@botpress/webchat 4.4.3 → 4.4.5

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(re,k){typeof exports=="object"&&typeof module<"u"?k(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],k):(re=typeof globalThis<"u"?globalThis:re||self,k(re.Webchat={},re.ReactJsxRuntime,re.React,re.ReactDOM))})(this,function(re,k,D,zu){"use strict";var Vv,Wv,qv;var rs=typeof document<"u"?document.currentScript:null;function Uu(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 A=Uu(D),ju=Uu(zu);function Jv(e,t=[]){let n=[];function r(o,s){const a=A.createContext(s);a.displayName=o+"Context";const l=n.length;n=[...n,s];const u=c=>{var y;const{scope:h,children:d,...m}=c,p=((y=h==null?void 0:h[e])==null?void 0:y[l])||a,g=A.useMemo(()=>m,Object.values(m));return k.jsx(p.Provider,{value:g,children:d})};u.displayName=o+"Provider";function f(c,h){var p;const d=((p=h==null?void 0:h[e])==null?void 0:p[l])||a,m=A.useContext(d);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${c}\` must be used within \`${o}\``)}return[u,f]}const i=()=>{const o=n.map(s=>A.createContext(s));return function(a){const l=(a==null?void 0:a[e])||o;return A.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,Xv(i,...t)]}function Xv(...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(o){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const c=l(o)[`__scope${u}`];return{...a,...c}},{});return A.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Ln(e){const t=A.useRef(e);return A.useEffect(()=>{t.current=e}),A.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var en=globalThis!=null&&globalThis.document?A.useLayoutEffect:()=>{};function Hu(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function is(...e){return t=>{let n=!1;const r=e.map(i=>{const o=Hu(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():Hu(e[i],null)}}}}function tn(...e){return A.useCallback(is(...e),e)}var eb=Symbol.for("react.lazy"),bi=A[" use ".trim().toString()];function tb(e){return typeof e=="object"&&e!==null&&"then"in e}function Vu(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===eb&&"_payload"in e&&tb(e._payload)}function nb(e){const t=rb(e),n=A.forwardRef((r,i)=>{let{children:o,...s}=r;Vu(o)&&typeof bi=="function"&&(o=bi(o._payload));const a=A.Children.toArray(o),l=a.find(ob);if(l){const u=l.props.children,f=a.map(c=>c===l?A.Children.count(u)>1?A.Children.only(null):A.isValidElement(u)?u.props.children:null:c);return k.jsx(t,{...s,ref:i,children:A.isValidElement(u)?A.cloneElement(u,void 0,f):null})}return k.jsx(t,{...s,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function rb(e){const t=A.forwardRef((n,r)=>{let{children:i,...o}=n;if(Vu(i)&&typeof bi=="function"&&(i=bi(i._payload)),A.isValidElement(i)){const s=ab(i),a=sb(o,i.props);return i.type!==A.Fragment&&(a.ref=r?is(r,s):s),A.cloneElement(i,a)}return A.Children.count(i)>1?A.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ib=Symbol("radix.slottable");function ob(e){return A.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ib}function sb(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{const l=o(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function ab(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var lb=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],os=lb.reduce((e,t)=>{const n=nb(`Primitive.${t}`),r=A.forwardRef((i,o)=>{const{asChild:s,...a}=i,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),k.jsx(l,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),yn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ss={exports:{}},as={};/**
1
+ (function(re,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],x):(re=typeof globalThis<"u"?globalThis:re||self,x(re.Webchat={},re.ReactJsxRuntime,re.React,re.ReactDOM))})(this,function(re,x,M,Fu){"use strict";var ts=typeof document<"u"?document.currentScript:null;function Ru(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 C=Ru(M),$u=Ru(Fu);function Hv(e,t=[]){let n=[];function r(o,s){const a=C.createContext(s);a.displayName=o+"Context";const l=n.length;n=[...n,s];const u=c=>{var v;const{scope:h,children:d,...m}=c,p=((v=h==null?void 0:h[e])==null?void 0:v[l])||a,g=C.useMemo(()=>m,Object.values(m));return x.jsx(p.Provider,{value:g,children:d})};u.displayName=o+"Provider";function f(c,h){var p;const d=((p=h==null?void 0:h[e])==null?void 0:p[l])||a,m=C.useContext(d);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${c}\` must be used within \`${o}\``)}return[u,f]}const i=()=>{const o=n.map(s=>C.createContext(s));return function(a){const l=(a==null?void 0:a[e])||o;return C.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,jv(i,...t)]}function jv(...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(o){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const c=l(o)[`__scope${u}`];return{...a,...c}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Ln(e){const t=C.useRef(e);return C.useEffect(()=>{t.current=e}),C.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var en=globalThis!=null&&globalThis.document?C.useLayoutEffect:()=>{};function Bu(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ns(...e){return t=>{let n=!1;const r=e.map(i=>{const o=Bu(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():Bu(e[i],null)}}}}function tn(...e){return C.useCallback(ns(...e),e)}var Vv=Symbol.for("react.lazy"),bi=C[" use ".trim().toString()];function Wv(e){return typeof e=="object"&&e!==null&&"then"in e}function zu(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Vv&&"_payload"in e&&Wv(e._payload)}function qv(e){const t=Yv(e),n=C.forwardRef((r,i)=>{let{children:o,...s}=r;zu(o)&&typeof bi=="function"&&(o=bi(o._payload));const a=C.Children.toArray(o),l=a.find(Gv);if(l){const u=l.props.children,f=a.map(c=>c===l?C.Children.count(u)>1?C.Children.only(null):C.isValidElement(u)?u.props.children:null:c);return x.jsx(t,{...s,ref:i,children:C.isValidElement(u)?C.cloneElement(u,void 0,f):null})}return x.jsx(t,{...s,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function Yv(e){const t=C.forwardRef((n,r)=>{let{children:i,...o}=n;if(zu(i)&&typeof bi=="function"&&(i=bi(i._payload)),C.isValidElement(i)){const s=Zv(i),a=Qv(o,i.props);return i.type!==C.Fragment&&(a.ref=r?ns(r,s):s),C.cloneElement(i,a)}return C.Children.count(i)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Kv=Symbol("radix.slottable");function Gv(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Kv}function Qv(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{const l=o(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function Zv(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Jv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],rs=Jv.reduce((e,t)=>{const n=qv(`Primitive.${t}`),r=C.forwardRef((i,o)=>{const{asChild:s,...a}=i,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(l,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),yn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var is={exports:{}},os={};/**
2
2
  * @license React
3
3
  * use-sync-external-store-shim.production.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 Wu;function ub(){if(Wu)return as;Wu=1;var e=D;function t(c,h){return c===h&&(c!==0||1/c===1/h)||c!==c&&h!==h}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function a(c,h){var d=h(),m=r({inst:{value:d,getSnapshot:h}}),p=m[0].inst,g=m[1];return o(function(){p.value=d,p.getSnapshot=h,l(p)&&g({inst:p})},[c,d,h]),i(function(){return l(p)&&g({inst:p}),c(function(){l(p)&&g({inst:p})})},[c]),s(d),d}function l(c){var h=c.getSnapshot;c=c.value;try{var d=h();return!n(c,d)}catch{return!0}}function u(c,h){return h()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return as.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,as}var ls={};/**
9
+ */var Uu;function Xv(){if(Uu)return os;Uu=1;var e=M;function t(c,h){return c===h&&(c!==0||1/c===1/h)||c!==c&&h!==h}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function a(c,h){var d=h(),m=r({inst:{value:d,getSnapshot:h}}),p=m[0].inst,g=m[1];return o(function(){p.value=d,p.getSnapshot=h,l(p)&&g({inst:p})},[c,d,h]),i(function(){return l(p)&&g({inst:p}),c(function(){l(p)&&g({inst:p})})},[c]),s(d),d}function l(c){var h=c.getSnapshot;c=c.value;try{var d=h();return!n(c,d)}catch{return!0}}function u(c,h){return h()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return os.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,os}var ss={};/**
10
10
  * @license React
11
11
  * use-sync-external-store-shim.development.js
12
12
  *
@@ -14,239 +14,239 @@
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 qu;function cb(){return qu||(qu=1,process.env.NODE_ENV!=="production"&&function(){function e(d,m){return d===m&&(d!==0||1/d===1/m)||d!==d&&m!==m}function t(d,m){f||i.startTransition===void 0||(f=!0,console.error("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 p=m();if(!c){var g=m();o(p,g)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}g=s({inst:{value:p,getSnapshot:m}});var y=g[0].inst,v=g[1];return l(function(){y.value=p,y.getSnapshot=m,n(y)&&v({inst:y})},[d,p,m]),a(function(){return n(y)&&v({inst:y}),d(function(){n(y)&&v({inst:y})})},[d]),u(p),p}function n(d){var m=d.getSnapshot;d=d.value;try{var p=m();return!o(d,p)}catch{return!0}}function r(d,m){return m()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var i=D,o=typeof Object.is=="function"?Object.is:e,s=i.useState,a=i.useEffect,l=i.useLayoutEffect,u=i.useDebugValue,f=!1,c=!1,h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;ls.useSyncExternalStore=i.useSyncExternalStore!==void 0?i.useSyncExternalStore:h,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),ls}process.env.NODE_ENV==="production"?ss.exports=ub():ss.exports=cb();var us=ss.exports;function fb(){return us.useSyncExternalStore(db,()=>!0,()=>!1)}function db(){return()=>{}}var cs="Avatar",[hb]=Jv(cs),[pb,Yu]=hb(cs),fs=A.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,o]=A.useState("idle");return k.jsx(pb,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:o,children:k.jsx(os.span,{...r,ref:t})})});fs.displayName=cs;var Ku="AvatarImage",ds=A.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...o}=e,s=Yu(Ku,n),a=mb(r,o),l=Ln(u=>{i(u),s.onImageLoadingStatusChange(u)});return en(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?k.jsx(os.img,{...o,ref:t,src:r}):null});ds.displayName=Ku;var Gu="AvatarFallback",hs=A.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,o=Yu(Gu,n),[s,a]=A.useState(r===void 0);return A.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(l)}},[r]),s&&o.imageLoadingStatus!=="loaded"?k.jsx(os.span,{...i,ref:t}):null});hs.displayName=Gu;function Qu(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function mb(e,{referrerPolicy:t,crossOrigin:n}){const r=fb(),i=A.useRef(null),o=r?(i.current||(i.current=new window.Image),i.current):null,[s,a]=A.useState(()=>Qu(o,e));return en(()=>{a(Qu(o,e))},[o,e]),en(()=>{const l=c=>()=>{a(c)};if(!o)return;const u=l("loaded"),f=l("error");return o.addEventListener("load",u),o.addEventListener("error",f),t&&(o.referrerPolicy=t),typeof n=="string"&&(o.crossOrigin=n),()=>{o.removeEventListener("load",u),o.removeEventListener("error",f)}},[o,n,t]),s}function Zu(e,t){let n=`${e} {`;for(const[r,i]of Object.entries(t))n+=`${r}: ${i}; `;return n+="}",n}function Ju(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 gb=(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 o=new Image;o.addEventListener("load",()=>{i&&clearTimeout(i),n({width:o.naturalWidth,height:o.naturalHeight})}),o.addEventListener("error",s=>{i&&clearTimeout(i),r(`${s.type}: ${s.message}`)}),o.src=e,t.timeout&&(i=setTimeout(()=>r("Timeout"),t.timeout))});var Xu={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(yn,function(){var n=1e3,r=6e4,i=36e5,o="millisecond",s="second",a="minute",l="hour",u="day",f="week",c="month",h="quarter",d="year",m="date",p="Invalid Date",g=/^(\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,v={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(L){var R=["th","st","nd","rd"],N=L%100;return"["+L+(R[(N-20)%10]||R[N]||R[0])+"]"}},w=function(L,R,N){var j=String(L);return!j||j.length>=R?L:""+Array(R+1-j.length).join(N)+L},E={s:w,z:function(L){var R=-L.utcOffset(),N=Math.abs(R),j=Math.floor(N/60),B=N%60;return(R<=0?"+":"-")+w(j,2,"0")+":"+w(B,2,"0")},m:function L(R,N){if(R.date()<N.date())return-L(N,R);var j=12*(N.year()-R.year())+(N.month()-R.month()),B=R.clone().add(j,c),W=N-B<0,b=R.clone().add(j+(W?-1:1),c);return+(-(j+(N-B)/(W?B-b:b-B))||0)},a:function(L){return L<0?Math.ceil(L)||0:Math.floor(L)},p:function(L){return{M:c,y:d,w:f,d:u,D:m,h:l,m:a,s,ms:o,Q:h}[L]||String(L||"").toLowerCase().replace(/s$/,"")},u:function(L){return L===void 0}},S="en",C={};C[S]=v;var I="$isDayjsObject",M=function(L){return L instanceof U||!(!L||!L[I])},P=function L(R,N,j){var B;if(!R)return S;if(typeof R=="string"){var W=R.toLowerCase();C[W]&&(B=W),N&&(C[W]=N,B=W);var b=R.split("-");if(!B&&b.length>1)return L(b[0])}else{var _=R.name;C[_]=R,B=_}return!j&&B&&(S=B),B||!j&&S},T=function(L,R){if(M(L))return L.clone();var N=typeof R=="object"?R:{};return N.date=L,N.args=arguments,new U(N)},O=E;O.l=P,O.i=M,O.w=function(L,R){return T(L,{locale:R.$L,utc:R.$u,x:R.$x,$offset:R.$offset})};var U=function(){function L(N){this.$L=P(N.locale,null,!0),this.parse(N),this.$x=this.$x||N.x||{},this[I]=!0}var R=L.prototype;return R.parse=function(N){this.$d=function(j){var B=j.date,W=j.utc;if(B===null)return new Date(NaN);if(O.u(B))return new Date;if(B instanceof Date)return new Date(B);if(typeof B=="string"&&!/Z$/i.test(B)){var b=B.match(g);if(b){var _=b[2]-1||0,H=(b[7]||"0").substring(0,3);return W?new Date(Date.UTC(b[1],_,b[3]||1,b[4]||0,b[5]||0,b[6]||0,H)):new Date(b[1],_,b[3]||1,b[4]||0,b[5]||0,b[6]||0,H)}}return new Date(B)}(N),this.init()},R.init=function(){var N=this.$d;this.$y=N.getFullYear(),this.$M=N.getMonth(),this.$D=N.getDate(),this.$W=N.getDay(),this.$H=N.getHours(),this.$m=N.getMinutes(),this.$s=N.getSeconds(),this.$ms=N.getMilliseconds()},R.$utils=function(){return O},R.isValid=function(){return this.$d.toString()!==p},R.isSame=function(N,j){var B=T(N);return this.startOf(j)<=B&&B<=this.endOf(j)},R.isAfter=function(N,j){return T(N)<this.startOf(j)},R.isBefore=function(N,j){return this.endOf(j)<T(N)},R.$g=function(N,j,B){return O.u(N)?this[j]:this.set(B,N)},R.unix=function(){return Math.floor(this.valueOf()/1e3)},R.valueOf=function(){return this.$d.getTime()},R.startOf=function(N,j){var B=this,W=!!O.u(j)||j,b=O.p(N),_=function(se,G){var te=O.w(B.$u?Date.UTC(B.$y,G,se):new Date(B.$y,G,se),B);return W?te:te.endOf(u)},H=function(se,G){return O.w(B.toDate()[se].apply(B.toDate("s"),(W?[0,0,0,0]:[23,59,59,999]).slice(G)),B)},x=this.$W,V=this.$M,Y=this.$D,q="set"+(this.$u?"UTC":"");switch(b){case d:return W?_(1,0):_(31,11);case c:return W?_(1,V):_(0,V+1);case f:var Q=this.$locale().weekStart||0,X=(x<Q?x+7:x)-Q;return _(W?Y-X:Y+(6-X),V);case u:case m:return H(q+"Hours",0);case l:return H(q+"Minutes",1);case a:return H(q+"Seconds",2);case s:return H(q+"Milliseconds",3);default:return this.clone()}},R.endOf=function(N){return this.startOf(N,!1)},R.$set=function(N,j){var B,W=O.p(N),b="set"+(this.$u?"UTC":""),_=(B={},B[u]=b+"Date",B[m]=b+"Date",B[c]=b+"Month",B[d]=b+"FullYear",B[l]=b+"Hours",B[a]=b+"Minutes",B[s]=b+"Seconds",B[o]=b+"Milliseconds",B)[W],H=W===u?this.$D+(j-this.$W):j;if(W===c||W===d){var x=this.clone().set(m,1);x.$d[_](H),x.init(),this.$d=x.set(m,Math.min(this.$D,x.daysInMonth())).$d}else _&&this.$d[_](H);return this.init(),this},R.set=function(N,j){return this.clone().$set(N,j)},R.get=function(N){return this[O.p(N)]()},R.add=function(N,j){var B,W=this;N=Number(N);var b=O.p(j),_=function(V){var Y=T(W);return O.w(Y.date(Y.date()+Math.round(V*N)),W)};if(b===c)return this.set(c,this.$M+N);if(b===d)return this.set(d,this.$y+N);if(b===u)return _(1);if(b===f)return _(7);var H=(B={},B[a]=r,B[l]=i,B[s]=n,B)[b]||1,x=this.$d.getTime()+N*H;return O.w(x,this)},R.subtract=function(N,j){return this.add(-1*N,j)},R.format=function(N){var j=this,B=this.$locale();if(!this.isValid())return B.invalidDate||p;var W=N||"YYYY-MM-DDTHH:mm:ssZ",b=O.z(this),_=this.$H,H=this.$m,x=this.$M,V=B.weekdays,Y=B.months,q=B.meridiem,Q=function(G,te,$,ne){return G&&(G[te]||G(j,W))||$[te].slice(0,ne)},X=function(G){return O.s(_%12||12,G,"0")},se=q||function(G,te,$){var ne=G<12?"AM":"PM";return $?ne.toLowerCase():ne};return W.replace(y,function(G,te){return te||function($){switch($){case"YY":return String(j.$y).slice(-2);case"YYYY":return O.s(j.$y,4,"0");case"M":return x+1;case"MM":return O.s(x+1,2,"0");case"MMM":return Q(B.monthsShort,x,Y,3);case"MMMM":return Q(Y,x);case"D":return j.$D;case"DD":return O.s(j.$D,2,"0");case"d":return String(j.$W);case"dd":return Q(B.weekdaysMin,j.$W,V,2);case"ddd":return Q(B.weekdaysShort,j.$W,V,3);case"dddd":return V[j.$W];case"H":return String(_);case"HH":return O.s(_,2,"0");case"h":return X(1);case"hh":return X(2);case"a":return se(_,H,!0);case"A":return se(_,H,!1);case"m":return String(H);case"mm":return O.s(H,2,"0");case"s":return String(j.$s);case"ss":return O.s(j.$s,2,"0");case"SSS":return O.s(j.$ms,3,"0");case"Z":return b}return null}(G)||b.replace(":","")})},R.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},R.diff=function(N,j,B){var W,b=this,_=O.p(j),H=T(N),x=(H.utcOffset()-this.utcOffset())*r,V=this-H,Y=function(){return O.m(b,H)};switch(_){case d:W=Y()/12;break;case c:W=Y();break;case h:W=Y()/3;break;case f:W=(V-x)/6048e5;break;case u:W=(V-x)/864e5;break;case l:W=V/i;break;case a:W=V/r;break;case s:W=V/n;break;default:W=V}return B?W:O.a(W)},R.daysInMonth=function(){return this.endOf(c).$D},R.$locale=function(){return C[this.$L]},R.locale=function(N,j){if(!N)return this.$L;var B=this.clone(),W=P(N,j,!0);return W&&(B.$L=W),B},R.clone=function(){return O.w(this.$d,this)},R.toDate=function(){return new Date(this.valueOf())},R.toJSON=function(){return this.isValid()?this.toISOString():null},R.toISOString=function(){return this.$d.toISOString()},R.toString=function(){return this.$d.toUTCString()},L}(),F=U.prototype;return T.prototype=F,[["$ms",o],["$s",s],["$m",a],["$H",l],["$W",u],["$M",c],["$y",d],["$D",m]].forEach(function(L){F[L[1]]=function(R){return this.$g(R,L[0],L[1])}}),T.extend=function(L,R){return L.$i||(L(R,U,T),L.$i=!0),T},T.locale=P,T.isDayjs=M,T.unix=function(L){return T(1e3*L)},T.en=C[S],T.Ls=C,T.p={},T})})(Xu);var yb=Xu.exports;const wi=vn(yb);var ec={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(yn,function(){return function(n,r,i){r.prototype.isToday=function(){var o="YYYY-MM-DD",s=i();return this.format(o)===s.format(o)}}})})(ec);var vb=ec.exports;const bb=vn(vb);var tc={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(yn,function(){return function(n,r,i){r.prototype.isYesterday=function(){var o="YYYY-MM-DD",s=i().subtract(1,"day");return this.format(o)===s.format(o)}}})})(tc);var wb=tc.exports;const Sb=vn(wb);wi.extend(bb),wi.extend(Sb);function nc(e,t,n,r,i){return e.map(o=>{const{authorId:s}=o,a=s===n?"outgoing":"incoming",l=t.find(f=>f.id===s);let u;return l&&l.id===n?u={name:l.name||"You",avatar:l.pictureUrl}:l?u={name:l.name||"Agent",avatar:l.pictureUrl}:u={name:r||"Bot",avatar:i},{...o,direction:a,sender:u}})}function xb(e,t="day"){var r,i,o;if(!e||e.length===0)return[];const n=[];(r=e[0])!=null&&r.timestamp&&n.push(rc(e[0].timestamp));for(let s=0;s<e.length;s++)if(e[s]&&n.push(e[s]),s+1<e.length){const a=(i=e[s])==null?void 0:i.timestamp,l=(o=e[s+1])==null?void 0:o.timestamp;!wi(a).isSame(l,t)&&l&&n.push(rc(l))}return n}function rc(e){return{id:ic(e),direction:"system",sender:{name:"system"},timestamp:e,block:{type:"text",text:ic(e)}}}function ic(e,t=!1){const n=wi(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")}function kb(e=""){if(typeof e!="string")throw new TypeError("Color should be string!");const t=/^#?([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i.exec(e);if(t)return t.splice(1).map(r=>Number.parseInt(r,16));const n=/^#?([\da-f])([\da-f])([\da-f])$/i.exec(e);if(n)return n.splice(1).map(r=>Number.parseInt(r+r,16));if(e.includes(","))return e.split(",").map(r=>Number.parseInt(r));throw new Error("Invalid color format! Use #ABC or #AABBCC or r,g,b")}function Eb(e){return"#"+e.map(t=>`0${t.toString(16).toUpperCase()}`.slice(-2)).join("")}function Cb(e,t){return e.map(n=>Math.round(n+(255-n)*t))}function Ab(e,t){return e.map(n=>Math.round(n*t))}const br=e=>t=>Cb(t,e),wr=e=>t=>Ab(t,e),Tb={50:br(.95),100:br(.9),200:br(.75),300:br(.6),400:br(.3),500:e=>e,600:wr(.9),700:wr(.6),800:wr(.45),900:wr(.3),950:wr(.2)};function oc(e,t=Tb){const n={},r=kb(e);for(const[i,o]of Object.entries(t))n[i]=Eb(o(r));return n}const sc=()=>{const e={};return{on:(i,o)=>{var s;return e[i]||(e[i]=new Set),(s=e[i])==null||s.add(o),()=>{var a;return(a=e[i])==null?void 0:a.delete(o)}},emit:(i,o)=>{var s,a;(s=e[i])==null||s.forEach(l=>l(o)),(a=e["*"])==null||a.forEach(l=>l({type:i,payload:o}))},removeAllListeners:i=>{var o;i?(o=e[i])==null||o.clear():Object.keys(e).forEach(s=>{var a;(a=e[s])==null||a.clear()})}}};class bn extends Error{}class Ib extends bn{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class Ob extends bn{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class Mb extends bn{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class Sr extends bn{}class ac extends bn{constructor(t){super(`Invalid unit ${t}`)}}class vt extends bn{}class nn extends bn{constructor(){super("Zone is an abstract class")}}const ie="numeric",At="short",ht="long",ps={year:ie,month:ie,day:ie},lc={year:ie,month:At,day:ie},Db={year:ie,month:At,day:ie,weekday:At},uc={year:ie,month:ht,day:ie},cc={year:ie,month:ht,day:ie,weekday:ht},fc={hour:ie,minute:ie},dc={hour:ie,minute:ie,second:ie},hc={hour:ie,minute:ie,second:ie,timeZoneName:At},pc={hour:ie,minute:ie,second:ie,timeZoneName:ht},mc={hour:ie,minute:ie,hourCycle:"h23"},gc={hour:ie,minute:ie,second:ie,hourCycle:"h23"},yc={hour:ie,minute:ie,second:ie,hourCycle:"h23",timeZoneName:At},vc={hour:ie,minute:ie,second:ie,hourCycle:"h23",timeZoneName:ht},bc={year:ie,month:ie,day:ie,hour:ie,minute:ie},wc={year:ie,month:ie,day:ie,hour:ie,minute:ie,second:ie},Sc={year:ie,month:At,day:ie,hour:ie,minute:ie},xc={year:ie,month:At,day:ie,hour:ie,minute:ie,second:ie},Nb={year:ie,month:At,day:ie,weekday:At,hour:ie,minute:ie},kc={year:ie,month:ht,day:ie,hour:ie,minute:ie,timeZoneName:At},Ec={year:ie,month:ht,day:ie,hour:ie,minute:ie,second:ie,timeZoneName:At},Cc={year:ie,month:ht,day:ie,weekday:ht,hour:ie,minute:ie,timeZoneName:ht},Ac={year:ie,month:ht,day:ie,weekday:ht,hour:ie,minute:ie,second:ie,timeZoneName:ht};function xe(e){return typeof e>"u"}function wn(e){return typeof e=="number"}function Si(e){return typeof e=="number"&&e%1===0}function _b(e){return typeof e=="string"}function Pb(e){return Object.prototype.toString.call(e)==="[object Date]"}function Tc(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Lb(e){return Array.isArray(e)?e:[e]}function Ic(e,t,n){if(e.length!==0)return e.reduce((r,i)=>{const o=[t(i),i];return r&&n(r[0],o[0])===r[0]?r:o},null)[1]}function Fb(e,t){return t.reduce((n,r)=>(n[r]=e[r],n),{})}function Fn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function qt(e,t,n){return Si(e)&&e>=t&&e<=n}function Rb(e,t){return e-t*Math.floor(e/t)}function Ve(e,t=2){const n=e<0;let r;return n?r="-"+(""+-e).padStart(t,"0"):r=(""+e).padStart(t,"0"),r}function rn(e){if(!(xe(e)||e===null||e===""))return parseInt(e,10)}function Sn(e){if(!(xe(e)||e===null||e===""))return parseFloat(e)}function ms(e){if(!(xe(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function gs(e,t,n=!1){const r=10**t;return(n?Math.trunc:Math.round)(e*r)/r}function xr(e){return e%4===0&&(e%100!==0||e%400===0)}function kr(e){return xr(e)?366:365}function xi(e,t){const n=Rb(t-1,12)+1,r=e+(t-n)/12;return n===2?xr(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function ys(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(t.getUTCFullYear()-1900)),+t}function ki(e){const t=(e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))%7,n=e-1,r=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7;return t===4||r===3?53:52}function vs(e){return e>99?e:e>60?1900+e:2e3+e}function Oc(e,t,n,r=null){const i=new Date(e),o={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(o.timeZone=r);const s={timeZoneName:t,...o},a=new Intl.DateTimeFormat(n,s).formatToParts(i).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function Ei(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0,i=n<0||Object.is(n,-0)?-r:r;return n*60+i}function Mc(e){const t=Number(e);if(typeof e=="boolean"||e===""||Number.isNaN(t))throw new vt(`Invalid unit value ${e}`);return t}function Ci(e,t){const n={};for(const r in e)if(Fn(e,r)){const i=e[r];if(i==null)continue;n[t(r)]=Mc(i)}return n}function Er(e,t){const n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),i=e>=0?"+":"-";switch(t){case"short":return`${i}${Ve(n,2)}:${Ve(r,2)}`;case"narrow":return`${i}${n}${r>0?`:${r}`:""}`;case"techie":return`${i}${Ve(n,2)}${Ve(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function Ai(e){return Fb(e,["hour","minute","second","millisecond"])}const Dc=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,$b=["January","February","March","April","May","June","July","August","September","October","November","December"],Nc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Bb=["J","F","M","A","M","J","J","A","S","O","N","D"];function _c(e){switch(e){case"narrow":return[...Bb];case"short":return[...Nc];case"long":return[...$b];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const Pc=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Lc=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],zb=["M","T","W","T","F","S","S"];function Fc(e){switch(e){case"narrow":return[...zb];case"short":return[...Lc];case"long":return[...Pc];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Rc=["AM","PM"],Ub=["Before Christ","Anno Domini"],jb=["BC","AD"],Hb=["B","A"];function $c(e){switch(e){case"narrow":return[...Hb];case"short":return[...jb];case"long":return[...Ub];default:return null}}function Vb(e){return Rc[e.hour<12?0:1]}function Wb(e,t){return Fc(t)[e.weekday-1]}function qb(e,t){return _c(t)[e.month-1]}function Yb(e,t){return $c(t)[e.year<0?0:1]}function Kb(e,t,n="always",r=!1){const i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},o=["hours","minutes","seconds"].indexOf(e)===-1;if(n==="auto"&&o){const c=e==="days";switch(t){case 1:return c?"tomorrow":`next ${i[e][0]}`;case-1:return c?"yesterday":`last ${i[e][0]}`;case 0:return c?"today":`this ${i[e][0]}`}}const s=Object.is(t,-0)||t<0,a=Math.abs(t),l=a===1,u=i[e],f=r?l?u[1]:u[2]||u[1]:l?i[e][0]:e;return s?`${a} ${f} ago`:`in ${a} ${f}`}function Bc(e,t){let n="";for(const r of e)r.literal?n+=r.val:n+=t(r.val);return n}const Gb={D:ps,DD:lc,DDD:uc,DDDD:cc,t:fc,tt:dc,ttt:hc,tttt:pc,T:mc,TT:gc,TTT:yc,TTTT:vc,f:bc,ff:Sc,fff:kc,ffff:Cc,F:wc,FF:xc,FFF:Ec,FFFF:Ac};class lt{static create(t,n={}){return new lt(t,n)}static parseFormat(t){let n=null,r="",i=!1;const o=[];for(let s=0;s<t.length;s++){const a=t.charAt(s);a==="'"?(r.length>0&&o.push({literal:i,val:r}),n=null,r="",i=!i):i||a===n?r+=a:(r.length>0&&o.push({literal:!1,val:r}),r=a,n=a)}return r.length>0&&o.push({literal:i,val:r}),o}static macroTokenToFormatOpts(t){return Gb[t]}constructor(t,n){this.opts=n,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...n}).format()}formatDateTime(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n}).format()}formatDateTimeParts(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n}).formatToParts()}resolvedOptions(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n}).resolvedOptions()}num(t,n=0){if(this.opts.forceSimple)return Ve(t,n);const r={...this.opts};return n>0&&(r.padTo=n),this.loc.numberFormatter(r).format(t)}formatDateTimeFromString(t,n){const r=this.loc.listingMode()==="en",i=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",o=(d,m)=>this.loc.extract(t,d,m),s=d=>t.isOffsetFixed&&t.offset===0&&d.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,d.format):"",a=()=>r?Vb(t):o({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(d,m)=>r?qb(t,d):o(m?{month:d}:{month:d,day:"numeric"},"month"),u=(d,m)=>r?Wb(t,d):o(m?{weekday:d}:{weekday:d,month:"long",day:"numeric"},"weekday"),f=d=>{const m=lt.macroTokenToFormatOpts(d);return m?this.formatWithSystemDefault(t,m):d},c=d=>r?Yb(t,d):o({era:d},"era"),h=d=>{switch(d){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return s({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return s({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return s({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return a();case"d":return i?o({day:"numeric"},"day"):this.num(t.day);case"dd":return i?o({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return i?o({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return i?o({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return l("short",!0);case"LLLL":return l("long",!0);case"LLLLL":return l("narrow",!0);case"M":return i?o({month:"numeric"},"month"):this.num(t.month);case"MM":return i?o({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return l("short",!1);case"MMMM":return l("long",!1);case"MMMMM":return l("narrow",!1);case"y":return i?o({year:"numeric"},"year"):this.num(t.year);case"yy":return i?o({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return i?o({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return i?o({year:"numeric"},"year"):this.num(t.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return f(d)}};return Bc(lt.parseFormat(n),h)}formatDurationFromString(t,n){const r=l=>{switch(l[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},i=l=>u=>{const f=r(u);return f?this.num(l.get(f),u.length):u},o=lt.parseFormat(n),s=o.reduce((l,{literal:u,val:f})=>u?l:l.concat(f),[]),a=t.shiftTo(...s.map(r).filter(l=>l));return Bc(o,i(a))}}class Tt{constructor(t,n){this.reason=t,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class Cr{get type(){throw new nn}get name(){throw new nn}get ianaName(){return this.name}get isUniversal(){throw new nn}offsetName(t,n){throw new nn}formatOffset(t,n){throw new nn}offset(t){throw new nn}equals(t){throw new nn}get isValid(){throw new nn}}let bs=null;class ws extends Cr{static get instance(){return bs===null&&(bs=new ws),bs}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return Oc(t,n,r)}formatOffset(t,n){return Er(this.offset(t),n)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}let Ti={};function Qb(e){return Ti[e]||(Ti[e]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),Ti[e]}const Zb={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Jb(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,i,o,s,a,l,u,f]=r;return[s,i,o,a,l,u,f]}function Xb(e,t){const n=e.formatToParts(t),r=[];for(let i=0;i<n.length;i++){const{type:o,value:s}=n[i],a=Zb[o];o==="era"?r[a]=s:xe(a)||(r[a]=parseInt(s,10))}return r}let Ii={};class Yt extends Cr{static create(t){return Ii[t]||(Ii[t]=new Yt(t)),Ii[t]}static resetCache(){Ii={},Ti={}}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=Yt.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return Oc(t,n,r,this.name)}formatOffset(t,n){return Er(this.offset(t),n)}offset(t){const n=new Date(t);if(isNaN(n))return NaN;const r=Qb(this.name);let[i,o,s,a,l,u,f]=r.formatToParts?Xb(r,n):Jb(r,n);a==="BC"&&(i=-Math.abs(i)+1);const h=ys({year:i,month:o,day:s,hour:l===24?0:l,minute:u,second:f,millisecond:0});let d=+n;const m=d%1e3;return d-=m>=0?m:1e3+m,(h-d)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let Ss=null;class it extends Cr{static get utcInstance(){return Ss===null&&(Ss=new it(0)),Ss}static instance(t){return t===0?it.utcInstance:new it(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new it(Ei(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Er(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Er(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return Er(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}class e0 extends Cr{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function on(e,t){if(xe(e)||e===null)return t;if(e instanceof Cr)return e;if(_b(e)){const n=e.toLowerCase();return n==="local"||n==="system"?t:n==="utc"||n==="gmt"?it.utcInstance:it.parseSpecifier(n)||Yt.create(e)}else return wn(e)?it.instance(e):typeof e=="object"&&e.offset&&typeof e.offset=="number"?e:new e0(e)}let zc=()=>Date.now(),Uc="system",jc=null,Hc=null,Vc=null,Wc;class qe{static get now(){return zc}static set now(t){zc=t}static set defaultZone(t){Uc=t}static get defaultZone(){return on(Uc,ws.instance)}static get defaultLocale(){return jc}static set defaultLocale(t){jc=t}static get defaultNumberingSystem(){return Hc}static set defaultNumberingSystem(t){Hc=t}static get defaultOutputCalendar(){return Vc}static set defaultOutputCalendar(t){Vc=t}static get throwOnInvalid(){return Wc}static set throwOnInvalid(t){Wc=t}static resetCaches(){Re.resetCache(),Yt.resetCache()}}let qc={};function t0(e,t={}){const n=JSON.stringify([e,t]);let r=qc[n];return r||(r=new Intl.ListFormat(e,t),qc[n]=r),r}let xs={};function ks(e,t={}){const n=JSON.stringify([e,t]);let r=xs[n];return r||(r=new Intl.DateTimeFormat(e,t),xs[n]=r),r}let Es={};function n0(e,t={}){const n=JSON.stringify([e,t]);let r=Es[n];return r||(r=new Intl.NumberFormat(e,t),Es[n]=r),r}let Cs={};function r0(e,t={}){const{base:n,...r}=t,i=JSON.stringify([e,r]);let o=Cs[i];return o||(o=new Intl.RelativeTimeFormat(e,t),Cs[i]=o),o}let Ar=null;function i0(){return Ar||(Ar=new Intl.DateTimeFormat().resolvedOptions().locale,Ar)}function o0(e){const t=e.indexOf("-u-");if(t===-1)return[e];{let n;const r=e.substring(0,t);try{n=ks(e).resolvedOptions()}catch{n=ks(r).resolvedOptions()}const{numberingSystem:i,calendar:o}=n;return[r,i,o]}}function s0(e,t,n){return(n||t)&&(e+="-u",n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`)),e}function a0(e){const t=[];for(let n=1;n<=12;n++){const r=pe.utc(2016,n,1);t.push(e(r))}return t}function l0(e){const t=[];for(let n=1;n<=7;n++){const r=pe.utc(2016,11,13+n);t.push(e(r))}return t}function Oi(e,t,n,r,i){const o=e.listingMode(n);return o==="error"?null:o==="en"?r(t):i(t)}function u0(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem==="latn"}class c0{constructor(t,n,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:i,floor:o,...s}=r;if(!n||Object.keys(s).length>0){const a={useGrouping:!1,...r};r.padTo>0&&(a.minimumIntegerDigits=r.padTo),this.inf=n0(t,a)}}format(t){if(this.inf){const n=this.floor?Math.floor(t):t;return this.inf.format(n)}else{const n=this.floor?Math.floor(t):gs(t,3);return Ve(n,this.padTo)}}}class f0{constructor(t,n,r){this.opts=r;let i;if(t.zone.isUniversal){const s=-1*(t.offset/60),a=s>=0?`Etc/GMT+${s}`:`Etc/GMT${s}`;t.offset!==0&&Yt.create(a).valid?(i=a,this.dt=t):(i="UTC",r.timeZoneName?this.dt=t:this.dt=t.offset===0?t:pe.fromMillis(t.ts+t.offset*60*1e3))}else t.zone.type==="system"?this.dt=t:(this.dt=t,i=t.zone.name);const o={...this.opts};i&&(o.timeZone=i),this.dtf=ks(n,o)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class d0{constructor(t,n,r){this.opts={style:"long",...r},!n&&Tc()&&(this.rtf=r0(t,r))}format(t,n){return this.rtf?this.rtf.format(t,n):Kb(n,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,n){return this.rtf?this.rtf.formatToParts(t,n):[]}}class Re{static fromOpts(t){return Re.create(t.locale,t.numberingSystem,t.outputCalendar,t.defaultToEN)}static create(t,n,r,i=!1){const o=t||qe.defaultLocale,s=o||(i?"en-US":i0()),a=n||qe.defaultNumberingSystem,l=r||qe.defaultOutputCalendar;return new Re(s,a,l,o)}static resetCache(){Ar=null,xs={},Es={},Cs={}}static fromObject({locale:t,numberingSystem:n,outputCalendar:r}={}){return Re.create(t,n,r)}constructor(t,n,r,i){const[o,s,a]=o0(t);this.locale=o,this.numberingSystem=n||s||null,this.outputCalendar=r||a||null,this.intl=s0(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=u0(this)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&n?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:Re.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,n=!1,r=!0){return Oi(this,t,r,_c,()=>{const i=n?{month:t,day:"numeric"}:{month:t},o=n?"format":"standalone";return this.monthsCache[o][t]||(this.monthsCache[o][t]=a0(s=>this.extract(s,i,"month"))),this.monthsCache[o][t]})}weekdays(t,n=!1,r=!0){return Oi(this,t,r,Fc,()=>{const i=n?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},o=n?"format":"standalone";return this.weekdaysCache[o][t]||(this.weekdaysCache[o][t]=l0(s=>this.extract(s,i,"weekday"))),this.weekdaysCache[o][t]})}meridiems(t=!0){return Oi(this,void 0,t,()=>Rc,()=>{if(!this.meridiemCache){const n={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[pe.utc(2016,11,13,9),pe.utc(2016,11,13,19)].map(r=>this.extract(r,n,"dayperiod"))}return this.meridiemCache})}eras(t,n=!0){return Oi(this,t,n,$c,()=>{const r={era:t};return this.eraCache[t]||(this.eraCache[t]=[pe.utc(-40,1,1),pe.utc(2017,1,1)].map(i=>this.extract(i,r,"era"))),this.eraCache[t]})}extract(t,n,r){const i=this.dtFormatter(t,n),o=i.formatToParts(),s=o.find(a=>a.type.toLowerCase()===r);return s?s.value:null}numberFormatter(t={}){return new c0(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,n={}){return new f0(t,this.intl,n)}relFormatter(t={}){return new d0(this.intl,this.isEnglish(),t)}listFormatter(t={}){return t0(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}}function Rn(...e){const t=e.reduce((n,r)=>n+r.source,"");return RegExp(`^${t}$`)}function $n(...e){return t=>e.reduce(([n,r,i],o)=>{const[s,a,l]=o(t,i);return[{...n,...s},a||r,l]},[{},null,1]).slice(0,2)}function Bn(e,...t){if(e==null)return[null,null];for(const[n,r]of t){const i=n.exec(e);if(i)return r(i)}return[null,null]}function Yc(...e){return(t,n)=>{const r={};let i;for(i=0;i<e.length;i++)r[e[i]]=rn(t[n+i]);return[r,null,n+i]}}const Kc=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,h0=`(?:${Kc.source}?(?:\\[(${Dc.source})\\])?)?`,As=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Gc=RegExp(`${As.source}${h0}`),Ts=RegExp(`(?:T${Gc.source})?`),p0=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,m0=/(\d{4})-?W(\d\d)(?:-?(\d))?/,g0=/(\d{4})-?(\d{3})/,y0=Yc("weekYear","weekNumber","weekDay"),v0=Yc("year","ordinal"),b0=/(\d{4})-(\d\d)-(\d\d)/,Qc=RegExp(`${As.source} ?(?:${Kc.source}|(${Dc.source}))?`),w0=RegExp(`(?: ${Qc.source})?`);function zn(e,t,n){const r=e[t];return xe(r)?n:rn(r)}function S0(e,t){return[{year:zn(e,t),month:zn(e,t+1,1),day:zn(e,t+2,1)},null,t+3]}function Un(e,t){return[{hours:zn(e,t,0),minutes:zn(e,t+1,0),seconds:zn(e,t+2,0),milliseconds:ms(e[t+3])},null,t+4]}function Tr(e,t){const n=!e[t]&&!e[t+1],r=Ei(e[t+1],e[t+2]),i=n?null:it.instance(r);return[{},i,t+3]}function Ir(e,t){const n=e[t]?Yt.create(e[t]):null;return[{},n,t+1]}const x0=RegExp(`^T?${As.source}$`),k0=/^-?P(?:(?:(-?\d{1,9}(?:\.\d{1,9})?)Y)?(?:(-?\d{1,9}(?:\.\d{1,9})?)M)?(?:(-?\d{1,9}(?:\.\d{1,9})?)W)?(?:(-?\d{1,9}(?:\.\d{1,9})?)D)?(?:T(?:(-?\d{1,9}(?:\.\d{1,9})?)H)?(?:(-?\d{1,9}(?:\.\d{1,9})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,9}))?S)?)?)$/;function E0(e){const[t,n,r,i,o,s,a,l,u]=e,f=t[0]==="-",c=l&&l[0]==="-",h=(d,m=!1)=>d!==void 0&&(m||d&&f)?-d:d;return[{years:h(Sn(n)),months:h(Sn(r)),weeks:h(Sn(i)),days:h(Sn(o)),hours:h(Sn(s)),minutes:h(Sn(a)),seconds:h(Sn(l),l==="-0"),milliseconds:h(ms(u),c)}]}const C0={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Is(e,t,n,r,i,o,s){const a={year:t.length===2?vs(rn(t)):rn(t),month:Nc.indexOf(n)+1,day:rn(r),hour:rn(i),minute:rn(o)};return s&&(a.second=rn(s)),e&&(a.weekday=e.length>3?Pc.indexOf(e)+1:Lc.indexOf(e)+1),a}const A0=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function T0(e){const[,t,n,r,i,o,s,a,l,u,f,c]=e,h=Is(t,i,r,n,o,s,a);let d;return l?d=C0[l]:u?d=0:d=Ei(f,c),[h,new it(d)]}function I0(e){return e.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const O0=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,M0=/^(Monday|Tuesday|Wedsday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,D0=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Zc(e){const[,t,n,r,i,o,s,a]=e;return[Is(t,i,r,n,o,s,a),it.utcInstance]}function N0(e){const[,t,n,r,i,o,s,a]=e;return[Is(t,a,n,r,i,o,s),it.utcInstance]}const _0=Rn(p0,Ts),P0=Rn(m0,Ts),L0=Rn(g0,Ts),F0=Rn(Gc),Jc=$n(S0,Un,Tr,Ir),R0=$n(y0,Un,Tr,Ir),$0=$n(v0,Un,Tr,Ir),B0=$n(Un,Tr,Ir);function z0(e){return Bn(e,[_0,Jc],[P0,R0],[L0,$0],[F0,B0])}function U0(e){return Bn(I0(e),[A0,T0])}function j0(e){return Bn(e,[O0,Zc],[M0,Zc],[D0,N0])}function H0(e){return Bn(e,[k0,E0])}const V0=$n(Un);function W0(e){return Bn(e,[x0,V0])}const q0=Rn(b0,w0),Y0=Rn(Qc),K0=$n(Un,Tr,Ir);function G0(e){return Bn(e,[q0,Jc],[Y0,K0])}const Q0="Invalid Duration",Xc={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Z0={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...Xc},bt=146097/400,jn=146097/4800,J0={years:{quarters:4,months:12,weeks:bt/7,days:bt,hours:bt*24,minutes:bt*24*60,seconds:bt*24*60*60,milliseconds:bt*24*60*60*1e3},quarters:{months:3,weeks:bt/28,days:bt/4,hours:bt*24/4,minutes:bt*24*60/4,seconds:bt*24*60*60/4,milliseconds:bt*24*60*60*1e3/4},months:{weeks:jn/7,days:jn,hours:jn*24,minutes:jn*24*60,seconds:jn*24*60*60,milliseconds:jn*24*60*60*1e3},...Xc},xn=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],X0=xn.slice(0).reverse();function kn(e,t,n=!1){const r={values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy};return new Ee(r)}function ew(e){return e<0?Math.floor(e):Math.ceil(e)}function ef(e,t,n,r,i){const o=e[i][n],s=t[n]/o,a=Math.sign(s)===Math.sign(r[i]),l=!a&&r[i]!==0&&Math.abs(s)<=1?ew(s):Math.trunc(s);r[i]+=l,t[n]-=l*o}function tw(e,t){X0.reduce((n,r)=>xe(t[r])?n:(n&&ef(e,t,n,t,r),r),null)}class Ee{constructor(t){const n=t.conversionAccuracy==="longterm"||!1;this.values=t.values,this.loc=t.loc||Re.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=n?J0:Z0,this.isLuxonDuration=!0}static fromMillis(t,n){return Ee.fromObject({milliseconds:t},n)}static fromObject(t,n={}){if(t==null||typeof t!="object")throw new vt(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new Ee({values:Ci(t,Ee.normalizeUnit),loc:Re.fromObject(n),conversionAccuracy:n.conversionAccuracy})}static fromDurationLike(t){if(wn(t))return Ee.fromMillis(t);if(Ee.isDuration(t))return t;if(typeof t=="object")return Ee.fromObject(t);throw new vt(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){const[r]=H0(t);return r?Ee.fromObject(r,n):Ee.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){const[r]=W0(t);return r?Ee.fromObject(r,n):Ee.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,n=null){if(!t)throw new vt("need to specify a reason the Duration is invalid");const r=t instanceof Tt?t:new Tt(t,n);if(qe.throwOnInvalid)throw new Mb(r);return new Ee({invalid:r})}static normalizeUnit(t){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!n)throw new ac(t);return n}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,n={}){const r={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?lt.create(this.loc,r).formatDurationFromString(this,t):Q0}toHuman(t={}){const n=xn.map(r=>{const i=this.values[r];return xe(i)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:r.slice(0,-1)}).format(i)}).filter(r=>r);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=gs(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const n=this.toMillis();if(n<0||n>=864e5)return null;t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t};const r=this.shiftTo("hours","minutes","seconds","milliseconds");let i=t.format==="basic"?"hhmm":"hh:mm";(!t.suppressSeconds||r.seconds!==0||r.milliseconds!==0)&&(i+=t.format==="basic"?"ss":":ss",(!t.suppressMilliseconds||r.milliseconds!==0)&&(i+=".SSS"));let o=r.toFormat(i);return t.includePrefix&&(o="T"+o),o}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const n=Ee.fromDurationLike(t),r={};for(const i of xn)(Fn(n.values,i)||Fn(this.values,i))&&(r[i]=n.get(i)+this.get(i));return kn(this,{values:r},!0)}minus(t){if(!this.isValid)return this;const n=Ee.fromDurationLike(t);return this.plus(n.negate())}mapUnits(t){if(!this.isValid)return this;const n={};for(const r of Object.keys(this.values))n[r]=Mc(t(this.values[r],r));return kn(this,{values:n},!0)}get(t){return this[Ee.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const n={...this.values,...Ci(t,Ee.normalizeUnit)};return kn(this,{values:n})}reconfigure({locale:t,numberingSystem:n,conversionAccuracy:r}={}){const i=this.loc.clone({locale:t,numberingSystem:n}),o={loc:i};return r&&(o.conversionAccuracy=r),kn(this,o)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return tw(this.matrix,t),kn(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(s=>Ee.normalizeUnit(s));const n={},r={},i=this.toObject();let o;for(const s of xn)if(t.indexOf(s)>=0){o=s;let a=0;for(const u in r)a+=this.matrix[u][s]*r[u],r[u]=0;wn(i[s])&&(a+=i[s]);const l=Math.trunc(a);n[s]=l,r[s]=(a*1e3-l*1e3)/1e3;for(const u in i)xn.indexOf(u)>xn.indexOf(s)&&ef(this.matrix,i,u,n,s)}else wn(i[s])&&(r[s]=i[s]);for(const s in r)r[s]!==0&&(n[o]+=s===o?r[s]:r[s]/this.matrix[o][s]);return kn(this,{values:n},!0).normalize()}negate(){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=this.values[n]===0?0:-this.values[n];return kn(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function n(r,i){return r===void 0||r===0?i===void 0||i===0:r===i}for(const r of xn)if(!n(this.values[r],t.values[r]))return!1;return!0}}const Or="Invalid Interval";function nw(e,t){return!e||!e.isValid?ze.invalid("missing or invalid start"):!t||!t.isValid?ze.invalid("missing or invalid end"):t<e?ze.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null}class ze{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,n=null){if(!t)throw new vt("need to specify a reason the Interval is invalid");const r=t instanceof Tt?t:new Tt(t,n);if(qe.throwOnInvalid)throw new Ob(r);return new ze({invalid:r})}static fromDateTimes(t,n){const r=Nr(t),i=Nr(n),o=nw(r,i);return o??new ze({start:r,end:i})}static after(t,n){const r=Ee.fromDurationLike(n),i=Nr(t);return ze.fromDateTimes(i,i.plus(r))}static before(t,n){const r=Ee.fromDurationLike(n),i=Nr(t);return ze.fromDateTimes(i.minus(r),i)}static fromISO(t,n){const[r,i]=(t||"").split("/",2);if(r&&i){let o,s;try{o=pe.fromISO(r,n),s=o.isValid}catch{s=!1}let a,l;try{a=pe.fromISO(i,n),l=a.isValid}catch{l=!1}if(s&&l)return ze.fromDateTimes(o,a);if(s){const u=Ee.fromISO(i,n);if(u.isValid)return ze.after(o,u)}else if(l){const u=Ee.fromISO(r,n);if(u.isValid)return ze.before(a,u)}}return ze.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds"){if(!this.isValid)return NaN;const n=this.start.startOf(t),r=this.end.startOf(t);return Math.floor(r.diff(n,t).get(t))+1}hasSame(t){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,t):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return this.isValid?this.s>t:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:n}={}){return this.isValid?ze.fromDateTimes(t||this.s,n||this.e):this}splitAt(...t){if(!this.isValid)return[];const n=t.map(Nr).filter(s=>this.contains(s)).sort(),r=[];let{s:i}=this,o=0;for(;i<this.e;){const s=n[o]||this.e,a=+s>+this.e?this.e:s;r.push(ze.fromDateTimes(i,a)),i=a,o+=1}return r}splitBy(t){const n=Ee.fromDurationLike(t);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,i=1,o;const s=[];for(;r<this.e;){const a=this.start.plus(n.mapUnits(l=>l*i));o=+a>+this.e?this.e:a,s.push(ze.fromDateTimes(r,o)),r=o,i+=1}return s}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return this.isValid?+this.e==+t.s:!1}abutsEnd(t){return this.isValid?+t.e==+this.s:!1}engulfs(t){return this.isValid?this.s<=t.s&&this.e>=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const n=this.s>t.s?this.s:t.s,r=this.e<t.e?this.e:t.e;return n>=r?null:ze.fromDateTimes(n,r)}union(t){if(!this.isValid)return this;const n=this.s<t.s?this.s:t.s,r=this.e>t.e?this.e:t.e;return ze.fromDateTimes(n,r)}static merge(t){const[n,r]=t.sort((i,o)=>i.s-o.s).reduce(([i,o],s)=>o?o.overlaps(s)||o.abutsStart(s)?[i,o.union(s)]:[i.concat([o]),s]:[i,s],[[],null]);return r&&n.push(r),n}static xor(t){let n=null,r=0;const i=[],o=t.map(l=>[{time:l.s,type:"s"},{time:l.e,type:"e"}]),s=Array.prototype.concat(...o),a=s.sort((l,u)=>l.time-u.time);for(const l of a)r+=l.type==="s"?1:-1,r===1?n=l.time:(n&&+n!=+l.time&&i.push(ze.fromDateTimes(n,l.time)),n=null);return ze.merge(i)}difference(...t){return ze.xor([this].concat(t)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Or}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:Or}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Or}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:Or}toFormat(t,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${n}${this.e.toFormat(t)}`:Or}toDuration(t,n){return this.isValid?this.e.diff(this.s,t,n):Ee.invalid(this.invalidReason)}mapEndpoints(t){return ze.fromDateTimes(t(this.s),t(this.e))}}let Mi=class{static hasDST(t=qe.defaultZone){const n=pe.now().setZone(t).set({month:12});return!t.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(t){return Yt.isValidZone(t)}static normalizeZone(t){return on(t,qe.defaultZone)}static months(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null,outputCalendar:o="gregory"}={}){return(i||Re.create(n,r,o)).months(t)}static monthsFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null,outputCalendar:o="gregory"}={}){return(i||Re.create(n,r,o)).months(t,!0)}static weekdays(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null}={}){return(i||Re.create(n,r,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null}={}){return(i||Re.create(n,r,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return Re.create(t).meridiems()}static eras(t="short",{locale:n=null}={}){return Re.create(n,null,"gregory").eras(t)}static features(){return{relative:Tc()}}};function tf(e,t){const n=i=>i.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(t)-n(e);return Math.floor(Ee.fromMillis(r).as("days"))}function rw(e,t,n){const r=[["years",(a,l)=>l.year-a.year],["quarters",(a,l)=>l.quarter-a.quarter],["months",(a,l)=>l.month-a.month+(l.year-a.year)*12],["weeks",(a,l)=>{const u=tf(a,l);return(u-u%7)/7}],["days",tf]],i={};let o,s;for(const[a,l]of r)if(n.indexOf(a)>=0){o=a;let u=l(e,t);s=e.plus({[a]:u}),s>t?(e=e.plus({[a]:u-1}),u-=1):e=s,i[a]=u}return[e,i,s,o]}function iw(e,t,n,r){let[i,o,s,a]=rw(e,t,n);const l=t-i,u=n.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);u.length===0&&(s<t&&(s=i.plus({[a]:1})),s!==i&&(o[a]=(o[a]||0)+l/(s-i)));const f=Ee.fromObject(o,r);return u.length>0?Ee.fromMillis(l,r).shiftTo(...u).plus(f):f}const Os={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},nf={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},ow=Os.hanidec.replace(/[\[|\]]/g,"").split("");function sw(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(e[n].search(Os.hanidec)!==-1)t+=ow.indexOf(e[n]);else for(const i in nf){const[o,s]=nf[i];r>=o&&r<=s&&(t+=r-o)}}return parseInt(t,10)}else return t}function It({numberingSystem:e},t=""){return new RegExp(`${Os[e||"latn"]}${t}`)}const aw="missing Intl.DateTimeFormat.formatToParts support";function Ce(e,t=n=>n){return{regex:e,deser:([n])=>t(sw(n))}}const rf="[  ]",of=new RegExp(rf,"g");function lw(e){return e.replace(/\./g,"\\.?").replace(of,rf)}function sf(e){return e.replace(/\./g,"").replace(of," ").toLowerCase()}function Ot(e,t){return e===null?null:{regex:RegExp(e.map(lw).join("|")),deser:([n])=>e.findIndex(r=>sf(n)===sf(r))+t}}function af(e,t){return{regex:e,deser:([,n,r])=>Ei(n,r),groups:t}}function Ms(e){return{regex:e,deser:([t])=>t}}function uw(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function cw(e,t){const n=It(t),r=It(t,"{2}"),i=It(t,"{3}"),o=It(t,"{4}"),s=It(t,"{6}"),a=It(t,"{1,2}"),l=It(t,"{1,3}"),u=It(t,"{1,6}"),f=It(t,"{1,9}"),c=It(t,"{2,4}"),h=It(t,"{4,6}"),d=g=>({regex:RegExp(uw(g.val)),deser:([y])=>y,literal:!0}),p=(g=>{if(e.literal)return d(g);switch(g.val){case"G":return Ot(t.eras("short",!1),0);case"GG":return Ot(t.eras("long",!1),0);case"y":return Ce(u);case"yy":return Ce(c,vs);case"yyyy":return Ce(o);case"yyyyy":return Ce(h);case"yyyyyy":return Ce(s);case"M":return Ce(a);case"MM":return Ce(r);case"MMM":return Ot(t.months("short",!0,!1),1);case"MMMM":return Ot(t.months("long",!0,!1),1);case"L":return Ce(a);case"LL":return Ce(r);case"LLL":return Ot(t.months("short",!1,!1),1);case"LLLL":return Ot(t.months("long",!1,!1),1);case"d":return Ce(a);case"dd":return Ce(r);case"o":return Ce(l);case"ooo":return Ce(i);case"HH":return Ce(r);case"H":return Ce(a);case"hh":return Ce(r);case"h":return Ce(a);case"mm":return Ce(r);case"m":return Ce(a);case"q":return Ce(a);case"qq":return Ce(r);case"s":return Ce(a);case"ss":return Ce(r);case"S":return Ce(l);case"SSS":return Ce(i);case"u":return Ms(f);case"uu":return Ms(a);case"uuu":return Ce(n);case"a":return Ot(t.meridiems(),0);case"kkkk":return Ce(o);case"kk":return Ce(c,vs);case"W":return Ce(a);case"WW":return Ce(r);case"E":case"c":return Ce(n);case"EEE":return Ot(t.weekdays("short",!1,!1),1);case"EEEE":return Ot(t.weekdays("long",!1,!1),1);case"ccc":return Ot(t.weekdays("short",!0,!1),1);case"cccc":return Ot(t.weekdays("long",!0,!1),1);case"Z":case"ZZ":return af(new RegExp(`([+-]${a.source})(?::(${r.source}))?`),2);case"ZZZ":return af(new RegExp(`([+-]${a.source})(${r.source})?`),2);case"z":return Ms(/[a-z_+-/]{1,256}?/i);default:return d(g)}})(e)||{invalidReason:aw};return p.token=e,p}const fw={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"}};function dw(e,t,n){const{type:r,value:i}=e;if(r==="literal")return{literal:!0,val:i};const o=n[r];let s=fw[r];if(typeof s=="object"&&(s=s[o]),s)return{literal:!1,val:s}}function hw(e){return[`^${e.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,e]}function pw(e,t,n){const r=e.match(t);if(r){const i={};let o=1;for(const s in n)if(Fn(n,s)){const a=n[s],l=a.groups?a.groups+1:1;!a.literal&&a.token&&(i[a.token.val[0]]=a.deser(r.slice(o,o+l))),o+=l}return[r,i]}else return[r,{}]}function mw(e){const t=o=>{switch(o){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,r;return xe(e.z)||(n=Yt.create(e.z)),xe(e.Z)||(n||(n=new it(e.Z)),r=e.Z),xe(e.q)||(e.M=(e.q-1)*3+1),xe(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),xe(e.u)||(e.S=ms(e.u)),[Object.keys(e).reduce((o,s)=>{const a=t(s);return a&&(o[a]=e[s]),o},{}),n,r]}let Ds=null;function gw(){return Ds||(Ds=pe.fromMillis(1555555555555)),Ds}function yw(e,t){if(e.literal)return e;const n=lt.macroTokenToFormatOpts(e.val);if(!n)return e;const o=lt.create(t,n).formatDateTimeParts(gw()).map(s=>dw(s,t,n));return o.includes(void 0)?e:o}function vw(e,t){return Array.prototype.concat(...e.map(n=>yw(n,t)))}function lf(e,t,n){const r=vw(lt.parseFormat(n),e),i=r.map(s=>cw(s,e)),o=i.find(s=>s.invalidReason);if(o)return{input:t,tokens:r,invalidReason:o.invalidReason};{const[s,a]=hw(i),l=RegExp(s,"i"),[u,f]=pw(t,l,a),[c,h,d]=f?mw(f):[null,null,void 0];if(Fn(f,"a")&&Fn(f,"H"))throw new Sr("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:r,regex:l,rawMatches:u,matches:f,result:c,zone:h,specificOffset:d}}}function bw(e,t,n){const{result:r,zone:i,specificOffset:o,invalidReason:s}=lf(e,t,n);return[r,i,o,s]}const uf=[0,31,59,90,120,151,181,212,243,273,304,334],cf=[0,31,60,91,121,152,182,213,244,274,305,335];function wt(e,t){return new Tt("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function ff(e,t,n){const r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const i=r.getUTCDay();return i===0?7:i}function df(e,t,n){return n+(xr(e)?cf:uf)[t-1]}function hf(e,t){const n=xr(e)?cf:uf,r=n.findIndex(o=>o<t),i=t-n[r];return{month:r+1,day:i}}function Ns(e){const{year:t,month:n,day:r}=e,i=df(t,n,r),o=ff(t,n,r);let s=Math.floor((i-o+10)/7),a;return s<1?(a=t-1,s=ki(a)):s>ki(t)?(a=t+1,s=1):a=t,{weekYear:a,weekNumber:s,weekday:o,...Ai(e)}}function pf(e){const{weekYear:t,weekNumber:n,weekday:r}=e,i=ff(t,1,4),o=kr(t);let s=n*7+r-i-3,a;s<1?(a=t-1,s+=kr(a)):s>o?(a=t+1,s-=kr(t)):a=t;const{month:l,day:u}=hf(a,s);return{year:a,month:l,day:u,...Ai(e)}}function _s(e){const{year:t,month:n,day:r}=e,i=df(t,n,r);return{year:t,ordinal:i,...Ai(e)}}function mf(e){const{year:t,ordinal:n}=e,{month:r,day:i}=hf(t,n);return{year:t,month:r,day:i,...Ai(e)}}function ww(e){const t=Si(e.weekYear),n=qt(e.weekNumber,1,ki(e.weekYear)),r=qt(e.weekday,1,7);return t?n?r?!1:wt("weekday",e.weekday):wt("week",e.week):wt("weekYear",e.weekYear)}function Sw(e){const t=Si(e.year),n=qt(e.ordinal,1,kr(e.year));return t?n?!1:wt("ordinal",e.ordinal):wt("year",e.year)}function gf(e){const t=Si(e.year),n=qt(e.month,1,12),r=qt(e.day,1,xi(e.year,e.month));return t?n?r?!1:wt("day",e.day):wt("month",e.month):wt("year",e.year)}function yf(e){const{hour:t,minute:n,second:r,millisecond:i}=e,o=qt(t,0,23)||t===24&&n===0&&r===0&&i===0,s=qt(n,0,59),a=qt(r,0,59),l=qt(i,0,999);return o?s?a?l?!1:wt("millisecond",i):wt("second",r):wt("minute",n):wt("hour",t)}const Ps="Invalid DateTime",vf=864e13;function Di(e){return new Tt("unsupported zone",`the zone "${e.name}" is not supported`)}function Ls(e){return e.weekData===null&&(e.weekData=Ns(e.c)),e.weekData}function Mr(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new pe({...n,...t,old:n})}function bf(e,t,n){let r=e-t*60*1e3;const i=n.offset(r);if(t===i)return[r,t];r-=(i-t)*60*1e3;const o=n.offset(r);return i===o?[r,i]:[e-Math.min(i,o)*60*1e3,Math.max(i,o)]}function wf(e,t){e+=t*60*1e3;const n=new Date(e);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function Ni(e,t,n){return bf(ys(e),t,n)}function Sf(e,t){const n=e.o,r=e.c.year+Math.trunc(t.years),i=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,o={...e.c,year:r,month:i,day:Math.min(e.c.day,xi(r,i))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},s=Ee.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),a=ys(o);let[l,u]=bf(a,n,e.zone);return s!==0&&(l+=s,u=e.zone.offset(l)),{ts:l,o:u}}function Dr(e,t,n,r,i,o){const{setZone:s,zone:a}=n;if(e&&Object.keys(e).length!==0){const l=t||a,u=pe.fromObject(e,{...n,zone:l,specificOffset:o});return s?u:u.setZone(a)}else return pe.invalid(new Tt("unparsable",`the input "${i}" can't be parsed as ${r}`))}function _i(e,t,n=!0){return e.isValid?lt.create(Re.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function Fs(e,t){const n=e.c.year>9999||e.c.year<0;let r="";return n&&e.c.year>=0&&(r+="+"),r+=Ve(e.c.year,n?6:4),t?(r+="-",r+=Ve(e.c.month),r+="-",r+=Ve(e.c.day)):(r+=Ve(e.c.month),r+=Ve(e.c.day)),r}function xf(e,t,n,r,i,o){let s=Ve(e.c.hour);return t?(s+=":",s+=Ve(e.c.minute),(e.c.second!==0||!n)&&(s+=":")):s+=Ve(e.c.minute),(e.c.second!==0||!n)&&(s+=Ve(e.c.second),(e.c.millisecond!==0||!r)&&(s+=".",s+=Ve(e.c.millisecond,3))),i&&(e.isOffsetFixed&&e.offset===0&&!o?s+="Z":e.o<0?(s+="-",s+=Ve(Math.trunc(-e.o/60)),s+=":",s+=Ve(Math.trunc(-e.o%60))):(s+="+",s+=Ve(Math.trunc(e.o/60)),s+=":",s+=Ve(Math.trunc(e.o%60)))),o&&(s+="["+e.zone.ianaName+"]"),s}const kf={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},xw={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},kw={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Ef=["year","month","day","hour","minute","second","millisecond"],Ew=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Cw=["year","ordinal","hour","minute","second","millisecond"];function Cf(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new ac(e);return t}function Af(e,t){const n=on(t.zone,qe.defaultZone),r=Re.fromObject(t),i=qe.now();let o,s;if(xe(e.year))o=i;else{for(const u of Ef)xe(e[u])&&(e[u]=kf[u]);const a=gf(e)||yf(e);if(a)return pe.invalid(a);const l=n.offset(i);[o,s]=Ni(e,l,n)}return new pe({ts:o,zone:n,loc:r,o:s})}function Tf(e,t,n){const r=xe(n.round)?!0:n.round,i=(s,a)=>(s=gs(s,r||n.calendary?0:2,!0),t.loc.clone(n).relFormatter(n).format(s,a)),o=s=>n.calendary?t.hasSame(e,s)?0:t.startOf(s).diff(e.startOf(s),s).get(s):t.diff(e,s).get(s);if(n.unit)return i(o(n.unit),n.unit);for(const s of n.units){const a=o(s);if(Math.abs(a)>=1)return i(a,s)}return i(e>t?-0:0,n.units[n.units.length-1])}function If(e){let t={},n;return e.length>0&&typeof e[e.length-1]=="object"?(t=e[e.length-1],n=Array.from(e).slice(0,e.length-1)):n=Array.from(e),[t,n]}class pe{constructor(t){const n=t.zone||qe.defaultZone;let r=t.invalid||(Number.isNaN(t.ts)?new Tt("invalid input"):null)||(n.isValid?null:Di(n));this.ts=xe(t.ts)?qe.now():t.ts;let i=null,o=null;if(!r)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(n))[i,o]=[t.old.c,t.old.o];else{const a=n.offset(this.ts);i=wf(this.ts,a),r=Number.isNaN(i.year)?new Tt("invalid input"):null,i=r?null:i,o=r?null:a}this._zone=n,this.loc=t.loc||Re.create(),this.invalid=r,this.weekData=null,this.c=i,this.o=o,this.isLuxonDateTime=!0}static now(){return new pe({})}static local(){const[t,n]=If(arguments),[r,i,o,s,a,l,u]=n;return Af({year:r,month:i,day:o,hour:s,minute:a,second:l,millisecond:u},t)}static utc(){const[t,n]=If(arguments),[r,i,o,s,a,l,u]=n;return t.zone=it.utcInstance,Af({year:r,month:i,day:o,hour:s,minute:a,second:l,millisecond:u},t)}static fromJSDate(t,n={}){const r=Pb(t)?t.valueOf():NaN;if(Number.isNaN(r))return pe.invalid("invalid input");const i=on(n.zone,qe.defaultZone);return i.isValid?new pe({ts:r,zone:i,loc:Re.fromObject(n)}):pe.invalid(Di(i))}static fromMillis(t,n={}){if(wn(t))return t<-vf||t>vf?pe.invalid("Timestamp out of range"):new pe({ts:t,zone:on(n.zone,qe.defaultZone),loc:Re.fromObject(n)});throw new vt(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,n={}){if(wn(t))return new pe({ts:t*1e3,zone:on(n.zone,qe.defaultZone),loc:Re.fromObject(n)});throw new vt("fromSeconds requires a numerical input")}static fromObject(t,n={}){t=t||{};const r=on(n.zone,qe.defaultZone);if(!r.isValid)return pe.invalid(Di(r));const i=qe.now(),o=xe(n.specificOffset)?r.offset(i):n.specificOffset,s=Ci(t,Cf),a=!xe(s.ordinal),l=!xe(s.year),u=!xe(s.month)||!xe(s.day),f=l||u,c=s.weekYear||s.weekNumber,h=Re.fromObject(n);if((f||a)&&c)throw new Sr("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&a)throw new Sr("Can't mix ordinal dates with month/day");const d=c||s.weekday&&!f;let m,p,g=wf(i,o);d?(m=Ew,p=xw,g=Ns(g)):a?(m=Cw,p=kw,g=_s(g)):(m=Ef,p=kf);let y=!1;for(const M of m){const P=s[M];xe(P)?y?s[M]=p[M]:s[M]=g[M]:y=!0}const v=d?ww(s):a?Sw(s):gf(s),w=v||yf(s);if(w)return pe.invalid(w);const E=d?pf(s):a?mf(s):s,[S,C]=Ni(E,o,r),I=new pe({ts:S,zone:r,o:C,loc:h});return s.weekday&&f&&t.weekday!==I.weekday?pe.invalid("mismatched weekday",`you can't specify both a weekday of ${s.weekday} and a date of ${I.toISO()}`):I}static fromISO(t,n={}){const[r,i]=z0(t);return Dr(r,i,n,"ISO 8601",t)}static fromRFC2822(t,n={}){const[r,i]=U0(t);return Dr(r,i,n,"RFC 2822",t)}static fromHTTP(t,n={}){const[r,i]=j0(t);return Dr(r,i,n,"HTTP",n)}static fromFormat(t,n,r={}){if(xe(t)||xe(n))throw new vt("fromFormat requires an input string and a format");const{locale:i=null,numberingSystem:o=null}=r,s=Re.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0}),[a,l,u,f]=bw(s,t,n);return f?pe.invalid(f):Dr(a,l,r,`format ${n}`,t,u)}static fromString(t,n,r={}){return pe.fromFormat(t,n,r)}static fromSQL(t,n={}){const[r,i]=G0(t);return Dr(r,i,n,"SQL",t)}static invalid(t,n=null){if(!t)throw new vt("need to specify a reason the DateTime is invalid");const r=t instanceof Tt?t:new Tt(t,n);if(qe.throwOnInvalid)throw new Ib(r);return new pe({invalid:r})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Ls(this).weekYear:NaN}get weekNumber(){return this.isValid?Ls(this).weekNumber:NaN}get weekday(){return this.isValid?Ls(this).weekday:NaN}get ordinal(){return this.isValid?_s(this.c).ordinal:NaN}get monthShort(){return this.isValid?Mi.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Mi.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Mi.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Mi.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}get isInLeapYear(){return xr(this.year)}get daysInMonth(){return xi(this.year,this.month)}get daysInYear(){return this.isValid?kr(this.year):NaN}get weeksInWeekYear(){return this.isValid?ki(this.weekYear):NaN}resolvedLocaleOptions(t={}){const{locale:n,numberingSystem:r,calendar:i}=lt.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:i}}toUTC(t=0,n={}){return this.setZone(it.instance(t),n)}toLocal(){return this.setZone(qe.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(t=on(t,qe.defaultZone),t.equals(this.zone))return this;if(t.isValid){let i=this.ts;if(n||r){const o=t.offset(this.ts),s=this.toObject();[i]=Ni(s,o,t)}return Mr(this,{ts:i,zone:t})}else return pe.invalid(Di(t))}reconfigure({locale:t,numberingSystem:n,outputCalendar:r}={}){const i=this.loc.clone({locale:t,numberingSystem:n,outputCalendar:r});return Mr(this,{loc:i})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const n=Ci(t,Cf),r=!xe(n.weekYear)||!xe(n.weekNumber)||!xe(n.weekday),i=!xe(n.ordinal),o=!xe(n.year),s=!xe(n.month)||!xe(n.day),a=o||s,l=n.weekYear||n.weekNumber;if((a||i)&&l)throw new Sr("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(s&&i)throw new Sr("Can't mix ordinal dates with month/day");let u;r?u=pf({...Ns(this.c),...n}):xe(n.ordinal)?(u={...this.toObject(),...n},xe(n.day)&&(u.day=Math.min(xi(u.year,u.month),u.day))):u=mf({..._s(this.c),...n});const[f,c]=Ni(u,this.o,this.zone);return Mr(this,{ts:f,o:c})}plus(t){if(!this.isValid)return this;const n=Ee.fromDurationLike(t);return Mr(this,Sf(this,n))}minus(t){if(!this.isValid)return this;const n=Ee.fromDurationLike(t).negate();return Mr(this,Sf(this,n))}startOf(t){if(!this.isValid)return this;const n={},r=Ee.normalizeUnit(t);switch(r){case"years":n.month=1;case"quarters":case"months":n.day=1;case"weeks":case"days":n.hour=0;case"hours":n.minute=0;case"minutes":n.second=0;case"seconds":n.millisecond=0;break}if(r==="weeks"&&(n.weekday=1),r==="quarters"){const i=Math.ceil(this.month/3);n.month=(i-1)*3+1}return this.set(n)}endOf(t){return this.isValid?this.plus({[t]:1}).startOf(t).minus(1):this}toFormat(t,n={}){return this.isValid?lt.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,t):Ps}toLocaleString(t=ps,n={}){return this.isValid?lt.create(this.loc.clone(n),t).formatDateTime(this):Ps}toLocaleParts(t={}){return this.isValid?lt.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:n=!1,suppressMilliseconds:r=!1,includeOffset:i=!0,extendedZone:o=!1}={}){if(!this.isValid)return null;const s=t==="extended";let a=Fs(this,s);return a+="T",a+=xf(this,s,n,r,i,o),a}toISODate({format:t="extended"}={}){return this.isValid?Fs(this,t==="extended"):null}toISOWeekDate(){return _i(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:n=!1,includeOffset:r=!0,includePrefix:i=!1,extendedZone:o=!1,format:s="extended"}={}){return this.isValid?(i?"T":"")+xf(this,s==="extended",n,t,r,o):null}toRFC2822(){return _i(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return _i(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?Fs(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:n=!1,includeOffsetSpace:r=!0}={}){let i="HH:mm:ss.SSS";return(n||t)&&(r&&(i+=" "),n?i+="z":t&&(i+="ZZ")),_i(this,i,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():Ps}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const n={...this.c};return t.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,n="milliseconds",r={}){if(!this.isValid||!t.isValid)return Ee.invalid("created by diffing an invalid DateTime");const i={locale:this.locale,numberingSystem:this.numberingSystem,...r},o=Lb(n).map(Ee.normalizeUnit),s=t.valueOf()>this.valueOf(),a=s?this:t,l=s?t:this,u=iw(a,l,o,i);return s?u.negate():u}diffNow(t="milliseconds",n={}){return this.diff(pe.now(),t,n)}until(t){return this.isValid?ze.fromDateTimes(this,t):this}hasSame(t,n){if(!this.isValid)return!1;const r=t.valueOf(),i=this.setZone(t.zone,{keepLocalTime:!0});return i.startOf(n)<=r&&r<=i.endOf(n)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const n=t.base||pe.fromObject({},{zone:this.zone}),r=t.padding?this<n?-t.padding:t.padding:0;let i=["years","months","days","hours","minutes","seconds"],o=t.unit;return Array.isArray(t.unit)&&(i=t.unit,o=void 0),Tf(n,this.plus(r),{...t,numeric:"always",units:i,unit:o})}toRelativeCalendar(t={}){return this.isValid?Tf(t.base||pe.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(pe.isDateTime))throw new vt("min requires all arguments be DateTimes");return Ic(t,n=>n.valueOf(),Math.min)}static max(...t){if(!t.every(pe.isDateTime))throw new vt("max requires all arguments be DateTimes");return Ic(t,n=>n.valueOf(),Math.max)}static fromFormatExplain(t,n,r={}){const{locale:i=null,numberingSystem:o=null}=r,s=Re.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0});return lf(s,t,n)}static fromStringExplain(t,n,r={}){return pe.fromFormatExplain(t,n,r)}static get DATE_SHORT(){return ps}static get DATE_MED(){return lc}static get DATE_MED_WITH_WEEKDAY(){return Db}static get DATE_FULL(){return uc}static get DATE_HUGE(){return cc}static get TIME_SIMPLE(){return fc}static get TIME_WITH_SECONDS(){return dc}static get TIME_WITH_SHORT_OFFSET(){return hc}static get TIME_WITH_LONG_OFFSET(){return pc}static get TIME_24_SIMPLE(){return mc}static get TIME_24_WITH_SECONDS(){return gc}static get TIME_24_WITH_SHORT_OFFSET(){return yc}static get TIME_24_WITH_LONG_OFFSET(){return vc}static get DATETIME_SHORT(){return bc}static get DATETIME_SHORT_WITH_SECONDS(){return wc}static get DATETIME_MED(){return Sc}static get DATETIME_MED_WITH_SECONDS(){return xc}static get DATETIME_MED_WITH_WEEKDAY(){return Nb}static get DATETIME_FULL(){return kc}static get DATETIME_FULL_WITH_SECONDS(){return Ec}static get DATETIME_HUGE(){return Cc}static get DATETIME_HUGE_WITH_SECONDS(){return Ac}}function Nr(e){if(pe.isDateTime(e))return e;if(e&&e.valueOf&&wn(e.valueOf()))return pe.fromJSDate(e);if(e&&typeof e=="object")return pe.fromObject(e);throw new vt(`Unknown datetime argument: ${e}, of type ${typeof e}`)}function Aw(e){const t=typeof e=="string"?pe.fromISO(e):pe.fromJSDate(e);if(!t.isValid)return"Invalid date";const r=pe.now().diff(t,["years","months","days","hours","minutes"]).toObject();return r.years&&r.years>=1?`${Math.floor(r.years)} year${Math.floor(r.years)>1?"s":""} ago`:r.months&&r.months>=1?`${Math.floor(r.months)} month${Math.floor(r.months)>1?"s":""} ago`:r.days&&r.days>=1?`${Math.floor(r.days)} day${Math.floor(r.days)>1?"s":""} ago`:r.hours&&r.hours>=1?`${Math.floor(r.hours)}h ago`:r.minutes&&r.minutes>=1?`${Math.floor(r.minutes)}m ago`:"just now"}function Rs(e){if(!/^#?([a-fA-F\d]{6}|[a-fA-F\d]{3})$/.test(e))return{r:0,g:0,b:0};const n=e.replace(/^#/,"");let r=n;n.length===3&&(r=n.split("").map(l=>l+l).join(""));const i=parseInt(r,16),o=i>>16&255,s=i>>8&255,a=i&255;return{r:o,g:s,b:a}}function Tw(e){return`#${((1<<24)+(e.r<<16)+(e.g<<8)+e.b).toString(16).slice(1)}`}const Iw=(e,t=30)=>{const n=Math.min(e.r,e.g,e.b),r=Math.max(e.r,e.g,e.b,n+1);return{r:Math.floor((e.r-n)/(r-n)*t*(1-.299)+120-t/2),g:Math.floor((e.g-n)/(r-n)*t*(1-.587)+120-t/2),b:Math.floor((e.b-n)/(r-n)*t*(1-.114)+120-t/2)}};function Of(e){return Object.entries(e).reduce((t,[n,r])=>{const i=n.replace(/(\d+)/,o=>(1e3-parseInt(o)).toString());return{...t,[i]:r}},{})}const Ow=2.4,Mw=.2126729,Dw=.7151522,Nw=.072175,_w=.56,Pw=.57,Lw=.62,Fw=.65,Pi=.022,Mf=1.414,Rw=1.14,$w=1.14,Bw=.035991,zw=27.7847239587675,Uw=27.7847239587675,Df=.027,Nf=.027,_f=.001,jw=5e-4;function Pf(e){const{r:t,g:n,b:r}=e,i=o=>(o/255)**Ow;return Mw*i(t)+Dw*i(n)+Nw*i(r)}function Lf(e,t){if(!e||!t)return 0;let n=Pf(Rs(e)),r=Pf(Rs(t)),i=0,o=0;return n=n>Pi?n:n+(Pi-n)**Mf,r=r>Pi?r:r+(Pi-r)**Mf,Math.abs(r-n)<jw?0:(r>n?(i=(r**_w-n**Pw)*Rw,o=i<_f?0:i<Bw?i-i*zw*Df:i-Df):(i=(r**Fw-n**Lw)*$w,o=i>-_f?0:i>-.035991?i-i*Uw*Nf:i+Nf),Math.abs(o*100))}const Hw=(e,t,n)=>{const r=e;let i=0;for(;t.some(o=>n(o)===e);)i+=1,e=`${r} (${i})`;return e};function Ff(e){const{fontFamily:t,...n}=e,r=Rf(n);return Zu(".bpReset",{...r,"font-family":`'${t}', sans-serif`})+Zu(":host, :root",{...r})}function Rf(e){const{radius:t,themeMode:n,color:r,variant:i,headerVariant:o}=e;let s={},a={};if(r){const h=oc(r),d=n==="dark"?Of(h):h,m=oc(Tw(Iw(Rs(r)))),p=n==="dark"?Of(m):m,g=n==="dark"?"#101010":"#fdfdfd";a=Object.entries({...d,1:g}).reduce((v,[w,E])=>({...v,[`--bpPrimary-${w}`]:E}),{});const y=Object.entries({...p,1:g}).reduce((v,[w,E])=>({...v,[`--bpGray-${w}`]:E}),{});s={...a,...y}}t&&(s={...s,"--bpRadius-scale":t.toString()});const l=n==="dark"?{bg:"var(--transparent-dark)",bgHover:"var(--transparent-dark-hover)"}:{bg:"var(--transparent-light)",bgHover:"var(--transparent-light-hover)"},u=a?Lf(a["--bpPrimary-600"],a["--bpPrimary-50"])>40?"var(--bpPrimary-50)":"var(--bpPrimary-900)":"var(--bpPrimary-50)",f=i==="solid"?{"--message-bg":"var(--bpPrimary-600)","--message-bg-hover":"var(--bpPrimary-700)","--message-text":u,"--send-button-bg":"var(--bpPrimary-600)","--send-button-bg-hover":"var(--bpPrimary-700)","--send-button-text":"var(--bpPrimary-50)","--button-bg":"var(--bpPrimary-200)","--button-bg-hover":"var(--bpPrimary-300)","--button-text":"var(--bpPrimary-800)","--fab-bg":"var(--bpPrimary-600)","--fab-bg-hover":"var(--bpPrimary-700)","--fab-icon":u,"--modal-submit-bg":"var(--bpPrimary-600)","--modal-submit-bg-hover":"var(--bpPrimary-700)"}:{"--message-bg":"var(--bpPrimary-100)","--message-bg-hover":"var(--bpPrimary-200)","--message-text":"var(--bpPrimary-900)","--send-button-bg":"var(--bpPrimary-600)","--send-button-bg-hover":"var(--bpPrimary-700)","--send-button-text":"var(--bpPrimary-50)","--button-bg":"var(--bpPrimary-500)","--button-bg-hover":"var(--bpPrimary-600)","--button-text":a?Lf(a["--bpPrimary-500"],a["--bpPrimary-50"])>40?"var(--bpPrimary-50)":"var(--bpPrimary-900)":"var(--bpPrimary-50)","--fab-bg":"var(--bpPrimary-100)","--fab-bg-hover":"var(--bpPrimary-200)","--fab-icon":"var(--bpPrimary-700)","--scrollbar":"var(--bpGray-500)","--scrollbar-hover":"var(--bpGray-400)","--modal-submit-bg":"var(--bpPrimary-200)","--modal-submit-bg-hover":"var(--bpPrimary-300)"},c=o==="solid"?{"--header-bg":"var(--bpPrimary-600)","--header-bg-hover":"var(--bpPrimary-700)","--header-hover-dark":"var(--bpPrimary-800)","--header-title":u,"--header-description":u,"--header-description-icon":u,"--header-description-link":u,"--header-avatar-bg":"var(--bpPrimary-300)","--header-avatar-text":"var(--bpPrimary-700)"}:{"--header-bg":l.bg,"--header-bg-hover":l.bgHover,"--header-hover-dark":"var(--bpGray-200)","--header-title":"var(--bpGray-900)","--header-description":"var(--bpGray-600)","--header-description-icon":"var(--bpPrimary-700)","--header-description-link":"var(--bpPrimary-800)","--header-avatar-bg":"var(--bpPrimary-600)","--header-avatar-text":"var(--bpPrimary-50)"};return{...s,...f,...c}}const Vw=e=>{if(typeof URL.canParse=="function")return URL.canParse(e);try{return new URL(e),!0}catch{return!1}},$f=["audio","file","image","video"],Bf=e=>$f.includes(e),zf="The Client ID is required to initialize the webchat.",Ww="The API url is required to initialize the webchat.",qw="The Bot ID is required to initialize the webchat.",Yw="No config URL provided.",Uf=`Invalid API URL.
18
- Please use a valid API URL.`,jf=`Invalid Client ID.
19
- Please use a valid Botpress Client ID.`,Hf=`Invalid URL.
20
- Please make sure your client ID and API URL are valid`,Kw=`Invalid config URL.
21
- Please make sure your config URL is valid`,Gw=`Invalid webchat configuration.
22
- Please make sure your config file is valid`,Qw="Access denied to configuration file. Please check your credentials or your configuration URL and try again.",Vf=`This bot has temporarily paused.
23
- Please check back later.`,Wf=`This bot has temporarily paused.
24
- Please check back later.`,$s="Something went wrong. To fix it, please clear your browser's local and session storage and then refresh the page",Li="Please check your internet connection and refresh the page.",qf=`You've been disconnected from the conversation.
25
- Please refresh the page.`,Yf=`Unable to process the message.
26
- Please start a new conversation.`,Bs={ResourceNotFound:{type:"configuration",message:jf},Forbidden:{type:"bot",message:Vf}},zs={MethodNotFound:{type:"configuration",message:Hf},QuotaExceeded:{type:"bot",message:Wf},Forbidden:{type:"bot",message:$s}};function Kf(e){return e in Bs}function Gf(e){return e in zs}function Qf(e){return e!==null&&typeof e=="object"&&"id"in e&&"code"in e&&"type"in e}function Zf(e){return e!==null&&typeof e=="object"&&"type"in e&&e.type==="error"&&"message"in e&&typeof e.message=="string"}const Jf=async(e,t=3,n=1e3)=>{let r;for(let i=1;i<=t;i++)try{return await e()}catch(o){if(r=o,i===t)throw r;const s=n*Math.pow(2,i-1);await new Promise(a=>setTimeout(a,s))}throw new Error("Unreachable: retry loop should always return or throw")},Zw=["networkerror","failedtofetch","errorininputstream"],_r=e=>{var n;console.error("An error occurred:",e);let t={type:"unknown",message:"An unexpected error occurred"};if(Qf(e))e.type==="network"?t={id:e.id,type:"network",message:Li}:(n=e.message)!=null&&n.includes("[Webhook Handler]")&&Kf(e.type)?t={id:e.id,...Bs[e.type]}:Gf(e.type)?t={id:e.id,...zs[e.type]}:t={id:e.id,type:e.type,message:e.message||"An error occurred"};else if(Zf(e))Xf(e.message)?t={type:"disconnected",message:qf}:ed(e.message).includes("invalidcontenttype")?t={type:"bot",message:Yf}:t={type:"event",message:e.message};else if(e instanceof Error&&Xf(e.message))t={type:"network",message:Li};else if(e&&typeof e=="object"&&"type"in e&&"message"in e){const r=e;r.type==="network"?t={type:"network",message:Li}:t={type:r.type,message:r.message}}return t};function Xf(e){return Zw.some(t=>ed(e).includes(t))}function ed(e){return e.replaceAll(" ","").toLowerCase()}const Jw=(e,t)=>{if(!e)return{type:"configuration",message:zf};if(!Vw(t))return{type:"configuration",message:Uf}},Xw=e=>new Promise((t,n)=>{const r=new FileReader;r.onload=i=>{var o;return t((o=i.target)==null?void 0:o.result)},r.onerror=i=>{var o;return n((o=i.target)==null?void 0:o.error)},r.readAsArrayBuffer(e)});function e1(e,t,n,r){let i;return t&&e?i={conversationId:e,userToken:t}:t?i={conversationId:void 0,userToken:t}:i={conversationId:n,userToken:r},i}const En=D.forwardRef(({userId:e,src:t,container:n,image:r,fallback:i,...o},s)=>{const a=Ju(e??"",15);return k.jsxs(fs,{ref:s,"data-color":a,...n,...o,children:[k.jsx(ds,{src:t,...r}),k.jsx(hs,{...i,children:typeof o.children=="string"?o.children[0]:o.children})]})});En.displayName="Avatar";function FP(){}function RP(){}function t1(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const n1=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,r1=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,i1={};function td(e,t){return(i1.jsx?r1:n1).test(e)}const o1=/[ \t\n\f\r]/g;function s1(e){return typeof e=="object"?e.type==="text"?nd(e.value):!1:nd(e)}function nd(e){return e.replace(o1,"")===""}class Pr{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Pr.prototype.normal={},Pr.prototype.property={},Pr.prototype.space=void 0;function rd(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Pr(n,r,t)}function Us(e){return e.toLowerCase()}class ut{constructor(t,n){this.attribute=n,this.property=t}}ut.prototype.attribute="",ut.prototype.booleanish=!1,ut.prototype.boolean=!1,ut.prototype.commaOrSpaceSeparated=!1,ut.prototype.commaSeparated=!1,ut.prototype.defined=!1,ut.prototype.mustUseProperty=!1,ut.prototype.number=!1,ut.prototype.overloadedBoolean=!1,ut.prototype.property="",ut.prototype.spaceSeparated=!1,ut.prototype.space=void 0;let a1=0;const ye=Cn(),We=Cn(),js=Cn(),Z=Cn(),_e=Cn(),Hn=Cn(),pt=Cn();function Cn(){return 2**++a1}const Hs=Object.freeze(Object.defineProperty({__proto__:null,boolean:ye,booleanish:We,commaOrSpaceSeparated:pt,commaSeparated:Hn,number:Z,overloadedBoolean:js,spaceSeparated:_e},Symbol.toStringTag,{value:"Module"})),Vs=Object.keys(Hs);class Ws extends ut{constructor(t,n,r,i){let o=-1;if(super(t,n),id(this,"space",i),typeof r=="number")for(;++o<Vs.length;){const s=Vs[o];id(this,Vs[o],(r&Hs[s])===Hs[s])}}}Ws.prototype.defined=!0;function id(e,t,n){n&&(e[t]=n)}function Vn(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new Ws(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Us(r)]=r,n[Us(o.attribute)]=r}return new Pr(t,n,e.space)}const od=Vn({properties:{ariaActiveDescendant:null,ariaAtomic:We,ariaAutoComplete:null,ariaBusy:We,ariaChecked:We,ariaColCount:Z,ariaColIndex:Z,ariaColSpan:Z,ariaControls:_e,ariaCurrent:null,ariaDescribedBy:_e,ariaDetails:null,ariaDisabled:We,ariaDropEffect:_e,ariaErrorMessage:null,ariaExpanded:We,ariaFlowTo:_e,ariaGrabbed:We,ariaHasPopup:null,ariaHidden:We,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:_e,ariaLevel:Z,ariaLive:null,ariaModal:We,ariaMultiLine:We,ariaMultiSelectable:We,ariaOrientation:null,ariaOwns:_e,ariaPlaceholder:null,ariaPosInSet:Z,ariaPressed:We,ariaReadOnly:We,ariaRelevant:null,ariaRequired:We,ariaRoleDescription:_e,ariaRowCount:Z,ariaRowIndex:Z,ariaRowSpan:Z,ariaSelected:We,ariaSetSize:Z,ariaSort:null,ariaValueMax:Z,ariaValueMin:Z,ariaValueNow:Z,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function sd(e,t){return t in e?e[t]:t}function ad(e,t){return sd(e,t.toLowerCase())}const l1=Vn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Hn,acceptCharset:_e,accessKey:_e,action:null,allow:null,allowFullScreen:ye,allowPaymentRequest:ye,allowUserMedia:ye,alt:null,as:null,async:ye,autoCapitalize:null,autoComplete:_e,autoFocus:ye,autoPlay:ye,blocking:_e,capture:null,charSet:null,checked:ye,cite:null,className:_e,cols:Z,colSpan:null,content:null,contentEditable:We,controls:ye,controlsList:_e,coords:Z|Hn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ye,defer:ye,dir:null,dirName:null,disabled:ye,download:js,draggable:We,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ye,formTarget:null,headers:_e,height:Z,hidden:js,high:Z,href:null,hrefLang:null,htmlFor:_e,httpEquiv:_e,id:null,imageSizes:null,imageSrcSet:null,inert:ye,inputMode:null,integrity:null,is:null,isMap:ye,itemId:null,itemProp:_e,itemRef:_e,itemScope:ye,itemType:_e,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ye,low:Z,manifest:null,max:null,maxLength:Z,media:null,method:null,min:null,minLength:Z,multiple:ye,muted:ye,name:null,nonce:null,noModule:ye,noValidate:ye,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle: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:ye,optimum:Z,pattern:null,ping:_e,placeholder:null,playsInline:ye,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ye,referrerPolicy:null,rel:_e,required:ye,reversed:ye,rows:Z,rowSpan:Z,sandbox:_e,scope:null,scoped:ye,seamless:ye,selected:ye,shadowRootClonable:ye,shadowRootDelegatesFocus:ye,shadowRootMode:null,shape:null,size:Z,sizes:null,slot:null,span:Z,spellCheck:We,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Z,step:null,style:null,tabIndex:Z,target:null,title:null,translate:null,type:null,typeMustMatch:ye,useMap:null,value:We,width:Z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:_e,axis:null,background:null,bgColor:null,border:Z,borderColor:null,bottomMargin:Z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ye,declare:ye,event:null,face:null,frame:null,frameBorder:null,hSpace:Z,leftMargin:Z,link:null,longDesc:null,lowSrc:null,marginHeight:Z,marginWidth:Z,noResize:ye,noHref:ye,noShade:ye,noWrap:ye,object:null,profile:null,prompt:null,rev:null,rightMargin:Z,rules:null,scheme:null,scrolling:We,standby:null,summary:null,text:null,topMargin:Z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Z,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ye,disableRemotePlayback:ye,prefix:null,property:null,results:Z,security:null,unselectable:null},space:"html",transform:ad}),u1=Vn({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",transformOrigin:"transform-origin",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"},properties:{about:pt,accentHeight:Z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Z,amplitude:Z,arabicForm:null,ascent:Z,attributeName:null,attributeType:null,azimuth:Z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Z,by:null,calcMode:null,capHeight:Z,className:_e,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:Z,diffuseConstant:Z,direction:null,display:null,dur:null,divisor:Z,dominantBaseline:null,download:ye,dx:null,dy:null,edgeMode:null,editable:null,elevation:Z,enableBackground:null,end:null,event:null,exponent:Z,externalResourcesRequired:null,fill:null,fillOpacity:Z,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:Hn,g2:Hn,glyphName:Hn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Z,horizOriginX:Z,horizOriginY:Z,id:null,ideographic:Z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Z,k:Z,k1:Z,k2:Z,k3:Z,k4:Z,kernelMatrix:pt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Z,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:Z,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:Z,overlineThickness:Z,paintOrder:null,panose1:null,path:null,pathLength:Z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:_e,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Z,pointsAtY:Z,pointsAtZ:Z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:pt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:pt,rev:pt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:pt,requiredFeatures:pt,requiredFonts:pt,requiredFormats:pt,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:Z,specularExponent:Z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Z,strikethroughThickness:Z,string:null,stroke:null,strokeDashArray:pt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Z,strokeOpacity:Z,strokeWidth:null,style:null,surfaceScale:Z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:pt,tabIndex:Z,tableValues:null,target:null,targetX:Z,targetY:Z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:pt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Z,underlineThickness:Z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Z,values:null,vAlphabetic:Z,vMathematical:Z,vectorEffect:null,vHanging:Z,vIdeographic:Z,version:null,vertAdvY:Z,vertOriginX:Z,vertOriginY:Z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:sd}),ld=Vn({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),ud=Vn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ad}),cd=Vn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),c1={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"},f1=/[A-Z]/g,fd=/-[a-z]/g,d1=/^data[-\w.:]+$/i;function h1(e,t){const n=Us(t);let r=t,i=ut;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&d1.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(fd,m1);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!fd.test(o)){let s=o.replace(f1,p1);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=Ws}return new i(r,t)}function p1(e){return"-"+e.toLowerCase()}function m1(e){return e.charAt(1).toUpperCase()}const g1=rd([od,l1,ld,ud,cd],"html"),qs=rd([od,u1,ld,ud,cd],"svg");function y1(e){return e.join(" ").trim()}var Ys={},dd=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,v1=/\n/g,b1=/^\s*/,w1=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,S1=/^:\s*/,x1=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,k1=/^[;\s]*/,E1=/^\s+|\s+$/g,C1=`
27
- `,hd="/",pd="*",An="",A1="comment",T1="declaration";function I1(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(m){var p=m.match(v1);p&&(n+=p.length);var g=m.lastIndexOf(C1);r=~g?m.length-g:r+m.length}function o(){var m={line:n,column:r};return function(p){return p.position=new s(m),u(),p}}function s(m){this.start=m,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function a(m){var p=new Error(t.source+":"+n+":"+r+": "+m);if(p.reason=m,p.filename=t.source,p.line=n,p.column=r,p.source=e,!t.silent)throw p}function l(m){var p=m.exec(e);if(p){var g=p[0];return i(g),e=e.slice(g.length),p}}function u(){l(b1)}function f(m){var p;for(m=m||[];p=c();)p!==!1&&m.push(p);return m}function c(){var m=o();if(!(hd!=e.charAt(0)||pd!=e.charAt(1))){for(var p=2;An!=e.charAt(p)&&(pd!=e.charAt(p)||hd!=e.charAt(p+1));)++p;if(p+=2,An===e.charAt(p-1))return a("End of comment missing");var g=e.slice(2,p-2);return r+=2,i(g),e=e.slice(p),r+=2,m({type:A1,comment:g})}}function h(){var m=o(),p=l(w1);if(p){if(c(),!l(S1))return a("property missing ':'");var g=l(x1),y=m({type:T1,property:md(p[0].replace(dd,An)),value:g?md(g[0].replace(dd,An)):An});return l(k1),y}}function d(){var m=[];f(m);for(var p;p=h();)p!==!1&&(m.push(p),f(m));return m}return u(),d()}function md(e){return e?e.replace(E1,An):An}var O1=I1,M1=yn&&yn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ys,"__esModule",{value:!0}),Ys.default=N1;const D1=M1(O1);function N1(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,D1.default)(e),i=typeof t=="function";return r.forEach(o=>{if(o.type!=="declaration")return;const{property:s,value:a}=o;i?t(s,a,o):a&&(n=n||{},n[s]=a)}),n}var Fi={};Object.defineProperty(Fi,"__esModule",{value:!0}),Fi.camelCase=void 0;var _1=/^--[a-zA-Z0-9_-]+$/,P1=/-([a-z])/g,L1=/^[^-]+$/,F1=/^-(webkit|moz|ms|o|khtml)-/,R1=/^-(ms)-/,$1=function(e){return!e||L1.test(e)||_1.test(e)},B1=function(e,t){return t.toUpperCase()},gd=function(e,t){return"".concat(t,"-")},z1=function(e,t){return t===void 0&&(t={}),$1(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(R1,gd):e=e.replace(F1,gd),e.replace(P1,B1))};Fi.camelCase=z1;var U1=yn&&yn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},j1=U1(Ys),H1=Fi;function Ks(e,t){var n={};return!e||typeof e!="string"||(0,j1.default)(e,function(r,i){r&&i&&(n[(0,H1.camelCase)(r,t)]=i)}),n}Ks.default=Ks;var V1=Ks;const W1=vn(V1),yd=vd("end"),Gs=vd("start");function vd(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 q1(e){const t=Gs(e),n=yd(e);if(t&&n)return{start:t,end:n}}function Lr(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?bd(e.position):"start"in e||"end"in e?bd(e):"line"in e||"column"in e?Qs(e):""}function Qs(e){return wd(e&&e.line)+":"+wd(e&&e.column)}function bd(e){return Qs(e&&e.start)+"-"+Qs(e&&e.end)}function wd(e){return e&&typeof e=="number"?e:1}class et extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.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=Lr(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}et.prototype.file="",et.prototype.name="",et.prototype.reason="",et.prototype.message="",et.prototype.stack="",et.prototype.column=void 0,et.prototype.line=void 0,et.prototype.ancestors=void 0,et.prototype.cause=void 0,et.prototype.fatal=void 0,et.prototype.place=void 0,et.prototype.ruleId=void 0,et.prototype.source=void 0;const Zs={}.hasOwnProperty,Y1=new Map,K1=/[A-Z]/g,G1=new Set(["table","tbody","thead","tfoot","tr"]),Q1=new Set(["td","th"]),Sd="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Z1(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=oS(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=iS(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"?qs:g1,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=xd(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function xd(e,t,n){if(t.type==="element")return J1(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return X1(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return tS(e,t,n);if(t.type==="mdxjsEsm")return eS(e,t);if(t.type==="root")return nS(e,t,n);if(t.type==="text")return rS(e,t)}function J1(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=qs,e.schema=i),e.ancestors.push(t);const o=Ed(e,t.tagName,!1),s=sS(e,t);let a=Xs(e,t);return G1.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!s1(l):!0})),kd(e,s,o,t),Js(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function X1(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)}Fr(e,t.position)}function eS(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Fr(e,t.position)}function tS(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=qs,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:Ed(e,t.name,!0),s=aS(e,t),a=Xs(e,t);return kd(e,s,o,t),Js(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function nS(e,t,n){const r={};return Js(r,Xs(e,t)),e.create(t,e.Fragment,r,n)}function rS(e,t){return t.value}function kd(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Js(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function iS(e,t,n){return r;function r(i,o,s,a){const u=Array.isArray(s.children)?n:t;return a?u(o,s,a):u(o,s)}}function oS(e,t){return n;function n(r,i,o,s){const a=Array.isArray(o.children),l=Gs(r);return t(i,o,s,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function sS(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Zs.call(t.properties,i)){const o=lS(e,i,t.properties[i]);if(o){const[s,a]=o;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&Q1.has(t.tagName)?r=a:n[s]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function aS(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Fr(e,t.position);else{const i=r.name;let o;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,o=e.evaluater.evaluateExpression(a.expression)}else Fr(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Xs(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Y1;for(;++r<t.children.length;){const o=t.children[r];let s;if(e.passKeys){const l=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(l){const u=i.get(l)||0;s=l+"-"+u,i.set(l,u+1)}}const a=xd(e,o,s);a!==void 0&&n.push(a)}return n}function lS(e,t,n){const r=h1(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?t1(n):y1(n)),r.property==="style"){let i=typeof n=="object"?n:uS(e,String(n));return e.stylePropertyNameCase==="css"&&(i=cS(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?c1[r.property]||r.property:r.attribute,n]}}function uS(e,t){try{return W1(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new et("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Sd+"#cannot-parse-style-attribute",i}}function Ed(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,s;for(;++o<i.length;){const a=td(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=s}else r=td(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Zs.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Fr(e)}function Fr(e,t){const n=new et("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=Sd+"#cannot-handle-mdx-estrees-without-createevaluater",n}function cS(e){const t={};let n;for(n in e)Zs.call(e,n)&&(t[fS(n)]=e[n]);return t}function fS(e){let t=e.replace(K1,dS);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function dS(e){return"-"+e.toLowerCase()}const ea={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"]},hS={};function ta(e,t){const n=hS,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Cd(e,r,i)}function Cd(e,t,n){if(pS(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 Ad(e.children,t,n)}return Array.isArray(e)?Ad(e,t,n):""}function Ad(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Cd(e[i],t,n);return r.join("")}function pS(e){return!!(e&&typeof e=="object")}const Td=document.createElement("i");function na(e){const t="&"+e+";";Td.innerHTML=t;const n=Td.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function mt(e,t,n,r){const i=e.length;let o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function St(e,t){return e.length>0?(mt(e,e.length,0,t),e):t}const Id={}.hasOwnProperty;function Od(e){const t={};let n=-1;for(;++n<e.length;)mS(t,e[n]);return t}function mS(e,t){let n;for(n in t){const i=(Id.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){Id.call(i,s)||(i[s]=[]);const a=o[s];gS(i[s],Array.isArray(a)?a:a?[a]:[])}}}function gS(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);mt(e,0,0,r)}function Md(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 Mt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ot=sn(/[A-Za-z]/),tt=sn(/[\dA-Za-z]/),yS=sn(/[#-'*+\--9=?A-Z^-~]/);function Ri(e){return e!==null&&(e<32||e===127)}const ra=sn(/\d/),vS=sn(/[\dA-Fa-f]/),bS=sn(/[!-/:-@[-`{-~]/);function ce(e){return e!==null&&e<-2}function De(e){return e!==null&&(e<0||e===32)}function ve(e){return e===-2||e===-1||e===32}const $i=sn(new RegExp("\\p{P}|\\p{S}","u")),Tn=sn(/\s/);function sn(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Wn(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(o===37&&tt(e.charCodeAt(n+1))&&tt(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function ke(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(l){return ve(l)?(e.enter(n),a(l)):t(l)}function a(l){return ve(l)&&o++<i?(e.consume(l),a):(e.exit(n),t(l))}}const wS={tokenize:SS};function SS(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"),ke(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return ce(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),s)}}const xS={tokenize:kS},Dd={tokenize:ES};function kS(e){const t=this,n=[];let r=0,i,o,s;return a;function a(w){if(r<n.length){const E=n[r];return t.containerState=E[1],e.attempt(E[0].continuation,l,u)(w)}return u(w)}function l(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();const E=t.events.length;let S=E,C;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){C=t.events[S][1].end;break}y(r);let I=E;for(;I<t.events.length;)t.events[I][1].end={...C},I++;return mt(t.events,S+1,0,t.events.slice(E)),t.events.length=I,u(w)}return a(w)}function u(w){if(r===n.length){if(!i)return h(w);if(i.currentConstruct&&i.currentConstruct.concrete)return m(w);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Dd,f,c)(w)}function f(w){return i&&v(),y(r),h(w)}function c(w){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,m(w)}function h(w){return t.containerState={},e.attempt(Dd,d,m)(w)}function d(w){return r++,n.push([t.currentConstruct,t.containerState]),h(w)}function m(w){if(w===null){i&&v(),y(0),e.consume(w);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),p(w)}function p(w){if(w===null){g(e.exit("chunkFlow"),!0),y(0),e.consume(w);return}return ce(w)?(e.consume(w),g(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(w),p)}function g(w,E){const S=t.sliceStream(w);if(E&&S.push(null),w.previous=o,o&&(o.next=w),o=w,i.defineSkip(w.start),i.write(S),t.parser.lazy[w.start.line]){let C=i.events.length;for(;C--;)if(i.events[C][1].start.offset<s&&(!i.events[C][1].end||i.events[C][1].end.offset>s))return;const I=t.events.length;let M=I,P,T;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){if(P){T=t.events[M][1].end;break}P=!0}for(y(r),C=I;C<t.events.length;)t.events[C][1].end={...T},C++;mt(t.events,M+1,0,t.events.slice(I)),t.events.length=C}}function y(w){let E=n.length;for(;E-- >w;){const S=n[E];t.containerState=S[1],S[0].exit.call(t,e)}n.length=w}function v(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function ES(e,t,n){return ke(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function qn(e){if(e===null||De(e)||Tn(e))return 1;if($i(e))return 2}function Bi(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const ia={name:"attention",resolveAll:CS,tokenize:AS};function CS(e,t){let n=-1,r,i,o,s,a,l,u,f;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 c={...e[r][1].end},h={...e[n][1].start};Nd(c,-l),Nd(h,l),s={type:l>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},o={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[r][1].end={...s.start},e[n][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=St(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=St(u,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),u=St(u,Bi(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=St(u,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,u=St(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,mt(e,r-1,n-r+3,u),n=r+u.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function AS(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=qn(r);let o;return s;function s(l){return o=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===o)return e.consume(l),a;const u=e.exit("attentionSequence"),f=qn(l),c=!f||f===2&&i||n.includes(l),h=!i||i===2&&f||n.includes(r);return u._open=!!(o===42?c:c&&(i||!h)),u._close=!!(o===42?h:h&&(f||!c)),t(l)}}function Nd(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const TS={name:"autolink",tokenize:IS};function IS(e,t,n){let r=0;return i;function i(d){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(d){return ot(d)?(e.consume(d),s):d===64?n(d):u(d)}function s(d){return d===43||d===45||d===46||tt(d)?(r=1,a(d)):u(d)}function a(d){return d===58?(e.consume(d),r=0,l):(d===43||d===45||d===46||tt(d))&&r++<32?(e.consume(d),a):(r=0,u(d))}function l(d){return d===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):d===null||d===32||d===60||Ri(d)?n(d):(e.consume(d),l)}function u(d){return d===64?(e.consume(d),f):yS(d)?(e.consume(d),u):n(d)}function f(d){return tt(d)?c(d):n(d)}function c(d){return d===46?(e.consume(d),r=0,f):d===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):h(d)}function h(d){if((d===45||tt(d))&&r++<63){const m=d===45?h:c;return e.consume(d),m}return n(d)}}const Rr={partial:!0,tokenize:OS};function OS(e,t,n){return r;function r(o){return ve(o)?ke(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||ce(o)?t(o):n(o)}}const _d={continuation:{tokenize:DS},exit:NS,name:"blockQuote",tokenize:MS};function MS(e,t,n){const r=this;return i;function i(s){if(s===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return ve(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function DS(e,t,n){const r=this;return i;function i(s){return ve(s)?ke(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(_d,t,n)(s)}}function NS(e){e.exit("blockQuote")}const Pd={name:"characterEscape",tokenize:_S};function _S(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return bS(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const Ld={name:"characterReference",tokenize:PS};function PS(e,t,n){const r=this;let i=0,o,s;return a;function a(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),l}function l(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),o=31,s=tt,f(c))}function u(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=vS,f):(e.enter("characterReferenceValue"),o=7,s=ra,f(c))}function f(c){if(c===59&&i){const h=e.exit("characterReferenceValue");return s===tt&&!na(r.sliceSerialize(h))?n(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(c)&&i++<o?(e.consume(c),f):n(c)}}const Fd={partial:!0,tokenize:FS},Rd={concrete:!0,name:"codeFenced",tokenize:LS};function LS(e,t,n){const r=this,i={partial:!0,tokenize:S};let o=0,s=0,a;return l;function l(C){return u(C)}function u(C){const I=r.events[r.events.length-1];return o=I&&I[1].type==="linePrefix"?I[2].sliceSerialize(I[1],!0).length:0,a=C,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(C)}function f(C){return C===a?(s++,e.consume(C),f):s<3?n(C):(e.exit("codeFencedFenceSequence"),ve(C)?ke(e,c,"whitespace")(C):c(C))}function c(C){return C===null||ce(C)?(e.exit("codeFencedFence"),r.interrupt?t(C):e.check(Fd,p,E)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(C))}function h(C){return C===null||ce(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(C)):ve(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ke(e,d,"whitespace")(C)):C===96&&C===a?n(C):(e.consume(C),h)}function d(C){return C===null||ce(C)?c(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(C))}function m(C){return C===null||ce(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(C)):C===96&&C===a?n(C):(e.consume(C),m)}function p(C){return e.attempt(i,E,g)(C)}function g(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),y}function y(C){return o>0&&ve(C)?ke(e,v,"linePrefix",o+1)(C):v(C)}function v(C){return C===null||ce(C)?e.check(Fd,p,E)(C):(e.enter("codeFlowValue"),w(C))}function w(C){return C===null||ce(C)?(e.exit("codeFlowValue"),v(C)):(e.consume(C),w)}function E(C){return e.exit("codeFenced"),t(C)}function S(C,I,M){let P=0;return T;function T(R){return C.enter("lineEnding"),C.consume(R),C.exit("lineEnding"),O}function O(R){return C.enter("codeFencedFence"),ve(R)?ke(C,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):U(R)}function U(R){return R===a?(C.enter("codeFencedFenceSequence"),F(R)):M(R)}function F(R){return R===a?(P++,C.consume(R),F):P>=s?(C.exit("codeFencedFenceSequence"),ve(R)?ke(C,L,"whitespace")(R):L(R)):M(R)}function L(R){return R===null||ce(R)?(C.exit("codeFencedFence"),I(R)):M(R)}}}function FS(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const oa={name:"codeIndented",tokenize:$S},RS={partial:!0,tokenize:BS};function $S(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),ke(e,o,"linePrefix",5)(u)}function o(u){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?s(u):n(u)}function s(u){return u===null?l(u):ce(u)?e.attempt(RS,s,l)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||ce(u)?(e.exit("codeFlowValue"),s(u)):(e.consume(u),a)}function l(u){return e.exit("codeIndented"),t(u)}}function BS(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):ce(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):ke(e,o,"linePrefix",5)(s)}function o(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):ce(s)?i(s):n(s)}}const zS={name:"codeText",previous:jS,resolve:US,tokenize:HS};function US(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 jS(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function HS(e,t,n){let r=0,i,o;return s;function s(c){return e.enter("codeText"),e.enter("codeTextSequence"),a(c)}function a(c){return c===96?(e.consume(c),r++,a):(e.exit("codeTextSequence"),l(c))}function l(c){return c===null?n(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),l):c===96?(o=e.enter("codeTextSequence"),i=0,f(c)):ce(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l):(e.enter("codeTextData"),u(c))}function u(c){return c===null||c===32||c===96||ce(c)?(e.exit("codeTextData"),l(c)):(e.consume(c),u)}function f(c){return c===96?(e.consume(c),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(c)):(o.type="codeTextData",u(c))}}class VS{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&$r(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),$r(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),$r(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);$r(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);$r(this.left,n.reverse())}}}function $r(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function $d(e){const t={};let n=-1,r,i,o,s,a,l,u;const f=new VS(e);for(;++n<f.length;){for(;n in t;)n=t[n];if(r=f.get(n),n&&r[1].type==="chunkFlow"&&f.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,WS(f,n)),n=t[n],u=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(s=f.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},a=f.slice(i,n),a.unshift(r),f.splice(i,n-i+1,a))}}return mt(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!u}function WS(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const a=s.events,l=[],u={};let f,c,h=-1,d=n,m=0,p=0;const g=[p];for(;d;){for(;e.get(++i)[1]!==d;);o.push(i),d._tokenizer||(f=r.sliceStream(d),d.next||f.push(null),c&&s.defineSkip(d.start),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(f),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),c=d,d=d.next}for(d=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&&(p=h+1,g.push(p),d._tokenizer=void 0,d.previous=void 0,d=d.next);for(s.events=[],d?(d._tokenizer=void 0,d.previous=void 0):g.pop(),h=g.length;h--;){const y=a.slice(g[h],g[h+1]),v=o.pop();l.push([v,v+y.length-1]),e.splice(v,2,y)}for(l.reverse(),h=-1;++h<l.length;)u[m+l[h][0]]=m+l[h][1],m+=l[h][1]-l[h][0]-1;return u}const qS={resolve:KS,tokenize:GS},YS={partial:!0,tokenize:QS};function KS(e){return $d(e),e}function GS(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?o(a):ce(a)?e.check(YS,s,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function QS(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),ke(e,o,"linePrefix")}function o(s){if(s===null||ce(s))return n(s);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(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function Bd(e,t,n,r,i,o,s,a,l){const u=l||Number.POSITIVE_INFINITY;let f=0;return c;function c(y){return y===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(y),e.exit(o),h):y===null||y===32||y===41||Ri(y)?n(y):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),p(y))}function h(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),d(y))}function d(y){return y===62?(e.exit("chunkString"),e.exit(a),h(y)):y===null||y===60||ce(y)?n(y):(e.consume(y),y===92?m:d)}function m(y){return y===60||y===62||y===92?(e.consume(y),d):d(y)}function p(y){return!f&&(y===null||y===41||De(y))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(y)):f<u&&y===40?(e.consume(y),f++,p):y===41?(e.consume(y),f--,p):y===null||y===32||y===40||Ri(y)?n(y):(e.consume(y),y===92?g:p)}function g(y){return y===40||y===41||y===92?(e.consume(y),p):p(y)}}function zd(e,t,n,r,i,o){const s=this;let a=0,l;return u;function u(d){return e.enter(r),e.enter(i),e.consume(d),e.exit(i),e.enter(o),f}function f(d){return a>999||d===null||d===91||d===93&&!l||d===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(d):d===93?(e.exit(o),e.enter(i),e.consume(d),e.exit(i),e.exit(r),t):ce(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),c(d))}function c(d){return d===null||d===91||d===93||ce(d)||a++>999?(e.exit("chunkString"),f(d)):(e.consume(d),l||(l=!ve(d)),d===92?h:c)}function h(d){return d===91||d===92||d===93?(e.consume(d),a++,c):c(d)}}function Ud(e,t,n,r,i,o){let s;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),s=h===40?41:h,l):n(h)}function l(h){return h===s?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(o),u(h))}function u(h){return h===s?(e.exit(o),l(s)):h===null?n(h):ce(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),ke(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===s||h===null||ce(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?c:f)}function c(h){return h===s||h===92?(e.consume(h),f):f(h)}}function Br(e,t){let n;return r;function r(i){return ce(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ve(i)?ke(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const ZS={name:"definition",tokenize:XS},JS={partial:!0,tokenize:ex};function XS(e,t,n){const r=this;let i;return o;function o(d){return e.enter("definition"),s(d)}function s(d){return zd.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function a(d){return i=Mt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),d===58?(e.enter("definitionMarker"),e.consume(d),e.exit("definitionMarker"),l):n(d)}function l(d){return De(d)?Br(e,u)(d):u(d)}function u(d){return Bd(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function f(d){return e.attempt(JS,c,c)(d)}function c(d){return ve(d)?ke(e,h,"whitespace")(d):h(d)}function h(d){return d===null||ce(d)?(e.exit("definition"),r.parser.defined.push(i),t(d)):n(d)}}function ex(e,t,n){return r;function r(a){return De(a)?Br(e,i)(a):n(a)}function i(a){return Ud(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return ve(a)?ke(e,s,"whitespace")(a):s(a)}function s(a){return a===null||ce(a)?t(a):n(a)}}const tx={name:"hardBreakEscape",tokenize:nx};function nx(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return ce(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const rx={name:"headingAtx",resolve:ix,tokenize:ox};function ix(e,t){let n=e.length-2,r=3,i,o;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},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},mt(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function ox(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),s(f)}function s(f){return f===35&&r++<6?(e.consume(f),s):f===null||De(f)?(e.exit("atxHeadingSequence"),a(f)):n(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),l(f)):f===null||ce(f)?(e.exit("atxHeading"),t(f)):ve(f)?ke(e,a,"whitespace")(f):(e.enter("atxHeadingText"),u(f))}function l(f){return f===35?(e.consume(f),l):(e.exit("atxHeadingSequence"),a(f))}function u(f){return f===null||f===35||De(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),u)}}const sx=["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"],jd=["pre","script","style","textarea"],ax={concrete:!0,name:"htmlFlow",resolveTo:cx,tokenize:fx},lx={partial:!0,tokenize:hx},ux={partial:!0,tokenize:dx};function cx(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 fx(e,t,n){const r=this;let i,o,s,a,l;return u;function u(x){return f(x)}function f(x){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(x),c}function c(x){return x===33?(e.consume(x),h):x===47?(e.consume(x),o=!0,p):x===63?(e.consume(x),i=3,r.interrupt?t:b):ot(x)?(e.consume(x),s=String.fromCharCode(x),g):n(x)}function h(x){return x===45?(e.consume(x),i=2,d):x===91?(e.consume(x),i=5,a=0,m):ot(x)?(e.consume(x),i=4,r.interrupt?t:b):n(x)}function d(x){return x===45?(e.consume(x),r.interrupt?t:b):n(x)}function m(x){const V="CDATA[";return x===V.charCodeAt(a++)?(e.consume(x),a===V.length?r.interrupt?t:U:m):n(x)}function p(x){return ot(x)?(e.consume(x),s=String.fromCharCode(x),g):n(x)}function g(x){if(x===null||x===47||x===62||De(x)){const V=x===47,Y=s.toLowerCase();return!V&&!o&&jd.includes(Y)?(i=1,r.interrupt?t(x):U(x)):sx.includes(s.toLowerCase())?(i=6,V?(e.consume(x),y):r.interrupt?t(x):U(x)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(x):o?v(x):w(x))}return x===45||tt(x)?(e.consume(x),s+=String.fromCharCode(x),g):n(x)}function y(x){return x===62?(e.consume(x),r.interrupt?t:U):n(x)}function v(x){return ve(x)?(e.consume(x),v):T(x)}function w(x){return x===47?(e.consume(x),T):x===58||x===95||ot(x)?(e.consume(x),E):ve(x)?(e.consume(x),w):T(x)}function E(x){return x===45||x===46||x===58||x===95||tt(x)?(e.consume(x),E):S(x)}function S(x){return x===61?(e.consume(x),C):ve(x)?(e.consume(x),S):w(x)}function C(x){return x===null||x===60||x===61||x===62||x===96?n(x):x===34||x===39?(e.consume(x),l=x,I):ve(x)?(e.consume(x),C):M(x)}function I(x){return x===l?(e.consume(x),l=null,P):x===null||ce(x)?n(x):(e.consume(x),I)}function M(x){return x===null||x===34||x===39||x===47||x===60||x===61||x===62||x===96||De(x)?S(x):(e.consume(x),M)}function P(x){return x===47||x===62||ve(x)?w(x):n(x)}function T(x){return x===62?(e.consume(x),O):n(x)}function O(x){return x===null||ce(x)?U(x):ve(x)?(e.consume(x),O):n(x)}function U(x){return x===45&&i===2?(e.consume(x),N):x===60&&i===1?(e.consume(x),j):x===62&&i===4?(e.consume(x),_):x===63&&i===3?(e.consume(x),b):x===93&&i===5?(e.consume(x),W):ce(x)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(lx,H,F)(x)):x===null||ce(x)?(e.exit("htmlFlowData"),F(x)):(e.consume(x),U)}function F(x){return e.check(ux,L,H)(x)}function L(x){return e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),R}function R(x){return x===null||ce(x)?F(x):(e.enter("htmlFlowData"),U(x))}function N(x){return x===45?(e.consume(x),b):U(x)}function j(x){return x===47?(e.consume(x),s="",B):U(x)}function B(x){if(x===62){const V=s.toLowerCase();return jd.includes(V)?(e.consume(x),_):U(x)}return ot(x)&&s.length<8?(e.consume(x),s+=String.fromCharCode(x),B):U(x)}function W(x){return x===93?(e.consume(x),b):U(x)}function b(x){return x===62?(e.consume(x),_):x===45&&i===2?(e.consume(x),b):U(x)}function _(x){return x===null||ce(x)?(e.exit("htmlFlowData"),H(x)):(e.consume(x),_)}function H(x){return e.exit("htmlFlow"),t(x)}}function dx(e,t,n){const r=this;return i;function i(s){return ce(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function hx(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Rr,t,n)}}const px={name:"htmlText",tokenize:mx};function mx(e,t,n){const r=this;let i,o,s;return a;function a(b){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(b),l}function l(b){return b===33?(e.consume(b),u):b===47?(e.consume(b),S):b===63?(e.consume(b),w):ot(b)?(e.consume(b),M):n(b)}function u(b){return b===45?(e.consume(b),f):b===91?(e.consume(b),o=0,m):ot(b)?(e.consume(b),v):n(b)}function f(b){return b===45?(e.consume(b),d):n(b)}function c(b){return b===null?n(b):b===45?(e.consume(b),h):ce(b)?(s=c,j(b)):(e.consume(b),c)}function h(b){return b===45?(e.consume(b),d):c(b)}function d(b){return b===62?N(b):b===45?h(b):c(b)}function m(b){const _="CDATA[";return b===_.charCodeAt(o++)?(e.consume(b),o===_.length?p:m):n(b)}function p(b){return b===null?n(b):b===93?(e.consume(b),g):ce(b)?(s=p,j(b)):(e.consume(b),p)}function g(b){return b===93?(e.consume(b),y):p(b)}function y(b){return b===62?N(b):b===93?(e.consume(b),y):p(b)}function v(b){return b===null||b===62?N(b):ce(b)?(s=v,j(b)):(e.consume(b),v)}function w(b){return b===null?n(b):b===63?(e.consume(b),E):ce(b)?(s=w,j(b)):(e.consume(b),w)}function E(b){return b===62?N(b):w(b)}function S(b){return ot(b)?(e.consume(b),C):n(b)}function C(b){return b===45||tt(b)?(e.consume(b),C):I(b)}function I(b){return ce(b)?(s=I,j(b)):ve(b)?(e.consume(b),I):N(b)}function M(b){return b===45||tt(b)?(e.consume(b),M):b===47||b===62||De(b)?P(b):n(b)}function P(b){return b===47?(e.consume(b),N):b===58||b===95||ot(b)?(e.consume(b),T):ce(b)?(s=P,j(b)):ve(b)?(e.consume(b),P):N(b)}function T(b){return b===45||b===46||b===58||b===95||tt(b)?(e.consume(b),T):O(b)}function O(b){return b===61?(e.consume(b),U):ce(b)?(s=O,j(b)):ve(b)?(e.consume(b),O):P(b)}function U(b){return b===null||b===60||b===61||b===62||b===96?n(b):b===34||b===39?(e.consume(b),i=b,F):ce(b)?(s=U,j(b)):ve(b)?(e.consume(b),U):(e.consume(b),L)}function F(b){return b===i?(e.consume(b),i=void 0,R):b===null?n(b):ce(b)?(s=F,j(b)):(e.consume(b),F)}function L(b){return b===null||b===34||b===39||b===60||b===61||b===96?n(b):b===47||b===62||De(b)?P(b):(e.consume(b),L)}function R(b){return b===47||b===62||De(b)?P(b):n(b)}function N(b){return b===62?(e.consume(b),e.exit("htmlTextData"),e.exit("htmlText"),t):n(b)}function j(b){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),B}function B(b){return ve(b)?ke(e,W,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):W(b)}function W(b){return e.enter("htmlTextData"),s(b)}}const sa={name:"labelEnd",resolveAll:bx,resolveTo:wx,tokenize:Sx},gx={tokenize:xx},yx={tokenize:kx},vx={tokenize:Ex};function bx(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&mt(e,0,e.length,n),e}function wx(e,t){let n=e.length,r=0,i,o,s,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const l={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[o][1].start},end:{...e[s][1].end}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",l,t],["enter",u,t]],a=St(a,e.slice(o+1,o+r+3)),a=St(a,[["enter",f,t]]),a=St(a,Bi(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),a=St(a,[["exit",f,t],e[s-2],e[s-1],["exit",u,t]]),a=St(a,e.slice(s+1)),a=St(a,[["exit",l,t]]),mt(e,o,e.length,a),e}function Sx(e,t,n){const r=this;let i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(h){return o?o._inactive?c(h):(s=r.parser.defined.includes(Mt(r.sliceSerialize({start:o.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(gx,f,s?f:c)(h):h===91?e.attempt(yx,f,s?u:c)(h):s?f(h):c(h)}function u(h){return e.attempt(vx,f,c)(h)}function f(h){return t(h)}function c(h){return o._balanced=!0,n(h)}}function xx(e,t,n){return r;function r(c){return e.enter("resource"),e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),i}function i(c){return De(c)?Br(e,o)(c):o(c)}function o(c){return c===41?f(c):Bd(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function s(c){return De(c)?Br(e,l)(c):f(c)}function a(c){return n(c)}function l(c){return c===34||c===39||c===40?Ud(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):f(c)}function u(c){return De(c)?Br(e,f)(c):f(c)}function f(c){return c===41?(e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),e.exit("resource"),t):n(c)}}function kx(e,t,n){const r=this;return i;function i(a){return zd.call(r,e,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(Mt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function Ex(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const Cx={name:"labelStartImage",resolveAll:sa.resolveAll,tokenize:Ax};function Ax(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const Tx={name:"labelStartLink",resolveAll:sa.resolveAll,tokenize:Ix};function Ix(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const aa={name:"lineEnding",tokenize:Ox};function Ox(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ke(e,t,"linePrefix")}}const zi={name:"thematicBreak",tokenize:Mx};function Mx(e,t,n){let r=0,i;return o;function o(u){return e.enter("thematicBreak"),s(u)}function s(u){return i=u,a(u)}function a(u){return u===i?(e.enter("thematicBreakSequence"),l(u)):r>=3&&(u===null||ce(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===i?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),ve(u)?ke(e,a,"whitespace")(u):a(u))}}const ct={continuation:{tokenize:Px},exit:Fx,name:"list",tokenize:_x},Dx={partial:!0,tokenize:Rx},Nx={partial:!0,tokenize:Lx};function _x(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(d){const m=r.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||d===r.containerState.marker:ra(d)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),d===42||d===45?e.check(zi,n,u)(d):u(d);if(!r.interrupt||d===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(d)}return n(d)}function l(d){return ra(d)&&++s<10?(e.consume(d),l):(!r.interrupt||s<2)&&(r.containerState.marker?d===r.containerState.marker:d===41||d===46)?(e.exit("listItemValue"),u(d)):n(d)}function u(d){return e.enter("listItemMarker"),e.consume(d),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||d,e.check(Rr,r.interrupt?n:f,e.attempt(Dx,h,c))}function f(d){return r.containerState.initialBlankLine=!0,o++,h(d)}function c(d){return ve(d)?(e.enter("listItemPrefixWhitespace"),e.consume(d),e.exit("listItemPrefixWhitespace"),h):n(d)}function h(d){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(d)}}function Px(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Rr,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ke(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!ve(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Nx,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,ke(e,e.attempt(ct,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Lx(e,t,n){const r=this;return ke(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function Fx(e){e.exit(this.containerState.type)}function Rx(e,t,n){const r=this;return ke(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!ve(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Hd={name:"setextUnderline",resolveTo:$x,tokenize:Bx};function $x(e,t){let n=e.length,r,i,o;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),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function Bx(e,t,n){const r=this;let i;return o;function o(u){let f=r.events.length,c;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){c=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=u,s(u)):n(u)}function s(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),ve(u)?ke(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||ce(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const zx={tokenize:Ux};function Ux(e){const t=this,n=e.attempt(Rr,r,e.attempt(this.parser.constructs.flowInitial,i,ke(e,e.attempt(this.parser.constructs.flow,i,e.attempt(qS,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const jx={resolveAll:Wd()},Hx=Vd("string"),Vx=Vd("text");function Vd(e){return{resolveAll:Wd(e==="text"?Wx:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,a);return s;function s(f){return u(f)?o(f):a(f)}function a(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),l}function l(f){return u(f)?(n.exit("data"),o(f)):(n.consume(f),l)}function u(f){if(f===null)return!0;const c=i[f];let h=-1;if(c)for(;++h<c.length;){const d=c[h];if(!d.previous||d.previous.call(r,r.previous))return!0}return!1}}}function Wd(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function Wx(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 o=i.length,s=-1,a=0,l;for(;o--;){const u=i[o];if(typeof u=="string"){for(s=u.length;u.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(u===-2)l=!0,a++;else if(u!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const u={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:r.start._bufferIndex+s,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const qx=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:ZS},disable:{null:[]},document:{42:ct,43:ct,45:ct,48:ct,49:ct,50:ct,51:ct,52:ct,53:ct,54:ct,55:ct,56:ct,57:ct,62:_d},flow:{35:rx,42:zi,45:[Hd,zi],60:ax,61:Hd,95:zi,96:Rd,126:Rd},flowInitial:{[-2]:oa,[-1]:oa,32:oa},insideSpan:{null:[ia,jx]},string:{38:Ld,92:Pd},text:{[-5]:aa,[-4]:aa,[-3]:aa,33:Cx,38:Ld,42:ia,60:[TS,px],91:Tx,92:[tx,Pd],93:sa,95:ia,96:zS}},Symbol.toStringTag,{value:"Module"}));function Yx(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let s=[],a=[];const l={attempt:I(S),check:I(C),consume:v,enter:w,exit:E,interrupt:I(C,{interrupt:!0})},u={code:null,containerState:{},defineSkip:p,events:[],now:m,parser:e,previous:null,sliceSerialize:h,sliceStream:d,write:c};let f=t.tokenize.call(u,l);return t.resolveAll&&o.push(t),u;function c(O){return s=St(s,O),g(),s[s.length-1]!==null?[]:(M(t,0),u.events=Bi(o,u.events,u),u.events)}function h(O,U){return Gx(d(O),U)}function d(O){return Kx(s,O)}function m(){const{_bufferIndex:O,_index:U,line:F,column:L,offset:R}=r;return{_bufferIndex:O,_index:U,line:F,column:L,offset:R}}function p(O){i[O.line]=O.column,T()}function g(){let O;for(;r._index<s.length;){const U=s[r._index];if(typeof U=="string")for(O=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===O&&r._bufferIndex<U.length;)y(U.charCodeAt(r._bufferIndex));else y(U)}}function y(O){f=f(O)}function v(O){ce(O)?(r.line++,r.column=1,r.offset+=O===-3?2:1,T()):O!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=O}function w(O,U){const F=U||{};return F.type=O,F.start=m(),u.events.push(["enter",F,u]),a.push(F),F}function E(O){const U=a.pop();return U.end=m(),u.events.push(["exit",U,u]),U}function S(O,U){M(O,U.from)}function C(O,U){U.restore()}function I(O,U){return F;function F(L,R,N){let j,B,W,b;return Array.isArray(L)?H(L):"tokenize"in L?H([L]):_(L);function _(q){return Q;function Q(X){const se=X!==null&&q[X],G=X!==null&&q.null,te=[...Array.isArray(se)?se:se?[se]:[],...Array.isArray(G)?G:G?[G]:[]];return H(te)(X)}}function H(q){return j=q,B=0,q.length===0?N:x(q[B])}function x(q){return Q;function Q(X){return b=P(),W=q,q.partial||(u.currentConstruct=q),q.name&&u.parser.constructs.disable.null.includes(q.name)?Y():q.tokenize.call(U?Object.assign(Object.create(u),U):u,l,V,Y)(X)}}function V(q){return O(W,b),R}function Y(q){return b.restore(),++B<j.length?x(j[B]):N}}}function M(O,U){O.resolveAll&&!o.includes(O)&&o.push(O),O.resolve&&mt(u.events,U,u.events.length-U,O.resolve(u.events.slice(U),u)),O.resolveTo&&(u.events=O.resolveTo(u.events,u))}function P(){const O=m(),U=u.previous,F=u.currentConstruct,L=u.events.length,R=Array.from(a);return{from:L,restore:N};function N(){r=O,u.previous=U,u.currentConstruct=F,u.events.length=L,a=R,T()}}function T(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Kx(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function Gx(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
17
+ */var Hu;function eb(){return Hu||(Hu=1,process.env.NODE_ENV!=="production"&&function(){function e(d,m){return d===m&&(d!==0||1/d===1/m)||d!==d&&m!==m}function t(d,m){f||i.startTransition===void 0||(f=!0,console.error("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 p=m();if(!c){var g=m();o(p,g)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}g=s({inst:{value:p,getSnapshot:m}});var v=g[0].inst,y=g[1];return l(function(){v.value=p,v.getSnapshot=m,n(v)&&y({inst:v})},[d,p,m]),a(function(){return n(v)&&y({inst:v}),d(function(){n(v)&&y({inst:v})})},[d]),u(p),p}function n(d){var m=d.getSnapshot;d=d.value;try{var p=m();return!o(d,p)}catch{return!0}}function r(d,m){return m()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var i=M,o=typeof Object.is=="function"?Object.is:e,s=i.useState,a=i.useEffect,l=i.useLayoutEffect,u=i.useDebugValue,f=!1,c=!1,h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;ss.useSyncExternalStore=i.useSyncExternalStore!==void 0?i.useSyncExternalStore:h,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),ss}process.env.NODE_ENV==="production"?is.exports=Xv():is.exports=eb();var as=is.exports;function tb(){return as.useSyncExternalStore(nb,()=>!0,()=>!1)}function nb(){return()=>{}}var ls="Avatar",[rb]=Hv(ls),[ib,ju]=rb(ls),us=C.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,o]=C.useState("idle");return x.jsx(ib,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:o,children:x.jsx(rs.span,{...r,ref:t})})});us.displayName=ls;var Vu="AvatarImage",cs=C.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...o}=e,s=ju(Vu,n),a=ob(r,o),l=Ln(u=>{i(u),s.onImageLoadingStatusChange(u)});return en(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?x.jsx(rs.img,{...o,ref:t,src:r}):null});cs.displayName=Vu;var Wu="AvatarFallback",fs=C.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,o=ju(Wu,n),[s,a]=C.useState(r===void 0);return C.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(l)}},[r]),s&&o.imageLoadingStatus!=="loaded"?x.jsx(rs.span,{...i,ref:t}):null});fs.displayName=Wu;function qu(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function ob(e,{referrerPolicy:t,crossOrigin:n}){const r=tb(),i=C.useRef(null),o=r?(i.current||(i.current=new window.Image),i.current):null,[s,a]=C.useState(()=>qu(o,e));return en(()=>{a(qu(o,e))},[o,e]),en(()=>{const l=c=>()=>{a(c)};if(!o)return;const u=l("loaded"),f=l("error");return o.addEventListener("load",u),o.addEventListener("error",f),t&&(o.referrerPolicy=t),typeof n=="string"&&(o.crossOrigin=n),()=>{o.removeEventListener("load",u),o.removeEventListener("error",f)}},[o,n,t]),s}function Yu(e,t){let n=`${e} {`;for(const[r,i]of Object.entries(t))n+=`${r}: ${i}; `;return n+="}",n}function Ku(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 sb=(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 o=new Image;o.addEventListener("load",()=>{i&&clearTimeout(i),n({width:o.naturalWidth,height:o.naturalHeight})}),o.addEventListener("error",s=>{i&&clearTimeout(i),r(`${s.type}: ${s.message}`)}),o.src=e,t.timeout&&(i=setTimeout(()=>r("Timeout"),t.timeout))});var Gu={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(yn,function(){var n=1e3,r=6e4,i=36e5,o="millisecond",s="second",a="minute",l="hour",u="day",f="week",c="month",h="quarter",d="year",m="date",p="Invalid Date",g=/^(\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,y={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(F){var R=["th","st","nd","rd"],N=F%100;return"["+F+(R[(N-20)%10]||R[N]||R[0])+"]"}},w=function(F,R,N){var H=String(F);return!H||H.length>=R?F:""+Array(R+1-H.length).join(N)+F},A={s:w,z:function(F){var R=-F.utcOffset(),N=Math.abs(R),H=Math.floor(N/60),z=N%60;return(R<=0?"+":"-")+w(H,2,"0")+":"+w(z,2,"0")},m:function F(R,N){if(R.date()<N.date())return-F(N,R);var H=12*(N.year()-R.year())+(N.month()-R.month()),z=R.clone().add(H,c),W=N-z<0,b=R.clone().add(H+(W?-1:1),c);return+(-(H+(N-z)/(W?z-b:b-z))||0)},a:function(F){return F<0?Math.ceil(F)||0:Math.floor(F)},p:function(F){return{M:c,y:d,w:f,d:u,D:m,h:l,m:a,s,ms:o,Q:h}[F]||String(F||"").toLowerCase().replace(/s$/,"")},u:function(F){return F===void 0}},k="en",E={};E[k]=y;var I="$isDayjsObject",D=function(F){return F instanceof B||!(!F||!F[I])},P=function F(R,N,H){var z;if(!R)return k;if(typeof R=="string"){var W=R.toLowerCase();E[W]&&(z=W),N&&(E[W]=N,z=W);var b=R.split("-");if(!z&&b.length>1)return F(b[0])}else{var _=R.name;E[_]=R,z=_}return!H&&z&&(k=z),z||!H&&k},T=function(F,R){if(D(F))return F.clone();var N=typeof R=="object"?R:{};return N.date=F,N.args=arguments,new B(N)},O=A;O.l=P,O.i=D,O.w=function(F,R){return T(F,{locale:R.$L,utc:R.$u,x:R.$x,$offset:R.$offset})};var B=function(){function F(N){this.$L=P(N.locale,null,!0),this.parse(N),this.$x=this.$x||N.x||{},this[I]=!0}var R=F.prototype;return R.parse=function(N){this.$d=function(H){var z=H.date,W=H.utc;if(z===null)return new Date(NaN);if(O.u(z))return new Date;if(z instanceof Date)return new Date(z);if(typeof z=="string"&&!/Z$/i.test(z)){var b=z.match(g);if(b){var _=b[2]-1||0,j=(b[7]||"0").substring(0,3);return W?new Date(Date.UTC(b[1],_,b[3]||1,b[4]||0,b[5]||0,b[6]||0,j)):new Date(b[1],_,b[3]||1,b[4]||0,b[5]||0,b[6]||0,j)}}return new Date(z)}(N),this.init()},R.init=function(){var N=this.$d;this.$y=N.getFullYear(),this.$M=N.getMonth(),this.$D=N.getDate(),this.$W=N.getDay(),this.$H=N.getHours(),this.$m=N.getMinutes(),this.$s=N.getSeconds(),this.$ms=N.getMilliseconds()},R.$utils=function(){return O},R.isValid=function(){return this.$d.toString()!==p},R.isSame=function(N,H){var z=T(N);return this.startOf(H)<=z&&z<=this.endOf(H)},R.isAfter=function(N,H){return T(N)<this.startOf(H)},R.isBefore=function(N,H){return this.endOf(H)<T(N)},R.$g=function(N,H,z){return O.u(N)?this[H]:this.set(z,N)},R.unix=function(){return Math.floor(this.valueOf()/1e3)},R.valueOf=function(){return this.$d.getTime()},R.startOf=function(N,H){var z=this,W=!!O.u(H)||H,b=O.p(N),_=function(se,G){var te=O.w(z.$u?Date.UTC(z.$y,G,se):new Date(z.$y,G,se),z);return W?te:te.endOf(u)},j=function(se,G){return O.w(z.toDate()[se].apply(z.toDate("s"),(W?[0,0,0,0]:[23,59,59,999]).slice(G)),z)},S=this.$W,V=this.$M,Y=this.$D,q="set"+(this.$u?"UTC":"");switch(b){case d:return W?_(1,0):_(31,11);case c:return W?_(1,V):_(0,V+1);case f:var Q=this.$locale().weekStart||0,X=(S<Q?S+7:S)-Q;return _(W?Y-X:Y+(6-X),V);case u:case m:return j(q+"Hours",0);case l:return j(q+"Minutes",1);case a:return j(q+"Seconds",2);case s:return j(q+"Milliseconds",3);default:return this.clone()}},R.endOf=function(N){return this.startOf(N,!1)},R.$set=function(N,H){var z,W=O.p(N),b="set"+(this.$u?"UTC":""),_=(z={},z[u]=b+"Date",z[m]=b+"Date",z[c]=b+"Month",z[d]=b+"FullYear",z[l]=b+"Hours",z[a]=b+"Minutes",z[s]=b+"Seconds",z[o]=b+"Milliseconds",z)[W],j=W===u?this.$D+(H-this.$W):H;if(W===c||W===d){var S=this.clone().set(m,1);S.$d[_](j),S.init(),this.$d=S.set(m,Math.min(this.$D,S.daysInMonth())).$d}else _&&this.$d[_](j);return this.init(),this},R.set=function(N,H){return this.clone().$set(N,H)},R.get=function(N){return this[O.p(N)]()},R.add=function(N,H){var z,W=this;N=Number(N);var b=O.p(H),_=function(V){var Y=T(W);return O.w(Y.date(Y.date()+Math.round(V*N)),W)};if(b===c)return this.set(c,this.$M+N);if(b===d)return this.set(d,this.$y+N);if(b===u)return _(1);if(b===f)return _(7);var j=(z={},z[a]=r,z[l]=i,z[s]=n,z)[b]||1,S=this.$d.getTime()+N*j;return O.w(S,this)},R.subtract=function(N,H){return this.add(-1*N,H)},R.format=function(N){var H=this,z=this.$locale();if(!this.isValid())return z.invalidDate||p;var W=N||"YYYY-MM-DDTHH:mm:ssZ",b=O.z(this),_=this.$H,j=this.$m,S=this.$M,V=z.weekdays,Y=z.months,q=z.meridiem,Q=function(G,te,$,ne){return G&&(G[te]||G(H,W))||$[te].slice(0,ne)},X=function(G){return O.s(_%12||12,G,"0")},se=q||function(G,te,$){var ne=G<12?"AM":"PM";return $?ne.toLowerCase():ne};return W.replace(v,function(G,te){return te||function($){switch($){case"YY":return String(H.$y).slice(-2);case"YYYY":return O.s(H.$y,4,"0");case"M":return S+1;case"MM":return O.s(S+1,2,"0");case"MMM":return Q(z.monthsShort,S,Y,3);case"MMMM":return Q(Y,S);case"D":return H.$D;case"DD":return O.s(H.$D,2,"0");case"d":return String(H.$W);case"dd":return Q(z.weekdaysMin,H.$W,V,2);case"ddd":return Q(z.weekdaysShort,H.$W,V,3);case"dddd":return V[H.$W];case"H":return String(_);case"HH":return O.s(_,2,"0");case"h":return X(1);case"hh":return X(2);case"a":return se(_,j,!0);case"A":return se(_,j,!1);case"m":return String(j);case"mm":return O.s(j,2,"0");case"s":return String(H.$s);case"ss":return O.s(H.$s,2,"0");case"SSS":return O.s(H.$ms,3,"0");case"Z":return b}return null}(G)||b.replace(":","")})},R.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},R.diff=function(N,H,z){var W,b=this,_=O.p(H),j=T(N),S=(j.utcOffset()-this.utcOffset())*r,V=this-j,Y=function(){return O.m(b,j)};switch(_){case d:W=Y()/12;break;case c:W=Y();break;case h:W=Y()/3;break;case f:W=(V-S)/6048e5;break;case u:W=(V-S)/864e5;break;case l:W=V/i;break;case a:W=V/r;break;case s:W=V/n;break;default:W=V}return z?W:O.a(W)},R.daysInMonth=function(){return this.endOf(c).$D},R.$locale=function(){return E[this.$L]},R.locale=function(N,H){if(!N)return this.$L;var z=this.clone(),W=P(N,H,!0);return W&&(z.$L=W),z},R.clone=function(){return O.w(this.$d,this)},R.toDate=function(){return new Date(this.valueOf())},R.toJSON=function(){return this.isValid()?this.toISOString():null},R.toISOString=function(){return this.$d.toISOString()},R.toString=function(){return this.$d.toUTCString()},F}(),L=B.prototype;return T.prototype=L,[["$ms",o],["$s",s],["$m",a],["$H",l],["$W",u],["$M",c],["$y",d],["$D",m]].forEach(function(F){L[F[1]]=function(R){return this.$g(R,F[0],F[1])}}),T.extend=function(F,R){return F.$i||(F(R,B,T),F.$i=!0),T},T.locale=P,T.isDayjs=D,T.unix=function(F){return T(1e3*F)},T.en=E[k],T.Ls=E,T.p={},T})})(Gu);var ab=Gu.exports;const wi=vn(ab);var Qu={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(yn,function(){return function(n,r,i){r.prototype.isToday=function(){var o="YYYY-MM-DD",s=i();return this.format(o)===s.format(o)}}})})(Qu);var lb=Qu.exports;const ub=vn(lb);var Zu={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(yn,function(){return function(n,r,i){r.prototype.isYesterday=function(){var o="YYYY-MM-DD",s=i().subtract(1,"day");return this.format(o)===s.format(o)}}})})(Zu);var cb=Zu.exports;const fb=vn(cb);wi.extend(ub),wi.extend(fb);function Ju(e,t,n,r,i){return e.map(o=>{const{authorId:s}=o,a=s===n?"outgoing":"incoming",l=t.find(f=>f.id===s);let u;return l&&l.id===n?u={name:l.name||"You",avatar:l.pictureUrl}:l?u={name:l.name||"Agent",avatar:l.pictureUrl}:u={name:r||"Bot",avatar:i},{...o,direction:a,sender:u}})}function db(e,t="day"){var r,i,o;if(!e||e.length===0)return[];const n=[];(r=e[0])!=null&&r.timestamp&&n.push(Xu(e[0].timestamp));for(let s=0;s<e.length;s++)if(e[s]&&n.push(e[s]),s+1<e.length){const a=(i=e[s])==null?void 0:i.timestamp,l=(o=e[s+1])==null?void 0:o.timestamp;!wi(a).isSame(l,t)&&l&&n.push(Xu(l))}return n}function Xu(e){return{id:ec(e),direction:"system",sender:{name:"system"},timestamp:e,block:{type:"text",text:ec(e)}}}function ec(e,t=!1){const n=wi(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")}function hb(e=""){if(typeof e!="string")throw new TypeError("Color should be string!");const t=/^#?([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i.exec(e);if(t)return t.splice(1).map(r=>Number.parseInt(r,16));const n=/^#?([\da-f])([\da-f])([\da-f])$/i.exec(e);if(n)return n.splice(1).map(r=>Number.parseInt(r+r,16));if(e.includes(","))return e.split(",").map(r=>Number.parseInt(r));throw new Error("Invalid color format! Use #ABC or #AABBCC or r,g,b")}function pb(e){return"#"+e.map(t=>`0${t.toString(16).toUpperCase()}`.slice(-2)).join("")}function mb(e,t){return e.map(n=>Math.round(n+(255-n)*t))}function gb(e,t){return e.map(n=>Math.round(n*t))}const wr=e=>t=>mb(t,e),Sr=e=>t=>gb(t,e),yb={50:wr(.95),100:wr(.9),200:wr(.75),300:wr(.6),400:wr(.3),500:e=>e,600:Sr(.9),700:Sr(.6),800:Sr(.45),900:Sr(.3),950:Sr(.2)};function tc(e,t=yb){const n={},r=hb(e);for(const[i,o]of Object.entries(t))n[i]=pb(o(r));return n}const nc=()=>{const e={};return{on:(i,o)=>{var s;return e[i]||(e[i]=new Set),(s=e[i])==null||s.add(o),()=>{var a;return(a=e[i])==null?void 0:a.delete(o)}},emit:(i,o)=>{var s,a;(s=e[i])==null||s.forEach(l=>l(o)),(a=e["*"])==null||a.forEach(l=>l({type:i,payload:o}))},removeAllListeners:i=>{var o;i?(o=e[i])==null||o.clear():Object.keys(e).forEach(s=>{var a;(a=e[s])==null||a.clear()})}}};class bn extends Error{}class vb extends bn{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class bb extends bn{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class wb extends bn{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class xr extends bn{}class rc extends bn{constructor(t){super(`Invalid unit ${t}`)}}class vt extends bn{}class nn extends bn{constructor(){super("Zone is an abstract class")}}const ie="numeric",At="short",ht="long",ds={year:ie,month:ie,day:ie},ic={year:ie,month:At,day:ie},Sb={year:ie,month:At,day:ie,weekday:At},oc={year:ie,month:ht,day:ie},sc={year:ie,month:ht,day:ie,weekday:ht},ac={hour:ie,minute:ie},lc={hour:ie,minute:ie,second:ie},uc={hour:ie,minute:ie,second:ie,timeZoneName:At},cc={hour:ie,minute:ie,second:ie,timeZoneName:ht},fc={hour:ie,minute:ie,hourCycle:"h23"},dc={hour:ie,minute:ie,second:ie,hourCycle:"h23"},hc={hour:ie,minute:ie,second:ie,hourCycle:"h23",timeZoneName:At},pc={hour:ie,minute:ie,second:ie,hourCycle:"h23",timeZoneName:ht},mc={year:ie,month:ie,day:ie,hour:ie,minute:ie},gc={year:ie,month:ie,day:ie,hour:ie,minute:ie,second:ie},yc={year:ie,month:At,day:ie,hour:ie,minute:ie},vc={year:ie,month:At,day:ie,hour:ie,minute:ie,second:ie},xb={year:ie,month:At,day:ie,weekday:At,hour:ie,minute:ie},bc={year:ie,month:ht,day:ie,hour:ie,minute:ie,timeZoneName:At},wc={year:ie,month:ht,day:ie,hour:ie,minute:ie,second:ie,timeZoneName:At},Sc={year:ie,month:ht,day:ie,weekday:ht,hour:ie,minute:ie,timeZoneName:ht},xc={year:ie,month:ht,day:ie,weekday:ht,hour:ie,minute:ie,second:ie,timeZoneName:ht};function xe(e){return typeof e>"u"}function wn(e){return typeof e=="number"}function Si(e){return typeof e=="number"&&e%1===0}function kb(e){return typeof e=="string"}function Eb(e){return Object.prototype.toString.call(e)==="[object Date]"}function kc(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Cb(e){return Array.isArray(e)?e:[e]}function Ec(e,t,n){if(e.length!==0)return e.reduce((r,i)=>{const o=[t(i),i];return r&&n(r[0],o[0])===r[0]?r:o},null)[1]}function Ab(e,t){return t.reduce((n,r)=>(n[r]=e[r],n),{})}function Fn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function qt(e,t,n){return Si(e)&&e>=t&&e<=n}function Tb(e,t){return e-t*Math.floor(e/t)}function Ve(e,t=2){const n=e<0;let r;return n?r="-"+(""+-e).padStart(t,"0"):r=(""+e).padStart(t,"0"),r}function rn(e){if(!(xe(e)||e===null||e===""))return parseInt(e,10)}function Sn(e){if(!(xe(e)||e===null||e===""))return parseFloat(e)}function hs(e){if(!(xe(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function ps(e,t,n=!1){const r=10**t;return(n?Math.trunc:Math.round)(e*r)/r}function kr(e){return e%4===0&&(e%100!==0||e%400===0)}function Er(e){return kr(e)?366:365}function xi(e,t){const n=Tb(t-1,12)+1,r=e+(t-n)/12;return n===2?kr(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function ms(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(t.getUTCFullYear()-1900)),+t}function ki(e){const t=(e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))%7,n=e-1,r=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7;return t===4||r===3?53:52}function gs(e){return e>99?e:e>60?1900+e:2e3+e}function Cc(e,t,n,r=null){const i=new Date(e),o={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(o.timeZone=r);const s={timeZoneName:t,...o},a=new Intl.DateTimeFormat(n,s).formatToParts(i).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function Ei(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0,i=n<0||Object.is(n,-0)?-r:r;return n*60+i}function Ac(e){const t=Number(e);if(typeof e=="boolean"||e===""||Number.isNaN(t))throw new vt(`Invalid unit value ${e}`);return t}function Ci(e,t){const n={};for(const r in e)if(Fn(e,r)){const i=e[r];if(i==null)continue;n[t(r)]=Ac(i)}return n}function Cr(e,t){const n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),i=e>=0?"+":"-";switch(t){case"short":return`${i}${Ve(n,2)}:${Ve(r,2)}`;case"narrow":return`${i}${n}${r>0?`:${r}`:""}`;case"techie":return`${i}${Ve(n,2)}${Ve(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function Ai(e){return Ab(e,["hour","minute","second","millisecond"])}const Tc=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,Ib=["January","February","March","April","May","June","July","August","September","October","November","December"],Ic=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Ob=["J","F","M","A","M","J","J","A","S","O","N","D"];function Oc(e){switch(e){case"narrow":return[...Ob];case"short":return[...Ic];case"long":return[...Ib];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const Mc=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Dc=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Mb=["M","T","W","T","F","S","S"];function Nc(e){switch(e){case"narrow":return[...Mb];case"short":return[...Dc];case"long":return[...Mc];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const _c=["AM","PM"],Db=["Before Christ","Anno Domini"],Nb=["BC","AD"],_b=["B","A"];function Pc(e){switch(e){case"narrow":return[..._b];case"short":return[...Nb];case"long":return[...Db];default:return null}}function Pb(e){return _c[e.hour<12?0:1]}function Lb(e,t){return Nc(t)[e.weekday-1]}function Fb(e,t){return Oc(t)[e.month-1]}function Rb(e,t){return Pc(t)[e.year<0?0:1]}function $b(e,t,n="always",r=!1){const i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},o=["hours","minutes","seconds"].indexOf(e)===-1;if(n==="auto"&&o){const c=e==="days";switch(t){case 1:return c?"tomorrow":`next ${i[e][0]}`;case-1:return c?"yesterday":`last ${i[e][0]}`;case 0:return c?"today":`this ${i[e][0]}`}}const s=Object.is(t,-0)||t<0,a=Math.abs(t),l=a===1,u=i[e],f=r?l?u[1]:u[2]||u[1]:l?i[e][0]:e;return s?`${a} ${f} ago`:`in ${a} ${f}`}function Lc(e,t){let n="";for(const r of e)r.literal?n+=r.val:n+=t(r.val);return n}const Bb={D:ds,DD:ic,DDD:oc,DDDD:sc,t:ac,tt:lc,ttt:uc,tttt:cc,T:fc,TT:dc,TTT:hc,TTTT:pc,f:mc,ff:yc,fff:bc,ffff:Sc,F:gc,FF:vc,FFF:wc,FFFF:xc};class lt{static create(t,n={}){return new lt(t,n)}static parseFormat(t){let n=null,r="",i=!1;const o=[];for(let s=0;s<t.length;s++){const a=t.charAt(s);a==="'"?(r.length>0&&o.push({literal:i,val:r}),n=null,r="",i=!i):i||a===n?r+=a:(r.length>0&&o.push({literal:!1,val:r}),r=a,n=a)}return r.length>0&&o.push({literal:i,val:r}),o}static macroTokenToFormatOpts(t){return Bb[t]}constructor(t,n){this.opts=n,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...n}).format()}formatDateTime(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n}).format()}formatDateTimeParts(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n}).formatToParts()}resolvedOptions(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n}).resolvedOptions()}num(t,n=0){if(this.opts.forceSimple)return Ve(t,n);const r={...this.opts};return n>0&&(r.padTo=n),this.loc.numberFormatter(r).format(t)}formatDateTimeFromString(t,n){const r=this.loc.listingMode()==="en",i=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",o=(d,m)=>this.loc.extract(t,d,m),s=d=>t.isOffsetFixed&&t.offset===0&&d.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,d.format):"",a=()=>r?Pb(t):o({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(d,m)=>r?Fb(t,d):o(m?{month:d}:{month:d,day:"numeric"},"month"),u=(d,m)=>r?Lb(t,d):o(m?{weekday:d}:{weekday:d,month:"long",day:"numeric"},"weekday"),f=d=>{const m=lt.macroTokenToFormatOpts(d);return m?this.formatWithSystemDefault(t,m):d},c=d=>r?Rb(t,d):o({era:d},"era"),h=d=>{switch(d){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return s({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return s({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return s({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return a();case"d":return i?o({day:"numeric"},"day"):this.num(t.day);case"dd":return i?o({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return i?o({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return i?o({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return l("short",!0);case"LLLL":return l("long",!0);case"LLLLL":return l("narrow",!0);case"M":return i?o({month:"numeric"},"month"):this.num(t.month);case"MM":return i?o({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return l("short",!1);case"MMMM":return l("long",!1);case"MMMMM":return l("narrow",!1);case"y":return i?o({year:"numeric"},"year"):this.num(t.year);case"yy":return i?o({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return i?o({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return i?o({year:"numeric"},"year"):this.num(t.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return f(d)}};return Lc(lt.parseFormat(n),h)}formatDurationFromString(t,n){const r=l=>{switch(l[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},i=l=>u=>{const f=r(u);return f?this.num(l.get(f),u.length):u},o=lt.parseFormat(n),s=o.reduce((l,{literal:u,val:f})=>u?l:l.concat(f),[]),a=t.shiftTo(...s.map(r).filter(l=>l));return Lc(o,i(a))}}class Tt{constructor(t,n){this.reason=t,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class Ar{get type(){throw new nn}get name(){throw new nn}get ianaName(){return this.name}get isUniversal(){throw new nn}offsetName(t,n){throw new nn}formatOffset(t,n){throw new nn}offset(t){throw new nn}equals(t){throw new nn}get isValid(){throw new nn}}let ys=null;class vs extends Ar{static get instance(){return ys===null&&(ys=new vs),ys}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return Cc(t,n,r)}formatOffset(t,n){return Cr(this.offset(t),n)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}let Ti={};function zb(e){return Ti[e]||(Ti[e]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),Ti[e]}const Ub={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Hb(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,i,o,s,a,l,u,f]=r;return[s,i,o,a,l,u,f]}function jb(e,t){const n=e.formatToParts(t),r=[];for(let i=0;i<n.length;i++){const{type:o,value:s}=n[i],a=Ub[o];o==="era"?r[a]=s:xe(a)||(r[a]=parseInt(s,10))}return r}let Ii={};class Yt extends Ar{static create(t){return Ii[t]||(Ii[t]=new Yt(t)),Ii[t]}static resetCache(){Ii={},Ti={}}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=Yt.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return Cc(t,n,r,this.name)}formatOffset(t,n){return Cr(this.offset(t),n)}offset(t){const n=new Date(t);if(isNaN(n))return NaN;const r=zb(this.name);let[i,o,s,a,l,u,f]=r.formatToParts?jb(r,n):Hb(r,n);a==="BC"&&(i=-Math.abs(i)+1);const h=ms({year:i,month:o,day:s,hour:l===24?0:l,minute:u,second:f,millisecond:0});let d=+n;const m=d%1e3;return d-=m>=0?m:1e3+m,(h-d)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let bs=null;class it extends Ar{static get utcInstance(){return bs===null&&(bs=new it(0)),bs}static instance(t){return t===0?it.utcInstance:new it(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new it(Ei(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Cr(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Cr(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return Cr(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}class Vb extends Ar{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function on(e,t){if(xe(e)||e===null)return t;if(e instanceof Ar)return e;if(kb(e)){const n=e.toLowerCase();return n==="local"||n==="system"?t:n==="utc"||n==="gmt"?it.utcInstance:it.parseSpecifier(n)||Yt.create(e)}else return wn(e)?it.instance(e):typeof e=="object"&&e.offset&&typeof e.offset=="number"?e:new Vb(e)}let Fc=()=>Date.now(),Rc="system",$c=null,Bc=null,zc=null,Uc;class qe{static get now(){return Fc}static set now(t){Fc=t}static set defaultZone(t){Rc=t}static get defaultZone(){return on(Rc,vs.instance)}static get defaultLocale(){return $c}static set defaultLocale(t){$c=t}static get defaultNumberingSystem(){return Bc}static set defaultNumberingSystem(t){Bc=t}static get defaultOutputCalendar(){return zc}static set defaultOutputCalendar(t){zc=t}static get throwOnInvalid(){return Uc}static set throwOnInvalid(t){Uc=t}static resetCaches(){Re.resetCache(),Yt.resetCache()}}let Hc={};function Wb(e,t={}){const n=JSON.stringify([e,t]);let r=Hc[n];return r||(r=new Intl.ListFormat(e,t),Hc[n]=r),r}let ws={};function Ss(e,t={}){const n=JSON.stringify([e,t]);let r=ws[n];return r||(r=new Intl.DateTimeFormat(e,t),ws[n]=r),r}let xs={};function qb(e,t={}){const n=JSON.stringify([e,t]);let r=xs[n];return r||(r=new Intl.NumberFormat(e,t),xs[n]=r),r}let ks={};function Yb(e,t={}){const{base:n,...r}=t,i=JSON.stringify([e,r]);let o=ks[i];return o||(o=new Intl.RelativeTimeFormat(e,t),ks[i]=o),o}let Tr=null;function Kb(){return Tr||(Tr=new Intl.DateTimeFormat().resolvedOptions().locale,Tr)}function Gb(e){const t=e.indexOf("-u-");if(t===-1)return[e];{let n;const r=e.substring(0,t);try{n=Ss(e).resolvedOptions()}catch{n=Ss(r).resolvedOptions()}const{numberingSystem:i,calendar:o}=n;return[r,i,o]}}function Qb(e,t,n){return(n||t)&&(e+="-u",n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`)),e}function Zb(e){const t=[];for(let n=1;n<=12;n++){const r=pe.utc(2016,n,1);t.push(e(r))}return t}function Jb(e){const t=[];for(let n=1;n<=7;n++){const r=pe.utc(2016,11,13+n);t.push(e(r))}return t}function Oi(e,t,n,r,i){const o=e.listingMode(n);return o==="error"?null:o==="en"?r(t):i(t)}function Xb(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem==="latn"}class e0{constructor(t,n,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:i,floor:o,...s}=r;if(!n||Object.keys(s).length>0){const a={useGrouping:!1,...r};r.padTo>0&&(a.minimumIntegerDigits=r.padTo),this.inf=qb(t,a)}}format(t){if(this.inf){const n=this.floor?Math.floor(t):t;return this.inf.format(n)}else{const n=this.floor?Math.floor(t):ps(t,3);return Ve(n,this.padTo)}}}class t0{constructor(t,n,r){this.opts=r;let i;if(t.zone.isUniversal){const s=-1*(t.offset/60),a=s>=0?`Etc/GMT+${s}`:`Etc/GMT${s}`;t.offset!==0&&Yt.create(a).valid?(i=a,this.dt=t):(i="UTC",r.timeZoneName?this.dt=t:this.dt=t.offset===0?t:pe.fromMillis(t.ts+t.offset*60*1e3))}else t.zone.type==="system"?this.dt=t:(this.dt=t,i=t.zone.name);const o={...this.opts};i&&(o.timeZone=i),this.dtf=Ss(n,o)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class n0{constructor(t,n,r){this.opts={style:"long",...r},!n&&kc()&&(this.rtf=Yb(t,r))}format(t,n){return this.rtf?this.rtf.format(t,n):$b(n,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,n){return this.rtf?this.rtf.formatToParts(t,n):[]}}class Re{static fromOpts(t){return Re.create(t.locale,t.numberingSystem,t.outputCalendar,t.defaultToEN)}static create(t,n,r,i=!1){const o=t||qe.defaultLocale,s=o||(i?"en-US":Kb()),a=n||qe.defaultNumberingSystem,l=r||qe.defaultOutputCalendar;return new Re(s,a,l,o)}static resetCache(){Tr=null,ws={},xs={},ks={}}static fromObject({locale:t,numberingSystem:n,outputCalendar:r}={}){return Re.create(t,n,r)}constructor(t,n,r,i){const[o,s,a]=Gb(t);this.locale=o,this.numberingSystem=n||s||null,this.outputCalendar=r||a||null,this.intl=Qb(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=Xb(this)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&n?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:Re.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,n=!1,r=!0){return Oi(this,t,r,Oc,()=>{const i=n?{month:t,day:"numeric"}:{month:t},o=n?"format":"standalone";return this.monthsCache[o][t]||(this.monthsCache[o][t]=Zb(s=>this.extract(s,i,"month"))),this.monthsCache[o][t]})}weekdays(t,n=!1,r=!0){return Oi(this,t,r,Nc,()=>{const i=n?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},o=n?"format":"standalone";return this.weekdaysCache[o][t]||(this.weekdaysCache[o][t]=Jb(s=>this.extract(s,i,"weekday"))),this.weekdaysCache[o][t]})}meridiems(t=!0){return Oi(this,void 0,t,()=>_c,()=>{if(!this.meridiemCache){const n={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[pe.utc(2016,11,13,9),pe.utc(2016,11,13,19)].map(r=>this.extract(r,n,"dayperiod"))}return this.meridiemCache})}eras(t,n=!0){return Oi(this,t,n,Pc,()=>{const r={era:t};return this.eraCache[t]||(this.eraCache[t]=[pe.utc(-40,1,1),pe.utc(2017,1,1)].map(i=>this.extract(i,r,"era"))),this.eraCache[t]})}extract(t,n,r){const i=this.dtFormatter(t,n),o=i.formatToParts(),s=o.find(a=>a.type.toLowerCase()===r);return s?s.value:null}numberFormatter(t={}){return new e0(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,n={}){return new t0(t,this.intl,n)}relFormatter(t={}){return new n0(this.intl,this.isEnglish(),t)}listFormatter(t={}){return Wb(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}}function Rn(...e){const t=e.reduce((n,r)=>n+r.source,"");return RegExp(`^${t}$`)}function $n(...e){return t=>e.reduce(([n,r,i],o)=>{const[s,a,l]=o(t,i);return[{...n,...s},a||r,l]},[{},null,1]).slice(0,2)}function Bn(e,...t){if(e==null)return[null,null];for(const[n,r]of t){const i=n.exec(e);if(i)return r(i)}return[null,null]}function jc(...e){return(t,n)=>{const r={};let i;for(i=0;i<e.length;i++)r[e[i]]=rn(t[n+i]);return[r,null,n+i]}}const Vc=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,r0=`(?:${Vc.source}?(?:\\[(${Tc.source})\\])?)?`,Es=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Wc=RegExp(`${Es.source}${r0}`),Cs=RegExp(`(?:T${Wc.source})?`),i0=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,o0=/(\d{4})-?W(\d\d)(?:-?(\d))?/,s0=/(\d{4})-?(\d{3})/,a0=jc("weekYear","weekNumber","weekDay"),l0=jc("year","ordinal"),u0=/(\d{4})-(\d\d)-(\d\d)/,qc=RegExp(`${Es.source} ?(?:${Vc.source}|(${Tc.source}))?`),c0=RegExp(`(?: ${qc.source})?`);function zn(e,t,n){const r=e[t];return xe(r)?n:rn(r)}function f0(e,t){return[{year:zn(e,t),month:zn(e,t+1,1),day:zn(e,t+2,1)},null,t+3]}function Un(e,t){return[{hours:zn(e,t,0),minutes:zn(e,t+1,0),seconds:zn(e,t+2,0),milliseconds:hs(e[t+3])},null,t+4]}function Ir(e,t){const n=!e[t]&&!e[t+1],r=Ei(e[t+1],e[t+2]),i=n?null:it.instance(r);return[{},i,t+3]}function Or(e,t){const n=e[t]?Yt.create(e[t]):null;return[{},n,t+1]}const d0=RegExp(`^T?${Es.source}$`),h0=/^-?P(?:(?:(-?\d{1,9}(?:\.\d{1,9})?)Y)?(?:(-?\d{1,9}(?:\.\d{1,9})?)M)?(?:(-?\d{1,9}(?:\.\d{1,9})?)W)?(?:(-?\d{1,9}(?:\.\d{1,9})?)D)?(?:T(?:(-?\d{1,9}(?:\.\d{1,9})?)H)?(?:(-?\d{1,9}(?:\.\d{1,9})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,9}))?S)?)?)$/;function p0(e){const[t,n,r,i,o,s,a,l,u]=e,f=t[0]==="-",c=l&&l[0]==="-",h=(d,m=!1)=>d!==void 0&&(m||d&&f)?-d:d;return[{years:h(Sn(n)),months:h(Sn(r)),weeks:h(Sn(i)),days:h(Sn(o)),hours:h(Sn(s)),minutes:h(Sn(a)),seconds:h(Sn(l),l==="-0"),milliseconds:h(hs(u),c)}]}const m0={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function As(e,t,n,r,i,o,s){const a={year:t.length===2?gs(rn(t)):rn(t),month:Ic.indexOf(n)+1,day:rn(r),hour:rn(i),minute:rn(o)};return s&&(a.second=rn(s)),e&&(a.weekday=e.length>3?Mc.indexOf(e)+1:Dc.indexOf(e)+1),a}const g0=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function y0(e){const[,t,n,r,i,o,s,a,l,u,f,c]=e,h=As(t,i,r,n,o,s,a);let d;return l?d=m0[l]:u?d=0:d=Ei(f,c),[h,new it(d)]}function v0(e){return e.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const b0=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,w0=/^(Monday|Tuesday|Wedsday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,S0=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Yc(e){const[,t,n,r,i,o,s,a]=e;return[As(t,i,r,n,o,s,a),it.utcInstance]}function x0(e){const[,t,n,r,i,o,s,a]=e;return[As(t,a,n,r,i,o,s),it.utcInstance]}const k0=Rn(i0,Cs),E0=Rn(o0,Cs),C0=Rn(s0,Cs),A0=Rn(Wc),Kc=$n(f0,Un,Ir,Or),T0=$n(a0,Un,Ir,Or),I0=$n(l0,Un,Ir,Or),O0=$n(Un,Ir,Or);function M0(e){return Bn(e,[k0,Kc],[E0,T0],[C0,I0],[A0,O0])}function D0(e){return Bn(v0(e),[g0,y0])}function N0(e){return Bn(e,[b0,Yc],[w0,Yc],[S0,x0])}function _0(e){return Bn(e,[h0,p0])}const P0=$n(Un);function L0(e){return Bn(e,[d0,P0])}const F0=Rn(u0,c0),R0=Rn(qc),$0=$n(Un,Ir,Or);function B0(e){return Bn(e,[F0,Kc],[R0,$0])}const z0="Invalid Duration",Gc={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},U0={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...Gc},bt=146097/400,Hn=146097/4800,H0={years:{quarters:4,months:12,weeks:bt/7,days:bt,hours:bt*24,minutes:bt*24*60,seconds:bt*24*60*60,milliseconds:bt*24*60*60*1e3},quarters:{months:3,weeks:bt/28,days:bt/4,hours:bt*24/4,minutes:bt*24*60/4,seconds:bt*24*60*60/4,milliseconds:bt*24*60*60*1e3/4},months:{weeks:Hn/7,days:Hn,hours:Hn*24,minutes:Hn*24*60,seconds:Hn*24*60*60,milliseconds:Hn*24*60*60*1e3},...Gc},xn=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],j0=xn.slice(0).reverse();function kn(e,t,n=!1){const r={values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy};return new Ee(r)}function V0(e){return e<0?Math.floor(e):Math.ceil(e)}function Qc(e,t,n,r,i){const o=e[i][n],s=t[n]/o,a=Math.sign(s)===Math.sign(r[i]),l=!a&&r[i]!==0&&Math.abs(s)<=1?V0(s):Math.trunc(s);r[i]+=l,t[n]-=l*o}function W0(e,t){j0.reduce((n,r)=>xe(t[r])?n:(n&&Qc(e,t,n,t,r),r),null)}class Ee{constructor(t){const n=t.conversionAccuracy==="longterm"||!1;this.values=t.values,this.loc=t.loc||Re.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=n?H0:U0,this.isLuxonDuration=!0}static fromMillis(t,n){return Ee.fromObject({milliseconds:t},n)}static fromObject(t,n={}){if(t==null||typeof t!="object")throw new vt(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new Ee({values:Ci(t,Ee.normalizeUnit),loc:Re.fromObject(n),conversionAccuracy:n.conversionAccuracy})}static fromDurationLike(t){if(wn(t))return Ee.fromMillis(t);if(Ee.isDuration(t))return t;if(typeof t=="object")return Ee.fromObject(t);throw new vt(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){const[r]=_0(t);return r?Ee.fromObject(r,n):Ee.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){const[r]=L0(t);return r?Ee.fromObject(r,n):Ee.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,n=null){if(!t)throw new vt("need to specify a reason the Duration is invalid");const r=t instanceof Tt?t:new Tt(t,n);if(qe.throwOnInvalid)throw new wb(r);return new Ee({invalid:r})}static normalizeUnit(t){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!n)throw new rc(t);return n}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,n={}){const r={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?lt.create(this.loc,r).formatDurationFromString(this,t):z0}toHuman(t={}){const n=xn.map(r=>{const i=this.values[r];return xe(i)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:r.slice(0,-1)}).format(i)}).filter(r=>r);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=ps(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const n=this.toMillis();if(n<0||n>=864e5)return null;t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t};const r=this.shiftTo("hours","minutes","seconds","milliseconds");let i=t.format==="basic"?"hhmm":"hh:mm";(!t.suppressSeconds||r.seconds!==0||r.milliseconds!==0)&&(i+=t.format==="basic"?"ss":":ss",(!t.suppressMilliseconds||r.milliseconds!==0)&&(i+=".SSS"));let o=r.toFormat(i);return t.includePrefix&&(o="T"+o),o}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const n=Ee.fromDurationLike(t),r={};for(const i of xn)(Fn(n.values,i)||Fn(this.values,i))&&(r[i]=n.get(i)+this.get(i));return kn(this,{values:r},!0)}minus(t){if(!this.isValid)return this;const n=Ee.fromDurationLike(t);return this.plus(n.negate())}mapUnits(t){if(!this.isValid)return this;const n={};for(const r of Object.keys(this.values))n[r]=Ac(t(this.values[r],r));return kn(this,{values:n},!0)}get(t){return this[Ee.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const n={...this.values,...Ci(t,Ee.normalizeUnit)};return kn(this,{values:n})}reconfigure({locale:t,numberingSystem:n,conversionAccuracy:r}={}){const i=this.loc.clone({locale:t,numberingSystem:n}),o={loc:i};return r&&(o.conversionAccuracy=r),kn(this,o)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return W0(this.matrix,t),kn(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(s=>Ee.normalizeUnit(s));const n={},r={},i=this.toObject();let o;for(const s of xn)if(t.indexOf(s)>=0){o=s;let a=0;for(const u in r)a+=this.matrix[u][s]*r[u],r[u]=0;wn(i[s])&&(a+=i[s]);const l=Math.trunc(a);n[s]=l,r[s]=(a*1e3-l*1e3)/1e3;for(const u in i)xn.indexOf(u)>xn.indexOf(s)&&Qc(this.matrix,i,u,n,s)}else wn(i[s])&&(r[s]=i[s]);for(const s in r)r[s]!==0&&(n[o]+=s===o?r[s]:r[s]/this.matrix[o][s]);return kn(this,{values:n},!0).normalize()}negate(){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=this.values[n]===0?0:-this.values[n];return kn(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function n(r,i){return r===void 0||r===0?i===void 0||i===0:r===i}for(const r of xn)if(!n(this.values[r],t.values[r]))return!1;return!0}}const Mr="Invalid Interval";function q0(e,t){return!e||!e.isValid?ze.invalid("missing or invalid start"):!t||!t.isValid?ze.invalid("missing or invalid end"):t<e?ze.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null}class ze{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,n=null){if(!t)throw new vt("need to specify a reason the Interval is invalid");const r=t instanceof Tt?t:new Tt(t,n);if(qe.throwOnInvalid)throw new bb(r);return new ze({invalid:r})}static fromDateTimes(t,n){const r=_r(t),i=_r(n),o=q0(r,i);return o??new ze({start:r,end:i})}static after(t,n){const r=Ee.fromDurationLike(n),i=_r(t);return ze.fromDateTimes(i,i.plus(r))}static before(t,n){const r=Ee.fromDurationLike(n),i=_r(t);return ze.fromDateTimes(i.minus(r),i)}static fromISO(t,n){const[r,i]=(t||"").split("/",2);if(r&&i){let o,s;try{o=pe.fromISO(r,n),s=o.isValid}catch{s=!1}let a,l;try{a=pe.fromISO(i,n),l=a.isValid}catch{l=!1}if(s&&l)return ze.fromDateTimes(o,a);if(s){const u=Ee.fromISO(i,n);if(u.isValid)return ze.after(o,u)}else if(l){const u=Ee.fromISO(r,n);if(u.isValid)return ze.before(a,u)}}return ze.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds"){if(!this.isValid)return NaN;const n=this.start.startOf(t),r=this.end.startOf(t);return Math.floor(r.diff(n,t).get(t))+1}hasSame(t){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,t):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return this.isValid?this.s>t:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:n}={}){return this.isValid?ze.fromDateTimes(t||this.s,n||this.e):this}splitAt(...t){if(!this.isValid)return[];const n=t.map(_r).filter(s=>this.contains(s)).sort(),r=[];let{s:i}=this,o=0;for(;i<this.e;){const s=n[o]||this.e,a=+s>+this.e?this.e:s;r.push(ze.fromDateTimes(i,a)),i=a,o+=1}return r}splitBy(t){const n=Ee.fromDurationLike(t);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,i=1,o;const s=[];for(;r<this.e;){const a=this.start.plus(n.mapUnits(l=>l*i));o=+a>+this.e?this.e:a,s.push(ze.fromDateTimes(r,o)),r=o,i+=1}return s}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return this.isValid?+this.e==+t.s:!1}abutsEnd(t){return this.isValid?+t.e==+this.s:!1}engulfs(t){return this.isValid?this.s<=t.s&&this.e>=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const n=this.s>t.s?this.s:t.s,r=this.e<t.e?this.e:t.e;return n>=r?null:ze.fromDateTimes(n,r)}union(t){if(!this.isValid)return this;const n=this.s<t.s?this.s:t.s,r=this.e>t.e?this.e:t.e;return ze.fromDateTimes(n,r)}static merge(t){const[n,r]=t.sort((i,o)=>i.s-o.s).reduce(([i,o],s)=>o?o.overlaps(s)||o.abutsStart(s)?[i,o.union(s)]:[i.concat([o]),s]:[i,s],[[],null]);return r&&n.push(r),n}static xor(t){let n=null,r=0;const i=[],o=t.map(l=>[{time:l.s,type:"s"},{time:l.e,type:"e"}]),s=Array.prototype.concat(...o),a=s.sort((l,u)=>l.time-u.time);for(const l of a)r+=l.type==="s"?1:-1,r===1?n=l.time:(n&&+n!=+l.time&&i.push(ze.fromDateTimes(n,l.time)),n=null);return ze.merge(i)}difference(...t){return ze.xor([this].concat(t)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Mr}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:Mr}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Mr}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:Mr}toFormat(t,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${n}${this.e.toFormat(t)}`:Mr}toDuration(t,n){return this.isValid?this.e.diff(this.s,t,n):Ee.invalid(this.invalidReason)}mapEndpoints(t){return ze.fromDateTimes(t(this.s),t(this.e))}}let Mi=class{static hasDST(t=qe.defaultZone){const n=pe.now().setZone(t).set({month:12});return!t.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(t){return Yt.isValidZone(t)}static normalizeZone(t){return on(t,qe.defaultZone)}static months(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null,outputCalendar:o="gregory"}={}){return(i||Re.create(n,r,o)).months(t)}static monthsFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null,outputCalendar:o="gregory"}={}){return(i||Re.create(n,r,o)).months(t,!0)}static weekdays(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null}={}){return(i||Re.create(n,r,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null}={}){return(i||Re.create(n,r,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return Re.create(t).meridiems()}static eras(t="short",{locale:n=null}={}){return Re.create(n,null,"gregory").eras(t)}static features(){return{relative:kc()}}};function Zc(e,t){const n=i=>i.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(t)-n(e);return Math.floor(Ee.fromMillis(r).as("days"))}function Y0(e,t,n){const r=[["years",(a,l)=>l.year-a.year],["quarters",(a,l)=>l.quarter-a.quarter],["months",(a,l)=>l.month-a.month+(l.year-a.year)*12],["weeks",(a,l)=>{const u=Zc(a,l);return(u-u%7)/7}],["days",Zc]],i={};let o,s;for(const[a,l]of r)if(n.indexOf(a)>=0){o=a;let u=l(e,t);s=e.plus({[a]:u}),s>t?(e=e.plus({[a]:u-1}),u-=1):e=s,i[a]=u}return[e,i,s,o]}function K0(e,t,n,r){let[i,o,s,a]=Y0(e,t,n);const l=t-i,u=n.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);u.length===0&&(s<t&&(s=i.plus({[a]:1})),s!==i&&(o[a]=(o[a]||0)+l/(s-i)));const f=Ee.fromObject(o,r);return u.length>0?Ee.fromMillis(l,r).shiftTo(...u).plus(f):f}const Ts={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Jc={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},G0=Ts.hanidec.replace(/[\[|\]]/g,"").split("");function Q0(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(e[n].search(Ts.hanidec)!==-1)t+=G0.indexOf(e[n]);else for(const i in Jc){const[o,s]=Jc[i];r>=o&&r<=s&&(t+=r-o)}}return parseInt(t,10)}else return t}function It({numberingSystem:e},t=""){return new RegExp(`${Ts[e||"latn"]}${t}`)}const Z0="missing Intl.DateTimeFormat.formatToParts support";function Ce(e,t=n=>n){return{regex:e,deser:([n])=>t(Q0(n))}}const Xc="[  ]",ef=new RegExp(Xc,"g");function J0(e){return e.replace(/\./g,"\\.?").replace(ef,Xc)}function tf(e){return e.replace(/\./g,"").replace(ef," ").toLowerCase()}function Ot(e,t){return e===null?null:{regex:RegExp(e.map(J0).join("|")),deser:([n])=>e.findIndex(r=>tf(n)===tf(r))+t}}function nf(e,t){return{regex:e,deser:([,n,r])=>Ei(n,r),groups:t}}function Is(e){return{regex:e,deser:([t])=>t}}function X0(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function ew(e,t){const n=It(t),r=It(t,"{2}"),i=It(t,"{3}"),o=It(t,"{4}"),s=It(t,"{6}"),a=It(t,"{1,2}"),l=It(t,"{1,3}"),u=It(t,"{1,6}"),f=It(t,"{1,9}"),c=It(t,"{2,4}"),h=It(t,"{4,6}"),d=g=>({regex:RegExp(X0(g.val)),deser:([v])=>v,literal:!0}),p=(g=>{if(e.literal)return d(g);switch(g.val){case"G":return Ot(t.eras("short",!1),0);case"GG":return Ot(t.eras("long",!1),0);case"y":return Ce(u);case"yy":return Ce(c,gs);case"yyyy":return Ce(o);case"yyyyy":return Ce(h);case"yyyyyy":return Ce(s);case"M":return Ce(a);case"MM":return Ce(r);case"MMM":return Ot(t.months("short",!0,!1),1);case"MMMM":return Ot(t.months("long",!0,!1),1);case"L":return Ce(a);case"LL":return Ce(r);case"LLL":return Ot(t.months("short",!1,!1),1);case"LLLL":return Ot(t.months("long",!1,!1),1);case"d":return Ce(a);case"dd":return Ce(r);case"o":return Ce(l);case"ooo":return Ce(i);case"HH":return Ce(r);case"H":return Ce(a);case"hh":return Ce(r);case"h":return Ce(a);case"mm":return Ce(r);case"m":return Ce(a);case"q":return Ce(a);case"qq":return Ce(r);case"s":return Ce(a);case"ss":return Ce(r);case"S":return Ce(l);case"SSS":return Ce(i);case"u":return Is(f);case"uu":return Is(a);case"uuu":return Ce(n);case"a":return Ot(t.meridiems(),0);case"kkkk":return Ce(o);case"kk":return Ce(c,gs);case"W":return Ce(a);case"WW":return Ce(r);case"E":case"c":return Ce(n);case"EEE":return Ot(t.weekdays("short",!1,!1),1);case"EEEE":return Ot(t.weekdays("long",!1,!1),1);case"ccc":return Ot(t.weekdays("short",!0,!1),1);case"cccc":return Ot(t.weekdays("long",!0,!1),1);case"Z":case"ZZ":return nf(new RegExp(`([+-]${a.source})(?::(${r.source}))?`),2);case"ZZZ":return nf(new RegExp(`([+-]${a.source})(${r.source})?`),2);case"z":return Is(/[a-z_+-/]{1,256}?/i);default:return d(g)}})(e)||{invalidReason:Z0};return p.token=e,p}const tw={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"}};function nw(e,t,n){const{type:r,value:i}=e;if(r==="literal")return{literal:!0,val:i};const o=n[r];let s=tw[r];if(typeof s=="object"&&(s=s[o]),s)return{literal:!1,val:s}}function rw(e){return[`^${e.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,e]}function iw(e,t,n){const r=e.match(t);if(r){const i={};let o=1;for(const s in n)if(Fn(n,s)){const a=n[s],l=a.groups?a.groups+1:1;!a.literal&&a.token&&(i[a.token.val[0]]=a.deser(r.slice(o,o+l))),o+=l}return[r,i]}else return[r,{}]}function ow(e){const t=o=>{switch(o){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,r;return xe(e.z)||(n=Yt.create(e.z)),xe(e.Z)||(n||(n=new it(e.Z)),r=e.Z),xe(e.q)||(e.M=(e.q-1)*3+1),xe(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),xe(e.u)||(e.S=hs(e.u)),[Object.keys(e).reduce((o,s)=>{const a=t(s);return a&&(o[a]=e[s]),o},{}),n,r]}let Os=null;function sw(){return Os||(Os=pe.fromMillis(1555555555555)),Os}function aw(e,t){if(e.literal)return e;const n=lt.macroTokenToFormatOpts(e.val);if(!n)return e;const o=lt.create(t,n).formatDateTimeParts(sw()).map(s=>nw(s,t,n));return o.includes(void 0)?e:o}function lw(e,t){return Array.prototype.concat(...e.map(n=>aw(n,t)))}function rf(e,t,n){const r=lw(lt.parseFormat(n),e),i=r.map(s=>ew(s,e)),o=i.find(s=>s.invalidReason);if(o)return{input:t,tokens:r,invalidReason:o.invalidReason};{const[s,a]=rw(i),l=RegExp(s,"i"),[u,f]=iw(t,l,a),[c,h,d]=f?ow(f):[null,null,void 0];if(Fn(f,"a")&&Fn(f,"H"))throw new xr("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:r,regex:l,rawMatches:u,matches:f,result:c,zone:h,specificOffset:d}}}function uw(e,t,n){const{result:r,zone:i,specificOffset:o,invalidReason:s}=rf(e,t,n);return[r,i,o,s]}const of=[0,31,59,90,120,151,181,212,243,273,304,334],sf=[0,31,60,91,121,152,182,213,244,274,305,335];function wt(e,t){return new Tt("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function af(e,t,n){const r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const i=r.getUTCDay();return i===0?7:i}function lf(e,t,n){return n+(kr(e)?sf:of)[t-1]}function uf(e,t){const n=kr(e)?sf:of,r=n.findIndex(o=>o<t),i=t-n[r];return{month:r+1,day:i}}function Ms(e){const{year:t,month:n,day:r}=e,i=lf(t,n,r),o=af(t,n,r);let s=Math.floor((i-o+10)/7),a;return s<1?(a=t-1,s=ki(a)):s>ki(t)?(a=t+1,s=1):a=t,{weekYear:a,weekNumber:s,weekday:o,...Ai(e)}}function cf(e){const{weekYear:t,weekNumber:n,weekday:r}=e,i=af(t,1,4),o=Er(t);let s=n*7+r-i-3,a;s<1?(a=t-1,s+=Er(a)):s>o?(a=t+1,s-=Er(t)):a=t;const{month:l,day:u}=uf(a,s);return{year:a,month:l,day:u,...Ai(e)}}function Ds(e){const{year:t,month:n,day:r}=e,i=lf(t,n,r);return{year:t,ordinal:i,...Ai(e)}}function ff(e){const{year:t,ordinal:n}=e,{month:r,day:i}=uf(t,n);return{year:t,month:r,day:i,...Ai(e)}}function cw(e){const t=Si(e.weekYear),n=qt(e.weekNumber,1,ki(e.weekYear)),r=qt(e.weekday,1,7);return t?n?r?!1:wt("weekday",e.weekday):wt("week",e.week):wt("weekYear",e.weekYear)}function fw(e){const t=Si(e.year),n=qt(e.ordinal,1,Er(e.year));return t?n?!1:wt("ordinal",e.ordinal):wt("year",e.year)}function df(e){const t=Si(e.year),n=qt(e.month,1,12),r=qt(e.day,1,xi(e.year,e.month));return t?n?r?!1:wt("day",e.day):wt("month",e.month):wt("year",e.year)}function hf(e){const{hour:t,minute:n,second:r,millisecond:i}=e,o=qt(t,0,23)||t===24&&n===0&&r===0&&i===0,s=qt(n,0,59),a=qt(r,0,59),l=qt(i,0,999);return o?s?a?l?!1:wt("millisecond",i):wt("second",r):wt("minute",n):wt("hour",t)}const Ns="Invalid DateTime",pf=864e13;function Di(e){return new Tt("unsupported zone",`the zone "${e.name}" is not supported`)}function _s(e){return e.weekData===null&&(e.weekData=Ms(e.c)),e.weekData}function Dr(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new pe({...n,...t,old:n})}function mf(e,t,n){let r=e-t*60*1e3;const i=n.offset(r);if(t===i)return[r,t];r-=(i-t)*60*1e3;const o=n.offset(r);return i===o?[r,i]:[e-Math.min(i,o)*60*1e3,Math.max(i,o)]}function gf(e,t){e+=t*60*1e3;const n=new Date(e);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function Ni(e,t,n){return mf(ms(e),t,n)}function yf(e,t){const n=e.o,r=e.c.year+Math.trunc(t.years),i=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,o={...e.c,year:r,month:i,day:Math.min(e.c.day,xi(r,i))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},s=Ee.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),a=ms(o);let[l,u]=mf(a,n,e.zone);return s!==0&&(l+=s,u=e.zone.offset(l)),{ts:l,o:u}}function Nr(e,t,n,r,i,o){const{setZone:s,zone:a}=n;if(e&&Object.keys(e).length!==0){const l=t||a,u=pe.fromObject(e,{...n,zone:l,specificOffset:o});return s?u:u.setZone(a)}else return pe.invalid(new Tt("unparsable",`the input "${i}" can't be parsed as ${r}`))}function _i(e,t,n=!0){return e.isValid?lt.create(Re.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function Ps(e,t){const n=e.c.year>9999||e.c.year<0;let r="";return n&&e.c.year>=0&&(r+="+"),r+=Ve(e.c.year,n?6:4),t?(r+="-",r+=Ve(e.c.month),r+="-",r+=Ve(e.c.day)):(r+=Ve(e.c.month),r+=Ve(e.c.day)),r}function vf(e,t,n,r,i,o){let s=Ve(e.c.hour);return t?(s+=":",s+=Ve(e.c.minute),(e.c.second!==0||!n)&&(s+=":")):s+=Ve(e.c.minute),(e.c.second!==0||!n)&&(s+=Ve(e.c.second),(e.c.millisecond!==0||!r)&&(s+=".",s+=Ve(e.c.millisecond,3))),i&&(e.isOffsetFixed&&e.offset===0&&!o?s+="Z":e.o<0?(s+="-",s+=Ve(Math.trunc(-e.o/60)),s+=":",s+=Ve(Math.trunc(-e.o%60))):(s+="+",s+=Ve(Math.trunc(e.o/60)),s+=":",s+=Ve(Math.trunc(e.o%60)))),o&&(s+="["+e.zone.ianaName+"]"),s}const bf={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},dw={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},hw={ordinal:1,hour:0,minute:0,second:0,millisecond:0},wf=["year","month","day","hour","minute","second","millisecond"],pw=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],mw=["year","ordinal","hour","minute","second","millisecond"];function Sf(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new rc(e);return t}function xf(e,t){const n=on(t.zone,qe.defaultZone),r=Re.fromObject(t),i=qe.now();let o,s;if(xe(e.year))o=i;else{for(const u of wf)xe(e[u])&&(e[u]=bf[u]);const a=df(e)||hf(e);if(a)return pe.invalid(a);const l=n.offset(i);[o,s]=Ni(e,l,n)}return new pe({ts:o,zone:n,loc:r,o:s})}function kf(e,t,n){const r=xe(n.round)?!0:n.round,i=(s,a)=>(s=ps(s,r||n.calendary?0:2,!0),t.loc.clone(n).relFormatter(n).format(s,a)),o=s=>n.calendary?t.hasSame(e,s)?0:t.startOf(s).diff(e.startOf(s),s).get(s):t.diff(e,s).get(s);if(n.unit)return i(o(n.unit),n.unit);for(const s of n.units){const a=o(s);if(Math.abs(a)>=1)return i(a,s)}return i(e>t?-0:0,n.units[n.units.length-1])}function Ef(e){let t={},n;return e.length>0&&typeof e[e.length-1]=="object"?(t=e[e.length-1],n=Array.from(e).slice(0,e.length-1)):n=Array.from(e),[t,n]}class pe{constructor(t){const n=t.zone||qe.defaultZone;let r=t.invalid||(Number.isNaN(t.ts)?new Tt("invalid input"):null)||(n.isValid?null:Di(n));this.ts=xe(t.ts)?qe.now():t.ts;let i=null,o=null;if(!r)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(n))[i,o]=[t.old.c,t.old.o];else{const a=n.offset(this.ts);i=gf(this.ts,a),r=Number.isNaN(i.year)?new Tt("invalid input"):null,i=r?null:i,o=r?null:a}this._zone=n,this.loc=t.loc||Re.create(),this.invalid=r,this.weekData=null,this.c=i,this.o=o,this.isLuxonDateTime=!0}static now(){return new pe({})}static local(){const[t,n]=Ef(arguments),[r,i,o,s,a,l,u]=n;return xf({year:r,month:i,day:o,hour:s,minute:a,second:l,millisecond:u},t)}static utc(){const[t,n]=Ef(arguments),[r,i,o,s,a,l,u]=n;return t.zone=it.utcInstance,xf({year:r,month:i,day:o,hour:s,minute:a,second:l,millisecond:u},t)}static fromJSDate(t,n={}){const r=Eb(t)?t.valueOf():NaN;if(Number.isNaN(r))return pe.invalid("invalid input");const i=on(n.zone,qe.defaultZone);return i.isValid?new pe({ts:r,zone:i,loc:Re.fromObject(n)}):pe.invalid(Di(i))}static fromMillis(t,n={}){if(wn(t))return t<-pf||t>pf?pe.invalid("Timestamp out of range"):new pe({ts:t,zone:on(n.zone,qe.defaultZone),loc:Re.fromObject(n)});throw new vt(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,n={}){if(wn(t))return new pe({ts:t*1e3,zone:on(n.zone,qe.defaultZone),loc:Re.fromObject(n)});throw new vt("fromSeconds requires a numerical input")}static fromObject(t,n={}){t=t||{};const r=on(n.zone,qe.defaultZone);if(!r.isValid)return pe.invalid(Di(r));const i=qe.now(),o=xe(n.specificOffset)?r.offset(i):n.specificOffset,s=Ci(t,Sf),a=!xe(s.ordinal),l=!xe(s.year),u=!xe(s.month)||!xe(s.day),f=l||u,c=s.weekYear||s.weekNumber,h=Re.fromObject(n);if((f||a)&&c)throw new xr("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&a)throw new xr("Can't mix ordinal dates with month/day");const d=c||s.weekday&&!f;let m,p,g=gf(i,o);d?(m=pw,p=dw,g=Ms(g)):a?(m=mw,p=hw,g=Ds(g)):(m=wf,p=bf);let v=!1;for(const D of m){const P=s[D];xe(P)?v?s[D]=p[D]:s[D]=g[D]:v=!0}const y=d?cw(s):a?fw(s):df(s),w=y||hf(s);if(w)return pe.invalid(w);const A=d?cf(s):a?ff(s):s,[k,E]=Ni(A,o,r),I=new pe({ts:k,zone:r,o:E,loc:h});return s.weekday&&f&&t.weekday!==I.weekday?pe.invalid("mismatched weekday",`you can't specify both a weekday of ${s.weekday} and a date of ${I.toISO()}`):I}static fromISO(t,n={}){const[r,i]=M0(t);return Nr(r,i,n,"ISO 8601",t)}static fromRFC2822(t,n={}){const[r,i]=D0(t);return Nr(r,i,n,"RFC 2822",t)}static fromHTTP(t,n={}){const[r,i]=N0(t);return Nr(r,i,n,"HTTP",n)}static fromFormat(t,n,r={}){if(xe(t)||xe(n))throw new vt("fromFormat requires an input string and a format");const{locale:i=null,numberingSystem:o=null}=r,s=Re.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0}),[a,l,u,f]=uw(s,t,n);return f?pe.invalid(f):Nr(a,l,r,`format ${n}`,t,u)}static fromString(t,n,r={}){return pe.fromFormat(t,n,r)}static fromSQL(t,n={}){const[r,i]=B0(t);return Nr(r,i,n,"SQL",t)}static invalid(t,n=null){if(!t)throw new vt("need to specify a reason the DateTime is invalid");const r=t instanceof Tt?t:new Tt(t,n);if(qe.throwOnInvalid)throw new vb(r);return new pe({invalid:r})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?_s(this).weekYear:NaN}get weekNumber(){return this.isValid?_s(this).weekNumber:NaN}get weekday(){return this.isValid?_s(this).weekday:NaN}get ordinal(){return this.isValid?Ds(this.c).ordinal:NaN}get monthShort(){return this.isValid?Mi.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Mi.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Mi.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Mi.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}get isInLeapYear(){return kr(this.year)}get daysInMonth(){return xi(this.year,this.month)}get daysInYear(){return this.isValid?Er(this.year):NaN}get weeksInWeekYear(){return this.isValid?ki(this.weekYear):NaN}resolvedLocaleOptions(t={}){const{locale:n,numberingSystem:r,calendar:i}=lt.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:i}}toUTC(t=0,n={}){return this.setZone(it.instance(t),n)}toLocal(){return this.setZone(qe.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(t=on(t,qe.defaultZone),t.equals(this.zone))return this;if(t.isValid){let i=this.ts;if(n||r){const o=t.offset(this.ts),s=this.toObject();[i]=Ni(s,o,t)}return Dr(this,{ts:i,zone:t})}else return pe.invalid(Di(t))}reconfigure({locale:t,numberingSystem:n,outputCalendar:r}={}){const i=this.loc.clone({locale:t,numberingSystem:n,outputCalendar:r});return Dr(this,{loc:i})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const n=Ci(t,Sf),r=!xe(n.weekYear)||!xe(n.weekNumber)||!xe(n.weekday),i=!xe(n.ordinal),o=!xe(n.year),s=!xe(n.month)||!xe(n.day),a=o||s,l=n.weekYear||n.weekNumber;if((a||i)&&l)throw new xr("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(s&&i)throw new xr("Can't mix ordinal dates with month/day");let u;r?u=cf({...Ms(this.c),...n}):xe(n.ordinal)?(u={...this.toObject(),...n},xe(n.day)&&(u.day=Math.min(xi(u.year,u.month),u.day))):u=ff({...Ds(this.c),...n});const[f,c]=Ni(u,this.o,this.zone);return Dr(this,{ts:f,o:c})}plus(t){if(!this.isValid)return this;const n=Ee.fromDurationLike(t);return Dr(this,yf(this,n))}minus(t){if(!this.isValid)return this;const n=Ee.fromDurationLike(t).negate();return Dr(this,yf(this,n))}startOf(t){if(!this.isValid)return this;const n={},r=Ee.normalizeUnit(t);switch(r){case"years":n.month=1;case"quarters":case"months":n.day=1;case"weeks":case"days":n.hour=0;case"hours":n.minute=0;case"minutes":n.second=0;case"seconds":n.millisecond=0;break}if(r==="weeks"&&(n.weekday=1),r==="quarters"){const i=Math.ceil(this.month/3);n.month=(i-1)*3+1}return this.set(n)}endOf(t){return this.isValid?this.plus({[t]:1}).startOf(t).minus(1):this}toFormat(t,n={}){return this.isValid?lt.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,t):Ns}toLocaleString(t=ds,n={}){return this.isValid?lt.create(this.loc.clone(n),t).formatDateTime(this):Ns}toLocaleParts(t={}){return this.isValid?lt.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:n=!1,suppressMilliseconds:r=!1,includeOffset:i=!0,extendedZone:o=!1}={}){if(!this.isValid)return null;const s=t==="extended";let a=Ps(this,s);return a+="T",a+=vf(this,s,n,r,i,o),a}toISODate({format:t="extended"}={}){return this.isValid?Ps(this,t==="extended"):null}toISOWeekDate(){return _i(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:n=!1,includeOffset:r=!0,includePrefix:i=!1,extendedZone:o=!1,format:s="extended"}={}){return this.isValid?(i?"T":"")+vf(this,s==="extended",n,t,r,o):null}toRFC2822(){return _i(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return _i(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?Ps(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:n=!1,includeOffsetSpace:r=!0}={}){let i="HH:mm:ss.SSS";return(n||t)&&(r&&(i+=" "),n?i+="z":t&&(i+="ZZ")),_i(this,i,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():Ns}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const n={...this.c};return t.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,n="milliseconds",r={}){if(!this.isValid||!t.isValid)return Ee.invalid("created by diffing an invalid DateTime");const i={locale:this.locale,numberingSystem:this.numberingSystem,...r},o=Cb(n).map(Ee.normalizeUnit),s=t.valueOf()>this.valueOf(),a=s?this:t,l=s?t:this,u=K0(a,l,o,i);return s?u.negate():u}diffNow(t="milliseconds",n={}){return this.diff(pe.now(),t,n)}until(t){return this.isValid?ze.fromDateTimes(this,t):this}hasSame(t,n){if(!this.isValid)return!1;const r=t.valueOf(),i=this.setZone(t.zone,{keepLocalTime:!0});return i.startOf(n)<=r&&r<=i.endOf(n)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const n=t.base||pe.fromObject({},{zone:this.zone}),r=t.padding?this<n?-t.padding:t.padding:0;let i=["years","months","days","hours","minutes","seconds"],o=t.unit;return Array.isArray(t.unit)&&(i=t.unit,o=void 0),kf(n,this.plus(r),{...t,numeric:"always",units:i,unit:o})}toRelativeCalendar(t={}){return this.isValid?kf(t.base||pe.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(pe.isDateTime))throw new vt("min requires all arguments be DateTimes");return Ec(t,n=>n.valueOf(),Math.min)}static max(...t){if(!t.every(pe.isDateTime))throw new vt("max requires all arguments be DateTimes");return Ec(t,n=>n.valueOf(),Math.max)}static fromFormatExplain(t,n,r={}){const{locale:i=null,numberingSystem:o=null}=r,s=Re.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0});return rf(s,t,n)}static fromStringExplain(t,n,r={}){return pe.fromFormatExplain(t,n,r)}static get DATE_SHORT(){return ds}static get DATE_MED(){return ic}static get DATE_MED_WITH_WEEKDAY(){return Sb}static get DATE_FULL(){return oc}static get DATE_HUGE(){return sc}static get TIME_SIMPLE(){return ac}static get TIME_WITH_SECONDS(){return lc}static get TIME_WITH_SHORT_OFFSET(){return uc}static get TIME_WITH_LONG_OFFSET(){return cc}static get TIME_24_SIMPLE(){return fc}static get TIME_24_WITH_SECONDS(){return dc}static get TIME_24_WITH_SHORT_OFFSET(){return hc}static get TIME_24_WITH_LONG_OFFSET(){return pc}static get DATETIME_SHORT(){return mc}static get DATETIME_SHORT_WITH_SECONDS(){return gc}static get DATETIME_MED(){return yc}static get DATETIME_MED_WITH_SECONDS(){return vc}static get DATETIME_MED_WITH_WEEKDAY(){return xb}static get DATETIME_FULL(){return bc}static get DATETIME_FULL_WITH_SECONDS(){return wc}static get DATETIME_HUGE(){return Sc}static get DATETIME_HUGE_WITH_SECONDS(){return xc}}function _r(e){if(pe.isDateTime(e))return e;if(e&&e.valueOf&&wn(e.valueOf()))return pe.fromJSDate(e);if(e&&typeof e=="object")return pe.fromObject(e);throw new vt(`Unknown datetime argument: ${e}, of type ${typeof e}`)}function gw(e){const t=typeof e=="string"?pe.fromISO(e):pe.fromJSDate(e);if(!t.isValid)return"Invalid date";const r=pe.now().diff(t,["years","months","days","hours","minutes"]).toObject();return r.years&&r.years>=1?`${Math.floor(r.years)} year${Math.floor(r.years)>1?"s":""} ago`:r.months&&r.months>=1?`${Math.floor(r.months)} month${Math.floor(r.months)>1?"s":""} ago`:r.days&&r.days>=1?`${Math.floor(r.days)} day${Math.floor(r.days)>1?"s":""} ago`:r.hours&&r.hours>=1?`${Math.floor(r.hours)}h ago`:r.minutes&&r.minutes>=1?`${Math.floor(r.minutes)}m ago`:"just now"}function Ls(e){if(!/^#?([a-fA-F\d]{6}|[a-fA-F\d]{3})$/.test(e))return{r:0,g:0,b:0};const n=e.replace(/^#/,"");let r=n;n.length===3&&(r=n.split("").map(l=>l+l).join(""));const i=parseInt(r,16),o=i>>16&255,s=i>>8&255,a=i&255;return{r:o,g:s,b:a}}function yw(e){return`#${((1<<24)+(e.r<<16)+(e.g<<8)+e.b).toString(16).slice(1)}`}const vw=(e,t=30)=>{const n=Math.min(e.r,e.g,e.b),r=Math.max(e.r,e.g,e.b,n+1);return{r:Math.floor((e.r-n)/(r-n)*t*(1-.299)+120-t/2),g:Math.floor((e.g-n)/(r-n)*t*(1-.587)+120-t/2),b:Math.floor((e.b-n)/(r-n)*t*(1-.114)+120-t/2)}};function Cf(e){return Object.entries(e).reduce((t,[n,r])=>{const i=n.replace(/(\d+)/,o=>(1e3-parseInt(o)).toString());return{...t,[i]:r}},{})}const bw=2.4,ww=.2126729,Sw=.7151522,xw=.072175,kw=.56,Ew=.57,Cw=.62,Aw=.65,Pi=.022,Af=1.414,Tw=1.14,Iw=1.14,Ow=.035991,Mw=27.7847239587675,Dw=27.7847239587675,Tf=.027,If=.027,Of=.001,Nw=5e-4;function Mf(e){const{r:t,g:n,b:r}=e,i=o=>(o/255)**bw;return ww*i(t)+Sw*i(n)+xw*i(r)}function Df(e,t){if(!e||!t)return 0;let n=Mf(Ls(e)),r=Mf(Ls(t)),i=0,o=0;return n=n>Pi?n:n+(Pi-n)**Af,r=r>Pi?r:r+(Pi-r)**Af,Math.abs(r-n)<Nw?0:(r>n?(i=(r**kw-n**Ew)*Tw,o=i<Of?0:i<Ow?i-i*Mw*Tf:i-Tf):(i=(r**Aw-n**Cw)*Iw,o=i>-Of?0:i>-.035991?i-i*Dw*If:i+If),Math.abs(o*100))}const _w=(e,t,n)=>{const r=e;let i=0;for(;t.some(o=>n(o)===e);)i+=1,e=`${r} (${i})`;return e};function Nf(e){const{fontFamily:t,...n}=e,r=_f(n);return Yu(".bpReset",{...r,"font-family":`'${t}', sans-serif`})+Yu(":host, :root",{...r})}function _f(e){const{radius:t,themeMode:n,color:r,variant:i,headerVariant:o}=e;let s={},a={};if(r){const h=tc(r),d=n==="dark"?Cf(h):h,m=tc(yw(vw(Ls(r)))),p=n==="dark"?Cf(m):m,g=n==="dark"?"#101010":"#fdfdfd";a=Object.entries({...d,1:g}).reduce((y,[w,A])=>({...y,[`--bpPrimary-${w}`]:A}),{});const v=Object.entries({...p,1:g}).reduce((y,[w,A])=>({...y,[`--bpGray-${w}`]:A}),{});s={...a,...v}}t&&(s={...s,"--bpRadius-scale":t.toString()});const l=n==="dark"?{bg:"var(--transparent-dark)",bgHover:"var(--transparent-dark-hover)"}:{bg:"var(--transparent-light)",bgHover:"var(--transparent-light-hover)"},u=a?Df(a["--bpPrimary-600"],a["--bpPrimary-50"])>40?"var(--bpPrimary-50)":"var(--bpPrimary-900)":"var(--bpPrimary-50)",f=i==="solid"?{"--message-bg":"var(--bpPrimary-600)","--message-bg-hover":"var(--bpPrimary-700)","--message-text":u,"--send-button-bg":"var(--bpPrimary-600)","--send-button-bg-hover":"var(--bpPrimary-700)","--send-button-text":"var(--bpPrimary-50)","--button-bg":"var(--bpPrimary-200)","--button-bg-hover":"var(--bpPrimary-300)","--button-text":"var(--bpPrimary-800)","--fab-bg":"var(--bpPrimary-600)","--fab-bg-hover":"var(--bpPrimary-700)","--fab-icon":u,"--modal-submit-bg":"var(--bpPrimary-600)","--modal-submit-bg-hover":"var(--bpPrimary-700)"}:{"--message-bg":"var(--bpPrimary-100)","--message-bg-hover":"var(--bpPrimary-200)","--message-text":"var(--bpPrimary-900)","--send-button-bg":"var(--bpPrimary-600)","--send-button-bg-hover":"var(--bpPrimary-700)","--send-button-text":"var(--bpPrimary-50)","--button-bg":"var(--bpPrimary-500)","--button-bg-hover":"var(--bpPrimary-600)","--button-text":a?Df(a["--bpPrimary-500"],a["--bpPrimary-50"])>40?"var(--bpPrimary-50)":"var(--bpPrimary-900)":"var(--bpPrimary-50)","--fab-bg":"var(--bpPrimary-100)","--fab-bg-hover":"var(--bpPrimary-200)","--fab-icon":"var(--bpPrimary-700)","--scrollbar":"var(--bpGray-500)","--scrollbar-hover":"var(--bpGray-400)","--modal-submit-bg":"var(--bpPrimary-200)","--modal-submit-bg-hover":"var(--bpPrimary-300)"},c=o==="solid"?{"--header-bg":"var(--bpPrimary-600)","--header-bg-hover":"var(--bpPrimary-700)","--header-hover-dark":"var(--bpPrimary-800)","--header-title":u,"--header-description":u,"--header-description-icon":u,"--header-description-link":u,"--header-avatar-bg":"var(--bpPrimary-300)","--header-avatar-text":"var(--bpPrimary-700)"}:{"--header-bg":l.bg,"--header-bg-hover":l.bgHover,"--header-hover-dark":"var(--bpGray-200)","--header-title":"var(--bpGray-900)","--header-description":"var(--bpGray-600)","--header-description-icon":"var(--bpPrimary-700)","--header-description-link":"var(--bpPrimary-800)","--header-avatar-bg":"var(--bpPrimary-600)","--header-avatar-text":"var(--bpPrimary-50)"};return{...s,...f,...c}}const Pw=e=>{if(typeof URL.canParse=="function")return URL.canParse(e);try{return new URL(e),!0}catch{return!1}},Pf=["audio","file","image","video"],Lf=e=>Pf.includes(e),Ff="The Client ID is required to initialize the webchat.",Lw="The API url is required to initialize the webchat.",Fw="The Bot ID is required to initialize the webchat.",Rw="No config URL provided.",Rf=`Invalid API URL.
18
+ Please use a valid API URL.`,$f=`Invalid Client ID.
19
+ Please use a valid Botpress Client ID.`,Bf=`Invalid URL.
20
+ Please make sure your client ID and API URL are valid`,$w=`Invalid config URL.
21
+ Please make sure your config URL is valid`,Bw=`Invalid webchat configuration.
22
+ Please make sure your config file is valid`,zw="Access denied to configuration file. Please check your credentials or your configuration URL and try again.",zf=`This bot has temporarily paused.
23
+ Please check back later.`,Uf=`This bot has temporarily paused.
24
+ Please check back later.`,Fs="Something went wrong. To fix it, please clear your browser's local and session storage and then refresh the page",Li="Please check your internet connection and refresh the page.",Hf=`You've been disconnected from the conversation.
25
+ Please refresh the page.`,jf=`Unable to process the message.
26
+ Please start a new conversation.`,Rs={ResourceNotFound:{type:"configuration",message:$f},Forbidden:{type:"bot",message:zf}},$s={MethodNotFound:{type:"configuration",message:Bf},QuotaExceeded:{type:"bot",message:Uf},Forbidden:{type:"bot",message:Fs}};function Vf(e){return e in Rs}function Wf(e){return e in $s}function qf(e){return e!==null&&typeof e=="object"&&"id"in e&&"code"in e&&"type"in e}function Yf(e){return e!==null&&typeof e=="object"&&"type"in e&&e.type==="error"&&"message"in e&&typeof e.message=="string"}const Kf=async(e,t=3,n=1e3)=>{let r;for(let i=1;i<=t;i++)try{return await e()}catch(o){if(r=o,i===t)throw r;const s=n*Math.pow(2,i-1);await new Promise(a=>setTimeout(a,s))}throw new Error("Unreachable: retry loop should always return or throw")},Uw=["networkerror","failedtofetch","errorininputstream"],Pr=e=>{var n;console.error("An error occurred:",e);let t={type:"unknown",message:"An unexpected error occurred"};if(qf(e))e.type==="network"?t={id:e.id,type:"network",message:Li}:(n=e.message)!=null&&n.includes("[Webhook Handler]")&&Vf(e.type)?t={id:e.id,...Rs[e.type]}:Wf(e.type)?t={id:e.id,...$s[e.type]}:t={id:e.id,type:e.type,message:e.message||"An error occurred"};else if(Yf(e))Gf(e.message)?t={type:"disconnected",message:Hf}:Qf(e.message).includes("invalidcontenttype")?t={type:"bot",message:jf}:t={type:"event",message:e.message};else if(e instanceof Error&&Gf(e.message))t={type:"network",message:Li};else if(e&&typeof e=="object"&&"type"in e&&"message"in e){const r=e;r.type==="network"?t={type:"network",message:Li}:t={type:r.type,message:r.message}}return t};function Gf(e){return Uw.some(t=>Qf(e).includes(t))}function Qf(e){return e.replaceAll(" ","").toLowerCase()}const Hw=(e,t)=>{if(!e)return{type:"configuration",message:Ff};if(!Pw(t))return{type:"configuration",message:Rf}},jw=e=>new Promise((t,n)=>{const r=new FileReader;r.onload=i=>{var o;return t((o=i.target)==null?void 0:o.result)},r.onerror=i=>{var o;return n((o=i.target)==null?void 0:o.error)},r.readAsArrayBuffer(e)});function Vw(e,t,n,r){let i;return t&&e?i={conversationId:e,userToken:t}:t?i={conversationId:void 0,userToken:t}:i={conversationId:n,userToken:r},i}const En=M.forwardRef(({userId:e,src:t,container:n,image:r,fallback:i,...o},s)=>{const a=Ku(e??"",15);return x.jsxs(us,{ref:s,"data-color":a,...n,...o,children:[x.jsx(cs,{src:t,...r}),x.jsx(fs,{...i,children:typeof o.children=="string"?o.children[0]:o.children})]})});En.displayName="Avatar";function kP(){}function EP(){}function Ww(e,t){const n={};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,Yw=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Kw={};function Zf(e,t){return(Kw.jsx?Yw:qw).test(e)}const Gw=/[ \t\n\f\r]/g;function Qw(e){return typeof e=="object"?e.type==="text"?Jf(e.value):!1:Jf(e)}function Jf(e){return e.replace(Gw,"")===""}class Lr{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Lr.prototype.normal={},Lr.prototype.property={},Lr.prototype.space=void 0;function Xf(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Lr(n,r,t)}function Bs(e){return e.toLowerCase()}class ut{constructor(t,n){this.attribute=n,this.property=t}}ut.prototype.attribute="",ut.prototype.booleanish=!1,ut.prototype.boolean=!1,ut.prototype.commaOrSpaceSeparated=!1,ut.prototype.commaSeparated=!1,ut.prototype.defined=!1,ut.prototype.mustUseProperty=!1,ut.prototype.number=!1,ut.prototype.overloadedBoolean=!1,ut.prototype.property="",ut.prototype.spaceSeparated=!1,ut.prototype.space=void 0;let Zw=0;const ge=Cn(),We=Cn(),zs=Cn(),Z=Cn(),_e=Cn(),jn=Cn(),pt=Cn();function Cn(){return 2**++Zw}const Us=Object.freeze(Object.defineProperty({__proto__:null,boolean:ge,booleanish:We,commaOrSpaceSeparated:pt,commaSeparated:jn,number:Z,overloadedBoolean:zs,spaceSeparated:_e},Symbol.toStringTag,{value:"Module"})),Hs=Object.keys(Us);class js extends ut{constructor(t,n,r,i){let o=-1;if(super(t,n),ed(this,"space",i),typeof r=="number")for(;++o<Hs.length;){const s=Hs[o];ed(this,Hs[o],(r&Us[s])===Us[s])}}}js.prototype.defined=!0;function ed(e,t,n){n&&(e[t]=n)}function Vn(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new js(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Bs(r)]=r,n[Bs(o.attribute)]=r}return new Lr(t,n,e.space)}const td=Vn({properties:{ariaActiveDescendant:null,ariaAtomic:We,ariaAutoComplete:null,ariaBusy:We,ariaChecked:We,ariaColCount:Z,ariaColIndex:Z,ariaColSpan:Z,ariaControls:_e,ariaCurrent:null,ariaDescribedBy:_e,ariaDetails:null,ariaDisabled:We,ariaDropEffect:_e,ariaErrorMessage:null,ariaExpanded:We,ariaFlowTo:_e,ariaGrabbed:We,ariaHasPopup:null,ariaHidden:We,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:_e,ariaLevel:Z,ariaLive:null,ariaModal:We,ariaMultiLine:We,ariaMultiSelectable:We,ariaOrientation:null,ariaOwns:_e,ariaPlaceholder:null,ariaPosInSet:Z,ariaPressed:We,ariaReadOnly:We,ariaRelevant:null,ariaRequired:We,ariaRoleDescription:_e,ariaRowCount:Z,ariaRowIndex:Z,ariaRowSpan:Z,ariaSelected:We,ariaSetSize:Z,ariaSort:null,ariaValueMax:Z,ariaValueMin:Z,ariaValueNow:Z,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function nd(e,t){return t in e?e[t]:t}function rd(e,t){return nd(e,t.toLowerCase())}const Jw=Vn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:jn,acceptCharset:_e,accessKey:_e,action:null,allow:null,allowFullScreen:ge,allowPaymentRequest:ge,allowUserMedia:ge,alt:null,as:null,async:ge,autoCapitalize:null,autoComplete:_e,autoFocus:ge,autoPlay:ge,blocking:_e,capture:null,charSet:null,checked:ge,cite:null,className:_e,cols:Z,colSpan:null,content:null,contentEditable:We,controls:ge,controlsList:_e,coords:Z|jn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ge,defer:ge,dir:null,dirName:null,disabled:ge,download:zs,draggable:We,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ge,formTarget:null,headers:_e,height:Z,hidden:zs,high:Z,href:null,hrefLang:null,htmlFor:_e,httpEquiv:_e,id:null,imageSizes:null,imageSrcSet:null,inert:ge,inputMode:null,integrity:null,is:null,isMap:ge,itemId:null,itemProp:_e,itemRef:_e,itemScope:ge,itemType:_e,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ge,low:Z,manifest:null,max:null,maxLength:Z,media:null,method:null,min:null,minLength:Z,multiple:ge,muted:ge,name:null,nonce:null,noModule:ge,noValidate:ge,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle: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:ge,optimum:Z,pattern:null,ping:_e,placeholder:null,playsInline:ge,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ge,referrerPolicy:null,rel:_e,required:ge,reversed:ge,rows:Z,rowSpan:Z,sandbox:_e,scope:null,scoped:ge,seamless:ge,selected:ge,shadowRootClonable:ge,shadowRootDelegatesFocus:ge,shadowRootMode:null,shape:null,size:Z,sizes:null,slot:null,span:Z,spellCheck:We,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Z,step:null,style:null,tabIndex:Z,target:null,title:null,translate:null,type:null,typeMustMatch:ge,useMap:null,value:We,width:Z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:_e,axis:null,background:null,bgColor:null,border:Z,borderColor:null,bottomMargin:Z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ge,declare:ge,event:null,face:null,frame:null,frameBorder:null,hSpace:Z,leftMargin:Z,link:null,longDesc:null,lowSrc:null,marginHeight:Z,marginWidth:Z,noResize:ge,noHref:ge,noShade:ge,noWrap:ge,object:null,profile:null,prompt:null,rev:null,rightMargin:Z,rules:null,scheme:null,scrolling:We,standby:null,summary:null,text:null,topMargin:Z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Z,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ge,disableRemotePlayback:ge,prefix:null,property:null,results:Z,security:null,unselectable:null},space:"html",transform:rd}),Xw=Vn({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",transformOrigin:"transform-origin",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"},properties:{about:pt,accentHeight:Z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Z,amplitude:Z,arabicForm:null,ascent:Z,attributeName:null,attributeType:null,azimuth:Z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Z,by:null,calcMode:null,capHeight:Z,className:_e,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:Z,diffuseConstant:Z,direction:null,display:null,dur:null,divisor:Z,dominantBaseline:null,download:ge,dx:null,dy:null,edgeMode:null,editable:null,elevation:Z,enableBackground:null,end:null,event:null,exponent:Z,externalResourcesRequired:null,fill:null,fillOpacity:Z,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:jn,g2:jn,glyphName:jn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Z,horizOriginX:Z,horizOriginY:Z,id:null,ideographic:Z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Z,k:Z,k1:Z,k2:Z,k3:Z,k4:Z,kernelMatrix:pt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Z,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:Z,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:Z,overlineThickness:Z,paintOrder:null,panose1:null,path:null,pathLength:Z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:_e,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Z,pointsAtY:Z,pointsAtZ:Z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:pt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:pt,rev:pt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:pt,requiredFeatures:pt,requiredFonts:pt,requiredFormats:pt,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:Z,specularExponent:Z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Z,strikethroughThickness:Z,string:null,stroke:null,strokeDashArray:pt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Z,strokeOpacity:Z,strokeWidth:null,style:null,surfaceScale:Z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:pt,tabIndex:Z,tableValues:null,target:null,targetX:Z,targetY:Z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:pt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Z,underlineThickness:Z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Z,values:null,vAlphabetic:Z,vMathematical:Z,vectorEffect:null,vHanging:Z,vIdeographic:Z,version:null,vertAdvY:Z,vertOriginX:Z,vertOriginY:Z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:nd}),id=Vn({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),od=Vn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:rd}),sd=Vn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),e1={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"},t1=/[A-Z]/g,ad=/-[a-z]/g,n1=/^data[-\w.:]+$/i;function r1(e,t){const n=Bs(t);let r=t,i=ut;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&n1.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(ad,o1);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!ad.test(o)){let s=o.replace(t1,i1);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=js}return new i(r,t)}function i1(e){return"-"+e.toLowerCase()}function o1(e){return e.charAt(1).toUpperCase()}const s1=Xf([td,Jw,id,od,sd],"html"),Vs=Xf([td,Xw,id,od,sd],"svg");function a1(e){return e.join(" ").trim()}var Ws={},ld=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,l1=/\n/g,u1=/^\s*/,c1=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,f1=/^:\s*/,d1=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,h1=/^[;\s]*/,p1=/^\s+|\s+$/g,m1=`
27
+ `,ud="/",cd="*",An="",g1="comment",y1="declaration";function v1(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(m){var p=m.match(l1);p&&(n+=p.length);var g=m.lastIndexOf(m1);r=~g?m.length-g:r+m.length}function o(){var m={line:n,column:r};return function(p){return p.position=new s(m),u(),p}}function s(m){this.start=m,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function a(m){var p=new Error(t.source+":"+n+":"+r+": "+m);if(p.reason=m,p.filename=t.source,p.line=n,p.column=r,p.source=e,!t.silent)throw p}function l(m){var p=m.exec(e);if(p){var g=p[0];return i(g),e=e.slice(g.length),p}}function u(){l(u1)}function f(m){var p;for(m=m||[];p=c();)p!==!1&&m.push(p);return m}function c(){var m=o();if(!(ud!=e.charAt(0)||cd!=e.charAt(1))){for(var p=2;An!=e.charAt(p)&&(cd!=e.charAt(p)||ud!=e.charAt(p+1));)++p;if(p+=2,An===e.charAt(p-1))return a("End of comment missing");var g=e.slice(2,p-2);return r+=2,i(g),e=e.slice(p),r+=2,m({type:g1,comment:g})}}function h(){var m=o(),p=l(c1);if(p){if(c(),!l(f1))return a("property missing ':'");var g=l(d1),v=m({type:y1,property:fd(p[0].replace(ld,An)),value:g?fd(g[0].replace(ld,An)):An});return l(h1),v}}function d(){var m=[];f(m);for(var p;p=h();)p!==!1&&(m.push(p),f(m));return m}return u(),d()}function fd(e){return e?e.replace(p1,An):An}var b1=v1,w1=yn&&yn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.default=x1;const S1=w1(b1);function x1(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,S1.default)(e),i=typeof t=="function";return r.forEach(o=>{if(o.type!=="declaration")return;const{property:s,value:a}=o;i?t(s,a,o):a&&(n=n||{},n[s]=a)}),n}var Fi={};Object.defineProperty(Fi,"__esModule",{value:!0}),Fi.camelCase=void 0;var k1=/^--[a-zA-Z0-9_-]+$/,E1=/-([a-z])/g,C1=/^[^-]+$/,A1=/^-(webkit|moz|ms|o|khtml)-/,T1=/^-(ms)-/,I1=function(e){return!e||C1.test(e)||k1.test(e)},O1=function(e,t){return t.toUpperCase()},dd=function(e,t){return"".concat(t,"-")},M1=function(e,t){return t===void 0&&(t={}),I1(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(T1,dd):e=e.replace(A1,dd),e.replace(E1,O1))};Fi.camelCase=M1;var D1=yn&&yn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},N1=D1(Ws),_1=Fi;function qs(e,t){var n={};return!e||typeof e!="string"||(0,N1.default)(e,function(r,i){r&&i&&(n[(0,_1.camelCase)(r,t)]=i)}),n}qs.default=qs;var P1=qs;const L1=vn(P1),hd=pd("end"),Ys=pd("start");function pd(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 F1(e){const t=Ys(e),n=hd(e);if(t&&n)return{start:t,end:n}}function Fr(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?md(e.position):"start"in e||"end"in e?md(e):"line"in e||"column"in e?Ks(e):""}function Ks(e){return gd(e&&e.line)+":"+gd(e&&e.column)}function md(e){return Ks(e&&e.start)+"-"+Ks(e&&e.end)}function gd(e){return e&&typeof e=="number"?e:1}class et extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.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=Fr(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}et.prototype.file="",et.prototype.name="",et.prototype.reason="",et.prototype.message="",et.prototype.stack="",et.prototype.column=void 0,et.prototype.line=void 0,et.prototype.ancestors=void 0,et.prototype.cause=void 0,et.prototype.fatal=void 0,et.prototype.place=void 0,et.prototype.ruleId=void 0,et.prototype.source=void 0;const Gs={}.hasOwnProperty,R1=new Map,$1=/[A-Z]/g,B1=new Set(["table","tbody","thead","tfoot","tr"]),z1=new Set(["td","th"]),yd="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function U1(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=G1(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=K1(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"?Vs:s1,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=vd(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function vd(e,t,n){if(t.type==="element")return H1(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return j1(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return W1(e,t,n);if(t.type==="mdxjsEsm")return V1(e,t);if(t.type==="root")return q1(e,t,n);if(t.type==="text")return Y1(e,t)}function H1(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Vs,e.schema=i),e.ancestors.push(t);const o=wd(e,t.tagName,!1),s=Q1(e,t);let a=Zs(e,t);return B1.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!Qw(l):!0})),bd(e,s,o,t),Qs(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function j1(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)}Rr(e,t.position)}function V1(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Rr(e,t.position)}function W1(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Vs,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:wd(e,t.name,!0),s=Z1(e,t),a=Zs(e,t);return bd(e,s,o,t),Qs(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function q1(e,t,n){const r={};return Qs(r,Zs(e,t)),e.create(t,e.Fragment,r,n)}function Y1(e,t){return t.value}function bd(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Qs(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function K1(e,t,n){return r;function r(i,o,s,a){const u=Array.isArray(s.children)?n:t;return a?u(o,s,a):u(o,s)}}function G1(e,t){return n;function n(r,i,o,s){const a=Array.isArray(o.children),l=Ys(r);return t(i,o,s,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function Q1(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Gs.call(t.properties,i)){const o=J1(e,i,t.properties[i]);if(o){const[s,a]=o;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&z1.has(t.tagName)?r=a:n[s]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Z1(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Rr(e,t.position);else{const i=r.name;let o;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,o=e.evaluater.evaluateExpression(a.expression)}else Rr(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Zs(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:R1;for(;++r<t.children.length;){const o=t.children[r];let s;if(e.passKeys){const l=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(l){const u=i.get(l)||0;s=l+"-"+u,i.set(l,u+1)}}const a=vd(e,o,s);a!==void 0&&n.push(a)}return n}function J1(e,t,n){const r=r1(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Ww(n):a1(n)),r.property==="style"){let i=typeof n=="object"?n:X1(e,String(n));return e.stylePropertyNameCase==="css"&&(i=eS(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?e1[r.property]||r.property:r.attribute,n]}}function X1(e,t){try{return L1(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new et("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=yd+"#cannot-parse-style-attribute",i}}function wd(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,s;for(;++o<i.length;){const a=Zf(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=s}else r=Zf(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Gs.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Rr(e)}function Rr(e,t){const n=new et("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=yd+"#cannot-handle-mdx-estrees-without-createevaluater",n}function eS(e){const t={};let n;for(n in e)Gs.call(e,n)&&(t[tS(n)]=e[n]);return t}function tS(e){let t=e.replace($1,nS);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function nS(e){return"-"+e.toLowerCase()}const Js={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"]},rS={};function Xs(e,t){const n=rS,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Sd(e,r,i)}function Sd(e,t,n){if(iS(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 xd(e.children,t,n)}return Array.isArray(e)?xd(e,t,n):""}function xd(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Sd(e[i],t,n);return r.join("")}function iS(e){return!!(e&&typeof e=="object")}const kd=document.createElement("i");function ea(e){const t="&"+e+";";kd.innerHTML=t;const n=kd.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function mt(e,t,n,r){const i=e.length;let o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function St(e,t){return e.length>0?(mt(e,e.length,0,t),e):t}const Ed={}.hasOwnProperty;function Cd(e){const t={};let n=-1;for(;++n<e.length;)oS(t,e[n]);return t}function oS(e,t){let n;for(n in t){const i=(Ed.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){Ed.call(i,s)||(i[s]=[]);const a=o[s];sS(i[s],Array.isArray(a)?a:a?[a]:[])}}}function sS(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);mt(e,0,0,r)}function Ad(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 Mt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ot=sn(/[A-Za-z]/),tt=sn(/[\dA-Za-z]/),aS=sn(/[#-'*+\--9=?A-Z^-~]/);function Ri(e){return e!==null&&(e<32||e===127)}const ta=sn(/\d/),lS=sn(/[\dA-Fa-f]/),uS=sn(/[!-/:-@[-`{-~]/);function ce(e){return e!==null&&e<-2}function De(e){return e!==null&&(e<0||e===32)}function ve(e){return e===-2||e===-1||e===32}const $i=sn(new RegExp("\\p{P}|\\p{S}","u")),Tn=sn(/\s/);function sn(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Wn(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(o===37&&tt(e.charCodeAt(n+1))&&tt(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function ke(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(l){return ve(l)?(e.enter(n),a(l)):t(l)}function a(l){return ve(l)&&o++<i?(e.consume(l),a):(e.exit(n),t(l))}}const cS={tokenize:fS};function fS(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"),ke(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return ce(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),s)}}const dS={tokenize:hS},Td={tokenize:pS};function hS(e){const t=this,n=[];let r=0,i,o,s;return a;function a(w){if(r<n.length){const A=n[r];return t.containerState=A[1],e.attempt(A[0].continuation,l,u)(w)}return u(w)}function l(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&y();const A=t.events.length;let k=A,E;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){E=t.events[k][1].end;break}v(r);let I=A;for(;I<t.events.length;)t.events[I][1].end={...E},I++;return mt(t.events,k+1,0,t.events.slice(A)),t.events.length=I,u(w)}return a(w)}function u(w){if(r===n.length){if(!i)return h(w);if(i.currentConstruct&&i.currentConstruct.concrete)return m(w);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Td,f,c)(w)}function f(w){return i&&y(),v(r),h(w)}function c(w){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,m(w)}function h(w){return t.containerState={},e.attempt(Td,d,m)(w)}function d(w){return r++,n.push([t.currentConstruct,t.containerState]),h(w)}function m(w){if(w===null){i&&y(),v(0),e.consume(w);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),p(w)}function p(w){if(w===null){g(e.exit("chunkFlow"),!0),v(0),e.consume(w);return}return ce(w)?(e.consume(w),g(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(w),p)}function g(w,A){const k=t.sliceStream(w);if(A&&k.push(null),w.previous=o,o&&(o.next=w),o=w,i.defineSkip(w.start),i.write(k),t.parser.lazy[w.start.line]){let E=i.events.length;for(;E--;)if(i.events[E][1].start.offset<s&&(!i.events[E][1].end||i.events[E][1].end.offset>s))return;const I=t.events.length;let D=I,P,T;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){if(P){T=t.events[D][1].end;break}P=!0}for(v(r),E=I;E<t.events.length;)t.events[E][1].end={...T},E++;mt(t.events,D+1,0,t.events.slice(I)),t.events.length=E}}function v(w){let A=n.length;for(;A-- >w;){const k=n[A];t.containerState=k[1],k[0].exit.call(t,e)}n.length=w}function y(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function pS(e,t,n){return ke(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function qn(e){if(e===null||De(e)||Tn(e))return 1;if($i(e))return 2}function Bi(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const na={name:"attention",resolveAll:mS,tokenize:gS};function mS(e,t){let n=-1,r,i,o,s,a,l,u,f;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 c={...e[r][1].end},h={...e[n][1].start};Id(c,-l),Id(h,l),s={type:l>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},o={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[r][1].end={...s.start},e[n][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=St(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=St(u,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),u=St(u,Bi(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=St(u,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,u=St(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,mt(e,r-1,n-r+3,u),n=r+u.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function gS(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=qn(r);let o;return s;function s(l){return o=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===o)return e.consume(l),a;const u=e.exit("attentionSequence"),f=qn(l),c=!f||f===2&&i||n.includes(l),h=!i||i===2&&f||n.includes(r);return u._open=!!(o===42?c:c&&(i||!h)),u._close=!!(o===42?h:h&&(f||!c)),t(l)}}function Id(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const yS={name:"autolink",tokenize:vS};function vS(e,t,n){let r=0;return i;function i(d){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(d){return ot(d)?(e.consume(d),s):d===64?n(d):u(d)}function s(d){return d===43||d===45||d===46||tt(d)?(r=1,a(d)):u(d)}function a(d){return d===58?(e.consume(d),r=0,l):(d===43||d===45||d===46||tt(d))&&r++<32?(e.consume(d),a):(r=0,u(d))}function l(d){return d===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):d===null||d===32||d===60||Ri(d)?n(d):(e.consume(d),l)}function u(d){return d===64?(e.consume(d),f):aS(d)?(e.consume(d),u):n(d)}function f(d){return tt(d)?c(d):n(d)}function c(d){return d===46?(e.consume(d),r=0,f):d===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):h(d)}function h(d){if((d===45||tt(d))&&r++<63){const m=d===45?h:c;return e.consume(d),m}return n(d)}}const $r={partial:!0,tokenize:bS};function bS(e,t,n){return r;function r(o){return ve(o)?ke(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||ce(o)?t(o):n(o)}}const Od={continuation:{tokenize:SS},exit:xS,name:"blockQuote",tokenize:wS};function wS(e,t,n){const r=this;return i;function i(s){if(s===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return ve(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function SS(e,t,n){const r=this;return i;function i(s){return ve(s)?ke(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(Od,t,n)(s)}}function xS(e){e.exit("blockQuote")}const Md={name:"characterEscape",tokenize:kS};function kS(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return uS(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const Dd={name:"characterReference",tokenize:ES};function ES(e,t,n){const r=this;let i=0,o,s;return a;function a(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),l}function l(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),o=31,s=tt,f(c))}function u(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=lS,f):(e.enter("characterReferenceValue"),o=7,s=ta,f(c))}function f(c){if(c===59&&i){const h=e.exit("characterReferenceValue");return s===tt&&!ea(r.sliceSerialize(h))?n(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(c)&&i++<o?(e.consume(c),f):n(c)}}const Nd={partial:!0,tokenize:AS},_d={concrete:!0,name:"codeFenced",tokenize:CS};function CS(e,t,n){const r=this,i={partial:!0,tokenize:k};let o=0,s=0,a;return l;function l(E){return u(E)}function u(E){const I=r.events[r.events.length-1];return o=I&&I[1].type==="linePrefix"?I[2].sliceSerialize(I[1],!0).length:0,a=E,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(E)}function f(E){return E===a?(s++,e.consume(E),f):s<3?n(E):(e.exit("codeFencedFenceSequence"),ve(E)?ke(e,c,"whitespace")(E):c(E))}function c(E){return E===null||ce(E)?(e.exit("codeFencedFence"),r.interrupt?t(E):e.check(Nd,p,A)(E)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(E))}function h(E){return E===null||ce(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(E)):ve(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ke(e,d,"whitespace")(E)):E===96&&E===a?n(E):(e.consume(E),h)}function d(E){return E===null||ce(E)?c(E):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(E))}function m(E){return E===null||ce(E)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(E)):E===96&&E===a?n(E):(e.consume(E),m)}function p(E){return e.attempt(i,A,g)(E)}function g(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),v}function v(E){return o>0&&ve(E)?ke(e,y,"linePrefix",o+1)(E):y(E)}function y(E){return E===null||ce(E)?e.check(Nd,p,A)(E):(e.enter("codeFlowValue"),w(E))}function w(E){return E===null||ce(E)?(e.exit("codeFlowValue"),y(E)):(e.consume(E),w)}function A(E){return e.exit("codeFenced"),t(E)}function k(E,I,D){let P=0;return T;function T(R){return E.enter("lineEnding"),E.consume(R),E.exit("lineEnding"),O}function O(R){return E.enter("codeFencedFence"),ve(R)?ke(E,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):B(R)}function B(R){return R===a?(E.enter("codeFencedFenceSequence"),L(R)):D(R)}function L(R){return R===a?(P++,E.consume(R),L):P>=s?(E.exit("codeFencedFenceSequence"),ve(R)?ke(E,F,"whitespace")(R):F(R)):D(R)}function F(R){return R===null||ce(R)?(E.exit("codeFencedFence"),I(R)):D(R)}}}function AS(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const ra={name:"codeIndented",tokenize:IS},TS={partial:!0,tokenize:OS};function IS(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),ke(e,o,"linePrefix",5)(u)}function o(u){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?s(u):n(u)}function s(u){return u===null?l(u):ce(u)?e.attempt(TS,s,l)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||ce(u)?(e.exit("codeFlowValue"),s(u)):(e.consume(u),a)}function l(u){return e.exit("codeIndented"),t(u)}}function OS(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):ce(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):ke(e,o,"linePrefix",5)(s)}function o(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):ce(s)?i(s):n(s)}}const MS={name:"codeText",previous:NS,resolve:DS,tokenize:_S};function DS(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 NS(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function _S(e,t,n){let r=0,i,o;return s;function s(c){return e.enter("codeText"),e.enter("codeTextSequence"),a(c)}function a(c){return c===96?(e.consume(c),r++,a):(e.exit("codeTextSequence"),l(c))}function l(c){return c===null?n(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),l):c===96?(o=e.enter("codeTextSequence"),i=0,f(c)):ce(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l):(e.enter("codeTextData"),u(c))}function u(c){return c===null||c===32||c===96||ce(c)?(e.exit("codeTextData"),l(c)):(e.consume(c),u)}function f(c){return c===96?(e.consume(c),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(c)):(o.type="codeTextData",u(c))}}class PS{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Br(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Br(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Br(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Br(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Br(this.left,n.reverse())}}}function Br(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Pd(e){const t={};let n=-1,r,i,o,s,a,l,u;const f=new PS(e);for(;++n<f.length;){for(;n in t;)n=t[n];if(r=f.get(n),n&&r[1].type==="chunkFlow"&&f.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,LS(f,n)),n=t[n],u=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(s=f.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},a=f.slice(i,n),a.unshift(r),f.splice(i,n-i+1,a))}}return mt(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!u}function LS(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const a=s.events,l=[],u={};let f,c,h=-1,d=n,m=0,p=0;const g=[p];for(;d;){for(;e.get(++i)[1]!==d;);o.push(i),d._tokenizer||(f=r.sliceStream(d),d.next||f.push(null),c&&s.defineSkip(d.start),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(f),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),c=d,d=d.next}for(d=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&&(p=h+1,g.push(p),d._tokenizer=void 0,d.previous=void 0,d=d.next);for(s.events=[],d?(d._tokenizer=void 0,d.previous=void 0):g.pop(),h=g.length;h--;){const v=a.slice(g[h],g[h+1]),y=o.pop();l.push([y,y+v.length-1]),e.splice(y,2,v)}for(l.reverse(),h=-1;++h<l.length;)u[m+l[h][0]]=m+l[h][1],m+=l[h][1]-l[h][0]-1;return u}const FS={resolve:$S,tokenize:BS},RS={partial:!0,tokenize:zS};function $S(e){return Pd(e),e}function BS(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?o(a):ce(a)?e.check(RS,s,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function zS(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),ke(e,o,"linePrefix")}function o(s){if(s===null||ce(s))return n(s);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(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function Ld(e,t,n,r,i,o,s,a,l){const u=l||Number.POSITIVE_INFINITY;let f=0;return c;function c(v){return v===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(v),e.exit(o),h):v===null||v===32||v===41||Ri(v)?n(v):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),p(v))}function h(v){return v===62?(e.enter(o),e.consume(v),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),d(v))}function d(v){return v===62?(e.exit("chunkString"),e.exit(a),h(v)):v===null||v===60||ce(v)?n(v):(e.consume(v),v===92?m:d)}function m(v){return v===60||v===62||v===92?(e.consume(v),d):d(v)}function p(v){return!f&&(v===null||v===41||De(v))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(v)):f<u&&v===40?(e.consume(v),f++,p):v===41?(e.consume(v),f--,p):v===null||v===32||v===40||Ri(v)?n(v):(e.consume(v),v===92?g:p)}function g(v){return v===40||v===41||v===92?(e.consume(v),p):p(v)}}function Fd(e,t,n,r,i,o){const s=this;let a=0,l;return u;function u(d){return e.enter(r),e.enter(i),e.consume(d),e.exit(i),e.enter(o),f}function f(d){return a>999||d===null||d===91||d===93&&!l||d===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(d):d===93?(e.exit(o),e.enter(i),e.consume(d),e.exit(i),e.exit(r),t):ce(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),c(d))}function c(d){return d===null||d===91||d===93||ce(d)||a++>999?(e.exit("chunkString"),f(d)):(e.consume(d),l||(l=!ve(d)),d===92?h:c)}function h(d){return d===91||d===92||d===93?(e.consume(d),a++,c):c(d)}}function Rd(e,t,n,r,i,o){let s;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),s=h===40?41:h,l):n(h)}function l(h){return h===s?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(o),u(h))}function u(h){return h===s?(e.exit(o),l(s)):h===null?n(h):ce(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),ke(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===s||h===null||ce(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?c:f)}function c(h){return h===s||h===92?(e.consume(h),f):f(h)}}function zr(e,t){let n;return r;function r(i){return ce(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ve(i)?ke(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const US={name:"definition",tokenize:jS},HS={partial:!0,tokenize:VS};function jS(e,t,n){const r=this;let i;return o;function o(d){return e.enter("definition"),s(d)}function s(d){return Fd.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function a(d){return i=Mt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),d===58?(e.enter("definitionMarker"),e.consume(d),e.exit("definitionMarker"),l):n(d)}function l(d){return De(d)?zr(e,u)(d):u(d)}function u(d){return Ld(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function f(d){return e.attempt(HS,c,c)(d)}function c(d){return ve(d)?ke(e,h,"whitespace")(d):h(d)}function h(d){return d===null||ce(d)?(e.exit("definition"),r.parser.defined.push(i),t(d)):n(d)}}function VS(e,t,n){return r;function r(a){return De(a)?zr(e,i)(a):n(a)}function i(a){return Rd(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return ve(a)?ke(e,s,"whitespace")(a):s(a)}function s(a){return a===null||ce(a)?t(a):n(a)}}const WS={name:"hardBreakEscape",tokenize:qS};function qS(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return ce(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const YS={name:"headingAtx",resolve:KS,tokenize:GS};function KS(e,t){let n=e.length-2,r=3,i,o;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},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},mt(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function GS(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),s(f)}function s(f){return f===35&&r++<6?(e.consume(f),s):f===null||De(f)?(e.exit("atxHeadingSequence"),a(f)):n(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),l(f)):f===null||ce(f)?(e.exit("atxHeading"),t(f)):ve(f)?ke(e,a,"whitespace")(f):(e.enter("atxHeadingText"),u(f))}function l(f){return f===35?(e.consume(f),l):(e.exit("atxHeadingSequence"),a(f))}function u(f){return f===null||f===35||De(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),u)}}const QS=["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"],$d=["pre","script","style","textarea"],ZS={concrete:!0,name:"htmlFlow",resolveTo:ex,tokenize:tx},JS={partial:!0,tokenize:rx},XS={partial:!0,tokenize:nx};function ex(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 tx(e,t,n){const r=this;let i,o,s,a,l;return u;function u(S){return f(S)}function f(S){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(S),c}function c(S){return S===33?(e.consume(S),h):S===47?(e.consume(S),o=!0,p):S===63?(e.consume(S),i=3,r.interrupt?t:b):ot(S)?(e.consume(S),s=String.fromCharCode(S),g):n(S)}function h(S){return S===45?(e.consume(S),i=2,d):S===91?(e.consume(S),i=5,a=0,m):ot(S)?(e.consume(S),i=4,r.interrupt?t:b):n(S)}function d(S){return S===45?(e.consume(S),r.interrupt?t:b):n(S)}function m(S){const V="CDATA[";return S===V.charCodeAt(a++)?(e.consume(S),a===V.length?r.interrupt?t:B:m):n(S)}function p(S){return ot(S)?(e.consume(S),s=String.fromCharCode(S),g):n(S)}function g(S){if(S===null||S===47||S===62||De(S)){const V=S===47,Y=s.toLowerCase();return!V&&!o&&$d.includes(Y)?(i=1,r.interrupt?t(S):B(S)):QS.includes(s.toLowerCase())?(i=6,V?(e.consume(S),v):r.interrupt?t(S):B(S)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(S):o?y(S):w(S))}return S===45||tt(S)?(e.consume(S),s+=String.fromCharCode(S),g):n(S)}function v(S){return S===62?(e.consume(S),r.interrupt?t:B):n(S)}function y(S){return ve(S)?(e.consume(S),y):T(S)}function w(S){return S===47?(e.consume(S),T):S===58||S===95||ot(S)?(e.consume(S),A):ve(S)?(e.consume(S),w):T(S)}function A(S){return S===45||S===46||S===58||S===95||tt(S)?(e.consume(S),A):k(S)}function k(S){return S===61?(e.consume(S),E):ve(S)?(e.consume(S),k):w(S)}function E(S){return S===null||S===60||S===61||S===62||S===96?n(S):S===34||S===39?(e.consume(S),l=S,I):ve(S)?(e.consume(S),E):D(S)}function I(S){return S===l?(e.consume(S),l=null,P):S===null||ce(S)?n(S):(e.consume(S),I)}function D(S){return S===null||S===34||S===39||S===47||S===60||S===61||S===62||S===96||De(S)?k(S):(e.consume(S),D)}function P(S){return S===47||S===62||ve(S)?w(S):n(S)}function T(S){return S===62?(e.consume(S),O):n(S)}function O(S){return S===null||ce(S)?B(S):ve(S)?(e.consume(S),O):n(S)}function B(S){return S===45&&i===2?(e.consume(S),N):S===60&&i===1?(e.consume(S),H):S===62&&i===4?(e.consume(S),_):S===63&&i===3?(e.consume(S),b):S===93&&i===5?(e.consume(S),W):ce(S)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(JS,j,L)(S)):S===null||ce(S)?(e.exit("htmlFlowData"),L(S)):(e.consume(S),B)}function L(S){return e.check(XS,F,j)(S)}function F(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),R}function R(S){return S===null||ce(S)?L(S):(e.enter("htmlFlowData"),B(S))}function N(S){return S===45?(e.consume(S),b):B(S)}function H(S){return S===47?(e.consume(S),s="",z):B(S)}function z(S){if(S===62){const V=s.toLowerCase();return $d.includes(V)?(e.consume(S),_):B(S)}return ot(S)&&s.length<8?(e.consume(S),s+=String.fromCharCode(S),z):B(S)}function W(S){return S===93?(e.consume(S),b):B(S)}function b(S){return S===62?(e.consume(S),_):S===45&&i===2?(e.consume(S),b):B(S)}function _(S){return S===null||ce(S)?(e.exit("htmlFlowData"),j(S)):(e.consume(S),_)}function j(S){return e.exit("htmlFlow"),t(S)}}function nx(e,t,n){const r=this;return i;function i(s){return ce(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function rx(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt($r,t,n)}}const ix={name:"htmlText",tokenize:ox};function ox(e,t,n){const r=this;let i,o,s;return a;function a(b){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(b),l}function l(b){return b===33?(e.consume(b),u):b===47?(e.consume(b),k):b===63?(e.consume(b),w):ot(b)?(e.consume(b),D):n(b)}function u(b){return b===45?(e.consume(b),f):b===91?(e.consume(b),o=0,m):ot(b)?(e.consume(b),y):n(b)}function f(b){return b===45?(e.consume(b),d):n(b)}function c(b){return b===null?n(b):b===45?(e.consume(b),h):ce(b)?(s=c,H(b)):(e.consume(b),c)}function h(b){return b===45?(e.consume(b),d):c(b)}function d(b){return b===62?N(b):b===45?h(b):c(b)}function m(b){const _="CDATA[";return b===_.charCodeAt(o++)?(e.consume(b),o===_.length?p:m):n(b)}function p(b){return b===null?n(b):b===93?(e.consume(b),g):ce(b)?(s=p,H(b)):(e.consume(b),p)}function g(b){return b===93?(e.consume(b),v):p(b)}function v(b){return b===62?N(b):b===93?(e.consume(b),v):p(b)}function y(b){return b===null||b===62?N(b):ce(b)?(s=y,H(b)):(e.consume(b),y)}function w(b){return b===null?n(b):b===63?(e.consume(b),A):ce(b)?(s=w,H(b)):(e.consume(b),w)}function A(b){return b===62?N(b):w(b)}function k(b){return ot(b)?(e.consume(b),E):n(b)}function E(b){return b===45||tt(b)?(e.consume(b),E):I(b)}function I(b){return ce(b)?(s=I,H(b)):ve(b)?(e.consume(b),I):N(b)}function D(b){return b===45||tt(b)?(e.consume(b),D):b===47||b===62||De(b)?P(b):n(b)}function P(b){return b===47?(e.consume(b),N):b===58||b===95||ot(b)?(e.consume(b),T):ce(b)?(s=P,H(b)):ve(b)?(e.consume(b),P):N(b)}function T(b){return b===45||b===46||b===58||b===95||tt(b)?(e.consume(b),T):O(b)}function O(b){return b===61?(e.consume(b),B):ce(b)?(s=O,H(b)):ve(b)?(e.consume(b),O):P(b)}function B(b){return b===null||b===60||b===61||b===62||b===96?n(b):b===34||b===39?(e.consume(b),i=b,L):ce(b)?(s=B,H(b)):ve(b)?(e.consume(b),B):(e.consume(b),F)}function L(b){return b===i?(e.consume(b),i=void 0,R):b===null?n(b):ce(b)?(s=L,H(b)):(e.consume(b),L)}function F(b){return b===null||b===34||b===39||b===60||b===61||b===96?n(b):b===47||b===62||De(b)?P(b):(e.consume(b),F)}function R(b){return b===47||b===62||De(b)?P(b):n(b)}function N(b){return b===62?(e.consume(b),e.exit("htmlTextData"),e.exit("htmlText"),t):n(b)}function H(b){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),z}function z(b){return ve(b)?ke(e,W,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):W(b)}function W(b){return e.enter("htmlTextData"),s(b)}}const ia={name:"labelEnd",resolveAll:ux,resolveTo:cx,tokenize:fx},sx={tokenize:dx},ax={tokenize:hx},lx={tokenize:px};function ux(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&mt(e,0,e.length,n),e}function cx(e,t){let n=e.length,r=0,i,o,s,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const l={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[o][1].start},end:{...e[s][1].end}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",l,t],["enter",u,t]],a=St(a,e.slice(o+1,o+r+3)),a=St(a,[["enter",f,t]]),a=St(a,Bi(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),a=St(a,[["exit",f,t],e[s-2],e[s-1],["exit",u,t]]),a=St(a,e.slice(s+1)),a=St(a,[["exit",l,t]]),mt(e,o,e.length,a),e}function fx(e,t,n){const r=this;let i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(h){return o?o._inactive?c(h):(s=r.parser.defined.includes(Mt(r.sliceSerialize({start:o.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(sx,f,s?f:c)(h):h===91?e.attempt(ax,f,s?u:c)(h):s?f(h):c(h)}function u(h){return e.attempt(lx,f,c)(h)}function f(h){return t(h)}function c(h){return o._balanced=!0,n(h)}}function dx(e,t,n){return r;function r(c){return e.enter("resource"),e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),i}function i(c){return De(c)?zr(e,o)(c):o(c)}function o(c){return c===41?f(c):Ld(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function s(c){return De(c)?zr(e,l)(c):f(c)}function a(c){return n(c)}function l(c){return c===34||c===39||c===40?Rd(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):f(c)}function u(c){return De(c)?zr(e,f)(c):f(c)}function f(c){return c===41?(e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),e.exit("resource"),t):n(c)}}function hx(e,t,n){const r=this;return i;function i(a){return Fd.call(r,e,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(Mt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function px(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const mx={name:"labelStartImage",resolveAll:ia.resolveAll,tokenize:gx};function gx(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const yx={name:"labelStartLink",resolveAll:ia.resolveAll,tokenize:vx};function vx(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const oa={name:"lineEnding",tokenize:bx};function bx(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ke(e,t,"linePrefix")}}const zi={name:"thematicBreak",tokenize:wx};function wx(e,t,n){let r=0,i;return o;function o(u){return e.enter("thematicBreak"),s(u)}function s(u){return i=u,a(u)}function a(u){return u===i?(e.enter("thematicBreakSequence"),l(u)):r>=3&&(u===null||ce(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===i?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),ve(u)?ke(e,a,"whitespace")(u):a(u))}}const ct={continuation:{tokenize:Ex},exit:Ax,name:"list",tokenize:kx},Sx={partial:!0,tokenize:Tx},xx={partial:!0,tokenize:Cx};function kx(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(d){const m=r.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||d===r.containerState.marker:ta(d)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),d===42||d===45?e.check(zi,n,u)(d):u(d);if(!r.interrupt||d===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(d)}return n(d)}function l(d){return ta(d)&&++s<10?(e.consume(d),l):(!r.interrupt||s<2)&&(r.containerState.marker?d===r.containerState.marker:d===41||d===46)?(e.exit("listItemValue"),u(d)):n(d)}function u(d){return e.enter("listItemMarker"),e.consume(d),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||d,e.check($r,r.interrupt?n:f,e.attempt(Sx,h,c))}function f(d){return r.containerState.initialBlankLine=!0,o++,h(d)}function c(d){return ve(d)?(e.enter("listItemPrefixWhitespace"),e.consume(d),e.exit("listItemPrefixWhitespace"),h):n(d)}function h(d){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(d)}}function Ex(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check($r,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ke(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!ve(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(xx,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,ke(e,e.attempt(ct,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Cx(e,t,n){const r=this;return ke(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function Ax(e){e.exit(this.containerState.type)}function Tx(e,t,n){const r=this;return ke(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!ve(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Bd={name:"setextUnderline",resolveTo:Ix,tokenize:Ox};function Ix(e,t){let n=e.length,r,i,o;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),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function Ox(e,t,n){const r=this;let i;return o;function o(u){let f=r.events.length,c;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){c=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=u,s(u)):n(u)}function s(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),ve(u)?ke(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||ce(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const Mx={tokenize:Dx};function Dx(e){const t=this,n=e.attempt($r,r,e.attempt(this.parser.constructs.flowInitial,i,ke(e,e.attempt(this.parser.constructs.flow,i,e.attempt(FS,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Nx={resolveAll:Ud()},_x=zd("string"),Px=zd("text");function zd(e){return{resolveAll:Ud(e==="text"?Lx:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,a);return s;function s(f){return u(f)?o(f):a(f)}function a(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),l}function l(f){return u(f)?(n.exit("data"),o(f)):(n.consume(f),l)}function u(f){if(f===null)return!0;const c=i[f];let h=-1;if(c)for(;++h<c.length;){const d=c[h];if(!d.previous||d.previous.call(r,r.previous))return!0}return!1}}}function Ud(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function Lx(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 o=i.length,s=-1,a=0,l;for(;o--;){const u=i[o];if(typeof u=="string"){for(s=u.length;u.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(u===-2)l=!0,a++;else if(u!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const u={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:r.start._bufferIndex+s,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const Fx=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:US},disable:{null:[]},document:{42:ct,43:ct,45:ct,48:ct,49:ct,50:ct,51:ct,52:ct,53:ct,54:ct,55:ct,56:ct,57:ct,62:Od},flow:{35:YS,42:zi,45:[Bd,zi],60:ZS,61:Bd,95:zi,96:_d,126:_d},flowInitial:{[-2]:ra,[-1]:ra,32:ra},insideSpan:{null:[na,Nx]},string:{38:Dd,92:Md},text:{[-5]:oa,[-4]:oa,[-3]:oa,33:mx,38:Dd,42:na,60:[yS,ix],91:yx,92:[WS,Md],93:ia,95:na,96:MS}},Symbol.toStringTag,{value:"Module"}));function Rx(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let s=[],a=[];const l={attempt:I(k),check:I(E),consume:y,enter:w,exit:A,interrupt:I(E,{interrupt:!0})},u={code:null,containerState:{},defineSkip:p,events:[],now:m,parser:e,previous:null,sliceSerialize:h,sliceStream:d,write:c};let f=t.tokenize.call(u,l);return t.resolveAll&&o.push(t),u;function c(O){return s=St(s,O),g(),s[s.length-1]!==null?[]:(D(t,0),u.events=Bi(o,u.events,u),u.events)}function h(O,B){return Bx(d(O),B)}function d(O){return $x(s,O)}function m(){const{_bufferIndex:O,_index:B,line:L,column:F,offset:R}=r;return{_bufferIndex:O,_index:B,line:L,column:F,offset:R}}function p(O){i[O.line]=O.column,T()}function g(){let O;for(;r._index<s.length;){const B=s[r._index];if(typeof B=="string")for(O=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===O&&r._bufferIndex<B.length;)v(B.charCodeAt(r._bufferIndex));else v(B)}}function v(O){f=f(O)}function y(O){ce(O)?(r.line++,r.column=1,r.offset+=O===-3?2:1,T()):O!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=O}function w(O,B){const L=B||{};return L.type=O,L.start=m(),u.events.push(["enter",L,u]),a.push(L),L}function A(O){const B=a.pop();return B.end=m(),u.events.push(["exit",B,u]),B}function k(O,B){D(O,B.from)}function E(O,B){B.restore()}function I(O,B){return L;function L(F,R,N){let H,z,W,b;return Array.isArray(F)?j(F):"tokenize"in F?j([F]):_(F);function _(q){return Q;function Q(X){const se=X!==null&&q[X],G=X!==null&&q.null,te=[...Array.isArray(se)?se:se?[se]:[],...Array.isArray(G)?G:G?[G]:[]];return j(te)(X)}}function j(q){return H=q,z=0,q.length===0?N:S(q[z])}function S(q){return Q;function Q(X){return b=P(),W=q,q.partial||(u.currentConstruct=q),q.name&&u.parser.constructs.disable.null.includes(q.name)?Y():q.tokenize.call(B?Object.assign(Object.create(u),B):u,l,V,Y)(X)}}function V(q){return O(W,b),R}function Y(q){return b.restore(),++z<H.length?S(H[z]):N}}}function D(O,B){O.resolveAll&&!o.includes(O)&&o.push(O),O.resolve&&mt(u.events,B,u.events.length-B,O.resolve(u.events.slice(B),u)),O.resolveTo&&(u.events=O.resolveTo(u.events,u))}function P(){const O=m(),B=u.previous,L=u.currentConstruct,F=u.events.length,R=Array.from(a);return{from:F,restore:N};function N(){r=O,u.previous=B,u.currentConstruct=L,u.events.length=F,a=R,T()}}function T(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function $x(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function Bx(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
28
28
  `;break}case-3:{s=`\r
29
- `;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}function Qx(e){const r={constructs:Od([qx,...(e||{}).extensions||[]]),content:i(wS),defined:[],document:i(xS),flow:i(zx),lazy:{},string:i(Hx),text:i(Vx)};return r;function i(o){return s;function s(a){return Yx(r,o,a)}}}function Zx(e){for(;!$d(e););return e}const qd=/[\0\t\n\r]/g;function Jx(){let e=1,t="",n=!0,r;return i;function i(o,s,a){const l=[];let u,f,c,h,d;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),c=0,t="",n&&(o.charCodeAt(0)===65279&&c++,n=void 0);c<o.length;){if(qd.lastIndex=c,u=qd.exec(o),h=u&&u.index!==void 0?u.index:o.length,d=o.charCodeAt(h),!u){t=o.slice(c);break}if(d===10&&c===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),c<h&&(l.push(o.slice(c,h)),e+=h-c),d){case 0:{l.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,l.push(-2);e++<f;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}c=h+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const Xx=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ek(e){return e.replace(Xx,tk)}function tk(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return Md(n.slice(o?2:1),o?16:10)}return na(n)||e}const Yd={}.hasOwnProperty;function nk(e,t,n){return typeof t!="string"&&(n=t,t=void 0),rk(n)(Zx(Qx(n).document().write(Jx()(e,t,!0))))}function rk(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(fe),autolinkProtocol:P,autolinkEmail:P,atxHeading:o(Oe),blockQuote:o(G),characterEscape:P,characterReference:P,codeFenced:o(te),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(te,s),codeText:o($,s),codeTextData:P,data:P,codeFlowValue:P,definition:o(ne),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(ge),hardBreakEscape:o(J),hardBreakTrailing:o(J),htmlFlow:o(ue,s),htmlFlowData:P,htmlText:o(ue,s),htmlTextData:P,image:o(de),label:s,link:o(fe),listItem:o(Fe),listItemValue:h,listOrdered:o(Ae,c),listUnordered:o(Ae),paragraph:o(Me),reference:x,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(Oe),strong:o(je),thematicBreak:o(ae)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:se,autolinkProtocol:X,blockQuote:l(),characterEscapeValue:T,characterReferenceMarkerHexadecimal:Y,characterReferenceMarkerNumeric:Y,characterReferenceValue:q,characterReference:Q,codeFenced:l(g),codeFencedFence:p,codeFencedFenceInfo:d,codeFencedFenceMeta:m,codeFlowValue:T,codeIndented:l(y),codeText:l(R),codeTextData:T,data:T,definition:l(),definitionDestinationString:E,definitionLabelString:v,definitionTitleString:w,emphasis:l(),hardBreakEscape:l(U),hardBreakTrailing:l(U),htmlFlow:l(F),htmlFlowData:T,htmlText:l(L),htmlTextData:T,image:l(j),label:W,labelText:B,lineEnding:O,link:l(N),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:V,resourceDestinationString:b,resourceTitleString:_,resource:H,setextHeading:l(M),setextHeadingLineSequence:I,setextHeadingText:C,strong:l(),thematicBreak:l()}};Kd(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(z){let K={type:"root",children:[]};const oe={stack:[K],tokenStack:[],config:t,enter:a,exit:u,buffer:s,resume:f,data:n},le=[];let he=-1;for(;++he<z.length;)if(z[he][1].type==="listOrdered"||z[he][1].type==="listUnordered")if(z[he][0]==="enter")le.push(he);else{const He=le.pop();he=i(z,He,he)}for(he=-1;++he<z.length;){const He=t[z[he][0]];Yd.call(He,z[he][1].type)&&He[z[he][1].type].call(Object.assign({sliceSerialize:z[he][2].sliceSerialize},oe),z[he][1])}if(oe.tokenStack.length>0){const He=oe.tokenStack[oe.tokenStack.length-1];(He[1]||Gd).call(oe,void 0,He[0])}for(K.position={start:an(z.length>0?z[0][1].start:{line:1,column:1,offset:0}),end:an(z.length>0?z[z.length-2][1].end:{line:1,column:1,offset:0})},he=-1;++he<t.transforms.length;)K=t.transforms[he](K)||K;return K}function i(z,K,oe){let le=K-1,he=-1,He=!1,Ge,Ze,Et,Rt;for(;++le<=oe;){const Qe=z[le];switch(Qe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Qe[0]==="enter"?he++:he--,Rt=void 0;break}case"lineEndingBlank":{Qe[0]==="enter"&&(Ge&&!Rt&&!he&&!Et&&(Et=le),Rt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Rt=void 0}if(!he&&Qe[0]==="enter"&&Qe[1].type==="listItemPrefix"||he===-1&&Qe[0]==="exit"&&(Qe[1].type==="listUnordered"||Qe[1].type==="listOrdered")){if(Ge){let Ct=le;for(Ze=void 0;Ct--;){const at=z[Ct];if(at[1].type==="lineEnding"||at[1].type==="lineEndingBlank"){if(at[0]==="exit")continue;Ze&&(z[Ze][1].type="lineEndingBlank",He=!0),at[1].type="lineEnding",Ze=Ct}else if(!(at[1].type==="linePrefix"||at[1].type==="blockQuotePrefix"||at[1].type==="blockQuotePrefixWhitespace"||at[1].type==="blockQuoteMarker"||at[1].type==="listItemIndent"))break}Et&&(!Ze||Et<Ze)&&(Ge._spread=!0),Ge.end=Object.assign({},Ze?z[Ze][1].start:Qe[1].end),z.splice(Ze||le,0,["exit",Ge,Qe[2]]),le++,oe++}if(Qe[1].type==="listItemPrefix"){const Ct={type:"listItem",_spread:!1,start:Object.assign({},Qe[1].start),end:void 0};Ge=Ct,z.splice(le,0,["enter",Ct,Qe[2]]),le++,oe++,Et=void 0,Rt=!0}}}return z[K][1]._spread=He,oe}function o(z,K){return oe;function oe(le){a.call(this,z(le),le),K&&K.call(this,le)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(z,K,oe){this.stack[this.stack.length-1].children.push(z),this.stack.push(z),this.tokenStack.push([K,oe||void 0]),z.position={start:an(K.start),end:void 0}}function l(z){return K;function K(oe){z&&z.call(this,oe),u.call(this,oe)}}function u(z,K){const oe=this.stack.pop(),le=this.tokenStack.pop();if(le)le[0].type!==z.type&&(K?K.call(this,z,le[0]):(le[1]||Gd).call(this,z,le[0]));else throw new Error("Cannot close `"+z.type+"` ("+Lr({start:z.start,end:z.end})+"): it’s not open");oe.position.end=an(z.end)}function f(){return ta(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function h(z){if(this.data.expectingFirstListItemValue){const K=this.stack[this.stack.length-2];K.start=Number.parseInt(this.sliceSerialize(z),10),this.data.expectingFirstListItemValue=void 0}}function d(){const z=this.resume(),K=this.stack[this.stack.length-1];K.lang=z}function m(){const z=this.resume(),K=this.stack[this.stack.length-1];K.meta=z}function p(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){const z=this.resume(),K=this.stack[this.stack.length-1];K.value=z.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const z=this.resume(),K=this.stack[this.stack.length-1];K.value=z.replace(/(\r?\n|\r)$/g,"")}function v(z){const K=this.resume(),oe=this.stack[this.stack.length-1];oe.label=K,oe.identifier=Mt(this.sliceSerialize(z)).toLowerCase()}function w(){const z=this.resume(),K=this.stack[this.stack.length-1];K.title=z}function E(){const z=this.resume(),K=this.stack[this.stack.length-1];K.url=z}function S(z){const K=this.stack[this.stack.length-1];if(!K.depth){const oe=this.sliceSerialize(z).length;K.depth=oe}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function I(z){const K=this.stack[this.stack.length-1];K.depth=this.sliceSerialize(z).codePointAt(0)===61?1:2}function M(){this.data.setextHeadingSlurpLineEnding=void 0}function P(z){const oe=this.stack[this.stack.length-1].children;let le=oe[oe.length-1];(!le||le.type!=="text")&&(le=ee(),le.position={start:an(z.start),end:void 0},oe.push(le)),this.stack.push(le)}function T(z){const K=this.stack.pop();K.value+=this.sliceSerialize(z),K.position.end=an(z.end)}function O(z){const K=this.stack[this.stack.length-1];if(this.data.atHardBreak){const oe=K.children[K.children.length-1];oe.position.end=an(z.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(K.type)&&(P.call(this,z),T.call(this,z))}function U(){this.data.atHardBreak=!0}function F(){const z=this.resume(),K=this.stack[this.stack.length-1];K.value=z}function L(){const z=this.resume(),K=this.stack[this.stack.length-1];K.value=z}function R(){const z=this.resume(),K=this.stack[this.stack.length-1];K.value=z}function N(){const z=this.stack[this.stack.length-1];if(this.data.inReference){const K=this.data.referenceType||"shortcut";z.type+="Reference",z.referenceType=K,delete z.url,delete z.title}else delete z.identifier,delete z.label;this.data.referenceType=void 0}function j(){const z=this.stack[this.stack.length-1];if(this.data.inReference){const K=this.data.referenceType||"shortcut";z.type+="Reference",z.referenceType=K,delete z.url,delete z.title}else delete z.identifier,delete z.label;this.data.referenceType=void 0}function B(z){const K=this.sliceSerialize(z),oe=this.stack[this.stack.length-2];oe.label=ek(K),oe.identifier=Mt(K).toLowerCase()}function W(){const z=this.stack[this.stack.length-1],K=this.resume(),oe=this.stack[this.stack.length-1];if(this.data.inReference=!0,oe.type==="link"){const le=z.children;oe.children=le}else oe.alt=K}function b(){const z=this.resume(),K=this.stack[this.stack.length-1];K.url=z}function _(){const z=this.resume(),K=this.stack[this.stack.length-1];K.title=z}function H(){this.data.inReference=void 0}function x(){this.data.referenceType="collapsed"}function V(z){const K=this.resume(),oe=this.stack[this.stack.length-1];oe.label=K,oe.identifier=Mt(this.sliceSerialize(z)).toLowerCase(),this.data.referenceType="full"}function Y(z){this.data.characterReferenceType=z.type}function q(z){const K=this.sliceSerialize(z),oe=this.data.characterReferenceType;let le;oe?(le=Md(K,oe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):le=na(K);const he=this.stack[this.stack.length-1];he.value+=le}function Q(z){const K=this.stack.pop();K.position.end=an(z.end)}function X(z){T.call(this,z);const K=this.stack[this.stack.length-1];K.url=this.sliceSerialize(z)}function se(z){T.call(this,z);const K=this.stack[this.stack.length-1];K.url="mailto:"+this.sliceSerialize(z)}function G(){return{type:"blockquote",children:[]}}function te(){return{type:"code",lang:null,meta:null,value:""}}function $(){return{type:"inlineCode",value:""}}function ne(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ge(){return{type:"emphasis",children:[]}}function Oe(){return{type:"heading",depth:0,children:[]}}function J(){return{type:"break"}}function ue(){return{type:"html",value:""}}function de(){return{type:"image",title:null,url:"",alt:null}}function fe(){return{type:"link",title:null,url:"",children:[]}}function Ae(z){return{type:"list",ordered:z.type==="listOrdered",start:null,spread:z._spread,children:[]}}function Fe(z){return{type:"listItem",spread:z._spread,checked:null,children:[]}}function Me(){return{type:"paragraph",children:[]}}function je(){return{type:"strong",children:[]}}function ee(){return{type:"text",value:""}}function ae(){return{type:"thematicBreak"}}}function an(e){return{line:e.line,column:e.column,offset:e.offset}}function Kd(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Kd(e,r):ik(e,r)}}function ik(e,t){let n;for(n in t)if(Yd.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 Gd(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Lr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Lr({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Lr({start:t.start,end:t.end})+") is still open")}function ok(e){const t=this;t.parser=n;function n(r){return nk(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function sk(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 ak(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
30
- `}]}function lk(e,t){const n=t.value?t.value+`
31
- `:"",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 uk(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ck(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function fk(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Wn(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let s,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=o+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(s)}]};e.patch(t,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)}function dk(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 hk(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Qd(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),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function pk(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Qd(e,t);const i={src:Wn(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function mk(e,t){const n={src:Wn(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 gk(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 yk(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Qd(e,t);const i={href:Wn(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function vk(e,t){const n={href:Wn(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 bk(e,t,n){const r=e.all(t),i=n?wk(n):Zd(t),o={},s=[];if(typeof t.checked=="boolean"){const f=r[0];let c;f&&f.type==="element"&&f.tagName==="p"?c=f:(c={type:"element",tagName:"p",properties:{},children:[]},r.unshift(c)),c.children.length>0&&c.children.unshift({type:"text",value:" "}),c.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const f=r[a];(i||a!==0||f.type!=="element"||f.tagName!=="p")&&s.push({type:"text",value:`
29
+ `;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}function zx(e){const r={constructs:Cd([Fx,...(e||{}).extensions||[]]),content:i(cS),defined:[],document:i(dS),flow:i(Mx),lazy:{},string:i(_x),text:i(Px)};return r;function i(o){return s;function s(a){return Rx(r,o,a)}}}function Ux(e){for(;!Pd(e););return e}const Hd=/[\0\t\n\r]/g;function Hx(){let e=1,t="",n=!0,r;return i;function i(o,s,a){const l=[];let u,f,c,h,d;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),c=0,t="",n&&(o.charCodeAt(0)===65279&&c++,n=void 0);c<o.length;){if(Hd.lastIndex=c,u=Hd.exec(o),h=u&&u.index!==void 0?u.index:o.length,d=o.charCodeAt(h),!u){t=o.slice(c);break}if(d===10&&c===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),c<h&&(l.push(o.slice(c,h)),e+=h-c),d){case 0:{l.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,l.push(-2);e++<f;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}c=h+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const jx=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Vx(e){return e.replace(jx,Wx)}function Wx(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return Ad(n.slice(o?2:1),o?16:10)}return ea(n)||e}const jd={}.hasOwnProperty;function qx(e,t,n){return typeof t!="string"&&(n=t,t=void 0),Yx(n)(Ux(zx(n).document().write(Hx()(e,t,!0))))}function Yx(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(fe),autolinkProtocol:P,autolinkEmail:P,atxHeading:o(Oe),blockQuote:o(G),characterEscape:P,characterReference:P,codeFenced:o(te),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(te,s),codeText:o($,s),codeTextData:P,data:P,codeFlowValue:P,definition:o(ne),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(me),hardBreakEscape:o(J),hardBreakTrailing:o(J),htmlFlow:o(ue,s),htmlFlowData:P,htmlText:o(ue,s),htmlTextData:P,image:o(de),label:s,link:o(fe),listItem:o(Fe),listItemValue:h,listOrdered:o(Ae,c),listUnordered:o(Ae),paragraph:o(Me),reference:S,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(Oe),strong:o(He),thematicBreak:o(ae)},exit:{atxHeading:l(),atxHeadingSequence:k,autolink:l(),autolinkEmail:se,autolinkProtocol:X,blockQuote:l(),characterEscapeValue:T,characterReferenceMarkerHexadecimal:Y,characterReferenceMarkerNumeric:Y,characterReferenceValue:q,characterReference:Q,codeFenced:l(g),codeFencedFence:p,codeFencedFenceInfo:d,codeFencedFenceMeta:m,codeFlowValue:T,codeIndented:l(v),codeText:l(R),codeTextData:T,data:T,definition:l(),definitionDestinationString:A,definitionLabelString:y,definitionTitleString:w,emphasis:l(),hardBreakEscape:l(B),hardBreakTrailing:l(B),htmlFlow:l(L),htmlFlowData:T,htmlText:l(F),htmlTextData:T,image:l(H),label:W,labelText:z,lineEnding:O,link:l(N),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:V,resourceDestinationString:b,resourceTitleString:_,resource:j,setextHeading:l(D),setextHeadingLineSequence:I,setextHeadingText:E,strong:l(),thematicBreak:l()}};Vd(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(U){let K={type:"root",children:[]};const oe={stack:[K],tokenStack:[],config:t,enter:a,exit:u,buffer:s,resume:f,data:n},le=[];let he=-1;for(;++he<U.length;)if(U[he][1].type==="listOrdered"||U[he][1].type==="listUnordered")if(U[he][0]==="enter")le.push(he);else{const je=le.pop();he=i(U,je,he)}for(he=-1;++he<U.length;){const je=t[U[he][0]];jd.call(je,U[he][1].type)&&je[U[he][1].type].call(Object.assign({sliceSerialize:U[he][2].sliceSerialize},oe),U[he][1])}if(oe.tokenStack.length>0){const je=oe.tokenStack[oe.tokenStack.length-1];(je[1]||Wd).call(oe,void 0,je[0])}for(K.position={start:an(U.length>0?U[0][1].start:{line:1,column:1,offset:0}),end:an(U.length>0?U[U.length-2][1].end:{line:1,column:1,offset:0})},he=-1;++he<t.transforms.length;)K=t.transforms[he](K)||K;return K}function i(U,K,oe){let le=K-1,he=-1,je=!1,Ge,Ze,Et,Rt;for(;++le<=oe;){const Qe=U[le];switch(Qe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Qe[0]==="enter"?he++:he--,Rt=void 0;break}case"lineEndingBlank":{Qe[0]==="enter"&&(Ge&&!Rt&&!he&&!Et&&(Et=le),Rt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Rt=void 0}if(!he&&Qe[0]==="enter"&&Qe[1].type==="listItemPrefix"||he===-1&&Qe[0]==="exit"&&(Qe[1].type==="listUnordered"||Qe[1].type==="listOrdered")){if(Ge){let Ct=le;for(Ze=void 0;Ct--;){const at=U[Ct];if(at[1].type==="lineEnding"||at[1].type==="lineEndingBlank"){if(at[0]==="exit")continue;Ze&&(U[Ze][1].type="lineEndingBlank",je=!0),at[1].type="lineEnding",Ze=Ct}else if(!(at[1].type==="linePrefix"||at[1].type==="blockQuotePrefix"||at[1].type==="blockQuotePrefixWhitespace"||at[1].type==="blockQuoteMarker"||at[1].type==="listItemIndent"))break}Et&&(!Ze||Et<Ze)&&(Ge._spread=!0),Ge.end=Object.assign({},Ze?U[Ze][1].start:Qe[1].end),U.splice(Ze||le,0,["exit",Ge,Qe[2]]),le++,oe++}if(Qe[1].type==="listItemPrefix"){const Ct={type:"listItem",_spread:!1,start:Object.assign({},Qe[1].start),end:void 0};Ge=Ct,U.splice(le,0,["enter",Ct,Qe[2]]),le++,oe++,Et=void 0,Rt=!0}}}return U[K][1]._spread=je,oe}function o(U,K){return oe;function oe(le){a.call(this,U(le),le),K&&K.call(this,le)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(U,K,oe){this.stack[this.stack.length-1].children.push(U),this.stack.push(U),this.tokenStack.push([K,oe||void 0]),U.position={start:an(K.start),end:void 0}}function l(U){return K;function K(oe){U&&U.call(this,oe),u.call(this,oe)}}function u(U,K){const oe=this.stack.pop(),le=this.tokenStack.pop();if(le)le[0].type!==U.type&&(K?K.call(this,U,le[0]):(le[1]||Wd).call(this,U,le[0]));else throw new Error("Cannot close `"+U.type+"` ("+Fr({start:U.start,end:U.end})+"): it’s not open");oe.position.end=an(U.end)}function f(){return Xs(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function h(U){if(this.data.expectingFirstListItemValue){const K=this.stack[this.stack.length-2];K.start=Number.parseInt(this.sliceSerialize(U),10),this.data.expectingFirstListItemValue=void 0}}function d(){const U=this.resume(),K=this.stack[this.stack.length-1];K.lang=U}function m(){const U=this.resume(),K=this.stack[this.stack.length-1];K.meta=U}function p(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){const U=this.resume(),K=this.stack[this.stack.length-1];K.value=U.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const U=this.resume(),K=this.stack[this.stack.length-1];K.value=U.replace(/(\r?\n|\r)$/g,"")}function y(U){const K=this.resume(),oe=this.stack[this.stack.length-1];oe.label=K,oe.identifier=Mt(this.sliceSerialize(U)).toLowerCase()}function w(){const U=this.resume(),K=this.stack[this.stack.length-1];K.title=U}function A(){const U=this.resume(),K=this.stack[this.stack.length-1];K.url=U}function k(U){const K=this.stack[this.stack.length-1];if(!K.depth){const oe=this.sliceSerialize(U).length;K.depth=oe}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function I(U){const K=this.stack[this.stack.length-1];K.depth=this.sliceSerialize(U).codePointAt(0)===61?1:2}function D(){this.data.setextHeadingSlurpLineEnding=void 0}function P(U){const oe=this.stack[this.stack.length-1].children;let le=oe[oe.length-1];(!le||le.type!=="text")&&(le=ee(),le.position={start:an(U.start),end:void 0},oe.push(le)),this.stack.push(le)}function T(U){const K=this.stack.pop();K.value+=this.sliceSerialize(U),K.position.end=an(U.end)}function O(U){const K=this.stack[this.stack.length-1];if(this.data.atHardBreak){const oe=K.children[K.children.length-1];oe.position.end=an(U.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(K.type)&&(P.call(this,U),T.call(this,U))}function B(){this.data.atHardBreak=!0}function L(){const U=this.resume(),K=this.stack[this.stack.length-1];K.value=U}function F(){const U=this.resume(),K=this.stack[this.stack.length-1];K.value=U}function R(){const U=this.resume(),K=this.stack[this.stack.length-1];K.value=U}function N(){const U=this.stack[this.stack.length-1];if(this.data.inReference){const K=this.data.referenceType||"shortcut";U.type+="Reference",U.referenceType=K,delete U.url,delete U.title}else delete U.identifier,delete U.label;this.data.referenceType=void 0}function H(){const U=this.stack[this.stack.length-1];if(this.data.inReference){const K=this.data.referenceType||"shortcut";U.type+="Reference",U.referenceType=K,delete U.url,delete U.title}else delete U.identifier,delete U.label;this.data.referenceType=void 0}function z(U){const K=this.sliceSerialize(U),oe=this.stack[this.stack.length-2];oe.label=Vx(K),oe.identifier=Mt(K).toLowerCase()}function W(){const U=this.stack[this.stack.length-1],K=this.resume(),oe=this.stack[this.stack.length-1];if(this.data.inReference=!0,oe.type==="link"){const le=U.children;oe.children=le}else oe.alt=K}function b(){const U=this.resume(),K=this.stack[this.stack.length-1];K.url=U}function _(){const U=this.resume(),K=this.stack[this.stack.length-1];K.title=U}function j(){this.data.inReference=void 0}function S(){this.data.referenceType="collapsed"}function V(U){const K=this.resume(),oe=this.stack[this.stack.length-1];oe.label=K,oe.identifier=Mt(this.sliceSerialize(U)).toLowerCase(),this.data.referenceType="full"}function Y(U){this.data.characterReferenceType=U.type}function q(U){const K=this.sliceSerialize(U),oe=this.data.characterReferenceType;let le;oe?(le=Ad(K,oe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):le=ea(K);const he=this.stack[this.stack.length-1];he.value+=le}function Q(U){const K=this.stack.pop();K.position.end=an(U.end)}function X(U){T.call(this,U);const K=this.stack[this.stack.length-1];K.url=this.sliceSerialize(U)}function se(U){T.call(this,U);const K=this.stack[this.stack.length-1];K.url="mailto:"+this.sliceSerialize(U)}function G(){return{type:"blockquote",children:[]}}function te(){return{type:"code",lang:null,meta:null,value:""}}function $(){return{type:"inlineCode",value:""}}function ne(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function me(){return{type:"emphasis",children:[]}}function Oe(){return{type:"heading",depth:0,children:[]}}function J(){return{type:"break"}}function ue(){return{type:"html",value:""}}function de(){return{type:"image",title:null,url:"",alt:null}}function fe(){return{type:"link",title:null,url:"",children:[]}}function Ae(U){return{type:"list",ordered:U.type==="listOrdered",start:null,spread:U._spread,children:[]}}function Fe(U){return{type:"listItem",spread:U._spread,checked:null,children:[]}}function Me(){return{type:"paragraph",children:[]}}function He(){return{type:"strong",children:[]}}function ee(){return{type:"text",value:""}}function ae(){return{type:"thematicBreak"}}}function an(e){return{line:e.line,column:e.column,offset:e.offset}}function Vd(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Vd(e,r):Kx(e,r)}}function Kx(e,t){let n;for(n in t)if(jd.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 Wd(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Fr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Fr({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Fr({start:t.start,end:t.end})+") is still open")}function Gx(e){const t=this;t.parser=n;function n(r){return qx(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Qx(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 Zx(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
30
+ `}]}function Jx(e,t){const n=t.value?t.value+`
31
+ `:"",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 Xx(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ek(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function tk(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Wn(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let s,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=o+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(s)}]};e.patch(t,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)}function nk(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 rk(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function qd(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),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function ik(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return qd(e,t);const i={src:Wn(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function ok(e,t){const n={src:Wn(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 sk(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 ak(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return qd(e,t);const i={href:Wn(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function lk(e,t){const n={href:Wn(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 uk(e,t,n){const r=e.all(t),i=n?ck(n):Yd(t),o={},s=[];if(typeof t.checked=="boolean"){const f=r[0];let c;f&&f.type==="element"&&f.tagName==="p"?c=f:(c={type:"element",tagName:"p",properties:{},children:[]},r.unshift(c)),c.children.length>0&&c.children.unshift({type:"text",value:" "}),c.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const f=r[a];(i||a!==0||f.type!=="element"||f.tagName!=="p")&&s.push({type:"text",value:`
32
32
  `}),f.type==="element"&&f.tagName==="p"&&!i?s.push(...f.children):s.push(f)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&s.push({type:"text",value:`
33
- `});const u={type:"element",tagName:"li",properties:o,children:s};return e.patch(t,u),e.applyData(t,u)}function wk(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=Zd(n[r])}return t}function Zd(e){const t=e.spread;return t??e.children.length>1}function Sk(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 s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function xk(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function kk(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Ek(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ck(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=Gs(t.children[1]),l=yd(t.children[t.children.length-1]);a&&l&&(s.position={start:a,end:l}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function Ak(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length;let l=-1;const u=[];for(;++l<a;){const c=t.children[l],h={},d=s?s[l]:void 0;d&&(h.align=d);let m={type:"element",tagName:o,properties:h,children:[]};c&&(m.children=e.all(c),e.patch(c,m),m=e.applyData(c,m)),u.push(m)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,f),e.applyData(t,f)}function Tk(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Jd=9,Xd=32;function Ik(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(eh(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(eh(t.slice(i),i>0,!1)),o.join("")}function eh(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===Jd||o===Xd;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===Jd||o===Xd;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Ok(e,t){const n={type:"text",value:Ik(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 Dk={blockquote:sk,break:ak,code:lk,delete:uk,emphasis:ck,footnoteReference:fk,heading:dk,html:hk,imageReference:pk,image:mk,inlineCode:gk,linkReference:yk,link:vk,listItem:bk,list:Sk,paragraph:xk,root:kk,strong:Ek,table:Ck,tableCell:Tk,tableRow:Ak,text:Ok,thematicBreak:Mk,toml:Ui,yaml:Ui,definition:Ui,footnoteDefinition:Ui};function Ui(){}const th=-1,ji=0,zr=1,Hi=2,la=3,ua=4,ca=5,fa=6,nh=7,rh=8,ih=typeof self=="object"?self:globalThis,Nk=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,s]=t[i];switch(o){case ji:case th:return n(s,i);case zr:{const a=n([],i);for(const l of s)a.push(r(l));return a}case Hi:{const a=n({},i);for(const[l,u]of s)a[r(l)]=r(u);return a}case la:return n(new Date(s),i);case ua:{const{source:a,flags:l}=s;return n(new RegExp(a,l),i)}case ca:{const a=n(new Map,i);for(const[l,u]of s)a.set(r(l),r(u));return a}case fa:{const a=n(new Set,i);for(const l of s)a.add(r(l));return a}case nh:{const{name:a,message:l}=s;return n(new ih[a](l),i)}case rh:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:a}=new Uint8Array(s);return n(new DataView(a),s)}}return n(new ih[o](s),i)};return r},oh=e=>Nk(new Map,e)(0),Yn="",{toString:_k}={},{keys:Pk}=Object,Ur=e=>{const t=typeof e;if(t!=="object"||!e)return[ji,t];const n=_k.call(e).slice(8,-1);switch(n){case"Array":return[zr,Yn];case"Object":return[Hi,Yn];case"Date":return[la,Yn];case"RegExp":return[ua,Yn];case"Map":return[ca,Yn];case"Set":return[fa,Yn];case"DataView":return[zr,n]}return n.includes("Array")?[zr,n]:n.includes("Error")?[nh,n]:[Hi,n]},Vi=([e,t])=>e===ji&&(t==="function"||t==="symbol"),Lk=(e,t,n,r)=>{const i=(s,a)=>{const l=r.push(s)-1;return n.set(a,l),l},o=s=>{if(n.has(s))return n.get(s);let[a,l]=Ur(s);switch(a){case ji:{let f=s;switch(l){case"bigint":a=rh,f=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);f=null;break;case"undefined":return i([th],s)}return i([a,f],s)}case zr:{if(l){let h=s;return l==="DataView"?h=new Uint8Array(s.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(s)),i([l,[...h]],s)}const f=[],c=i([a,f],s);for(const h of s)f.push(o(h));return c}case Hi:{if(l)switch(l){case"BigInt":return i([l,s.toString()],s);case"Boolean":case"Number":case"String":return i([l,s.valueOf()],s)}if(t&&"toJSON"in s)return o(s.toJSON());const f=[],c=i([a,f],s);for(const h of Pk(s))(e||!Vi(Ur(s[h])))&&f.push([o(h),o(s[h])]);return c}case la:return i([a,s.toISOString()],s);case ua:{const{source:f,flags:c}=s;return i([a,{source:f,flags:c}],s)}case ca:{const f=[],c=i([a,f],s);for(const[h,d]of s)(e||!(Vi(Ur(h))||Vi(Ur(d))))&&f.push([o(h),o(d)]);return c}case fa:{const f=[],c=i([a,f],s);for(const h of s)(e||!Vi(Ur(h)))&&f.push(o(h));return c}}const{message:u}=s;return i([a,{name:l,message:u}],s)};return o},sh=(e,{json:t,lossy:n}={})=>{const r=[];return Lk(!(t||n),!!t,new Map,r)(e),r},Wi=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?oh(sh(e,t)):structuredClone(e):(e,t)=>oh(sh(e,t));function Fk(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 Rk(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function $k(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Fk,r=e.options.footnoteBackLabel||Rk,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[l]);if(!u)continue;const f=e.all(u),c=String(u.identifier).toUpperCase(),h=Wn(c.toLowerCase());let d=0;const m=[],p=e.footnoteCounts.get(c);for(;p!==void 0&&++d<=p;){m.length>0&&m.push({type:"text",value:" "});let v=typeof n=="string"?n:n(l,d);typeof v=="string"&&(v={type:"text",value:v}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(d>1?"-"+d:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,d),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const g=f[f.length-1];if(g&&g.type==="element"&&g.tagName==="p"){const v=g.children[g.children.length-1];v&&v.type==="text"?v.value+=" ":g.children.push({type:"text",value:" "}),g.children.push(...m)}else f.push(...m);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(f,!0)};e.patch(u,y),a.push(y)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Wi(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
33
+ `});const u={type:"element",tagName:"li",properties:o,children:s};return e.patch(t,u),e.applyData(t,u)}function ck(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=Yd(n[r])}return t}function Yd(e){const t=e.spread;return t??e.children.length>1}function fk(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 s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function dk(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function hk(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function pk(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function mk(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=Ys(t.children[1]),l=hd(t.children[t.children.length-1]);a&&l&&(s.position={start:a,end:l}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function gk(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length;let l=-1;const u=[];for(;++l<a;){const c=t.children[l],h={},d=s?s[l]:void 0;d&&(h.align=d);let m={type:"element",tagName:o,properties:h,children:[]};c&&(m.children=e.all(c),e.patch(c,m),m=e.applyData(c,m)),u.push(m)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,f),e.applyData(t,f)}function yk(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Kd=9,Gd=32;function vk(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(Qd(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(Qd(t.slice(i),i>0,!1)),o.join("")}function Qd(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===Kd||o===Gd;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===Kd||o===Gd;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function bk(e,t){const n={type:"text",value:vk(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function wk(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Sk={blockquote:Qx,break:Zx,code:Jx,delete:Xx,emphasis:ek,footnoteReference:tk,heading:nk,html:rk,imageReference:ik,image:ok,inlineCode:sk,linkReference:ak,link:lk,listItem:uk,list:fk,paragraph:dk,root:hk,strong:pk,table:mk,tableCell:yk,tableRow:gk,text:bk,thematicBreak:wk,toml:Ui,yaml:Ui,definition:Ui,footnoteDefinition:Ui};function Ui(){}const Zd=-1,Hi=0,Ur=1,ji=2,sa=3,aa=4,la=5,ua=6,Jd=7,Xd=8,eh=typeof self=="object"?self:globalThis,xk=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,s]=t[i];switch(o){case Hi:case Zd:return n(s,i);case Ur:{const a=n([],i);for(const l of s)a.push(r(l));return a}case ji:{const a=n({},i);for(const[l,u]of s)a[r(l)]=r(u);return a}case sa:return n(new Date(s),i);case aa:{const{source:a,flags:l}=s;return n(new RegExp(a,l),i)}case la:{const a=n(new Map,i);for(const[l,u]of s)a.set(r(l),r(u));return a}case ua:{const a=n(new Set,i);for(const l of s)a.add(r(l));return a}case Jd:{const{name:a,message:l}=s;return n(new eh[a](l),i)}case Xd:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:a}=new Uint8Array(s);return n(new DataView(a),s)}}return n(new eh[o](s),i)};return r},th=e=>xk(new Map,e)(0),Yn="",{toString:kk}={},{keys:Ek}=Object,Hr=e=>{const t=typeof e;if(t!=="object"||!e)return[Hi,t];const n=kk.call(e).slice(8,-1);switch(n){case"Array":return[Ur,Yn];case"Object":return[ji,Yn];case"Date":return[sa,Yn];case"RegExp":return[aa,Yn];case"Map":return[la,Yn];case"Set":return[ua,Yn];case"DataView":return[Ur,n]}return n.includes("Array")?[Ur,n]:n.includes("Error")?[Jd,n]:[ji,n]},Vi=([e,t])=>e===Hi&&(t==="function"||t==="symbol"),Ck=(e,t,n,r)=>{const i=(s,a)=>{const l=r.push(s)-1;return n.set(a,l),l},o=s=>{if(n.has(s))return n.get(s);let[a,l]=Hr(s);switch(a){case Hi:{let f=s;switch(l){case"bigint":a=Xd,f=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);f=null;break;case"undefined":return i([Zd],s)}return i([a,f],s)}case Ur:{if(l){let h=s;return l==="DataView"?h=new Uint8Array(s.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(s)),i([l,[...h]],s)}const f=[],c=i([a,f],s);for(const h of s)f.push(o(h));return c}case ji:{if(l)switch(l){case"BigInt":return i([l,s.toString()],s);case"Boolean":case"Number":case"String":return i([l,s.valueOf()],s)}if(t&&"toJSON"in s)return o(s.toJSON());const f=[],c=i([a,f],s);for(const h of Ek(s))(e||!Vi(Hr(s[h])))&&f.push([o(h),o(s[h])]);return c}case sa:return i([a,s.toISOString()],s);case aa:{const{source:f,flags:c}=s;return i([a,{source:f,flags:c}],s)}case la:{const f=[],c=i([a,f],s);for(const[h,d]of s)(e||!(Vi(Hr(h))||Vi(Hr(d))))&&f.push([o(h),o(d)]);return c}case ua:{const f=[],c=i([a,f],s);for(const h of s)(e||!Vi(Hr(h)))&&f.push(o(h));return c}}const{message:u}=s;return i([a,{name:l,message:u}],s)};return o},nh=(e,{json:t,lossy:n}={})=>{const r=[];return Ck(!(t||n),!!t,new Map,r)(e),r},Wi=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?th(nh(e,t)):structuredClone(e):(e,t)=>th(nh(e,t));function Ak(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 Tk(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Ik(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Ak,r=e.options.footnoteBackLabel||Tk,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[l]);if(!u)continue;const f=e.all(u),c=String(u.identifier).toUpperCase(),h=Wn(c.toLowerCase());let d=0;const m=[],p=e.footnoteCounts.get(c);for(;p!==void 0&&++d<=p;){m.length>0&&m.push({type:"text",value:" "});let y=typeof n=="string"?n:n(l,d);typeof y=="string"&&(y={type:"text",value:y}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(d>1?"-"+d:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,d),className:["data-footnote-backref"]},children:Array.isArray(y)?y:[y]})}const g=f[f.length-1];if(g&&g.type==="element"&&g.tagName==="p"){const y=g.children[g.children.length-1];y&&y.type==="text"?y.value+=" ":g.children.push({type:"text",value:" "}),g.children.push(...m)}else f.push(...m);const v={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(f,!0)};e.patch(u,v),a.push(v)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Wi(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
34
34
  `},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
35
- `}]}}const qi=function(e){if(e==null)return jk;if(typeof e=="function")return Yi(e);if(typeof e=="object")return Array.isArray(e)?Bk(e):zk(e);if(typeof e=="string")return Uk(e);throw new Error("Expected function, string, or object as test")};function Bk(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=qi(e[n]);return Yi(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function zk(e){const t=e;return Yi(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function Uk(e){return Yi(t);function t(n){return n&&n.type===e}}function Yi(e){return t;function t(n,r,i){return!!(Hk(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function jk(){return!0}function Hk(e){return e!==null&&typeof e=="object"&&"type"in e}function YP(e){return e}const ah=[],Vk=!0,da=!1,Wk="skip";function lh(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=qi(i),s=r?-1:1;a(e,void 0,[])();function a(l,u,f){const c=l&&typeof l=="object"?l:{};if(typeof c.type=="string"){const d=typeof c.tagName=="string"?c.tagName:typeof c.name=="string"?c.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(d?"<"+d+">":""))+")"})}return h;function h(){let d=ah,m,p,g;if((!t||o(l,u,f[f.length-1]||void 0))&&(d=qk(n(l,f)),d[0]===da))return d;if("children"in l&&l.children){const y=l;if(y.children&&d[0]!==Wk)for(p=(r?y.children.length:-1)+s,g=f.concat(y);p>-1&&p<y.children.length;){const v=y.children[p];if(m=a(v,p,g)(),m[0]===da)return m;p=typeof m[1]=="number"?m[1]:p+s}}return d}}}function qk(e){return Array.isArray(e)?e:typeof e=="number"?[Vk,e]:e==null?ah:[e]}function ha(e,t,n,r){let i,o,s;typeof t=="function"&&typeof n!="function"?(o=void 0,s=t,i=n):(o=t,s=n,i=r),lh(e,o,a,i);function a(l,u){const f=u[u.length-1],c=f?f.children.indexOf(l):void 0;return s(l,c,f)}}const pa={}.hasOwnProperty,Yk={};function Kk(e,t){const n=t||Yk,r=new Map,i=new Map,o=new Map,s={...Dk,...n.handlers},a={all:u,applyData:Qk,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:s,one:l,options:n,patch:Gk,wrap:Jk};return ha(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const c=f.type==="definition"?r:i,h=String(f.identifier).toUpperCase();c.has(h)||c.set(h,f)}}),a;function l(f,c){const h=f.type,d=a.handlers[h];if(pa.call(a.handlers,h)&&d)return d(a,f,c);if(a.options.passThrough&&a.options.passThrough.includes(h)){if("children"in f){const{children:p,...g}=f,y=Wi(g);return y.children=a.all(f),y}return Wi(f)}return(a.options.unknownHandler||Zk)(a,f,c)}function u(f){const c=[];if("children"in f){const h=f.children;let d=-1;for(;++d<h.length;){const m=a.one(h[d],f);if(m){if(d&&h[d-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=uh(m.value)),!Array.isArray(m)&&m.type==="element")){const p=m.children[0];p&&p.type==="text"&&(p.value=uh(p.value))}Array.isArray(m)?c.push(...m):c.push(m)}}}return c}}function Gk(e,t){e.position&&(t.position=q1(e))}function Qk(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&o&&Object.assign(n.properties,Wi(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Zk(e,t){const n=t.data||{},r="value"in t&&!(pa.call(n,"hProperties")||pa.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 Jk(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
35
+ `}]}}const qi=function(e){if(e==null)return Nk;if(typeof e=="function")return Yi(e);if(typeof e=="object")return Array.isArray(e)?Ok(e):Mk(e);if(typeof e=="string")return Dk(e);throw new Error("Expected function, string, or object as test")};function Ok(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=qi(e[n]);return Yi(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function Mk(e){const t=e;return Yi(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function Dk(e){return Yi(t);function t(n){return n&&n.type===e}}function Yi(e){return t;function t(n,r,i){return!!(_k(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Nk(){return!0}function _k(e){return e!==null&&typeof e=="object"&&"type"in e}function PP(e){return e}const rh=[],Pk=!0,ca=!1,Lk="skip";function ih(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=qi(i),s=r?-1:1;a(e,void 0,[])();function a(l,u,f){const c=l&&typeof l=="object"?l:{};if(typeof c.type=="string"){const d=typeof c.tagName=="string"?c.tagName:typeof c.name=="string"?c.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(d?"<"+d+">":""))+")"})}return h;function h(){let d=rh,m,p,g;if((!t||o(l,u,f[f.length-1]||void 0))&&(d=Fk(n(l,f)),d[0]===ca))return d;if("children"in l&&l.children){const v=l;if(v.children&&d[0]!==Lk)for(p=(r?v.children.length:-1)+s,g=f.concat(v);p>-1&&p<v.children.length;){const y=v.children[p];if(m=a(y,p,g)(),m[0]===ca)return m;p=typeof m[1]=="number"?m[1]:p+s}}return d}}}function Fk(e){return Array.isArray(e)?e:typeof e=="number"?[Pk,e]:e==null?rh:[e]}function fa(e,t,n,r){let i,o,s;typeof t=="function"&&typeof n!="function"?(o=void 0,s=t,i=n):(o=t,s=n,i=r),ih(e,o,a,i);function a(l,u){const f=u[u.length-1],c=f?f.children.indexOf(l):void 0;return s(l,c,f)}}const da={}.hasOwnProperty,Rk={};function $k(e,t){const n=t||Rk,r=new Map,i=new Map,o=new Map,s={...Sk,...n.handlers},a={all:u,applyData:zk,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:s,one:l,options:n,patch:Bk,wrap:Hk};return fa(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const c=f.type==="definition"?r:i,h=String(f.identifier).toUpperCase();c.has(h)||c.set(h,f)}}),a;function l(f,c){const h=f.type,d=a.handlers[h];if(da.call(a.handlers,h)&&d)return d(a,f,c);if(a.options.passThrough&&a.options.passThrough.includes(h)){if("children"in f){const{children:p,...g}=f,v=Wi(g);return v.children=a.all(f),v}return Wi(f)}return(a.options.unknownHandler||Uk)(a,f,c)}function u(f){const c=[];if("children"in f){const h=f.children;let d=-1;for(;++d<h.length;){const m=a.one(h[d],f);if(m){if(d&&h[d-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=oh(m.value)),!Array.isArray(m)&&m.type==="element")){const p=m.children[0];p&&p.type==="text"&&(p.value=oh(p.value))}Array.isArray(m)?c.push(...m):c.push(m)}}}return c}}function Bk(e,t){e.position&&(t.position=F1(e))}function zk(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&o&&Object.assign(n.properties,Wi(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Uk(e,t){const n=t.data||{},r="value"in t&&!(da.call(n,"hProperties")||da.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 Hk(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
36
36
  `});++r<e.length;)r&&n.push({type:"text",value:`
37
37
  `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
38
- `}),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 ch(e,t){const n=Kk(e,t),r=n.one(e,void 0),i=$k(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
39
- `},i),o}function Xk(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,...e||t})}}function fh(e){if(e)throw e}var Ki=Object.prototype.hasOwnProperty,dh=Object.prototype.toString,hh=Object.defineProperty,ph=Object.getOwnPropertyDescriptor,mh=function(t){return typeof Array.isArray=="function"?Array.isArray(t):dh.call(t)==="[object Array]"},gh=function(t){if(!t||dh.call(t)!=="[object Object]")return!1;var n=Ki.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Ki.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Ki.call(t,i)},yh=function(t,n){hh&&n.name==="__proto__"?hh(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},vh=function(t,n){if(n==="__proto__")if(Ki.call(t,n)){if(ph)return ph(t,n).value}else return;return t[n]},eE=function e(){var t,n,r,i,o,s,a=arguments[0],l=1,u=arguments.length,f=!1;for(typeof a=="boolean"&&(f=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<u;++l)if(t=arguments[l],t!=null)for(n in t)r=vh(a,n),i=vh(t,n),a!==i&&(f&&i&&(gh(i)||(o=mh(i)))?(o?(o=!1,s=r&&mh(r)?r:[]):s=r&&gh(r)?r:{},yh(a,{name:n,newValue:e(f,s,i)})):typeof i<"u"&&yh(a,{name:n,newValue:i}));return a};const ma=vn(eE);function ga(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 tE(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...i);function a(l,...u){const f=e[++o];let c=-1;if(l){s(l);return}for(;++c<i.length;)(u[c]===null||u[c]===void 0)&&(u[c]=i[c]);i=u,f?nE(f,a)(...u):s(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function nE(e,t){let n;return r;function r(...s){const a=e.length>s.length;let l;a&&s.push(i);try{l=e.apply(this,s)}catch(u){const f=u;if(a&&n)throw f;return i(f)}a||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(s,...a){n||(n=!0,t(s,...a))}function o(s){i(null,s)}}const $t={basename:rE,dirname:iE,extname:oE,join:sE,sep:"/"};function rE(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');jr(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function iE(e){if(jr(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 oE(e){jr(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function sE(...e){let t=-1,n;for(;++t<e.length;)jr(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":aE(n)}function aE(e){jr(e);const t=e.codePointAt(0)===47;let n=lE(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function lE(e,t){let n="",r=0,i=-1,o=0,s=-1,a,l;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(i===s-1||o===1))if(i!==s-1&&o===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=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function jr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const uE={cwd:cE};function cE(){return"/"}function ya(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function fE(e){if(typeof e=="string")e=new URL(e);else if(!ya(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 dE(e)}function dE(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 va=["history","path","basename","stem","extname","dirname"];class bh{constructor(t){let n;t?ya(t)?n={path:t}:typeof t=="string"||hE(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":uE.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<va.length;){const o=va[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)va.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?$t.basename(this.path):void 0}set basename(t){wa(t,"basename"),ba(t,"basename"),this.path=$t.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?$t.dirname(this.path):void 0}set dirname(t){wh(this.basename,"dirname"),this.path=$t.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?$t.extname(this.path):void 0}set extname(t){if(ba(t,"extname"),wh(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=$t.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){ya(t)&&(t=fE(t)),wa(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?$t.basename(this.path,this.extname):void 0}set stem(t){wa(t,"stem"),ba(t,"stem"),this.path=$t.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 et(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 ba(e,t){if(e&&e.includes($t.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+$t.sep+"`")}function wa(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function wh(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function hE(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const pE=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},mE={}.hasOwnProperty;class Sa extends pE{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=tE()}copy(){const t=new Sa;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(ma(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Ea("data",this.frozen),this.namespace[t]=n,this):mE.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Ea("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=Gi(t),r=this.parser||this.Parser;return xa("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),xa("process",this.parser||this.Parser),ka("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,s){const a=Gi(t),l=r.parse(a);r.run(l,a,function(f,c,h){if(f||!c||!h)return u(f);const d=c,m=r.stringify(d,h);vE(m)?h.value=m:h.result=m,u(f,h)});function u(f,c){f||!c?s(f):o?o(c):n(void 0,c)}}}processSync(t){let n=!1,r;return this.freeze(),xa("processSync",this.parser||this.Parser),ka("processSync",this.compiler||this.Compiler),this.process(t,i),xh("processSync","process",n),r;function i(o,s){n=!0,fh(o),r=s}}run(t,n,r){Sh(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(s,a){const l=Gi(n);i.run(t,l,u);function u(f,c,h){const d=c||t;f?a(f):s?s(d):r(void 0,d,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),xh("runSync","run",r),i;function o(s,a){fh(s),i=a,r=!0}}stringify(t,n){this.freeze();const r=Gi(n),i=this.compiler||this.Compiler;return ka("stringify",i),Sh(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Ea("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[f,...c]=u;l(f,c)}else s(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function s(u){if(!("plugins"in u)&&!("settings"in u))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(u.plugins),u.settings&&(i.settings=ma(!0,i.settings,u.settings))}function a(u){let f=-1;if(u!=null)if(Array.isArray(u))for(;++f<u.length;){const c=u[f];o(c)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,f){let c=-1,h=-1;for(;++c<r.length;)if(r[c][0]===u){h=c;break}if(h===-1)r.push([u,...f]);else if(f.length>0){let[d,...m]=f;const p=r[h][1];ga(p)&&ga(d)&&(d=ma(!0,p,d)),r[h]=[u,d,...m]}}}}const gE=new Sa().freeze();function xa(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function ka(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Ea(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 Sh(e){if(!ga(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 Gi(e){return yE(e)?e:new bh(e)}function yE(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function vE(e){return typeof e=="string"||bE(e)}function bE(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const wE="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",kh=[],Eh={allowDangerousHtml:!0},SE=/^(https?|ircs?|mailto|xmpp)$/i,xE=[{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 Ch(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,o=e.components,s=e.disallowedElements,a=e.rehypePlugins||kh,l=e.remarkPlugins||kh,u=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Eh}:Eh,f=e.skipHtml,c=e.unwrapDisallowed,h=e.urlTransform||Ah,d=gE().use(ok).use(l).use(Xk,u).use(a),m=new bh;typeof r=="string"&&(m.value=r);for(const v of xE)Object.hasOwn(e,v.from)&&(""+v.from+(v.to?"use `"+v.to+"` instead":"remove it")+wE+v.id,void 0);const p=d.parse(m);let g=d.runSync(p,m);return i&&(g={type:"element",tagName:"div",properties:{className:i},children:g.type==="root"?g.children:[g]}),ha(g,y),Z1(g,{Fragment:k.Fragment,components:o,ignoreInvalidStyle:!0,jsx:k.jsx,jsxs:k.jsxs,passKeys:!0,passNode:!0});function y(v,w,E){if(v.type==="raw"&&E&&typeof w=="number")return f?E.children.splice(w,1):E.children[w]={type:"text",value:v.value},w;if(v.type==="element"){let S;for(S in ea)if(Object.hasOwn(ea,S)&&Object.hasOwn(v.properties,S)){const C=v.properties[S],I=ea[S];(I===null||I.includes(v.tagName))&&(v.properties[S]=h(String(C||""),S,v))}}if(v.type==="element"){let S=t?!t.includes(v.tagName):s?s.includes(v.tagName):!1;if(!S&&n&&typeof w=="number"&&(S=!n(v,w,E)),S&&E&&typeof w=="number")return c&&v.children?E.children.splice(w,1,...v.children):E.children.splice(w,1),w}}}function Ah(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||SE.test(e.slice(0,t))?e:""}function kE(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Th(e,t,n){const i=qi((n||{}).ignore||[]),o=EE(t);let s=-1;for(;++s<o.length;)lh(e,"text",a);function a(u,f){let c=-1,h;for(;++c<f.length;){const d=f[c],m=h?h.children:void 0;if(i(d,m?m.indexOf(d):void 0,h))return;h=d}if(h)return l(u,f)}function l(u,f){const c=f[f.length-1],h=o[s][0],d=o[s][1];let m=0;const g=c.children.indexOf(u);let y=!1,v=[];h.lastIndex=0;let w=h.exec(u.value);for(;w;){const E=w.index,S={index:w.index,input:w.input,stack:[...f,u]};let C=d(...w,S);if(typeof C=="string"&&(C=C.length>0?{type:"text",value:C}:void 0),C===!1?h.lastIndex=E+1:(m!==E&&v.push({type:"text",value:u.value.slice(m,E)}),Array.isArray(C)?v.push(...C):C&&v.push(C),m=E+w[0].length,y=!0),!h.global)break;w=h.exec(u.value)}return y?(m<u.value.length&&v.push({type:"text",value:u.value.slice(m)}),c.children.splice(g,1,...v)):v=[u],g+v.length}}function EE(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([CE(i[0]),AE(i[1])])}return t}function CE(e){return typeof e=="string"?new RegExp(kE(e),"g"):e}function AE(e){return typeof e=="function"?e:function(){return e}}function TE(e){Th(e,[/\r?\n|\r/g,IE])}function IE(){return{type:"break"}}function OE(){return function(e){TE(e)}}function Ih(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 Ca="phrasing",Aa=["autolink","link","image","label"];function ME(){return{transforms:[RE],enter:{literalAutolink:NE,literalAutolinkEmail:Ta,literalAutolinkHttp:Ta,literalAutolinkWww:Ta},exit:{literalAutolink:FE,literalAutolinkEmail:LE,literalAutolinkHttp:_E,literalAutolinkWww:PE}}}function DE(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Ca,notInConstruct:Aa},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Ca,notInConstruct:Aa},{character:":",before:"[ps]",after:"\\/",inConstruct:Ca,notInConstruct:Aa}]}}function NE(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Ta(e){this.config.enter.autolinkProtocol.call(this,e)}function _E(e){this.config.exit.autolinkProtocol.call(this,e)}function PE(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 LE(e){this.config.exit.autolinkEmail.call(this,e)}function FE(e){this.exit(e)}function RE(e){Th(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,$E],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),BE]],{ignore:["link","linkReference"]})}function $E(e,t,n,r,i){let o="";if(!Oh(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!zE(n)))return!1;const s=UE(n+r);if(!s[0])return!1;const a={type:"link",title:null,url:o+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function BE(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 zE(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 UE(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=Ih(e,"(");let o=Ih(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function Oh(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Tn(n)||$i(n))&&(!t||n!==47)}Mh.peek=QE;function jE(){this.buffer()}function HE(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function VE(){this.buffer()}function WE(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function qE(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Mt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function YE(e){this.exit(e)}function KE(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Mt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function GE(e){this.exit(e)}function QE(){return"["}function Mh(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const s=n.enter("footnoteReference"),a=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),a(),s(),o+=i.move("]"),o}function ZE(){return{enter:{gfmFootnoteCallString:jE,gfmFootnoteCall:HE,gfmFootnoteDefinitionLabelString:VE,gfmFootnoteDefinition:WE},exit:{gfmFootnoteCallString:qE,gfmFootnoteCall:YE,gfmFootnoteDefinitionLabelString:KE,gfmFootnoteDefinition:GE}}}function JE(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Mh},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,s){const a=o.createTracker(s);let l=a.move("[^");const u=o.enter("footnoteDefinition"),f=o.enter("label");return l+=a.move(o.safe(o.associationId(r),{before:l,after:"]"})),f(),l+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),l+=a.move((t?`
40
- `:" ")+o.indentLines(o.containerFlow(r,a.current()),t?Dh:XE))),u(),l}}function XE(e,t,n){return t===0?e:Dh(e,t,n)}function Dh(e,t,n){return(n?"":" ")+e}const eC=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Nh.peek=oC;function tC(){return{canContainEols:["delete"],enter:{strikethrough:rC},exit:{strikethrough:iC}}}function nC(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:eC}],handlers:{delete:Nh}}}function rC(e){this.enter({type:"delete",children:[]},e)}function iC(e){this.exit(e)}function Nh(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function oC(){return"~"}function sC(e){return e.length}function aC(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||sC,o=[],s=[],a=[],l=[];let u=0,f=-1;for(;++f<e.length;){const p=[],g=[];let y=-1;for(e[f].length>u&&(u=e[f].length);++y<e[f].length;){const v=lC(e[f][y]);if(n.alignDelimiters!==!1){const w=i(v);g[y]=w,(l[y]===void 0||w>l[y])&&(l[y]=w)}p.push(v)}s[f]=p,a[f]=g}let c=-1;if(typeof r=="object"&&"length"in r)for(;++c<u;)o[c]=_h(r[c]);else{const p=_h(r);for(;++c<u;)o[c]=p}c=-1;const h=[],d=[];for(;++c<u;){const p=o[c];let g="",y="";p===99?(g=":",y=":"):p===108?g=":":p===114&&(y=":");let v=n.alignDelimiters===!1?1:Math.max(1,l[c]-g.length-y.length);const w=g+"-".repeat(v)+y;n.alignDelimiters!==!1&&(v=g.length+v+y.length,v>l[c]&&(l[c]=v),d[c]=v),h[c]=w}s.splice(1,0,h),a.splice(1,0,d),f=-1;const m=[];for(;++f<s.length;){const p=s[f],g=a[f];c=-1;const y=[];for(;++c<u;){const v=p[c]||"";let w="",E="";if(n.alignDelimiters!==!1){const S=l[c]-(g[c]||0),C=o[c];C===114?w=" ".repeat(S):C===99?S%2?(w=" ".repeat(S/2+.5),E=" ".repeat(S/2-.5)):(w=" ".repeat(S/2),E=w):E=" ".repeat(S)}n.delimiterStart!==!1&&!c&&y.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&v==="")&&(n.delimiterStart!==!1||c)&&y.push(" "),n.alignDelimiters!==!1&&y.push(w),y.push(v),n.alignDelimiters!==!1&&y.push(E),n.padding!==!1&&y.push(" "),(n.delimiterEnd!==!1||c!==u-1)&&y.push("|")}m.push(n.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return m.join(`
41
- `)}function lC(e){return e==null?"":String(e)}function _h(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 uC(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const s=n.indentLines(n.containerFlow(e,o.current()),cC);return i(),s}function cC(e,t,n){return">"+(n?"":" ")+e}function fC(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 Lh(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
42
- `&&fC(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
43
- `}function dC(e,t){const n=String(e);let r=n.indexOf(t),i=r,o=0,s=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>s&&(s=o):o=1,i=r+t.length,r=n.indexOf(t,i);return s}function hC(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 pC(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 mC(e,t,n,r){const i=pC(n),o=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(hC(e,n)){const c=n.enter("codeIndented"),h=n.indentLines(o,gC);return c(),h}const a=n.createTracker(r),l=i.repeat(Math.max(dC(o,i)+1,3)),u=n.enter("codeFenced");let f=a.move(l);if(e.lang){const c=n.enter(`codeFencedLang${s}`);f+=a.move(n.safe(e.lang,{before:f,after:" ",encode:["`"],...a.current()})),c()}if(e.lang&&e.meta){const c=n.enter(`codeFencedMeta${s}`);f+=a.move(" "),f+=a.move(n.safe(e.meta,{before:f,after:`
38
+ `}),n}function oh(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function sh(e,t){const n=$k(e,t),r=n.one(e,void 0),i=Ik(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
39
+ `},i),o}function jk(e,t){return e&&"run"in e?async function(n,r){const i=sh(n,{file:r,...t});await e.run(i,r)}:function(n,r){return sh(n,{file:r,...e||t})}}function ah(e){if(e)throw e}var Ki=Object.prototype.hasOwnProperty,lh=Object.prototype.toString,uh=Object.defineProperty,ch=Object.getOwnPropertyDescriptor,fh=function(t){return typeof Array.isArray=="function"?Array.isArray(t):lh.call(t)==="[object Array]"},dh=function(t){if(!t||lh.call(t)!=="[object Object]")return!1;var n=Ki.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Ki.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Ki.call(t,i)},hh=function(t,n){uh&&n.name==="__proto__"?uh(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},ph=function(t,n){if(n==="__proto__")if(Ki.call(t,n)){if(ch)return ch(t,n).value}else return;return t[n]},Vk=function e(){var t,n,r,i,o,s,a=arguments[0],l=1,u=arguments.length,f=!1;for(typeof a=="boolean"&&(f=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<u;++l)if(t=arguments[l],t!=null)for(n in t)r=ph(a,n),i=ph(t,n),a!==i&&(f&&i&&(dh(i)||(o=fh(i)))?(o?(o=!1,s=r&&fh(r)?r:[]):s=r&&dh(r)?r:{},hh(a,{name:n,newValue:e(f,s,i)})):typeof i<"u"&&hh(a,{name:n,newValue:i}));return a};const ha=vn(Vk);function pa(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 Wk(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...i);function a(l,...u){const f=e[++o];let c=-1;if(l){s(l);return}for(;++c<i.length;)(u[c]===null||u[c]===void 0)&&(u[c]=i[c]);i=u,f?qk(f,a)(...u):s(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function qk(e,t){let n;return r;function r(...s){const a=e.length>s.length;let l;a&&s.push(i);try{l=e.apply(this,s)}catch(u){const f=u;if(a&&n)throw f;return i(f)}a||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(s,...a){n||(n=!0,t(s,...a))}function o(s){i(null,s)}}const $t={basename:Yk,dirname:Kk,extname:Gk,join:Qk,sep:"/"};function Yk(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');jr(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function Kk(e){if(jr(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 Gk(e){jr(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Qk(...e){let t=-1,n;for(;++t<e.length;)jr(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Zk(n)}function Zk(e){jr(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,o=0,s=-1,a,l;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(i===s-1||o===1))if(i!==s-1&&o===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=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function jr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Xk={cwd:eE};function eE(){return"/"}function ma(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function tE(e){if(typeof e=="string")e=new URL(e);else if(!ma(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 nE(e)}function nE(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 ga=["history","path","basename","stem","extname","dirname"];class mh{constructor(t){let n;t?ma(t)?n={path:t}:typeof t=="string"||rE(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Xk.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<ga.length;){const o=ga[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)ga.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?$t.basename(this.path):void 0}set basename(t){va(t,"basename"),ya(t,"basename"),this.path=$t.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?$t.dirname(this.path):void 0}set dirname(t){gh(this.basename,"dirname"),this.path=$t.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?$t.extname(this.path):void 0}set extname(t){if(ya(t,"extname"),gh(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=$t.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){ma(t)&&(t=tE(t)),va(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?$t.basename(this.path,this.extname):void 0}set stem(t){va(t,"stem"),ya(t,"stem"),this.path=$t.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 et(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 ya(e,t){if(e&&e.includes($t.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+$t.sep+"`")}function va(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function gh(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function rE(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const iE=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},oE={}.hasOwnProperty;class ba extends iE{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=Wk()}copy(){const t=new ba;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(ha(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(xa("data",this.frozen),this.namespace[t]=n,this):oE.call(this.namespace,t)&&this.namespace[t]||void 0:t?(xa("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=Gi(t),r=this.parser||this.Parser;return wa("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),wa("process",this.parser||this.Parser),Sa("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,s){const a=Gi(t),l=r.parse(a);r.run(l,a,function(f,c,h){if(f||!c||!h)return u(f);const d=c,m=r.stringify(d,h);lE(m)?h.value=m:h.result=m,u(f,h)});function u(f,c){f||!c?s(f):o?o(c):n(void 0,c)}}}processSync(t){let n=!1,r;return this.freeze(),wa("processSync",this.parser||this.Parser),Sa("processSync",this.compiler||this.Compiler),this.process(t,i),vh("processSync","process",n),r;function i(o,s){n=!0,ah(o),r=s}}run(t,n,r){yh(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(s,a){const l=Gi(n);i.run(t,l,u);function u(f,c,h){const d=c||t;f?a(f):s?s(d):r(void 0,d,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),vh("runSync","run",r),i;function o(s,a){ah(s),i=a,r=!0}}stringify(t,n){this.freeze();const r=Gi(n),i=this.compiler||this.Compiler;return Sa("stringify",i),yh(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(xa("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[f,...c]=u;l(f,c)}else s(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function s(u){if(!("plugins"in u)&&!("settings"in u))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(u.plugins),u.settings&&(i.settings=ha(!0,i.settings,u.settings))}function a(u){let f=-1;if(u!=null)if(Array.isArray(u))for(;++f<u.length;){const c=u[f];o(c)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,f){let c=-1,h=-1;for(;++c<r.length;)if(r[c][0]===u){h=c;break}if(h===-1)r.push([u,...f]);else if(f.length>0){let[d,...m]=f;const p=r[h][1];pa(p)&&pa(d)&&(d=ha(!0,p,d)),r[h]=[u,d,...m]}}}}const sE=new ba().freeze();function wa(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Sa(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function xa(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 yh(e){if(!pa(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function vh(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Gi(e){return aE(e)?e:new mh(e)}function aE(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function lE(e){return typeof e=="string"||uE(e)}function uE(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const cE="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",bh=[],wh={allowDangerousHtml:!0},fE=/^(https?|ircs?|mailto|xmpp)$/i,dE=[{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 Sh(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,o=e.components,s=e.disallowedElements,a=e.rehypePlugins||bh,l=e.remarkPlugins||bh,u=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...wh}:wh,f=e.skipHtml,c=e.unwrapDisallowed,h=e.urlTransform||xh,d=sE().use(Gx).use(l).use(jk,u).use(a),m=new mh;typeof r=="string"&&(m.value=r);for(const y of dE)Object.hasOwn(e,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+cE+y.id,void 0);const p=d.parse(m);let g=d.runSync(p,m);return i&&(g={type:"element",tagName:"div",properties:{className:i},children:g.type==="root"?g.children:[g]}),fa(g,v),U1(g,{Fragment:x.Fragment,components:o,ignoreInvalidStyle:!0,jsx:x.jsx,jsxs:x.jsxs,passKeys:!0,passNode:!0});function v(y,w,A){if(y.type==="raw"&&A&&typeof w=="number")return f?A.children.splice(w,1):A.children[w]={type:"text",value:y.value},w;if(y.type==="element"){let k;for(k in Js)if(Object.hasOwn(Js,k)&&Object.hasOwn(y.properties,k)){const E=y.properties[k],I=Js[k];(I===null||I.includes(y.tagName))&&(y.properties[k]=h(String(E||""),k,y))}}if(y.type==="element"){let k=t?!t.includes(y.tagName):s?s.includes(y.tagName):!1;if(!k&&n&&typeof w=="number"&&(k=!n(y,w,A)),k&&A&&typeof w=="number")return c&&y.children?A.children.splice(w,1,...y.children):A.children.splice(w,1),w}}}function xh(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||fE.test(e.slice(0,t))?e:""}function hE(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function kh(e,t,n){const i=qi((n||{}).ignore||[]),o=pE(t);let s=-1;for(;++s<o.length;)ih(e,"text",a);function a(u,f){let c=-1,h;for(;++c<f.length;){const d=f[c],m=h?h.children:void 0;if(i(d,m?m.indexOf(d):void 0,h))return;h=d}if(h)return l(u,f)}function l(u,f){const c=f[f.length-1],h=o[s][0],d=o[s][1];let m=0;const g=c.children.indexOf(u);let v=!1,y=[];h.lastIndex=0;let w=h.exec(u.value);for(;w;){const A=w.index,k={index:w.index,input:w.input,stack:[...f,u]};let E=d(...w,k);if(typeof E=="string"&&(E=E.length>0?{type:"text",value:E}:void 0),E===!1?h.lastIndex=A+1:(m!==A&&y.push({type:"text",value:u.value.slice(m,A)}),Array.isArray(E)?y.push(...E):E&&y.push(E),m=A+w[0].length,v=!0),!h.global)break;w=h.exec(u.value)}return v?(m<u.value.length&&y.push({type:"text",value:u.value.slice(m)}),c.children.splice(g,1,...y)):y=[u],g+y.length}}function pE(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([mE(i[0]),gE(i[1])])}return t}function mE(e){return typeof e=="string"?new RegExp(hE(e),"g"):e}function gE(e){return typeof e=="function"?e:function(){return e}}function yE(e){kh(e,[/\r?\n|\r/g,vE])}function vE(){return{type:"break"}}function bE(){return function(e){yE(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 ka="phrasing",Ea=["autolink","link","image","label"];function wE(){return{transforms:[TE],enter:{literalAutolink:xE,literalAutolinkEmail:Ca,literalAutolinkHttp:Ca,literalAutolinkWww:Ca},exit:{literalAutolink:AE,literalAutolinkEmail:CE,literalAutolinkHttp:kE,literalAutolinkWww:EE}}}function SE(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:ka,notInConstruct:Ea},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:ka,notInConstruct:Ea},{character:":",before:"[ps]",after:"\\/",inConstruct:ka,notInConstruct:Ea}]}}function xE(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Ca(e){this.config.enter.autolinkProtocol.call(this,e)}function kE(e){this.config.exit.autolinkProtocol.call(this,e)}function EE(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 CE(e){this.config.exit.autolinkEmail.call(this,e)}function AE(e){this.exit(e)}function TE(e){kh(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,IE],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),OE]],{ignore:["link","linkReference"]})}function IE(e,t,n,r,i){let o="";if(!Ch(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!ME(n)))return!1;const s=DE(n+r);if(!s[0])return!1;const a={type:"link",title:null,url:o+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function OE(e,t,n,r){return!Ch(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function ME(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 DE(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 o=Eh(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function Ch(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Tn(n)||$i(n))&&(!t||n!==47)}Ah.peek=zE;function NE(){this.buffer()}function _E(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function PE(){this.buffer()}function LE(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function FE(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Mt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function RE(e){this.exit(e)}function $E(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Mt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function BE(e){this.exit(e)}function zE(){return"["}function Ah(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const s=n.enter("footnoteReference"),a=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),a(),s(),o+=i.move("]"),o}function UE(){return{enter:{gfmFootnoteCallString:NE,gfmFootnoteCall:_E,gfmFootnoteDefinitionLabelString:PE,gfmFootnoteDefinition:LE},exit:{gfmFootnoteCallString:FE,gfmFootnoteCall:RE,gfmFootnoteDefinitionLabelString:$E,gfmFootnoteDefinition:BE}}}function HE(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Ah},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,s){const a=o.createTracker(s);let l=a.move("[^");const u=o.enter("footnoteDefinition"),f=o.enter("label");return l+=a.move(o.safe(o.associationId(r),{before:l,after:"]"})),f(),l+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),l+=a.move((t?`
40
+ `:" ")+o.indentLines(o.containerFlow(r,a.current()),t?Th:jE))),u(),l}}function jE(e,t,n){return t===0?e:Th(e,t,n)}function Th(e,t,n){return(n?"":" ")+e}const VE=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Ih.peek=GE;function WE(){return{canContainEols:["delete"],enter:{strikethrough:YE},exit:{strikethrough:KE}}}function qE(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:VE}],handlers:{delete:Ih}}}function YE(e){this.enter({type:"delete",children:[]},e)}function KE(e){this.exit(e)}function Ih(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function GE(){return"~"}function QE(e){return e.length}function ZE(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||QE,o=[],s=[],a=[],l=[];let u=0,f=-1;for(;++f<e.length;){const p=[],g=[];let v=-1;for(e[f].length>u&&(u=e[f].length);++v<e[f].length;){const y=JE(e[f][v]);if(n.alignDelimiters!==!1){const w=i(y);g[v]=w,(l[v]===void 0||w>l[v])&&(l[v]=w)}p.push(y)}s[f]=p,a[f]=g}let c=-1;if(typeof r=="object"&&"length"in r)for(;++c<u;)o[c]=Oh(r[c]);else{const p=Oh(r);for(;++c<u;)o[c]=p}c=-1;const h=[],d=[];for(;++c<u;){const p=o[c];let g="",v="";p===99?(g=":",v=":"):p===108?g=":":p===114&&(v=":");let y=n.alignDelimiters===!1?1:Math.max(1,l[c]-g.length-v.length);const w=g+"-".repeat(y)+v;n.alignDelimiters!==!1&&(y=g.length+y+v.length,y>l[c]&&(l[c]=y),d[c]=y),h[c]=w}s.splice(1,0,h),a.splice(1,0,d),f=-1;const m=[];for(;++f<s.length;){const p=s[f],g=a[f];c=-1;const v=[];for(;++c<u;){const y=p[c]||"";let w="",A="";if(n.alignDelimiters!==!1){const k=l[c]-(g[c]||0),E=o[c];E===114?w=" ".repeat(k):E===99?k%2?(w=" ".repeat(k/2+.5),A=" ".repeat(k/2-.5)):(w=" ".repeat(k/2),A=w):A=" ".repeat(k)}n.delimiterStart!==!1&&!c&&v.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&y==="")&&(n.delimiterStart!==!1||c)&&v.push(" "),n.alignDelimiters!==!1&&v.push(w),v.push(y),n.alignDelimiters!==!1&&v.push(A),n.padding!==!1&&v.push(" "),(n.delimiterEnd!==!1||c!==u-1)&&v.push("|")}m.push(n.delimiterEnd===!1?v.join("").replace(/ +$/,""):v.join(""))}return m.join(`
41
+ `)}function JE(e){return e==null?"":String(e)}function Oh(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 XE(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const s=n.indentLines(n.containerFlow(e,o.current()),eC);return i(),s}function eC(e,t,n){return">"+(n?"":" ")+e}function tC(e,t){return Mh(e,t.inConstruct,!0)&&!Mh(e,t.notInConstruct,!1)}function Mh(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 Dh(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,o=0,s=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>s&&(s=o):o=1,i=r+t.length,r=n.indexOf(t,i);return s}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 oC(e,t,n,r){const i=iC(n),o=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(rC(e,n)){const c=n.enter("codeIndented"),h=n.indentLines(o,sC);return c(),h}const a=n.createTracker(r),l=i.repeat(Math.max(nC(o,i)+1,3)),u=n.enter("codeFenced");let f=a.move(l);if(e.lang){const c=n.enter(`codeFencedLang${s}`);f+=a.move(n.safe(e.lang,{before:f,after:" ",encode:["`"],...a.current()})),c()}if(e.lang&&e.meta){const c=n.enter(`codeFencedMeta${s}`);f+=a.move(" "),f+=a.move(n.safe(e.meta,{before:f,after:`
44
44
  `,encode:["`"],...a.current()})),c()}return f+=a.move(`
45
45
  `),o&&(f+=a.move(o+`
46
- `)),f+=a.move(l),u(),f}function gC(e,t,n){return(n?"":" ")+e}function Ia(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 yC(e,t,n,r){const i=Ia(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("definition");let a=n.enter("label");const l=n.createTracker(r);let u=l.move("[");return u+=l.move(n.safe(n.associationId(e),{before:u,after:"]",...l.current()})),u+=l.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(a=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":`
47
- `,...l.current()}))),a(),e.title&&(a=n.enter(`title${o}`),u+=l.move(" "+i),u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),a()),s(),u}function vC(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Hr(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Qi(e,t,n){const r=qn(e),i=qn(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Fh.peek=bC;function Fh(e,t,n,r){const i=vC(n),o=n.enter("emphasis"),s=n.createTracker(r),a=s.move(i);let l=s.move(n.containerPhrasing(e,{after:i,before:a,...s.current()}));const u=l.charCodeAt(0),f=Qi(r.before.charCodeAt(r.before.length-1),u,i);f.inside&&(l=Hr(u)+l.slice(1));const c=l.charCodeAt(l.length-1),h=Qi(r.after.charCodeAt(0),c,i);h.inside&&(l=l.slice(0,-1)+Hr(c));const d=s.move(i);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:f.outside},a+l+d}function bC(e,t,n){return n.options.emphasis||"*"}function wC(e,t){let n=!1;return ha(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,da}),!!((!e.depth||e.depth<3)&&ta(e)&&(t.options.setext||n))}function SC(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(wC(e,n)){const f=n.enter("headingSetext"),c=n.enter("phrasing"),h=n.containerPhrasing(e,{...o.current(),before:`
46
+ `)),f+=a.move(l),u(),f}function sC(e,t,n){return(n?"":" ")+e}function Aa(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=Aa(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("definition");let a=n.enter("label");const l=n.createTracker(r);let u=l.move("[");return u+=l.move(n.safe(n.associationId(e),{before:u,after:"]",...l.current()})),u+=l.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(a=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":`
47
+ `,...l.current()}))),a(),e.title&&(a=n.enter(`title${o}`),u+=l.move(" "+i),u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),a()),s(),u}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}function Vr(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Qi(e,t,n){const r=qn(e),i=qn(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Nh.peek=uC;function Nh(e,t,n,r){const i=lC(n),o=n.enter("emphasis"),s=n.createTracker(r),a=s.move(i);let l=s.move(n.containerPhrasing(e,{after:i,before:a,...s.current()}));const u=l.charCodeAt(0),f=Qi(r.before.charCodeAt(r.before.length-1),u,i);f.inside&&(l=Vr(u)+l.slice(1));const c=l.charCodeAt(l.length-1),h=Qi(r.after.charCodeAt(0),c,i);h.inside&&(l=l.slice(0,-1)+Vr(c));const d=s.move(i);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:f.outside},a+l+d}function uC(e,t,n){return n.options.emphasis||"*"}function cC(e,t){let n=!1;return fa(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,ca}),!!((!e.depth||e.depth<3)&&Xs(e)&&(t.options.setext||n))}function fC(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(cC(e,n)){const f=n.enter("headingSetext"),c=n.enter("phrasing"),h=n.containerPhrasing(e,{...o.current(),before:`
48
48
  `,after:`
49
49
  `});return c(),f(),h+`
50
50
  `+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
51
51
  `))+1))}const s="#".repeat(i),a=n.enter("headingAtx"),l=n.enter("phrasing");o.move(s+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
52
- `,...o.current()});return/^[\t ]/.test(u)&&(u=Hr(u.charCodeAt(0))+u.slice(1)),u=u?s+" "+u:s,n.options.closeAtx&&(u+=" "+s),l(),a(),u}Rh.peek=xC;function Rh(e){return e.value||""}function xC(){return"<"}$h.peek=kC;function $h(e,t,n,r){const i=Ia(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let a=n.enter("label");const l=n.createTracker(r);let u=l.move("![");return u+=l.move(n.safe(e.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(a=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),a(),e.title&&(a=n.enter(`title${o}`),u+=l.move(" "+i),u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),a()),u+=l.move(")"),s(),u}function kC(){return"!"}Bh.peek=EC;function Bh(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let s=n.enter("label");const a=n.createTracker(r);let l=a.move("![");const u=n.safe(e.alt,{before:l,after:"]",...a.current()});l+=a.move(u+"]["),s();const f=n.stack;n.stack=[],s=n.enter("reference");const c=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return s(),n.stack=f,o(),i==="full"||!u||u!==c?l+=a.move(c+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function EC(){return"!"}zh.peek=CC;function zh(e,t,n){let r=e.value||"",i="`",o=-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+" ");++o<n.unsafe.length;){const s=n.unsafe[o],a=n.compilePattern(s);let l;if(s.atBreak)for(;l=a.exec(r);){let u=l.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(l.index+1)}}return i+r+i}function CC(){return"`"}function Uh(e,t){const n=ta(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=AC;function jh(e,t,n,r){const i=Ia(n),o=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let a,l;if(Uh(e,n)){const f=n.stack;n.stack=[],a=n.enter("autolink");let c=s.move("<");return c+=s.move(n.containerPhrasing(e,{before:c,after:">",...s.current()})),c+=s.move(">"),a(),n.stack=f,c}a=n.enter("link"),l=n.enter("label");let u=s.move("[");return u+=s.move(n.containerPhrasing(e,{before:u,after:"](",...s.current()})),u+=s.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=s.move("<"),u+=s.move(n.safe(e.url,{before:u,after:">",...s.current()})),u+=s.move(">")):(l=n.enter("destinationRaw"),u+=s.move(n.safe(e.url,{before:u,after:e.title?" ":")",...s.current()}))),l(),e.title&&(l=n.enter(`title${o}`),u+=s.move(" "+i),u+=s.move(n.safe(e.title,{before:u,after:i,...s.current()})),u+=s.move(i),l()),u+=s.move(")"),a(),u}function AC(e,t,n){return Uh(e,n)?"<":"["}Hh.peek=TC;function Hh(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let s=n.enter("label");const a=n.createTracker(r);let l=a.move("[");const u=n.containerPhrasing(e,{before:l,after:"]",...a.current()});l+=a.move(u+"]["),s();const f=n.stack;n.stack=[],s=n.enter("reference");const c=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return s(),n.stack=f,o(),i==="full"||!u||u!==c?l+=a.move(c+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function TC(){return"["}function Oa(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 IC(e){const t=Oa(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 OC(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 MC(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let s=e.ordered?OC(n):Oa(n);const a=e.ordered?s==="."?")":".":IC(n);let l=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&f&&(!f.children||!f.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)===s&&f){let c=-1;for(;++c<e.children.length;){const h=e.children[c];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(s=a),n.bulletCurrent=s;const u=n.containerFlow(e,r);return n.bulletLastUsed=s,n.bulletCurrent=o,i(),u}function DC(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 NC(e,t,n,r){const i=DC(n);let o=n.bulletCurrent||Oa(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let s=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const a=n.createTracker(r);a.move(o+" ".repeat(s-o.length)),a.shift(s);const l=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,a.current()),f);return l(),u;function f(c,h,d){return h?(d?"":" ".repeat(s))+c:(d?o:o+" ".repeat(s-o.length))+c}}function _C(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),s=n.containerPhrasing(e,r);return o(),i(),s}const PC=qi(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function LC(e,t,n,r){return(e.children.some(function(s){return PC(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function FC(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Wh.peek=RC;function Wh(e,t,n,r){const i=FC(n),o=n.enter("strong"),s=n.createTracker(r),a=s.move(i+i);let l=s.move(n.containerPhrasing(e,{after:i,before:a,...s.current()}));const u=l.charCodeAt(0),f=Qi(r.before.charCodeAt(r.before.length-1),u,i);f.inside&&(l=Hr(u)+l.slice(1));const c=l.charCodeAt(l.length-1),h=Qi(r.after.charCodeAt(0),c,i);h.inside&&(l=l.slice(0,-1)+Hr(c));const d=s.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:f.outside},a+l+d}function RC(e,t,n){return n.options.strong||"*"}function $C(e,t,n,r){return n.safe(e.value,r)}function BC(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 zC(e,t,n){const r=(Vh(n)+(n.options.ruleSpaces?" ":"")).repeat(BC(n));return n.options.ruleSpaces?r.slice(0,-1):r}const qh={blockquote:uC,break:Lh,code:mC,definition:yC,emphasis:Fh,hardBreak:Lh,heading:SC,html:Rh,image:$h,imageReference:Bh,inlineCode:zh,link:jh,linkReference:Hh,list:MC,listItem:NC,paragraph:_C,root:LC,strong:Wh,text:$C,thematicBreak:zC};function UC(){return{enter:{table:jC,tableData:Yh,tableHeader:Yh,tableRow:VC},exit:{codeText:WC,table:HC,tableData:Ma,tableHeader:Ma,tableRow:Ma}}}function jC(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 HC(e){this.exit(e),this.data.inTable=void 0}function VC(e){this.enter({type:"tableRow",children:[]},e)}function Ma(e){this.exit(e)}function Yh(e){this.enter({type:"tableCell",children:[]},e)}function WC(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,qC));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function qC(e,t){return t==="|"?t:e}function YC(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=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:s,tableCell:l,tableRow:a}};function s(d,m,p,g){return u(f(d,p,g),d.align)}function a(d,m,p,g){const y=c(d,p,g),v=u([y]);return v.slice(0,v.indexOf(`
54
- `))}function l(d,m,p,g){const y=p.enter("tableCell"),v=p.enter("phrasing"),w=p.containerPhrasing(d,{...g,before:o,after:o});return v(),y(),w}function u(d,m){return aC(d,{align:m,alignDelimiters:r,padding:n,stringLength:i})}function f(d,m,p){const g=d.children;let y=-1;const v=[],w=m.enter("table");for(;++y<g.length;)v[y]=c(g[y],m,p);return w(),v}function c(d,m,p){const g=d.children;let y=-1;const v=[],w=m.enter("tableRow");for(;++y<g.length;)v[y]=l(g[y],d,m,p);return w(),v}function h(d,m,p){let g=qh.inlineCode(d,m,p);return p.stack.includes("tableCell")&&(g=g.replace(/\|/g,"\\$&")),g}}function KC(){return{exit:{taskListCheckValueChecked:Kh,taskListCheckValueUnchecked:Kh,paragraph:QC}}}function GC(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:ZC}}}function Kh(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function QC(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 o=-1,s;for(;++o<i.length;){const a=i[o];if(a.type==="paragraph"){s=a;break}}s===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 ZC(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);o&&a.move(s);let l=qh.listItem(e,t,n,{...r,...a.current()});return o&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),l;function u(f){return f+s}}function JC(){return[ME(),ZE(),tC(),UC(),KC()]}function XC(e){return{extensions:[DE(),JE(e),nC(),YC(e),GC()]}}const eA={tokenize:sA,partial:!0},Gh={tokenize:aA,partial:!0},Qh={tokenize:lA,partial:!0},Zh={tokenize:uA,partial:!0},tA={tokenize:cA,partial:!0},Jh={name:"wwwAutolink",tokenize:iA,previous:ep},Xh={name:"protocolAutolink",tokenize:oA,previous:tp},Kt={name:"emailAutolink",tokenize:rA,previous:np},Bt={};function nA(){return{text:Bt}}let In=48;for(;In<123;)Bt[In]=Kt,In++,In===58?In=65:In===91&&(In=97);Bt[43]=Kt,Bt[45]=Kt,Bt[46]=Kt,Bt[95]=Kt,Bt[72]=[Kt,Xh],Bt[104]=[Kt,Xh],Bt[87]=[Kt,Jh],Bt[119]=[Kt,Jh];function rA(e,t,n){const r=this;let i,o;return s;function s(c){return!Da(c)||!np.call(r,r.previous)||Na(r.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(c))}function a(c){return Da(c)?(e.consume(c),a):c===64?(e.consume(c),l):n(c)}function l(c){return c===46?e.check(tA,f,u)(c):c===45||c===95||tt(c)?(o=!0,e.consume(c),l):f(c)}function u(c){return e.consume(c),i=!0,l}function f(c){return o&&i&&ot(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(c)):n(c)}}function iA(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!ep.call(r,r.previous)||Na(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(eA,e.attempt(Gh,e.attempt(Qh,o),n),n)(s))}function o(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function oA(e,t,n){const r=this;let i="",o=!1;return s;function s(c){return(c===72||c===104)&&tp.call(r,r.previous)&&!Na(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(c),e.consume(c),a):n(c)}function a(c){if(ot(c)&&i.length<5)return i+=String.fromCodePoint(c),e.consume(c),a;if(c===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(c),l}return n(c)}function l(c){return c===47?(e.consume(c),o?u:(o=!0,l)):n(c)}function u(c){return c===null||Ri(c)||De(c)||Tn(c)||$i(c)?n(c):e.attempt(Gh,e.attempt(Qh,f),n)(c)}function f(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(c)}}function sA(e,t,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),o):n(s)}function o(s){return s===null?n(s):t(s)}}function aA(e,t,n){let r,i,o;return s;function s(u){return u===46||u===95?e.check(Zh,l,a)(u):u===null||De(u)||Tn(u)||u!==45&&$i(u)?l(u):(o=!0,e.consume(u),s)}function a(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),s}function l(u){return i||r||!o?n(u):t(u)}}function lA(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r<n?o(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(Zh,t,o)(s):s===null||De(s)||Tn(s)?t(s):(e.consume(s),i)}function o(s){return s===41&&r++,e.consume(s),i}}function uA(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),o):a===93?(e.consume(a),i):a===60||a===null||De(a)||Tn(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||De(a)||Tn(a)?t(a):r(a)}function o(a){return ot(a)?s(a):n(a)}function s(a){return a===59?(e.consume(a),r):ot(a)?(e.consume(a),s):n(a)}}function cA(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return tt(o)?n(o):t(o)}}function ep(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||De(e)}function tp(e){return!ot(e)}function np(e){return!(e===47||Da(e))}function Da(e){return e===43||e===45||e===46||e===95||tt(e)}function Na(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 fA={tokenize:bA,partial:!0};function dA(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:gA,continuation:{tokenize:yA},exit:vA}},text:{91:{name:"gfmFootnoteCall",tokenize:mA},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:hA,resolveTo:pA}}}}function hA(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){s=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(!s||!s._balanced)return n(l);const u=Mt(r.sliceSerialize({start:s.end,end:r.now()}));return u.codePointAt(0)!==94||!o.includes(u.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function pA(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 o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function mA(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,s;return a;function a(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),l}function l(c){return c!==94?n(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(c){if(o>999||c===93&&!s||c===null||c===91||De(c))return n(c);if(c===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(Mt(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(c)}return De(c)||(s=!0),o++,e.consume(c),c===92?f:u}function f(c){return c===91||c===92||c===93?(e.consume(c),o++,u):u(c)}}function gA(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,s=0,a;return l;function l(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):n(m)}function f(m){if(s>999||m===93&&!a||m===null||m===91||De(m))return n(m);if(m===93){e.exit("chunkString");const p=e.exit("gfmFootnoteDefinitionLabelString");return o=Mt(r.sliceSerialize(p)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return De(m)||(a=!0),s++,e.consume(m),m===92?c:f}function c(m){return m===91||m===92||m===93?(e.consume(m),s++,f):f(m)}function h(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),i.includes(o)||i.push(o),ke(e,d,"gfmFootnoteDefinitionWhitespace")):n(m)}function d(m){return t(m)}}function yA(e,t,n){return e.check(Rr,t,e.attempt(fA,t,n))}function vA(e){e.exit("gfmFootnoteDefinition")}function bA(e,t,n){const r=this;return ke(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):n(o)}}function wA(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,a){let l=-1;for(;++l<s.length;)if(s[l][0]==="enter"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._close){let u=l;for(;u--;)if(s[u][0]==="exit"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._open&&s[l][1].end.offset-s[l][1].start.offset===s[u][1].end.offset-s[u][1].start.offset){s[l][1].type="strikethroughSequence",s[u][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},s[u][1].start),end:Object.assign({},s[l][1].end)},c={type:"strikethroughText",start:Object.assign({},s[u][1].end),end:Object.assign({},s[l][1].start)},h=[["enter",f,a],["enter",s[u][1],a],["exit",s[u][1],a],["enter",c,a]],d=a.parser.constructs.insideSpan.null;d&&mt(h,h.length,0,Bi(d,s.slice(u+1,l),a)),mt(h,h.length,0,[["exit",c,a],["enter",s[l][1],a],["exit",s[l][1],a],["exit",f,a]]),mt(s,u-1,l-u+3,h),l=u+h.length-2;break}}for(l=-1;++l<s.length;)s[l][1].type==="strikethroughSequenceTemporary"&&(s[l][1].type="data");return s}function o(s,a,l){const u=this.previous,f=this.events;let c=0;return h;function h(m){return u===126&&f[f.length-1][1].type!=="characterEscape"?l(m):(s.enter("strikethroughSequenceTemporary"),d(m))}function d(m){const p=qn(u);if(m===126)return c>1?l(m):(s.consume(m),c++,d);if(c<2&&!n)return l(m);const g=s.exit("strikethroughSequenceTemporary"),y=qn(m);return g._open=!y||y===2&&!!p,g._close=!p||p===2&&!!y,a(m)}}}class SA{constructor(){this.map=[]}add(t,n,r){xA(this,t,n,r)}consume(t){if(this.map.sort(function(o,s){return o[0]-s[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.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function xA(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 kA(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 o=r.length-1;r[o]=r[o]==="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 EA(){return{flow:{null:{name:"table",tokenize:CA,resolveAll:AA}}}}function CA(e,t,n){const r=this;let i=0,o=0,s;return a;function a(T){let O=r.events.length-1;for(;O>-1;){const L=r.events[O][1].type;if(L==="lineEnding"||L==="linePrefix")O--;else break}const U=O>-1?r.events[O][1].type:null,F=U==="tableHead"||U==="tableRow"?C:l;return F===C&&r.parser.lazy[r.now().line]?n(T):F(T)}function l(T){return e.enter("tableHead"),e.enter("tableRow"),u(T)}function u(T){return T===124||(s=!0,o+=1),f(T)}function f(T){return T===null?n(T):ce(T)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),d):n(T):ve(T)?ke(e,f,"whitespace")(T):(o+=1,s&&(s=!1,i+=1),T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),s=!0,f):(e.enter("data"),c(T)))}function c(T){return T===null||T===124||De(T)?(e.exit("data"),f(T)):(e.consume(T),T===92?h:c)}function h(T){return T===92||T===124?(e.consume(T),c):c(T)}function d(T){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(T):(e.enter("tableDelimiterRow"),s=!1,ve(T)?ke(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):m(T))}function m(T){return T===45||T===58?g(T):T===124?(s=!0,e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),p):S(T)}function p(T){return ve(T)?ke(e,g,"whitespace")(T):g(T)}function g(T){return T===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),y):T===45?(o+=1,y(T)):T===null||ce(T)?E(T):S(T)}function y(T){return T===45?(e.enter("tableDelimiterFiller"),v(T)):S(T)}function v(T){return T===45?(e.consume(T),v):T===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),w):(e.exit("tableDelimiterFiller"),w(T))}function w(T){return ve(T)?ke(e,E,"whitespace")(T):E(T)}function E(T){return T===124?m(T):T===null||ce(T)?!s||i!==o?S(T):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(T)):S(T)}function S(T){return n(T)}function C(T){return e.enter("tableRow"),I(T)}function I(T){return T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),I):T===null||ce(T)?(e.exit("tableRow"),t(T)):ve(T)?ke(e,I,"whitespace")(T):(e.enter("data"),M(T))}function M(T){return T===null||T===124||De(T)?(e.exit("data"),I(T)):(e.consume(T),T===92?P:M)}function P(T){return T===92||T===124?(e.consume(T),M):M(T)}}function AA(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],a=!1,l=0,u,f,c;const h=new SA;for(;++n<e.length;){const d=e[n],m=d[1];d[0]==="enter"?m.type==="tableHead"?(a=!1,l!==0&&(rp(h,t,l,u,f),f=void 0,l=0),u={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",u,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(r=!0,c=void 0,o=[0,0,0,0],s=[0,n+1,0,0],a&&(a=!1,f={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",f,t]])),i=m.type==="tableDelimiterRow"?2:f?3:1):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(o[1]!==0&&(s[0]=s[1],c=Zi(h,t,o,i,void 0,c),o=[0,0,0,0]),s[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(s[0]=s[1],c=Zi(h,t,o,i,void 0,c)),o=s,s=[o[1],n,0,0])):m.type==="tableHead"?(a=!0,l=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(l=n,o[1]!==0?(s[0]=s[1],c=Zi(h,t,o,i,n,c)):s[1]!==0&&(c=Zi(h,t,s,i,n,c)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(s[3]=n)}for(l!==0&&rp(h,t,l,u,f),h.consume(t.events),n=-1;++n<t.events.length;){const d=t.events[n];d[0]==="enter"&&d[1].type==="table"&&(d[1]._align=kA(t.events,n))}return e}function Zi(e,t,n,r,i,o){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(o.end=Object.assign({},Kn(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const l=Kn(t.events,n[1]);if(o={type:s,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const u=Kn(t.events,n[2]),f=Kn(t.events,n[3]),c={type:a,start:Object.assign({},u),end:Object.assign({},f)};if(e.add(n[2],0,[["enter",c,t]]),r!==2){const h=t.events[n[2]],d=t.events[n[3]];if(h[1].end=Object.assign({},d[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,p=n[3]-n[2]-1;e.add(m,p,[])}}e.add(n[3]+1,0,[["exit",c,t]])}return i!==void 0&&(o.end=Object.assign({},Kn(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function rp(e,t,n,r,i){const o=[],s=Kn(t.events,n);i&&(i.end=Object.assign({},s),o.push(["exit",i,t])),r.end=Object.assign({},s),o.push(["exit",r,t]),e.add(n+1,0,o)}function Kn(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const TA={name:"tasklistCheck",tokenize:OA};function IA(){return{text:{91:TA}}}function OA(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"),o)}function o(l){return De(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),s):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),s):n(l)}function s(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return ce(l)?t(l):ve(l)?e.check({tokenize:MA},t,n)(l):n(l)}}function MA(e,t,n){return ke(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function DA(e){return Od([nA(),dA(),wA(e),EA(),IA()])}const NA={};function _A(e){const t=this,n=e||NA,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(DA(n)),o.push(JC()),s.push(XC(n))}const me={container:{className:"bpReset bpContainer bpFont",dropzone:{overlay:{className:"bpDropzoneOverlay"}}},loader:{className:"bpReset bpLoader"},modal:{overlay:{className:"bpModalOverlay"},dialog:{container:{className:"bpReset bpModalContainer"},title:{className:"bpModalTitle"},description:{className:"bpModalDescription"},content:{container:{className:"bpModalContentContainer"},textarea:{className:"bpModalContentTextArea"}},button:{container:{className:"bpModalButtonContainer"},confirm:{className:"bpModalButtonConfirm"},cancel:{className:"bpModalButtonCancel"}}}},messagePreview:{container:{className:"bpMessagePreviewContainer"},message:{className:"bpMessagePreviewMessage"},description:{className:"bpMessagePreviewDescription"},closeButton:{className:"bpMessagePreviewCloseButton"},avatar:{container:{className:"bpMessagePreviewAvatarContainer"},image:{className:"bpMessagePreviewAvatarImage"},fallback:{className:"bpMessagePreviewAvatarFallback"}}},fab:{container:{className:"bpReset bpFabContainer"},icon:{className:"bpFabIcon"},image:{className:"bpFabImage"}},notification:{container:{className:"bpReset bpNotificationContainer"},title:{className:"bpNotificationTitle"},description:{className:"bpNotificationDescription"},icon:{className:"bpNotificationIcon"},closeIcon:{className:"bpNotificationCloseIcon"}},header:{container:{className:"bpReset bpHeaderContainer bpFont"},content:{container:{className:"bpReset bpHeaderContentContainer"},conversationHistory:{className:"bpHeaderConversationHistoryButton"},title:{className:"bpHeaderContentTitle"},description:{className:"bpHeaderContentDescription"},avatar:{container:{className:"bpReset bpHeaderContentAvatarContainer"},image:{className:"bpHeaderContentAvatarImage"},fallback:{className:"bpHeaderContentAvatarFallback"}},toggleSound:{className:"bpHeaderSoundToggleButton"},actions:{container:{className:"bpReset bpHeaderContentActionsContainer"},icons:{className:"bpHeaderContentActionsIcons"}}},expandedContent:{container:{className:"bpReset bpHeaderExpandedContentContainer"},descriptionItems:{container:{className:"bpReset bpHeaderExpandedContentDescriptionItemsContainer"},icon:{className:"bpHeaderExpandedContentDescriptionItemsIcon"},text:{className:"bpHeaderExpandedContentDescriptionItemsText"},link:{className:"bpHeaderExpandedContentDescriptionItemsLink"}},group:{className:"bpHeaderExpandedContentGroup"}},newConversationIcon:{className:"bpHeaderNewConversationIcon"}},composer:{wrapper:{className:"bpReset bpComposerWrapper"},container:{className:"bpReset bpComposerContainer bpFont"},footer:{className:"bpComposerFooter"},inputContainer:{className:"bpComposerInputContainer"},input:{className:"bpComposerInput"},inputLoader:{className:"bpComposerInputLoader"},sendbutton:{className:"bpComposerSendButton"},uploadButton:{className:"bpComposerUploadButton"},voiceButton:{className:"bpComposerVoiceButton"},fileContainer:{className:"bpComposerFileContainer"},fileWidget:{container:{className:"bpComposerFileAttachement"},loader:{className:"bpComposerFileLoader"},fileIcon:{container:{className:"bpComposerFileIconWrapper"},icon:{className:"bpComposerFileIcon"}},metadata:{container:{className:"bpComposerFileMetadata"},name:{className:"bpComposerFileName"},type:{className:"bpComposerFileExtension"}},removeIcon:{className:"bpComposerFileRemoveIcon"},errorIcon:{className:"bpComposerFileErrorIcon"},previewImage:{className:"bpComposerFilePreviewImage"}}},messageList:{scrollDownButton:{className:"bpMessageListScrollDownButton"},container:{className:"bpReset bpMessageListContainer bpFont"},viewPort:{className:"bpMessageListViewport"},marquee:{container:{className:"bpReset bpMessageListMarqueeContainer"},content:{className:"bpMessageListMarqueeContent"},title:{className:"bpMessageListMarqueeTitle"},description:{className:"bpMessageListMarqueeDescription"},avatar:{container:{className:"bpReset bpMessageListMarqueeAvatarContainer"},image:{className:"bpMessageListMarqueeAvatarImage"},fallback:{className:"bpMessageListMarqueeAvatarFallback"}}},headerMessage:{className:"bpMessageListHeaderMessage"}},message:{container:{className:"bpReset bpMessageContainer"},avatar:{container:{className:"bpReset bpMessageAvatarContainer"},image:{className:"bpMessageAvatarImage"},fallback:{className:"bpMessageAvatarFallback"}},deliveryStatus:{className:"bpMessageDeliveryStatus"},blocks:{text:{heading1:{className:"bpMessageBlocksTextHeading1"},heading2:{className:"bpMessageBlocksTextHeading2"},heading3:{className:"bpMessageBlocksTextHeading3"},heading4:{className:"bpMessageBlocksTextHeading4"},unorderedList:{className:"bpMessageBlocksTextUnorderedList"},orderedList:{className:"bpMessageBlocksTextOrderedList"},listItem:{className:"bpMessageBlocksTextListItem"},link:{className:"bpMessageBlocksTextLink"},italic:{className:"bpMessageBlocksTextItalic"},bold:{className:"bpMessageBlocksTextBold"},text:{className:"bpMessageBlocksTextText"},image:{className:"bpMessageBlocksTextImage"},imageError:{className:"bpMessageBlocksTextImageError"},horizontalRule:{className:"bpMessageBlocksTextHorizontalRule"},lineBreak:{className:"bpMessageBlocksTextLineBreak"},input:{className:"bpMessageBlocksTextInput"},codeBlockContainer:{className:"bpMessageBlocksTextCodeBlockContainer"},codeBlockTitle:{className:"bpMessageBlocksTextCodeBlockTitle"},codeBlockCopyIcon:{className:"bpMessageBlocksTextCodeBlockCopyIcon"},codeBlock:{className:"bpMessageBlocksTextCodeBlock"},code:{className:"bpMessageBlocksTextCode"},tableContainer:{className:"bpMessageBlocksTextTableContainer"},table:{className:"bpMessageBlocksTextTable"},tableHeader:{className:"bpMessageBlocksTextTableHeader"},tableData:{className:"bpMessageBlocksTextTableData"},tableRow:{className:"bpMessageBlocksTextTableRow"}},audio:{className:"bpMessageBlocksAudio"},image:{image:{className:"bpMessageBlocksImageImage"},placeholder:{className:"bpMessageBlocksImagePlaceholder"},skeleton:{className:"bpSkeleton"}},video:{className:"bpMessageBlocksVideo"},location:{container:{className:"bpMessageBlocksLocationContainer"},title:{className:"bpMessageBlocksLocationTitle"},icon:{className:"bpMessageBlocksLocationIcon"}},file:{container:{className:"bpMessageBlocksFileContainer"},title:{className:"bpMessageBlocksFileTitle"},icon:{className:"bpMessageBlocksFileIcon"}},row:{className:"bpMessageBlocksRow"},column:{className:"bpMessageBlocksColumn"},bubble:{container:{className:"bpMessageBlocksBubble"},feedbackContainer:{className:"bpMessageBlocksBubbleFeedbackContainer"},feedbackIcon:{className:"bpMessageBlocksBubbleFeedbackIcon"}},carousel:{container:{className:"bpMessageBlocksCarouselContainer"},slidesContainer:{className:"bpMessageBlocksCarouselSlidesContainer"},backButton:{className:"bpMessageBlocksCarouselBackButton"},nextButton:{className:"bpMessageBlocksCarouselNextButton"}},dropdown:{button:{container:{className:"bpMessageBlocksDropdownButtonContainer"},text:{className:"bpMessageBlocksDropdownButtonText"},icon:{className:"bpMessageBlocksDropdownButtonIcon"}},content:{container:{className:"bpMessageBlocksDropdownContentContainer"},item:{className:"bpMessageBlocksDropdownContentItem"}}},button:{className:"bpMessageBlocksButton"}}},error:{container:{className:"bpReset bpErrorContainer"},id:{className:"bpErrorId"},header:{container:{className:"bpErrorHeader"},actions:{className:"bpErrorHeaderActions"}},content:{className:"bpErrorContent"},errorTitle:{className:"bpErrorTitle"},errorMessage:{className:"bpErrorMessage"},icon:{className:"bpErrorIcon"}},typingIndicator:{container:{className:"bpTypingIndicatorContainer"},loader:{className:"bpTypingIndicatorLoader"}},proactiveBubble:{container:{className:"bpProactiveBubbleContainer"},content:{className:"bpProactiveBubbleContent"},layout:{className:"bpProactiveBubbleLayout"},icon:{className:"bpProactiveBubbleIcon"},message:{className:"bpProactiveBubbleMessage"},closeButton:{className:"bpProactiveBubbleCloseButton"},arrow:{className:"bpProactiveBubbleArrow"}},conversationHistory:{container:{className:"bpReset bpConversationHistoryContainer bpFont"},header:{className:"bpConversationHistoryHeader"},closeButton:{className:"bpConversationHistoryCloseButton"},scrollContainer:{className:"bpConversationHistoryScrollContainer"},loaderContainer:{className:"bpConversationHistoryLoaderContainer"},conversation:{container:{className:"bpConversationHistoryConversationContainer"},chevron:{className:"bpConversationHistoryConversationChevron"},userAvatar:{className:{className:"bpConversationHistoryConversationUserAvatarFallback"}},avatar:{container:{className:"bpReset bpConversationHistoryConversationAvatarContainer"},image:{className:"bpConversationHistoryConversationAvatarImage"},fallback:{className:"bpConversationHistoryConversationAvatarFallback"}},content:{className:"bpConversationHistoryConversationContent"},name:{className:"bpConversationHistoryConversationName"},timestamp:{className:"bpConversationHistoryConversationTimestamp"}},newConversation:{button:{className:"bpConversationHistoryNewConversationButton"},icon:{className:"bpConversationHistoryNewConversationButtonIcon"}}}};/**
52
+ `,...o.current()});return/^[\t ]/.test(u)&&(u=Vr(u.charCodeAt(0))+u.slice(1)),u=u?s+" "+u:s,n.options.closeAtx&&(u+=" "+s),l(),a(),u}_h.peek=dC;function _h(e){return e.value||""}function dC(){return"<"}Ph.peek=hC;function Ph(e,t,n,r){const i=Aa(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let a=n.enter("label");const l=n.createTracker(r);let u=l.move("![");return u+=l.move(n.safe(e.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(a=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),a(),e.title&&(a=n.enter(`title${o}`),u+=l.move(" "+i),u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),a()),u+=l.move(")"),s(),u}function hC(){return"!"}Lh.peek=pC;function Lh(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let s=n.enter("label");const a=n.createTracker(r);let l=a.move("![");const u=n.safe(e.alt,{before:l,after:"]",...a.current()});l+=a.move(u+"]["),s();const f=n.stack;n.stack=[],s=n.enter("reference");const c=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return s(),n.stack=f,o(),i==="full"||!u||u!==c?l+=a.move(c+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function pC(){return"!"}Fh.peek=mC;function Fh(e,t,n){let r=e.value||"",i="`",o=-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+" ");++o<n.unsafe.length;){const s=n.unsafe[o],a=n.compilePattern(s);let l;if(s.atBreak)for(;l=a.exec(r);){let u=l.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(l.index+1)}}return i+r+i}function mC(){return"`"}function Rh(e,t){const n=Xs(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))}$h.peek=gC;function $h(e,t,n,r){const i=Aa(n),o=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let a,l;if(Rh(e,n)){const f=n.stack;n.stack=[],a=n.enter("autolink");let c=s.move("<");return c+=s.move(n.containerPhrasing(e,{before:c,after:">",...s.current()})),c+=s.move(">"),a(),n.stack=f,c}a=n.enter("link"),l=n.enter("label");let u=s.move("[");return u+=s.move(n.containerPhrasing(e,{before:u,after:"](",...s.current()})),u+=s.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=s.move("<"),u+=s.move(n.safe(e.url,{before:u,after:">",...s.current()})),u+=s.move(">")):(l=n.enter("destinationRaw"),u+=s.move(n.safe(e.url,{before:u,after:e.title?" ":")",...s.current()}))),l(),e.title&&(l=n.enter(`title${o}`),u+=s.move(" "+i),u+=s.move(n.safe(e.title,{before:u,after:i,...s.current()})),u+=s.move(i),l()),u+=s.move(")"),a(),u}function gC(e,t,n){return Rh(e,n)?"<":"["}Bh.peek=yC;function Bh(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let s=n.enter("label");const a=n.createTracker(r);let l=a.move("[");const u=n.containerPhrasing(e,{before:l,after:"]",...a.current()});l+=a.move(u+"]["),s();const f=n.stack;n.stack=[],s=n.enter("reference");const c=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return s(),n.stack=f,o(),i==="full"||!u||u!==c?l+=a.move(c+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function yC(){return"["}function Ta(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=Ta(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 zh(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"),o=n.bulletCurrent;let s=e.ordered?bC(n):Ta(n);const a=e.ordered?s==="."?")":".":vC(n);let l=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&f&&(!f.children||!f.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),zh(n)===s&&f){let c=-1;for(;++c<e.children.length;){const h=e.children[c];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(s=a),n.bulletCurrent=s;const u=n.containerFlow(e,r);return n.bulletLastUsed=s,n.bulletCurrent=o,i(),u}function SC(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 xC(e,t,n,r){const i=SC(n);let o=n.bulletCurrent||Ta(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let s=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const a=n.createTracker(r);a.move(o+" ".repeat(s-o.length)),a.shift(s);const l=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,a.current()),f);return l(),u;function f(c,h,d){return h?(d?"":" ".repeat(s))+c:(d?o:o+" ".repeat(s-o.length))+c}}function kC(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),s=n.containerPhrasing(e,r);return o(),i(),s}const EC=qi(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function CC(e,t,n,r){return(e.children.some(function(s){return EC(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function AC(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Uh.peek=TC;function Uh(e,t,n,r){const i=AC(n),o=n.enter("strong"),s=n.createTracker(r),a=s.move(i+i);let l=s.move(n.containerPhrasing(e,{after:i,before:a,...s.current()}));const u=l.charCodeAt(0),f=Qi(r.before.charCodeAt(r.before.length-1),u,i);f.inside&&(l=Vr(u)+l.slice(1));const c=l.charCodeAt(l.length-1),h=Qi(r.after.charCodeAt(0),c,i);h.inside&&(l=l.slice(0,-1)+Vr(c));const d=s.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:f.outside},a+l+d}function TC(e,t,n){return n.options.strong||"*"}function IC(e,t,n,r){return n.safe(e.value,r)}function OC(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 MC(e,t,n){const r=(zh(n)+(n.options.ruleSpaces?" ":"")).repeat(OC(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Hh={blockquote:XE,break:Dh,code:oC,definition:aC,emphasis:Nh,hardBreak:Dh,heading:fC,html:_h,image:Ph,imageReference:Lh,inlineCode:Fh,link:$h,linkReference:Bh,list:wC,listItem:xC,paragraph:kC,root:CC,strong:Uh,text:IC,thematicBreak:MC};function DC(){return{enter:{table:NC,tableData:jh,tableHeader:jh,tableRow:PC},exit:{codeText:LC,table:_C,tableData:Ia,tableHeader:Ia,tableRow:Ia}}}function NC(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 PC(e){this.enter({type:"tableRow",children:[]},e)}function Ia(e){this.exit(e)}function jh(e){this.enter({type:"tableCell",children:[]},e)}function LC(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,FC));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function FC(e,t){return t==="|"?t:e}function RC(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=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:s,tableCell:l,tableRow:a}};function s(d,m,p,g){return u(f(d,p,g),d.align)}function a(d,m,p,g){const v=c(d,p,g),y=u([v]);return y.slice(0,y.indexOf(`
54
+ `))}function l(d,m,p,g){const v=p.enter("tableCell"),y=p.enter("phrasing"),w=p.containerPhrasing(d,{...g,before:o,after:o});return y(),v(),w}function u(d,m){return ZE(d,{align:m,alignDelimiters:r,padding:n,stringLength:i})}function f(d,m,p){const g=d.children;let v=-1;const y=[],w=m.enter("table");for(;++v<g.length;)y[v]=c(g[v],m,p);return w(),y}function c(d,m,p){const g=d.children;let v=-1;const y=[],w=m.enter("tableRow");for(;++v<g.length;)y[v]=l(g[v],d,m,p);return w(),y}function h(d,m,p){let g=Hh.inlineCode(d,m,p);return p.stack.includes("tableCell")&&(g=g.replace(/\|/g,"\\$&")),g}}function $C(){return{exit:{taskListCheckValueChecked:Vh,taskListCheckValueUnchecked:Vh,paragraph:zC}}}function BC(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:UC}}}function Vh(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function zC(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 o=-1,s;for(;++o<i.length;){const a=i[o];if(a.type==="paragraph"){s=a;break}}s===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],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);o&&a.move(s);let l=Hh.listItem(e,t,n,{...r,...a.current()});return o&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),l;function u(f){return f+s}}function HC(){return[wE(),UE(),WE(),DC(),$C()]}function jC(e){return{extensions:[SE(),HE(e),qE(),RC(e),BC()]}}const VC={tokenize:QC,partial:!0},Wh={tokenize:ZC,partial:!0},qh={tokenize:JC,partial:!0},Yh={tokenize:XC,partial:!0},WC={tokenize:eA,partial:!0},Kh={name:"wwwAutolink",tokenize:KC,previous:Qh},Gh={name:"protocolAutolink",tokenize:GC,previous:Zh},Kt={name:"emailAutolink",tokenize:YC,previous:Jh},Bt={};function qC(){return{text:Bt}}let In=48;for(;In<123;)Bt[In]=Kt,In++,In===58?In=65:In===91&&(In=97);Bt[43]=Kt,Bt[45]=Kt,Bt[46]=Kt,Bt[95]=Kt,Bt[72]=[Kt,Gh],Bt[104]=[Kt,Gh],Bt[87]=[Kt,Kh],Bt[119]=[Kt,Kh];function YC(e,t,n){const r=this;let i,o;return s;function s(c){return!Oa(c)||!Jh.call(r,r.previous)||Ma(r.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(c))}function a(c){return Oa(c)?(e.consume(c),a):c===64?(e.consume(c),l):n(c)}function l(c){return c===46?e.check(WC,f,u)(c):c===45||c===95||tt(c)?(o=!0,e.consume(c),l):f(c)}function u(c){return e.consume(c),i=!0,l}function f(c){return o&&i&&ot(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(c)):n(c)}}function KC(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!Qh.call(r,r.previous)||Ma(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(VC,e.attempt(Wh,e.attempt(qh,o),n),n)(s))}function o(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function GC(e,t,n){const r=this;let i="",o=!1;return s;function s(c){return(c===72||c===104)&&Zh.call(r,r.previous)&&!Ma(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(c),e.consume(c),a):n(c)}function a(c){if(ot(c)&&i.length<5)return i+=String.fromCodePoint(c),e.consume(c),a;if(c===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(c),l}return n(c)}function l(c){return c===47?(e.consume(c),o?u:(o=!0,l)):n(c)}function u(c){return c===null||Ri(c)||De(c)||Tn(c)||$i(c)?n(c):e.attempt(Wh,e.attempt(qh,f),n)(c)}function f(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(c)}}function QC(e,t,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),o):n(s)}function o(s){return s===null?n(s):t(s)}}function ZC(e,t,n){let r,i,o;return s;function s(u){return u===46||u===95?e.check(Yh,l,a)(u):u===null||De(u)||Tn(u)||u!==45&&$i(u)?l(u):(o=!0,e.consume(u),s)}function a(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),s}function l(u){return i||r||!o?n(u):t(u)}}function JC(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r<n?o(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(Yh,t,o)(s):s===null||De(s)||Tn(s)?t(s):(e.consume(s),i)}function o(s){return s===41&&r++,e.consume(s),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),o):a===93?(e.consume(a),i):a===60||a===null||De(a)||Tn(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||De(a)||Tn(a)?t(a):r(a)}function o(a){return ot(a)?s(a):n(a)}function s(a){return a===59?(e.consume(a),r):ot(a)?(e.consume(a),s):n(a)}}function eA(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return tt(o)?n(o):t(o)}}function Qh(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||De(e)}function Zh(e){return!ot(e)}function Jh(e){return!(e===47||Oa(e))}function Oa(e){return e===43||e===45||e===46||e===95||tt(e)}function Ma(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 tA={tokenize:uA,partial:!0};function nA(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:sA,continuation:{tokenize:aA},exit:lA}},text:{91:{name:"gfmFootnoteCall",tokenize:oA},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:rA,resolveTo:iA}}}}function rA(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){s=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(!s||!s._balanced)return n(l);const u=Mt(r.sliceSerialize({start:s.end,end:r.now()}));return u.codePointAt(0)!==94||!o.includes(u.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function iA(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 o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function oA(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,s;return a;function a(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),l}function l(c){return c!==94?n(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(c){if(o>999||c===93&&!s||c===null||c===91||De(c))return n(c);if(c===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(Mt(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(c)}return De(c)||(s=!0),o++,e.consume(c),c===92?f:u}function f(c){return c===91||c===92||c===93?(e.consume(c),o++,u):u(c)}}function sA(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,s=0,a;return l;function l(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):n(m)}function f(m){if(s>999||m===93&&!a||m===null||m===91||De(m))return n(m);if(m===93){e.exit("chunkString");const p=e.exit("gfmFootnoteDefinitionLabelString");return o=Mt(r.sliceSerialize(p)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return De(m)||(a=!0),s++,e.consume(m),m===92?c:f}function c(m){return m===91||m===92||m===93?(e.consume(m),s++,f):f(m)}function h(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),i.includes(o)||i.push(o),ke(e,d,"gfmFootnoteDefinitionWhitespace")):n(m)}function d(m){return t(m)}}function aA(e,t,n){return e.check($r,t,e.attempt(tA,t,n))}function lA(e){e.exit("gfmFootnoteDefinition")}function uA(e,t,n){const r=this;return ke(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):n(o)}}function cA(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,a){let l=-1;for(;++l<s.length;)if(s[l][0]==="enter"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._close){let u=l;for(;u--;)if(s[u][0]==="exit"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._open&&s[l][1].end.offset-s[l][1].start.offset===s[u][1].end.offset-s[u][1].start.offset){s[l][1].type="strikethroughSequence",s[u][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},s[u][1].start),end:Object.assign({},s[l][1].end)},c={type:"strikethroughText",start:Object.assign({},s[u][1].end),end:Object.assign({},s[l][1].start)},h=[["enter",f,a],["enter",s[u][1],a],["exit",s[u][1],a],["enter",c,a]],d=a.parser.constructs.insideSpan.null;d&&mt(h,h.length,0,Bi(d,s.slice(u+1,l),a)),mt(h,h.length,0,[["exit",c,a],["enter",s[l][1],a],["exit",s[l][1],a],["exit",f,a]]),mt(s,u-1,l-u+3,h),l=u+h.length-2;break}}for(l=-1;++l<s.length;)s[l][1].type==="strikethroughSequenceTemporary"&&(s[l][1].type="data");return s}function o(s,a,l){const u=this.previous,f=this.events;let c=0;return h;function h(m){return u===126&&f[f.length-1][1].type!=="characterEscape"?l(m):(s.enter("strikethroughSequenceTemporary"),d(m))}function d(m){const p=qn(u);if(m===126)return c>1?l(m):(s.consume(m),c++,d);if(c<2&&!n)return l(m);const g=s.exit("strikethroughSequenceTemporary"),v=qn(m);return g._open=!v||v===2&&!!p,g._close=!p||p===2&&!!v,a(m)}}}class fA{constructor(){this.map=[]}add(t,n,r){dA(this,t,n,r)}consume(t){if(this.map.sort(function(o,s){return o[0]-s[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.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function dA(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 hA(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 o=r.length-1;r[o]=r[o]==="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 pA(){return{flow:{null:{name:"table",tokenize:mA,resolveAll:gA}}}}function mA(e,t,n){const r=this;let i=0,o=0,s;return a;function a(T){let O=r.events.length-1;for(;O>-1;){const F=r.events[O][1].type;if(F==="lineEnding"||F==="linePrefix")O--;else break}const B=O>-1?r.events[O][1].type:null,L=B==="tableHead"||B==="tableRow"?E:l;return L===E&&r.parser.lazy[r.now().line]?n(T):L(T)}function l(T){return e.enter("tableHead"),e.enter("tableRow"),u(T)}function u(T){return T===124||(s=!0,o+=1),f(T)}function f(T){return T===null?n(T):ce(T)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),d):n(T):ve(T)?ke(e,f,"whitespace")(T):(o+=1,s&&(s=!1,i+=1),T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),s=!0,f):(e.enter("data"),c(T)))}function c(T){return T===null||T===124||De(T)?(e.exit("data"),f(T)):(e.consume(T),T===92?h:c)}function h(T){return T===92||T===124?(e.consume(T),c):c(T)}function d(T){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(T):(e.enter("tableDelimiterRow"),s=!1,ve(T)?ke(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):m(T))}function m(T){return T===45||T===58?g(T):T===124?(s=!0,e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),p):k(T)}function p(T){return ve(T)?ke(e,g,"whitespace")(T):g(T)}function g(T){return T===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),v):T===45?(o+=1,v(T)):T===null||ce(T)?A(T):k(T)}function v(T){return T===45?(e.enter("tableDelimiterFiller"),y(T)):k(T)}function y(T){return T===45?(e.consume(T),y):T===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),w):(e.exit("tableDelimiterFiller"),w(T))}function w(T){return ve(T)?ke(e,A,"whitespace")(T):A(T)}function A(T){return T===124?m(T):T===null||ce(T)?!s||i!==o?k(T):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(T)):k(T)}function k(T){return n(T)}function E(T){return e.enter("tableRow"),I(T)}function I(T){return T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),I):T===null||ce(T)?(e.exit("tableRow"),t(T)):ve(T)?ke(e,I,"whitespace")(T):(e.enter("data"),D(T))}function D(T){return T===null||T===124||De(T)?(e.exit("data"),I(T)):(e.consume(T),T===92?P:D)}function P(T){return T===92||T===124?(e.consume(T),D):D(T)}}function gA(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],a=!1,l=0,u,f,c;const h=new fA;for(;++n<e.length;){const d=e[n],m=d[1];d[0]==="enter"?m.type==="tableHead"?(a=!1,l!==0&&(Xh(h,t,l,u,f),f=void 0,l=0),u={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",u,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(r=!0,c=void 0,o=[0,0,0,0],s=[0,n+1,0,0],a&&(a=!1,f={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",f,t]])),i=m.type==="tableDelimiterRow"?2:f?3:1):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(o[1]!==0&&(s[0]=s[1],c=Zi(h,t,o,i,void 0,c),o=[0,0,0,0]),s[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(s[0]=s[1],c=Zi(h,t,o,i,void 0,c)),o=s,s=[o[1],n,0,0])):m.type==="tableHead"?(a=!0,l=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(l=n,o[1]!==0?(s[0]=s[1],c=Zi(h,t,o,i,n,c)):s[1]!==0&&(c=Zi(h,t,s,i,n,c)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(s[3]=n)}for(l!==0&&Xh(h,t,l,u,f),h.consume(t.events),n=-1;++n<t.events.length;){const d=t.events[n];d[0]==="enter"&&d[1].type==="table"&&(d[1]._align=hA(t.events,n))}return e}function Zi(e,t,n,r,i,o){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(o.end=Object.assign({},Kn(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const l=Kn(t.events,n[1]);if(o={type:s,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const u=Kn(t.events,n[2]),f=Kn(t.events,n[3]),c={type:a,start:Object.assign({},u),end:Object.assign({},f)};if(e.add(n[2],0,[["enter",c,t]]),r!==2){const h=t.events[n[2]],d=t.events[n[3]];if(h[1].end=Object.assign({},d[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,p=n[3]-n[2]-1;e.add(m,p,[])}}e.add(n[3]+1,0,[["exit",c,t]])}return i!==void 0&&(o.end=Object.assign({},Kn(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function Xh(e,t,n,r,i){const o=[],s=Kn(t.events,n);i&&(i.end=Object.assign({},s),o.push(["exit",i,t])),r.end=Object.assign({},s),o.push(["exit",r,t]),e.add(n+1,0,o)}function Kn(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const yA={name:"tasklistCheck",tokenize:bA};function vA(){return{text:{91:yA}}}function bA(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"),o)}function o(l){return De(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),s):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),s):n(l)}function s(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return ce(l)?t(l):ve(l)?e.check({tokenize:wA},t,n)(l):n(l)}}function wA(e,t,n){return ke(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function SA(e){return Cd([qC(),nA(),cA(e),pA(),vA()])}const xA={};function kA(e){const t=this,n=e||xA,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(SA(n)),o.push(HC()),s.push(jC(n))}const ye={container:{className:"bpReset bpContainer bpFont",dropzone:{overlay:{className:"bpDropzoneOverlay"}}},loader:{className:"bpReset bpLoader"},modal:{overlay:{className:"bpModalOverlay"},dialog:{container:{className:"bpReset bpModalContainer"},title:{className:"bpModalTitle"},description:{className:"bpModalDescription"},content:{container:{className:"bpModalContentContainer"},textarea:{className:"bpModalContentTextArea"}},button:{container:{className:"bpModalButtonContainer"},confirm:{className:"bpModalButtonConfirm"},cancel:{className:"bpModalButtonCancel"}}}},messagePreview:{container:{className:"bpMessagePreviewContainer"},message:{className:"bpMessagePreviewMessage"},description:{className:"bpMessagePreviewDescription"},closeButton:{className:"bpMessagePreviewCloseButton"},avatar:{container:{className:"bpMessagePreviewAvatarContainer"},image:{className:"bpMessagePreviewAvatarImage"},fallback:{className:"bpMessagePreviewAvatarFallback"}}},fab:{container:{className:"bpReset bpFabContainer"},icon:{className:"bpFabIcon"},image:{className:"bpFabImage"}},notification:{container:{className:"bpReset bpNotificationContainer"},title:{className:"bpNotificationTitle"},description:{className:"bpNotificationDescription"},icon:{className:"bpNotificationIcon"},closeIcon:{className:"bpNotificationCloseIcon"}},header:{container:{className:"bpReset bpHeaderContainer bpFont"},content:{container:{className:"bpReset bpHeaderContentContainer"},conversationHistory:{className:"bpHeaderConversationHistoryButton"},title:{className:"bpHeaderContentTitle"},description:{className:"bpHeaderContentDescription"},avatar:{container:{className:"bpReset bpHeaderContentAvatarContainer"},image:{className:"bpHeaderContentAvatarImage"},fallback:{className:"bpHeaderContentAvatarFallback"}},toggleSound:{className:"bpHeaderSoundToggleButton"},actions:{container:{className:"bpReset bpHeaderContentActionsContainer"},icons:{className:"bpHeaderContentActionsIcons"}}},expandedContent:{container:{className:"bpReset bpHeaderExpandedContentContainer"},descriptionItems:{container:{className:"bpReset bpHeaderExpandedContentDescriptionItemsContainer"},icon:{className:"bpHeaderExpandedContentDescriptionItemsIcon"},text:{className:"bpHeaderExpandedContentDescriptionItemsText"},link:{className:"bpHeaderExpandedContentDescriptionItemsLink"}},group:{className:"bpHeaderExpandedContentGroup"}},newConversationIcon:{className:"bpHeaderNewConversationIcon"}},composer:{wrapper:{className:"bpReset bpComposerWrapper"},container:{className:"bpReset bpComposerContainer bpFont"},footer:{className:"bpComposerFooter"},inputContainer:{className:"bpComposerInputContainer"},input:{className:"bpComposerInput"},inputLoader:{className:"bpComposerInputLoader"},sendbutton:{className:"bpComposerSendButton"},uploadButton:{className:"bpComposerUploadButton"},voiceButton:{className:"bpComposerVoiceButton"},fileContainer:{className:"bpComposerFileContainer"},fileWidget:{container:{className:"bpComposerFileAttachement"},loader:{className:"bpComposerFileLoader"},fileIcon:{container:{className:"bpComposerFileIconWrapper"},icon:{className:"bpComposerFileIcon"}},metadata:{container:{className:"bpComposerFileMetadata"},name:{className:"bpComposerFileName"},type:{className:"bpComposerFileExtension"}},removeIcon:{className:"bpComposerFileRemoveIcon"},errorIcon:{className:"bpComposerFileErrorIcon"},previewImage:{className:"bpComposerFilePreviewImage"}}},messageList:{scrollDownButton:{className:"bpMessageListScrollDownButton"},container:{className:"bpReset bpMessageListContainer bpFont"},viewPort:{className:"bpMessageListViewport"},marquee:{container:{className:"bpReset bpMessageListMarqueeContainer"},content:{className:"bpMessageListMarqueeContent"},title:{className:"bpMessageListMarqueeTitle"},description:{className:"bpMessageListMarqueeDescription"},avatar:{container:{className:"bpReset bpMessageListMarqueeAvatarContainer"},image:{className:"bpMessageListMarqueeAvatarImage"},fallback:{className:"bpMessageListMarqueeAvatarFallback"}}},headerMessage:{className:"bpMessageListHeaderMessage"}},message:{container:{className:"bpReset bpMessageContainer"},avatar:{container:{className:"bpReset bpMessageAvatarContainer"},image:{className:"bpMessageAvatarImage"},fallback:{className:"bpMessageAvatarFallback"}},deliveryStatus:{className:"bpMessageDeliveryStatus"},blocks:{text:{heading1:{className:"bpMessageBlocksTextHeading1"},heading2:{className:"bpMessageBlocksTextHeading2"},heading3:{className:"bpMessageBlocksTextHeading3"},heading4:{className:"bpMessageBlocksTextHeading4"},unorderedList:{className:"bpMessageBlocksTextUnorderedList"},orderedList:{className:"bpMessageBlocksTextOrderedList"},listItem:{className:"bpMessageBlocksTextListItem"},link:{className:"bpMessageBlocksTextLink"},italic:{className:"bpMessageBlocksTextItalic"},bold:{className:"bpMessageBlocksTextBold"},text:{className:"bpMessageBlocksTextText"},image:{className:"bpMessageBlocksTextImage"},imageError:{className:"bpMessageBlocksTextImageError"},horizontalRule:{className:"bpMessageBlocksTextHorizontalRule"},lineBreak:{className:"bpMessageBlocksTextLineBreak"},input:{className:"bpMessageBlocksTextInput"},codeBlockContainer:{className:"bpMessageBlocksTextCodeBlockContainer"},codeBlockTitle:{className:"bpMessageBlocksTextCodeBlockTitle"},codeBlockCopyIcon:{className:"bpMessageBlocksTextCodeBlockCopyIcon"},codeBlock:{className:"bpMessageBlocksTextCodeBlock"},code:{className:"bpMessageBlocksTextCode"},tableContainer:{className:"bpMessageBlocksTextTableContainer"},table:{className:"bpMessageBlocksTextTable"},tableHeader:{className:"bpMessageBlocksTextTableHeader"},tableData:{className:"bpMessageBlocksTextTableData"},tableRow:{className:"bpMessageBlocksTextTableRow"}},audio:{className:"bpMessageBlocksAudio"},image:{image:{className:"bpMessageBlocksImageImage"},placeholder:{className:"bpMessageBlocksImagePlaceholder"},skeleton:{className:"bpSkeleton"}},video:{className:"bpMessageBlocksVideo"},location:{container:{className:"bpMessageBlocksLocationContainer"},title:{className:"bpMessageBlocksLocationTitle"},icon:{className:"bpMessageBlocksLocationIcon"}},file:{container:{className:"bpMessageBlocksFileContainer"},title:{className:"bpMessageBlocksFileTitle"},icon:{className:"bpMessageBlocksFileIcon"}},row:{className:"bpMessageBlocksRow"},column:{className:"bpMessageBlocksColumn"},bubble:{container:{className:"bpMessageBlocksBubble"},feedbackContainer:{className:"bpMessageBlocksBubbleFeedbackContainer"},feedbackIcon:{className:"bpMessageBlocksBubbleFeedbackIcon"}},carousel:{container:{className:"bpMessageBlocksCarouselContainer"},slidesContainer:{className:"bpMessageBlocksCarouselSlidesContainer"},backButton:{className:"bpMessageBlocksCarouselBackButton"},nextButton:{className:"bpMessageBlocksCarouselNextButton"}},dropdown:{button:{container:{className:"bpMessageBlocksDropdownButtonContainer"},text:{className:"bpMessageBlocksDropdownButtonText"},icon:{className:"bpMessageBlocksDropdownButtonIcon"}},content:{container:{className:"bpMessageBlocksDropdownContentContainer"},item:{className:"bpMessageBlocksDropdownContentItem"}}},button:{className:"bpMessageBlocksButton"}}},error:{container:{className:"bpReset bpErrorContainer"},id:{className:"bpErrorId"},header:{container:{className:"bpErrorHeader"},actions:{className:"bpErrorHeaderActions"}},content:{className:"bpErrorContent"},errorTitle:{className:"bpErrorTitle"},errorMessage:{className:"bpErrorMessage"},icon:{className:"bpErrorIcon"}},typingIndicator:{container:{className:"bpTypingIndicatorContainer"},loader:{className:"bpTypingIndicatorLoader"}},proactiveBubble:{container:{className:"bpProactiveBubbleContainer"},content:{className:"bpProactiveBubbleContent"},layout:{className:"bpProactiveBubbleLayout"},icon:{className:"bpProactiveBubbleIcon"},message:{className:"bpProactiveBubbleMessage"},closeButton:{className:"bpProactiveBubbleCloseButton"},arrow:{className:"bpProactiveBubbleArrow"}},conversationHistory:{container:{className:"bpReset bpConversationHistoryContainer bpFont"},header:{className:"bpConversationHistoryHeader"},closeButton:{className:"bpConversationHistoryCloseButton"},scrollContainer:{className:"bpConversationHistoryScrollContainer"},loaderContainer:{className:"bpConversationHistoryLoaderContainer"},conversation:{container:{className:"bpConversationHistoryConversationContainer"},chevron:{className:"bpConversationHistoryConversationChevron"},userAvatar:{className:{className:"bpConversationHistoryConversationUserAvatarFallback"}},avatar:{container:{className:"bpReset bpConversationHistoryConversationAvatarContainer"},image:{className:"bpConversationHistoryConversationAvatarImage"},fallback:{className:"bpConversationHistoryConversationAvatarFallback"}},content:{className:"bpConversationHistoryConversationContent"},name:{className:"bpConversationHistoryConversationName"},timestamp:{className:"bpConversationHistoryConversationTimestamp"}},newConversation:{button:{className:"bpConversationHistoryNewConversationButton"},icon:{className:"bpConversationHistoryNewConversationButtonIcon"}}}};/**
55
55
  * @license lucide-react v0.554.0 - ISC
56
56
  *
57
57
  * This source code is licensed under the ISC license.
58
58
  * See the LICENSE file in the root directory of this source tree.
59
- */const PA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),LA=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),ip=e=>{const t=LA(e);return t.charAt(0).toUpperCase()+t.slice(1)},op=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),FA=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
59
+ */const EA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),CA=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),ep=e=>{const t=CA(e);return t.charAt(0).toUpperCase()+t.slice(1)},tp=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),AA=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
60
60
  * @license lucide-react v0.554.0 - ISC
61
61
  *
62
62
  * This source code is licensed under the ISC license.
63
63
  * See the LICENSE file in the root directory of this source tree.
64
- */var RA={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
64
+ */var TA={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
65
65
  * @license lucide-react v0.554.0 - ISC
66
66
  *
67
67
  * This source code is licensed under the ISC license.
68
68
  * See the LICENSE file in the root directory of this source tree.
69
- */const $A=D.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:s,...a},l)=>D.createElement("svg",{ref:l,...RA,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:op("lucide",i),...!o&&!FA(a)&&{"aria-hidden":"true"},...a},[...s.map(([u,f])=>D.createElement(u,f)),...Array.isArray(o)?o:[o]]));/**
69
+ */const IA=M.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:s,...a},l)=>M.createElement("svg",{ref:l,...TA,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:tp("lucide",i),...!o&&!AA(a)&&{"aria-hidden":"true"},...a},[...s.map(([u,f])=>M.createElement(u,f)),...Array.isArray(o)?o:[o]]));/**
70
70
  * @license lucide-react v0.554.0 - ISC
71
71
  *
72
72
  * This source code is licensed under the ISC license.
73
73
  * See the LICENSE file in the root directory of this source tree.
74
- */const Se=(e,t)=>{const n=D.forwardRef(({className:r,...i},o)=>D.createElement($A,{ref:o,iconNode:t,className:op(`lucide-${PA(ip(e))}`,`lucide-${e}`,r),...i}));return n.displayName=ip(e),n};/**
74
+ */const Se=(e,t)=>{const n=M.forwardRef(({className:r,...i},o)=>M.createElement(IA,{ref:o,iconNode:t,className:tp(`lucide-${EA(ep(e))}`,`lucide-${e}`,r),...i}));return n.displayName=ep(e),n};/**
75
75
  * @license lucide-react v0.554.0 - ISC
76
76
  *
77
77
  * This source code is licensed under the ISC license.
78
78
  * See the LICENSE file in the root directory of this source tree.
79
- */const BA=Se("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
79
+ */const OA=Se("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
80
80
  * @license lucide-react v0.554.0 - ISC
81
81
  *
82
82
  * This source code is licensed under the ISC license.
83
83
  * See the LICENSE file in the root directory of this source tree.
84
- */const sp=Se("bot-off",[["path",{d:"M13.67 8H18a2 2 0 0 1 2 2v4.33",key:"7az073"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M22 22 2 2",key:"1r8tn9"}],["path",{d:"M8 8H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h12a2 2 0 0 0 1.414-.586",key:"s09a7a"}],["path",{d:"M9 13v2",key:"rq6x2g"}],["path",{d:"M9.67 4H12v2.33",key:"110xot"}]]);/**
84
+ */const np=Se("bot-off",[["path",{d:"M13.67 8H18a2 2 0 0 1 2 2v4.33",key:"7az073"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M22 22 2 2",key:"1r8tn9"}],["path",{d:"M8 8H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h12a2 2 0 0 0 1.414-.586",key:"s09a7a"}],["path",{d:"M9 13v2",key:"rq6x2g"}],["path",{d:"M9.67 4H12v2.33",key:"110xot"}]]);/**
85
85
  * @license lucide-react v0.554.0 - ISC
86
86
  *
87
87
  * This source code is licensed under the ISC license.
88
88
  * See the LICENSE file in the root directory of this source tree.
89
- */const zA=Se("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
89
+ */const MA=Se("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
90
90
  * @license lucide-react v0.554.0 - ISC
91
91
  *
92
92
  * This source code is licensed under the ISC license.
93
93
  * See the LICENSE file in the root directory of this source tree.
94
- */const UA=Se("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
94
+ */const DA=Se("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
95
95
  * @license lucide-react v0.554.0 - ISC
96
96
  *
97
97
  * This source code is licensed under the ISC license.
98
98
  * See the LICENSE file in the root directory of this source tree.
99
- */const ap=Se("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
99
+ */const rp=Se("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
100
100
  * @license lucide-react v0.554.0 - ISC
101
101
  *
102
102
  * This source code is licensed under the ISC license.
103
103
  * See the LICENSE file in the root directory of this source tree.
104
- */const lp=Se("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
104
+ */const ip=Se("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
105
105
  * @license lucide-react v0.554.0 - ISC
106
106
  *
107
107
  * This source code is licensed under the ISC license.
108
108
  * See the LICENSE file in the root directory of this source tree.
109
- */const jA=Se("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
109
+ */const NA=Se("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
110
110
  * @license lucide-react v0.554.0 - ISC
111
111
  *
112
112
  * This source code is licensed under the ISC license.
113
113
  * See the LICENSE file in the root directory of this source tree.
114
- */const up=Se("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
114
+ */const op=Se("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
115
115
  * @license lucide-react v0.554.0 - ISC
116
116
  *
117
117
  * This source code is licensed under the ISC license.
118
118
  * See the LICENSE file in the root directory of this source tree.
119
- */const HA=Se("cloud-upload",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]]);/**
119
+ */const _A=Se("cloud-upload",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]]);/**
120
120
  * @license lucide-react v0.554.0 - ISC
121
121
  *
122
122
  * This source code is licensed under the ISC license.
123
123
  * See the LICENSE file in the root directory of this source tree.
124
- */const VA=Se("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
124
+ */const PA=Se("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
125
125
  * @license lucide-react v0.554.0 - ISC
126
126
  *
127
127
  * This source code is licensed under the ISC license.
128
128
  * See the LICENSE file in the root directory of this source tree.
129
- */const WA=Se("file-down",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);/**
129
+ */const LA=Se("file-down",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);/**
130
130
  * @license lucide-react v0.554.0 - ISC
131
131
  *
132
132
  * This source code is licensed under the ISC license.
133
133
  * See the LICENSE file in the root directory of this source tree.
134
- */const cp=Se("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
134
+ */const sp=Se("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
135
135
  * @license lucide-react v0.554.0 - ISC
136
136
  *
137
137
  * This source code is licensed under the ISC license.
138
138
  * See the LICENSE file in the root directory of this source tree.
139
- */const qA=Se("files",[["path",{d:"M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8",key:"14sh0y"}],["path",{d:"M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z",key:"1970lx"}],["path",{d:"M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1",key:"l4dndm"}]]);/**
139
+ */const FA=Se("files",[["path",{d:"M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8",key:"14sh0y"}],["path",{d:"M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z",key:"1970lx"}],["path",{d:"M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1",key:"l4dndm"}]]);/**
140
140
  * @license lucide-react v0.554.0 - ISC
141
141
  *
142
142
  * This source code is licensed under the ISC license.
143
143
  * See the LICENSE file in the root directory of this source tree.
144
- */const YA=Se("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
144
+ */const RA=Se("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
145
145
  * @license lucide-react v0.554.0 - ISC
146
146
  *
147
147
  * This source code is licensed under the ISC license.
148
148
  * See the LICENSE file in the root directory of this source tree.
149
- */const fp=Se("image-off",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]]);/**
149
+ */const ap=Se("image-off",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]]);/**
150
150
  * @license lucide-react v0.554.0 - ISC
151
151
  *
152
152
  * This source code is licensed under the ISC license.
153
153
  * See the LICENSE file in the root directory of this source tree.
154
- */const KA=Se("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
154
+ */const $A=Se("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
155
155
  * @license lucide-react v0.554.0 - ISC
156
156
  *
157
157
  * This source code is licensed under the ISC license.
158
158
  * See the LICENSE file in the root directory of this source tree.
159
- */const GA=Se("loader",[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]);/**
159
+ */const BA=Se("loader",[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]);/**
160
160
  * @license lucide-react v0.554.0 - ISC
161
161
  *
162
162
  * This source code is licensed under the ISC license.
163
163
  * See the LICENSE file in the root directory of this source tree.
164
- */const QA=Se("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
164
+ */const zA=Se("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
165
165
  * @license lucide-react v0.554.0 - ISC
166
166
  *
167
167
  * This source code is licensed under the ISC license.
168
168
  * See the LICENSE file in the root directory of this source tree.
169
- */const ZA=Se("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]);/**
169
+ */const UA=Se("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]);/**
170
170
  * @license lucide-react v0.554.0 - ISC
171
171
  *
172
172
  * This source code is licensed under the ISC license.
173
173
  * See the LICENSE file in the root directory of this source tree.
174
- */const JA=Se("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/**
174
+ */const HA=Se("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/**
175
175
  * @license lucide-react v0.554.0 - ISC
176
176
  *
177
177
  * This source code is licensed under the ISC license.
178
178
  * See the LICENSE file in the root directory of this source tree.
179
- */const XA=Se("mic",[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]]);/**
179
+ */const jA=Se("mic",[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]]);/**
180
180
  * @license lucide-react v0.554.0 - ISC
181
181
  *
182
182
  * This source code is licensed under the ISC license.
183
183
  * See the LICENSE file in the root directory of this source tree.
184
- */const eT=Se("monitor-cog",[["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"m14.305 7.53.923-.382",key:"1mlnsw"}],["path",{d:"m15.228 4.852-.923-.383",key:"82mpwg"}],["path",{d:"m16.852 3.228-.383-.924",key:"ln4sir"}],["path",{d:"m16.852 8.772-.383.923",key:"1dejw0"}],["path",{d:"m19.148 3.228.383-.924",key:"192kgf"}],["path",{d:"m19.53 9.696-.382-.924",key:"fiavlr"}],["path",{d:"m20.772 4.852.924-.383",key:"1j8mgp"}],["path",{d:"m20.772 7.148.924.383",key:"zix9be"}],["path",{d:"M22 13v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7",key:"1tnzv8"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}]]);/**
184
+ */const VA=Se("monitor-cog",[["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"m14.305 7.53.923-.382",key:"1mlnsw"}],["path",{d:"m15.228 4.852-.923-.383",key:"82mpwg"}],["path",{d:"m16.852 3.228-.383-.924",key:"ln4sir"}],["path",{d:"m16.852 8.772-.383.923",key:"1dejw0"}],["path",{d:"m19.148 3.228.383-.924",key:"192kgf"}],["path",{d:"m19.53 9.696-.382-.924",key:"fiavlr"}],["path",{d:"m20.772 4.852.924-.383",key:"1j8mgp"}],["path",{d:"m20.772 7.148.924.383",key:"zix9be"}],["path",{d:"M22 13v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7",key:"1tnzv8"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}]]);/**
185
185
  * @license lucide-react v0.554.0 - ISC
186
186
  *
187
187
  * This source code is licensed under the ISC license.
188
188
  * See the LICENSE file in the root directory of this source tree.
189
- */const tT=Se("phone",[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]]);/**
189
+ */const WA=Se("phone",[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]]);/**
190
190
  * @license lucide-react v0.554.0 - ISC
191
191
  *
192
192
  * This source code is licensed under the ISC license.
193
193
  * See the LICENSE file in the root directory of this source tree.
194
- */const nT=Se("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
194
+ */const qA=Se("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
195
195
  * @license lucide-react v0.554.0 - ISC
196
196
  *
197
197
  * This source code is licensed under the ISC license.
198
198
  * See the LICENSE file in the root directory of this source tree.
199
- */const rT=Se("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
199
+ */const YA=Se("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
200
200
  * @license lucide-react v0.554.0 - ISC
201
201
  *
202
202
  * This source code is licensed under the ISC license.
203
203
  * See the LICENSE file in the root directory of this source tree.
204
- */const iT=Se("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
204
+ */const KA=Se("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
205
205
  * @license lucide-react v0.554.0 - ISC
206
206
  *
207
207
  * This source code is licensed under the ISC license.
208
208
  * See the LICENSE file in the root directory of this source tree.
209
- */const oT=Se("thumbs-down",[["path",{d:"M17 14V2",key:"8ymqnk"}],["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}]]);/**
209
+ */const GA=Se("thumbs-down",[["path",{d:"M17 14V2",key:"8ymqnk"}],["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}]]);/**
210
210
  * @license lucide-react v0.554.0 - ISC
211
211
  *
212
212
  * This source code is licensed under the ISC license.
213
213
  * See the LICENSE file in the root directory of this source tree.
214
- */const sT=Se("thumbs-up",[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]]);/**
214
+ */const QA=Se("thumbs-up",[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]]);/**
215
215
  * @license lucide-react v0.554.0 - ISC
216
216
  *
217
217
  * This source code is licensed under the ISC license.
218
218
  * See the LICENSE file in the root directory of this source tree.
219
- */const aT=Se("unplug",[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]]);/**
219
+ */const ZA=Se("unplug",[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]]);/**
220
220
  * @license lucide-react v0.554.0 - ISC
221
221
  *
222
222
  * This source code is licensed under the ISC license.
223
223
  * See the LICENSE file in the root directory of this source tree.
224
- */const lT=Se("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
224
+ */const JA=Se("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
225
225
  * @license lucide-react v0.554.0 - ISC
226
226
  *
227
227
  * This source code is licensed under the ISC license.
228
228
  * See the LICENSE file in the root directory of this source tree.
229
- */const uT=Se("video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);/**
229
+ */const XA=Se("video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);/**
230
230
  * @license lucide-react v0.554.0 - ISC
231
231
  *
232
232
  * This source code is licensed under the ISC license.
233
233
  * See the LICENSE file in the root directory of this source tree.
234
- */const dp=Se("volume-2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/**
234
+ */const lp=Se("volume-2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/**
235
235
  * @license lucide-react v0.554.0 - ISC
236
236
  *
237
237
  * This source code is licensed under the ISC license.
238
238
  * See the LICENSE file in the root directory of this source tree.
239
- */const cT=Se("volume-x",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);/**
239
+ */const eT=Se("volume-x",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);/**
240
240
  * @license lucide-react v0.554.0 - ISC
241
241
  *
242
242
  * This source code is licensed under the ISC license.
243
243
  * See the LICENSE file in the root directory of this source tree.
244
- */const fT=Se("wifi-off",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
244
+ */const tT=Se("wifi-off",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
245
245
  * @license lucide-react v0.554.0 - ISC
246
246
  *
247
247
  * This source code is licensed under the ISC license.
248
248
  * See the LICENSE file in the root directory of this source tree.
249
- */const hp=Se("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),dT=({text:e})=>{const{message:{blocks:{text:t}}}=me,[n,r]=D.useState(new Map);function i(s){if(n.has(s))return;const a=new Image;a.src=s,a.onerror=()=>{r(l=>new Map(l).set(s,!0))},a.onload=()=>{r(l=>new Map(l).set(s,!1))}}D.useEffect(()=>{const s=/!\[.*?\]\((.*?)\)/g,a=[];let l;for(;(l=s.exec(e))!==null;){const u=l[1];u&&!a.includes(u)&&a.push(u)}a.forEach(u=>{i(u)})},[e]);const o={h1:({node:s,...a})=>k.jsx("h1",{...a,...t.heading1}),h2:({node:s,...a})=>k.jsx("h2",{...a,...t.heading2}),h3:({node:s,...a})=>k.jsx("h3",{...a,...t.heading3}),h4:({node:s,...a})=>k.jsx("h4",{...a,...t.heading4}),h5:"h4",h6:"h4",em:({node:s,...a})=>k.jsx("em",{...a,...t.italic}),strong:({node:s,...a})=>k.jsx("strong",{...a,...t.bold}),p:({node:s,...a})=>k.jsx("p",{...a,...t.text}),hr:({node:s,...a})=>k.jsx("hr",{...a,...t.horizontalRule}),a:({node:s,href:a,children:l,...u})=>k.jsx("a",{...u,...t.link,onMouseUp:f=>{window.open(a,"_blank","noopener,noreferrer")},children:l}),img:({node:s,...a})=>{const l=a.src;return n.get(l)||!1?k.jsx("div",{"data-error":!0,...t.image,children:k.jsx(fp,{strokeWidth:"1"})}):k.jsx("img",{...a,...t.image})},ol:({node:s,...a})=>k.jsx("ol",{...a,...t.orderedList}),ul:({node:s,...a})=>k.jsx("ul",{...a,...t.unorderedList}),li:({node:s,...a})=>k.jsx("li",{...a,...t.listItem}),br:({node:s,...a})=>k.jsx("br",{...a,...t.lineBreak}),pre:({node:s,...a})=>{var m,p;const l=s==null?void 0:s.children[0],u=hT(((p=(m=l==null?void 0:l.properties)==null?void 0:m.className)==null?void 0:p[0])||""),[f,c]=D.useState(!1),h=D.useRef(null),d=()=>{if(!h.current)return;const g=h.current.textContent||"";navigator.clipboard.writeText(g).then(()=>{c(!0),setTimeout(()=>{c(!1)},1500)}).catch(y=>{console.error("Failed to copy code to clipboard:",y)})};return k.jsxs("div",{...t.codeBlockContainer,children:[k.jsxs("div",{...t.codeBlockTitle,children:[u?k.jsx("span",{children:u}):"Code",f?k.jsx(zA,{...t.codeBlockCopyIcon}):k.jsx(qA,{...t.codeBlockCopyIcon,onClick:d})]}),k.jsx("pre",{ref:h,...a,...t.codeBlock})]})},input:({node:s,...a})=>k.jsx("input",{...a,...t.input,disabled:!1}),code:({node:s,...a})=>k.jsx("code",{...a,...t.code}),table:({node:s,...a})=>k.jsx("div",{...t.tableContainer,children:k.jsx("table",{...a,...t.table})}),th:({node:s,...a})=>k.jsx("th",{...a,...t.tableHeader}),tr:({node:s,...a})=>k.jsx("tr",{...a,...t.tableRow}),td:({node:s,...a})=>k.jsx("td",{...a,...t.tableData})};return k.jsx(Ch,{urlTransform:s=>s.startsWith("tel:")?s:Ah(s),components:o,remarkPlugins:[_A,OE],children:e})},hT=e=>{if(!e)return"";const t=e.match(/language-(\w+)/);return t?t[1]:""},pT={},pp=e=>{let t;const n=new Set,r=(l,u)=>{const f=typeof l=="function"?l(t):l;if(!Object.is(f,t)){const c=t;t=u??typeof f!="object"?f:Object.assign({},t,f),n.forEach(h=>h(t,c))}},i=()=>t,a={setState:r,getState:i,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{(pT?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(r,i,a),a},mT=e=>e?pp(e):pp;var _a={exports:{}},Pa={},Ji={exports:{}},La={};/**
249
+ */const up=Se("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),nT=({text:e})=>{const{message:{blocks:{text:t}}}=ye,[n,r]=M.useState(new Map);function i(s){if(n.has(s))return;const a=new Image;a.src=s,a.onerror=()=>{r(l=>new Map(l).set(s,!0))},a.onload=()=>{r(l=>new Map(l).set(s,!1))}}M.useEffect(()=>{const s=/!\[.*?\]\((.*?)\)/g,a=[];let l;for(;(l=s.exec(e))!==null;){const u=l[1];u&&!a.includes(u)&&a.push(u)}a.forEach(u=>{i(u)})},[e]);const o={h1:({node:s,...a})=>x.jsx("h1",{...a,...t.heading1}),h2:({node:s,...a})=>x.jsx("h2",{...a,...t.heading2}),h3:({node:s,...a})=>x.jsx("h3",{...a,...t.heading3}),h4:({node:s,...a})=>x.jsx("h4",{...a,...t.heading4}),h5:"h4",h6:"h4",em:({node:s,...a})=>x.jsx("em",{...a,...t.italic}),strong:({node:s,...a})=>x.jsx("strong",{...a,...t.bold}),p:({node:s,...a})=>x.jsx("p",{...a,...t.text}),hr:({node:s,...a})=>x.jsx("hr",{...a,...t.horizontalRule}),a:({node:s,href:a,children:l,...u})=>x.jsx("a",{...u,...t.link,onMouseUp:f=>{window.open(a,"_blank","noopener,noreferrer")},children:l}),img:({node:s,...a})=>{const l=a.src;return n.get(l)||!1?x.jsx("div",{"data-error":!0,...t.image,children:x.jsx(ap,{strokeWidth:"1"})}):x.jsx("img",{...a,...t.image})},ol:({node:s,...a})=>x.jsx("ol",{...a,...t.orderedList}),ul:({node:s,...a})=>x.jsx("ul",{...a,...t.unorderedList}),li:({node:s,...a})=>x.jsx("li",{...a,...t.listItem}),br:({node:s,...a})=>x.jsx("br",{...a,...t.lineBreak}),pre:({node:s,...a})=>{var m,p;const l=s==null?void 0:s.children[0],u=rT(((p=(m=l==null?void 0:l.properties)==null?void 0:m.className)==null?void 0:p[0])||""),[f,c]=M.useState(!1),h=M.useRef(null),d=()=>{if(!h.current)return;const g=h.current.textContent||"";navigator.clipboard.writeText(g).then(()=>{c(!0),setTimeout(()=>{c(!1)},1500)}).catch(v=>{console.error("Failed to copy code to clipboard:",v)})};return x.jsxs("div",{...t.codeBlockContainer,children:[x.jsxs("div",{...t.codeBlockTitle,children:[u?x.jsx("span",{children:u}):"Code",f?x.jsx(MA,{...t.codeBlockCopyIcon}):x.jsx(FA,{...t.codeBlockCopyIcon,onClick:d})]}),x.jsx("pre",{ref:h,...a,...t.codeBlock})]})},input:({node:s,...a})=>x.jsx("input",{...a,...t.input,disabled:!1}),code:({node:s,...a})=>x.jsx("code",{...a,...t.code}),table:({node:s,...a})=>x.jsx("div",{...t.tableContainer,children:x.jsx("table",{...a,...t.table})}),th:({node:s,...a})=>x.jsx("th",{...a,...t.tableHeader}),tr:({node:s,...a})=>x.jsx("tr",{...a,...t.tableRow}),td:({node:s,...a})=>x.jsx("td",{...a,...t.tableData})};return x.jsx(Sh,{urlTransform:s=>s.startsWith("tel:")?s:xh(s),components:o,remarkPlugins:[kA,bE],children:e})},rT=e=>{if(!e)return"";const t=e.match(/language-(\w+)/);return t?t[1]:""},iT={},cp=e=>{let t;const n=new Set,r=(l,u)=>{const f=typeof l=="function"?l(t):l;if(!Object.is(f,t)){const c=t;t=u??typeof f!="object"?f:Object.assign({},t,f),n.forEach(h=>h(t,c))}},i=()=>t,a={setState:r,getState:i,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{(iT?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(r,i,a),a},oT=e=>e?cp(e):cp;var Da={exports:{}},Na={},Ji={exports:{}},_a={};/**
250
250
  * @license React
251
251
  * use-sync-external-store-shim.production.min.js
252
252
  *
@@ -254,7 +254,7 @@ Please start a new conversation.`,Bs={ResourceNotFound:{type:"configuration",mes
254
254
  *
255
255
  * This source code is licensed under the MIT license found in the
256
256
  * LICENSE file in the root directory of this source tree.
257
- */var mp;function gT(){if(mp)return La;mp=1;var e=D;function t(c,h){return c===h&&(c!==0||1/c===1/h)||c!==c&&h!==h}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function a(c,h){var d=h(),m=r({inst:{value:d,getSnapshot:h}}),p=m[0].inst,g=m[1];return o(function(){p.value=d,p.getSnapshot=h,l(p)&&g({inst:p})},[c,d,h]),i(function(){return l(p)&&g({inst:p}),c(function(){l(p)&&g({inst:p})})},[c]),s(d),d}function l(c){var h=c.getSnapshot;c=c.value;try{var d=h();return!n(c,d)}catch{return!0}}function u(c,h){return h()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return La.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,La}var Fa={};/**
257
+ */var fp;function sT(){if(fp)return _a;fp=1;var e=M;function t(c,h){return c===h&&(c!==0||1/c===1/h)||c!==c&&h!==h}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function a(c,h){var d=h(),m=r({inst:{value:d,getSnapshot:h}}),p=m[0].inst,g=m[1];return o(function(){p.value=d,p.getSnapshot=h,l(p)&&g({inst:p})},[c,d,h]),i(function(){return l(p)&&g({inst:p}),c(function(){l(p)&&g({inst:p})})},[c]),s(d),d}function l(c){var h=c.getSnapshot;c=c.value;try{var d=h();return!n(c,d)}catch{return!0}}function u(c,h){return h()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return _a.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,_a}var Pa={};/**
258
258
  * @license React
259
259
  * use-sync-external-store-shim.development.js
260
260
  *
@@ -262,7 +262,7 @@ Please start a new conversation.`,Bs={ResourceNotFound:{type:"configuration",mes
262
262
  *
263
263
  * This source code is licensed under the MIT license found in the
264
264
  * LICENSE file in the root directory of this source tree.
265
- */var gp;function yT(){return gp||(gp=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=D,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(w){{for(var E=arguments.length,S=new Array(E>1?E-1:0),C=1;C<E;C++)S[C-1]=arguments[C];r("error",w,S)}}function r(w,E,S){{var C=t.ReactDebugCurrentFrame,I=C.getStackAddendum();I!==""&&(E+="%s",S=S.concat([I]));var M=S.map(function(P){return String(P)});M.unshift("Warning: "+E),Function.prototype.apply.call(console[w],console,M)}}function i(w,E){return w===E&&(w!==0||1/w===1/E)||w!==w&&E!==E}var o=typeof Object.is=="function"?Object.is:i,s=e.useState,a=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue,f=!1,c=!1;function h(w,E,S){f||e.startTransition!==void 0&&(f=!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 C=E();if(!c){var I=E();o(C,I)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}var M=s({inst:{value:C,getSnapshot:E}}),P=M[0].inst,T=M[1];return l(function(){P.value=C,P.getSnapshot=E,d(P)&&T({inst:P})},[w,C,E]),a(function(){d(P)&&T({inst:P});var O=function(){d(P)&&T({inst:P})};return w(O)},[w]),u(C),C}function d(w){var E=w.getSnapshot,S=w.value;try{var C=E();return!o(S,C)}catch{return!0}}function m(w,E,S){return E()}var p=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",g=!p,y=g?m:h,v=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:y;Fa.useSyncExternalStore=v,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Fa}var yp;function vp(){return yp||(yp=1,process.env.NODE_ENV==="production"?Ji.exports=gT():Ji.exports=yT()),Ji.exports}/**
265
+ */var dp;function aT(){return dp||(dp=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=M,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(w){{for(var A=arguments.length,k=new Array(A>1?A-1:0),E=1;E<A;E++)k[E-1]=arguments[E];r("error",w,k)}}function r(w,A,k){{var E=t.ReactDebugCurrentFrame,I=E.getStackAddendum();I!==""&&(A+="%s",k=k.concat([I]));var D=k.map(function(P){return String(P)});D.unshift("Warning: "+A),Function.prototype.apply.call(console[w],console,D)}}function i(w,A){return w===A&&(w!==0||1/w===1/A)||w!==w&&A!==A}var o=typeof Object.is=="function"?Object.is:i,s=e.useState,a=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue,f=!1,c=!1;function h(w,A,k){f||e.startTransition!==void 0&&(f=!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 E=A();if(!c){var I=A();o(E,I)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}var D=s({inst:{value:E,getSnapshot:A}}),P=D[0].inst,T=D[1];return l(function(){P.value=E,P.getSnapshot=A,d(P)&&T({inst:P})},[w,E,A]),a(function(){d(P)&&T({inst:P});var O=function(){d(P)&&T({inst:P})};return w(O)},[w]),u(E),E}function d(w){var A=w.getSnapshot,k=w.value;try{var E=A();return!o(k,E)}catch{return!0}}function m(w,A,k){return A()}var p=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",g=!p,v=g?m:h,y=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v;Pa.useSyncExternalStore=y,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Pa}var hp;function pp(){return hp||(hp=1,process.env.NODE_ENV==="production"?Ji.exports=sT():Ji.exports=aT()),Ji.exports}/**
266
266
  * @license React
267
267
  * use-sync-external-store-shim/with-selector.production.min.js
268
268
  *
@@ -270,7 +270,7 @@ Please start a new conversation.`,Bs={ResourceNotFound:{type:"configuration",mes
270
270
  *
271
271
  * This source code is licensed under the MIT license found in the
272
272
  * LICENSE file in the root directory of this source tree.
273
- */var bp;function vT(){if(bp)return Pa;bp=1;var e=D,t=vp();function n(u,f){return u===f&&(u!==0||1/u===1/f)||u!==u&&f!==f}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return Pa.useSyncExternalStoreWithSelector=function(u,f,c,h,d){var m=o(null);if(m.current===null){var p={hasValue:!1,value:null};m.current=p}else p=m.current;m=a(function(){function y(C){if(!v){if(v=!0,w=C,C=h(C),d!==void 0&&p.hasValue){var I=p.value;if(d(I,C))return E=I}return E=C}if(I=E,r(w,C))return I;var M=h(C);return d!==void 0&&d(I,M)?I:(w=C,E=M)}var v=!1,w,E,S=c===void 0?null:c;return[function(){return y(f())},S===null?void 0:function(){return y(S())}]},[f,c,h,d]);var g=i(u,m[0],m[1]);return s(function(){p.hasValue=!0,p.value=g},[g]),l(g),g},Pa}var Ra={};/**
273
+ */var mp;function lT(){if(mp)return Na;mp=1;var e=M,t=pp();function n(u,f){return u===f&&(u!==0||1/u===1/f)||u!==u&&f!==f}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return Na.useSyncExternalStoreWithSelector=function(u,f,c,h,d){var m=o(null);if(m.current===null){var p={hasValue:!1,value:null};m.current=p}else p=m.current;m=a(function(){function v(E){if(!y){if(y=!0,w=E,E=h(E),d!==void 0&&p.hasValue){var I=p.value;if(d(I,E))return A=I}return A=E}if(I=A,r(w,E))return I;var D=h(E);return d!==void 0&&d(I,D)?I:(w=E,A=D)}var y=!1,w,A,k=c===void 0?null:c;return[function(){return v(f())},k===null?void 0:function(){return v(k())}]},[f,c,h,d]);var g=i(u,m[0],m[1]);return s(function(){p.hasValue=!0,p.value=g},[g]),l(g),g},Na}var La={};/**
274
274
  * @license React
275
275
  * use-sync-external-store-shim/with-selector.development.js
276
276
  *
@@ -278,57 +278,54 @@ Please start a new conversation.`,Bs={ResourceNotFound:{type:"configuration",mes
278
278
  *
279
279
  * This source code is licensed under the MIT license found in the
280
280
  * LICENSE file in the root directory of this source tree.
281
- */var wp;function bT(){return wp||(wp=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=D,t=vp();function n(f,c){return f===c&&(f!==0||1/f===1/c)||f!==f&&c!==c}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;function u(f,c,h,d,m){var p=o(null),g;p.current===null?(g={hasValue:!1,value:null},p.current=g):g=p.current;var y=a(function(){var S=!1,C,I,M=function(U){if(!S){S=!0,C=U;var F=d(U);if(m!==void 0&&g.hasValue){var L=g.value;if(m(L,F))return I=L,L}return I=F,F}var R=C,N=I;if(r(R,U))return N;var j=d(U);return m!==void 0&&m(N,j)?N:(C=U,I=j,j)},P=h===void 0?null:h,T=function(){return M(c())},O=P===null?void 0:function(){return M(P())};return[T,O]},[c,h,d,m]),v=y[0],w=y[1],E=i(f,v,w);return s(function(){g.hasValue=!0,g.value=E},[E]),l(E),E}Ra.useSyncExternalStoreWithSelector=u,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Ra}process.env.NODE_ENV==="production"?_a.exports=vT():_a.exports=bT();var wT=_a.exports;const ST=vn(wT),Sp={},{useSyncExternalStoreWithSelector:xT}=ST;let xp=!1;function kT(e,t=e.getState,n){(Sp?"production":void 0)!=="production"&&n&&!xp&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),xp=!0);const r=xT(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return D.useDebugValue(r),r}const ET=e=>{(Sp?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?mT(e):e,n=(r,i)=>kT(t,r,i);return Object.assign(n,t),n},ln=e=>ET,Xi={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},$a=new Map,eo=e=>{const t=$a.get(e);return t?Object.fromEntries(Object.entries(t.stores).map(([n,r])=>[n,r.getState()])):{}},CT=(e,t,n)=>{if(e===void 0)return{type:"untracked",connection:t.connect(n)};const r=$a.get(n.name);if(r)return{type:"tracked",store:e,...r};const i={connection:t.connect(n),stores:{}};return $a.set(n.name,i),{type:"tracked",store:e,...i}},Gn=(e,t={})=>(n,r,i)=>{const{enabled:o,anonymousActionType:s,store:a,...l}=t;let u;try{u=(o??(Xi?"production":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!u)return(Xi?"production":void 0)!=="production"&&o&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),e(n,r,i);const{connection:f,...c}=CT(a,u,l);let h=!0;i.setState=(p,g,y)=>{const v=n(p,g);if(!h)return v;const w=y===void 0?{type:s||"anonymous"}:typeof y=="string"?{type:y}:y;return a===void 0?(f==null||f.send(w,r()),v):(f==null||f.send({...w,type:`${a}/${w.type}`},{...eo(l.name),[a]:i.getState()}),v)};const d=(...p)=>{const g=h;h=!1,n(...p),h=g},m=e(i.setState,r,i);if(c.type==="untracked"?f==null||f.init(m):(c.stores[c.store]=i,f==null||f.init(Object.fromEntries(Object.entries(c.stores).map(([p,g])=>[p,p===c.store?m:g.getState()])))),i.dispatchFromDevtools&&typeof i.dispatch=="function"){let p=!1;const g=i.dispatch;i.dispatch=(...y)=>{(Xi?"production":void 0)!=="production"&&y[0].type==="__setState"&&!p&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),p=!0),g(...y)}}return f.subscribe(p=>{var g;switch(p.type){case"ACTION":if(typeof p.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return Ba(p.payload,y=>{if(y.type==="__setState"){if(a===void 0){d(y.state);return}Object.keys(y.state).length!==1&&console.error(`
281
+ */var gp;function uT(){return gp||(gp=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=M,t=pp();function n(f,c){return f===c&&(f!==0||1/f===1/c)||f!==f&&c!==c}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;function u(f,c,h,d,m){var p=o(null),g;p.current===null?(g={hasValue:!1,value:null},p.current=g):g=p.current;var v=a(function(){var k=!1,E,I,D=function(B){if(!k){k=!0,E=B;var L=d(B);if(m!==void 0&&g.hasValue){var F=g.value;if(m(F,L))return I=F,F}return I=L,L}var R=E,N=I;if(r(R,B))return N;var H=d(B);return m!==void 0&&m(N,H)?N:(E=B,I=H,H)},P=h===void 0?null:h,T=function(){return D(c())},O=P===null?void 0:function(){return D(P())};return[T,O]},[c,h,d,m]),y=v[0],w=v[1],A=i(f,y,w);return s(function(){g.hasValue=!0,g.value=A},[A]),l(A),A}La.useSyncExternalStoreWithSelector=u,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),La}process.env.NODE_ENV==="production"?Da.exports=lT():Da.exports=uT();var cT=Da.exports;const fT=vn(cT),yp={},{useSyncExternalStoreWithSelector:dT}=fT;let vp=!1;function hT(e,t=e.getState,n){(yp?"production":void 0)!=="production"&&n&&!vp&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),vp=!0);const r=dT(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return M.useDebugValue(r),r}const pT=e=>{(yp?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?oT(e):e,n=(r,i)=>hT(t,r,i);return Object.assign(n,t),n},ln=e=>pT,Xi={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},Fa=new Map,eo=e=>{const t=Fa.get(e);return t?Object.fromEntries(Object.entries(t.stores).map(([n,r])=>[n,r.getState()])):{}},mT=(e,t,n)=>{if(e===void 0)return{type:"untracked",connection:t.connect(n)};const r=Fa.get(n.name);if(r)return{type:"tracked",store:e,...r};const i={connection:t.connect(n),stores:{}};return Fa.set(n.name,i),{type:"tracked",store:e,...i}},Gn=(e,t={})=>(n,r,i)=>{const{enabled:o,anonymousActionType:s,store:a,...l}=t;let u;try{u=(o??(Xi?"production":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!u)return(Xi?"production":void 0)!=="production"&&o&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),e(n,r,i);const{connection:f,...c}=mT(a,u,l);let h=!0;i.setState=(p,g,v)=>{const y=n(p,g);if(!h)return y;const w=v===void 0?{type:s||"anonymous"}:typeof v=="string"?{type:v}:v;return a===void 0?(f==null||f.send(w,r()),y):(f==null||f.send({...w,type:`${a}/${w.type}`},{...eo(l.name),[a]:i.getState()}),y)};const d=(...p)=>{const g=h;h=!1,n(...p),h=g},m=e(i.setState,r,i);if(c.type==="untracked"?f==null||f.init(m):(c.stores[c.store]=i,f==null||f.init(Object.fromEntries(Object.entries(c.stores).map(([p,g])=>[p,p===c.store?m:g.getState()])))),i.dispatchFromDevtools&&typeof i.dispatch=="function"){let p=!1;const g=i.dispatch;i.dispatch=(...v)=>{(Xi?"production":void 0)!=="production"&&v[0].type==="__setState"&&!p&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),p=!0),g(...v)}}return f.subscribe(p=>{var g;switch(p.type){case"ACTION":if(typeof p.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return Ra(p.payload,v=>{if(v.type==="__setState"){if(a===void 0){d(v.state);return}Object.keys(v.state).length!==1&&console.error(`
282
282
  [zustand devtools middleware] Unsupported __setState action format.
283
283
  When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
284
284
  and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }
285
- `);const v=y.state[a];if(v==null)return;JSON.stringify(i.getState())!==JSON.stringify(v)&&d(v);return}i.dispatchFromDevtools&&typeof i.dispatch=="function"&&i.dispatch(y)});case"DISPATCH":switch(p.payload.type){case"RESET":return d(m),a===void 0?f==null?void 0:f.init(i.getState()):f==null?void 0:f.init(eo(l.name));case"COMMIT":if(a===void 0){f==null||f.init(i.getState());return}return f==null?void 0:f.init(eo(l.name));case"ROLLBACK":return Ba(p.state,y=>{if(a===void 0){d(y),f==null||f.init(i.getState());return}d(y[a]),f==null||f.init(eo(l.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return Ba(p.state,y=>{if(a===void 0){d(y);return}JSON.stringify(i.getState())!==JSON.stringify(y[a])&&d(y[a])});case"IMPORT_STATE":{const{nextLiftedState:y}=p.payload,v=(g=y.computedStates.slice(-1)[0])==null?void 0:g.state;if(!v)return;d(a===void 0?v:v[a]),f==null||f.send(null,y);return}case"PAUSE_RECORDING":return h=!h}return}}),m},Ba=(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 to(e,t){let n;try{n=e()}catch{return}return{getItem:i=>{var o;const s=l=>l===null?null:JSON.parse(l,void 0),a=(o=n.getItem(i))!=null?o:null;return a instanceof Promise?a.then(s):s(a)},setItem:(i,o)=>n.setItem(i,JSON.stringify(o,void 0)),removeItem:i=>n.removeItem(i)}}const Vr=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Vr(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Vr(r)(n)}}}},AT=(e,t)=>(n,r,i)=>{let o={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:g=>g,version:0,merge:(g,y)=>({...y,...g}),...t},s=!1;const a=new Set,l=new Set;let u;try{u=o.getStorage()}catch{}if(!u)return e((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...g)},r,i);const f=Vr(o.serialize),c=()=>{const g=o.partialize({...r()});let y;const v=f({state:g,version:o.version}).then(w=>u.setItem(o.name,w)).catch(w=>{y=w});if(y)throw y;return v},h=i.setState;i.setState=(g,y)=>{h(g,y),c()};const d=e((...g)=>{n(...g),c()},r,i);let m;const p=()=>{var g;if(!u)return;s=!1,a.forEach(v=>v(r()));const y=((g=o.onRehydrateStorage)==null?void 0:g.call(o,r()))||void 0;return Vr(u.getItem.bind(u))(o.name).then(v=>{if(v)return o.deserialize(v)}).then(v=>{if(v)if(typeof v.version=="number"&&v.version!==o.version){if(o.migrate)return o.migrate(v.state,v.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return v.state}).then(v=>{var w;return m=o.merge(v,(w=r())!=null?w:d),n(m,!0),c()}).then(()=>{y==null||y(m,void 0),s=!0,l.forEach(v=>v(m))}).catch(v=>{y==null||y(void 0,v)})};return i.persist={setOptions:g=>{o={...o,...g},g.getStorage&&(u=g.getStorage())},clearStorage:()=>{u==null||u.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>p(),hasHydrated:()=>s,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(l.add(g),()=>{l.delete(g)})},p(),m||d},TT=(e,t)=>(n,r,i)=>{let o={storage:to(()=>localStorage),partialize:p=>p,version:0,merge:(p,g)=>({...g,...p}),...t},s=!1;const a=new Set,l=new Set;let u=o.storage;if(!u)return e((...p)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...p)},r,i);const f=()=>{const p=o.partialize({...r()});return u.setItem(o.name,{state:p,version:o.version})},c=i.setState;i.setState=(p,g)=>{c(p,g),f()};const h=e((...p)=>{n(...p),f()},r,i);let d;const m=()=>{var p,g;if(!u)return;s=!1,a.forEach(v=>{var w;return v((w=r())!=null?w:h)});const y=((g=o.onRehydrateStorage)==null?void 0:g.call(o,(p=r())!=null?p:h))||void 0;return Vr(u.getItem.bind(u))(o.name).then(v=>{if(v)if(typeof v.version=="number"&&v.version!==o.version){if(o.migrate)return o.migrate(v.state,v.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return v.state}).then(v=>{var w;return d=o.merge(v,(w=r())!=null?w:h),n(d,!0),f()}).then(()=>{y==null||y(d,void 0),d=r(),s=!0,l.forEach(v=>v(d))}).catch(v=>{y==null||y(void 0,v)})};return i.persist={setOptions:p=>{o={...o,...p},p.storage&&(u=p.storage)},clearStorage:()=>{u==null||u.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>m(),hasHydrated:()=>s,onHydrate:p=>(a.add(p),()=>{a.delete(p)}),onFinishHydration:p=>(l.add(p),()=>{l.delete(p)})},o.skipHydration||m(),d||h},no=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?((Xi?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),AT(e,t)):TT(e,t),IT=(e,t)=>ln()(Gn(no(n=>({messageHistory:[],addMessageToHistory:r=>n(i=>({...i,messageHistory:[r,...(i.messageHistory??[]).slice(0,100).filter(String)]})),clearHistory:()=>n(()=>({messageHistory:[]}))}),{name:e,storage:to(()=>t==="sessionStorage"?sessionStorage:localStorage)}))),za={},kp=(e,t,n)=>{const i=`${t||"bp-webchat"}-message-history-${e}`;return za[i]||(za[i]=IT(i,n)),za[i]},OT=e=>ln()(Gn(t=>({messages:[],setMessages:n=>t({messages:n}),saveMessage:n=>t(({messages:r})=>{var s;const i=(s=n.metadata)==null?void 0:s.clientMessageId;let o=-1;return i&&(o=r.findIndex(a=>{var l;return((l=a.metadata)==null?void 0:l.clientMessageId)===i})),o===-1&&(o=r.findIndex(a=>a.id===n.id)),o!==-1?{messages:[...r.slice(0,o),{...r[o],...n},...r.slice(o+1)]}:{messages:[...r,n]}}),updateMessage:(n,r)=>t(({messages:i})=>({messages:i.map(o=>o.id===n?{...o,...r}:o)})),removeMessage:n=>t(({messages:r})=>({messages:r.filter(i=>i.id!==n)})),clearMessages:()=>t({messages:[]})}),{name:e})),Ua={},Ep=e=>{const t=`messages-${e}`;return Ua[t]||(Ua[t]=OT(t)),Ua[t]},MT=(e,t)=>ln()(Gn(no(n=>({setUser:r=>n(i=>({...i,user:r})),setConversationId:r=>n(i=>({...i,conversationId:r})),clearAll:()=>{n(r=>({...r,user:void 0,conversationId:void 0}))}}),{name:e,storage:to(()=>t==="sessionStorage"?sessionStorage:localStorage)}))),ja={},Cp=(e="bp-webchat",t)=>{const n=`${e}-client`;return ja[n]||(ja[n]=MT(n,t)),ja[n]},Qn=ln()(Gn(e=>({eventEmitter:sc(),messageContainerRef:D.createRef(),setMessageContainerRef:t=>e({messageContainerRef:t}),portalContainer:null,setPortalContainer:t=>e({portalContainer:t})}),{name:"webchatStore"})),DT=8,NT=e=>ln()(no((t,n)=>({files:[],setFiles:r=>t({files:r}),upsertFile:r=>t(({files:i})=>({files:i.some(a=>a.name===r.name)?i.map(a=>a.name===r.name?{...a,...r}:a):[...i,{...r}]})),uploadFile:async(r,i)=>{if(n().files.length===DT)return;const o=r.name.lastIndexOf("."),s=o>0&&o<r.name.length-1,a=s?r.name.substring(0,o):r.name,l=s?r.name.substring(o):"",u=Hw(a,n().files,h=>h.name),f=u+l,c=new File([r],f,{type:r.type});n().upsertFile({name:u,type:"file",instance:c,status:"loading"});try{const{fileUrl:h,type:d,fileId:m}=await i(c);n().upsertFile({fileId:m,name:u,type:d,url:h,instance:c,status:"uploaded"})}catch{n().upsertFile({name:u,type:"file",instance:c,status:"error"})}},deleteFile:r=>t(({files:i})=>({files:i.filter(o=>o.name!=r)}))}),{name:e,storage:to(()=>sessionStorage)})),Ha={},Ap=(e,t)=>{const r=`${t||"bp-webchat"}-composer-files-${e}`;return Ha[r]||(Ha[r]=NT(r)),Ha[r]},_T=e=>ln()(Gn(t=>({participants:[],setParticipants:n=>t({participants:n}),addParticipant:n=>t(r=>({participants:[...r.participants,n]})),removeParticipant:n=>t(r=>({participants:r.participants.filter(i=>i.id!==n)})),clearParticipants:()=>t({participants:[]})}),{name:e})),Va={},Tp=e=>{const t=`participants-${e}`;return Va[t]||(Va[t]=_T(t)),Va[t]},PT=e=>ln()(Gn(no((t,n)=>({soundOn:!0,setSoundEnabled:r=>t({soundOn:r}),toggleSound:()=>t({soundOn:!n().soundOn})}),{name:e}))),Wa={},Ip=(e="bp-webchat")=>{const t=`${e}-sound`;return Wa[t]||(Wa[t]=PT(t)),Wa[t]},LT=({text:e,buttonValue:t,variant:n,groupId:r,reusable:i,sendMessage:o,isReadOnly:s,...a})=>{const l=Qn(w=>w.eventEmitter),[u,f]=D.useState(!1),[c,h]=D.useState(!1),[d,m]=D.useState(!1),{message:{blocks:{button:p}}}=me;D.useEffect(()=>{if(r)return l.on(`button-group-${r}-click`,()=>{h(!0),i||m(!0)})},[l,r,i]);const y={...a,onClick:w=>{if((d||s)&&n==="link"){w.preventDefault();return}f(!0),i||m(!0),r&&l.emit(`button-group-${r}-click`),n!=="link"&&o&&(o==null||o({type:"text",text:e,value:t}))},"data-activated":u?"":void 0,"data-group-activated":c?"":void 0,"data-type":n,...p},v=d||s;return n==="link"?k.jsx("a",{...y,style:s?{pointerEvents:"none"}:void 0,href:t,target:"_blank",rel:"noopener noreferrer",children:e}):k.jsx("button",{...y,style:s?{pointerEvents:"none"}:void 0,disabled:v,children:e})},qa=D.createContext(null);function Op(){const e=D.useContext(qa);if(!e)throw new Error("useMessageContext must be used within a Message");return e}const Ya=D.createContext({showInputModal:void 0});function Ka(){return D.useContext(Ya)}const Mp=D.forwardRef(({block:e,direction:t,sender:n,timestamp:r,messageId:i,feedback:o,metadata:s,isReadOnly:a,sendMessage:l,addMessageFeedback:u,...f},c)=>{const{showInputModal:h}=Ka(),{message:{blocks:{bubble:{container:d,feedbackContainer:m,feedbackIcon:p}}}}=me;return t=="incoming"?k.jsxs("div",{"data-direction":"incoming","data-feedback":!!o,...f,...d,ref:c,children:[k.jsx(Dn,{block:{...e,direction:t,timestamp:r,sender:n,messageId:i,isReadOnly:a,metadata:s,sendMessage:l}}),u&&h&&e.type==="text"&&k.jsxs("div",{...m,children:[k.jsx(sT,{...p,"data-selected":o==="positive",onClick:()=>u(i,{value:"positive"})}),k.jsx(oT,{...p,"data-selected":o==="negative",onClick:async()=>{const g=await h({title:"Help us improve",description:"Please provide feedback to help us improve.",confirmButtonText:"Send feedback",cancelButtonText:"Cancel",Content:FT});u(i,{value:"negative",comment:g})}})]})]}):k.jsx("div",{"data-direction":"outgoing",...f,...d,ref:c,children:k.jsx(Dn,{block:{...e,direction:t,timestamp:r,sender:n,messageId:i,isReadOnly:a,metadata:s,sendMessage:l,addMessageFeedback:u}})})});Mp.displayName="Bubble";const FT=({setValue:e})=>{const{modal:{dialog:{content:t}}}=me;return k.jsx("textarea",{...t.textarea,placeholder:"Let us know what went wrong...",onChange:n=>e(n.target.value)})},Dp=({className:e,...t})=>k.jsx("div",{"data-slot":"skeleton",className:`bpSkeleton ${e||""}`,...t});Dp.displayName="Skeleton";var xt=function(){return xt=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},xt.apply(this,arguments)};function Np(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 Zn(e,t,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(f){try{u(r.next(f))}catch(c){s(c)}}function l(f){try{u(r.throw(f))}catch(c){s(c)}}function u(f){f.done?o(f.value):i(f.value).then(a,l)}u((r=r.apply(e,t||[])).next())})}function Jn(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(f){return l([u,f])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1],o=u;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(u);break}o[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(f){u=[6,f],i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function _p(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],s;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o}function Ga(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;function RT(){var e=D.useRef(!1),t=D.useCallback(function(){return e.current},[]);return D.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),t}function $T(e,t,n){t===void 0&&(t=[]),n===void 0&&(n={loading:!1});var r=D.useRef(0),i=RT(),o=D.useState(n),s=o[0],a=o[1],l=D.useCallback(function(){for(var u=[],f=0;f<arguments.length;f++)u[f]=arguments[f];var c=++r.current;return s.loading||a(function(h){return xt(xt({},h),{loading:!0})}),e.apply(void 0,u).then(function(h){return i()&&c===r.current&&a({value:h,loading:!1}),h},function(h){return i()&&c===r.current&&a({error:h,loading:!1}),h})},t);return[s,l]}function BT(e,t){t===void 0&&(t=[]);var n=$T(e,t,{loading:!0}),r=n[0],i=n[1];return D.useEffect(function(){i()},[i]),r}const Pp=D.forwardRef(({url:e,type:t,orientation:n="auto",...r},i)=>{const o=D.useId(),{setIsLoading:s}=Op(),[a,l]=D.useState(n==="auto"?"square":n),[u,f]=D.useState("initial"),{message:{blocks:{image:c}}}=me;return D.useLayoutEffect(()=>(s(h=>[...h,o]),()=>{s(h=>h.filter(d=>d!==o))}),[o,s]),BT(async()=>{if(!e)return;const h=new Image;try{const{width:d,height:m}=await gb(e);n==="auto"&&l(zT(d,m)),h.onload=()=>{f("loaded"),s(p=>p.filter(g=>g!==o))},h.onerror=()=>{f("error"),l("square"),s(p=>p.filter(g=>g!==o))},h.src=e,h.complete&&(h.naturalWidth>0?(f("loaded"),s(p=>p.filter(g=>g!==o))):(f("error"),l("square"),s(p=>p.filter(g=>g!==o))))}catch(d){console.error(d),f("error"),s(m=>m.filter(p=>p!==o))}return()=>{h.onload=null,h.onerror=null}},[e,o,s,n]),e?u==="error"?k.jsx("div",{"data-error":"true","data-orientation":a,...r,...c.image,ref:i,children:k.jsx(fp,{size:"25%",strokeWidth:"5%"})}):u==="initial"?k.jsx(Dp,{"data-orientation":a,...c.placeholder}):k.jsx("img",{"data-orientation":a,"data-loaded":u==="loaded",...r,...c.image,src:e,alt:"",ref:i}):null});Pp.displayName="Image";function zT(e,t){const n={square:1,portrait:.75,landscape:1.3333333333333333},r=e/t;return Object.keys(n).reduce((o,s)=>Math.abs(n[s]-r)<Math.abs(n[o]-r)?s:o)}const Lp=D.forwardRef(({url:e,isReadOnly:t,...n},r)=>{const{message:{blocks:{video:i}}}=me;return k.jsx("div",{children:k.jsx("video",{...n,"data-chromatic":"ignore",style:t?{pointerEvents:"none"}:void 0,controls:!0,src:e,...i,ref:r})})});Lp.displayName="Video";const Fp=D.forwardRef(({url:e,isReadOnly:t,...n},r)=>{const{message:{blocks:{audio:i}}}=me;return k.jsx("div",{children:k.jsx("audio",{...n,controls:!0,style:t?{pointerEvents:"none"}:void 0,src:e,...i,ref:r})})});Fp.displayName="Audio";const Rp=D.forwardRef(({latitude:e,longitude:t,title:n,isReadOnly:r,...i},o)=>{const s=`https://www.google.com/maps/search/?api=1&query=${e},${t}`,{message:{blocks:{location:a}}}=me;return k.jsxs("a",{...i,...a.container,style:r?{pointerEvents:"none"}:void 0,href:s,type:"_blank",rel:"noopener",ref:o,children:[k.jsx("p",{...a.title,children:n}),k.jsx(JA,{...a.icon})]})});Rp.displayName="Location";const $p=D.forwardRef(({blocks:e,horizontalAlignment:t,verticalAlignment:n,direction:r,sender:i,timestamp:o,messageId:s,isReadOnly:a,sendMessage:l,...u},f)=>{const{message:{blocks:{column:c}}}=me;return k.jsx("div",{"data-horizontal":t,"data-vertical":n,...u,...c,ref:f,children:e.map((h,d)=>k.jsx(Dn,{block:{...h,direction:r,timestamp:o,sender:i,messageId:s,isReadOnly:a,sendMessage:l}},d))})});$p.displayName="Column";const Bp=D.forwardRef(({blocks:e,horizontalAlignment:t,verticalAlignment:n,direction:r,sender:i,timestamp:o,metadata:s,messageId:a,isReadOnly:l,sendMessage:u,...f},c)=>{const{message:{blocks:{row:h}}}=me;return k.jsx("div",{"data-horizontal":t,"data-vertical":n,...f,...h,ref:c,children:e.map((d,m)=>k.jsx(Dn,{block:{...d,direction:r,timestamp:o,sender:i,messageId:a,isReadOnly:l,sendMessage:u}},m))})});Bp.displayName="Row";function UT(e){return Object.prototype.toString.call(e)==="[object Object]"}function zp(e){return UT(e)||Array.isArray(e)}function jT(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Qa(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||{})),o=JSON.stringify(Object.keys(t.breakpoints||{}));return i!==o?!1:n.every(s=>{const a=e[s],l=t[s];return typeof a=="function"?`${a}`==`${l}`:!zp(a)||!zp(l)?a===l:Qa(a,l)})}function Up(e){return e.concat().sort((t,n)=>t.name>n.name?1:-1).map(t=>t.options)}function HT(e,t){if(e.length!==t.length)return!1;const n=Up(e),r=Up(t);return n.every((i,o)=>{const s=r[o];return Qa(i,s)})}function Za(e){return typeof e=="number"}function Ja(e){return typeof e=="string"}function ro(e){return typeof e=="boolean"}function jp(e){return Object.prototype.toString.call(e)==="[object Object]"}function $e(e){return Math.abs(e)}function Xa(e){return Math.sign(e)}function Wr(e,t){return $e(e-t)}function VT(e,t){if(e===0||t===0||$e(e)<=$e(t))return 0;const n=Wr($e(e),$e(t));return $e(n/e)}function WT(e){return Math.round(e*100)/100}function qr(e){return Kr(e).map(Number)}function Dt(e){return e[Yr(e)]}function Yr(e){return Math.max(0,e.length-1)}function el(e,t){return t===Yr(e)}function Hp(e,t=0){return Array.from(Array(e),(n,r)=>t+r)}function Kr(e){return Object.keys(e)}function Vp(e,t){return[e,t].reduce((n,r)=>(Kr(r).forEach(i=>{const o=n[i],s=r[i],a=jp(o)&&jp(s);n[i]=a?Vp(o,s):s}),n),{})}function tl(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function qT(e,t){const n={start:r,center:i,end:o};function r(){return 0}function i(l){return o(l)/2}function o(l){return t-l}function s(l,u){return Ja(e)?n[e](l):e(t,l,u)}return{measure:s}}function Gr(){let e=[];function t(i,o,s,a={passive:!0}){let l;if("addEventListener"in i)i.addEventListener(o,s,a),l=()=>i.removeEventListener(o,s,a);else{const u=i;u.addListener(s),l=()=>u.removeListener(s)}return e.push(l),r}function n(){e=e.filter(i=>i())}const r={add:t,clear:n};return r}function YT(e,t,n,r){const i=Gr(),o=1e3/60;let s=null,a=0,l=0;function u(){i.add(e,"visibilitychange",()=>{e.hidden&&m()})}function f(){d(),i.clear()}function c(g){if(!l)return;s||(s=g,n(),n());const y=g-s;for(s=g,a+=y;a>=o;)n(),a-=o;const v=a/o;r(v),l&&(l=t.requestAnimationFrame(c))}function h(){l||(l=t.requestAnimationFrame(c))}function d(){t.cancelAnimationFrame(l),s=null,a=0,l=0}function m(){s=null,a=0}return{init:u,destroy:f,start:h,stop:d,update:n,render:r}}function KT(e,t){const n=t==="rtl",r=e==="y",i=r?"y":"x",o=r?"x":"y",s=!r&&n?-1:1,a=f(),l=c();function u(m){const{height:p,width:g}=m;return r?p:g}function f(){return r?"top":n?"right":"left"}function c(){return r?"bottom":n?"left":"right"}function h(m){return m*s}return{scroll:i,cross:o,startEdge:a,endEdge:l,measureSize:u,direction:h}}function On(e=0,t=0){const n=$e(e-t);function r(u){return u<e}function i(u){return u>t}function o(u){return r(u)||i(u)}function s(u){return o(u)?r(u)?e:t:u}function a(u){return n?u-n*Math.ceil((u-t)/n):u}return{length:n,max:t,min:e,constrain:s,reachedAny:o,reachedMax:i,reachedMin:r,removeOffset:a}}function Wp(e,t,n){const{constrain:r}=On(0,e),i=e+1;let o=s(t);function s(h){return n?$e((i+h)%i):r(h)}function a(){return o}function l(h){return o=s(h),c}function u(h){return f().set(a()+h)}function f(){return Wp(e,a(),n)}const c={get:a,set:l,add:u,clone:f};return c}function GT(e,t,n,r,i,o,s,a,l,u,f,c,h,d,m,p,g,y,v){const{cross:w,direction:E}=e,S=["INPUT","SELECT","TEXTAREA"],C={passive:!1},I=Gr(),M=Gr(),P=On(50,225).constrain(d.measure(20)),T={mouse:300,touch:400},O={mouse:500,touch:600},U=m?43:25;let F=!1,L=0,R=0,N=!1,j=!1,B=!1,W=!1;function b($){if(!v)return;function ne(Oe){(ro(v)||v($,Oe))&&q(Oe)}const ge=t;I.add(ge,"dragstart",Oe=>Oe.preventDefault(),C).add(ge,"touchmove",()=>{},C).add(ge,"touchend",()=>{}).add(ge,"touchstart",ne).add(ge,"mousedown",ne).add(ge,"touchcancel",X).add(ge,"contextmenu",X).add(ge,"click",se,!0)}function _(){I.clear(),M.clear()}function H(){const $=W?n:t;M.add($,"touchmove",Q,C).add($,"touchend",X).add($,"mousemove",Q,C).add($,"mouseup",X)}function x($){const ne=$.nodeName||"";return S.includes(ne)}function V(){return(m?O:T)[W?"mouse":"touch"]}function Y($,ne){const ge=c.add(Xa($)*-1),Oe=f.byDistance($,!m).distance;return m||$e($)<P?Oe:g&&ne?Oe*.5:f.byIndex(ge.get(),0).distance}function q($){const ne=tl($,r);W=ne,B=m&&ne&&!$.buttons&&F,F=Wr(i.get(),s.get())>=2,!(ne&&$.button!==0)&&(x($.target)||(N=!0,o.pointerDown($),u.useFriction(0).useDuration(0),i.set(s),H(),L=o.readPoint($),R=o.readPoint($,w),h.emit("pointerDown")))}function Q($){if(!tl($,r)&&$.touches.length>=2)return X($);const ge=o.readPoint($),Oe=o.readPoint($,w),J=Wr(ge,L),ue=Wr(Oe,R);if(!j&&!W&&(!$.cancelable||(j=J>ue,!j)))return X($);const de=o.pointerMove($);J>p&&(B=!0),u.useFriction(.3).useDuration(.75),a.start(),i.add(E(de)),$.preventDefault()}function X($){const ge=f.byDistance(0,!1).index!==c.get(),Oe=o.pointerUp($)*V(),J=Y(E(Oe),ge),ue=VT(Oe,J),de=U-10*ue,fe=y+ue/50;j=!1,N=!1,M.clear(),u.useDuration(de).useFriction(fe),l.distance(J,!m),W=!1,h.emit("pointerUp")}function se($){B&&($.stopPropagation(),$.preventDefault(),B=!1)}function G(){return N}return{init:b,destroy:_,pointerDown:G}}function QT(e,t){let r,i;function o(c){return c.timeStamp}function s(c,h){const m=`client${(h||e.scroll)==="x"?"X":"Y"}`;return(tl(c,t)?c:c.touches[0])[m]}function a(c){return r=c,i=c,s(c)}function l(c){const h=s(c)-s(i),d=o(c)-o(r)>170;return i=c,d&&(r=c),h}function u(c){if(!r||!i)return 0;const h=s(i)-s(r),d=o(c)-o(r),m=o(c)-o(i)>170,p=h/d;return d&&!m&&$e(p)>.1?p:0}return{pointerDown:a,pointerMove:l,pointerUp:u,readPoint:s}}function ZT(){function e(n){const{offsetTop:r,offsetLeft:i,offsetWidth:o,offsetHeight:s}=n;return{top:r,right:i+o,bottom:r+s,left:i,width:o,height:s}}return{measure:e}}function JT(e){function t(r){return e*(r/100)}return{measure:t}}function XT(e,t,n,r,i,o,s){const a=[e].concat(r);let l,u,f=[],c=!1;function h(g){return i.measureSize(s.measure(g))}function d(g){if(!o)return;u=h(e),f=r.map(h);function y(v){for(const w of v){if(c)return;const E=w.target===e,S=r.indexOf(w.target),C=E?u:f[S],I=h(E?e:r[S]);if($e(I-C)>=.5){g.reInit(),t.emit("resize");break}}}l=new ResizeObserver(v=>{(ro(o)||o(g,v))&&y(v)}),n.requestAnimationFrame(()=>{a.forEach(v=>l.observe(v))})}function m(){c=!0,l&&l.disconnect()}return{init:d,destroy:m}}function eI(e,t,n,r,i,o){let s=0,a=0,l=i,u=o,f=e.get(),c=0;function h(){const C=r.get()-e.get(),I=!l;let M=0;return I?(s=0,n.set(r),e.set(r),M=C):(n.set(e),s+=C/l,s*=u,f+=s,e.add(s),M=f-c),a=Xa(M),c=f,S}function d(){const C=r.get()-t.get();return $e(C)<.001}function m(){return l}function p(){return a}function g(){return s}function y(){return w(i)}function v(){return E(o)}function w(C){return l=C,S}function E(C){return u=C,S}const S={direction:p,duration:m,velocity:g,seek:h,settled:d,useBaseFriction:v,useBaseDuration:y,useFriction:E,useDuration:w};return S}function tI(e,t,n,r,i){const o=i.measure(10),s=i.measure(50),a=On(.1,.99);let l=!1;function u(){return!(l||!e.reachedAny(n.get())||!e.reachedAny(t.get()))}function f(d){if(!u())return;const m=e.reachedMin(t.get())?"min":"max",p=$e(e[m]-t.get()),g=n.get()-t.get(),y=a.constrain(p/s);n.subtract(g*y),!d&&$e(g)<o&&(n.set(e.constrain(n.get())),r.useDuration(25).useBaseFriction())}function c(d){l=!d}return{shouldConstrain:u,constrain:f,toggleActive:c}}function nI(e,t,n,r,i){const o=On(-t+e,0),s=c(),a=f(),l=h();function u(m,p){return Wr(m,p)<=1}function f(){const m=s[0],p=Dt(s),g=s.lastIndexOf(m),y=s.indexOf(p)+1;return On(g,y)}function c(){return n.map((m,p)=>{const{min:g,max:y}=o,v=o.constrain(m),w=!p,E=el(n,p);return w?y:E||u(g,v)?g:u(y,v)?y:v}).map(m=>parseFloat(m.toFixed(3)))}function h(){if(t<=e+i)return[o.max];if(r==="keepSnaps")return s;const{min:m,max:p}=a;return s.slice(m,p)}return{snapsContained:l,scrollContainLimit:a}}function rI(e,t,n){const r=t[0],i=n?r-e:Dt(t);return{limit:On(i,r)}}function iI(e,t,n,r){const o=t.min+.1,s=t.max+.1,{reachedMin:a,reachedMax:l}=On(o,s);function u(h){return h===1?l(n.get()):h===-1?a(n.get()):!1}function f(h){if(!u(h))return;const d=e*(h*-1);r.forEach(m=>m.add(d))}return{loop:f}}function oI(e){const{max:t,length:n}=e;function r(o){const s=o-t;return n?s/-n:0}return{get:r}}function sI(e,t,n,r,i){const{startEdge:o,endEdge:s}=e,{groupSlides:a}=i,l=c().map(t.measure),u=h(),f=d();function c(){return a(r).map(p=>Dt(p)[s]-p[0][o]).map($e)}function h(){return r.map(p=>n[o]-p[o]).map(p=>-$e(p))}function d(){return a(u).map(p=>p[0]).map((p,g)=>p+l[g])}return{snaps:u,snapsAligned:f}}function aI(e,t,n,r,i,o){const{groupSlides:s}=i,{min:a,max:l}=r,u=f();function f(){const h=s(o),d=!e||t==="keepSnaps";return n.length===1?[o]:d?h:h.slice(a,l).map((m,p,g)=>{const y=!p,v=el(g,p);if(y){const w=Dt(g[0])+1;return Hp(w)}if(v){const w=Yr(o)-Dt(g)[0]+1;return Hp(w,Dt(g)[0])}return m})}return{slideRegistry:u}}function lI(e,t,n,r,i){const{reachedAny:o,removeOffset:s,constrain:a}=r;function l(m){return m.concat().sort((p,g)=>$e(p)-$e(g))[0]}function u(m){const p=e?s(m):a(m),g=t.map((v,w)=>({diff:f(v-p,0),index:w})).sort((v,w)=>$e(v.diff)-$e(w.diff)),{index:y}=g[0];return{index:y,distance:p}}function f(m,p){const g=[m,m+n,m-n];if(!e)return m;if(!p)return l(g);const y=g.filter(v=>Xa(v)===p);return y.length?l(y):Dt(g)-n}function c(m,p){const g=t[m]-i.get(),y=f(g,p);return{index:m,distance:y}}function h(m,p){const g=i.get()+m,{index:y,distance:v}=u(g),w=!e&&o(g);if(!p||w)return{index:y,distance:m};const E=t[y]-v,S=m+f(E,0);return{index:y,distance:S}}return{byDistance:h,byIndex:c,shortcut:f}}function uI(e,t,n,r,i,o,s){function a(c){const h=c.distance,d=c.index!==t.get();o.add(h),h&&(r.duration()?e.start():(e.update(),e.render(1),e.update())),d&&(n.set(t.get()),t.set(c.index),s.emit("select"))}function l(c,h){const d=i.byDistance(c,h);a(d)}function u(c,h){const d=t.clone().set(c),m=i.byIndex(d.get(),h);a(m)}return{distance:l,index:u}}function cI(e,t,n,r,i,o,s,a){const l={passive:!0,capture:!0};let u=0;function f(d){if(!a)return;function m(p){if(new Date().getTime()-u>10)return;s.emit("slideFocusStart"),e.scrollLeft=0;const v=n.findIndex(w=>w.includes(p));Za(v)&&(i.useDuration(0),r.index(v,0),s.emit("slideFocus"))}o.add(document,"keydown",c,!1),t.forEach((p,g)=>{o.add(p,"focus",y=>{(ro(a)||a(d,y))&&m(g)},l)})}function c(d){d.code==="Tab"&&(u=new Date().getTime())}return{init:f}}function Qr(e){let t=e;function n(){return t}function r(l){t=s(l)}function i(l){t+=s(l)}function o(l){t-=s(l)}function s(l){return Za(l)?l:l.get()}return{get:n,set:r,add:i,subtract:o}}function qp(e,t){const n=e.scroll==="x"?s:a,r=t.style;let i=null,o=!1;function s(h){return`translate3d(${h}px,0px,0px)`}function a(h){return`translate3d(0px,${h}px,0px)`}function l(h){if(o)return;const d=WT(e.direction(h));d!==i&&(r.transform=n(d),i=d)}function u(h){o=!h}function f(){o||(r.transform="",t.getAttribute("style")||t.removeAttribute("style"))}return{clear:f,to:l,toggleActive:u}}function fI(e,t,n,r,i,o,s,a,l){const f=qr(i),c=qr(i).reverse(),h=y().concat(v());function d(I,M){return I.reduce((P,T)=>P-i[T],M)}function m(I,M){return I.reduce((P,T)=>d(P,M)>0?P.concat([T]):P,[])}function p(I){return o.map((M,P)=>({start:M-r[P]+.5+I,end:M+t-.5+I}))}function g(I,M,P){const T=p(M);return I.map(O=>{const U=P?0:-n,F=P?n:0,L=P?"end":"start",R=T[O][L];return{index:O,loopPoint:R,slideLocation:Qr(-1),translate:qp(e,l[O]),target:()=>a.get()>R?U:F}})}function y(){const I=s[0],M=m(c,I);return g(M,n,!1)}function v(){const I=t-s[0]-1,M=m(f,I);return g(M,-n,!0)}function w(){return h.every(({index:I})=>{const M=f.filter(P=>P!==I);return d(M,t)<=.1})}function E(){h.forEach(I=>{const{target:M,translate:P,slideLocation:T}=I,O=M();O!==T.get()&&(P.to(O),T.set(O))})}function S(){h.forEach(I=>I.translate.clear())}return{canLoop:w,clear:S,loop:E,loopPoints:h}}function dI(e,t,n){let r,i=!1;function o(l){if(!n)return;function u(f){for(const c of f)if(c.type==="childList"){l.reInit(),t.emit("slidesChanged");break}}r=new MutationObserver(f=>{i||(ro(n)||n(l,f))&&u(f)}),r.observe(e,{childList:!0})}function s(){r&&r.disconnect(),i=!0}return{init:o,destroy:s}}function hI(e,t,n,r){const i={};let o=null,s=null,a,l=!1;function u(){a=new IntersectionObserver(m=>{l||(m.forEach(p=>{const g=t.indexOf(p.target);i[g]=p}),o=null,s=null,n.emit("slidesInView"))},{root:e.parentElement,threshold:r}),t.forEach(m=>a.observe(m))}function f(){a&&a.disconnect(),l=!0}function c(m){return Kr(i).reduce((p,g)=>{const y=parseInt(g),{isIntersecting:v}=i[y];return(m&&v||!m&&!v)&&p.push(y),p},[])}function h(m=!0){if(m&&o)return o;if(!m&&s)return s;const p=c(m);return m&&(o=p),m||(s=p),p}return{init:u,destroy:f,get:h}}function pI(e,t,n,r,i,o){const{measureSize:s,startEdge:a,endEdge:l}=e,u=n[0]&&i,f=m(),c=p(),h=n.map(s),d=g();function m(){if(!u)return 0;const v=n[0];return $e(t[a]-v[a])}function p(){if(!u)return 0;const v=o.getComputedStyle(Dt(r));return parseFloat(v.getPropertyValue(`margin-${l}`))}function g(){return n.map((v,w,E)=>{const S=!w,C=el(E,w);return S?h[w]+f:C?h[w]+c:E[w+1][a]-v[a]}).map($e)}return{slideSizes:h,slideSizesWithGaps:d,startGap:f,endGap:c}}function mI(e,t,n,r,i,o,s,a,l){const{startEdge:u,endEdge:f,direction:c}=e,h=Za(n);function d(y,v){return qr(y).filter(w=>w%v===0).map(w=>y.slice(w,w+v))}function m(y){return y.length?qr(y).reduce((v,w,E)=>{const S=Dt(v)||0,C=S===0,I=w===Yr(y),M=i[u]-o[S][u],P=i[u]-o[w][f],T=!r&&C?c(s):0,O=!r&&I?c(a):0,U=$e(P-O-(M+T));return E&&U>t+l&&v.push(w),I&&v.push(y.length),v},[]).map((v,w,E)=>{const S=Math.max(E[w-1]||0);return y.slice(S,v)}):[]}function p(y){return h?d(y,n):m(y)}return{groupSlides:p}}function gI(e,t,n,r,i,o,s){const{align:a,axis:l,direction:u,startIndex:f,loop:c,duration:h,dragFree:d,dragThreshold:m,inViewThreshold:p,slidesToScroll:g,skipSnaps:y,containScroll:v,watchResize:w,watchSlides:E,watchDrag:S,watchFocus:C}=o,I=2,M=ZT(),P=M.measure(t),T=n.map(M.measure),O=KT(l,u),U=O.measureSize(P),F=JT(U),L=qT(a,U),R=!c&&!!v,N=c||!!v,{slideSizes:j,slideSizesWithGaps:B,startGap:W,endGap:b}=pI(O,P,T,n,N,i),_=mI(O,U,g,c,P,T,W,b,I),{snaps:H,snapsAligned:x}=sI(O,L,P,T,_),V=-Dt(H)+Dt(B),{snapsContained:Y,scrollContainLimit:q}=nI(U,V,x,v,I),Q=R?Y:x,{limit:X}=rI(V,Q,c),se=Wp(Yr(Q),f,c),G=se.clone(),te=qr(n),$=({dragHandler:he,scrollBody:He,scrollBounds:Ge,options:{loop:Ze}})=>{Ze||Ge.constrain(he.pointerDown()),He.seek()},ne=({scrollBody:he,translate:He,location:Ge,offsetLocation:Ze,previousLocation:Et,scrollLooper:Rt,slideLooper:Qe,dragHandler:Ct,animation:at,eventHandler:ns,scrollBounds:NP,options:{loop:Yv}},Kv)=>{const Gv=he.settled(),_P=!NP.shouldConstrain(),Qv=Yv?Gv:Gv&&_P,Zv=Qv&&!Ct.pointerDown();Zv&&at.stop();const PP=Ge.get()*Kv+Et.get()*(1-Kv);Ze.set(PP),Yv&&(Rt.loop(he.direction()),Qe.loop()),He.to(Ze.get()),Zv&&ns.emit("settle"),Qv||ns.emit("scroll")},ge=YT(r,i,()=>$(le),he=>ne(le,he)),Oe=.68,J=Q[se.get()],ue=Qr(J),de=Qr(J),fe=Qr(J),Ae=Qr(J),Fe=eI(ue,fe,de,Ae,h,Oe),Me=lI(c,Q,V,X,Ae),je=uI(ge,se,G,Fe,Me,Ae,s),ee=oI(X),ae=Gr(),z=hI(t,n,s,p),{slideRegistry:K}=aI(R,v,Q,q,_,te),oe=cI(e,n,K,je,Fe,ae,s,C),le={ownerDocument:r,ownerWindow:i,eventHandler:s,containerRect:P,slideRects:T,animation:ge,axis:O,dragHandler:GT(O,e,r,i,Ae,QT(O,i),ue,ge,je,Fe,Me,se,s,F,d,m,y,Oe,S),eventStore:ae,percentOfView:F,index:se,indexPrevious:G,limit:X,location:ue,offsetLocation:fe,previousLocation:de,options:o,resizeHandler:XT(t,s,i,n,O,w,M),scrollBody:Fe,scrollBounds:tI(X,fe,Ae,Fe,F),scrollLooper:iI(V,X,fe,[ue,fe,de,Ae]),scrollProgress:ee,scrollSnapList:Q.map(ee.get),scrollSnaps:Q,scrollTarget:Me,scrollTo:je,slideLooper:fI(O,U,V,j,B,H,Q,fe,n),slideFocus:oe,slidesHandler:dI(t,s,E),slidesInView:z,slideIndexes:te,slideRegistry:K,slidesToScroll:_,target:Ae,translate:qp(O,t)};return le}function yI(){let e={},t;function n(u){t=u}function r(u){return e[u]||[]}function i(u){return r(u).forEach(f=>f(t,u)),l}function o(u,f){return e[u]=r(u).concat([f]),l}function s(u,f){return e[u]=r(u).filter(c=>c!==f),l}function a(){e={}}const l={init:n,emit:i,off:s,on:o,clear:a};return l}const vI={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function bI(e){function t(o,s){return Vp(o,s||{})}function n(o){const s=o.breakpoints||{},a=Kr(s).filter(l=>e.matchMedia(l).matches).map(l=>s[l]).reduce((l,u)=>t(l,u),{});return t(o,a)}function r(o){return o.map(s=>Kr(s.breakpoints||{})).reduce((s,a)=>s.concat(a),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:n,optionsMediaQueries:r}}function wI(e){let t=[];function n(o,s){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(o=>o.destroy())}return{init:n,destroy:r}}function io(e,t,n){const r=e.ownerDocument,i=r.defaultView,o=bI(i),s=wI(o),a=Gr(),l=yI(),{mergeOptions:u,optionsAtMedia:f,optionsMediaQueries:c}=o,{on:h,off:d,emit:m}=l,p=O;let g=!1,y,v=u(vI,io.globalOptions),w=u(v),E=[],S,C,I;function M(){const{container:te,slides:$}=w;C=(Ja(te)?e.querySelector(te):te)||e.children[0];const ge=Ja($)?C.querySelectorAll($):$;I=[].slice.call(ge||C.children)}function P(te){const $=gI(e,C,I,r,i,te,l);if(te.loop&&!$.slideLooper.canLoop()){const ne=Object.assign({},te,{loop:!1});return P(ne)}return $}function T(te,$){g||(v=u(v,te),w=f(v),E=$||E,M(),y=P(w),c([v,...E.map(({options:ne})=>ne)]).forEach(ne=>a.add(ne,"change",O)),w.active&&(y.translate.to(y.location.get()),y.animation.init(),y.slidesInView.init(),y.slideFocus.init(G),y.eventHandler.init(G),y.resizeHandler.init(G),y.slidesHandler.init(G),y.options.loop&&y.slideLooper.loop(),C.offsetParent&&I.length&&y.dragHandler.init(G),S=s.init(G,E)))}function O(te,$){const ne=_();U(),T(u({startIndex:ne},te),$),l.emit("reInit")}function U(){y.dragHandler.destroy(),y.eventStore.clear(),y.translate.clear(),y.slideLooper.clear(),y.resizeHandler.destroy(),y.slidesHandler.destroy(),y.slidesInView.destroy(),y.animation.destroy(),s.destroy(),a.clear()}function F(){g||(g=!0,a.clear(),U(),l.emit("destroy"),l.clear())}function L(te,$,ne){!w.active||g||(y.scrollBody.useBaseFriction().useDuration($===!0?0:w.duration),y.scrollTo.index(te,ne||0))}function R(te){const $=y.index.add(1).get();L($,te,-1)}function N(te){const $=y.index.add(-1).get();L($,te,1)}function j(){return y.index.add(1).get()!==_()}function B(){return y.index.add(-1).get()!==_()}function W(){return y.scrollSnapList}function b(){return y.scrollProgress.get(y.offsetLocation.get())}function _(){return y.index.get()}function H(){return y.indexPrevious.get()}function x(){return y.slidesInView.get()}function V(){return y.slidesInView.get(!1)}function Y(){return S}function q(){return y}function Q(){return e}function X(){return C}function se(){return I}const G={canScrollNext:j,canScrollPrev:B,containerNode:X,internalEngine:q,destroy:F,off:d,on:h,emit:m,plugins:Y,previousScrollSnap:H,reInit:p,rootNode:Q,scrollNext:R,scrollPrev:N,scrollProgress:b,scrollSnapList:W,scrollTo:L,selectedScrollSnap:_,slideNodes:se,slidesInView:x,slidesNotInView:V};return T(t,n),setTimeout(()=>l.emit("init"),0),G}io.globalOptions=void 0;function nl(e={},t=[]){const n=D.useRef(e),r=D.useRef(t),[i,o]=D.useState(),[s,a]=D.useState(),l=D.useCallback(()=>{i&&i.reInit(n.current,r.current)},[i]);return D.useEffect(()=>{Qa(n.current,e)||(n.current=e,l())},[e,l]),D.useEffect(()=>{HT(r.current,t)||(r.current=t,l())},[t,l]),D.useEffect(()=>{if(jT()&&s){io.globalOptions=nl.globalOptions;const u=io(s,n.current,r.current);return o(u),()=>u.destroy()}else o(void 0)},[s,o]),[a,i]}nl.globalOptions=void 0;const Yp=D.forwardRef(({blocks:e,direction:t,sender:n,timestamp:r,messageId:i,isReadOnly:o,sendMessage:s},a)=>{const[l,u]=nl({skipSnaps:!0,loop:!0}),[f,c]=D.useState(!0),[h,d]=D.useState(!0),m=D.useCallback(()=>u==null?void 0:u.scrollPrev(),[u]),p=D.useCallback(()=>u==null?void 0:u.scrollNext(),[u]),{message:{blocks:{carousel:g}}}=me,y=D.useCallback(v=>{c(!(v!=null&&v.canScrollPrev())),d(!(v!=null&&v.canScrollNext()))},[]);return D.useEffect(()=>{u&&(y(u),u.on("reInit",y),u.on("select",y))},[u,y]),k.jsxs("div",{...g==null?void 0:g.container,"data-container":"carousel",ref:l,children:[k.jsx("div",{ref:a,...g==null?void 0:g.slidesContainer,children:e.map((v,w)=>k.jsx(Dn,{block:{...v,direction:t,timestamp:r,sender:n,messageId:i,sendMessage:s,isReadOnly:o}},w))}),e.length>1&&k.jsxs(k.Fragment,{children:[k.jsx(ap,{...g==null?void 0:g.backButton,"data-disabled":f?"":void 0,onClick:m}),k.jsx(lp,{...g==null?void 0:g.nextButton,"data-disabled":h?"":void 0,onClick:p})]})]})});Yp.displayName="Carousel";const Kp=Math.floor;function Gp(e){return Qp(e)?(e.nodeName||"").toLowerCase():"#document"}function Zr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function SI(e){var t;return(t=(Qp(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Qp(e){return e instanceof Node||e instanceof Zr(e).Node}function kt(e){return e instanceof Element||e instanceof Zr(e).Element}function Xn(e){return e instanceof HTMLElement||e instanceof Zr(e).HTMLElement}function rl(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Zr(e).ShadowRoot}function xI(e){return["html","body","#document"].includes(Gp(e))}function kI(e){return Zr(e).getComputedStyle(e)}function EI(e){if(Gp(e)==="html")return e;const t=e.assignedSlot||e.parentNode||rl(e)&&e.host||SI(e);return rl(t)?t.host:t}function un(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 ft(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&rl(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Zp(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function CI(){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(Zp())||t.test(CI()))&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Xp(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 em(){return/apple/i.test(navigator.vendor)}function AI(){return Zp().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function tm(e,t){return["mouse","pen"].includes(e)}function TI(e){return"nativeEvent"in e}function II(e){return e.matches("html,body")}function Nt(e){return(e==null?void 0:e.ownerDocument)||document}function il(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 nm(e){return"composedPath"in e?e.composedPath()[0]:e.target}const OI="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function rm(e){return Xn(e)&&e.matches(OI)}function Je(e){e.preventDefault(),e.stopPropagation()}const er=Math.min,gt=Math.max,oo=Math.round,so=Math.floor,zt=e=>({x:e,y:e});function im(e,t,n){return gt(e,er(t,n))}function ao(e,t){return typeof e=="function"?e(t):e}function Jr(e){return e.split("-")[0]}function ol(e){return e.split("-")[1]}function om(e){return e==="x"?"y":"x"}function MI(e){return e==="y"?"height":"width"}const DI=new Set(["top","bottom"]);function Xr(e){return DI.has(Jr(e))?"y":"x"}function NI(e){return om(Xr(e))}function _I(e){return{top:0,right:0,bottom:0,left:0,...e}}function PI(e){return typeof e!="number"?_I(e):{top:e,right:e,bottom:e,left:e}}function lo(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function sm(e,t,n){let{reference:r,floating:i}=e;const o=Xr(t),s=NI(t),a=MI(s),l=Jr(t),u=o==="y",f=r.x+r.width/2-i.width/2,c=r.y+r.height/2-i.height/2,h=r[a]/2-i[a]/2;let d;switch(l){case"top":d={x:f,y:r.y-i.height};break;case"bottom":d={x:f,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:c};break;case"left":d={x:r.x-i.width,y:c};break;default:d={x:r.x,y:r.y}}switch(ol(t)){case"start":d[s]-=h*(n&&u?-1:1);break;case"end":d[s]+=h*(n&&u?-1:1);break}return d}const LI=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:f,y:c}=sm(u,r,l),h=r,d={},m=0;for(let p=0;p<a.length;p++){const{name:g,fn:y}=a[p],{x:v,y:w,data:E,reset:S}=await y({x:f,y:c,initialPlacement:r,placement:h,strategy:i,middlewareData:d,rects:u,platform:s,elements:{reference:e,floating:t}});f=v??f,c=w??c,d={...d,[g]:{...d[g],...E}},S&&m<=50&&(m++,typeof S=="object"&&(S.placement&&(h=S.placement),S.rects&&(u=S.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):S.rects),{x:f,y:c}=sm(u,h,l)),p=-1)}return{x:f,y:c,placement:h,strategy:i,middlewareData:d}};async function am(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:c="floating",altBoundary:h=!1,padding:d=0}=ao(t,e),m=PI(d),g=a[h?c==="floating"?"reference":"floating":c],y=lo(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(g)))==null||n?g:g.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:u,rootBoundary:f,strategy:l})),v=c==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,w=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),E=await(o.isElement==null?void 0:o.isElement(w))?await(o.getScale==null?void 0:o.getScale(w))||{x:1,y:1}:{x:1,y:1},S=lo(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:w,strategy:l}):v);return{top:(y.top-S.top+m.top)/E.y,bottom:(S.bottom-y.bottom+m.bottom)/E.y,left:(y.left-S.left+m.left)/E.x,right:(S.right-y.right+m.right)/E.x}}const FI=new Set(["left","top"]);async function RI(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=Jr(n),a=ol(n),l=Xr(n)==="y",u=FI.has(s)?-1:1,f=o&&l?-1:1,c=ao(t,e);let{mainAxis:h,crossAxis:d,alignmentAxis:m}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:c.mainAxis||0,crossAxis:c.crossAxis||0,alignmentAxis:c.alignmentAxis};return a&&typeof m=="number"&&(d=a==="end"?m*-1:m),l?{x:d*f,y:h*u}:{x:h*u,y:d*f}}const $I=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:s,middlewareData:a}=t,l=await RI(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:s}}}}},BI=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:g=>{let{x:y,y:v}=g;return{x:y,y:v}}},...l}=ao(e,t),u={x:n,y:r},f=await am(t,l),c=Xr(Jr(i)),h=om(c);let d=u[h],m=u[c];if(o){const g=h==="y"?"top":"left",y=h==="y"?"bottom":"right",v=d+f[g],w=d-f[y];d=im(v,d,w)}if(s){const g=c==="y"?"top":"left",y=c==="y"?"bottom":"right",v=m+f[g],w=m-f[y];m=im(v,m,w)}const p=a.fn({...t,[h]:d,[c]:m});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[h]:o,[c]:s}}}}}},zI=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:s,elements:a}=t,{apply:l=()=>{},...u}=ao(e,t),f=await am(t,u),c=Jr(i),h=ol(i),d=Xr(i)==="y",{width:m,height:p}=o.floating;let g,y;c==="top"||c==="bottom"?(g=c,y=h===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(y=c,g=h==="end"?"top":"bottom");const v=p-f.top-f.bottom,w=m-f.left-f.right,E=er(p-f[g],v),S=er(m-f[y],w),C=!t.middlewareData.shift;let I=E,M=S;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(I=v),C&&!h){const T=gt(f.left,0),O=gt(f.right,0),U=gt(f.top,0),F=gt(f.bottom,0);d?M=m-2*(T!==0||O!==0?T+O:gt(f.left,f.right)):I=p-2*(U!==0||F!==0?U+F:gt(f.top,f.bottom))}await l({...t,availableWidth:M,availableHeight:I});const P=await s.getDimensions(a.floating);return m!==P.width||p!==P.height?{reset:{rects:!0}}:{}}}};function uo(){return typeof window<"u"}function tr(e){return lm(e)?(e.nodeName||"").toLowerCase():"#document"}function yt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ut(e){var t;return(t=(lm(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function lm(e){return uo()?e instanceof Node||e instanceof yt(e).Node:!1}function _t(e){return uo()?e instanceof Element||e instanceof yt(e).Element:!1}function jt(e){return uo()?e instanceof HTMLElement||e instanceof yt(e).HTMLElement:!1}function um(e){return!uo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof yt(e).ShadowRoot}const UI=new Set(["inline","contents"]);function ei(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Pt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!UI.has(i)}const jI=new Set(["table","td","th"]);function HI(e){return jI.has(tr(e))}const VI=[":popover-open",":modal"];function co(e){return VI.some(t=>{try{return e.matches(t)}catch{return!1}})}const WI=["transform","translate","scale","rotate","perspective"],qI=["transform","translate","scale","rotate","perspective","filter"],YI=["paint","layout","strict","content"];function sl(e){const t=al(),n=_t(e)?Pt(e):e;return WI.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||qI.some(r=>(n.willChange||"").includes(r))||YI.some(r=>(n.contain||"").includes(r))}function KI(e){let t=cn(e);for(;jt(t)&&!nr(t);){if(sl(t))return t;if(co(t))return null;t=cn(t)}return null}function al(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const GI=new Set(["html","body","#document"]);function nr(e){return GI.has(tr(e))}function Pt(e){return yt(e).getComputedStyle(e)}function fo(e){return _t(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function cn(e){if(tr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||um(e)&&e.host||Ut(e);return um(t)?t.host:t}function cm(e){const t=cn(e);return nr(t)?e.ownerDocument?e.ownerDocument.body:e.body:jt(t)&&ei(t)?t:cm(t)}function fn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=cm(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=yt(i);if(o){const a=ll(s);return t.concat(s,s.visualViewport||[],ei(i)?i:[],a&&n?fn(a):[])}return t.concat(i,fn(i,[],n))}function ll(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function fm(e){const t=Pt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=jt(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=oo(n)!==o||oo(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function ul(e){return _t(e)?e:e.contextElement}function rr(e){const t=ul(e);if(!jt(t))return zt(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=fm(t);let s=(o?oo(n.width):n.width)/r,a=(o?oo(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const QI=zt(0);function dm(e){const t=yt(e);return!al()||!t.visualViewport?QI:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ZI(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==yt(e)?!1:t}function Mn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=ul(e);let s=zt(1);t&&(r?_t(r)&&(s=rr(r)):s=rr(e));const a=ZI(o,n,r)?dm(o):zt(0);let l=(i.left+a.x)/s.x,u=(i.top+a.y)/s.y,f=i.width/s.x,c=i.height/s.y;if(o){const h=yt(o),d=r&&_t(r)?yt(r):r;let m=h,p=ll(m);for(;p&&r&&d!==m;){const g=rr(p),y=p.getBoundingClientRect(),v=Pt(p),w=y.left+(p.clientLeft+parseFloat(v.paddingLeft))*g.x,E=y.top+(p.clientTop+parseFloat(v.paddingTop))*g.y;l*=g.x,u*=g.y,f*=g.x,c*=g.y,l+=w,u+=E,m=yt(p),p=ll(m)}}return lo({width:f,height:c,x:l,y:u})}function ho(e,t){const n=fo(e).scrollLeft;return t?t.left+n:Mn(Ut(e)).left+n}function hm(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-ho(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function JI(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",s=Ut(r),a=t?co(t.floating):!1;if(r===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},u=zt(1);const f=zt(0),c=jt(r);if((c||!c&&!o)&&((tr(r)!=="body"||ei(s))&&(l=fo(r)),jt(r))){const d=Mn(r);u=rr(r),f.x=d.x+r.clientLeft,f.y=d.y+r.clientTop}const h=s&&!c&&!o?hm(s,l):zt(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+f.x+h.x,y:n.y*u.y-l.scrollTop*u.y+f.y+h.y}}function XI(e){return Array.from(e.getClientRects())}function eO(e){const t=Ut(e),n=fo(e),r=e.ownerDocument.body,i=gt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=gt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+ho(e);const a=-n.scrollTop;return Pt(r).direction==="rtl"&&(s+=gt(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}const pm=25;function tO(e,t){const n=yt(e),r=Ut(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;const f=al();(!f||f&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const u=ho(r);if(u<=0){const f=r.ownerDocument,c=f.body,h=getComputedStyle(c),d=f.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,m=Math.abs(r.clientWidth-c.clientWidth-d);m<=pm&&(o-=m)}else u<=pm&&(o+=u);return{width:o,height:s,x:a,y:l}}const nO=new Set(["absolute","fixed"]);function rO(e,t){const n=Mn(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=jt(e)?rr(e):zt(1),s=e.clientWidth*o.x,a=e.clientHeight*o.y,l=i*o.x,u=r*o.y;return{width:s,height:a,x:l,y:u}}function mm(e,t,n){let r;if(t==="viewport")r=tO(e,n);else if(t==="document")r=eO(Ut(e));else if(_t(t))r=rO(t,n);else{const i=dm(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return lo(r)}function gm(e,t){const n=cn(e);return n===t||!_t(n)||nr(n)?!1:Pt(n).position==="fixed"||gm(n,t)}function iO(e,t){const n=t.get(e);if(n)return n;let r=fn(e,[],!1).filter(a=>_t(a)&&tr(a)!=="body"),i=null;const o=Pt(e).position==="fixed";let s=o?cn(e):e;for(;_t(s)&&!nr(s);){const a=Pt(s),l=sl(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&nO.has(i.position)||ei(s)&&!l&&gm(e,s))?r=r.filter(f=>f!==s):i=a,s=cn(s)}return t.set(e,r),r}function oO(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?co(t)?[]:iO(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((u,f)=>{const c=mm(t,f,i);return u.top=gt(c.top,u.top),u.right=er(c.right,u.right),u.bottom=er(c.bottom,u.bottom),u.left=gt(c.left,u.left),u},mm(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function sO(e){const{width:t,height:n}=fm(e);return{width:t,height:n}}function aO(e,t,n){const r=jt(t),i=Ut(t),o=n==="fixed",s=Mn(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=zt(0);function u(){l.x=ho(i)}if(r||!r&&!o)if((tr(t)!=="body"||ei(i))&&(a=fo(t)),r){const d=Mn(t,!0,o,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else i&&u();o&&!r&&i&&u();const f=i&&!r&&!o?hm(i,a):zt(0),c=s.left+a.scrollLeft-l.x-f.x,h=s.top+a.scrollTop-l.y-f.y;return{x:c,y:h,width:s.width,height:s.height}}function cl(e){return Pt(e).position==="static"}function ym(e,t){if(!jt(e)||Pt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ut(e)===n&&(n=n.ownerDocument.body),n}function vm(e,t){const n=yt(e);if(co(e))return n;if(!jt(e)){let i=cn(e);for(;i&&!nr(i);){if(_t(i)&&!cl(i))return i;i=cn(i)}return n}let r=ym(e,t);for(;r&&HI(r)&&cl(r);)r=ym(r,t);return r&&nr(r)&&cl(r)&&!sl(r)?n:r||KI(e)||n}const lO=async function(e){const t=this.getOffsetParent||vm,n=this.getDimensions,r=await n(e.floating);return{reference:aO(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function uO(e){return Pt(e).direction==="rtl"}const cO={convertOffsetParentRelativeRectToViewportRelativeRect:JI,getDocumentElement:Ut,getClippingRect:oO,getOffsetParent:vm,getElementRects:lO,getClientRects:XI,getDimensions:sO,getScale:rr,isElement:_t,isRTL:uO};function bm(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function fO(e,t){let n=null,r;const i=Ut(e);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const u=e.getBoundingClientRect(),{left:f,top:c,width:h,height:d}=u;if(a||t(),!h||!d)return;const m=so(c),p=so(i.clientWidth-(f+h)),g=so(i.clientHeight-(c+d)),y=so(f),w={rootMargin:-m+"px "+-p+"px "+-g+"px "+-y+"px",threshold:gt(0,er(1,l))||1};let E=!0;function S(C){const I=C[0].intersectionRatio;if(I!==l){if(!E)return s();I?s(!1,I):r=setTimeout(()=>{s(!1,1e-7)},1e3)}I===1&&!bm(u,e.getBoundingClientRect())&&s(),E=!1}try{n=new IntersectionObserver(S,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(S,w)}n.observe(e)}return s(!0),o}function dO(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=ul(e),f=i||o?[...u?fn(u):[],...fn(t)]:[];f.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),o&&y.addEventListener("resize",n)});const c=u&&a?fO(u,n):null;let h=-1,d=null;s&&(d=new ResizeObserver(y=>{let[v]=y;v&&v.target===u&&d&&(d.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=d)==null||w.observe(t)})),n()}),u&&!l&&d.observe(u),d.observe(t));let m,p=l?Mn(e):null;l&&g();function g(){const y=Mn(e);p&&!bm(p,y)&&n(),p=y,m=requestAnimationFrame(g)}return n(),()=>{var y;f.forEach(v=>{i&&v.removeEventListener("scroll",n),o&&v.removeEventListener("resize",n)}),c==null||c(),(y=d)==null||y.disconnect(),d=null,l&&cancelAnimationFrame(m)}}const hO=$I,pO=BI,mO=zI,gO=(e,t,n)=>{const r=new Map,i={platform:cO,...n},o={...i.platform,_c:r};return LI(e,t,{...i,platform:o})};var yO=typeof document<"u",vO=function(){},po=yO?D.useLayoutEffect:vO;function mo(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(!mo(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 o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!mo(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function wm(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Sm(e,t){const n=wm(e);return Math.round(t*n)/n}function fl(e){const t=A.useRef(e);return po(()=>{t.current=e}),t}function bO(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[f,c]=A.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,d]=A.useState(r);mo(h,r)||d(r);const[m,p]=A.useState(null),[g,y]=A.useState(null),v=A.useCallback(B=>{B!==C.current&&(C.current=B,p(B))},[]),w=A.useCallback(B=>{B!==I.current&&(I.current=B,y(B))},[]),E=o||m,S=s||g,C=A.useRef(null),I=A.useRef(null),M=A.useRef(f),P=l!=null,T=fl(l),O=fl(i),U=fl(u),F=A.useCallback(()=>{if(!C.current||!I.current)return;const B={placement:t,strategy:n,middleware:h};O.current&&(B.platform=O.current),gO(C.current,I.current,B).then(W=>{const b={...W,isPositioned:U.current!==!1};L.current&&!mo(M.current,b)&&(M.current=b,ju.flushSync(()=>{c(b)}))})},[h,t,n,O,U]);po(()=>{u===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,c(B=>({...B,isPositioned:!1})))},[u]);const L=A.useRef(!1);po(()=>(L.current=!0,()=>{L.current=!1}),[]),po(()=>{if(E&&(C.current=E),S&&(I.current=S),E&&S){if(T.current)return T.current(E,S,F);F()}},[E,S,F,T,P]);const R=A.useMemo(()=>({reference:C,floating:I,setReference:v,setFloating:w}),[v,w]),N=A.useMemo(()=>({reference:E,floating:S}),[E,S]),j=A.useMemo(()=>{const B={position:n,left:0,top:0};if(!N.floating)return B;const W=Sm(N.floating,f.x),b=Sm(N.floating,f.y);return a?{...B,transform:"translate("+W+"px, "+b+"px)",...wm(N.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:W,top:b}},[n,a,N.floating,f.x,f.y]);return A.useMemo(()=>({...f,update:F,refs:R,elements:N,floatingStyles:j}),[f,F,R,N,j])}const wO=(e,t)=>({...hO(e),options:[e,t]}),SO=(e,t)=>({...pO(e),options:[e,t]}),xO=(e,t)=>({...mO(e),options:[e,t]});/*!
285
+ `);const y=v.state[a];if(y==null)return;JSON.stringify(i.getState())!==JSON.stringify(y)&&d(y);return}i.dispatchFromDevtools&&typeof i.dispatch=="function"&&i.dispatch(v)});case"DISPATCH":switch(p.payload.type){case"RESET":return d(m),a===void 0?f==null?void 0:f.init(i.getState()):f==null?void 0:f.init(eo(l.name));case"COMMIT":if(a===void 0){f==null||f.init(i.getState());return}return f==null?void 0:f.init(eo(l.name));case"ROLLBACK":return Ra(p.state,v=>{if(a===void 0){d(v),f==null||f.init(i.getState());return}d(v[a]),f==null||f.init(eo(l.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return Ra(p.state,v=>{if(a===void 0){d(v);return}JSON.stringify(i.getState())!==JSON.stringify(v[a])&&d(v[a])});case"IMPORT_STATE":{const{nextLiftedState:v}=p.payload,y=(g=v.computedStates.slice(-1)[0])==null?void 0:g.state;if(!y)return;d(a===void 0?y:y[a]),f==null||f.send(null,v);return}case"PAUSE_RECORDING":return h=!h}return}}),m},Ra=(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 to(e,t){let n;try{n=e()}catch{return}return{getItem:i=>{var o;const s=l=>l===null?null:JSON.parse(l,void 0),a=(o=n.getItem(i))!=null?o:null;return a instanceof Promise?a.then(s):s(a)},setItem:(i,o)=>n.setItem(i,JSON.stringify(o,void 0)),removeItem:i=>n.removeItem(i)}}const Wr=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Wr(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Wr(r)(n)}}}},gT=(e,t)=>(n,r,i)=>{let o={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:g=>g,version:0,merge:(g,v)=>({...v,...g}),...t},s=!1;const a=new Set,l=new Set;let u;try{u=o.getStorage()}catch{}if(!u)return e((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...g)},r,i);const f=Wr(o.serialize),c=()=>{const g=o.partialize({...r()});let v;const y=f({state:g,version:o.version}).then(w=>u.setItem(o.name,w)).catch(w=>{v=w});if(v)throw v;return y},h=i.setState;i.setState=(g,v)=>{h(g,v),c()};const d=e((...g)=>{n(...g),c()},r,i);let m;const p=()=>{var g;if(!u)return;s=!1,a.forEach(y=>y(r()));const v=((g=o.onRehydrateStorage)==null?void 0:g.call(o,r()))||void 0;return Wr(u.getItem.bind(u))(o.name).then(y=>{if(y)return o.deserialize(y)}).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==o.version){if(o.migrate)return o.migrate(y.state,y.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return y.state}).then(y=>{var w;return m=o.merge(y,(w=r())!=null?w:d),n(m,!0),c()}).then(()=>{v==null||v(m,void 0),s=!0,l.forEach(y=>y(m))}).catch(y=>{v==null||v(void 0,y)})};return i.persist={setOptions:g=>{o={...o,...g},g.getStorage&&(u=g.getStorage())},clearStorage:()=>{u==null||u.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>p(),hasHydrated:()=>s,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(l.add(g),()=>{l.delete(g)})},p(),m||d},yT=(e,t)=>(n,r,i)=>{let o={storage:to(()=>localStorage),partialize:p=>p,version:0,merge:(p,g)=>({...g,...p}),...t},s=!1;const a=new Set,l=new Set;let u=o.storage;if(!u)return e((...p)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...p)},r,i);const f=()=>{const p=o.partialize({...r()});return u.setItem(o.name,{state:p,version:o.version})},c=i.setState;i.setState=(p,g)=>{c(p,g),f()};const h=e((...p)=>{n(...p),f()},r,i);let d;const m=()=>{var p,g;if(!u)return;s=!1,a.forEach(y=>{var w;return y((w=r())!=null?w:h)});const v=((g=o.onRehydrateStorage)==null?void 0:g.call(o,(p=r())!=null?p:h))||void 0;return Wr(u.getItem.bind(u))(o.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==o.version){if(o.migrate)return o.migrate(y.state,y.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return y.state}).then(y=>{var w;return d=o.merge(y,(w=r())!=null?w:h),n(d,!0),f()}).then(()=>{v==null||v(d,void 0),d=r(),s=!0,l.forEach(y=>y(d))}).catch(y=>{v==null||v(void 0,y)})};return i.persist={setOptions:p=>{o={...o,...p},p.storage&&(u=p.storage)},clearStorage:()=>{u==null||u.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>m(),hasHydrated:()=>s,onHydrate:p=>(a.add(p),()=>{a.delete(p)}),onFinishHydration:p=>(l.add(p),()=>{l.delete(p)})},o.skipHydration||m(),d||h},no=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?((Xi?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),gT(e,t)):yT(e,t),vT=(e,t)=>ln()(Gn(no(n=>({messageHistory:[],addMessageToHistory:r=>n(i=>({...i,messageHistory:[r,...(i.messageHistory??[]).slice(0,100).filter(String)]})),clearHistory:()=>n(()=>({messageHistory:[]}))}),{name:e,storage:to(()=>t==="sessionStorage"?sessionStorage:localStorage)}))),$a={},bp=(e,t,n)=>{const i=`${t||"bp-webchat"}-message-history-${e}`;return $a[i]||($a[i]=vT(i,n)),$a[i]},bT=e=>ln()(Gn(t=>({messages:[],setMessages:n=>t({messages:n}),saveMessage:n=>t(({messages:r})=>{var s;const i=(s=n.metadata)==null?void 0:s.clientMessageId;let o=-1;return i&&(o=r.findIndex(a=>{var l;return((l=a.metadata)==null?void 0:l.clientMessageId)===i})),o===-1&&(o=r.findIndex(a=>a.id===n.id)),o!==-1?{messages:[...r.slice(0,o),{...r[o],...n},...r.slice(o+1)]}:{messages:[...r,n]}}),updateMessage:(n,r)=>t(({messages:i})=>({messages:i.map(o=>o.id===n?{...o,...r}:o)})),removeMessage:n=>t(({messages:r})=>({messages:r.filter(i=>i.id!==n)})),clearMessages:()=>t({messages:[]})}),{name:e})),Ba={},wp=e=>{const t=`messages-${e}`;return Ba[t]||(Ba[t]=bT(t)),Ba[t]},wT=(e,t)=>ln()(Gn(no(n=>({setUser:r=>n(i=>({...i,user:r})),setConversationId:r=>n(i=>({...i,conversationId:r})),clearAll:()=>{n(r=>({...r,user:void 0,conversationId:void 0}))}}),{name:e,storage:to(()=>t==="sessionStorage"?sessionStorage:localStorage)}))),za={},Sp=(e="bp-webchat",t)=>{const n=`${e}-client`;return za[n]||(za[n]=wT(n,t)),za[n]},Qn=ln()(Gn(e=>({eventEmitter:nc(),messageContainerRef:M.createRef(),setMessageContainerRef:t=>e({messageContainerRef:t}),portalContainer:null,setPortalContainer:t=>e({portalContainer:t})}),{name:"webchatStore"})),ST=8,xT=e=>ln()(no((t,n)=>({files:[],setFiles:r=>t({files:r}),upsertFile:r=>t(({files:i})=>({files:i.some(a=>a.name===r.name)?i.map(a=>a.name===r.name?{...a,...r}:a):[...i,{...r}]})),uploadFile:async(r,i)=>{if(n().files.length===ST)return;const o=r.name.lastIndexOf("."),s=o>0&&o<r.name.length-1,a=s?r.name.substring(0,o):r.name,l=s?r.name.substring(o):"",u=_w(a,n().files,h=>h.name),f=u+l,c=new File([r],f,{type:r.type});n().upsertFile({name:u,type:"file",instance:c,status:"loading"});try{const{fileUrl:h,type:d,fileId:m}=await i(c);n().upsertFile({fileId:m,name:u,type:d,url:h,instance:c,status:"uploaded"})}catch{n().upsertFile({name:u,type:"file",instance:c,status:"error"})}},deleteFile:r=>t(({files:i})=>({files:i.filter(o=>o.name!=r)}))}),{name:e,storage:to(()=>sessionStorage)})),Ua={},xp=(e,t)=>{const r=`${t||"bp-webchat"}-composer-files-${e}`;return Ua[r]||(Ua[r]=xT(r)),Ua[r]},kT=e=>ln()(Gn(t=>({participants:[],setParticipants:n=>t({participants:n}),addParticipant:n=>t(r=>({participants:[...r.participants,n]})),removeParticipant:n=>t(r=>({participants:r.participants.filter(i=>i.id!==n)})),clearParticipants:()=>t({participants:[]})}),{name:e})),Ha={},kp=e=>{const t=`participants-${e}`;return Ha[t]||(Ha[t]=kT(t)),Ha[t]},ET=e=>ln()(Gn(no((t,n)=>({soundOn:!0,setSoundEnabled:r=>t({soundOn:r}),toggleSound:()=>t({soundOn:!n().soundOn})}),{name:e}))),ja={},Ep=(e="bp-webchat")=>{const t=`${e}-sound`;return ja[t]||(ja[t]=ET(t)),ja[t]},CT=({text:e,buttonValue:t,variant:n,groupId:r,reusable:i,sendMessage:o,isReadOnly:s,...a})=>{const l=Qn(w=>w.eventEmitter),[u,f]=M.useState(!1),[c,h]=M.useState(!1),[d,m]=M.useState(!1),{message:{blocks:{button:p}}}=ye;M.useEffect(()=>{if(r)return l.on(`button-group-${r}-click`,()=>{h(!0),i||m(!0)})},[l,r,i]);const v={...a,onClick:w=>{if((d||s)&&n==="link"){w.preventDefault();return}f(!0),i||m(!0),r&&l.emit(`button-group-${r}-click`),n!=="link"&&o&&(o==null||o({type:"text",text:e,value:t}))},"data-activated":u?"":void 0,"data-group-activated":c?"":void 0,"data-type":n,...p},y=d||s;return n==="link"?x.jsx("a",{...v,style:s?{pointerEvents:"none"}:void 0,href:t,target:"_blank",rel:"noopener noreferrer",children:e}):x.jsx("button",{...v,style:s?{pointerEvents:"none"}:void 0,disabled:y,children:e})},Va=M.createContext(null);function Cp(){const e=M.useContext(Va);if(!e)throw new Error("useMessageContext must be used within a Message");return e}const Wa=M.createContext({showInputModal:void 0});function qa(){return M.useContext(Wa)}const Ap=M.forwardRef(({block:e,direction:t,sender:n,timestamp:r,messageId:i,feedback:o,metadata:s,isReadOnly:a,sendMessage:l,addMessageFeedback:u,...f},c)=>{const{showInputModal:h}=qa(),{message:{blocks:{bubble:{container:d,feedbackContainer:m,feedbackIcon:p}}}}=ye;return t=="incoming"?x.jsxs("div",{"data-direction":"incoming","data-feedback":!!o,...f,...d,ref:c,children:[x.jsx(Dn,{block:{...e,direction:t,timestamp:r,sender:n,messageId:i,isReadOnly:a,metadata:s,sendMessage:l}}),u&&h&&e.type==="text"&&x.jsxs("div",{...m,children:[x.jsx(QA,{...p,"data-selected":o==="positive",onClick:()=>u(i,{value:"positive"})}),x.jsx(GA,{...p,"data-selected":o==="negative",onClick:async()=>{const g=await h({title:"Help us improve",description:"Please provide feedback to help us improve.",confirmButtonText:"Send feedback",cancelButtonText:"Cancel",Content:AT});u(i,{value:"negative",comment:g})}})]})]}):x.jsx("div",{"data-direction":"outgoing",...f,...d,ref:c,children:x.jsx(Dn,{block:{...e,direction:t,timestamp:r,sender:n,messageId:i,isReadOnly:a,metadata:s,sendMessage:l,addMessageFeedback:u}})})});Ap.displayName="Bubble";const AT=({setValue:e})=>{const{modal:{dialog:{content:t}}}=ye;return x.jsx("textarea",{...t.textarea,placeholder:"Let us know what went wrong...",onChange:n=>e(n.target.value)})},Tp=({className:e,...t})=>x.jsx("div",{"data-slot":"skeleton",className:`bpSkeleton ${e||""}`,...t});Tp.displayName="Skeleton";var xt=function(){return xt=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},xt.apply(this,arguments)};function Ip(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 Zn(e,t,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(f){try{u(r.next(f))}catch(c){s(c)}}function l(f){try{u(r.throw(f))}catch(c){s(c)}}function u(f){f.done?o(f.value):i(f.value).then(a,l)}u((r=r.apply(e,t||[])).next())})}function Jn(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(f){return l([u,f])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1],o=u;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(u);break}o[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(f){u=[6,f],i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Op(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],s;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o}function Ya(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;function TT(){var e=M.useRef(!1),t=M.useCallback(function(){return e.current},[]);return M.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),t}function IT(e,t,n){t===void 0&&(t=[]),n===void 0&&(n={loading:!1});var r=M.useRef(0),i=TT(),o=M.useState(n),s=o[0],a=o[1],l=M.useCallback(function(){for(var u=[],f=0;f<arguments.length;f++)u[f]=arguments[f];var c=++r.current;return s.loading||a(function(h){return xt(xt({},h),{loading:!0})}),e.apply(void 0,u).then(function(h){return i()&&c===r.current&&a({value:h,loading:!1}),h},function(h){return i()&&c===r.current&&a({error:h,loading:!1}),h})},t);return[s,l]}function OT(e,t){t===void 0&&(t=[]);var n=IT(e,t,{loading:!0}),r=n[0],i=n[1];return M.useEffect(function(){i()},[i]),r}const Mp=M.forwardRef(({url:e,type:t,orientation:n="auto",...r},i)=>{const o=M.useId(),{setIsLoading:s}=Cp(),[a,l]=M.useState(n==="auto"?"square":n),[u,f]=M.useState("initial"),{message:{blocks:{image:c}}}=ye;return M.useLayoutEffect(()=>(s(h=>[...h,o]),()=>{s(h=>h.filter(d=>d!==o))}),[o,s]),OT(async()=>{if(!e)return;const h=new Image;try{const{width:d,height:m}=await sb(e);n==="auto"&&l(MT(d,m)),h.onload=()=>{f("loaded"),s(p=>p.filter(g=>g!==o))},h.onerror=()=>{f("error"),l("square"),s(p=>p.filter(g=>g!==o))},h.src=e,h.complete&&(h.naturalWidth>0?(f("loaded"),s(p=>p.filter(g=>g!==o))):(f("error"),l("square"),s(p=>p.filter(g=>g!==o))))}catch(d){console.error(d),f("error"),s(m=>m.filter(p=>p!==o))}return()=>{h.onload=null,h.onerror=null}},[e,o,s,n]),e?u==="error"?x.jsx("div",{"data-error":"true","data-orientation":a,...r,...c.image,ref:i,children:x.jsx(ap,{size:"25%",strokeWidth:"5%"})}):u==="initial"?x.jsx(Tp,{"data-orientation":a,...c.placeholder}):x.jsx("img",{"data-orientation":a,"data-loaded":u==="loaded",...r,...c.image,src:e,alt:"",ref:i}):null});Mp.displayName="Image";function MT(e,t){const n={square:1,portrait:.75,landscape:1.3333333333333333},r=e/t;return Object.keys(n).reduce((o,s)=>Math.abs(n[s]-r)<Math.abs(n[o]-r)?s:o)}const Dp=M.forwardRef(({url:e,isReadOnly:t,...n},r)=>{const{message:{blocks:{video:i}}}=ye;return x.jsx("div",{children:x.jsx("video",{...n,"data-chromatic":"ignore",style:t?{pointerEvents:"none"}:void 0,controls:!0,src:e,...i,ref:r})})});Dp.displayName="Video";const Np=M.forwardRef(({url:e,isReadOnly:t,...n},r)=>{const{message:{blocks:{audio:i}}}=ye;return x.jsx("div",{children:x.jsx("audio",{...n,controls:!0,style:t?{pointerEvents:"none"}:void 0,src:e,...i,ref:r})})});Np.displayName="Audio";const _p=M.forwardRef(({latitude:e,longitude:t,title:n,isReadOnly:r,...i},o)=>{const s=`https://www.google.com/maps/search/?api=1&query=${e},${t}`,{message:{blocks:{location:a}}}=ye;return x.jsxs("a",{...i,...a.container,style:r?{pointerEvents:"none"}:void 0,href:s,type:"_blank",rel:"noopener",ref:o,children:[x.jsx("p",{...a.title,children:n}),x.jsx(HA,{...a.icon})]})});_p.displayName="Location";const Pp=M.forwardRef(({blocks:e,horizontalAlignment:t,verticalAlignment:n,direction:r,sender:i,timestamp:o,messageId:s,isReadOnly:a,sendMessage:l,...u},f)=>{const{message:{blocks:{column:c}}}=ye;return x.jsx("div",{"data-horizontal":t,"data-vertical":n,...u,...c,ref:f,children:e.map((h,d)=>x.jsx(Dn,{block:{...h,direction:r,timestamp:o,sender:i,messageId:s,isReadOnly:a,sendMessage:l}},d))})});Pp.displayName="Column";const Lp=M.forwardRef(({blocks:e,horizontalAlignment:t,verticalAlignment:n,direction:r,sender:i,timestamp:o,metadata:s,messageId:a,isReadOnly:l,sendMessage:u,...f},c)=>{const{message:{blocks:{row:h}}}=ye;return x.jsx("div",{"data-horizontal":t,"data-vertical":n,...f,...h,ref:c,children:e.map((d,m)=>x.jsx(Dn,{block:{...d,direction:r,timestamp:o,sender:i,messageId:a,isReadOnly:l,sendMessage:u}},m))})});Lp.displayName="Row";function DT(e){return Object.prototype.toString.call(e)==="[object Object]"}function Fp(e){return DT(e)||Array.isArray(e)}function NT(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Ka(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||{})),o=JSON.stringify(Object.keys(t.breakpoints||{}));return i!==o?!1:n.every(s=>{const a=e[s],l=t[s];return typeof a=="function"?`${a}`==`${l}`:!Fp(a)||!Fp(l)?a===l:Ka(a,l)})}function Rp(e){return e.concat().sort((t,n)=>t.name>n.name?1:-1).map(t=>t.options)}function _T(e,t){if(e.length!==t.length)return!1;const n=Rp(e),r=Rp(t);return n.every((i,o)=>{const s=r[o];return Ka(i,s)})}function Ga(e){return typeof e=="number"}function Qa(e){return typeof e=="string"}function ro(e){return typeof e=="boolean"}function $p(e){return Object.prototype.toString.call(e)==="[object Object]"}function $e(e){return Math.abs(e)}function Za(e){return Math.sign(e)}function qr(e,t){return $e(e-t)}function PT(e,t){if(e===0||t===0||$e(e)<=$e(t))return 0;const n=qr($e(e),$e(t));return $e(n/e)}function LT(e){return Math.round(e*100)/100}function Yr(e){return Gr(e).map(Number)}function Dt(e){return e[Kr(e)]}function Kr(e){return Math.max(0,e.length-1)}function Ja(e,t){return t===Kr(e)}function Bp(e,t=0){return Array.from(Array(e),(n,r)=>t+r)}function Gr(e){return Object.keys(e)}function zp(e,t){return[e,t].reduce((n,r)=>(Gr(r).forEach(i=>{const o=n[i],s=r[i],a=$p(o)&&$p(s);n[i]=a?zp(o,s):s}),n),{})}function Xa(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function FT(e,t){const n={start:r,center:i,end:o};function r(){return 0}function i(l){return o(l)/2}function o(l){return t-l}function s(l,u){return Qa(e)?n[e](l):e(t,l,u)}return{measure:s}}function Qr(){let e=[];function t(i,o,s,a={passive:!0}){let l;if("addEventListener"in i)i.addEventListener(o,s,a),l=()=>i.removeEventListener(o,s,a);else{const u=i;u.addListener(s),l=()=>u.removeListener(s)}return e.push(l),r}function n(){e=e.filter(i=>i())}const r={add:t,clear:n};return r}function RT(e,t,n,r){const i=Qr(),o=1e3/60;let s=null,a=0,l=0;function u(){i.add(e,"visibilitychange",()=>{e.hidden&&m()})}function f(){d(),i.clear()}function c(g){if(!l)return;s||(s=g,n(),n());const v=g-s;for(s=g,a+=v;a>=o;)n(),a-=o;const y=a/o;r(y),l&&(l=t.requestAnimationFrame(c))}function h(){l||(l=t.requestAnimationFrame(c))}function d(){t.cancelAnimationFrame(l),s=null,a=0,l=0}function m(){s=null,a=0}return{init:u,destroy:f,start:h,stop:d,update:n,render:r}}function $T(e,t){const n=t==="rtl",r=e==="y",i=r?"y":"x",o=r?"x":"y",s=!r&&n?-1:1,a=f(),l=c();function u(m){const{height:p,width:g}=m;return r?p:g}function f(){return r?"top":n?"right":"left"}function c(){return r?"bottom":n?"left":"right"}function h(m){return m*s}return{scroll:i,cross:o,startEdge:a,endEdge:l,measureSize:u,direction:h}}function On(e=0,t=0){const n=$e(e-t);function r(u){return u<e}function i(u){return u>t}function o(u){return r(u)||i(u)}function s(u){return o(u)?r(u)?e:t:u}function a(u){return n?u-n*Math.ceil((u-t)/n):u}return{length:n,max:t,min:e,constrain:s,reachedAny:o,reachedMax:i,reachedMin:r,removeOffset:a}}function Up(e,t,n){const{constrain:r}=On(0,e),i=e+1;let o=s(t);function s(h){return n?$e((i+h)%i):r(h)}function a(){return o}function l(h){return o=s(h),c}function u(h){return f().set(a()+h)}function f(){return Up(e,a(),n)}const c={get:a,set:l,add:u,clone:f};return c}function BT(e,t,n,r,i,o,s,a,l,u,f,c,h,d,m,p,g,v,y){const{cross:w,direction:A}=e,k=["INPUT","SELECT","TEXTAREA"],E={passive:!1},I=Qr(),D=Qr(),P=On(50,225).constrain(d.measure(20)),T={mouse:300,touch:400},O={mouse:500,touch:600},B=m?43:25;let L=!1,F=0,R=0,N=!1,H=!1,z=!1,W=!1;function b($){if(!y)return;function ne(Oe){(ro(y)||y($,Oe))&&q(Oe)}const me=t;I.add(me,"dragstart",Oe=>Oe.preventDefault(),E).add(me,"touchmove",()=>{},E).add(me,"touchend",()=>{}).add(me,"touchstart",ne).add(me,"mousedown",ne).add(me,"touchcancel",X).add(me,"contextmenu",X).add(me,"click",se,!0)}function _(){I.clear(),D.clear()}function j(){const $=W?n:t;D.add($,"touchmove",Q,E).add($,"touchend",X).add($,"mousemove",Q,E).add($,"mouseup",X)}function S($){const ne=$.nodeName||"";return k.includes(ne)}function V(){return(m?O:T)[W?"mouse":"touch"]}function Y($,ne){const me=c.add(Za($)*-1),Oe=f.byDistance($,!m).distance;return m||$e($)<P?Oe:g&&ne?Oe*.5:f.byIndex(me.get(),0).distance}function q($){const ne=Xa($,r);W=ne,z=m&&ne&&!$.buttons&&L,L=qr(i.get(),s.get())>=2,!(ne&&$.button!==0)&&(S($.target)||(N=!0,o.pointerDown($),u.useFriction(0).useDuration(0),i.set(s),j(),F=o.readPoint($),R=o.readPoint($,w),h.emit("pointerDown")))}function Q($){if(!Xa($,r)&&$.touches.length>=2)return X($);const me=o.readPoint($),Oe=o.readPoint($,w),J=qr(me,F),ue=qr(Oe,R);if(!H&&!W&&(!$.cancelable||(H=J>ue,!H)))return X($);const de=o.pointerMove($);J>p&&(z=!0),u.useFriction(.3).useDuration(.75),a.start(),i.add(A(de)),$.preventDefault()}function X($){const me=f.byDistance(0,!1).index!==c.get(),Oe=o.pointerUp($)*V(),J=Y(A(Oe),me),ue=PT(Oe,J),de=B-10*ue,fe=v+ue/50;H=!1,N=!1,D.clear(),u.useDuration(de).useFriction(fe),l.distance(J,!m),W=!1,h.emit("pointerUp")}function se($){z&&($.stopPropagation(),$.preventDefault(),z=!1)}function G(){return N}return{init:b,destroy:_,pointerDown:G}}function zT(e,t){let r,i;function o(c){return c.timeStamp}function s(c,h){const m=`client${(h||e.scroll)==="x"?"X":"Y"}`;return(Xa(c,t)?c:c.touches[0])[m]}function a(c){return r=c,i=c,s(c)}function l(c){const h=s(c)-s(i),d=o(c)-o(r)>170;return i=c,d&&(r=c),h}function u(c){if(!r||!i)return 0;const h=s(i)-s(r),d=o(c)-o(r),m=o(c)-o(i)>170,p=h/d;return d&&!m&&$e(p)>.1?p:0}return{pointerDown:a,pointerMove:l,pointerUp:u,readPoint:s}}function UT(){function e(n){const{offsetTop:r,offsetLeft:i,offsetWidth:o,offsetHeight:s}=n;return{top:r,right:i+o,bottom:r+s,left:i,width:o,height:s}}return{measure:e}}function HT(e){function t(r){return e*(r/100)}return{measure:t}}function jT(e,t,n,r,i,o,s){const a=[e].concat(r);let l,u,f=[],c=!1;function h(g){return i.measureSize(s.measure(g))}function d(g){if(!o)return;u=h(e),f=r.map(h);function v(y){for(const w of y){if(c)return;const A=w.target===e,k=r.indexOf(w.target),E=A?u:f[k],I=h(A?e:r[k]);if($e(I-E)>=.5){g.reInit(),t.emit("resize");break}}}l=new ResizeObserver(y=>{(ro(o)||o(g,y))&&v(y)}),n.requestAnimationFrame(()=>{a.forEach(y=>l.observe(y))})}function m(){c=!0,l&&l.disconnect()}return{init:d,destroy:m}}function VT(e,t,n,r,i,o){let s=0,a=0,l=i,u=o,f=e.get(),c=0;function h(){const E=r.get()-e.get(),I=!l;let D=0;return I?(s=0,n.set(r),e.set(r),D=E):(n.set(e),s+=E/l,s*=u,f+=s,e.add(s),D=f-c),a=Za(D),c=f,k}function d(){const E=r.get()-t.get();return $e(E)<.001}function m(){return l}function p(){return a}function g(){return s}function v(){return w(i)}function y(){return A(o)}function w(E){return l=E,k}function A(E){return u=E,k}const k={direction:p,duration:m,velocity:g,seek:h,settled:d,useBaseFriction:y,useBaseDuration:v,useFriction:A,useDuration:w};return k}function WT(e,t,n,r,i){const o=i.measure(10),s=i.measure(50),a=On(.1,.99);let l=!1;function u(){return!(l||!e.reachedAny(n.get())||!e.reachedAny(t.get()))}function f(d){if(!u())return;const m=e.reachedMin(t.get())?"min":"max",p=$e(e[m]-t.get()),g=n.get()-t.get(),v=a.constrain(p/s);n.subtract(g*v),!d&&$e(g)<o&&(n.set(e.constrain(n.get())),r.useDuration(25).useBaseFriction())}function c(d){l=!d}return{shouldConstrain:u,constrain:f,toggleActive:c}}function qT(e,t,n,r,i){const o=On(-t+e,0),s=c(),a=f(),l=h();function u(m,p){return qr(m,p)<=1}function f(){const m=s[0],p=Dt(s),g=s.lastIndexOf(m),v=s.indexOf(p)+1;return On(g,v)}function c(){return n.map((m,p)=>{const{min:g,max:v}=o,y=o.constrain(m),w=!p,A=Ja(n,p);return w?v:A||u(g,y)?g:u(v,y)?v:y}).map(m=>parseFloat(m.toFixed(3)))}function h(){if(t<=e+i)return[o.max];if(r==="keepSnaps")return s;const{min:m,max:p}=a;return s.slice(m,p)}return{snapsContained:l,scrollContainLimit:a}}function YT(e,t,n){const r=t[0],i=n?r-e:Dt(t);return{limit:On(i,r)}}function KT(e,t,n,r){const o=t.min+.1,s=t.max+.1,{reachedMin:a,reachedMax:l}=On(o,s);function u(h){return h===1?l(n.get()):h===-1?a(n.get()):!1}function f(h){if(!u(h))return;const d=e*(h*-1);r.forEach(m=>m.add(d))}return{loop:f}}function GT(e){const{max:t,length:n}=e;function r(o){const s=o-t;return n?s/-n:0}return{get:r}}function QT(e,t,n,r,i){const{startEdge:o,endEdge:s}=e,{groupSlides:a}=i,l=c().map(t.measure),u=h(),f=d();function c(){return a(r).map(p=>Dt(p)[s]-p[0][o]).map($e)}function h(){return r.map(p=>n[o]-p[o]).map(p=>-$e(p))}function d(){return a(u).map(p=>p[0]).map((p,g)=>p+l[g])}return{snaps:u,snapsAligned:f}}function ZT(e,t,n,r,i,o){const{groupSlides:s}=i,{min:a,max:l}=r,u=f();function f(){const h=s(o),d=!e||t==="keepSnaps";return n.length===1?[o]:d?h:h.slice(a,l).map((m,p,g)=>{const v=!p,y=Ja(g,p);if(v){const w=Dt(g[0])+1;return Bp(w)}if(y){const w=Kr(o)-Dt(g)[0]+1;return Bp(w,Dt(g)[0])}return m})}return{slideRegistry:u}}function JT(e,t,n,r,i){const{reachedAny:o,removeOffset:s,constrain:a}=r;function l(m){return m.concat().sort((p,g)=>$e(p)-$e(g))[0]}function u(m){const p=e?s(m):a(m),g=t.map((y,w)=>({diff:f(y-p,0),index:w})).sort((y,w)=>$e(y.diff)-$e(w.diff)),{index:v}=g[0];return{index:v,distance:p}}function f(m,p){const g=[m,m+n,m-n];if(!e)return m;if(!p)return l(g);const v=g.filter(y=>Za(y)===p);return v.length?l(v):Dt(g)-n}function c(m,p){const g=t[m]-i.get(),v=f(g,p);return{index:m,distance:v}}function h(m,p){const g=i.get()+m,{index:v,distance:y}=u(g),w=!e&&o(g);if(!p||w)return{index:v,distance:m};const A=t[v]-y,k=m+f(A,0);return{index:v,distance:k}}return{byDistance:h,byIndex:c,shortcut:f}}function XT(e,t,n,r,i,o,s){function a(c){const h=c.distance,d=c.index!==t.get();o.add(h),h&&(r.duration()?e.start():(e.update(),e.render(1),e.update())),d&&(n.set(t.get()),t.set(c.index),s.emit("select"))}function l(c,h){const d=i.byDistance(c,h);a(d)}function u(c,h){const d=t.clone().set(c),m=i.byIndex(d.get(),h);a(m)}return{distance:l,index:u}}function eI(e,t,n,r,i,o,s,a){const l={passive:!0,capture:!0};let u=0;function f(d){if(!a)return;function m(p){if(new Date().getTime()-u>10)return;s.emit("slideFocusStart"),e.scrollLeft=0;const y=n.findIndex(w=>w.includes(p));Ga(y)&&(i.useDuration(0),r.index(y,0),s.emit("slideFocus"))}o.add(document,"keydown",c,!1),t.forEach((p,g)=>{o.add(p,"focus",v=>{(ro(a)||a(d,v))&&m(g)},l)})}function c(d){d.code==="Tab"&&(u=new Date().getTime())}return{init:f}}function Zr(e){let t=e;function n(){return t}function r(l){t=s(l)}function i(l){t+=s(l)}function o(l){t-=s(l)}function s(l){return Ga(l)?l:l.get()}return{get:n,set:r,add:i,subtract:o}}function Hp(e,t){const n=e.scroll==="x"?s:a,r=t.style;let i=null,o=!1;function s(h){return`translate3d(${h}px,0px,0px)`}function a(h){return`translate3d(0px,${h}px,0px)`}function l(h){if(o)return;const d=LT(e.direction(h));d!==i&&(r.transform=n(d),i=d)}function u(h){o=!h}function f(){o||(r.transform="",t.getAttribute("style")||t.removeAttribute("style"))}return{clear:f,to:l,toggleActive:u}}function tI(e,t,n,r,i,o,s,a,l){const f=Yr(i),c=Yr(i).reverse(),h=v().concat(y());function d(I,D){return I.reduce((P,T)=>P-i[T],D)}function m(I,D){return I.reduce((P,T)=>d(P,D)>0?P.concat([T]):P,[])}function p(I){return o.map((D,P)=>({start:D-r[P]+.5+I,end:D+t-.5+I}))}function g(I,D,P){const T=p(D);return I.map(O=>{const B=P?0:-n,L=P?n:0,F=P?"end":"start",R=T[O][F];return{index:O,loopPoint:R,slideLocation:Zr(-1),translate:Hp(e,l[O]),target:()=>a.get()>R?B:L}})}function v(){const I=s[0],D=m(c,I);return g(D,n,!1)}function y(){const I=t-s[0]-1,D=m(f,I);return g(D,-n,!0)}function w(){return h.every(({index:I})=>{const D=f.filter(P=>P!==I);return d(D,t)<=.1})}function A(){h.forEach(I=>{const{target:D,translate:P,slideLocation:T}=I,O=D();O!==T.get()&&(P.to(O),T.set(O))})}function k(){h.forEach(I=>I.translate.clear())}return{canLoop:w,clear:k,loop:A,loopPoints:h}}function nI(e,t,n){let r,i=!1;function o(l){if(!n)return;function u(f){for(const c of f)if(c.type==="childList"){l.reInit(),t.emit("slidesChanged");break}}r=new MutationObserver(f=>{i||(ro(n)||n(l,f))&&u(f)}),r.observe(e,{childList:!0})}function s(){r&&r.disconnect(),i=!0}return{init:o,destroy:s}}function rI(e,t,n,r){const i={};let o=null,s=null,a,l=!1;function u(){a=new IntersectionObserver(m=>{l||(m.forEach(p=>{const g=t.indexOf(p.target);i[g]=p}),o=null,s=null,n.emit("slidesInView"))},{root:e.parentElement,threshold:r}),t.forEach(m=>a.observe(m))}function f(){a&&a.disconnect(),l=!0}function c(m){return Gr(i).reduce((p,g)=>{const v=parseInt(g),{isIntersecting:y}=i[v];return(m&&y||!m&&!y)&&p.push(v),p},[])}function h(m=!0){if(m&&o)return o;if(!m&&s)return s;const p=c(m);return m&&(o=p),m||(s=p),p}return{init:u,destroy:f,get:h}}function iI(e,t,n,r,i,o){const{measureSize:s,startEdge:a,endEdge:l}=e,u=n[0]&&i,f=m(),c=p(),h=n.map(s),d=g();function m(){if(!u)return 0;const y=n[0];return $e(t[a]-y[a])}function p(){if(!u)return 0;const y=o.getComputedStyle(Dt(r));return parseFloat(y.getPropertyValue(`margin-${l}`))}function g(){return n.map((y,w,A)=>{const k=!w,E=Ja(A,w);return k?h[w]+f:E?h[w]+c:A[w+1][a]-y[a]}).map($e)}return{slideSizes:h,slideSizesWithGaps:d,startGap:f,endGap:c}}function oI(e,t,n,r,i,o,s,a,l){const{startEdge:u,endEdge:f,direction:c}=e,h=Ga(n);function d(v,y){return Yr(v).filter(w=>w%y===0).map(w=>v.slice(w,w+y))}function m(v){return v.length?Yr(v).reduce((y,w,A)=>{const k=Dt(y)||0,E=k===0,I=w===Kr(v),D=i[u]-o[k][u],P=i[u]-o[w][f],T=!r&&E?c(s):0,O=!r&&I?c(a):0,B=$e(P-O-(D+T));return A&&B>t+l&&y.push(w),I&&y.push(v.length),y},[]).map((y,w,A)=>{const k=Math.max(A[w-1]||0);return v.slice(k,y)}):[]}function p(v){return h?d(v,n):m(v)}return{groupSlides:p}}function sI(e,t,n,r,i,o,s){const{align:a,axis:l,direction:u,startIndex:f,loop:c,duration:h,dragFree:d,dragThreshold:m,inViewThreshold:p,slidesToScroll:g,skipSnaps:v,containScroll:y,watchResize:w,watchSlides:A,watchDrag:k,watchFocus:E}=o,I=2,D=UT(),P=D.measure(t),T=n.map(D.measure),O=$T(l,u),B=O.measureSize(P),L=HT(B),F=FT(a,B),R=!c&&!!y,N=c||!!y,{slideSizes:H,slideSizesWithGaps:z,startGap:W,endGap:b}=iI(O,P,T,n,N,i),_=oI(O,B,g,c,P,T,W,b,I),{snaps:j,snapsAligned:S}=QT(O,F,P,T,_),V=-Dt(j)+Dt(z),{snapsContained:Y,scrollContainLimit:q}=qT(B,V,S,y,I),Q=R?Y:S,{limit:X}=YT(V,Q,c),se=Up(Kr(Q),f,c),G=se.clone(),te=Yr(n),$=({dragHandler:he,scrollBody:je,scrollBounds:Ge,options:{loop:Ze}})=>{Ze||Ge.constrain(he.pointerDown()),je.seek()},ne=({scrollBody:he,translate:je,location:Ge,offsetLocation:Ze,previousLocation:Et,scrollLooper:Rt,slideLooper:Qe,dragHandler:Ct,animation:at,eventHandler:es,scrollBounds:bP,options:{loop:Rv}},$v)=>{const Bv=he.settled(),wP=!bP.shouldConstrain(),zv=Rv?Bv:Bv&&wP,Uv=zv&&!Ct.pointerDown();Uv&&at.stop();const SP=Ge.get()*$v+Et.get()*(1-$v);Ze.set(SP),Rv&&(Rt.loop(he.direction()),Qe.loop()),je.to(Ze.get()),Uv&&es.emit("settle"),zv||es.emit("scroll")},me=RT(r,i,()=>$(le),he=>ne(le,he)),Oe=.68,J=Q[se.get()],ue=Zr(J),de=Zr(J),fe=Zr(J),Ae=Zr(J),Fe=VT(ue,fe,de,Ae,h,Oe),Me=JT(c,Q,V,X,Ae),He=XT(me,se,G,Fe,Me,Ae,s),ee=GT(X),ae=Qr(),U=rI(t,n,s,p),{slideRegistry:K}=ZT(R,y,Q,q,_,te),oe=eI(e,n,K,He,Fe,ae,s,E),le={ownerDocument:r,ownerWindow:i,eventHandler:s,containerRect:P,slideRects:T,animation:me,axis:O,dragHandler:BT(O,e,r,i,Ae,zT(O,i),ue,me,He,Fe,Me,se,s,L,d,m,v,Oe,k),eventStore:ae,percentOfView:L,index:se,indexPrevious:G,limit:X,location:ue,offsetLocation:fe,previousLocation:de,options:o,resizeHandler:jT(t,s,i,n,O,w,D),scrollBody:Fe,scrollBounds:WT(X,fe,Ae,Fe,L),scrollLooper:KT(V,X,fe,[ue,fe,de,Ae]),scrollProgress:ee,scrollSnapList:Q.map(ee.get),scrollSnaps:Q,scrollTarget:Me,scrollTo:He,slideLooper:tI(O,B,V,H,z,j,Q,fe,n),slideFocus:oe,slidesHandler:nI(t,s,A),slidesInView:U,slideIndexes:te,slideRegistry:K,slidesToScroll:_,target:Ae,translate:Hp(O,t)};return le}function aI(){let e={},t;function n(u){t=u}function r(u){return e[u]||[]}function i(u){return r(u).forEach(f=>f(t,u)),l}function o(u,f){return e[u]=r(u).concat([f]),l}function s(u,f){return e[u]=r(u).filter(c=>c!==f),l}function a(){e={}}const l={init:n,emit:i,off:s,on:o,clear:a};return l}const lI={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function uI(e){function t(o,s){return zp(o,s||{})}function n(o){const s=o.breakpoints||{},a=Gr(s).filter(l=>e.matchMedia(l).matches).map(l=>s[l]).reduce((l,u)=>t(l,u),{});return t(o,a)}function r(o){return o.map(s=>Gr(s.breakpoints||{})).reduce((s,a)=>s.concat(a),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:n,optionsMediaQueries:r}}function cI(e){let t=[];function n(o,s){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(o=>o.destroy())}return{init:n,destroy:r}}function io(e,t,n){const r=e.ownerDocument,i=r.defaultView,o=uI(i),s=cI(o),a=Qr(),l=aI(),{mergeOptions:u,optionsAtMedia:f,optionsMediaQueries:c}=o,{on:h,off:d,emit:m}=l,p=O;let g=!1,v,y=u(lI,io.globalOptions),w=u(y),A=[],k,E,I;function D(){const{container:te,slides:$}=w;E=(Qa(te)?e.querySelector(te):te)||e.children[0];const me=Qa($)?E.querySelectorAll($):$;I=[].slice.call(me||E.children)}function P(te){const $=sI(e,E,I,r,i,te,l);if(te.loop&&!$.slideLooper.canLoop()){const ne=Object.assign({},te,{loop:!1});return P(ne)}return $}function T(te,$){g||(y=u(y,te),w=f(y),A=$||A,D(),v=P(w),c([y,...A.map(({options:ne})=>ne)]).forEach(ne=>a.add(ne,"change",O)),w.active&&(v.translate.to(v.location.get()),v.animation.init(),v.slidesInView.init(),v.slideFocus.init(G),v.eventHandler.init(G),v.resizeHandler.init(G),v.slidesHandler.init(G),v.options.loop&&v.slideLooper.loop(),E.offsetParent&&I.length&&v.dragHandler.init(G),k=s.init(G,A)))}function O(te,$){const ne=_();B(),T(u({startIndex:ne},te),$),l.emit("reInit")}function B(){v.dragHandler.destroy(),v.eventStore.clear(),v.translate.clear(),v.slideLooper.clear(),v.resizeHandler.destroy(),v.slidesHandler.destroy(),v.slidesInView.destroy(),v.animation.destroy(),s.destroy(),a.clear()}function L(){g||(g=!0,a.clear(),B(),l.emit("destroy"),l.clear())}function F(te,$,ne){!w.active||g||(v.scrollBody.useBaseFriction().useDuration($===!0?0:w.duration),v.scrollTo.index(te,ne||0))}function R(te){const $=v.index.add(1).get();F($,te,-1)}function N(te){const $=v.index.add(-1).get();F($,te,1)}function H(){return v.index.add(1).get()!==_()}function z(){return v.index.add(-1).get()!==_()}function W(){return v.scrollSnapList}function b(){return v.scrollProgress.get(v.offsetLocation.get())}function _(){return v.index.get()}function j(){return v.indexPrevious.get()}function S(){return v.slidesInView.get()}function V(){return v.slidesInView.get(!1)}function Y(){return k}function q(){return v}function Q(){return e}function X(){return E}function se(){return I}const G={canScrollNext:H,canScrollPrev:z,containerNode:X,internalEngine:q,destroy:L,off:d,on:h,emit:m,plugins:Y,previousScrollSnap:j,reInit:p,rootNode:Q,scrollNext:R,scrollPrev:N,scrollProgress:b,scrollSnapList:W,scrollTo:F,selectedScrollSnap:_,slideNodes:se,slidesInView:S,slidesNotInView:V};return T(t,n),setTimeout(()=>l.emit("init"),0),G}io.globalOptions=void 0;function el(e={},t=[]){const n=M.useRef(e),r=M.useRef(t),[i,o]=M.useState(),[s,a]=M.useState(),l=M.useCallback(()=>{i&&i.reInit(n.current,r.current)},[i]);return M.useEffect(()=>{Ka(n.current,e)||(n.current=e,l())},[e,l]),M.useEffect(()=>{_T(r.current,t)||(r.current=t,l())},[t,l]),M.useEffect(()=>{if(NT()&&s){io.globalOptions=el.globalOptions;const u=io(s,n.current,r.current);return o(u),()=>u.destroy()}else o(void 0)},[s,o]),[a,i]}el.globalOptions=void 0;const jp=M.forwardRef(({blocks:e,direction:t,sender:n,timestamp:r,messageId:i,isReadOnly:o,sendMessage:s},a)=>{const[l,u]=el({skipSnaps:!0,loop:!0}),[f,c]=M.useState(!0),[h,d]=M.useState(!0),m=M.useCallback(()=>u==null?void 0:u.scrollPrev(),[u]),p=M.useCallback(()=>u==null?void 0:u.scrollNext(),[u]),{message:{blocks:{carousel:g}}}=ye,v=M.useCallback(y=>{c(!(y!=null&&y.canScrollPrev())),d(!(y!=null&&y.canScrollNext()))},[]);return M.useEffect(()=>{u&&(v(u),u.on("reInit",v),u.on("select",v))},[u,v]),x.jsxs("div",{...g==null?void 0:g.container,"data-container":"carousel",ref:l,children:[x.jsx("div",{ref:a,...g==null?void 0:g.slidesContainer,children:e.map((y,w)=>x.jsx(Dn,{block:{...y,direction:t,timestamp:r,sender:n,messageId:i,sendMessage:s,isReadOnly:o}},w))}),e.length>1&&x.jsxs(x.Fragment,{children:[x.jsx(rp,{...g==null?void 0:g.backButton,"data-disabled":f?"":void 0,onClick:m}),x.jsx(ip,{...g==null?void 0:g.nextButton,"data-disabled":h?"":void 0,onClick:p})]})]})});jp.displayName="Carousel";const Vp=Math.floor;function Wp(e){return qp(e)?(e.nodeName||"").toLowerCase():"#document"}function Jr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function fI(e){var t;return(t=(qp(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function qp(e){return e instanceof Node||e instanceof Jr(e).Node}function kt(e){return e instanceof Element||e instanceof Jr(e).Element}function Xn(e){return e instanceof HTMLElement||e instanceof Jr(e).HTMLElement}function tl(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Jr(e).ShadowRoot}function dI(e){return["html","body","#document"].includes(Wp(e))}function hI(e){return Jr(e).getComputedStyle(e)}function pI(e){if(Wp(e)==="html")return e;const t=e.assignedSlot||e.parentNode||tl(e)&&e.host||fI(e);return tl(t)?t.host:t}function un(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 ft(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&tl(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Yp(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function mI(){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 Kp(e){if(e.mozInputSource===0&&e.isTrusted)return!0;const t=/Android/i;return(t.test(Yp())||t.test(mI()))&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Gp(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 Qp(){return/apple/i.test(navigator.vendor)}function gI(){return Yp().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Zp(e,t){return["mouse","pen"].includes(e)}function yI(e){return"nativeEvent"in e}function vI(e){return e.matches("html,body")}function Nt(e){return(e==null?void 0:e.ownerDocument)||document}function nl(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 Jp(e){return"composedPath"in e?e.composedPath()[0]:e.target}const bI="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Xp(e){return Xn(e)&&e.matches(bI)}function Je(e){e.preventDefault(),e.stopPropagation()}const er=Math.min,gt=Math.max,oo=Math.round,so=Math.floor,zt=e=>({x:e,y:e});function em(e,t,n){return gt(e,er(t,n))}function ao(e,t){return typeof e=="function"?e(t):e}function Xr(e){return e.split("-")[0]}function rl(e){return e.split("-")[1]}function tm(e){return e==="x"?"y":"x"}function wI(e){return e==="y"?"height":"width"}const SI=new Set(["top","bottom"]);function ei(e){return SI.has(Xr(e))?"y":"x"}function xI(e){return tm(ei(e))}function kI(e){return{top:0,right:0,bottom:0,left:0,...e}}function EI(e){return typeof e!="number"?kI(e):{top:e,right:e,bottom:e,left:e}}function lo(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function nm(e,t,n){let{reference:r,floating:i}=e;const o=ei(t),s=xI(t),a=wI(s),l=Xr(t),u=o==="y",f=r.x+r.width/2-i.width/2,c=r.y+r.height/2-i.height/2,h=r[a]/2-i[a]/2;let d;switch(l){case"top":d={x:f,y:r.y-i.height};break;case"bottom":d={x:f,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:c};break;case"left":d={x:r.x-i.width,y:c};break;default:d={x:r.x,y:r.y}}switch(rl(t)){case"start":d[s]-=h*(n&&u?-1:1);break;case"end":d[s]+=h*(n&&u?-1:1);break}return d}const CI=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:f,y:c}=nm(u,r,l),h=r,d={},m=0;for(let p=0;p<a.length;p++){const{name:g,fn:v}=a[p],{x:y,y:w,data:A,reset:k}=await v({x:f,y:c,initialPlacement:r,placement:h,strategy:i,middlewareData:d,rects:u,platform:s,elements:{reference:e,floating:t}});f=y??f,c=w??c,d={...d,[g]:{...d[g],...A}},k&&m<=50&&(m++,typeof k=="object"&&(k.placement&&(h=k.placement),k.rects&&(u=k.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):k.rects),{x:f,y:c}=nm(u,h,l)),p=-1)}return{x:f,y:c,placement:h,strategy:i,middlewareData:d}};async function rm(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:c="floating",altBoundary:h=!1,padding:d=0}=ao(t,e),m=EI(d),g=a[h?c==="floating"?"reference":"floating":c],v=lo(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(g)))==null||n?g:g.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:u,rootBoundary:f,strategy:l})),y=c==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,w=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),A=await(o.isElement==null?void 0:o.isElement(w))?await(o.getScale==null?void 0:o.getScale(w))||{x:1,y:1}:{x:1,y:1},k=lo(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:w,strategy:l}):y);return{top:(v.top-k.top+m.top)/A.y,bottom:(k.bottom-v.bottom+m.bottom)/A.y,left:(v.left-k.left+m.left)/A.x,right:(k.right-v.right+m.right)/A.x}}const AI=new Set(["left","top"]);async function TI(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=Xr(n),a=rl(n),l=ei(n)==="y",u=AI.has(s)?-1:1,f=o&&l?-1:1,c=ao(t,e);let{mainAxis:h,crossAxis:d,alignmentAxis:m}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:c.mainAxis||0,crossAxis:c.crossAxis||0,alignmentAxis:c.alignmentAxis};return a&&typeof m=="number"&&(d=a==="end"?m*-1:m),l?{x:d*f,y:h*u}:{x:h*u,y:d*f}}const II=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:s,middlewareData:a}=t,l=await TI(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:s}}}}},OI=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:g=>{let{x:v,y}=g;return{x:v,y}}},...l}=ao(e,t),u={x:n,y:r},f=await rm(t,l),c=ei(Xr(i)),h=tm(c);let d=u[h],m=u[c];if(o){const g=h==="y"?"top":"left",v=h==="y"?"bottom":"right",y=d+f[g],w=d-f[v];d=em(y,d,w)}if(s){const g=c==="y"?"top":"left",v=c==="y"?"bottom":"right",y=m+f[g],w=m-f[v];m=em(y,m,w)}const p=a.fn({...t,[h]:d,[c]:m});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[h]:o,[c]:s}}}}}},MI=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:s,elements:a}=t,{apply:l=()=>{},...u}=ao(e,t),f=await rm(t,u),c=Xr(i),h=rl(i),d=ei(i)==="y",{width:m,height:p}=o.floating;let g,v;c==="top"||c==="bottom"?(g=c,v=h===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(v=c,g=h==="end"?"top":"bottom");const y=p-f.top-f.bottom,w=m-f.left-f.right,A=er(p-f[g],y),k=er(m-f[v],w),E=!t.middlewareData.shift;let I=A,D=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(I=y),E&&!h){const T=gt(f.left,0),O=gt(f.right,0),B=gt(f.top,0),L=gt(f.bottom,0);d?D=m-2*(T!==0||O!==0?T+O:gt(f.left,f.right)):I=p-2*(B!==0||L!==0?B+L:gt(f.top,f.bottom))}await l({...t,availableWidth:D,availableHeight:I});const P=await s.getDimensions(a.floating);return m!==P.width||p!==P.height?{reset:{rects:!0}}:{}}}};function uo(){return typeof window<"u"}function tr(e){return im(e)?(e.nodeName||"").toLowerCase():"#document"}function yt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ut(e){var t;return(t=(im(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function im(e){return uo()?e instanceof Node||e instanceof yt(e).Node:!1}function _t(e){return uo()?e instanceof Element||e instanceof yt(e).Element:!1}function Ht(e){return uo()?e instanceof HTMLElement||e instanceof yt(e).HTMLElement:!1}function om(e){return!uo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof yt(e).ShadowRoot}const DI=new Set(["inline","contents"]);function ti(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Pt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!DI.has(i)}const NI=new Set(["table","td","th"]);function _I(e){return NI.has(tr(e))}const PI=[":popover-open",":modal"];function co(e){return PI.some(t=>{try{return e.matches(t)}catch{return!1}})}const LI=["transform","translate","scale","rotate","perspective"],FI=["transform","translate","scale","rotate","perspective","filter"],RI=["paint","layout","strict","content"];function il(e){const t=ol(),n=_t(e)?Pt(e):e;return LI.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||FI.some(r=>(n.willChange||"").includes(r))||RI.some(r=>(n.contain||"").includes(r))}function $I(e){let t=cn(e);for(;Ht(t)&&!nr(t);){if(il(t))return t;if(co(t))return null;t=cn(t)}return null}function ol(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const BI=new Set(["html","body","#document"]);function nr(e){return BI.has(tr(e))}function Pt(e){return yt(e).getComputedStyle(e)}function fo(e){return _t(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function cn(e){if(tr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||om(e)&&e.host||Ut(e);return om(t)?t.host:t}function sm(e){const t=cn(e);return nr(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ht(t)&&ti(t)?t:sm(t)}function fn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=sm(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=yt(i);if(o){const a=sl(s);return t.concat(s,s.visualViewport||[],ti(i)?i:[],a&&n?fn(a):[])}return t.concat(i,fn(i,[],n))}function sl(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function am(e){const t=Pt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Ht(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=oo(n)!==o||oo(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function al(e){return _t(e)?e:e.contextElement}function rr(e){const t=al(e);if(!Ht(t))return zt(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=am(t);let s=(o?oo(n.width):n.width)/r,a=(o?oo(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const zI=zt(0);function lm(e){const t=yt(e);return!ol()||!t.visualViewport?zI:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function UI(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==yt(e)?!1:t}function Mn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=al(e);let s=zt(1);t&&(r?_t(r)&&(s=rr(r)):s=rr(e));const a=UI(o,n,r)?lm(o):zt(0);let l=(i.left+a.x)/s.x,u=(i.top+a.y)/s.y,f=i.width/s.x,c=i.height/s.y;if(o){const h=yt(o),d=r&&_t(r)?yt(r):r;let m=h,p=sl(m);for(;p&&r&&d!==m;){const g=rr(p),v=p.getBoundingClientRect(),y=Pt(p),w=v.left+(p.clientLeft+parseFloat(y.paddingLeft))*g.x,A=v.top+(p.clientTop+parseFloat(y.paddingTop))*g.y;l*=g.x,u*=g.y,f*=g.x,c*=g.y,l+=w,u+=A,m=yt(p),p=sl(m)}}return lo({width:f,height:c,x:l,y:u})}function ho(e,t){const n=fo(e).scrollLeft;return t?t.left+n:Mn(Ut(e)).left+n}function um(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-ho(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function HI(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",s=Ut(r),a=t?co(t.floating):!1;if(r===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},u=zt(1);const f=zt(0),c=Ht(r);if((c||!c&&!o)&&((tr(r)!=="body"||ti(s))&&(l=fo(r)),Ht(r))){const d=Mn(r);u=rr(r),f.x=d.x+r.clientLeft,f.y=d.y+r.clientTop}const h=s&&!c&&!o?um(s,l):zt(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+f.x+h.x,y:n.y*u.y-l.scrollTop*u.y+f.y+h.y}}function jI(e){return Array.from(e.getClientRects())}function VI(e){const t=Ut(e),n=fo(e),r=e.ownerDocument.body,i=gt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=gt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+ho(e);const a=-n.scrollTop;return Pt(r).direction==="rtl"&&(s+=gt(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}const cm=25;function WI(e,t){const n=yt(e),r=Ut(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;const f=ol();(!f||f&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const u=ho(r);if(u<=0){const f=r.ownerDocument,c=f.body,h=getComputedStyle(c),d=f.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,m=Math.abs(r.clientWidth-c.clientWidth-d);m<=cm&&(o-=m)}else u<=cm&&(o+=u);return{width:o,height:s,x:a,y:l}}const qI=new Set(["absolute","fixed"]);function YI(e,t){const n=Mn(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=Ht(e)?rr(e):zt(1),s=e.clientWidth*o.x,a=e.clientHeight*o.y,l=i*o.x,u=r*o.y;return{width:s,height:a,x:l,y:u}}function fm(e,t,n){let r;if(t==="viewport")r=WI(e,n);else if(t==="document")r=VI(Ut(e));else if(_t(t))r=YI(t,n);else{const i=lm(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return lo(r)}function dm(e,t){const n=cn(e);return n===t||!_t(n)||nr(n)?!1:Pt(n).position==="fixed"||dm(n,t)}function KI(e,t){const n=t.get(e);if(n)return n;let r=fn(e,[],!1).filter(a=>_t(a)&&tr(a)!=="body"),i=null;const o=Pt(e).position==="fixed";let s=o?cn(e):e;for(;_t(s)&&!nr(s);){const a=Pt(s),l=il(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&qI.has(i.position)||ti(s)&&!l&&dm(e,s))?r=r.filter(f=>f!==s):i=a,s=cn(s)}return t.set(e,r),r}function GI(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?co(t)?[]:KI(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((u,f)=>{const c=fm(t,f,i);return u.top=gt(c.top,u.top),u.right=er(c.right,u.right),u.bottom=er(c.bottom,u.bottom),u.left=gt(c.left,u.left),u},fm(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function QI(e){const{width:t,height:n}=am(e);return{width:t,height:n}}function ZI(e,t,n){const r=Ht(t),i=Ut(t),o=n==="fixed",s=Mn(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=zt(0);function u(){l.x=ho(i)}if(r||!r&&!o)if((tr(t)!=="body"||ti(i))&&(a=fo(t)),r){const d=Mn(t,!0,o,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else i&&u();o&&!r&&i&&u();const f=i&&!r&&!o?um(i,a):zt(0),c=s.left+a.scrollLeft-l.x-f.x,h=s.top+a.scrollTop-l.y-f.y;return{x:c,y:h,width:s.width,height:s.height}}function ll(e){return Pt(e).position==="static"}function hm(e,t){if(!Ht(e)||Pt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ut(e)===n&&(n=n.ownerDocument.body),n}function pm(e,t){const n=yt(e);if(co(e))return n;if(!Ht(e)){let i=cn(e);for(;i&&!nr(i);){if(_t(i)&&!ll(i))return i;i=cn(i)}return n}let r=hm(e,t);for(;r&&_I(r)&&ll(r);)r=hm(r,t);return r&&nr(r)&&ll(r)&&!il(r)?n:r||$I(e)||n}const JI=async function(e){const t=this.getOffsetParent||pm,n=this.getDimensions,r=await n(e.floating);return{reference:ZI(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function XI(e){return Pt(e).direction==="rtl"}const eO={convertOffsetParentRelativeRectToViewportRelativeRect:HI,getDocumentElement:Ut,getClippingRect:GI,getOffsetParent:pm,getElementRects:JI,getClientRects:jI,getDimensions:QI,getScale:rr,isElement:_t,isRTL:XI};function mm(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function tO(e,t){let n=null,r;const i=Ut(e);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const u=e.getBoundingClientRect(),{left:f,top:c,width:h,height:d}=u;if(a||t(),!h||!d)return;const m=so(c),p=so(i.clientWidth-(f+h)),g=so(i.clientHeight-(c+d)),v=so(f),w={rootMargin:-m+"px "+-p+"px "+-g+"px "+-v+"px",threshold:gt(0,er(1,l))||1};let A=!0;function k(E){const I=E[0].intersectionRatio;if(I!==l){if(!A)return s();I?s(!1,I):r=setTimeout(()=>{s(!1,1e-7)},1e3)}I===1&&!mm(u,e.getBoundingClientRect())&&s(),A=!1}try{n=new IntersectionObserver(k,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(k,w)}n.observe(e)}return s(!0),o}function nO(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=al(e),f=i||o?[...u?fn(u):[],...fn(t)]:[];f.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),o&&v.addEventListener("resize",n)});const c=u&&a?tO(u,n):null;let h=-1,d=null;s&&(d=new ResizeObserver(v=>{let[y]=v;y&&y.target===u&&d&&(d.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=d)==null||w.observe(t)})),n()}),u&&!l&&d.observe(u),d.observe(t));let m,p=l?Mn(e):null;l&&g();function g(){const v=Mn(e);p&&!mm(p,v)&&n(),p=v,m=requestAnimationFrame(g)}return n(),()=>{var v;f.forEach(y=>{i&&y.removeEventListener("scroll",n),o&&y.removeEventListener("resize",n)}),c==null||c(),(v=d)==null||v.disconnect(),d=null,l&&cancelAnimationFrame(m)}}const rO=II,iO=OI,oO=MI,sO=(e,t,n)=>{const r=new Map,i={platform:eO,...n},o={...i.platform,_c:r};return CI(e,t,{...i,platform:o})};var aO=typeof document<"u",lO=function(){},po=aO?M.useLayoutEffect:lO;function mo(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(!mo(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 o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!mo(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function gm(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ym(e,t){const n=gm(e);return Math.round(t*n)/n}function ul(e){const t=C.useRef(e);return po(()=>{t.current=e}),t}function uO(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[f,c]=C.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,d]=C.useState(r);mo(h,r)||d(r);const[m,p]=C.useState(null),[g,v]=C.useState(null),y=C.useCallback(z=>{z!==E.current&&(E.current=z,p(z))},[]),w=C.useCallback(z=>{z!==I.current&&(I.current=z,v(z))},[]),A=o||m,k=s||g,E=C.useRef(null),I=C.useRef(null),D=C.useRef(f),P=l!=null,T=ul(l),O=ul(i),B=ul(u),L=C.useCallback(()=>{if(!E.current||!I.current)return;const z={placement:t,strategy:n,middleware:h};O.current&&(z.platform=O.current),sO(E.current,I.current,z).then(W=>{const b={...W,isPositioned:B.current!==!1};F.current&&!mo(D.current,b)&&(D.current=b,$u.flushSync(()=>{c(b)}))})},[h,t,n,O,B]);po(()=>{u===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,c(z=>({...z,isPositioned:!1})))},[u]);const F=C.useRef(!1);po(()=>(F.current=!0,()=>{F.current=!1}),[]),po(()=>{if(A&&(E.current=A),k&&(I.current=k),A&&k){if(T.current)return T.current(A,k,L);L()}},[A,k,L,T,P]);const R=C.useMemo(()=>({reference:E,floating:I,setReference:y,setFloating:w}),[y,w]),N=C.useMemo(()=>({reference:A,floating:k}),[A,k]),H=C.useMemo(()=>{const z={position:n,left:0,top:0};if(!N.floating)return z;const W=ym(N.floating,f.x),b=ym(N.floating,f.y);return a?{...z,transform:"translate("+W+"px, "+b+"px)",...gm(N.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:W,top:b}},[n,a,N.floating,f.x,f.y]);return C.useMemo(()=>({...f,update:L,refs:R,elements:N,floatingStyles:H}),[f,L,R,N,H])}const cO=(e,t)=>({...rO(e),options:[e,t]}),fO=(e,t)=>({...iO(e),options:[e,t]}),dO=(e,t)=>({...oO(e),options:[e,t]});/*!
286
286
  * tabbable 6.3.0
287
287
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
288
- */var kO=["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])"],dl=kO.join(","),xm=typeof Element>"u",ti=xm?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,go=!xm&&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},ni=function(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"),o=i===""||i==="true",s=o||n&&t&&ni(t.parentNode);return s},EO=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},CO=function(t,n,r){if(ni(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(dl));return n&&ti.call(t,dl)&&i.unshift(t),i=i.filter(r),i},hl=function(t,n,r){for(var i=[],o=Array.from(t);o.length;){var s=o.shift();if(!ni(s,!1))if(s.tagName==="SLOT"){var a=s.assignedElements(),l=a.length?a:s.children,u=hl(l,!0,r);r.flatten?i.push.apply(i,u):i.push({scopeParent:s,candidates:u})}else{var f=ti.call(s,dl);f&&r.filter(s)&&(n||!t.includes(s))&&i.push(s);var c=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),h=!ni(c,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(c&&h){var d=hl(c===!0?s.children:c.children,!0,r);r.flatten?i.push.apply(i,d):i.push({scopeParent:s,candidates:d})}else o.unshift.apply(o,s.children)}}return i},km=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Em=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||EO(t))&&!km(t)?0:t.tabIndex},AO=function(t,n){var r=Em(t);return r<0&&n&&!km(t)?0:r},TO=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Cm=function(t){return t.tagName==="INPUT"},IO=function(t){return Cm(t)&&t.type==="hidden"},OO=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},MO=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},DO=function(t){if(!t.name)return!0;var n=t.form||go(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(s){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",s.message),!1}var o=MO(i,t.form);return!o||o===t},NO=function(t){return Cm(t)&&t.type==="radio"},_O=function(t){return NO(t)&&!DO(t)},PO=function(t){var n,r=t&&go(t),i=(n=r)===null||n===void 0?void 0:n.host,o=!1;if(r&&r!==t){var s,a,l;for(o=!!((s=i)!==null&&s!==void 0&&(a=s.ownerDocument)!==null&&a!==void 0&&a.contains(i)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!o&&i;){var u,f,c;r=go(i),i=(u=r)===null||u===void 0?void 0:u.host,o=!!((f=i)!==null&&f!==void 0&&(c=f.ownerDocument)!==null&&c!==void 0&&c.contains(i))}}return o},Am=function(t){var n=t.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},LO=function(t,n){var r=n.displayCheck,i=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var o=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!o}if(getComputedStyle(t).visibility==="hidden")return!0;var s=ti.call(t,"details>summary:first-of-type"),a=s?t.parentElement:t;if(ti.call(a,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof i=="function"){for(var l=t;t;){var u=t.parentElement,f=go(t);if(u&&!u.shadowRoot&&i(u)===!0)return Am(t);t.assignedSlot?t=t.assignedSlot:!u&&f!==t.ownerDocument?t=f.host:t=u}t=l}if(PO(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Am(t);return!1},FO=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 ti.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},RO=function(t,n){return!(n.disabled||ni(n)||IO(n)||LO(n,t)||OO(n)||FO(n))},Tm=function(t,n){return!(_O(n)||Em(n)<0||!RO(t,n))},$O=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Im=function(t){var n=[],r=[];return t.forEach(function(i,o){var s=!!i.scopeParent,a=s?i.scopeParent:i,l=AO(a,s),u=s?Im(i.candidates):a;l===0?s?n.push.apply(n,u):n.push(a):r.push({documentOrder:o,tabIndex:l,item:i,isScope:s,content:u})}),r.sort(TO).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},pl=function(t,n){n=n||{};var r;return n.getShadowRoot?r=hl([t],n.includeContainer,{filter:Tm.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:$O}):r=CO(t,n.includeContainer,Tm.bind(null,n)),Im(r)};const ml="ArrowUp",yo="ArrowDown",ir="ArrowLeft",ri="ArrowRight";function vo(e,t,n){return Math.floor(e/t)!==n}function ii(e,t){return t<0||t>=e.current.length}function gl(e,t){return nt(e,{disabledIndices:t})}function Om(e,t){return nt(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function nt(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:i,amount:o=1}=t===void 0?{}:t;const s=e.current;let a=n;do{var l,u;a=a+(r?-o:o)}while(a>=0&&a<=s.length-1&&(i?i.includes(a):s[a]==null||(l=s[a])!=null&&l.hasAttribute("disabled")||((u=s[a])==null?void 0:u.getAttribute("aria-disabled"))==="true"));return a}function BO(e,t){let{event:n,orientation:r,loop:i,cols:o,disabledIndices:s,minIndex:a,maxIndex:l,prevIndex:u,stopEvent:f=!1}=t,c=u;if(n.key===ml){if(f&&Je(n),u===-1)c=l;else if(c=nt(e,{startingIndex:c,amount:o,decrement:!0,disabledIndices:s}),i&&(u-o<a||c<0)){const h=u%o,d=l%o,m=l-(d-h);d===h?c=l:c=d>h?m:m-o}ii(e,c)&&(c=u)}if(n.key===yo&&(f&&Je(n),u===-1?c=a:(c=nt(e,{startingIndex:u,amount:o,disabledIndices:s}),i&&u+o>l&&(c=nt(e,{startingIndex:u%o-o,amount:o,disabledIndices:s}))),ii(e,c)&&(c=u)),r==="both"){const h=Kp(u/o);n.key===ri&&(f&&Je(n),u%o!==o-1?(c=nt(e,{startingIndex:u,disabledIndices:s}),i&&vo(c,o,h)&&(c=nt(e,{startingIndex:u-u%o-1,disabledIndices:s}))):i&&(c=nt(e,{startingIndex:u-u%o-1,disabledIndices:s})),vo(c,o,h)&&(c=u)),n.key===ir&&(f&&Je(n),u%o!==0?(c=nt(e,{startingIndex:u,disabledIndices:s,decrement:!0}),i&&vo(c,o,h)&&(c=nt(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}))):i&&(c=nt(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s})),vo(c,o,h)&&(c=u));const d=Kp(l/o)===h;ii(e,c)&&(i&&d?c=n.key===ir?l:nt(e,{startingIndex:u-u%o-1,disabledIndices:s}):c=u)}return c}let Mm=0;function Gt(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(Mm);const o=()=>e==null?void 0:e.focus({preventScroll:n});i?o():Mm=requestAnimationFrame(o)}var Ye=typeof document<"u"?D.useLayoutEffect:D.useEffect;function bo(){return bo=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},bo.apply(this,arguments)}let yl=!1,zO=0;const Dm=()=>"floating-ui-"+zO++;function UO(){const[e,t]=A.useState(()=>yl?Dm():void 0);return Ye(()=>{e==null&&t(Dm())},[]),A.useEffect(()=>{yl||(yl=!0)},[]),e}const vl=A.useId||UO;function jO(){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 HO=A.createContext(null),VO=A.createContext(null),Nm=()=>{var e;return((e=A.useContext(HO))==null?void 0:e.id)||null},wo=()=>A.useContext(VO);function oi(e){return"data-floating-ui-"+e}function dn(e){const t=D.useRef(e);return Ye(()=>{t.current=e}),t}function WO(e,t){var n;let r=[],i=(n=e.find(o=>o.id===t))==null?void 0:n.parentId;for(;i;){const o=e.find(s=>s.id===i);i=o==null?void 0:o.parentId,o&&(r=r.concat(o))}return r}function or(e,t){let n=e.filter(i=>{var o;return i.parentId===t&&((o=i.context)==null?void 0:o.open)}),r=n;for(;r.length;)r=e.filter(i=>{var o;return(o=r)==null?void 0:o.some(s=>{var a;return i.parentId===s.id&&((a=i.context)==null?void 0:a.open)})}),n=n.concat(r);return n}function qO(e,t){let n,r=-1;function i(o,s){s>r&&(n=o,r=s),or(e,o).forEach(l=>{i(l.id,s+1)})}return i(t,0),e.find(o=>o.id===n)}let sr=new WeakMap,So=new WeakSet,xo={},bl=0;const YO=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,_m=e=>e&&(e.host||_m(e.parentNode)),KO=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=_m(n);return e.contains(r)?r:null}).filter(n=>n!=null);function GO(e,t,n,r){const i="data-floating-ui-inert",o=r?"inert":n?"aria-hidden":null,s=KO(t,e),a=new Set,l=new Set(s),u=[];xo[i]||(xo[i]=new WeakMap);const f=xo[i];s.forEach(c),h(t),a.clear();function c(d){!d||a.has(d)||(a.add(d),d.parentNode&&c(d.parentNode))}function h(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,m=>{if(a.has(m))h(m);else{const p=o?m.getAttribute(o):null,g=p!==null&&p!=="false",y=(sr.get(m)||0)+1,v=(f.get(m)||0)+1;sr.set(m,y),f.set(m,v),u.push(m),y===1&&g&&So.add(m),v===1&&m.setAttribute(i,""),!g&&o&&m.setAttribute(o,"true")}})}return bl++,()=>{u.forEach(d=>{const m=(sr.get(d)||0)-1,p=(f.get(d)||0)-1;sr.set(d,m),f.set(d,p),m||(!So.has(d)&&o&&d.removeAttribute(o),So.delete(d)),p||d.removeAttribute(i)}),bl--,bl||(sr=new WeakMap,sr=new WeakMap,So=new WeakSet,xo={})}}function Pm(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=Nt(e[0]).body;return GO(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const wl=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Lm(e,t){const n=pl(e,wl());t==="prev"&&n.reverse();const r=n.indexOf(un(Nt(e)));return n.slice(r+1)[0]}function Fm(){return Lm(document.body,"next")}function Rm(){return Lm(document.body,"prev")}function si(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!ft(n,r)}function QO(e){pl(e,wl()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function ZO(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 Sl={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 JO;function $m(e){e.key==="Tab"&&(e.target,clearTimeout(JO))}const ko=A.forwardRef(function(t,n){const[r,i]=A.useState();Ye(()=>(em()&&i("button"),document.addEventListener("keydown",$m),()=>{document.removeEventListener("keydown",$m)}),[]);const o={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[oi("focus-guard")]:"",style:Sl};return A.createElement("span",bo({},t,o))}),Bm=A.createContext(null);function XO(e){let{id:t,root:n}=e===void 0?{}:e;const[r,i]=A.useState(null),o=vl(),s=zm(),a=A.useMemo(()=>({id:t,root:n,portalContext:s,uniqueId:o}),[t,n,s,o]),l=A.useRef();return Ye(()=>()=>{r==null||r.remove()},[r,a]),Ye(()=>{if(l.current===a)return;l.current=a;const{id:u,root:f,portalContext:c,uniqueId:h}=a,d=u?document.getElementById(u):null,m=oi("portal");if(d){const p=document.createElement("div");p.id=h,p.setAttribute(m,""),d.appendChild(p),i(p)}else{let p=f||(c==null?void 0:c.portalNode);p&&!kt(p)&&(p=p.current),p=p||document.body;let g=null;u&&(g=document.createElement("div"),g.id=u,p.appendChild(g));const y=document.createElement("div");y.id=h,y.setAttribute(m,""),p=g||p,p.appendChild(y),i(y)}},[a]),r}function eM(e){let{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e;const o=XO({id:n,root:r}),[s,a]=A.useState(null),l=A.useRef(null),u=A.useRef(null),f=A.useRef(null),c=A.useRef(null),h=!!s&&!s.modal&&s.open&&i&&!!(r||o);return A.useEffect(()=>{if(!o||!i||s!=null&&s.modal)return;function d(m){o&&si(m)&&(m.type==="focusin"?ZO:QO)(o)}return o.addEventListener("focusin",d,!0),o.addEventListener("focusout",d,!0),()=>{o.removeEventListener("focusin",d,!0),o.removeEventListener("focusout",d,!0)}},[o,i,s==null?void 0:s.modal]),A.createElement(Bm.Provider,{value:A.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:f,afterInsideRef:c,portalNode:o,setFocusManagerState:a}),[i,o])},h&&o&&A.createElement(ko,{"data-type":"outside",ref:l,onFocus:d=>{if(si(d,o)){var m;(m=f.current)==null||m.focus()}else{const p=Rm()||(s==null?void 0:s.refs.domReference.current);p==null||p.focus()}}}),h&&o&&A.createElement("span",{"aria-owns":o.id,style:Sl}),o&&zu.createPortal(t,o),h&&o&&A.createElement(ko,{"data-type":"outside",ref:u,onFocus:d=>{if(si(d,o)){var m;(m=c.current)==null||m.focus()}else{const p=Fm()||(s==null?void 0:s.refs.domReference.current);p==null||p.focus(),s!=null&&s.closeOnFocusOut&&(s==null||s.onOpenChange(!1,d.nativeEvent))}}}))}const zm=()=>A.useContext(Bm),tM=A.forwardRef(function(t,n){return A.createElement("button",bo({},t,{type:"button",ref:n,tabIndex:-1,style:Sl}))});function nM(e){const{context:t,children:n,disabled:r=!1,order:i=["content"],guards:o=!0,initialFocus:s=0,returnFocus:a=!0,modal:l=!0,visuallyHiddenDismiss:u=!1,closeOnFocusOut:f=!0}=e,{open:c,refs:h,nodeId:d,onOpenChange:m,events:p,dataRef:g,elements:{domReference:y,floating:v}}=t,w=YO()?o:!0,E=dn(i),S=dn(s),C=dn(a),I=wo(),M=zm(),P=typeof s=="number"&&s<0,T=A.useRef(null),O=A.useRef(null),U=A.useRef(!1),F=A.useRef(null),L=A.useRef(!1),R=M!=null,N=y&&y.getAttribute("role")==="combobox"&&rm(y)&&P,j=A.useCallback(function(_){return _===void 0&&(_=v),_?pl(_,wl()):[]},[v]),B=A.useCallback(_=>{const H=j(_);return E.current.map(x=>y&&x==="reference"?y:v&&x==="floating"?v:H).filter(Boolean).flat()},[y,v,E,j]);A.useEffect(()=>{if(r||!l)return;function _(x){if(x.key==="Tab"){ft(v,un(Nt(v)))&&j().length===0&&!N&&Je(x);const V=B(),Y=nm(x);E.current[0]==="reference"&&Y===y&&(Je(x),x.shiftKey?Gt(V[V.length-1]):Gt(V[1])),E.current[1]==="floating"&&Y===v&&x.shiftKey&&(Je(x),Gt(V[0]))}}const H=Nt(v);return H.addEventListener("keydown",_),()=>{H.removeEventListener("keydown",_)}},[r,y,v,l,E,h,N,j,B]),A.useEffect(()=>{if(r||!f)return;function _(){L.current=!0,setTimeout(()=>{L.current=!1})}function H(x){const V=x.relatedTarget;queueMicrotask(()=>{const Y=!(ft(y,V)||ft(v,V)||ft(V,v)||ft(M==null?void 0:M.portalNode,V)||V!=null&&V.hasAttribute(oi("focus-guard"))||I&&(or(I.nodesRef.current,d).find(q=>{var Q,X;return ft((Q=q.context)==null?void 0:Q.elements.floating,V)||ft((X=q.context)==null?void 0:X.elements.domReference,V)})||WO(I.nodesRef.current,d).find(q=>{var Q,X;return((Q=q.context)==null?void 0:Q.elements.floating)===V||((X=q.context)==null?void 0:X.elements.domReference)===V})));V&&Y&&!L.current&&V!==F.current&&(U.current=!0,m(!1,x))})}if(v&&Xn(y))return y.addEventListener("focusout",H),y.addEventListener("pointerdown",_),!l&&v.addEventListener("focusout",H),()=>{y.removeEventListener("focusout",H),y.removeEventListener("pointerdown",_),!l&&v.removeEventListener("focusout",H)}},[r,y,v,l,d,I,M,m,f]),A.useEffect(()=>{var _;if(r)return;const H=Array.from((M==null||(_=M.portalNode)==null?void 0:_.querySelectorAll("["+oi("portal")+"]"))||[]);if(v){const x=[v,...H,T.current,O.current,E.current.includes("reference")||N?y:null].filter(Y=>Y!=null),V=l?Pm(x,w,!w):Pm(x);return()=>{V()}}},[r,y,v,l,E,M,N,w]),Ye(()=>{if(r||!v)return;const _=Nt(v),H=un(_);queueMicrotask(()=>{const x=B(v),V=S.current,Y=(typeof V=="number"?x[V]:V.current)||v,q=ft(v,H);!P&&!q&&c&&Gt(Y,{preventScroll:Y===v})})},[r,c,v,P,B,S]),Ye(()=>{if(r||!v)return;let _=!1;const H=Nt(v),x=un(H),V=g.current;F.current=x;function Y(q){if(q.type==="escapeKey"&&h.domReference.current&&(F.current=h.domReference.current),["referencePress","escapeKey"].includes(q.type))return;const Q=q.data.returnFocus;typeof Q=="object"?(U.current=!1,_=Q.preventScroll):U.current=!Q}return p.on("dismiss",Y),()=>{p.off("dismiss",Y);const q=un(H);(ft(v,q)||I&&or(I.nodesRef.current,d).some(X=>{var se;return ft((se=X.context)==null?void 0:se.elements.floating,q)})||V.openEvent&&["click","mousedown"].includes(V.openEvent.type))&&h.domReference.current&&(F.current=h.domReference.current),C.current&&Xn(F.current)&&!U.current&&Gt(F.current,{cancelPrevious:!1,preventScroll:_})}},[r,v,C,g,h,p,I,d]),Ye(()=>{if(!(r||!M))return M.setFocusManagerState({modal:l,closeOnFocusOut:f,open:c,onOpenChange:m,refs:h}),()=>{M.setFocusManagerState(null)}},[r,M,l,c,m,h,f]),Ye(()=>{if(!r&&v&&typeof MutationObserver=="function"&&!P){const _=()=>{const x=v.getAttribute("tabindex");E.current.includes("floating")||un(Nt(v))!==h.domReference.current&&j().length===0?x!=="0"&&v.setAttribute("tabindex","0"):x!=="-1"&&v.setAttribute("tabindex","-1")};_();const H=new MutationObserver(_);return H.observe(v,{childList:!0,subtree:!0,attributes:!0}),()=>{H.disconnect()}}},[r,v,h,E,j,P]);function W(_){return r||!u||!l?null:A.createElement(tM,{ref:_==="start"?T:O,onClick:H=>m(!1,H.nativeEvent)},typeof u=="string"?u:"Dismiss")}const b=!r&&w&&!N&&(R||l);return A.createElement(A.Fragment,null,b&&A.createElement(ko,{"data-type":"inside",ref:M==null?void 0:M.beforeInsideRef,onFocus:_=>{if(l){const x=B();Gt(i[0]==="reference"?x[0]:x[x.length-1])}else if(M!=null&&M.preserveTabOrder&&M.portalNode)if(U.current=!1,si(_,M.portalNode)){const x=Fm()||y;x==null||x.focus()}else{var H;(H=M.beforeOutsideRef.current)==null||H.focus()}}}),!N&&W("start"),n,W("end"),b&&A.createElement(ko,{"data-type":"inside",ref:M==null?void 0:M.afterInsideRef,onFocus:_=>{if(l)Gt(B()[0]);else if(M!=null&&M.preserveTabOrder&&M.portalNode)if(f&&(U.current=!0),si(_,M.portalNode)){const x=Rm()||y;x==null||x.focus()}else{var H;(H=M.afterOutsideRef.current)==null||H.focus()}}}))}function Um(e){return Xn(e.target)&&e.target.tagName==="BUTTON"}function jm(e){return rm(e)}function rM(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:i,elements:{domReference:o}}=e,{enabled:s=!0,event:a="click",toggle:l=!0,ignoreMouse:u=!1,keyboardHandlers:f=!0}=t,c=A.useRef(),h=A.useRef(!1);return A.useMemo(()=>s?{reference:{onPointerDown(d){c.current=d.pointerType},onMouseDown(d){d.button===0&&(tm(c.current)&&u||a!=="click"&&(n&&l&&(!i.current.openEvent||i.current.openEvent.type==="mousedown")?r(!1,d.nativeEvent):(d.preventDefault(),r(!0,d.nativeEvent))))},onClick(d){if(a==="mousedown"&&c.current){c.current=void 0;return}tm(c.current)&&u||(n&&l&&(!i.current.openEvent||i.current.openEvent.type==="click")?r(!1,d.nativeEvent):r(!0,d.nativeEvent))},onKeyDown(d){c.current=void 0,!(d.defaultPrevented||!f||Um(d))&&(d.key===" "&&!jm(o)&&(d.preventDefault(),h.current=!0),d.key==="Enter"&&r(!(n&&l),d.nativeEvent))},onKeyUp(d){d.defaultPrevented||!f||Um(d)||jm(o)||d.key===" "&&h.current&&(h.current=!1,r(!(n&&l),d.nativeEvent))}}}:{},[s,i,a,u,f,o,l,n,r])}const iM=A.useInsertionEffect||(e=>e());function hn(e){const t=A.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return iM(()=>{t.current=e}),A.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 oM={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},sM={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},aM=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 lM(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:i,nodeId:o,elements:{reference:s,domReference:a,floating:l},dataRef:u}=e,{enabled:f=!0,escapeKey:c=!0,outsidePress:h=!0,outsidePressEvent:d="pointerdown",referencePress:m=!1,referencePressEvent:p="pointerdown",ancestorScroll:g=!1,bubbles:y}=t,v=wo(),w=Nm()!=null,E=hn(typeof h=="function"?h:()=>!1),S=typeof h=="function"?E:h,C=A.useRef(!1),{escapeKeyBubbles:I,outsidePressBubbles:M}=aM(y),P=hn(O=>{if(!n||!f||!c||O.key!=="Escape")return;const U=v?or(v.nodesRef.current,o):[];if(!I&&(O.stopPropagation(),U.length>0)){let F=!0;if(U.forEach(L=>{var R;if((R=L.context)!=null&&R.open&&!L.context.dataRef.current.__escapeKeyBubbles){F=!1;return}}),!F)return}i.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),r(!1,TI(O)?O.nativeEvent:O)}),T=hn(O=>{const U=C.current;if(C.current=!1,U||typeof S=="function"&&!S(O))return;const F=nm(O),L="["+oi("inert")+"]",R=Nt(l).querySelectorAll(L);let N=kt(F)?F:null;for(;N&&!xI(N);){const W=EI(N);if(W===Nt(l).body||!kt(W))break;N=W}if(R.length&&kt(F)&&!II(F)&&!ft(F,l)&&Array.from(R).every(W=>!ft(N,W)))return;if(Xn(F)&&l){const W=F.clientWidth>0&&F.scrollWidth>F.clientWidth,b=F.clientHeight>0&&F.scrollHeight>F.clientHeight;let _=b&&O.offsetX>F.clientWidth;if(b&&kI(F).direction==="rtl"&&(_=O.offsetX<=F.offsetWidth-F.clientWidth),_||W&&O.offsetY>F.clientHeight)return}const j=v&&or(v.nodesRef.current,o).some(W=>{var b;return il(O,(b=W.context)==null?void 0:b.elements.floating)});if(il(O,l)||il(O,a)||j)return;const B=v?or(v.nodesRef.current,o):[];if(B.length>0){let W=!0;if(B.forEach(b=>{var _;if((_=b.context)!=null&&_.open&&!b.context.dataRef.current.__outsidePressBubbles){W=!1;return}}),!W)return}i.emit("dismiss",{type:"outsidePress",data:{returnFocus:w?{preventScroll:!0}:Jp(O)||Xp(O)}}),r(!1,O)});return A.useEffect(()=>{if(!n||!f)return;u.current.__escapeKeyBubbles=I,u.current.__outsidePressBubbles=M;function O(L){r(!1,L)}const U=Nt(l);c&&U.addEventListener("keydown",P),S&&U.addEventListener(d,T);let F=[];return g&&(kt(a)&&(F=fn(a)),kt(l)&&(F=F.concat(fn(l))),!kt(s)&&s&&s.contextElement&&(F=F.concat(fn(s.contextElement)))),F=F.filter(L=>{var R;return L!==((R=U.defaultView)==null?void 0:R.visualViewport)}),F.forEach(L=>{L.addEventListener("scroll",O,{passive:!0})}),()=>{c&&U.removeEventListener("keydown",P),S&&U.removeEventListener(d,T),F.forEach(L=>{L.removeEventListener("scroll",O)})}},[u,l,a,s,c,S,d,n,r,g,f,I,M,P,T]),A.useEffect(()=>{C.current=!1},[S,d]),A.useMemo(()=>f?{reference:{onKeyDown:P,[oM[p]]:O=>{m&&(i.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),r(!1,O.nativeEvent))}},floating:{onKeyDown:P,[sM[d]]:()=>{C.current=!0}}}:{},[f,i,m,d,p,r,P])}let xl;process.env.NODE_ENV!=="production"&&(xl=new Set);function uM(e){var t;e===void 0&&(e={});const{open:n=!1,onOpenChange:r,nodeId:i}=e;if(process.env.NODE_ENV!=="production"){var o;const I="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((o=e.elements)!=null&&o.reference&&!kt(e.elements.reference)){var s;if(!((s=xl)!=null&&s.has(I))){var a;(a=xl)==null||a.add(I),console.error(I)}}}const[l,u]=A.useState(null),f=((t=e.elements)==null?void 0:t.reference)||l,c=bO(e),h=wo(),d=hn((I,M)=>{I&&(p.current.openEvent=M),r==null||r(I,M)}),m=A.useRef(null),p=A.useRef({}),g=A.useState(()=>jO())[0],y=vl(),v=A.useCallback(I=>{const M=kt(I)?{getBoundingClientRect:()=>I.getBoundingClientRect(),contextElement:I}:I;c.refs.setReference(M)},[c.refs]),w=A.useCallback(I=>{(kt(I)||I===null)&&(m.current=I,u(I)),(kt(c.refs.reference.current)||c.refs.reference.current===null||I!==null&&!kt(I))&&c.refs.setReference(I)},[c.refs]),E=A.useMemo(()=>({...c.refs,setReference:w,setPositionReference:v,domReference:m}),[c.refs,w,v]),S=A.useMemo(()=>({...c.elements,domReference:f}),[c.elements,f]),C=A.useMemo(()=>({...c,refs:E,elements:S,dataRef:p,nodeId:i,floatingId:y,events:g,open:n,onOpenChange:d}),[c,i,y,g,n,d,E,S]);return Ye(()=>{const I=h==null?void 0:h.nodesRef.current.find(M=>M.id===i);I&&(I.context=C)}),A.useMemo(()=>({...c,context:C,refs:E,elements:S}),[c,E,S,C])}function kl(e,t,n){const r=new Map;return{...n==="floating"&&{tabIndex:-1},...e,...t.map(i=>i?i[n]:null).concat(e).reduce((i,o)=>(o&&Object.entries(o).forEach(s=>{let[a,l]=s;if(a.indexOf("on")===0){if(r.has(a)||r.set(a,[]),typeof l=="function"){var u;(u=r.get(a))==null||u.push(l),i[a]=function(){for(var f,c=arguments.length,h=new Array(c),d=0;d<c;d++)h[d]=arguments[d];return(f=r.get(a))==null?void 0:f.map(m=>m(...h)).find(m=>m!==void 0)}}}else i[a]=l}),i),{})}}function cM(e){e===void 0&&(e=[]);const t=e,n=A.useCallback(o=>kl(o,e,"reference"),t),r=A.useCallback(o=>kl(o,e,"floating"),t),i=A.useCallback(o=>kl(o,e,"item"),e.map(o=>o==null?void 0:o.item));return A.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:i}),[n,r,i])}let Hm=!1;function Eo(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Vm(e,t){return Eo(t,e===ml||e===yo,e===ir||e===ri)}function El(e,t,n){return Eo(t,e===yo,n?e===ir:e===ri)||e==="Enter"||e==" "||e===""}function fM(e,t,n){return Eo(t,n?e===ir:e===ri,e===yo)}function Wm(e,t,n){return Eo(t,n?e===ri:e===ir,e===ml)}function dM(e,t){const{open:n,onOpenChange:r,refs:i,elements:{domReference:o,floating:s}}=e,{listRef:a,activeIndex:l,onNavigate:u=()=>{},enabled:f=!0,selectedIndex:c=null,allowEscape:h=!1,loop:d=!1,nested:m=!1,rtl:p=!1,virtual:g=!1,focusItemOnOpen:y="auto",focusItemOnHover:v=!0,openOnArrowKeyDown:w=!0,disabledIndices:E=void 0,orientation:S="vertical",cols:C=1,scrollItemIntoView:I=!0,virtualItemRef:M}=t;process.env.NODE_ENV!=="production"&&(h&&(d||console.warn(["Floating UI: `useListNavigation` looping must be enabled to allow","escaping."].join(" ")),g||console.warn(["Floating UI: `useListNavigation` must be virtual to allow","escaping."].join(" "))),S==="vertical"&&C>1&&console.warn(["Floating UI: In grid list navigation mode (`cols` > 1), the",'`orientation` should be either "horizontal" or "both".'].join(" ")));const P=Nm(),T=wo(),O=hn(u),U=A.useRef(y),F=A.useRef(c??-1),L=A.useRef(null),R=A.useRef(!0),N=A.useRef(O),j=A.useRef(!!s),B=A.useRef(!1),W=A.useRef(!1),b=dn(E),_=dn(n),H=dn(I),[x,V]=A.useState(),[Y,q]=A.useState(),Q=hn(function(G,te,$){$===void 0&&($=!1);const ne=G.current[te.current];ne&&(g?(V(ne.id),T==null||T.events.emit("virtualfocus",ne),M&&(M.current=ne)):Gt(ne,{preventScroll:!0,sync:AI()&&em()?Hm||B.current:!1}),requestAnimationFrame(()=>{const ge=H.current;ge&&ne&&($||!R.current)&&(ne.scrollIntoView==null||ne.scrollIntoView(typeof ge=="boolean"?{block:"nearest",inline:"nearest"}:ge))}))});Ye(()=>{document.createElement("div").focus({get preventScroll(){return Hm=!0,!1}})},[]),Ye(()=>{f&&(n&&s?U.current&&c!=null&&(W.current=!0,O(c)):j.current&&(F.current=-1,N.current(null)))},[f,n,s,c,O]),Ye(()=>{if(f&&n&&s)if(l==null){if(B.current=!1,c!=null)return;if(j.current&&(F.current=-1,Q(a,F)),!j.current&&U.current&&(L.current!=null||U.current===!0&&L.current==null)){let G=0;const te=()=>{a.current[0]==null?(G<2&&(G?requestAnimationFrame:queueMicrotask)(te),G++):(F.current=L.current==null||El(L.current,S,p)||m?gl(a,b.current):Om(a,b.current),L.current=null,O(F.current))};te()}}else ii(a,l)||(F.current=l,Q(a,F,W.current),W.current=!1)},[f,n,s,l,c,m,a,S,p,O,Q,b]),Ye(()=>{var G,te;if(!f||s||!T||g||!j.current)return;const $=T.nodesRef.current,ne=(G=$.find(J=>J.id===P))==null||(te=G.context)==null?void 0:te.elements.floating,ge=un(Nt(s)),Oe=$.some(J=>J.context&&ft(J.context.elements.floating,ge));ne&&!Oe&&R.current&&ne.focus({preventScroll:!0})},[f,s,T,P,g]),Ye(()=>{if(!f||!T||!g||P)return;function G(te){q(te.id),M&&(M.current=te)}return T.events.on("virtualfocus",G),()=>{T.events.off("virtualfocus",G)}},[f,T,g,P,M]),Ye(()=>{N.current=O,j.current=!!s}),Ye(()=>{n||(L.current=null)},[n]);const X=l!=null,se=A.useMemo(()=>{function G($){if(!n)return;const ne=a.current.indexOf($);ne!==-1&&O(ne)}return{onFocus($){let{currentTarget:ne}=$;G(ne)},onClick:$=>{let{currentTarget:ne}=$;return ne.focus({preventScroll:!0})},...v&&{onMouseMove($){let{currentTarget:ne}=$;G(ne)},onPointerLeave($){let{pointerType:ne}=$;!R.current||ne==="touch"||(F.current=-1,Q(a,F),O(null),g||Gt(i.floating.current,{preventScroll:!0}))}}}},[n,i,Q,v,a,O,g]);return A.useMemo(()=>{if(!f)return{};const G=b.current;function te(J){if(R.current=!1,B.current=!0,!_.current&&J.currentTarget===i.floating.current)return;if(m&&Wm(J.key,S,p)){Je(J),r(!1,J.nativeEvent),Xn(o)&&!g&&o.focus();return}const ue=F.current,de=gl(a,G),fe=Om(a,G);if(J.key==="Home"&&(Je(J),F.current=de,O(F.current)),J.key==="End"&&(Je(J),F.current=fe,O(F.current)),!(C>1&&(F.current=BO(a,{event:J,orientation:S,loop:d,cols:C,disabledIndices:G,minIndex:de,maxIndex:fe,prevIndex:F.current,stopEvent:!0}),O(F.current),S==="both"))&&Vm(J.key,S)){if(Je(J),n&&!g&&un(J.currentTarget.ownerDocument)===J.currentTarget){F.current=El(J.key,S,p)?de:fe,O(F.current);return}El(J.key,S,p)?d?F.current=ue>=fe?h&&ue!==a.current.length?-1:de:nt(a,{startingIndex:ue,disabledIndices:G}):F.current=Math.min(fe,nt(a,{startingIndex:ue,disabledIndices:G})):d?F.current=ue<=de?h&&ue!==-1?a.current.length:fe:nt(a,{startingIndex:ue,decrement:!0,disabledIndices:G}):F.current=Math.max(de,nt(a,{startingIndex:ue,decrement:!0,disabledIndices:G})),ii(a,F.current)?O(null):O(F.current)}}function $(J){y==="auto"&&Jp(J.nativeEvent)&&(U.current=!0)}function ne(J){U.current=y,y==="auto"&&Xp(J.nativeEvent)&&(U.current=!0)}const ge=g&&n&&X&&{"aria-activedescendant":Y||x},Oe=a.current.find(J=>(J==null?void 0:J.id)===x);return{reference:{...ge,onKeyDown(J){R.current=!1;const ue=J.key.indexOf("Arrow")===0,de=fM(J.key,S,p),fe=Wm(J.key,S,p),Ae=Vm(J.key,S),Fe=(m?de:Ae)||J.key==="Enter"||J.key.trim()==="";if(g&&n){const ae=T==null?void 0:T.nodesRef.current.find(K=>K.parentId==null),z=T&&ae?qO(T.nodesRef.current,ae.id):null;if(ue&&z&&M){const K=new KeyboardEvent("keydown",{key:J.key,bubbles:!0});if(de||fe){var Me,je;const oe=((Me=z.context)==null?void 0:Me.elements.domReference)===J.currentTarget,le=fe&&!oe?(je=z.context)==null?void 0:je.elements.domReference:de?Oe:null;le&&(Je(J),le.dispatchEvent(K),q(void 0))}if(Ae&&z.context&&z.context.open&&z.parentId&&J.currentTarget!==z.context.elements.domReference){var ee;Je(J),(ee=z.context.elements.domReference)==null||ee.dispatchEvent(K);return}}return te(J)}if(!(!n&&!w&&ue)){if(Fe&&(L.current=m&&Ae?null:J.key),m){de&&(Je(J),n?(F.current=gl(a,G),O(F.current)):r(!0,J.nativeEvent));return}Ae&&(c!=null&&(F.current=c),Je(J),!n&&w?r(!0,J.nativeEvent):te(J),n&&O(F.current))}},onFocus(){n&&O(null)},onPointerDown:ne,onMouseDown:$,onClick:$},floating:{"aria-orientation":S==="both"?void 0:S,...ge,onKeyDown:te,onPointerMove(){R.current=!0}},item:se}},[o,i,x,Y,b,_,a,f,S,p,g,n,X,m,c,w,h,C,d,y,O,r,se,T,M])}function hM(e,t){t===void 0&&(t={});const{open:n,floatingId:r}=e,{enabled:i=!0,role:o="dialog"}=t,s=vl();return A.useMemo(()=>{const a={id:r,role:o};return i?o==="tooltip"?{reference:{"aria-describedby":n?r:void 0},floating:a}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":o==="alertdialog"?"dialog":o,"aria-controls":n?r:void 0,...o==="listbox"&&{role:"combobox"},...o==="menu"&&{id:s}},floating:{...a,...o==="menu"&&{"aria-labelledby":s}}}:{}},[i,o,n,r,s])}function pM(e,t){var n;const{open:r,dataRef:i}=e,{listRef:o,activeIndex:s,onMatch:a,onTypingChange:l,enabled:u=!0,findMatch:f=null,resetMs:c=750,ignoreKeys:h=[],selectedIndex:d=null}=t,m=A.useRef(),p=A.useRef(""),g=A.useRef((n=d??s)!=null?n:-1),y=A.useRef(null),v=hn(a),w=hn(l),E=dn(f),S=dn(h);return Ye(()=>{r&&(clearTimeout(m.current),y.current=null,p.current="")},[r]),Ye(()=>{if(r&&p.current===""){var C;g.current=(C=d??s)!=null?C:-1}},[r,d,s]),A.useMemo(()=>{if(!u)return{};function C(P){P?i.current.typing||(i.current.typing=P,w(P)):i.current.typing&&(i.current.typing=P,w(P))}function I(P,T,O){const U=E.current?E.current(T,O):T.find(F=>(F==null?void 0:F.toLocaleLowerCase().indexOf(O.toLocaleLowerCase()))===0);return U?P.indexOf(U):-1}function M(P){const T=o.current;if(p.current.length>0&&p.current[0]!==" "&&(I(T,T,p.current)===-1?C(!1):P.key===" "&&Je(P)),T==null||S.current.includes(P.key)||P.key.length!==1||P.ctrlKey||P.metaKey||P.altKey)return;r&&P.key!==" "&&(Je(P),C(!0)),T.every(L=>{var R,N;return L?((R=L[0])==null?void 0:R.toLocaleLowerCase())!==((N=L[1])==null?void 0:N.toLocaleLowerCase()):!0})&&p.current===P.key&&(p.current="",g.current=y.current),p.current+=P.key,clearTimeout(m.current),m.current=setTimeout(()=>{p.current="",g.current=y.current,C(!1)},c);const U=g.current,F=I(T,[...T.slice((U||0)+1),...T.slice(0,(U||0)+1)],p.current);F!==-1?(v(F),y.current=F):P.key!==" "&&(p.current="",C(!1))}return{reference:{onKeyDown:M},floating:{onKeyDown:M,onKeyUp(P){P.key===" "&&C(!1)}}}},[u,r,i,o,c,S,E,v,w])}const mM=({options:e,reusable:t,sendMessage:n,isReadOnly:r})=>{var R,N,j,B,W;const i=Qn(b=>b.messageContainerRef),o=Qn(b=>b.portalContainer),[s,a]=A.useState(!1),[l,u]=A.useState(null),[f,c]=A.useState(null),{message:{blocks:{dropdown:h}}}=me,d=e.reduce((b,_)=>(b[_.label]=_.value,b),{}),m=d?Object.keys(d):[],p=b=>{a(f!==null&&!t?!1:b)},{refs:g,floatingStyles:y,context:v}=uM({placement:"bottom-start",open:s,onOpenChange:p,whileElementsMounted:dO,middleware:[wO(5),SO({padding:10,boundary:(i==null?void 0:i.current)??void 0,crossAxis:!0}),xO({apply({rects:b,elements:_,availableHeight:H}){Object.assign(_.floating.style,{maxHeight:`${H}px`,minWidth:`${b.reference.width}px`})},padding:10})]}),w=A.useRef([]),E=A.useRef(m),S=A.useRef(!1),C=rM(v,{event:"mousedown"}),I=lM(v),M=hM(v,{role:"listbox"}),P=dM(v,{listRef:w,activeIndex:l,selectedIndex:f,onNavigate:u,loop:!0}),T=pM(v,{listRef:E,activeIndex:l,selectedIndex:f,onMatch:s?u:c,onTypingChange(b){S.current=b}}),{getReferenceProps:O,getFloatingProps:U,getItemProps:F}=cM([I,M,P,T,C]),L=b=>{c(b),m[b]!==void 0&&(n==null||n({type:"text",text:m[b]??"",value:d[m[b]]??""})),a(!1)};return k.jsxs(k.Fragment,{children:[k.jsxs("div",{tabIndex:0,ref:g.setReference,"aria-labelledby":"select-label","aria-autocomplete":"none","data-disabled":f!==null&&!t?"":void 0,style:r?{pointerEvents:"none"}:void 0,...(R=h.button)==null?void 0:R.container,...O(),children:[k.jsx("span",{...(N=h.button)==null?void 0:N.text,children:f?m[f]:"Select..."}),k.jsx(UA,{...(j=h.button)==null?void 0:j.icon})]}),s&&k.jsx(eM,{root:o??void 0,children:k.jsx(nM,{context:v,modal:!1,children:k.jsx("div",{ref:g.setFloating,className:(W=(B=h.content)==null?void 0:B.container)==null?void 0:W.className,style:{...y,pointerEvents:"auto"},...U(),children:m.map((b,_)=>{var H;return k.jsx("div",{ref:x=>{w.current[_]=x},role:"option",tabIndex:_===l?0:-1,"aria-selected":_===f&&_===l,"data-active":_===l?"":void 0,...(H=h.content)==null?void 0:H.item,...F({onClick(){L(_)},onKeyDown(x){x.key==="Enter"&&(x.preventDefault(),L(_)),x.key===" "&&!S.current&&(x.preventDefault(),L(_))}}),children:b},b)})})})})]})},qm=D.forwardRef(({title:e,url:t,isReadOnly:n,...r},i)=>{const{message:{blocks:{file:o}}}=me;return k.jsxs("a",{...r,...o.container,href:t,style:n?{pointerEvents:"none"}:void 0,download:!0,ref:i,target:"_blank",rel:"noreferrer",children:[k.jsx("p",{...o.title,children:e||t}),k.jsx(WA,{...o.icon})]})});qm.displayName="File";const gM=ln()((e,t)=>({components:{},getCustomComponent:async n=>{const r=t().components[n];if(r)return r;const i=await fetch(n).then(u=>u.text()),o=new Blob([i],{type:"application/javascript"}),a=await import(URL.createObjectURL(o)),l=()=>a.default;return e(u=>({components:{...u.components,[n]:l}})),l}}));globalThis.React=D;const Ym={audio:Fp,bubble:Mp,button:LT,carousel:Yp,column:$p,dropdown:mM,file:qm,image:Pp,location:Rp,row:Bp,text:dT,video:Lp,custom:({url:e,name:t,data:n,...r})=>{const i=gM(u=>u.getCustomComponent),[o,s]=D.useState(null),[a,l]=D.useState(null);return D.useEffect(()=>{i(e).then(s).catch(u=>{l(u.message)})},[e]),a?k.jsx("div",{style:{color:"red"},children:a}):o?k.jsx(o,{...n,...r}):null}},Dn=({block:e,renderers:t,...n})=>{const r=(t==null?void 0:t[e.type])??Ym[e.type],i={...n,...e};return k.jsx(r,{...i})};function Km(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Km(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ar(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Km(e))&&(r&&(r+=" "),r+=t);return r}const yM=({disabled:e,onFileSelected:t})=>{const n=D.useRef(null),{uploadButton:r}=me.composer,i=()=>{n.current&&n.current.click()},o=s=>{const a=s.target.files;a&&a.length>0&&Array.from(a).forEach(l=>{t(l)})};return k.jsxs(k.Fragment,{children:[k.jsx(nT,{...r,role:"button",tabIndex:0,"aria-label":"Upload File Button","data-disabled":e,onClick:i}),k.jsx("input",{value:"",multiple:!0,type:"file",ref:n,style:{display:"none"},onChange:o})]})},vM=({name:e,type:t,instance:n,status:r,removeFile:i})=>{const{loader:o,fileIcon:s,removeIcon:a,errorIcon:l,previewImage:u}=me.composer.fileWidget,f=["PNG","JPEG","JPG"].includes(Ao(n.name));return r==="loading"?k.jsx(Co,{name:e,status:r,removeButton:k.jsx("div",{...o}),extension:Ao(n.name),children:k.jsx("div",{...s.container,children:k.jsx(Cl,{type:t,...s.icon})})}):r==="error"?k.jsx(Co,{name:e,status:r,removeButton:k.jsx(Gm,{removeFile:()=>i(e)}),extension:"Upload Error",children:k.jsxs("div",{...s.container,children:[k.jsx(jA,{...l}),k.jsx(Cl,{type:t,...s.icon})]})}):r=="uploaded"&&f?k.jsx(Co,{name:e,status:r,removeButton:k.jsx(Gm,{removeFile:()=>i(e)}),extension:Ao(n.name),children:k.jsx("div",{...s.container,children:k.jsx("img",{src:URL.createObjectURL(n),alt:e,...u})})}):k.jsx(Co,{name:e,status:r,removeButton:k.jsx(up,{onClick:()=>i(e),...a}),extension:Ao(n.name),children:k.jsx("div",{...s.container,children:k.jsx(Cl,{type:t,...s.icon})})})},Co=({name:e,status:t,removeButton:n,children:r,extension:i})=>{const{container:o,metadata:s}=me.composer.fileWidget;return k.jsxs("div",{"data-status":t,title:e,...o,children:[n,r,k.jsxs("div",{...s.container,children:[k.jsx("div",{...s.name,children:e}),k.jsx("div",{...s.type,children:i})]})]})},Cl=({type:e,...t})=>e==="image"?k.jsx(KA,{...t}):e==="video"?k.jsx(uT,{...t}):e==="audio"?k.jsx(dp,{...t}):k.jsx(cp,{...t}),Ao=e=>{if(!e)return"File";const t=e.split(".").pop();return t?t.toUpperCase():"File"},Gm=({removeFile:e})=>{const{composer:{fileWidget:{removeIcon:t}}}=me;return k.jsx(up,{role:"button",tabIndex:0,"aria-label":"Remove File Button",onClick:()=>e(),...t})};function Al(){return Al=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Al.apply(null,arguments)}function bM(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var wM=D.useLayoutEffect,SM=function(t){var n=D.useRef(t);return wM(function(){n.current=t}),n},Qm=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},xM=function(t,n){var r=D.useRef();return D.useCallback(function(i){t.current=i,r.current&&Qm(r.current,null),r.current=n,n&&Qm(n,i)},[n])},Zm={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},kM=function(t){Object.keys(Zm).forEach(function(n){t.style.setProperty(n,Zm[n],"important")})},Jm=kM,st=null,Xm=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function EM(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),st||(st=document.createElement("textarea"),st.setAttribute("tabindex","-1"),st.setAttribute("aria-hidden","true"),Jm(st)),st.parentNode===null&&document.body.appendChild(st);var i=e.paddingSize,o=e.borderSize,s=e.sizingStyle,a=s.boxSizing;Object.keys(s).forEach(function(h){var d=h;st.style[d]=s[d]}),Jm(st),st.value=t;var l=Xm(st,e);st.value=t,l=Xm(st,e),st.value="x";var u=st.scrollHeight-i,f=u*n;a==="border-box"&&(f=f+i+o),l=Math.max(f,l);var c=u*r;return a==="border-box"&&(c=c+i+o),l=Math.min(c,l),[l,u]}var eg=function(){},CM=function(t,n){return t.reduce(function(r,i){return r[i]=n[i],r},{})},AM=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],TM=!!document.documentElement.currentStyle,IM=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=CM(AM,n),i=r.boxSizing;if(i==="")return null;TM&&i==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var o=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),s=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:o,borderSize:s}},OM=IM;function tg(e,t,n){var r=SM(n);A.useLayoutEffect(function(){var i=function(s){return r.current(s)};if(e)return e.addEventListener(t,i),function(){return e.removeEventListener(t,i)}},[])}var MM=function(t){tg(window,"resize",t)},DM=function(t){tg(document.fonts,"loadingdone",t)},NM=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],_M=function(t,n){var r=t.cacheMeasurements,i=t.maxRows,o=t.minRows,s=t.onChange,a=s===void 0?eg:s,l=t.onHeightChange,u=l===void 0?eg:l,f=bM(t,NM),c=f.value!==void 0,h=A.useRef(null),d=xM(h,n),m=A.useRef(0),p=A.useRef(),g=function(){var w=h.current,E=r&&p.current?p.current:OM(w);if(E){p.current=E;var S=EM(E,w.value||w.placeholder||"x",o,i),C=S[0],I=S[1];m.current!==C&&(m.current=C,w.style.setProperty("height",C+"px","important"),u(C,{rowHeight:I}))}},y=function(w){c||g(),a(w)};return A.useLayoutEffect(g),MM(g),DM(g),A.createElement("textarea",Al({},f,{onChange:y,ref:d}))},PM=A.forwardRef(_M);const LM=({inputRef:e,composerPlaceholder:t,composerDisabled:n,textInput:r,historyIndex:i,setTextInput:o,setHistoryIndex:s,sendComposerMessage:a,allowFileUpload:l,onFilePasted:u,conversationId:f,storageKey:c})=>{const d=kp(f||"default",c)(E=>E.messageHistory),[m,p]=D.useState(""),[g,y]=D.useState(!1),{input:v}=me.composer,w=E=>{if(!l||!u||!E.clipboardData)return;const S=Array.from(E.clipboardData.files);S.length>0&&(E.preventDefault(),S.forEach(C=>{u(C)}))};return k.jsx(PM,{...v,"aria-label":"Message Input",ref:e,placeholder:t??"Type your message...",disabled:n,value:r,"data-has-value":!!r,onChange:E=>{const S=E.target.value;o(S),d.includes(S)||s(-1)},onPaste:w,maxRows:5,onKeyDown:E=>{if(n)return;const S=E.nativeEvent;if(!(S.isComposing||S.keyCode===229)&&(r.length===0&&y(!1),E.key!=="ArrowUp"&&E.key!=="ArrowDown"&&E.key!=="ArrowLeft"&&E.key!=="ArrowRight"&&y(!0),E.key==="Enter"&&E.shiftKey?(E.preventDefault(),o(`${r}
289
- `)):E.key==="Enter"&&(E.preventDefault(),a()),!(r.length>0&&g))){if(E.key==="ArrowUp"){E.preventDefault(),i===-1&&r.trim()!==""&&p(r);const C=Math.min(i+1,d.length-1);s(C),o(d[C]??"")}if(E.key==="ArrowDown"){E.preventDefault();const C=Math.max(i-1,-1);o(i===-1?r.trim():C===-1?m:d[C]??""),s(C)}}}})},FM=({disabled:e,setTextInput:t})=>{const[n,r]=D.useState(!1),i=D.useRef(null),{voiceButton:o}=me.composer,s=window.SpeechRecognition||window.webkitSpeechRecognition,a=()=>{i.current||(i.current=new s);const l=i.current;l&&(l.continuous=!0,l.onresult=u=>{var c,h,d;const f=((d=(h=(c=u.results)==null?void 0:c[0])==null?void 0:h[0])==null?void 0:d.transcript)??"";t(f??""),l.stop(),r(!1)},n?(l.stop(),r(!1)):(l.start(),r(!0)))};if(s)return k.jsx(XA,{...o,tabIndex:0,"aria-label":"Voice Input Button",role:"button","data-show":!e,"data-listens":!!n,onClick:a})},ng=D.memo(D.forwardRef(({className:e,inputRef:t,disableComposer:n,isReadOnly:r,allowFileUpload:i,disableSendButton:o,connected:s,composerPlaceholder:a,footer:l,sendMessage:u,uploadFile:f,storageKey:c,conversationId:h,children:d,...m},p)=>{const{composer:g}=me,y=n||r||!s,[v,w]=D.useState(""),[E,S]=D.useState(-1),C=Ap(h||"default"),I=kp(h||"default",c),M=C(N=>N.files),P=C(N=>N.setFiles),T=C(N=>N.deleteFile),O=C(N=>N.uploadFile),U=I(N=>N.addMessageToHistory),F=M.filter(N=>N.status==="uploaded"),L=!!v.trim()||F.length>0,R=()=>{if(o||!L)return;const N=F.map(B=>{const W=B.url,b=B.type,_=B.fileId;return{video:{type:"video",videoUrl:W,fileId:_},audio:{type:"audio",audioUrl:W,fileId:_},image:{type:"image",imageUrl:W,fileId:_}}[b]??{title:B.name,type:"file",fileUrl:W,fileId:_}})??[];v&&N.push({type:"text",text:v});let j;N.length==1?j=N[0]:j={type:"bloc",items:N.map(W=>{const{type:b,..._}=W;return{type:b,payload:_}})},w(""),u==null||u(j),P([]),U(v),S(-1)};return r?null:k.jsxs(k.Fragment,{children:[k.jsxs("div",{"data-disabled":y,"data-waiting":o,className:ar(g.container.className,e),ref:p,...m,children:[d,M.length>0&&k.jsx("div",{...g==null?void 0:g.fileContainer,children:M.map(N=>k.jsx(vM,{...N,removeFile:T},N.name))}),k.jsxs("div",{...g.inputContainer,onClick:()=>{t&&"current"in t&&t.current&&t.current.focus()},children:[i&&k.jsx(yM,{disabled:y,onFileSelected:N=>{f&&O(N,f)}}),k.jsx(LM,{inputRef:t,composerPlaceholder:a,composerDisabled:y,textInput:v,historyIndex:E,setTextInput:w,setHistoryIndex:S,sendComposerMessage:R,allowFileUpload:i,onFilePasted:N=>{f&&O(N,f)},conversationId:h,storageKey:c}),o&&k.jsx(GA,{...g.inputLoader,role:"status","data-show":o}),!y&&!o&&k.jsxs(k.Fragment,{children:[k.jsx(BA,{...g.sendbutton,role:"button",tabIndex:0,"aria-label":"Send Message Button","data-show":L,onClick:()=>R()}),k.jsx(FM,{disabled:L,setTextInput:w})]})]})]}),k.jsx(Ch,{components:{a:({node:N,...j})=>k.jsx("a",{...j,target:"_blank",rel:"noreferrer noopener"})},allowedElements:["a","strong","code","em","p","span"],...g.footer,children:l})]})}));var Tl={exports:{}},To={exports:{}},Te={};/** @license React v16.13.1
288
+ */var hO=["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])"],cl=hO.join(","),vm=typeof Element>"u",ni=vm?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,go=!vm&&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},ri=function(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"),o=i===""||i==="true",s=o||n&&t&&ri(t.parentNode);return s},pO=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},mO=function(t,n,r){if(ri(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(cl));return n&&ni.call(t,cl)&&i.unshift(t),i=i.filter(r),i},fl=function(t,n,r){for(var i=[],o=Array.from(t);o.length;){var s=o.shift();if(!ri(s,!1))if(s.tagName==="SLOT"){var a=s.assignedElements(),l=a.length?a:s.children,u=fl(l,!0,r);r.flatten?i.push.apply(i,u):i.push({scopeParent:s,candidates:u})}else{var f=ni.call(s,cl);f&&r.filter(s)&&(n||!t.includes(s))&&i.push(s);var c=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),h=!ri(c,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(c&&h){var d=fl(c===!0?s.children:c.children,!0,r);r.flatten?i.push.apply(i,d):i.push({scopeParent:s,candidates:d})}else o.unshift.apply(o,s.children)}}return i},bm=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},wm=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||pO(t))&&!bm(t)?0:t.tabIndex},gO=function(t,n){var r=wm(t);return r<0&&n&&!bm(t)?0:r},yO=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Sm=function(t){return t.tagName==="INPUT"},vO=function(t){return Sm(t)&&t.type==="hidden"},bO=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},wO=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},SO=function(t){if(!t.name)return!0;var n=t.form||go(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(s){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",s.message),!1}var o=wO(i,t.form);return!o||o===t},xO=function(t){return Sm(t)&&t.type==="radio"},kO=function(t){return xO(t)&&!SO(t)},EO=function(t){var n,r=t&&go(t),i=(n=r)===null||n===void 0?void 0:n.host,o=!1;if(r&&r!==t){var s,a,l;for(o=!!((s=i)!==null&&s!==void 0&&(a=s.ownerDocument)!==null&&a!==void 0&&a.contains(i)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!o&&i;){var u,f,c;r=go(i),i=(u=r)===null||u===void 0?void 0:u.host,o=!!((f=i)!==null&&f!==void 0&&(c=f.ownerDocument)!==null&&c!==void 0&&c.contains(i))}}return o},xm=function(t){var n=t.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},CO=function(t,n){var r=n.displayCheck,i=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var o=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!o}if(getComputedStyle(t).visibility==="hidden")return!0;var s=ni.call(t,"details>summary:first-of-type"),a=s?t.parentElement:t;if(ni.call(a,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof i=="function"){for(var l=t;t;){var u=t.parentElement,f=go(t);if(u&&!u.shadowRoot&&i(u)===!0)return xm(t);t.assignedSlot?t=t.assignedSlot:!u&&f!==t.ownerDocument?t=f.host:t=u}t=l}if(EO(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return xm(t);return!1},AO=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 ni.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},TO=function(t,n){return!(n.disabled||ri(n)||vO(n)||CO(n,t)||bO(n)||AO(n))},km=function(t,n){return!(kO(n)||wm(n)<0||!TO(t,n))},IO=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Em=function(t){var n=[],r=[];return t.forEach(function(i,o){var s=!!i.scopeParent,a=s?i.scopeParent:i,l=gO(a,s),u=s?Em(i.candidates):a;l===0?s?n.push.apply(n,u):n.push(a):r.push({documentOrder:o,tabIndex:l,item:i,isScope:s,content:u})}),r.sort(yO).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},dl=function(t,n){n=n||{};var r;return n.getShadowRoot?r=fl([t],n.includeContainer,{filter:km.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:IO}):r=mO(t,n.includeContainer,km.bind(null,n)),Em(r)};const hl="ArrowUp",yo="ArrowDown",ir="ArrowLeft",ii="ArrowRight";function vo(e,t,n){return Math.floor(e/t)!==n}function oi(e,t){return t<0||t>=e.current.length}function pl(e,t){return nt(e,{disabledIndices:t})}function Cm(e,t){return nt(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function nt(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:i,amount:o=1}=t===void 0?{}:t;const s=e.current;let a=n;do{var l,u;a=a+(r?-o:o)}while(a>=0&&a<=s.length-1&&(i?i.includes(a):s[a]==null||(l=s[a])!=null&&l.hasAttribute("disabled")||((u=s[a])==null?void 0:u.getAttribute("aria-disabled"))==="true"));return a}function OO(e,t){let{event:n,orientation:r,loop:i,cols:o,disabledIndices:s,minIndex:a,maxIndex:l,prevIndex:u,stopEvent:f=!1}=t,c=u;if(n.key===hl){if(f&&Je(n),u===-1)c=l;else if(c=nt(e,{startingIndex:c,amount:o,decrement:!0,disabledIndices:s}),i&&(u-o<a||c<0)){const h=u%o,d=l%o,m=l-(d-h);d===h?c=l:c=d>h?m:m-o}oi(e,c)&&(c=u)}if(n.key===yo&&(f&&Je(n),u===-1?c=a:(c=nt(e,{startingIndex:u,amount:o,disabledIndices:s}),i&&u+o>l&&(c=nt(e,{startingIndex:u%o-o,amount:o,disabledIndices:s}))),oi(e,c)&&(c=u)),r==="both"){const h=Vp(u/o);n.key===ii&&(f&&Je(n),u%o!==o-1?(c=nt(e,{startingIndex:u,disabledIndices:s}),i&&vo(c,o,h)&&(c=nt(e,{startingIndex:u-u%o-1,disabledIndices:s}))):i&&(c=nt(e,{startingIndex:u-u%o-1,disabledIndices:s})),vo(c,o,h)&&(c=u)),n.key===ir&&(f&&Je(n),u%o!==0?(c=nt(e,{startingIndex:u,disabledIndices:s,decrement:!0}),i&&vo(c,o,h)&&(c=nt(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}))):i&&(c=nt(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s})),vo(c,o,h)&&(c=u));const d=Vp(l/o)===h;oi(e,c)&&(i&&d?c=n.key===ir?l:nt(e,{startingIndex:u-u%o-1,disabledIndices:s}):c=u)}return c}let Am=0;function Gt(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(Am);const o=()=>e==null?void 0:e.focus({preventScroll:n});i?o():Am=requestAnimationFrame(o)}var Ye=typeof document<"u"?M.useLayoutEffect:M.useEffect;function bo(){return bo=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},bo.apply(this,arguments)}let ml=!1,MO=0;const Tm=()=>"floating-ui-"+MO++;function DO(){const[e,t]=C.useState(()=>ml?Tm():void 0);return Ye(()=>{e==null&&t(Tm())},[]),C.useEffect(()=>{ml||(ml=!0)},[]),e}const gl=C.useId||DO;function NO(){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 _O=C.createContext(null),PO=C.createContext(null),Im=()=>{var e;return((e=C.useContext(_O))==null?void 0:e.id)||null},wo=()=>C.useContext(PO);function si(e){return"data-floating-ui-"+e}function dn(e){const t=M.useRef(e);return Ye(()=>{t.current=e}),t}function LO(e,t){var n;let r=[],i=(n=e.find(o=>o.id===t))==null?void 0:n.parentId;for(;i;){const o=e.find(s=>s.id===i);i=o==null?void 0:o.parentId,o&&(r=r.concat(o))}return r}function or(e,t){let n=e.filter(i=>{var o;return i.parentId===t&&((o=i.context)==null?void 0:o.open)}),r=n;for(;r.length;)r=e.filter(i=>{var o;return(o=r)==null?void 0:o.some(s=>{var a;return i.parentId===s.id&&((a=i.context)==null?void 0:a.open)})}),n=n.concat(r);return n}function FO(e,t){let n,r=-1;function i(o,s){s>r&&(n=o,r=s),or(e,o).forEach(l=>{i(l.id,s+1)})}return i(t,0),e.find(o=>o.id===n)}let sr=new WeakMap,So=new WeakSet,xo={},yl=0;const RO=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,Om=e=>e&&(e.host||Om(e.parentNode)),$O=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=Om(n);return e.contains(r)?r:null}).filter(n=>n!=null);function BO(e,t,n,r){const i="data-floating-ui-inert",o=r?"inert":n?"aria-hidden":null,s=$O(t,e),a=new Set,l=new Set(s),u=[];xo[i]||(xo[i]=new WeakMap);const f=xo[i];s.forEach(c),h(t),a.clear();function c(d){!d||a.has(d)||(a.add(d),d.parentNode&&c(d.parentNode))}function h(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,m=>{if(a.has(m))h(m);else{const p=o?m.getAttribute(o):null,g=p!==null&&p!=="false",v=(sr.get(m)||0)+1,y=(f.get(m)||0)+1;sr.set(m,v),f.set(m,y),u.push(m),v===1&&g&&So.add(m),y===1&&m.setAttribute(i,""),!g&&o&&m.setAttribute(o,"true")}})}return yl++,()=>{u.forEach(d=>{const m=(sr.get(d)||0)-1,p=(f.get(d)||0)-1;sr.set(d,m),f.set(d,p),m||(!So.has(d)&&o&&d.removeAttribute(o),So.delete(d)),p||d.removeAttribute(i)}),yl--,yl||(sr=new WeakMap,sr=new WeakMap,So=new WeakSet,xo={})}}function Mm(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=Nt(e[0]).body;return BO(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const vl=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Dm(e,t){const n=dl(e,vl());t==="prev"&&n.reverse();const r=n.indexOf(un(Nt(e)));return n.slice(r+1)[0]}function Nm(){return Dm(document.body,"next")}function _m(){return Dm(document.body,"prev")}function ai(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!ft(n,r)}function zO(e){dl(e,vl()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function UO(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 bl={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 HO;function Pm(e){e.key==="Tab"&&(e.target,clearTimeout(HO))}const ko=C.forwardRef(function(t,n){const[r,i]=C.useState();Ye(()=>(Qp()&&i("button"),document.addEventListener("keydown",Pm),()=>{document.removeEventListener("keydown",Pm)}),[]);const o={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[si("focus-guard")]:"",style:bl};return C.createElement("span",bo({},t,o))}),Lm=C.createContext(null);function jO(e){let{id:t,root:n}=e===void 0?{}:e;const[r,i]=C.useState(null),o=gl(),s=Fm(),a=C.useMemo(()=>({id:t,root:n,portalContext:s,uniqueId:o}),[t,n,s,o]),l=C.useRef();return Ye(()=>()=>{r==null||r.remove()},[r,a]),Ye(()=>{if(l.current===a)return;l.current=a;const{id:u,root:f,portalContext:c,uniqueId:h}=a,d=u?document.getElementById(u):null,m=si("portal");if(d){const p=document.createElement("div");p.id=h,p.setAttribute(m,""),d.appendChild(p),i(p)}else{let p=f||(c==null?void 0:c.portalNode);p&&!kt(p)&&(p=p.current),p=p||document.body;let g=null;u&&(g=document.createElement("div"),g.id=u,p.appendChild(g));const v=document.createElement("div");v.id=h,v.setAttribute(m,""),p=g||p,p.appendChild(v),i(v)}},[a]),r}function VO(e){let{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e;const o=jO({id:n,root:r}),[s,a]=C.useState(null),l=C.useRef(null),u=C.useRef(null),f=C.useRef(null),c=C.useRef(null),h=!!s&&!s.modal&&s.open&&i&&!!(r||o);return C.useEffect(()=>{if(!o||!i||s!=null&&s.modal)return;function d(m){o&&ai(m)&&(m.type==="focusin"?UO:zO)(o)}return o.addEventListener("focusin",d,!0),o.addEventListener("focusout",d,!0),()=>{o.removeEventListener("focusin",d,!0),o.removeEventListener("focusout",d,!0)}},[o,i,s==null?void 0:s.modal]),C.createElement(Lm.Provider,{value:C.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:f,afterInsideRef:c,portalNode:o,setFocusManagerState:a}),[i,o])},h&&o&&C.createElement(ko,{"data-type":"outside",ref:l,onFocus:d=>{if(ai(d,o)){var m;(m=f.current)==null||m.focus()}else{const p=_m()||(s==null?void 0:s.refs.domReference.current);p==null||p.focus()}}}),h&&o&&C.createElement("span",{"aria-owns":o.id,style:bl}),o&&Fu.createPortal(t,o),h&&o&&C.createElement(ko,{"data-type":"outside",ref:u,onFocus:d=>{if(ai(d,o)){var m;(m=c.current)==null||m.focus()}else{const p=Nm()||(s==null?void 0:s.refs.domReference.current);p==null||p.focus(),s!=null&&s.closeOnFocusOut&&(s==null||s.onOpenChange(!1,d.nativeEvent))}}}))}const Fm=()=>C.useContext(Lm),WO=C.forwardRef(function(t,n){return C.createElement("button",bo({},t,{type:"button",ref:n,tabIndex:-1,style:bl}))});function qO(e){const{context:t,children:n,disabled:r=!1,order:i=["content"],guards:o=!0,initialFocus:s=0,returnFocus:a=!0,modal:l=!0,visuallyHiddenDismiss:u=!1,closeOnFocusOut:f=!0}=e,{open:c,refs:h,nodeId:d,onOpenChange:m,events:p,dataRef:g,elements:{domReference:v,floating:y}}=t,w=RO()?o:!0,A=dn(i),k=dn(s),E=dn(a),I=wo(),D=Fm(),P=typeof s=="number"&&s<0,T=C.useRef(null),O=C.useRef(null),B=C.useRef(!1),L=C.useRef(null),F=C.useRef(!1),R=D!=null,N=v&&v.getAttribute("role")==="combobox"&&Xp(v)&&P,H=C.useCallback(function(_){return _===void 0&&(_=y),_?dl(_,vl()):[]},[y]),z=C.useCallback(_=>{const j=H(_);return A.current.map(S=>v&&S==="reference"?v:y&&S==="floating"?y:j).filter(Boolean).flat()},[v,y,A,H]);C.useEffect(()=>{if(r||!l)return;function _(S){if(S.key==="Tab"){ft(y,un(Nt(y)))&&H().length===0&&!N&&Je(S);const V=z(),Y=Jp(S);A.current[0]==="reference"&&Y===v&&(Je(S),S.shiftKey?Gt(V[V.length-1]):Gt(V[1])),A.current[1]==="floating"&&Y===y&&S.shiftKey&&(Je(S),Gt(V[0]))}}const j=Nt(y);return j.addEventListener("keydown",_),()=>{j.removeEventListener("keydown",_)}},[r,v,y,l,A,h,N,H,z]),C.useEffect(()=>{if(r||!f)return;function _(){F.current=!0,setTimeout(()=>{F.current=!1})}function j(S){const V=S.relatedTarget;queueMicrotask(()=>{const Y=!(ft(v,V)||ft(y,V)||ft(V,y)||ft(D==null?void 0:D.portalNode,V)||V!=null&&V.hasAttribute(si("focus-guard"))||I&&(or(I.nodesRef.current,d).find(q=>{var Q,X;return ft((Q=q.context)==null?void 0:Q.elements.floating,V)||ft((X=q.context)==null?void 0:X.elements.domReference,V)})||LO(I.nodesRef.current,d).find(q=>{var Q,X;return((Q=q.context)==null?void 0:Q.elements.floating)===V||((X=q.context)==null?void 0:X.elements.domReference)===V})));V&&Y&&!F.current&&V!==L.current&&(B.current=!0,m(!1,S))})}if(y&&Xn(v))return v.addEventListener("focusout",j),v.addEventListener("pointerdown",_),!l&&y.addEventListener("focusout",j),()=>{v.removeEventListener("focusout",j),v.removeEventListener("pointerdown",_),!l&&y.removeEventListener("focusout",j)}},[r,v,y,l,d,I,D,m,f]),C.useEffect(()=>{var _;if(r)return;const j=Array.from((D==null||(_=D.portalNode)==null?void 0:_.querySelectorAll("["+si("portal")+"]"))||[]);if(y){const S=[y,...j,T.current,O.current,A.current.includes("reference")||N?v:null].filter(Y=>Y!=null),V=l?Mm(S,w,!w):Mm(S);return()=>{V()}}},[r,v,y,l,A,D,N,w]),Ye(()=>{if(r||!y)return;const _=Nt(y),j=un(_);queueMicrotask(()=>{const S=z(y),V=k.current,Y=(typeof V=="number"?S[V]:V.current)||y,q=ft(y,j);!P&&!q&&c&&Gt(Y,{preventScroll:Y===y})})},[r,c,y,P,z,k]),Ye(()=>{if(r||!y)return;let _=!1;const j=Nt(y),S=un(j),V=g.current;L.current=S;function Y(q){if(q.type==="escapeKey"&&h.domReference.current&&(L.current=h.domReference.current),["referencePress","escapeKey"].includes(q.type))return;const Q=q.data.returnFocus;typeof Q=="object"?(B.current=!1,_=Q.preventScroll):B.current=!Q}return p.on("dismiss",Y),()=>{p.off("dismiss",Y);const q=un(j);(ft(y,q)||I&&or(I.nodesRef.current,d).some(X=>{var se;return ft((se=X.context)==null?void 0:se.elements.floating,q)})||V.openEvent&&["click","mousedown"].includes(V.openEvent.type))&&h.domReference.current&&(L.current=h.domReference.current),E.current&&Xn(L.current)&&!B.current&&Gt(L.current,{cancelPrevious:!1,preventScroll:_})}},[r,y,E,g,h,p,I,d]),Ye(()=>{if(!(r||!D))return D.setFocusManagerState({modal:l,closeOnFocusOut:f,open:c,onOpenChange:m,refs:h}),()=>{D.setFocusManagerState(null)}},[r,D,l,c,m,h,f]),Ye(()=>{if(!r&&y&&typeof MutationObserver=="function"&&!P){const _=()=>{const S=y.getAttribute("tabindex");A.current.includes("floating")||un(Nt(y))!==h.domReference.current&&H().length===0?S!=="0"&&y.setAttribute("tabindex","0"):S!=="-1"&&y.setAttribute("tabindex","-1")};_();const j=new MutationObserver(_);return j.observe(y,{childList:!0,subtree:!0,attributes:!0}),()=>{j.disconnect()}}},[r,y,h,A,H,P]);function W(_){return r||!u||!l?null:C.createElement(WO,{ref:_==="start"?T:O,onClick:j=>m(!1,j.nativeEvent)},typeof u=="string"?u:"Dismiss")}const b=!r&&w&&!N&&(R||l);return C.createElement(C.Fragment,null,b&&C.createElement(ko,{"data-type":"inside",ref:D==null?void 0:D.beforeInsideRef,onFocus:_=>{if(l){const S=z();Gt(i[0]==="reference"?S[0]:S[S.length-1])}else if(D!=null&&D.preserveTabOrder&&D.portalNode)if(B.current=!1,ai(_,D.portalNode)){const S=Nm()||v;S==null||S.focus()}else{var j;(j=D.beforeOutsideRef.current)==null||j.focus()}}}),!N&&W("start"),n,W("end"),b&&C.createElement(ko,{"data-type":"inside",ref:D==null?void 0:D.afterInsideRef,onFocus:_=>{if(l)Gt(z()[0]);else if(D!=null&&D.preserveTabOrder&&D.portalNode)if(f&&(B.current=!0),ai(_,D.portalNode)){const S=_m()||v;S==null||S.focus()}else{var j;(j=D.afterOutsideRef.current)==null||j.focus()}}}))}function Rm(e){return Xn(e.target)&&e.target.tagName==="BUTTON"}function $m(e){return Xp(e)}function YO(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:i,elements:{domReference:o}}=e,{enabled:s=!0,event:a="click",toggle:l=!0,ignoreMouse:u=!1,keyboardHandlers:f=!0}=t,c=C.useRef(),h=C.useRef(!1);return C.useMemo(()=>s?{reference:{onPointerDown(d){c.current=d.pointerType},onMouseDown(d){d.button===0&&(Zp(c.current)&&u||a!=="click"&&(n&&l&&(!i.current.openEvent||i.current.openEvent.type==="mousedown")?r(!1,d.nativeEvent):(d.preventDefault(),r(!0,d.nativeEvent))))},onClick(d){if(a==="mousedown"&&c.current){c.current=void 0;return}Zp(c.current)&&u||(n&&l&&(!i.current.openEvent||i.current.openEvent.type==="click")?r(!1,d.nativeEvent):r(!0,d.nativeEvent))},onKeyDown(d){c.current=void 0,!(d.defaultPrevented||!f||Rm(d))&&(d.key===" "&&!$m(o)&&(d.preventDefault(),h.current=!0),d.key==="Enter"&&r(!(n&&l),d.nativeEvent))},onKeyUp(d){d.defaultPrevented||!f||Rm(d)||$m(o)||d.key===" "&&h.current&&(h.current=!1,r(!(n&&l),d.nativeEvent))}}}:{},[s,i,a,u,f,o,l,n,r])}const KO=C.useInsertionEffect||(e=>e());function hn(e){const t=C.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return KO(()=>{t.current=e}),C.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 GO={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},QO={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},ZO=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 JO(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:i,nodeId:o,elements:{reference:s,domReference:a,floating:l},dataRef:u}=e,{enabled:f=!0,escapeKey:c=!0,outsidePress:h=!0,outsidePressEvent:d="pointerdown",referencePress:m=!1,referencePressEvent:p="pointerdown",ancestorScroll:g=!1,bubbles:v}=t,y=wo(),w=Im()!=null,A=hn(typeof h=="function"?h:()=>!1),k=typeof h=="function"?A:h,E=C.useRef(!1),{escapeKeyBubbles:I,outsidePressBubbles:D}=ZO(v),P=hn(O=>{if(!n||!f||!c||O.key!=="Escape")return;const B=y?or(y.nodesRef.current,o):[];if(!I&&(O.stopPropagation(),B.length>0)){let L=!0;if(B.forEach(F=>{var R;if((R=F.context)!=null&&R.open&&!F.context.dataRef.current.__escapeKeyBubbles){L=!1;return}}),!L)return}i.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),r(!1,yI(O)?O.nativeEvent:O)}),T=hn(O=>{const B=E.current;if(E.current=!1,B||typeof k=="function"&&!k(O))return;const L=Jp(O),F="["+si("inert")+"]",R=Nt(l).querySelectorAll(F);let N=kt(L)?L:null;for(;N&&!dI(N);){const W=pI(N);if(W===Nt(l).body||!kt(W))break;N=W}if(R.length&&kt(L)&&!vI(L)&&!ft(L,l)&&Array.from(R).every(W=>!ft(N,W)))return;if(Xn(L)&&l){const W=L.clientWidth>0&&L.scrollWidth>L.clientWidth,b=L.clientHeight>0&&L.scrollHeight>L.clientHeight;let _=b&&O.offsetX>L.clientWidth;if(b&&hI(L).direction==="rtl"&&(_=O.offsetX<=L.offsetWidth-L.clientWidth),_||W&&O.offsetY>L.clientHeight)return}const H=y&&or(y.nodesRef.current,o).some(W=>{var b;return nl(O,(b=W.context)==null?void 0:b.elements.floating)});if(nl(O,l)||nl(O,a)||H)return;const z=y?or(y.nodesRef.current,o):[];if(z.length>0){let W=!0;if(z.forEach(b=>{var _;if((_=b.context)!=null&&_.open&&!b.context.dataRef.current.__outsidePressBubbles){W=!1;return}}),!W)return}i.emit("dismiss",{type:"outsidePress",data:{returnFocus:w?{preventScroll:!0}:Kp(O)||Gp(O)}}),r(!1,O)});return C.useEffect(()=>{if(!n||!f)return;u.current.__escapeKeyBubbles=I,u.current.__outsidePressBubbles=D;function O(F){r(!1,F)}const B=Nt(l);c&&B.addEventListener("keydown",P),k&&B.addEventListener(d,T);let L=[];return g&&(kt(a)&&(L=fn(a)),kt(l)&&(L=L.concat(fn(l))),!kt(s)&&s&&s.contextElement&&(L=L.concat(fn(s.contextElement)))),L=L.filter(F=>{var R;return F!==((R=B.defaultView)==null?void 0:R.visualViewport)}),L.forEach(F=>{F.addEventListener("scroll",O,{passive:!0})}),()=>{c&&B.removeEventListener("keydown",P),k&&B.removeEventListener(d,T),L.forEach(F=>{F.removeEventListener("scroll",O)})}},[u,l,a,s,c,k,d,n,r,g,f,I,D,P,T]),C.useEffect(()=>{E.current=!1},[k,d]),C.useMemo(()=>f?{reference:{onKeyDown:P,[GO[p]]:O=>{m&&(i.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),r(!1,O.nativeEvent))}},floating:{onKeyDown:P,[QO[d]]:()=>{E.current=!0}}}:{},[f,i,m,d,p,r,P])}let wl;process.env.NODE_ENV!=="production"&&(wl=new Set);function XO(e){var t;e===void 0&&(e={});const{open:n=!1,onOpenChange:r,nodeId:i}=e;if(process.env.NODE_ENV!=="production"){var o;const I="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((o=e.elements)!=null&&o.reference&&!kt(e.elements.reference)){var s;if(!((s=wl)!=null&&s.has(I))){var a;(a=wl)==null||a.add(I),console.error(I)}}}const[l,u]=C.useState(null),f=((t=e.elements)==null?void 0:t.reference)||l,c=uO(e),h=wo(),d=hn((I,D)=>{I&&(p.current.openEvent=D),r==null||r(I,D)}),m=C.useRef(null),p=C.useRef({}),g=C.useState(()=>NO())[0],v=gl(),y=C.useCallback(I=>{const D=kt(I)?{getBoundingClientRect:()=>I.getBoundingClientRect(),contextElement:I}:I;c.refs.setReference(D)},[c.refs]),w=C.useCallback(I=>{(kt(I)||I===null)&&(m.current=I,u(I)),(kt(c.refs.reference.current)||c.refs.reference.current===null||I!==null&&!kt(I))&&c.refs.setReference(I)},[c.refs]),A=C.useMemo(()=>({...c.refs,setReference:w,setPositionReference:y,domReference:m}),[c.refs,w,y]),k=C.useMemo(()=>({...c.elements,domReference:f}),[c.elements,f]),E=C.useMemo(()=>({...c,refs:A,elements:k,dataRef:p,nodeId:i,floatingId:v,events:g,open:n,onOpenChange:d}),[c,i,v,g,n,d,A,k]);return Ye(()=>{const I=h==null?void 0:h.nodesRef.current.find(D=>D.id===i);I&&(I.context=E)}),C.useMemo(()=>({...c,context:E,refs:A,elements:k}),[c,A,k,E])}function Sl(e,t,n){const r=new Map;return{...n==="floating"&&{tabIndex:-1},...e,...t.map(i=>i?i[n]:null).concat(e).reduce((i,o)=>(o&&Object.entries(o).forEach(s=>{let[a,l]=s;if(a.indexOf("on")===0){if(r.has(a)||r.set(a,[]),typeof l=="function"){var u;(u=r.get(a))==null||u.push(l),i[a]=function(){for(var f,c=arguments.length,h=new Array(c),d=0;d<c;d++)h[d]=arguments[d];return(f=r.get(a))==null?void 0:f.map(m=>m(...h)).find(m=>m!==void 0)}}}else i[a]=l}),i),{})}}function eM(e){e===void 0&&(e=[]);const t=e,n=C.useCallback(o=>Sl(o,e,"reference"),t),r=C.useCallback(o=>Sl(o,e,"floating"),t),i=C.useCallback(o=>Sl(o,e,"item"),e.map(o=>o==null?void 0:o.item));return C.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:i}),[n,r,i])}let Bm=!1;function Eo(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function zm(e,t){return Eo(t,e===hl||e===yo,e===ir||e===ii)}function xl(e,t,n){return Eo(t,e===yo,n?e===ir:e===ii)||e==="Enter"||e==" "||e===""}function tM(e,t,n){return Eo(t,n?e===ir:e===ii,e===yo)}function Um(e,t,n){return Eo(t,n?e===ii:e===ir,e===hl)}function nM(e,t){const{open:n,onOpenChange:r,refs:i,elements:{domReference:o,floating:s}}=e,{listRef:a,activeIndex:l,onNavigate:u=()=>{},enabled:f=!0,selectedIndex:c=null,allowEscape:h=!1,loop:d=!1,nested:m=!1,rtl:p=!1,virtual:g=!1,focusItemOnOpen:v="auto",focusItemOnHover:y=!0,openOnArrowKeyDown:w=!0,disabledIndices:A=void 0,orientation:k="vertical",cols:E=1,scrollItemIntoView:I=!0,virtualItemRef:D}=t;process.env.NODE_ENV!=="production"&&(h&&(d||console.warn(["Floating UI: `useListNavigation` looping must be enabled to allow","escaping."].join(" ")),g||console.warn(["Floating UI: `useListNavigation` must be virtual to allow","escaping."].join(" "))),k==="vertical"&&E>1&&console.warn(["Floating UI: In grid list navigation mode (`cols` > 1), the",'`orientation` should be either "horizontal" or "both".'].join(" ")));const P=Im(),T=wo(),O=hn(u),B=C.useRef(v),L=C.useRef(c??-1),F=C.useRef(null),R=C.useRef(!0),N=C.useRef(O),H=C.useRef(!!s),z=C.useRef(!1),W=C.useRef(!1),b=dn(A),_=dn(n),j=dn(I),[S,V]=C.useState(),[Y,q]=C.useState(),Q=hn(function(G,te,$){$===void 0&&($=!1);const ne=G.current[te.current];ne&&(g?(V(ne.id),T==null||T.events.emit("virtualfocus",ne),D&&(D.current=ne)):Gt(ne,{preventScroll:!0,sync:gI()&&Qp()?Bm||z.current:!1}),requestAnimationFrame(()=>{const me=j.current;me&&ne&&($||!R.current)&&(ne.scrollIntoView==null||ne.scrollIntoView(typeof me=="boolean"?{block:"nearest",inline:"nearest"}:me))}))});Ye(()=>{document.createElement("div").focus({get preventScroll(){return Bm=!0,!1}})},[]),Ye(()=>{f&&(n&&s?B.current&&c!=null&&(W.current=!0,O(c)):H.current&&(L.current=-1,N.current(null)))},[f,n,s,c,O]),Ye(()=>{if(f&&n&&s)if(l==null){if(z.current=!1,c!=null)return;if(H.current&&(L.current=-1,Q(a,L)),!H.current&&B.current&&(F.current!=null||B.current===!0&&F.current==null)){let G=0;const te=()=>{a.current[0]==null?(G<2&&(G?requestAnimationFrame:queueMicrotask)(te),G++):(L.current=F.current==null||xl(F.current,k,p)||m?pl(a,b.current):Cm(a,b.current),F.current=null,O(L.current))};te()}}else oi(a,l)||(L.current=l,Q(a,L,W.current),W.current=!1)},[f,n,s,l,c,m,a,k,p,O,Q,b]),Ye(()=>{var G,te;if(!f||s||!T||g||!H.current)return;const $=T.nodesRef.current,ne=(G=$.find(J=>J.id===P))==null||(te=G.context)==null?void 0:te.elements.floating,me=un(Nt(s)),Oe=$.some(J=>J.context&&ft(J.context.elements.floating,me));ne&&!Oe&&R.current&&ne.focus({preventScroll:!0})},[f,s,T,P,g]),Ye(()=>{if(!f||!T||!g||P)return;function G(te){q(te.id),D&&(D.current=te)}return T.events.on("virtualfocus",G),()=>{T.events.off("virtualfocus",G)}},[f,T,g,P,D]),Ye(()=>{N.current=O,H.current=!!s}),Ye(()=>{n||(F.current=null)},[n]);const X=l!=null,se=C.useMemo(()=>{function G($){if(!n)return;const ne=a.current.indexOf($);ne!==-1&&O(ne)}return{onFocus($){let{currentTarget:ne}=$;G(ne)},onClick:$=>{let{currentTarget:ne}=$;return ne.focus({preventScroll:!0})},...y&&{onMouseMove($){let{currentTarget:ne}=$;G(ne)},onPointerLeave($){let{pointerType:ne}=$;!R.current||ne==="touch"||(L.current=-1,Q(a,L),O(null),g||Gt(i.floating.current,{preventScroll:!0}))}}}},[n,i,Q,y,a,O,g]);return C.useMemo(()=>{if(!f)return{};const G=b.current;function te(J){if(R.current=!1,z.current=!0,!_.current&&J.currentTarget===i.floating.current)return;if(m&&Um(J.key,k,p)){Je(J),r(!1,J.nativeEvent),Xn(o)&&!g&&o.focus();return}const ue=L.current,de=pl(a,G),fe=Cm(a,G);if(J.key==="Home"&&(Je(J),L.current=de,O(L.current)),J.key==="End"&&(Je(J),L.current=fe,O(L.current)),!(E>1&&(L.current=OO(a,{event:J,orientation:k,loop:d,cols:E,disabledIndices:G,minIndex:de,maxIndex:fe,prevIndex:L.current,stopEvent:!0}),O(L.current),k==="both"))&&zm(J.key,k)){if(Je(J),n&&!g&&un(J.currentTarget.ownerDocument)===J.currentTarget){L.current=xl(J.key,k,p)?de:fe,O(L.current);return}xl(J.key,k,p)?d?L.current=ue>=fe?h&&ue!==a.current.length?-1:de:nt(a,{startingIndex:ue,disabledIndices:G}):L.current=Math.min(fe,nt(a,{startingIndex:ue,disabledIndices:G})):d?L.current=ue<=de?h&&ue!==-1?a.current.length:fe:nt(a,{startingIndex:ue,decrement:!0,disabledIndices:G}):L.current=Math.max(de,nt(a,{startingIndex:ue,decrement:!0,disabledIndices:G})),oi(a,L.current)?O(null):O(L.current)}}function $(J){v==="auto"&&Kp(J.nativeEvent)&&(B.current=!0)}function ne(J){B.current=v,v==="auto"&&Gp(J.nativeEvent)&&(B.current=!0)}const me=g&&n&&X&&{"aria-activedescendant":Y||S},Oe=a.current.find(J=>(J==null?void 0:J.id)===S);return{reference:{...me,onKeyDown(J){R.current=!1;const ue=J.key.indexOf("Arrow")===0,de=tM(J.key,k,p),fe=Um(J.key,k,p),Ae=zm(J.key,k),Fe=(m?de:Ae)||J.key==="Enter"||J.key.trim()==="";if(g&&n){const ae=T==null?void 0:T.nodesRef.current.find(K=>K.parentId==null),U=T&&ae?FO(T.nodesRef.current,ae.id):null;if(ue&&U&&D){const K=new KeyboardEvent("keydown",{key:J.key,bubbles:!0});if(de||fe){var Me,He;const oe=((Me=U.context)==null?void 0:Me.elements.domReference)===J.currentTarget,le=fe&&!oe?(He=U.context)==null?void 0:He.elements.domReference:de?Oe:null;le&&(Je(J),le.dispatchEvent(K),q(void 0))}if(Ae&&U.context&&U.context.open&&U.parentId&&J.currentTarget!==U.context.elements.domReference){var ee;Je(J),(ee=U.context.elements.domReference)==null||ee.dispatchEvent(K);return}}return te(J)}if(!(!n&&!w&&ue)){if(Fe&&(F.current=m&&Ae?null:J.key),m){de&&(Je(J),n?(L.current=pl(a,G),O(L.current)):r(!0,J.nativeEvent));return}Ae&&(c!=null&&(L.current=c),Je(J),!n&&w?r(!0,J.nativeEvent):te(J),n&&O(L.current))}},onFocus(){n&&O(null)},onPointerDown:ne,onMouseDown:$,onClick:$},floating:{"aria-orientation":k==="both"?void 0:k,...me,onKeyDown:te,onPointerMove(){R.current=!0}},item:se}},[o,i,S,Y,b,_,a,f,k,p,g,n,X,m,c,w,h,E,d,v,O,r,se,T,D])}function rM(e,t){t===void 0&&(t={});const{open:n,floatingId:r}=e,{enabled:i=!0,role:o="dialog"}=t,s=gl();return C.useMemo(()=>{const a={id:r,role:o};return i?o==="tooltip"?{reference:{"aria-describedby":n?r:void 0},floating:a}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":o==="alertdialog"?"dialog":o,"aria-controls":n?r:void 0,...o==="listbox"&&{role:"combobox"},...o==="menu"&&{id:s}},floating:{...a,...o==="menu"&&{"aria-labelledby":s}}}:{}},[i,o,n,r,s])}function iM(e,t){var n;const{open:r,dataRef:i}=e,{listRef:o,activeIndex:s,onMatch:a,onTypingChange:l,enabled:u=!0,findMatch:f=null,resetMs:c=750,ignoreKeys:h=[],selectedIndex:d=null}=t,m=C.useRef(),p=C.useRef(""),g=C.useRef((n=d??s)!=null?n:-1),v=C.useRef(null),y=hn(a),w=hn(l),A=dn(f),k=dn(h);return Ye(()=>{r&&(clearTimeout(m.current),v.current=null,p.current="")},[r]),Ye(()=>{if(r&&p.current===""){var E;g.current=(E=d??s)!=null?E:-1}},[r,d,s]),C.useMemo(()=>{if(!u)return{};function E(P){P?i.current.typing||(i.current.typing=P,w(P)):i.current.typing&&(i.current.typing=P,w(P))}function I(P,T,O){const B=A.current?A.current(T,O):T.find(L=>(L==null?void 0:L.toLocaleLowerCase().indexOf(O.toLocaleLowerCase()))===0);return B?P.indexOf(B):-1}function D(P){const T=o.current;if(p.current.length>0&&p.current[0]!==" "&&(I(T,T,p.current)===-1?E(!1):P.key===" "&&Je(P)),T==null||k.current.includes(P.key)||P.key.length!==1||P.ctrlKey||P.metaKey||P.altKey)return;r&&P.key!==" "&&(Je(P),E(!0)),T.every(F=>{var R,N;return F?((R=F[0])==null?void 0:R.toLocaleLowerCase())!==((N=F[1])==null?void 0:N.toLocaleLowerCase()):!0})&&p.current===P.key&&(p.current="",g.current=v.current),p.current+=P.key,clearTimeout(m.current),m.current=setTimeout(()=>{p.current="",g.current=v.current,E(!1)},c);const B=g.current,L=I(T,[...T.slice((B||0)+1),...T.slice(0,(B||0)+1)],p.current);L!==-1?(y(L),v.current=L):P.key!==" "&&(p.current="",E(!1))}return{reference:{onKeyDown:D},floating:{onKeyDown:D,onKeyUp(P){P.key===" "&&E(!1)}}}},[u,r,i,o,c,k,A,y,w])}const oM=({options:e,reusable:t,sendMessage:n,isReadOnly:r})=>{var R,N,H,z,W;const i=Qn(b=>b.messageContainerRef),o=Qn(b=>b.portalContainer),[s,a]=C.useState(!1),[l,u]=C.useState(null),[f,c]=C.useState(null),{message:{blocks:{dropdown:h}}}=ye,d=e.reduce((b,_)=>(b[_.label]=_.value,b),{}),m=d?Object.keys(d):[],p=b=>{a(f!==null&&!t?!1:b)},{refs:g,floatingStyles:v,context:y}=XO({placement:"bottom-start",open:s,onOpenChange:p,whileElementsMounted:nO,middleware:[cO(5),fO({padding:10,boundary:(i==null?void 0:i.current)??void 0,crossAxis:!0}),dO({apply({rects:b,elements:_,availableHeight:j}){Object.assign(_.floating.style,{maxHeight:`${j}px`,minWidth:`${b.reference.width}px`})},padding:10})]}),w=C.useRef([]),A=C.useRef(m),k=C.useRef(!1),E=YO(y,{event:"mousedown"}),I=JO(y),D=rM(y,{role:"listbox"}),P=nM(y,{listRef:w,activeIndex:l,selectedIndex:f,onNavigate:u,loop:!0}),T=iM(y,{listRef:A,activeIndex:l,selectedIndex:f,onMatch:s?u:c,onTypingChange(b){k.current=b}}),{getReferenceProps:O,getFloatingProps:B,getItemProps:L}=eM([I,D,P,T,E]),F=b=>{c(b),m[b]!==void 0&&(n==null||n({type:"text",text:m[b]??"",value:d[m[b]]??""})),a(!1)};return x.jsxs(x.Fragment,{children:[x.jsxs("div",{tabIndex:0,ref:g.setReference,"aria-labelledby":"select-label","aria-autocomplete":"none","data-disabled":f!==null&&!t?"":void 0,style:r?{pointerEvents:"none"}:void 0,...(R=h.button)==null?void 0:R.container,...O(),children:[x.jsx("span",{...(N=h.button)==null?void 0:N.text,children:f?m[f]:"Select..."}),x.jsx(DA,{...(H=h.button)==null?void 0:H.icon})]}),s&&x.jsx(VO,{root:o??void 0,children:x.jsx(qO,{context:y,modal:!1,children:x.jsx("div",{ref:g.setFloating,className:(W=(z=h.content)==null?void 0:z.container)==null?void 0:W.className,style:{...v,pointerEvents:"auto"},...B(),children:m.map((b,_)=>{var j;return x.jsx("div",{ref:S=>{w.current[_]=S},role:"option",tabIndex:_===l?0:-1,"aria-selected":_===f&&_===l,"data-active":_===l?"":void 0,...(j=h.content)==null?void 0:j.item,...L({onClick(){F(_)},onKeyDown(S){S.key==="Enter"&&(S.preventDefault(),F(_)),S.key===" "&&!k.current&&(S.preventDefault(),F(_))}}),children:b},b)})})})})]})},Hm=M.forwardRef(({title:e,url:t,isReadOnly:n,...r},i)=>{const{message:{blocks:{file:o}}}=ye;return x.jsxs("a",{...r,...o.container,href:t,style:n?{pointerEvents:"none"}:void 0,download:!0,ref:i,target:"_blank",rel:"noreferrer",children:[x.jsx("p",{...o.title,children:e||t}),x.jsx(LA,{...o.icon})]})});Hm.displayName="File";const sM=ln()((e,t)=>({components:{},getCustomComponent:async n=>{const r=t().components[n];if(r)return r;const i=await fetch(n).then(u=>u.text()),o=new Blob([i],{type:"application/javascript"}),a=await import(URL.createObjectURL(o)),l=()=>a.default;return e(u=>({components:{...u.components,[n]:l}})),l}}));globalThis.React=M;const jm={audio:Np,bubble:Ap,button:CT,carousel:jp,column:Pp,dropdown:oM,file:Hm,image:Mp,location:_p,row:Lp,text:nT,video:Dp,custom:({url:e,name:t,data:n,...r})=>{const i=sM(u=>u.getCustomComponent),[o,s]=M.useState(null),[a,l]=M.useState(null);return M.useEffect(()=>{i(e).then(s).catch(u=>{l(u.message)})},[e]),a?x.jsx("div",{style:{color:"red"},children:a}):o?x.jsx(o,{...n,...r}):null}},Dn=({block:e,renderers:t,...n})=>{const r=(t==null?void 0:t[e.type])??jm[e.type],i={...n,...e};return x.jsx(r,{...i})};function Vm(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Vm(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ar(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Vm(e))&&(r&&(r+=" "),r+=t);return r}const aM=({disabled:e,onFileSelected:t})=>{const n=M.useRef(null),{uploadButton:r}=ye.composer,i=()=>{n.current&&n.current.click()},o=s=>{const a=s.target.files;a&&a.length>0&&Array.from(a).forEach(l=>{t(l)})};return x.jsxs(x.Fragment,{children:[x.jsx(qA,{...r,role:"button",tabIndex:0,"aria-label":"Upload File Button","data-disabled":e,onClick:i}),x.jsx("input",{value:"",multiple:!0,type:"file",ref:n,style:{display:"none"},onChange:o})]})},lM=({name:e,type:t,instance:n,status:r,removeFile:i})=>{const{loader:o,fileIcon:s,removeIcon:a,errorIcon:l,previewImage:u}=ye.composer.fileWidget,f=["PNG","JPEG","JPG"].includes(Ao(n.name));return r==="loading"?x.jsx(Co,{name:e,status:r,removeButton:x.jsx("div",{...o}),extension:Ao(n.name),children:x.jsx("div",{...s.container,children:x.jsx(kl,{type:t,...s.icon})})}):r==="error"?x.jsx(Co,{name:e,status:r,removeButton:x.jsx(Wm,{removeFile:()=>i(e)}),extension:"Upload Error",children:x.jsxs("div",{...s.container,children:[x.jsx(NA,{...l}),x.jsx(kl,{type:t,...s.icon})]})}):r=="uploaded"&&f?x.jsx(Co,{name:e,status:r,removeButton:x.jsx(Wm,{removeFile:()=>i(e)}),extension:Ao(n.name),children:x.jsx("div",{...s.container,children:x.jsx("img",{src:URL.createObjectURL(n),alt:e,...u})})}):x.jsx(Co,{name:e,status:r,removeButton:x.jsx(op,{onClick:()=>i(e),...a}),extension:Ao(n.name),children:x.jsx("div",{...s.container,children:x.jsx(kl,{type:t,...s.icon})})})},Co=({name:e,status:t,removeButton:n,children:r,extension:i})=>{const{container:o,metadata:s}=ye.composer.fileWidget;return x.jsxs("div",{"data-status":t,title:e,...o,children:[n,r,x.jsxs("div",{...s.container,children:[x.jsx("div",{...s.name,children:e}),x.jsx("div",{...s.type,children:i})]})]})},kl=({type:e,...t})=>e==="image"?x.jsx($A,{...t}):e==="video"?x.jsx(XA,{...t}):e==="audio"?x.jsx(lp,{...t}):x.jsx(sp,{...t}),Ao=e=>{if(!e)return"File";const t=e.split(".").pop();return t?t.toUpperCase():"File"},Wm=({removeFile:e})=>{const{composer:{fileWidget:{removeIcon:t}}}=ye;return x.jsx(op,{role:"button",tabIndex:0,"aria-label":"Remove File Button",onClick:()=>e(),...t})};function El(){return El=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},El.apply(null,arguments)}function uM(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var cM=M.useLayoutEffect,fM=function(t){var n=M.useRef(t);return cM(function(){n.current=t}),n},qm=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},dM=function(t,n){var r=M.useRef();return M.useCallback(function(i){t.current=i,r.current&&qm(r.current,null),r.current=n,n&&qm(n,i)},[n])},Ym={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},hM=function(t){Object.keys(Ym).forEach(function(n){t.style.setProperty(n,Ym[n],"important")})},Km=hM,st=null,Gm=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function pM(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),st||(st=document.createElement("textarea"),st.setAttribute("tabindex","-1"),st.setAttribute("aria-hidden","true"),Km(st)),st.parentNode===null&&document.body.appendChild(st);var i=e.paddingSize,o=e.borderSize,s=e.sizingStyle,a=s.boxSizing;Object.keys(s).forEach(function(h){var d=h;st.style[d]=s[d]}),Km(st),st.value=t;var l=Gm(st,e);st.value=t,l=Gm(st,e),st.value="x";var u=st.scrollHeight-i,f=u*n;a==="border-box"&&(f=f+i+o),l=Math.max(f,l);var c=u*r;return a==="border-box"&&(c=c+i+o),l=Math.min(c,l),[l,u]}var Qm=function(){},mM=function(t,n){return t.reduce(function(r,i){return r[i]=n[i],r},{})},gM=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],yM=!!document.documentElement.currentStyle,vM=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=mM(gM,n),i=r.boxSizing;if(i==="")return null;yM&&i==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var o=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),s=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:o,borderSize:s}},bM=vM;function Zm(e,t,n){var r=fM(n);C.useLayoutEffect(function(){var i=function(s){return r.current(s)};if(e)return e.addEventListener(t,i),function(){return e.removeEventListener(t,i)}},[])}var wM=function(t){Zm(window,"resize",t)},SM=function(t){Zm(document.fonts,"loadingdone",t)},xM=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],kM=function(t,n){var r=t.cacheMeasurements,i=t.maxRows,o=t.minRows,s=t.onChange,a=s===void 0?Qm:s,l=t.onHeightChange,u=l===void 0?Qm:l,f=uM(t,xM),c=f.value!==void 0,h=C.useRef(null),d=dM(h,n),m=C.useRef(0),p=C.useRef(),g=function(){var w=h.current,A=r&&p.current?p.current:bM(w);if(A){p.current=A;var k=pM(A,w.value||w.placeholder||"x",o,i),E=k[0],I=k[1];m.current!==E&&(m.current=E,w.style.setProperty("height",E+"px","important"),u(E,{rowHeight:I}))}},v=function(w){c||g(),a(w)};return C.useLayoutEffect(g),wM(g),SM(g),C.createElement("textarea",El({},f,{onChange:v,ref:d}))},EM=C.forwardRef(kM);const CM=({inputRef:e,composerPlaceholder:t,composerDisabled:n,textInput:r,historyIndex:i,setTextInput:o,setHistoryIndex:s,sendComposerMessage:a,allowFileUpload:l,onFilePasted:u,conversationId:f,storageKey:c})=>{const d=bp(f||"default",c)(A=>A.messageHistory),[m,p]=M.useState(""),[g,v]=M.useState(!1),{input:y}=ye.composer,w=A=>{if(!l||!u||!A.clipboardData)return;const k=Array.from(A.clipboardData.files);k.length>0&&(A.preventDefault(),k.forEach(E=>{u(E)}))};return x.jsx(EM,{...y,"aria-label":"Message Input",ref:e,placeholder:t??"Type your message...",disabled:n,value:r,"data-has-value":!!r,onChange:A=>{const k=A.target.value;o(k),d.includes(k)||s(-1)},onPaste:w,maxRows:5,onKeyDown:A=>{if(n)return;const k=A.nativeEvent;if(!(k.isComposing||k.keyCode===229)&&(r.length===0&&v(!1),A.key!=="ArrowUp"&&A.key!=="ArrowDown"&&A.key!=="ArrowLeft"&&A.key!=="ArrowRight"&&v(!0),A.key==="Enter"&&A.shiftKey?(A.preventDefault(),o(`${r}
289
+ `)):A.key==="Enter"&&(A.preventDefault(),a()),!(r.length>0&&g))){if(A.key==="ArrowUp"){A.preventDefault(),i===-1&&r.trim()!==""&&p(r);const E=Math.min(i+1,d.length-1);s(E),o(d[E]??"")}if(A.key==="ArrowDown"){A.preventDefault();const E=Math.max(i-1,-1);o(i===-1?r.trim():E===-1?m:d[E]??""),s(E)}}}})},AM=({disabled:e,setTextInput:t})=>{const[n,r]=M.useState(!1),i=M.useRef(null),{voiceButton:o}=ye.composer,s=window.SpeechRecognition||window.webkitSpeechRecognition,a=()=>{i.current||(i.current=new s);const l=i.current;l&&(l.continuous=!0,l.onresult=u=>{var c,h,d;const f=((d=(h=(c=u.results)==null?void 0:c[0])==null?void 0:h[0])==null?void 0:d.transcript)??"";t(f??""),l.stop(),r(!1)},n?(l.stop(),r(!1)):(l.start(),r(!0)))};if(s)return x.jsx(jA,{...o,tabIndex:0,"aria-label":"Voice Input Button",role:"button","data-show":!e,"data-listens":!!n,onClick:a})},Jm=M.memo(M.forwardRef(({className:e,inputRef:t,disableComposer:n,isReadOnly:r,allowFileUpload:i,disableSendButton:o,connected:s,composerPlaceholder:a,footer:l,sendMessage:u,uploadFile:f,storageKey:c,conversationId:h,children:d,...m},p)=>{const{composer:g}=ye,v=n||r||!s,[y,w]=M.useState(""),[A,k]=M.useState(-1),E=xp(h||"default"),I=bp(h||"default",c),D=E(N=>N.files),P=E(N=>N.setFiles),T=E(N=>N.deleteFile),O=E(N=>N.uploadFile),B=I(N=>N.addMessageToHistory),L=D.filter(N=>N.status==="uploaded"),F=!!y.trim()||L.length>0,R=()=>{if(o||!F)return;const N=L.map(z=>{const W=z.url,b=z.type,_=z.fileId;return{video:{type:"video",videoUrl:W,fileId:_},audio:{type:"audio",audioUrl:W,fileId:_},image:{type:"image",imageUrl:W,fileId:_}}[b]??{title:z.name,type:"file",fileUrl:W,fileId:_}})??[];y&&N.push({type:"text",text:y});let H;N.length==1?H=N[0]:H={type:"bloc",items:N.map(W=>{const{type:b,..._}=W;return{type:b,payload:_}})},w(""),u==null||u(H),P([]),B(y),k(-1)};return r?null:x.jsxs(x.Fragment,{children:[x.jsxs("div",{"data-disabled":v,"data-waiting":o,className:ar(g.container.className,e),ref:p,...m,children:[d,D.length>0&&x.jsx("div",{...g==null?void 0:g.fileContainer,children:D.map(N=>x.jsx(lM,{...N,removeFile:T},N.name))}),x.jsxs("div",{...g.inputContainer,onClick:()=>{t&&"current"in t&&t.current&&t.current.focus()},children:[i&&x.jsx(aM,{disabled:v,onFileSelected:N=>{f&&O(N,f)}}),x.jsx(CM,{inputRef:t,composerPlaceholder:a,composerDisabled:v,textInput:y,historyIndex:A,setTextInput:w,setHistoryIndex:k,sendComposerMessage:R,allowFileUpload:i,onFilePasted:N=>{f&&O(N,f)},conversationId:h,storageKey:c}),o&&x.jsx(BA,{...g.inputLoader,role:"status","data-show":o}),!v&&!o&&x.jsxs(x.Fragment,{children:[x.jsx(OA,{...g.sendbutton,role:"button",tabIndex:0,"aria-label":"Send Message Button","data-show":F,onClick:()=>R()}),x.jsx(AM,{disabled:F,setTextInput:w})]})]})]}),x.jsx(Sh,{components:{a:({node:N,...H})=>x.jsx("a",{...H,target:"_blank",rel:"noreferrer noopener"})},allowedElements:["a","strong","code","em","p","span"],...g.footer,children:l})]})}));var Cl={exports:{}},To={exports:{}},Te={};/** @license React v16.13.1
290
290
  * react-is.production.min.js
291
291
  *
292
292
  * Copyright (c) Facebook, Inc. and its affiliates.
293
293
  *
294
294
  * This source code is licensed under the MIT license found in the
295
295
  * LICENSE file in the root directory of this source tree.
296
- */var rg;function RM(){if(rg)return Te;rg=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,f=e?Symbol.for("react.forward_ref"):60112,c=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,d=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,v=e?Symbol.for("react.scope"):60119;function w(S){if(typeof S=="object"&&S!==null){var C=S.$$typeof;switch(C){case t:switch(S=S.type,S){case l:case u:case r:case o:case i:case c:return S;default:switch(S=S&&S.$$typeof,S){case a:case f:case m:case d:case s:return S;default:return C}}case n:return C}}}function E(S){return w(S)===u}return Te.AsyncMode=l,Te.ConcurrentMode=u,Te.ContextConsumer=a,Te.ContextProvider=s,Te.Element=t,Te.ForwardRef=f,Te.Fragment=r,Te.Lazy=m,Te.Memo=d,Te.Portal=n,Te.Profiler=o,Te.StrictMode=i,Te.Suspense=c,Te.isAsyncMode=function(S){return E(S)||w(S)===l},Te.isConcurrentMode=E,Te.isContextConsumer=function(S){return w(S)===a},Te.isContextProvider=function(S){return w(S)===s},Te.isElement=function(S){return typeof S=="object"&&S!==null&&S.$$typeof===t},Te.isForwardRef=function(S){return w(S)===f},Te.isFragment=function(S){return w(S)===r},Te.isLazy=function(S){return w(S)===m},Te.isMemo=function(S){return w(S)===d},Te.isPortal=function(S){return w(S)===n},Te.isProfiler=function(S){return w(S)===o},Te.isStrictMode=function(S){return w(S)===i},Te.isSuspense=function(S){return w(S)===c},Te.isValidElementType=function(S){return typeof S=="string"||typeof S=="function"||S===r||S===u||S===o||S===i||S===c||S===h||typeof S=="object"&&S!==null&&(S.$$typeof===m||S.$$typeof===d||S.$$typeof===s||S.$$typeof===a||S.$$typeof===f||S.$$typeof===g||S.$$typeof===y||S.$$typeof===v||S.$$typeof===p)},Te.typeOf=w,Te}var Ie={};/** @license React v16.13.1
296
+ */var Xm;function TM(){if(Xm)return Te;Xm=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,f=e?Symbol.for("react.forward_ref"):60112,c=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,d=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,y=e?Symbol.for("react.scope"):60119;function w(k){if(typeof k=="object"&&k!==null){var E=k.$$typeof;switch(E){case t:switch(k=k.type,k){case l:case u:case r:case o:case i:case c:return k;default:switch(k=k&&k.$$typeof,k){case a:case f:case m:case d:case s:return k;default:return E}}case n:return E}}}function A(k){return w(k)===u}return Te.AsyncMode=l,Te.ConcurrentMode=u,Te.ContextConsumer=a,Te.ContextProvider=s,Te.Element=t,Te.ForwardRef=f,Te.Fragment=r,Te.Lazy=m,Te.Memo=d,Te.Portal=n,Te.Profiler=o,Te.StrictMode=i,Te.Suspense=c,Te.isAsyncMode=function(k){return A(k)||w(k)===l},Te.isConcurrentMode=A,Te.isContextConsumer=function(k){return w(k)===a},Te.isContextProvider=function(k){return w(k)===s},Te.isElement=function(k){return typeof k=="object"&&k!==null&&k.$$typeof===t},Te.isForwardRef=function(k){return w(k)===f},Te.isFragment=function(k){return w(k)===r},Te.isLazy=function(k){return w(k)===m},Te.isMemo=function(k){return w(k)===d},Te.isPortal=function(k){return w(k)===n},Te.isProfiler=function(k){return w(k)===o},Te.isStrictMode=function(k){return w(k)===i},Te.isSuspense=function(k){return w(k)===c},Te.isValidElementType=function(k){return typeof k=="string"||typeof k=="function"||k===r||k===u||k===o||k===i||k===c||k===h||typeof k=="object"&&k!==null&&(k.$$typeof===m||k.$$typeof===d||k.$$typeof===s||k.$$typeof===a||k.$$typeof===f||k.$$typeof===g||k.$$typeof===v||k.$$typeof===y||k.$$typeof===p)},Te.typeOf=w,Te}var Ie={};/** @license React v16.13.1
297
297
  * react-is.development.js
298
298
  *
299
299
  * Copyright (c) Facebook, Inc. and its affiliates.
300
300
  *
301
301
  * This source code is licensed under the MIT license found in the
302
302
  * LICENSE file in the root directory of this source tree.
303
- */var ig;function $M(){return ig||(ig=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,f=e?Symbol.for("react.forward_ref"):60112,c=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,d=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,v=e?Symbol.for("react.scope"):60119;function w($){return typeof $=="string"||typeof $=="function"||$===r||$===u||$===o||$===i||$===c||$===h||typeof $=="object"&&$!==null&&($.$$typeof===m||$.$$typeof===d||$.$$typeof===s||$.$$typeof===a||$.$$typeof===f||$.$$typeof===g||$.$$typeof===y||$.$$typeof===v||$.$$typeof===p)}function E($){if(typeof $=="object"&&$!==null){var ne=$.$$typeof;switch(ne){case t:var ge=$.type;switch(ge){case l:case u:case r:case o:case i:case c:return ge;default:var Oe=ge&&ge.$$typeof;switch(Oe){case a:case f:case m:case d:case s:return Oe;default:return ne}}case n:return ne}}}var S=l,C=u,I=a,M=s,P=t,T=f,O=r,U=m,F=d,L=n,R=o,N=i,j=c,B=!1;function W($){return B||(B=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),b($)||E($)===l}function b($){return E($)===u}function _($){return E($)===a}function H($){return E($)===s}function x($){return typeof $=="object"&&$!==null&&$.$$typeof===t}function V($){return E($)===f}function Y($){return E($)===r}function q($){return E($)===m}function Q($){return E($)===d}function X($){return E($)===n}function se($){return E($)===o}function G($){return E($)===i}function te($){return E($)===c}Ie.AsyncMode=S,Ie.ConcurrentMode=C,Ie.ContextConsumer=I,Ie.ContextProvider=M,Ie.Element=P,Ie.ForwardRef=T,Ie.Fragment=O,Ie.Lazy=U,Ie.Memo=F,Ie.Portal=L,Ie.Profiler=R,Ie.StrictMode=N,Ie.Suspense=j,Ie.isAsyncMode=W,Ie.isConcurrentMode=b,Ie.isContextConsumer=_,Ie.isContextProvider=H,Ie.isElement=x,Ie.isForwardRef=V,Ie.isFragment=Y,Ie.isLazy=q,Ie.isMemo=Q,Ie.isPortal=X,Ie.isProfiler=se,Ie.isStrictMode=G,Ie.isSuspense=te,Ie.isValidElementType=w,Ie.typeOf=E}()),Ie}var og;function sg(){return og||(og=1,process.env.NODE_ENV==="production"?To.exports=RM():To.exports=$M()),To.exports}/*
303
+ */var eg;function IM(){return eg||(eg=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,f=e?Symbol.for("react.forward_ref"):60112,c=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,d=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,y=e?Symbol.for("react.scope"):60119;function w($){return typeof $=="string"||typeof $=="function"||$===r||$===u||$===o||$===i||$===c||$===h||typeof $=="object"&&$!==null&&($.$$typeof===m||$.$$typeof===d||$.$$typeof===s||$.$$typeof===a||$.$$typeof===f||$.$$typeof===g||$.$$typeof===v||$.$$typeof===y||$.$$typeof===p)}function A($){if(typeof $=="object"&&$!==null){var ne=$.$$typeof;switch(ne){case t:var me=$.type;switch(me){case l:case u:case r:case o:case i:case c:return me;default:var Oe=me&&me.$$typeof;switch(Oe){case a:case f:case m:case d:case s:return Oe;default:return ne}}case n:return ne}}}var k=l,E=u,I=a,D=s,P=t,T=f,O=r,B=m,L=d,F=n,R=o,N=i,H=c,z=!1;function W($){return z||(z=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),b($)||A($)===l}function b($){return A($)===u}function _($){return A($)===a}function j($){return A($)===s}function S($){return typeof $=="object"&&$!==null&&$.$$typeof===t}function V($){return A($)===f}function Y($){return A($)===r}function q($){return A($)===m}function Q($){return A($)===d}function X($){return A($)===n}function se($){return A($)===o}function G($){return A($)===i}function te($){return A($)===c}Ie.AsyncMode=k,Ie.ConcurrentMode=E,Ie.ContextConsumer=I,Ie.ContextProvider=D,Ie.Element=P,Ie.ForwardRef=T,Ie.Fragment=O,Ie.Lazy=B,Ie.Memo=L,Ie.Portal=F,Ie.Profiler=R,Ie.StrictMode=N,Ie.Suspense=H,Ie.isAsyncMode=W,Ie.isConcurrentMode=b,Ie.isContextConsumer=_,Ie.isContextProvider=j,Ie.isElement=S,Ie.isForwardRef=V,Ie.isFragment=Y,Ie.isLazy=q,Ie.isMemo=Q,Ie.isPortal=X,Ie.isProfiler=se,Ie.isStrictMode=G,Ie.isSuspense=te,Ie.isValidElementType=w,Ie.typeOf=A}()),Ie}var tg;function ng(){return tg||(tg=1,process.env.NODE_ENV==="production"?To.exports=TM():To.exports=IM()),To.exports}/*
304
304
  object-assign
305
305
  (c) Sindre Sorhus
306
306
  @license MIT
307
- */var Il,ag;function BM(){if(ag)return Il;ag=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function i(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var s={},a=0;a<10;a++)s["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(s).map(function(f){return s[f]});if(l.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(f){u[f]=f}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Il=i()?Object.assign:function(o,s){for(var a,l=r(o),u,f=1;f<arguments.length;f++){a=Object(arguments[f]);for(var c in a)t.call(a,c)&&(l[c]=a[c]);if(e){u=e(a);for(var h=0;h<u.length;h++)n.call(a,u[h])&&(l[u[h]]=a[u[h]])}}return l},Il}var Ol,lg;function Ml(){if(lg)return Ol;lg=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Ol=e,Ol}var Dl,ug;function cg(){return ug||(ug=1,Dl=Function.call.bind(Object.prototype.hasOwnProperty)),Dl}var Nl,fg;function zM(){if(fg)return Nl;fg=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Ml(),n={},r=cg();e=function(o){var s="Warning: "+o;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}}function i(o,s,a,l,u){if(process.env.NODE_ENV!=="production"){for(var f in o)if(r(o,f)){var c;try{if(typeof o[f]!="function"){var h=Error((l||"React class")+": "+a+" type `"+f+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[f]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}c=o[f](s,f,l,a,null,t)}catch(m){c=m}if(c&&!(c instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+f+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof c+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),c instanceof Error&&!(c.message in n)){n[c.message]=!0;var d=u?u():"";e("Failed "+a+" type: "+c.message+(d??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Nl=i,Nl}var _l,dg;function UM(){if(dg)return _l;dg=1;var e=sg(),t=BM(),n=Ml(),r=cg(),i=zM(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function s(){return null}return _l=function(a,l){var u=typeof Symbol=="function"&&Symbol.iterator,f="@@iterator";function c(b){var _=b&&(u&&b[u]||b[f]);if(typeof _=="function")return _}var h="<<anonymous>>",d={array:y("array"),bigint:y("bigint"),bool:y("boolean"),func:y("function"),number:y("number"),object:y("object"),string:y("string"),symbol:y("symbol"),any:v(),arrayOf:w,element:E(),elementType:S(),instanceOf:C,node:T(),objectOf:M,oneOf:I,oneOfType:P,shape:U,exact:F};function m(b,_){return b===_?b!==0||1/b===1/_:b!==b&&_!==_}function p(b,_){this.message=b,this.data=_&&typeof _=="object"?_:{},this.stack=""}p.prototype=Error.prototype;function g(b){if(process.env.NODE_ENV!=="production")var _={},H=0;function x(Y,q,Q,X,se,G,te){if(X=X||h,G=G||Q,te!==n){if(l){var $=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw $.name="Invariant Violation",$}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ne=X+":"+Q;!_[ne]&&H<3&&(o("You are manually calling a React.PropTypes validation function for the `"+G+"` prop on `"+X+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),_[ne]=!0,H++)}}return q[Q]==null?Y?q[Q]===null?new p("The "+se+" `"+G+"` is marked as required "+("in `"+X+"`, but its value is `null`.")):new p("The "+se+" `"+G+"` is marked as required in "+("`"+X+"`, but its value is `undefined`.")):null:b(q,Q,X,se,G)}var V=x.bind(null,!1);return V.isRequired=x.bind(null,!0),V}function y(b){function _(H,x,V,Y,q,Q){var X=H[x],se=N(X);if(se!==b){var G=j(X);return new p("Invalid "+Y+" `"+q+"` of type "+("`"+G+"` supplied to `"+V+"`, expected ")+("`"+b+"`."),{expectedType:b})}return null}return g(_)}function v(){return g(s)}function w(b){function _(H,x,V,Y,q){if(typeof b!="function")return new p("Property `"+q+"` of component `"+V+"` has invalid PropType notation inside arrayOf.");var Q=H[x];if(!Array.isArray(Q)){var X=N(Q);return new p("Invalid "+Y+" `"+q+"` of type "+("`"+X+"` supplied to `"+V+"`, expected an array."))}for(var se=0;se<Q.length;se++){var G=b(Q,se,V,Y,q+"["+se+"]",n);if(G instanceof Error)return G}return null}return g(_)}function E(){function b(_,H,x,V,Y){var q=_[H];if(!a(q)){var Q=N(q);return new p("Invalid "+V+" `"+Y+"` of type "+("`"+Q+"` supplied to `"+x+"`, expected a single ReactElement."))}return null}return g(b)}function S(){function b(_,H,x,V,Y){var q=_[H];if(!e.isValidElementType(q)){var Q=N(q);return new p("Invalid "+V+" `"+Y+"` of type "+("`"+Q+"` supplied to `"+x+"`, expected a single ReactElement type."))}return null}return g(b)}function C(b){function _(H,x,V,Y,q){if(!(H[x]instanceof b)){var Q=b.name||h,X=W(H[x]);return new p("Invalid "+Y+" `"+q+"` of type "+("`"+X+"` supplied to `"+V+"`, expected ")+("instance of `"+Q+"`."))}return null}return g(_)}function I(b){if(!Array.isArray(b))return process.env.NODE_ENV!=="production"&&(arguments.length>1?o("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):o("Invalid argument supplied to oneOf, expected an array.")),s;function _(H,x,V,Y,q){for(var Q=H[x],X=0;X<b.length;X++)if(m(Q,b[X]))return null;var se=JSON.stringify(b,function(te,$){var ne=j($);return ne==="symbol"?String($):$});return new p("Invalid "+Y+" `"+q+"` of value `"+String(Q)+"` "+("supplied to `"+V+"`, expected one of "+se+"."))}return g(_)}function M(b){function _(H,x,V,Y,q){if(typeof b!="function")return new p("Property `"+q+"` of component `"+V+"` has invalid PropType notation inside objectOf.");var Q=H[x],X=N(Q);if(X!=="object")return new p("Invalid "+Y+" `"+q+"` of type "+("`"+X+"` supplied to `"+V+"`, expected an object."));for(var se in Q)if(r(Q,se)){var G=b(Q,se,V,Y,q+"."+se,n);if(G instanceof Error)return G}return null}return g(_)}function P(b){if(!Array.isArray(b))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var _=0;_<b.length;_++){var H=b[_];if(typeof H!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+B(H)+" at index "+_+"."),s}function x(V,Y,q,Q,X){for(var se=[],G=0;G<b.length;G++){var te=b[G],$=te(V,Y,q,Q,X,n);if($==null)return null;$.data&&r($.data,"expectedType")&&se.push($.data.expectedType)}var ne=se.length>0?", expected one of type ["+se.join(", ")+"]":"";return new p("Invalid "+Q+" `"+X+"` supplied to "+("`"+q+"`"+ne+"."))}return g(x)}function T(){function b(_,H,x,V,Y){return L(_[H])?null:new p("Invalid "+V+" `"+Y+"` supplied to "+("`"+x+"`, expected a ReactNode."))}return g(b)}function O(b,_,H,x,V){return new p((b||"React class")+": "+_+" type `"+H+"."+x+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+V+"`.")}function U(b){function _(H,x,V,Y,q){var Q=H[x],X=N(Q);if(X!=="object")return new p("Invalid "+Y+" `"+q+"` of type `"+X+"` "+("supplied to `"+V+"`, expected `object`."));for(var se in b){var G=b[se];if(typeof G!="function")return O(V,Y,q,se,j(G));var te=G(Q,se,V,Y,q+"."+se,n);if(te)return te}return null}return g(_)}function F(b){function _(H,x,V,Y,q){var Q=H[x],X=N(Q);if(X!=="object")return new p("Invalid "+Y+" `"+q+"` of type `"+X+"` "+("supplied to `"+V+"`, expected `object`."));var se=t({},H[x],b);for(var G in se){var te=b[G];if(r(b,G)&&typeof te!="function")return O(V,Y,q,G,j(te));if(!te)return new p("Invalid "+Y+" `"+q+"` key `"+G+"` supplied to `"+V+"`.\nBad object: "+JSON.stringify(H[x],null," ")+`
308
- Valid keys: `+JSON.stringify(Object.keys(b),null," "));var $=te(Q,G,V,Y,q+"."+G,n);if($)return $}return null}return g(_)}function L(b){switch(typeof b){case"number":case"string":case"undefined":return!0;case"boolean":return!b;case"object":if(Array.isArray(b))return b.every(L);if(b===null||a(b))return!0;var _=c(b);if(_){var H=_.call(b),x;if(_!==b.entries){for(;!(x=H.next()).done;)if(!L(x.value))return!1}else for(;!(x=H.next()).done;){var V=x.value;if(V&&!L(V[1]))return!1}}else return!1;return!0;default:return!1}}function R(b,_){return b==="symbol"?!0:_?_["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&_ instanceof Symbol:!1}function N(b){var _=typeof b;return Array.isArray(b)?"array":b instanceof RegExp?"object":R(_,b)?"symbol":_}function j(b){if(typeof b>"u"||b===null)return""+b;var _=N(b);if(_==="object"){if(b instanceof Date)return"date";if(b instanceof RegExp)return"regexp"}return _}function B(b){var _=j(b);switch(_){case"array":case"object":return"an "+_;case"boolean":case"date":case"regexp":return"a "+_;default:return _}}function W(b){return!b.constructor||!b.constructor.name?h:b.constructor.name}return d.checkPropTypes=i,d.resetWarningCache=i.resetWarningCache,d.PropTypes=d,d},_l}var Pl,hg;function jM(){if(hg)return Pl;hg=1;var e=Ml();function t(){}function n(){}return n.resetWarningCache=t,Pl=function(){function r(s,a,l,u,f,c){if(c!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Pl}if(process.env.NODE_ENV!=="production"){var HM=sg(),VM=!0;Tl.exports=UM()(HM.isElement,VM)}else Tl.exports=jM()();var WM=Tl.exports;const Ne=vn(WM);var qM=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function ai(e,t){var n=YM(e);if(typeof n.path!="string"){var r=e.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof t=="string"?t:typeof r=="string"&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function YM(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),i=qM.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var KM=[".DS_Store","Thumbs.db"];function GM(e){return Zn(this,void 0,void 0,function(){return Jn(this,function(t){return Io(e)&&QM(e.dataTransfer)?[2,eD(e.dataTransfer,e.type)]:ZM(e)?[2,JM(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,XM(e)]:[2,[]]})})}function QM(e){return Io(e)}function ZM(e){return Io(e)&&Io(e.target)}function Io(e){return typeof e=="object"&&e!==null}function JM(e){return Ll(e.target.files).map(function(t){return ai(t)})}function XM(e){return Zn(this,void 0,void 0,function(){var t;return Jn(this,function(n){switch(n.label){case 0:return[4,Promise.all(e.map(function(r){return r.getFile()}))];case 1:return t=n.sent(),[2,t.map(function(r){return ai(r)})]}})})}function eD(e,t){return Zn(this,void 0,void 0,function(){var n,r;return Jn(this,function(i){switch(i.label){case 0:return e.items?(n=Ll(e.items).filter(function(o){return o.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(tD))]):[3,2];case 1:return r=i.sent(),[2,pg(mg(r))];case 2:return[2,pg(Ll(e.files).map(function(o){return ai(o)}))]}})})}function pg(e){return e.filter(function(t){return KM.indexOf(t.name)===-1})}function Ll(e){if(e===null)return[];for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r)}return t}function tD(e){if(typeof e.webkitGetAsEntry!="function")return gg(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?yg(t):gg(e)}function mg(e){return e.reduce(function(t,n){return Ga(Ga([],_p(t),!1),_p(Array.isArray(n)?mg(n):[n]),!1)},[])}function gg(e){var t=e.getAsFile();if(!t)return Promise.reject("".concat(e," is not a File"));var n=ai(t);return Promise.resolve(n)}function nD(e){return Zn(this,void 0,void 0,function(){return Jn(this,function(t){return[2,e.isDirectory?yg(e):rD(e)]})})}function yg(e){var t=e.createReader();return new Promise(function(n,r){var i=[];function o(){var s=this;t.readEntries(function(a){return Zn(s,void 0,void 0,function(){var l,u,f;return Jn(this,function(c){switch(c.label){case 0:if(a.length)return[3,5];c.label=1;case 1:return c.trys.push([1,3,,4]),[4,Promise.all(i)];case 2:return l=c.sent(),n(l),[3,4];case 3:return u=c.sent(),r(u),[3,4];case 4:return[3,6];case 5:f=Promise.all(a.map(nD)),i.push(f),o(),c.label=6;case 6:return[2]}})})},function(a){r(a)})}o()})}function rD(e){return Zn(this,void 0,void 0,function(){return Jn(this,function(t){return[2,new Promise(function(n,r){e.file(function(i){var o=ai(i,e.fullPath);n(o)},function(i){r(i)})})]})})}var iD=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var r=e.name||"",i=(e.type||"").toLowerCase(),o=i.replace(/\/.*$/,"");return n.some(function(s){var a=s.trim().toLowerCase();return a.charAt(0)==="."?r.toLowerCase().endsWith(a):a.endsWith("/*")?o===a.replace(/\/.*$/,""):i===a})}return!0};function vg(e){return aD(e)||sD(e)||xg(e)||oD()}function oD(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
309
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sD(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function aD(e){if(Array.isArray(e))return Fl(e)}function bg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function wg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bg(Object(n),!0).forEach(function(r){Sg(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bg(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Sg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function li(e,t){return cD(e)||uD(e,t)||xg(e,t)||lD()}function lD(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
310
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xg(e,t){if(e){if(typeof e=="string")return Fl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Fl(e,t)}}function Fl(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function uD(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,s,a;try{for(n=n.call(e);!(i=(s=n.next()).done)&&(r.push(s.value),!(t&&r.length===t));i=!0);}catch(l){o=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw a}}return r}}function cD(e){if(Array.isArray(e))return e}var fD="file-invalid-type",dD="file-too-large",hD="file-too-small",pD="too-many-files",mD=function(t){t=Array.isArray(t)&&t.length===1?t[0]:t;var n=Array.isArray(t)?"one of ".concat(t.join(", ")):t;return{code:fD,message:"File type must be ".concat(n)}},kg=function(t){return{code:dD,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},Eg=function(t){return{code:hD,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},gD={code:pD,message:"Too many files"};function Cg(e,t){var n=e.type==="application/x-moz-file"||iD(e,t);return[n,n?null:mD(t)]}function Ag(e,t,n){if(Nn(e.size))if(Nn(t)&&Nn(n)){if(e.size>n)return[!1,kg(n)];if(e.size<t)return[!1,Eg(t)]}else{if(Nn(t)&&e.size<t)return[!1,Eg(t)];if(Nn(n)&&e.size>n)return[!1,kg(n)]}return[!0,null]}function Nn(e){return e!=null}function yD(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,o=e.multiple,s=e.maxFiles,a=e.validator;return!o&&t.length>1||o&&s>=1&&t.length>s?!1:t.every(function(l){var u=Cg(l,n),f=li(u,1),c=f[0],h=Ag(l,r,i),d=li(h,1),m=d[0],p=a?a(l):null;return c&&m&&!p})}function Oo(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Mo(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function Tg(e){e.preventDefault()}function vD(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function bD(e){return e.indexOf("Edge/")!==-1}function wD(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return vD(e)||bD(e)}function Ht(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];return t.some(function(a){return!Oo(r)&&a&&a.apply(void 0,[r].concat(o)),Oo(r)})}}function SD(){return"showOpenFilePicker"in window}function xD(e){if(Nn(e)){var t=Object.entries(e).filter(function(n){var r=li(n,2),i=r[0],o=r[1],s=!0;return Ig(i)||(console.warn('Skipped "'.concat(i,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),s=!1),(!Array.isArray(o)||!o.every(Og))&&(console.warn('Skipped "'.concat(i,'" because an invalid file extension was provided.')),s=!1),s}).reduce(function(n,r){var i=li(r,2),o=i[0],s=i[1];return wg(wg({},n),{},Sg({},o,s))},{});return[{description:"Files",accept:t}]}return e}function kD(e){if(Nn(e))return Object.entries(e).reduce(function(t,n){var r=li(n,2),i=r[0],o=r[1];return[].concat(vg(t),[i],vg(o))},[]).filter(function(t){return Ig(t)||Og(t)}).join(",")}function ED(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function CD(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function Ig(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function Og(e){return/^.*\.[\w]+$/.test(e)}var AD=["children"],TD=["open"],ID=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],OD=["refKey","onChange","onClick"];function MD(e){return _D(e)||ND(e)||Mg(e)||DD()}function DD(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
311
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ND(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function _D(e){if(Array.isArray(e))return $l(e)}function Rl(e,t){return FD(e)||LD(e,t)||Mg(e,t)||PD()}function PD(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
312
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Mg(e,t){if(e){if(typeof e=="string")return $l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $l(e,t)}}function $l(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function LD(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,s,a;try{for(n=n.call(e);!(i=(s=n.next()).done)&&(r.push(s.value),!(t&&r.length===t));i=!0);}catch(l){o=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw a}}return r}}function FD(e){if(Array.isArray(e))return e}function Dg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Be(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Dg(Object(n),!0).forEach(function(r){Bl(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dg(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Bl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Do(e,t){if(e==null)return{};var n=RD(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function RD(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var zl=D.forwardRef(function(e,t){var n=e.children,r=Do(e,AD),i=_g(r),o=i.open,s=Do(i,TD);return D.useImperativeHandle(t,function(){return{open:o}},[o]),D.createElement(D.Fragment,null,n(Be(Be({},s),{},{open:o})))});zl.displayName="Dropzone";var Ng={disabled:!1,getFilesFromEvent:GM,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};zl.defaultProps=Ng,zl.propTypes={children:Ne.func,accept:Ne.objectOf(Ne.arrayOf(Ne.string)),multiple:Ne.bool,preventDropOnDocument:Ne.bool,noClick:Ne.bool,noKeyboard:Ne.bool,noDrag:Ne.bool,noDragEventsBubbling:Ne.bool,minSize:Ne.number,maxSize:Ne.number,maxFiles:Ne.number,disabled:Ne.bool,getFilesFromEvent:Ne.func,onFileDialogCancel:Ne.func,onFileDialogOpen:Ne.func,useFsAccessApi:Ne.bool,autoFocus:Ne.bool,onDragEnter:Ne.func,onDragLeave:Ne.func,onDragOver:Ne.func,onDrop:Ne.func,onDropAccepted:Ne.func,onDropRejected:Ne.func,onError:Ne.func,validator:Ne.func};var Ul={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function _g(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Be(Be({},Ng),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,o=t.maxSize,s=t.minSize,a=t.multiple,l=t.maxFiles,u=t.onDragEnter,f=t.onDragLeave,c=t.onDragOver,h=t.onDrop,d=t.onDropAccepted,m=t.onDropRejected,p=t.onFileDialogCancel,g=t.onFileDialogOpen,y=t.useFsAccessApi,v=t.autoFocus,w=t.preventDropOnDocument,E=t.noClick,S=t.noKeyboard,C=t.noDrag,I=t.noDragEventsBubbling,M=t.onError,P=t.validator,T=D.useMemo(function(){return kD(n)},[n]),O=D.useMemo(function(){return xD(n)},[n]),U=D.useMemo(function(){return typeof g=="function"?g:Pg},[g]),F=D.useMemo(function(){return typeof p=="function"?p:Pg},[p]),L=D.useRef(null),R=D.useRef(null),N=D.useReducer($D,Ul),j=Rl(N,2),B=j[0],W=j[1],b=B.isFocused,_=B.isFileDialogActive,H=D.useRef(typeof window<"u"&&window.isSecureContext&&y&&SD()),x=function(){!H.current&&_&&setTimeout(function(){if(R.current){var ae=R.current.files;ae.length||(W({type:"closeDialog"}),F())}},300)};D.useEffect(function(){return window.addEventListener("focus",x,!1),function(){window.removeEventListener("focus",x,!1)}},[R,_,F,H]);var V=D.useRef([]),Y=function(ae){L.current&&L.current.contains(ae.target)||(ae.preventDefault(),V.current=[])};D.useEffect(function(){return w&&(document.addEventListener("dragover",Tg,!1),document.addEventListener("drop",Y,!1)),function(){w&&(document.removeEventListener("dragover",Tg),document.removeEventListener("drop",Y))}},[L,w]),D.useEffect(function(){return!r&&v&&L.current&&L.current.focus(),function(){}},[L,v,r]);var q=D.useCallback(function(ee){M?M(ee):console.error(ee)},[M]),Q=D.useCallback(function(ee){ee.preventDefault(),ee.persist(),Ae(ee),V.current=[].concat(MD(V.current),[ee.target]),Mo(ee)&&Promise.resolve(i(ee)).then(function(ae){if(!(Oo(ee)&&!I)){var z=ae.length,K=z>0&&yD({files:ae,accept:T,minSize:s,maxSize:o,multiple:a,maxFiles:l,validator:P}),oe=z>0&&!K;W({isDragAccept:K,isDragReject:oe,isDragActive:!0,type:"setDraggedFiles"}),u&&u(ee)}}).catch(function(ae){return q(ae)})},[i,u,q,I,T,s,o,a,l,P]),X=D.useCallback(function(ee){ee.preventDefault(),ee.persist(),Ae(ee);var ae=Mo(ee);if(ae&&ee.dataTransfer)try{ee.dataTransfer.dropEffect="copy"}catch{}return ae&&c&&c(ee),!1},[c,I]),se=D.useCallback(function(ee){ee.preventDefault(),ee.persist(),Ae(ee);var ae=V.current.filter(function(K){return L.current&&L.current.contains(K)}),z=ae.indexOf(ee.target);z!==-1&&ae.splice(z,1),V.current=ae,!(ae.length>0)&&(W({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Mo(ee)&&f&&f(ee))},[L,f,I]),G=D.useCallback(function(ee,ae){var z=[],K=[];ee.forEach(function(oe){var le=Cg(oe,T),he=Rl(le,2),He=he[0],Ge=he[1],Ze=Ag(oe,s,o),Et=Rl(Ze,2),Rt=Et[0],Qe=Et[1],Ct=P?P(oe):null;if(He&&Rt&&!Ct)z.push(oe);else{var at=[Ge,Qe];Ct&&(at=at.concat(Ct)),K.push({file:oe,errors:at.filter(function(ns){return ns})})}}),(!a&&z.length>1||a&&l>=1&&z.length>l)&&(z.forEach(function(oe){K.push({file:oe,errors:[gD]})}),z.splice(0)),W({acceptedFiles:z,fileRejections:K,type:"setFiles"}),h&&h(z,K,ae),K.length>0&&m&&m(K,ae),z.length>0&&d&&d(z,ae)},[W,a,T,s,o,l,h,d,m,P]),te=D.useCallback(function(ee){ee.preventDefault(),ee.persist(),Ae(ee),V.current=[],Mo(ee)&&Promise.resolve(i(ee)).then(function(ae){Oo(ee)&&!I||G(ae,ee)}).catch(function(ae){return q(ae)}),W({type:"reset"})},[i,G,q,I]),$=D.useCallback(function(){if(H.current){W({type:"openDialog"}),U();var ee={multiple:a,types:O};window.showOpenFilePicker(ee).then(function(ae){return i(ae)}).then(function(ae){G(ae,null),W({type:"closeDialog"})}).catch(function(ae){ED(ae)?(F(ae),W({type:"closeDialog"})):CD(ae)?(H.current=!1,R.current?(R.current.value=null,R.current.click()):q(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):q(ae)});return}R.current&&(W({type:"openDialog"}),U(),R.current.value=null,R.current.click())},[W,U,F,y,G,q,O,a]),ne=D.useCallback(function(ee){!L.current||!L.current.isEqualNode(ee.target)||(ee.key===" "||ee.key==="Enter"||ee.keyCode===32||ee.keyCode===13)&&(ee.preventDefault(),$())},[L,$]),ge=D.useCallback(function(){W({type:"focus"})},[]),Oe=D.useCallback(function(){W({type:"blur"})},[]),J=D.useCallback(function(){E||(wD()?setTimeout($,0):$())},[E,$]),ue=function(ae){return r?null:ae},de=function(ae){return S?null:ue(ae)},fe=function(ae){return C?null:ue(ae)},Ae=function(ae){I&&ae.stopPropagation()},Fe=D.useMemo(function(){return function(){var ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ae=ee.refKey,z=ae===void 0?"ref":ae,K=ee.role,oe=ee.onKeyDown,le=ee.onFocus,he=ee.onBlur,He=ee.onClick,Ge=ee.onDragEnter,Ze=ee.onDragOver,Et=ee.onDragLeave,Rt=ee.onDrop,Qe=Do(ee,ID);return Be(Be(Bl({onKeyDown:de(Ht(oe,ne)),onFocus:de(Ht(le,ge)),onBlur:de(Ht(he,Oe)),onClick:ue(Ht(He,J)),onDragEnter:fe(Ht(Ge,Q)),onDragOver:fe(Ht(Ze,X)),onDragLeave:fe(Ht(Et,se)),onDrop:fe(Ht(Rt,te)),role:typeof K=="string"&&K!==""?K:"presentation"},z,L),!r&&!S?{tabIndex:0}:{}),Qe)}},[L,ne,ge,Oe,J,Q,X,se,te,S,C,r]),Me=D.useCallback(function(ee){ee.stopPropagation()},[]),je=D.useMemo(function(){return function(){var ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ae=ee.refKey,z=ae===void 0?"ref":ae,K=ee.onChange,oe=ee.onClick,le=Do(ee,OD),he=Bl({accept:T,multiple:a,type:"file",style:{display:"none"},onChange:ue(Ht(K,te)),onClick:ue(Ht(oe,Me)),tabIndex:-1},z,R);return Be(Be({},he),le)}},[R,n,a,te,r]);return Be(Be({},B),{},{isFocused:b&&!r,getRootProps:Fe,getInputProps:je,rootRef:L,inputRef:R,open:ue($)})}function $D(e,t){switch(t.type){case"focus":return Be(Be({},e),{},{isFocused:!0});case"blur":return Be(Be({},e),{},{isFocused:!1});case"openDialog":return Be(Be({},Ul),{},{isFileDialogActive:!0});case"closeDialog":return Be(Be({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Be(Be({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Be(Be({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return Be({},Ul);default:return e}}function Pg(){}const Lg=({children:e})=>{const t=D.useRef(null),[n,r]=D.useState({open:!1}),i=({title:s,description:a,confirmButtonText:l,cancelButtonText:u,onConfirm:f,onCancel:c,initialValue:h,Content:d})=>new Promise((m,p)=>{t.current=h,r({open:!0,title:s,description:a,confirmButtonText:l,cancelButtonText:u,content:d?k.jsx(d,{value:h,setValue:g=>{t.current=g}}):null,onConfirm:()=>{f==null||f(),m(t.current),o()},onCancel:()=>{c==null||c(),p(),o()}})}),o=()=>{r(s=>({...s,open:!1}))};return k.jsxs(Ya.Provider,{value:{showInputModal:i},children:[k.jsx(vr,{open:n.open,onOpenChange:s=>r(a=>({...a,open:s})),children:k.jsx(vr.Content,{title:n.title,description:n.description,confirmButtonText:n.confirmButtonText,cancelButtonText:n.cancelButtonText,onConfirm:n.onConfirm,onCancel:n.onCancel,children:n.content})}),e]})},BD=(e,t)=>{const n=e.replace(/\s+/g,"+");if(!e.replace(/[^a-zA-Z0-9\s\-_]/g,"").trim())return;const i=t.filter(l=>/^\d+$/.test(l)).join(";"),o=`https://fonts.googleapis.com/css2?family=${n}:wght@${i}&display=swap`;if(document.querySelector(`link[href="${o}"]`))return;const a=document.createElement("link");a.rel="stylesheet",a.href=o,document.head.appendChild(a)},Fg=({color:e,fontFamily:t,radius:n,themeMode:r,variant:i,headerVariant:o,additionalStylesheetUrl:s})=>{D.useMemo(()=>{t&&BD(t,["100","200","300","400","500","600","700","800"])},[t]);const a=D.useMemo(()=>Ff({color:e,fontFamily:t,radius:n,themeMode:r,variant:i,headerVariant:o}),[e,t,n,r,i,o]);return k.jsxs(k.Fragment,{children:[s&&k.jsx("link",{rel:"stylesheet",href:s}),k.jsxs("style",{children:[a,`
307
+ */var Al,rg;function OM(){if(rg)return Al;rg=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function i(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var s={},a=0;a<10;a++)s["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(s).map(function(f){return s[f]});if(l.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(f){u[f]=f}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Al=i()?Object.assign:function(o,s){for(var a,l=r(o),u,f=1;f<arguments.length;f++){a=Object(arguments[f]);for(var c in a)t.call(a,c)&&(l[c]=a[c]);if(e){u=e(a);for(var h=0;h<u.length;h++)n.call(a,u[h])&&(l[u[h]]=a[u[h]])}}return l},Al}var Tl,ig;function Il(){if(ig)return Tl;ig=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Tl=e,Tl}var Ol,og;function sg(){return og||(og=1,Ol=Function.call.bind(Object.prototype.hasOwnProperty)),Ol}var Ml,ag;function MM(){if(ag)return Ml;ag=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Il(),n={},r=sg();e=function(o){var s="Warning: "+o;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}}function i(o,s,a,l,u){if(process.env.NODE_ENV!=="production"){for(var f in o)if(r(o,f)){var c;try{if(typeof o[f]!="function"){var h=Error((l||"React class")+": "+a+" type `"+f+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[f]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}c=o[f](s,f,l,a,null,t)}catch(m){c=m}if(c&&!(c instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+f+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof c+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),c instanceof Error&&!(c.message in n)){n[c.message]=!0;var d=u?u():"";e("Failed "+a+" type: "+c.message+(d??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Ml=i,Ml}var Dl,lg;function DM(){if(lg)return Dl;lg=1;var e=ng(),t=OM(),n=Il(),r=sg(),i=MM(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function s(){return null}return Dl=function(a,l){var u=typeof Symbol=="function"&&Symbol.iterator,f="@@iterator";function c(b){var _=b&&(u&&b[u]||b[f]);if(typeof _=="function")return _}var h="<<anonymous>>",d={array:v("array"),bigint:v("bigint"),bool:v("boolean"),func:v("function"),number:v("number"),object:v("object"),string:v("string"),symbol:v("symbol"),any:y(),arrayOf:w,element:A(),elementType:k(),instanceOf:E,node:T(),objectOf:D,oneOf:I,oneOfType:P,shape:B,exact:L};function m(b,_){return b===_?b!==0||1/b===1/_:b!==b&&_!==_}function p(b,_){this.message=b,this.data=_&&typeof _=="object"?_:{},this.stack=""}p.prototype=Error.prototype;function g(b){if(process.env.NODE_ENV!=="production")var _={},j=0;function S(Y,q,Q,X,se,G,te){if(X=X||h,G=G||Q,te!==n){if(l){var $=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw $.name="Invariant Violation",$}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ne=X+":"+Q;!_[ne]&&j<3&&(o("You are manually calling a React.PropTypes validation function for the `"+G+"` prop on `"+X+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),_[ne]=!0,j++)}}return q[Q]==null?Y?q[Q]===null?new p("The "+se+" `"+G+"` is marked as required "+("in `"+X+"`, but its value is `null`.")):new p("The "+se+" `"+G+"` is marked as required in "+("`"+X+"`, but its value is `undefined`.")):null:b(q,Q,X,se,G)}var V=S.bind(null,!1);return V.isRequired=S.bind(null,!0),V}function v(b){function _(j,S,V,Y,q,Q){var X=j[S],se=N(X);if(se!==b){var G=H(X);return new p("Invalid "+Y+" `"+q+"` of type "+("`"+G+"` supplied to `"+V+"`, expected ")+("`"+b+"`."),{expectedType:b})}return null}return g(_)}function y(){return g(s)}function w(b){function _(j,S,V,Y,q){if(typeof b!="function")return new p("Property `"+q+"` of component `"+V+"` has invalid PropType notation inside arrayOf.");var Q=j[S];if(!Array.isArray(Q)){var X=N(Q);return new p("Invalid "+Y+" `"+q+"` of type "+("`"+X+"` supplied to `"+V+"`, expected an array."))}for(var se=0;se<Q.length;se++){var G=b(Q,se,V,Y,q+"["+se+"]",n);if(G instanceof Error)return G}return null}return g(_)}function A(){function b(_,j,S,V,Y){var q=_[j];if(!a(q)){var Q=N(q);return new p("Invalid "+V+" `"+Y+"` of type "+("`"+Q+"` supplied to `"+S+"`, expected a single ReactElement."))}return null}return g(b)}function k(){function b(_,j,S,V,Y){var q=_[j];if(!e.isValidElementType(q)){var Q=N(q);return new p("Invalid "+V+" `"+Y+"` of type "+("`"+Q+"` supplied to `"+S+"`, expected a single ReactElement type."))}return null}return g(b)}function E(b){function _(j,S,V,Y,q){if(!(j[S]instanceof b)){var Q=b.name||h,X=W(j[S]);return new p("Invalid "+Y+" `"+q+"` of type "+("`"+X+"` supplied to `"+V+"`, expected ")+("instance of `"+Q+"`."))}return null}return g(_)}function I(b){if(!Array.isArray(b))return process.env.NODE_ENV!=="production"&&(arguments.length>1?o("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):o("Invalid argument supplied to oneOf, expected an array.")),s;function _(j,S,V,Y,q){for(var Q=j[S],X=0;X<b.length;X++)if(m(Q,b[X]))return null;var se=JSON.stringify(b,function(te,$){var ne=H($);return ne==="symbol"?String($):$});return new p("Invalid "+Y+" `"+q+"` of value `"+String(Q)+"` "+("supplied to `"+V+"`, expected one of "+se+"."))}return g(_)}function D(b){function _(j,S,V,Y,q){if(typeof b!="function")return new p("Property `"+q+"` of component `"+V+"` has invalid PropType notation inside objectOf.");var Q=j[S],X=N(Q);if(X!=="object")return new p("Invalid "+Y+" `"+q+"` of type "+("`"+X+"` supplied to `"+V+"`, expected an object."));for(var se in Q)if(r(Q,se)){var G=b(Q,se,V,Y,q+"."+se,n);if(G instanceof Error)return G}return null}return g(_)}function P(b){if(!Array.isArray(b))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var _=0;_<b.length;_++){var j=b[_];if(typeof j!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+z(j)+" at index "+_+"."),s}function S(V,Y,q,Q,X){for(var se=[],G=0;G<b.length;G++){var te=b[G],$=te(V,Y,q,Q,X,n);if($==null)return null;$.data&&r($.data,"expectedType")&&se.push($.data.expectedType)}var ne=se.length>0?", expected one of type ["+se.join(", ")+"]":"";return new p("Invalid "+Q+" `"+X+"` supplied to "+("`"+q+"`"+ne+"."))}return g(S)}function T(){function b(_,j,S,V,Y){return F(_[j])?null:new p("Invalid "+V+" `"+Y+"` supplied to "+("`"+S+"`, expected a ReactNode."))}return g(b)}function O(b,_,j,S,V){return new p((b||"React class")+": "+_+" type `"+j+"."+S+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+V+"`.")}function B(b){function _(j,S,V,Y,q){var Q=j[S],X=N(Q);if(X!=="object")return new p("Invalid "+Y+" `"+q+"` of type `"+X+"` "+("supplied to `"+V+"`, expected `object`."));for(var se in b){var G=b[se];if(typeof G!="function")return O(V,Y,q,se,H(G));var te=G(Q,se,V,Y,q+"."+se,n);if(te)return te}return null}return g(_)}function L(b){function _(j,S,V,Y,q){var Q=j[S],X=N(Q);if(X!=="object")return new p("Invalid "+Y+" `"+q+"` of type `"+X+"` "+("supplied to `"+V+"`, expected `object`."));var se=t({},j[S],b);for(var G in se){var te=b[G];if(r(b,G)&&typeof te!="function")return O(V,Y,q,G,H(te));if(!te)return new p("Invalid "+Y+" `"+q+"` key `"+G+"` supplied to `"+V+"`.\nBad object: "+JSON.stringify(j[S],null," ")+`
308
+ Valid keys: `+JSON.stringify(Object.keys(b),null," "));var $=te(Q,G,V,Y,q+"."+G,n);if($)return $}return null}return g(_)}function F(b){switch(typeof b){case"number":case"string":case"undefined":return!0;case"boolean":return!b;case"object":if(Array.isArray(b))return b.every(F);if(b===null||a(b))return!0;var _=c(b);if(_){var j=_.call(b),S;if(_!==b.entries){for(;!(S=j.next()).done;)if(!F(S.value))return!1}else for(;!(S=j.next()).done;){var V=S.value;if(V&&!F(V[1]))return!1}}else return!1;return!0;default:return!1}}function R(b,_){return b==="symbol"?!0:_?_["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&_ instanceof Symbol:!1}function N(b){var _=typeof b;return Array.isArray(b)?"array":b instanceof RegExp?"object":R(_,b)?"symbol":_}function H(b){if(typeof b>"u"||b===null)return""+b;var _=N(b);if(_==="object"){if(b instanceof Date)return"date";if(b instanceof RegExp)return"regexp"}return _}function z(b){var _=H(b);switch(_){case"array":case"object":return"an "+_;case"boolean":case"date":case"regexp":return"a "+_;default:return _}}function W(b){return!b.constructor||!b.constructor.name?h:b.constructor.name}return d.checkPropTypes=i,d.resetWarningCache=i.resetWarningCache,d.PropTypes=d,d},Dl}var Nl,ug;function NM(){if(ug)return Nl;ug=1;var e=Il();function t(){}function n(){}return n.resetWarningCache=t,Nl=function(){function r(s,a,l,u,f,c){if(c!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Nl}if(process.env.NODE_ENV!=="production"){var _M=ng(),PM=!0;Cl.exports=DM()(_M.isElement,PM)}else Cl.exports=NM()();var LM=Cl.exports;const Ne=vn(LM);var FM=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function li(e,t){var n=RM(e);if(typeof n.path!="string"){var r=e.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof t=="string"?t:typeof r=="string"&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function RM(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),i=FM.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var $M=[".DS_Store","Thumbs.db"];function BM(e){return Zn(this,void 0,void 0,function(){return Jn(this,function(t){return Io(e)&&zM(e.dataTransfer)?[2,VM(e.dataTransfer,e.type)]:UM(e)?[2,HM(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,jM(e)]:[2,[]]})})}function zM(e){return Io(e)}function UM(e){return Io(e)&&Io(e.target)}function Io(e){return typeof e=="object"&&e!==null}function HM(e){return _l(e.target.files).map(function(t){return li(t)})}function jM(e){return Zn(this,void 0,void 0,function(){var t;return Jn(this,function(n){switch(n.label){case 0:return[4,Promise.all(e.map(function(r){return r.getFile()}))];case 1:return t=n.sent(),[2,t.map(function(r){return li(r)})]}})})}function VM(e,t){return Zn(this,void 0,void 0,function(){var n,r;return Jn(this,function(i){switch(i.label){case 0:return e.items?(n=_l(e.items).filter(function(o){return o.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(WM))]):[3,2];case 1:return r=i.sent(),[2,cg(fg(r))];case 2:return[2,cg(_l(e.files).map(function(o){return li(o)}))]}})})}function cg(e){return e.filter(function(t){return $M.indexOf(t.name)===-1})}function _l(e){if(e===null)return[];for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r)}return t}function WM(e){if(typeof e.webkitGetAsEntry!="function")return dg(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?hg(t):dg(e)}function fg(e){return e.reduce(function(t,n){return Ya(Ya([],Op(t),!1),Op(Array.isArray(n)?fg(n):[n]),!1)},[])}function dg(e){var t=e.getAsFile();if(!t)return Promise.reject("".concat(e," is not a File"));var n=li(t);return Promise.resolve(n)}function qM(e){return Zn(this,void 0,void 0,function(){return Jn(this,function(t){return[2,e.isDirectory?hg(e):YM(e)]})})}function hg(e){var t=e.createReader();return new Promise(function(n,r){var i=[];function o(){var s=this;t.readEntries(function(a){return Zn(s,void 0,void 0,function(){var l,u,f;return Jn(this,function(c){switch(c.label){case 0:if(a.length)return[3,5];c.label=1;case 1:return c.trys.push([1,3,,4]),[4,Promise.all(i)];case 2:return l=c.sent(),n(l),[3,4];case 3:return u=c.sent(),r(u),[3,4];case 4:return[3,6];case 5:f=Promise.all(a.map(qM)),i.push(f),o(),c.label=6;case 6:return[2]}})})},function(a){r(a)})}o()})}function YM(e){return Zn(this,void 0,void 0,function(){return Jn(this,function(t){return[2,new Promise(function(n,r){e.file(function(i){var o=li(i,e.fullPath);n(o)},function(i){r(i)})})]})})}var KM=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var r=e.name||"",i=(e.type||"").toLowerCase(),o=i.replace(/\/.*$/,"");return n.some(function(s){var a=s.trim().toLowerCase();return a.charAt(0)==="."?r.toLowerCase().endsWith(a):a.endsWith("/*")?o===a.replace(/\/.*$/,""):i===a})}return!0};function pg(e){return ZM(e)||QM(e)||vg(e)||GM()}function GM(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
309
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function QM(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ZM(e){if(Array.isArray(e))return Pl(e)}function mg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function gg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mg(Object(n),!0).forEach(function(r){yg(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mg(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ui(e,t){return eD(e)||XM(e,t)||vg(e,t)||JM()}function JM(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
310
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vg(e,t){if(e){if(typeof e=="string")return Pl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Pl(e,t)}}function Pl(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function XM(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,s,a;try{for(n=n.call(e);!(i=(s=n.next()).done)&&(r.push(s.value),!(t&&r.length===t));i=!0);}catch(l){o=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw a}}return r}}function eD(e){if(Array.isArray(e))return e}var tD="file-invalid-type",nD="file-too-large",rD="file-too-small",iD="too-many-files",oD=function(t){t=Array.isArray(t)&&t.length===1?t[0]:t;var n=Array.isArray(t)?"one of ".concat(t.join(", ")):t;return{code:tD,message:"File type must be ".concat(n)}},bg=function(t){return{code:nD,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},wg=function(t){return{code:rD,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},sD={code:iD,message:"Too many files"};function Sg(e,t){var n=e.type==="application/x-moz-file"||KM(e,t);return[n,n?null:oD(t)]}function xg(e,t,n){if(Nn(e.size))if(Nn(t)&&Nn(n)){if(e.size>n)return[!1,bg(n)];if(e.size<t)return[!1,wg(t)]}else{if(Nn(t)&&e.size<t)return[!1,wg(t)];if(Nn(n)&&e.size>n)return[!1,bg(n)]}return[!0,null]}function Nn(e){return e!=null}function aD(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,o=e.multiple,s=e.maxFiles,a=e.validator;return!o&&t.length>1||o&&s>=1&&t.length>s?!1:t.every(function(l){var u=Sg(l,n),f=ui(u,1),c=f[0],h=xg(l,r,i),d=ui(h,1),m=d[0],p=a?a(l):null;return c&&m&&!p})}function Oo(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Mo(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function kg(e){e.preventDefault()}function lD(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function uD(e){return e.indexOf("Edge/")!==-1}function cD(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return lD(e)||uD(e)}function jt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];return t.some(function(a){return!Oo(r)&&a&&a.apply(void 0,[r].concat(o)),Oo(r)})}}function fD(){return"showOpenFilePicker"in window}function dD(e){if(Nn(e)){var t=Object.entries(e).filter(function(n){var r=ui(n,2),i=r[0],o=r[1],s=!0;return Eg(i)||(console.warn('Skipped "'.concat(i,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),s=!1),(!Array.isArray(o)||!o.every(Cg))&&(console.warn('Skipped "'.concat(i,'" because an invalid file extension was provided.')),s=!1),s}).reduce(function(n,r){var i=ui(r,2),o=i[0],s=i[1];return gg(gg({},n),{},yg({},o,s))},{});return[{description:"Files",accept:t}]}return e}function hD(e){if(Nn(e))return Object.entries(e).reduce(function(t,n){var r=ui(n,2),i=r[0],o=r[1];return[].concat(pg(t),[i],pg(o))},[]).filter(function(t){return Eg(t)||Cg(t)}).join(",")}function pD(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function mD(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function Eg(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function Cg(e){return/^.*\.[\w]+$/.test(e)}var gD=["children"],yD=["open"],vD=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],bD=["refKey","onChange","onClick"];function wD(e){return kD(e)||xD(e)||Ag(e)||SD()}function SD(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
311
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xD(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function kD(e){if(Array.isArray(e))return Fl(e)}function Ll(e,t){return AD(e)||CD(e,t)||Ag(e,t)||ED()}function ED(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
312
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ag(e,t){if(e){if(typeof e=="string")return Fl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Fl(e,t)}}function Fl(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function CD(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,s,a;try{for(n=n.call(e);!(i=(s=n.next()).done)&&(r.push(s.value),!(t&&r.length===t));i=!0);}catch(l){o=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw a}}return r}}function AD(e){if(Array.isArray(e))return e}function Tg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Be(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Tg(Object(n),!0).forEach(function(r){Rl(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tg(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Rl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Do(e,t){if(e==null)return{};var n=TD(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function TD(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var $l=M.forwardRef(function(e,t){var n=e.children,r=Do(e,gD),i=Og(r),o=i.open,s=Do(i,yD);return M.useImperativeHandle(t,function(){return{open:o}},[o]),M.createElement(M.Fragment,null,n(Be(Be({},s),{},{open:o})))});$l.displayName="Dropzone";var Ig={disabled:!1,getFilesFromEvent:BM,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};$l.defaultProps=Ig,$l.propTypes={children:Ne.func,accept:Ne.objectOf(Ne.arrayOf(Ne.string)),multiple:Ne.bool,preventDropOnDocument:Ne.bool,noClick:Ne.bool,noKeyboard:Ne.bool,noDrag:Ne.bool,noDragEventsBubbling:Ne.bool,minSize:Ne.number,maxSize:Ne.number,maxFiles:Ne.number,disabled:Ne.bool,getFilesFromEvent:Ne.func,onFileDialogCancel:Ne.func,onFileDialogOpen:Ne.func,useFsAccessApi:Ne.bool,autoFocus:Ne.bool,onDragEnter:Ne.func,onDragLeave:Ne.func,onDragOver:Ne.func,onDrop:Ne.func,onDropAccepted:Ne.func,onDropRejected:Ne.func,onError:Ne.func,validator:Ne.func};var Bl={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function Og(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Be(Be({},Ig),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,o=t.maxSize,s=t.minSize,a=t.multiple,l=t.maxFiles,u=t.onDragEnter,f=t.onDragLeave,c=t.onDragOver,h=t.onDrop,d=t.onDropAccepted,m=t.onDropRejected,p=t.onFileDialogCancel,g=t.onFileDialogOpen,v=t.useFsAccessApi,y=t.autoFocus,w=t.preventDropOnDocument,A=t.noClick,k=t.noKeyboard,E=t.noDrag,I=t.noDragEventsBubbling,D=t.onError,P=t.validator,T=M.useMemo(function(){return hD(n)},[n]),O=M.useMemo(function(){return dD(n)},[n]),B=M.useMemo(function(){return typeof g=="function"?g:Mg},[g]),L=M.useMemo(function(){return typeof p=="function"?p:Mg},[p]),F=M.useRef(null),R=M.useRef(null),N=M.useReducer(ID,Bl),H=Ll(N,2),z=H[0],W=H[1],b=z.isFocused,_=z.isFileDialogActive,j=M.useRef(typeof window<"u"&&window.isSecureContext&&v&&fD()),S=function(){!j.current&&_&&setTimeout(function(){if(R.current){var ae=R.current.files;ae.length||(W({type:"closeDialog"}),L())}},300)};M.useEffect(function(){return window.addEventListener("focus",S,!1),function(){window.removeEventListener("focus",S,!1)}},[R,_,L,j]);var V=M.useRef([]),Y=function(ae){F.current&&F.current.contains(ae.target)||(ae.preventDefault(),V.current=[])};M.useEffect(function(){return w&&(document.addEventListener("dragover",kg,!1),document.addEventListener("drop",Y,!1)),function(){w&&(document.removeEventListener("dragover",kg),document.removeEventListener("drop",Y))}},[F,w]),M.useEffect(function(){return!r&&y&&F.current&&F.current.focus(),function(){}},[F,y,r]);var q=M.useCallback(function(ee){D?D(ee):console.error(ee)},[D]),Q=M.useCallback(function(ee){ee.preventDefault(),ee.persist(),Ae(ee),V.current=[].concat(wD(V.current),[ee.target]),Mo(ee)&&Promise.resolve(i(ee)).then(function(ae){if(!(Oo(ee)&&!I)){var U=ae.length,K=U>0&&aD({files:ae,accept:T,minSize:s,maxSize:o,multiple:a,maxFiles:l,validator:P}),oe=U>0&&!K;W({isDragAccept:K,isDragReject:oe,isDragActive:!0,type:"setDraggedFiles"}),u&&u(ee)}}).catch(function(ae){return q(ae)})},[i,u,q,I,T,s,o,a,l,P]),X=M.useCallback(function(ee){ee.preventDefault(),ee.persist(),Ae(ee);var ae=Mo(ee);if(ae&&ee.dataTransfer)try{ee.dataTransfer.dropEffect="copy"}catch{}return ae&&c&&c(ee),!1},[c,I]),se=M.useCallback(function(ee){ee.preventDefault(),ee.persist(),Ae(ee);var ae=V.current.filter(function(K){return F.current&&F.current.contains(K)}),U=ae.indexOf(ee.target);U!==-1&&ae.splice(U,1),V.current=ae,!(ae.length>0)&&(W({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Mo(ee)&&f&&f(ee))},[F,f,I]),G=M.useCallback(function(ee,ae){var U=[],K=[];ee.forEach(function(oe){var le=Sg(oe,T),he=Ll(le,2),je=he[0],Ge=he[1],Ze=xg(oe,s,o),Et=Ll(Ze,2),Rt=Et[0],Qe=Et[1],Ct=P?P(oe):null;if(je&&Rt&&!Ct)U.push(oe);else{var at=[Ge,Qe];Ct&&(at=at.concat(Ct)),K.push({file:oe,errors:at.filter(function(es){return es})})}}),(!a&&U.length>1||a&&l>=1&&U.length>l)&&(U.forEach(function(oe){K.push({file:oe,errors:[sD]})}),U.splice(0)),W({acceptedFiles:U,fileRejections:K,type:"setFiles"}),h&&h(U,K,ae),K.length>0&&m&&m(K,ae),U.length>0&&d&&d(U,ae)},[W,a,T,s,o,l,h,d,m,P]),te=M.useCallback(function(ee){ee.preventDefault(),ee.persist(),Ae(ee),V.current=[],Mo(ee)&&Promise.resolve(i(ee)).then(function(ae){Oo(ee)&&!I||G(ae,ee)}).catch(function(ae){return q(ae)}),W({type:"reset"})},[i,G,q,I]),$=M.useCallback(function(){if(j.current){W({type:"openDialog"}),B();var ee={multiple:a,types:O};window.showOpenFilePicker(ee).then(function(ae){return i(ae)}).then(function(ae){G(ae,null),W({type:"closeDialog"})}).catch(function(ae){pD(ae)?(L(ae),W({type:"closeDialog"})):mD(ae)?(j.current=!1,R.current?(R.current.value=null,R.current.click()):q(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):q(ae)});return}R.current&&(W({type:"openDialog"}),B(),R.current.value=null,R.current.click())},[W,B,L,v,G,q,O,a]),ne=M.useCallback(function(ee){!F.current||!F.current.isEqualNode(ee.target)||(ee.key===" "||ee.key==="Enter"||ee.keyCode===32||ee.keyCode===13)&&(ee.preventDefault(),$())},[F,$]),me=M.useCallback(function(){W({type:"focus"})},[]),Oe=M.useCallback(function(){W({type:"blur"})},[]),J=M.useCallback(function(){A||(cD()?setTimeout($,0):$())},[A,$]),ue=function(ae){return r?null:ae},de=function(ae){return k?null:ue(ae)},fe=function(ae){return E?null:ue(ae)},Ae=function(ae){I&&ae.stopPropagation()},Fe=M.useMemo(function(){return function(){var ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ae=ee.refKey,U=ae===void 0?"ref":ae,K=ee.role,oe=ee.onKeyDown,le=ee.onFocus,he=ee.onBlur,je=ee.onClick,Ge=ee.onDragEnter,Ze=ee.onDragOver,Et=ee.onDragLeave,Rt=ee.onDrop,Qe=Do(ee,vD);return Be(Be(Rl({onKeyDown:de(jt(oe,ne)),onFocus:de(jt(le,me)),onBlur:de(jt(he,Oe)),onClick:ue(jt(je,J)),onDragEnter:fe(jt(Ge,Q)),onDragOver:fe(jt(Ze,X)),onDragLeave:fe(jt(Et,se)),onDrop:fe(jt(Rt,te)),role:typeof K=="string"&&K!==""?K:"presentation"},U,F),!r&&!k?{tabIndex:0}:{}),Qe)}},[F,ne,me,Oe,J,Q,X,se,te,k,E,r]),Me=M.useCallback(function(ee){ee.stopPropagation()},[]),He=M.useMemo(function(){return function(){var ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ae=ee.refKey,U=ae===void 0?"ref":ae,K=ee.onChange,oe=ee.onClick,le=Do(ee,bD),he=Rl({accept:T,multiple:a,type:"file",style:{display:"none"},onChange:ue(jt(K,te)),onClick:ue(jt(oe,Me)),tabIndex:-1},U,R);return Be(Be({},he),le)}},[R,n,a,te,r]);return Be(Be({},z),{},{isFocused:b&&!r,getRootProps:Fe,getInputProps:He,rootRef:F,inputRef:R,open:ue($)})}function ID(e,t){switch(t.type){case"focus":return Be(Be({},e),{},{isFocused:!0});case"blur":return Be(Be({},e),{},{isFocused:!1});case"openDialog":return Be(Be({},Bl),{},{isFileDialogActive:!0});case"closeDialog":return Be(Be({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Be(Be({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Be(Be({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return Be({},Bl);default:return e}}function Mg(){}const Dg=({children:e})=>{const t=M.useRef(null),[n,r]=M.useState({open:!1}),i=({title:s,description:a,confirmButtonText:l,cancelButtonText:u,onConfirm:f,onCancel:c,initialValue:h,Content:d})=>new Promise((m,p)=>{t.current=h,r({open:!0,title:s,description:a,confirmButtonText:l,cancelButtonText:u,content:d?x.jsx(d,{value:h,setValue:g=>{t.current=g}}):null,onConfirm:()=>{f==null||f(),m(t.current),o()},onCancel:()=>{c==null||c(),p(),o()}})}),o=()=>{r(s=>({...s,open:!1}))};return x.jsxs(Wa.Provider,{value:{showInputModal:i},children:[x.jsx(br,{open:n.open,onOpenChange:s=>r(a=>({...a,open:s})),children:x.jsx(br.Content,{title:n.title,description:n.description,confirmButtonText:n.confirmButtonText,cancelButtonText:n.cancelButtonText,onConfirm:n.onConfirm,onCancel:n.onCancel,children:n.content})}),e]})},OD=(e,t)=>{const n=e.replace(/\s+/g,"+");if(!e.replace(/[^a-zA-Z0-9\s\-_]/g,"").trim())return;const i=t.filter(l=>/^\d+$/.test(l)).join(";"),o=`https://fonts.googleapis.com/css2?family=${n}:wght@${i}&display=swap`;if(document.querySelector(`link[href="${o}"]`))return;const a=document.createElement("link");a.rel="stylesheet",a.href=o,document.head.appendChild(a)},Ng=({color:e,fontFamily:t,radius:n,themeMode:r,variant:i,headerVariant:o,additionalStylesheetUrl:s})=>{M.useMemo(()=>{t&&OD(t,["100","200","300","400","500","600","700","800"])},[t]);const a=M.useMemo(()=>Nf({color:e,fontFamily:t,radius:n,themeMode:r,variant:i,headerVariant:o}),[e,t,n,r,i,o]);return x.jsxs(x.Fragment,{children:[s&&x.jsx("link",{rel:"stylesheet",href:s}),x.jsxs("style",{children:[a,`
313
313
  .bpWebchat {
314
314
  border-radius: ${.375*(n??1)}rem;
315
315
  }
316
316
  .bpMessagePreview {
317
317
  border-radius: ${.125*(n??1)}rem;
318
318
  }
319
- `]})]})};let No;const zD=new Uint8Array(16);function UD(){if(!No&&(No=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!No))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return No(zD)}const Xe=[];for(let e=0;e<256;++e)Xe.push((e+256).toString(16).slice(1));function jD(e,t=0){return Xe[e[t+0]]+Xe[e[t+1]]+Xe[e[t+2]]+Xe[e[t+3]]+"-"+Xe[e[t+4]]+Xe[e[t+5]]+"-"+Xe[e[t+6]]+Xe[e[t+7]]+"-"+Xe[e[t+8]]+Xe[e[t+9]]+"-"+Xe[e[t+10]]+Xe[e[t+11]]+Xe[e[t+12]]+Xe[e[t+13]]+Xe[e[t+14]]+Xe[e[t+15]]}const Rg={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function HD(e,t,n){if(Rg.randomUUID&&!e)return Rg.randomUUID();e=e||{};const r=e.random||(e.rng||UD)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,jD(r)}function ui(e){var s;const{metadata:t,conversationId:n,userId:r}=e,{payload:i,disableInput:o}=$g(e.payload);return{id:e.id,conversationId:n,authorId:r,timestamp:new Date(e.createdAt),block:i,feedback:(s=e.feedback)==null?void 0:s.value,disableInput:o,metadata:t}}const $g=e=>{switch(e.type){case"audio":return Bg(e);case"card":return VD(e);case"carousel":return WD(e);case"choice":return qD(e);case"dropdown":return YD(e);case"file":return zg(e);case"image":return Ug(e);case"location":return jg(e);case"markdown":return Hg(e);case"text":return Vg(e);case"video":return Wg(e);case"bloc":return KD(e);case"custom":return{payload:e};default:{const t=e;throw new Error(`Unsuported message type ${t}`)}}},ci=e=>({block:e,type:"bubble"}),Bg=e=>({payload:{type:"audio",url:e.audioUrl}}),VD=e=>({payload:ci(qg(e))}),WD=e=>({payload:{type:"carousel",blocks:e.items.map(t=>qg({...t}))}}),qD=e=>{const t=e.options.map(o=>({title:o.label,value:o.value})),n=e.text,r=HD(),i=ci({type:"text",text:n});return t.length===0?{disableInput:e.disableFreeText,payload:i}:{disableInput:e.disableFreeText,payload:{type:"column",blocks:[i,{type:"row",blocks:t.map(({title:o,value:s})=>({type:"button",variant:"action",text:o,buttonValue:s,groupId:r}))}]}}},YD=e=>{const t=e.options.map(i=>({label:i.label,value:i.value})),n=e.text,r=[{type:"dropdown",label:n??"Select an option",options:t}];return n&&r.unshift({type:"text",text:n}),{disableInput:!0,payload:ci({type:"column",blocks:r})}},zg=e=>({payload:{type:"file",url:e.fileUrl,title:e.title}}),Ug=e=>({payload:{type:"image",url:e.imageUrl}}),jg=e=>({payload:{type:"location",latitude:e.latitude,longitude:e.longitude,title:e.title??e.address??"View on map"}}),Hg=e=>({payload:ci({type:"text",text:e.markdown})}),Vg=e=>({payload:ci({type:"text",text:e.text,value:e.value})}),Wg=e=>({payload:{type:"video",url:e.videoUrl}}),KD=e=>({payload:{type:"column",blocks:e.items.map(n=>{switch(n.type){case"audio":return Bg({...n.payload,type:n.type}).payload;case"file":return zg({...n.payload,type:n.type}).payload;case"image":return Ug({...n.payload,type:n.type}).payload;case"location":return jg({...n.payload,type:n.type}).payload;case"markdown":return Hg({...n.payload,type:n.type}).payload;case"text":return Vg({...n.payload,type:n.type}).payload;case"video":return Wg({...n.payload,type:n.type}).payload;default:throw new Error("Unsuported message type")}})}}),qg=e=>{const t=e.title,n=e.subtitle,r=e.imageUrl,i=e.actions.map(s=>{switch(s.action){case"postback":return{type:"button",variant:"action",text:s.label,buttonValue:s.value,reusable:!0};case"url":return{type:"button",variant:"link",text:s.label,buttonValue:s.value,reusable:!0};case"say":return{type:"button",variant:"action",text:s.label,buttonValue:s.value,reusable:!0};default:throw new Error(`Unknown action type ${s.action}`)}}),o=[];return r&&o.push({type:"image",url:r}),t&&o.push({type:"text",text:`#### ${t}`}),n&&o.push({type:"text",text:n}),i.length>0&&o.push({type:"row",blocks:i}),{type:"column",horizontalAlignment:"center",blocks:[...o]}};var GD=Object.defineProperty,QD=(e,t,n)=>t in e?GD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ZD=(e,t,n)=>QD(e,t+"",n),JD=async(e,t)=>{let n=typeof t=="function"?await t(e):t;if(n)return e.scheme==="bearer"?`Bearer ${n}`:e.scheme==="basic"?`Basic ${btoa(n)}`:n},XD={bodySerializer:e=>JSON.stringify(e,(t,n)=>typeof n=="bigint"?n.toString():n)},eN=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},tN=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},nN=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},Yg=({allowReserved:e,explode:t,name:n,style:r,value:i})=>{if(!t){let a=(e?i:i.map(l=>encodeURIComponent(l))).join(tN(r));switch(r){case"label":return`.${a}`;case"matrix":return`;${n}=${a}`;case"simple":return a;default:return`${n}=${a}`}}let o=eN(r),s=i.map(a=>r==="label"||r==="simple"?e?a:encodeURIComponent(a):_o({allowReserved:e,name:n,value:a})).join(o);return r==="label"||r==="matrix"?o+s:s},_o=({allowReserved:e,name:t,value:n})=>{if(n==null)return"";if(typeof n=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${t}=${e?n:encodeURIComponent(n)}`},Kg=({allowReserved:e,explode:t,name:n,style:r,value:i})=>{if(i instanceof Date)return`${n}=${i.toISOString()}`;if(r!=="deepObject"&&!t){let a=[];Object.entries(i).forEach(([u,f])=>{a=[...a,u,e?f:encodeURIComponent(f)]});let l=a.join(",");switch(r){case"form":return`${n}=${l}`;case"label":return`.${l}`;case"matrix":return`;${n}=${l}`;default:return l}}let o=nN(r),s=Object.entries(i).map(([a,l])=>_o({allowReserved:e,name:r==="deepObject"?`${n}[${a}]`:a,value:l})).join(o);return r==="label"||r==="matrix"?o+s:s},rN=/\{[^{}]+\}/g,iN=({path:e,url:t})=>{let n=t,r=t.match(rN);if(r)for(let i of r){let o=!1,s=i.substring(1,i.length-1),a="simple";s.endsWith("*")&&(o=!0,s=s.substring(0,s.length-1)),s.startsWith(".")?(s=s.substring(1),a="label"):s.startsWith(";")&&(s=s.substring(1),a="matrix");let l=e[s];if(l==null)continue;if(Array.isArray(l)){n=n.replace(i,Yg({explode:o,name:s,style:a,value:l}));continue}if(typeof l=="object"){n=n.replace(i,Kg({explode:o,name:s,style:a,value:l}));continue}if(a==="matrix"){n=n.replace(i,`;${_o({name:s,value:l})}`);continue}let u=encodeURIComponent(a==="label"?`.${l}`:l);n=n.replace(i,u)}return n},Gg=({allowReserved:e,array:t,object:n}={})=>r=>{let i=[];if(r&&typeof r=="object")for(let o in r){let s=r[o];if(s!=null){if(Array.isArray(s)){i=[...i,Yg({allowReserved:e,explode:!0,name:o,style:"form",value:s,...t})];continue}if(typeof s=="object"){i=[...i,Kg({allowReserved:e,explode:!0,name:o,style:"deepObject",value:s,...n})];continue}i=[...i,_o({allowReserved:e,name:o,value:s})]}}return i.join("&")},oN=e=>{var t;if(!e)return"stream";let n=(t=e.split(";")[0])==null?void 0:t.trim();if(n){if(n.startsWith("application/json")||n.endsWith("+json"))return"json";if(n==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(r=>n.startsWith(r)))return"blob";if(n.startsWith("text/"))return"text"}},sN=async({security:e,...t})=>{for(let n of e){let r=await JD(n,t.auth);if(!r)continue;let i=n.name??"Authorization";switch(n.in){case"query":t.query||(t.query={}),t.query[i]=r;break;case"cookie":t.headers.append("Cookie",`${i}=${r}`);break;case"header":default:t.headers.set(i,r);break}return}},Qg=e=>aN({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:Gg(e.querySerializer),url:e.url}),aN=({baseUrl:e,path:t,query:n,querySerializer:r,url:i})=>{let o=i.startsWith("/")?i:`/${i}`,s=(e??"")+o;t&&(s=iN({path:t,url:s}));let a=n?r(n):"";return a.startsWith("?")&&(a=a.substring(1)),a&&(s+=`?${a}`),s},Zg=(e,t)=>{var n;let r={...e,...t};return(n=r.baseUrl)!=null&&n.endsWith("/")&&(r.baseUrl=r.baseUrl.substring(0,r.baseUrl.length-1)),r.headers=Jg(e.headers,t.headers),r},Jg=(...e)=>{let t=new Headers;for(let n of e){if(!n||typeof n!="object")continue;let r=n instanceof Headers?n.entries():Object.entries(n);for(let[i,o]of r)if(o===null)t.delete(i);else if(Array.isArray(o))for(let s of o)t.append(i,s);else o!==void 0&&t.set(i,typeof o=="object"?JSON.stringify(o):o)}return t},jl=class{constructor(){ZD(this,"_fns"),this._fns=[]}clear(){this._fns=[]}exists(t){return this._fns.indexOf(t)!==-1}eject(t){let n=this._fns.indexOf(t);n!==-1&&(this._fns=[...this._fns.slice(0,n),...this._fns.slice(n+1)])}use(t){this._fns=[...this._fns,t]}},lN=()=>({error:new jl,request:new jl,response:new jl}),uN=Gg({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),cN={"Content-Type":"application/json"},Xg=(e={})=>({...XD,headers:cN,parseAs:"auto",querySerializer:uN,...e}),fN=(e={})=>{let t=Zg(Xg(),e),n=()=>({...t}),r=s=>(t=Zg(t,s),n()),i=lN(),o=async s=>{let a={...t,...s,fetch:s.fetch??t.fetch??globalThis.fetch,headers:Jg(t.headers,s.headers)};a.security&&await sN({...a,security:a.security}),a.body&&a.bodySerializer&&(a.body=a.bodySerializer(a.body)),(a.body===void 0||a.body==="")&&a.headers.delete("Content-Type");let l=Qg(a),u={redirect:"follow",...a},f=new Request(l,u);for(let g of i.request._fns)f=await g(f,a);let c=a.fetch,h=await c(f);for(let g of i.response._fns)h=await g(h,f,a);let d={request:f,response:h};if(h.ok){if(h.status===204||h.headers.get("Content-Length")==="0")return{data:{},...d};let g=(a.parseAs==="auto"?oN(h.headers.get("Content-Type")):a.parseAs)??"json";if(g==="stream")return{data:h.body,...d};let y=await h[g]();return g==="json"&&(a.responseValidator&&await a.responseValidator(y),a.responseTransformer&&(y=await a.responseTransformer(y))),{data:y,...d}}let m=await h.text();try{m=JSON.parse(m)}catch{}let p=m;for(let g of i.error._fns)p=await g(m,h,f,a);if(p=p||{},a.throwOnError)throw p;return{error:p,...d}};return{buildUrl:Qg,connect:s=>o({...s,method:"CONNECT"}),delete:s=>o({...s,method:"DELETE"}),get:s=>o({...s,method:"GET"}),getConfig:n,head:s=>o({...s,method:"HEAD"}),interceptors:i,options:s=>o({...s,method:"OPTIONS"}),patch:s=>o({...s,method:"PATCH"}),post:s=>o({...s,method:"POST"}),put:s=>o({...s,method:"PUT"}),request:o,setConfig:r,trace:s=>o({...s,method:"TRACE"})}},dN=fN,hN=Xg;const Pe=dN((e=>({...e,withCredentials:!0,timeout:6e4,maxBodyLength:104857600,maxContentLength:104857600,throwOnError:!0,parseAs:"json"}))(hN({baseUrl:"https://webchat.botpress.cloud/"}))),pN=e=>(e.client??Pe).delete({url:"/conversations/{id}",...e}),mN=e=>(e.client??Pe).get({url:"/conversations/{id}",...e}),gN=e=>(e.client??Pe).get({url:"/conversations",...e}),yN=e=>(e.client??Pe).post({url:"/conversations",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),vN=e=>(e.client??Pe).get({url:"/conversations/{id}/messages",...e}),bN=e=>(e.client??Pe).get({url:"/conversations/{id}/participants",...e}),wN=e=>(e.client??Pe).post({url:"/conversations/{id}/participants",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),SN=e=>(e.client??Pe).delete({url:"/conversations/{id}/participants/{userId}",...e}),xN=e=>(e.client??Pe).get({url:"/conversations/{id}/participants/{userId}",...e}),kN=e=>(e.client??Pe).delete({url:"/messages/{id}",...e}),EN=e=>(e.client??Pe).get({url:"/messages/{id}",...e}),CN=e=>(e.client??Pe).put({url:"/messages/{id}",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),AN=e=>(e.client??Pe).post({url:"/messages",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),TN=e=>(e.client??Pe).delete({url:"/messages/{id}/feedback",...e}),IN=e=>(e.client??Pe).put({url:"/messages/{id}/feedback",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),ON=e=>(e.client??Pe).delete({url:"/users/me",...e}),MN=e=>(e.client??Pe).get({url:"/users/me",...e}),DN=e=>(e.client??Pe).put({url:"/users/me",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),NN=e=>((e==null?void 0:e.client)??Pe).post({url:"/users/key",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),_N=e=>(e.client??Pe).get({url:"/events/{id}",...e}),PN=e=>(e.client??Pe).post({url:"/events",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),LN=e=>(e.client??Pe).post({url:"/files",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}});let ey=class extends Error{constructor(t,n){super(t),this.name="ParseError",this.type=n.type,this.field=n.field,this.value=n.value,this.line=n.line}};function Hl(e){}function FN(e){if(typeof e=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:t=Hl,onError:n=Hl,onRetry:r=Hl,onComment:i}=e;let o="",s=!0,a,l="",u="";function f(p){const g=s?p.replace(/^\xEF\xBB\xBF/,""):p,[y,v]=RN(`${o}${g}`);for(const w of y)c(w);o=v,s=!1}function c(p){if(p===""){d();return}if(p.startsWith(":")){i&&i(p.slice(p.startsWith(": ")?2:1));return}const g=p.indexOf(":");if(g!==-1){const y=p.slice(0,g),v=p[g+1]===" "?2:1,w=p.slice(g+v);h(y,w,p);return}h(p,"",p)}function h(p,g,y){switch(p){case"event":u=g;break;case"data":l=`${l}${g}
320
- `;break;case"id":a=g.includes("\0")?void 0:g;break;case"retry":/^\d+$/.test(g)?r(parseInt(g,10)):n(new ey(`Invalid \`retry\` value: "${g}"`,{type:"invalid-retry",value:g,line:y}));break;default:n(new ey(`Unknown field "${p.length>20?`${p.slice(0,20)}…`:p}"`,{type:"unknown-field",field:p,value:g,line:y}));break}}function d(){l.length>0&&t({id:a,event:u||void 0,data:l.endsWith(`
321
- `)?l.slice(0,-1):l}),a=void 0,l="",u=""}function m(p={}){o&&p.consume&&c(o),s=!0,a=void 0,l="",u="",o=""}return{feed:f,reset:m}}function RN(e){const t=[];let n="",r=0;for(;r<e.length;){const i=e.indexOf("\r",r),o=e.indexOf(`
319
+ `]})]})};let No;const MD=new Uint8Array(16);function DD(){if(!No&&(No=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!No))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return No(MD)}const Xe=[];for(let e=0;e<256;++e)Xe.push((e+256).toString(16).slice(1));function ND(e,t=0){return Xe[e[t+0]]+Xe[e[t+1]]+Xe[e[t+2]]+Xe[e[t+3]]+"-"+Xe[e[t+4]]+Xe[e[t+5]]+"-"+Xe[e[t+6]]+Xe[e[t+7]]+"-"+Xe[e[t+8]]+Xe[e[t+9]]+"-"+Xe[e[t+10]]+Xe[e[t+11]]+Xe[e[t+12]]+Xe[e[t+13]]+Xe[e[t+14]]+Xe[e[t+15]]}const _g={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function _D(e,t,n){if(_g.randomUUID&&!e)return _g.randomUUID();e=e||{};const r=e.random||(e.rng||DD)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,ND(r)}function lr(e){var s;const{metadata:t,conversationId:n,userId:r}=e,{payload:i,disableInput:o}=Pg(e.payload);return{id:e.id,conversationId:n,authorId:r,timestamp:new Date(e.createdAt),block:i,feedback:(s=e.feedback)==null?void 0:s.value,disableInput:o,metadata:t}}const Pg=e=>{switch(e.type){case"audio":return Lg(e);case"card":return PD(e);case"carousel":return LD(e);case"choice":return FD(e);case"dropdown":return RD(e);case"file":return Fg(e);case"image":return Rg(e);case"location":return $g(e);case"markdown":return Bg(e);case"text":return zg(e);case"video":return Ug(e);case"bloc":return $D(e);case"custom":return{payload:e};default:{const t=e;throw new Error(`Unsuported message type ${t}`)}}},ci=e=>({block:e,type:"bubble"}),Lg=e=>({payload:{type:"audio",url:e.audioUrl}}),PD=e=>({payload:ci(Hg(e))}),LD=e=>({payload:{type:"carousel",blocks:e.items.map(t=>Hg({...t}))}}),FD=e=>{const t=e.options.map(o=>({title:o.label,value:o.value})),n=e.text,r=_D(),i=ci({type:"text",text:n});return t.length===0?{disableInput:e.disableFreeText,payload:i}:{disableInput:e.disableFreeText,payload:{type:"column",blocks:[i,{type:"row",blocks:t.map(({title:o,value:s})=>({type:"button",variant:"action",text:o,buttonValue:s,groupId:r}))}]}}},RD=e=>{const t=e.options.map(i=>({label:i.label,value:i.value})),n=e.text,r=[{type:"dropdown",label:n??"Select an option",options:t}];return n&&r.unshift({type:"text",text:n}),{disableInput:!0,payload:ci({type:"column",blocks:r})}},Fg=e=>({payload:{type:"file",url:e.fileUrl,title:e.title}}),Rg=e=>({payload:{type:"image",url:e.imageUrl}}),$g=e=>({payload:{type:"location",latitude:e.latitude,longitude:e.longitude,title:e.title??e.address??"View on map"}}),Bg=e=>({payload:ci({type:"text",text:e.markdown})}),zg=e=>({payload:ci({type:"text",text:e.text,value:e.value})}),Ug=e=>({payload:{type:"video",url:e.videoUrl}}),$D=e=>({payload:{type:"column",blocks:e.items.map(n=>{switch(n.type){case"audio":return Lg({...n.payload,type:n.type}).payload;case"file":return Fg({...n.payload,type:n.type}).payload;case"image":return Rg({...n.payload,type:n.type}).payload;case"location":return $g({...n.payload,type:n.type}).payload;case"markdown":return Bg({...n.payload,type:n.type}).payload;case"text":return zg({...n.payload,type:n.type}).payload;case"video":return Ug({...n.payload,type:n.type}).payload;default:throw new Error("Unsuported message type")}})}}),Hg=e=>{const t=e.title,n=e.subtitle,r=e.imageUrl,i=e.actions.map(s=>{switch(s.action){case"postback":return{type:"button",variant:"action",text:s.label,buttonValue:s.value,reusable:!0};case"url":return{type:"button",variant:"link",text:s.label,buttonValue:s.value,reusable:!0};case"say":return{type:"button",variant:"action",text:s.label,buttonValue:s.value,reusable:!0};default:throw new Error(`Unknown action type ${s.action}`)}}),o=[];return r&&o.push({type:"image",url:r}),t&&o.push({type:"text",text:`#### ${t}`}),n&&o.push({type:"text",text:n}),i.length>0&&o.push({type:"row",blocks:i}),{type:"column",horizontalAlignment:"center",blocks:[...o]}};var BD=Object.defineProperty,zD=(e,t,n)=>t in e?BD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,UD=(e,t,n)=>zD(e,t+"",n),HD=async(e,t)=>{let n=typeof t=="function"?await t(e):t;if(n)return e.scheme==="bearer"?`Bearer ${n}`:e.scheme==="basic"?`Basic ${btoa(n)}`:n},jD={bodySerializer:e=>JSON.stringify(e,(t,n)=>typeof n=="bigint"?n.toString():n)},VD=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},WD=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},qD=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},jg=({allowReserved:e,explode:t,name:n,style:r,value:i})=>{if(!t){let a=(e?i:i.map(l=>encodeURIComponent(l))).join(WD(r));switch(r){case"label":return`.${a}`;case"matrix":return`;${n}=${a}`;case"simple":return a;default:return`${n}=${a}`}}let o=VD(r),s=i.map(a=>r==="label"||r==="simple"?e?a:encodeURIComponent(a):_o({allowReserved:e,name:n,value:a})).join(o);return r==="label"||r==="matrix"?o+s:s},_o=({allowReserved:e,name:t,value:n})=>{if(n==null)return"";if(typeof n=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${t}=${e?n:encodeURIComponent(n)}`},Vg=({allowReserved:e,explode:t,name:n,style:r,value:i})=>{if(i instanceof Date)return`${n}=${i.toISOString()}`;if(r!=="deepObject"&&!t){let a=[];Object.entries(i).forEach(([u,f])=>{a=[...a,u,e?f:encodeURIComponent(f)]});let l=a.join(",");switch(r){case"form":return`${n}=${l}`;case"label":return`.${l}`;case"matrix":return`;${n}=${l}`;default:return l}}let o=qD(r),s=Object.entries(i).map(([a,l])=>_o({allowReserved:e,name:r==="deepObject"?`${n}[${a}]`:a,value:l})).join(o);return r==="label"||r==="matrix"?o+s:s},YD=/\{[^{}]+\}/g,KD=({path:e,url:t})=>{let n=t,r=t.match(YD);if(r)for(let i of r){let o=!1,s=i.substring(1,i.length-1),a="simple";s.endsWith("*")&&(o=!0,s=s.substring(0,s.length-1)),s.startsWith(".")?(s=s.substring(1),a="label"):s.startsWith(";")&&(s=s.substring(1),a="matrix");let l=e[s];if(l==null)continue;if(Array.isArray(l)){n=n.replace(i,jg({explode:o,name:s,style:a,value:l}));continue}if(typeof l=="object"){n=n.replace(i,Vg({explode:o,name:s,style:a,value:l}));continue}if(a==="matrix"){n=n.replace(i,`;${_o({name:s,value:l})}`);continue}let u=encodeURIComponent(a==="label"?`.${l}`:l);n=n.replace(i,u)}return n},Wg=({allowReserved:e,array:t,object:n}={})=>r=>{let i=[];if(r&&typeof r=="object")for(let o in r){let s=r[o];if(s!=null){if(Array.isArray(s)){i=[...i,jg({allowReserved:e,explode:!0,name:o,style:"form",value:s,...t})];continue}if(typeof s=="object"){i=[...i,Vg({allowReserved:e,explode:!0,name:o,style:"deepObject",value:s,...n})];continue}i=[...i,_o({allowReserved:e,name:o,value:s})]}}return i.join("&")},GD=e=>{var t;if(!e)return"stream";let n=(t=e.split(";")[0])==null?void 0:t.trim();if(n){if(n.startsWith("application/json")||n.endsWith("+json"))return"json";if(n==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(r=>n.startsWith(r)))return"blob";if(n.startsWith("text/"))return"text"}},QD=async({security:e,...t})=>{for(let n of e){let r=await HD(n,t.auth);if(!r)continue;let i=n.name??"Authorization";switch(n.in){case"query":t.query||(t.query={}),t.query[i]=r;break;case"cookie":t.headers.append("Cookie",`${i}=${r}`);break;case"header":default:t.headers.set(i,r);break}return}},qg=e=>ZD({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:Wg(e.querySerializer),url:e.url}),ZD=({baseUrl:e,path:t,query:n,querySerializer:r,url:i})=>{let o=i.startsWith("/")?i:`/${i}`,s=(e??"")+o;t&&(s=KD({path:t,url:s}));let a=n?r(n):"";return a.startsWith("?")&&(a=a.substring(1)),a&&(s+=`?${a}`),s},Yg=(e,t)=>{var n;let r={...e,...t};return(n=r.baseUrl)!=null&&n.endsWith("/")&&(r.baseUrl=r.baseUrl.substring(0,r.baseUrl.length-1)),r.headers=Kg(e.headers,t.headers),r},Kg=(...e)=>{let t=new Headers;for(let n of e){if(!n||typeof n!="object")continue;let r=n instanceof Headers?n.entries():Object.entries(n);for(let[i,o]of r)if(o===null)t.delete(i);else if(Array.isArray(o))for(let s of o)t.append(i,s);else o!==void 0&&t.set(i,typeof o=="object"?JSON.stringify(o):o)}return t},zl=class{constructor(){UD(this,"_fns"),this._fns=[]}clear(){this._fns=[]}exists(t){return this._fns.indexOf(t)!==-1}eject(t){let n=this._fns.indexOf(t);n!==-1&&(this._fns=[...this._fns.slice(0,n),...this._fns.slice(n+1)])}use(t){this._fns=[...this._fns,t]}},JD=()=>({error:new zl,request:new zl,response:new zl}),XD=Wg({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),eN={"Content-Type":"application/json"},Gg=(e={})=>({...jD,headers:eN,parseAs:"auto",querySerializer:XD,...e}),tN=(e={})=>{let t=Yg(Gg(),e),n=()=>({...t}),r=s=>(t=Yg(t,s),n()),i=JD(),o=async s=>{let a={...t,...s,fetch:s.fetch??t.fetch??globalThis.fetch,headers:Kg(t.headers,s.headers)};a.security&&await QD({...a,security:a.security}),a.body&&a.bodySerializer&&(a.body=a.bodySerializer(a.body)),(a.body===void 0||a.body==="")&&a.headers.delete("Content-Type");let l=qg(a),u={redirect:"follow",...a},f=new Request(l,u);for(let g of i.request._fns)f=await g(f,a);let c=a.fetch,h=await c(f);for(let g of i.response._fns)h=await g(h,f,a);let d={request:f,response:h};if(h.ok){if(h.status===204||h.headers.get("Content-Length")==="0")return{data:{},...d};let g=(a.parseAs==="auto"?GD(h.headers.get("Content-Type")):a.parseAs)??"json";if(g==="stream")return{data:h.body,...d};let v=await h[g]();return g==="json"&&(a.responseValidator&&await a.responseValidator(v),a.responseTransformer&&(v=await a.responseTransformer(v))),{data:v,...d}}let m=await h.text();try{m=JSON.parse(m)}catch{}let p=m;for(let g of i.error._fns)p=await g(m,h,f,a);if(p=p||{},a.throwOnError)throw p;return{error:p,...d}};return{buildUrl:qg,connect:s=>o({...s,method:"CONNECT"}),delete:s=>o({...s,method:"DELETE"}),get:s=>o({...s,method:"GET"}),getConfig:n,head:s=>o({...s,method:"HEAD"}),interceptors:i,options:s=>o({...s,method:"OPTIONS"}),patch:s=>o({...s,method:"PATCH"}),post:s=>o({...s,method:"POST"}),put:s=>o({...s,method:"PUT"}),request:o,setConfig:r,trace:s=>o({...s,method:"TRACE"})}},nN=tN,rN=Gg;const Pe=nN((e=>({...e,withCredentials:!0,timeout:6e4,maxBodyLength:104857600,maxContentLength:104857600,throwOnError:!0,parseAs:"json"}))(rN({baseUrl:"https://webchat.botpress.cloud/"}))),iN=e=>(e.client??Pe).delete({url:"/conversations/{id}",...e}),oN=e=>(e.client??Pe).get({url:"/conversations/{id}",...e}),sN=e=>(e.client??Pe).get({url:"/conversations",...e}),aN=e=>(e.client??Pe).post({url:"/conversations",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),lN=e=>(e.client??Pe).get({url:"/conversations/{id}/messages",...e}),uN=e=>(e.client??Pe).get({url:"/conversations/{id}/participants",...e}),cN=e=>(e.client??Pe).post({url:"/conversations/{id}/participants",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),fN=e=>(e.client??Pe).delete({url:"/conversations/{id}/participants/{userId}",...e}),dN=e=>(e.client??Pe).get({url:"/conversations/{id}/participants/{userId}",...e}),hN=e=>(e.client??Pe).delete({url:"/messages/{id}",...e}),pN=e=>(e.client??Pe).get({url:"/messages/{id}",...e}),mN=e=>(e.client??Pe).put({url:"/messages/{id}",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),gN=e=>(e.client??Pe).post({url:"/messages",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),yN=e=>(e.client??Pe).delete({url:"/messages/{id}/feedback",...e}),vN=e=>(e.client??Pe).put({url:"/messages/{id}/feedback",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),bN=e=>(e.client??Pe).delete({url:"/users/me",...e}),wN=e=>(e.client??Pe).get({url:"/users/me",...e}),SN=e=>(e.client??Pe).put({url:"/users/me",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),xN=e=>((e==null?void 0:e.client)??Pe).post({url:"/users/key",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),kN=e=>(e.client??Pe).get({url:"/events/{id}",...e}),EN=e=>(e.client??Pe).post({url:"/events",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),CN=e=>(e.client??Pe).post({url:"/files",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}});let Qg=class extends Error{constructor(t,n){super(t),this.name="ParseError",this.type=n.type,this.field=n.field,this.value=n.value,this.line=n.line}};function Ul(e){}function AN(e){if(typeof e=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:t=Ul,onError:n=Ul,onRetry:r=Ul,onComment:i}=e;let o="",s=!0,a,l="",u="";function f(p){const g=s?p.replace(/^\xEF\xBB\xBF/,""):p,[v,y]=TN(`${o}${g}`);for(const w of v)c(w);o=y,s=!1}function c(p){if(p===""){d();return}if(p.startsWith(":")){i&&i(p.slice(p.startsWith(": ")?2:1));return}const g=p.indexOf(":");if(g!==-1){const v=p.slice(0,g),y=p[g+1]===" "?2:1,w=p.slice(g+y);h(v,w,p);return}h(p,"",p)}function h(p,g,v){switch(p){case"event":u=g;break;case"data":l=`${l}${g}
320
+ `;break;case"id":a=g.includes("\0")?void 0:g;break;case"retry":/^\d+$/.test(g)?r(parseInt(g,10)):n(new Qg(`Invalid \`retry\` value: "${g}"`,{type:"invalid-retry",value:g,line:v}));break;default:n(new Qg(`Unknown field "${p.length>20?`${p.slice(0,20)}…`:p}"`,{type:"unknown-field",field:p,value:g,line:v}));break}}function d(){l.length>0&&t({id:a,event:u||void 0,data:l.endsWith(`
321
+ `)?l.slice(0,-1):l}),a=void 0,l="",u=""}function m(p={}){o&&p.consume&&c(o),s=!0,a=void 0,l="",u="",o=""}return{feed:f,reset:m}}function TN(e){const t=[];let n="",r=0;for(;r<e.length;){const i=e.indexOf("\r",r),o=e.indexOf(`
322
322
  `,r);let s=-1;if(i!==-1&&o!==-1?s=Math.min(i,o):i!==-1?i===e.length-1?s=-1:s=i:o!==-1&&(s=o),s===-1){n=e.slice(r);break}else{const a=e.slice(r,s);t.push(a),r=s+1,e[r-1]==="\r"&&e[r]===`
323
- `&&r++}}return[t,n]}class ty extends Event{constructor(t,n){var r,i;super(t),this.code=(r=n==null?void 0:n.code)!=null?r:void 0,this.message=(i=n==null?void 0:n.message)!=null?i:void 0}[Symbol.for("nodejs.util.inspect.custom")](t,n,r){return r(ny(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(ny(this),n)}}function $N(e){const t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function Vl(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(Vl).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${Vl(e.cause)}`:e.message:`${e}`}function ny(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var ry=e=>{throw TypeError(e)},Wl=(e,t,n)=>t.has(e)||ry("Cannot "+n),be=(e,t,n)=>(Wl(e,t,"read from private field"),n?n.call(e):t.get(e)),Ke=(e,t,n)=>t.has(e)?ry("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Le=(e,t,n,r)=>(Wl(e,t,"write to private field"),t.set(e,n),n),Qt=(e,t,n)=>(Wl(e,t,"access private method"),n),dt,_n,lr,Po,Lo,fi,ur,di,pn,cr,fr,dr,hi,Lt,ql,Yl,Kl,iy,Gl,Ql,pi,Zl,Jl;class Fo extends EventTarget{constructor(t,n){var r,i;super(),Ke(this,Lt),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,Ke(this,dt),Ke(this,_n),Ke(this,lr),Ke(this,Po),Ke(this,Lo),Ke(this,fi),Ke(this,ur),Ke(this,di,null),Ke(this,pn),Ke(this,cr),Ke(this,fr,null),Ke(this,dr,null),Ke(this,hi,null),Ke(this,Yl,async o=>{var s;be(this,cr).reset();const{body:a,redirected:l,status:u,headers:f}=o;if(u===204){Qt(this,Lt,pi).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(l?Le(this,lr,new URL(o.url)):Le(this,lr,void 0),u!==200){Qt(this,Lt,pi).call(this,`Non-200 status code (${u})`,u);return}if(!(f.get("content-type")||"").startsWith("text/event-stream")){Qt(this,Lt,pi).call(this,'Invalid content type, expected "text/event-stream"',u);return}if(be(this,dt)===this.CLOSED)return;Le(this,dt,this.OPEN);const c=new Event("open");if((s=be(this,hi))==null||s.call(this,c),this.dispatchEvent(c),typeof a!="object"||!a||!("getReader"in a)){Qt(this,Lt,pi).call(this,"Invalid response body, expected a web ReadableStream",u),this.close();return}const h=new TextDecoder,d=a.getReader();let m=!0;do{const{done:p,value:g}=await d.read();g&&be(this,cr).feed(h.decode(g,{stream:!p})),p&&(m=!1,be(this,cr).reset(),Qt(this,Lt,Zl).call(this))}while(m)}),Ke(this,Kl,o=>{Le(this,pn,void 0),!(o.name==="AbortError"||o.type==="aborted")&&Qt(this,Lt,Zl).call(this,Vl(o))}),Ke(this,Gl,o=>{typeof o.id=="string"&&Le(this,di,o.id);const s=new MessageEvent(o.event||"message",{data:o.data,origin:be(this,lr)?be(this,lr).origin:be(this,_n).origin,lastEventId:o.id||""});be(this,dr)&&(!o.event||o.event==="message")&&be(this,dr).call(this,s),this.dispatchEvent(s)}),Ke(this,Ql,o=>{Le(this,fi,o)}),Ke(this,Jl,()=>{Le(this,ur,void 0),be(this,dt)===this.CONNECTING&&Qt(this,Lt,ql).call(this)});try{if(t instanceof URL)Le(this,_n,t);else if(typeof t=="string")Le(this,_n,new URL(t,BN()));else throw new Error("Invalid URL")}catch{throw $N("An invalid or illegal string was specified")}Le(this,cr,FN({onEvent:be(this,Gl),onRetry:be(this,Ql)})),Le(this,dt,this.CONNECTING),Le(this,fi,3e3),Le(this,Lo,(r=n==null?void 0:n.fetch)!=null?r:globalThis.fetch),Le(this,Po,(i=n==null?void 0:n.withCredentials)!=null?i:!1),Qt(this,Lt,ql).call(this)}get readyState(){return be(this,dt)}get url(){return be(this,_n).href}get withCredentials(){return be(this,Po)}get onerror(){return be(this,fr)}set onerror(t){Le(this,fr,t)}get onmessage(){return be(this,dr)}set onmessage(t){Le(this,dr,t)}get onopen(){return be(this,hi)}set onopen(t){Le(this,hi,t)}addEventListener(t,n,r){const i=n;super.addEventListener(t,i,r)}removeEventListener(t,n,r){const i=n;super.removeEventListener(t,i,r)}close(){be(this,ur)&&clearTimeout(be(this,ur)),be(this,dt)!==this.CLOSED&&(be(this,pn)&&be(this,pn).abort(),Le(this,dt,this.CLOSED),Le(this,pn,void 0))}}dt=new WeakMap,_n=new WeakMap,lr=new WeakMap,Po=new WeakMap,Lo=new WeakMap,fi=new WeakMap,ur=new WeakMap,di=new WeakMap,pn=new WeakMap,cr=new WeakMap,fr=new WeakMap,dr=new WeakMap,hi=new WeakMap,Lt=new WeakSet,ql=function(){Le(this,dt,this.CONNECTING),Le(this,pn,new AbortController),be(this,Lo)(be(this,_n),Qt(this,Lt,iy).call(this)).then(be(this,Yl)).catch(be(this,Kl))},Yl=new WeakMap,Kl=new WeakMap,iy=function(){var e;const t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...be(this,di)?{"Last-Event-ID":be(this,di)}:void 0},cache:"no-store",signal:(e=be(this,pn))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},Gl=new WeakMap,Ql=new WeakMap,pi=function(e,t){var n;be(this,dt)!==this.CLOSED&&Le(this,dt,this.CLOSED);const r=new ty("error",{code:t,message:e});(n=be(this,fr))==null||n.call(this,r),this.dispatchEvent(r)},Zl=function(e,t){var n;if(be(this,dt)===this.CLOSED)return;Le(this,dt,this.CONNECTING);const r=new ty("error",{code:t,message:e});(n=be(this,fr))==null||n.call(this,r),this.dispatchEvent(r),Le(this,ur,setTimeout(be(this,Jl),be(this,fi)))},Jl=new WeakMap,Fo.CONNECTING=0,Fo.OPEN=1,Fo.CLOSED=2;function BN(){const e="document"in globalThis?globalThis.document:void 0;return e&&typeof e=="object"&&"baseURI"in e&&typeof e.baseURI=="string"?e.baseURI:void 0}async function zN(e){var t;const n=await e.clone().json();if((t=n==null?void 0:n.id)!=null&&t.startsWith("err_")){const r=new Error(n.message);throw r.id=n.id,r.code=n.code,r.type=n.type,r}return e}const oy=()=>{const e={};return{on:(t,n)=>{var r;return e[t]||(e[t]=new Set),(r=e[t])==null||r.add(n),()=>{var i;return(i=e[t])==null?void 0:i.delete(n)}},emit:(t,n)=>{var r,i;(r=e[t])==null||r.forEach(o=>o(n)),(i=e["*"])==null||i.forEach(o=>o({type:t,payload:n}))}}},Ue=e=>e.data,sy=10,ay=3e3,UN="60000",jN={throwOnError:!0},HN=({conversationId:e,userToken:t,clientId:n,apiUrl:r,adminSecret:i})=>{let o=0,s=null;const a=oy(),l=()=>{s&&s.close();const u=`${`${r||Pe.getConfig().baseUrl}/${n}`}/initialize${e?`?conversationId=${e}`:""}`,f={...i?{"x-admin-secret":i}:{},...t?{"x-user-key":t}:{}};s=uy(u,f),s.addEventListener("open",()=>a.emit("open")),s.addEventListener("error",c=>{o<sy?(o++,setTimeout(()=>l(),ay)):a.emit("error",c)}),s.addEventListener("message",c=>{const h=ly(c.data);a.emit(h.type,h.data)})};return l(),a.on},VN=({userKey:e,clientId:t,apiUrl:n,customHeaders:r,advancedOptions:i})=>{const o={"x-user-key":e,...r},s=`${n||Pe.getConfig().baseUrl}/${t}`,a={...jN,baseUrl:s};return Pe.interceptors.response._fns.length===0&&Pe.interceptors.response.use(zN),{createConversation:()=>yN({...a,headers:o,body:{}}).then(Ue),getConversation:({conversationId:l})=>mN({...a,headers:o,path:{id:l}}).then(Ue),deleteConversation:({conversationId:l})=>pN({...a,headers:o,path:{id:l}}).then(Ue),listConversations:({nextToken:l})=>gN({...a,headers:o,query:{nextToken:l}}).then(Ue),listConversationMessages:({conversationId:l,nextToken:u})=>vN({...a,headers:o,path:{id:l},query:{nextToken:u}}).then(Ue),addParticipant:({conversationId:l,userId:u})=>wN({...a,headers:o,path:{id:l},body:{userId:u}}).then(Ue),removeParticipant:({conversationId:l,userId:u})=>SN({...a,headers:o,path:{id:l,userId:u}}).then(Ue),getParticipant:({conversationId:l,userId:u})=>xN({...a,headers:o,path:{id:l,userId:u}}).then(Ue),listParticipants:({conversationId:l,nextToken:u})=>bN({...a,headers:o,path:{id:l},query:{nextToken:u}}).then(Ue),createMessage:l=>AN({...a,headers:o,body:l}).then(Ue),updateMessage:({messageId:l,...u})=>CN({...a,headers:o,path:{id:l},body:u}).then(Ue),getMessage:({messageId:l})=>EN({...a,headers:o,path:{id:l}}).then(Ue),deleteMessage:({messageId:l})=>kN({...a,headers:o,path:{id:l}}).then(Ue),createFile:l=>LN({...a,headers:o,body:l}).then(Ue),getUser:()=>MN({...a,headers:o}).then(Ue),updateUser:l=>DN({...a,headers:o,body:l}).then(Ue),deleteUser:()=>ON({...a,headers:o}).then(Ue),createEvent:l=>PN({...a,headers:o,body:l}).then(Ue),getEvent:({eventId:l})=>_N({...a,headers:o,path:{id:l}}).then(Ue),addMessageFeedback:({messageId:l,...u})=>IN({...a,headers:o,path:{id:l},body:u}).then(Ue),removeMessageFeedback:({messageId:l})=>TN({...a,headers:o,path:{id:l}}).then(Ue),generateUserKey:({adminSecret:l,...u})=>NN({...a,headers:{"x-admin-secret":l},body:u}).then(Ue),listenConversation:({conversationId:l})=>{let u=0,f=null;const c=oy(),h=()=>{f&&f.close();const d=`${s}/conversations/${l}/listen`,m=i==null?void 0:i.eventSource;f=m?m({url:d,headers:o}):uy(d,o),f.addEventListener("open",()=>c.emit("open")),f.addEventListener("error",p=>{u<sy?(u++,setTimeout(()=>h(),ay)):c.emit("error",p)}),f.addEventListener("message",p=>{const g=ly(p.data);c.emit(g.type,g.data)})};return h(),c.on}}},ly=e=>{try{return JSON.parse(e)}catch{return e}},uy=(e,t)=>new Fo(e,{fetch:(n,r)=>fetch(n,{...r,headers:{...r==null?void 0:r.headers,...t,timeout:UN}})}),WN=async({apiUrl:e,clientId:t,adminSecret:n,clientHeaders:r,emitter:i,conversationId:o,userToken:s})=>new Promise(a=>{const l=HN({apiUrl:e,clientId:t,userToken:s,conversationId:o,adminSecret:n}),u=l("init",({conversation:f,messages:c,participants:h,user:d})=>{const m=VN({clientId:t,apiUrl:e,userKey:d.userKey,customHeaders:r});m.createEvent({conversationId:f.id,payload:{type:"conversation_started",data:{}}}).then(({event:p})=>{var g,y;(y=(g=p.payload.data)==null?void 0:g.status)!=null&&y.isInitial&&i.emit("conversation",f.id)}),a({on:l,conversation:f,messages:c,participants:h,user:d,client:m,onCleanup:()=>{u()}})})}),qN={webchat:"#9C27B0",client:"#2196F3",store:"#4CAF50",events:"#00BCD4"},YN={debug:"#9E9E9E",info:"#2196F3",warn:"#FF9800",error:"#F44336"};let cy=!1,Xl=null,fy=Date.now();const KN=e=>{cy=e,fy=Date.now()},GN=e=>{Xl=e},QN=()=>{const e=Date.now()-fy,t=Math.floor(e/1e3),n=e%1e3;return`+${t}.${n.toString().padStart(3,"0")}s`},ZN=e=>e===void 0?"undefined":e===null?"null":e instanceof Error?{error:e.message,stack:e.stack}:e,Ro=e=>{const t=qN[e]||"#666",n=(r,...i)=>{if(!cy&&r!=="warn"&&r!=="error")return;const o=QN(),s=`%c[bp:${e}]%c ${o} %c${r.toUpperCase()}%c`,a=[`color: ${t}; font-weight: bold;`,"color: #999; font-size: 10px;",`color: ${YN[r]}; font-weight: bold;`,"color: inherit;"],l=i.map(ZN);if(console[r](s,...a,...l),Xl){const[u,f]=i;Xl(`debug:${e}:${r}`,{message:typeof u=="string"?u:void 0,...typeof f=="object"&&f!==null?f:{}})}};return{debug:(...r)=>n("debug",...r),info:(...r)=>n("info",...r),warn:(...r)=>n("warn",...r),error:(...r)=>n("error",...r)}},dy={webchat:Ro("webchat"),client:Ro("client"),store:Ro("store"),events:Ro("events")};function hy(){const[e,t]=D.useState(!1),n=D.useRef(null);return{state:e,setState:(r,i)=>{if(t(r),!r)return()=>{};if(n.current=new Date,!i)return()=>{};const o=setTimeout(()=>{const s=n.current;s&&new Date().getTime()-s.getTime()>i&&t(!1)},i+100);return()=>clearTimeout(o)}}}const mi=dy.webchat;function py({apiUrl:e="https://webchat.botpress.cloud",clientId:t,storageKey:n,storageLocation:r,adminSecret:i,clientHeaders:o,playNotificationSound:s,...a}){const l=Cp(n,r),u=l(O=>O.conversationId),f=l(O=>O.user),c=l(O=>O.setConversationId),h=l(O=>O.setUser),{state:d,setState:m}=hy(),{state:p,setState:g}=hy(),y=D.useMemo(()=>sc(),[]),[v,w]=D.useState("connecting"),[E,S]=D.useState(void 0),[C,I]=D.useState(void 0),M=D.useRef(null),P=e1(a.conversationId,a.userToken,u,f==null?void 0:f.userToken);D.useEffect(()=>{let O=!1;mi.info("starting initialization",{clientId:t,apiUrl:e,storageKey:n});const U=async()=>{var L;await T(P),O&&(mi.debug("initialization completed but effect was cleaned up, tearing down"),(L=M.current)==null||L.call(M),M.current=null)},F=Jw(t,e);if(F){mi.error("configuration error",F),I(F),w("error");return}return U(),()=>{O=!0,M.current&&(M.current(),M.current=null)}},[a.conversationId,a.userToken,t,e]);const T=async({conversationId:O,userToken:U})=>{var V;(V=M.current)==null||V.call(M),I(void 0),m(!1),g(!1),w("connecting");const{on:F,conversation:L,messages:R,participants:N,user:j,client:B,onCleanup:W}=await WN({apiUrl:e,clientId:t,clientHeaders:o,emitter:y,adminSecret:i,conversationId:O,userToken:U});S(B),c(L.id),h({userId:j.id,userToken:j.userKey});const b=Ep(L.id),_=R.reverse().map(ui).filter(Boolean);b.getState().setMessages(_);const H=Tp(L.id);H.getState().setParticipants(N);const x=[W,F("open",()=>{I(void 0),w("connected")}),F("error",Y=>{mi.error("connection error",{error:Y,conversationId:L.id}),I(q=>q||_r(Y)),w("error"),y.emit("error",new Error(`Connection to conversation lost: ${Y==null?void 0:Y.message}`))}),F("message_created",Y=>{const q=ui(Y);b.getState().saveMessage(q),j.id!==q.authorId&&(s==null||s(),m(!1),g(!1),y.emit("isTyping",{isTyping:!1,timeout:0})),y.emit("message",q)}),F("message_status_changed",Y=>{var q;Y.newStatus==="processing"&&b.getState().updateMessage((q=Y.message.metadata)==null?void 0:q.clientMessageId,{status:Y.newStatus})}),F("typing_stopped",()=>{m(!1),g(!1)}),F("typing_started",()=>{m(!0,5e3),g(!0,5e3),y.emit("isTyping",{isTyping:!0,timeout:5e3})}),F("participant_added",Y=>{H.getState().addParticipant(Y.participant),y.emit("participantAdded",Y.participant)}),F("participant_removed",Y=>{H.getState().removeParticipant(Y.participantId),y.emit("participantRemoved",Y.participantId)}),F("webchat_visibility",Y=>y.emit("webchatVisibility",Y.visibility)),F("webchat_config",Y=>y.emit("webchatConfig",Y.config)),F("custom",Y=>y.emit("customEvent",Y.event))];w("connected"),mi.info("client fully connected with event handlers ready",{conversationId:L.id}),M.current=()=>{x.forEach(Y=>Y())}};return{clientState:v,httpClient:E,error:C,activeConversationId:u,userCredentials:f,isTyping:d,isAwaitingResponse:p,openConversation:T,setAwaitingResponse:g,emitter:y,setError:I,setClientState:w}}const my=D.createContext(null);function $o(){const e=D.useContext(my);if(!e)throw new Error("useWebchatContext must be used inside <WebchatProvider>");return e}function gy({clientId:e,apiUrl:t,storageKey:n,storageLocation:r,adminSecret:i,clientHeaders:o,children:s,...a}){var S;const{clientState:l,httpClient:u,error:f,activeConversationId:c,userCredentials:h,isTyping:d,isAwaitingResponse:m,openConversation:p,setClientState:g,setError:y,setAwaitingResponse:v,emitter:w}=py({apiUrl:t,clientId:e,storageKey:n,storageLocation:r,adminSecret:i,clientHeaders:o,conversationId:a.conversationId,userToken:(S=a.userCredentials)==null?void 0:S.userToken}),E={client:u,clientState:l,setClientState:g,conversationId:c,userCredentials:h,error:f,setError:y,isTyping:d,isAwaitingResponse:m,openConversation:p,setAwaitingResponse:v,emitter:w};return k.jsx(my.Provider,{value:E,children:s})}const eu=({children:e,className:t,uploadFile:n,allowFileUpload:r,storageKey:i,conversationId:o,...s})=>{const{container:a}=me,l=Qn(g=>g.setMessageContainerRef),f=Ap(o||"default",i)(g=>g.uploadFile),[c,h]=D.useState(0),d=D.useRef(null);D.useEffect(()=>{l(d)},[d,l]);const m=D.useCallback(g=>{n&&(g.forEach(y=>f(y,n)),h(0))},[f,n]),{getRootProps:p}=_g({noClick:!0,noKeyboard:!0,onDrop:m,disabled:!(r&&n),onDragEnter:()=>h(g=>g+1),onDragLeave:()=>h(g=>g-1)});return k.jsxs("div",{...s,className:ar(a.className,t),...p(),ref:d,children:[k.jsxs("div",{"data-hover":c>0,...a.dropzone.overlay,children:["Drop files to upload",k.jsx(HA,{style:{width:"50px"}})]}),k.jsx(Lg,{children:e})]})};eu.displayName="Container";const yy=D.forwardRef(({onClick:e,imgUrl:t,...n},r)=>{const{fab:i}=me,{container:o,icon:s,image:a}=i??{};return t?k.jsx("img",{src:t,role:"button",tabIndex:0,...a,draggable:"false",onClick:e}):k.jsx("div",{...n,...o,ref:r,onClick:e,children:k.jsx("div",{...s})})});yy.displayName="Fab";function Zt(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function JN(e,t){const n=A.createContext(t),r=o=>{const{children:s,...a}=o,l=A.useMemo(()=>a,Object.values(a));return k.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function i(o){const s=A.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function vy(e,t=[]){let n=[];function r(o,s){const a=A.createContext(s),l=n.length;n=[...n,s];const u=c=>{var y;const{scope:h,children:d,...m}=c,p=((y=h==null?void 0:h[e])==null?void 0:y[l])||a,g=A.useMemo(()=>m,Object.values(m));return k.jsx(p.Provider,{value:g,children:d})};u.displayName=o+"Provider";function f(c,h){var p;const d=((p=h==null?void 0:h[e])==null?void 0:p[l])||a,m=A.useContext(d);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${c}\` must be used within \`${o}\``)}return[u,f]}const i=()=>{const o=n.map(s=>A.createContext(s));return function(a){const l=(a==null?void 0:a[e])||o;return A.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,XN(i,...t)]}function XN(...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(o){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const c=l(o)[`__scope${u}`];return{...a,...c}},{});return A.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var e2=A[" useInsertionEffect ".trim().toString()]||en;function by({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,s]=t2({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:i;{const f=A.useRef(e!==void 0);A.useEffect(()=>{const c=f.current;c!==a&&console.warn(`${r} is changing from ${c?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=a},[a,r])}const u=A.useCallback(f=>{var c;if(a){const h=n2(f)?f(e):f;h!==e&&((c=s.current)==null||c.call(s,h))}else o(f)},[a,e,o,s]);return[l,u]}function t2({defaultProp:e,onChange:t}){const[n,r]=A.useState(e),i=A.useRef(n),o=A.useRef(t);return e2(()=>{o.current=t},[t]),A.useEffect(()=>{var s;i.current!==n&&((s=o.current)==null||s.call(o,n),i.current=n)},[n,i]),[n,r,o]}function n2(e){return typeof e=="function"}function wy(e){const t=r2(e),n=A.forwardRef((r,i)=>{const{children:o,...s}=r,a=A.Children.toArray(o),l=a.find(o2);if(l){const u=l.props.children,f=a.map(c=>c===l?A.Children.count(u)>1?A.Children.only(null):A.isValidElement(u)?u.props.children:null:c);return k.jsx(t,{...s,ref:i,children:A.isValidElement(u)?A.cloneElement(u,void 0,f):null})}return k.jsx(t,{...s,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function r2(e){const t=A.forwardRef((n,r)=>{const{children:i,...o}=n;if(A.isValidElement(i)){const s=a2(i),a=s2(o,i.props);return i.type!==A.Fragment&&(a.ref=r?is(r,s):s),A.cloneElement(i,a)}return A.Children.count(i)>1?A.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var i2=Symbol("radix.slottable");function o2(e){return A.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===i2}function s2(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{const l=o(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function a2(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var l2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ft=l2.reduce((e,t)=>{const n=wy(`Primitive.${t}`),r=A.forwardRef((i,o)=>{const{asChild:s,...a}=i,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),k.jsx(l,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function u2(e,t){e&&ju.flushSync(()=>e.dispatchEvent(t))}function c2(e,t){return A.useReducer((n,r)=>t[n][r]??n,e)}var Bo=e=>{const{present:t,children:n}=e,r=f2(t),i=typeof n=="function"?n({present:r.isPresent}):A.Children.only(n),o=tn(r.ref,d2(i));return typeof n=="function"||r.isPresent?A.cloneElement(i,{ref:o}):null};Bo.displayName="Presence";function f2(e){const[t,n]=A.useState(),r=A.useRef(null),i=A.useRef(e),o=A.useRef("none"),s=e?"mounted":"unmounted",[a,l]=c2(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return A.useEffect(()=>{const u=zo(r.current);o.current=a==="mounted"?u:"none"},[a]),en(()=>{const u=r.current,f=i.current;if(f!==e){const h=o.current,d=zo(u);e?l("MOUNT"):d==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(f&&h!==d?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),en(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,c=d=>{const p=zo(r.current).includes(CSS.escape(d.animationName));if(d.target===t&&p&&(l("ANIMATION_END"),!i.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},h=d=>{d.target===t&&(o.current=zo(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:A.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function zo(e){return(e==null?void 0:e.animationName)||"none"}function d2(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var h2=A[" useId ".trim().toString()]||(()=>{}),p2=0;function Uo(e){const[t,n]=A.useState(h2());return en(()=>{n(r=>r??String(p2++))},[e]),e||(t?`radix-${t}`:"")}var jo="Collapsible",[m2]=vy(jo),[g2,tu]=m2(jo),Sy=A.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:s,...a}=e,[l,u]=by({prop:r,defaultProp:i??!1,onChange:s,caller:jo});return k.jsx(g2,{scope:n,disabled:o,contentId:Uo(),open:l,onOpenToggle:A.useCallback(()=>u(f=>!f),[u]),children:k.jsx(Ft.div,{"data-state":ru(l),"data-disabled":o?"":void 0,...a,ref:t})})});Sy.displayName=jo;var xy="CollapsibleTrigger",ky=A.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=tu(xy,n);return k.jsx(Ft.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":ru(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:Zt(e.onClick,i.onOpenToggle)})});ky.displayName=xy;var nu="CollapsibleContent",Ey=A.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=tu(nu,e.__scopeCollapsible);return k.jsx(Bo,{present:n||i.open,children:({present:o})=>k.jsx(y2,{...r,ref:t,present:o})})});Ey.displayName=nu;var y2=A.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=e,s=tu(nu,n),[a,l]=A.useState(r),u=A.useRef(null),f=tn(t,u),c=A.useRef(0),h=c.current,d=A.useRef(0),m=d.current,p=s.open||a,g=A.useRef(p),y=A.useRef(void 0);return A.useEffect(()=>{const v=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(v)},[]),en(()=>{const v=u.current;if(v){y.current=y.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const w=v.getBoundingClientRect();c.current=w.height,d.current=w.width,g.current||(v.style.transitionDuration=y.current.transitionDuration,v.style.animationName=y.current.animationName),l(r)}},[s.open,r]),k.jsx(Ft.div,{"data-state":ru(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!p,...o,ref:f,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:p&&i})});function ru(e){return e?"open":"closed"}var v2=Sy,b2=Ey;const iu=({restartConversation:e,...t})=>{var o,s;const{header:n}=me,{showInputModal:r}=Ka(),i=async a=>{a.stopPropagation(),r?r({title:"Create New Conversation",description:"This will clear the current conversation and start a new one.",confirmButtonText:"New conversation",cancelButtonText:"Cancel"}).then(()=>e()):e()};return k.jsx(rT,{...t,...(s=(o=n==null?void 0:n.content)==null?void 0:o.actions)==null?void 0:s.icons,"aria-label":"Restart Conversation Button",tabIndex:0,role:"button",onClick:i})},ou=({onClick:e,...t})=>{const{header:n}=me,r=i=>{i.stopPropagation(),e==null||e()};return k.jsx(hp,{...t,...n.content.actions.icons,role:"button",tabIndex:0,"aria-label":"Close Chatbot Button",onClick:r,onKeyDown:i=>{i.key==="Enter"&&r(i)}})},w2=({onClick:e,...t})=>{const{header:n}=me,r=i=>{i.stopPropagation(),e==null||e()};return k.jsx(ap,{...t,...n.content.actions.icons,role:"button",tabIndex:0,"aria-label":"Show Recent Conversations Button",onClick:r,onKeyDown:i=>{i.key==="Enter"&&r(i)}})},gi=({icon:e,title:t,link:n,...r})=>{var s,a,l,u,f,c,h,d,m,p,g,y;const{header:i}=me,o=e??VA;return t?n?k.jsxs("a",{...r,...(a=(s=i.expandedContent)==null?void 0:s.descriptionItems)==null?void 0:a.container,href:n,target:"_blank",rel:"noreferrer noopener",children:[k.jsx(o,{...(u=(l=i.expandedContent)==null?void 0:l.descriptionItems)==null?void 0:u.icon}),k.jsx("p",{...(c=(f=i.expandedContent)==null?void 0:f.descriptionItems)==null?void 0:c.link,children:t})]}):k.jsxs("div",{...r,...(d=(h=i.expandedContent)==null?void 0:h.descriptionItems)==null?void 0:d.container,children:[k.jsx(o,{...(p=(m=i.expandedContent)==null?void 0:m.descriptionItems)==null?void 0:p.icon}),k.jsx("p",{...(y=(g=i.expandedContent)==null?void 0:g.descriptionItems)==null?void 0:y.text,children:t})]}):null},S2=({soundOn:e,toggleSound:t})=>{const n=o=>{o.stopPropagation(),t==null||t()},{header:r}=me,i=e?dp:cT;return k.jsx("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),n(o))},title:e?"Disable chat sounds":"Enable chat sounds",...r.content.actions.icons,children:k.jsx(i,{size:16})})},Cy=({defaultOpen:e,closeWindow:t,configuration:n,restartConversation:r,showConversationHistory:i,disabled:o,soundOn:s,toggleSound:a,clientId:l,...u})=>{var p,g,y,v,w,E,S,C,I,M,P,T,O,U,F,L,R,N,j,B,W,b,_,H;const{header:f}=me,[c,h]=D.useState(e),d=!!((p=n.email)!=null&&p.title)||!!((g=n.phone)!=null&&g.title)||!!((y=n.website)!=null&&y.title)||!!((v=n.termsOfService)!=null&&v.link)||!!((w=n.privacyPolicy)!=null&&w.link),m=d&&!o;return k.jsxs(v2,{open:m?c:!1,onOpenChange:m?h:void 0,"data-disabled":m?void 0:"",...f.container,...u,children:[k.jsxs(ky,{"aria-label":"Expand Header Button",...f.content.container,children:[k.jsx("div",{...f.content.conversationHistory,children:i&&!c&&k.jsx(w2,{onClick:i})}),k.jsx(En,{userId:l,src:n.botAvatar,...f.content.avatar,children:n.botName||"Bot"}),k.jsx("h2",{...f.content.title,children:n.botName||"Bot"}),n.botDescription&&k.jsx("p",{...f.content.description,children:n.botDescription}),k.jsxs("div",{...f.content.actions.container,children:[n.soundEnabled&&s!==void 0&&a&&k.jsx(S2,{soundOn:s,toggleSound:a}),r&&k.jsx(iu,{restartConversation:r}),t&&k.jsx(ou,{onClick:t})]})]}),d&&k.jsxs(b2,{...f.expandedContent.container,children:[k.jsxs("div",{"data-links":"",...f.expandedContent.group,children:[k.jsx(gi,{"data-email":"",icon:ZA,title:(E=n.email)==null?void 0:E.title,link:(C=(S=n.email)==null?void 0:S.link)!=null&&C.startsWith("mailto:")?(I=n.email)==null?void 0:I.link:`mailto:${(M=n.email)==null?void 0:M.link}`}),k.jsx(gi,{"data-phone":"",icon:tT,title:(P=n.phone)==null?void 0:P.title,link:(O=(T=n.phone)==null?void 0:T.link)!=null&&O.startsWith("tel:")?(U=n.phone)==null?void 0:U.link:`tel:${(F=n.phone)==null?void 0:F.link}`}),k.jsx(gi,{"data-website":"",link:(L=n.website)==null?void 0:L.link,icon:YA,title:(R=n.website)==null?void 0:R.title})]}),k.jsxs("div",{"data-legal":"",...(N=f.expandedContent)==null?void 0:N.group,children:[((j=n.termsOfService)==null?void 0:j.link)&&k.jsx(gi,{"data-terms":"",link:(B=n.termsOfService)==null?void 0:B.link,icon:cp,title:(W=n.termsOfService)==null?void 0:W.title}),((b=n.privacyPolicy)==null?void 0:b.link)&&k.jsx(gi,{"data-privacy":"",link:(_=n.privacyPolicy)==null?void 0:_.link,icon:QA,title:(H=n.privacyPolicy)==null?void 0:H.title})]})]})]})},su=D.memo(({...e})=>{const{typingIndicator:t}=me;return k.jsx("div",{...e,...t==null?void 0:t.container,children:k.jsx("div",{...t==null?void 0:t.loader})})});su.displayName="TypingIndicator";const au=D.memo(D.forwardRef(({direction:e,block:t,disableInput:n,children:r,sender:i,id:o,authorId:s,status:a,renderers:l,isReadOnly:u,isLastDeliveredMessage:f,feedback:c,timestamp:h,metadata:d,sendMessage:m,addMessageFeedback:p,showAvatar:g},y)=>{const[v,w]=D.useState([]),{message:{container:E,deliveryStatus:S}}=me;return g=g??e==="incoming",k.jsx(qa.Provider,{value:{isLoading:v,setIsLoading:w},children:k.jsxs("div",{...E,className:ar(E==null?void 0:E.className,f&&(S==null?void 0:S.className)),"data-loaded":v.length===0,"data-disable-input":!!n,"data-direction":e,dir:"auto",ref:y,children:[e==="incoming"&&g&&k.jsx(Ay,{authorId:s,sender:i}),t&&k.jsx(Dn,{block:{...t,isReadOnly:u,direction:e,timestamp:h,sender:i,feedback:c,messageId:o,status:a,metadata:d,sendMessage:m,addMessageFeedback:p},renderers:l}),e==="outgoing"&&g&&k.jsx(Ay,{authorId:s,sender:i}),r]})})})),Ay=({authorId:e,sender:t})=>{const{message:{avatar:n}}=me,[r,i]=D.useState("idle"),o=Ju(e??"",15);return k.jsxs(fs,{"data-color":o,"data-loading-status":r,...n==null?void 0:n.container,children:[k.jsx(ds,{...n==null?void 0:n.image,onLoadingStatusChange:i,src:t==null?void 0:t.avatar}),k.jsxs(hs,{...n==null?void 0:n.fallback,children:[t==null?void 0:t.name[0]," "]})]})};function x2({botAvatar:e,botDescription:t,botName:n}){const{messageList:{marquee:r}}=me;return k.jsxs("li",{...r.container,children:[k.jsx(En,{src:e,...r.avatar,children:(n||"Bot").slice(0,1)}),k.jsxs("div",{...r.content,children:[k.jsx("h1",{...r.title,children:n||"Bot"}),k.jsx("p",{...r.description,children:t})]})]})}let lu=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");/*!---------------------------------------------------------------------------------------------
324
- * Copyright (c) StackBlitz. All rights reserved.
325
- * Licensed under the MIT License. See License.txt in the project root for license information.
326
- *--------------------------------------------------------------------------------------------*/const k2={damping:.7,stiffness:.05,mass:1.25},E2=70,C2=1e3/60,A2=350;let Ho=!1;(Vv=globalThis.document)==null||Vv.addEventListener("mousedown",()=>{Ho=!0}),(Wv=globalThis.document)==null||Wv.addEventListener("mouseup",()=>{Ho=!1}),(qv=globalThis.document)==null||qv.addEventListener("click",()=>{Ho=!1});const T2=(e={})=>{const[t,n]=D.useState(!1),[r,i]=D.useState(e.initial!==!1),[o,s]=D.useState(!1),a=D.useRef(null);a.current=e;const l=D.useCallback(()=>{var E;if(!Ho)return!1;const v=window.getSelection();if(!v||!v.rangeCount)return!1;const w=v.getRangeAt(0);return w.commonAncestorContainer.contains(g.current)||((E=g.current)==null?void 0:E.contains(w.commonAncestorContainer))},[]),u=D.useCallback(v=>{c.isAtBottom=v,i(v)},[]),f=D.useCallback(v=>{c.escapedFromLock=v,n(v)},[]),c=D.useMemo(()=>{let v;return{escapedFromLock:t,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){var w;return((w=g.current)==null?void 0:w.scrollTop)??0},set scrollTop(w){g.current&&(g.current.scrollTop=w,c.ignoreScrollToTop=g.current.scrollTop)},get targetScrollTop(){return!g.current||!y.current?0:g.current.scrollHeight-1-g.current.clientHeight},get calculatedTargetScrollTop(){if(!g.current||!y.current)return 0;const{targetScrollTop:w}=this;if(!e.targetScrollTop)return w;if((v==null?void 0:v.targetScrollTop)===w)return v.calculatedScrollTop;const E=Math.max(Math.min(e.targetScrollTop(w,{scrollElement:g.current,contentElement:y.current}),w),0);return v={targetScrollTop:w,calculatedScrollTop:E},requestAnimationFrame(()=>{v=void 0}),E},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=E2}}},[]),h=D.useCallback((v={})=>{var P;typeof v=="string"&&(v={animation:v}),v.preserveScrollPosition||u(!0);const w=Date.now()+(Number(v.wait)||0),E=cu(a.current,v.animation),{ignoreEscapes:S=!1}=v;let C,I=c.calculatedTargetScrollTop;v.duration instanceof Promise?v.duration.finally(()=>{C=Date.now()}):C=w+(v.duration??0);const M=async()=>{const T=new Promise(requestAnimationFrame).then(()=>{var L;if(!c.isAtBottom)return c.animation=void 0,!1;const{scrollTop:O}=c,U=performance.now(),F=(U-(c.lastTick??U))/C2;if(c.animation||(c.animation={behavior:E,promise:T,ignoreEscapes:S}),c.animation.behavior===E&&(c.lastTick=U),l()||w>Date.now())return M();if(O<Math.min(I,c.calculatedTargetScrollTop)){if(((L=c.animation)==null?void 0:L.behavior)===E){if(E==="instant")return c.scrollTop=c.calculatedTargetScrollTop,M();c.velocity=(E.damping*c.velocity+E.stiffness*c.scrollDifference)/E.mass,c.accumulated+=c.velocity*F,c.scrollTop+=c.accumulated,c.scrollTop!==O&&(c.accumulated=0)}return M()}return C>Date.now()?(I=c.calculatedTargetScrollTop,M()):(c.animation=void 0,c.scrollTop<c.calculatedTargetScrollTop?h({animation:cu(a.current,a.current.resize),ignoreEscapes:S,duration:Math.max(0,C-Date.now())||void 0}):c.isAtBottom)});return T.then(O=>(requestAnimationFrame(()=>{c.animation||(c.lastTick=void 0,c.velocity=0)}),O))};return v.wait!==!0&&(c.animation=void 0),((P=c.animation)==null?void 0:P.behavior)===E?c.animation.promise:M()},[u,l,c]),d=D.useCallback(()=>{f(!0),u(!1)},[f,u]),m=D.useCallback(({target:v})=>{if(v!==g.current)return;const{scrollTop:w,ignoreScrollToTop:E}=c;let{lastScrollTop:S=w}=c;c.lastScrollTop=w,c.ignoreScrollToTop=void 0,E&&E>w&&(S=E),s(c.isNearBottom),setTimeout(()=>{var M;if(c.resizeDifference||w===E)return;if(l()){f(!0),u(!1);return}const C=w>S,I=w<S;if((M=c.animation)!=null&&M.ignoreEscapes){c.scrollTop=S;return}I&&(f(!0),u(!1)),C&&f(!1),!c.escapedFromLock&&c.isNearBottom&&u(!0)},1)},[f,u,l,c]),p=D.useCallback(({target:v,deltaY:w})=>{var S;let E=v;for(;!["scroll","auto"].includes(getComputedStyle(E).overflow);){if(!E.parentElement)return;E=E.parentElement}E===g.current&&w<0&&g.current.scrollHeight>g.current.clientHeight&&!((S=c.animation)!=null&&S.ignoreEscapes)&&(f(!0),u(!1))},[f,u,c]),g=Ty(v=>{var w,E;(w=g.current)==null||w.removeEventListener("scroll",m),(E=g.current)==null||E.removeEventListener("wheel",p),v==null||v.addEventListener("scroll",m,{passive:!0}),v==null||v.addEventListener("wheel",p,{passive:!0})},[]),y=Ty(v=>{var E,S;if((E=c.resizeObserver)==null||E.disconnect(),!v)return;let w;c.resizeObserver=new ResizeObserver(([C])=>{const{height:I}=C.contentRect,M=I-(w??I);if(c.resizeDifference=M,c.scrollTop>c.targetScrollTop&&(c.scrollTop=c.targetScrollTop),s(c.isNearBottom),M>=0){const P=cu(a.current,w?a.current.resize:a.current.initial);h({animation:P,wait:!0,preserveScrollPosition:!0,duration:P==="instant"?void 0:A2})}else c.isNearBottom&&(f(!1),u(!0));w=I,requestAnimationFrame(()=>{setTimeout(()=>{c.resizeDifference===M&&(c.resizeDifference=0)},1)})}),(S=c.resizeObserver)==null||S.observe(v)},[]);return{contentRef:y,scrollRef:g,scrollToBottom:h,stopScroll:d,isAtBottom:r||o,isNearBottom:o,escapedFromLock:t,state:c}};function Ty(e,t){const n=D.useCallback(r=>(n.current=r,e(r)),t);return n}const uu=new Map;function cu(...e){const t={...k2};let n=!1;for(const i of e){if(i==="instant"){n=!0;continue}typeof i=="object"&&(n=!1,t.damping=i.damping??t.damping,t.stiffness=i.stiffness??t.stiffness,t.mass=i.mass??t.mass)}const r=JSON.stringify(t);return uu.has(r)||uu.set(r,Object.freeze(t)),n?"instant":uu.get(r)}const Iy=D.createContext(null),I2=typeof window<"u"?D.useLayoutEffect:D.useEffect;function Vo({instance:e,children:t,resize:n,initial:r,mass:i,damping:o,stiffness:s,targetScrollTop:a,contextRef:l,...u}){const f=D.useRef(null),c=A.useCallback((S,C)=>{const I=(E==null?void 0:E.targetScrollTop)??a;return(I==null?void 0:I(S,C))??S},[a]),h=T2({mass:i,damping:o,stiffness:s,resize:n,initial:r,targetScrollTop:c}),{scrollRef:d,contentRef:m,scrollToBottom:p,stopScroll:g,isAtBottom:y,escapedFromLock:v,state:w}=e??h,E=D.useMemo(()=>({scrollToBottom:p,stopScroll:g,scrollRef:d,isAtBottom:y,escapedFromLock:v,contentRef:m,state:w,get targetScrollTop(){return f.current},set targetScrollTop(S){f.current=S}}),[p,y,m,d,g,v,w]);return D.useImperativeHandle(l,()=>E,[E]),I2(()=>{d.current&&getComputedStyle(d.current).overflow==="visible"&&(d.current.style.overflow="auto")},[]),k.jsx(Iy.Provider,{value:E,children:k.jsx("div",{...u,children:typeof t=="function"?t(E):t})})}(function(e){function t({children:n,...r}){const i=Oy();return k.jsx("div",{ref:i.scrollRef,style:{height:"100%",width:"100%"},children:k.jsx("div",{...r,ref:i.contentRef,children:typeof n=="function"?n(i):n})})}e.Content=t})(Vo||(Vo={}));function Oy(){const e=D.useContext(Iy);if(!e)throw new Error("use-stick-to-bottom component context must be used within a StickToBottom component");return e}const fu=D.memo(({className:e,messages:t=[],isTyping:n,headerMessage:r,renderers:i,botAvatar:o,botDescription:s,botName:a,sendMessage:l,addMessageFeedback:u,showMarquee:f=!0,showDateSystemMessage:c=!0,showMessageStatus:h=!0,showIncomingMessageAvatar:d=!0,showOutgoingMessageAvatar:m=!1,...p})=>{var E;const{messageList:g}=me,y=D.useMemo(()=>c?xb(t):t,[t]),v=D.useMemo(()=>{var C;const S=y.filter(I=>I.direction==="outgoing"&&I.status!=="pending");return(C=S[S.length-1])==null?void 0:C.id},[y]),w=S=>{if(S.direction==="incoming")return d;if(S.direction==="outgoing")return m};return k.jsxs(Vo,{...p,resize:"smooth",initial:"instant",className:ar(g.container.className,e),children:[k.jsxs(Vo.Content,{className:g.viewPort.className,children:[r&&k.jsx("span",{...g.headerMessage,children:r}),f&&k.jsx(x2,{botAvatar:o,botDescription:s,botName:a}),y.map(S=>{var C;return k.jsx(au,{renderers:i,sendMessage:l,addMessageFeedback:u,isLastDeliveredMessage:h&&S.id===v,showAvatar:w(S),...S},((C=S.metadata)==null?void 0:C.clientMessageId)||S.id)}),n&&k.jsx(au,{id:lu(),renderers:i,sendMessage:l,direction:"incoming",timestamp:new Date,showAvatar:d,block:void 0,sender:((E=t.filter(S=>S.direction==="incoming").at(-1))==null?void 0:E.sender)??{name:a||"Bot",avatar:o},children:k.jsx(su,{})})]}),k.jsx(O2,{})]})}),O2=()=>{const{isAtBottom:e,scrollToBottom:t}=Oy(),{messageList:n}=me;return e?null:k.jsx("button",{className:n.scrollDownButton.className,onClick:()=>t()})};fu.displayName="MessageList";const My=({className:e,...t})=>{const{className:n}=me.loader;return k.jsx("div",{...t,className:ar(e,n)})};function Dy({error:e,restartConversation:t,closeWindow:n}){let r,i;const{error:o}=me;return e.type==="configuration"?(r="Configuration error",i=k.jsx(eT,{...o.icon})):e.type==="bot"?(r="Bot error",i=k.jsx(sp,{...o.icon})):e.type==="network"?(r="Network error",i=k.jsx(fT,{...o.icon})):e.type==="disconnected"?(r="Disconnected",i=k.jsx(aT,{...o.icon})):(r="Unexpected error",i=k.jsx(sp,{...o.icon})),k.jsx(M2,{error:e,title:r,icon:i,restartConversation:t,closeWindow:n})}function M2({error:e,title:t,icon:n,restartConversation:r,closeWindow:i}){const{error:o}=me;return k.jsxs("div",{...o.container,children:[k.jsxs("div",{...o.header.container,children:[`Webchat ${e.type} error`,k.jsxs("div",{...o.header.actions,children:[r&&k.jsx(iu,{restartConversation:r,style:{color:"white",backgroundColor:"transparent"}}),i&&k.jsx(ou,{onClick:i,style:{color:"white",backgroundColor:"transparent"}})]})]}),k.jsxs("div",{...o.content,children:[n,k.jsx("div",{...o.errorTitle,children:t}),k.jsx("div",{...o.errorMessage,children:e.message}),e.id&&k.jsx("div",{...o.id,children:e.id})]})]})}const yi=dy.webchat;async function D2(e,t){const{userId:n,conversationId:r,userToken:i,openConversation:o,setClientState:s,setError:a,emitter:l}=t;yi.warn("handleWebchatError",{userId:n,conversationId:r,type:e.type,message:e.message});const f=[{name:"startNewConversation",predicate:c=>c.message===$s||c.type==="ResourceNotFound",recover:async()=>o({userToken:i})},{name:"reopenConversation",predicate:c=>c.type==="network",recover:async()=>o({userToken:i,conversationId:r})}].find(c=>c.predicate(e));if(!f){yi.error("no recovery strategy found, setting error state",{userId:n,conversationId:r}),s("error"),a(e);return}yi.info("attempting recovery",{userId:n,conversationId:r,strategy:f.name});try{await Jf(f.recover,3,5e3),yi.info("recovery successful",{userId:n,conversationId:r}),a(void 0),s("connected")}catch(c){yi.error("recovery failed",{error:c,userId:n,conversationId:r}),a(_r(c)),s("error"),l.emit("error",c)}}function N2(e,t){return async(...n)=>{try{return await e(...n)}catch(r){await D2(_r(r),t)}}}function Ny(e,t){const n={};for(const[r,i]of Object.entries(e))n[r]=N2(i,t);return n}function _y({client:e,conversationId:t}){return{sendEvent:async(r,i)=>{if(!e||!t)throw new Error("Cannot send event: client or conversationId not available");await e.createEvent({conversationId:t,payload:{type:"custom",data:r},bindConversation:(i==null?void 0:i.bindConversation)??!0,bindUser:(i==null?void 0:i.bindUser)??!0})}}}function Py({client:e,conversationId:t,user:n}){return{uploadFile:async i=>{if(!e)throw new Error("Client not initialized");if(!t)throw new Error("No active conversation");if(!n)throw new Error("User not authenticated");const{size:o,name:s}=i,a=await Xw(i),l=new Date;l.setDate(l.getDate()+30);const{file:{uploadUrl:u,contentType:f,url:c,id:h}}=await e.createFile({size:o,key:`${lu(6)}-${i.name}`,accessPolicies:["public_content"],index:!1,tags:{source:"integration",integrationName:"webchat",conversation:t,user:n.userId},expiresAt:l.toISOString()});await fetch(u,{method:"PUT",headers:{"x-amz-tagging":"public=true","content-type":f},body:a});const d=f.split("/").shift()??"",m=Bf(d)?d:"file";return{fileUrl:c,name:s,type:m,fileId:h}}}}function Ly({client:e,conversationId:t,userId:n,setAwaitingResponse:r}){const i=Ep(t||"default"),o=i(d=>d.messages),s=i(d=>d.saveMessage),a=i(d=>d.updateMessage),l=i(d=>d.setMessages),u=i(d=>d.clearMessages);return{messages:o,sendMessage:async d=>{if(!e||!t||!n)throw console.log("Cannot send message: client, conversationId, or userId not available",e,t,n),new Error("Cannot send message: client, conversationId, or userId not available");r==null||r(!0);const m=lu(),p={id:m,createdAt:new Date().toISOString(),userId:n,conversationId:t,payload:d,metadata:{clientMessageId:m,delivered:!1}},g=ui(p);g.status="pending",s(g),await e.createMessage({conversationId:t,payload:d,metadata:{clientMessageId:m}})},setMessages:d=>{const m=d.map(p=>ui(p)).filter(Boolean);l(m)},clearMessages:u,saveMessageFeedback:async(d,m)=>{if(!e)throw new Error("Cannot update feedback: client not available");a(d,{feedback:m.value}),await e.addMessageFeedback({messageId:d,...m})}}}function Fy({client:e,conversationId:t}){const n=Tp(t||"default"),r=n(u=>u.participants),i=n(u=>u.setParticipants),o=n(u=>u.addParticipant),s=n(u=>u.removeParticipant),a=n(u=>u.clearParticipants);return{participants:r,setParticipants:i,fetchParticipants:async()=>{if(!e||!t)return;const{participants:u}=await e.listParticipants({conversationId:t});i(u)},clearParticipants:a,addParticipant:o,removeParticipant:s}}const Ry={chatMessageNotification:new URL("data:audio/ogg;base64,T2dnUwACAAAAAAAAAAAVJAEzAAAAAOU+A6UBHgF2b3JiaXMAAAAAASJWAAD/////AH0AAP////+pAU9nZ1MAAAAAAAAAAAAAFSQBMwEAAAD3T/UfDpz////////////////FA3ZvcmJpcwwAAABMYXZmNjEuNy4xMDAEAAAAHwAAAGVuY29kZXI9TGF2YzYxLjE5LjEwMSBsaWJ2b3JiaXMrAAAAZW5jb2RlZF9ieT1BZG9iZSBQcmVtaWVyZSBQcm8gMjAyNS4wIChNYWNpbhcAAAB0aW1lX3JlZmVyZW5jZT0xMjExMDQwMA8AAABkYXRlPTIwMjUtMDgtMDUBBXZvcmJpcyJCQ1YBAEAAABhCECoFrWOOOsgVIYwZoqBCyinHHULQIaMkQ4g6xjXHGGNHuWSKQsmB0JBVAABAAACkHFdQckkt55xzoxhXzHHoIOecc+UgZ8xxCSXnnHOOOeeSco4x55xzoxhXDnIpLeecc4EUR4pxpxjnnHOkHEeKcagY55xzbTG3knLOOeecc+Ygh1JyrjXnnHOkGGcOcgsl55xzxiBnzHHrIOecc4w1t9RyzjnnnHPOOeecc84555xzjDHnnHPOOeecc24x5xZzrjnnnHPOOeccc84555xzIDRkFQCQAACgoSiK4igOEBqyCgDIAAAQQHEUR5EUS7Ecy9EkDQgNWQUAAAEACAAAoEiGpEiKpViOZmmeJnqiKJqiKquyacqyLMuy67ouEBqyCgBIAABQURTFcBQHCA1ZBQBkAAAIYCiKoziO5FiSpVmeB4SGrAIAgAAABAAAUAxHsRRN8STP8jzP8zzP8zzP8zzP8zzP8zzP8zwNCA1ZBQAgAAAAgihkGANCQ1YBAEAAAAghGhlDnVISXAoWQhwRQx1CzkOppYPgKYUlY9JTrEEIIXzvPffee++B0JBVAAAQAABhFDiIgcckCCGEYhQnRHGmIAghhOUkWMp56CQI3YMQQrice8u59957IDRkFQAACADAIIQQQgghhBBCCCmklFJIKaaYYoopxxxzzDHHIIMMMuigk046yaSSTjrKJKOOUmsptRRTTLHlFmOttdacc69BKWOMMcYYY4wxxhhjjDHGGCMIDVkFAIAAABAGGWSQQQghhBRSSCmmmHLMMcccA0JDVgEAgAAAAgAAABxFUiRHciRHkiTJkixJkzzLszzLszxN1ERNFVXVVW3X9m1f9m3f1WXf9mXb1WVdlmXdtW1d1l1d13Vd13Vd13Vd13Vd13Vd14HQkFUAgAQAgI7kOI7kOI7kSI6kSAoQGrIKAJABABAAgKM4iuNIjuRYjiVZkiZplmd5lqd5mqiJHhAasgoAAAQAEAAAAAAAgKIoiqM4jiRZlqZpnqd6oiiaqqqKpqmqqmqapmmapmmapmmapmmapmmapmmapmmapmmapmmapmmapmkCoSGrAAAJAAAdx3EcR3Ecx3EkR5IkIDRkFQAgAwAgAABDURxFcizHkjRLszzL00TP9FxRNnVTV20gNGQVAAAIACAAAAAAAADHczzHczzJkzzLczzHkzxJ0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRNA0JDVgIAZAAAEJOQSk6xV0YpxiS0XiqkFJPUe6iYYkw67alCBikHuYdKIaWg094ypZBSDHunmELIGOqhg5AxhbDX2nPPvfceCA1ZEQBEAQAAxiDGEGPIMSYlgxIxxyRkUiLnnJROSialpFZazKSEmEqLkXNOSiclk1JaC6llkkprJaYCAAACHAAAAiyEQkNWBABRAACIMUgppBRSSjGnmENKKceUY0gp5ZxyTjnHmHQQKucYdA5KpJRyjjmnnHMSMgeVcw5CJp0AAIAABwCAAAuh0JAVAUCcAACAkHOKMQgRYxBCCSmFUFKqnJPSQUmpg5JSSanFklKMlXNSOgkpdRJSKinFWFKKLaRUY2kt19JSjS3GnFuMvYaUYi2p1Vpaq7nFWHOLNffIOUqdlNY6Ka2l1mpNrdXaSWktpNZiaS3G1mLNKcacMymthZZiK6nF2GLLNbWYc2kt1xRjzynGnmusucecgzCt1ZxayznFmHvMseeYcw+Sc5Q6Ka11UlpLrdWaWqs1k9Jaaa3GkFqLLcacW4sxZ1JaLKnFWFqKMcWYc4st19BarinGnFOLOcdag5Kx9l5aqznFmHuKreeYczA2x547SrmW1nourfVecy5C1tyLaC3n1GoPKsaec87B2NyDEK3lnGrsPcXYe+45GNtz8K3W4FvNRcicg9C5+KZ7MEbV2oPMtQiZcxA66CJ08Ml4lGoureVcWus91hp8zTkI0VruKcbeU4u9156bsL0HIVrLPcXYg4ox+JpzMDrnYlStwcecg5C1FqF7L0rnIJSqtQeZa1Ay1yJ08MXooIsvAABgwAEAIMCEMlBoyIoAIE4AgEHIOaUYhEopCKGElEIoKVWMSciYg5IxJ6WUUloIJbWKMQiZY1Iyx6SEEloqJbQSSmmplNJaKKW1llqMKbUWQymphVJaK6W0llqqMbVWY8SYlMw5KZljUkoprZVSWqsck5IxKKmDkEopKcVSUouVc1Iy6Kh0EEoqqcRUUmmtpNJSKaXFklJsKcVUW4u1hlJaLKnEVlJqMbVUW4sx14gxKRlzUjLnpJRSUiultJY5J6WDjkrmoKSSUmulpBQz5qR0DkrKIKNSUootpRJTKKW1klJspaTWWoy1ptRaLSW1VlJqsZQSW4sx1xZLTZ2U1koqMYZSWmsx5ppaizGUElspKcaSSmytxZpbbDmGUlosqcRWSmqx1ZZja7Hm1FKNKbWaW2y5xpRTj7X2nFqrNbVUY2ux5lhbb7XWnDsprYVSWislxZhai7HFWHMoJbaSUmylpBhbbLm2FmMPobRYSmqxpBJjazHmGFuOqbVaW2y5ptRirbX2HFtuPaUWa4ux5tJSjTXX3mNNORUAADDgAAAQYEIZKDRkJQAQBQAAGMMYYxAapZxzTkqDlHPOScmcgxBCSplzEEJIKXNOQkotZc5BSKm1UEpKrcUWSkmptRYLAAAocAAACLBBU2JxgEJDVgIAUQAAiDFKMQahMUYp5yA0xijFGIRKKcack1ApxZhzUDLHnINQSuaccxBKCSGUUkpKIYRSSkmpAACAAgcAgAAbNCUWByg0ZEUAEAUAABhjnDPOIQqdpc5SJKmj1lFrKKUaS4ydxlZ767nTGnttuTeUSo2p1o5ry7nV3mlNPbccCwAAO3AAADuwEAoNWQkA5AEAEMYoxZhzzhmFGHPOOecMUow555xzijHnnIMQQsWYc85BCCFzzjkIoYSSOecchBBK6JyDUEoppXTOQQihlFI65yCEUkopnXMQSimllAIAgAocAAACbBTZnGAkqNCQlQBAHgAAYAxCzklprWHMOQgt1dgwxhyUlGKLnIOQUou5RsxBSCnGoDsoKbUYbPCdhJRaizkHk1KLNefeg0iptZqDzj3VVnPPvfecYqw1595zLwAAd8EBAOzARpHNCUaCCg1ZCQDkAQAQCCnFmHPOGaUYc8w554xSjDHmnHOKMcacc85BxRhjzjkHIWPMOecghJAx5pxzEELonHMOQgghdM45ByGEEDrnoIMQQgidcxBCCCGEAgCAChwAAAJsFNmcYCSo0JCVAEA4AAAAIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEELonHPOOeecc84555xzzjnnnHPOOScAyLfCAcD/wcYZVpLOCkeDCw1ZCQCEAwAACkEopWIQSiklkk46KZ2TUEopkYNSSumklFJKCaWUUkoIpZRSSggdlFJCKaWUUkoppZRSSimllFI6KaWUUkoppZTKOSmlk1JKKaVEzkkpIZRSSimlhFJKKaWUUkoppZRSSimllFJKKaWEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQCALgbHAAgEmycYSXprHA0uNCQlQBASAAAoBRzjkoIKZSQUqiYoo5CKSmkUkoKEWPOSeochVBSKKmDyjkIpaSUQiohdc5BByWFkFIJIZWOOugolFBSKiWU0jkopYQUSkoplZBCSKl0lFIoJZWUQiohlVJKSCWVEEoKnaRUSgqppFRSCJ10kEInJaSSSgqpk5RSKiWllEpKJXRSQioppRBCSqmUEEpIKaVOUkmppBRCKCGFlFJKJaWSSkohlVRCCaWklFIooaRUUkoppZJSKQAA4MABACDACDrJqLIIG0248AAUGrISACADAECUdNZpp0kiCDFFmScNKcYgtaQswxBTkonxFGOMOShGQw4x5JQYF0oIoYNiPCaVQ8pQUbm31DkFxRZjfO+xFwEAAAgCAASEBAAYICiYAQAGBwgjBwIdAQQObQCAgQiZCQwKocFBJgA8QERIBQCJCYrShS4IIYJ0EWTxwIUTN5644YQObRAAAAAAABAA8AEAkFAAERHRzFVYXGBkaGxwdHh8gIQEAAAAAAAIAHwAACQiQERENHMVFhcYGRobHB0eHyAhAQAAAAAAAAAAQEBAAAAAAAAgAAAAQEBPZ2dTAASuMwAAAAAAABUkATMCAAAACYS6sR4BAUQxGR89NxobGiEkKCknJiYmJSUhISEaFgwBAQEAAnyfvULHAlAEJgh2vpgQBMHIyMjIyNhIQOjz+ePz58+fL89xAwYBAFaH//3//7/xNw0MBoNB6qlPfWrUKQng+/0FABAAhLEjKuHFBwA4AHC9Fx4Oh7EwDEOgvnJ3RtV+Op0+nU6n5cyzEwAoltTpwed5dgVKMPoru90zNHGA7F0CP98BAAAAAHl9ePviAgCW+3rugPIDwC6BbWoTAFEAAADh5GpCCACgc+0zxlAAVKddkjDsA14GDoJtf7R+NkE4W23hI5mF3d74iVGvzg9PpA4cCQs66joePTmOfhgl7vNZzYzQADDyz30FAGSvVUZ6wJ4MAKbCGeb4+v5NLIdK3YvrLkCu98uV//FpXQNyKAKAV7r186fTktcJJgjAlVp1fUmaGgtrdAAuDXYJSPs/AAAAAHDnAeHxciEUAB76CvfarGjDzIjALoEd+/0EAAAAQNYeMrkBAF6ZKm8xuw94NtgloHDUCAAAAIAMJ5Qz2iUAvjhKL8lkfmA6wi6BWfNHgiAAAABq4eeqGgCg8+LAAXQAfhgqz2RKHzAVYJeAynEAIQEAALwq6tFbIQAEEIIO8iULngMAXhgajrw3D5iFWhe7BLZNrwCVKAAA0t2TfT8mADx0aMfS4CULeACvA14YWnasNht80ZpdAhv8BEiiAADgcbm4jo0JANAVCTRV6JqQS0OTADoAXhg6zWy+AZ3GsiDRAYJzgiQAAICnb9FLAQAUNQFd44AioMNJICUAfhi67ZRjA2IMSHTAJK0KkgAAAG7W0uLlEgC6KnQdDkgBlAAdJAB+GHpL40hATAASHSC5CZIAAAAGZ3J60ioBoKsBTQKE5KFJIJFAAp4Y+jp7cg4qINEBi+MASQAAAM8rmdZcAKApwFhNPHQkQEBRQwIAnhj6OZ8KIBwDiQ4Q9ApIFAAAQHRFd6FEALA0NaApQAegnPrDA54Y+nN+AYAIJDoAfgIkCgAAcLRlPVsLALqmKqFpHIwUwQEJCwCeKPpzEQA8kOgAyTlBAgAAgPnK3q8jAWAuJFBYOsbAAgCeKPolEQA8rMFCohQAAMxD2BdSAJYFdNThKcCkBQCOgwKeGPpzEQA8rEEhCQAAoCz4MRGA41gaQMBRjACexHugAACeGPqFCAAeugQAAHryFgBdRYGFhGeow8x7AJ4Y+iURADyIigIAliFAAcYWCQC11gGeGPolEQA8UAAAABoODg4=",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:rs&&rs.tagName.toUpperCase()==="SCRIPT"&&rs.src||new URL("index.umd.cjs",document.baseURI).href).href};function $y({storageKey:e,soundEnabled:t}){const n=Ip(e||"bp-webchat"),r=n(u=>u.soundOn),i=n(u=>u.toggleSound),o=D.useRef(null),s=D.useRef(t??!1),a=D.useRef(r);D.useEffect(()=>{try{o.current=new Audio,o.current.preload="auto",o.current.src=Ry.chatMessageNotification,o.current.volume=.9}catch(u){console.error("Error loading sound effect:",u),o.current=null}},[]),D.useEffect(()=>{s.current=t??!1},[t]),D.useEffect(()=>{a.current=r},[r]);const l=D.useCallback(()=>{s.current&&a.current&&o.current&&o.current.play().catch(()=>{})},[]);return{soundOn:r,toggleSound:i,playNotificationSound:l}}function _2({apiUrl:e="https://webchat.botpress.cloud",clientId:t,storageKey:n,storageLocation:r,adminSecret:i,soundEnabled:o,clientHeaders:s,...a}){var N;const{soundOn:l,toggleSound:u,playNotificationSound:f}=$y({storageKey:n,soundEnabled:o}),{clientState:c,httpClient:h,error:d,activeConversationId:m,userCredentials:p,isTyping:g,isAwaitingResponse:y,openConversation:v,setAwaitingResponse:w,emitter:E,setError:S,setClientState:C}=py({apiUrl:e,clientId:t,storageKey:n,storageLocation:r,adminSecret:i,clientHeaders:s,conversationId:a.conversationId,userToken:(N=a.user)==null?void 0:N.userToken,playNotificationSound:f}),{messages:I,sendMessage:M,saveMessageFeedback:P}=Ly({client:h,conversationId:m,userId:p==null?void 0:p.userId,setAwaitingResponse:w}),{participants:T}=Fy({client:h,conversationId:m}),{uploadFile:O}=Py({client:h,conversationId:m,user:p}),{sendEvent:U}=_y({client:h,conversationId:m});if(c!=="connected"||!p||!m||!h)return{clientState:c,on:E.on,client:void 0,messages:[],conversationId:void 0,newConversation:j=>{v({conversationId:j,userToken:p==null?void 0:p.userToken}).catch(B=>{E.emit("error",B)})},user:void 0,isTyping:void 0,participants:[],toggleSound:u,soundOn:l,error:d,disableSendButton:y};const F={userId:p==null?void 0:p.userId,conversationId:m,userToken:p==null?void 0:p.userToken,openConversation:v,setClientState:C,setError:S,emitter:E},R={...Ny({sendMessage:async j=>M(j),sendEvent:U,uploadFile:O,addMessageFeedback:P},F),getUser:async()=>{const{user:j}=await h.getUser();return j},updateUser:async j=>{const{user:B}=await h.updateUser({name:j.name,pictureUrl:j.pictureUrl,userData:j.data});return B},listConversations:async()=>h.listConversations({})};return{clientState:"connected",on:E.on,client:R,messages:I,conversationId:m,newConversation:j=>{v({conversationId:j,userToken:p.userToken}).catch(B=>{E.emit("error",B)})},user:p,isTyping:g,participants:T,error:d,soundOn:l,toggleSound:u,disableSendButton:y}}const By=()=>{const{client:e,userCredentials:t}=$o();return e?{userCredentials:t,getUser:async()=>(await e.getUser()).user,updateUser:async i=>(await e.updateUser(i)).user}:{userCredentials:t,getUser:void 0,updateUser:void 0}};function zy(){const{client:e,conversationId:t,userCredentials:n,setAwaitingResponse:r,emitter:i,clientState:o,setClientState:s,setError:a,openConversation:l,error:u,isAwaitingResponse:f,isTyping:c}=$o(),{messages:h,sendMessage:d,saveMessageFeedback:m}=Ly({client:e,conversationId:t,userId:n==null?void 0:n.userId,setAwaitingResponse:r}),{participants:p}=Fy({client:e,conversationId:t}),{sendEvent:g}=_y({client:e,conversationId:t}),{uploadFile:y}=Py({client:e,conversationId:t,user:n}),v={userId:n==null?void 0:n.userId,userToken:n==null?void 0:n.userToken,conversationId:t,openConversation:l,setClientState:s,setError:a,emitter:i},w=Ny({sendMessage:d,saveMessageFeedback:m,sendEvent:g,uploadFile:y},v);return{conversationId:t,messages:h,participants:p,sendMessage:w.sendMessage,saveMessageFeedback:w.saveMessageFeedback,sendEvent:w.sendEvent,uploadFile:w.uploadFile,on:i.on,status:o,error:u,isAwaitingResponse:f,isTyping:c}}function Uy(){const{client:e,openConversation:t,userCredentials:n}=$o();return e?{listConversations:async()=>e.listConversations({}),openConversation:i=>t({conversationId:i,userToken:n==null?void 0:n.userToken})}:{listConversations:void 0,openConversation:i=>t({conversationId:i,userToken:n==null?void 0:n.userToken})}}const jy=0,Hy=1,Vy=2,Wy=3;var qy=Object.prototype.hasOwnProperty;function du(e,t){var n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&du(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(qy.call(e,n)&&++r&&!qy.call(t,n)||!(n in t)||!du(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const Jt=new WeakMap,Xt=()=>{},rt=Xt(),hu=Object,we=e=>e===rt,Vt=e=>typeof e=="function",mn=(e,t)=>({...e,...t}),Yy=e=>Vt(e.then),pu={},Wo={},mu="undefined",vi=typeof window!=mu,gu=typeof document!=mu,P2=vi&&"Deno"in window,L2=()=>vi&&typeof window.requestAnimationFrame!=mu,Ky=(e,t)=>{const n=Jt.get(e);return[()=>!we(t)&&e.get(t)||pu,r=>{if(!we(t)){const i=e.get(t);t in Wo||(Wo[t]=i),n[5](t,mn(i,r),i||pu)}},n[6],()=>!we(t)&&t in Wo?Wo[t]:!we(t)&&e.get(t)||pu]};let yu=!0;const F2=()=>yu,[vu,bu]=vi&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Xt,Xt],R2=()=>{const e=gu&&document.visibilityState;return we(e)||e!=="hidden"},$2=e=>(gu&&document.addEventListener("visibilitychange",e),vu("focus",e),()=>{gu&&document.removeEventListener("visibilitychange",e),bu("focus",e)}),B2=e=>{const t=()=>{yu=!0,e()},n=()=>{yu=!1};return vu("online",t),vu("offline",n),()=>{bu("online",t),bu("offline",n)}},z2={isOnline:F2,isVisible:R2},U2={initFocus:$2,initReconnect:B2},Gy=!D.useId,hr=!vi||P2,j2=e=>L2()?window.requestAnimationFrame(e):setTimeout(e,1),wu=hr?D.useEffect:D.useLayoutEffect,Su=typeof navigator<"u"&&navigator.connection,Qy=!hr&&Su&&(["slow-2g","2g"].includes(Su.effectiveType)||Su.saveData),qo=new WeakMap,H2=e=>hu.prototype.toString.call(e),xu=(e,t)=>e===`[object ${t}]`;let V2=0;const ku=e=>{const t=typeof e,n=H2(e),r=xu(n,"Date"),i=xu(n,"RegExp"),o=xu(n,"Object");let s,a;if(hu(e)===e&&!r&&!i){if(s=qo.get(e),s)return s;if(s=++V2+"~",qo.set(e,s),Array.isArray(e)){for(s="@",a=0;a<e.length;a++)s+=ku(e[a])+",";qo.set(e,s)}if(o){s="#";const l=hu.keys(e).sort();for(;!we(a=l.pop());)we(e[a])||(s+=a+":"+ku(e[a])+",");qo.set(e,s)}}else s=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return s},Eu=e=>{if(Vt(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?ku(e):"",[e,t]};let W2=0;const Cu=()=>++W2;async function Zy(...e){const[t,n,r,i]=e,o=mn({populateCache:!0,throwOnError:!0},typeof i=="boolean"?{revalidate:i}:i||{});let s=o.populateCache;const a=o.rollbackOnError;let l=o.optimisticData;const u=h=>typeof a=="function"?a(h):a!==!1,f=o.throwOnError;if(Vt(n)){const h=n,d=[],m=t.keys();for(const p of m)!/^\$(inf|sub)\$/.test(p)&&h(t.get(p)._k)&&d.push(p);return Promise.all(d.map(c))}return c(n);async function c(h){const[d]=Eu(h);if(!d)return;const[m,p]=Ky(t,d),[g,y,v,w]=Jt.get(t),E=()=>{const L=g[d];return(Vt(o.revalidate)?o.revalidate(m().data,h):o.revalidate!==!1)&&(delete v[d],delete w[d],L&&L[0])?L[0](Vy).then(()=>m().data):m().data};if(e.length<3)return E();let S=r,C,I=!1;const M=Cu();y[d]=[M,0];const P=!we(l),T=m(),O=T.data,U=T._c,F=we(U)?O:U;if(P&&(l=Vt(l)?l(F,O):l,p({data:l,_c:F})),Vt(S))try{S=S(F)}catch(L){C=L,I=!0}if(S&&Yy(S))if(S=await S.catch(L=>{C=L,I=!0}),M!==y[d][0]){if(I)throw C;return S}else I&&P&&u(C)&&(s=!0,p({data:F,_c:rt}));if(s&&!I)if(Vt(s)){const L=s(S,F);p({data:L,error:rt,_c:rt})}else p({data:S,error:rt,_c:rt});if(y[d][1]=Cu(),Promise.resolve(E()).then(()=>{p({_c:rt})}),I){if(f)throw C;return}return S}}const Jy=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},q2=(e,t)=>{if(!Jt.has(e)){const n=mn(U2,t),r=Object.create(null),i=Zy.bind(rt,e);let o=Xt;const s=Object.create(null),a=(f,c)=>{const h=s[f]||[];return s[f]=h,h.push(c),()=>h.splice(h.indexOf(c),1)},l=(f,c,h)=>{e.set(f,c);const d=s[f];if(d)for(const m of d)m(c,h)},u=()=>{if(!Jt.has(e)&&(Jt.set(e,[r,Object.create(null),Object.create(null),Object.create(null),i,l,a]),!hr)){const f=n.initFocus(setTimeout.bind(rt,Jy.bind(rt,r,jy))),c=n.initReconnect(setTimeout.bind(rt,Jy.bind(rt,r,Hy)));o=()=>{f&&f(),c&&c(),Jt.delete(e)}}};return u(),[e,i,u,o]}return[e,Jt.get(e)[4]]},Y2=(e,t,n,r,i)=>{const o=n.errorRetryCount,s=i.retryCount,a=~~((Math.random()+.5)*(1<<(s<8?s:8)))*n.errorRetryInterval;!we(o)&&s>o||setTimeout(r,a,i)},K2=du,[Xy,G2]=q2(new Map),Q2=mn({onLoadingSlow:Xt,onSuccess:Xt,onError:Xt,onErrorRetry:Y2,onDiscarded:Xt,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:Qy?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:Qy?5e3:3e3,compare:K2,isPaused:()=>!1,cache:Xy,mutate:G2,fallback:{}},z2),Z2=(e,t)=>{const n=mn(e,t);if(t){const{use:r,fallback:i}=e,{use:o,fallback:s}=t;r&&o&&(n.use=r.concat(o)),i&&s&&(n.fallback=mn(i,s))}return n},J2=D.createContext({}),X2="$inf$",ev=vi&&window.__SWR_DEVTOOLS_USE__,e_=ev?window.__SWR_DEVTOOLS_USE__:[],t_=()=>{ev&&(window.__SWR_DEVTOOLS_REACT__=D)},n_=e=>Vt(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],r_=()=>{const e=D.useContext(J2);return D.useMemo(()=>mn(Q2,e),[e])},i_=e=>(t,n,r)=>e(t,n&&((...o)=>{const[s]=Eu(t),[,,,a]=Jt.get(Xy);if(s.startsWith(X2))return n(...o);const l=a[s];return we(l)?n(...o):(delete a[s],l)}),r),o_=e_.concat(i_),s_=e=>function(...n){const r=r_(),[i,o,s]=n_(n),a=Z2(r,s);let l=e;const{use:u}=a,f=(u||[]).concat(o_);for(let c=f.length;c--;)l=f[c](l);return l(i,o||a.fetcher||null,a)},a_=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const i=r.indexOf(n);i>=0&&(r[i]=r[r.length-1],r.pop())}};t_();const Au=D.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),Tu={dedupe:!0},tv=Promise.resolve(rt),l_=()=>Xt,u_=s_((e,t,n)=>{const{cache:r,compare:i,suspense:o,fallbackData:s,revalidateOnMount:a,revalidateIfStale:l,refreshInterval:u,refreshWhenHidden:f,refreshWhenOffline:c,keepPreviousData:h,strictServerPrefetchWarning:d}=n,[m,p,g,y]=Jt.get(r),[v,w]=Eu(e),E=D.useRef(!1),S=D.useRef(!1),C=D.useRef(v),I=D.useRef(t),M=D.useRef(n),P=()=>M.current,T=()=>P().isVisible()&&P().isOnline(),[O,U,F,L]=Ky(r,v),R=D.useRef({}).current,N=we(s)?we(n.fallback)?rt:n.fallback[v]:s,j=(J,ue)=>{for(const de in R){const fe=de;if(fe==="data"){if(!i(J[fe],ue[fe])&&(!we(J[fe])||!i(q,ue[fe])))return!1}else if(ue[fe]!==J[fe])return!1}return!0},B=!E.current,W=D.useMemo(()=>{const J=O(),ue=L(),de=Me=>{const je=mn(Me);return delete je._k,(()=>{if(!v||!t||P().isPaused())return!1;if(B&&!we(a))return a;const ae=we(N)?je.data:N;return we(ae)||l})()?{isValidating:!0,isLoading:!0,...je}:je},fe=de(J),Ae=J===ue?fe:de(ue);let Fe=fe;return[()=>{const Me=de(O());return j(Me,Fe)?(Fe.data=Me.data,Fe.isLoading=Me.isLoading,Fe.isValidating=Me.isValidating,Fe.error=Me.error,Fe):(Fe=Me,Me)},()=>Ae]},[r,v]),b=us.useSyncExternalStore(D.useCallback(J=>F(v,(ue,de)=>{j(de,ue)||J()}),[r,v]),W[0],W[1]),_=m[v]&&m[v].length>0,H=b.data,x=we(H)?N&&Yy(N)?Au(N):N:H,V=b.error,Y=D.useRef(x),q=h?we(H)?we(Y.current)?x:Y.current:H:x,Q=v&&we(x),X=D.useRef(null);!hr&&us.useSyncExternalStore(l_,()=>(X.current=!1,X),()=>(X.current=!0,X));const se=X.current;d&&se&&!o&&Q&&console.warn(`Missing pre-initiated data for serialized key "${v}" during server-side rendering. Data fetching should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);const G=!v||!t||P().isPaused()||_&&!we(V)?!1:B&&!we(a)?a:o?we(x)?!1:l:we(x)||l,te=we(b.isValidating)?G:b.isValidating,$=we(b.isLoading)?G:b.isLoading,ne=D.useCallback(async J=>{const ue=I.current;if(!v||!ue||S.current||P().isPaused())return!1;let de,fe,Ae=!0;const Fe=J||{},Me=!g[v]||!Fe.dedupe,je=()=>Gy?!S.current&&v===C.current&&E.current:v===C.current,ee={isValidating:!1,isLoading:!1},ae=()=>{U(ee)},z=()=>{const oe=g[v];oe&&oe[1]===fe&&delete g[v]},K={isValidating:!0};we(O().data)&&(K.isLoading=!0);try{if(Me&&(U(K),n.loadingTimeout&&we(O().data)&&setTimeout(()=>{Ae&&je()&&P().onLoadingSlow(v,n)},n.loadingTimeout),g[v]=[ue(w),Cu()]),[de,fe]=g[v],de=await de,Me&&setTimeout(z,n.dedupingInterval),!g[v]||g[v][1]!==fe)return Me&&je()&&P().onDiscarded(v),!1;ee.error=rt;const oe=p[v];if(!we(oe)&&(fe<=oe[0]||fe<=oe[1]||oe[1]===0))return ae(),Me&&je()&&P().onDiscarded(v),!1;const le=O().data;ee.data=i(le,de)?le:de,Me&&je()&&P().onSuccess(de,v,n)}catch(oe){z();const le=P(),{shouldRetryOnError:he}=le;le.isPaused()||(ee.error=oe,Me&&je()&&(le.onError(oe,v,le),(he===!0||Vt(he)&&he(oe))&&(!P().revalidateOnFocus||!P().revalidateOnReconnect||T())&&le.onErrorRetry(oe,v,le,He=>{const Ge=m[v];Ge&&Ge[0]&&Ge[0](Wy,He)},{retryCount:(Fe.retryCount||0)+1,dedupe:!0})))}return Ae=!1,ae(),!0},[v,r]),ge=D.useCallback((...J)=>Zy(r,C.current,...J),[]);if(wu(()=>{I.current=t,M.current=n,we(H)||(Y.current=H)}),wu(()=>{if(!v)return;const J=ne.bind(rt,Tu);let ue=0;P().revalidateOnFocus&&(ue=Date.now()+P().focusThrottleInterval);const fe=a_(v,m,(Ae,Fe={})=>{if(Ae==jy){const Me=Date.now();P().revalidateOnFocus&&Me>ue&&T()&&(ue=Me+P().focusThrottleInterval,J())}else if(Ae==Hy)P().revalidateOnReconnect&&T()&&J();else{if(Ae==Vy)return ne();if(Ae==Wy)return ne(Fe)}});return S.current=!1,C.current=v,E.current=!0,U({_k:w}),G&&(g[v]||(we(x)||hr?J():j2(J))),()=>{S.current=!0,fe()}},[v]),wu(()=>{let J;function ue(){const fe=Vt(u)?u(O().data):u;fe&&J!==-1&&(J=setTimeout(de,fe))}function de(){!O().error&&(f||P().isVisible())&&(c||P().isOnline())?ne(Tu).then(ue):ue()}return ue(),()=>{J&&(clearTimeout(J),J=-1)}},[u,f,c,v]),D.useDebugValue(q),o){if(!Gy&&hr&&Q)throw new Error("Fallback data is required when using Suspense in SSR.");Q&&(I.current=t,M.current=n,S.current=!1);const J=y[v],ue=!we(J)&&Q?ge(J):tv;if(Au(ue),!we(V)&&Q)throw V;const de=Q?ne(Tu):tv;!we(q)&&Q&&(de.status="fulfilled",de.value=!0),Au(de)}return{mutate:ge,get data(){return R.data=!0,q},get error(){return R.error=!0,V},get isValidating(){return R.isValidating=!0,te},get isLoading(){return R.isLoading=!0,$}}});function nv({userCredentials:e,listConversations:t,clientId:n}){const r=!!e&&n&&t,{data:i,error:o,isValidating:s,mutate:a}=u_(r?[n,"conversations",e==null?void 0:e.userId]:null,async()=>(await t({})).conversations.filter(c_).sort((u,f)=>new Date(f.updatedAt).getTime()-new Date(u.updatedAt).getTime()).map(u=>({...u,lastMessage:{...u.lastMessage,author:{type:u.lastMessage.userId===(e==null?void 0:e.userId)?"user":"bot"}}})),{revalidateOnFocus:!1,revalidateOnReconnect:!0,dedupingInterval:2e3});return{conversations:i??[],isLoading:s,error:o&&_r(o),refresh:async()=>await a()}}const c_=e=>!!e.lastMessage,f_=e=>e==null||e.length===0?"":e.charAt(0).toUpperCase()+e.slice(1),Iu=({className:e,onConversationClick:t,onNewConversation:n,onClose:r,currentConversationId:i,isLoading:o,conversations:s,botAvatar:a,botName:l,...u})=>{const{conversationHistory:f}=me;return k.jsxs("div",{...u,...f.container,className:ar(f.container.className,e),children:[k.jsxs("div",{...f.header,children:["Conversations",r&&k.jsx("div",{...f.closeButton,children:k.jsx(ou,{onClick:r})})]}),o?k.jsx("div",{...f.loaderContainer,children:k.jsx(My,{})}):k.jsx("div",{...f.scrollContainer,children:s.length===0?k.jsx("div",{...f.loaderContainer,children:"No conversation started yet"}):s.map(({id:c,lastMessage:h})=>{let d="";if(h.payload.type==="text")d=h.payload.text;else if(h.payload.type==="bloc"&&h.payload.items.some(m=>m.type==="text")){const m=h.payload.items.find(p=>p.type==="text");d=(m==null?void 0:m.payload.text)??""}else d="Sent an attachment";return k.jsxs("button",{...f.conversation.container,onClick:()=>t==null?void 0:t(c),"data-active":i===c?"":void 0,children:[h.author.type==="bot"?k.jsx(En,{userId:h.userId,src:a,...f.conversation.avatar,children:l??"Bot"}):k.jsx(En,{userId:h.userId,...f.conversation.avatar,fallback:f.conversation.userAvatar.className,children:k.jsx(lT,{strokeWidth:1.5})}),k.jsxs("div",{...f.conversation.content,children:[k.jsx("span",{...f.conversation.name,children:d}),k.jsx("span",{...f.conversation.timestamp,children:f_(Aw(h.createdAt))})]}),k.jsx(lp,{strokeWidth:1.5,...f.conversation.chevron})]},c)})}),k.jsxs("button",{...f.newConversation.button,onClick:n,children:[k.jsx(iT,{...f.newConversation.icon}),"New conversation"]})]})};Iu.displayName="ConversationHistory";const rv=({connected:e,configuration:t,isTyping:n,messages:r,user:i,isLoading:o,renderers:s,isReadOnly:a,disableComposer:l,error:u,participants:f,closeWindow:c,sendMessage:h,uploadFile:d,addMessageFeedback:m,listConversations:p,restartConversation:g,clientId:y,storageKey:v,soundOn:w,toggleSound:E,disableSendButton:S,conversationId:C,...I})=>{const{color:M,fontFamily:P,radius:T,themeMode:O,variant:U,headerVariant:F,botAvatar:L,botDescription:R,botName:N,composerPlaceholder:j,footer:B,feedbackEnabled:W,additionalStylesheetUrl:b,allowFileUpload:_,conversationHistory:H}=t,x={color:M,fontFamily:P,radius:T,themeMode:O,variant:U,headerVariant:F,additionalStylesheetUrl:b},[V,Y]=D.useState("chat"),q=nv({clientId:y,listConversations:p,userCredentials:i});D.useEffect(()=>{V==="conversations"&&q.refresh()},[V]),W||(m=void 0);const Q=D.useMemo(()=>i?nc(r,f,i.userId,N,L):[],[L,N,r,i,f]),X=D.useMemo(()=>{var te,$;return(($=(te=r.at(-1))==null?void 0:te.metadata)==null?void 0:$.conversationStatus)==="closed"},[r]),se=D.useRef(null),G=Qn(te=>te.setPortalContainer);return D.useEffect(()=>(G(se.current),()=>{G(null)}),[G]),k.jsxs(k.Fragment,{children:[k.jsx(Fg,{...x}),k.jsx("div",{ref:se,style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none",zIndex:10}}),k.jsx(eu,{connected:e,allowFileUpload:_,uploadFile:d,storageKey:v,conversationId:C,...I,children:u||q.error?k.jsx(Dy,{error:u||q.error,restartConversation:g,closeWindow:c}):V==="conversations"?k.jsx(Iu,{onClose:c,conversations:q.conversations,isLoading:q.isLoading,onNewConversation:()=>{g==null||g(),Y("chat")},onConversationClick:te=>{g==null||g(te),Y("chat")},botAvatar:L,botName:N}):k.jsxs(k.Fragment,{children:[k.jsx(Cy,{showConversationHistory:H?()=>Y("conversations"):void 0,closeWindow:c,configuration:t,restartConversation:g,clientId:y,soundOn:w,toggleSound:E}),o?k.jsx(My,{}):k.jsx(fu,{botAvatar:L,botDescription:R,botName:N,renderers:s,isTyping:n,sendMessage:h,addMessageFeedback:m,messages:Q}),!X&&k.jsx(ng,{sendMessage:h,uploadFile:d,connected:e,isReadOnly:a,disableComposer:l,footer:B,composerPlaceholder:j,allowFileUpload:_,storageKey:v,disableSendButton:S,conversationId:C})]})})]})};function d_({configuration:e,storageKey:t,clientId:n,...r}){const i=t||`bp-webchat-${n}`,{messages:o,participants:s,sendMessage:a,uploadFile:l,saveMessageFeedback:u,conversationId:f,status:c,error:h,isTyping:d,isAwaitingResponse:m}=zy(),{openConversation:p,listConversations:g}=Uy(),{userCredentials:y}=By(),{soundOn:v,toggleSound:w}=$y({storageKey:i,soundEnabled:e==null?void 0:e.soundEnabled});return k.jsx(rv,{configuration:e??{},user:y,isLoading:c==="connecting",isTyping:d,connected:c==="connected"?!0:c==="disconnected"?!1:void 0,messages:o,sendMessage:a,uploadFile:l,addMessageFeedback:u,listConversations:g,restartConversation:p,participants:s,error:h,clientId:n,soundOn:v,toggleSound:w,disableSendButton:m,conversationId:f,storageKey:i,...r})}const h_=({clientId:e,storageKey:t,configuration:n,apiUrl:r,user:i,conversationId:o,...s})=>{const a=t||`bp-webchat-${e}`;return k.jsx(gy,{clientId:e,apiUrl:r,userCredentials:i,conversationId:o,storageKey:a,storageLocation:n==null?void 0:n.storageLocation,adminSecret:n==null?void 0:n.adminSecret,children:k.jsx(d_,{configuration:n,storageKey:t,clientId:e,...s})})};function p_(e,t=globalThis==null?void 0:globalThis.document){const n=Ln(e);A.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var m_="DismissableLayer",Ou="dismissableLayer.update",g_="dismissableLayer.pointerDownOutside",y_="dismissableLayer.focusOutside",iv,ov=A.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),sv=A.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,onDismiss:a,...l}=e,u=A.useContext(ov),[f,c]=A.useState(null),h=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,d]=A.useState({}),m=tn(t,I=>c(I)),p=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=p.indexOf(g),v=f?p.indexOf(f):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,E=v>=y,S=w_(I=>{const M=I.target,P=[...u.branches].some(T=>T.contains(M));!E||P||(i==null||i(I),s==null||s(I),I.defaultPrevented||a==null||a())},h),C=S_(I=>{const M=I.target;[...u.branches].some(T=>T.contains(M))||(o==null||o(I),s==null||s(I),I.defaultPrevented||a==null||a())},h);return p_(I=>{v===u.layers.size-1&&(r==null||r(I),!I.defaultPrevented&&a&&(I.preventDefault(),a()))},h),A.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(iv=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),av(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=iv)}},[f,h,n,u]),A.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),av())},[f,u]),A.useEffect(()=>{const I=()=>d({});return document.addEventListener(Ou,I),()=>document.removeEventListener(Ou,I)},[]),k.jsx(Ft.div,{...l,ref:m,style:{pointerEvents:w?E?"auto":"none":void 0,...e.style},onFocusCapture:Zt(e.onFocusCapture,C.onFocusCapture),onBlurCapture:Zt(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:Zt(e.onPointerDownCapture,S.onPointerDownCapture)})});sv.displayName=m_;var v_="DismissableLayerBranch",b_=A.forwardRef((e,t)=>{const n=A.useContext(ov),r=A.useRef(null),i=tn(t,r);return A.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),k.jsx(Ft.div,{...e,ref:i})});b_.displayName=v_;function w_(e,t=globalThis==null?void 0:globalThis.document){const n=Ln(e),r=A.useRef(!1),i=A.useRef(()=>{});return A.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let l=function(){lv(g_,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=l,t.addEventListener("click",i.current,{once:!0})):l()}else t.removeEventListener("click",i.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function S_(e,t=globalThis==null?void 0:globalThis.document){const n=Ln(e),r=A.useRef(!1);return A.useEffect(()=>{const i=o=>{o.target&&!r.current&&lv(y_,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function av(){const e=new CustomEvent(Ou);document.dispatchEvent(e)}function lv(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?u2(i,o):i.dispatchEvent(o)}var Mu="focusScope.autoFocusOnMount",Du="focusScope.autoFocusOnUnmount",uv={bubbles:!1,cancelable:!0},x_="FocusScope",cv=A.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[a,l]=A.useState(null),u=Ln(i),f=Ln(o),c=A.useRef(null),h=tn(t,p=>l(p)),d=A.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;A.useEffect(()=>{if(r){let p=function(w){if(d.paused||!a)return;const E=w.target;a.contains(E)?c.current=E:gn(c.current,{select:!0})},g=function(w){if(d.paused||!a)return;const E=w.relatedTarget;E!==null&&(a.contains(E)||gn(c.current,{select:!0}))},y=function(w){if(document.activeElement===document.body)for(const S of w)S.removedNodes.length>0&&gn(a)};document.addEventListener("focusin",p),document.addEventListener("focusout",g);const v=new MutationObserver(y);return a&&v.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",g),v.disconnect()}}},[r,a,d.paused]),A.useEffect(()=>{if(a){hv.add(d);const p=document.activeElement;if(!a.contains(p)){const y=new CustomEvent(Mu,uv);a.addEventListener(Mu,u),a.dispatchEvent(y),y.defaultPrevented||(k_(I_(fv(a)),{select:!0}),document.activeElement===p&&gn(a))}return()=>{a.removeEventListener(Mu,u),setTimeout(()=>{const y=new CustomEvent(Du,uv);a.addEventListener(Du,f),a.dispatchEvent(y),y.defaultPrevented||gn(p??document.body,{select:!0}),a.removeEventListener(Du,f),hv.remove(d)},0)}}},[a,u,f,d]);const m=A.useCallback(p=>{if(!n&&!r||d.paused)return;const g=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,y=document.activeElement;if(g&&y){const v=p.currentTarget,[w,E]=E_(v);w&&E?!p.shiftKey&&y===E?(p.preventDefault(),n&&gn(w,{select:!0})):p.shiftKey&&y===w&&(p.preventDefault(),n&&gn(E,{select:!0})):y===v&&p.preventDefault()}},[n,r,d.paused]);return k.jsx(Ft.div,{tabIndex:-1,...s,ref:h,onKeyDown:m})});cv.displayName=x_;function k_(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(gn(r,{select:t}),document.activeElement!==n)return}function E_(e){const t=fv(e),n=dv(t,e),r=dv(t.reverse(),e);return[n,r]}function fv(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 dv(e,t){for(const n of e)if(!C_(n,{upTo:t}))return n}function C_(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 A_(e){return e instanceof HTMLInputElement&&"select"in e}function gn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&A_(e)&&t&&e.select()}}var hv=T_();function T_(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=pv(e,t),e.unshift(t)},remove(t){var n;e=pv(e,t),(n=e[0])==null||n.resume()}}}function pv(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function I_(e){return e.filter(t=>t.tagName!=="A")}var Nu=0;function O_(){A.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??mv()),document.body.insertAdjacentElement("beforeend",e[1]??mv()),Nu++,()=>{Nu===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Nu--}},[])}function mv(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Yo="right-scroll-bar-position",Ko="width-before-scroll-bar",M_="with-scroll-bars-hidden",D_="--removed-body-scroll-bar-size";function _u(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function N_(e,t){var n=D.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}var __=typeof window<"u"?A.useLayoutEffect:A.useEffect,gv=new WeakMap;function P_(e,t){var n=N_(null,function(r){return e.forEach(function(i){return _u(i,r)})});return __(function(){var r=gv.get(n);if(r){var i=new Set(r),o=new Set(e),s=n.current;i.forEach(function(a){o.has(a)||_u(a,null)}),o.forEach(function(a){i.has(a)||_u(a,s)})}gv.set(n,e)},[e]),n}function L_(e){return e}function F_(e,t){t===void 0&&(t=L_);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(o){var s=t(o,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(o){for(r=!0;n.length;){var s=n;n=[],s.forEach(o)}n={push:function(a){return o(a)},filter:function(){return n}}},assignMedium:function(o){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(o),s=n}var l=function(){var f=s;s=[],f.forEach(o)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(f){s.push(f),u()},filter:function(f){return s=s.filter(f),n}}}};return i}function R_(e){e===void 0&&(e={});var t=F_(null);return t.options=xt({async:!0,ssr:!1},e),t}var yv=function(e){var t=e.sideCar,n=Np(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 A.createElement(r,xt({},n))};yv.isSideCarExport=!0;function $_(e,t){return e.useMedium(t),yv}var vv=R_(),Pu=function(){},Go=A.forwardRef(function(e,t){var n=A.useRef(null),r=A.useState({onScrollCapture:Pu,onWheelCapture:Pu,onTouchMoveCapture:Pu}),i=r[0],o=r[1],s=e.forwardProps,a=e.children,l=e.className,u=e.removeScrollBar,f=e.enabled,c=e.shards,h=e.sideCar,d=e.noRelative,m=e.noIsolation,p=e.inert,g=e.allowPinchZoom,y=e.as,v=y===void 0?"div":y,w=e.gapMode,E=Np(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=h,C=P_([n,t]),I=xt(xt({},E),i);return A.createElement(A.Fragment,null,f&&A.createElement(S,{sideCar:vv,removeScrollBar:u,shards:c,noRelative:d,noIsolation:m,inert:p,setCallbacks:o,allowPinchZoom:!!g,lockRef:n,gapMode:w}),s?A.cloneElement(A.Children.only(a),xt(xt({},I),{ref:C})):A.createElement(v,xt({},I,{className:l,ref:C}),a))});Go.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Go.classNames={fullWidth:Ko,zeroRight:Yo};var B_=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function z_(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=B_();return t&&e.setAttribute("nonce",t),e}function U_(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function j_(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var H_=function(){var e=0,t=null;return{add:function(n){e==0&&(t=z_())&&(U_(t,n),j_(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},V_=function(){var e=H_();return function(t,n){A.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},bv=function(){var e=V_(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},W_={left:0,top:0,right:0,gap:0},Lu=function(e){return parseInt(e||"",10)||0},q_=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[Lu(n),Lu(r),Lu(i)]},Y_=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return W_;var t=q_(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])}},K_=bv(),pr="data-scroll-locked",G_=function(e,t,n,r){var i=e.left,o=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
327
- .`.concat(M_,` {
323
+ `&&r++}}return[t,n]}class Zg extends Event{constructor(t,n){var r,i;super(t),this.code=(r=n==null?void 0:n.code)!=null?r:void 0,this.message=(i=n==null?void 0:n.message)!=null?i:void 0}[Symbol.for("nodejs.util.inspect.custom")](t,n,r){return r(Jg(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(Jg(this),n)}}function IN(e){const t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function Hl(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(Hl).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${Hl(e.cause)}`:e.message:`${e}`}function Jg(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var Xg=e=>{throw TypeError(e)},jl=(e,t,n)=>t.has(e)||Xg("Cannot "+n),be=(e,t,n)=>(jl(e,t,"read from private field"),n?n.call(e):t.get(e)),Ke=(e,t,n)=>t.has(e)?Xg("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Le=(e,t,n,r)=>(jl(e,t,"write to private field"),t.set(e,n),n),Qt=(e,t,n)=>(jl(e,t,"access private method"),n),dt,_n,ur,Po,Lo,fi,cr,di,pn,fr,dr,hr,hi,Lt,Vl,Wl,ql,ey,Yl,Kl,pi,Gl,Ql;class Fo extends EventTarget{constructor(t,n){var r,i;super(),Ke(this,Lt),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,Ke(this,dt),Ke(this,_n),Ke(this,ur),Ke(this,Po),Ke(this,Lo),Ke(this,fi),Ke(this,cr),Ke(this,di,null),Ke(this,pn),Ke(this,fr),Ke(this,dr,null),Ke(this,hr,null),Ke(this,hi,null),Ke(this,Wl,async o=>{var s;be(this,fr).reset();const{body:a,redirected:l,status:u,headers:f}=o;if(u===204){Qt(this,Lt,pi).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(l?Le(this,ur,new URL(o.url)):Le(this,ur,void 0),u!==200){Qt(this,Lt,pi).call(this,`Non-200 status code (${u})`,u);return}if(!(f.get("content-type")||"").startsWith("text/event-stream")){Qt(this,Lt,pi).call(this,'Invalid content type, expected "text/event-stream"',u);return}if(be(this,dt)===this.CLOSED)return;Le(this,dt,this.OPEN);const c=new Event("open");if((s=be(this,hi))==null||s.call(this,c),this.dispatchEvent(c),typeof a!="object"||!a||!("getReader"in a)){Qt(this,Lt,pi).call(this,"Invalid response body, expected a web ReadableStream",u),this.close();return}const h=new TextDecoder,d=a.getReader();let m=!0;do{const{done:p,value:g}=await d.read();g&&be(this,fr).feed(h.decode(g,{stream:!p})),p&&(m=!1,be(this,fr).reset(),Qt(this,Lt,Gl).call(this))}while(m)}),Ke(this,ql,o=>{Le(this,pn,void 0),!(o.name==="AbortError"||o.type==="aborted")&&Qt(this,Lt,Gl).call(this,Hl(o))}),Ke(this,Yl,o=>{typeof o.id=="string"&&Le(this,di,o.id);const s=new MessageEvent(o.event||"message",{data:o.data,origin:be(this,ur)?be(this,ur).origin:be(this,_n).origin,lastEventId:o.id||""});be(this,hr)&&(!o.event||o.event==="message")&&be(this,hr).call(this,s),this.dispatchEvent(s)}),Ke(this,Kl,o=>{Le(this,fi,o)}),Ke(this,Ql,()=>{Le(this,cr,void 0),be(this,dt)===this.CONNECTING&&Qt(this,Lt,Vl).call(this)});try{if(t instanceof URL)Le(this,_n,t);else if(typeof t=="string")Le(this,_n,new URL(t,ON()));else throw new Error("Invalid URL")}catch{throw IN("An invalid or illegal string was specified")}Le(this,fr,AN({onEvent:be(this,Yl),onRetry:be(this,Kl)})),Le(this,dt,this.CONNECTING),Le(this,fi,3e3),Le(this,Lo,(r=n==null?void 0:n.fetch)!=null?r:globalThis.fetch),Le(this,Po,(i=n==null?void 0:n.withCredentials)!=null?i:!1),Qt(this,Lt,Vl).call(this)}get readyState(){return be(this,dt)}get url(){return be(this,_n).href}get withCredentials(){return be(this,Po)}get onerror(){return be(this,dr)}set onerror(t){Le(this,dr,t)}get onmessage(){return be(this,hr)}set onmessage(t){Le(this,hr,t)}get onopen(){return be(this,hi)}set onopen(t){Le(this,hi,t)}addEventListener(t,n,r){const i=n;super.addEventListener(t,i,r)}removeEventListener(t,n,r){const i=n;super.removeEventListener(t,i,r)}close(){be(this,cr)&&clearTimeout(be(this,cr)),be(this,dt)!==this.CLOSED&&(be(this,pn)&&be(this,pn).abort(),Le(this,dt,this.CLOSED),Le(this,pn,void 0))}}dt=new WeakMap,_n=new WeakMap,ur=new WeakMap,Po=new WeakMap,Lo=new WeakMap,fi=new WeakMap,cr=new WeakMap,di=new WeakMap,pn=new WeakMap,fr=new WeakMap,dr=new WeakMap,hr=new WeakMap,hi=new WeakMap,Lt=new WeakSet,Vl=function(){Le(this,dt,this.CONNECTING),Le(this,pn,new AbortController),be(this,Lo)(be(this,_n),Qt(this,Lt,ey).call(this)).then(be(this,Wl)).catch(be(this,ql))},Wl=new WeakMap,ql=new WeakMap,ey=function(){var e;const t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...be(this,di)?{"Last-Event-ID":be(this,di)}:void 0},cache:"no-store",signal:(e=be(this,pn))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},Yl=new WeakMap,Kl=new WeakMap,pi=function(e,t){var n;be(this,dt)!==this.CLOSED&&Le(this,dt,this.CLOSED);const r=new Zg("error",{code:t,message:e});(n=be(this,dr))==null||n.call(this,r),this.dispatchEvent(r)},Gl=function(e,t){var n;if(be(this,dt)===this.CLOSED)return;Le(this,dt,this.CONNECTING);const r=new Zg("error",{code:t,message:e});(n=be(this,dr))==null||n.call(this,r),this.dispatchEvent(r),Le(this,cr,setTimeout(be(this,Ql),be(this,fi)))},Ql=new WeakMap,Fo.CONNECTING=0,Fo.OPEN=1,Fo.CLOSED=2;function ON(){const e="document"in globalThis?globalThis.document:void 0;return e&&typeof e=="object"&&"baseURI"in e&&typeof e.baseURI=="string"?e.baseURI:void 0}async function MN(e){var t;const n=await e.clone().json();if((t=n==null?void 0:n.id)!=null&&t.startsWith("err_")){const r=new Error(n.message);throw r.id=n.id,r.code=n.code,r.type=n.type,r}return e}const ty=()=>{const e={};return{on:(t,n)=>{var r;return e[t]||(e[t]=new Set),(r=e[t])==null||r.add(n),()=>{var i;return(i=e[t])==null?void 0:i.delete(n)}},emit:(t,n)=>{var r,i;(r=e[t])==null||r.forEach(o=>o(n)),(i=e["*"])==null||i.forEach(o=>o({type:t,payload:n}))}}},Ue=e=>e.data,ny=10,ry=3e3,DN="60000",NN={throwOnError:!0},_N=({conversationId:e,userToken:t,clientId:n,apiUrl:r,adminSecret:i})=>{let o=0,s=null;const a=ty(),l=()=>{s&&s.close();const u=`${`${r||Pe.getConfig().baseUrl}/${n}`}/initialize${e?`?conversationId=${e}`:""}`,f={...i?{"x-admin-secret":i}:{},...t?{"x-user-key":t}:{}};s=oy(u,f),s.addEventListener("open",()=>a.emit("open")),s.addEventListener("error",c=>{o<ny?(o++,setTimeout(()=>l(),ry)):a.emit("error",c)}),s.addEventListener("message",c=>{const h=iy(c.data);a.emit(h.type,h.data)})};return l(),a.on},PN=({userKey:e,clientId:t,apiUrl:n,customHeaders:r,advancedOptions:i})=>{const o={"x-user-key":e,...r},s=`${n||Pe.getConfig().baseUrl}/${t}`,a={...NN,baseUrl:s};return Pe.interceptors.response._fns.length===0&&Pe.interceptors.response.use(MN),{createConversation:()=>aN({...a,headers:o,body:{}}).then(Ue),getConversation:({conversationId:l})=>oN({...a,headers:o,path:{id:l}}).then(Ue),deleteConversation:({conversationId:l})=>iN({...a,headers:o,path:{id:l}}).then(Ue),listConversations:({nextToken:l})=>sN({...a,headers:o,query:{nextToken:l}}).then(Ue),listConversationMessages:({conversationId:l,nextToken:u})=>lN({...a,headers:o,path:{id:l},query:{nextToken:u}}).then(Ue),addParticipant:({conversationId:l,userId:u})=>cN({...a,headers:o,path:{id:l},body:{userId:u}}).then(Ue),removeParticipant:({conversationId:l,userId:u})=>fN({...a,headers:o,path:{id:l,userId:u}}).then(Ue),getParticipant:({conversationId:l,userId:u})=>dN({...a,headers:o,path:{id:l,userId:u}}).then(Ue),listParticipants:({conversationId:l,nextToken:u})=>uN({...a,headers:o,path:{id:l},query:{nextToken:u}}).then(Ue),createMessage:l=>gN({...a,headers:o,body:l}).then(Ue),updateMessage:({messageId:l,...u})=>mN({...a,headers:o,path:{id:l},body:u}).then(Ue),getMessage:({messageId:l})=>pN({...a,headers:o,path:{id:l}}).then(Ue),deleteMessage:({messageId:l})=>hN({...a,headers:o,path:{id:l}}).then(Ue),createFile:l=>CN({...a,headers:o,body:l}).then(Ue),getUser:()=>wN({...a,headers:o}).then(Ue),updateUser:l=>SN({...a,headers:o,body:l}).then(Ue),deleteUser:()=>bN({...a,headers:o}).then(Ue),createEvent:l=>EN({...a,headers:o,body:l}).then(Ue),getEvent:({eventId:l})=>kN({...a,headers:o,path:{id:l}}).then(Ue),addMessageFeedback:({messageId:l,...u})=>vN({...a,headers:o,path:{id:l},body:u}).then(Ue),removeMessageFeedback:({messageId:l})=>yN({...a,headers:o,path:{id:l}}).then(Ue),generateUserKey:({adminSecret:l,...u})=>xN({...a,headers:{"x-admin-secret":l},body:u}).then(Ue),listenConversation:({conversationId:l})=>{let u=0,f=null;const c=ty(),h=()=>{f&&f.close();const d=`${s}/conversations/${l}/listen`,m=i==null?void 0:i.eventSource;f=m?m({url:d,headers:o}):oy(d,o),f.addEventListener("open",()=>c.emit("open")),f.addEventListener("error",p=>{u<ny?(u++,setTimeout(()=>h(),ry)):c.emit("error",p)}),f.addEventListener("message",p=>{const g=iy(p.data);c.emit(g.type,g.data)})};return h(),c.on}}},iy=e=>{try{return JSON.parse(e)}catch{return e}},oy=(e,t)=>new Fo(e,{fetch:(n,r)=>fetch(n,{...r,headers:{...r==null?void 0:r.headers,...t,timeout:DN}})}),LN=async({apiUrl:e,clientId:t,adminSecret:n,clientHeaders:r,emitter:i,conversationId:o,userToken:s})=>new Promise(a=>{const l=_N({apiUrl:e,clientId:t,userToken:s,conversationId:o,adminSecret:n}),u=l("init",({conversation:f,messages:c,participants:h,user:d})=>{const m=PN({clientId:t,apiUrl:e,userKey:d.userKey,customHeaders:r});m.createEvent({conversationId:f.id,payload:{type:"conversation_started",data:{}}}).then(({event:p})=>{var g,v;(v=(g=p.payload.data)==null?void 0:g.status)!=null&&v.isInitial&&i.emit("conversation",f.id)}),a({on:l,conversation:f,messages:c,participants:h,user:d,client:m,onCleanup:()=>{u()}})})}),FN={webchat:"#9C27B0",client:"#2196F3",store:"#4CAF50",events:"#00BCD4"},RN={debug:"#9E9E9E",info:"#2196F3",warn:"#FF9800",error:"#F44336"};let sy=!1,Zl=null,ay=Date.now();const $N=e=>{sy=e,ay=Date.now()},BN=e=>{Zl=e},zN=()=>{const e=Date.now()-ay,t=Math.floor(e/1e3),n=e%1e3;return`+${t}.${n.toString().padStart(3,"0")}s`},UN=e=>e===void 0?"undefined":e===null?"null":e instanceof Error?{error:e.message,stack:e.stack}:e,Ro=e=>{const t=FN[e]||"#666",n=(r,...i)=>{if(!sy&&r!=="warn"&&r!=="error")return;const o=zN(),s=`%c[bp:${e}]%c ${o} %c${r.toUpperCase()}%c`,a=[`color: ${t}; font-weight: bold;`,"color: #999; font-size: 10px;",`color: ${RN[r]}; font-weight: bold;`,"color: inherit;"],l=i.map(UN);if(console[r](s,...a,...l),Zl){const[u,f]=i;Zl(`debug:${e}:${r}`,{message:typeof u=="string"?u:void 0,...typeof f=="object"&&f!==null?f:{}})}};return{debug:(...r)=>n("debug",...r),info:(...r)=>n("info",...r),warn:(...r)=>n("warn",...r),error:(...r)=>n("error",...r)}},ly={webchat:Ro("webchat"),client:Ro("client"),store:Ro("store"),events:Ro("events")};function uy(){const[e,t]=M.useState(!1),n=M.useRef(null);return{state:e,setState:(r,i)=>{if(t(r),!r)return()=>{};if(n.current=new Date,!i)return()=>{};const o=setTimeout(()=>{const s=n.current;s&&new Date().getTime()-s.getTime()>i&&t(!1)},i+100);return()=>clearTimeout(o)}}}const mi=ly.webchat;function cy({apiUrl:e="https://webchat.botpress.cloud",clientId:t,storageKey:n,storageLocation:r,adminSecret:i,clientHeaders:o,playNotificationSound:s,...a}){const l=Sp(n,r),u=l(O=>O.conversationId),f=l(O=>O.user),c=l(O=>O.setConversationId),h=l(O=>O.setUser),{state:d,setState:m}=uy(),{state:p,setState:g}=uy(),v=M.useMemo(()=>nc(),[]),[y,w]=M.useState("connecting"),[A,k]=M.useState(void 0),[E,I]=M.useState(void 0),D=M.useRef(null),P=Vw(a.conversationId,a.userToken,u,f==null?void 0:f.userToken);M.useEffect(()=>{let O=!1;mi.info("starting initialization",{clientId:t,apiUrl:e,storageKey:n});const B=async()=>{var F;await T(P),O&&(mi.debug("initialization completed but effect was cleaned up, tearing down"),(F=D.current)==null||F.call(D),D.current=null)},L=Hw(t,e);if(L){mi.error("configuration error",L),I(L),w("error");return}return B(),()=>{O=!0,D.current&&(D.current(),D.current=null)}},[a.conversationId,a.userToken,t,e]);const T=async({conversationId:O,userToken:B})=>{var V;(V=D.current)==null||V.call(D),I(void 0),m(!1),g(!1),w("connecting");const{on:L,conversation:F,messages:R,participants:N,user:H,client:z,onCleanup:W}=await LN({apiUrl:e,clientId:t,clientHeaders:o,emitter:v,adminSecret:i,conversationId:O,userToken:B});k(z),c(F.id),h({userId:H.id,userToken:H.userKey});const b=wp(F.id),_=R.reverse().map(lr).filter(Boolean);b.getState().setMessages(_);const j=kp(F.id);j.getState().setParticipants(N);const S=[W,L("open",()=>{I(void 0),w("connected")}),L("error",Y=>{mi.error("connection error",{error:Y,conversationId:F.id}),I(q=>q||Pr(Y)),w("error"),v.emit("error",new Error(`Connection to conversation lost: ${Y==null?void 0:Y.message}`))}),L("message_created",Y=>{const q=lr(Y);b.getState().saveMessage(q),H.id!==q.authorId&&(s==null||s(),m(!1),g(!1),v.emit("isTyping",{isTyping:!1,timeout:0})),v.emit("message",q)}),L("message_updated",Y=>{const q=lr(Y);b.getState().saveMessage(q)}),L("message_status_changed",Y=>{var q;Y.newStatus==="processing"&&b.getState().updateMessage((q=Y.message.metadata)==null?void 0:q.clientMessageId,{status:Y.newStatus})}),L("typing_stopped",()=>{m(!1),g(!1)}),L("typing_started",()=>{m(!0,5e3),g(!0,5e3),v.emit("isTyping",{isTyping:!0,timeout:5e3})}),L("participant_added",Y=>{j.getState().addParticipant(Y.participant),v.emit("participantAdded",Y.participant)}),L("participant_removed",Y=>{j.getState().removeParticipant(Y.participantId),v.emit("participantRemoved",Y.participantId)}),L("webchat_visibility",Y=>v.emit("webchatVisibility",Y.visibility)),L("webchat_config",Y=>v.emit("webchatConfig",Y.config)),L("custom",Y=>v.emit("customEvent",Y.event))];w("connected"),mi.info("client fully connected with event handlers ready",{conversationId:F.id}),D.current=()=>{S.forEach(Y=>Y())}};return{clientState:y,httpClient:A,error:E,activeConversationId:u,userCredentials:f,isTyping:d,isAwaitingResponse:p,openConversation:T,setAwaitingResponse:g,emitter:v,setError:I,setClientState:w}}const fy=M.createContext(null);function $o(){const e=M.useContext(fy);if(!e)throw new Error("useWebchatContext must be used inside <WebchatProvider>");return e}function dy({clientId:e,apiUrl:t,storageKey:n,storageLocation:r,adminSecret:i,clientHeaders:o,children:s,...a}){var k;const{clientState:l,httpClient:u,error:f,activeConversationId:c,userCredentials:h,isTyping:d,isAwaitingResponse:m,openConversation:p,setClientState:g,setError:v,setAwaitingResponse:y,emitter:w}=cy({apiUrl:t,clientId:e,storageKey:n,storageLocation:r,adminSecret:i,clientHeaders:o,conversationId:a.conversationId,userToken:(k=a.userCredentials)==null?void 0:k.userToken}),A={client:u,clientState:l,setClientState:g,conversationId:c,userCredentials:h,error:f,setError:v,isTyping:d,isAwaitingResponse:m,openConversation:p,setAwaitingResponse:y,emitter:w};return x.jsx(fy.Provider,{value:A,children:s})}const Jl=({children:e,className:t,uploadFile:n,allowFileUpload:r,storageKey:i,conversationId:o,...s})=>{const{container:a}=ye,l=Qn(g=>g.setMessageContainerRef),f=xp(o||"default",i)(g=>g.uploadFile),[c,h]=M.useState(0),d=M.useRef(null);M.useEffect(()=>{l(d)},[d,l]);const m=M.useCallback(g=>{n&&(g.forEach(v=>f(v,n)),h(0))},[f,n]),{getRootProps:p}=Og({noClick:!0,noKeyboard:!0,onDrop:m,disabled:!(r&&n),onDragEnter:()=>h(g=>g+1),onDragLeave:()=>h(g=>g-1)});return x.jsxs("div",{...s,className:ar(a.className,t),...p(),ref:d,children:[x.jsxs("div",{"data-hover":c>0,...a.dropzone.overlay,children:["Drop files to upload",x.jsx(_A,{style:{width:"50px"}})]}),x.jsx(Dg,{children:e})]})};Jl.displayName="Container";const hy=M.forwardRef(({onClick:e,imgUrl:t,...n},r)=>{const{fab:i}=ye,{container:o,icon:s,image:a}=i??{};return t?x.jsx("img",{src:t,role:"button",tabIndex:0,...a,draggable:"false",onClick:e}):x.jsx("div",{...n,...o,ref:r,onClick:e,children:x.jsx("div",{...s})})});hy.displayName="Fab";function Zt(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function HN(e,t){const n=C.createContext(t),r=o=>{const{children:s,...a}=o,l=C.useMemo(()=>a,Object.values(a));return x.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function i(o){const s=C.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function py(e,t=[]){let n=[];function r(o,s){const a=C.createContext(s),l=n.length;n=[...n,s];const u=c=>{var v;const{scope:h,children:d,...m}=c,p=((v=h==null?void 0:h[e])==null?void 0:v[l])||a,g=C.useMemo(()=>m,Object.values(m));return x.jsx(p.Provider,{value:g,children:d})};u.displayName=o+"Provider";function f(c,h){var p;const d=((p=h==null?void 0:h[e])==null?void 0:p[l])||a,m=C.useContext(d);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${c}\` must be used within \`${o}\``)}return[u,f]}const i=()=>{const o=n.map(s=>C.createContext(s));return function(a){const l=(a==null?void 0:a[e])||o;return C.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,jN(i,...t)]}function jN(...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(o){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const c=l(o)[`__scope${u}`];return{...a,...c}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var VN=C[" useInsertionEffect ".trim().toString()]||en;function my({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,s]=WN({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:i;{const f=C.useRef(e!==void 0);C.useEffect(()=>{const c=f.current;c!==a&&console.warn(`${r} is changing from ${c?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=a},[a,r])}const u=C.useCallback(f=>{var c;if(a){const h=qN(f)?f(e):f;h!==e&&((c=s.current)==null||c.call(s,h))}else o(f)},[a,e,o,s]);return[l,u]}function WN({defaultProp:e,onChange:t}){const[n,r]=C.useState(e),i=C.useRef(n),o=C.useRef(t);return VN(()=>{o.current=t},[t]),C.useEffect(()=>{var s;i.current!==n&&((s=o.current)==null||s.call(o,n),i.current=n)},[n,i]),[n,r,o]}function qN(e){return typeof e=="function"}function gy(e){const t=YN(e),n=C.forwardRef((r,i)=>{const{children:o,...s}=r,a=C.Children.toArray(o),l=a.find(GN);if(l){const u=l.props.children,f=a.map(c=>c===l?C.Children.count(u)>1?C.Children.only(null):C.isValidElement(u)?u.props.children:null:c);return x.jsx(t,{...s,ref:i,children:C.isValidElement(u)?C.cloneElement(u,void 0,f):null})}return x.jsx(t,{...s,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function YN(e){const t=C.forwardRef((n,r)=>{const{children:i,...o}=n;if(C.isValidElement(i)){const s=ZN(i),a=QN(o,i.props);return i.type!==C.Fragment&&(a.ref=r?ns(r,s):s),C.cloneElement(i,a)}return C.Children.count(i)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var KN=Symbol("radix.slottable");function GN(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===KN}function QN(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{const l=o(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function ZN(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var JN=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ft=JN.reduce((e,t)=>{const n=gy(`Primitive.${t}`),r=C.forwardRef((i,o)=>{const{asChild:s,...a}=i,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(l,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function XN(e,t){e&&$u.flushSync(()=>e.dispatchEvent(t))}function e2(e,t){return C.useReducer((n,r)=>t[n][r]??n,e)}var Bo=e=>{const{present:t,children:n}=e,r=t2(t),i=typeof n=="function"?n({present:r.isPresent}):C.Children.only(n),o=tn(r.ref,n2(i));return typeof n=="function"||r.isPresent?C.cloneElement(i,{ref:o}):null};Bo.displayName="Presence";function t2(e){const[t,n]=C.useState(),r=C.useRef(null),i=C.useRef(e),o=C.useRef("none"),s=e?"mounted":"unmounted",[a,l]=e2(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{const u=zo(r.current);o.current=a==="mounted"?u:"none"},[a]),en(()=>{const u=r.current,f=i.current;if(f!==e){const h=o.current,d=zo(u);e?l("MOUNT"):d==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(f&&h!==d?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),en(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,c=d=>{const p=zo(r.current).includes(CSS.escape(d.animationName));if(d.target===t&&p&&(l("ANIMATION_END"),!i.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},h=d=>{d.target===t&&(o.current=zo(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:C.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function zo(e){return(e==null?void 0:e.animationName)||"none"}function n2(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var r2=C[" useId ".trim().toString()]||(()=>{}),i2=0;function Uo(e){const[t,n]=C.useState(r2());return en(()=>{n(r=>r??String(i2++))},[e]),e||(t?`radix-${t}`:"")}var Ho="Collapsible",[o2]=py(Ho),[s2,Xl]=o2(Ho),yy=C.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:s,...a}=e,[l,u]=my({prop:r,defaultProp:i??!1,onChange:s,caller:Ho});return x.jsx(s2,{scope:n,disabled:o,contentId:Uo(),open:l,onOpenToggle:C.useCallback(()=>u(f=>!f),[u]),children:x.jsx(Ft.div,{"data-state":tu(l),"data-disabled":o?"":void 0,...a,ref:t})})});yy.displayName=Ho;var vy="CollapsibleTrigger",by=C.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=Xl(vy,n);return x.jsx(Ft.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":tu(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:Zt(e.onClick,i.onOpenToggle)})});by.displayName=vy;var eu="CollapsibleContent",wy=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Xl(eu,e.__scopeCollapsible);return x.jsx(Bo,{present:n||i.open,children:({present:o})=>x.jsx(a2,{...r,ref:t,present:o})})});wy.displayName=eu;var a2=C.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=e,s=Xl(eu,n),[a,l]=C.useState(r),u=C.useRef(null),f=tn(t,u),c=C.useRef(0),h=c.current,d=C.useRef(0),m=d.current,p=s.open||a,g=C.useRef(p),v=C.useRef(void 0);return C.useEffect(()=>{const y=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(y)},[]),en(()=>{const y=u.current;if(y){v.current=v.current||{transitionDuration:y.style.transitionDuration,animationName:y.style.animationName},y.style.transitionDuration="0s",y.style.animationName="none";const w=y.getBoundingClientRect();c.current=w.height,d.current=w.width,g.current||(y.style.transitionDuration=v.current.transitionDuration,y.style.animationName=v.current.animationName),l(r)}},[s.open,r]),x.jsx(Ft.div,{"data-state":tu(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!p,...o,ref:f,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:p&&i})});function tu(e){return e?"open":"closed"}var l2=yy,u2=wy;const nu=({restartConversation:e,...t})=>{var o,s;const{header:n}=ye,{showInputModal:r}=qa(),i=async a=>{a.stopPropagation(),r?r({title:"Create New Conversation",description:"This will clear the current conversation and start a new one.",confirmButtonText:"New conversation",cancelButtonText:"Cancel"}).then(()=>e()):e()};return x.jsx(YA,{...t,...(s=(o=n==null?void 0:n.content)==null?void 0:o.actions)==null?void 0:s.icons,"aria-label":"Restart Conversation Button",tabIndex:0,role:"button",onClick:i})},ru=({onClick:e,...t})=>{const{header:n}=ye,r=i=>{i.stopPropagation(),e==null||e()};return x.jsx(up,{...t,...n.content.actions.icons,role:"button",tabIndex:0,"aria-label":"Close Chatbot Button",onClick:r,onKeyDown:i=>{i.key==="Enter"&&r(i)}})},c2=({onClick:e,...t})=>{const{header:n}=ye,r=i=>{i.stopPropagation(),e==null||e()};return x.jsx(rp,{...t,...n.content.actions.icons,role:"button",tabIndex:0,"aria-label":"Show Recent Conversations Button",onClick:r,onKeyDown:i=>{i.key==="Enter"&&r(i)}})},gi=({icon:e,title:t,link:n,...r})=>{var s,a,l,u,f,c,h,d,m,p,g,v;const{header:i}=ye,o=e??PA;return t?n?x.jsxs("a",{...r,...(a=(s=i.expandedContent)==null?void 0:s.descriptionItems)==null?void 0:a.container,href:n,target:"_blank",rel:"noreferrer noopener",children:[x.jsx(o,{...(u=(l=i.expandedContent)==null?void 0:l.descriptionItems)==null?void 0:u.icon}),x.jsx("p",{...(c=(f=i.expandedContent)==null?void 0:f.descriptionItems)==null?void 0:c.link,children:t})]}):x.jsxs("div",{...r,...(d=(h=i.expandedContent)==null?void 0:h.descriptionItems)==null?void 0:d.container,children:[x.jsx(o,{...(p=(m=i.expandedContent)==null?void 0:m.descriptionItems)==null?void 0:p.icon}),x.jsx("p",{...(v=(g=i.expandedContent)==null?void 0:g.descriptionItems)==null?void 0:v.text,children:t})]}):null},f2=({soundOn:e,toggleSound:t})=>{const n=o=>{o.stopPropagation(),t==null||t()},{header:r}=ye,i=e?lp:eT;return x.jsx("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),n(o))},title:e?"Disable chat sounds":"Enable chat sounds",...r.content.actions.icons,children:x.jsx(i,{size:16})})},Sy=({defaultOpen:e,closeWindow:t,configuration:n,restartConversation:r,showConversationHistory:i,disabled:o,soundOn:s,toggleSound:a,clientId:l,...u})=>{var p,g,v,y,w,A,k,E,I,D,P,T,O,B,L,F,R,N,H,z,W,b,_,j;const{header:f}=ye,[c,h]=M.useState(e),d=!!((p=n.email)!=null&&p.title)||!!((g=n.phone)!=null&&g.title)||!!((v=n.website)!=null&&v.title)||!!((y=n.termsOfService)!=null&&y.link)||!!((w=n.privacyPolicy)!=null&&w.link),m=d&&!o;return x.jsxs(l2,{open:m?c:!1,onOpenChange:m?h:void 0,"data-disabled":m?void 0:"",...f.container,...u,children:[x.jsxs(by,{"aria-label":"Expand Header Button",...f.content.container,children:[x.jsx("div",{...f.content.conversationHistory,children:i&&!c&&x.jsx(c2,{onClick:i})}),x.jsx(En,{userId:l,src:n.botAvatar,...f.content.avatar,children:n.botName||"Bot"}),x.jsx("h2",{...f.content.title,children:n.botName||"Bot"}),n.botDescription&&x.jsx("p",{...f.content.description,children:n.botDescription}),x.jsxs("div",{...f.content.actions.container,children:[n.soundEnabled&&s!==void 0&&a&&x.jsx(f2,{soundOn:s,toggleSound:a}),r&&x.jsx(nu,{restartConversation:r}),t&&x.jsx(ru,{onClick:t})]})]}),d&&x.jsxs(u2,{...f.expandedContent.container,children:[x.jsxs("div",{"data-links":"",...f.expandedContent.group,children:[x.jsx(gi,{"data-email":"",icon:UA,title:(A=n.email)==null?void 0:A.title,link:(E=(k=n.email)==null?void 0:k.link)!=null&&E.startsWith("mailto:")?(I=n.email)==null?void 0:I.link:`mailto:${(D=n.email)==null?void 0:D.link}`}),x.jsx(gi,{"data-phone":"",icon:WA,title:(P=n.phone)==null?void 0:P.title,link:(O=(T=n.phone)==null?void 0:T.link)!=null&&O.startsWith("tel:")?(B=n.phone)==null?void 0:B.link:`tel:${(L=n.phone)==null?void 0:L.link}`}),x.jsx(gi,{"data-website":"",link:(F=n.website)==null?void 0:F.link,icon:RA,title:(R=n.website)==null?void 0:R.title})]}),x.jsxs("div",{"data-legal":"",...(N=f.expandedContent)==null?void 0:N.group,children:[((H=n.termsOfService)==null?void 0:H.link)&&x.jsx(gi,{"data-terms":"",link:(z=n.termsOfService)==null?void 0:z.link,icon:sp,title:(W=n.termsOfService)==null?void 0:W.title}),((b=n.privacyPolicy)==null?void 0:b.link)&&x.jsx(gi,{"data-privacy":"",link:(_=n.privacyPolicy)==null?void 0:_.link,icon:zA,title:(j=n.privacyPolicy)==null?void 0:j.title})]})]})]})},iu=M.memo(({...e})=>{const{typingIndicator:t}=ye;return x.jsx("div",{...e,...t==null?void 0:t.container,children:x.jsx("div",{...t==null?void 0:t.loader})})});iu.displayName="TypingIndicator";const ou=M.memo(M.forwardRef(({direction:e,block:t,disableInput:n,children:r,sender:i,id:o,authorId:s,status:a,renderers:l,isReadOnly:u,isLastDeliveredMessage:f,feedback:c,timestamp:h,metadata:d,sendMessage:m,addMessageFeedback:p,showAvatar:g},v)=>{const[y,w]=M.useState([]),{message:{container:A,deliveryStatus:k}}=ye;return g=g??e==="incoming",x.jsx(Va.Provider,{value:{isLoading:y,setIsLoading:w},children:x.jsxs("div",{...A,className:ar(A==null?void 0:A.className,f&&(k==null?void 0:k.className)),"data-loaded":y.length===0,"data-disable-input":!!n,"data-direction":e,dir:"auto",ref:v,children:[e==="incoming"&&g&&x.jsx(xy,{authorId:s,sender:i}),t&&x.jsx(Dn,{block:{...t,isReadOnly:u,direction:e,timestamp:h,sender:i,feedback:c,messageId:o,status:a,metadata:d,sendMessage:m,addMessageFeedback:p},renderers:l}),e==="outgoing"&&g&&x.jsx(xy,{authorId:s,sender:i}),r]})})})),xy=({authorId:e,sender:t})=>{const{message:{avatar:n}}=ye,[r,i]=M.useState("idle"),o=Ku(e??"",15);return x.jsxs(us,{"data-color":o,"data-loading-status":r,...n==null?void 0:n.container,children:[x.jsx(cs,{...n==null?void 0:n.image,onLoadingStatusChange:i,src:t==null?void 0:t.avatar}),x.jsxs(fs,{...n==null?void 0:n.fallback,children:[t==null?void 0:t.name[0]," "]})]})};function d2({botAvatar:e,botDescription:t,botName:n}){const{messageList:{marquee:r}}=ye;return x.jsxs("li",{...r.container,children:[x.jsx(En,{src:e,...r.avatar,children:(n||"Bot").slice(0,1)}),x.jsxs("div",{...r.content,children:[x.jsx("h1",{...r.title,children:n||"Bot"}),x.jsx("p",{...r.description,children:t})]})]})}let su=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");const h2=70,p2=300;function m2(e,t={}){const n=t.nearBottomThreshold??h2,[r,i]=M.useState(!0),o=M.useRef(null),s=M.useRef(0),a=M.useRef(!0),l=M.useRef(!1),u=M.useRef(!1),f=M.useRef(0),c=M.useCallback(y=>y.scrollHeight-y.clientHeight-y.scrollTop<n,[n]),h=M.useCallback((y,w=p2)=>{cancelAnimationFrame(f.current);const A=y.scrollTop,k=performance.now(),E=()=>{const I=performance.now()-k,D=Math.min(I/w,1),P=1-Math.pow(1-D,3),T=y.scrollHeight-y.clientHeight;y.scrollTop=A+(T-A)*P,s.current=y.scrollTop,D<1&&u.current?f.current=requestAnimationFrame(E):(y.scrollTop=y.scrollHeight-y.clientHeight,s.current=y.scrollTop,u.current=!1,a.current=!0,i(!0))};u.current=!0,f.current=requestAnimationFrame(E)},[]),d=M.useCallback(()=>{const y=o.current;y&&(a.current=!0,i(!0),h(y))},[h]),m=M.useCallback(()=>{const y=o.current;if(!y)return;if(l.current){l.current=!1,s.current=y.scrollTop,a.current=c(y);return}if(u.current){s.current=y.scrollTop,c(y)&&(u.current=!1,l.current=!0,y.scrollTop=y.scrollHeight-y.clientHeight,s.current=y.scrollTop,a.current=!0,i(!0));return}s.current=y.scrollTop;const w=c(y);a.current=w,i(w)},[c]),p=M.useCallback(y=>{y.deltaY<0&&(cancelAnimationFrame(f.current),u.current=!1,a.current=!1,i(!1))},[]),g=M.useCallback(()=>{u.current&&(cancelAnimationFrame(f.current),u.current=!1)},[]),v=M.useCallback(y=>{const w=o.current;w&&(w.removeEventListener("scroll",m),w.removeEventListener("wheel",p),w.removeEventListener("touchstart",g)),o.current=y,y&&(y.addEventListener("scroll",m,{passive:!0}),y.addEventListener("wheel",p,{passive:!0}),y.addEventListener("touchstart",g,{passive:!0}),s.current=y.scrollTop)},[m,p,g]);return M.useLayoutEffect(()=>{const y=o.current;if(y)if(a.current){const w=y.scrollHeight-y.clientHeight,A=w-y.scrollTop;A>0&&A<=y.clientHeight&&y.clientHeight>0?(u.current=!0,y.scrollTo({top:w,behavior:"smooth"}),cancelAnimationFrame(f.current),f.current=requestAnimationFrame(()=>{u.current&&o.current&&c(o.current)&&(u.current=!1,a.current=!0,i(!0))})):(cancelAnimationFrame(f.current),u.current=!1,y.scrollTop=w),s.current=w,a.current=!0}else l.current=!0,y.scrollTop=s.current},[e,c]),M.useEffect(()=>{const y=o.current;if(!y)return;const w=y.firstElementChild;if(!w)return;const A=new ResizeObserver(()=>{o.current&&(u.current||(a.current?(l.current=!0,o.current.scrollTop=o.current.scrollHeight-o.current.clientHeight,s.current=o.current.scrollTop):o.current.scrollTop=s.current))});return A.observe(w),()=>A.disconnect()},[]),M.useEffect(()=>{const y=window.visualViewport;if(!y)return;const w=()=>{const A=o.current;A&&(u.current||a.current&&(l.current=!0,A.scrollTop=A.scrollHeight-A.clientHeight,s.current=A.scrollTop))};return y.addEventListener("resize",w),()=>y.removeEventListener("resize",w)},[]),M.useEffect(()=>{const y=o.current;if(!y)return;let w=!1;const A=new IntersectionObserver(k=>{var E,I;(E=k[0])!=null&&E.isIntersecting&&w&&a.current&&(y.scrollTop=y.scrollHeight-y.clientHeight,s.current=y.scrollTop),w=!((I=k[0])!=null&&I.isIntersecting)});return A.observe(y),()=>A.disconnect()},[]),M.useEffect(()=>()=>cancelAnimationFrame(f.current),[]),{scrollRef:v,isAtBottom:r,scrollToBottom:d}}const g2={height:"100%",width:"100%",overflowY:"auto",scrollbarWidth:"none",overscrollBehaviorY:"contain"},au=M.memo(({className:e,messages:t=[],isTyping:n,headerMessage:r,renderers:i,botAvatar:o,botDescription:s,botName:a,sendMessage:l,addMessageFeedback:u,showMarquee:f=!0,showDateSystemMessage:c=!0,showMessageStatus:h=!0,showIncomingMessageAvatar:d=!0,showOutgoingMessageAvatar:m=!1,...p})=>{var T;const{messageList:g}=ye,v=M.useMemo(()=>c?db(t):t,[t]),y=M.useMemo(()=>{var B;const O=v.filter(L=>L.direction==="outgoing"&&L.status!=="pending");return(B=O[O.length-1])==null?void 0:B.id},[v]),w=v[v.length-1],A=(w==null?void 0:w.id)??"",k=`${v.length}:${A}:${n}`,{scrollRef:E,isAtBottom:I,scrollToBottom:D}=m2(k);M.useEffect(()=>{(w==null?void 0:w.direction)==="outgoing"&&D()},[A]);const P=O=>{if(O.direction==="incoming")return d;if(O.direction==="outgoing")return m};return x.jsxs("div",{...p,className:ar(g.container.className,e),children:[x.jsx("div",{ref:E,style:g2,children:x.jsxs("div",{className:g.viewPort.className,children:[r&&x.jsx("span",{...g.headerMessage,children:r}),f&&x.jsx(d2,{botAvatar:o,botDescription:s,botName:a}),v.map(O=>{var B;return x.jsx(ou,{renderers:i,sendMessage:l,addMessageFeedback:u,isLastDeliveredMessage:h&&O.id===y,showAvatar:P(O),...O},((B=O.metadata)==null?void 0:B.clientMessageId)||O.id)}),n&&x.jsx(ou,{id:su(),renderers:i,sendMessage:l,direction:"incoming",timestamp:new Date,showAvatar:d,block:void 0,sender:((T=t.filter(O=>O.direction==="incoming").at(-1))==null?void 0:T.sender)??{name:a||"Bot",avatar:o},children:x.jsx(iu,{})})]})}),!I&&x.jsx("button",{className:g.scrollDownButton.className,onClick:()=>D()})]})});au.displayName="MessageList";const ky=({className:e,...t})=>{const{className:n}=ye.loader;return x.jsx("div",{...t,className:ar(e,n)})};function Ey({error:e,restartConversation:t,closeWindow:n}){let r,i;const{error:o}=ye;return e.type==="configuration"?(r="Configuration error",i=x.jsx(VA,{...o.icon})):e.type==="bot"?(r="Bot error",i=x.jsx(np,{...o.icon})):e.type==="network"?(r="Network error",i=x.jsx(tT,{...o.icon})):e.type==="disconnected"?(r="Disconnected",i=x.jsx(ZA,{...o.icon})):(r="Unexpected error",i=x.jsx(np,{...o.icon})),x.jsx(y2,{error:e,title:r,icon:i,restartConversation:t,closeWindow:n})}function y2({error:e,title:t,icon:n,restartConversation:r,closeWindow:i}){const{error:o}=ye;return x.jsxs("div",{...o.container,children:[x.jsxs("div",{...o.header.container,children:[`Webchat ${e.type} error`,x.jsxs("div",{...o.header.actions,children:[r&&x.jsx(nu,{restartConversation:r,style:{color:"white",backgroundColor:"transparent"}}),i&&x.jsx(ru,{onClick:i,style:{color:"white",backgroundColor:"transparent"}})]})]}),x.jsxs("div",{...o.content,children:[n,x.jsx("div",{...o.errorTitle,children:t}),x.jsx("div",{...o.errorMessage,children:e.message}),e.id&&x.jsx("div",{...o.id,children:e.id})]})]})}const yi=ly.webchat;async function v2(e,t){const{userId:n,conversationId:r,userToken:i,openConversation:o,setClientState:s,setError:a,emitter:l}=t;yi.warn("handleWebchatError",{userId:n,conversationId:r,type:e.type,message:e.message});const f=[{name:"startNewConversation",predicate:c=>c.message===Fs||c.type==="ResourceNotFound",recover:async()=>o({userToken:i})},{name:"reopenConversation",predicate:c=>c.type==="network",recover:async()=>o({userToken:i,conversationId:r})}].find(c=>c.predicate(e));if(!f){yi.error("no recovery strategy found, setting error state",{userId:n,conversationId:r}),s("error"),a(e);return}yi.info("attempting recovery",{userId:n,conversationId:r,strategy:f.name});try{await Kf(f.recover,3,5e3),yi.info("recovery successful",{userId:n,conversationId:r}),a(void 0),s("connected")}catch(c){yi.error("recovery failed",{error:c,userId:n,conversationId:r}),a(Pr(c)),s("error"),l.emit("error",c)}}function b2(e,t){return async(...n)=>{try{return await e(...n)}catch(r){await v2(Pr(r),t)}}}function Cy(e,t){const n={};for(const[r,i]of Object.entries(e))n[r]=b2(i,t);return n}function Ay({client:e,conversationId:t}){return{sendEvent:async(r,i)=>{if(!e||!t)throw new Error("Cannot send event: client or conversationId not available");await e.createEvent({conversationId:t,payload:{type:"custom",data:r},bindConversation:(i==null?void 0:i.bindConversation)??!0,bindUser:(i==null?void 0:i.bindUser)??!0})}}}function Ty({client:e,conversationId:t,user:n}){return{uploadFile:async i=>{if(!e)throw new Error("Client not initialized");if(!t)throw new Error("No active conversation");if(!n)throw new Error("User not authenticated");const{size:o,name:s}=i,a=await jw(i),l=new Date;l.setDate(l.getDate()+30);const{file:{uploadUrl:u,contentType:f,url:c,id:h}}=await e.createFile({size:o,key:`${su(6)}-${i.name}`,accessPolicies:["public_content"],index:!1,tags:{source:"integration",integrationName:"webchat",conversation:t,user:n.userId},expiresAt:l.toISOString()});await fetch(u,{method:"PUT",headers:{"x-amz-tagging":"public=true","content-type":f},body:a});const d=f.split("/").shift()??"",m=Lf(d)?d:"file";return{fileUrl:c,name:s,type:m,fileId:h}}}}function Iy({client:e,conversationId:t,userId:n,setAwaitingResponse:r}){const i=wp(t||"default"),o=i(d=>d.messages),s=i(d=>d.saveMessage),a=i(d=>d.updateMessage),l=i(d=>d.setMessages),u=i(d=>d.clearMessages);return{messages:o,sendMessage:async d=>{if(!e||!t||!n)throw console.log("Cannot send message: client, conversationId, or userId not available",e,t,n),new Error("Cannot send message: client, conversationId, or userId not available");r==null||r(!0);const m=su(),p={id:m,createdAt:new Date().toISOString(),userId:n,conversationId:t,payload:d,metadata:{clientMessageId:m,delivered:!1}},g=lr(p);g.status="pending",s(g),await e.createMessage({conversationId:t,payload:d,metadata:{clientMessageId:m}})},setMessages:d=>{const m=d.map(p=>lr(p)).filter(Boolean);l(m)},clearMessages:u,saveMessageFeedback:async(d,m)=>{if(!e)throw new Error("Cannot update feedback: client not available");a(d,{feedback:m.value}),await e.addMessageFeedback({messageId:d,...m})}}}function Oy({client:e,conversationId:t}){const n=kp(t||"default"),r=n(u=>u.participants),i=n(u=>u.setParticipants),o=n(u=>u.addParticipant),s=n(u=>u.removeParticipant),a=n(u=>u.clearParticipants);return{participants:r,setParticipants:i,fetchParticipants:async()=>{if(!e||!t)return;const{participants:u}=await e.listParticipants({conversationId:t});i(u)},clearParticipants:a,addParticipant:o,removeParticipant:s}}const My={chatMessageNotification:new URL("data:audio/ogg;base64,T2dnUwACAAAAAAAAAAAVJAEzAAAAAOU+A6UBHgF2b3JiaXMAAAAAASJWAAD/////AH0AAP////+pAU9nZ1MAAAAAAAAAAAAAFSQBMwEAAAD3T/UfDpz////////////////FA3ZvcmJpcwwAAABMYXZmNjEuNy4xMDAEAAAAHwAAAGVuY29kZXI9TGF2YzYxLjE5LjEwMSBsaWJ2b3JiaXMrAAAAZW5jb2RlZF9ieT1BZG9iZSBQcmVtaWVyZSBQcm8gMjAyNS4wIChNYWNpbhcAAAB0aW1lX3JlZmVyZW5jZT0xMjExMDQwMA8AAABkYXRlPTIwMjUtMDgtMDUBBXZvcmJpcyJCQ1YBAEAAABhCECoFrWOOOsgVIYwZoqBCyinHHULQIaMkQ4g6xjXHGGNHuWSKQsmB0JBVAABAAACkHFdQckkt55xzoxhXzHHoIOecc+UgZ8xxCSXnnHOOOeeSco4x55xzoxhXDnIpLeecc4EUR4pxpxjnnHOkHEeKcagY55xzbTG3knLOOeecc+Ygh1JyrjXnnHOkGGcOcgsl55xzxiBnzHHrIOecc4w1t9RyzjnnnHPOOeecc84555xzjDHnnHPOOeecc24x5xZzrjnnnHPOOeccc84555xzIDRkFQCQAACgoSiK4igOEBqyCgDIAAAQQHEUR5EUS7Ecy9EkDQgNWQUAAAEACAAAoEiGpEiKpViOZmmeJnqiKJqiKquyacqyLMuy67ouEBqyCgBIAABQURTFcBQHCA1ZBQBkAAAIYCiKoziO5FiSpVmeB4SGrAIAgAAABAAAUAxHsRRN8STP8jzP8zzP8zzP8zzP8zzP8zzP8zwNCA1ZBQAgAAAAgihkGANCQ1YBAEAAAAghGhlDnVISXAoWQhwRQx1CzkOppYPgKYUlY9JTrEEIIXzvPffee++B0JBVAAAQAABhFDiIgcckCCGEYhQnRHGmIAghhOUkWMp56CQI3YMQQrice8u59957IDRkFQAACADAIIQQQgghhBBCCCmklFJIKaaYYoopxxxzzDHHIIMMMuigk046yaSSTjrKJKOOUmsptRRTTLHlFmOttdacc69BKWOMMcYYY4wxxhhjjDHGGCMIDVkFAIAAABAGGWSQQQghhBRSSCmmmHLMMcccA0JDVgEAgAAAAgAAABxFUiRHciRHkiTJkixJkzzLszzLszxN1ERNFVXVVW3X9m1f9m3f1WXf9mXb1WVdlmXdtW1d1l1d13Vd13Vd13Vd13Vd13Vd14HQkFUAgAQAgI7kOI7kOI7kSI6kSAoQGrIKAJABABAAgKM4iuNIjuRYjiVZkiZplmd5lqd5mqiJHhAasgoAAAQAEAAAAAAAgKIoiqM4jiRZlqZpnqd6oiiaqqqKpqmqqmqapmmapmmapmmapmmapmmapmmapmmapmmapmmapmmapmkCoSGrAAAJAAAdx3EcR3Ecx3EkR5IkIDRkFQAgAwAgAABDURxFcizHkjRLszzL00TP9FxRNnVTV20gNGQVAAAIACAAAAAAAADHczzHczzJkzzLczzHkzxJ0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRNA0JDVgIAZAAAEJOQSk6xV0YpxiS0XiqkFJPUe6iYYkw67alCBikHuYdKIaWg094ypZBSDHunmELIGOqhg5AxhbDX2nPPvfceCA1ZEQBEAQAAxiDGEGPIMSYlgxIxxyRkUiLnnJROSialpFZazKSEmEqLkXNOSiclk1JaC6llkkprJaYCAAACHAAAAiyEQkNWBABRAACIMUgppBRSSjGnmENKKceUY0gp5ZxyTjnHmHQQKucYdA5KpJRyjjmnnHMSMgeVcw5CJp0AAIAABwCAAAuh0JAVAUCcAACAkHOKMQgRYxBCCSmFUFKqnJPSQUmpg5JSSanFklKMlXNSOgkpdRJSKinFWFKKLaRUY2kt19JSjS3GnFuMvYaUYi2p1Vpaq7nFWHOLNffIOUqdlNY6Ka2l1mpNrdXaSWktpNZiaS3G1mLNKcacMymthZZiK6nF2GLLNbWYc2kt1xRjzynGnmusucecgzCt1ZxayznFmHvMseeYcw+Sc5Q6Ka11UlpLrdWaWqs1k9Jaaa3GkFqLLcacW4sxZ1JaLKnFWFqKMcWYc4st19BarinGnFOLOcdag5Kx9l5aqznFmHuKreeYczA2x547SrmW1nourfVecy5C1tyLaC3n1GoPKsaec87B2NyDEK3lnGrsPcXYe+45GNtz8K3W4FvNRcicg9C5+KZ7MEbV2oPMtQiZcxA66CJ08Ml4lGoureVcWus91hp8zTkI0VruKcbeU4u9156bsL0HIVrLPcXYg4ox+JpzMDrnYlStwcecg5C1FqF7L0rnIJSqtQeZa1Ay1yJ08MXooIsvAABgwAEAIMCEMlBoyIoAIE4AgEHIOaUYhEopCKGElEIoKVWMSciYg5IxJ6WUUloIJbWKMQiZY1Iyx6SEEloqJbQSSmmplNJaKKW1llqMKbUWQymphVJaK6W0llqqMbVWY8SYlMw5KZljUkoprZVSWqsck5IxKKmDkEopKcVSUouVc1Iy6Kh0EEoqqcRUUmmtpNJSKaXFklJsKcVUW4u1hlJaLKnEVlJqMbVUW4sx14gxKRlzUjLnpJRSUiultJY5J6WDjkrmoKSSUmulpBQz5qR0DkrKIKNSUootpRJTKKW1klJspaTWWoy1ptRaLSW1VlJqsZQSW4sx1xZLTZ2U1koqMYZSWmsx5ppaizGUElspKcaSSmytxZpbbDmGUlosqcRWSmqx1ZZja7Hm1FKNKbWaW2y5xpRTj7X2nFqrNbVUY2ux5lhbb7XWnDsprYVSWislxZhai7HFWHMoJbaSUmylpBhbbLm2FmMPobRYSmqxpBJjazHmGFuOqbVaW2y5ptRirbX2HFtuPaUWa4ux5tJSjTXX3mNNORUAADDgAAAQYEIZKDRkJQAQBQAAGMMYYxAapZxzTkqDlHPOScmcgxBCSplzEEJIKXNOQkotZc5BSKm1UEpKrcUWSkmptRYLAAAocAAACLBBU2JxgEJDVgIAUQAAiDFKMQahMUYp5yA0xijFGIRKKcack1ApxZhzUDLHnINQSuaccxBKCSGUUkpKIYRSSkmpAACAAgcAgAAbNCUWByg0ZEUAEAUAABhjnDPOIQqdpc5SJKmj1lFrKKUaS4ydxlZ767nTGnttuTeUSo2p1o5ry7nV3mlNPbccCwAAO3AAADuwEAoNWQkA5AEAEMYoxZhzzhmFGHPOOecMUow555xzijHnnIMQQsWYc85BCCFzzjkIoYSSOecchBBK6JyDUEoppXTOQQihlFI65yCEUkopnXMQSimllAIAgAocAAACbBTZnGAkqNCQlQBAHgAAYAxCzklprWHMOQgt1dgwxhyUlGKLnIOQUou5RsxBSCnGoDsoKbUYbPCdhJRaizkHk1KLNefeg0iptZqDzj3VVnPPvfecYqw1595zLwAAd8EBAOzARpHNCUaCCg1ZCQDkAQAQCCnFmHPOGaUYc8w554xSjDHmnHOKMcacc85BxRhjzjkHIWPMOecghJAx5pxzEELonHMOQgghdM45ByGEEDrnoIMQQgidcxBCCCGEAgCAChwAAAJsFNmcYCSo0JCVAEA4AAAAIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEELonHPOOeecc84555xzzjnnnHPOOScAyLfCAcD/wcYZVpLOCkeDCw1ZCQCEAwAACkEopWIQSiklkk46KZ2TUEopkYNSSumklFJKCaWUUkoIpZRSSggdlFJCKaWUUkoppZRSSimllFI6KaWUUkoppZTKOSmlk1JKKaVEzkkpIZRSSimlhFJKKaWUUkoppZRSSimllFJKKaWEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQCALgbHAAgEmycYSXprHA0uNCQlQBASAAAoBRzjkoIKZSQUqiYoo5CKSmkUkoKEWPOSeochVBSKKmDyjkIpaSUQiohdc5BByWFkFIJIZWOOugolFBSKiWU0jkopYQUSkoplZBCSKl0lFIoJZWUQiohlVJKSCWVEEoKnaRUSgqppFRSCJ10kEInJaSSSgqpk5RSKiWllEpKJXRSQioppRBCSqmUEEpIKaVOUkmppBRCKCGFlFJKJaWSSkohlVRCCaWklFIooaRUUkoppZJSKQAA4MABACDACDrJqLIIG0248AAUGrISACADAECUdNZpp0kiCDFFmScNKcYgtaQswxBTkonxFGOMOShGQw4x5JQYF0oIoYNiPCaVQ8pQUbm31DkFxRZjfO+xFwEAAAgCAASEBAAYICiYAQAGBwgjBwIdAQQObQCAgQiZCQwKocFBJgA8QERIBQCJCYrShS4IIYJ0EWTxwIUTN5644YQObRAAAAAAABAA8AEAkFAAERHRzFVYXGBkaGxwdHh8gIQEAAAAAAAIAHwAACQiQERENHMVFhcYGRobHB0eHyAhAQAAAAAAAAAAQEBAAAAAAAAgAAAAQEBPZ2dTAASuMwAAAAAAABUkATMCAAAACYS6sR4BAUQxGR89NxobGiEkKCknJiYmJSUhISEaFgwBAQEAAnyfvULHAlAEJgh2vpgQBMHIyMjIyNhIQOjz+ePz58+fL89xAwYBAFaH//3//7/xNw0MBoNB6qlPfWrUKQng+/0FABAAhLEjKuHFBwA4AHC9Fx4Oh7EwDEOgvnJ3RtV+Op0+nU6n5cyzEwAoltTpwed5dgVKMPoru90zNHGA7F0CP98BAAAAAHl9ePviAgCW+3rugPIDwC6BbWoTAFEAAADh5GpCCACgc+0zxlAAVKddkjDsA14GDoJtf7R+NkE4W23hI5mF3d74iVGvzg9PpA4cCQs66joePTmOfhgl7vNZzYzQADDyz30FAGSvVUZ6wJ4MAKbCGeb4+v5NLIdK3YvrLkCu98uV//FpXQNyKAKAV7r186fTktcJJgjAlVp1fUmaGgtrdAAuDXYJSPs/AAAAAHDnAeHxciEUAB76CvfarGjDzIjALoEd+/0EAAAAQNYeMrkBAF6ZKm8xuw94NtgloHDUCAAAAIAMJ5Qz2iUAvjhKL8lkfmA6wi6BWfNHgiAAAABq4eeqGgCg8+LAAXQAfhgqz2RKHzAVYJeAynEAIQEAALwq6tFbIQAEEIIO8iULngMAXhgajrw3D5iFWhe7BLZNrwCVKAAA0t2TfT8mADx0aMfS4CULeACvA14YWnasNht80ZpdAhv8BEiiAADgcbm4jo0JANAVCTRV6JqQS0OTADoAXhg6zWy+AZ3GsiDRAYJzgiQAAICnb9FLAQAUNQFd44AioMNJICUAfhi67ZRjA2IMSHTAJK0KkgAAAG7W0uLlEgC6KnQdDkgBlAAdJAB+GHpL40hATAASHSC5CZIAAAAGZ3J60ioBoKsBTQKE5KFJIJFAAp4Y+jp7cg4qINEBi+MASQAAAM8rmdZcAKApwFhNPHQkQEBRQwIAnhj6OZ8KIBwDiQ4Q9ApIFAAAQHRFd6FEALA0NaApQAegnPrDA54Y+nN+AYAIJDoAfgIkCgAAcLRlPVsLALqmKqFpHIwUwQEJCwCeKPpzEQA8kOgAyTlBAgAAgPnK3q8jAWAuJFBYOsbAAgCeKPolEQA8rMFCohQAAMxD2BdSAJYFdNThKcCkBQCOgwKeGPpzEQA8rEEhCQAAoCz4MRGA41gaQMBRjACexHugAACeGPqFCAAeugQAAHryFgBdRYGFhGeow8x7AJ4Y+iURADyIigIAliFAAcYWCQC11gGeGPolEQA8UAAAABoODg4=",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:ts&&ts.tagName.toUpperCase()==="SCRIPT"&&ts.src||new URL("index.umd.cjs",document.baseURI).href).href};function Dy({storageKey:e,soundEnabled:t}){const n=Ep(e||"bp-webchat"),r=n(u=>u.soundOn),i=n(u=>u.toggleSound),o=M.useRef(null),s=M.useRef(t??!1),a=M.useRef(r);M.useEffect(()=>{try{o.current=new Audio,o.current.preload="auto",o.current.src=My.chatMessageNotification,o.current.volume=.9}catch(u){console.error("Error loading sound effect:",u),o.current=null}},[]),M.useEffect(()=>{s.current=t??!1},[t]),M.useEffect(()=>{a.current=r},[r]);const l=M.useCallback(()=>{s.current&&a.current&&o.current&&o.current.play().catch(()=>{})},[]);return{soundOn:r,toggleSound:i,playNotificationSound:l}}function w2({apiUrl:e="https://webchat.botpress.cloud",clientId:t,storageKey:n,storageLocation:r,adminSecret:i,soundEnabled:o,clientHeaders:s,...a}){var N;const{soundOn:l,toggleSound:u,playNotificationSound:f}=Dy({storageKey:n,soundEnabled:o}),{clientState:c,httpClient:h,error:d,activeConversationId:m,userCredentials:p,isTyping:g,isAwaitingResponse:v,openConversation:y,setAwaitingResponse:w,emitter:A,setError:k,setClientState:E}=cy({apiUrl:e,clientId:t,storageKey:n,storageLocation:r,adminSecret:i,clientHeaders:s,conversationId:a.conversationId,userToken:(N=a.user)==null?void 0:N.userToken,playNotificationSound:f}),{messages:I,sendMessage:D,saveMessageFeedback:P}=Iy({client:h,conversationId:m,userId:p==null?void 0:p.userId,setAwaitingResponse:w}),{participants:T}=Oy({client:h,conversationId:m}),{uploadFile:O}=Ty({client:h,conversationId:m,user:p}),{sendEvent:B}=Ay({client:h,conversationId:m});if(c!=="connected"||!p||!m||!h)return{clientState:c,on:A.on,client:void 0,messages:[],conversationId:void 0,newConversation:H=>{y({conversationId:H,userToken:p==null?void 0:p.userToken}).catch(z=>{A.emit("error",z)})},user:void 0,isTyping:void 0,participants:[],toggleSound:u,soundOn:l,error:d,disableSendButton:v};const L={userId:p==null?void 0:p.userId,conversationId:m,userToken:p==null?void 0:p.userToken,openConversation:y,setClientState:E,setError:k,emitter:A},R={...Cy({sendMessage:async H=>D(H),sendEvent:B,uploadFile:O,addMessageFeedback:P},L),getUser:async()=>{const{user:H}=await h.getUser();return H},updateUser:async H=>{const{user:z}=await h.updateUser({name:H.name,pictureUrl:H.pictureUrl,userData:H.data});return z},listConversations:async()=>h.listConversations({})};return{clientState:"connected",on:A.on,client:R,messages:I,conversationId:m,newConversation:H=>{y({conversationId:H,userToken:p.userToken}).catch(z=>{A.emit("error",z)})},user:p,isTyping:g,participants:T,error:d,soundOn:l,toggleSound:u,disableSendButton:v}}const Ny=()=>{const{client:e,userCredentials:t}=$o();return e?{userCredentials:t,getUser:async()=>(await e.getUser()).user,updateUser:async i=>(await e.updateUser(i)).user}:{userCredentials:t,getUser:void 0,updateUser:void 0}};function _y(){const{client:e,conversationId:t,userCredentials:n,setAwaitingResponse:r,emitter:i,clientState:o,setClientState:s,setError:a,openConversation:l,error:u,isAwaitingResponse:f,isTyping:c}=$o(),{messages:h,sendMessage:d,saveMessageFeedback:m}=Iy({client:e,conversationId:t,userId:n==null?void 0:n.userId,setAwaitingResponse:r}),{participants:p}=Oy({client:e,conversationId:t}),{sendEvent:g}=Ay({client:e,conversationId:t}),{uploadFile:v}=Ty({client:e,conversationId:t,user:n}),y={userId:n==null?void 0:n.userId,userToken:n==null?void 0:n.userToken,conversationId:t,openConversation:l,setClientState:s,setError:a,emitter:i},w=Cy({sendMessage:d,saveMessageFeedback:m,sendEvent:g,uploadFile:v},y);return{conversationId:t,messages:h,participants:p,sendMessage:w.sendMessage,saveMessageFeedback:w.saveMessageFeedback,sendEvent:w.sendEvent,uploadFile:w.uploadFile,on:i.on,status:o,error:u,isAwaitingResponse:f,isTyping:c}}function Py(){const{client:e,openConversation:t,userCredentials:n}=$o();return e?{listConversations:async()=>e.listConversations({}),openConversation:i=>t({conversationId:i,userToken:n==null?void 0:n.userToken})}:{listConversations:void 0,openConversation:i=>t({conversationId:i,userToken:n==null?void 0:n.userToken})}}const Ly=0,Fy=1,Ry=2,$y=3;var By=Object.prototype.hasOwnProperty;function lu(e,t){var n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&lu(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(By.call(e,n)&&++r&&!By.call(t,n)||!(n in t)||!lu(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const Jt=new WeakMap,Xt=()=>{},rt=Xt(),uu=Object,we=e=>e===rt,Vt=e=>typeof e=="function",mn=(e,t)=>({...e,...t}),zy=e=>Vt(e.then),cu={},jo={},fu="undefined",vi=typeof window!=fu,du=typeof document!=fu,S2=vi&&"Deno"in window,x2=()=>vi&&typeof window.requestAnimationFrame!=fu,Uy=(e,t)=>{const n=Jt.get(e);return[()=>!we(t)&&e.get(t)||cu,r=>{if(!we(t)){const i=e.get(t);t in jo||(jo[t]=i),n[5](t,mn(i,r),i||cu)}},n[6],()=>!we(t)&&t in jo?jo[t]:!we(t)&&e.get(t)||cu]};let hu=!0;const k2=()=>hu,[pu,mu]=vi&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Xt,Xt],E2=()=>{const e=du&&document.visibilityState;return we(e)||e!=="hidden"},C2=e=>(du&&document.addEventListener("visibilitychange",e),pu("focus",e),()=>{du&&document.removeEventListener("visibilitychange",e),mu("focus",e)}),A2=e=>{const t=()=>{hu=!0,e()},n=()=>{hu=!1};return pu("online",t),pu("offline",n),()=>{mu("online",t),mu("offline",n)}},T2={isOnline:k2,isVisible:E2},I2={initFocus:C2,initReconnect:A2},Hy=!M.useId,pr=!vi||S2,O2=e=>x2()?window.requestAnimationFrame(e):setTimeout(e,1),gu=pr?M.useEffect:M.useLayoutEffect,yu=typeof navigator<"u"&&navigator.connection,jy=!pr&&yu&&(["slow-2g","2g"].includes(yu.effectiveType)||yu.saveData),Vo=new WeakMap,M2=e=>uu.prototype.toString.call(e),vu=(e,t)=>e===`[object ${t}]`;let D2=0;const bu=e=>{const t=typeof e,n=M2(e),r=vu(n,"Date"),i=vu(n,"RegExp"),o=vu(n,"Object");let s,a;if(uu(e)===e&&!r&&!i){if(s=Vo.get(e),s)return s;if(s=++D2+"~",Vo.set(e,s),Array.isArray(e)){for(s="@",a=0;a<e.length;a++)s+=bu(e[a])+",";Vo.set(e,s)}if(o){s="#";const l=uu.keys(e).sort();for(;!we(a=l.pop());)we(e[a])||(s+=a+":"+bu(e[a])+",");Vo.set(e,s)}}else s=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return s},wu=e=>{if(Vt(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?bu(e):"",[e,t]};let N2=0;const Su=()=>++N2;async function Vy(...e){const[t,n,r,i]=e,o=mn({populateCache:!0,throwOnError:!0},typeof i=="boolean"?{revalidate:i}:i||{});let s=o.populateCache;const a=o.rollbackOnError;let l=o.optimisticData;const u=h=>typeof a=="function"?a(h):a!==!1,f=o.throwOnError;if(Vt(n)){const h=n,d=[],m=t.keys();for(const p of m)!/^\$(inf|sub)\$/.test(p)&&h(t.get(p)._k)&&d.push(p);return Promise.all(d.map(c))}return c(n);async function c(h){const[d]=wu(h);if(!d)return;const[m,p]=Uy(t,d),[g,v,y,w]=Jt.get(t),A=()=>{const F=g[d];return(Vt(o.revalidate)?o.revalidate(m().data,h):o.revalidate!==!1)&&(delete y[d],delete w[d],F&&F[0])?F[0](Ry).then(()=>m().data):m().data};if(e.length<3)return A();let k=r,E,I=!1;const D=Su();v[d]=[D,0];const P=!we(l),T=m(),O=T.data,B=T._c,L=we(B)?O:B;if(P&&(l=Vt(l)?l(L,O):l,p({data:l,_c:L})),Vt(k))try{k=k(L)}catch(F){E=F,I=!0}if(k&&zy(k))if(k=await k.catch(F=>{E=F,I=!0}),D!==v[d][0]){if(I)throw E;return k}else I&&P&&u(E)&&(s=!0,p({data:L,_c:rt}));if(s&&!I)if(Vt(s)){const F=s(k,L);p({data:F,error:rt,_c:rt})}else p({data:k,error:rt,_c:rt});if(v[d][1]=Su(),Promise.resolve(A()).then(()=>{p({_c:rt})}),I){if(f)throw E;return}return k}}const Wy=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},_2=(e,t)=>{if(!Jt.has(e)){const n=mn(I2,t),r=Object.create(null),i=Vy.bind(rt,e);let o=Xt;const s=Object.create(null),a=(f,c)=>{const h=s[f]||[];return s[f]=h,h.push(c),()=>h.splice(h.indexOf(c),1)},l=(f,c,h)=>{e.set(f,c);const d=s[f];if(d)for(const m of d)m(c,h)},u=()=>{if(!Jt.has(e)&&(Jt.set(e,[r,Object.create(null),Object.create(null),Object.create(null),i,l,a]),!pr)){const f=n.initFocus(setTimeout.bind(rt,Wy.bind(rt,r,Ly))),c=n.initReconnect(setTimeout.bind(rt,Wy.bind(rt,r,Fy)));o=()=>{f&&f(),c&&c(),Jt.delete(e)}}};return u(),[e,i,u,o]}return[e,Jt.get(e)[4]]},P2=(e,t,n,r,i)=>{const o=n.errorRetryCount,s=i.retryCount,a=~~((Math.random()+.5)*(1<<(s<8?s:8)))*n.errorRetryInterval;!we(o)&&s>o||setTimeout(r,a,i)},L2=lu,[qy,F2]=_2(new Map),R2=mn({onLoadingSlow:Xt,onSuccess:Xt,onError:Xt,onErrorRetry:P2,onDiscarded:Xt,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:jy?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:jy?5e3:3e3,compare:L2,isPaused:()=>!1,cache:qy,mutate:F2,fallback:{}},T2),$2=(e,t)=>{const n=mn(e,t);if(t){const{use:r,fallback:i}=e,{use:o,fallback:s}=t;r&&o&&(n.use=r.concat(o)),i&&s&&(n.fallback=mn(i,s))}return n},B2=M.createContext({}),z2="$inf$",Yy=vi&&window.__SWR_DEVTOOLS_USE__,U2=Yy?window.__SWR_DEVTOOLS_USE__:[],H2=()=>{Yy&&(window.__SWR_DEVTOOLS_REACT__=M)},j2=e=>Vt(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],V2=()=>{const e=M.useContext(B2);return M.useMemo(()=>mn(R2,e),[e])},W2=e=>(t,n,r)=>e(t,n&&((...o)=>{const[s]=wu(t),[,,,a]=Jt.get(qy);if(s.startsWith(z2))return n(...o);const l=a[s];return we(l)?n(...o):(delete a[s],l)}),r),q2=U2.concat(W2),Y2=e=>function(...n){const r=V2(),[i,o,s]=j2(n),a=$2(r,s);let l=e;const{use:u}=a,f=(u||[]).concat(q2);for(let c=f.length;c--;)l=f[c](l);return l(i,o||a.fetcher||null,a)},K2=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const i=r.indexOf(n);i>=0&&(r[i]=r[r.length-1],r.pop())}};H2();const xu=M.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),ku={dedupe:!0},Ky=Promise.resolve(rt),G2=()=>Xt,Q2=Y2((e,t,n)=>{const{cache:r,compare:i,suspense:o,fallbackData:s,revalidateOnMount:a,revalidateIfStale:l,refreshInterval:u,refreshWhenHidden:f,refreshWhenOffline:c,keepPreviousData:h,strictServerPrefetchWarning:d}=n,[m,p,g,v]=Jt.get(r),[y,w]=wu(e),A=M.useRef(!1),k=M.useRef(!1),E=M.useRef(y),I=M.useRef(t),D=M.useRef(n),P=()=>D.current,T=()=>P().isVisible()&&P().isOnline(),[O,B,L,F]=Uy(r,y),R=M.useRef({}).current,N=we(s)?we(n.fallback)?rt:n.fallback[y]:s,H=(J,ue)=>{for(const de in R){const fe=de;if(fe==="data"){if(!i(J[fe],ue[fe])&&(!we(J[fe])||!i(q,ue[fe])))return!1}else if(ue[fe]!==J[fe])return!1}return!0},z=!A.current,W=M.useMemo(()=>{const J=O(),ue=F(),de=Me=>{const He=mn(Me);return delete He._k,(()=>{if(!y||!t||P().isPaused())return!1;if(z&&!we(a))return a;const ae=we(N)?He.data:N;return we(ae)||l})()?{isValidating:!0,isLoading:!0,...He}:He},fe=de(J),Ae=J===ue?fe:de(ue);let Fe=fe;return[()=>{const Me=de(O());return H(Me,Fe)?(Fe.data=Me.data,Fe.isLoading=Me.isLoading,Fe.isValidating=Me.isValidating,Fe.error=Me.error,Fe):(Fe=Me,Me)},()=>Ae]},[r,y]),b=as.useSyncExternalStore(M.useCallback(J=>L(y,(ue,de)=>{H(de,ue)||J()}),[r,y]),W[0],W[1]),_=m[y]&&m[y].length>0,j=b.data,S=we(j)?N&&zy(N)?xu(N):N:j,V=b.error,Y=M.useRef(S),q=h?we(j)?we(Y.current)?S:Y.current:j:S,Q=y&&we(S),X=M.useRef(null);!pr&&as.useSyncExternalStore(G2,()=>(X.current=!1,X),()=>(X.current=!0,X));const se=X.current;d&&se&&!o&&Q&&console.warn(`Missing pre-initiated data for serialized key "${y}" during server-side rendering. Data fetching should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);const G=!y||!t||P().isPaused()||_&&!we(V)?!1:z&&!we(a)?a:o?we(S)?!1:l:we(S)||l,te=we(b.isValidating)?G:b.isValidating,$=we(b.isLoading)?G:b.isLoading,ne=M.useCallback(async J=>{const ue=I.current;if(!y||!ue||k.current||P().isPaused())return!1;let de,fe,Ae=!0;const Fe=J||{},Me=!g[y]||!Fe.dedupe,He=()=>Hy?!k.current&&y===E.current&&A.current:y===E.current,ee={isValidating:!1,isLoading:!1},ae=()=>{B(ee)},U=()=>{const oe=g[y];oe&&oe[1]===fe&&delete g[y]},K={isValidating:!0};we(O().data)&&(K.isLoading=!0);try{if(Me&&(B(K),n.loadingTimeout&&we(O().data)&&setTimeout(()=>{Ae&&He()&&P().onLoadingSlow(y,n)},n.loadingTimeout),g[y]=[ue(w),Su()]),[de,fe]=g[y],de=await de,Me&&setTimeout(U,n.dedupingInterval),!g[y]||g[y][1]!==fe)return Me&&He()&&P().onDiscarded(y),!1;ee.error=rt;const oe=p[y];if(!we(oe)&&(fe<=oe[0]||fe<=oe[1]||oe[1]===0))return ae(),Me&&He()&&P().onDiscarded(y),!1;const le=O().data;ee.data=i(le,de)?le:de,Me&&He()&&P().onSuccess(de,y,n)}catch(oe){U();const le=P(),{shouldRetryOnError:he}=le;le.isPaused()||(ee.error=oe,Me&&He()&&(le.onError(oe,y,le),(he===!0||Vt(he)&&he(oe))&&(!P().revalidateOnFocus||!P().revalidateOnReconnect||T())&&le.onErrorRetry(oe,y,le,je=>{const Ge=m[y];Ge&&Ge[0]&&Ge[0]($y,je)},{retryCount:(Fe.retryCount||0)+1,dedupe:!0})))}return Ae=!1,ae(),!0},[y,r]),me=M.useCallback((...J)=>Vy(r,E.current,...J),[]);if(gu(()=>{I.current=t,D.current=n,we(j)||(Y.current=j)}),gu(()=>{if(!y)return;const J=ne.bind(rt,ku);let ue=0;P().revalidateOnFocus&&(ue=Date.now()+P().focusThrottleInterval);const fe=K2(y,m,(Ae,Fe={})=>{if(Ae==Ly){const Me=Date.now();P().revalidateOnFocus&&Me>ue&&T()&&(ue=Me+P().focusThrottleInterval,J())}else if(Ae==Fy)P().revalidateOnReconnect&&T()&&J();else{if(Ae==Ry)return ne();if(Ae==$y)return ne(Fe)}});return k.current=!1,E.current=y,A.current=!0,B({_k:w}),G&&(g[y]||(we(S)||pr?J():O2(J))),()=>{k.current=!0,fe()}},[y]),gu(()=>{let J;function ue(){const fe=Vt(u)?u(O().data):u;fe&&J!==-1&&(J=setTimeout(de,fe))}function de(){!O().error&&(f||P().isVisible())&&(c||P().isOnline())?ne(ku).then(ue):ue()}return ue(),()=>{J&&(clearTimeout(J),J=-1)}},[u,f,c,y]),M.useDebugValue(q),o){if(!Hy&&pr&&Q)throw new Error("Fallback data is required when using Suspense in SSR.");Q&&(I.current=t,D.current=n,k.current=!1);const J=v[y],ue=!we(J)&&Q?me(J):Ky;if(xu(ue),!we(V)&&Q)throw V;const de=Q?ne(ku):Ky;!we(q)&&Q&&(de.status="fulfilled",de.value=!0),xu(de)}return{mutate:me,get data(){return R.data=!0,q},get error(){return R.error=!0,V},get isValidating(){return R.isValidating=!0,te},get isLoading(){return R.isLoading=!0,$}}});function Gy({userCredentials:e,listConversations:t,clientId:n}){const r=!!e&&n&&t,{data:i,error:o,isValidating:s,mutate:a}=Q2(r?[n,"conversations",e==null?void 0:e.userId]:null,async()=>(await t({})).conversations.filter(Z2).sort((u,f)=>new Date(f.updatedAt).getTime()-new Date(u.updatedAt).getTime()).map(u=>({...u,lastMessage:{...u.lastMessage,author:{type:u.lastMessage.userId===(e==null?void 0:e.userId)?"user":"bot"}}})),{revalidateOnFocus:!1,revalidateOnReconnect:!0,dedupingInterval:2e3});return{conversations:i??[],isLoading:s,error:o&&Pr(o),refresh:async()=>await a()}}const Z2=e=>!!e.lastMessage,J2=e=>e==null||e.length===0?"":e.charAt(0).toUpperCase()+e.slice(1),Eu=({className:e,onConversationClick:t,onNewConversation:n,onClose:r,currentConversationId:i,isLoading:o,conversations:s,botAvatar:a,botName:l,...u})=>{const{conversationHistory:f}=ye;return x.jsxs("div",{...u,...f.container,className:ar(f.container.className,e),children:[x.jsxs("div",{...f.header,children:["Conversations",r&&x.jsx("div",{...f.closeButton,children:x.jsx(ru,{onClick:r})})]}),o?x.jsx("div",{...f.loaderContainer,children:x.jsx(ky,{})}):x.jsx("div",{...f.scrollContainer,children:s.length===0?x.jsx("div",{...f.loaderContainer,children:"No conversation started yet"}):s.map(({id:c,lastMessage:h})=>{let d="";if(h.payload.type==="text")d=h.payload.text;else if(h.payload.type==="bloc"&&h.payload.items.some(m=>m.type==="text")){const m=h.payload.items.find(p=>p.type==="text");d=(m==null?void 0:m.payload.text)??""}else d="Sent an attachment";return x.jsxs("button",{...f.conversation.container,onClick:()=>t==null?void 0:t(c),"data-active":i===c?"":void 0,children:[h.author.type==="bot"?x.jsx(En,{userId:h.userId,src:a,...f.conversation.avatar,children:l??"Bot"}):x.jsx(En,{userId:h.userId,...f.conversation.avatar,fallback:f.conversation.userAvatar.className,children:x.jsx(JA,{strokeWidth:1.5})}),x.jsxs("div",{...f.conversation.content,children:[x.jsx("span",{...f.conversation.name,children:d}),x.jsx("span",{...f.conversation.timestamp,children:J2(gw(h.createdAt))})]}),x.jsx(ip,{strokeWidth:1.5,...f.conversation.chevron})]},c)})}),x.jsxs("button",{...f.newConversation.button,onClick:n,children:[x.jsx(KA,{...f.newConversation.icon}),"New conversation"]})]})};Eu.displayName="ConversationHistory";const Qy=({connected:e,configuration:t,isTyping:n,messages:r,user:i,isLoading:o,renderers:s,isReadOnly:a,disableComposer:l,error:u,participants:f,closeWindow:c,sendMessage:h,uploadFile:d,addMessageFeedback:m,listConversations:p,restartConversation:g,clientId:v,storageKey:y,soundOn:w,toggleSound:A,disableSendButton:k,conversationId:E,...I})=>{const{color:D,fontFamily:P,radius:T,themeMode:O,variant:B,headerVariant:L,botAvatar:F,botDescription:R,botName:N,composerPlaceholder:H,footer:z,feedbackEnabled:W,additionalStylesheetUrl:b,allowFileUpload:_,conversationHistory:j}=t,S={color:D,fontFamily:P,radius:T,themeMode:O,variant:B,headerVariant:L,additionalStylesheetUrl:b},[V,Y]=M.useState("chat"),q=Gy({clientId:v,listConversations:p,userCredentials:i});M.useEffect(()=>{V==="conversations"&&q.refresh()},[V]),W||(m=void 0);const Q=M.useMemo(()=>i?Ju(r,f,i.userId,N,F):[],[F,N,r,i,f]),X=M.useMemo(()=>{var te,$;return(($=(te=r.at(-1))==null?void 0:te.metadata)==null?void 0:$.conversationStatus)==="closed"},[r]),se=M.useRef(null),G=Qn(te=>te.setPortalContainer);return M.useEffect(()=>(G(se.current),()=>{G(null)}),[G]),x.jsxs(x.Fragment,{children:[x.jsx(Ng,{...S}),x.jsx("div",{ref:se,style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none",zIndex:10}}),x.jsx(Jl,{connected:e,allowFileUpload:_,uploadFile:d,storageKey:y,conversationId:E,...I,children:u||q.error?x.jsx(Ey,{error:u||q.error,restartConversation:g,closeWindow:c}):V==="conversations"?x.jsx(Eu,{onClose:c,conversations:q.conversations,isLoading:q.isLoading,onNewConversation:()=>{g==null||g(),Y("chat")},onConversationClick:te=>{g==null||g(te),Y("chat")},botAvatar:F,botName:N}):x.jsxs(x.Fragment,{children:[x.jsx(Sy,{showConversationHistory:j?()=>Y("conversations"):void 0,closeWindow:c,configuration:t,restartConversation:g,clientId:v,soundOn:w,toggleSound:A}),o?x.jsx(ky,{}):x.jsx(au,{botAvatar:F,botDescription:R,botName:N,renderers:s,isTyping:n,sendMessage:h,addMessageFeedback:m,messages:Q},E),!X&&x.jsx(Jm,{sendMessage:h,uploadFile:d,connected:e,isReadOnly:a,disableComposer:l,footer:z,composerPlaceholder:H,allowFileUpload:_,storageKey:y,disableSendButton:k,conversationId:E})]})})]})};function X2({configuration:e,storageKey:t,clientId:n,...r}){const i=t||`bp-webchat-${n}`,{messages:o,participants:s,sendMessage:a,uploadFile:l,saveMessageFeedback:u,conversationId:f,status:c,error:h,isTyping:d,isAwaitingResponse:m}=_y(),{openConversation:p,listConversations:g}=Py(),{userCredentials:v}=Ny(),{soundOn:y,toggleSound:w}=Dy({storageKey:i,soundEnabled:e==null?void 0:e.soundEnabled});return x.jsx(Qy,{configuration:e??{},user:v,isLoading:c==="connecting",isTyping:d,connected:c==="connected"?!0:c==="disconnected"?!1:void 0,messages:o,sendMessage:a,uploadFile:l,addMessageFeedback:u,listConversations:g,restartConversation:p,participants:s,error:h,clientId:n,soundOn:y,toggleSound:w,disableSendButton:m,conversationId:f,storageKey:i,...r})}const e_=({clientId:e,storageKey:t,configuration:n,apiUrl:r,user:i,conversationId:o,...s})=>{const a=t||`bp-webchat-${e}`;return x.jsx(dy,{clientId:e,apiUrl:r,userCredentials:i,conversationId:o,storageKey:a,storageLocation:n==null?void 0:n.storageLocation,adminSecret:n==null?void 0:n.adminSecret,children:x.jsx(X2,{configuration:n,storageKey:t,clientId:e,...s})})};function t_(e,t=globalThis==null?void 0:globalThis.document){const n=Ln(e);C.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var n_="DismissableLayer",Cu="dismissableLayer.update",r_="dismissableLayer.pointerDownOutside",i_="dismissableLayer.focusOutside",Zy,Jy=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Xy=C.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,onDismiss:a,...l}=e,u=C.useContext(Jy),[f,c]=C.useState(null),h=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,d]=C.useState({}),m=tn(t,I=>c(I)),p=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=p.indexOf(g),y=f?p.indexOf(f):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,A=y>=v,k=a_(I=>{const D=I.target,P=[...u.branches].some(T=>T.contains(D));!A||P||(i==null||i(I),s==null||s(I),I.defaultPrevented||a==null||a())},h),E=l_(I=>{const D=I.target;[...u.branches].some(T=>T.contains(D))||(o==null||o(I),s==null||s(I),I.defaultPrevented||a==null||a())},h);return t_(I=>{y===u.layers.size-1&&(r==null||r(I),!I.defaultPrevented&&a&&(I.preventDefault(),a()))},h),C.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Zy=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),ev(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Zy)}},[f,h,n,u]),C.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),ev())},[f,u]),C.useEffect(()=>{const I=()=>d({});return document.addEventListener(Cu,I),()=>document.removeEventListener(Cu,I)},[]),x.jsx(Ft.div,{...l,ref:m,style:{pointerEvents:w?A?"auto":"none":void 0,...e.style},onFocusCapture:Zt(e.onFocusCapture,E.onFocusCapture),onBlurCapture:Zt(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Zt(e.onPointerDownCapture,k.onPointerDownCapture)})});Xy.displayName=n_;var o_="DismissableLayerBranch",s_=C.forwardRef((e,t)=>{const n=C.useContext(Jy),r=C.useRef(null),i=tn(t,r);return C.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),x.jsx(Ft.div,{...e,ref:i})});s_.displayName=o_;function a_(e,t=globalThis==null?void 0:globalThis.document){const n=Ln(e),r=C.useRef(!1),i=C.useRef(()=>{});return C.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let l=function(){tv(r_,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=l,t.addEventListener("click",i.current,{once:!0})):l()}else t.removeEventListener("click",i.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function l_(e,t=globalThis==null?void 0:globalThis.document){const n=Ln(e),r=C.useRef(!1);return C.useEffect(()=>{const i=o=>{o.target&&!r.current&&tv(i_,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ev(){const e=new CustomEvent(Cu);document.dispatchEvent(e)}function tv(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?XN(i,o):i.dispatchEvent(o)}var Au="focusScope.autoFocusOnMount",Tu="focusScope.autoFocusOnUnmount",nv={bubbles:!1,cancelable:!0},u_="FocusScope",rv=C.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[a,l]=C.useState(null),u=Ln(i),f=Ln(o),c=C.useRef(null),h=tn(t,p=>l(p)),d=C.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.useEffect(()=>{if(r){let p=function(w){if(d.paused||!a)return;const A=w.target;a.contains(A)?c.current=A:gn(c.current,{select:!0})},g=function(w){if(d.paused||!a)return;const A=w.relatedTarget;A!==null&&(a.contains(A)||gn(c.current,{select:!0}))},v=function(w){if(document.activeElement===document.body)for(const k of w)k.removedNodes.length>0&&gn(a)};document.addEventListener("focusin",p),document.addEventListener("focusout",g);const y=new MutationObserver(v);return a&&y.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",g),y.disconnect()}}},[r,a,d.paused]),C.useEffect(()=>{if(a){sv.add(d);const p=document.activeElement;if(!a.contains(p)){const v=new CustomEvent(Au,nv);a.addEventListener(Au,u),a.dispatchEvent(v),v.defaultPrevented||(c_(m_(iv(a)),{select:!0}),document.activeElement===p&&gn(a))}return()=>{a.removeEventListener(Au,u),setTimeout(()=>{const v=new CustomEvent(Tu,nv);a.addEventListener(Tu,f),a.dispatchEvent(v),v.defaultPrevented||gn(p??document.body,{select:!0}),a.removeEventListener(Tu,f),sv.remove(d)},0)}}},[a,u,f,d]);const m=C.useCallback(p=>{if(!n&&!r||d.paused)return;const g=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,v=document.activeElement;if(g&&v){const y=p.currentTarget,[w,A]=f_(y);w&&A?!p.shiftKey&&v===A?(p.preventDefault(),n&&gn(w,{select:!0})):p.shiftKey&&v===w&&(p.preventDefault(),n&&gn(A,{select:!0})):v===y&&p.preventDefault()}},[n,r,d.paused]);return x.jsx(Ft.div,{tabIndex:-1,...s,ref:h,onKeyDown:m})});rv.displayName=u_;function c_(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(gn(r,{select:t}),document.activeElement!==n)return}function f_(e){const t=iv(e),n=ov(t,e),r=ov(t.reverse(),e);return[n,r]}function iv(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 ov(e,t){for(const n of e)if(!d_(n,{upTo:t}))return n}function d_(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 h_(e){return e instanceof HTMLInputElement&&"select"in e}function gn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&h_(e)&&t&&e.select()}}var sv=p_();function p_(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=av(e,t),e.unshift(t)},remove(t){var n;e=av(e,t),(n=e[0])==null||n.resume()}}}function av(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function m_(e){return e.filter(t=>t.tagName!=="A")}var Iu=0;function g_(){C.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??lv()),document.body.insertAdjacentElement("beforeend",e[1]??lv()),Iu++,()=>{Iu===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Iu--}},[])}function lv(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Wo="right-scroll-bar-position",qo="width-before-scroll-bar",y_="with-scroll-bars-hidden",v_="--removed-body-scroll-bar-size";function Ou(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function b_(e,t){var n=M.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}var w_=typeof window<"u"?C.useLayoutEffect:C.useEffect,uv=new WeakMap;function S_(e,t){var n=b_(null,function(r){return e.forEach(function(i){return Ou(i,r)})});return w_(function(){var r=uv.get(n);if(r){var i=new Set(r),o=new Set(e),s=n.current;i.forEach(function(a){o.has(a)||Ou(a,null)}),o.forEach(function(a){i.has(a)||Ou(a,s)})}uv.set(n,e)},[e]),n}function x_(e){return e}function k_(e,t){t===void 0&&(t=x_);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(o){var s=t(o,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(o){for(r=!0;n.length;){var s=n;n=[],s.forEach(o)}n={push:function(a){return o(a)},filter:function(){return n}}},assignMedium:function(o){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(o),s=n}var l=function(){var f=s;s=[],f.forEach(o)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(f){s.push(f),u()},filter:function(f){return s=s.filter(f),n}}}};return i}function E_(e){e===void 0&&(e={});var t=k_(null);return t.options=xt({async:!0,ssr:!1},e),t}var cv=function(e){var t=e.sideCar,n=Ip(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 C.createElement(r,xt({},n))};cv.isSideCarExport=!0;function C_(e,t){return e.useMedium(t),cv}var fv=E_(),Mu=function(){},Yo=C.forwardRef(function(e,t){var n=C.useRef(null),r=C.useState({onScrollCapture:Mu,onWheelCapture:Mu,onTouchMoveCapture:Mu}),i=r[0],o=r[1],s=e.forwardProps,a=e.children,l=e.className,u=e.removeScrollBar,f=e.enabled,c=e.shards,h=e.sideCar,d=e.noRelative,m=e.noIsolation,p=e.inert,g=e.allowPinchZoom,v=e.as,y=v===void 0?"div":v,w=e.gapMode,A=Ip(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=h,E=S_([n,t]),I=xt(xt({},A),i);return C.createElement(C.Fragment,null,f&&C.createElement(k,{sideCar:fv,removeScrollBar:u,shards:c,noRelative:d,noIsolation:m,inert:p,setCallbacks:o,allowPinchZoom:!!g,lockRef:n,gapMode:w}),s?C.cloneElement(C.Children.only(a),xt(xt({},I),{ref:E})):C.createElement(y,xt({},I,{className:l,ref:E}),a))});Yo.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Yo.classNames={fullWidth:qo,zeroRight:Wo};var A_=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function T_(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=A_();return t&&e.setAttribute("nonce",t),e}function I_(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function O_(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var M_=function(){var e=0,t=null;return{add:function(n){e==0&&(t=T_())&&(I_(t,n),O_(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},D_=function(){var e=M_();return function(t,n){C.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},dv=function(){var e=D_(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},N_={left:0,top:0,right:0,gap:0},Du=function(e){return parseInt(e||"",10)||0},__=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[Du(n),Du(r),Du(i)]},P_=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return N_;var t=__(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])}},L_=dv(),mr="data-scroll-locked",F_=function(e,t,n,r){var i=e.left,o=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
324
+ .`.concat(y_,` {
328
325
  overflow: hidden `).concat(r,`;
329
326
  padding-right: `).concat(a,"px ").concat(r,`;
330
327
  }
331
- body[`).concat(pr,`] {
328
+ body[`).concat(mr,`] {
332
329
  overflow: hidden `).concat(r,`;
333
330
  overscroll-behavior: contain;
334
331
  `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
@@ -341,30 +338,30 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
341
338
  `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
342
339
  }
343
340
 
344
- .`).concat(Yo,` {
341
+ .`).concat(Wo,` {
345
342
  right: `).concat(a,"px ").concat(r,`;
346
343
  }
347
344
 
348
- .`).concat(Ko,` {
345
+ .`).concat(qo,` {
349
346
  margin-right: `).concat(a,"px ").concat(r,`;
350
347
  }
351
348
 
352
- .`).concat(Yo," .").concat(Yo,` {
349
+ .`).concat(Wo," .").concat(Wo,` {
353
350
  right: 0 `).concat(r,`;
354
351
  }
355
352
 
356
- .`).concat(Ko," .").concat(Ko,` {
353
+ .`).concat(qo," .").concat(qo,` {
357
354
  margin-right: 0 `).concat(r,`;
358
355
  }
359
356
 
360
- body[`).concat(pr,`] {
361
- `).concat(D_,": ").concat(a,`px;
357
+ body[`).concat(mr,`] {
358
+ `).concat(v_,": ").concat(a,`px;
362
359
  }
363
- `)},wv=function(){var e=parseInt(document.body.getAttribute(pr)||"0",10);return isFinite(e)?e:0},Q_=function(){A.useEffect(function(){return document.body.setAttribute(pr,(wv()+1).toString()),function(){var e=wv()-1;e<=0?document.body.removeAttribute(pr):document.body.setAttribute(pr,e.toString())}},[])},Z_=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;Q_();var o=A.useMemo(function(){return Y_(i)},[i]);return A.createElement(K_,{styles:G_(o,!t,i,n?"":"!important")})},Fu=!1;if(typeof window<"u")try{var Qo=Object.defineProperty({},"passive",{get:function(){return Fu=!0,!0}});window.addEventListener("test",Qo,Qo),window.removeEventListener("test",Qo,Qo)}catch{Fu=!1}var mr=Fu?{passive:!1}:!1,J_=function(e){return e.tagName==="TEXTAREA"},Sv=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!J_(e)&&n[t]==="visible")},X_=function(e){return Sv(e,"overflowY")},eP=function(e){return Sv(e,"overflowX")},xv=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=kv(e,r);if(i){var o=Ev(e,r),s=o[1],a=o[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},tP=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},nP=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},kv=function(e,t){return e==="v"?X_(t):eP(t)},Ev=function(e,t){return e==="v"?tP(t):nP(t)},rP=function(e,t){return e==="h"&&t==="rtl"?-1:1},iP=function(e,t,n,r,i){var o=rP(e,window.getComputedStyle(t).direction),s=o*r,a=n.target,l=t.contains(a),u=!1,f=s>0,c=0,h=0;do{if(!a)break;var d=Ev(e,a),m=d[0],p=d[1],g=d[2],y=p-g-o*m;(m||y)&&kv(e,a)&&(c+=y,h+=m);var v=a.parentNode;a=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(f&&Math.abs(c)<1||!f&&Math.abs(h)<1)&&(u=!0),u},Zo=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Cv=function(e){return[e.deltaX,e.deltaY]},Av=function(e){return e&&"current"in e?e.current:e},oP=function(e,t){return e[0]===t[0]&&e[1]===t[1]},sP=function(e){return`
360
+ `)},hv=function(){var e=parseInt(document.body.getAttribute(mr)||"0",10);return isFinite(e)?e:0},R_=function(){C.useEffect(function(){return document.body.setAttribute(mr,(hv()+1).toString()),function(){var e=hv()-1;e<=0?document.body.removeAttribute(mr):document.body.setAttribute(mr,e.toString())}},[])},$_=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;R_();var o=C.useMemo(function(){return P_(i)},[i]);return C.createElement(L_,{styles:F_(o,!t,i,n?"":"!important")})},Nu=!1;if(typeof window<"u")try{var Ko=Object.defineProperty({},"passive",{get:function(){return Nu=!0,!0}});window.addEventListener("test",Ko,Ko),window.removeEventListener("test",Ko,Ko)}catch{Nu=!1}var gr=Nu?{passive:!1}:!1,B_=function(e){return e.tagName==="TEXTAREA"},pv=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!B_(e)&&n[t]==="visible")},z_=function(e){return pv(e,"overflowY")},U_=function(e){return pv(e,"overflowX")},mv=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=gv(e,r);if(i){var o=yv(e,r),s=o[1],a=o[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},H_=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},j_=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},gv=function(e,t){return e==="v"?z_(t):U_(t)},yv=function(e,t){return e==="v"?H_(t):j_(t)},V_=function(e,t){return e==="h"&&t==="rtl"?-1:1},W_=function(e,t,n,r,i){var o=V_(e,window.getComputedStyle(t).direction),s=o*r,a=n.target,l=t.contains(a),u=!1,f=s>0,c=0,h=0;do{if(!a)break;var d=yv(e,a),m=d[0],p=d[1],g=d[2],v=p-g-o*m;(m||v)&&gv(e,a)&&(c+=v,h+=m);var y=a.parentNode;a=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(f&&Math.abs(c)<1||!f&&Math.abs(h)<1)&&(u=!0),u},Go=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},vv=function(e){return[e.deltaX,e.deltaY]},bv=function(e){return e&&"current"in e?e.current:e},q_=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Y_=function(e){return`
364
361
  .block-interactivity-`.concat(e,` {pointer-events: none;}
365
362
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
366
- `)},aP=0,gr=[];function lP(e){var t=A.useRef([]),n=A.useRef([0,0]),r=A.useRef(),i=A.useState(aP++)[0],o=A.useState(bv)[0],s=A.useRef(e);A.useEffect(function(){s.current=e},[e]),A.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var p=Ga([e.lockRef.current],(e.shards||[]).map(Av),!0).filter(Boolean);return p.forEach(function(g){return g.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),p.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=A.useCallback(function(p,g){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!s.current.allowPinchZoom;var y=Zo(p),v=n.current,w="deltaX"in p?p.deltaX:v[0]-y[0],E="deltaY"in p?p.deltaY:v[1]-y[1],S,C=p.target,I=Math.abs(w)>Math.abs(E)?"h":"v";if("touches"in p&&I==="h"&&C.type==="range")return!1;var M=xv(I,C);if(!M)return!0;if(M?S=I:(S=I==="v"?"h":"v",M=xv(I,C)),!M)return!1;if(!r.current&&"changedTouches"in p&&(w||E)&&(r.current=S),!S)return!0;var P=r.current||S;return iP(P,g,p,P==="h"?w:E)},[]),l=A.useCallback(function(p){var g=p;if(!(!gr.length||gr[gr.length-1]!==o)){var y="deltaY"in g?Cv(g):Zo(g),v=t.current.filter(function(S){return S.name===g.type&&(S.target===g.target||g.target===S.shadowParent)&&oP(S.delta,y)})[0];if(v&&v.should){g.cancelable&&g.preventDefault();return}if(!v){var w=(s.current.shards||[]).map(Av).filter(Boolean).filter(function(S){return S.contains(g.target)}),E=w.length>0?a(g,w[0]):!s.current.noIsolation;E&&g.cancelable&&g.preventDefault()}}},[]),u=A.useCallback(function(p,g,y,v){var w={name:p,delta:g,target:y,should:v,shadowParent:uP(y)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(E){return E!==w})},1)},[]),f=A.useCallback(function(p){n.current=Zo(p),r.current=void 0},[]),c=A.useCallback(function(p){u(p.type,Cv(p),p.target,a(p,e.lockRef.current))},[]),h=A.useCallback(function(p){u(p.type,Zo(p),p.target,a(p,e.lockRef.current))},[]);A.useEffect(function(){return gr.push(o),e.setCallbacks({onScrollCapture:c,onWheelCapture:c,onTouchMoveCapture:h}),document.addEventListener("wheel",l,mr),document.addEventListener("touchmove",l,mr),document.addEventListener("touchstart",f,mr),function(){gr=gr.filter(function(p){return p!==o}),document.removeEventListener("wheel",l,mr),document.removeEventListener("touchmove",l,mr),document.removeEventListener("touchstart",f,mr)}},[]);var d=e.removeScrollBar,m=e.inert;return A.createElement(A.Fragment,null,m?A.createElement(o,{styles:sP(i)}):null,d?A.createElement(Z_,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function uP(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const cP=$_(vv,lP);var Tv=A.forwardRef(function(e,t){return A.createElement(Go,xt({},e,{ref:t,sideCar:cP}))});Tv.classNames=Go.classNames;var fP=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},yr=new WeakMap,Jo=new WeakMap,Xo={},Ru=0,Iv=function(e){return e&&(e.host||Iv(e.parentNode))},dP=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Iv(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})},hP=function(e,t,n,r){var i=dP(t,Array.isArray(e)?e:[e]);Xo[n]||(Xo[n]=new WeakMap);var o=Xo[n],s=[],a=new Set,l=new Set(i),u=function(c){!c||a.has(c)||(a.add(c),u(c.parentNode))};i.forEach(u);var f=function(c){!c||l.has(c)||Array.prototype.forEach.call(c.children,function(h){if(a.has(h))f(h);else try{var d=h.getAttribute(r),m=d!==null&&d!=="false",p=(yr.get(h)||0)+1,g=(o.get(h)||0)+1;yr.set(h,p),o.set(h,g),s.push(h),p===1&&m&&Jo.set(h,!0),g===1&&h.setAttribute(n,"true"),m||h.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",h,y)}})};return f(t),a.clear(),Ru++,function(){s.forEach(function(c){var h=yr.get(c)-1,d=o.get(c)-1;yr.set(c,h),o.set(c,d),h||(Jo.has(c)||c.removeAttribute(r),Jo.delete(c)),d||c.removeAttribute(n)}),Ru--,Ru||(yr=new WeakMap,yr=new WeakMap,Jo=new WeakMap,Xo={})}},pP=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=fP(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),hP(r,i,n,"aria-hidden")):function(){return null}},es="Dialog",[Ov]=vy(es),[mP,Wt]=Ov(es),Mv=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!0}=e,a=A.useRef(null),l=A.useRef(null),[u,f]=by({prop:r,defaultProp:i??!1,onChange:o,caller:es});return k.jsx(mP,{scope:t,triggerRef:a,contentRef:l,contentId:Uo(),titleId:Uo(),descriptionId:Uo(),open:u,onOpenChange:f,onOpenToggle:A.useCallback(()=>f(c=>!c),[f]),modal:s,children:n})};Mv.displayName=es;var Dv="DialogTrigger",Nv=A.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt(Dv,n),o=tn(t,i.triggerRef);return k.jsx(Ft.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Bu(i.open),...r,ref:o,onClick:Zt(e.onClick,i.onOpenToggle)})});Nv.displayName=Dv;var gP="DialogPortal",[RL,_v]=Ov(gP,{forceMount:void 0}),ts="DialogOverlay",yP=A.forwardRef((e,t)=>{const n=_v(ts,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Wt(ts,e.__scopeDialog);return o.modal?k.jsx(Bo,{present:r||o.open,children:k.jsx(bP,{...i,ref:t})}):null});yP.displayName=ts;var vP=wy("DialogOverlay.RemoveScroll"),bP=A.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt(ts,n);return k.jsx(Tv,{as:vP,allowPinchZoom:!0,shards:[i.contentRef],children:k.jsx(Ft.div,{"data-state":Bu(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Pn="DialogContent",Pv=A.forwardRef((e,t)=>{const n=_v(Pn,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Wt(Pn,e.__scopeDialog);return k.jsx(Bo,{present:r||o.open,children:o.modal?k.jsx(wP,{...i,ref:t}):k.jsx(SP,{...i,ref:t})})});Pv.displayName=Pn;var wP=A.forwardRef((e,t)=>{const n=Wt(Pn,e.__scopeDialog),r=A.useRef(null),i=tn(t,n.contentRef,r);return A.useEffect(()=>{const o=r.current;if(o)return pP(o)},[]),k.jsx(Lv,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Zt(e.onCloseAutoFocus,o=>{var s;o.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:Zt(e.onPointerDownOutside,o=>{const s=o.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&o.preventDefault()}),onFocusOutside:Zt(e.onFocusOutside,o=>o.preventDefault())})}),SP=A.forwardRef((e,t)=>{const n=Wt(Pn,e.__scopeDialog),r=A.useRef(!1),i=A.useRef(!1);return k.jsx(Lv,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,o),o.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=o.target;((u=n.triggerRef.current)==null?void 0:u.contains(s))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),Lv=A.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...s}=e,a=Wt(Pn,n),l=A.useRef(null),u=tn(t,l);return O_(),k.jsxs(k.Fragment,{children:[k.jsx(cv,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:k.jsx(sv,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Bu(a.open),...s,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),k.jsxs(k.Fragment,{children:[k.jsx(xP,{titleId:a.titleId}),k.jsx(EP,{contentRef:l,descriptionId:a.descriptionId})]})]})}),$u="DialogTitle",Fv=A.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt($u,n);return k.jsx(Ft.h2,{id:i.titleId,...r,ref:t})});Fv.displayName=$u;var Rv="DialogDescription",$v=A.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt(Rv,n);return k.jsx(Ft.p,{id:i.descriptionId,...r,ref:t})});$v.displayName=Rv;var Bv="DialogClose",zv=A.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt(Bv,n);return k.jsx(Ft.button,{type:"button",...r,ref:t,onClick:Zt(e.onClick,()=>i.onOpenChange(!1))})});zv.displayName=Bv;function Bu(e){return e?"open":"closed"}var Uv="DialogTitleWarning",[$L,jv]=JN(Uv,{contentName:Pn,titleName:$u,docsSlug:"dialog"}),xP=({titleId:e})=>{const t=jv(Uv),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
363
+ `)},K_=0,yr=[];function G_(e){var t=C.useRef([]),n=C.useRef([0,0]),r=C.useRef(),i=C.useState(K_++)[0],o=C.useState(dv)[0],s=C.useRef(e);C.useEffect(function(){s.current=e},[e]),C.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var p=Ya([e.lockRef.current],(e.shards||[]).map(bv),!0).filter(Boolean);return p.forEach(function(g){return g.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),p.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=C.useCallback(function(p,g){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!s.current.allowPinchZoom;var v=Go(p),y=n.current,w="deltaX"in p?p.deltaX:y[0]-v[0],A="deltaY"in p?p.deltaY:y[1]-v[1],k,E=p.target,I=Math.abs(w)>Math.abs(A)?"h":"v";if("touches"in p&&I==="h"&&E.type==="range")return!1;var D=mv(I,E);if(!D)return!0;if(D?k=I:(k=I==="v"?"h":"v",D=mv(I,E)),!D)return!1;if(!r.current&&"changedTouches"in p&&(w||A)&&(r.current=k),!k)return!0;var P=r.current||k;return W_(P,g,p,P==="h"?w:A)},[]),l=C.useCallback(function(p){var g=p;if(!(!yr.length||yr[yr.length-1]!==o)){var v="deltaY"in g?vv(g):Go(g),y=t.current.filter(function(k){return k.name===g.type&&(k.target===g.target||g.target===k.shadowParent)&&q_(k.delta,v)})[0];if(y&&y.should){g.cancelable&&g.preventDefault();return}if(!y){var w=(s.current.shards||[]).map(bv).filter(Boolean).filter(function(k){return k.contains(g.target)}),A=w.length>0?a(g,w[0]):!s.current.noIsolation;A&&g.cancelable&&g.preventDefault()}}},[]),u=C.useCallback(function(p,g,v,y){var w={name:p,delta:g,target:v,should:y,shadowParent:Q_(v)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(A){return A!==w})},1)},[]),f=C.useCallback(function(p){n.current=Go(p),r.current=void 0},[]),c=C.useCallback(function(p){u(p.type,vv(p),p.target,a(p,e.lockRef.current))},[]),h=C.useCallback(function(p){u(p.type,Go(p),p.target,a(p,e.lockRef.current))},[]);C.useEffect(function(){return yr.push(o),e.setCallbacks({onScrollCapture:c,onWheelCapture:c,onTouchMoveCapture:h}),document.addEventListener("wheel",l,gr),document.addEventListener("touchmove",l,gr),document.addEventListener("touchstart",f,gr),function(){yr=yr.filter(function(p){return p!==o}),document.removeEventListener("wheel",l,gr),document.removeEventListener("touchmove",l,gr),document.removeEventListener("touchstart",f,gr)}},[]);var d=e.removeScrollBar,m=e.inert;return C.createElement(C.Fragment,null,m?C.createElement(o,{styles:Y_(i)}):null,d?C.createElement($_,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Q_(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Z_=C_(fv,G_);var wv=C.forwardRef(function(e,t){return C.createElement(Yo,xt({},e,{ref:t,sideCar:Z_}))});wv.classNames=Yo.classNames;var J_=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},vr=new WeakMap,Qo=new WeakMap,Zo={},_u=0,Sv=function(e){return e&&(e.host||Sv(e.parentNode))},X_=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Sv(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})},eP=function(e,t,n,r){var i=X_(t,Array.isArray(e)?e:[e]);Zo[n]||(Zo[n]=new WeakMap);var o=Zo[n],s=[],a=new Set,l=new Set(i),u=function(c){!c||a.has(c)||(a.add(c),u(c.parentNode))};i.forEach(u);var f=function(c){!c||l.has(c)||Array.prototype.forEach.call(c.children,function(h){if(a.has(h))f(h);else try{var d=h.getAttribute(r),m=d!==null&&d!=="false",p=(vr.get(h)||0)+1,g=(o.get(h)||0)+1;vr.set(h,p),o.set(h,g),s.push(h),p===1&&m&&Qo.set(h,!0),g===1&&h.setAttribute(n,"true"),m||h.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",h,v)}})};return f(t),a.clear(),_u++,function(){s.forEach(function(c){var h=vr.get(c)-1,d=o.get(c)-1;vr.set(c,h),o.set(c,d),h||(Qo.has(c)||c.removeAttribute(r),Qo.delete(c)),d||c.removeAttribute(n)}),_u--,_u||(vr=new WeakMap,vr=new WeakMap,Qo=new WeakMap,Zo={})}},tP=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=J_(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),eP(r,i,n,"aria-hidden")):function(){return null}},Jo="Dialog",[xv]=py(Jo),[nP,Wt]=xv(Jo),kv=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!0}=e,a=C.useRef(null),l=C.useRef(null),[u,f]=my({prop:r,defaultProp:i??!1,onChange:o,caller:Jo});return x.jsx(nP,{scope:t,triggerRef:a,contentRef:l,contentId:Uo(),titleId:Uo(),descriptionId:Uo(),open:u,onOpenChange:f,onOpenToggle:C.useCallback(()=>f(c=>!c),[f]),modal:s,children:n})};kv.displayName=Jo;var Ev="DialogTrigger",Cv=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt(Ev,n),o=tn(t,i.triggerRef);return x.jsx(Ft.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Lu(i.open),...r,ref:o,onClick:Zt(e.onClick,i.onOpenToggle)})});Cv.displayName=Ev;var rP="DialogPortal",[EL,Av]=xv(rP,{forceMount:void 0}),Xo="DialogOverlay",iP=C.forwardRef((e,t)=>{const n=Av(Xo,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Wt(Xo,e.__scopeDialog);return o.modal?x.jsx(Bo,{present:r||o.open,children:x.jsx(sP,{...i,ref:t})}):null});iP.displayName=Xo;var oP=gy("DialogOverlay.RemoveScroll"),sP=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt(Xo,n);return x.jsx(wv,{as:oP,allowPinchZoom:!0,shards:[i.contentRef],children:x.jsx(Ft.div,{"data-state":Lu(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Pn="DialogContent",Tv=C.forwardRef((e,t)=>{const n=Av(Pn,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Wt(Pn,e.__scopeDialog);return x.jsx(Bo,{present:r||o.open,children:o.modal?x.jsx(aP,{...i,ref:t}):x.jsx(lP,{...i,ref:t})})});Tv.displayName=Pn;var aP=C.forwardRef((e,t)=>{const n=Wt(Pn,e.__scopeDialog),r=C.useRef(null),i=tn(t,n.contentRef,r);return C.useEffect(()=>{const o=r.current;if(o)return tP(o)},[]),x.jsx(Iv,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Zt(e.onCloseAutoFocus,o=>{var s;o.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:Zt(e.onPointerDownOutside,o=>{const s=o.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&o.preventDefault()}),onFocusOutside:Zt(e.onFocusOutside,o=>o.preventDefault())})}),lP=C.forwardRef((e,t)=>{const n=Wt(Pn,e.__scopeDialog),r=C.useRef(!1),i=C.useRef(!1);return x.jsx(Iv,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,o),o.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=o.target;((u=n.triggerRef.current)==null?void 0:u.contains(s))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),Iv=C.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...s}=e,a=Wt(Pn,n),l=C.useRef(null),u=tn(t,l);return g_(),x.jsxs(x.Fragment,{children:[x.jsx(rv,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:x.jsx(Xy,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Lu(a.open),...s,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),x.jsxs(x.Fragment,{children:[x.jsx(uP,{titleId:a.titleId}),x.jsx(fP,{contentRef:l,descriptionId:a.descriptionId})]})]})}),Pu="DialogTitle",Ov=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt(Pu,n);return x.jsx(Ft.h2,{id:i.titleId,...r,ref:t})});Ov.displayName=Pu;var Mv="DialogDescription",Dv=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt(Mv,n);return x.jsx(Ft.p,{id:i.descriptionId,...r,ref:t})});Dv.displayName=Mv;var Nv="DialogClose",_v=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt(Nv,n);return x.jsx(Ft.button,{type:"button",...r,ref:t,onClick:Zt(e.onClick,()=>i.onOpenChange(!1))})});_v.displayName=Nv;function Lu(e){return e?"open":"closed"}var Pv="DialogTitleWarning",[CL,Lv]=HN(Pv,{contentName:Pn,titleName:Pu,docsSlug:"dialog"}),uP=({titleId:e})=>{const t=Lv(Pv),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
367
364
 
368
365
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
369
366
 
370
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return A.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},kP="DialogDescriptionWarning",EP=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${jv(kP).contentName}}.`;return A.useEffect(()=>{var o;const i=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},CP=Mv,AP=Nv,TP=Pv,IP=Fv,OP=$v,MP=zv;function vr({open:e,onOpenChange:t,children:n}){const{modal:r}=me;return k.jsxs(CP,{open:e,modal:!1,onOpenChange:t,children:[e&&k.jsx("div",{...r==null?void 0:r.overlay}),n]})}function DP({title:e,description:t,onConfirm:n,onCancel:r,confirmButtonText:i,cancelButtonText:o,children:s}){const{modal:a}=me;return k.jsx(k.Fragment,{children:k.jsxs(TP,{...a.dialog.container,children:[k.jsx(IP,{...a.dialog.title,children:e}),k.jsx(OP,{...a.dialog.description,children:t}),k.jsx("div",{...a.dialog.content.container,children:s}),k.jsxs("div",{...a.dialog.button.container,children:[i&&k.jsx("button",{...a.dialog.button.confirm,type:"button",onClick:n,children:i}),o&&k.jsx("button",{...a.dialog.button.cancel,type:"button",onClick:r,children:o})]})]})})}vr.Button=AP,vr.Close=MP,vr.Content=DP;const Hv=D.forwardRef(({children:e,onClick:t,avatarUrl:n,botName:r,description:i,onClose:o,...s},a)=>{const{messagePreview:l}=me,{container:u,closeButton:f,message:c,avatar:h,description:d}=l??{};return k.jsxs("div",{...s,...u,ref:a,onClick:t,children:[k.jsx(En,{src:n,...h,children:r||"Bot"}),k.jsx("p",{...c,children:e}),k.jsx("p",{...d,children:i}),k.jsx(hp,{...f,onClick:m=>{m.stopPropagation(),o==null||o()}})]})});Hv.displayName="MessagePreview",re.Avatar=En,re.BOT_IS_BLOCKED=Vf,re.Block=Dn,re.CONFIG_ACCESS_DENIED=Qw,re.Chat=rv,re.Composer=ng,re.Container=eu,re.ConversationHistory=Iu,re.ErrorState=Dy,re.Fab=yy,re.Header=Cy,re.INVALID_API_URL=Uf,re.INVALID_BOTPRESS_URL=Hf,re.INVALID_CLIENT_ID=jf,re.INVALID_CONFIGURATION=Gw,re.INVALID_CONFIG_URL=Kw,re.INVALID_MESSAGE_CONTENT_TYPE=Yf,re.MISSING_API_URL=Ww,re.MISSING_BOT_ID=qw,re.MISSING_CLIENT_ID=zf,re.MISSING_CONFIG_URL=Yw,re.Message=au,re.MessageContext=qa,re.MessageList=fu,re.MessagePreview=Hv,re.Modal=vr,re.ModalContext=Ya,re.ModalProvider=Lg,re.NETWORK_ERROR=Li,re.NOT_A_PARTICIPANT=$s,re.QUOTA_EXCEEDED=Wf,re.RestartConversationButton=iu,re.SOUND_EFFECTS=Ry,re.SSE_DISCONNECTED_ERROR=qf,re.StylesheetProvider=Fg,re.TypingIndicator=su,re.Webchat=h_,re.WebchatProvider=gy,re._setDebugEnabled=KN,re._setTrackFn=GN,re.commonApiErrorMap=zs,re.enrichMessage=nc,re.fileTypes=$f,re.generateThemeOverride=Rf,re.generateThemeStylesheet=Ff,re.getUseChatSoundStore=Ip,re.getUseWebchatClientStore=Cp,re.integrationMessagePayloadToBlockPayload=$g,re.integrationMessageToBlockMessage=ui,re.isCommonApiErrorType=Gf,re.isEventError=Zf,re.isFileType=Bf,re.isIntegrationError=Qf,re.isWebhookHandlerErrorType=Kf,re.mapToWebchatError=_r,re.renderers=Ym,re.retryWithBackoff=Jf,re.useActiveConversation=zy,re.useConversationList=nv,re.useConversations=Uy,re.useMessageContext=Op,re.useModalContext=Ka,re.useUser=By,re.useWebchat=_2,re.useWebchatContext=$o,re.useWebchatStore=Qn,re.webchatClasses=me,re.webhookHandlerErrorMap=Bs,Object.defineProperty(re,Symbol.toStringTag,{value:"Module"})});
367
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return C.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},cP="DialogDescriptionWarning",fP=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Lv(cP).contentName}}.`;return C.useEffect(()=>{var o;const i=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},dP=kv,hP=Cv,pP=Tv,mP=Ov,gP=Dv,yP=_v;function br({open:e,onOpenChange:t,children:n}){const{modal:r}=ye;return x.jsxs(dP,{open:e,modal:!1,onOpenChange:t,children:[e&&x.jsx("div",{...r==null?void 0:r.overlay}),n]})}function vP({title:e,description:t,onConfirm:n,onCancel:r,confirmButtonText:i,cancelButtonText:o,children:s}){const{modal:a}=ye;return x.jsx(x.Fragment,{children:x.jsxs(pP,{...a.dialog.container,children:[x.jsx(mP,{...a.dialog.title,children:e}),x.jsx(gP,{...a.dialog.description,children:t}),x.jsx("div",{...a.dialog.content.container,children:s}),x.jsxs("div",{...a.dialog.button.container,children:[i&&x.jsx("button",{...a.dialog.button.confirm,type:"button",onClick:n,children:i}),o&&x.jsx("button",{...a.dialog.button.cancel,type:"button",onClick:r,children:o})]})]})})}br.Button=hP,br.Close=yP,br.Content=vP;const Fv=M.forwardRef(({children:e,onClick:t,avatarUrl:n,botName:r,description:i,onClose:o,...s},a)=>{const{messagePreview:l}=ye,{container:u,closeButton:f,message:c,avatar:h,description:d}=l??{};return x.jsxs("div",{...s,...u,ref:a,onClick:t,children:[x.jsx(En,{src:n,...h,children:r||"Bot"}),x.jsx("p",{...c,children:e}),x.jsx("p",{...d,children:i}),x.jsx(up,{...f,onClick:m=>{m.stopPropagation(),o==null||o()}})]})});Fv.displayName="MessagePreview",re.Avatar=En,re.BOT_IS_BLOCKED=zf,re.Block=Dn,re.CONFIG_ACCESS_DENIED=zw,re.Chat=Qy,re.Composer=Jm,re.Container=Jl,re.ConversationHistory=Eu,re.ErrorState=Ey,re.Fab=hy,re.Header=Sy,re.INVALID_API_URL=Rf,re.INVALID_BOTPRESS_URL=Bf,re.INVALID_CLIENT_ID=$f,re.INVALID_CONFIGURATION=Bw,re.INVALID_CONFIG_URL=$w,re.INVALID_MESSAGE_CONTENT_TYPE=jf,re.MISSING_API_URL=Lw,re.MISSING_BOT_ID=Fw,re.MISSING_CLIENT_ID=Ff,re.MISSING_CONFIG_URL=Rw,re.Message=ou,re.MessageContext=Va,re.MessageList=au,re.MessagePreview=Fv,re.Modal=br,re.ModalContext=Wa,re.ModalProvider=Dg,re.NETWORK_ERROR=Li,re.NOT_A_PARTICIPANT=Fs,re.QUOTA_EXCEEDED=Uf,re.RestartConversationButton=nu,re.SOUND_EFFECTS=My,re.SSE_DISCONNECTED_ERROR=Hf,re.StylesheetProvider=Ng,re.TypingIndicator=iu,re.Webchat=e_,re.WebchatProvider=dy,re._setDebugEnabled=$N,re._setTrackFn=BN,re.commonApiErrorMap=$s,re.enrichMessage=Ju,re.fileTypes=Pf,re.generateThemeOverride=_f,re.generateThemeStylesheet=Nf,re.getUseChatSoundStore=Ep,re.getUseWebchatClientStore=Sp,re.integrationMessagePayloadToBlockPayload=Pg,re.integrationMessageToBlockMessage=lr,re.isCommonApiErrorType=Wf,re.isEventError=Yf,re.isFileType=Lf,re.isIntegrationError=qf,re.isWebhookHandlerErrorType=Vf,re.mapToWebchatError=Pr,re.renderers=jm,re.retryWithBackoff=Kf,re.useActiveConversation=_y,re.useConversationList=Gy,re.useConversations=Py,re.useMessageContext=Cp,re.useModalContext=qa,re.useUser=Ny,re.useWebchat=w2,re.useWebchatContext=$o,re.useWebchatStore=Qn,re.webchatClasses=ye,re.webhookHandlerErrorMap=Rs,Object.defineProperty(re,Symbol.toStringTag,{value:"Module"})});