@botpress/webchat 4.4.9 → 4.5.1

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,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,$u){"use strict";var ts=typeof document<"u"?document.currentScript:null;function Bu(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=Bu(M),zu=Bu($u);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 v;const{scope:h,children:d,...p}=c,m=((v=h==null?void 0:h[e])==null?void 0:v[l])||a,g=A.useMemo(()=>p,Object.values(p));return x.jsx(m.Provider,{value:g,children:d})};u.displayName=o+"Provider";function f(c,h){var m;const d=((m=h==null?void 0:h[e])==null?void 0:m[l])||a,p=A.useContext(d);if(p)return p;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,Vv(i,...t)]}function Vv(...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 Uu(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=Uu(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():Uu(e[i],null)}}}}function tn(...e){return A.useCallback(ns(...e),e)}var Wv=Symbol.for("react.lazy"),bi=A[" use ".trim().toString()];function qv(e){return typeof e=="object"&&e!==null&&"then"in e}function Hu(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Wv&&"_payload"in e&&qv(e._payload)}function Yv(e){const t=Kv(e),n=A.forwardRef((r,i)=>{let{children:o,...s}=r;Hu(o)&&typeof bi=="function"&&(o=bi(o._payload));const a=A.Children.toArray(o),l=a.find(Qv);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 x.jsx(t,{...s,ref:i,children:A.isValidElement(u)?A.cloneElement(u,void 0,f):null})}return x.jsx(t,{...s,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function Kv(e){const t=A.forwardRef((n,r)=>{let{children:i,...o}=n;if(Hu(i)&&typeof bi=="function"&&(i=bi(i._payload)),A.isValidElement(i)){const s=Jv(i),a=Zv(o,i.props);return i.type!==A.Fragment&&(a.ref=r?ns(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 Gv=Symbol("radix.slottable");function Qv(e){return A.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Gv}function Zv(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 Jv(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 Xv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],rs=Xv.reduce((e,t)=>{const n=Yv(`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),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={};/**
1
+ (function(X,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):(X=typeof globalThis<"u"?globalThis:X||self,x(X.Webchat={},X.ReactJsxRuntime,X.React,X.ReactDOM))})(this,function(X,x,D,$u){"use strict";var ns=typeof document<"u"?document.currentScript:null;function zu(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=zu(D),Hu=zu($u);function tb(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,nb(i,...t)]}function nb(...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 Fn(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 tn=globalThis!=null&&globalThis.document?C.useLayoutEffect:()=>{};function Uu(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function rs(...e){return t=>{let n=!1;const r=e.map(i=>{const o=Uu(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():Uu(e[i],null)}}}}function nn(...e){return C.useCallback(rs(...e),e)}var rb=Symbol.for("react.lazy"),ki=C[" use ".trim().toString()];function ib(e){return typeof e=="object"&&e!==null&&"then"in e}function ju(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===rb&&"_payload"in e&&ib(e._payload)}function ob(e){const t=sb(e),n=C.forwardRef((r,i)=>{let{children:o,...s}=r;ju(o)&&typeof ki=="function"&&(o=ki(o._payload));const a=C.Children.toArray(o),l=a.find(lb);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 sb(e){const t=C.forwardRef((n,r)=>{let{children:i,...o}=n;if(ju(i)&&typeof ki=="function"&&(i=ki(i._payload)),C.isValidElement(i)){const s=cb(i),a=ub(o,i.props);return i.type!==C.Fragment&&(a.ref=r?rs(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 ab=Symbol("radix.slottable");function lb(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ab}function ub(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 cb(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 fb=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],is=fb.reduce((e,t)=>{const n=ob(`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}},{}),vn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function bn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var os={exports:{}},ss={};/**
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 ju;function eb(){if(ju)return os;ju=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(),p=r({inst:{value:d,getSnapshot:h}}),m=p[0].inst,g=p[1];return o(function(){m.value=d,m.getSnapshot=h,l(m)&&g({inst:m})},[c,d,h]),i(function(){return l(m)&&g({inst:m}),c(function(){l(m)&&g({inst:m})})},[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={};/**
9
+ */var Vu;function db(){if(Vu)return ss;Vu=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 ss.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,ss}var as={};/**
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 Vu;function tb(){return Vu||(Vu=1,process.env.NODE_ENV!=="production"&&function(){function e(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}function t(d,p){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 m=p();if(!c){var g=p();o(m,g)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}g=s({inst:{value:m,getSnapshot:p}});var v=g[0].inst,y=g[1];return l(function(){v.value=m,v.getSnapshot=p,n(v)&&y({inst:v})},[d,m,p]),a(function(){return n(v)&&y({inst:v}),d(function(){n(v)&&y({inst:v})})},[d]),u(m),m}function n(d){var p=d.getSnapshot;d=d.value;try{var m=p();return!o(d,m)}catch{return!0}}function r(d,p){return p()}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=eb():is.exports=tb();var as=is.exports;function nb(){return as.useSyncExternalStore(rb,()=>!0,()=>!1)}function rb(){return()=>{}}var ls="Avatar",[ib]=jv(ls),[ob,Wu]=ib(ls),us=A.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,o]=A.useState("idle");return x.jsx(ob,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:o,children:x.jsx(rs.span,{...r,ref:t})})});us.displayName=ls;var qu="AvatarImage",cs=A.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...o}=e,s=Wu(qu,n),a=sb(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=qu;var Yu="AvatarFallback",fs=A.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,o=Wu(Yu,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"?x.jsx(rs.span,{...i,ref:t}):null});fs.displayName=Yu;function Ku(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function sb(e,{referrerPolicy:t,crossOrigin:n}){const r=nb(),i=A.useRef(null),o=r?(i.current||(i.current=new window.Image),i.current):null,[s,a]=A.useState(()=>Ku(o,e));return en(()=>{a(Ku(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 Gu(e,t){let n=`${e} {`;for(const[r,i]of Object.entries(t))n+=`${r}: ${i}; `;return n+="}",n}function Qu(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 ab=(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 Zu={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",p="date",m="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 j=String(F);return!j||j.length>=R?F:""+Array(R+1-j.length).join(N)+F},C={s:w,z:function(F){var R=-F.utcOffset(),N=Math.abs(R),j=Math.floor(N/60),z=N%60;return(R<=0?"+":"-")+w(j,2,"0")+":"+w(z,2,"0")},m:function F(R,N){if(R.date()<N.date())return-F(N,R);var j=12*(N.year()-R.year())+(N.month()-R.month()),z=R.clone().add(j,c),V=N-z<0,b=R.clone().add(j+(V?-1:1),c);return+(-(j+(N-z)/(V?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:p,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 U||!(!F||!F[I])},P=function F(R,N,j){var z;if(!R)return k;if(typeof R=="string"){var V=R.toLowerCase();E[V]&&(z=V),N&&(E[V]=N,z=V);var b=R.split("-");if(!z&&b.length>1)return F(b[0])}else{var _=R.name;E[_]=R,z=_}return!j&&z&&(k=z),z||!j&&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 U(N)},O=C;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 U=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(j){var z=j.date,V=j.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,B=(b[7]||"0").substring(0,3);return V?new Date(Date.UTC(b[1],_,b[3]||1,b[4]||0,b[5]||0,b[6]||0,B)):new Date(b[1],_,b[3]||1,b[4]||0,b[5]||0,b[6]||0,B)}}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()!==m},R.isSame=function(N,j){var z=T(N);return this.startOf(j)<=z&&z<=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,z){return O.u(N)?this[j]:this.set(z,N)},R.unix=function(){return Math.floor(this.valueOf()/1e3)},R.valueOf=function(){return this.$d.getTime()},R.startOf=function(N,j){var z=this,V=!!O.u(j)||j,b=O.p(N),_=function(se,K){var ne=O.w(z.$u?Date.UTC(z.$y,K,se):new Date(z.$y,K,se),z);return V?ne:ne.endOf(u)},B=function(se,K){return O.w(z.toDate()[se].apply(z.toDate("s"),(V?[0,0,0,0]:[23,59,59,999]).slice(K)),z)},S=this.$W,W=this.$M,J=this.$D,Y="set"+(this.$u?"UTC":"");switch(b){case d:return V?_(1,0):_(31,11);case c:return V?_(1,W):_(0,W+1);case f:var G=this.$locale().weekStart||0,X=(S<G?S+7:S)-G;return _(V?J-X:J+(6-X),W);case u:case p:return B(Y+"Hours",0);case l:return B(Y+"Minutes",1);case a:return B(Y+"Seconds",2);case s:return B(Y+"Milliseconds",3);default:return this.clone()}},R.endOf=function(N){return this.startOf(N,!1)},R.$set=function(N,j){var z,V=O.p(N),b="set"+(this.$u?"UTC":""),_=(z={},z[u]=b+"Date",z[p]=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)[V],B=V===u?this.$D+(j-this.$W):j;if(V===c||V===d){var S=this.clone().set(p,1);S.$d[_](B),S.init(),this.$d=S.set(p,Math.min(this.$D,S.daysInMonth())).$d}else _&&this.$d[_](B);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 z,V=this;N=Number(N);var b=O.p(j),_=function(W){var J=T(V);return O.w(J.date(J.date()+Math.round(W*N)),V)};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 B=(z={},z[a]=r,z[l]=i,z[s]=n,z)[b]||1,S=this.$d.getTime()+N*B;return O.w(S,this)},R.subtract=function(N,j){return this.add(-1*N,j)},R.format=function(N){var j=this,z=this.$locale();if(!this.isValid())return z.invalidDate||m;var V=N||"YYYY-MM-DDTHH:mm:ssZ",b=O.z(this),_=this.$H,B=this.$m,S=this.$M,W=z.weekdays,J=z.months,Y=z.meridiem,G=function(K,ne,$,te){return K&&(K[ne]||K(j,V))||$[ne].slice(0,te)},X=function(K){return O.s(_%12||12,K,"0")},se=Y||function(K,ne,$){var te=K<12?"AM":"PM";return $?te.toLowerCase():te};return V.replace(v,function(K,ne){return ne||function($){switch($){case"YY":return String(j.$y).slice(-2);case"YYYY":return O.s(j.$y,4,"0");case"M":return S+1;case"MM":return O.s(S+1,2,"0");case"MMM":return G(z.monthsShort,S,J,3);case"MMMM":return G(J,S);case"D":return j.$D;case"DD":return O.s(j.$D,2,"0");case"d":return String(j.$W);case"dd":return G(z.weekdaysMin,j.$W,W,2);case"ddd":return G(z.weekdaysShort,j.$W,W,3);case"dddd":return W[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(_,B,!0);case"A":return se(_,B,!1);case"m":return String(B);case"mm":return O.s(B,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}(K)||b.replace(":","")})},R.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},R.diff=function(N,j,z){var V,b=this,_=O.p(j),B=T(N),S=(B.utcOffset()-this.utcOffset())*r,W=this-B,J=function(){return O.m(b,B)};switch(_){case d:V=J()/12;break;case c:V=J();break;case h:V=J()/3;break;case f:V=(W-S)/6048e5;break;case u:V=(W-S)/864e5;break;case l:V=W/i;break;case a:V=W/r;break;case s:V=W/n;break;default:V=W}return z?V:O.a(V)},R.daysInMonth=function(){return this.endOf(c).$D},R.$locale=function(){return E[this.$L]},R.locale=function(N,j){if(!N)return this.$L;var z=this.clone(),V=P(N,j,!0);return V&&(z.$L=V),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=U.prototype;return T.prototype=L,[["$ms",o],["$s",s],["$m",a],["$H",l],["$W",u],["$M",c],["$y",d],["$D",p]].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,U,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})})(Zu);var lb=Zu.exports;const wi=vn(lb);var Ju={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)}}})})(Ju);var ub=Ju.exports;const cb=vn(ub);var Xu={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)}}})})(Xu);var fb=Xu.exports;const db=vn(fb);wi.extend(cb),wi.extend(db);function ec(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 hb(e,t="day"){var r,i,o;if(!e||e.length===0)return[];const n=[];(r=e[0])!=null&&r.timestamp&&n.push(tc(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(tc(l))}return n}function tc(e){return{id:nc(e),direction:"system",sender:{name:"system"},timestamp:e,block:{type:"text",text:nc(e)}}}function nc(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 pb(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 mb(e){return"#"+e.map(t=>`0${t.toString(16).toUpperCase()}`.slice(-2)).join("")}function gb(e,t){return e.map(n=>Math.round(n+(255-n)*t))}function yb(e,t){return e.map(n=>Math.round(n*t))}const wr=e=>t=>gb(t,e),Sr=e=>t=>yb(t,e),vb={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 rc(e,t=vb){const n={},r=pb(e);for(const[i,o]of Object.entries(t))n[i]=mb(o(r));return n}const ic=()=>{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 bb extends bn{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class wb extends bn{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class Sb extends bn{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class xr extends bn{}class oc 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},sc={year:ie,month:At,day:ie},xb={year:ie,month:At,day:ie,weekday:At},ac={year:ie,month:ht,day:ie},lc={year:ie,month:ht,day:ie,weekday:ht},uc={hour:ie,minute:ie},cc={hour:ie,minute:ie,second:ie},fc={hour:ie,minute:ie,second:ie,timeZoneName:At},dc={hour:ie,minute:ie,second:ie,timeZoneName:ht},hc={hour:ie,minute:ie,hourCycle:"h23"},pc={hour:ie,minute:ie,second:ie,hourCycle:"h23"},mc={hour:ie,minute:ie,second:ie,hourCycle:"h23",timeZoneName:At},gc={hour:ie,minute:ie,second:ie,hourCycle:"h23",timeZoneName:ht},yc={year:ie,month:ie,day:ie,hour:ie,minute:ie},vc={year:ie,month:ie,day:ie,hour:ie,minute:ie,second:ie},bc={year:ie,month:At,day:ie,hour:ie,minute:ie},wc={year:ie,month:At,day:ie,hour:ie,minute:ie,second:ie},kb={year:ie,month:At,day:ie,weekday:At,hour:ie,minute:ie},Sc={year:ie,month:ht,day:ie,hour:ie,minute:ie,timeZoneName:At},xc={year:ie,month:ht,day:ie,hour:ie,minute:ie,second:ie,timeZoneName:At},kc={year:ie,month:ht,day:ie,weekday:ht,hour:ie,minute:ie,timeZoneName:ht},Ec={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 Eb(e){return typeof e=="string"}function Cb(e){return Object.prototype.toString.call(e)==="[object Date]"}function Cc(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Ab(e){return Array.isArray(e)?e:[e]}function Ac(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 Tb(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 Ib(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=Ib(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 Tc(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 Ic(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)]=Ic(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 Tb(e,["hour","minute","second","millisecond"])}const Oc=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,Ob=["January","February","March","April","May","June","July","August","September","October","November","December"],Mc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Mb=["J","F","M","A","M","J","J","A","S","O","N","D"];function Dc(e){switch(e){case"narrow":return[...Mb];case"short":return[...Mc];case"long":return[...Ob];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 Nc=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],_c=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Db=["M","T","W","T","F","S","S"];function Pc(e){switch(e){case"narrow":return[...Db];case"short":return[..._c];case"long":return[...Nc];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Lc=["AM","PM"],Nb=["Before Christ","Anno Domini"],_b=["BC","AD"],Pb=["B","A"];function Fc(e){switch(e){case"narrow":return[...Pb];case"short":return[..._b];case"long":return[...Nb];default:return null}}function Lb(e){return Lc[e.hour<12?0:1]}function Fb(e,t){return Pc(t)[e.weekday-1]}function Rb(e,t){return Dc(t)[e.month-1]}function $b(e,t){return Fc(t)[e.year<0?0:1]}function Bb(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 Rc(e,t){let n="";for(const r of e)r.literal?n+=r.val:n+=t(r.val);return n}const zb={D:ds,DD:sc,DDD:ac,DDDD:lc,t:uc,tt:cc,ttt:fc,tttt:dc,T:hc,TT:pc,TTT:mc,TTTT:gc,f:yc,ff:bc,fff:Sc,ffff:kc,F:vc,FF:wc,FFF:xc,FFFF:Ec};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 zb[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,p)=>this.loc.extract(t,d,p),s=d=>t.isOffsetFixed&&t.offset===0&&d.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,d.format):"",a=()=>r?Lb(t):o({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(d,p)=>r?Rb(t,d):o(p?{month:d}:{month:d,day:"numeric"},"month"),u=(d,p)=>r?Fb(t,d):o(p?{weekday:d}:{weekday:d,month:"long",day:"numeric"},"weekday"),f=d=>{const p=lt.macroTokenToFormatOpts(d);return p?this.formatWithSystemDefault(t,p):d},c=d=>r?$b(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 Rc(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 Rc(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 Tc(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 Ub(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 Hb={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 Vb(e,t){const n=e.formatToParts(t),r=[];for(let i=0;i<n.length;i++){const{type:o,value:s}=n[i],a=Hb[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 Tc(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=Ub(this.name);let[i,o,s,a,l,u,f]=r.formatToParts?Vb(r,n):jb(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 p=d%1e3;return d-=p>=0?p:1e3+p,(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 Wb 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(Eb(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 Wb(e)}let $c=()=>Date.now(),Bc="system",zc=null,Uc=null,Hc=null,jc;class qe{static get now(){return $c}static set now(t){$c=t}static set defaultZone(t){Bc=t}static get defaultZone(){return on(Bc,vs.instance)}static get defaultLocale(){return zc}static set defaultLocale(t){zc=t}static get defaultNumberingSystem(){return Uc}static set defaultNumberingSystem(t){Uc=t}static get defaultOutputCalendar(){return Hc}static set defaultOutputCalendar(t){Hc=t}static get throwOnInvalid(){return jc}static set throwOnInvalid(t){jc=t}static resetCaches(){Re.resetCache(),Yt.resetCache()}}let Vc={};function qb(e,t={}){const n=JSON.stringify([e,t]);let r=Vc[n];return r||(r=new Intl.ListFormat(e,t),Vc[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 Yb(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 Kb(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 Gb(){return Tr||(Tr=new Intl.DateTimeFormat().resolvedOptions().locale,Tr)}function Qb(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 Zb(e,t,n){return(n||t)&&(e+="-u",n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`)),e}function Jb(e){const t=[];for(let n=1;n<=12;n++){const r=pe.utc(2016,n,1);t.push(e(r))}return t}function Xb(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 e0(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 t0{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=Yb(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 n0{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 r0{constructor(t,n,r){this.opts={style:"long",...r},!n&&Cc()&&(this.rtf=Kb(t,r))}format(t,n){return this.rtf?this.rtf.format(t,n):Bb(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":Gb()),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]=Qb(t);this.locale=o,this.numberingSystem=n||s||null,this.outputCalendar=r||a||null,this.intl=Zb(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=e0(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,Dc,()=>{const i=n?{month:t,day:"numeric"}:{month:t},o=n?"format":"standalone";return this.monthsCache[o][t]||(this.monthsCache[o][t]=Jb(s=>this.extract(s,i,"month"))),this.monthsCache[o][t]})}weekdays(t,n=!1,r=!0){return Oi(this,t,r,Pc,()=>{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]=Xb(s=>this.extract(s,i,"weekday"))),this.weekdaysCache[o][t]})}meridiems(t=!0){return Oi(this,void 0,t,()=>Lc,()=>{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,Fc,()=>{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 t0(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,n={}){return new n0(t,this.intl,n)}relFormatter(t={}){return new r0(this.intl,this.isEnglish(),t)}listFormatter(t={}){return qb(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 Wc(...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 qc=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,i0=`(?:${qc.source}?(?:\\[(${Oc.source})\\])?)?`,Es=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Yc=RegExp(`${Es.source}${i0}`),Cs=RegExp(`(?:T${Yc.source})?`),o0=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,s0=/(\d{4})-?W(\d\d)(?:-?(\d))?/,a0=/(\d{4})-?(\d{3})/,l0=Wc("weekYear","weekNumber","weekDay"),u0=Wc("year","ordinal"),c0=/(\d{4})-(\d\d)-(\d\d)/,Kc=RegExp(`${Es.source} ?(?:${qc.source}|(${Oc.source}))?`),f0=RegExp(`(?: ${Kc.source})?`);function zn(e,t,n){const r=e[t];return xe(r)?n:rn(r)}function d0(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 h0=RegExp(`^T?${Es.source}$`),p0=/^-?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 m0(e){const[t,n,r,i,o,s,a,l,u]=e,f=t[0]==="-",c=l&&l[0]==="-",h=(d,p=!1)=>d!==void 0&&(p||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 g0={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:Mc.indexOf(n)+1,day:rn(r),hour:rn(i),minute:rn(o)};return s&&(a.second=rn(s)),e&&(a.weekday=e.length>3?Nc.indexOf(e)+1:_c.indexOf(e)+1),a}const y0=/^(?:(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 v0(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=g0[l]:u?d=0:d=Ei(f,c),[h,new it(d)]}function b0(e){return e.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const w0=/^(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$/,S0=/^(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$/,x0=/^(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 Gc(e){const[,t,n,r,i,o,s,a]=e;return[As(t,i,r,n,o,s,a),it.utcInstance]}function k0(e){const[,t,n,r,i,o,s,a]=e;return[As(t,a,n,r,i,o,s),it.utcInstance]}const E0=Rn(o0,Cs),C0=Rn(s0,Cs),A0=Rn(a0,Cs),T0=Rn(Yc),Qc=$n(d0,Un,Ir,Or),I0=$n(l0,Un,Ir,Or),O0=$n(u0,Un,Ir,Or),M0=$n(Un,Ir,Or);function D0(e){return Bn(e,[E0,Qc],[C0,I0],[A0,O0],[T0,M0])}function N0(e){return Bn(b0(e),[y0,v0])}function _0(e){return Bn(e,[w0,Gc],[S0,Gc],[x0,k0])}function P0(e){return Bn(e,[p0,m0])}const L0=$n(Un);function F0(e){return Bn(e,[h0,L0])}const R0=Rn(c0,f0),$0=Rn(Kc),B0=$n(Un,Ir,Or);function z0(e){return Bn(e,[R0,Qc],[$0,B0])}const U0="Invalid Duration",Zc={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}},H0={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},...Zc},bt=146097/400,Hn=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:Hn/7,days:Hn,hours:Hn*24,minutes:Hn*24*60,seconds:Hn*24*60*60,milliseconds:Hn*24*60*60*1e3},...Zc},xn=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],V0=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 W0(e){return e<0?Math.floor(e):Math.ceil(e)}function Jc(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?W0(s):Math.trunc(s);r[i]+=l,t[n]-=l*o}function q0(e,t){V0.reduce((n,r)=>xe(t[r])?n:(n&&Jc(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:H0,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]=P0(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]=F0(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 Sb(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 oc(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):U0}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]=Ic(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 q0(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)&&Jc(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 Y0(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 wb(r);return new ze({invalid:r})}static fromDateTimes(t,n){const r=_r(t),i=_r(n),o=Y0(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:Cc()}}};function Xc(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 K0(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=Xc(a,l);return(u-u%7)/7}],["days",Xc]],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 G0(e,t,n,r){let[i,o,s,a]=K0(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"},ef={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]},Q0=Ts.hanidec.replace(/[\[|\]]/g,"").split("");function Z0(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+=Q0.indexOf(e[n]);else for(const i in ef){const[o,s]=ef[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 J0="missing Intl.DateTimeFormat.formatToParts support";function Ce(e,t=n=>n){return{regex:e,deser:([n])=>t(Z0(n))}}const tf="[  ]",nf=new RegExp(tf,"g");function X0(e){return e.replace(/\./g,"\\.?").replace(nf,tf)}function rf(e){return e.replace(/\./g,"").replace(nf," ").toLowerCase()}function Ot(e,t){return e===null?null:{regex:RegExp(e.map(X0).join("|")),deser:([n])=>e.findIndex(r=>rf(n)===rf(r))+t}}function of(e,t){return{regex:e,deser:([,n,r])=>Ei(n,r),groups:t}}function Is(e){return{regex:e,deser:([t])=>t}}function ew(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function tw(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(ew(g.val)),deser:([v])=>v,literal:!0}),m=(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 of(new RegExp(`([+-]${a.source})(?::(${r.source}))?`),2);case"ZZZ":return of(new RegExp(`([+-]${a.source})(${r.source})?`),2);case"z":return Is(/[a-z_+-/]{1,256}?/i);default:return d(g)}})(e)||{invalidReason:J0};return m.token=e,m}const nw={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 rw(e,t,n){const{type:r,value:i}=e;if(r==="literal")return{literal:!0,val:i};const o=n[r];let s=nw[r];if(typeof s=="object"&&(s=s[o]),s)return{literal:!1,val:s}}function iw(e){return[`^${e.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,e]}function ow(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 sw(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 aw(){return Os||(Os=pe.fromMillis(1555555555555)),Os}function lw(e,t){if(e.literal)return e;const n=lt.macroTokenToFormatOpts(e.val);if(!n)return e;const o=lt.create(t,n).formatDateTimeParts(aw()).map(s=>rw(s,t,n));return o.includes(void 0)?e:o}function uw(e,t){return Array.prototype.concat(...e.map(n=>lw(n,t)))}function sf(e,t,n){const r=uw(lt.parseFormat(n),e),i=r.map(s=>tw(s,e)),o=i.find(s=>s.invalidReason);if(o)return{input:t,tokens:r,invalidReason:o.invalidReason};{const[s,a]=iw(i),l=RegExp(s,"i"),[u,f]=ow(t,l,a),[c,h,d]=f?sw(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 cw(e,t,n){const{result:r,zone:i,specificOffset:o,invalidReason:s}=sf(e,t,n);return[r,i,o,s]}const af=[0,31,59,90,120,151,181,212,243,273,304,334],lf=[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 uf(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 cf(e,t,n){return n+(kr(e)?lf:af)[t-1]}function ff(e,t){const n=kr(e)?lf:af,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=cf(t,n,r),o=uf(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 df(e){const{weekYear:t,weekNumber:n,weekday:r}=e,i=uf(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}=ff(a,s);return{year:a,month:l,day:u,...Ai(e)}}function Ds(e){const{year:t,month:n,day:r}=e,i=cf(t,n,r);return{year:t,ordinal:i,...Ai(e)}}function hf(e){const{year:t,ordinal:n}=e,{month:r,day:i}=ff(t,n);return{year:t,month:r,day:i,...Ai(e)}}function fw(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 dw(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 pf(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 mf(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",gf=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 yf(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 vf(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 yf(ms(e),t,n)}function bf(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]=yf(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 wf(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 Sf={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},hw={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},pw={ordinal:1,hour:0,minute:0,second:0,millisecond:0},xf=["year","month","day","hour","minute","second","millisecond"],mw=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],gw=["year","ordinal","hour","minute","second","millisecond"];function kf(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 oc(e);return t}function Ef(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 xf)xe(e[u])&&(e[u]=Sf[u]);const a=pf(e)||mf(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 Cf(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 Af(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=vf(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]=Af(arguments),[r,i,o,s,a,l,u]=n;return Ef({year:r,month:i,day:o,hour:s,minute:a,second:l,millisecond:u},t)}static utc(){const[t,n]=Af(arguments),[r,i,o,s,a,l,u]=n;return t.zone=it.utcInstance,Ef({year:r,month:i,day:o,hour:s,minute:a,second:l,millisecond:u},t)}static fromJSDate(t,n={}){const r=Cb(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<-gf||t>gf?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,kf),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 p,m,g=vf(i,o);d?(p=mw,m=hw,g=Ms(g)):a?(p=gw,m=pw,g=Ds(g)):(p=xf,m=Sf);let v=!1;for(const D of p){const P=s[D];xe(P)?v?s[D]=m[D]:s[D]=g[D]:v=!0}const y=d?fw(s):a?dw(s):pf(s),w=y||mf(s);if(w)return pe.invalid(w);const C=d?df(s):a?hf(s):s,[k,E]=Ni(C,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]=D0(t);return Nr(r,i,n,"ISO 8601",t)}static fromRFC2822(t,n={}){const[r,i]=N0(t);return Nr(r,i,n,"RFC 2822",t)}static fromHTTP(t,n={}){const[r,i]=_0(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]=cw(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]=z0(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 bb(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,kf),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=df({...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=hf({...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,bf(this,n))}minus(t){if(!this.isValid)return this;const n=Ee.fromDurationLike(t).negate();return Dr(this,bf(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+=wf(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":"")+wf(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=Ab(n).map(Ee.normalizeUnit),s=t.valueOf()>this.valueOf(),a=s?this:t,l=s?t:this,u=G0(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),Cf(n,this.plus(r),{...t,numeric:"always",units:i,unit:o})}toRelativeCalendar(t={}){return this.isValid?Cf(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 Ac(t,n=>n.valueOf(),Math.min)}static max(...t){if(!t.every(pe.isDateTime))throw new vt("max requires all arguments be DateTimes");return Ac(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 sf(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 sc}static get DATE_MED_WITH_WEEKDAY(){return xb}static get DATE_FULL(){return ac}static get DATE_HUGE(){return lc}static get TIME_SIMPLE(){return uc}static get TIME_WITH_SECONDS(){return cc}static get TIME_WITH_SHORT_OFFSET(){return fc}static get TIME_WITH_LONG_OFFSET(){return dc}static get TIME_24_SIMPLE(){return hc}static get TIME_24_WITH_SECONDS(){return pc}static get TIME_24_WITH_SHORT_OFFSET(){return mc}static get TIME_24_WITH_LONG_OFFSET(){return gc}static get DATETIME_SHORT(){return yc}static get DATETIME_SHORT_WITH_SECONDS(){return vc}static get DATETIME_MED(){return bc}static get DATETIME_MED_WITH_SECONDS(){return wc}static get DATETIME_MED_WITH_WEEKDAY(){return kb}static get DATETIME_FULL(){return Sc}static get DATETIME_FULL_WITH_SECONDS(){return xc}static get DATETIME_HUGE(){return kc}static get DATETIME_HUGE_WITH_SECONDS(){return Ec}}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 yw(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 vw(e){return`#${((1<<24)+(e.r<<16)+(e.g<<8)+e.b).toString(16).slice(1)}`}const bw=(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 Tf(e){return Object.entries(e).reduce((t,[n,r])=>{const i=n.replace(/(\d+)/,o=>(1e3-parseInt(o)).toString());return{...t,[i]:r}},{})}const ww=2.4,Sw=.2126729,xw=.7151522,kw=.072175,Ew=.56,Cw=.57,Aw=.62,Tw=.65,Pi=.022,If=1.414,Iw=1.14,Ow=1.14,Mw=.035991,Dw=27.7847239587675,Nw=27.7847239587675,Of=.027,Mf=.027,Df=.001,_w=5e-4;function Nf(e){const{r:t,g:n,b:r}=e,i=o=>(o/255)**ww;return Sw*i(t)+xw*i(n)+kw*i(r)}function _f(e,t){if(!e||!t)return 0;let n=Nf(Ls(e)),r=Nf(Ls(t)),i=0,o=0;return n=n>Pi?n:n+(Pi-n)**If,r=r>Pi?r:r+(Pi-r)**If,Math.abs(r-n)<_w?0:(r>n?(i=(r**Ew-n**Cw)*Iw,o=i<Df?0:i<Mw?i-i*Dw*Of:i-Of):(i=(r**Tw-n**Aw)*Ow,o=i>-Df?0:i>-.035991?i-i*Nw*Mf:i+Mf),Math.abs(o*100))}const Pw=(e,t,n)=>{const r=e;let i=0;for(;t.some(o=>n(o)===e);)i+=1,e=`${r} (${i})`;return e};function Pf(e){const{fontFamily:t,...n}=e,r=Lf(n);return Gu(".bpReset",{...r,"font-family":`'${t}', sans-serif`})+Gu(":host, :root",{...r})}function Lf(e){const{radius:t,themeMode:n,color:r,variant:i,headerVariant:o}=e;let s={},a={};if(r){const h=rc(r),d=n==="dark"?Tf(h):h,p=rc(vw(bw(Ls(r)))),m=n==="dark"?Tf(p):p,g=n==="dark"?"#101010":"#fdfdfd";a=Object.entries({...d,1:g}).reduce((y,[w,C])=>({...y,[`--bpPrimary-${w}`]:C}),{});const v=Object.entries({...m,1:g}).reduce((y,[w,C])=>({...y,[`--bpGray-${w}`]:C}),{});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?_f(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?_f(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 Lw=e=>{if(typeof URL.canParse=="function")return URL.canParse(e);try{return new URL(e),!0}catch{return!1}},Ff=["audio","file","image","video"],Rf=e=>Ff.includes(e),$f="The Client ID is required to initialize the webchat.",Fw="The API url is required to initialize the webchat.",Rw="The Bot ID is required to initialize the webchat.",$w="No config URL provided.",Bf=`Invalid API URL.
18
- Please use a valid API URL.`,zf=`Invalid Client ID.
19
- Please use a valid Botpress Client ID.`,Uf=`Invalid URL.
20
- Please make sure your client ID and API URL are valid`,Bw=`Invalid config URL.
21
- Please make sure your config URL is valid`,zw=`Invalid webchat configuration.
22
- Please make sure your config file is valid`,Uw="Access denied to configuration file. Please check your credentials or your configuration URL and try again.",Hf=`This bot has temporarily paused.
23
- Please check back later.`,jf=`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.",Vf=`You've been disconnected from the conversation.
25
- Please refresh the page.`,Wf=`Unable to process the message.
26
- Please start a new conversation.`,Rs={ResourceNotFound:{type:"configuration",message:zf},Forbidden:{type:"bot",message:Hf}},$s={MethodNotFound:{type:"configuration",message:Uf},QuotaExceeded:{type:"bot",message:jf},Forbidden:{type:"bot",message:Fs}};function qf(e){return e in Rs}function Yf(e){return e in $s}function Kf(e){return e!==null&&typeof e=="object"&&"id"in e&&"code"in e&&"type"in e}function Gf(e){return e!==null&&typeof e=="object"&&"type"in e&&e.type==="error"&&"message"in e&&typeof e.message=="string"}const Qf=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")},Hw=["networkerror","failedtofetch","errorininputstream"],Pr=e=>{var n;console.error("An error occurred:",e);let t={type:"unknown",message:"An unexpected error occurred"};if(Kf(e))e.type==="network"?t={id:e.id,type:"network",message:Li}:(n=e.message)!=null&&n.includes("[Webhook Handler]")&&qf(e.type)?t={id:e.id,...Rs[e.type]}:Yf(e.type)?t={id:e.id,...$s[e.type]}:t={id:e.id,type:e.type,message:e.message||"An error occurred"};else if(Gf(e))Zf(e.message)?t={type:"disconnected",message:Vf}:Jf(e.message).includes("invalidcontenttype")?t={type:"bot",message:Wf}:t={type:"event",message:e.message};else if(e instanceof Error&&Zf(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 Zf(e){return Hw.some(t=>Jf(e).includes(t))}function Jf(e){return e.replaceAll(" ","").toLowerCase()}const jw=(e,t)=>{if(!e)return{type:"configuration",message:$f};if(!Lw(t))return{type:"configuration",message:Bf}},Vw=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 Ww(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=Qu(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 CP(){}function AP(){}function qw(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Yw=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Kw=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Gw={};function Xf(e,t){return(Gw.jsx?Kw:Yw).test(e)}const Qw=/[ \t\n\f\r]/g;function Zw(e){return typeof e=="object"?e.type==="text"?ed(e.value):!1:ed(e)}function ed(e){return e.replace(Qw,"")===""}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 td(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 Jw=0;const ge=Cn(),We=Cn(),zs=Cn(),Q=Cn(),_e=Cn(),jn=Cn(),pt=Cn();function Cn(){return 2**++Jw}const Us=Object.freeze(Object.defineProperty({__proto__:null,boolean:ge,booleanish:We,commaOrSpaceSeparated:pt,commaSeparated:jn,number:Q,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),nd(this,"space",i),typeof r=="number")for(;++o<Hs.length;){const s=Hs[o];nd(this,Hs[o],(r&Us[s])===Us[s])}}}js.prototype.defined=!0;function nd(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 rd=Vn({properties:{ariaActiveDescendant:null,ariaAtomic:We,ariaAutoComplete:null,ariaBusy:We,ariaChecked:We,ariaColCount:Q,ariaColIndex:Q,ariaColSpan:Q,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:Q,ariaLive:null,ariaModal:We,ariaMultiLine:We,ariaMultiSelectable:We,ariaOrientation:null,ariaOwns:_e,ariaPlaceholder:null,ariaPosInSet:Q,ariaPressed:We,ariaReadOnly:We,ariaRelevant:null,ariaRequired:We,ariaRoleDescription:_e,ariaRowCount:Q,ariaRowIndex:Q,ariaRowSpan:Q,ariaSelected:We,ariaSetSize:Q,ariaSort:null,ariaValueMax:Q,ariaValueMin:Q,ariaValueNow:Q,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function id(e,t){return t in e?e[t]:t}function od(e,t){return id(e,t.toLowerCase())}const Xw=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:Q,colSpan:null,content:null,contentEditable:We,controls:ge,controlsList:_e,coords:Q|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:Q,hidden:zs,high:Q,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:Q,manifest:null,max:null,maxLength:Q,media:null,method:null,min:null,minLength:Q,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:Q,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:Q,rowSpan:Q,sandbox:_e,scope:null,scoped:ge,seamless:ge,selected:ge,shadowRootClonable:ge,shadowRootDelegatesFocus:ge,shadowRootMode:null,shape:null,size:Q,sizes:null,slot:null,span:Q,spellCheck:We,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Q,step:null,style:null,tabIndex:Q,target:null,title:null,translate:null,type:null,typeMustMatch:ge,useMap:null,value:We,width:Q,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:_e,axis:null,background:null,bgColor:null,border:Q,borderColor:null,bottomMargin:Q,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:Q,leftMargin:Q,link:null,longDesc:null,lowSrc:null,marginHeight:Q,marginWidth:Q,noResize:ge,noHref:ge,noShade:ge,noWrap:ge,object:null,profile:null,prompt:null,rev:null,rightMargin:Q,rules:null,scheme:null,scrolling:We,standby:null,summary:null,text:null,topMargin:Q,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Q,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ge,disableRemotePlayback:ge,prefix:null,property:null,results:Q,security:null,unselectable:null},space:"html",transform:od}),e1=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:Q,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Q,amplitude:Q,arabicForm:null,ascent:Q,attributeName:null,attributeType:null,azimuth:Q,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Q,by:null,calcMode:null,capHeight:Q,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:Q,diffuseConstant:Q,direction:null,display:null,dur:null,divisor:Q,dominantBaseline:null,download:ge,dx:null,dy:null,edgeMode:null,editable:null,elevation:Q,enableBackground:null,end:null,event:null,exponent:Q,externalResourcesRequired:null,fill:null,fillOpacity:Q,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:Q,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Q,horizOriginX:Q,horizOriginY:Q,id:null,ideographic:Q,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Q,k:Q,k1:Q,k2:Q,k3:Q,k4:Q,kernelMatrix:pt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Q,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:Q,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:Q,overlineThickness:Q,paintOrder:null,panose1:null,path:null,pathLength:Q,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:_e,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Q,pointsAtY:Q,pointsAtZ:Q,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:Q,specularExponent:Q,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Q,strikethroughThickness:Q,string:null,stroke:null,strokeDashArray:pt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Q,strokeOpacity:Q,strokeWidth:null,style:null,surfaceScale:Q,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:pt,tabIndex:Q,tableValues:null,target:null,targetX:Q,targetY:Q,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:Q,underlineThickness:Q,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Q,values:null,vAlphabetic:Q,vMathematical:Q,vectorEffect:null,vHanging:Q,vIdeographic:Q,version:null,vertAdvY:Q,vertOriginX:Q,vertOriginY:Q,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Q,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:id}),sd=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()}}),ad=Vn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:od}),ld=Vn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),t1={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"},n1=/[A-Z]/g,ud=/-[a-z]/g,r1=/^data[-\w.:]+$/i;function i1(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"&&r1.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(ud,s1);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!ud.test(o)){let s=o.replace(n1,o1);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=js}return new i(r,t)}function o1(e){return"-"+e.toLowerCase()}function s1(e){return e.charAt(1).toUpperCase()}const a1=td([rd,Xw,sd,ad,ld],"html"),Vs=td([rd,e1,sd,ad,ld],"svg");function l1(e){return e.join(" ").trim()}var Ws={},cd=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,u1=/\n/g,c1=/^\s*/,f1=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,d1=/^:\s*/,h1=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,p1=/^[;\s]*/,m1=/^\s+|\s+$/g,g1=`
27
- `,fd="/",dd="*",An="",y1="comment",v1="declaration";function b1(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(p){var m=p.match(u1);m&&(n+=m.length);var g=p.lastIndexOf(g1);r=~g?p.length-g:r+p.length}function o(){var p={line:n,column:r};return function(m){return m.position=new s(p),u(),m}}function s(p){this.start=p,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function a(p){var m=new Error(t.source+":"+n+":"+r+": "+p);if(m.reason=p,m.filename=t.source,m.line=n,m.column=r,m.source=e,!t.silent)throw m}function l(p){var m=p.exec(e);if(m){var g=m[0];return i(g),e=e.slice(g.length),m}}function u(){l(c1)}function f(p){var m;for(p=p||[];m=c();)m!==!1&&p.push(m);return p}function c(){var p=o();if(!(fd!=e.charAt(0)||dd!=e.charAt(1))){for(var m=2;An!=e.charAt(m)&&(dd!=e.charAt(m)||fd!=e.charAt(m+1));)++m;if(m+=2,An===e.charAt(m-1))return a("End of comment missing");var g=e.slice(2,m-2);return r+=2,i(g),e=e.slice(m),r+=2,p({type:y1,comment:g})}}function h(){var p=o(),m=l(f1);if(m){if(c(),!l(d1))return a("property missing ':'");var g=l(h1),v=p({type:v1,property:hd(m[0].replace(cd,An)),value:g?hd(g[0].replace(cd,An)):An});return l(p1),v}}function d(){var p=[];f(p);for(var m;m=h();)m!==!1&&(p.push(m),f(p));return p}return u(),d()}function hd(e){return e?e.replace(m1,An):An}var w1=b1,S1=yn&&yn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.default=k1;const x1=S1(w1);function k1(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,x1.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 E1=/^--[a-zA-Z0-9_-]+$/,C1=/-([a-z])/g,A1=/^[^-]+$/,T1=/^-(webkit|moz|ms|o|khtml)-/,I1=/^-(ms)-/,O1=function(e){return!e||A1.test(e)||E1.test(e)},M1=function(e,t){return t.toUpperCase()},pd=function(e,t){return"".concat(t,"-")},D1=function(e,t){return t===void 0&&(t={}),O1(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(I1,pd):e=e.replace(T1,pd),e.replace(C1,M1))};Fi.camelCase=D1;var N1=yn&&yn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},_1=N1(Ws),P1=Fi;function qs(e,t){var n={};return!e||typeof e!="string"||(0,_1.default)(e,function(r,i){r&&i&&(n[(0,P1.camelCase)(r,t)]=i)}),n}qs.default=qs;var L1=qs;const F1=vn(L1),md=gd("end"),Ys=gd("start");function gd(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 R1(e){const t=Ys(e),n=md(e);if(t&&n)return{start:t,end:n}}function Fr(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?yd(e.position):"start"in e||"end"in e?yd(e):"line"in e||"column"in e?Ks(e):""}function Ks(e){return vd(e&&e.line)+":"+vd(e&&e.column)}function yd(e){return Ks(e&&e.start)+"-"+Ks(e&&e.end)}function vd(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,$1=new Map,B1=/[A-Z]/g,z1=new Set(["table","tbody","thead","tfoot","tr"]),U1=new Set(["td","th"]),bd="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function H1(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=Q1(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=G1(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:a1,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=wd(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function wd(e,t,n){if(t.type==="element")return j1(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return V1(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return q1(e,t,n);if(t.type==="mdxjsEsm")return W1(e,t);if(t.type==="root")return Y1(e,t,n);if(t.type==="text")return K1(e,t)}function j1(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=xd(e,t.tagName,!1),s=Z1(e,t);let a=Zs(e,t);return z1.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!Zw(l):!0})),Sd(e,s,o,t),Qs(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function V1(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 W1(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Rr(e,t.position)}function q1(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:xd(e,t.name,!0),s=J1(e,t),a=Zs(e,t);return Sd(e,s,o,t),Qs(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function Y1(e,t,n){const r={};return Qs(r,Zs(e,t)),e.create(t,e.Fragment,r,n)}function K1(e,t){return t.value}function Sd(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 G1(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 Q1(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 Z1(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Gs.call(t.properties,i)){const o=X1(e,i,t.properties[i]);if(o){const[s,a]=o;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&U1.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 J1(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:$1;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=wd(e,o,s);a!==void 0&&n.push(a)}return n}function X1(e,t,n){const r=i1(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?qw(n):l1(n)),r.property==="style"){let i=typeof n=="object"?n:eS(e,String(n));return e.stylePropertyNameCase==="css"&&(i=tS(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?t1[r.property]||r.property:r.attribute,n]}}function eS(e,t){try{return F1(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=bd+"#cannot-parse-style-attribute",i}}function xd(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=Xf(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=Xf(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=bd+"#cannot-handle-mdx-estrees-without-createevaluater",n}function tS(e){const t={};let n;for(n in e)Gs.call(e,n)&&(t[nS(n)]=e[n]);return t}function nS(e){let t=e.replace(B1,rS);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function rS(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"]},iS={};function Xs(e,t){const n=iS,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return kd(e,r,i)}function kd(e,t,n){if(oS(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 Ed(e.children,t,n)}return Array.isArray(e)?Ed(e,t,n):""}function Ed(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=kd(e[i],t,n);return r.join("")}function oS(e){return!!(e&&typeof e=="object")}const Cd=document.createElement("i");function ea(e){const t="&"+e+";";Cd.innerHTML=t;const n=Cd.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 Ad={}.hasOwnProperty;function Td(e){const t={};let n=-1;for(;++n<e.length;)sS(t,e[n]);return t}function sS(e,t){let n;for(n in t){const i=(Ad.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){Ad.call(i,s)||(i[s]=[]);const a=o[s];aS(i[s],Array.isArray(a)?a:a?[a]:[])}}}function aS(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 Id(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]/),lS=sn(/[#-'*+\--9=?A-Z^-~]/);function Ri(e){return e!==null&&(e<32||e===127)}const ta=sn(/\d/),uS=sn(/[\dA-Fa-f]/),cS=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 fS={tokenize:dS};function dS(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 hS={tokenize:pS},Od={tokenize:mS};function pS(e){const t=this,n=[];let r=0,i,o,s;return a;function a(w){if(r<n.length){const C=n[r];return t.containerState=C[1],e.attempt(C[0].continuation,l,u)(w)}return u(w)}function l(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&y();const C=t.events.length;let k=C,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=C;for(;I<t.events.length;)t.events[I][1].end={...E},I++;return mt(t.events,k+1,0,t.events.slice(C)),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 p(w);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Od,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,p(w)}function h(w){return t.containerState={},e.attempt(Od,d,p)(w)}function d(w){return r++,n.push([t.currentConstruct,t.containerState]),h(w)}function p(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}),m(w)}function m(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),m)}function g(w,C){const k=t.sliceStream(w);if(C&&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 C=n.length;for(;C-- >w;){const k=n[C];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 mS(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:gS,tokenize:yS};function gS(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};Md(c,-l),Md(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 yS(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 Md(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const vS={name:"autolink",tokenize:bS};function bS(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):lS(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 p=d===45?h:c;return e.consume(d),p}return n(d)}}const $r={partial:!0,tokenize:wS};function wS(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 Dd={continuation:{tokenize:xS},exit:kS,name:"blockQuote",tokenize:SS};function SS(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 xS(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(Dd,t,n)(s)}}function kS(e){e.exit("blockQuote")}const Nd={name:"characterEscape",tokenize:ES};function ES(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 cS(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const _d={name:"characterReference",tokenize:CS};function CS(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=uS,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 Pd={partial:!0,tokenize:TS},Ld={concrete:!0,name:"codeFenced",tokenize:AS};function AS(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(Pd,m,C)(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"}),p(E))}function p(E){return E===null||ce(E)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(E)):E===96&&E===a?n(E):(e.consume(E),p)}function m(E){return e.attempt(i,C,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(Pd,m,C)(E):(e.enter("codeFlowValue"),w(E))}function w(E){return E===null||ce(E)?(e.exit("codeFlowValue"),y(E)):(e.consume(E),w)}function C(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,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):U(R)}function U(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 TS(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:OS},IS={partial:!0,tokenize:MS};function OS(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(IS,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 MS(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 DS={name:"codeText",previous:_S,resolve:NS,tokenize:PS};function NS(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 _S(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function PS(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 LS{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 Fd(e){const t={};let n=-1,r,i,o,s,a,l,u;const f=new LS(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,FS(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 FS(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,p=0,m=0;const g=[m];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&&(m=h+1,g.push(m),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[p+l[h][0]]=p+l[h][1],p+=l[h][1]-l[h][0]-1;return u}const RS={resolve:BS,tokenize:zS},$S={partial:!0,tokenize:US};function BS(e){return Fd(e),e}function zS(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($S,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 US(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 Rd(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"}),m(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?p:d)}function p(v){return v===60||v===62||v===92?(e.consume(v),d):d(v)}function m(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++,m):v===41?(e.consume(v),f--,m):v===null||v===32||v===40||Ri(v)?n(v):(e.consume(v),v===92?g:m)}function g(v){return v===40||v===41||v===92?(e.consume(v),m):m(v)}}function $d(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 Bd(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 HS={name:"definition",tokenize:VS},jS={partial:!0,tokenize:WS};function VS(e,t,n){const r=this;let i;return o;function o(d){return e.enter("definition"),s(d)}function s(d){return $d.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 Rd(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 WS(e,t,n){return r;function r(a){return De(a)?zr(e,i)(a):n(a)}function i(a){return Bd(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 qS={name:"hardBreakEscape",tokenize:YS};function YS(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 KS={name:"headingAtx",resolve:GS,tokenize:QS};function GS(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 QS(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 ZS=["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"],zd=["pre","script","style","textarea"],JS={concrete:!0,name:"htmlFlow",resolveTo:tx,tokenize:nx},XS={partial:!0,tokenize:ix},ex={partial:!0,tokenize:rx};function tx(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 nx(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,m):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,p):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 p(S){const W="CDATA[";return S===W.charCodeAt(a++)?(e.consume(S),a===W.length?r.interrupt?t:U:p):n(S)}function m(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 W=S===47,J=s.toLowerCase();return!W&&!o&&zd.includes(J)?(i=1,r.interrupt?t(S):U(S)):ZS.includes(s.toLowerCase())?(i=6,W?(e.consume(S),v):r.interrupt?t(S):U(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:U):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),C):ve(S)?(e.consume(S),w):T(S)}function C(S){return S===45||S===46||S===58||S===95||tt(S)?(e.consume(S),C):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)?U(S):ve(S)?(e.consume(S),O):n(S)}function U(S){return S===45&&i===2?(e.consume(S),N):S===60&&i===1?(e.consume(S),j):S===62&&i===4?(e.consume(S),_):S===63&&i===3?(e.consume(S),b):S===93&&i===5?(e.consume(S),V):ce(S)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(XS,B,L)(S)):S===null||ce(S)?(e.exit("htmlFlowData"),L(S)):(e.consume(S),U)}function L(S){return e.check(ex,F,B)(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"),U(S))}function N(S){return S===45?(e.consume(S),b):U(S)}function j(S){return S===47?(e.consume(S),s="",z):U(S)}function z(S){if(S===62){const W=s.toLowerCase();return zd.includes(W)?(e.consume(S),_):U(S)}return ot(S)&&s.length<8?(e.consume(S),s+=String.fromCharCode(S),z):U(S)}function V(S){return S===93?(e.consume(S),b):U(S)}function b(S){return S===62?(e.consume(S),_):S===45&&i===2?(e.consume(S),b):U(S)}function _(S){return S===null||ce(S)?(e.exit("htmlFlowData"),B(S)):(e.consume(S),_)}function B(S){return e.exit("htmlFlow"),t(S)}}function rx(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 ix(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt($r,t,n)}}const ox={name:"htmlText",tokenize:sx};function sx(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,p):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,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 p(b){const _="CDATA[";return b===_.charCodeAt(o++)?(e.consume(b),o===_.length?m:p):n(b)}function m(b){return b===null?n(b):b===93?(e.consume(b),g):ce(b)?(s=m,j(b)):(e.consume(b),m)}function g(b){return b===93?(e.consume(b),v):m(b)}function v(b){return b===62?N(b):b===93?(e.consume(b),v):m(b)}function y(b){return b===null||b===62?N(b):ce(b)?(s=y,j(b)):(e.consume(b),y)}function w(b){return b===null?n(b):b===63?(e.consume(b),C):ce(b)?(s=w,j(b)):(e.consume(b),w)}function C(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,j(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,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,L):ce(b)?(s=U,j(b)):ve(b)?(e.consume(b),U):(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,j(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 j(b){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),z}function z(b){return ve(b)?ke(e,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):V(b)}function V(b){return e.enter("htmlTextData"),s(b)}}const ia={name:"labelEnd",resolveAll:cx,resolveTo:fx,tokenize:dx},ax={tokenize:hx},lx={tokenize:px},ux={tokenize:mx};function cx(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 fx(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 dx(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(ax,f,s?f:c)(h):h===91?e.attempt(lx,f,s?u:c)(h):s?f(h):c(h)}function u(h){return e.attempt(ux,f,c)(h)}function f(h){return t(h)}function c(h){return o._balanced=!0,n(h)}}function hx(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):Rd(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?Bd(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 px(e,t,n){const r=this;return i;function i(a){return $d.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 mx(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 gx={name:"labelStartImage",resolveAll:ia.resolveAll,tokenize:yx};function yx(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 vx={name:"labelStartLink",resolveAll:ia.resolveAll,tokenize:bx};function bx(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:wx};function wx(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:Sx};function Sx(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:Cx},exit:Tx,name:"list",tokenize:Ex},xx={partial:!0,tokenize:Ix},kx={partial:!0,tokenize:Ax};function Ex(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 p=r.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||d===r.containerState.marker:ta(d)){if(r.containerState.type||(r.containerState.type=p,e.enter(p,{_container:!0})),p==="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(xx,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 Cx(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(kx,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 Ax(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 Tx(e){e.exit(this.containerState.type)}function Ix(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 Ud={name:"setextUnderline",resolveTo:Ox,tokenize:Mx};function Ox(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 Mx(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 Dx={tokenize:Nx};function Nx(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(RS,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 _x={resolveAll:jd()},Px=Hd("string"),Lx=Hd("text");function Hd(e){return{resolveAll:jd(e==="text"?Fx: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 jd(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 Fx(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 Rx=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:HS},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:Dd},flow:{35:KS,42:zi,45:[Ud,zi],60:JS,61:Ud,95:zi,96:Ld,126:Ld},flowInitial:{[-2]:ra,[-1]:ra,32:ra},insideSpan:{null:[na,_x]},string:{38:_d,92:Nd},text:{[-5]:oa,[-4]:oa,[-3]:oa,33:gx,38:_d,42:na,60:[vS,ox],91:vx,92:[qS,Nd],93:ia,95:na,96:DS}},Symbol.toStringTag,{value:"Module"}));function $x(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:C,interrupt:I(E,{interrupt:!0})},u={code:null,containerState:{},defineSkip:m,events:[],now:p,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,U){return zx(d(O),U)}function d(O){return Bx(s,O)}function p(){const{_bufferIndex:O,_index:U,line:L,column:F,offset:R}=r;return{_bufferIndex:O,_index:U,line:L,column:F,offset:R}}function m(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;)v(U.charCodeAt(r._bufferIndex));else v(U)}}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,U){const L=U||{};return L.type=O,L.start=p(),u.events.push(["enter",L,u]),a.push(L),L}function C(O){const U=a.pop();return U.end=p(),u.events.push(["exit",U,u]),U}function k(O,U){D(O,U.from)}function E(O,U){U.restore()}function I(O,U){return L;function L(F,R,N){let j,z,V,b;return Array.isArray(F)?B(F):"tokenize"in F?B([F]):_(F);function _(Y){return G;function G(X){const se=X!==null&&Y[X],K=X!==null&&Y.null,ne=[...Array.isArray(se)?se:se?[se]:[],...Array.isArray(K)?K:K?[K]:[]];return B(ne)(X)}}function B(Y){return j=Y,z=0,Y.length===0?N:S(Y[z])}function S(Y){return G;function G(X){return b=P(),V=Y,Y.partial||(u.currentConstruct=Y),Y.name&&u.parser.constructs.disable.null.includes(Y.name)?J():Y.tokenize.call(U?Object.assign(Object.create(u),U):u,l,W,J)(X)}}function W(Y){return O(V,b),R}function J(Y){return b.restore(),++z<j.length?S(j[z]):N}}}function D(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=p(),U=u.previous,L=u.currentConstruct,F=u.events.length,R=Array.from(a);return{from:F,restore:N};function N(){r=O,u.previous=U,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 Bx(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 zx(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 Wu;function hb(){return Wu||(Wu=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=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;as.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())}()),as}process.env.NODE_ENV==="production"?os.exports=db():os.exports=hb();var ls=os.exports;function pb(){return ls.useSyncExternalStore(mb,()=>!0,()=>!1)}function mb(){return()=>{}}var us="Avatar",[gb]=tb(us),[yb,qu]=gb(us),cs=C.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,o]=C.useState("idle");return x.jsx(yb,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:o,children:x.jsx(is.span,{...r,ref:t})})});cs.displayName=us;var Yu="AvatarImage",fs=C.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...o}=e,s=qu(Yu,n),a=vb(r,o),l=Fn(u=>{i(u),s.onImageLoadingStatusChange(u)});return tn(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?x.jsx(is.img,{...o,ref:t,src:r}):null});fs.displayName=Yu;var Ku="AvatarFallback",ds=C.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,o=qu(Ku,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(is.span,{...i,ref:t}):null});ds.displayName=Ku;function Gu(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function vb(e,{referrerPolicy:t,crossOrigin:n}){const r=pb(),i=C.useRef(null),o=r?(i.current||(i.current=new window.Image),i.current):null,[s,a]=C.useState(()=>Gu(o,e));return tn(()=>{a(Gu(o,e))},[o,e]),tn(()=>{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 Qu(e,t){let n=`${e} {`;for(const[r,i]of Object.entries(t))n+=`${r}: ${i}; `;return n+="}",n}function Zu(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 bb=(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 Ju={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(vn,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 _=["th","st","nd","rd"],z=F%100;return"["+F+(_[(z-20)%10]||_[z]||_[0])+"]"}},w=function(F,_,z){var $=String(F);return!$||$.length>=_?F:""+Array(_+1-$.length).join(z)+F},A={s:w,z:function(F){var _=-F.utcOffset(),z=Math.abs(_),$=Math.floor(z/60),U=z%60;return(_<=0?"+":"-")+w($,2,"0")+":"+w(U,2,"0")},m:function F(_,z){if(_.date()<z.date())return-F(z,_);var $=12*(z.year()-_.year())+(z.month()-_.month()),U=_.clone().add($,c),W=z-U<0,b=_.clone().add($+(W?-1:1),c);return+(-($+(z-U)/(W?U-b:b-U))||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",M=function(F){return F instanceof H||!(!F||!F[I])},L=function F(_,z,$){var U;if(!_)return k;if(typeof _=="string"){var W=_.toLowerCase();E[W]&&(U=W),z&&(E[W]=z,U=W);var b=_.split("-");if(!U&&b.length>1)return F(b[0])}else{var N=_.name;E[N]=_,U=N}return!$&&U&&(k=U),U||!$&&k},T=function(F,_){if(M(F))return F.clone();var z=typeof _=="object"?_:{};return z.date=F,z.args=arguments,new H(z)},O=A;O.l=L,O.i=M,O.w=function(F,_){return T(F,{locale:_.$L,utc:_.$u,x:_.$x,$offset:_.$offset})};var H=function(){function F(z){this.$L=L(z.locale,null,!0),this.parse(z),this.$x=this.$x||z.x||{},this[I]=!0}var _=F.prototype;return _.parse=function(z){this.$d=function($){var U=$.date,W=$.utc;if(U===null)return new Date(NaN);if(O.u(U))return new Date;if(U instanceof Date)return new Date(U);if(typeof U=="string"&&!/Z$/i.test(U)){var b=U.match(g);if(b){var N=b[2]-1||0,R=(b[7]||"0").substring(0,3);return W?new Date(Date.UTC(b[1],N,b[3]||1,b[4]||0,b[5]||0,b[6]||0,R)):new Date(b[1],N,b[3]||1,b[4]||0,b[5]||0,b[6]||0,R)}}return new Date(U)}(z),this.init()},_.init=function(){var z=this.$d;this.$y=z.getFullYear(),this.$M=z.getMonth(),this.$D=z.getDate(),this.$W=z.getDay(),this.$H=z.getHours(),this.$m=z.getMinutes(),this.$s=z.getSeconds(),this.$ms=z.getMilliseconds()},_.$utils=function(){return O},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(z,$){var U=T(z);return this.startOf($)<=U&&U<=this.endOf($)},_.isAfter=function(z,$){return T(z)<this.startOf($)},_.isBefore=function(z,$){return this.endOf($)<T(z)},_.$g=function(z,$,U){return O.u(z)?this[$]:this.set(U,z)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(z,$){var U=this,W=!!O.u($)||$,b=O.p(z),N=function(se,K){var re=O.w(U.$u?Date.UTC(U.$y,K,se):new Date(U.$y,K,se),U);return W?re:re.endOf(u)},R=function(se,K){return O.w(U.toDate()[se].apply(U.toDate("s"),(W?[0,0,0,0]:[23,59,59,999]).slice(K)),U)},S=this.$W,V=this.$M,ee=this.$D,Y="set"+(this.$u?"UTC":"");switch(b){case d:return W?N(1,0):N(31,11);case c:return W?N(1,V):N(0,V+1);case f:var G=this.$locale().weekStart||0,J=(S<G?S+7:S)-G;return N(W?ee-J:ee+(6-J),V);case u:case m:return R(Y+"Hours",0);case l:return R(Y+"Minutes",1);case a:return R(Y+"Seconds",2);case s:return R(Y+"Milliseconds",3);default:return this.clone()}},_.endOf=function(z){return this.startOf(z,!1)},_.$set=function(z,$){var U,W=O.p(z),b="set"+(this.$u?"UTC":""),N=(U={},U[u]=b+"Date",U[m]=b+"Date",U[c]=b+"Month",U[d]=b+"FullYear",U[l]=b+"Hours",U[a]=b+"Minutes",U[s]=b+"Seconds",U[o]=b+"Milliseconds",U)[W],R=W===u?this.$D+($-this.$W):$;if(W===c||W===d){var S=this.clone().set(m,1);S.$d[N](R),S.init(),this.$d=S.set(m,Math.min(this.$D,S.daysInMonth())).$d}else N&&this.$d[N](R);return this.init(),this},_.set=function(z,$){return this.clone().$set(z,$)},_.get=function(z){return this[O.p(z)]()},_.add=function(z,$){var U,W=this;z=Number(z);var b=O.p($),N=function(V){var ee=T(W);return O.w(ee.date(ee.date()+Math.round(V*z)),W)};if(b===c)return this.set(c,this.$M+z);if(b===d)return this.set(d,this.$y+z);if(b===u)return N(1);if(b===f)return N(7);var R=(U={},U[a]=r,U[l]=i,U[s]=n,U)[b]||1,S=this.$d.getTime()+z*R;return O.w(S,this)},_.subtract=function(z,$){return this.add(-1*z,$)},_.format=function(z){var $=this,U=this.$locale();if(!this.isValid())return U.invalidDate||p;var W=z||"YYYY-MM-DDTHH:mm:ssZ",b=O.z(this),N=this.$H,R=this.$m,S=this.$M,V=U.weekdays,ee=U.months,Y=U.meridiem,G=function(K,re,B,ne){return K&&(K[re]||K($,W))||B[re].slice(0,ne)},J=function(K){return O.s(N%12||12,K,"0")},se=Y||function(K,re,B){var ne=K<12?"AM":"PM";return B?ne.toLowerCase():ne};return W.replace(v,function(K,re){return re||function(B){switch(B){case"YY":return String($.$y).slice(-2);case"YYYY":return O.s($.$y,4,"0");case"M":return S+1;case"MM":return O.s(S+1,2,"0");case"MMM":return G(U.monthsShort,S,ee,3);case"MMMM":return G(ee,S);case"D":return $.$D;case"DD":return O.s($.$D,2,"0");case"d":return String($.$W);case"dd":return G(U.weekdaysMin,$.$W,V,2);case"ddd":return G(U.weekdaysShort,$.$W,V,3);case"dddd":return V[$.$W];case"H":return String(N);case"HH":return O.s(N,2,"0");case"h":return J(1);case"hh":return J(2);case"a":return se(N,R,!0);case"A":return se(N,R,!1);case"m":return String(R);case"mm":return O.s(R,2,"0");case"s":return String($.$s);case"ss":return O.s($.$s,2,"0");case"SSS":return O.s($.$ms,3,"0");case"Z":return b}return null}(K)||b.replace(":","")})},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(z,$,U){var W,b=this,N=O.p($),R=T(z),S=(R.utcOffset()-this.utcOffset())*r,V=this-R,ee=function(){return O.m(b,R)};switch(N){case d:W=ee()/12;break;case c:W=ee();break;case h:W=ee()/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 U?W:O.a(W)},_.daysInMonth=function(){return this.endOf(c).$D},_.$locale=function(){return E[this.$L]},_.locale=function(z,$){if(!z)return this.$L;var U=this.clone(),W=L(z,$,!0);return W&&(U.$L=W),U},_.clone=function(){return O.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},F}(),P=H.prototype;return T.prototype=P,[["$ms",o],["$s",s],["$m",a],["$H",l],["$W",u],["$M",c],["$y",d],["$D",m]].forEach(function(F){P[F[1]]=function(_){return this.$g(_,F[0],F[1])}}),T.extend=function(F,_){return F.$i||(F(_,H,T),F.$i=!0),T},T.locale=L,T.isDayjs=M,T.unix=function(F){return T(1e3*F)},T.en=E[k],T.Ls=E,T.p={},T})})(Ju);var wb=Ju.exports;const kr=bn(wb);var Xu={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(vn,function(){return function(n,r,i){r.prototype.isToday=function(){var o="YYYY-MM-DD",s=i();return this.format(o)===s.format(o)}}})})(Xu);var Sb=Xu.exports;const kb=bn(Sb);var ec={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(vn,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)}}})})(ec);var xb=ec.exports;const Eb=bn(xb),tc={"composer.placeholder":"Écrivez votre message...","composer.sendButton.ariaLabel":"Bouton Envoyer le message","composer.voiceButton.ariaLabel":"Bouton Saisie vocale","composer.fileButton.ariaLabel":"Bouton Téléverser un fichier","composer.messageInput.ariaLabel":"Saisie du message","fileAttachment.uploadError":"Erreur de téléversement","fileAttachment.fallbackExtension":"Fichier","fileAttachment.removeButton.ariaLabel":"Bouton Supprimer le fichier","header.defaultBotName":"Bot","header.expandButton.ariaLabel":"Bouton Développer l'en-tête","header.sound.enable":"Activer les sons du chat","header.sound.disable":"Désactiver les sons du chat","conversationHistory.title":"Conversations","conversationHistory.empty":"Aucune conversation commencée","conversationHistory.newConversation":"Nouvelle conversation","conversationHistory.sentAttachment":"A envoyé une pièce jointe","conversationHistory.showButton.ariaLabel":"Bouton Afficher les conversations récentes","restartConversation.title":"Créer une nouvelle conversation","restartConversation.description":"Cela effacera la conversation en cours et en démarrera une nouvelle.","restartConversation.confirm":"Nouvelle conversation","restartConversation.cancel":"Annuler","restartConversation.button.ariaLabel":"Bouton Redémarrer la conversation","closeButton.ariaLabel":"Bouton Fermer le chatbot","feedback.title":"Aidez-nous à nous améliorer","feedback.description":"Veuillez nous faire part de vos commentaires pour nous aider à nous améliorer.","feedback.confirm":"Envoyer le commentaire","feedback.cancel":"Annuler","feedback.placeholder":"Dites-nous ce qui n'a pas fonctionné...","error.configuration":"Erreur de configuration","error.bot":"Erreur du bot","error.network":"Erreur réseau","error.disconnected":"Déconnecté","error.unexpected":"Erreur inattendue","dropdown.placeholder":"Sélectionner...","message.status.delivered":"Distribué","date.today":"Aujourd'hui","date.yesterday":"Hier"},nc={"composer.placeholder":"Escribe tu mensaje...","composer.sendButton.ariaLabel":"Botón Enviar mensaje","composer.voiceButton.ariaLabel":"Botón Entrada de voz","composer.fileButton.ariaLabel":"Botón Subir archivo","composer.messageInput.ariaLabel":"Entrada de mensaje","fileAttachment.uploadError":"Error de carga","fileAttachment.fallbackExtension":"Archivo","fileAttachment.removeButton.ariaLabel":"Botón Eliminar archivo","header.defaultBotName":"Bot","header.expandButton.ariaLabel":"Botón Expandir encabezado","header.sound.enable":"Activar sonidos del chat","header.sound.disable":"Desactivar sonidos del chat","conversationHistory.title":"Conversaciones","conversationHistory.empty":"Aún no se ha iniciado ninguna conversación","conversationHistory.newConversation":"Nueva conversación","conversationHistory.sentAttachment":"Envió un archivo adjunto","conversationHistory.showButton.ariaLabel":"Botón Mostrar conversaciones recientes","restartConversation.title":"Crear nueva conversación","restartConversation.description":"Esto borrará la conversación actual y comenzará una nueva.","restartConversation.confirm":"Nueva conversación","restartConversation.cancel":"Cancelar","restartConversation.button.ariaLabel":"Botón Reiniciar conversación","closeButton.ariaLabel":"Botón Cerrar chatbot","feedback.title":"Ayúdanos a mejorar","feedback.description":"Por favor, envíanos tus comentarios para ayudarnos a mejorar.","feedback.confirm":"Enviar comentario","feedback.cancel":"Cancelar","feedback.placeholder":"Cuéntanos qué salió mal...","error.configuration":"Error de configuración","error.bot":"Error del bot","error.network":"Error de red","error.disconnected":"Desconectado","error.unexpected":"Error inesperado","dropdown.placeholder":"Seleccionar...","message.status.delivered":"Entregado","date.today":"Hoy","date.yesterday":"Ayer"},rc={"composer.placeholder":"Digite sua mensagem...","composer.sendButton.ariaLabel":"Botão Enviar mensagem","composer.voiceButton.ariaLabel":"Botão Entrada de voz","composer.fileButton.ariaLabel":"Botão Enviar arquivo","composer.messageInput.ariaLabel":"Entrada de mensagem","fileAttachment.uploadError":"Erro no envio","fileAttachment.fallbackExtension":"Arquivo","fileAttachment.removeButton.ariaLabel":"Botão Remover arquivo","header.defaultBotName":"Bot","header.expandButton.ariaLabel":"Botão Expandir cabeçalho","header.sound.enable":"Ativar sons do chat","header.sound.disable":"Desativar sons do chat","conversationHistory.title":"Conversas","conversationHistory.empty":"Nenhuma conversa iniciada ainda","conversationHistory.newConversation":"Nova conversa","conversationHistory.sentAttachment":"Enviou um anexo","conversationHistory.showButton.ariaLabel":"Botão Mostrar conversas recentes","restartConversation.title":"Criar nova conversa","restartConversation.description":"Isso apagará a conversa atual e iniciará uma nova.","restartConversation.confirm":"Nova conversa","restartConversation.cancel":"Cancelar","restartConversation.button.ariaLabel":"Botão Reiniciar conversa","closeButton.ariaLabel":"Botão Fechar chatbot","feedback.title":"Ajude-nos a melhorar","feedback.description":"Por favor, envie seu feedback para nos ajudar a melhorar.","feedback.confirm":"Enviar feedback","feedback.cancel":"Cancelar","feedback.placeholder":"Conte-nos o que deu errado...","error.configuration":"Erro de configuração","error.bot":"Erro do bot","error.network":"Erro de rede","error.disconnected":"Desconectado","error.unexpected":"Erro inesperado","dropdown.placeholder":"Selecionar...","message.status.delivered":"Entregue","date.today":"Hoje","date.yesterday":"Ontem"},ic={"composer.placeholder":"Nachricht eingeben...","composer.sendButton.ariaLabel":"Schaltfläche Nachricht senden","composer.voiceButton.ariaLabel":"Schaltfläche Spracheingabe","composer.fileButton.ariaLabel":"Schaltfläche Datei hochladen","composer.messageInput.ariaLabel":"Nachrichteneingabe","fileAttachment.uploadError":"Fehler beim Hochladen","fileAttachment.fallbackExtension":"Datei","fileAttachment.removeButton.ariaLabel":"Schaltfläche Datei entfernen","header.defaultBotName":"Bot","header.expandButton.ariaLabel":"Schaltfläche Kopfzeile erweitern","header.sound.enable":"Chat-Töne aktivieren","header.sound.disable":"Chat-Töne deaktivieren","conversationHistory.title":"Unterhaltungen","conversationHistory.empty":"Noch keine Unterhaltung begonnen","conversationHistory.newConversation":"Neue Unterhaltung","conversationHistory.sentAttachment":"Anhang gesendet","conversationHistory.showButton.ariaLabel":"Schaltfläche Letzte Unterhaltungen anzeigen","restartConversation.title":"Neue Unterhaltung erstellen","restartConversation.description":"Dies löscht die aktuelle Unterhaltung und startet eine neue.","restartConversation.confirm":"Neue Unterhaltung","restartConversation.cancel":"Abbrechen","restartConversation.button.ariaLabel":"Schaltfläche Unterhaltung neu starten","closeButton.ariaLabel":"Schaltfläche Chatbot schließen","feedback.title":"Helfen Sie uns, besser zu werden","feedback.description":"Bitte geben Sie uns Feedback, damit wir uns verbessern können.","feedback.confirm":"Feedback senden","feedback.cancel":"Abbrechen","feedback.placeholder":"Sagen Sie uns, was schiefgelaufen ist...","error.configuration":"Konfigurationsfehler","error.bot":"Bot-Fehler","error.network":"Netzwerkfehler","error.disconnected":"Getrennt","error.unexpected":"Unerwarteter Fehler","dropdown.placeholder":"Auswählen...","message.status.delivered":"Zugestellt","date.today":"Heute","date.yesterday":"Gestern"},oc={"composer.placeholder":"Scrivi il tuo messaggio...","composer.sendButton.ariaLabel":"Pulsante Invia messaggio","composer.voiceButton.ariaLabel":"Pulsante Inserimento vocale","composer.fileButton.ariaLabel":"Pulsante Carica file","composer.messageInput.ariaLabel":"Campo di inserimento messaggio","fileAttachment.uploadError":"Errore di caricamento","fileAttachment.fallbackExtension":"File","fileAttachment.removeButton.ariaLabel":"Pulsante Rimuovi file","header.defaultBotName":"Bot","header.expandButton.ariaLabel":"Pulsante Espandi intestazione","header.sound.enable":"Attiva suoni della chat","header.sound.disable":"Disattiva suoni della chat","conversationHistory.title":"Conversazioni","conversationHistory.empty":"Nessuna conversazione avviata","conversationHistory.newConversation":"Nuova conversazione","conversationHistory.sentAttachment":"Ha inviato un allegato","conversationHistory.showButton.ariaLabel":"Pulsante Mostra conversazioni recenti","restartConversation.title":"Crea nuova conversazione","restartConversation.description":"Questo cancellerà la conversazione corrente e ne avvierà una nuova.","restartConversation.confirm":"Nuova conversazione","restartConversation.cancel":"Annulla","restartConversation.button.ariaLabel":"Pulsante Riavvia conversazione","closeButton.ariaLabel":"Pulsante Chiudi chatbot","feedback.title":"Aiutaci a migliorare","feedback.description":"Inviaci il tuo feedback per aiutarci a migliorare.","feedback.confirm":"Invia feedback","feedback.cancel":"Annulla","feedback.placeholder":"Dicci cosa non ha funzionato...","error.configuration":"Errore di configurazione","error.bot":"Errore del bot","error.network":"Errore di rete","error.disconnected":"Disconnesso","error.unexpected":"Errore imprevisto","dropdown.placeholder":"Seleziona...","message.status.delivered":"Consegnato","date.today":"Oggi","date.yesterday":"Ieri"},sc={"composer.placeholder":"メッセージを入力...","composer.sendButton.ariaLabel":"メッセージ送信ボタン","composer.voiceButton.ariaLabel":"音声入力ボタン","composer.fileButton.ariaLabel":"ファイルアップロードボタン","composer.messageInput.ariaLabel":"メッセージ入力","fileAttachment.uploadError":"アップロードエラー","fileAttachment.fallbackExtension":"ファイル","fileAttachment.removeButton.ariaLabel":"ファイル削除ボタン","header.defaultBotName":"ボット","header.expandButton.ariaLabel":"ヘッダー展開ボタン","header.sound.enable":"チャット音を有効にする","header.sound.disable":"チャット音を無効にする","conversationHistory.title":"会話履歴","conversationHistory.empty":"まだ会話がありません","conversationHistory.newConversation":"新しい会話","conversationHistory.sentAttachment":"添付ファイルを送信しました","conversationHistory.showButton.ariaLabel":"最近の会話を表示ボタン","restartConversation.title":"新しい会話を作成","restartConversation.description":"現在の会話を消去し、新しい会話を開始します。","restartConversation.confirm":"新しい会話","restartConversation.cancel":"キャンセル","restartConversation.button.ariaLabel":"会話を再開ボタン","closeButton.ariaLabel":"チャットボットを閉じるボタン","feedback.title":"改善にご協力ください","feedback.description":"サービス向上のため、フィードバックをお寄せください。","feedback.confirm":"フィードバックを送信","feedback.cancel":"キャンセル","feedback.placeholder":"問題点をお知らせください...","error.configuration":"設定エラー","error.bot":"ボットエラー","error.network":"ネットワークエラー","error.disconnected":"切断されました","error.unexpected":"予期しないエラー","dropdown.placeholder":"選択...","message.status.delivered":"配信済み","date.today":"今日","date.yesterday":"昨日"},ac={"composer.placeholder":"메시지를 입력하세요...","composer.sendButton.ariaLabel":"메시지 보내기 버튼","composer.voiceButton.ariaLabel":"음성 입력 버튼","composer.fileButton.ariaLabel":"파일 업로드 버튼","composer.messageInput.ariaLabel":"메시지 입력","fileAttachment.uploadError":"업로드 오류","fileAttachment.fallbackExtension":"파일","fileAttachment.removeButton.ariaLabel":"파일 삭제 버튼","header.defaultBotName":"봇","header.expandButton.ariaLabel":"헤더 펼치기 버튼","header.sound.enable":"채팅 소리 켜기","header.sound.disable":"채팅 소리 끄기","conversationHistory.title":"대화 목록","conversationHistory.empty":"아직 시작된 대화가 없습니다","conversationHistory.newConversation":"새 대화","conversationHistory.sentAttachment":"첨부 파일을 보냈습니다","conversationHistory.showButton.ariaLabel":"최근 대화 보기 버튼","restartConversation.title":"새 대화 만들기","restartConversation.description":"현재 대화를 지우고 새 대화를 시작합니다.","restartConversation.confirm":"새 대화","restartConversation.cancel":"취소","restartConversation.button.ariaLabel":"대화 다시 시작 버튼","closeButton.ariaLabel":"챗봇 닫기 버튼","feedback.title":"개선에 도움을 주세요","feedback.description":"서비스 개선을 위해 피드백을 보내주세요.","feedback.confirm":"피드백 보내기","feedback.cancel":"취소","feedback.placeholder":"어떤 점이 문제였는지 알려주세요...","error.configuration":"설정 오류","error.bot":"봇 오류","error.network":"네트워크 오류","error.disconnected":"연결 끊김","error.unexpected":"예기치 않은 오류","dropdown.placeholder":"선택...","message.status.delivered":"전달됨","date.today":"오늘","date.yesterday":"어제"},lc={"composer.placeholder":"اكتب رسالتك...","composer.sendButton.ariaLabel":"زر إرسال الرسالة","composer.voiceButton.ariaLabel":"زر الإدخال الصوتي","composer.fileButton.ariaLabel":"زر رفع ملف","composer.messageInput.ariaLabel":"إدخال الرسالة","fileAttachment.uploadError":"خطأ في الرفع","fileAttachment.fallbackExtension":"ملف","fileAttachment.removeButton.ariaLabel":"زر إزالة الملف","header.defaultBotName":"بوت","header.expandButton.ariaLabel":"زر توسيع الرأس","header.sound.enable":"تفعيل أصوات المحادثة","header.sound.disable":"تعطيل أصوات المحادثة","conversationHistory.title":"المحادثات","conversationHistory.empty":"لم تبدأ أي محادثة بعد","conversationHistory.newConversation":"محادثة جديدة","conversationHistory.sentAttachment":"أرسل مرفقاً","conversationHistory.showButton.ariaLabel":"زر عرض المحادثات الأخيرة","restartConversation.title":"إنشاء محادثة جديدة","restartConversation.description":"سيؤدي هذا إلى مسح المحادثة الحالية وبدء محادثة جديدة.","restartConversation.confirm":"محادثة جديدة","restartConversation.cancel":"إلغاء","restartConversation.button.ariaLabel":"زر إعادة بدء المحادثة","closeButton.ariaLabel":"زر إغلاق الشات بوت","feedback.title":"ساعدنا على التحسين","feedback.description":"يرجى تقديم ملاحظاتك لمساعدتنا على التحسين.","feedback.confirm":"إرسال الملاحظات","feedback.cancel":"إلغاء","feedback.placeholder":"أخبرنا ما الخطأ الذي حدث...","error.configuration":"خطأ في الإعدادات","error.bot":"خطأ في البوت","error.network":"خطأ في الشبكة","error.disconnected":"غير متصل","error.unexpected":"خطأ غير متوقع","dropdown.placeholder":"اختر...","message.status.delivered":"تم التسليم","date.today":"اليوم","date.yesterday":"أمس"},Rn={"composer.placeholder":"Type your message...","composer.sendButton.ariaLabel":"Send Message Button","composer.voiceButton.ariaLabel":"Voice Input Button","composer.fileButton.ariaLabel":"Upload File Button","composer.messageInput.ariaLabel":"Message Input","fileAttachment.uploadError":"Upload Error","fileAttachment.fallbackExtension":"File","fileAttachment.removeButton.ariaLabel":"Remove File Button","header.defaultBotName":"Bot","header.expandButton.ariaLabel":"Expand Header Button","header.sound.enable":"Enable chat sounds","header.sound.disable":"Disable chat sounds","conversationHistory.title":"Conversations","conversationHistory.empty":"No conversation started yet","conversationHistory.newConversation":"New conversation","conversationHistory.sentAttachment":"Sent an attachment","conversationHistory.showButton.ariaLabel":"Show Recent Conversations Button","restartConversation.title":"Create New Conversation","restartConversation.description":"This will clear the current conversation and start a new one.","restartConversation.confirm":"New conversation","restartConversation.cancel":"Cancel","restartConversation.button.ariaLabel":"Restart Conversation Button","closeButton.ariaLabel":"Close Chatbot Button","feedback.title":"Help us improve","feedback.description":"Please provide feedback to help us improve.","feedback.confirm":"Send feedback","feedback.cancel":"Cancel","feedback.placeholder":"Let us know what went wrong...","error.configuration":"Configuration error","error.bot":"Bot error","error.network":"Network error","error.disconnected":"Disconnected","error.unexpected":"Unexpected error","dropdown.placeholder":"Select...","message.status.delivered":"Delivered","date.today":"Today","date.yesterday":"Yesterday"},Cb={fr:tc,es:nc,pt:rc,de:ic,it:oc,ja:sc,ko:ac,ar:lc};function uc(e){const n=((e??(typeof navigator<"u"?navigator.language:"en")).split("-")[0]??"en").toLowerCase();return Cb[n]??Rn}kr.extend(kb),kr.extend(Eb);function cc(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 Ab(e,t=Rn,n="day"){var i,o,s;if(!e||e.length===0)return[];const r=[];(i=e[0])!=null&&i.timestamp&&r.push(fc(e[0].timestamp,t));for(let a=0;a<e.length;a++)if(e[a]&&r.push(e[a]),a+1<e.length){const l=(o=e[a])==null?void 0:o.timestamp,u=(s=e[a+1])==null?void 0:s.timestamp;!kr(l).isSame(u,n)&&u&&r.push(fc(u,t))}return r}function fc(e,t){return{id:`system-date-${kr(e).format("YYYY-MM-DD")}`,direction:"system",sender:{name:"system"},timestamp:e,block:{type:"text",text:Tb(e,t)}}}function Tb(e,t=Rn,n=!1){const r=kr(e),i="h:mma",o=t["date.today"],s=t["date.yesterday"];return r.isToday()?n?`${o} • ${r.format(i)}`:o:r.isYesterday()?n?`${s} • ${r.format(i)}`:s:n?r.format(`YYYY-MM-DD • ${i}`):r.format("YYYY-MM-DD")}function Ib(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 Ob(e){return"#"+e.map(t=>`0${t.toString(16).toUpperCase()}`.slice(-2)).join("")}function Db(e,t){return e.map(n=>Math.round(n+(255-n)*t))}function Mb(e,t){return e.map(n=>Math.round(n*t))}const xr=e=>t=>Db(t,e),Er=e=>t=>Mb(t,e),Nb={50:xr(.95),100:xr(.9),200:xr(.75),300:xr(.6),400:xr(.3),500:e=>e,600:Er(.9),700:Er(.6),800:Er(.45),900:Er(.3),950:Er(.2)};function dc(e,t=Nb){const n={},r=Ib(e);for(const[i,o]of Object.entries(t))n[i]=Ob(o(r));return n}const hc=()=>{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 wn extends Error{}class Lb extends wn{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class _b extends wn{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class Pb extends wn{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class Cr extends wn{}class pc extends wn{constructor(t){super(`Invalid unit ${t}`)}}class bt extends wn{}class rn extends wn{constructor(){super("Zone is an abstract class")}}const ie="numeric",Tt="short",pt="long",hs={year:ie,month:ie,day:ie},mc={year:ie,month:Tt,day:ie},Fb={year:ie,month:Tt,day:ie,weekday:Tt},gc={year:ie,month:pt,day:ie},yc={year:ie,month:pt,day:ie,weekday:pt},vc={hour:ie,minute:ie},bc={hour:ie,minute:ie,second:ie},wc={hour:ie,minute:ie,second:ie,timeZoneName:Tt},Sc={hour:ie,minute:ie,second:ie,timeZoneName:pt},kc={hour:ie,minute:ie,hourCycle:"h23"},xc={hour:ie,minute:ie,second:ie,hourCycle:"h23"},Ec={hour:ie,minute:ie,second:ie,hourCycle:"h23",timeZoneName:Tt},Cc={hour:ie,minute:ie,second:ie,hourCycle:"h23",timeZoneName:pt},Ac={year:ie,month:ie,day:ie,hour:ie,minute:ie},Tc={year:ie,month:ie,day:ie,hour:ie,minute:ie,second:ie},Ic={year:ie,month:Tt,day:ie,hour:ie,minute:ie},Oc={year:ie,month:Tt,day:ie,hour:ie,minute:ie,second:ie},Rb={year:ie,month:Tt,day:ie,weekday:Tt,hour:ie,minute:ie},Dc={year:ie,month:pt,day:ie,hour:ie,minute:ie,timeZoneName:Tt},Mc={year:ie,month:pt,day:ie,hour:ie,minute:ie,second:ie,timeZoneName:Tt},Nc={year:ie,month:pt,day:ie,weekday:pt,hour:ie,minute:ie,timeZoneName:pt},Lc={year:ie,month:pt,day:ie,weekday:pt,hour:ie,minute:ie,second:ie,timeZoneName:pt};function xe(e){return typeof e>"u"}function Sn(e){return typeof e=="number"}function xi(e){return typeof e=="number"&&e%1===0}function Bb(e){return typeof e=="string"}function $b(e){return Object.prototype.toString.call(e)==="[object Date]"}function _c(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function zb(e){return Array.isArray(e)?e:[e]}function Pc(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 Hb(e,t){return t.reduce((n,r)=>(n[r]=e[r],n),{})}function Bn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Yt(e,t,n){return xi(e)&&e>=t&&e<=n}function Ub(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 on(e){if(!(xe(e)||e===null||e===""))return parseInt(e,10)}function kn(e){if(!(xe(e)||e===null||e===""))return parseFloat(e)}function ps(e){if(!(xe(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function ms(e,t,n=!1){const r=10**t;return(n?Math.trunc:Math.round)(e*r)/r}function Ar(e){return e%4===0&&(e%100!==0||e%400===0)}function Tr(e){return Ar(e)?366:365}function Ei(e,t){const n=Ub(t-1,12)+1,r=e+(t-n)/12;return n===2?Ar(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function gs(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 Ci(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 ys(e){return e>99?e:e>60?1900+e:2e3+e}function Fc(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 Ai(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 Rc(e){const t=Number(e);if(typeof e=="boolean"||e===""||Number.isNaN(t))throw new bt(`Invalid unit value ${e}`);return t}function Ti(e,t){const n={};for(const r in e)if(Bn(e,r)){const i=e[r];if(i==null)continue;n[t(r)]=Rc(i)}return n}function Ir(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 Ii(e){return Hb(e,["hour","minute","second","millisecond"])}const Bc=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,jb=["January","February","March","April","May","June","July","August","September","October","November","December"],$c=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Vb=["J","F","M","A","M","J","J","A","S","O","N","D"];function zc(e){switch(e){case"narrow":return[...Vb];case"short":return[...$c];case"long":return[...jb];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 Hc=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Uc=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Wb=["M","T","W","T","F","S","S"];function jc(e){switch(e){case"narrow":return[...Wb];case"short":return[...Uc];case"long":return[...Hc];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Vc=["AM","PM"],qb=["Before Christ","Anno Domini"],Yb=["BC","AD"],Kb=["B","A"];function Wc(e){switch(e){case"narrow":return[...Kb];case"short":return[...Yb];case"long":return[...qb];default:return null}}function Gb(e){return Vc[e.hour<12?0:1]}function Qb(e,t){return jc(t)[e.weekday-1]}function Zb(e,t){return zc(t)[e.month-1]}function Jb(e,t){return Wc(t)[e.year<0?0:1]}function Xb(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 qc(e,t){let n="";for(const r of e)r.literal?n+=r.val:n+=t(r.val);return n}const ew={D:hs,DD:mc,DDD:gc,DDDD:yc,t:vc,tt:bc,ttt:wc,tttt:Sc,T:kc,TT:xc,TTT:Ec,TTTT:Cc,f:Ac,ff:Ic,fff:Dc,ffff:Nc,F:Tc,FF:Oc,FFF:Mc,FFFF:Lc};class ut{static create(t,n={}){return new ut(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 ew[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?Gb(t):o({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(d,m)=>r?Zb(t,d):o(m?{month:d}:{month:d,day:"numeric"},"month"),u=(d,m)=>r?Qb(t,d):o(m?{weekday:d}:{weekday:d,month:"long",day:"numeric"},"weekday"),f=d=>{const m=ut.macroTokenToFormatOpts(d);return m?this.formatWithSystemDefault(t,m):d},c=d=>r?Jb(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 qc(ut.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=ut.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 qc(o,i(a))}}class It{constructor(t,n){this.reason=t,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class Or{get type(){throw new rn}get name(){throw new rn}get ianaName(){return this.name}get isUniversal(){throw new rn}offsetName(t,n){throw new rn}formatOffset(t,n){throw new rn}offset(t){throw new rn}equals(t){throw new rn}get isValid(){throw new rn}}let vs=null;class bs extends Or{static get instance(){return vs===null&&(vs=new bs),vs}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return Fc(t,n,r)}formatOffset(t,n){return Ir(this.offset(t),n)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}let Oi={};function tw(e){return Oi[e]||(Oi[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"})),Oi[e]}const nw={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function rw(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 iw(e,t){const n=e.formatToParts(t),r=[];for(let i=0;i<n.length;i++){const{type:o,value:s}=n[i],a=nw[o];o==="era"?r[a]=s:xe(a)||(r[a]=parseInt(s,10))}return r}let Di={};class Kt extends Or{static create(t){return Di[t]||(Di[t]=new Kt(t)),Di[t]}static resetCache(){Di={},Oi={}}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=Kt.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return Fc(t,n,r,this.name)}formatOffset(t,n){return Ir(this.offset(t),n)}offset(t){const n=new Date(t);if(isNaN(n))return NaN;const r=tw(this.name);let[i,o,s,a,l,u,f]=r.formatToParts?iw(r,n):rw(r,n);a==="BC"&&(i=-Math.abs(i)+1);const h=gs({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 ws=null;class ot extends Or{static get utcInstance(){return ws===null&&(ws=new ot(0)),ws}static instance(t){return t===0?ot.utcInstance:new ot(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new ot(Ai(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Ir(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Ir(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return Ir(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 ow extends Or{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 sn(e,t){if(xe(e)||e===null)return t;if(e instanceof Or)return e;if(Bb(e)){const n=e.toLowerCase();return n==="local"||n==="system"?t:n==="utc"||n==="gmt"?ot.utcInstance:ot.parseSpecifier(n)||Kt.create(e)}else return Sn(e)?ot.instance(e):typeof e=="object"&&e.offset&&typeof e.offset=="number"?e:new ow(e)}let Yc=()=>Date.now(),Kc="system",Gc=null,Qc=null,Zc=null,Jc;class qe{static get now(){return Yc}static set now(t){Yc=t}static set defaultZone(t){Kc=t}static get defaultZone(){return sn(Kc,bs.instance)}static get defaultLocale(){return Gc}static set defaultLocale(t){Gc=t}static get defaultNumberingSystem(){return Qc}static set defaultNumberingSystem(t){Qc=t}static get defaultOutputCalendar(){return Zc}static set defaultOutputCalendar(t){Zc=t}static get throwOnInvalid(){return Jc}static set throwOnInvalid(t){Jc=t}static resetCaches(){Re.resetCache(),Kt.resetCache()}}let Xc={};function sw(e,t={}){const n=JSON.stringify([e,t]);let r=Xc[n];return r||(r=new Intl.ListFormat(e,t),Xc[n]=r),r}let Ss={};function ks(e,t={}){const n=JSON.stringify([e,t]);let r=Ss[n];return r||(r=new Intl.DateTimeFormat(e,t),Ss[n]=r),r}let xs={};function aw(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 Es={};function lw(e,t={}){const{base:n,...r}=t,i=JSON.stringify([e,r]);let o=Es[i];return o||(o=new Intl.RelativeTimeFormat(e,t),Es[i]=o),o}let Dr=null;function uw(){return Dr||(Dr=new Intl.DateTimeFormat().resolvedOptions().locale,Dr)}function cw(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 fw(e,t,n){return(n||t)&&(e+="-u",n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`)),e}function dw(e){const t=[];for(let n=1;n<=12;n++){const r=pe.utc(2016,n,1);t.push(e(r))}return t}function hw(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 Mi(e,t,n,r,i){const o=e.listingMode(n);return o==="error"?null:o==="en"?r(t):i(t)}function pw(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 mw{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=aw(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):ms(t,3);return Ve(n,this.padTo)}}}class gw{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&&Kt.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 yw{constructor(t,n,r){this.opts={style:"long",...r},!n&&_c()&&(this.rtf=lw(t,r))}format(t,n){return this.rtf?this.rtf.format(t,n):Xb(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":uw()),a=n||qe.defaultNumberingSystem,l=r||qe.defaultOutputCalendar;return new Re(s,a,l,o)}static resetCache(){Dr=null,Ss={},xs={},Es={}}static fromObject({locale:t,numberingSystem:n,outputCalendar:r}={}){return Re.create(t,n,r)}constructor(t,n,r,i){const[o,s,a]=cw(t);this.locale=o,this.numberingSystem=n||s||null,this.outputCalendar=r||a||null,this.intl=fw(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=pw(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 Mi(this,t,r,zc,()=>{const i=n?{month:t,day:"numeric"}:{month:t},o=n?"format":"standalone";return this.monthsCache[o][t]||(this.monthsCache[o][t]=dw(s=>this.extract(s,i,"month"))),this.monthsCache[o][t]})}weekdays(t,n=!1,r=!0){return Mi(this,t,r,jc,()=>{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]=hw(s=>this.extract(s,i,"weekday"))),this.weekdaysCache[o][t]})}meridiems(t=!0){return Mi(this,void 0,t,()=>Vc,()=>{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 Mi(this,t,n,Wc,()=>{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 mw(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,n={}){return new gw(t,this.intl,n)}relFormatter(t={}){return new yw(this.intl,this.isEnglish(),t)}listFormatter(t={}){return sw(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 $n(...e){const t=e.reduce((n,r)=>n+r.source,"");return RegExp(`^${t}$`)}function zn(...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 Hn(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 ef(...e){return(t,n)=>{const r={};let i;for(i=0;i<e.length;i++)r[e[i]]=on(t[n+i]);return[r,null,n+i]}}const tf=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,vw=`(?:${tf.source}?(?:\\[(${Bc.source})\\])?)?`,Cs=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,nf=RegExp(`${Cs.source}${vw}`),As=RegExp(`(?:T${nf.source})?`),bw=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,ww=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Sw=/(\d{4})-?(\d{3})/,kw=ef("weekYear","weekNumber","weekDay"),xw=ef("year","ordinal"),Ew=/(\d{4})-(\d\d)-(\d\d)/,rf=RegExp(`${Cs.source} ?(?:${tf.source}|(${Bc.source}))?`),Cw=RegExp(`(?: ${rf.source})?`);function Un(e,t,n){const r=e[t];return xe(r)?n:on(r)}function Aw(e,t){return[{year:Un(e,t),month:Un(e,t+1,1),day:Un(e,t+2,1)},null,t+3]}function jn(e,t){return[{hours:Un(e,t,0),minutes:Un(e,t+1,0),seconds:Un(e,t+2,0),milliseconds:ps(e[t+3])},null,t+4]}function Mr(e,t){const n=!e[t]&&!e[t+1],r=Ai(e[t+1],e[t+2]),i=n?null:ot.instance(r);return[{},i,t+3]}function Nr(e,t){const n=e[t]?Kt.create(e[t]):null;return[{},n,t+1]}const Tw=RegExp(`^T?${Cs.source}$`),Iw=/^-?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 Ow(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(kn(n)),months:h(kn(r)),weeks:h(kn(i)),days:h(kn(o)),hours:h(kn(s)),minutes:h(kn(a)),seconds:h(kn(l),l==="-0"),milliseconds:h(ps(u),c)}]}const Dw={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 Ts(e,t,n,r,i,o,s){const a={year:t.length===2?ys(on(t)):on(t),month:$c.indexOf(n)+1,day:on(r),hour:on(i),minute:on(o)};return s&&(a.second=on(s)),e&&(a.weekday=e.length>3?Hc.indexOf(e)+1:Uc.indexOf(e)+1),a}const Mw=/^(?:(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 Nw(e){const[,t,n,r,i,o,s,a,l,u,f,c]=e,h=Ts(t,i,r,n,o,s,a);let d;return l?d=Dw[l]:u?d=0:d=Ai(f,c),[h,new ot(d)]}function Lw(e){return e.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const _w=/^(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$/,Pw=/^(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$/,Fw=/^(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 of(e){const[,t,n,r,i,o,s,a]=e;return[Ts(t,i,r,n,o,s,a),ot.utcInstance]}function Rw(e){const[,t,n,r,i,o,s,a]=e;return[Ts(t,a,n,r,i,o,s),ot.utcInstance]}const Bw=$n(bw,As),$w=$n(ww,As),zw=$n(Sw,As),Hw=$n(nf),sf=zn(Aw,jn,Mr,Nr),Uw=zn(kw,jn,Mr,Nr),jw=zn(xw,jn,Mr,Nr),Vw=zn(jn,Mr,Nr);function Ww(e){return Hn(e,[Bw,sf],[$w,Uw],[zw,jw],[Hw,Vw])}function qw(e){return Hn(Lw(e),[Mw,Nw])}function Yw(e){return Hn(e,[_w,of],[Pw,of],[Fw,Rw])}function Kw(e){return Hn(e,[Iw,Ow])}const Gw=zn(jn);function Qw(e){return Hn(e,[Tw,Gw])}const Zw=$n(Ew,Cw),Jw=$n(rf),Xw=zn(jn,Mr,Nr);function e0(e){return Hn(e,[Zw,sf],[Jw,Xw])}const t0="Invalid Duration",af={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}},n0={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},...af},wt=146097/400,Vn=146097/4800,r0={years:{quarters:4,months:12,weeks:wt/7,days:wt,hours:wt*24,minutes:wt*24*60,seconds:wt*24*60*60,milliseconds:wt*24*60*60*1e3},quarters:{months:3,weeks:wt/28,days:wt/4,hours:wt*24/4,minutes:wt*24*60/4,seconds:wt*24*60*60/4,milliseconds:wt*24*60*60*1e3/4},months:{weeks:Vn/7,days:Vn,hours:Vn*24,minutes:Vn*24*60,seconds:Vn*24*60*60,milliseconds:Vn*24*60*60*1e3},...af},xn=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],i0=xn.slice(0).reverse();function En(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 Ce(r)}function o0(e){return e<0?Math.floor(e):Math.ceil(e)}function lf(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?o0(s):Math.trunc(s);r[i]+=l,t[n]-=l*o}function s0(e,t){i0.reduce((n,r)=>xe(t[r])?n:(n&&lf(e,t,n,t,r),r),null)}class Ce{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?r0:n0,this.isLuxonDuration=!0}static fromMillis(t,n){return Ce.fromObject({milliseconds:t},n)}static fromObject(t,n={}){if(t==null||typeof t!="object")throw new bt(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new Ce({values:Ti(t,Ce.normalizeUnit),loc:Re.fromObject(n),conversionAccuracy:n.conversionAccuracy})}static fromDurationLike(t){if(Sn(t))return Ce.fromMillis(t);if(Ce.isDuration(t))return t;if(typeof t=="object")return Ce.fromObject(t);throw new bt(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){const[r]=Kw(t);return r?Ce.fromObject(r,n):Ce.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){const[r]=Qw(t);return r?Ce.fromObject(r,n):Ce.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,n=null){if(!t)throw new bt("need to specify a reason the Duration is invalid");const r=t instanceof It?t:new It(t,n);if(qe.throwOnInvalid)throw new Pb(r);return new Ce({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 pc(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?ut.create(this.loc,r).formatDurationFromString(this,t):t0}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+=ms(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=Ce.fromDurationLike(t),r={};for(const i of xn)(Bn(n.values,i)||Bn(this.values,i))&&(r[i]=n.get(i)+this.get(i));return En(this,{values:r},!0)}minus(t){if(!this.isValid)return this;const n=Ce.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]=Rc(t(this.values[r],r));return En(this,{values:n},!0)}get(t){return this[Ce.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const n={...this.values,...Ti(t,Ce.normalizeUnit)};return En(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),En(this,o)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return s0(this.matrix,t),En(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(s=>Ce.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;Sn(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)&&lf(this.matrix,i,u,n,s)}else Sn(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 En(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 En(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 Lr="Invalid Interval";function a0(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 bt("need to specify a reason the Interval is invalid");const r=t instanceof It?t:new It(t,n);if(qe.throwOnInvalid)throw new _b(r);return new ze({invalid:r})}static fromDateTimes(t,n){const r=Fr(t),i=Fr(n),o=a0(r,i);return o??new ze({start:r,end:i})}static after(t,n){const r=Ce.fromDurationLike(n),i=Fr(t);return ze.fromDateTimes(i,i.plus(r))}static before(t,n){const r=Ce.fromDurationLike(n),i=Fr(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=Ce.fromISO(i,n);if(u.isValid)return ze.after(o,u)}else if(l){const u=Ce.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(Fr).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=Ce.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()})`:Lr}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:Lr}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Lr}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:Lr}toFormat(t,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${n}${this.e.toFormat(t)}`:Lr}toDuration(t,n){return this.isValid?this.e.diff(this.s,t,n):Ce.invalid(this.invalidReason)}mapEndpoints(t){return ze.fromDateTimes(t(this.s),t(this.e))}}let Ni=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 Kt.isValidZone(t)}static normalizeZone(t){return sn(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:_c()}}};function uf(e,t){const n=i=>i.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(t)-n(e);return Math.floor(Ce.fromMillis(r).as("days"))}function l0(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=uf(a,l);return(u-u%7)/7}],["days",uf]],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 u0(e,t,n,r){let[i,o,s,a]=l0(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=Ce.fromObject(o,r);return u.length>0?Ce.fromMillis(l,r).shiftTo(...u).plus(f):f}const Is={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},cf={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]},c0=Is.hanidec.replace(/[\[|\]]/g,"").split("");function f0(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(Is.hanidec)!==-1)t+=c0.indexOf(e[n]);else for(const i in cf){const[o,s]=cf[i];r>=o&&r<=s&&(t+=r-o)}}return parseInt(t,10)}else return t}function Ot({numberingSystem:e},t=""){return new RegExp(`${Is[e||"latn"]}${t}`)}const d0="missing Intl.DateTimeFormat.formatToParts support";function Ae(e,t=n=>n){return{regex:e,deser:([n])=>t(f0(n))}}const ff="[  ]",df=new RegExp(ff,"g");function h0(e){return e.replace(/\./g,"\\.?").replace(df,ff)}function hf(e){return e.replace(/\./g,"").replace(df," ").toLowerCase()}function Dt(e,t){return e===null?null:{regex:RegExp(e.map(h0).join("|")),deser:([n])=>e.findIndex(r=>hf(n)===hf(r))+t}}function pf(e,t){return{regex:e,deser:([,n,r])=>Ai(n,r),groups:t}}function Os(e){return{regex:e,deser:([t])=>t}}function p0(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function m0(e,t){const n=Ot(t),r=Ot(t,"{2}"),i=Ot(t,"{3}"),o=Ot(t,"{4}"),s=Ot(t,"{6}"),a=Ot(t,"{1,2}"),l=Ot(t,"{1,3}"),u=Ot(t,"{1,6}"),f=Ot(t,"{1,9}"),c=Ot(t,"{2,4}"),h=Ot(t,"{4,6}"),d=g=>({regex:RegExp(p0(g.val)),deser:([v])=>v,literal:!0}),p=(g=>{if(e.literal)return d(g);switch(g.val){case"G":return Dt(t.eras("short",!1),0);case"GG":return Dt(t.eras("long",!1),0);case"y":return Ae(u);case"yy":return Ae(c,ys);case"yyyy":return Ae(o);case"yyyyy":return Ae(h);case"yyyyyy":return Ae(s);case"M":return Ae(a);case"MM":return Ae(r);case"MMM":return Dt(t.months("short",!0,!1),1);case"MMMM":return Dt(t.months("long",!0,!1),1);case"L":return Ae(a);case"LL":return Ae(r);case"LLL":return Dt(t.months("short",!1,!1),1);case"LLLL":return Dt(t.months("long",!1,!1),1);case"d":return Ae(a);case"dd":return Ae(r);case"o":return Ae(l);case"ooo":return Ae(i);case"HH":return Ae(r);case"H":return Ae(a);case"hh":return Ae(r);case"h":return Ae(a);case"mm":return Ae(r);case"m":return Ae(a);case"q":return Ae(a);case"qq":return Ae(r);case"s":return Ae(a);case"ss":return Ae(r);case"S":return Ae(l);case"SSS":return Ae(i);case"u":return Os(f);case"uu":return Os(a);case"uuu":return Ae(n);case"a":return Dt(t.meridiems(),0);case"kkkk":return Ae(o);case"kk":return Ae(c,ys);case"W":return Ae(a);case"WW":return Ae(r);case"E":case"c":return Ae(n);case"EEE":return Dt(t.weekdays("short",!1,!1),1);case"EEEE":return Dt(t.weekdays("long",!1,!1),1);case"ccc":return Dt(t.weekdays("short",!0,!1),1);case"cccc":return Dt(t.weekdays("long",!0,!1),1);case"Z":case"ZZ":return pf(new RegExp(`([+-]${a.source})(?::(${r.source}))?`),2);case"ZZZ":return pf(new RegExp(`([+-]${a.source})(${r.source})?`),2);case"z":return Os(/[a-z_+-/]{1,256}?/i);default:return d(g)}})(e)||{invalidReason:d0};return p.token=e,p}const g0={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 y0(e,t,n){const{type:r,value:i}=e;if(r==="literal")return{literal:!0,val:i};const o=n[r];let s=g0[r];if(typeof s=="object"&&(s=s[o]),s)return{literal:!1,val:s}}function v0(e){return[`^${e.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,e]}function b0(e,t,n){const r=e.match(t);if(r){const i={};let o=1;for(const s in n)if(Bn(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 w0(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=Kt.create(e.z)),xe(e.Z)||(n||(n=new ot(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=ps(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 S0(){return Ds||(Ds=pe.fromMillis(1555555555555)),Ds}function k0(e,t){if(e.literal)return e;const n=ut.macroTokenToFormatOpts(e.val);if(!n)return e;const o=ut.create(t,n).formatDateTimeParts(S0()).map(s=>y0(s,t,n));return o.includes(void 0)?e:o}function x0(e,t){return Array.prototype.concat(...e.map(n=>k0(n,t)))}function mf(e,t,n){const r=x0(ut.parseFormat(n),e),i=r.map(s=>m0(s,e)),o=i.find(s=>s.invalidReason);if(o)return{input:t,tokens:r,invalidReason:o.invalidReason};{const[s,a]=v0(i),l=RegExp(s,"i"),[u,f]=b0(t,l,a),[c,h,d]=f?w0(f):[null,null,void 0];if(Bn(f,"a")&&Bn(f,"H"))throw new Cr("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 E0(e,t,n){const{result:r,zone:i,specificOffset:o,invalidReason:s}=mf(e,t,n);return[r,i,o,s]}const gf=[0,31,59,90,120,151,181,212,243,273,304,334],yf=[0,31,60,91,121,152,182,213,244,274,305,335];function St(e,t){return new It("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function vf(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 bf(e,t,n){return n+(Ar(e)?yf:gf)[t-1]}function wf(e,t){const n=Ar(e)?yf:gf,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=bf(t,n,r),o=vf(t,n,r);let s=Math.floor((i-o+10)/7),a;return s<1?(a=t-1,s=Ci(a)):s>Ci(t)?(a=t+1,s=1):a=t,{weekYear:a,weekNumber:s,weekday:o,...Ii(e)}}function Sf(e){const{weekYear:t,weekNumber:n,weekday:r}=e,i=vf(t,1,4),o=Tr(t);let s=n*7+r-i-3,a;s<1?(a=t-1,s+=Tr(a)):s>o?(a=t+1,s-=Tr(t)):a=t;const{month:l,day:u}=wf(a,s);return{year:a,month:l,day:u,...Ii(e)}}function Ns(e){const{year:t,month:n,day:r}=e,i=bf(t,n,r);return{year:t,ordinal:i,...Ii(e)}}function kf(e){const{year:t,ordinal:n}=e,{month:r,day:i}=wf(t,n);return{year:t,month:r,day:i,...Ii(e)}}function C0(e){const t=xi(e.weekYear),n=Yt(e.weekNumber,1,Ci(e.weekYear)),r=Yt(e.weekday,1,7);return t?n?r?!1:St("weekday",e.weekday):St("week",e.week):St("weekYear",e.weekYear)}function A0(e){const t=xi(e.year),n=Yt(e.ordinal,1,Tr(e.year));return t?n?!1:St("ordinal",e.ordinal):St("year",e.year)}function xf(e){const t=xi(e.year),n=Yt(e.month,1,12),r=Yt(e.day,1,Ei(e.year,e.month));return t?n?r?!1:St("day",e.day):St("month",e.month):St("year",e.year)}function Ef(e){const{hour:t,minute:n,second:r,millisecond:i}=e,o=Yt(t,0,23)||t===24&&n===0&&r===0&&i===0,s=Yt(n,0,59),a=Yt(r,0,59),l=Yt(i,0,999);return o?s?a?l?!1:St("millisecond",i):St("second",r):St("minute",n):St("hour",t)}const Ls="Invalid DateTime",Cf=864e13;function Li(e){return new It("unsupported zone",`the zone "${e.name}" is not supported`)}function _s(e){return e.weekData===null&&(e.weekData=Ms(e.c)),e.weekData}function _r(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 Af(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 Tf(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 _i(e,t,n){return Af(gs(e),t,n)}function If(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,Ei(r,i))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},s=Ce.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=gs(o);let[l,u]=Af(a,n,e.zone);return s!==0&&(l+=s,u=e.zone.offset(l)),{ts:l,o:u}}function Pr(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 It("unparsable",`the input "${i}" can't be parsed as ${r}`))}function Pi(e,t,n=!0){return e.isValid?ut.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 Of(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 Df={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},T0={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},I0={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Mf=["year","month","day","hour","minute","second","millisecond"],O0=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],D0=["year","ordinal","hour","minute","second","millisecond"];function Nf(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 pc(e);return t}function Lf(e,t){const n=sn(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 Mf)xe(e[u])&&(e[u]=Df[u]);const a=xf(e)||Ef(e);if(a)return pe.invalid(a);const l=n.offset(i);[o,s]=_i(e,l,n)}return new pe({ts:o,zone:n,loc:r,o:s})}function _f(e,t,n){const r=xe(n.round)?!0:n.round,i=(s,a)=>(s=ms(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 Pf(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 It("invalid input"):null)||(n.isValid?null:Li(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=Tf(this.ts,a),r=Number.isNaN(i.year)?new It("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]=Pf(arguments),[r,i,o,s,a,l,u]=n;return Lf({year:r,month:i,day:o,hour:s,minute:a,second:l,millisecond:u},t)}static utc(){const[t,n]=Pf(arguments),[r,i,o,s,a,l,u]=n;return t.zone=ot.utcInstance,Lf({year:r,month:i,day:o,hour:s,minute:a,second:l,millisecond:u},t)}static fromJSDate(t,n={}){const r=$b(t)?t.valueOf():NaN;if(Number.isNaN(r))return pe.invalid("invalid input");const i=sn(n.zone,qe.defaultZone);return i.isValid?new pe({ts:r,zone:i,loc:Re.fromObject(n)}):pe.invalid(Li(i))}static fromMillis(t,n={}){if(Sn(t))return t<-Cf||t>Cf?pe.invalid("Timestamp out of range"):new pe({ts:t,zone:sn(n.zone,qe.defaultZone),loc:Re.fromObject(n)});throw new bt(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,n={}){if(Sn(t))return new pe({ts:t*1e3,zone:sn(n.zone,qe.defaultZone),loc:Re.fromObject(n)});throw new bt("fromSeconds requires a numerical input")}static fromObject(t,n={}){t=t||{};const r=sn(n.zone,qe.defaultZone);if(!r.isValid)return pe.invalid(Li(r));const i=qe.now(),o=xe(n.specificOffset)?r.offset(i):n.specificOffset,s=Ti(t,Nf),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 Cr("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&a)throw new Cr("Can't mix ordinal dates with month/day");const d=c||s.weekday&&!f;let m,p,g=Tf(i,o);d?(m=O0,p=T0,g=Ms(g)):a?(m=D0,p=I0,g=Ns(g)):(m=Mf,p=Df);let v=!1;for(const M of m){const L=s[M];xe(L)?v?s[M]=p[M]:s[M]=g[M]:v=!0}const y=d?C0(s):a?A0(s):xf(s),w=y||Ef(s);if(w)return pe.invalid(w);const A=d?Sf(s):a?kf(s):s,[k,E]=_i(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]=Ww(t);return Pr(r,i,n,"ISO 8601",t)}static fromRFC2822(t,n={}){const[r,i]=qw(t);return Pr(r,i,n,"RFC 2822",t)}static fromHTTP(t,n={}){const[r,i]=Yw(t);return Pr(r,i,n,"HTTP",n)}static fromFormat(t,n,r={}){if(xe(t)||xe(n))throw new bt("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]=E0(s,t,n);return f?pe.invalid(f):Pr(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]=e0(t);return Pr(r,i,n,"SQL",t)}static invalid(t,n=null){if(!t)throw new bt("need to specify a reason the DateTime is invalid");const r=t instanceof It?t:new It(t,n);if(qe.throwOnInvalid)throw new Lb(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?Ns(this.c).ordinal:NaN}get monthShort(){return this.isValid?Ni.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Ni.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Ni.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Ni.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 Ar(this.year)}get daysInMonth(){return Ei(this.year,this.month)}get daysInYear(){return this.isValid?Tr(this.year):NaN}get weeksInWeekYear(){return this.isValid?Ci(this.weekYear):NaN}resolvedLocaleOptions(t={}){const{locale:n,numberingSystem:r,calendar:i}=ut.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:i}}toUTC(t=0,n={}){return this.setZone(ot.instance(t),n)}toLocal(){return this.setZone(qe.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(t=sn(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]=_i(s,o,t)}return _r(this,{ts:i,zone:t})}else return pe.invalid(Li(t))}reconfigure({locale:t,numberingSystem:n,outputCalendar:r}={}){const i=this.loc.clone({locale:t,numberingSystem:n,outputCalendar:r});return _r(this,{loc:i})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const n=Ti(t,Nf),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 Cr("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(s&&i)throw new Cr("Can't mix ordinal dates with month/day");let u;r?u=Sf({...Ms(this.c),...n}):xe(n.ordinal)?(u={...this.toObject(),...n},xe(n.day)&&(u.day=Math.min(Ei(u.year,u.month),u.day))):u=kf({...Ns(this.c),...n});const[f,c]=_i(u,this.o,this.zone);return _r(this,{ts:f,o:c})}plus(t){if(!this.isValid)return this;const n=Ce.fromDurationLike(t);return _r(this,If(this,n))}minus(t){if(!this.isValid)return this;const n=Ce.fromDurationLike(t).negate();return _r(this,If(this,n))}startOf(t){if(!this.isValid)return this;const n={},r=Ce.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?ut.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,t):Ls}toLocaleString(t=hs,n={}){return this.isValid?ut.create(this.loc.clone(n),t).formatDateTime(this):Ls}toLocaleParts(t={}){return this.isValid?ut.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+=Of(this,s,n,r,i,o),a}toISODate({format:t="extended"}={}){return this.isValid?Ps(this,t==="extended"):null}toISOWeekDate(){return Pi(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":"")+Of(this,s==="extended",n,t,r,o):null}toRFC2822(){return Pi(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Pi(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")),Pi(this,i,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():Ls}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 Ce.invalid("created by diffing an invalid DateTime");const i={locale:this.locale,numberingSystem:this.numberingSystem,...r},o=zb(n).map(Ce.normalizeUnit),s=t.valueOf()>this.valueOf(),a=s?this:t,l=s?t:this,u=u0(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),_f(n,this.plus(r),{...t,numeric:"always",units:i,unit:o})}toRelativeCalendar(t={}){return this.isValid?_f(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 bt("min requires all arguments be DateTimes");return Pc(t,n=>n.valueOf(),Math.min)}static max(...t){if(!t.every(pe.isDateTime))throw new bt("max requires all arguments be DateTimes");return Pc(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 mf(s,t,n)}static fromStringExplain(t,n,r={}){return pe.fromFormatExplain(t,n,r)}static get DATE_SHORT(){return hs}static get DATE_MED(){return mc}static get DATE_MED_WITH_WEEKDAY(){return Fb}static get DATE_FULL(){return gc}static get DATE_HUGE(){return yc}static get TIME_SIMPLE(){return vc}static get TIME_WITH_SECONDS(){return bc}static get TIME_WITH_SHORT_OFFSET(){return wc}static get TIME_WITH_LONG_OFFSET(){return Sc}static get TIME_24_SIMPLE(){return kc}static get TIME_24_WITH_SECONDS(){return xc}static get TIME_24_WITH_SHORT_OFFSET(){return Ec}static get TIME_24_WITH_LONG_OFFSET(){return Cc}static get DATETIME_SHORT(){return Ac}static get DATETIME_SHORT_WITH_SECONDS(){return Tc}static get DATETIME_MED(){return Ic}static get DATETIME_MED_WITH_SECONDS(){return Oc}static get DATETIME_MED_WITH_WEEKDAY(){return Rb}static get DATETIME_FULL(){return Dc}static get DATETIME_FULL_WITH_SECONDS(){return Mc}static get DATETIME_HUGE(){return Nc}static get DATETIME_HUGE_WITH_SECONDS(){return Lc}}function Fr(e){if(pe.isDateTime(e))return e;if(e&&e.valueOf&&Sn(e.valueOf()))return pe.fromJSDate(e);if(e&&typeof e=="object")return pe.fromObject(e);throw new bt(`Unknown datetime argument: ${e}, of type ${typeof e}`)}function M0(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 Fs(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 N0(e){return`#${((1<<24)+(e.r<<16)+(e.g<<8)+e.b).toString(16).slice(1)}`}const L0=(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 Ff(e){return Object.entries(e).reduce((t,[n,r])=>{const i=n.replace(/(\d+)/,o=>(1e3-parseInt(o)).toString());return{...t,[i]:r}},{})}const _0=2.4,P0=.2126729,F0=.7151522,R0=.072175,B0=.56,$0=.57,z0=.62,H0=.65,Fi=.022,Rf=1.414,U0=1.14,j0=1.14,V0=.035991,W0=27.7847239587675,q0=27.7847239587675,Bf=.027,$f=.027,zf=.001,Y0=5e-4;function Hf(e){const{r:t,g:n,b:r}=e,i=o=>(o/255)**_0;return P0*i(t)+F0*i(n)+R0*i(r)}function Uf(e,t){if(!e||!t)return 0;let n=Hf(Fs(e)),r=Hf(Fs(t)),i=0,o=0;return n=n>Fi?n:n+(Fi-n)**Rf,r=r>Fi?r:r+(Fi-r)**Rf,Math.abs(r-n)<Y0?0:(r>n?(i=(r**B0-n**$0)*U0,o=i<zf?0:i<V0?i-i*W0*Bf:i-Bf):(i=(r**H0-n**z0)*j0,o=i>-zf?0:i>-.035991?i-i*q0*$f:i+$f),Math.abs(o*100))}const K0=(e,t,n)=>{const r=e;let i=0;for(;t.some(o=>n(o)===e);)i+=1,e=`${r} (${i})`;return e};function jf(e){const{fontFamily:t,...n}=e,r=Vf(n);return Qu(".bpReset",{...r,"font-family":`'${t}', sans-serif`})+Qu(":host, :root",{...r})}function Vf(e){const{radius:t,themeMode:n,color:r,variant:i,headerVariant:o}=e;let s={},a={};if(r){const h=dc(r),d=n==="dark"?Ff(h):h,m=dc(N0(L0(Fs(r)))),p=n==="dark"?Ff(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?Uf(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?Uf(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 G0=e=>{if(typeof URL.canParse=="function")return URL.canParse(e);try{return new URL(e),!0}catch{return!1}},Wf=["audio","file","image","video"],qf=e=>Wf.includes(e),Yf="The Client ID is required to initialize the webchat.",Q0="The API url is required to initialize the webchat.",Z0="The Bot ID is required to initialize the webchat.",J0="No config URL provided.",Kf=`Invalid API URL.
18
+ Please use a valid API URL.`,Gf=`Invalid Client ID.
19
+ Please use a valid Botpress Client ID.`,Qf=`Invalid URL.
20
+ Please make sure your client ID and API URL are valid`,X0=`Invalid config URL.
21
+ Please make sure your config URL is valid`,e1=`Invalid webchat configuration.
22
+ Please make sure your config file is valid`,t1="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.`,Jf=`This bot has temporarily paused.
24
+ Please check back later.`,Rs="Something went wrong. To fix it, please clear your browser's local and session storage and then refresh the page",Ri="Please check your internet connection and refresh the page.",Xf=`You've been disconnected from the conversation.
25
+ Please refresh the page.`,ed=`Unable to process the message.
26
+ Please start a new conversation.`,Bs={ResourceNotFound:{type:"configuration",message:Gf},Forbidden:{type:"bot",message:Zf}},$s={MethodNotFound:{type:"configuration",message:Qf},QuotaExceeded:{type:"bot",message:Jf},Forbidden:{type:"bot",message:Rs}};function td(e){return e in Bs}function nd(e){return e in $s}function rd(e){return e!==null&&typeof e=="object"&&"id"in e&&"code"in e&&"type"in e}function id(e){return e!==null&&typeof e=="object"&&"type"in e&&e.type==="error"&&"message"in e&&typeof e.message=="string"}const od=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")},n1=["networkerror","failedtofetch","errorininputstream"],Rr=e=>{var n;console.error("An error occurred:",e);let t={type:"unknown",message:"An unexpected error occurred"};if(rd(e))e.type==="network"?t={id:e.id,type:"network",message:Ri}:(n=e.message)!=null&&n.includes("[Webhook Handler]")&&td(e.type)?t={id:e.id,...Bs[e.type]}:nd(e.type)?t={id:e.id,...$s[e.type]}:t={id:e.id,type:e.type,message:e.message||"An error occurred"};else if(id(e))sd(e.message)?t={type:"disconnected",message:Xf}:ad(e.message).includes("invalidcontenttype")?t={type:"bot",message:ed}:t={type:"event",message:e.message};else if(e instanceof Error&&sd(e.message))t={type:"network",message:Ri};else if(e&&typeof e=="object"&&"type"in e&&"message"in e){const r=e;r.type==="network"?t={type:"network",message:Ri}:t={type:r.type,message:r.message}}return t};function sd(e){return n1.some(t=>ad(e).includes(t))}function ad(e){return e.replaceAll(" ","").toLowerCase()}const r1=(e,t)=>{if(!e)return{type:"configuration",message:Yf};if(!G0(t))return{type:"configuration",message:Kf}},i1=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 o1(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 Cn=D.forwardRef(({userId:e,src:t,container:n,image:r,fallback:i,...o},s)=>{const a=Zu(e??"",15);return x.jsxs(cs,{ref:s,"data-color":a,...n,...o,children:[x.jsx(fs,{src:t,...r}),x.jsx(ds,{...i,children:typeof o.children=="string"?o.children[0]:o.children})]})});Cn.displayName="Avatar";function z2(){}function H2(){}function s1(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const a1=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,l1=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,u1={};function ld(e,t){return(u1.jsx?l1:a1).test(e)}const c1=/[ \t\n\f\r]/g;function f1(e){return typeof e=="object"?e.type==="text"?ud(e.value):!1:ud(e)}function ud(e){return e.replace(c1,"")===""}class Br{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Br.prototype.normal={},Br.prototype.property={},Br.prototype.space=void 0;function cd(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Br(n,r,t)}function zs(e){return e.toLowerCase()}class ct{constructor(t,n){this.attribute=n,this.property=t}}ct.prototype.attribute="",ct.prototype.booleanish=!1,ct.prototype.boolean=!1,ct.prototype.commaOrSpaceSeparated=!1,ct.prototype.commaSeparated=!1,ct.prototype.defined=!1,ct.prototype.mustUseProperty=!1,ct.prototype.number=!1,ct.prototype.overloadedBoolean=!1,ct.prototype.property="",ct.prototype.spaceSeparated=!1,ct.prototype.space=void 0;let d1=0;const ge=An(),We=An(),Hs=An(),Z=An(),Le=An(),Wn=An(),mt=An();function An(){return 2**++d1}const Us=Object.freeze(Object.defineProperty({__proto__:null,boolean:ge,booleanish:We,commaOrSpaceSeparated:mt,commaSeparated:Wn,number:Z,overloadedBoolean:Hs,spaceSeparated:Le},Symbol.toStringTag,{value:"Module"})),js=Object.keys(Us);class Vs extends ct{constructor(t,n,r,i){let o=-1;if(super(t,n),fd(this,"space",i),typeof r=="number")for(;++o<js.length;){const s=js[o];fd(this,js[o],(r&Us[s])===Us[s])}}}Vs.prototype.defined=!0;function fd(e,t,n){n&&(e[t]=n)}function qn(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new Vs(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[zs(r)]=r,n[zs(o.attribute)]=r}return new Br(t,n,e.space)}const dd=qn({properties:{ariaActiveDescendant:null,ariaAtomic:We,ariaAutoComplete:null,ariaBusy:We,ariaChecked:We,ariaColCount:Z,ariaColIndex:Z,ariaColSpan:Z,ariaControls:Le,ariaCurrent:null,ariaDescribedBy:Le,ariaDetails:null,ariaDisabled:We,ariaDropEffect:Le,ariaErrorMessage:null,ariaExpanded:We,ariaFlowTo:Le,ariaGrabbed:We,ariaHasPopup:null,ariaHidden:We,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Le,ariaLevel:Z,ariaLive:null,ariaModal:We,ariaMultiLine:We,ariaMultiSelectable:We,ariaOrientation:null,ariaOwns:Le,ariaPlaceholder:null,ariaPosInSet:Z,ariaPressed:We,ariaReadOnly:We,ariaRelevant:null,ariaRequired:We,ariaRoleDescription:Le,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 hd(e,t){return t in e?e[t]:t}function pd(e,t){return hd(e,t.toLowerCase())}const h1=qn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Wn,acceptCharset:Le,accessKey:Le,action:null,allow:null,allowFullScreen:ge,allowPaymentRequest:ge,allowUserMedia:ge,alt:null,as:null,async:ge,autoCapitalize:null,autoComplete:Le,autoFocus:ge,autoPlay:ge,blocking:Le,capture:null,charSet:null,checked:ge,cite:null,className:Le,cols:Z,colSpan:null,content:null,contentEditable:We,controls:ge,controlsList:Le,coords:Z|Wn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ge,defer:ge,dir:null,dirName:null,disabled:ge,download:Hs,draggable:We,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ge,formTarget:null,headers:Le,height:Z,hidden:Hs,high:Z,href:null,hrefLang:null,htmlFor:Le,httpEquiv:Le,id:null,imageSizes:null,imageSrcSet:null,inert:ge,inputMode:null,integrity:null,is:null,isMap:ge,itemId:null,itemProp:Le,itemRef:Le,itemScope:ge,itemType:Le,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:Le,placeholder:null,playsInline:ge,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ge,referrerPolicy:null,rel:Le,required:ge,reversed:ge,rows:Z,rowSpan:Z,sandbox:Le,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:Le,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:pd}),p1=qn({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:mt,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:Le,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:Wn,g2:Wn,glyphName:Wn,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:mt,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:Le,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Z,pointsAtY:Z,pointsAtZ:Z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:mt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:mt,rev:mt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:mt,requiredFeatures:mt,requiredFonts:mt,requiredFormats:mt,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:mt,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:mt,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:mt,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:hd}),md=qn({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()}}),gd=qn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:pd}),yd=qn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),m1={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"},g1=/[A-Z]/g,vd=/-[a-z]/g,y1=/^data[-\w.:]+$/i;function v1(e,t){const n=zs(t);let r=t,i=ct;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&y1.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(vd,w1);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!vd.test(o)){let s=o.replace(g1,b1);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=Vs}return new i(r,t)}function b1(e){return"-"+e.toLowerCase()}function w1(e){return e.charAt(1).toUpperCase()}const S1=cd([dd,h1,md,gd,yd],"html"),Ws=cd([dd,p1,md,gd,yd],"svg");function k1(e){return e.join(" ").trim()}var qs={},bd=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,x1=/\n/g,E1=/^\s*/,C1=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,A1=/^:\s*/,T1=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,I1=/^[;\s]*/,O1=/^\s+|\s+$/g,D1=`
27
+ `,wd="/",Sd="*",Tn="",M1="comment",N1="declaration";function L1(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(x1);p&&(n+=p.length);var g=m.lastIndexOf(D1);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(E1)}function f(m){var p;for(m=m||[];p=c();)p!==!1&&m.push(p);return m}function c(){var m=o();if(!(wd!=e.charAt(0)||Sd!=e.charAt(1))){for(var p=2;Tn!=e.charAt(p)&&(Sd!=e.charAt(p)||wd!=e.charAt(p+1));)++p;if(p+=2,Tn===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:M1,comment:g})}}function h(){var m=o(),p=l(C1);if(p){if(c(),!l(A1))return a("property missing ':'");var g=l(T1),v=m({type:N1,property:kd(p[0].replace(bd,Tn)),value:g?kd(g[0].replace(bd,Tn)):Tn});return l(I1),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 kd(e){return e?e.replace(O1,Tn):Tn}var _1=L1,P1=vn&&vn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(qs,"__esModule",{value:!0}),qs.default=R1;const F1=P1(_1);function R1(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,F1.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 Bi={};Object.defineProperty(Bi,"__esModule",{value:!0}),Bi.camelCase=void 0;var B1=/^--[a-zA-Z0-9_-]+$/,$1=/-([a-z])/g,z1=/^[^-]+$/,H1=/^-(webkit|moz|ms|o|khtml)-/,U1=/^-(ms)-/,j1=function(e){return!e||z1.test(e)||B1.test(e)},V1=function(e,t){return t.toUpperCase()},xd=function(e,t){return"".concat(t,"-")},W1=function(e,t){return t===void 0&&(t={}),j1(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(U1,xd):e=e.replace(H1,xd),e.replace($1,V1))};Bi.camelCase=W1;var q1=vn&&vn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Y1=q1(qs),K1=Bi;function Ys(e,t){var n={};return!e||typeof e!="string"||(0,Y1.default)(e,function(r,i){r&&i&&(n[(0,K1.camelCase)(r,t)]=i)}),n}Ys.default=Ys;var G1=Ys;const Q1=bn(G1),Ed=Cd("end"),Ks=Cd("start");function Cd(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 Z1(e){const t=Ks(e),n=Ed(e);if(t&&n)return{start:t,end:n}}function $r(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Ad(e.position):"start"in e||"end"in e?Ad(e):"line"in e||"column"in e?Gs(e):""}function Gs(e){return Td(e&&e.line)+":"+Td(e&&e.column)}function Ad(e){return Gs(e&&e.start)+"-"+Gs(e&&e.end)}function Td(e){return e&&typeof e=="number"?e:1}class tt 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=$r(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}}tt.prototype.file="",tt.prototype.name="",tt.prototype.reason="",tt.prototype.message="",tt.prototype.stack="",tt.prototype.column=void 0,tt.prototype.line=void 0,tt.prototype.ancestors=void 0,tt.prototype.cause=void 0,tt.prototype.fatal=void 0,tt.prototype.place=void 0,tt.prototype.ruleId=void 0,tt.prototype.source=void 0;const Qs={}.hasOwnProperty,J1=new Map,X1=/[A-Z]/g,eS=new Set(["table","tbody","thead","tfoot","tr"]),tS=new Set(["td","th"]),Id="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function nS(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=cS(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=uS(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"?Ws:S1,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=Od(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function Od(e,t,n){if(t.type==="element")return rS(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return iS(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return sS(e,t,n);if(t.type==="mdxjsEsm")return oS(e,t);if(t.type==="root")return aS(e,t,n);if(t.type==="text")return lS(e,t)}function rS(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Ws,e.schema=i),e.ancestors.push(t);const o=Md(e,t.tagName,!1),s=fS(e,t);let a=Js(e,t);return eS.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!f1(l):!0})),Dd(e,s,o,t),Zs(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function iS(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)}zr(e,t.position)}function oS(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);zr(e,t.position)}function sS(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Ws,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:Md(e,t.name,!0),s=dS(e,t),a=Js(e,t);return Dd(e,s,o,t),Zs(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function aS(e,t,n){const r={};return Zs(r,Js(e,t)),e.create(t,e.Fragment,r,n)}function lS(e,t){return t.value}function Dd(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Zs(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function uS(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 cS(e,t){return n;function n(r,i,o,s){const a=Array.isArray(o.children),l=Ks(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 fS(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Qs.call(t.properties,i)){const o=hS(e,i,t.properties[i]);if(o){const[s,a]=o;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&tS.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 dS(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 zr(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 zr(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Js(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:J1;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=Od(e,o,s);a!==void 0&&n.push(a)}return n}function hS(e,t,n){const r=v1(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?s1(n):k1(n)),r.property==="style"){let i=typeof n=="object"?n:pS(e,String(n));return e.stylePropertyNameCase==="css"&&(i=mS(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?m1[r.property]||r.property:r.attribute,n]}}function pS(e,t){try{return Q1(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new tt("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=Id+"#cannot-parse-style-attribute",i}}function Md(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=ld(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=ld(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Qs.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);zr(e)}function zr(e,t){const n=new tt("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=Id+"#cannot-handle-mdx-estrees-without-createevaluater",n}function mS(e){const t={};let n;for(n in e)Qs.call(e,n)&&(t[gS(n)]=e[n]);return t}function gS(e){let t=e.replace(X1,yS);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function yS(e){return"-"+e.toLowerCase()}const Xs={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"]},vS={};function ea(e,t){const n=vS,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Nd(e,r,i)}function Nd(e,t,n){if(bS(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 Ld(e.children,t,n)}return Array.isArray(e)?Ld(e,t,n):""}function Ld(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Nd(e[i],t,n);return r.join("")}function bS(e){return!!(e&&typeof e=="object")}const _d=document.createElement("i");function ta(e){const t="&"+e+";";_d.innerHTML=t;const n=_d.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function gt(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 kt(e,t){return e.length>0?(gt(e,e.length,0,t),e):t}const Pd={}.hasOwnProperty;function Fd(e){const t={};let n=-1;for(;++n<e.length;)wS(t,e[n]);return t}function wS(e,t){let n;for(n in t){const i=(Pd.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){Pd.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]);gt(e,0,0,r)}function Rd(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 st=an(/[A-Za-z]/),nt=an(/[\dA-Za-z]/),kS=an(/[#-'*+\--9=?A-Z^-~]/);function $i(e){return e!==null&&(e<32||e===127)}const na=an(/\d/),xS=an(/[\dA-Fa-f]/),ES=an(/[!-/:-@[-`{-~]/);function ce(e){return e!==null&&e<-2}function Me(e){return e!==null&&(e<0||e===32)}function ve(e){return e===-2||e===-1||e===32}const zi=an(new RegExp("\\p{P}|\\p{S}","u")),In=an(/\s/);function an(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Yn(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(o===37&&nt(e.charCodeAt(n+1))&&nt(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 Ee(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:AS};function AS(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"),Ee(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 TS={tokenize:IS},Bd={tokenize:OS};function IS(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 gt(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(Bd,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(Bd,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 M=I,L,T;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){if(L){T=t.events[M][1].end;break}L=!0}for(v(r),E=I;E<t.events.length;)t.events[E][1].end={...T},E++;gt(t.events,M+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 OS(e,t,n){return Ee(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Kn(e){if(e===null||Me(e)||In(e))return 1;if(zi(e))return 2}function Hi(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 ra={name:"attention",resolveAll:DS,tokenize:MS};function DS(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};$d(c,-l),$d(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=kt(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=kt(u,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),u=kt(u,Hi(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=kt(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=kt(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,gt(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 MS(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Kn(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=Kn(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 $d(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const NS={name:"autolink",tokenize:LS};function LS(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 st(d)?(e.consume(d),s):d===64?n(d):u(d)}function s(d){return d===43||d===45||d===46||nt(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||nt(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||$i(d)?n(d):(e.consume(d),l)}function u(d){return d===64?(e.consume(d),f):kS(d)?(e.consume(d),u):n(d)}function f(d){return nt(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||nt(d))&&r++<63){const m=d===45?h:c;return e.consume(d),m}return n(d)}}const Hr={partial:!0,tokenize:_S};function _S(e,t,n){return r;function r(o){return ve(o)?Ee(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||ce(o)?t(o):n(o)}}const zd={continuation:{tokenize:FS},exit:RS,name:"blockQuote",tokenize:PS};function PS(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 FS(e,t,n){const r=this;return i;function i(s){return ve(s)?Ee(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(zd,t,n)(s)}}function RS(e){e.exit("blockQuote")}const Hd={name:"characterEscape",tokenize:BS};function BS(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 ES(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const Ud={name:"characterReference",tokenize:$S};function $S(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=nt,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=xS,f):(e.enter("characterReferenceValue"),o=7,s=na,f(c))}function f(c){if(c===59&&i){const h=e.exit("characterReferenceValue");return s===nt&&!ta(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 jd={partial:!0,tokenize:HS},Vd={concrete:!0,name:"codeFenced",tokenize:zS};function zS(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)?Ee(e,c,"whitespace")(E):c(E))}function c(E){return E===null||ce(E)?(e.exit("codeFencedFence"),r.interrupt?t(E):e.check(jd,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"),Ee(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)?Ee(e,y,"linePrefix",o+1)(E):y(E)}function y(E){return E===null||ce(E)?e.check(jd,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,M){let L=0;return T;function T(_){return E.enter("lineEnding"),E.consume(_),E.exit("lineEnding"),O}function O(_){return E.enter("codeFencedFence"),ve(_)?Ee(E,H,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):H(_)}function H(_){return _===a?(E.enter("codeFencedFenceSequence"),P(_)):M(_)}function P(_){return _===a?(L++,E.consume(_),P):L>=s?(E.exit("codeFencedFenceSequence"),ve(_)?Ee(E,F,"whitespace")(_):F(_)):M(_)}function F(_){return _===null||ce(_)?(E.exit("codeFencedFence"),I(_)):M(_)}}}function HS(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 ia={name:"codeIndented",tokenize:jS},US={partial:!0,tokenize:VS};function jS(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),Ee(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(US,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 VS(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):Ee(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 WS={name:"codeText",previous:YS,resolve:qS,tokenize:KS};function qS(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 YS(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function KS(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 GS{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&&Ur(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),Ur(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ur(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);Ur(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ur(this.left,n.reverse())}}}function Ur(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 Wd(e){const t={};let n=-1,r,i,o,s,a,l,u;const f=new GS(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,QS(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 gt(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!u}function QS(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 ZS={resolve:XS,tokenize:ek},JS={partial:!0,tokenize:tk};function XS(e){return Wd(e),e}function ek(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(JS,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 tk(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Ee(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 qd(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||$i(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||Me(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||$i(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 Yd(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 Kd(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"),Ee(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 jr(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)?Ee(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const nk={name:"definition",tokenize:ik},rk={partial:!0,tokenize:ok};function ik(e,t,n){const r=this;let i;return o;function o(d){return e.enter("definition"),s(d)}function s(d){return Yd.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 Me(d)?jr(e,u)(d):u(d)}function u(d){return qd(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function f(d){return e.attempt(rk,c,c)(d)}function c(d){return ve(d)?Ee(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 ok(e,t,n){return r;function r(a){return Me(a)?jr(e,i)(a):n(a)}function i(a){return Kd(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return ve(a)?Ee(e,s,"whitespace")(a):s(a)}function s(a){return a===null||ce(a)?t(a):n(a)}}const sk={name:"hardBreakEscape",tokenize:ak};function ak(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 lk={name:"headingAtx",resolve:uk,tokenize:ck};function uk(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"},gt(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function ck(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||Me(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)?Ee(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||Me(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),u)}}const fk=["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"],Gd=["pre","script","style","textarea"],dk={concrete:!0,name:"htmlFlow",resolveTo:mk,tokenize:gk},hk={partial:!0,tokenize:vk},pk={partial:!0,tokenize:yk};function mk(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 gk(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):st(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):st(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:H:m):n(S)}function p(S){return st(S)?(e.consume(S),s=String.fromCharCode(S),g):n(S)}function g(S){if(S===null||S===47||S===62||Me(S)){const V=S===47,ee=s.toLowerCase();return!V&&!o&&Gd.includes(ee)?(i=1,r.interrupt?t(S):H(S)):fk.includes(s.toLowerCase())?(i=6,V?(e.consume(S),v):r.interrupt?t(S):H(S)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(S):o?y(S):w(S))}return S===45||nt(S)?(e.consume(S),s+=String.fromCharCode(S),g):n(S)}function v(S){return S===62?(e.consume(S),r.interrupt?t:H):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||st(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||nt(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):M(S)}function I(S){return S===l?(e.consume(S),l=null,L):S===null||ce(S)?n(S):(e.consume(S),I)}function M(S){return S===null||S===34||S===39||S===47||S===60||S===61||S===62||S===96||Me(S)?k(S):(e.consume(S),M)}function L(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)?H(S):ve(S)?(e.consume(S),O):n(S)}function H(S){return S===45&&i===2?(e.consume(S),z):S===60&&i===1?(e.consume(S),$):S===62&&i===4?(e.consume(S),N):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(hk,R,P)(S)):S===null||ce(S)?(e.exit("htmlFlowData"),P(S)):(e.consume(S),H)}function P(S){return e.check(pk,F,R)(S)}function F(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),_}function _(S){return S===null||ce(S)?P(S):(e.enter("htmlFlowData"),H(S))}function z(S){return S===45?(e.consume(S),b):H(S)}function $(S){return S===47?(e.consume(S),s="",U):H(S)}function U(S){if(S===62){const V=s.toLowerCase();return Gd.includes(V)?(e.consume(S),N):H(S)}return st(S)&&s.length<8?(e.consume(S),s+=String.fromCharCode(S),U):H(S)}function W(S){return S===93?(e.consume(S),b):H(S)}function b(S){return S===62?(e.consume(S),N):S===45&&i===2?(e.consume(S),b):H(S)}function N(S){return S===null||ce(S)?(e.exit("htmlFlowData"),R(S)):(e.consume(S),N)}function R(S){return e.exit("htmlFlow"),t(S)}}function yk(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 vk(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Hr,t,n)}}const bk={name:"htmlText",tokenize:wk};function wk(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):st(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):st(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,$(b)):(e.consume(b),c)}function h(b){return b===45?(e.consume(b),d):c(b)}function d(b){return b===62?z(b):b===45?h(b):c(b)}function m(b){const N="CDATA[";return b===N.charCodeAt(o++)?(e.consume(b),o===N.length?p:m):n(b)}function p(b){return b===null?n(b):b===93?(e.consume(b),g):ce(b)?(s=p,$(b)):(e.consume(b),p)}function g(b){return b===93?(e.consume(b),v):p(b)}function v(b){return b===62?z(b):b===93?(e.consume(b),v):p(b)}function y(b){return b===null||b===62?z(b):ce(b)?(s=y,$(b)):(e.consume(b),y)}function w(b){return b===null?n(b):b===63?(e.consume(b),A):ce(b)?(s=w,$(b)):(e.consume(b),w)}function A(b){return b===62?z(b):w(b)}function k(b){return st(b)?(e.consume(b),E):n(b)}function E(b){return b===45||nt(b)?(e.consume(b),E):I(b)}function I(b){return ce(b)?(s=I,$(b)):ve(b)?(e.consume(b),I):z(b)}function M(b){return b===45||nt(b)?(e.consume(b),M):b===47||b===62||Me(b)?L(b):n(b)}function L(b){return b===47?(e.consume(b),z):b===58||b===95||st(b)?(e.consume(b),T):ce(b)?(s=L,$(b)):ve(b)?(e.consume(b),L):z(b)}function T(b){return b===45||b===46||b===58||b===95||nt(b)?(e.consume(b),T):O(b)}function O(b){return b===61?(e.consume(b),H):ce(b)?(s=O,$(b)):ve(b)?(e.consume(b),O):L(b)}function H(b){return b===null||b===60||b===61||b===62||b===96?n(b):b===34||b===39?(e.consume(b),i=b,P):ce(b)?(s=H,$(b)):ve(b)?(e.consume(b),H):(e.consume(b),F)}function P(b){return b===i?(e.consume(b),i=void 0,_):b===null?n(b):ce(b)?(s=P,$(b)):(e.consume(b),P)}function F(b){return b===null||b===34||b===39||b===60||b===61||b===96?n(b):b===47||b===62||Me(b)?L(b):(e.consume(b),F)}function _(b){return b===47||b===62||Me(b)?L(b):n(b)}function z(b){return b===62?(e.consume(b),e.exit("htmlTextData"),e.exit("htmlText"),t):n(b)}function $(b){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),U}function U(b){return ve(b)?Ee(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 oa={name:"labelEnd",resolveAll:Ek,resolveTo:Ck,tokenize:Ak},Sk={tokenize:Tk},kk={tokenize:Ik},xk={tokenize:Ok};function Ek(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&&gt(e,0,e.length,n),e}function Ck(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=kt(a,e.slice(o+1,o+r+3)),a=kt(a,[["enter",f,t]]),a=kt(a,Hi(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),a=kt(a,[["exit",f,t],e[s-2],e[s-1],["exit",u,t]]),a=kt(a,e.slice(s+1)),a=kt(a,[["exit",l,t]]),gt(e,o,e.length,a),e}function Ak(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(Sk,f,s?f:c)(h):h===91?e.attempt(kk,f,s?u:c)(h):s?f(h):c(h)}function u(h){return e.attempt(xk,f,c)(h)}function f(h){return t(h)}function c(h){return o._balanced=!0,n(h)}}function Tk(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 Me(c)?jr(e,o)(c):o(c)}function o(c){return c===41?f(c):qd(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function s(c){return Me(c)?jr(e,l)(c):f(c)}function a(c){return n(c)}function l(c){return c===34||c===39||c===40?Kd(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):f(c)}function u(c){return Me(c)?jr(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 Ik(e,t,n){const r=this;return i;function i(a){return Yd.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 Ok(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 Dk={name:"labelStartImage",resolveAll:oa.resolveAll,tokenize:Mk};function Mk(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 Nk={name:"labelStartLink",resolveAll:oa.resolveAll,tokenize:Lk};function Lk(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 sa={name:"lineEnding",tokenize:_k};function _k(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ee(e,t,"linePrefix")}}const Ui={name:"thematicBreak",tokenize:Pk};function Pk(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)?Ee(e,a,"whitespace")(u):a(u))}}const ft={continuation:{tokenize:$k},exit:Hk,name:"list",tokenize:Bk},Fk={partial:!0,tokenize:Uk},Rk={partial:!0,tokenize:zk};function Bk(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:na(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(Ui,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 na(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(Hr,r.interrupt?n:f,e.attempt(Fk,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 $k(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Hr,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ee(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(Rk,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ee(e,e.attempt(ft,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function zk(e,t,n){const r=this;return Ee(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 Hk(e){e.exit(this.containerState.type)}function Uk(e,t,n){const r=this;return Ee(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 Qd={name:"setextUnderline",resolveTo:jk,tokenize:Vk};function jk(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 Vk(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)?Ee(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||ce(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const Wk={tokenize:qk};function qk(e){const t=this,n=e.attempt(Hr,r,e.attempt(this.parser.constructs.flowInitial,i,Ee(e,e.attempt(this.parser.constructs.flow,i,e.attempt(ZS,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 Yk={resolveAll:Jd()},Kk=Zd("string"),Gk=Zd("text");function Zd(e){return{resolveAll:Jd(e==="text"?Qk: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 Jd(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 Qk(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 Zk=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:nk},disable:{null:[]},document:{42:ft,43:ft,45:ft,48:ft,49:ft,50:ft,51:ft,52:ft,53:ft,54:ft,55:ft,56:ft,57:ft,62:zd},flow:{35:lk,42:Ui,45:[Qd,Ui],60:dk,61:Qd,95:Ui,96:Vd,126:Vd},flowInitial:{[-2]:ia,[-1]:ia,32:ia},insideSpan:{null:[ra,Yk]},string:{38:Ud,92:Hd},text:{[-5]:sa,[-4]:sa,[-3]:sa,33:Dk,38:Ud,42:ra,60:[NS,bk],91:Nk,92:[sk,Hd],93:oa,95:ra,96:WS}},Symbol.toStringTag,{value:"Module"}));function Jk(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=kt(s,O),g(),s[s.length-1]!==null?[]:(M(t,0),u.events=Hi(o,u.events,u),u.events)}function h(O,H){return ex(d(O),H)}function d(O){return Xk(s,O)}function m(){const{_bufferIndex:O,_index:H,line:P,column:F,offset:_}=r;return{_bufferIndex:O,_index:H,line:P,column:F,offset:_}}function p(O){i[O.line]=O.column,T()}function g(){let O;for(;r._index<s.length;){const H=s[r._index];if(typeof H=="string")for(O=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===O&&r._bufferIndex<H.length;)v(H.charCodeAt(r._bufferIndex));else v(H)}}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,H){const P=H||{};return P.type=O,P.start=m(),u.events.push(["enter",P,u]),a.push(P),P}function A(O){const H=a.pop();return H.end=m(),u.events.push(["exit",H,u]),H}function k(O,H){M(O,H.from)}function E(O,H){H.restore()}function I(O,H){return P;function P(F,_,z){let $,U,W,b;return Array.isArray(F)?R(F):"tokenize"in F?R([F]):N(F);function N(Y){return G;function G(J){const se=J!==null&&Y[J],K=J!==null&&Y.null,re=[...Array.isArray(se)?se:se?[se]:[],...Array.isArray(K)?K:K?[K]:[]];return R(re)(J)}}function R(Y){return $=Y,U=0,Y.length===0?z:S(Y[U])}function S(Y){return G;function G(J){return b=L(),W=Y,Y.partial||(u.currentConstruct=Y),Y.name&&u.parser.constructs.disable.null.includes(Y.name)?ee():Y.tokenize.call(H?Object.assign(Object.create(u),H):u,l,V,ee)(J)}}function V(Y){return O(W,b),_}function ee(Y){return b.restore(),++U<$.length?S($[U]):z}}}function M(O,H){O.resolveAll&&!o.includes(O)&&o.push(O),O.resolve&&gt(u.events,H,u.events.length-H,O.resolve(u.events.slice(H),u)),O.resolveTo&&(u.events=O.resolveTo(u.events,u))}function L(){const O=m(),H=u.previous,P=u.currentConstruct,F=u.events.length,_=Array.from(a);return{from:F,restore:z};function z(){r=O,u.previous=H,u.currentConstruct=P,u.events.length=F,a=_,T()}}function T(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Xk(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 ex(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 Ux(e){const r={constructs:Td([Rx,...(e||{}).extensions||[]]),content:i(fS),defined:[],document:i(hS),flow:i(Dx),lazy:{},string:i(Px),text:i(Lx)};return r;function i(o){return s;function s(a){return $x(r,o,a)}}}function Hx(e){for(;!Fd(e););return e}const Vd=/[\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(Vd.lastIndex=c,u=Vd.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 Vx=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Wx(e){return e.replace(Vx,qx)}function qx(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return Id(n.slice(o?2:1),o?16:10)}return ea(n)||e}const Wd={}.hasOwnProperty;function Yx(e,t,n){return typeof t!="string"&&(n=t,t=void 0),Kx(n)(Hx(Ux(n).document().write(jx()(e,t,!0))))}function Kx(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(fe),autolinkProtocol:P,autolinkEmail:P,atxHeading:o(Oe),blockQuote:o(K),characterEscape:P,characterReference:P,codeFenced:o(ne),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(ne,s),codeText:o($,s),codeTextData:P,data:P,codeFlowValue:P,definition:o(te),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(me),hardBreakEscape:o(Z),hardBreakTrailing:o(Z),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:J,characterReferenceMarkerNumeric:J,characterReferenceValue:Y,characterReference:G,codeFenced:l(g),codeFencedFence:m,codeFencedFenceInfo:d,codeFencedFenceMeta:p,codeFlowValue:T,codeIndented:l(v),codeText:l(R),codeTextData:T,data:T,definition:l(),definitionDestinationString:C,definitionLabelString:y,definitionTitleString:w,emphasis:l(),hardBreakEscape:l(U),hardBreakTrailing:l(U),htmlFlow:l(L),htmlFlowData:T,htmlText:l(F),htmlTextData:T,image:l(j),label:V,labelText:z,lineEnding:O,link:l(N),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:W,resourceDestinationString:b,resourceTitleString:_,resource:B,setextHeading:l(D),setextHeadingLineSequence:I,setextHeadingText:E,strong:l(),thematicBreak:l()}};qd(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(H){let q={type:"root",children:[]};const oe={stack:[q],tokenStack:[],config:t,enter:a,exit:u,buffer:s,resume:f,data:n},le=[];let he=-1;for(;++he<H.length;)if(H[he][1].type==="listOrdered"||H[he][1].type==="listUnordered")if(H[he][0]==="enter")le.push(he);else{const je=le.pop();he=i(H,je,he)}for(he=-1;++he<H.length;){const je=t[H[he][0]];Wd.call(je,H[he][1].type)&&je[H[he][1].type].call(Object.assign({sliceSerialize:H[he][2].sliceSerialize},oe),H[he][1])}if(oe.tokenStack.length>0){const je=oe.tokenStack[oe.tokenStack.length-1];(je[1]||Yd).call(oe,void 0,je[0])}for(q.position={start:an(H.length>0?H[0][1].start:{line:1,column:1,offset:0}),end:an(H.length>0?H[H.length-2][1].end:{line:1,column:1,offset:0})},he=-1;++he<t.transforms.length;)q=t.transforms[he](q)||q;return q}function i(H,q,oe){let le=q-1,he=-1,je=!1,Ge,Ze,Et,Rt;for(;++le<=oe;){const Qe=H[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=H[Ct];if(at[1].type==="lineEnding"||at[1].type==="lineEndingBlank"){if(at[0]==="exit")continue;Ze&&(H[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?H[Ze][1].start:Qe[1].end),H.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,H.splice(le,0,["enter",Ct,Qe[2]]),le++,oe++,Et=void 0,Rt=!0}}}return H[q][1]._spread=je,oe}function o(H,q){return oe;function oe(le){a.call(this,H(le),le),q&&q.call(this,le)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(H,q,oe){this.stack[this.stack.length-1].children.push(H),this.stack.push(H),this.tokenStack.push([q,oe||void 0]),H.position={start:an(q.start),end:void 0}}function l(H){return q;function q(oe){H&&H.call(this,oe),u.call(this,oe)}}function u(H,q){const oe=this.stack.pop(),le=this.tokenStack.pop();if(le)le[0].type!==H.type&&(q?q.call(this,H,le[0]):(le[1]||Yd).call(this,H,le[0]));else throw new Error("Cannot close `"+H.type+"` ("+Fr({start:H.start,end:H.end})+"): it’s not open");oe.position.end=an(H.end)}function f(){return Xs(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function h(H){if(this.data.expectingFirstListItemValue){const q=this.stack[this.stack.length-2];q.start=Number.parseInt(this.sliceSerialize(H),10),this.data.expectingFirstListItemValue=void 0}}function d(){const H=this.resume(),q=this.stack[this.stack.length-1];q.lang=H}function p(){const H=this.resume(),q=this.stack[this.stack.length-1];q.meta=H}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){const H=this.resume(),q=this.stack[this.stack.length-1];q.value=H.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const H=this.resume(),q=this.stack[this.stack.length-1];q.value=H.replace(/(\r?\n|\r)$/g,"")}function y(H){const q=this.resume(),oe=this.stack[this.stack.length-1];oe.label=q,oe.identifier=Mt(this.sliceSerialize(H)).toLowerCase()}function w(){const H=this.resume(),q=this.stack[this.stack.length-1];q.title=H}function C(){const H=this.resume(),q=this.stack[this.stack.length-1];q.url=H}function k(H){const q=this.stack[this.stack.length-1];if(!q.depth){const oe=this.sliceSerialize(H).length;q.depth=oe}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function I(H){const q=this.stack[this.stack.length-1];q.depth=this.sliceSerialize(H).codePointAt(0)===61?1:2}function D(){this.data.setextHeadingSlurpLineEnding=void 0}function P(H){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(H.start),end:void 0},oe.push(le)),this.stack.push(le)}function T(H){const q=this.stack.pop();q.value+=this.sliceSerialize(H),q.position.end=an(H.end)}function O(H){const q=this.stack[this.stack.length-1];if(this.data.atHardBreak){const oe=q.children[q.children.length-1];oe.position.end=an(H.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(q.type)&&(P.call(this,H),T.call(this,H))}function U(){this.data.atHardBreak=!0}function L(){const H=this.resume(),q=this.stack[this.stack.length-1];q.value=H}function F(){const H=this.resume(),q=this.stack[this.stack.length-1];q.value=H}function R(){const H=this.resume(),q=this.stack[this.stack.length-1];q.value=H}function N(){const H=this.stack[this.stack.length-1];if(this.data.inReference){const q=this.data.referenceType||"shortcut";H.type+="Reference",H.referenceType=q,delete H.url,delete H.title}else delete H.identifier,delete H.label;this.data.referenceType=void 0}function j(){const H=this.stack[this.stack.length-1];if(this.data.inReference){const q=this.data.referenceType||"shortcut";H.type+="Reference",H.referenceType=q,delete H.url,delete H.title}else delete H.identifier,delete H.label;this.data.referenceType=void 0}function z(H){const q=this.sliceSerialize(H),oe=this.stack[this.stack.length-2];oe.label=Wx(q),oe.identifier=Mt(q).toLowerCase()}function V(){const H=this.stack[this.stack.length-1],q=this.resume(),oe=this.stack[this.stack.length-1];if(this.data.inReference=!0,oe.type==="link"){const le=H.children;oe.children=le}else oe.alt=q}function b(){const H=this.resume(),q=this.stack[this.stack.length-1];q.url=H}function _(){const H=this.resume(),q=this.stack[this.stack.length-1];q.title=H}function B(){this.data.inReference=void 0}function S(){this.data.referenceType="collapsed"}function W(H){const q=this.resume(),oe=this.stack[this.stack.length-1];oe.label=q,oe.identifier=Mt(this.sliceSerialize(H)).toLowerCase(),this.data.referenceType="full"}function J(H){this.data.characterReferenceType=H.type}function Y(H){const q=this.sliceSerialize(H),oe=this.data.characterReferenceType;let le;oe?(le=Id(q,oe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):le=ea(q);const he=this.stack[this.stack.length-1];he.value+=le}function G(H){const q=this.stack.pop();q.position.end=an(H.end)}function X(H){T.call(this,H);const q=this.stack[this.stack.length-1];q.url=this.sliceSerialize(H)}function se(H){T.call(this,H);const q=this.stack[this.stack.length-1];q.url="mailto:"+this.sliceSerialize(H)}function K(){return{type:"blockquote",children:[]}}function ne(){return{type:"code",lang:null,meta:null,value:""}}function $(){return{type:"inlineCode",value:""}}function te(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function me(){return{type:"emphasis",children:[]}}function Oe(){return{type:"heading",depth:0,children:[]}}function Z(){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(H){return{type:"list",ordered:H.type==="listOrdered",start:null,spread:H._spread,children:[]}}function Fe(H){return{type:"listItem",spread:H._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 qd(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?qd(e,r):Gx(e,r)}}function Gx(e,t){let n;for(n in t)if(Wd.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 Yd(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 Qx(e){const t=this;t.parser=n;function n(r){return Yx(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Zx(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 Jx(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
30
- `}]}function Xx(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 ek(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function tk(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function nk(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 rk(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 ik(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Kd(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 ok(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Kd(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 sk(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 ak(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 lk(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Kd(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 uk(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 ck(e,t,n){const r=e.all(t),i=n?fk(n):Gd(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 tx(e){const r={constructs:Fd([Zk,...(e||{}).extensions||[]]),content:i(CS),defined:[],document:i(TS),flow:i(Wk),lazy:{},string:i(Kk),text:i(Gk)};return r;function i(o){return s;function s(a){return Jk(r,o,a)}}}function nx(e){for(;!Wd(e););return e}const Xd=/[\0\t\n\r]/g;function rx(){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(Xd.lastIndex=c,u=Xd.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 ix=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ox(e){return e.replace(ix,sx)}function sx(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return Rd(n.slice(o?2:1),o?16:10)}return ta(n)||e}const eh={}.hasOwnProperty;function ax(e,t,n){return typeof t!="string"&&(n=t,t=void 0),lx(n)(nx(tx(n).document().write(rx()(e,t,!0))))}function lx(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(fe),autolinkProtocol:L,autolinkEmail:L,atxHeading:o(we),blockQuote:o(K),characterEscape:L,characterReference:L,codeFenced:o(re),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(re,s),codeText:o(B,s),codeTextData:L,data:L,codeFlowValue:L,definition:o(ne),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(me),hardBreakEscape:o(Q),hardBreakTrailing:o(Q),htmlFlow:o(ue,s),htmlFlowData:L,htmlText:o(ue,s),htmlTextData:L,image:o(de),label:s,link:o(fe),listItem:o(Fe),listItemValue:h,listOrdered:o(Te,c),listUnordered:o(Te),paragraph:o(De),reference:S,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(we),strong:o(Ue),thematicBreak:o(ae)},exit:{atxHeading:l(),atxHeadingSequence:k,autolink:l(),autolinkEmail:se,autolinkProtocol:J,blockQuote:l(),characterEscapeValue:T,characterReferenceMarkerHexadecimal:ee,characterReferenceMarkerNumeric:ee,characterReferenceValue:Y,characterReference:G,codeFenced:l(g),codeFencedFence:p,codeFencedFenceInfo:d,codeFencedFenceMeta:m,codeFlowValue:T,codeIndented:l(v),codeText:l(_),codeTextData:T,data:T,definition:l(),definitionDestinationString:A,definitionLabelString:y,definitionTitleString:w,emphasis:l(),hardBreakEscape:l(H),hardBreakTrailing:l(H),htmlFlow:l(P),htmlFlowData:T,htmlText:l(F),htmlTextData:T,image:l($),label:W,labelText:U,lineEnding:O,link:l(z),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:V,resourceDestinationString:b,resourceTitleString:N,resource:R,setextHeading:l(M),setextHeadingLineSequence:I,setextHeadingText:E,strong:l(),thematicBreak:l()}};th(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(j){let q={type:"root",children:[]};const oe={stack:[q],tokenStack:[],config:t,enter:a,exit:u,buffer:s,resume:f,data:n},le=[];let he=-1;for(;++he<j.length;)if(j[he][1].type==="listOrdered"||j[he][1].type==="listUnordered")if(j[he][0]==="enter")le.push(he);else{const je=le.pop();he=i(j,je,he)}for(he=-1;++he<j.length;){const je=t[j[he][0]];eh.call(je,j[he][1].type)&&je[j[he][1].type].call(Object.assign({sliceSerialize:j[he][2].sliceSerialize},oe),j[he][1])}if(oe.tokenStack.length>0){const je=oe.tokenStack[oe.tokenStack.length-1];(je[1]||nh).call(oe,void 0,je[0])}for(q.position={start:ln(j.length>0?j[0][1].start:{line:1,column:1,offset:0}),end:ln(j.length>0?j[j.length-2][1].end:{line:1,column:1,offset:0})},he=-1;++he<t.transforms.length;)q=t.transforms[he](q)||q;return q}function i(j,q,oe){let le=q-1,he=-1,je=!1,Qe,Je,Ct,Bt;for(;++le<=oe;){const Ze=j[le];switch(Ze[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ze[0]==="enter"?he++:he--,Bt=void 0;break}case"lineEndingBlank":{Ze[0]==="enter"&&(Qe&&!Bt&&!he&&!Ct&&(Ct=le),Bt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Bt=void 0}if(!he&&Ze[0]==="enter"&&Ze[1].type==="listItemPrefix"||he===-1&&Ze[0]==="exit"&&(Ze[1].type==="listUnordered"||Ze[1].type==="listOrdered")){if(Qe){let At=le;for(Je=void 0;At--;){const lt=j[At];if(lt[1].type==="lineEnding"||lt[1].type==="lineEndingBlank"){if(lt[0]==="exit")continue;Je&&(j[Je][1].type="lineEndingBlank",je=!0),lt[1].type="lineEnding",Je=At}else if(!(lt[1].type==="linePrefix"||lt[1].type==="blockQuotePrefix"||lt[1].type==="blockQuotePrefixWhitespace"||lt[1].type==="blockQuoteMarker"||lt[1].type==="listItemIndent"))break}Ct&&(!Je||Ct<Je)&&(Qe._spread=!0),Qe.end=Object.assign({},Je?j[Je][1].start:Ze[1].end),j.splice(Je||le,0,["exit",Qe,Ze[2]]),le++,oe++}if(Ze[1].type==="listItemPrefix"){const At={type:"listItem",_spread:!1,start:Object.assign({},Ze[1].start),end:void 0};Qe=At,j.splice(le,0,["enter",At,Ze[2]]),le++,oe++,Ct=void 0,Bt=!0}}}return j[q][1]._spread=je,oe}function o(j,q){return oe;function oe(le){a.call(this,j(le),le),q&&q.call(this,le)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(j,q,oe){this.stack[this.stack.length-1].children.push(j),this.stack.push(j),this.tokenStack.push([q,oe||void 0]),j.position={start:ln(q.start),end:void 0}}function l(j){return q;function q(oe){j&&j.call(this,oe),u.call(this,oe)}}function u(j,q){const oe=this.stack.pop(),le=this.tokenStack.pop();if(le)le[0].type!==j.type&&(q?q.call(this,j,le[0]):(le[1]||nh).call(this,j,le[0]));else throw new Error("Cannot close `"+j.type+"` ("+$r({start:j.start,end:j.end})+"): it’s not open");oe.position.end=ln(j.end)}function f(){return ea(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function h(j){if(this.data.expectingFirstListItemValue){const q=this.stack[this.stack.length-2];q.start=Number.parseInt(this.sliceSerialize(j),10),this.data.expectingFirstListItemValue=void 0}}function d(){const j=this.resume(),q=this.stack[this.stack.length-1];q.lang=j}function m(){const j=this.resume(),q=this.stack[this.stack.length-1];q.meta=j}function p(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){const j=this.resume(),q=this.stack[this.stack.length-1];q.value=j.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const j=this.resume(),q=this.stack[this.stack.length-1];q.value=j.replace(/(\r?\n|\r)$/g,"")}function y(j){const q=this.resume(),oe=this.stack[this.stack.length-1];oe.label=q,oe.identifier=Mt(this.sliceSerialize(j)).toLowerCase()}function w(){const j=this.resume(),q=this.stack[this.stack.length-1];q.title=j}function A(){const j=this.resume(),q=this.stack[this.stack.length-1];q.url=j}function k(j){const q=this.stack[this.stack.length-1];if(!q.depth){const oe=this.sliceSerialize(j).length;q.depth=oe}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function I(j){const q=this.stack[this.stack.length-1];q.depth=this.sliceSerialize(j).codePointAt(0)===61?1:2}function M(){this.data.setextHeadingSlurpLineEnding=void 0}function L(j){const oe=this.stack[this.stack.length-1].children;let le=oe[oe.length-1];(!le||le.type!=="text")&&(le=te(),le.position={start:ln(j.start),end:void 0},oe.push(le)),this.stack.push(le)}function T(j){const q=this.stack.pop();q.value+=this.sliceSerialize(j),q.position.end=ln(j.end)}function O(j){const q=this.stack[this.stack.length-1];if(this.data.atHardBreak){const oe=q.children[q.children.length-1];oe.position.end=ln(j.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(q.type)&&(L.call(this,j),T.call(this,j))}function H(){this.data.atHardBreak=!0}function P(){const j=this.resume(),q=this.stack[this.stack.length-1];q.value=j}function F(){const j=this.resume(),q=this.stack[this.stack.length-1];q.value=j}function _(){const j=this.resume(),q=this.stack[this.stack.length-1];q.value=j}function z(){const j=this.stack[this.stack.length-1];if(this.data.inReference){const q=this.data.referenceType||"shortcut";j.type+="Reference",j.referenceType=q,delete j.url,delete j.title}else delete j.identifier,delete j.label;this.data.referenceType=void 0}function $(){const j=this.stack[this.stack.length-1];if(this.data.inReference){const q=this.data.referenceType||"shortcut";j.type+="Reference",j.referenceType=q,delete j.url,delete j.title}else delete j.identifier,delete j.label;this.data.referenceType=void 0}function U(j){const q=this.sliceSerialize(j),oe=this.stack[this.stack.length-2];oe.label=ox(q),oe.identifier=Mt(q).toLowerCase()}function W(){const j=this.stack[this.stack.length-1],q=this.resume(),oe=this.stack[this.stack.length-1];if(this.data.inReference=!0,oe.type==="link"){const le=j.children;oe.children=le}else oe.alt=q}function b(){const j=this.resume(),q=this.stack[this.stack.length-1];q.url=j}function N(){const j=this.resume(),q=this.stack[this.stack.length-1];q.title=j}function R(){this.data.inReference=void 0}function S(){this.data.referenceType="collapsed"}function V(j){const q=this.resume(),oe=this.stack[this.stack.length-1];oe.label=q,oe.identifier=Mt(this.sliceSerialize(j)).toLowerCase(),this.data.referenceType="full"}function ee(j){this.data.characterReferenceType=j.type}function Y(j){const q=this.sliceSerialize(j),oe=this.data.characterReferenceType;let le;oe?(le=Rd(q,oe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):le=ta(q);const he=this.stack[this.stack.length-1];he.value+=le}function G(j){const q=this.stack.pop();q.position.end=ln(j.end)}function J(j){T.call(this,j);const q=this.stack[this.stack.length-1];q.url=this.sliceSerialize(j)}function se(j){T.call(this,j);const q=this.stack[this.stack.length-1];q.url="mailto:"+this.sliceSerialize(j)}function K(){return{type:"blockquote",children:[]}}function re(){return{type:"code",lang:null,meta:null,value:""}}function B(){return{type:"inlineCode",value:""}}function ne(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function me(){return{type:"emphasis",children:[]}}function we(){return{type:"heading",depth:0,children:[]}}function Q(){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 Te(j){return{type:"list",ordered:j.type==="listOrdered",start:null,spread:j._spread,children:[]}}function Fe(j){return{type:"listItem",spread:j._spread,checked:null,children:[]}}function De(){return{type:"paragraph",children:[]}}function Ue(){return{type:"strong",children:[]}}function te(){return{type:"text",value:""}}function ae(){return{type:"thematicBreak"}}}function ln(e){return{line:e.line,column:e.column,offset:e.offset}}function th(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?th(e,r):ux(e,r)}}function ux(e,t){let n;for(n in t)if(eh.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 nh(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+$r({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+$r({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+$r({start:t.start,end:t.end})+") is still open")}function cx(e){const t=this;t.parser=n;function n(r){return ax(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function fx(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 dx(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
30
+ `}]}function hx(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 px(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function mx(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function gx(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Yn(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 yx(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 vx(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function rh(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 bx(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return rh(e,t);const i={src:Yn(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 wx(e,t){const n={src:Yn(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 Sx(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 kx(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return rh(e,t);const i={href:Yn(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 xx(e,t){const n={href:Yn(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 Ex(e,t,n){const r=e.all(t),i=n?Cx(n):ih(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 fk(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=Gd(n[r])}return t}function Gd(e){const t=e.spread;return t??e.children.length>1}function dk(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 hk(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function pk(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function mk(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function gk(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=md(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 yk(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 p={type:"element",tagName:o,properties:h,children:[]};c&&(p.children=e.all(c),e.patch(c,p),p=e.applyData(c,p)),u.push(p)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,f),e.applyData(t,f)}function vk(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Qd=9,Zd=32;function bk(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(Jd(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(Jd(t.slice(i),i>0,!1)),o.join("")}function Jd(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===Qd||o===Zd;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===Qd||o===Zd;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function wk(e,t){const n={type:"text",value:bk(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Sk(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const xk={blockquote:Zx,break:Jx,code:Xx,delete:ek,emphasis:tk,footnoteReference:nk,heading:rk,html:ik,imageReference:ok,image:sk,inlineCode:ak,linkReference:lk,link:uk,listItem:ck,list:dk,paragraph:hk,root:pk,strong:mk,table:gk,tableCell:vk,tableRow:yk,text:wk,thematicBreak:Sk,toml:Ui,yaml:Ui,definition:Ui,footnoteDefinition:Ui};function Ui(){}const Xd=-1,Hi=0,Ur=1,ji=2,sa=3,aa=4,la=5,ua=6,eh=7,th=8,nh=typeof self=="object"?self:globalThis,kk=(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 Xd: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 eh:{const{name:a,message:l}=s;return n(new nh[a](l),i)}case th: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 nh[o](s),i)};return r},rh=e=>kk(new Map,e)(0),Yn="",{toString:Ek}={},{keys:Ck}=Object,Hr=e=>{const t=typeof e;if(t!=="object"||!e)return[Hi,t];const n=Ek.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")?[eh,n]:[ji,n]},Vi=([e,t])=>e===Hi&&(t==="function"||t==="symbol"),Ak=(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=th,f=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);f=null;break;case"undefined":return i([Xd],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 Ck(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},ih=(e,{json:t,lossy:n}={})=>{const r=[];return Ak(!(t||n),!!t,new Map,r)(e),r},Wi=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?rh(ih(e,t)):structuredClone(e):(e,t)=>rh(ih(e,t));function Tk(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 Ik(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Ok(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Tk,r=e.options.footnoteBackLabel||Ik,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 p=[],m=e.footnoteCounts.get(c);for(;m!==void 0&&++d<=m;){p.length>0&&p.push({type:"text",value:" "});let y=typeof n=="string"?n:n(l,d);typeof y=="string"&&(y={type:"text",value:y}),p.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(...p)}else f.push(...p);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:`
33
+ `});const u={type:"element",tagName:"li",properties:o,children:s};return e.patch(t,u),e.applyData(t,u)}function Cx(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=ih(n[r])}return t}function ih(e){const t=e.spread;return t??e.children.length>1}function Ax(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 Tx(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ix(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Ox(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Dx(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=Ks(t.children[1]),l=Ed(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 Mx(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 Nx(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const oh=9,sh=32;function Lx(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(ah(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(ah(t.slice(i),i>0,!1)),o.join("")}function ah(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===oh||o===sh;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===oh||o===sh;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function _x(e,t){const n={type:"text",value:Lx(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Px(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Fx={blockquote:fx,break:dx,code:hx,delete:px,emphasis:mx,footnoteReference:gx,heading:yx,html:vx,imageReference:bx,image:wx,inlineCode:Sx,linkReference:kx,link:xx,listItem:Ex,list:Ax,paragraph:Tx,root:Ix,strong:Ox,table:Dx,tableCell:Nx,tableRow:Mx,text:_x,thematicBreak:Px,toml:ji,yaml:ji,definition:ji,footnoteDefinition:ji};function ji(){}const lh=-1,Vi=0,Vr=1,Wi=2,aa=3,la=4,ua=5,ca=6,uh=7,ch=8,fh=typeof self=="object"?self:globalThis,Rx=(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 Vi:case lh:return n(s,i);case Vr:{const a=n([],i);for(const l of s)a.push(r(l));return a}case Wi:{const a=n({},i);for(const[l,u]of s)a[r(l)]=r(u);return a}case aa:return n(new Date(s),i);case la:{const{source:a,flags:l}=s;return n(new RegExp(a,l),i)}case ua:{const a=n(new Map,i);for(const[l,u]of s)a.set(r(l),r(u));return a}case ca:{const a=n(new Set,i);for(const l of s)a.add(r(l));return a}case uh:{const{name:a,message:l}=s;return n(new fh[a](l),i)}case ch: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 fh[o](s),i)};return r},dh=e=>Rx(new Map,e)(0),Gn="",{toString:Bx}={},{keys:$x}=Object,Wr=e=>{const t=typeof e;if(t!=="object"||!e)return[Vi,t];const n=Bx.call(e).slice(8,-1);switch(n){case"Array":return[Vr,Gn];case"Object":return[Wi,Gn];case"Date":return[aa,Gn];case"RegExp":return[la,Gn];case"Map":return[ua,Gn];case"Set":return[ca,Gn];case"DataView":return[Vr,n]}return n.includes("Array")?[Vr,n]:n.includes("Error")?[uh,n]:[Wi,n]},qi=([e,t])=>e===Vi&&(t==="function"||t==="symbol"),zx=(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]=Wr(s);switch(a){case Vi:{let f=s;switch(l){case"bigint":a=ch,f=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);f=null;break;case"undefined":return i([lh],s)}return i([a,f],s)}case Vr:{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 Wi:{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 $x(s))(e||!qi(Wr(s[h])))&&f.push([o(h),o(s[h])]);return c}case aa:return i([a,s.toISOString()],s);case la:{const{source:f,flags:c}=s;return i([a,{source:f,flags:c}],s)}case ua:{const f=[],c=i([a,f],s);for(const[h,d]of s)(e||!(qi(Wr(h))||qi(Wr(d))))&&f.push([o(h),o(d)]);return c}case ca:{const f=[],c=i([a,f],s);for(const h of s)(e||!qi(Wr(h)))&&f.push(o(h));return c}}const{message:u}=s;return i([a,{name:l,message:u}],s)};return o},hh=(e,{json:t,lossy:n}={})=>{const r=[];return zx(!(t||n),!!t,new Map,r)(e),r},Yi=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?dh(hh(e,t)):structuredClone(e):(e,t)=>dh(hh(e,t));function Hx(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 Ux(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function jx(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Hx,r=e.options.footnoteBackLabel||Ux,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=Yn(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:{...Yi(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 _k;if(typeof e=="function")return Yi(e);if(typeof e=="object")return Array.isArray(e)?Mk(e):Dk(e);if(typeof e=="string")return Nk(e);throw new Error("Expected function, string, or object as test")};function Mk(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 Dk(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 Nk(e){return Yi(t);function t(n){return n&&n.type===e}}function Yi(e){return t;function t(n,r,i){return!!(Pk(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function _k(){return!0}function Pk(e){return e!==null&&typeof e=="object"&&"type"in e}function FP(e){return e}const oh=[],Lk=!0,ca=!1,Fk="skip";function sh(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=oh,p,m,g;if((!t||o(l,u,f[f.length-1]||void 0))&&(d=Rk(n(l,f)),d[0]===ca))return d;if("children"in l&&l.children){const v=l;if(v.children&&d[0]!==Fk)for(m=(r?v.children.length:-1)+s,g=f.concat(v);m>-1&&m<v.children.length;){const y=v.children[m];if(p=a(y,m,g)(),p[0]===ca)return p;m=typeof p[1]=="number"?p[1]:m+s}}return d}}}function Rk(e){return Array.isArray(e)?e:typeof e=="number"?[Lk,e]:e==null?oh:[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),sh(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,$k={};function Bk(e,t){const n=t||$k,r=new Map,i=new Map,o=new Map,s={...xk,...n.handlers},a={all:u,applyData:Uk,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:s,one:l,options:n,patch:zk,wrap:jk};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:m,...g}=f,v=Wi(g);return v.children=a.all(f),v}return Wi(f)}return(a.options.unknownHandler||Hk)(a,f,c)}function u(f){const c=[];if("children"in f){const h=f.children;let d=-1;for(;++d<h.length;){const p=a.one(h[d],f);if(p){if(d&&h[d-1].type==="break"&&(!Array.isArray(p)&&p.type==="text"&&(p.value=ah(p.value)),!Array.isArray(p)&&p.type==="element")){const m=p.children[0];m&&m.type==="text"&&(m.value=ah(m.value))}Array.isArray(p)?c.push(...p):c.push(p)}}}return c}}function zk(e,t){e.position&&(t.position=R1(e))}function Uk(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 Hk(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 jk(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
35
+ `}]}}const Ki=function(e){if(e==null)return Yx;if(typeof e=="function")return Gi(e);if(typeof e=="object")return Array.isArray(e)?Vx(e):Wx(e);if(typeof e=="string")return qx(e);throw new Error("Expected function, string, or object as test")};function Vx(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Ki(e[n]);return Gi(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function Wx(e){const t=e;return Gi(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function qx(e){return Gi(t);function t(n){return n&&n.type===e}}function Gi(e){return t;function t(n,r,i){return!!(Kx(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Yx(){return!0}function Kx(e){return e!==null&&typeof e=="object"&&"type"in e}function Z2(e){return e}const ph=[],Gx=!0,fa=!1,Qx="skip";function mh(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=Ki(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=ph,m,p,g;if((!t||o(l,u,f[f.length-1]||void 0))&&(d=Zx(n(l,f)),d[0]===fa))return d;if("children"in l&&l.children){const v=l;if(v.children&&d[0]!==Qx)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]===fa)return m;p=typeof m[1]=="number"?m[1]:p+s}}return d}}}function Zx(e){return Array.isArray(e)?e:typeof e=="number"?[Gx,e]:e==null?ph:[e]}function da(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),mh(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 ha={}.hasOwnProperty,Jx={};function Xx(e,t){const n=t||Jx,r=new Map,i=new Map,o=new Map,s={...Fx,...n.handlers},a={all:u,applyData:tE,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:s,one:l,options:n,patch:eE,wrap:rE};return da(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(ha.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=Yi(g);return v.children=a.all(f),v}return Yi(f)}return(a.options.unknownHandler||nE)(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=gh(m.value)),!Array.isArray(m)&&m.type==="element")){const p=m.children[0];p&&p.type==="text"&&(p.value=gh(p.value))}Array.isArray(m)?c.push(...m):c.push(m)}}}return c}}function eE(e,t){e.position&&(t.position=Z1(e))}function tE(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,Yi(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function nE(e,t){const n=t.data||{},r="value"in t&&!(ha.call(n,"hProperties")||ha.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 rE(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 ah(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function lh(e,t){const n=Bk(e,t),r=n.one(e,void 0),i=Ok(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 Vk(e,t){return e&&"run"in e?async function(n,r){const i=lh(n,{file:r,...t});await e.run(i,r)}:function(n,r){return lh(n,{file:r,...e||t})}}function uh(e){if(e)throw e}var Ki=Object.prototype.hasOwnProperty,ch=Object.prototype.toString,fh=Object.defineProperty,dh=Object.getOwnPropertyDescriptor,hh=function(t){return typeof Array.isArray=="function"?Array.isArray(t):ch.call(t)==="[object Array]"},ph=function(t){if(!t||ch.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)},mh=function(t,n){fh&&n.name==="__proto__"?fh(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},gh=function(t,n){if(n==="__proto__")if(Ki.call(t,n)){if(dh)return dh(t,n).value}else return;return t[n]},Wk=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=gh(a,n),i=gh(t,n),a!==i&&(f&&i&&(ph(i)||(o=hh(i)))?(o?(o=!1,s=r&&hh(r)?r:[]):s=r&&ph(r)?r:{},mh(a,{name:n,newValue:e(f,s,i)})):typeof i<"u"&&mh(a,{name:n,newValue:i}));return a};const ha=vn(Wk);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 qk(){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?Yk(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 Yk(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:Kk,dirname:Gk,extname:Qk,join:Zk,sep:"/"};function Kk(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 Gk(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 Qk(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 Zk(...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?".":Jk(n)}function Jk(e){jr(e);const t=e.codePointAt(0)===47;let n=Xk(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Xk(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 eE={cwd:tE};function tE(){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 nE(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 rE(e)}function rE(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 yh{constructor(t){let n;t?ma(t)?n={path:t}:typeof t=="string"||iE(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":eE.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){vh(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"),vh(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=nE(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 vh(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function iE(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const oE=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},sE={}.hasOwnProperty;class ba extends oE{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=qk()}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):sE.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,p=r.stringify(d,h);uE(p)?h.value=p:h.result=p,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),wh("processSync","process",n),r;function i(o,s){n=!0,uh(o),r=s}}run(t,n,r){bh(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),wh("runSync","run",r),i;function o(s,a){uh(s),i=a,r=!0}}stringify(t,n){this.freeze();const r=Gi(n),i=this.compiler||this.Compiler;return Sa("stringify",i),bh(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,...p]=f;const m=r[h][1];pa(m)&&pa(d)&&(d=ha(!0,m,d)),r[h]=[u,d,...p]}}}}const aE=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 bh(e){if(!pa(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function wh(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Gi(e){return lE(e)?e:new yh(e)}function lE(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function uE(e){return typeof e=="string"||cE(e)}function cE(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const fE="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Sh=[],xh={allowDangerousHtml:!0},dE=/^(https?|ircs?|mailto|xmpp)$/i,hE=[{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 kh(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,o=e.components,s=e.disallowedElements,a=e.rehypePlugins||Sh,l=e.remarkPlugins||Sh,u=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...xh}:xh,f=e.skipHtml,c=e.unwrapDisallowed,h=e.urlTransform||Eh,d=aE().use(Qx).use(l).use(Vk,u).use(a),p=new yh;typeof r=="string"&&(p.value=r);for(const y of hE)Object.hasOwn(e,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+fE+y.id,void 0);const m=d.parse(p);let g=d.runSync(m,p);return i&&(g={type:"element",tagName:"div",properties:{className:i},children:g.type==="root"?g.children:[g]}),fa(g,v),H1(g,{Fragment:x.Fragment,components:o,ignoreInvalidStyle:!0,jsx:x.jsx,jsxs:x.jsxs,passKeys:!0,passNode:!0});function v(y,w,C){if(y.type==="raw"&&C&&typeof w=="number")return f?C.children.splice(w,1):C.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,C)),k&&C&&typeof w=="number")return c&&y.children?C.children.splice(w,1,...y.children):C.children.splice(w,1),w}}}function Eh(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||dE.test(e.slice(0,t))?e:""}function pE(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Ch(e,t,n){const i=qi((n||{}).ignore||[]),o=mE(t);let s=-1;for(;++s<o.length;)sh(e,"text",a);function a(u,f){let c=-1,h;for(;++c<f.length;){const d=f[c],p=h?h.children:void 0;if(i(d,p?p.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 p=0;const g=c.children.indexOf(u);let v=!1,y=[];h.lastIndex=0;let w=h.exec(u.value);for(;w;){const C=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=C+1:(p!==C&&y.push({type:"text",value:u.value.slice(p,C)}),Array.isArray(E)?y.push(...E):E&&y.push(E),p=C+w[0].length,v=!0),!h.global)break;w=h.exec(u.value)}return v?(p<u.value.length&&y.push({type:"text",value:u.value.slice(p)}),c.children.splice(g,1,...y)):y=[u],g+y.length}}function mE(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([gE(i[0]),yE(i[1])])}return t}function gE(e){return typeof e=="string"?new RegExp(pE(e),"g"):e}function yE(e){return typeof e=="function"?e:function(){return e}}function vE(e){Ch(e,[/\r?\n|\r/g,bE])}function bE(){return{type:"break"}}function wE(){return function(e){vE(e)}}function Ah(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 SE(){return{transforms:[IE],enter:{literalAutolink:kE,literalAutolinkEmail:Ca,literalAutolinkHttp:Ca,literalAutolinkWww:Ca},exit:{literalAutolink:TE,literalAutolinkEmail:AE,literalAutolinkHttp:EE,literalAutolinkWww:CE}}}function xE(){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 kE(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Ca(e){this.config.enter.autolinkProtocol.call(this,e)}function EE(e){this.config.exit.autolinkProtocol.call(this,e)}function CE(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 AE(e){this.config.exit.autolinkEmail.call(this,e)}function TE(e){this.exit(e)}function IE(e){Ch(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,OE],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),ME]],{ignore:["link","linkReference"]})}function OE(e,t,n,r,i){let o="";if(!Th(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!DE(n)))return!1;const s=NE(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 ME(e,t,n,r){return!Th(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function DE(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 NE(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=Ah(e,"(");let o=Ah(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 Th(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Tn(n)||$i(n))&&(!t||n!==47)}Ih.peek=UE;function _E(){this.buffer()}function PE(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function LE(){this.buffer()}function FE(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function RE(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 $E(e){this.exit(e)}function BE(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 zE(e){this.exit(e)}function UE(){return"["}function Ih(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 HE(){return{enter:{gfmFootnoteCallString:_E,gfmFootnoteCall:PE,gfmFootnoteDefinitionLabelString:LE,gfmFootnoteDefinition:FE},exit:{gfmFootnoteCallString:RE,gfmFootnoteCall:$E,gfmFootnoteDefinitionLabelString:BE,gfmFootnoteDefinition:zE}}}function jE(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Ih},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?Oh:VE))),u(),l}}function VE(e,t,n){return t===0?e:Oh(e,t,n)}function Oh(e,t,n){return(n?"":" ")+e}const WE=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Mh.peek=QE;function qE(){return{canContainEols:["delete"],enter:{strikethrough:KE},exit:{strikethrough:GE}}}function YE(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:WE}],handlers:{delete:Mh}}}function KE(e){this.enter({type:"delete",children:[]},e)}function GE(e){this.exit(e)}function Mh(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 QE(){return"~"}function ZE(e){return e.length}function JE(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||ZE,o=[],s=[],a=[],l=[];let u=0,f=-1;for(;++f<e.length;){const m=[],g=[];let v=-1;for(e[f].length>u&&(u=e[f].length);++v<e[f].length;){const y=XE(e[f][v]);if(n.alignDelimiters!==!1){const w=i(y);g[v]=w,(l[v]===void 0||w>l[v])&&(l[v]=w)}m.push(y)}s[f]=m,a[f]=g}let c=-1;if(typeof r=="object"&&"length"in r)for(;++c<u;)o[c]=Dh(r[c]);else{const m=Dh(r);for(;++c<u;)o[c]=m}c=-1;const h=[],d=[];for(;++c<u;){const m=o[c];let g="",v="";m===99?(g=":",v=":"):m===108?g=":":m===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 p=[];for(;++f<s.length;){const m=s[f],g=a[f];c=-1;const v=[];for(;++c<u;){const y=m[c]||"";let w="",C="";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),C=" ".repeat(k/2-.5)):(w=" ".repeat(k/2),C=w):C=" ".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(C),n.padding!==!1&&v.push(" "),(n.delimiterEnd!==!1||c!==u-1)&&v.push("|")}p.push(n.delimiterEnd===!1?v.join("").replace(/ +$/,""):v.join(""))}return p.join(`
41
- `)}function XE(e){return e==null?"":String(e)}function Dh(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 eC(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()),tC);return i(),s}function tC(e,t,n){return">"+(n?"":" ")+e}function nC(e,t){return Nh(e,t.inConstruct,!0)&&!Nh(e,t.notInConstruct,!1)}function Nh(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function _h(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
42
- `&&nC(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
43
- `}function rC(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 iC(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 oC(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function sC(e,t,n,r){const i=oC(n),o=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(iC(e,n)){const c=n.enter("codeIndented"),h=n.indentLines(o,aC);return c(),h}const a=n.createTracker(r),l=i.repeat(Math.max(rC(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 gh(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function yh(e,t){const n=Xx(e,t),r=n.one(e,void 0),i=jx(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 iE(e,t){return e&&"run"in e?async function(n,r){const i=yh(n,{file:r,...t});await e.run(i,r)}:function(n,r){return yh(n,{file:r,...e||t})}}function vh(e){if(e)throw e}var Qi=Object.prototype.hasOwnProperty,bh=Object.prototype.toString,wh=Object.defineProperty,Sh=Object.getOwnPropertyDescriptor,kh=function(t){return typeof Array.isArray=="function"?Array.isArray(t):bh.call(t)==="[object Array]"},xh=function(t){if(!t||bh.call(t)!=="[object Object]")return!1;var n=Qi.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Qi.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Qi.call(t,i)},Eh=function(t,n){wh&&n.name==="__proto__"?wh(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Ch=function(t,n){if(n==="__proto__")if(Qi.call(t,n)){if(Sh)return Sh(t,n).value}else return;return t[n]},oE=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=Ch(a,n),i=Ch(t,n),a!==i&&(f&&i&&(xh(i)||(o=kh(i)))?(o?(o=!1,s=r&&kh(r)?r:[]):s=r&&xh(r)?r:{},Eh(a,{name:n,newValue:e(f,s,i)})):typeof i<"u"&&Eh(a,{name:n,newValue:i}));return a};const pa=bn(oE);function ma(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 sE(){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?aE(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 aE(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:lE,dirname:uE,extname:cE,join:fE,sep:"/"};function lE(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');qr(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 uE(e){if(qr(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 cE(e){qr(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 fE(...e){let t=-1,n;for(;++t<e.length;)qr(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":dE(n)}function dE(e){qr(e);const t=e.codePointAt(0)===47;let n=hE(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function hE(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 qr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const pE={cwd:mE};function mE(){return"/"}function ga(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function gE(e){if(typeof e=="string")e=new URL(e);else if(!ga(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 yE(e)}function yE(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 ya=["history","path","basename","stem","extname","dirname"];class Ah{constructor(t){let n;t?ga(t)?n={path:t}:typeof t=="string"||vE(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":pE.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<ya.length;){const o=ya[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)ya.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?$t.basename(this.path):void 0}set basename(t){ba(t,"basename"),va(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){Th(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(va(t,"extname"),Th(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){ga(t)&&(t=gE(t)),ba(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){ba(t,"stem"),va(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 tt(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 va(e,t){if(e&&e.includes($t.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+$t.sep+"`")}function ba(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Th(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function vE(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const bE=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},wE={}.hasOwnProperty;class wa extends bE{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=sE()}copy(){const t=new wa;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(pa(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(xa("data",this.frozen),this.namespace[t]=n,this):wE.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=Zi(t),r=this.parser||this.Parser;return Sa("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Sa("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=Zi(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);xE(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(),Sa("processSync",this.parser||this.Parser),ka("processSync",this.compiler||this.Compiler),this.process(t,i),Oh("processSync","process",n),r;function i(o,s){n=!0,vh(o),r=s}}run(t,n,r){Ih(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=Zi(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),Oh("runSync","run",r),i;function o(s,a){vh(s),i=a,r=!0}}stringify(t,n){this.freeze();const r=Zi(n),i=this.compiler||this.Compiler;return ka("stringify",i),Ih(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=pa(!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];ma(p)&&ma(d)&&(d=pa(!0,p,d)),r[h]=[u,d,...m]}}}}const SE=new wa().freeze();function Sa(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 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 Ih(e){if(!ma(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Oh(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Zi(e){return kE(e)?e:new Ah(e)}function kE(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function xE(e){return typeof e=="string"||EE(e)}function EE(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const CE="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Dh=[],Mh={allowDangerousHtml:!0},AE=/^(https?|ircs?|mailto|xmpp)$/i,TE=[{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 Nh(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,o=e.components,s=e.disallowedElements,a=e.rehypePlugins||Dh,l=e.remarkPlugins||Dh,u=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Mh}:Mh,f=e.skipHtml,c=e.unwrapDisallowed,h=e.urlTransform||Lh,d=SE().use(cx).use(l).use(iE,u).use(a),m=new Ah;typeof r=="string"&&(m.value=r);for(const y of TE)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]}),da(g,v),nS(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 Xs)if(Object.hasOwn(Xs,k)&&Object.hasOwn(y.properties,k)){const E=y.properties[k],I=Xs[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 Lh(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||AE.test(e.slice(0,t))?e:""}function IE(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function _h(e,t,n){const i=Ki((n||{}).ignore||[]),o=OE(t);let s=-1;for(;++s<o.length;)mh(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 OE(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([DE(i[0]),ME(i[1])])}return t}function DE(e){return typeof e=="string"?new RegExp(IE(e),"g"):e}function ME(e){return typeof e=="function"?e:function(){return e}}function NE(e){_h(e,[/\r?\n|\r/g,LE])}function LE(){return{type:"break"}}function _E(){return function(e){NE(e)}}function Ph(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 Ea="phrasing",Ca=["autolink","link","image","label"];function PE(){return{transforms:[UE],enter:{literalAutolink:RE,literalAutolinkEmail:Aa,literalAutolinkHttp:Aa,literalAutolinkWww:Aa},exit:{literalAutolink:HE,literalAutolinkEmail:zE,literalAutolinkHttp:BE,literalAutolinkWww:$E}}}function FE(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Ea,notInConstruct:Ca},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Ea,notInConstruct:Ca},{character:":",before:"[ps]",after:"\\/",inConstruct:Ea,notInConstruct:Ca}]}}function RE(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Aa(e){this.config.enter.autolinkProtocol.call(this,e)}function BE(e){this.config.exit.autolinkProtocol.call(this,e)}function $E(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 zE(e){this.config.exit.autolinkEmail.call(this,e)}function HE(e){this.exit(e)}function UE(e){_h(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,jE],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),VE]],{ignore:["link","linkReference"]})}function jE(e,t,n,r,i){let o="";if(!Fh(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!WE(n)))return!1;const s=qE(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 VE(e,t,n,r){return!Fh(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function WE(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 qE(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=Ph(e,"(");let o=Ph(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 Fh(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||In(n)||zi(n))&&(!t||n!==47)}Rh.peek=tC;function YE(){this.buffer()}function KE(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function GE(){this.buffer()}function QE(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function ZE(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 JE(e){this.exit(e)}function XE(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 eC(e){this.exit(e)}function tC(){return"["}function Rh(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 nC(){return{enter:{gfmFootnoteCallString:YE,gfmFootnoteCall:KE,gfmFootnoteDefinitionLabelString:GE,gfmFootnoteDefinition:QE},exit:{gfmFootnoteCallString:ZE,gfmFootnoteCall:JE,gfmFootnoteDefinitionLabelString:XE,gfmFootnoteDefinition:eC}}}function rC(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Rh},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?Bh:iC))),u(),l}}function iC(e,t,n){return t===0?e:Bh(e,t,n)}function Bh(e,t,n){return(n?"":" ")+e}const oC=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];$h.peek=cC;function sC(){return{canContainEols:["delete"],enter:{strikethrough:lC},exit:{strikethrough:uC}}}function aC(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:oC}],handlers:{delete:$h}}}function lC(e){this.enter({type:"delete",children:[]},e)}function uC(e){this.exit(e)}function $h(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 cC(){return"~"}function fC(e){return e.length}function dC(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||fC,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=hC(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]=zh(r[c]);else{const p=zh(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 hC(e){return e==null?"":String(e)}function zh(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 pC(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()),mC);return i(),s}function mC(e,t,n){return">"+(n?"":" ")+e}function gC(e,t){return Hh(e,t.inConstruct,!0)&&!Hh(e,t.notInConstruct,!1)}function Hh(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 Uh(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
42
+ `&&gC(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
43
+ `}function yC(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 vC(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 bC(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 wC(e,t,n,r){const i=bC(n),o=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(vC(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(yC(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 aC(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 lC(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 uC(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}}Ph.peek=cC;function Ph(e,t,n,r){const i=uC(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 cC(e,t,n){return n.options.emphasis||"*"}function fC(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 dC(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(fC(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 Ta(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 kC(e,t,n,r){const i=Ta(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 xC(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 Yr(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Ji(e,t,n){const r=Kn(e),i=Kn(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}}jh.peek=EC;function jh(e,t,n,r){const i=xC(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=Ji(r.before.charCodeAt(r.before.length-1),u,i);f.inside&&(l=Yr(u)+l.slice(1));const c=l.charCodeAt(l.length-1),h=Ji(r.after.charCodeAt(0),c,i);h.inside&&(l=l.slice(0,-1)+Yr(c));const d=s.move(i);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:f.outside},a+l+d}function EC(e,t,n){return n.options.emphasis||"*"}function CC(e,t){let n=!1;return da(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,fa}),!!((!e.depth||e.depth<3)&&ea(e)&&(t.options.setext||n))}function AC(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=Vr(u.charCodeAt(0))+u.slice(1)),u=u?s+" "+u:s,n.options.closeAtx&&(u+=" "+s),l(),a(),u}Lh.peek=hC;function Lh(e){return e.value||""}function hC(){return"<"}Fh.peek=pC;function Fh(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 pC(){return"!"}Rh.peek=mC;function Rh(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 mC(){return"!"}$h.peek=gC;function $h(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 gC(){return"`"}function Bh(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))}zh.peek=yC;function zh(e,t,n,r){const i=Aa(n),o=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let a,l;if(Bh(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 yC(e,t,n){return Bh(e,n)?"<":"["}Uh.peek=vC;function Uh(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 vC(){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 bC(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 wC(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 Hh(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 SC(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let s=e.ordered?wC(n):Ta(n);const a=e.ordered?s==="."?")":".":bC(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),Hh(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 xC(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function kC(e,t,n,r){const i=xC(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 EC(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),s=n.containerPhrasing(e,r);return o(),i(),s}const CC=qi(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function AC(e,t,n,r){return(e.children.some(function(s){return CC(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function TC(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}jh.peek=IC;function jh(e,t,n,r){const i=TC(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 IC(e,t,n){return n.options.strong||"*"}function OC(e,t,n,r){return n.safe(e.value,r)}function MC(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 DC(e,t,n){const r=(Hh(n)+(n.options.ruleSpaces?" ":"")).repeat(MC(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Vh={blockquote:eC,break:_h,code:sC,definition:lC,emphasis:Ph,hardBreak:_h,heading:dC,html:Lh,image:Fh,imageReference:Rh,inlineCode:$h,link:zh,linkReference:Uh,list:SC,listItem:kC,paragraph:EC,root:AC,strong:jh,text:OC,thematicBreak:DC};function NC(){return{enter:{table:_C,tableData:Wh,tableHeader:Wh,tableRow:LC},exit:{codeText:FC,table:PC,tableData:Ia,tableHeader:Ia,tableRow:Ia}}}function _C(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 PC(e){this.exit(e),this.data.inTable=void 0}function LC(e){this.enter({type:"tableRow",children:[]},e)}function Ia(e){this.exit(e)}function Wh(e){this.enter({type:"tableCell",children:[]},e)}function FC(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,RC));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function RC(e,t){return t==="|"?t:e}function $C(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,p,m,g){return u(f(d,m,g),d.align)}function a(d,p,m,g){const v=c(d,m,g),y=u([v]);return y.slice(0,y.indexOf(`
54
- `))}function l(d,p,m,g){const v=m.enter("tableCell"),y=m.enter("phrasing"),w=m.containerPhrasing(d,{...g,before:o,after:o});return y(),v(),w}function u(d,p){return JE(d,{align:p,alignDelimiters:r,padding:n,stringLength:i})}function f(d,p,m){const g=d.children;let v=-1;const y=[],w=p.enter("table");for(;++v<g.length;)y[v]=c(g[v],p,m);return w(),y}function c(d,p,m){const g=d.children;let v=-1;const y=[],w=p.enter("tableRow");for(;++v<g.length;)y[v]=l(g[v],d,p,m);return w(),y}function h(d,p,m){let g=Vh.inlineCode(d,p,m);return m.stack.includes("tableCell")&&(g=g.replace(/\|/g,"\\$&")),g}}function BC(){return{exit:{taskListCheckValueChecked:qh,taskListCheckValueUnchecked:qh,paragraph:UC}}}function zC(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:HC}}}function qh(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function UC(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 HC(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=Vh.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[SE(),HE(),qE(),NC(),BC()]}function VC(e){return{extensions:[xE(),jE(e),YE(),$C(e),zC()]}}const WC={tokenize:ZC,partial:!0},Yh={tokenize:JC,partial:!0},Kh={tokenize:XC,partial:!0},Gh={tokenize:eA,partial:!0},qC={tokenize:tA,partial:!0},Qh={name:"wwwAutolink",tokenize:GC,previous:Jh},Zh={name:"protocolAutolink",tokenize:QC,previous:Xh},Kt={name:"emailAutolink",tokenize:KC,previous:ep},Bt={};function YC(){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,Zh],Bt[104]=[Kt,Zh],Bt[87]=[Kt,Qh],Bt[119]=[Kt,Qh];function KC(e,t,n){const r=this;let i,o;return s;function s(c){return!Oa(c)||!ep.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(qC,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 GC(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!Jh.call(r,r.previous)||Ma(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(WC,e.attempt(Yh,e.attempt(Kh,o),n),n)(s))}function o(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function QC(e,t,n){const r=this;let i="",o=!1;return s;function s(c){return(c===72||c===104)&&Xh.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(Yh,e.attempt(Kh,f),n)(c)}function f(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(c)}}function ZC(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 JC(e,t,n){let r,i,o;return s;function s(u){return u===46||u===95?e.check(Gh,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 XC(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(Gh,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 eA(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 tA(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return tt(o)?n(o):t(o)}}function Jh(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||De(e)}function Xh(e){return!ot(e)}function ep(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 nA={tokenize:cA,partial:!0};function rA(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:aA,continuation:{tokenize:lA},exit:uA}},text:{91:{name:"gfmFootnoteCall",tokenize:sA},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:iA,resolveTo:oA}}}}function iA(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 oA(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 sA(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 aA(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,s=0,a;return l;function l(p){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(p){return p===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):n(p)}function f(p){if(s>999||p===93&&!a||p===null||p===91||De(p))return n(p);if(p===93){e.exit("chunkString");const m=e.exit("gfmFootnoteDefinitionLabelString");return o=Mt(r.sliceSerialize(m)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return De(p)||(a=!0),s++,e.consume(p),p===92?c:f}function c(p){return p===91||p===92||p===93?(e.consume(p),s++,f):f(p)}function h(p){return p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),i.includes(o)||i.push(o),ke(e,d,"gfmFootnoteDefinitionWhitespace")):n(p)}function d(p){return t(p)}}function lA(e,t,n){return e.check($r,t,e.attempt(nA,t,n))}function uA(e){e.exit("gfmFootnoteDefinition")}function cA(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 fA(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(p){return u===126&&f[f.length-1][1].type!=="characterEscape"?l(p):(s.enter("strikethroughSequenceTemporary"),d(p))}function d(p){const m=qn(u);if(p===126)return c>1?l(p):(s.consume(p),c++,d);if(c<2&&!n)return l(p);const g=s.exit("strikethroughSequenceTemporary"),v=qn(p);return g._open=!v||v===2&&!!m,g._close=!m||m===2&&!!v,a(p)}}}class dA{constructor(){this.map=[]}add(t,n,r){hA(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 hA(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 pA(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 mA(){return{flow:{null:{name:"table",tokenize:gA,resolveAll:yA}}}}function gA(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 U=O>-1?r.events[O][1].type:null,L=U==="tableHead"||U==="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,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):p(T))}function p(T){return T===45||T===58?g(T):T===124?(s=!0,e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),m):k(T)}function m(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)?C(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,C,"whitespace")(T):C(T)}function C(T){return T===124?p(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 yA(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 dA;for(;++n<e.length;){const d=e[n],p=d[1];d[0]==="enter"?p.type==="tableHead"?(a=!1,l!==0&&(tp(h,t,l,u,f),f=void 0,l=0),u={type:"table",start:Object.assign({},p.start),end:Object.assign({},p.end)},h.add(n,0,[["enter",u,t]])):p.type==="tableRow"||p.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({},p.start),end:Object.assign({},p.end)},h.add(n,0,[["enter",f,t]])),i=p.type==="tableDelimiterRow"?2:f?3:1):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.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)):p.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])):p.type==="tableHead"?(a=!0,l=n):p.type==="tableRow"||p.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&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")&&(s[3]=n)}for(l!==0&&tp(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=pA(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 p=n[2]+1,m=n[3]-n[2]-1;e.add(p,m,[])}}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 tp(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 vA={name:"tasklistCheck",tokenize:wA};function bA(){return{text:{91:vA}}}function wA(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:SA},t,n)(l):n(l)}}function SA(e,t,n){return ke(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function xA(e){return Td([YC(),rA(),fA(e),mA(),bA()])}const kA={};function EA(e){const t=this,n=e||kA,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(xA(n)),o.push(jC()),s.push(VC(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"}}}};/**
52
+ `,...o.current()});return/^[\t ]/.test(u)&&(u=Yr(u.charCodeAt(0))+u.slice(1)),u=u?s+" "+u:s,n.options.closeAtx&&(u+=" "+s),l(),a(),u}Vh.peek=TC;function Vh(e){return e.value||""}function TC(){return"<"}Wh.peek=IC;function Wh(e,t,n,r){const i=Ta(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 IC(){return"!"}qh.peek=OC;function qh(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 OC(){return"!"}Yh.peek=DC;function Yh(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 DC(){return"`"}function Kh(e,t){const n=ea(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))}Gh.peek=MC;function Gh(e,t,n,r){const i=Ta(n),o=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let a,l;if(Kh(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 MC(e,t,n){return Kh(e,n)?"<":"["}Qh.peek=NC;function Qh(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 NC(){return"["}function Ia(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 LC(e){const t=Ia(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 _C(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 PC(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let s=e.ordered?_C(n):Ia(n);const a=e.ordered?s==="."?")":".":LC(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 FC(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 RC(e,t,n,r){const i=FC(n);let o=n.bulletCurrent||Ia(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 BC(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),s=n.containerPhrasing(e,r);return o(),i(),s}const $C=Ki(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function zC(e,t,n,r){return(e.children.some(function(s){return $C(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function HC(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Jh.peek=UC;function Jh(e,t,n,r){const i=HC(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=Ji(r.before.charCodeAt(r.before.length-1),u,i);f.inside&&(l=Yr(u)+l.slice(1));const c=l.charCodeAt(l.length-1),h=Ji(r.after.charCodeAt(0),c,i);h.inside&&(l=l.slice(0,-1)+Yr(c));const d=s.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:f.outside},a+l+d}function UC(e,t,n){return n.options.strong||"*"}function jC(e,t,n,r){return n.safe(e.value,r)}function VC(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 WC(e,t,n){const r=(Zh(n)+(n.options.ruleSpaces?" ":"")).repeat(VC(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Xh={blockquote:pC,break:Uh,code:wC,definition:kC,emphasis:jh,hardBreak:Uh,heading:AC,html:Vh,image:Wh,imageReference:qh,inlineCode:Yh,link:Gh,linkReference:Qh,list:PC,listItem:RC,paragraph:BC,root:zC,strong:Jh,text:jC,thematicBreak:WC};function qC(){return{enter:{table:YC,tableData:ep,tableHeader:ep,tableRow:GC},exit:{codeText:QC,table:KC,tableData:Oa,tableHeader:Oa,tableRow:Oa}}}function YC(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 KC(e){this.exit(e),this.data.inTable=void 0}function GC(e){this.enter({type:"tableRow",children:[]},e)}function Oa(e){this.exit(e)}function ep(e){this.enter({type:"tableCell",children:[]},e)}function QC(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,ZC));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function ZC(e,t){return t==="|"?t:e}function JC(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 dC(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=Xh.inlineCode(d,m,p);return p.stack.includes("tableCell")&&(g=g.replace(/\|/g,"\\$&")),g}}function XC(){return{exit:{taskListCheckValueChecked:tp,taskListCheckValueUnchecked:tp,paragraph:tA}}}function eA(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:nA}}}function tp(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function tA(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 nA(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=Xh.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 rA(){return[PE(),nC(),sC(),qC(),XC()]}function iA(e){return{extensions:[FE(),rC(e),aC(),JC(e),eA()]}}const oA={tokenize:fA,partial:!0},np={tokenize:dA,partial:!0},rp={tokenize:hA,partial:!0},ip={tokenize:pA,partial:!0},sA={tokenize:mA,partial:!0},op={name:"wwwAutolink",tokenize:uA,previous:ap},sp={name:"protocolAutolink",tokenize:cA,previous:lp},Gt={name:"emailAutolink",tokenize:lA,previous:up},zt={};function aA(){return{text:zt}}let On=48;for(;On<123;)zt[On]=Gt,On++,On===58?On=65:On===91&&(On=97);zt[43]=Gt,zt[45]=Gt,zt[46]=Gt,zt[95]=Gt,zt[72]=[Gt,sp],zt[104]=[Gt,sp],zt[87]=[Gt,op],zt[119]=[Gt,op];function lA(e,t,n){const r=this;let i,o;return s;function s(c){return!Da(c)||!up.call(r,r.previous)||Ma(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(sA,f,u)(c):c===45||c===95||nt(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&&st(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(c)):n(c)}}function uA(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!ap.call(r,r.previous)||Ma(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(oA,e.attempt(np,e.attempt(rp,o),n),n)(s))}function o(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function cA(e,t,n){const r=this;let i="",o=!1;return s;function s(c){return(c===72||c===104)&&lp.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(st(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||$i(c)||Me(c)||In(c)||zi(c)?n(c):e.attempt(np,e.attempt(rp,f),n)(c)}function f(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(c)}}function fA(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 dA(e,t,n){let r,i,o;return s;function s(u){return u===46||u===95?e.check(ip,l,a)(u):u===null||Me(u)||In(u)||u!==45&&zi(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 hA(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(ip,t,o)(s):s===null||Me(s)||In(s)?t(s):(e.consume(s),i)}function o(s){return s===41&&r++,e.consume(s),i}}function pA(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||Me(a)||In(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||Me(a)||In(a)?t(a):r(a)}function o(a){return st(a)?s(a):n(a)}function s(a){return a===59?(e.consume(a),r):st(a)?(e.consume(a),s):n(a)}}function mA(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return nt(o)?n(o):t(o)}}function ap(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Me(e)}function lp(e){return!st(e)}function up(e){return!(e===47||Da(e))}function Da(e){return e===43||e===45||e===46||e===95||nt(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 gA={tokenize:EA,partial:!0};function yA(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:SA,continuation:{tokenize:kA},exit:xA}},text:{91:{name:"gfmFootnoteCall",tokenize:wA},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:vA,resolveTo:bA}}}}function vA(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 bA(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 wA(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||Me(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 Me(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||Me(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 Me(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),Ee(e,d,"gfmFootnoteDefinitionWhitespace")):n(m)}function d(m){return t(m)}}function kA(e,t,n){return e.check(Hr,t,e.attempt(gA,t,n))}function xA(e){e.exit("gfmFootnoteDefinition")}function EA(e,t,n){const r=this;return Ee(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&&gt(h,h.length,0,Hi(d,s.slice(u+1,l),a)),gt(h,h.length,0,[["exit",c,a],["enter",s[l][1],a],["exit",s[l][1],a],["exit",f,a]]),gt(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=Kn(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=Kn(m);return g._open=!v||v===2&&!!p,g._close=!p||p===2&&!!v,a(m)}}}class AA{constructor(){this.map=[]}add(t,n,r){TA(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 TA(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 IA(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 OA(){return{flow:{null:{name:"table",tokenize:DA,resolveAll:MA}}}}function DA(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 H=O>-1?r.events[O][1].type:null,P=H==="tableHead"||H==="tableRow"?E:l;return P===E&&r.parser.lazy[r.now().line]?n(T):P(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)?Ee(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||Me(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)?Ee(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)?Ee(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)?Ee(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)?Ee(e,I,"whitespace")(T):(e.enter("data"),M(T))}function M(T){return T===null||T===124||Me(T)?(e.exit("data"),I(T)):(e.consume(T),T===92?L:M)}function L(T){return T===92||T===124?(e.consume(T),M):M(T)}}function MA(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 AA;for(;++n<e.length;){const d=e[n],m=d[1];d[0]==="enter"?m.type==="tableHead"?(a=!1,l!==0&&(cp(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=Xi(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=Xi(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=Xi(h,t,o,i,n,c)):s[1]!==0&&(c=Xi(h,t,s,i,n,c)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(s[3]=n)}for(l!==0&&cp(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=IA(t.events,n))}return e}function Xi(e,t,n,r,i,o){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(o.end=Object.assign({},Qn(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const l=Qn(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=Qn(t.events,n[2]),f=Qn(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({},Qn(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function cp(e,t,n,r,i){const o=[],s=Qn(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 Qn(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const NA={name:"tasklistCheck",tokenize:_A};function LA(){return{text:{91:NA}}}function _A(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 Me(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:PA},t,n)(l):n(l)}}function PA(e,t,n){return Ee(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function FA(e){return Fd([aA(),yA(),CA(e),OA(),LA()])}const RA={};function BA(e){const t=this,n=e||RA,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(FA(n)),o.push(rA()),s.push(iA(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"},deliveryStatusLabel:{className:"bpMessageDeliveryStatusLabel"},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 CA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),AA=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),np=e=>{const t=AA(e);return t.charAt(0).toUpperCase()+t.slice(1)},rp=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),TA=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
59
+ */const $A=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),zA=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),fp=e=>{const t=zA(e);return t.charAt(0).toUpperCase()+t.slice(1)},dp=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),HA=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 IA={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 UA={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 OA=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,...IA,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:rp("lucide",i),...!o&&!TA(a)&&{"aria-hidden":"true"},...a},[...s.map(([u,f])=>M.createElement(u,f)),...Array.isArray(o)?o:[o]]));/**
69
+ */const jA=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,...UA,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:dp("lucide",i),...!o&&!HA(a)&&{"aria-hidden":"true"},...a},[...s.map(([u,f])=>D.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=M.forwardRef(({className:r,...i},o)=>M.createElement(OA,{ref:o,iconNode:t,className:rp(`lucide-${CA(np(e))}`,`lucide-${e}`,r),...i}));return n.displayName=np(e),n};/**
74
+ */const ke=(e,t)=>{const n=D.forwardRef(({className:r,...i},o)=>D.createElement(jA,{ref:o,iconNode:t,className:dp(`lucide-${$A(fp(e))}`,`lucide-${e}`,r),...i}));return n.displayName=fp(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 MA=Se("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
79
+ */const VA=ke("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 ip=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 hp=ke("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 DA=Se("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
89
+ */const WA=ke("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 NA=Se("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
94
+ */const qA=ke("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 op=Se("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
99
+ */const pp=ke("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 sp=Se("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
104
+ */const mp=ke("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 _A=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 YA=ke("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 ap=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 gp=ke("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 PA=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 KA=ke("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 LA=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 GA=ke("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 FA=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 QA=ke("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 lp=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 yp=ke("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 RA=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 ZA=ke("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 $A=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 JA=ke("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 up=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 vp=ke("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 BA=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 XA=ke("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 zA=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 eT=ke("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 UA=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 tT=ke("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 HA=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 nT=ke("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 rT=ke("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 VA=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 iT=ke("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 WA=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 oT=ke("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 qA=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 sT=ke("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 YA=Se("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
194
+ */const aT=ke("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 KA=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 lT=ke("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 GA=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 uT=ke("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 QA=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 cT=ke("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 ZA=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 fT=ke("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 JA=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 dT=ke("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 XA=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 hT=ke("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 eT=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 pT=ke("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 cp=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 bp=ke("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 tT=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 mT=ke("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 nT=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 gT=ke("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 fp=Se("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function rT(){const e=this.data();e.micromarkExtensions??(e.micromarkExtensions=[]),e.micromarkExtensions.push({disable:{null:["codeIndented"]}})}const iT=({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(up,{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 p,m;const l=s==null?void 0:s.children[0],u=oT(((m=(p=l==null?void 0:l.properties)==null?void 0:p.className)==null?void 0:m[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(DA,{...t.codeBlockCopyIcon}):x.jsx(RA,{...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(kh,{urlTransform:s=>s.startsWith("tel:")?s:Eh(s),components:o,remarkPlugins:[rT,EA,wE],children:e})},oT=e=>{if(!e)return"";const t=e.match(/language-(\w+)/);return t?t[1]:""},sT={},dp=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:()=>{(sT?"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},aT=e=>e?dp(e):dp;var Da={exports:{}},Na={},Ji={exports:{}},_a={};/**
249
+ */const wp=ke("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function yT(){const e=this.data();e.micromarkExtensions??(e.micromarkExtensions=[]),e.micromarkExtensions.push({disable:{null:["codeIndented"]}})}const vT=({text:e})=>{const{message:{blocks:{text:t}}}=ye,[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})=>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(vp,{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=bT(((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(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(WA,{...t.codeBlockCopyIcon}):x.jsx(ZA,{...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(Nh,{urlTransform:s=>s.startsWith("tel:")?s:Lh(s),components:o,remarkPlugins:[yT,BA,_E],children:e})},bT=e=>{if(!e)return"";const t=e.match(/language-(\w+)/);return t?t[1]:""},wT={},Sp=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:()=>{(wT?"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},ST=e=>e?Sp(e):Sp;var Na={exports:{}},La={},eo={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.`,Rs={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 hp;function lT(){if(hp)return _a;hp=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(),p=r({inst:{value:d,getSnapshot:h}}),m=p[0].inst,g=p[1];return o(function(){m.value=d,m.getSnapshot=h,l(m)&&g({inst:m})},[c,d,h]),i(function(){return l(m)&&g({inst:m}),c(function(){l(m)&&g({inst:m})})},[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={};/**
257
+ */var kp;function kT(){if(kp)return _a;kp=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 _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.`,Rs={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 pp;function uT(){return pp||(pp=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 C=arguments.length,k=new Array(C>1?C-1:0),E=1;E<C;E++)k[E-1]=arguments[E];r("error",w,k)}}function r(w,C,k){{var E=t.ReactDebugCurrentFrame,I=E.getStackAddendum();I!==""&&(C+="%s",k=k.concat([I]));var D=k.map(function(P){return String(P)});D.unshift("Warning: "+C),Function.prototype.apply.call(console[w],console,D)}}function i(w,C){return w===C&&(w!==0||1/w===1/C)||w!==w&&C!==C}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,C,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=C();if(!c){var I=C();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:C}}),P=D[0].inst,T=D[1];return l(function(){P.value=E,P.getSnapshot=C,d(P)&&T({inst:P})},[w,E,C]),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 C=w.getSnapshot,k=w.value;try{var E=C();return!o(k,E)}catch{return!0}}function p(w,C,k){return C()}var m=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",g=!m,v=g?p: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 mp;function gp(){return mp||(mp=1,process.env.NODE_ENV==="production"?Ji.exports=lT():Ji.exports=uT()),Ji.exports}/**
265
+ */var xp;function xT(){return xp||(xp=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 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 M=k.map(function(L){return String(L)});M.unshift("Warning: "+A),Function.prototype.apply.call(console[w],console,M)}}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 M=s({inst:{value:E,getSnapshot:A}}),L=M[0].inst,T=M[1];return l(function(){L.value=E,L.getSnapshot=A,d(L)&&T({inst:L})},[w,E,A]),a(function(){d(L)&&T({inst:L});var O=function(){d(L)&&T({inst:L})};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 Ep;function Cp(){return Ep||(Ep=1,process.env.NODE_ENV==="production"?eo.exports=kT():eo.exports=xT()),eo.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.`,Rs={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 yp;function cT(){if(yp)return Na;yp=1;var e=M,t=gp();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 p=o(null);if(p.current===null){var m={hasValue:!1,value:null};p.current=m}else m=p.current;p=a(function(){function v(E){if(!y){if(y=!0,w=E,E=h(E),d!==void 0&&m.hasValue){var I=m.value;if(d(I,E))return C=I}return C=E}if(I=C,r(w,E))return I;var D=h(E);return d!==void 0&&d(I,D)?I:(w=E,C=D)}var y=!1,w,C,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,p[0],p[1]);return s(function(){m.hasValue=!0,m.value=g},[g]),l(g),g},Na}var La={};/**
273
+ */var Ap;function ET(){if(Ap)return La;Ap=1;var e=D,t=Cp();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 La.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 M=h(E);return d!==void 0&&d(I,M)?I:(w=E,A=M)}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},La}var Fa={};/**
274
274
  * @license React
275
275
  * use-sync-external-store-shim/with-selector.development.js
276
276
  *
@@ -278,54 +278,54 @@ Please start a new conversation.`,Rs={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 vp;function fT(){return vp||(vp=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=gp();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,p){var m=o(null),g;m.current===null?(g={hasValue:!1,value:null},m.current=g):g=m.current;var v=a(function(){var k=!1,E,I,D=function(U){if(!k){k=!0,E=U;var L=d(U);if(p!==void 0&&g.hasValue){var F=g.value;if(p(F,L))return I=F,F}return I=L,L}var R=E,N=I;if(r(R,U))return N;var j=d(U);return p!==void 0&&p(N,j)?N:(E=U,I=j,j)},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,p]),y=v[0],w=v[1],C=i(f,y,w);return s(function(){g.hasValue=!0,g.value=C},[C]),l(C),C}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=cT():Da.exports=fT();var dT=Da.exports;const hT=vn(dT),bp={},{useSyncExternalStoreWithSelector:pT}=hT;let wp=!1;function mT(e,t=e.getState,n){(bp?"production":void 0)!=="production"&&n&&!wp&&(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"),wp=!0);const r=pT(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return M.useDebugValue(r),r}const gT=e=>{(bp?"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"?aT(e):e,n=(r,i)=>mT(t,r,i);return Object.assign(n,t),n},ln=e=>gT,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()])):{}},yT=(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}=yT(a,u,l);let h=!0;i.setState=(m,g,v)=>{const y=n(m,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=(...m)=>{const g=h;h=!1,n(...m),h=g},p=e(i.setState,r,i);if(c.type==="untracked"?f==null||f.init(p):(c.stores[c.store]=i,f==null||f.init(Object.fromEntries(Object.entries(c.stores).map(([m,g])=>[m,m===c.store?p:g.getState()])))),i.dispatchFromDevtools&&typeof i.dispatch=="function"){let m=!1;const g=i.dispatch;i.dispatch=(...v)=>{(Xi?"production":void 0)!=="production"&&v[0].type==="__setState"&&!m&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),m=!0),g(...v)}}return f.subscribe(m=>{var g;switch(m.type){case"ACTION":if(typeof m.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return Ra(m.payload,v=>{if(v.type==="__setState"){if(a===void 0){d(v.state);return}Object.keys(v.state).length!==1&&console.error(`
281
+ */var Tp;function CT(){return Tp||(Tp=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=Cp();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,M=function(H){if(!k){k=!0,E=H;var P=d(H);if(m!==void 0&&g.hasValue){var F=g.value;if(m(F,P))return I=F,F}return I=P,P}var _=E,z=I;if(r(_,H))return z;var $=d(H);return m!==void 0&&m(z,$)?z:(E=H,I=$,$)},L=h===void 0?null:h,T=function(){return M(c())},O=L===null?void 0:function(){return M(L())};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}Fa.useSyncExternalStoreWithSelector=u,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Fa}process.env.NODE_ENV==="production"?Na.exports=ET():Na.exports=CT();var AT=Na.exports;const TT=bn(AT),Ip={},{useSyncExternalStoreWithSelector:IT}=TT;let Op=!1;function OT(e,t=e.getState,n){(Ip?"production":void 0)!=="production"&&n&&!Op&&(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"),Op=!0);const r=IT(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return D.useDebugValue(r),r}const DT=e=>{(Ip?"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"?ST(e):e,n=(r,i)=>OT(t,r,i);return Object.assign(n,t),n},un=e=>DT,to={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},Ra=new Map,no=e=>{const t=Ra.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=Ra.get(n.name);if(r)return{type:"tracked",store:e,...r};const i={connection:t.connect(n),stores:{}};return Ra.set(n.name,i),{type:"tracked",store:e,...i}},Zn=(e,t={})=>(n,r,i)=>{const{enabled:o,anonymousActionType:s,store:a,...l}=t;let u;try{u=(o??(to?"production":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!u)return(to?"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}`},{...no(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)=>{(to?"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 Ba(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 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(m.payload.type){case"RESET":return d(p),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(m.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(m.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}=m.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}}),p},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)}}}},vT=(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 p;const m=()=>{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 p=o.merge(y,(w=r())!=null?w:d),n(p,!0),c()}).then(()=>{v==null||v(p,void 0),s=!0,l.forEach(y=>y(p))}).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:()=>m(),hasHydrated:()=>s,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(l.add(g),()=>{l.delete(g)})},m(),p||d},bT=(e,t)=>(n,r,i)=>{let o={storage:to(()=>localStorage),partialize:m=>m,version:0,merge:(m,g)=>({...g,...m}),...t},s=!1;const a=new Set,l=new Set;let u=o.storage;if(!u)return e((...m)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...m)},r,i);const f=()=>{const m=o.partialize({...r()});return u.setItem(o.name,{state:m,version:o.version})},c=i.setState;i.setState=(m,g)=>{c(m,g),f()};const h=e((...m)=>{n(...m),f()},r,i);let d;const p=()=>{var m,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,(m=r())!=null?m: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:m=>{o={...o,...m},m.storage&&(u=m.storage)},clearStorage:()=>{u==null||u.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>p(),hasHydrated:()=>s,onHydrate:m=>(a.add(m),()=>{a.delete(m)}),onFinishHydration:m=>(l.add(m),()=>{l.delete(m)})},o.skipHydration||p(),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."),vT(e,t)):bT(e,t),wT=(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={},Sp=(e,t,n)=>{const i=`${t||"bp-webchat"}-message-history-${e}`;return $a[i]||($a[i]=wT(i,n)),$a[i]},ST=e=>ln()(Gn(t=>({messages:[],setMessages:n=>t({messages:n}),saveMessage:n=>t(({messages:r})=>({messages:xp(r,n)})),saveMessages:n=>{n.length&&t(({messages:r})=>({messages:n.reduce(xp,r)}))},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}));function xp(e,t){var i;const n=(i=t.metadata)==null?void 0:i.clientMessageId;let r=-1;return n&&(r=e.findIndex(o=>{var s;return((s=o.metadata)==null?void 0:s.clientMessageId)===n})),r===-1&&(r=e.findIndex(o=>o.id===t.id)),r!==-1?[...e.slice(0,r),{...e[r],...t},...e.slice(r+1)]:[...e,t]}const Ba={},za=e=>{const t=`messages-${e}`;return Ba[t]||(Ba[t]=ST(t)),Ba[t]},xT=(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)}))),Ua={},kp=(e="bp-webchat",t)=>{const n=`${e}-client`;return Ua[n]||(Ua[n]=xT(n,t)),Ua[n]},Qn=ln()(Gn(e=>({eventEmitter:ic(),messageContainerRef:M.createRef(),setMessageContainerRef:t=>e({messageContainerRef:t}),portalContainer:null,setPortalContainer:t=>e({portalContainer:t})}),{name:"webchatStore"})),kT=8,ET=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===kT)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=Pw(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:p}=await i(c);n().upsertFile({fileId:p,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={},Ep=(e,t)=>{const r=`${t||"bp-webchat"}-composer-files-${e}`;return Ha[r]||(Ha[r]=ET(r)),Ha[r]},CT=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})),ja={},Va=e=>{const t=`participants-${e}`;return ja[t]||(ja[t]=CT(t)),ja[t]},AT=e=>ln()(Gn(no((t,n)=>({soundOn:!0,setSoundEnabled:r=>t({soundOn:r}),toggleSound:()=>t({soundOn:!n().soundOn})}),{name:e}))),Wa={},Cp=(e="bp-webchat")=>{const t=`${e}-sound`;return Wa[t]||(Wa[t]=AT(t)),Wa[t]},TT=({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,p]=M.useState(!1),{message:{blocks:{button:m}}}=ye;M.useEffect(()=>{if(r)return l.on(`button-group-${r}-click`,()=>{h(!0),i||p(!0)})},[l,r,i]);const v={...a,onClick:w=>{if((d||s)&&n==="link"){w.preventDefault();return}f(!0),i||p(!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,...m},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})},qa=M.createContext(null);function Ap(){const e=M.useContext(qa);if(!e)throw new Error("useMessageContext must be used within a Message");return e}const Ya=M.createContext({showInputModal:void 0});function Ka(){return M.useContext(Ya)}const Tp=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}=Ka(),{message:{blocks:{bubble:{container:d,feedbackContainer:p,feedbackIcon:m}}}}=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",{...p,children:[x.jsx(ZA,{...m,"data-selected":o==="positive",onClick:()=>u(i,{value:"positive"})}),x.jsx(QA,{...m,"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:IT});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}})})});Tp.displayName="Bubble";const IT=({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)})},Ip=({className:e,...t})=>x.jsx("div",{"data-slot":"skeleton",className:`bpSkeleton ${e||""}`,...t});Ip.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 Op(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 Mp(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 OT(){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 MT(e,t,n){t===void 0&&(t=[]),n===void 0&&(n={loading:!1});var r=M.useRef(0),i=OT(),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 DT(e,t){t===void 0&&(t=[]);var n=MT(e,t,{loading:!0}),r=n[0],i=n[1];return M.useEffect(function(){i()},[i]),r}const Dp=M.forwardRef(({url:e,type:t,orientation:n="auto",...r},i)=>{const o=M.useId(),{setIsLoading:s}=Ap(),[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]),DT(async()=>{if(!e)return;const h=new Image;try{const{width:d,height:p}=await ab(e);n==="auto"&&l(NT(d,p)),h.onload=()=>{f("loaded"),s(m=>m.filter(g=>g!==o))},h.onerror=()=>{f("error"),l("square"),s(m=>m.filter(g=>g!==o))},h.src=e,h.complete&&(h.naturalWidth>0?(f("loaded"),s(m=>m.filter(g=>g!==o))):(f("error"),l("square"),s(m=>m.filter(g=>g!==o))))}catch(d){console.error(d),f("error"),s(p=>p.filter(m=>m!==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(up,{size:"25%",strokeWidth:"5%"})}):u==="initial"?x.jsx(Ip,{"data-orientation":a,...c.placeholder}):x.jsx("img",{"data-orientation":a,"data-loaded":u==="loaded",...r,...c.image,src:e,alt:"",ref:i}):null});Dp.displayName="Image";function NT(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 Np=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})})});Np.displayName="Video";const _p=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})})});_p.displayName="Audio";const Pp=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(jA,{...a.icon})]})});Pp.displayName="Location";const Lp=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))})});Lp.displayName="Column";const Fp=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,p)=>x.jsx(Dn,{block:{...d,direction:r,timestamp:o,sender:i,messageId:a,isReadOnly:l,sendMessage:u}},p))})});Fp.displayName="Row";function _T(e){return Object.prototype.toString.call(e)==="[object Object]"}function Rp(e){return _T(e)||Array.isArray(e)}function PT(){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}`:!Rp(a)||!Rp(l)?a===l:Qa(a,l)})}function $p(e){return e.concat().sort((t,n)=>t.name>n.name?1:-1).map(t=>t.options)}function LT(e,t){if(e.length!==t.length)return!1;const n=$p(e),r=$p(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 Bp(e){return Object.prototype.toString.call(e)==="[object Object]"}function $e(e){return Math.abs(e)}function Xa(e){return Math.sign(e)}function qr(e,t){return $e(e-t)}function FT(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 RT(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 el(e,t){return t===Kr(e)}function zp(e,t=0){return Array.from(Array(e),(n,r)=>t+r)}function Gr(e){return Object.keys(e)}function Up(e,t){return[e,t].reduce((n,r)=>(Gr(r).forEach(i=>{const o=n[i],s=r[i],a=Bp(o)&&Bp(s);n[i]=a?Up(o,s):s}),n),{})}function tl(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function $T(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 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 BT(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&&p()})}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 p(){s=null,a=0}return{init:u,destroy:f,start:h,stop:d,update:n,render:r}}function zT(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(p){const{height:m,width:g}=p;return r?m:g}function f(){return r?"top":n?"right":"left"}function c(){return r?"bottom":n?"left":"right"}function h(p){return p*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 Hp(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 Hp(e,a(),n)}const c={get:a,set:l,add:u,clone:f};return c}function UT(e,t,n,r,i,o,s,a,l,u,f,c,h,d,p,m,g,v,y){const{cross:w,direction:C}=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},U=p?43:25;let L=!1,F=0,R=0,N=!1,j=!1,z=!1,V=!1;function b($){if(!y)return;function te(Oe){(ro(y)||y($,Oe))&&Y(Oe)}const me=t;I.add(me,"dragstart",Oe=>Oe.preventDefault(),E).add(me,"touchmove",()=>{},E).add(me,"touchend",()=>{}).add(me,"touchstart",te).add(me,"mousedown",te).add(me,"touchcancel",X).add(me,"contextmenu",X).add(me,"click",se,!0)}function _(){I.clear(),D.clear()}function B(){const $=V?n:t;D.add($,"touchmove",G,E).add($,"touchend",X).add($,"mousemove",G,E).add($,"mouseup",X)}function S($){const te=$.nodeName||"";return k.includes(te)}function W(){return(p?O:T)[V?"mouse":"touch"]}function J($,te){const me=c.add(Xa($)*-1),Oe=f.byDistance($,!p).distance;return p||$e($)<P?Oe:g&&te?Oe*.5:f.byIndex(me.get(),0).distance}function Y($){const te=tl($,r);V=te,z=p&&te&&!$.buttons&&L,L=qr(i.get(),s.get())>=2,!(te&&$.button!==0)&&(S($.target)||(N=!0,o.pointerDown($),u.useFriction(0).useDuration(0),i.set(s),B(),F=o.readPoint($),R=o.readPoint($,w),h.emit("pointerDown")))}function G($){if(!tl($,r)&&$.touches.length>=2)return X($);const me=o.readPoint($),Oe=o.readPoint($,w),Z=qr(me,F),ue=qr(Oe,R);if(!j&&!V&&(!$.cancelable||(j=Z>ue,!j)))return X($);const de=o.pointerMove($);Z>m&&(z=!0),u.useFriction(.3).useDuration(.75),a.start(),i.add(C(de)),$.preventDefault()}function X($){const me=f.byDistance(0,!1).index!==c.get(),Oe=o.pointerUp($)*W(),Z=J(C(Oe),me),ue=FT(Oe,Z),de=U-10*ue,fe=v+ue/50;j=!1,N=!1,D.clear(),u.useDuration(de).useFriction(fe),l.distance(Z,!p),V=!1,h.emit("pointerUp")}function se($){z&&($.stopPropagation(),$.preventDefault(),z=!1)}function K(){return N}return{init:b,destroy:_,pointerDown:K}}function HT(e,t){let r,i;function o(c){return c.timeStamp}function s(c,h){const p=`client${(h||e.scroll)==="x"?"X":"Y"}`;return(tl(c,t)?c:c.touches[0])[p]}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),p=o(c)-o(i)>170,m=h/d;return d&&!p&&$e(m)>.1?m:0}return{pointerDown:a,pointerMove:l,pointerUp:u,readPoint:s}}function jT(){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 VT(e){function t(r){return e*(r/100)}return{measure:t}}function WT(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 C=w.target===e,k=r.indexOf(w.target),E=C?u:f[k],I=h(C?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 p(){c=!0,l&&l.disconnect()}return{init:d,destroy:p}}function qT(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=Xa(D),c=f,k}function d(){const E=r.get()-t.get();return $e(E)<.001}function p(){return l}function m(){return a}function g(){return s}function v(){return w(i)}function y(){return C(o)}function w(E){return l=E,k}function C(E){return u=E,k}const k={direction:m,duration:p,velocity:g,seek:h,settled:d,useBaseFriction:y,useBaseDuration:v,useFriction:C,useDuration:w};return k}function YT(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 p=e.reachedMin(t.get())?"min":"max",m=$e(e[p]-t.get()),g=n.get()-t.get(),v=a.constrain(m/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 KT(e,t,n,r,i){const o=On(-t+e,0),s=c(),a=f(),l=h();function u(p,m){return qr(p,m)<=1}function f(){const p=s[0],m=Dt(s),g=s.lastIndexOf(p),v=s.indexOf(m)+1;return On(g,v)}function c(){return n.map((p,m)=>{const{min:g,max:v}=o,y=o.constrain(p),w=!m,C=el(n,m);return w?v:C||u(g,y)?g:u(v,y)?v:y}).map(p=>parseFloat(p.toFixed(3)))}function h(){if(t<=e+i)return[o.max];if(r==="keepSnaps")return s;const{min:p,max:m}=a;return s.slice(p,m)}return{snapsContained:l,scrollContainLimit:a}}function GT(e,t,n){const r=t[0],i=n?r-e:Dt(t);return{limit:On(i,r)}}function QT(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(p=>p.add(d))}return{loop:f}}function ZT(e){const{max:t,length:n}=e;function r(o){const s=o-t;return n?s/-n:0}return{get:r}}function JT(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(m=>Dt(m)[s]-m[0][o]).map($e)}function h(){return r.map(m=>n[o]-m[o]).map(m=>-$e(m))}function d(){return a(u).map(m=>m[0]).map((m,g)=>m+l[g])}return{snaps:u,snapsAligned:f}}function XT(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((p,m,g)=>{const v=!m,y=el(g,m);if(v){const w=Dt(g[0])+1;return zp(w)}if(y){const w=Kr(o)-Dt(g)[0]+1;return zp(w,Dt(g)[0])}return p})}return{slideRegistry:u}}function eI(e,t,n,r,i){const{reachedAny:o,removeOffset:s,constrain:a}=r;function l(p){return p.concat().sort((m,g)=>$e(m)-$e(g))[0]}function u(p){const m=e?s(p):a(p),g=t.map((y,w)=>({diff:f(y-m,0),index:w})).sort((y,w)=>$e(y.diff)-$e(w.diff)),{index:v}=g[0];return{index:v,distance:m}}function f(p,m){const g=[p,p+n,p-n];if(!e)return p;if(!m)return l(g);const v=g.filter(y=>Xa(y)===m);return v.length?l(v):Dt(g)-n}function c(p,m){const g=t[p]-i.get(),v=f(g,m);return{index:p,distance:v}}function h(p,m){const g=i.get()+p,{index:v,distance:y}=u(g),w=!e&&o(g);if(!m||w)return{index:v,distance:p};const C=t[v]-y,k=p+f(C,0);return{index:v,distance:k}}return{byDistance:h,byIndex:c,shortcut:f}}function tI(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),p=i.byIndex(d.get(),h);a(p)}return{distance:l,index:u}}function nI(e,t,n,r,i,o,s,a){const l={passive:!0,capture:!0};let u=0;function f(d){if(!a)return;function p(m){if(new Date().getTime()-u>10)return;s.emit("slideFocusStart"),e.scrollLeft=0;const y=n.findIndex(w=>w.includes(m));Za(y)&&(i.useDuration(0),r.index(y,0),s.emit("slideFocus"))}o.add(document,"keydown",c,!1),t.forEach((m,g)=>{o.add(m,"focus",v=>{(ro(a)||a(d,v))&&p(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 Za(l)?l:l.get()}return{get:n,set:r,add:i,subtract:o}}function jp(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=RT(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 rI(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 p(I,D){return I.reduce((P,T)=>d(P,D)>0?P.concat([T]):P,[])}function m(I){return o.map((D,P)=>({start:D-r[P]+.5+I,end:D+t-.5+I}))}function g(I,D,P){const T=m(D);return I.map(O=>{const U=P?0:-n,L=P?n:0,F=P?"end":"start",R=T[O][F];return{index:O,loopPoint:R,slideLocation:Zr(-1),translate:jp(e,l[O]),target:()=>a.get()>R?U:L}})}function v(){const I=s[0],D=p(c,I);return g(D,n,!1)}function y(){const I=t-s[0]-1,D=p(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 C(){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:C,loopPoints:h}}function iI(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 oI(e,t,n,r){const i={};let o=null,s=null,a,l=!1;function u(){a=new IntersectionObserver(p=>{l||(p.forEach(m=>{const g=t.indexOf(m.target);i[g]=m}),o=null,s=null,n.emit("slidesInView"))},{root:e.parentElement,threshold:r}),t.forEach(p=>a.observe(p))}function f(){a&&a.disconnect(),l=!0}function c(p){return Gr(i).reduce((m,g)=>{const v=parseInt(g),{isIntersecting:y}=i[v];return(p&&y||!p&&!y)&&m.push(v),m},[])}function h(p=!0){if(p&&o)return o;if(!p&&s)return s;const m=c(p);return p&&(o=m),p||(s=m),m}return{init:u,destroy:f,get:h}}function sI(e,t,n,r,i,o){const{measureSize:s,startEdge:a,endEdge:l}=e,u=n[0]&&i,f=p(),c=m(),h=n.map(s),d=g();function p(){if(!u)return 0;const y=n[0];return $e(t[a]-y[a])}function m(){if(!u)return 0;const y=o.getComputedStyle(Dt(r));return parseFloat(y.getPropertyValue(`margin-${l}`))}function g(){return n.map((y,w,C)=>{const k=!w,E=el(C,w);return k?h[w]+f:E?h[w]+c:C[w+1][a]-y[a]}).map($e)}return{slideSizes:h,slideSizesWithGaps:d,startGap:f,endGap:c}}function aI(e,t,n,r,i,o,s,a,l){const{startEdge:u,endEdge:f,direction:c}=e,h=Za(n);function d(v,y){return Yr(v).filter(w=>w%y===0).map(w=>v.slice(w,w+y))}function p(v){return v.length?Yr(v).reduce((y,w,C)=>{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,U=$e(P-O-(D+T));return C&&U>t+l&&y.push(w),I&&y.push(v.length),y},[]).map((y,w,C)=>{const k=Math.max(C[w-1]||0);return v.slice(k,y)}):[]}function m(v){return h?d(v,n):p(v)}return{groupSlides:m}}function lI(e,t,n,r,i,o,s){const{align:a,axis:l,direction:u,startIndex:f,loop:c,duration:h,dragFree:d,dragThreshold:p,inViewThreshold:m,slidesToScroll:g,skipSnaps:v,containScroll:y,watchResize:w,watchSlides:C,watchDrag:k,watchFocus:E}=o,I=2,D=jT(),P=D.measure(t),T=n.map(D.measure),O=zT(l,u),U=O.measureSize(P),L=VT(U),F=$T(a,U),R=!c&&!!y,N=c||!!y,{slideSizes:j,slideSizesWithGaps:z,startGap:V,endGap:b}=sI(O,P,T,n,N,i),_=aI(O,U,g,c,P,T,V,b,I),{snaps:B,snapsAligned:S}=JT(O,F,P,T,_),W=-Dt(B)+Dt(z),{snapsContained:J,scrollContainLimit:Y}=KT(U,W,S,y,I),G=R?J:S,{limit:X}=GT(W,G,c),se=Hp(Kr(G),f,c),K=se.clone(),ne=Yr(n),$=({dragHandler:he,scrollBody:je,scrollBounds:Ge,options:{loop:Ze}})=>{Ze||Ge.constrain(he.pointerDown()),je.seek()},te=({scrollBody:he,translate:je,location:Ge,offsetLocation:Ze,previousLocation:Et,scrollLooper:Rt,slideLooper:Qe,dragHandler:Ct,animation:at,eventHandler:es,scrollBounds:SP,options:{loop:$v}},Bv)=>{const zv=he.settled(),xP=!SP.shouldConstrain(),Uv=$v?zv:zv&&xP,Hv=Uv&&!Ct.pointerDown();Hv&&at.stop();const kP=Ge.get()*Bv+Et.get()*(1-Bv);Ze.set(kP),$v&&(Rt.loop(he.direction()),Qe.loop()),je.to(Ze.get()),Hv&&es.emit("settle"),Uv||es.emit("scroll")},me=BT(r,i,()=>$(le),he=>te(le,he)),Oe=.68,Z=G[se.get()],ue=Zr(Z),de=Zr(Z),fe=Zr(Z),Ae=Zr(Z),Fe=qT(ue,fe,de,Ae,h,Oe),Me=eI(c,G,W,X,Ae),He=tI(me,se,K,Fe,Me,Ae,s),ee=ZT(X),ae=Qr(),H=oI(t,n,s,m),{slideRegistry:q}=XT(R,y,G,Y,_,ne),oe=nI(e,n,q,He,Fe,ae,s,E),le={ownerDocument:r,ownerWindow:i,eventHandler:s,containerRect:P,slideRects:T,animation:me,axis:O,dragHandler:UT(O,e,r,i,Ae,HT(O,i),ue,me,He,Fe,Me,se,s,L,d,p,v,Oe,k),eventStore:ae,percentOfView:L,index:se,indexPrevious:K,limit:X,location:ue,offsetLocation:fe,previousLocation:de,options:o,resizeHandler:WT(t,s,i,n,O,w,D),scrollBody:Fe,scrollBounds:YT(X,fe,Ae,Fe,L),scrollLooper:QT(W,X,fe,[ue,fe,de,Ae]),scrollProgress:ee,scrollSnapList:G.map(ee.get),scrollSnaps:G,scrollTarget:Me,scrollTo:He,slideLooper:rI(O,U,W,j,z,B,G,fe,n),slideFocus:oe,slidesHandler:iI(t,s,C),slidesInView:H,slideIndexes:ne,slideRegistry:q,slidesToScroll:_,target:Ae,translate:jp(O,t)};return le}function uI(){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 cI={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 fI(e){function t(o,s){return Up(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 dI(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=fI(i),s=dI(o),a=Qr(),l=uI(),{mergeOptions:u,optionsAtMedia:f,optionsMediaQueries:c}=o,{on:h,off:d,emit:p}=l,m=O;let g=!1,v,y=u(cI,io.globalOptions),w=u(y),C=[],k,E,I;function D(){const{container:ne,slides:$}=w;E=(Ja(ne)?e.querySelector(ne):ne)||e.children[0];const me=Ja($)?E.querySelectorAll($):$;I=[].slice.call(me||E.children)}function P(ne){const $=lI(e,E,I,r,i,ne,l);if(ne.loop&&!$.slideLooper.canLoop()){const te=Object.assign({},ne,{loop:!1});return P(te)}return $}function T(ne,$){g||(y=u(y,ne),w=f(y),C=$||C,D(),v=P(w),c([y,...C.map(({options:te})=>te)]).forEach(te=>a.add(te,"change",O)),w.active&&(v.translate.to(v.location.get()),v.animation.init(),v.slidesInView.init(),v.slideFocus.init(K),v.eventHandler.init(K),v.resizeHandler.init(K),v.slidesHandler.init(K),v.options.loop&&v.slideLooper.loop(),E.offsetParent&&I.length&&v.dragHandler.init(K),k=s.init(K,C)))}function O(ne,$){const te=_();U(),T(u({startIndex:te},ne),$),l.emit("reInit")}function U(){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(),U(),l.emit("destroy"),l.clear())}function F(ne,$,te){!w.active||g||(v.scrollBody.useBaseFriction().useDuration($===!0?0:w.duration),v.scrollTo.index(ne,te||0))}function R(ne){const $=v.index.add(1).get();F($,ne,-1)}function N(ne){const $=v.index.add(-1).get();F($,ne,1)}function j(){return v.index.add(1).get()!==_()}function z(){return v.index.add(-1).get()!==_()}function V(){return v.scrollSnapList}function b(){return v.scrollProgress.get(v.offsetLocation.get())}function _(){return v.index.get()}function B(){return v.indexPrevious.get()}function S(){return v.slidesInView.get()}function W(){return v.slidesInView.get(!1)}function J(){return k}function Y(){return v}function G(){return e}function X(){return E}function se(){return I}const K={canScrollNext:j,canScrollPrev:z,containerNode:X,internalEngine:Y,destroy:L,off:d,on:h,emit:p,plugins:J,previousScrollSnap:B,reInit:m,rootNode:G,scrollNext:R,scrollPrev:N,scrollProgress:b,scrollSnapList:V,scrollTo:F,selectedScrollSnap:_,slideNodes:se,slidesInView:S,slidesNotInView:W};return T(t,n),setTimeout(()=>l.emit("init"),0),K}io.globalOptions=void 0;function nl(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(()=>{Qa(n.current,e)||(n.current=e,l())},[e,l]),M.useEffect(()=>{LT(r.current,t)||(r.current=t,l())},[t,l]),M.useEffect(()=>{if(PT()&&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 Vp=M.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]=M.useState(!0),[h,d]=M.useState(!0),p=M.useCallback(()=>u==null?void 0:u.scrollPrev(),[u]),m=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(op,{...g==null?void 0:g.backButton,"data-disabled":f?"":void 0,onClick:p}),x.jsx(sp,{...g==null?void 0:g.nextButton,"data-disabled":h?"":void 0,onClick:m})]})]})});Vp.displayName="Carousel";const Wp=Math.floor;function qp(e){return Yp(e)?(e.nodeName||"").toLowerCase():"#document"}function Jr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function hI(e){var t;return(t=(Yp(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Yp(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 rl(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Jr(e).ShadowRoot}function pI(e){return["html","body","#document"].includes(qp(e))}function mI(e){return Jr(e).getComputedStyle(e)}function gI(e){if(qp(e)==="html")return e;const t=e.assignedSlot||e.parentNode||rl(e)&&e.host||hI(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 Kp(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function yI(){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 Gp(e){if(e.mozInputSource===0&&e.isTrusted)return!0;const t=/Android/i;return(t.test(Kp())||t.test(yI()))&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Qp(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 Zp(){return/apple/i.test(navigator.vendor)}function vI(){return Kp().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Jp(e,t){return["mouse","pen"].includes(e)}function bI(e){return"nativeEvent"in e}function wI(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 Xp(e){return"composedPath"in e?e.composedPath()[0]:e.target}const SI="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function em(e){return Xn(e)&&e.matches(SI)}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 tm(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 ol(e){return e.split("-")[1]}function nm(e){return e==="x"?"y":"x"}function xI(e){return e==="y"?"height":"width"}const kI=new Set(["top","bottom"]);function ei(e){return kI.has(Xr(e))?"y":"x"}function EI(e){return nm(ei(e))}function CI(e){return{top:0,right:0,bottom:0,left:0,...e}}function AI(e){return typeof e!="number"?CI(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 rm(e,t,n){let{reference:r,floating:i}=e;const o=ei(t),s=EI(t),a=xI(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(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 TI=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}=rm(u,r,l),h=r,d={},p=0;for(let m=0;m<a.length;m++){const{name:g,fn:v}=a[m],{x:y,y:w,data:C,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],...C}},k&&p<=50&&(p++,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}=rm(u,h,l)),m=-1)}return{x:f,y:c,placement:h,strategy:i,middlewareData:d}};async function im(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),p=AI(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)),C=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+p.top)/C.y,bottom:(k.bottom-v.bottom+p.bottom)/C.y,left:(v.left-k.left+p.left)/C.x,right:(k.right-v.right+p.right)/C.x}}const II=new Set(["left","top"]);async function OI(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=ol(n),l=ei(n)==="y",u=II.has(s)?-1:1,f=o&&l?-1:1,c=ao(t,e);let{mainAxis:h,crossAxis:d,alignmentAxis:p}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:c.mainAxis||0,crossAxis:c.crossAxis||0,alignmentAxis:c.alignmentAxis};return a&&typeof p=="number"&&(d=a==="end"?p*-1:p),l?{x:d*f,y:h*u}:{x:h*u,y:d*f}}const MI=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 OI(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}}}}},DI=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 im(t,l),c=ei(Xr(i)),h=nm(c);let d=u[h],p=u[c];if(o){const g=h==="y"?"top":"left",v=h==="y"?"bottom":"right",y=d+f[g],w=d-f[v];d=tm(y,d,w)}if(s){const g=c==="y"?"top":"left",v=c==="y"?"bottom":"right",y=p+f[g],w=p-f[v];p=tm(y,p,w)}const m=a.fn({...t,[h]:d,[c]:p});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[h]:o,[c]:s}}}}}},NI=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 im(t,u),c=Xr(i),h=ol(i),d=ei(i)==="y",{width:p,height:m}=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=m-f.top-f.bottom,w=p-f.left-f.right,C=er(m-f[g],y),k=er(p-f[v],w),E=!t.middlewareData.shift;let I=C,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),U=gt(f.top,0),L=gt(f.bottom,0);d?D=p-2*(T!==0||O!==0?T+O:gt(f.left,f.right)):I=m-2*(U!==0||L!==0?U+L:gt(f.top,f.bottom))}await l({...t,availableWidth:D,availableHeight:I});const P=await s.getDimensions(a.floating);return p!==P.width||m!==P.height?{reset:{rects:!0}}:{}}}};function uo(){return typeof window<"u"}function tr(e){return om(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=(om(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function om(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 sm(e){return!uo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof yt(e).ShadowRoot}const _I=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)&&!_I.has(i)}const PI=new Set(["table","td","th"]);function LI(e){return PI.has(tr(e))}const FI=[":popover-open",":modal"];function co(e){return FI.some(t=>{try{return e.matches(t)}catch{return!1}})}const RI=["transform","translate","scale","rotate","perspective"],$I=["transform","translate","scale","rotate","perspective","filter"],BI=["paint","layout","strict","content"];function sl(e){const t=al(),n=_t(e)?Pt(e):e;return RI.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)||$I.some(r=>(n.willChange||"").includes(r))||BI.some(r=>(n.contain||"").includes(r))}function zI(e){let t=cn(e);for(;Ht(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 UI=new Set(["html","body","#document"]);function nr(e){return UI.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||sm(e)&&e.host||Ut(e);return sm(t)?t.host:t}function am(e){const t=cn(e);return nr(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ht(t)&&ti(t)?t:am(t)}function fn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=am(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||[],ti(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 lm(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 ul(e){return _t(e)?e:e.contextElement}function rr(e){const t=ul(e);if(!Ht(t))return zt(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=lm(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 HI=zt(0);function um(e){const t=yt(e);return!al()||!t.visualViewport?HI:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function jI(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=jI(o,n,r)?um(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 p=h,m=ll(p);for(;m&&r&&d!==p;){const g=rr(m),v=m.getBoundingClientRect(),y=Pt(m),w=v.left+(m.clientLeft+parseFloat(y.paddingLeft))*g.x,C=v.top+(m.clientTop+parseFloat(y.paddingTop))*g.y;l*=g.x,u*=g.y,f*=g.x,c*=g.y,l+=w,u+=C,p=yt(m),m=ll(p)}}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 cm(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 VI(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?cm(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 WI(e){return Array.from(e.getClientRects())}function qI(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 fm=25;function YI(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,p=Math.abs(r.clientWidth-c.clientWidth-d);p<=fm&&(o-=p)}else u<=fm&&(o+=u);return{width:o,height:s,x:a,y:l}}const KI=new Set(["absolute","fixed"]);function GI(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 dm(e,t,n){let r;if(t==="viewport")r=YI(e,n);else if(t==="document")r=qI(Ut(e));else if(_t(t))r=GI(t,n);else{const i=um(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return lo(r)}function hm(e,t){const n=cn(e);return n===t||!_t(n)||nr(n)?!1:Pt(n).position==="fixed"||hm(n,t)}function QI(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&&KI.has(i.position)||ti(s)&&!l&&hm(e,s))?r=r.filter(f=>f!==s):i=a,s=cn(s)}return t.set(e,r),r}function ZI(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?co(t)?[]:QI(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((u,f)=>{const c=dm(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},dm(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function JI(e){const{width:t,height:n}=lm(e);return{width:t,height:n}}function XI(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?cm(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 pm(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 mm(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)&&!cl(i))return i;i=cn(i)}return n}let r=pm(e,t);for(;r&&LI(r)&&cl(r);)r=pm(r,t);return r&&nr(r)&&cl(r)&&!sl(r)?n:r||zI(e)||n}const eO=async function(e){const t=this.getOffsetParent||mm,n=this.getDimensions,r=await n(e.floating);return{reference:XI(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function tO(e){return Pt(e).direction==="rtl"}const nO={convertOffsetParentRelativeRectToViewportRelativeRect:VI,getDocumentElement:Ut,getClippingRect:ZI,getOffsetParent:mm,getElementRects:eO,getClientRects:WI,getDimensions:JI,getScale:rr,isElement:_t,isRTL:tO};function gm(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function rO(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 p=so(c),m=so(i.clientWidth-(f+h)),g=so(i.clientHeight-(c+d)),v=so(f),w={rootMargin:-p+"px "+-m+"px "+-g+"px "+-v+"px",threshold:gt(0,er(1,l))||1};let C=!0;function k(E){const I=E[0].intersectionRatio;if(I!==l){if(!C)return s();I?s(!1,I):r=setTimeout(()=>{s(!1,1e-7)},1e3)}I===1&&!gm(u,e.getBoundingClientRect())&&s(),C=!1}try{n=new IntersectionObserver(k,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(k,w)}n.observe(e)}return s(!0),o}function iO(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(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),o&&v.addEventListener("resize",n)});const c=u&&a?rO(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 p,m=l?Mn(e):null;l&&g();function g(){const v=Mn(e);m&&!gm(m,v)&&n(),m=v,p=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(p)}}const oO=MI,sO=DI,aO=NI,lO=(e,t,n)=>{const r=new Map,i={platform:nO,...n},o={...i.platform,_c:r};return TI(e,t,{...i,platform:o})};var uO=typeof document<"u",cO=function(){},po=uO?M.useLayoutEffect:cO;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 ym(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function vm(e,t){const n=ym(e);return Math.round(t*n)/n}function fl(e){const t=A.useRef(e);return po(()=>{t.current=e}),t}function fO(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[p,m]=A.useState(null),[g,v]=A.useState(null),y=A.useCallback(z=>{z!==E.current&&(E.current=z,m(z))},[]),w=A.useCallback(z=>{z!==I.current&&(I.current=z,v(z))},[]),C=o||p,k=s||g,E=A.useRef(null),I=A.useRef(null),D=A.useRef(f),P=l!=null,T=fl(l),O=fl(i),U=fl(u),L=A.useCallback(()=>{if(!E.current||!I.current)return;const z={placement:t,strategy:n,middleware:h};O.current&&(z.platform=O.current),lO(E.current,I.current,z).then(V=>{const b={...V,isPositioned:U.current!==!1};F.current&&!mo(D.current,b)&&(D.current=b,zu.flushSync(()=>{c(b)}))})},[h,t,n,O,U]);po(()=>{u===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,c(z=>({...z,isPositioned:!1})))},[u]);const F=A.useRef(!1);po(()=>(F.current=!0,()=>{F.current=!1}),[]),po(()=>{if(C&&(E.current=C),k&&(I.current=k),C&&k){if(T.current)return T.current(C,k,L);L()}},[C,k,L,T,P]);const R=A.useMemo(()=>({reference:E,floating:I,setReference:y,setFloating:w}),[y,w]),N=A.useMemo(()=>({reference:C,floating:k}),[C,k]),j=A.useMemo(()=>{const z={position:n,left:0,top:0};if(!N.floating)return z;const V=vm(N.floating,f.x),b=vm(N.floating,f.y);return a?{...z,transform:"translate("+V+"px, "+b+"px)",...ym(N.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:b}},[n,a,N.floating,f.x,f.y]);return A.useMemo(()=>({...f,update:L,refs:R,elements:N,floatingStyles:j}),[f,L,R,N,j])}const dO=(e,t)=>({...oO(e),options:[e,t]}),hO=(e,t)=>({...sO(e),options:[e,t]}),pO=(e,t)=>({...aO(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(no(l.name));case"COMMIT":if(a===void 0){f==null||f.init(i.getState());return}return f==null?void 0:f.init(no(l.name));case"ROLLBACK":return Ba(p.state,v=>{if(a===void 0){d(v),f==null||f.init(i.getState());return}d(v[a]),f==null||f.init(no(l.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return Ba(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},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 ro(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 Kr=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Kr(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Kr(r)(n)}}}},NT=(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=Kr(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 Kr(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},LT=(e,t)=>(n,r,i)=>{let o={storage:ro(()=>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 Kr(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},io=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?((to?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),NT(e,t)):LT(e,t),_T=(e,t)=>un()(Zn(io(n=>({messageHistory:[],addMessageToHistory:r=>n(i=>({...i,messageHistory:[r,...(i.messageHistory??[]).slice(0,100).filter(String)]})),clearHistory:()=>n(()=>({messageHistory:[]}))}),{name:e,storage:ro(()=>t==="sessionStorage"?sessionStorage:localStorage)}))),$a={},Dp=(e,t,n)=>{const i=`${t||"bp-webchat"}-message-history-${e}`;return $a[i]||($a[i]=_T(i,n)),$a[i]},PT=e=>un()(Zn(t=>({messages:[],setMessages:n=>t({messages:n}),saveMessage:n=>t(({messages:r})=>({messages:Mp(r,n)})),saveMessages:n=>{n.length&&t(({messages:r})=>({messages:n.reduce(Mp,r)}))},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}));function Mp(e,t){var i;const n=(i=t.metadata)==null?void 0:i.clientMessageId;let r=-1;return n&&(r=e.findIndex(o=>{var s;return((s=o.metadata)==null?void 0:s.clientMessageId)===n})),r===-1&&(r=e.findIndex(o=>o.id===t.id)),r!==-1?[...e.slice(0,r),{...e[r],...t},...e.slice(r+1)]:[...e,t]}const za={},Ha=e=>{const t=`messages-${e}`;return za[t]||(za[t]=PT(t)),za[t]},FT=(e,t)=>un()(Zn(io(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:ro(()=>t==="sessionStorage"?sessionStorage:localStorage)}))),Ua={},Np=(e="bp-webchat",t)=>{const n=`${e}-client`;return Ua[n]||(Ua[n]=FT(n,t)),Ua[n]},Jn=un()(Zn(e=>({eventEmitter:hc(),messageContainerRef:D.createRef(),setMessageContainerRef:t=>e({messageContainerRef:t}),portalContainer:null,setPortalContainer:t=>e({portalContainer:t})}),{name:"webchatStore"})),RT=8,BT=e=>un()(io((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===RT)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=K0(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:ro(()=>sessionStorage)})),ja={},Lp=(e,t)=>{const r=`${t||"bp-webchat"}-composer-files-${e}`;return ja[r]||(ja[r]=BT(r)),ja[r]},$T=e=>un()(Zn(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={},Wa=e=>{const t=`participants-${e}`;return Va[t]||(Va[t]=$T(t)),Va[t]},zT=e=>un()(Zn(io((t,n)=>({soundOn:!0,setSoundEnabled:r=>t({soundOn:r}),toggleSound:()=>t({soundOn:!n().soundOn})}),{name:e}))),qa={},_p=(e="bp-webchat")=>{const t=`${e}-sound`;return qa[t]||(qa[t]=zT(t)),qa[t]},HT=({text:e,buttonValue:t,variant:n,groupId:r,reusable:i,sendMessage:o,isReadOnly:s,...a})=>{const l=Jn(w=>w.eventEmitter),[u,f]=D.useState(!1),[c,h]=D.useState(!1),[d,m]=D.useState(!1),{message:{blocks:{button:p}}}=ye;D.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})},Ya=D.createContext(null);function Pp(){const e=D.useContext(Ya);if(!e)throw new Error("useMessageContext must be used within a Message");return e}const Ka=D.createContext({showInputModal:void 0});function Ga(){return D.useContext(Ka)}const Fp=D.createContext(Rn),Rp=Fp.Provider;function Ye(){return D.useContext(Fp)}const Bp=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}=Ga(),d=Ye(),{message:{blocks:{bubble:{container:m,feedbackContainer:p,feedbackIcon:g}}}}=ye;return t=="incoming"?x.jsxs("div",{"data-direction":"incoming","data-feedback":!!o,...f,...m,ref:c,children:[x.jsx(Nn,{block:{...e,direction:t,timestamp:r,sender:n,messageId:i,isReadOnly:a,metadata:s,sendMessage:l}}),u&&h&&e.type==="text"&&x.jsxs("div",{...p,children:[x.jsx(fT,{...g,"data-selected":o==="positive",onClick:()=>u(i,{value:"positive"})}),x.jsx(cT,{...g,"data-selected":o==="negative",onClick:async()=>{const v=await h({title:d["feedback.title"],description:d["feedback.description"],confirmButtonText:d["feedback.confirm"],cancelButtonText:d["feedback.cancel"],Content:UT});u(i,{value:"negative",comment:v})}})]})]}):x.jsx("div",{"data-direction":"outgoing",...f,...m,ref:c,children:x.jsx(Nn,{block:{...e,direction:t,timestamp:r,sender:n,messageId:i,isReadOnly:a,metadata:s,sendMessage:l,addMessageFeedback:u}})})});Bp.displayName="Bubble";const UT=({setValue:e})=>{const{modal:{dialog:{content:t}}}=ye,n=Ye();return x.jsx("textarea",{...t.textarea,placeholder:n["feedback.placeholder"],onChange:r=>e(r.target.value)})},$p=({className:e,...t})=>x.jsx("div",{"data-slot":"skeleton",className:`bpSkeleton ${e||""}`,...t});$p.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 zp(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 Xn(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 er(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 Hp(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 Qa(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 jT(){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 VT(e,t,n){t===void 0&&(t=[]),n===void 0&&(n={loading:!1});var r=D.useRef(0),i=jT(),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 WT(e,t){t===void 0&&(t=[]);var n=VT(e,t,{loading:!0}),r=n[0],i=n[1];return D.useEffect(function(){i()},[i]),r}const Up=D.forwardRef(({url:e,type:t,orientation:n="auto",...r},i)=>{const o=D.useId(),{setIsLoading:s}=Pp(),[a,l]=D.useState(n==="auto"?"square":n),[u,f]=D.useState("initial"),{message:{blocks:{image:c}}}=ye;return D.useLayoutEffect(()=>(s(h=>[...h,o]),()=>{s(h=>h.filter(d=>d!==o))}),[o,s]),WT(async()=>{if(!e)return;const h=new Image;try{const{width:d,height:m}=await bb(e);n==="auto"&&l(qT(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(vp,{size:"25%",strokeWidth:"5%"})}):u==="initial"?x.jsx($p,{"data-orientation":a,...c.placeholder}):x.jsx("img",{"data-orientation":a,"data-loaded":u==="loaded",...r,...c.image,src:e,alt:"",ref:i}):null});Up.displayName="Image";function qT(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 jp=D.forwardRef(({url:e,isReadOnly:t,...n},r)=>{const{message:{blocks:{video:i}}}=ye,o=t?s=>{s.stopPropagation(),s.preventDefault()}:void 0;return x.jsx("div",{children:x.jsx("video",{...n,"data-chromatic":"ignore",controls:!0,onClick:o,src:e,...i,ref:r})})});jp.displayName="Video";const Vp=D.forwardRef(({url:e,isReadOnly:t,...n},r)=>{const{message:{blocks:{audio:i}}}=ye,o=t?s=>{s.stopPropagation(),s.preventDefault()}:void 0;return x.jsx("div",{children:x.jsx("audio",{...n,controls:!0,onClick:o,src:e,...i,ref:r})})});Vp.displayName="Audio";const Wp=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}}}=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(rT,{...a.icon})]})});Wp.displayName="Location";const qp=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}}}=ye;return x.jsx("div",{"data-horizontal":t,"data-vertical":n,...u,...c,ref:f,children:e.map((h,d)=>x.jsx(Nn,{block:{...h,direction:r,timestamp:o,sender:i,messageId:s,isReadOnly:a,sendMessage:l}},d))})});qp.displayName="Column";const Yp=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}}}=ye;return x.jsx("div",{"data-horizontal":t,"data-vertical":n,...f,...h,ref:c,children:e.map((d,m)=>x.jsx(Nn,{block:{...d,direction:r,timestamp:o,sender:i,messageId:a,isReadOnly:l,sendMessage:u}},m))})});Yp.displayName="Row";function YT(e){return Object.prototype.toString.call(e)==="[object Object]"}function Kp(e){return YT(e)||Array.isArray(e)}function KT(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Za(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}`:!Kp(a)||!Kp(l)?a===l:Za(a,l)})}function Gp(e){return e.concat().sort((t,n)=>t.name>n.name?1:-1).map(t=>t.options)}function GT(e,t){if(e.length!==t.length)return!1;const n=Gp(e),r=Gp(t);return n.every((i,o)=>{const s=r[o];return Za(i,s)})}function Ja(e){return typeof e=="number"}function Xa(e){return typeof e=="string"}function oo(e){return typeof e=="boolean"}function Qp(e){return Object.prototype.toString.call(e)==="[object Object]"}function Be(e){return Math.abs(e)}function el(e){return Math.sign(e)}function Gr(e,t){return Be(e-t)}function QT(e,t){if(e===0||t===0||Be(e)<=Be(t))return 0;const n=Gr(Be(e),Be(t));return Be(n/e)}function ZT(e){return Math.round(e*100)/100}function Qr(e){return Jr(e).map(Number)}function Nt(e){return e[Zr(e)]}function Zr(e){return Math.max(0,e.length-1)}function tl(e,t){return t===Zr(e)}function Zp(e,t=0){return Array.from(Array(e),(n,r)=>t+r)}function Jr(e){return Object.keys(e)}function Jp(e,t){return[e,t].reduce((n,r)=>(Jr(r).forEach(i=>{const o=n[i],s=r[i],a=Qp(o)&&Qp(s);n[i]=a?Jp(o,s):s}),n),{})}function nl(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function JT(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 Xa(e)?n[e](l):e(t,l,u)}return{measure:s}}function Xr(){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 XT(e,t,n,r){const i=Xr(),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 eI(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 Dn(e=0,t=0){const n=Be(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 Xp(e,t,n){const{constrain:r}=Dn(0,e),i=e+1;let o=s(t);function s(h){return n?Be((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 Xp(e,a(),n)}const c={get:a,set:l,add:u,clone:f};return c}function tI(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=Xr(),M=Xr(),L=Dn(50,225).constrain(d.measure(20)),T={mouse:300,touch:400},O={mouse:500,touch:600},H=m?43:25;let P=!1,F=0,_=0,z=!1,$=!1,U=!1,W=!1;function b(B){if(!y)return;function ne(we){(oo(y)||y(B,we))&&Y(we)}const me=t;I.add(me,"dragstart",we=>we.preventDefault(),E).add(me,"touchmove",()=>{},E).add(me,"touchend",()=>{}).add(me,"touchstart",ne).add(me,"mousedown",ne).add(me,"touchcancel",J).add(me,"contextmenu",J).add(me,"click",se,!0)}function N(){I.clear(),M.clear()}function R(){const B=W?n:t;M.add(B,"touchmove",G,E).add(B,"touchend",J).add(B,"mousemove",G,E).add(B,"mouseup",J)}function S(B){const ne=B.nodeName||"";return k.includes(ne)}function V(){return(m?O:T)[W?"mouse":"touch"]}function ee(B,ne){const me=c.add(el(B)*-1),we=f.byDistance(B,!m).distance;return m||Be(B)<L?we:g&&ne?we*.5:f.byIndex(me.get(),0).distance}function Y(B){const ne=nl(B,r);W=ne,U=m&&ne&&!B.buttons&&P,P=Gr(i.get(),s.get())>=2,!(ne&&B.button!==0)&&(S(B.target)||(z=!0,o.pointerDown(B),u.useFriction(0).useDuration(0),i.set(s),R(),F=o.readPoint(B),_=o.readPoint(B,w),h.emit("pointerDown")))}function G(B){if(!nl(B,r)&&B.touches.length>=2)return J(B);const me=o.readPoint(B),we=o.readPoint(B,w),Q=Gr(me,F),ue=Gr(we,_);if(!$&&!W&&(!B.cancelable||($=Q>ue,!$)))return J(B);const de=o.pointerMove(B);Q>p&&(U=!0),u.useFriction(.3).useDuration(.75),a.start(),i.add(A(de)),B.preventDefault()}function J(B){const me=f.byDistance(0,!1).index!==c.get(),we=o.pointerUp(B)*V(),Q=ee(A(we),me),ue=QT(we,Q),de=H-10*ue,fe=v+ue/50;$=!1,z=!1,M.clear(),u.useDuration(de).useFriction(fe),l.distance(Q,!m),W=!1,h.emit("pointerUp")}function se(B){U&&(B.stopPropagation(),B.preventDefault(),U=!1)}function K(){return z}return{init:b,destroy:N,pointerDown:K}}function nI(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(nl(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&&Be(p)>.1?p:0}return{pointerDown:a,pointerMove:l,pointerUp:u,readPoint:s}}function rI(){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 iI(e){function t(r){return e*(r/100)}return{measure:t}}function oI(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(Be(I-E)>=.5){g.reInit(),t.emit("resize");break}}}l=new ResizeObserver(y=>{(oo(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 sI(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 M=0;return I?(s=0,n.set(r),e.set(r),M=E):(n.set(e),s+=E/l,s*=u,f+=s,e.add(s),M=f-c),a=el(M),c=f,k}function d(){const E=r.get()-t.get();return Be(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 aI(e,t,n,r,i){const o=i.measure(10),s=i.measure(50),a=Dn(.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=Be(e[m]-t.get()),g=n.get()-t.get(),v=a.constrain(p/s);n.subtract(g*v),!d&&Be(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 lI(e,t,n,r,i){const o=Dn(-t+e,0),s=c(),a=f(),l=h();function u(m,p){return Gr(m,p)<=1}function f(){const m=s[0],p=Nt(s),g=s.lastIndexOf(m),v=s.indexOf(p)+1;return Dn(g,v)}function c(){return n.map((m,p)=>{const{min:g,max:v}=o,y=o.constrain(m),w=!p,A=tl(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 uI(e,t,n){const r=t[0],i=n?r-e:Nt(t);return{limit:Dn(i,r)}}function cI(e,t,n,r){const o=t.min+.1,s=t.max+.1,{reachedMin:a,reachedMax:l}=Dn(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 fI(e){const{max:t,length:n}=e;function r(o){const s=o-t;return n?s/-n:0}return{get:r}}function dI(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=>Nt(p)[s]-p[0][o]).map(Be)}function h(){return r.map(p=>n[o]-p[o]).map(p=>-Be(p))}function d(){return a(u).map(p=>p[0]).map((p,g)=>p+l[g])}return{snaps:u,snapsAligned:f}}function hI(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=tl(g,p);if(v){const w=Nt(g[0])+1;return Zp(w)}if(y){const w=Zr(o)-Nt(g)[0]+1;return Zp(w,Nt(g)[0])}return m})}return{slideRegistry:u}}function pI(e,t,n,r,i){const{reachedAny:o,removeOffset:s,constrain:a}=r;function l(m){return m.concat().sort((p,g)=>Be(p)-Be(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)=>Be(y.diff)-Be(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=>el(y)===p);return v.length?l(v):Nt(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 mI(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 gI(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));Ja(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=>{(oo(a)||a(d,v))&&m(g)},l)})}function c(d){d.code==="Tab"&&(u=new Date().getTime())}return{init:f}}function ei(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 Ja(l)?l:l.get()}return{get:n,set:r,add:i,subtract:o}}function em(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=ZT(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 yI(e,t,n,r,i,o,s,a,l){const f=Qr(i),c=Qr(i).reverse(),h=v().concat(y());function d(I,M){return I.reduce((L,T)=>L-i[T],M)}function m(I,M){return I.reduce((L,T)=>d(L,M)>0?L.concat([T]):L,[])}function p(I){return o.map((M,L)=>({start:M-r[L]+.5+I,end:M+t-.5+I}))}function g(I,M,L){const T=p(M);return I.map(O=>{const H=L?0:-n,P=L?n:0,F=L?"end":"start",_=T[O][F];return{index:O,loopPoint:_,slideLocation:ei(-1),translate:em(e,l[O]),target:()=>a.get()>_?H:P}})}function v(){const I=s[0],M=m(c,I);return g(M,n,!1)}function y(){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(L=>L!==I);return d(M,t)<=.1})}function A(){h.forEach(I=>{const{target:M,translate:L,slideLocation:T}=I,O=M();O!==T.get()&&(L.to(O),T.set(O))})}function k(){h.forEach(I=>I.translate.clear())}return{canLoop:w,clear:k,loop:A,loopPoints:h}}function vI(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||(oo(n)||n(l,f))&&u(f)}),r.observe(e,{childList:!0})}function s(){r&&r.disconnect(),i=!0}return{init:o,destroy:s}}function bI(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 Jr(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 wI(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 Be(t[a]-y[a])}function p(){if(!u)return 0;const y=o.getComputedStyle(Nt(r));return parseFloat(y.getPropertyValue(`margin-${l}`))}function g(){return n.map((y,w,A)=>{const k=!w,E=tl(A,w);return k?h[w]+f:E?h[w]+c:A[w+1][a]-y[a]}).map(Be)}return{slideSizes:h,slideSizesWithGaps:d,startGap:f,endGap:c}}function SI(e,t,n,r,i,o,s,a,l){const{startEdge:u,endEdge:f,direction:c}=e,h=Ja(n);function d(v,y){return Qr(v).filter(w=>w%y===0).map(w=>v.slice(w,w+y))}function m(v){return v.length?Qr(v).reduce((y,w,A)=>{const k=Nt(y)||0,E=k===0,I=w===Zr(v),M=i[u]-o[k][u],L=i[u]-o[w][f],T=!r&&E?c(s):0,O=!r&&I?c(a):0,H=Be(L-O-(M+T));return A&&H>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 kI(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,M=rI(),L=M.measure(t),T=n.map(M.measure),O=eI(l,u),H=O.measureSize(L),P=iI(H),F=JT(a,H),_=!c&&!!y,z=c||!!y,{slideSizes:$,slideSizesWithGaps:U,startGap:W,endGap:b}=wI(O,L,T,n,z,i),N=SI(O,H,g,c,L,T,W,b,I),{snaps:R,snapsAligned:S}=dI(O,F,L,T,N),V=-Nt(R)+Nt(U),{snapsContained:ee,scrollContainLimit:Y}=lI(H,V,S,y,I),G=_?ee:S,{limit:J}=uI(V,G,c),se=Xp(Zr(G),f,c),K=se.clone(),re=Qr(n),B=({dragHandler:he,scrollBody:je,scrollBounds:Qe,options:{loop:Je}})=>{Je||Qe.constrain(he.pointerDown()),je.seek()},ne=({scrollBody:he,translate:je,location:Qe,offsetLocation:Je,previousLocation:Ct,scrollLooper:Bt,slideLooper:Ze,dragHandler:At,animation:lt,eventHandler:ts,scrollBounds:F2,options:{loop:Qv}},Zv)=>{const Jv=he.settled(),R2=!F2.shouldConstrain(),Xv=Qv?Jv:Jv&&R2,eb=Xv&&!At.pointerDown();eb&&lt.stop();const B2=Qe.get()*Zv+Ct.get()*(1-Zv);Je.set(B2),Qv&&(Bt.loop(he.direction()),Ze.loop()),je.to(Je.get()),eb&&ts.emit("settle"),Xv||ts.emit("scroll")},me=XT(r,i,()=>B(le),he=>ne(le,he)),we=.68,Q=G[se.get()],ue=ei(Q),de=ei(Q),fe=ei(Q),Te=ei(Q),Fe=sI(ue,fe,de,Te,h,we),De=pI(c,G,V,J,Te),Ue=mI(me,se,K,Fe,De,Te,s),te=fI(J),ae=Xr(),j=bI(t,n,s,p),{slideRegistry:q}=hI(_,y,G,Y,N,re),oe=gI(e,n,q,Ue,Fe,ae,s,E),le={ownerDocument:r,ownerWindow:i,eventHandler:s,containerRect:L,slideRects:T,animation:me,axis:O,dragHandler:tI(O,e,r,i,Te,nI(O,i),ue,me,Ue,Fe,De,se,s,P,d,m,v,we,k),eventStore:ae,percentOfView:P,index:se,indexPrevious:K,limit:J,location:ue,offsetLocation:fe,previousLocation:de,options:o,resizeHandler:oI(t,s,i,n,O,w,M),scrollBody:Fe,scrollBounds:aI(J,fe,Te,Fe,P),scrollLooper:cI(V,J,fe,[ue,fe,de,Te]),scrollProgress:te,scrollSnapList:G.map(te.get),scrollSnaps:G,scrollTarget:De,scrollTo:Ue,slideLooper:yI(O,H,V,$,U,R,G,fe,n),slideFocus:oe,slidesHandler:vI(t,s,A),slidesInView:j,slideIndexes:re,slideRegistry:q,slidesToScroll:N,target:Te,translate:em(O,t)};return le}function xI(){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 EI={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 CI(e){function t(o,s){return Jp(o,s||{})}function n(o){const s=o.breakpoints||{},a=Jr(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=>Jr(s.breakpoints||{})).reduce((s,a)=>s.concat(a),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:n,optionsMediaQueries:r}}function AI(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 so(e,t,n){const r=e.ownerDocument,i=r.defaultView,o=CI(i),s=AI(o),a=Xr(),l=xI(),{mergeOptions:u,optionsAtMedia:f,optionsMediaQueries:c}=o,{on:h,off:d,emit:m}=l,p=O;let g=!1,v,y=u(EI,so.globalOptions),w=u(y),A=[],k,E,I;function M(){const{container:re,slides:B}=w;E=(Xa(re)?e.querySelector(re):re)||e.children[0];const me=Xa(B)?E.querySelectorAll(B):B;I=[].slice.call(me||E.children)}function L(re){const B=kI(e,E,I,r,i,re,l);if(re.loop&&!B.slideLooper.canLoop()){const ne=Object.assign({},re,{loop:!1});return L(ne)}return B}function T(re,B){g||(y=u(y,re),w=f(y),A=B||A,M(),v=L(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(K),v.eventHandler.init(K),v.resizeHandler.init(K),v.slidesHandler.init(K),v.options.loop&&v.slideLooper.loop(),E.offsetParent&&I.length&&v.dragHandler.init(K),k=s.init(K,A)))}function O(re,B){const ne=N();H(),T(u({startIndex:ne},re),B),l.emit("reInit")}function H(){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 P(){g||(g=!0,a.clear(),H(),l.emit("destroy"),l.clear())}function F(re,B,ne){!w.active||g||(v.scrollBody.useBaseFriction().useDuration(B===!0?0:w.duration),v.scrollTo.index(re,ne||0))}function _(re){const B=v.index.add(1).get();F(B,re,-1)}function z(re){const B=v.index.add(-1).get();F(B,re,1)}function $(){return v.index.add(1).get()!==N()}function U(){return v.index.add(-1).get()!==N()}function W(){return v.scrollSnapList}function b(){return v.scrollProgress.get(v.offsetLocation.get())}function N(){return v.index.get()}function R(){return v.indexPrevious.get()}function S(){return v.slidesInView.get()}function V(){return v.slidesInView.get(!1)}function ee(){return k}function Y(){return v}function G(){return e}function J(){return E}function se(){return I}const K={canScrollNext:$,canScrollPrev:U,containerNode:J,internalEngine:Y,destroy:P,off:d,on:h,emit:m,plugins:ee,previousScrollSnap:R,reInit:p,rootNode:G,scrollNext:_,scrollPrev:z,scrollProgress:b,scrollSnapList:W,scrollTo:F,selectedScrollSnap:N,slideNodes:se,slidesInView:S,slidesNotInView:V};return T(t,n),setTimeout(()=>l.emit("init"),0),K}so.globalOptions=void 0;function rl(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(()=>{Za(n.current,e)||(n.current=e,l())},[e,l]),D.useEffect(()=>{GT(r.current,t)||(r.current=t,l())},[t,l]),D.useEffect(()=>{if(KT()&&s){so.globalOptions=rl.globalOptions;const u=so(s,n.current,r.current);return o(u),()=>u.destroy()}else o(void 0)},[s,o]),[a,i]}rl.globalOptions=void 0;const tm=D.forwardRef(({blocks:e,direction:t,sender:n,timestamp:r,messageId:i,isReadOnly:o,sendMessage:s},a)=>{const[l,u]=rl({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}}}=ye,v=D.useCallback(y=>{c(!(y!=null&&y.canScrollPrev())),d(!(y!=null&&y.canScrollNext()))},[]);return D.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(Nn,{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(pp,{...g==null?void 0:g.backButton,"data-disabled":f?"":void 0,onClick:m}),x.jsx(mp,{...g==null?void 0:g.nextButton,"data-disabled":h?"":void 0,onClick:p})]})]})});tm.displayName="Carousel";const nm=Math.floor;function rm(e){return im(e)?(e.nodeName||"").toLowerCase():"#document"}function ti(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function TI(e){var t;return(t=(im(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function im(e){return e instanceof Node||e instanceof ti(e).Node}function Et(e){return e instanceof Element||e instanceof ti(e).Element}function tr(e){return e instanceof HTMLElement||e instanceof ti(e).HTMLElement}function il(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ti(e).ShadowRoot}function II(e){return["html","body","#document"].includes(rm(e))}function OI(e){return ti(e).getComputedStyle(e)}function DI(e){if(rm(e)==="html")return e;const t=e.assignedSlot||e.parentNode||il(e)&&e.host||TI(e);return il(t)?t.host:t}function cn(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 dt(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&il(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function om(){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 sm(e){if(e.mozInputSource===0&&e.isTrusted)return!0;const t=/Android/i;return(t.test(om())||t.test(MI()))&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function am(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 lm(){return/apple/i.test(navigator.vendor)}function NI(){return om().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function um(e,t){return["mouse","pen"].includes(e)}function LI(e){return"nativeEvent"in e}function _I(e){return e.matches("html,body")}function Lt(e){return(e==null?void 0:e.ownerDocument)||document}function ol(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 cm(e){return"composedPath"in e?e.composedPath()[0]:e.target}const PI="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function fm(e){return tr(e)&&e.matches(PI)}function Xe(e){e.preventDefault(),e.stopPropagation()}const nr=Math.min,yt=Math.max,ao=Math.round,lo=Math.floor,Ht=e=>({x:e,y:e});function dm(e,t,n){return yt(e,nr(t,n))}function uo(e,t){return typeof e=="function"?e(t):e}function ni(e){return e.split("-")[0]}function sl(e){return e.split("-")[1]}function hm(e){return e==="x"?"y":"x"}function FI(e){return e==="y"?"height":"width"}const RI=new Set(["top","bottom"]);function ri(e){return RI.has(ni(e))?"y":"x"}function BI(e){return hm(ri(e))}function $I(e){return{top:0,right:0,bottom:0,left:0,...e}}function zI(e){return typeof e!="number"?$I(e):{top:e,right:e,bottom:e,left:e}}function co(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 pm(e,t,n){let{reference:r,floating:i}=e;const o=ri(t),s=BI(t),a=FI(s),l=ni(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(sl(t)){case"start":d[s]-=h*(n&&u?-1:1);break;case"end":d[s]+=h*(n&&u?-1:1);break}return d}const HI=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}=pm(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}=pm(u,h,l)),p=-1)}return{x:f,y:c,placement:h,strategy:i,middlewareData:d}};async function mm(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}=uo(t,e),m=zI(d),g=a[h?c==="floating"?"reference":"floating":c],v=co(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=co(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 UI=new Set(["left","top"]);async function jI(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=ni(n),a=sl(n),l=ri(n)==="y",u=UI.has(s)?-1:1,f=o&&l?-1:1,c=uo(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 VI=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 jI(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}}}}},WI=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}=uo(e,t),u={x:n,y:r},f=await mm(t,l),c=ri(ni(i)),h=hm(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=dm(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=dm(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}}}}}},qI=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}=uo(e,t),f=await mm(t,u),c=ni(i),h=sl(i),d=ri(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=nr(p-f[g],y),k=nr(m-f[v],w),E=!t.middlewareData.shift;let I=A,M=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(I=y),E&&!h){const T=yt(f.left,0),O=yt(f.right,0),H=yt(f.top,0),P=yt(f.bottom,0);d?M=m-2*(T!==0||O!==0?T+O:yt(f.left,f.right)):I=p-2*(H!==0||P!==0?H+P:yt(f.top,f.bottom))}await l({...t,availableWidth:M,availableHeight:I});const L=await s.getDimensions(a.floating);return m!==L.width||p!==L.height?{reset:{rects:!0}}:{}}}};function fo(){return typeof window<"u"}function rr(e){return gm(e)?(e.nodeName||"").toLowerCase():"#document"}function vt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ut(e){var t;return(t=(gm(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function gm(e){return fo()?e instanceof Node||e instanceof vt(e).Node:!1}function _t(e){return fo()?e instanceof Element||e instanceof vt(e).Element:!1}function jt(e){return fo()?e instanceof HTMLElement||e instanceof vt(e).HTMLElement:!1}function ym(e){return!fo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof vt(e).ShadowRoot}const YI=new Set(["inline","contents"]);function ii(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Pt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!YI.has(i)}const KI=new Set(["table","td","th"]);function GI(e){return KI.has(rr(e))}const QI=[":popover-open",":modal"];function ho(e){return QI.some(t=>{try{return e.matches(t)}catch{return!1}})}const ZI=["transform","translate","scale","rotate","perspective"],JI=["transform","translate","scale","rotate","perspective","filter"],XI=["paint","layout","strict","content"];function al(e){const t=ll(),n=_t(e)?Pt(e):e;return ZI.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)||JI.some(r=>(n.willChange||"").includes(r))||XI.some(r=>(n.contain||"").includes(r))}function eO(e){let t=fn(e);for(;jt(t)&&!ir(t);){if(al(t))return t;if(ho(t))return null;t=fn(t)}return null}function ll(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const tO=new Set(["html","body","#document"]);function ir(e){return tO.has(rr(e))}function Pt(e){return vt(e).getComputedStyle(e)}function po(e){return _t(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function fn(e){if(rr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ym(e)&&e.host||Ut(e);return ym(t)?t.host:t}function vm(e){const t=fn(e);return ir(t)?e.ownerDocument?e.ownerDocument.body:e.body:jt(t)&&ii(t)?t:vm(t)}function dn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=vm(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=vt(i);if(o){const a=ul(s);return t.concat(s,s.visualViewport||[],ii(i)?i:[],a&&n?dn(a):[])}return t.concat(i,dn(i,[],n))}function ul(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function bm(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=ao(n)!==o||ao(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function cl(e){return _t(e)?e:e.contextElement}function or(e){const t=cl(e);if(!jt(t))return Ht(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=bm(t);let s=(o?ao(n.width):n.width)/r,a=(o?ao(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const nO=Ht(0);function wm(e){const t=vt(e);return!ll()||!t.visualViewport?nO:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function rO(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==vt(e)?!1:t}function Mn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=cl(e);let s=Ht(1);t&&(r?_t(r)&&(s=or(r)):s=or(e));const a=rO(o,n,r)?wm(o):Ht(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=vt(o),d=r&&_t(r)?vt(r):r;let m=h,p=ul(m);for(;p&&r&&d!==m;){const g=or(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=vt(p),p=ul(m)}}return co({width:f,height:c,x:l,y:u})}function mo(e,t){const n=po(e).scrollLeft;return t?t.left+n:Mn(Ut(e)).left+n}function Sm(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-mo(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function iO(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",s=Ut(r),a=t?ho(t.floating):!1;if(r===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},u=Ht(1);const f=Ht(0),c=jt(r);if((c||!c&&!o)&&((rr(r)!=="body"||ii(s))&&(l=po(r)),jt(r))){const d=Mn(r);u=or(r),f.x=d.x+r.clientLeft,f.y=d.y+r.clientTop}const h=s&&!c&&!o?Sm(s,l):Ht(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 oO(e){return Array.from(e.getClientRects())}function sO(e){const t=Ut(e),n=po(e),r=e.ownerDocument.body,i=yt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=yt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+mo(e);const a=-n.scrollTop;return Pt(r).direction==="rtl"&&(s+=yt(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}const km=25;function aO(e,t){const n=vt(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=ll();(!f||f&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const u=mo(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<=km&&(o-=m)}else u<=km&&(o+=u);return{width:o,height:s,x:a,y:l}}const lO=new Set(["absolute","fixed"]);function uO(e,t){const n=Mn(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=jt(e)?or(e):Ht(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 xm(e,t,n){let r;if(t==="viewport")r=aO(e,n);else if(t==="document")r=sO(Ut(e));else if(_t(t))r=uO(t,n);else{const i=wm(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return co(r)}function Em(e,t){const n=fn(e);return n===t||!_t(n)||ir(n)?!1:Pt(n).position==="fixed"||Em(n,t)}function cO(e,t){const n=t.get(e);if(n)return n;let r=dn(e,[],!1).filter(a=>_t(a)&&rr(a)!=="body"),i=null;const o=Pt(e).position==="fixed";let s=o?fn(e):e;for(;_t(s)&&!ir(s);){const a=Pt(s),l=al(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&lO.has(i.position)||ii(s)&&!l&&Em(e,s))?r=r.filter(f=>f!==s):i=a,s=fn(s)}return t.set(e,r),r}function fO(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?ho(t)?[]:cO(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((u,f)=>{const c=xm(t,f,i);return u.top=yt(c.top,u.top),u.right=nr(c.right,u.right),u.bottom=nr(c.bottom,u.bottom),u.left=yt(c.left,u.left),u},xm(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function dO(e){const{width:t,height:n}=bm(e);return{width:t,height:n}}function hO(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=Ht(0);function u(){l.x=mo(i)}if(r||!r&&!o)if((rr(t)!=="body"||ii(i))&&(a=po(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?Sm(i,a):Ht(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 fl(e){return Pt(e).position==="static"}function Cm(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 Am(e,t){const n=vt(e);if(ho(e))return n;if(!jt(e)){let i=fn(e);for(;i&&!ir(i);){if(_t(i)&&!fl(i))return i;i=fn(i)}return n}let r=Cm(e,t);for(;r&&GI(r)&&fl(r);)r=Cm(r,t);return r&&ir(r)&&fl(r)&&!al(r)?n:r||eO(e)||n}const pO=async function(e){const t=this.getOffsetParent||Am,n=this.getDimensions,r=await n(e.floating);return{reference:hO(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function mO(e){return Pt(e).direction==="rtl"}const gO={convertOffsetParentRelativeRectToViewportRelativeRect:iO,getDocumentElement:Ut,getClippingRect:fO,getOffsetParent:Am,getElementRects:pO,getClientRects:oO,getDimensions:dO,getScale:or,isElement:_t,isRTL:mO};function Tm(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function yO(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=lo(c),p=lo(i.clientWidth-(f+h)),g=lo(i.clientHeight-(c+d)),v=lo(f),w={rootMargin:-m+"px "+-p+"px "+-g+"px "+-v+"px",threshold:yt(0,nr(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&&!Tm(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 vO(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=cl(e),f=i||o?[...u?dn(u):[],...dn(t)]:[];f.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),o&&v.addEventListener("resize",n)});const c=u&&a?yO(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&&!Tm(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 bO=VI,wO=WI,SO=qI,kO=(e,t,n)=>{const r=new Map,i={platform:gO,...n},o={...i.platform,_c:r};return HI(e,t,{...i,platform:o})};var xO=typeof document<"u",EO=function(){},go=xO?D.useLayoutEffect:EO;function yo(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(!yo(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)&&!yo(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Im(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Om(e,t){const n=Im(e);return Math.round(t*n)/n}function dl(e){const t=C.useRef(e);return go(()=>{t.current=e}),t}function CO(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);yo(h,r)||d(r);const[m,p]=C.useState(null),[g,v]=C.useState(null),y=C.useCallback(U=>{U!==E.current&&(E.current=U,p(U))},[]),w=C.useCallback(U=>{U!==I.current&&(I.current=U,v(U))},[]),A=o||m,k=s||g,E=C.useRef(null),I=C.useRef(null),M=C.useRef(f),L=l!=null,T=dl(l),O=dl(i),H=dl(u),P=C.useCallback(()=>{if(!E.current||!I.current)return;const U={placement:t,strategy:n,middleware:h};O.current&&(U.platform=O.current),kO(E.current,I.current,U).then(W=>{const b={...W,isPositioned:H.current!==!1};F.current&&!yo(M.current,b)&&(M.current=b,Hu.flushSync(()=>{c(b)}))})},[h,t,n,O,H]);go(()=>{u===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,c(U=>({...U,isPositioned:!1})))},[u]);const F=C.useRef(!1);go(()=>(F.current=!0,()=>{F.current=!1}),[]),go(()=>{if(A&&(E.current=A),k&&(I.current=k),A&&k){if(T.current)return T.current(A,k,P);P()}},[A,k,P,T,L]);const _=C.useMemo(()=>({reference:E,floating:I,setReference:y,setFloating:w}),[y,w]),z=C.useMemo(()=>({reference:A,floating:k}),[A,k]),$=C.useMemo(()=>{const U={position:n,left:0,top:0};if(!z.floating)return U;const W=Om(z.floating,f.x),b=Om(z.floating,f.y);return a?{...U,transform:"translate("+W+"px, "+b+"px)",...Im(z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:W,top:b}},[n,a,z.floating,f.x,f.y]);return C.useMemo(()=>({...f,update:P,refs:_,elements:z,floatingStyles:$}),[f,P,_,z,$])}const AO=(e,t)=>({...bO(e),options:[e,t]}),TO=(e,t)=>({...wO(e),options:[e,t]}),IO=(e,t)=>({...SO(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 mO=["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=mO.join(","),bm=typeof Element>"u",ni=bm?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,go=!bm&&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},gO=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},yO=function(t,n,r){if(ri(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(dl));return n&&ni.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(!ri(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=ni.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=!ri(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},wm=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Sm=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||gO(t))&&!wm(t)?0:t.tabIndex},vO=function(t,n){var r=Sm(t);return r<0&&n&&!wm(t)?0:r},bO=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},xm=function(t){return t.tagName==="INPUT"},wO=function(t){return xm(t)&&t.type==="hidden"},SO=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},xO=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},kO=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=xO(i,t.form);return!o||o===t},EO=function(t){return xm(t)&&t.type==="radio"},CO=function(t){return EO(t)&&!kO(t)},AO=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},km=function(t){var n=t.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},TO=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 km(t);t.assignedSlot?t=t.assignedSlot:!u&&f!==t.ownerDocument?t=f.host:t=u}t=l}if(AO(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return km(t);return!1},IO=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},OO=function(t,n){return!(n.disabled||ri(n)||wO(n)||TO(n,t)||SO(n)||IO(n))},Em=function(t,n){return!(CO(n)||Sm(n)<0||!OO(t,n))},MO=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Cm=function(t){var n=[],r=[];return t.forEach(function(i,o){var s=!!i.scopeParent,a=s?i.scopeParent:i,l=vO(a,s),u=s?Cm(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(bO).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:Em.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:MO}):r=yO(t,n.includeContainer,Em.bind(null,n)),Cm(r)};const ml="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 gl(e,t){return nt(e,{disabledIndices:t})}function Am(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 DO(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,p=l-(d-h);d===h?c=l:c=d>h?p:p-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=Wp(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=Wp(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 Tm=0;function Gt(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(Tm);const o=()=>e==null?void 0:e.focus({preventScroll:n});i?o():Tm=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 yl=!1,NO=0;const Im=()=>"floating-ui-"+NO++;function _O(){const[e,t]=A.useState(()=>yl?Im():void 0);return Ye(()=>{e==null&&t(Im())},[]),A.useEffect(()=>{yl||(yl=!0)},[]),e}const vl=A.useId||_O;function PO(){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 LO=A.createContext(null),FO=A.createContext(null),Om=()=>{var e;return((e=A.useContext(LO))==null?void 0:e.id)||null},wo=()=>A.useContext(FO);function si(e){return"data-floating-ui-"+e}function dn(e){const t=M.useRef(e);return Ye(()=>{t.current=e}),t}function RO(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 $O(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 BO=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,Mm=e=>e&&(e.host||Mm(e.parentNode)),zO=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=Mm(n);return e.contains(r)?r:null}).filter(n=>n!=null);function UO(e,t,n,r){const i="data-floating-ui-inert",o=r?"inert":n?"aria-hidden":null,s=zO(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,p=>{if(a.has(p))h(p);else{const m=o?p.getAttribute(o):null,g=m!==null&&m!=="false",v=(sr.get(p)||0)+1,y=(f.get(p)||0)+1;sr.set(p,v),f.set(p,y),u.push(p),v===1&&g&&So.add(p),y===1&&p.setAttribute(i,""),!g&&o&&p.setAttribute(o,"true")}})}return bl++,()=>{u.forEach(d=>{const p=(sr.get(d)||0)-1,m=(f.get(d)||0)-1;sr.set(d,p),f.set(d,m),p||(!So.has(d)&&o&&d.removeAttribute(o),So.delete(d)),m||d.removeAttribute(i)}),bl--,bl||(sr=new WeakMap,sr=new WeakMap,So=new WeakSet,xo={})}}function Dm(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=Nt(e[0]).body;return UO(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 Nm(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 _m(){return Nm(document.body,"next")}function Pm(){return Nm(document.body,"prev")}function ai(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!ft(n,r)}function HO(e){pl(e,wl()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function jO(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 VO;function Lm(e){e.key==="Tab"&&(e.target,clearTimeout(VO))}const ko=A.forwardRef(function(t,n){const[r,i]=A.useState();Ye(()=>(Zp()&&i("button"),document.addEventListener("keydown",Lm),()=>{document.removeEventListener("keydown",Lm)}),[]);const o={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[si("focus-guard")]:"",style:Sl};return A.createElement("span",bo({},t,o))}),Fm=A.createContext(null);function WO(e){let{id:t,root:n}=e===void 0?{}:e;const[r,i]=A.useState(null),o=vl(),s=Rm(),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,p=si("portal");if(d){const m=document.createElement("div");m.id=h,m.setAttribute(p,""),d.appendChild(m),i(m)}else{let m=f||(c==null?void 0:c.portalNode);m&&!kt(m)&&(m=m.current),m=m||document.body;let g=null;u&&(g=document.createElement("div"),g.id=u,m.appendChild(g));const v=document.createElement("div");v.id=h,v.setAttribute(p,""),m=g||m,m.appendChild(v),i(v)}},[a]),r}function qO(e){let{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e;const o=WO({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(p){o&&ai(p)&&(p.type==="focusin"?jO:HO)(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(Fm.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(ai(d,o)){var p;(p=f.current)==null||p.focus()}else{const m=Pm()||(s==null?void 0:s.refs.domReference.current);m==null||m.focus()}}}),h&&o&&A.createElement("span",{"aria-owns":o.id,style:Sl}),o&&$u.createPortal(t,o),h&&o&&A.createElement(ko,{"data-type":"outside",ref:u,onFocus:d=>{if(ai(d,o)){var p;(p=c.current)==null||p.focus()}else{const m=_m()||(s==null?void 0:s.refs.domReference.current);m==null||m.focus(),s!=null&&s.closeOnFocusOut&&(s==null||s.onOpenChange(!1,d.nativeEvent))}}}))}const Rm=()=>A.useContext(Fm),YO=A.forwardRef(function(t,n){return A.createElement("button",bo({},t,{type:"button",ref:n,tabIndex:-1,style:Sl}))});function KO(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:p,events:m,dataRef:g,elements:{domReference:v,floating:y}}=t,w=BO()?o:!0,C=dn(i),k=dn(s),E=dn(a),I=wo(),D=Rm(),P=typeof s=="number"&&s<0,T=A.useRef(null),O=A.useRef(null),U=A.useRef(!1),L=A.useRef(null),F=A.useRef(!1),R=D!=null,N=v&&v.getAttribute("role")==="combobox"&&em(v)&&P,j=A.useCallback(function(_){return _===void 0&&(_=y),_?pl(_,wl()):[]},[y]),z=A.useCallback(_=>{const B=j(_);return C.current.map(S=>v&&S==="reference"?v:y&&S==="floating"?y:B).filter(Boolean).flat()},[v,y,C,j]);A.useEffect(()=>{if(r||!l)return;function _(S){if(S.key==="Tab"){ft(y,un(Nt(y)))&&j().length===0&&!N&&Je(S);const W=z(),J=Xp(S);C.current[0]==="reference"&&J===v&&(Je(S),S.shiftKey?Gt(W[W.length-1]):Gt(W[1])),C.current[1]==="floating"&&J===y&&S.shiftKey&&(Je(S),Gt(W[0]))}}const B=Nt(y);return B.addEventListener("keydown",_),()=>{B.removeEventListener("keydown",_)}},[r,v,y,l,C,h,N,j,z]),A.useEffect(()=>{if(r||!f)return;function _(){F.current=!0,setTimeout(()=>{F.current=!1})}function B(S){const W=S.relatedTarget;queueMicrotask(()=>{const J=!(ft(v,W)||ft(y,W)||ft(W,y)||ft(D==null?void 0:D.portalNode,W)||W!=null&&W.hasAttribute(si("focus-guard"))||I&&(or(I.nodesRef.current,d).find(Y=>{var G,X;return ft((G=Y.context)==null?void 0:G.elements.floating,W)||ft((X=Y.context)==null?void 0:X.elements.domReference,W)})||RO(I.nodesRef.current,d).find(Y=>{var G,X;return((G=Y.context)==null?void 0:G.elements.floating)===W||((X=Y.context)==null?void 0:X.elements.domReference)===W})));W&&J&&!F.current&&W!==L.current&&(U.current=!0,p(!1,S))})}if(y&&Xn(v))return v.addEventListener("focusout",B),v.addEventListener("pointerdown",_),!l&&y.addEventListener("focusout",B),()=>{v.removeEventListener("focusout",B),v.removeEventListener("pointerdown",_),!l&&y.removeEventListener("focusout",B)}},[r,v,y,l,d,I,D,p,f]),A.useEffect(()=>{var _;if(r)return;const B=Array.from((D==null||(_=D.portalNode)==null?void 0:_.querySelectorAll("["+si("portal")+"]"))||[]);if(y){const S=[y,...B,T.current,O.current,C.current.includes("reference")||N?v:null].filter(J=>J!=null),W=l?Dm(S,w,!w):Dm(S);return()=>{W()}}},[r,v,y,l,C,D,N,w]),Ye(()=>{if(r||!y)return;const _=Nt(y),B=un(_);queueMicrotask(()=>{const S=z(y),W=k.current,J=(typeof W=="number"?S[W]:W.current)||y,Y=ft(y,B);!P&&!Y&&c&&Gt(J,{preventScroll:J===y})})},[r,c,y,P,z,k]),Ye(()=>{if(r||!y)return;let _=!1;const B=Nt(y),S=un(B),W=g.current;L.current=S;function J(Y){if(Y.type==="escapeKey"&&h.domReference.current&&(L.current=h.domReference.current),["referencePress","escapeKey"].includes(Y.type))return;const G=Y.data.returnFocus;typeof G=="object"?(U.current=!1,_=G.preventScroll):U.current=!G}return m.on("dismiss",J),()=>{m.off("dismiss",J);const Y=un(B);(ft(y,Y)||I&&or(I.nodesRef.current,d).some(X=>{var se;return ft((se=X.context)==null?void 0:se.elements.floating,Y)})||W.openEvent&&["click","mousedown"].includes(W.openEvent.type))&&h.domReference.current&&(L.current=h.domReference.current),E.current&&Xn(L.current)&&!U.current&&Gt(L.current,{cancelPrevious:!1,preventScroll:_})}},[r,y,E,g,h,m,I,d]),Ye(()=>{if(!(r||!D))return D.setFocusManagerState({modal:l,closeOnFocusOut:f,open:c,onOpenChange:p,refs:h}),()=>{D.setFocusManagerState(null)}},[r,D,l,c,p,h,f]),Ye(()=>{if(!r&&y&&typeof MutationObserver=="function"&&!P){const _=()=>{const S=y.getAttribute("tabindex");C.current.includes("floating")||un(Nt(y))!==h.domReference.current&&j().length===0?S!=="0"&&y.setAttribute("tabindex","0"):S!=="-1"&&y.setAttribute("tabindex","-1")};_();const B=new MutationObserver(_);return B.observe(y,{childList:!0,subtree:!0,attributes:!0}),()=>{B.disconnect()}}},[r,y,h,C,j,P]);function V(_){return r||!u||!l?null:A.createElement(YO,{ref:_==="start"?T:O,onClick:B=>p(!1,B.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: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(U.current=!1,ai(_,D.portalNode)){const S=_m()||v;S==null||S.focus()}else{var B;(B=D.beforeOutsideRef.current)==null||B.focus()}}}),!N&&V("start"),n,V("end"),b&&A.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&&(U.current=!0),ai(_,D.portalNode)){const S=Pm()||v;S==null||S.focus()}else{var B;(B=D.afterOutsideRef.current)==null||B.focus()}}}))}function $m(e){return Xn(e.target)&&e.target.tagName==="BUTTON"}function Bm(e){return em(e)}function GO(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&&(Jp(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}Jp(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||$m(d))&&(d.key===" "&&!Bm(o)&&(d.preventDefault(),h.current=!0),d.key==="Enter"&&r(!(n&&l),d.nativeEvent))},onKeyUp(d){d.defaultPrevented||!f||$m(d)||Bm(o)||d.key===" "&&h.current&&(h.current=!1,r(!(n&&l),d.nativeEvent))}}}:{},[s,i,a,u,f,o,l,n,r])}const QO=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 QO(()=>{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 ZO={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},JO={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},XO=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 eM(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:p=!1,referencePressEvent:m="pointerdown",ancestorScroll:g=!1,bubbles:v}=t,y=wo(),w=Om()!=null,C=hn(typeof h=="function"?h:()=>!1),k=typeof h=="function"?C:h,E=A.useRef(!1),{escapeKeyBubbles:I,outsidePressBubbles:D}=XO(v),P=hn(O=>{if(!n||!f||!c||O.key!=="Escape")return;const U=y?or(y.nodesRef.current,o):[];if(!I&&(O.stopPropagation(),U.length>0)){let L=!0;if(U.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,bI(O)?O.nativeEvent:O)}),T=hn(O=>{const U=E.current;if(E.current=!1,U||typeof k=="function"&&!k(O))return;const L=Xp(O),F="["+si("inert")+"]",R=Nt(l).querySelectorAll(F);let N=kt(L)?L:null;for(;N&&!pI(N);){const V=gI(N);if(V===Nt(l).body||!kt(V))break;N=V}if(R.length&&kt(L)&&!wI(L)&&!ft(L,l)&&Array.from(R).every(V=>!ft(N,V)))return;if(Xn(L)&&l){const V=L.clientWidth>0&&L.scrollWidth>L.clientWidth,b=L.clientHeight>0&&L.scrollHeight>L.clientHeight;let _=b&&O.offsetX>L.clientWidth;if(b&&mI(L).direction==="rtl"&&(_=O.offsetX<=L.offsetWidth-L.clientWidth),_||V&&O.offsetY>L.clientHeight)return}const j=y&&or(y.nodesRef.current,o).some(V=>{var b;return il(O,(b=V.context)==null?void 0:b.elements.floating)});if(il(O,l)||il(O,a)||j)return;const z=y?or(y.nodesRef.current,o):[];if(z.length>0){let V=!0;if(z.forEach(b=>{var _;if((_=b.context)!=null&&_.open&&!b.context.dataRef.current.__outsidePressBubbles){V=!1;return}}),!V)return}i.emit("dismiss",{type:"outsidePress",data:{returnFocus:w?{preventScroll:!0}:Gp(O)||Qp(O)}}),r(!1,O)});return A.useEffect(()=>{if(!n||!f)return;u.current.__escapeKeyBubbles=I,u.current.__outsidePressBubbles=D;function O(F){r(!1,F)}const U=Nt(l);c&&U.addEventListener("keydown",P),k&&U.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=U.defaultView)==null?void 0:R.visualViewport)}),L.forEach(F=>{F.addEventListener("scroll",O,{passive:!0})}),()=>{c&&U.removeEventListener("keydown",P),k&&U.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]),A.useEffect(()=>{E.current=!1},[k,d]),A.useMemo(()=>f?{reference:{onKeyDown:P,[ZO[m]]:O=>{p&&(i.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),r(!1,O.nativeEvent))}},floating:{onKeyDown:P,[JO[d]]:()=>{E.current=!0}}}:{},[f,i,p,d,m,r,P])}let xl;process.env.NODE_ENV!=="production"&&(xl=new Set);function tM(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=fO(e),h=wo(),d=hn((I,D)=>{I&&(m.current.openEvent=D),r==null||r(I,D)}),p=A.useRef(null),m=A.useRef({}),g=A.useState(()=>PO())[0],v=vl(),y=A.useCallback(I=>{const D=kt(I)?{getBoundingClientRect:()=>I.getBoundingClientRect(),contextElement:I}:I;c.refs.setReference(D)},[c.refs]),w=A.useCallback(I=>{(kt(I)||I===null)&&(p.current=I,u(I)),(kt(c.refs.reference.current)||c.refs.reference.current===null||I!==null&&!kt(I))&&c.refs.setReference(I)},[c.refs]),C=A.useMemo(()=>({...c.refs,setReference:w,setPositionReference:y,domReference:p}),[c.refs,w,y]),k=A.useMemo(()=>({...c.elements,domReference:f}),[c.elements,f]),E=A.useMemo(()=>({...c,refs:C,elements:k,dataRef:m,nodeId:i,floatingId:v,events:g,open:n,onOpenChange:d}),[c,i,v,g,n,d,C,k]);return Ye(()=>{const I=h==null?void 0:h.nodesRef.current.find(D=>D.id===i);I&&(I.context=E)}),A.useMemo(()=>({...c,context:E,refs:C,elements:k}),[c,C,k,E])}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(p=>p(...h)).find(p=>p!==void 0)}}}else i[a]=l}),i),{})}}function nM(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 zm=!1;function Eo(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Um(e,t){return Eo(t,e===ml||e===yo,e===ir||e===ii)}function El(e,t,n){return Eo(t,e===yo,n?e===ir:e===ii)||e==="Enter"||e==" "||e===""}function rM(e,t,n){return Eo(t,n?e===ir:e===ii,e===yo)}function Hm(e,t,n){return Eo(t,n?e===ii:e===ir,e===ml)}function iM(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:p=!1,rtl:m=!1,virtual:g=!1,focusItemOnOpen:v="auto",focusItemOnHover:y=!0,openOnArrowKeyDown:w=!0,disabledIndices:C=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=Om(),T=wo(),O=hn(u),U=A.useRef(v),L=A.useRef(c??-1),F=A.useRef(null),R=A.useRef(!0),N=A.useRef(O),j=A.useRef(!!s),z=A.useRef(!1),V=A.useRef(!1),b=dn(C),_=dn(n),B=dn(I),[S,W]=A.useState(),[J,Y]=A.useState(),G=hn(function(K,ne,$){$===void 0&&($=!1);const te=K.current[ne.current];te&&(g?(W(te.id),T==null||T.events.emit("virtualfocus",te),D&&(D.current=te)):Gt(te,{preventScroll:!0,sync:vI()&&Zp()?zm||z.current:!1}),requestAnimationFrame(()=>{const me=B.current;me&&te&&($||!R.current)&&(te.scrollIntoView==null||te.scrollIntoView(typeof me=="boolean"?{block:"nearest",inline:"nearest"}:me))}))});Ye(()=>{document.createElement("div").focus({get preventScroll(){return zm=!0,!1}})},[]),Ye(()=>{f&&(n&&s?U.current&&c!=null&&(V.current=!0,O(c)):j.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(j.current&&(L.current=-1,G(a,L)),!j.current&&U.current&&(F.current!=null||U.current===!0&&F.current==null)){let K=0;const ne=()=>{a.current[0]==null?(K<2&&(K?requestAnimationFrame:queueMicrotask)(ne),K++):(L.current=F.current==null||El(F.current,k,m)||p?gl(a,b.current):Am(a,b.current),F.current=null,O(L.current))};ne()}}else oi(a,l)||(L.current=l,G(a,L,V.current),V.current=!1)},[f,n,s,l,c,p,a,k,m,O,G,b]),Ye(()=>{var K,ne;if(!f||s||!T||g||!j.current)return;const $=T.nodesRef.current,te=(K=$.find(Z=>Z.id===P))==null||(ne=K.context)==null?void 0:ne.elements.floating,me=un(Nt(s)),Oe=$.some(Z=>Z.context&&ft(Z.context.elements.floating,me));te&&!Oe&&R.current&&te.focus({preventScroll:!0})},[f,s,T,P,g]),Ye(()=>{if(!f||!T||!g||P)return;function K(ne){Y(ne.id),D&&(D.current=ne)}return T.events.on("virtualfocus",K),()=>{T.events.off("virtualfocus",K)}},[f,T,g,P,D]),Ye(()=>{N.current=O,j.current=!!s}),Ye(()=>{n||(F.current=null)},[n]);const X=l!=null,se=A.useMemo(()=>{function K($){if(!n)return;const te=a.current.indexOf($);te!==-1&&O(te)}return{onFocus($){let{currentTarget:te}=$;K(te)},onClick:$=>{let{currentTarget:te}=$;return te.focus({preventScroll:!0})},...y&&{onMouseMove($){let{currentTarget:te}=$;K(te)},onPointerLeave($){let{pointerType:te}=$;!R.current||te==="touch"||(L.current=-1,G(a,L),O(null),g||Gt(i.floating.current,{preventScroll:!0}))}}}},[n,i,G,y,a,O,g]);return A.useMemo(()=>{if(!f)return{};const K=b.current;function ne(Z){if(R.current=!1,z.current=!0,!_.current&&Z.currentTarget===i.floating.current)return;if(p&&Hm(Z.key,k,m)){Je(Z),r(!1,Z.nativeEvent),Xn(o)&&!g&&o.focus();return}const ue=L.current,de=gl(a,K),fe=Am(a,K);if(Z.key==="Home"&&(Je(Z),L.current=de,O(L.current)),Z.key==="End"&&(Je(Z),L.current=fe,O(L.current)),!(E>1&&(L.current=DO(a,{event:Z,orientation:k,loop:d,cols:E,disabledIndices:K,minIndex:de,maxIndex:fe,prevIndex:L.current,stopEvent:!0}),O(L.current),k==="both"))&&Um(Z.key,k)){if(Je(Z),n&&!g&&un(Z.currentTarget.ownerDocument)===Z.currentTarget){L.current=El(Z.key,k,m)?de:fe,O(L.current);return}El(Z.key,k,m)?d?L.current=ue>=fe?h&&ue!==a.current.length?-1:de:nt(a,{startingIndex:ue,disabledIndices:K}):L.current=Math.min(fe,nt(a,{startingIndex:ue,disabledIndices:K})):d?L.current=ue<=de?h&&ue!==-1?a.current.length:fe:nt(a,{startingIndex:ue,decrement:!0,disabledIndices:K}):L.current=Math.max(de,nt(a,{startingIndex:ue,decrement:!0,disabledIndices:K})),oi(a,L.current)?O(null):O(L.current)}}function $(Z){v==="auto"&&Gp(Z.nativeEvent)&&(U.current=!0)}function te(Z){U.current=v,v==="auto"&&Qp(Z.nativeEvent)&&(U.current=!0)}const me=g&&n&&X&&{"aria-activedescendant":J||S},Oe=a.current.find(Z=>(Z==null?void 0:Z.id)===S);return{reference:{...me,onKeyDown(Z){R.current=!1;const ue=Z.key.indexOf("Arrow")===0,de=rM(Z.key,k,m),fe=Hm(Z.key,k,m),Ae=Um(Z.key,k),Fe=(p?de:Ae)||Z.key==="Enter"||Z.key.trim()==="";if(g&&n){const ae=T==null?void 0:T.nodesRef.current.find(q=>q.parentId==null),H=T&&ae?$O(T.nodesRef.current,ae.id):null;if(ue&&H&&D){const q=new KeyboardEvent("keydown",{key:Z.key,bubbles:!0});if(de||fe){var Me,He;const oe=((Me=H.context)==null?void 0:Me.elements.domReference)===Z.currentTarget,le=fe&&!oe?(He=H.context)==null?void 0:He.elements.domReference:de?Oe:null;le&&(Je(Z),le.dispatchEvent(q),Y(void 0))}if(Ae&&H.context&&H.context.open&&H.parentId&&Z.currentTarget!==H.context.elements.domReference){var ee;Je(Z),(ee=H.context.elements.domReference)==null||ee.dispatchEvent(q);return}}return ne(Z)}if(!(!n&&!w&&ue)){if(Fe&&(F.current=p&&Ae?null:Z.key),p){de&&(Je(Z),n?(L.current=gl(a,K),O(L.current)):r(!0,Z.nativeEvent));return}Ae&&(c!=null&&(L.current=c),Je(Z),!n&&w?r(!0,Z.nativeEvent):ne(Z),n&&O(L.current))}},onFocus(){n&&O(null)},onPointerDown:te,onMouseDown:$,onClick:$},floating:{"aria-orientation":k==="both"?void 0:k,...me,onKeyDown:ne,onPointerMove(){R.current=!0}},item:se}},[o,i,S,J,b,_,a,f,k,m,g,n,X,p,c,w,h,E,d,v,O,r,se,T,D])}function oM(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 sM(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,p=A.useRef(),m=A.useRef(""),g=A.useRef((n=d??s)!=null?n:-1),v=A.useRef(null),y=hn(a),w=hn(l),C=dn(f),k=dn(h);return Ye(()=>{r&&(clearTimeout(p.current),v.current=null,m.current="")},[r]),Ye(()=>{if(r&&m.current===""){var E;g.current=(E=d??s)!=null?E:-1}},[r,d,s]),A.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 U=C.current?C.current(T,O):T.find(L=>(L==null?void 0:L.toLocaleLowerCase().indexOf(O.toLocaleLowerCase()))===0);return U?P.indexOf(U):-1}function D(P){const T=o.current;if(m.current.length>0&&m.current[0]!==" "&&(I(T,T,m.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})&&m.current===P.key&&(m.current="",g.current=v.current),m.current+=P.key,clearTimeout(p.current),p.current=setTimeout(()=>{m.current="",g.current=v.current,E(!1)},c);const U=g.current,L=I(T,[...T.slice((U||0)+1),...T.slice(0,(U||0)+1)],m.current);L!==-1?(y(L),v.current=L):P.key!==" "&&(m.current="",E(!1))}return{reference:{onKeyDown:D},floating:{onKeyDown:D,onKeyUp(P){P.key===" "&&E(!1)}}}},[u,r,i,o,c,k,C,y,w])}const aM=({options:e,reusable:t,sendMessage:n,isReadOnly:r})=>{var R,N,j,z,V;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}}}=ye,d=e.reduce((b,_)=>(b[_.label]=_.value,b),{}),p=d?Object.keys(d):[],m=b=>{a(f!==null&&!t?!1:b)},{refs:g,floatingStyles:v,context:y}=tM({placement:"bottom-start",open:s,onOpenChange:m,whileElementsMounted:iO,middleware:[dO(5),hO({padding:10,boundary:(i==null?void 0:i.current)??void 0,crossAxis:!0}),pO({apply({rects:b,elements:_,availableHeight:B}){Object.assign(_.floating.style,{maxHeight:`${B}px`,minWidth:`${b.reference.width}px`})},padding:10})]}),w=A.useRef([]),C=A.useRef(p),k=A.useRef(!1),E=GO(y,{event:"mousedown"}),I=eM(y),D=oM(y,{role:"listbox"}),P=iM(y,{listRef:w,activeIndex:l,selectedIndex:f,onNavigate:u,loop:!0}),T=sM(y,{listRef:C,activeIndex:l,selectedIndex:f,onMatch:s?u:c,onTypingChange(b){k.current=b}}),{getReferenceProps:O,getFloatingProps:U,getItemProps:L}=nM([I,D,P,T,E]),F=b=>{c(b),p[b]!==void 0&&(n==null||n({type:"text",text:p[b]??"",value:d[p[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?p[f]:"Select..."}),x.jsx(NA,{...(j=h.button)==null?void 0:j.icon})]}),s&&x.jsx(qO,{root:o??void 0,children:x.jsx(KO,{context:y,modal:!1,children:x.jsx("div",{ref:g.setFloating,className:(V=(z=h.content)==null?void 0:z.container)==null?void 0:V.className,style:{...v,pointerEvents:"auto"},...U(),children:p.map((b,_)=>{var B;return x.jsx("div",{ref:S=>{w.current[_]=S},role:"option",tabIndex:_===l?0:-1,"aria-selected":_===f&&_===l,"data-active":_===l?"":void 0,...(B=h.content)==null?void 0:B.item,...L({onClick(){F(_)},onKeyDown(S){S.key==="Enter"&&(S.preventDefault(),F(_)),S.key===" "&&!k.current&&(S.preventDefault(),F(_))}}),children:b},b)})})})})]})},jm=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(FA,{...o.icon})]})});jm.displayName="File";const lM=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 Vm={audio:_p,bubble:Tp,button:TT,carousel:Vp,column:Lp,dropdown:aM,file:jm,image:Dp,location:Pp,row:Fp,text:iT,video:Np,custom:({url:e,name:t,data:n,...r})=>{const i=lM(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])??Vm[e.type],i={...n,...e};return x.jsx(r,{...i})};function Wm(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=Wm(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=Wm(e))&&(r&&(r+=" "),r+=t);return r}const uM=({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(YA,{...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})]})},cM=({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(Cl,{type:t,...s.icon})})}):r==="error"?x.jsx(Co,{name:e,status:r,removeButton:x.jsx(qm,{removeFile:()=>i(e)}),extension:"Upload Error",children:x.jsxs("div",{...s.container,children:[x.jsx(_A,{...l}),x.jsx(Cl,{type:t,...s.icon})]})}):r=="uploaded"&&f?x.jsx(Co,{name:e,status:r,removeButton:x.jsx(qm,{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(ap,{onClick:()=>i(e),...a}),extension:Ao(n.name),children:x.jsx("div",{...s.container,children:x.jsx(Cl,{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})]})]})},Cl=({type:e,...t})=>e==="image"?x.jsx(BA,{...t}):e==="video"?x.jsx(eT,{...t}):e==="audio"?x.jsx(cp,{...t}):x.jsx(lp,{...t}),Ao=e=>{if(!e)return"File";const t=e.split(".").pop();return t?t.toUpperCase():"File"},qm=({removeFile:e})=>{const{composer:{fileWidget:{removeIcon:t}}}=ye;return x.jsx(ap,{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 fM(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 dM=M.useLayoutEffect,hM=function(t){var n=M.useRef(t);return dM(function(){n.current=t}),n},Ym=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},pM=function(t,n){var r=M.useRef();return M.useCallback(function(i){t.current=i,r.current&&Ym(r.current,null),r.current=n,n&&Ym(n,i)},[n])},Km={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},mM=function(t){Object.keys(Km).forEach(function(n){t.style.setProperty(n,Km[n],"important")})},Gm=mM,st=null,Qm=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function gM(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"),Gm(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]}),Gm(st),st.value=t;var l=Qm(st,e);st.value=t,l=Qm(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 Zm=function(){},yM=function(t,n){return t.reduce(function(r,i){return r[i]=n[i],r},{})},vM=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],bM=!!document.documentElement.currentStyle,wM=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=yM(vM,n),i=r.boxSizing;if(i==="")return null;bM&&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}},SM=wM;function Jm(e,t,n){var r=hM(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 xM=function(t){Jm(window,"resize",t)},kM=function(t){Jm(document.fonts,"loadingdone",t)},EM=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],CM=function(t,n){var r=t.cacheMeasurements,i=t.maxRows,o=t.minRows,s=t.onChange,a=s===void 0?Zm:s,l=t.onHeightChange,u=l===void 0?Zm:l,f=fM(t,EM),c=f.value!==void 0,h=A.useRef(null),d=pM(h,n),p=A.useRef(0),m=A.useRef(),g=function(){var w=h.current,C=r&&m.current?m.current:SM(w);if(C){m.current=C;var k=gM(C,w.value||w.placeholder||"x",o,i),E=k[0],I=k[1];p.current!==E&&(p.current=E,w.style.setProperty("height",E+"px","important"),u(E,{rowHeight:I}))}},v=function(w){c||g(),a(w)};return A.useLayoutEffect(g),xM(g),kM(g),A.createElement("textarea",Al({},f,{onChange:v,ref:d}))},AM=A.forwardRef(CM);const TM=({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=Sp(f||"default",c)(C=>C.messageHistory),[p,m]=M.useState(""),[g,v]=M.useState(!1),{input:y}=ye.composer,w=C=>{if(!l||!u||!C.clipboardData)return;const k=Array.from(C.clipboardData.files);k.length>0&&(C.preventDefault(),k.forEach(E=>{u(E)}))};return x.jsx(AM,{...y,"aria-label":"Message Input",ref:e,placeholder:t??"Type your message...",disabled:n,value:r,"data-has-value":!!r,onChange:C=>{const k=C.target.value;o(k),d.includes(k)||s(-1)},onPaste:w,maxRows:5,onKeyDown:C=>{if(n)return;const k=C.nativeEvent;if(!(k.isComposing||k.keyCode===229)&&(r.length===0&&v(!1),C.key!=="ArrowUp"&&C.key!=="ArrowDown"&&C.key!=="ArrowLeft"&&C.key!=="ArrowRight"&&v(!0),C.key==="Enter"&&C.shiftKey?(C.preventDefault(),o(`${r}
289
- `)):C.key==="Enter"&&(C.preventDefault(),a()),!(r.length>0&&g))){if(C.key==="ArrowUp"){C.preventDefault(),i===-1&&r.trim()!==""&&m(r);const E=Math.min(i+1,d.length-1);s(E),o(d[E]??"")}if(C.key==="ArrowDown"){C.preventDefault();const E=Math.max(i-1,-1);o(i===-1?r.trim():E===-1?p:d[E]??""),s(E)}}}})},IM=({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(VA,{...o,tabIndex:0,"aria-label":"Voice Input Button",role:"button","data-show":!e,"data-listens":!!n,onClick:a})},Xm=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,...p},m)=>{const{composer:g}=ye,v=n||r||!s,[y,w]=M.useState(""),[C,k]=M.useState(-1),E=Ep(h||"default"),I=Sp(h||"default",c),D=E(N=>N.files),P=E(N=>N.setFiles),T=E(N=>N.deleteFile),O=E(N=>N.uploadFile),U=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 V=z.url,b=z.type,_=z.fileId;return{video:{type:"video",videoUrl:V,fileId:_},audio:{type:"audio",audioUrl:V,fileId:_},image:{type:"image",imageUrl:V,fileId:_}}[b]??{title:z.name,type:"file",fileUrl:V,fileId:_}})??[];y&&N.push({type:"text",text:y});let j;N.length==1?j=N[0]:j={type:"bloc",items:N.map(V=>{const{type:b,..._}=V;return{type:b,payload:_}})},w(""),u==null||u(j),P([]),U(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:m,...p,children:[d,D.length>0&&x.jsx("div",{...g==null?void 0:g.fileContainer,children:D.map(N=>x.jsx(cM,{...N,removeFile:T},N.name))}),x.jsxs("div",{...g.inputContainer,onClick:()=>{t&&"current"in t&&t.current&&t.current.focus()},children:[i&&x.jsx(uM,{disabled:v,onFileSelected:N=>{f&&O(N,f)}}),x.jsx(TM,{inputRef:t,composerPlaceholder:a,composerDisabled:v,textInput:y,historyIndex:C,setTextInput:w,setHistoryIndex:k,sendComposerMessage:R,allowFileUpload:i,onFilePasted:N=>{f&&O(N,f)},conversationId:h,storageKey:c}),o&&x.jsx(zA,{...g.inputLoader,role:"status","data-show":o}),!v&&!o&&x.jsxs(x.Fragment,{children:[x.jsx(MA,{...g.sendbutton,role:"button",tabIndex:0,"aria-label":"Send Message Button","data-show":F,onClick:()=>R()}),x.jsx(IM,{disabled:F,setTextInput:w})]})]})]}),x.jsx(kh,{components:{a:({node:N,...j})=>x.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 OO=["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])"],hl=OO.join(","),Dm=typeof Element>"u",oi=Dm?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,vo=!Dm&&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},si=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&&si(t.parentNode);return s},DO=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(si(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(hl));return n&&oi.call(t,hl)&&i.unshift(t),i=i.filter(r),i},pl=function(t,n,r){for(var i=[],o=Array.from(t);o.length;){var s=o.shift();if(!si(s,!1))if(s.tagName==="SLOT"){var a=s.assignedElements(),l=a.length?a:s.children,u=pl(l,!0,r);r.flatten?i.push.apply(i,u):i.push({scopeParent:s,candidates:u})}else{var f=oi.call(s,hl);f&&r.filter(s)&&(n||!t.includes(s))&&i.push(s);var c=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),h=!si(c,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(c&&h){var d=pl(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},Mm=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Nm=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||DO(t))&&!Mm(t)?0:t.tabIndex},NO=function(t,n){var r=Nm(t);return r<0&&n&&!Mm(t)?0:r},LO=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Lm=function(t){return t.tagName==="INPUT"},_O=function(t){return Lm(t)&&t.type==="hidden"},PO=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},FO=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},RO=function(t){if(!t.name)return!0;var n=t.form||vo(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=FO(i,t.form);return!o||o===t},BO=function(t){return Lm(t)&&t.type==="radio"},$O=function(t){return BO(t)&&!RO(t)},zO=function(t){var n,r=t&&vo(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=vo(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},_m=function(t){var n=t.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},HO=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=oi.call(t,"details>summary:first-of-type"),a=s?t.parentElement:t;if(oi.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=vo(t);if(u&&!u.shadowRoot&&i(u)===!0)return _m(t);t.assignedSlot?t=t.assignedSlot:!u&&f!==t.ownerDocument?t=f.host:t=u}t=l}if(zO(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return _m(t);return!1},UO=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 oi.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},jO=function(t,n){return!(n.disabled||si(n)||_O(n)||HO(n,t)||PO(n)||UO(n))},Pm=function(t,n){return!($O(n)||Nm(n)<0||!jO(t,n))},VO=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Fm=function(t){var n=[],r=[];return t.forEach(function(i,o){var s=!!i.scopeParent,a=s?i.scopeParent:i,l=NO(a,s),u=s?Fm(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(LO).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},ml=function(t,n){n=n||{};var r;return n.getShadowRoot?r=pl([t],n.includeContainer,{filter:Pm.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:VO}):r=MO(t,n.includeContainer,Pm.bind(null,n)),Fm(r)};const gl="ArrowUp",bo="ArrowDown",sr="ArrowLeft",ai="ArrowRight";function wo(e,t,n){return Math.floor(e/t)!==n}function li(e,t){return t<0||t>=e.current.length}function yl(e,t){return rt(e,{disabledIndices:t})}function Rm(e,t){return rt(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function rt(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 WO(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===gl){if(f&&Xe(n),u===-1)c=l;else if(c=rt(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}li(e,c)&&(c=u)}if(n.key===bo&&(f&&Xe(n),u===-1?c=a:(c=rt(e,{startingIndex:u,amount:o,disabledIndices:s}),i&&u+o>l&&(c=rt(e,{startingIndex:u%o-o,amount:o,disabledIndices:s}))),li(e,c)&&(c=u)),r==="both"){const h=nm(u/o);n.key===ai&&(f&&Xe(n),u%o!==o-1?(c=rt(e,{startingIndex:u,disabledIndices:s}),i&&wo(c,o,h)&&(c=rt(e,{startingIndex:u-u%o-1,disabledIndices:s}))):i&&(c=rt(e,{startingIndex:u-u%o-1,disabledIndices:s})),wo(c,o,h)&&(c=u)),n.key===sr&&(f&&Xe(n),u%o!==0?(c=rt(e,{startingIndex:u,disabledIndices:s,decrement:!0}),i&&wo(c,o,h)&&(c=rt(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}))):i&&(c=rt(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s})),wo(c,o,h)&&(c=u));const d=nm(l/o)===h;li(e,c)&&(i&&d?c=n.key===sr?l:rt(e,{startingIndex:u-u%o-1,disabledIndices:s}):c=u)}return c}let Bm=0;function Qt(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(Bm);const o=()=>e==null?void 0:e.focus({preventScroll:n});i?o():Bm=requestAnimationFrame(o)}var Ke=typeof document<"u"?D.useLayoutEffect:D.useEffect;function So(){return So=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},So.apply(this,arguments)}let vl=!1,qO=0;const $m=()=>"floating-ui-"+qO++;function YO(){const[e,t]=C.useState(()=>vl?$m():void 0);return Ke(()=>{e==null&&t($m())},[]),C.useEffect(()=>{vl||(vl=!0)},[]),e}const bl=C.useId||YO;function KO(){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 GO=C.createContext(null),QO=C.createContext(null),zm=()=>{var e;return((e=C.useContext(GO))==null?void 0:e.id)||null},ko=()=>C.useContext(QO);function ui(e){return"data-floating-ui-"+e}function hn(e){const t=D.useRef(e);return Ke(()=>{t.current=e}),t}function ZO(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 ar(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 JO(e,t){let n,r=-1;function i(o,s){s>r&&(n=o,r=s),ar(e,o).forEach(l=>{i(l.id,s+1)})}return i(t,0),e.find(o=>o.id===n)}let lr=new WeakMap,xo=new WeakSet,Eo={},wl=0;const XO=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,Hm=e=>e&&(e.host||Hm(e.parentNode)),eD=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=Hm(n);return e.contains(r)?r:null}).filter(n=>n!=null);function tD(e,t,n,r){const i="data-floating-ui-inert",o=r?"inert":n?"aria-hidden":null,s=eD(t,e),a=new Set,l=new Set(s),u=[];Eo[i]||(Eo[i]=new WeakMap);const f=Eo[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=(lr.get(m)||0)+1,y=(f.get(m)||0)+1;lr.set(m,v),f.set(m,y),u.push(m),v===1&&g&&xo.add(m),y===1&&m.setAttribute(i,""),!g&&o&&m.setAttribute(o,"true")}})}return wl++,()=>{u.forEach(d=>{const m=(lr.get(d)||0)-1,p=(f.get(d)||0)-1;lr.set(d,m),f.set(d,p),m||(!xo.has(d)&&o&&d.removeAttribute(o),xo.delete(d)),p||d.removeAttribute(i)}),wl--,wl||(lr=new WeakMap,lr=new WeakMap,xo=new WeakSet,Eo={})}}function Um(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=Lt(e[0]).body;return tD(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Sl=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function jm(e,t){const n=ml(e,Sl());t==="prev"&&n.reverse();const r=n.indexOf(cn(Lt(e)));return n.slice(r+1)[0]}function Vm(){return jm(document.body,"next")}function Wm(){return jm(document.body,"prev")}function ci(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!dt(n,r)}function nD(e){ml(e,Sl()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function rD(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 kl={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 iD;function qm(e){e.key==="Tab"&&(e.target,clearTimeout(iD))}const Co=C.forwardRef(function(t,n){const[r,i]=C.useState();Ke(()=>(lm()&&i("button"),document.addEventListener("keydown",qm),()=>{document.removeEventListener("keydown",qm)}),[]);const o={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[ui("focus-guard")]:"",style:kl};return C.createElement("span",So({},t,o))}),Ym=C.createContext(null);function oD(e){let{id:t,root:n}=e===void 0?{}:e;const[r,i]=C.useState(null),o=bl(),s=Km(),a=C.useMemo(()=>({id:t,root:n,portalContext:s,uniqueId:o}),[t,n,s,o]),l=C.useRef();return Ke(()=>()=>{r==null||r.remove()},[r,a]),Ke(()=>{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=ui("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&&!Et(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 sD(e){let{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e;const o=oD({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&&ci(m)&&(m.type==="focusin"?rD:nD)(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(Ym.Provider,{value:C.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:f,afterInsideRef:c,portalNode:o,setFocusManagerState:a}),[i,o])},h&&o&&C.createElement(Co,{"data-type":"outside",ref:l,onFocus:d=>{if(ci(d,o)){var m;(m=f.current)==null||m.focus()}else{const p=Wm()||(s==null?void 0:s.refs.domReference.current);p==null||p.focus()}}}),h&&o&&C.createElement("span",{"aria-owns":o.id,style:kl}),o&&$u.createPortal(t,o),h&&o&&C.createElement(Co,{"data-type":"outside",ref:u,onFocus:d=>{if(ci(d,o)){var m;(m=c.current)==null||m.focus()}else{const p=Vm()||(s==null?void 0:s.refs.domReference.current);p==null||p.focus(),s!=null&&s.closeOnFocusOut&&(s==null||s.onOpenChange(!1,d.nativeEvent))}}}))}const Km=()=>C.useContext(Ym),aD=C.forwardRef(function(t,n){return C.createElement("button",So({},t,{type:"button",ref:n,tabIndex:-1,style:kl}))});function lD(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=XO()?o:!0,A=hn(i),k=hn(s),E=hn(a),I=ko(),M=Km(),L=typeof s=="number"&&s<0,T=C.useRef(null),O=C.useRef(null),H=C.useRef(!1),P=C.useRef(null),F=C.useRef(!1),_=M!=null,z=v&&v.getAttribute("role")==="combobox"&&fm(v)&&L,$=C.useCallback(function(N){return N===void 0&&(N=y),N?ml(N,Sl()):[]},[y]),U=C.useCallback(N=>{const R=$(N);return A.current.map(S=>v&&S==="reference"?v:y&&S==="floating"?y:R).filter(Boolean).flat()},[v,y,A,$]);C.useEffect(()=>{if(r||!l)return;function N(S){if(S.key==="Tab"){dt(y,cn(Lt(y)))&&$().length===0&&!z&&Xe(S);const V=U(),ee=cm(S);A.current[0]==="reference"&&ee===v&&(Xe(S),S.shiftKey?Qt(V[V.length-1]):Qt(V[1])),A.current[1]==="floating"&&ee===y&&S.shiftKey&&(Xe(S),Qt(V[0]))}}const R=Lt(y);return R.addEventListener("keydown",N),()=>{R.removeEventListener("keydown",N)}},[r,v,y,l,A,h,z,$,U]),C.useEffect(()=>{if(r||!f)return;function N(){F.current=!0,setTimeout(()=>{F.current=!1})}function R(S){const V=S.relatedTarget;queueMicrotask(()=>{const ee=!(dt(v,V)||dt(y,V)||dt(V,y)||dt(M==null?void 0:M.portalNode,V)||V!=null&&V.hasAttribute(ui("focus-guard"))||I&&(ar(I.nodesRef.current,d).find(Y=>{var G,J;return dt((G=Y.context)==null?void 0:G.elements.floating,V)||dt((J=Y.context)==null?void 0:J.elements.domReference,V)})||ZO(I.nodesRef.current,d).find(Y=>{var G,J;return((G=Y.context)==null?void 0:G.elements.floating)===V||((J=Y.context)==null?void 0:J.elements.domReference)===V})));V&&ee&&!F.current&&V!==P.current&&(H.current=!0,m(!1,S))})}if(y&&tr(v))return v.addEventListener("focusout",R),v.addEventListener("pointerdown",N),!l&&y.addEventListener("focusout",R),()=>{v.removeEventListener("focusout",R),v.removeEventListener("pointerdown",N),!l&&y.removeEventListener("focusout",R)}},[r,v,y,l,d,I,M,m,f]),C.useEffect(()=>{var N;if(r)return;const R=Array.from((M==null||(N=M.portalNode)==null?void 0:N.querySelectorAll("["+ui("portal")+"]"))||[]);if(y){const S=[y,...R,T.current,O.current,A.current.includes("reference")||z?v:null].filter(ee=>ee!=null),V=l?Um(S,w,!w):Um(S);return()=>{V()}}},[r,v,y,l,A,M,z,w]),Ke(()=>{if(r||!y)return;const N=Lt(y),R=cn(N);queueMicrotask(()=>{const S=U(y),V=k.current,ee=(typeof V=="number"?S[V]:V.current)||y,Y=dt(y,R);!L&&!Y&&c&&Qt(ee,{preventScroll:ee===y})})},[r,c,y,L,U,k]),Ke(()=>{if(r||!y)return;let N=!1;const R=Lt(y),S=cn(R),V=g.current;P.current=S;function ee(Y){if(Y.type==="escapeKey"&&h.domReference.current&&(P.current=h.domReference.current),["referencePress","escapeKey"].includes(Y.type))return;const G=Y.data.returnFocus;typeof G=="object"?(H.current=!1,N=G.preventScroll):H.current=!G}return p.on("dismiss",ee),()=>{p.off("dismiss",ee);const Y=cn(R);(dt(y,Y)||I&&ar(I.nodesRef.current,d).some(J=>{var se;return dt((se=J.context)==null?void 0:se.elements.floating,Y)})||V.openEvent&&["click","mousedown"].includes(V.openEvent.type))&&h.domReference.current&&(P.current=h.domReference.current),E.current&&tr(P.current)&&!H.current&&Qt(P.current,{cancelPrevious:!1,preventScroll:N})}},[r,y,E,g,h,p,I,d]),Ke(()=>{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]),Ke(()=>{if(!r&&y&&typeof MutationObserver=="function"&&!L){const N=()=>{const S=y.getAttribute("tabindex");A.current.includes("floating")||cn(Lt(y))!==h.domReference.current&&$().length===0?S!=="0"&&y.setAttribute("tabindex","0"):S!=="-1"&&y.setAttribute("tabindex","-1")};N();const R=new MutationObserver(N);return R.observe(y,{childList:!0,subtree:!0,attributes:!0}),()=>{R.disconnect()}}},[r,y,h,A,$,L]);function W(N){return r||!u||!l?null:C.createElement(aD,{ref:N==="start"?T:O,onClick:R=>m(!1,R.nativeEvent)},typeof u=="string"?u:"Dismiss")}const b=!r&&w&&!z&&(_||l);return C.createElement(C.Fragment,null,b&&C.createElement(Co,{"data-type":"inside",ref:M==null?void 0:M.beforeInsideRef,onFocus:N=>{if(l){const S=U();Qt(i[0]==="reference"?S[0]:S[S.length-1])}else if(M!=null&&M.preserveTabOrder&&M.portalNode)if(H.current=!1,ci(N,M.portalNode)){const S=Vm()||v;S==null||S.focus()}else{var R;(R=M.beforeOutsideRef.current)==null||R.focus()}}}),!z&&W("start"),n,W("end"),b&&C.createElement(Co,{"data-type":"inside",ref:M==null?void 0:M.afterInsideRef,onFocus:N=>{if(l)Qt(U()[0]);else if(M!=null&&M.preserveTabOrder&&M.portalNode)if(f&&(H.current=!0),ci(N,M.portalNode)){const S=Wm()||v;S==null||S.focus()}else{var R;(R=M.afterOutsideRef.current)==null||R.focus()}}}))}function Gm(e){return tr(e.target)&&e.target.tagName==="BUTTON"}function Qm(e){return fm(e)}function uD(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&&(um(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}um(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||Gm(d))&&(d.key===" "&&!Qm(o)&&(d.preventDefault(),h.current=!0),d.key==="Enter"&&r(!(n&&l),d.nativeEvent))},onKeyUp(d){d.defaultPrevented||!f||Gm(d)||Qm(o)||d.key===" "&&h.current&&(h.current=!1,r(!(n&&l),d.nativeEvent))}}}:{},[s,i,a,u,f,o,l,n,r])}const cD=C.useInsertionEffect||(e=>e());function pn(e){const t=C.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return cD(()=>{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 fD={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},dD={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},hD=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 pD(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=ko(),w=zm()!=null,A=pn(typeof h=="function"?h:()=>!1),k=typeof h=="function"?A:h,E=C.useRef(!1),{escapeKeyBubbles:I,outsidePressBubbles:M}=hD(v),L=pn(O=>{if(!n||!f||!c||O.key!=="Escape")return;const H=y?ar(y.nodesRef.current,o):[];if(!I&&(O.stopPropagation(),H.length>0)){let P=!0;if(H.forEach(F=>{var _;if((_=F.context)!=null&&_.open&&!F.context.dataRef.current.__escapeKeyBubbles){P=!1;return}}),!P)return}i.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),r(!1,LI(O)?O.nativeEvent:O)}),T=pn(O=>{const H=E.current;if(E.current=!1,H||typeof k=="function"&&!k(O))return;const P=cm(O),F="["+ui("inert")+"]",_=Lt(l).querySelectorAll(F);let z=Et(P)?P:null;for(;z&&!II(z);){const W=DI(z);if(W===Lt(l).body||!Et(W))break;z=W}if(_.length&&Et(P)&&!_I(P)&&!dt(P,l)&&Array.from(_).every(W=>!dt(z,W)))return;if(tr(P)&&l){const W=P.clientWidth>0&&P.scrollWidth>P.clientWidth,b=P.clientHeight>0&&P.scrollHeight>P.clientHeight;let N=b&&O.offsetX>P.clientWidth;if(b&&OI(P).direction==="rtl"&&(N=O.offsetX<=P.offsetWidth-P.clientWidth),N||W&&O.offsetY>P.clientHeight)return}const $=y&&ar(y.nodesRef.current,o).some(W=>{var b;return ol(O,(b=W.context)==null?void 0:b.elements.floating)});if(ol(O,l)||ol(O,a)||$)return;const U=y?ar(y.nodesRef.current,o):[];if(U.length>0){let W=!0;if(U.forEach(b=>{var N;if((N=b.context)!=null&&N.open&&!b.context.dataRef.current.__outsidePressBubbles){W=!1;return}}),!W)return}i.emit("dismiss",{type:"outsidePress",data:{returnFocus:w?{preventScroll:!0}:sm(O)||am(O)}}),r(!1,O)});return C.useEffect(()=>{if(!n||!f)return;u.current.__escapeKeyBubbles=I,u.current.__outsidePressBubbles=M;function O(F){r(!1,F)}const H=Lt(l);c&&H.addEventListener("keydown",L),k&&H.addEventListener(d,T);let P=[];return g&&(Et(a)&&(P=dn(a)),Et(l)&&(P=P.concat(dn(l))),!Et(s)&&s&&s.contextElement&&(P=P.concat(dn(s.contextElement)))),P=P.filter(F=>{var _;return F!==((_=H.defaultView)==null?void 0:_.visualViewport)}),P.forEach(F=>{F.addEventListener("scroll",O,{passive:!0})}),()=>{c&&H.removeEventListener("keydown",L),k&&H.removeEventListener(d,T),P.forEach(F=>{F.removeEventListener("scroll",O)})}},[u,l,a,s,c,k,d,n,r,g,f,I,M,L,T]),C.useEffect(()=>{E.current=!1},[k,d]),C.useMemo(()=>f?{reference:{onKeyDown:L,[fD[p]]:O=>{m&&(i.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),r(!1,O.nativeEvent))}},floating:{onKeyDown:L,[dD[d]]:()=>{E.current=!0}}}:{},[f,i,m,d,p,r,L])}let xl;process.env.NODE_ENV!=="production"&&(xl=new Set);function mD(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&&!Et(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]=C.useState(null),f=((t=e.elements)==null?void 0:t.reference)||l,c=CO(e),h=ko(),d=pn((I,M)=>{I&&(p.current.openEvent=M),r==null||r(I,M)}),m=C.useRef(null),p=C.useRef({}),g=C.useState(()=>KO())[0],v=bl(),y=C.useCallback(I=>{const M=Et(I)?{getBoundingClientRect:()=>I.getBoundingClientRect(),contextElement:I}:I;c.refs.setReference(M)},[c.refs]),w=C.useCallback(I=>{(Et(I)||I===null)&&(m.current=I,u(I)),(Et(c.refs.reference.current)||c.refs.reference.current===null||I!==null&&!Et(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 Ke(()=>{const I=h==null?void 0:h.nodesRef.current.find(M=>M.id===i);I&&(I.context=E)}),C.useMemo(()=>({...c,context:E,refs:A,elements:k}),[c,A,k,E])}function El(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 gD(e){e===void 0&&(e=[]);const t=e,n=C.useCallback(o=>El(o,e,"reference"),t),r=C.useCallback(o=>El(o,e,"floating"),t),i=C.useCallback(o=>El(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 Zm=!1;function Ao(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Jm(e,t){return Ao(t,e===gl||e===bo,e===sr||e===ai)}function Cl(e,t,n){return Ao(t,e===bo,n?e===sr:e===ai)||e==="Enter"||e==" "||e===""}function yD(e,t,n){return Ao(t,n?e===sr:e===ai,e===bo)}function Xm(e,t,n){return Ao(t,n?e===ai:e===sr,e===gl)}function vD(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: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(" "))),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 L=zm(),T=ko(),O=pn(u),H=C.useRef(v),P=C.useRef(c??-1),F=C.useRef(null),_=C.useRef(!0),z=C.useRef(O),$=C.useRef(!!s),U=C.useRef(!1),W=C.useRef(!1),b=hn(A),N=hn(n),R=hn(I),[S,V]=C.useState(),[ee,Y]=C.useState(),G=pn(function(K,re,B){B===void 0&&(B=!1);const ne=K.current[re.current];ne&&(g?(V(ne.id),T==null||T.events.emit("virtualfocus",ne),M&&(M.current=ne)):Qt(ne,{preventScroll:!0,sync:NI()&&lm()?Zm||U.current:!1}),requestAnimationFrame(()=>{const me=R.current;me&&ne&&(B||!_.current)&&(ne.scrollIntoView==null||ne.scrollIntoView(typeof me=="boolean"?{block:"nearest",inline:"nearest"}:me))}))});Ke(()=>{document.createElement("div").focus({get preventScroll(){return Zm=!0,!1}})},[]),Ke(()=>{f&&(n&&s?H.current&&c!=null&&(W.current=!0,O(c)):$.current&&(P.current=-1,z.current(null)))},[f,n,s,c,O]),Ke(()=>{if(f&&n&&s)if(l==null){if(U.current=!1,c!=null)return;if($.current&&(P.current=-1,G(a,P)),!$.current&&H.current&&(F.current!=null||H.current===!0&&F.current==null)){let K=0;const re=()=>{a.current[0]==null?(K<2&&(K?requestAnimationFrame:queueMicrotask)(re),K++):(P.current=F.current==null||Cl(F.current,k,p)||m?yl(a,b.current):Rm(a,b.current),F.current=null,O(P.current))};re()}}else li(a,l)||(P.current=l,G(a,P,W.current),W.current=!1)},[f,n,s,l,c,m,a,k,p,O,G,b]),Ke(()=>{var K,re;if(!f||s||!T||g||!$.current)return;const B=T.nodesRef.current,ne=(K=B.find(Q=>Q.id===L))==null||(re=K.context)==null?void 0:re.elements.floating,me=cn(Lt(s)),we=B.some(Q=>Q.context&&dt(Q.context.elements.floating,me));ne&&!we&&_.current&&ne.focus({preventScroll:!0})},[f,s,T,L,g]),Ke(()=>{if(!f||!T||!g||L)return;function K(re){Y(re.id),M&&(M.current=re)}return T.events.on("virtualfocus",K),()=>{T.events.off("virtualfocus",K)}},[f,T,g,L,M]),Ke(()=>{z.current=O,$.current=!!s}),Ke(()=>{n||(F.current=null)},[n]);const J=l!=null,se=C.useMemo(()=>{function K(B){if(!n)return;const ne=a.current.indexOf(B);ne!==-1&&O(ne)}return{onFocus(B){let{currentTarget:ne}=B;K(ne)},onClick:B=>{let{currentTarget:ne}=B;return ne.focus({preventScroll:!0})},...y&&{onMouseMove(B){let{currentTarget:ne}=B;K(ne)},onPointerLeave(B){let{pointerType:ne}=B;!_.current||ne==="touch"||(P.current=-1,G(a,P),O(null),g||Qt(i.floating.current,{preventScroll:!0}))}}}},[n,i,G,y,a,O,g]);return C.useMemo(()=>{if(!f)return{};const K=b.current;function re(Q){if(_.current=!1,U.current=!0,!N.current&&Q.currentTarget===i.floating.current)return;if(m&&Xm(Q.key,k,p)){Xe(Q),r(!1,Q.nativeEvent),tr(o)&&!g&&o.focus();return}const ue=P.current,de=yl(a,K),fe=Rm(a,K);if(Q.key==="Home"&&(Xe(Q),P.current=de,O(P.current)),Q.key==="End"&&(Xe(Q),P.current=fe,O(P.current)),!(E>1&&(P.current=WO(a,{event:Q,orientation:k,loop:d,cols:E,disabledIndices:K,minIndex:de,maxIndex:fe,prevIndex:P.current,stopEvent:!0}),O(P.current),k==="both"))&&Jm(Q.key,k)){if(Xe(Q),n&&!g&&cn(Q.currentTarget.ownerDocument)===Q.currentTarget){P.current=Cl(Q.key,k,p)?de:fe,O(P.current);return}Cl(Q.key,k,p)?d?P.current=ue>=fe?h&&ue!==a.current.length?-1:de:rt(a,{startingIndex:ue,disabledIndices:K}):P.current=Math.min(fe,rt(a,{startingIndex:ue,disabledIndices:K})):d?P.current=ue<=de?h&&ue!==-1?a.current.length:fe:rt(a,{startingIndex:ue,decrement:!0,disabledIndices:K}):P.current=Math.max(de,rt(a,{startingIndex:ue,decrement:!0,disabledIndices:K})),li(a,P.current)?O(null):O(P.current)}}function B(Q){v==="auto"&&sm(Q.nativeEvent)&&(H.current=!0)}function ne(Q){H.current=v,v==="auto"&&am(Q.nativeEvent)&&(H.current=!0)}const me=g&&n&&J&&{"aria-activedescendant":ee||S},we=a.current.find(Q=>(Q==null?void 0:Q.id)===S);return{reference:{...me,onKeyDown(Q){_.current=!1;const ue=Q.key.indexOf("Arrow")===0,de=yD(Q.key,k,p),fe=Xm(Q.key,k,p),Te=Jm(Q.key,k),Fe=(m?de:Te)||Q.key==="Enter"||Q.key.trim()==="";if(g&&n){const ae=T==null?void 0:T.nodesRef.current.find(q=>q.parentId==null),j=T&&ae?JO(T.nodesRef.current,ae.id):null;if(ue&&j&&M){const q=new KeyboardEvent("keydown",{key:Q.key,bubbles:!0});if(de||fe){var De,Ue;const oe=((De=j.context)==null?void 0:De.elements.domReference)===Q.currentTarget,le=fe&&!oe?(Ue=j.context)==null?void 0:Ue.elements.domReference:de?we:null;le&&(Xe(Q),le.dispatchEvent(q),Y(void 0))}if(Te&&j.context&&j.context.open&&j.parentId&&Q.currentTarget!==j.context.elements.domReference){var te;Xe(Q),(te=j.context.elements.domReference)==null||te.dispatchEvent(q);return}}return re(Q)}if(!(!n&&!w&&ue)){if(Fe&&(F.current=m&&Te?null:Q.key),m){de&&(Xe(Q),n?(P.current=yl(a,K),O(P.current)):r(!0,Q.nativeEvent));return}Te&&(c!=null&&(P.current=c),Xe(Q),!n&&w?r(!0,Q.nativeEvent):re(Q),n&&O(P.current))}},onFocus(){n&&O(null)},onPointerDown:ne,onMouseDown:B,onClick:B},floating:{"aria-orientation":k==="both"?void 0:k,...me,onKeyDown:re,onPointerMove(){_.current=!0}},item:se}},[o,i,S,ee,b,N,a,f,k,p,g,n,J,m,c,w,h,E,d,v,O,r,se,T,M])}function bD(e,t){t===void 0&&(t={});const{open:n,floatingId:r}=e,{enabled:i=!0,role:o="dialog"}=t,s=bl();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 wD(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=pn(a),w=pn(l),A=hn(f),k=hn(h);return Ke(()=>{r&&(clearTimeout(m.current),v.current=null,p.current="")},[r]),Ke(()=>{if(r&&p.current===""){var E;g.current=(E=d??s)!=null?E:-1}},[r,d,s]),C.useMemo(()=>{if(!u)return{};function E(L){L?i.current.typing||(i.current.typing=L,w(L)):i.current.typing&&(i.current.typing=L,w(L))}function I(L,T,O){const H=A.current?A.current(T,O):T.find(P=>(P==null?void 0:P.toLocaleLowerCase().indexOf(O.toLocaleLowerCase()))===0);return H?L.indexOf(H):-1}function M(L){const T=o.current;if(p.current.length>0&&p.current[0]!==" "&&(I(T,T,p.current)===-1?E(!1):L.key===" "&&Xe(L)),T==null||k.current.includes(L.key)||L.key.length!==1||L.ctrlKey||L.metaKey||L.altKey)return;r&&L.key!==" "&&(Xe(L),E(!0)),T.every(F=>{var _,z;return F?((_=F[0])==null?void 0:_.toLocaleLowerCase())!==((z=F[1])==null?void 0:z.toLocaleLowerCase()):!0})&&p.current===L.key&&(p.current="",g.current=v.current),p.current+=L.key,clearTimeout(m.current),m.current=setTimeout(()=>{p.current="",g.current=v.current,E(!1)},c);const H=g.current,P=I(T,[...T.slice((H||0)+1),...T.slice(0,(H||0)+1)],p.current);P!==-1?(y(P),v.current=P):L.key!==" "&&(p.current="",E(!1))}return{reference:{onKeyDown:M},floating:{onKeyDown:M,onKeyUp(L){L.key===" "&&E(!1)}}}},[u,r,i,o,c,k,A,y,w])}const SD=({options:e,reusable:t,sendMessage:n,isReadOnly:r})=>{var z,$,U,W,b;const i=Ye(),o=Jn(N=>N.messageContainerRef),s=Jn(N=>N.portalContainer),[a,l]=C.useState(!1),[u,f]=C.useState(null),[c,h]=C.useState(null),{message:{blocks:{dropdown:d}}}=ye,m=e.reduce((N,R)=>(N[R.label]=R.value,N),{}),p=m?Object.keys(m):[],g=N=>{l(c!==null&&!t?!1:N)},{refs:v,floatingStyles:y,context:w}=mD({placement:"bottom-start",open:a,onOpenChange:g,whileElementsMounted:vO,middleware:[AO(5),TO({padding:10,boundary:(o==null?void 0:o.current)??void 0,crossAxis:!0}),IO({apply({rects:N,elements:R,availableHeight:S}){Object.assign(R.floating.style,{maxHeight:`${S}px`,minWidth:`${N.reference.width}px`})},padding:10})]}),A=C.useRef([]),k=C.useRef(p),E=C.useRef(!1),I=uD(w,{event:"mousedown"}),M=pD(w),L=bD(w,{role:"listbox"}),T=vD(w,{listRef:A,activeIndex:u,selectedIndex:c,onNavigate:f,loop:!0}),O=wD(w,{listRef:k,activeIndex:u,selectedIndex:c,onMatch:a?f:h,onTypingChange(N){E.current=N}}),{getReferenceProps:H,getFloatingProps:P,getItemProps:F}=gD([M,L,T,O,I]),_=N=>{h(N),p[N]!==void 0&&(n==null||n({type:"text",text:p[N]??"",value:m[p[N]]??""})),l(!1)};return x.jsxs(x.Fragment,{children:[x.jsxs("div",{tabIndex:0,ref:v.setReference,"aria-labelledby":"select-label","aria-autocomplete":"none","data-disabled":c!==null&&!t?"":void 0,style:r?{pointerEvents:"none"}:void 0,...(z=d.button)==null?void 0:z.container,...H(),children:[x.jsx("span",{...($=d.button)==null?void 0:$.text,children:c?p[c]:i["dropdown.placeholder"]}),x.jsx(qA,{...(U=d.button)==null?void 0:U.icon})]}),a&&x.jsx(sD,{root:s??void 0,children:x.jsx(lD,{context:w,modal:!1,children:x.jsx("div",{ref:v.setFloating,className:(b=(W=d.content)==null?void 0:W.container)==null?void 0:b.className,style:{...y,pointerEvents:"auto"},...P(),children:p.map((N,R)=>{var S;return x.jsx("div",{ref:V=>{A.current[R]=V},role:"option",tabIndex:R===u?0:-1,"aria-selected":R===c&&R===u,"data-active":R===u?"":void 0,...(S=d.content)==null?void 0:S.item,...F({onClick(){_(R)},onKeyDown(V){V.key==="Enter"&&(V.preventDefault(),_(R)),V.key===" "&&!E.current&&(V.preventDefault(),_(R))}}),children:N},N)})})})})]})},eg=D.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(QA,{...o.icon})]})});eg.displayName="File";const kD=un()((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 tg={audio:Vp,bubble:Bp,button:HT,carousel:tm,column:qp,dropdown:SD,file:eg,image:Up,location:Wp,row:Yp,text:vT,video:jp,custom:({url:e,name:t,data:n,...r})=>{const i=kD(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?x.jsx("div",{style:{color:"red"},children:a}):o?x.jsx(o,{...n,...r}):null}},Nn=({block:e,renderers:t,...n})=>{const r=(t==null?void 0:t[e.type])??tg[e.type],i={...n,...e};return x.jsx(r,{...i})};function ng(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=ng(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ur(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=ng(e))&&(r&&(r+=" "),r+=t);return r}const xD=({disabled:e,onFileSelected:t})=>{const n=D.useRef(null),{uploadButton:r}=ye.composer,i=Ye(),o=()=>{n.current&&n.current.click()},s=a=>{const l=a.target.files;l&&l.length>0&&Array.from(l).forEach(u=>{t(u)})};return x.jsxs(x.Fragment,{children:[x.jsx(aT,{...r,role:"button",tabIndex:0,"aria-label":i["composer.fileButton.ariaLabel"],"data-disabled":e,onClick:o}),x.jsx("input",{value:"",multiple:!0,type:"file",ref:n,style:{display:"none"},onChange:s})]})},ED=({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=Ye(),c=CD(n.name,f["fileAttachment.fallbackExtension"]),h=["PNG","JPEG","JPG"].includes(c);return r==="loading"?x.jsx(To,{name:e,status:r,removeButton:x.jsx("div",{...o}),extension:c,children:x.jsx("div",{...s.container,children:x.jsx(Al,{type:t,...s.icon})})}):r==="error"?x.jsx(To,{name:e,status:r,removeButton:x.jsx(rg,{removeFile:()=>i(e)}),extension:f["fileAttachment.uploadError"],children:x.jsxs("div",{...s.container,children:[x.jsx(YA,{...l}),x.jsx(Al,{type:t,...s.icon})]})}):r=="uploaded"&&h?x.jsx(To,{name:e,status:r,removeButton:x.jsx(rg,{removeFile:()=>i(e)}),extension:c,children:x.jsx("div",{...s.container,children:x.jsx("img",{src:URL.createObjectURL(n),alt:e,...u})})}):x.jsx(To,{name:e,status:r,removeButton:x.jsx(gp,{onClick:()=>i(e),...a}),extension:c,children:x.jsx("div",{...s.container,children:x.jsx(Al,{type:t,...s.icon})})})},To=({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})]})]})},Al=({type:e,...t})=>e==="image"?x.jsx(XA,{...t}):e==="video"?x.jsx(pT,{...t}):e==="audio"?x.jsx(bp,{...t}):x.jsx(yp,{...t}),CD=(e,t)=>{if(!e)return t;const n=e.split(".").pop();return n?n.toUpperCase():t},rg=({removeFile:e})=>{const{composer:{fileWidget:{removeIcon:t}}}=ye,n=Ye();return x.jsx(gp,{role:"button",tabIndex:0,"aria-label":n["fileAttachment.removeButton.ariaLabel"],onClick:()=>e(),...t})};function Tl(){return Tl=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},Tl.apply(null,arguments)}function AD(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 TD=D.useLayoutEffect,ID=function(t){var n=D.useRef(t);return TD(function(){n.current=t}),n},ig=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},OD=function(t,n){var r=D.useRef();return D.useCallback(function(i){t.current=i,r.current&&ig(r.current,null),r.current=n,n&&ig(n,i)},[n])},og={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},DD=function(t){Object.keys(og).forEach(function(n){t.style.setProperty(n,og[n],"important")})},sg=DD,at=null,ag=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function MD(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),at||(at=document.createElement("textarea"),at.setAttribute("tabindex","-1"),at.setAttribute("aria-hidden","true"),sg(at)),at.parentNode===null&&document.body.appendChild(at);var i=e.paddingSize,o=e.borderSize,s=e.sizingStyle,a=s.boxSizing;Object.keys(s).forEach(function(h){var d=h;at.style[d]=s[d]}),sg(at),at.value=t;var l=ag(at,e);at.value=t,l=ag(at,e),at.value="x";var u=at.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 lg=function(){},ND=function(t,n){return t.reduce(function(r,i){return r[i]=n[i],r},{})},LD=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],_D=!!document.documentElement.currentStyle,PD=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=ND(LD,n),i=r.boxSizing;if(i==="")return null;_D&&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}},FD=PD;function ug(e,t,n){var r=ID(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 RD=function(t){ug(window,"resize",t)},BD=function(t){ug(document.fonts,"loadingdone",t)},$D=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],zD=function(t,n){var r=t.cacheMeasurements,i=t.maxRows,o=t.minRows,s=t.onChange,a=s===void 0?lg:s,l=t.onHeightChange,u=l===void 0?lg:l,f=AD(t,$D),c=f.value!==void 0,h=C.useRef(null),d=OD(h,n),m=C.useRef(0),p=C.useRef(),g=function(){var w=h.current,A=r&&p.current?p.current:FD(w);if(A){p.current=A;var k=MD(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),RD(g),BD(g),C.createElement("textarea",Tl({},f,{onChange:v,ref:d}))},HD=C.forwardRef(zD);const UD=({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=Dp(f||"default",c)(k=>k.messageHistory),[m,p]=D.useState(""),[g,v]=D.useState(!1),{input:y}=ye.composer,w=Ye(),A=k=>{if(!l||!u||!k.clipboardData)return;const E=Array.from(k.clipboardData.files);E.length>0&&(k.preventDefault(),E.forEach(I=>{u(I)}))};return x.jsx(HD,{...y,"aria-label":w["composer.messageInput.ariaLabel"],ref:e,placeholder:t??w["composer.placeholder"],disabled:n,value:r,"data-has-value":!!r,onChange:k=>{const E=k.target.value;o(E),d.includes(E)||s(-1)},onPaste:A,maxRows:5,onKeyDown:k=>{if(n)return;const E=k.nativeEvent;if(!(E.isComposing||E.keyCode===229)&&(r.length===0&&v(!1),k.key!=="ArrowUp"&&k.key!=="ArrowDown"&&k.key!=="ArrowLeft"&&k.key!=="ArrowRight"&&v(!0),k.key==="Enter"&&k.shiftKey?(k.preventDefault(),o(`${r}
289
+ `)):k.key==="Enter"&&(k.preventDefault(),a()),!(r.length>0&&g))){if(k.key==="ArrowUp"){k.preventDefault(),i===-1&&r.trim()!==""&&p(r);const I=Math.min(i+1,d.length-1);s(I),o(d[I]??"")}if(k.key==="ArrowDown"){k.preventDefault();const I=Math.max(i-1,-1);o(i===-1?r.trim():I===-1?m:d[I]??""),s(I)}}}})},jD=({disabled:e,setTextInput:t})=>{const n=Ye(),[r,i]=D.useState(!1),o=D.useRef(null),{voiceButton:s}=ye.composer,a=window.SpeechRecognition||window.webkitSpeechRecognition,l=()=>{o.current||(o.current=new a);const u=o.current;u&&(u.continuous=!0,u.onresult=f=>{var h,d,m;const c=((m=(d=(h=f.results)==null?void 0:h[0])==null?void 0:d[0])==null?void 0:m.transcript)??"";t(c??""),u.stop(),i(!1)},r?(u.stop(),i(!1)):(u.start(),i(!0)))};if(a)return x.jsx(iT,{...s,tabIndex:0,"aria-label":n["composer.voiceButton.ariaLabel"],role:"button","data-show":!e,"data-listens":!!r,onClick:l})},cg=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}=ye,v=Ye(),y=n||r||!s,[w,A]=D.useState(""),[k,E]=D.useState(-1),I=Lp(h||"default"),M=Dp(h||"default",c),L=I($=>$.files),T=I($=>$.setFiles),O=I($=>$.deleteFile),H=I($=>$.uploadFile),P=M($=>$.addMessageToHistory),F=L.filter($=>$.status==="uploaded"),_=!!w.trim()||F.length>0,z=()=>{if(o||!_)return;const $=F.map(W=>{const b=W.url,N=W.type,R=W.fileId;return{video:{type:"video",videoUrl:b,fileId:R},audio:{type:"audio",audioUrl:b,fileId:R},image:{type:"image",imageUrl:b,fileId:R}}[N]??{title:W.name,type:"file",fileUrl:b,fileId:R}})??[];w&&$.push({type:"text",text:w});let U;$.length==1?U=$[0]:U={type:"bloc",items:$.map(b=>{const{type:N,...R}=b;return{type:N,payload:R}})},A(""),u==null||u(U),T([]),P(w),E(-1)};return r?null:x.jsxs(x.Fragment,{children:[x.jsxs("div",{"data-disabled":y,"data-waiting":o,className:ur(g.container.className,e),ref:p,...m,children:[d,L.length>0&&x.jsx("div",{...g==null?void 0:g.fileContainer,children:L.map($=>x.jsx(ED,{...$,removeFile:O},$.name))}),x.jsxs("div",{...g.inputContainer,onClick:()=>{t&&"current"in t&&t.current&&t.current.focus()},children:[i&&x.jsx(xD,{disabled:y,onFileSelected:$=>{f&&H($,f)}}),x.jsx(UD,{inputRef:t,composerPlaceholder:a,composerDisabled:y,textInput:w,historyIndex:k,setTextInput:A,setHistoryIndex:E,sendComposerMessage:z,allowFileUpload:i,onFilePasted:$=>{f&&H($,f)},conversationId:h,storageKey:c}),o&&x.jsx(eT,{...g.inputLoader,role:"status","data-show":o}),!y&&!o&&x.jsxs(x.Fragment,{children:[x.jsx(VA,{...g.sendbutton,role:"button",tabIndex:0,"aria-label":v["composer.sendButton.ariaLabel"],"data-show":_,onClick:()=>z()}),x.jsx(jD,{disabled:_,setTextInput:A})]})]})]}),x.jsx(Nh,{components:{a:({node:$,...U})=>x.jsx("a",{...U,target:"_blank",rel:"noreferrer noopener"})},allowedElements:["a","strong","code","em","p","span"],...g.footer,children:l})]})}));var Il={exports:{}},Io={exports:{}},Ie={};/** @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 eg;function OM(){if(eg)return Te;eg=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,p=e?Symbol.for("react.lazy"):60116,m=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 p:case d:case s:return k;default:return E}}case n:return E}}}function C(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=p,Te.Memo=d,Te.Portal=n,Te.Profiler=o,Te.StrictMode=i,Te.Suspense=c,Te.isAsyncMode=function(k){return C(k)||w(k)===l},Te.isConcurrentMode=C,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)===p},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===p||k.$$typeof===d||k.$$typeof===s||k.$$typeof===a||k.$$typeof===f||k.$$typeof===g||k.$$typeof===v||k.$$typeof===y||k.$$typeof===m)},Te.typeOf=w,Te}var Ie={};/** @license React v16.13.1
296
+ */var fg;function VD(){if(fg)return Ie;fg=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 Ie.AsyncMode=l,Ie.ConcurrentMode=u,Ie.ContextConsumer=a,Ie.ContextProvider=s,Ie.Element=t,Ie.ForwardRef=f,Ie.Fragment=r,Ie.Lazy=m,Ie.Memo=d,Ie.Portal=n,Ie.Profiler=o,Ie.StrictMode=i,Ie.Suspense=c,Ie.isAsyncMode=function(k){return A(k)||w(k)===l},Ie.isConcurrentMode=A,Ie.isContextConsumer=function(k){return w(k)===a},Ie.isContextProvider=function(k){return w(k)===s},Ie.isElement=function(k){return typeof k=="object"&&k!==null&&k.$$typeof===t},Ie.isForwardRef=function(k){return w(k)===f},Ie.isFragment=function(k){return w(k)===r},Ie.isLazy=function(k){return w(k)===m},Ie.isMemo=function(k){return w(k)===d},Ie.isPortal=function(k){return w(k)===n},Ie.isProfiler=function(k){return w(k)===o},Ie.isStrictMode=function(k){return w(k)===i},Ie.isSuspense=function(k){return w(k)===c},Ie.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)},Ie.typeOf=w,Ie}var Oe={};/** @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 tg;function MM(){return tg||(tg=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,p=e?Symbol.for("react.lazy"):60116,m=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===p||$.$$typeof===d||$.$$typeof===s||$.$$typeof===a||$.$$typeof===f||$.$$typeof===g||$.$$typeof===v||$.$$typeof===y||$.$$typeof===m)}function C($){if(typeof $=="object"&&$!==null){var te=$.$$typeof;switch(te){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 p:case d:case s:return Oe;default:return te}}case n:return te}}}var k=l,E=u,I=a,D=s,P=t,T=f,O=r,U=p,L=d,F=n,R=o,N=i,j=c,z=!1;function V($){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($)||C($)===l}function b($){return C($)===u}function _($){return C($)===a}function B($){return C($)===s}function S($){return typeof $=="object"&&$!==null&&$.$$typeof===t}function W($){return C($)===f}function J($){return C($)===r}function Y($){return C($)===p}function G($){return C($)===d}function X($){return C($)===n}function se($){return C($)===o}function K($){return C($)===i}function ne($){return C($)===c}Ie.AsyncMode=k,Ie.ConcurrentMode=E,Ie.ContextConsumer=I,Ie.ContextProvider=D,Ie.Element=P,Ie.ForwardRef=T,Ie.Fragment=O,Ie.Lazy=U,Ie.Memo=L,Ie.Portal=F,Ie.Profiler=R,Ie.StrictMode=N,Ie.Suspense=j,Ie.isAsyncMode=V,Ie.isConcurrentMode=b,Ie.isContextConsumer=_,Ie.isContextProvider=B,Ie.isElement=S,Ie.isForwardRef=W,Ie.isFragment=J,Ie.isLazy=Y,Ie.isMemo=G,Ie.isPortal=X,Ie.isProfiler=se,Ie.isStrictMode=K,Ie.isSuspense=ne,Ie.isValidElementType=w,Ie.typeOf=C}()),Ie}var ng;function rg(){return ng||(ng=1,process.env.NODE_ENV==="production"?To.exports=OM():To.exports=MM()),To.exports}/*
303
+ */var dg;function WD(){return dg||(dg=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(B){return typeof B=="string"||typeof B=="function"||B===r||B===u||B===o||B===i||B===c||B===h||typeof B=="object"&&B!==null&&(B.$$typeof===m||B.$$typeof===d||B.$$typeof===s||B.$$typeof===a||B.$$typeof===f||B.$$typeof===g||B.$$typeof===v||B.$$typeof===y||B.$$typeof===p)}function A(B){if(typeof B=="object"&&B!==null){var ne=B.$$typeof;switch(ne){case t:var me=B.type;switch(me){case l:case u:case r:case o:case i:case c:return me;default:var we=me&&me.$$typeof;switch(we){case a:case f:case m:case d:case s:return we;default:return ne}}case n:return ne}}}var k=l,E=u,I=a,M=s,L=t,T=f,O=r,H=m,P=d,F=n,_=o,z=i,$=c,U=!1;function W(B){return U||(U=!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(B)||A(B)===l}function b(B){return A(B)===u}function N(B){return A(B)===a}function R(B){return A(B)===s}function S(B){return typeof B=="object"&&B!==null&&B.$$typeof===t}function V(B){return A(B)===f}function ee(B){return A(B)===r}function Y(B){return A(B)===m}function G(B){return A(B)===d}function J(B){return A(B)===n}function se(B){return A(B)===o}function K(B){return A(B)===i}function re(B){return A(B)===c}Oe.AsyncMode=k,Oe.ConcurrentMode=E,Oe.ContextConsumer=I,Oe.ContextProvider=M,Oe.Element=L,Oe.ForwardRef=T,Oe.Fragment=O,Oe.Lazy=H,Oe.Memo=P,Oe.Portal=F,Oe.Profiler=_,Oe.StrictMode=z,Oe.Suspense=$,Oe.isAsyncMode=W,Oe.isConcurrentMode=b,Oe.isContextConsumer=N,Oe.isContextProvider=R,Oe.isElement=S,Oe.isForwardRef=V,Oe.isFragment=ee,Oe.isLazy=Y,Oe.isMemo=G,Oe.isPortal=J,Oe.isProfiler=se,Oe.isStrictMode=K,Oe.isSuspense=re,Oe.isValidElementType=w,Oe.typeOf=A}()),Oe}var hg;function pg(){return hg||(hg=1,process.env.NODE_ENV==="production"?Io.exports=VD():Io.exports=WD()),Io.exports}/*
304
304
  object-assign
305
305
  (c) Sindre Sorhus
306
306
  @license MIT
307
- */var Il,ig;function DM(){if(ig)return Il;ig=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,og;function Ml(){if(og)return Ol;og=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Ol=e,Ol}var Dl,sg;function ag(){return sg||(sg=1,Dl=Function.call.bind(Object.prototype.hasOwnProperty)),Dl}var Nl,lg;function NM(){if(lg)return Nl;lg=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Ml(),n={},r=ag();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(p){c=p}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,ug;function _M(){if(ug)return _l;ug=1;var e=rg(),t=DM(),n=Ml(),r=ag(),i=NM(),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: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:C(),elementType:k(),instanceOf:E,node:T(),objectOf:D,oneOf:I,oneOfType:P,shape:U,exact:L};function p(b,_){return b===_?b!==0||1/b===1/_:b!==b&&_!==_}function m(b,_){this.message=b,this.data=_&&typeof _=="object"?_:{},this.stack=""}m.prototype=Error.prototype;function g(b){if(process.env.NODE_ENV!=="production")var _={},B=0;function S(J,Y,G,X,se,K,ne){if(X=X||h,K=K||G,ne!==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 te=X+":"+G;!_[te]&&B<3&&(o("You are manually calling a React.PropTypes validation function for the `"+K+"` 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."),_[te]=!0,B++)}}return Y[G]==null?J?Y[G]===null?new m("The "+se+" `"+K+"` is marked as required "+("in `"+X+"`, but its value is `null`.")):new m("The "+se+" `"+K+"` is marked as required in "+("`"+X+"`, but its value is `undefined`.")):null:b(Y,G,X,se,K)}var W=S.bind(null,!1);return W.isRequired=S.bind(null,!0),W}function v(b){function _(B,S,W,J,Y,G){var X=B[S],se=N(X);if(se!==b){var K=j(X);return new m("Invalid "+J+" `"+Y+"` of type "+("`"+K+"` supplied to `"+W+"`, expected ")+("`"+b+"`."),{expectedType:b})}return null}return g(_)}function y(){return g(s)}function w(b){function _(B,S,W,J,Y){if(typeof b!="function")return new m("Property `"+Y+"` of component `"+W+"` has invalid PropType notation inside arrayOf.");var G=B[S];if(!Array.isArray(G)){var X=N(G);return new m("Invalid "+J+" `"+Y+"` of type "+("`"+X+"` supplied to `"+W+"`, expected an array."))}for(var se=0;se<G.length;se++){var K=b(G,se,W,J,Y+"["+se+"]",n);if(K instanceof Error)return K}return null}return g(_)}function C(){function b(_,B,S,W,J){var Y=_[B];if(!a(Y)){var G=N(Y);return new m("Invalid "+W+" `"+J+"` of type "+("`"+G+"` supplied to `"+S+"`, expected a single ReactElement."))}return null}return g(b)}function k(){function b(_,B,S,W,J){var Y=_[B];if(!e.isValidElementType(Y)){var G=N(Y);return new m("Invalid "+W+" `"+J+"` of type "+("`"+G+"` supplied to `"+S+"`, expected a single ReactElement type."))}return null}return g(b)}function E(b){function _(B,S,W,J,Y){if(!(B[S]instanceof b)){var G=b.name||h,X=V(B[S]);return new m("Invalid "+J+" `"+Y+"` of type "+("`"+X+"` supplied to `"+W+"`, expected ")+("instance of `"+G+"`."))}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 _(B,S,W,J,Y){for(var G=B[S],X=0;X<b.length;X++)if(p(G,b[X]))return null;var se=JSON.stringify(b,function(ne,$){var te=j($);return te==="symbol"?String($):$});return new m("Invalid "+J+" `"+Y+"` of value `"+String(G)+"` "+("supplied to `"+W+"`, expected one of "+se+"."))}return g(_)}function D(b){function _(B,S,W,J,Y){if(typeof b!="function")return new m("Property `"+Y+"` of component `"+W+"` has invalid PropType notation inside objectOf.");var G=B[S],X=N(G);if(X!=="object")return new m("Invalid "+J+" `"+Y+"` of type "+("`"+X+"` supplied to `"+W+"`, expected an object."));for(var se in G)if(r(G,se)){var K=b(G,se,W,J,Y+"."+se,n);if(K instanceof Error)return K}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 B=b[_];if(typeof B!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+z(B)+" at index "+_+"."),s}function S(W,J,Y,G,X){for(var se=[],K=0;K<b.length;K++){var ne=b[K],$=ne(W,J,Y,G,X,n);if($==null)return null;$.data&&r($.data,"expectedType")&&se.push($.data.expectedType)}var te=se.length>0?", expected one of type ["+se.join(", ")+"]":"";return new m("Invalid "+G+" `"+X+"` supplied to "+("`"+Y+"`"+te+"."))}return g(S)}function T(){function b(_,B,S,W,J){return F(_[B])?null:new m("Invalid "+W+" `"+J+"` supplied to "+("`"+S+"`, expected a ReactNode."))}return g(b)}function O(b,_,B,S,W){return new m((b||"React class")+": "+_+" type `"+B+"."+S+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+W+"`.")}function U(b){function _(B,S,W,J,Y){var G=B[S],X=N(G);if(X!=="object")return new m("Invalid "+J+" `"+Y+"` of type `"+X+"` "+("supplied to `"+W+"`, expected `object`."));for(var se in b){var K=b[se];if(typeof K!="function")return O(W,J,Y,se,j(K));var ne=K(G,se,W,J,Y+"."+se,n);if(ne)return ne}return null}return g(_)}function L(b){function _(B,S,W,J,Y){var G=B[S],X=N(G);if(X!=="object")return new m("Invalid "+J+" `"+Y+"` of type `"+X+"` "+("supplied to `"+W+"`, expected `object`."));var se=t({},B[S],b);for(var K in se){var ne=b[K];if(r(b,K)&&typeof ne!="function")return O(W,J,Y,K,j(ne));if(!ne)return new m("Invalid "+J+" `"+Y+"` key `"+K+"` supplied to `"+W+"`.\nBad object: "+JSON.stringify(B[S],null," ")+`
308
- Valid keys: `+JSON.stringify(Object.keys(b),null," "));var $=ne(G,K,W,J,Y+"."+K,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 B=_.call(b),S;if(_!==b.entries){for(;!(S=B.next()).done;)if(!F(S.value))return!1}else for(;!(S=B.next()).done;){var W=S.value;if(W&&!F(W[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 z(b){var _=j(b);switch(_){case"array":case"object":return"an "+_;case"boolean":case"date":case"regexp":return"a "+_;default:return _}}function V(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,cg;function PM(){if(cg)return Pl;cg=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 LM=rg(),FM=!0;Tl.exports=_M()(LM.isElement,FM)}else Tl.exports=PM()();var RM=Tl.exports;const Ne=vn(RM);var $M=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=BM(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 BM(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),i=$M.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var zM=[".DS_Store","Thumbs.db"];function UM(e){return Zn(this,void 0,void 0,function(){return Jn(this,function(t){return Io(e)&&HM(e.dataTransfer)?[2,qM(e.dataTransfer,e.type)]:jM(e)?[2,VM(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,WM(e)]:[2,[]]})})}function HM(e){return Io(e)}function jM(e){return Io(e)&&Io(e.target)}function Io(e){return typeof e=="object"&&e!==null}function VM(e){return Ll(e.target.files).map(function(t){return li(t)})}function WM(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 qM(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(YM))]):[3,2];case 1:return r=i.sent(),[2,fg(dg(r))];case 2:return[2,fg(Ll(e.files).map(function(o){return li(o)}))]}})})}function fg(e){return e.filter(function(t){return zM.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 YM(e){if(typeof e.webkitGetAsEntry!="function")return hg(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?pg(t):hg(e)}function dg(e){return e.reduce(function(t,n){return Ga(Ga([],Mp(t),!1),Mp(Array.isArray(n)?dg(n):[n]),!1)},[])}function hg(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 KM(e){return Zn(this,void 0,void 0,function(){return Jn(this,function(t){return[2,e.isDirectory?pg(e):GM(e)]})})}function pg(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(KM)),i.push(f),o(),c.label=6;case 6:return[2]}})})},function(a){r(a)})}o()})}function GM(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 QM=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 mg(e){return XM(e)||JM(e)||bg(e)||ZM()}function ZM(){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 JM(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function XM(e){if(Array.isArray(e))return Fl(e)}function gg(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 yg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gg(Object(n),!0).forEach(function(r){vg(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gg(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vg(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 nD(e)||tD(e,t)||bg(e,t)||eD()}function eD(){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 bg(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 tD(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 nD(e){if(Array.isArray(e))return e}var rD="file-invalid-type",iD="file-too-large",oD="file-too-small",sD="too-many-files",aD=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:rD,message:"File type must be ".concat(n)}},wg=function(t){return{code:iD,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},Sg=function(t){return{code:oD,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},lD={code:sD,message:"Too many files"};function xg(e,t){var n=e.type==="application/x-moz-file"||QM(e,t);return[n,n?null:aD(t)]}function kg(e,t,n){if(Nn(e.size))if(Nn(t)&&Nn(n)){if(e.size>n)return[!1,wg(n)];if(e.size<t)return[!1,Sg(t)]}else{if(Nn(t)&&e.size<t)return[!1,Sg(t)];if(Nn(n)&&e.size>n)return[!1,wg(n)]}return[!0,null]}function Nn(e){return e!=null}function uD(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=xg(l,n),f=ui(u,1),c=f[0],h=kg(l,r,i),d=ui(h,1),p=d[0],m=a?a(l):null;return c&&p&&!m})}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 Eg(e){e.preventDefault()}function cD(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function fD(e){return e.indexOf("Edge/")!==-1}function dD(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return cD(e)||fD(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 hD(){return"showOpenFilePicker"in window}function pD(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 Cg(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(Ag))&&(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 yg(yg({},n),{},vg({},o,s))},{});return[{description:"Files",accept:t}]}return e}function mD(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(mg(t),[i],mg(o))},[]).filter(function(t){return Cg(t)||Ag(t)}).join(",")}function gD(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function yD(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function Cg(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function Ag(e){return/^.*\.[\w]+$/.test(e)}var vD=["children"],bD=["open"],wD=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],SD=["refKey","onChange","onClick"];function xD(e){return CD(e)||ED(e)||Tg(e)||kD()}function kD(){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 ED(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function CD(e){if(Array.isArray(e))return $l(e)}function Rl(e,t){return ID(e)||TD(e,t)||Tg(e,t)||AD()}function AD(){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 Tg(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 TD(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 ID(e){if(Array.isArray(e))return e}function Ig(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?Ig(Object(n),!0).forEach(function(r){Bl(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ig(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=OD(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 OD(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=M.forwardRef(function(e,t){var n=e.children,r=Do(e,vD),i=Mg(r),o=i.open,s=Do(i,bD);return M.useImperativeHandle(t,function(){return{open:o}},[o]),M.createElement(M.Fragment,null,n(Be(Be({},s),{},{open:o})))});zl.displayName="Dropzone";var Og={disabled:!1,getFilesFromEvent:UM,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=Og,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 Mg(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Be(Be({},Og),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,p=t.onDropRejected,m=t.onFileDialogCancel,g=t.onFileDialogOpen,v=t.useFsAccessApi,y=t.autoFocus,w=t.preventDropOnDocument,C=t.noClick,k=t.noKeyboard,E=t.noDrag,I=t.noDragEventsBubbling,D=t.onError,P=t.validator,T=M.useMemo(function(){return mD(n)},[n]),O=M.useMemo(function(){return pD(n)},[n]),U=M.useMemo(function(){return typeof g=="function"?g:Dg},[g]),L=M.useMemo(function(){return typeof m=="function"?m:Dg},[m]),F=M.useRef(null),R=M.useRef(null),N=M.useReducer(MD,Ul),j=Rl(N,2),z=j[0],V=j[1],b=z.isFocused,_=z.isFileDialogActive,B=M.useRef(typeof window<"u"&&window.isSecureContext&&v&&hD()),S=function(){!B.current&&_&&setTimeout(function(){if(R.current){var ae=R.current.files;ae.length||(V({type:"closeDialog"}),L())}},300)};M.useEffect(function(){return window.addEventListener("focus",S,!1),function(){window.removeEventListener("focus",S,!1)}},[R,_,L,B]);var W=M.useRef([]),J=function(ae){F.current&&F.current.contains(ae.target)||(ae.preventDefault(),W.current=[])};M.useEffect(function(){return w&&(document.addEventListener("dragover",Eg,!1),document.addEventListener("drop",J,!1)),function(){w&&(document.removeEventListener("dragover",Eg),document.removeEventListener("drop",J))}},[F,w]),M.useEffect(function(){return!r&&y&&F.current&&F.current.focus(),function(){}},[F,y,r]);var Y=M.useCallback(function(ee){D?D(ee):console.error(ee)},[D]),G=M.useCallback(function(ee){ee.preventDefault(),ee.persist(),Ae(ee),W.current=[].concat(xD(W.current),[ee.target]),Mo(ee)&&Promise.resolve(i(ee)).then(function(ae){if(!(Oo(ee)&&!I)){var H=ae.length,q=H>0&&uD({files:ae,accept:T,minSize:s,maxSize:o,multiple:a,maxFiles:l,validator:P}),oe=H>0&&!q;V({isDragAccept:q,isDragReject:oe,isDragActive:!0,type:"setDraggedFiles"}),u&&u(ee)}}).catch(function(ae){return Y(ae)})},[i,u,Y,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=W.current.filter(function(q){return F.current&&F.current.contains(q)}),H=ae.indexOf(ee.target);H!==-1&&ae.splice(H,1),W.current=ae,!(ae.length>0)&&(V({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Mo(ee)&&f&&f(ee))},[F,f,I]),K=M.useCallback(function(ee,ae){var H=[],q=[];ee.forEach(function(oe){var le=xg(oe,T),he=Rl(le,2),je=he[0],Ge=he[1],Ze=kg(oe,s,o),Et=Rl(Ze,2),Rt=Et[0],Qe=Et[1],Ct=P?P(oe):null;if(je&&Rt&&!Ct)H.push(oe);else{var at=[Ge,Qe];Ct&&(at=at.concat(Ct)),q.push({file:oe,errors:at.filter(function(es){return es})})}}),(!a&&H.length>1||a&&l>=1&&H.length>l)&&(H.forEach(function(oe){q.push({file:oe,errors:[lD]})}),H.splice(0)),V({acceptedFiles:H,fileRejections:q,type:"setFiles"}),h&&h(H,q,ae),q.length>0&&p&&p(q,ae),H.length>0&&d&&d(H,ae)},[V,a,T,s,o,l,h,d,p,P]),ne=M.useCallback(function(ee){ee.preventDefault(),ee.persist(),Ae(ee),W.current=[],Mo(ee)&&Promise.resolve(i(ee)).then(function(ae){Oo(ee)&&!I||K(ae,ee)}).catch(function(ae){return Y(ae)}),V({type:"reset"})},[i,K,Y,I]),$=M.useCallback(function(){if(B.current){V({type:"openDialog"}),U();var ee={multiple:a,types:O};window.showOpenFilePicker(ee).then(function(ae){return i(ae)}).then(function(ae){K(ae,null),V({type:"closeDialog"})}).catch(function(ae){gD(ae)?(L(ae),V({type:"closeDialog"})):yD(ae)?(B.current=!1,R.current?(R.current.value=null,R.current.click()):Y(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."))):Y(ae)});return}R.current&&(V({type:"openDialog"}),U(),R.current.value=null,R.current.click())},[V,U,L,v,K,Y,O,a]),te=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(){V({type:"focus"})},[]),Oe=M.useCallback(function(){V({type:"blur"})},[]),Z=M.useCallback(function(){C||(dD()?setTimeout($,0):$())},[C,$]),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,H=ae===void 0?"ref":ae,q=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,wD);return Be(Be(Bl({onKeyDown:de(jt(oe,te)),onFocus:de(jt(le,me)),onBlur:de(jt(he,Oe)),onClick:ue(jt(je,Z)),onDragEnter:fe(jt(Ge,G)),onDragOver:fe(jt(Ze,X)),onDragLeave:fe(jt(Et,se)),onDrop:fe(jt(Rt,ne)),role:typeof q=="string"&&q!==""?q:"presentation"},H,F),!r&&!k?{tabIndex:0}:{}),Qe)}},[F,te,me,Oe,Z,G,X,se,ne,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,H=ae===void 0?"ref":ae,q=ee.onChange,oe=ee.onClick,le=Do(ee,SD),he=Bl({accept:T,multiple:a,type:"file",style:{display:"none"},onChange:ue(jt(q,ne)),onClick:ue(jt(oe,Me)),tabIndex:-1},H,R);return Be(Be({},he),le)}},[R,n,a,ne,r]);return Be(Be({},z),{},{isFocused:b&&!r,getRootProps:Fe,getInputProps:He,rootRef:F,inputRef:R,open:ue($)})}function MD(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 Dg(){}const Ng=({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((p,m)=>{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(),p(t.current),o()},onCancel:()=>{c==null||c(),m(),o()}})}),o=()=>{r(s=>({...s,open:!1}))};return x.jsxs(Ya.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]})},DD=(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)},_g=({color:e,fontFamily:t,radius:n,themeMode:r,variant:i,headerVariant:o,additionalStylesheet:s,additionalStylesheetUrl:a})=>{M.useMemo(()=>{t&&DD(t,["100","200","300","400","500","600","700","800"])},[t]);const l=M.useMemo(()=>Pf({color:e,fontFamily:t,radius:n,themeMode:r,variant:i,headerVariant:o}),[e,t,n,r,i,o]);return x.jsxs(x.Fragment,{children:[a&&x.jsx("link",{rel:"stylesheet",href:a}),x.jsxs("style",{children:[l,`
307
+ */var Ol,mg;function qD(){if(mg)return Ol;mg=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 Ol=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},Ol}var Dl,gg;function Ml(){if(gg)return Dl;gg=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Dl=e,Dl}var Nl,yg;function vg(){return yg||(yg=1,Nl=Function.call.bind(Object.prototype.hasOwnProperty)),Nl}var Ll,bg;function YD(){if(bg)return Ll;bg=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Ml(),n={},r=vg();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={})},Ll=i,Ll}var _l,wg;function KD(){if(wg)return _l;wg=1;var e=pg(),t=qD(),n=Ml(),r=vg(),i=YD(),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 N=b&&(u&&b[u]||b[f]);if(typeof N=="function")return N}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:M,oneOf:I,oneOfType:L,shape:H,exact:P};function m(b,N){return b===N?b!==0||1/b===1/N:b!==b&&N!==N}function p(b,N){this.message=b,this.data=N&&typeof N=="object"?N:{},this.stack=""}p.prototype=Error.prototype;function g(b){if(process.env.NODE_ENV!=="production")var N={},R=0;function S(ee,Y,G,J,se,K,re){if(J=J||h,K=K||G,re!==n){if(l){var B=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 B.name="Invariant Violation",B}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ne=J+":"+G;!N[ne]&&R<3&&(o("You are manually calling a React.PropTypes validation function for the `"+K+"` prop on `"+J+"`. 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."),N[ne]=!0,R++)}}return Y[G]==null?ee?Y[G]===null?new p("The "+se+" `"+K+"` is marked as required "+("in `"+J+"`, but its value is `null`.")):new p("The "+se+" `"+K+"` is marked as required in "+("`"+J+"`, but its value is `undefined`.")):null:b(Y,G,J,se,K)}var V=S.bind(null,!1);return V.isRequired=S.bind(null,!0),V}function v(b){function N(R,S,V,ee,Y,G){var J=R[S],se=z(J);if(se!==b){var K=$(J);return new p("Invalid "+ee+" `"+Y+"` of type "+("`"+K+"` supplied to `"+V+"`, expected ")+("`"+b+"`."),{expectedType:b})}return null}return g(N)}function y(){return g(s)}function w(b){function N(R,S,V,ee,Y){if(typeof b!="function")return new p("Property `"+Y+"` of component `"+V+"` has invalid PropType notation inside arrayOf.");var G=R[S];if(!Array.isArray(G)){var J=z(G);return new p("Invalid "+ee+" `"+Y+"` of type "+("`"+J+"` supplied to `"+V+"`, expected an array."))}for(var se=0;se<G.length;se++){var K=b(G,se,V,ee,Y+"["+se+"]",n);if(K instanceof Error)return K}return null}return g(N)}function A(){function b(N,R,S,V,ee){var Y=N[R];if(!a(Y)){var G=z(Y);return new p("Invalid "+V+" `"+ee+"` of type "+("`"+G+"` supplied to `"+S+"`, expected a single ReactElement."))}return null}return g(b)}function k(){function b(N,R,S,V,ee){var Y=N[R];if(!e.isValidElementType(Y)){var G=z(Y);return new p("Invalid "+V+" `"+ee+"` of type "+("`"+G+"` supplied to `"+S+"`, expected a single ReactElement type."))}return null}return g(b)}function E(b){function N(R,S,V,ee,Y){if(!(R[S]instanceof b)){var G=b.name||h,J=W(R[S]);return new p("Invalid "+ee+" `"+Y+"` of type "+("`"+J+"` supplied to `"+V+"`, expected ")+("instance of `"+G+"`."))}return null}return g(N)}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 N(R,S,V,ee,Y){for(var G=R[S],J=0;J<b.length;J++)if(m(G,b[J]))return null;var se=JSON.stringify(b,function(re,B){var ne=$(B);return ne==="symbol"?String(B):B});return new p("Invalid "+ee+" `"+Y+"` of value `"+String(G)+"` "+("supplied to `"+V+"`, expected one of "+se+"."))}return g(N)}function M(b){function N(R,S,V,ee,Y){if(typeof b!="function")return new p("Property `"+Y+"` of component `"+V+"` has invalid PropType notation inside objectOf.");var G=R[S],J=z(G);if(J!=="object")return new p("Invalid "+ee+" `"+Y+"` of type "+("`"+J+"` supplied to `"+V+"`, expected an object."));for(var se in G)if(r(G,se)){var K=b(G,se,V,ee,Y+"."+se,n);if(K instanceof Error)return K}return null}return g(N)}function L(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 N=0;N<b.length;N++){var R=b[N];if(typeof R!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+U(R)+" at index "+N+"."),s}function S(V,ee,Y,G,J){for(var se=[],K=0;K<b.length;K++){var re=b[K],B=re(V,ee,Y,G,J,n);if(B==null)return null;B.data&&r(B.data,"expectedType")&&se.push(B.data.expectedType)}var ne=se.length>0?", expected one of type ["+se.join(", ")+"]":"";return new p("Invalid "+G+" `"+J+"` supplied to "+("`"+Y+"`"+ne+"."))}return g(S)}function T(){function b(N,R,S,V,ee){return F(N[R])?null:new p("Invalid "+V+" `"+ee+"` supplied to "+("`"+S+"`, expected a ReactNode."))}return g(b)}function O(b,N,R,S,V){return new p((b||"React class")+": "+N+" type `"+R+"."+S+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+V+"`.")}function H(b){function N(R,S,V,ee,Y){var G=R[S],J=z(G);if(J!=="object")return new p("Invalid "+ee+" `"+Y+"` of type `"+J+"` "+("supplied to `"+V+"`, expected `object`."));for(var se in b){var K=b[se];if(typeof K!="function")return O(V,ee,Y,se,$(K));var re=K(G,se,V,ee,Y+"."+se,n);if(re)return re}return null}return g(N)}function P(b){function N(R,S,V,ee,Y){var G=R[S],J=z(G);if(J!=="object")return new p("Invalid "+ee+" `"+Y+"` of type `"+J+"` "+("supplied to `"+V+"`, expected `object`."));var se=t({},R[S],b);for(var K in se){var re=b[K];if(r(b,K)&&typeof re!="function")return O(V,ee,Y,K,$(re));if(!re)return new p("Invalid "+ee+" `"+Y+"` key `"+K+"` supplied to `"+V+"`.\nBad object: "+JSON.stringify(R[S],null," ")+`
308
+ Valid keys: `+JSON.stringify(Object.keys(b),null," "));var B=re(G,K,V,ee,Y+"."+K,n);if(B)return B}return null}return g(N)}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 N=c(b);if(N){var R=N.call(b),S;if(N!==b.entries){for(;!(S=R.next()).done;)if(!F(S.value))return!1}else for(;!(S=R.next()).done;){var V=S.value;if(V&&!F(V[1]))return!1}}else return!1;return!0;default:return!1}}function _(b,N){return b==="symbol"?!0:N?N["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&N instanceof Symbol:!1}function z(b){var N=typeof b;return Array.isArray(b)?"array":b instanceof RegExp?"object":_(N,b)?"symbol":N}function $(b){if(typeof b>"u"||b===null)return""+b;var N=z(b);if(N==="object"){if(b instanceof Date)return"date";if(b instanceof RegExp)return"regexp"}return N}function U(b){var N=$(b);switch(N){case"array":case"object":return"an "+N;case"boolean":case"date":case"regexp":return"a "+N;default:return N}}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,Sg;function GD(){if(Sg)return Pl;Sg=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 QD=pg(),ZD=!0;Il.exports=KD()(QD.isElement,ZD)}else Il.exports=GD()();var JD=Il.exports;const Ne=bn(JD);var XD=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 fi(e,t){var n=eM(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 eM(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),i=XD.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var tM=[".DS_Store","Thumbs.db"];function nM(e){return Xn(this,void 0,void 0,function(){return er(this,function(t){return Oo(e)&&rM(e.dataTransfer)?[2,aM(e.dataTransfer,e.type)]:iM(e)?[2,oM(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,sM(e)]:[2,[]]})})}function rM(e){return Oo(e)}function iM(e){return Oo(e)&&Oo(e.target)}function Oo(e){return typeof e=="object"&&e!==null}function oM(e){return Fl(e.target.files).map(function(t){return fi(t)})}function sM(e){return Xn(this,void 0,void 0,function(){var t;return er(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 fi(r)})]}})})}function aM(e,t){return Xn(this,void 0,void 0,function(){var n,r;return er(this,function(i){switch(i.label){case 0:return e.items?(n=Fl(e.items).filter(function(o){return o.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(lM))]):[3,2];case 1:return r=i.sent(),[2,kg(xg(r))];case 2:return[2,kg(Fl(e.files).map(function(o){return fi(o)}))]}})})}function kg(e){return e.filter(function(t){return tM.indexOf(t.name)===-1})}function Fl(e){if(e===null)return[];for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r)}return t}function lM(e){if(typeof e.webkitGetAsEntry!="function")return Eg(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?Cg(t):Eg(e)}function xg(e){return e.reduce(function(t,n){return Qa(Qa([],Hp(t),!1),Hp(Array.isArray(n)?xg(n):[n]),!1)},[])}function Eg(e){var t=e.getAsFile();if(!t)return Promise.reject("".concat(e," is not a File"));var n=fi(t);return Promise.resolve(n)}function uM(e){return Xn(this,void 0,void 0,function(){return er(this,function(t){return[2,e.isDirectory?Cg(e):cM(e)]})})}function Cg(e){var t=e.createReader();return new Promise(function(n,r){var i=[];function o(){var s=this;t.readEntries(function(a){return Xn(s,void 0,void 0,function(){var l,u,f;return er(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(uM)),i.push(f),o(),c.label=6;case 6:return[2]}})})},function(a){r(a)})}o()})}function cM(e){return Xn(this,void 0,void 0,function(){return er(this,function(t){return[2,new Promise(function(n,r){e.file(function(i){var o=fi(i,e.fullPath);n(o)},function(i){r(i)})})]})})}var fM=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 Ag(e){return pM(e)||hM(e)||Dg(e)||dM()}function dM(){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 hM(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function pM(e){if(Array.isArray(e))return Rl(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 Ig(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){Og(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 Og(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function di(e,t){return yM(e)||gM(e,t)||Dg(e,t)||mM()}function mM(){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 Dg(e,t){if(e){if(typeof e=="string")return Rl(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 Rl(e,t)}}function Rl(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 gM(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 yM(e){if(Array.isArray(e))return e}var vM="file-invalid-type",bM="file-too-large",wM="file-too-small",SM="too-many-files",kM=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:vM,message:"File type must be ".concat(n)}},Mg=function(t){return{code:bM,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},Ng=function(t){return{code:wM,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},xM={code:SM,message:"Too many files"};function Lg(e,t){var n=e.type==="application/x-moz-file"||fM(e,t);return[n,n?null:kM(t)]}function _g(e,t,n){if(Ln(e.size))if(Ln(t)&&Ln(n)){if(e.size>n)return[!1,Mg(n)];if(e.size<t)return[!1,Ng(t)]}else{if(Ln(t)&&e.size<t)return[!1,Ng(t)];if(Ln(n)&&e.size>n)return[!1,Mg(n)]}return[!0,null]}function Ln(e){return e!=null}function EM(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=Lg(l,n),f=di(u,1),c=f[0],h=_g(l,r,i),d=di(h,1),m=d[0],p=a?a(l):null;return c&&m&&!p})}function Do(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 Pg(e){e.preventDefault()}function CM(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function AM(e){return e.indexOf("Edge/")!==-1}function TM(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return CM(e)||AM(e)}function Vt(){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!Do(r)&&a&&a.apply(void 0,[r].concat(o)),Do(r)})}}function IM(){return"showOpenFilePicker"in window}function OM(e){if(Ln(e)){var t=Object.entries(e).filter(function(n){var r=di(n,2),i=r[0],o=r[1],s=!0;return Fg(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(Rg))&&(console.warn('Skipped "'.concat(i,'" because an invalid file extension was provided.')),s=!1),s}).reduce(function(n,r){var i=di(r,2),o=i[0],s=i[1];return Ig(Ig({},n),{},Og({},o,s))},{});return[{description:"Files",accept:t}]}return e}function DM(e){if(Ln(e))return Object.entries(e).reduce(function(t,n){var r=di(n,2),i=r[0],o=r[1];return[].concat(Ag(t),[i],Ag(o))},[]).filter(function(t){return Fg(t)||Rg(t)}).join(",")}function MM(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function NM(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function Fg(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function Rg(e){return/^.*\.[\w]+$/.test(e)}var LM=["children"],_M=["open"],PM=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],FM=["refKey","onChange","onClick"];function RM(e){return zM(e)||$M(e)||Bg(e)||BM()}function BM(){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 $M(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function zM(e){if(Array.isArray(e))return $l(e)}function Bl(e,t){return jM(e)||UM(e,t)||Bg(e,t)||HM()}function HM(){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 Bg(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 UM(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 jM(e){if(Array.isArray(e))return e}function $g(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 $e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$g(Object(n),!0).forEach(function(r){zl(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$g(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function No(e,t){if(e==null)return{};var n=VM(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 VM(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 Hl=D.forwardRef(function(e,t){var n=e.children,r=No(e,LM),i=Hg(r),o=i.open,s=No(i,_M);return D.useImperativeHandle(t,function(){return{open:o}},[o]),D.createElement(D.Fragment,null,n($e($e({},s),{},{open:o})))});Hl.displayName="Dropzone";var zg={disabled:!1,getFilesFromEvent:nM,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};Hl.defaultProps=zg,Hl.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 Hg(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=$e($e({},zg),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,M=t.onError,L=t.validator,T=D.useMemo(function(){return DM(n)},[n]),O=D.useMemo(function(){return OM(n)},[n]),H=D.useMemo(function(){return typeof g=="function"?g:Ug},[g]),P=D.useMemo(function(){return typeof p=="function"?p:Ug},[p]),F=D.useRef(null),_=D.useRef(null),z=D.useReducer(WM,Ul),$=Bl(z,2),U=$[0],W=$[1],b=U.isFocused,N=U.isFileDialogActive,R=D.useRef(typeof window<"u"&&window.isSecureContext&&v&&IM()),S=function(){!R.current&&N&&setTimeout(function(){if(_.current){var ae=_.current.files;ae.length||(W({type:"closeDialog"}),P())}},300)};D.useEffect(function(){return window.addEventListener("focus",S,!1),function(){window.removeEventListener("focus",S,!1)}},[_,N,P,R]);var V=D.useRef([]),ee=function(ae){F.current&&F.current.contains(ae.target)||(ae.preventDefault(),V.current=[])};D.useEffect(function(){return w&&(document.addEventListener("dragover",Pg,!1),document.addEventListener("drop",ee,!1)),function(){w&&(document.removeEventListener("dragover",Pg),document.removeEventListener("drop",ee))}},[F,w]),D.useEffect(function(){return!r&&y&&F.current&&F.current.focus(),function(){}},[F,y,r]);var Y=D.useCallback(function(te){M?M(te):console.error(te)},[M]),G=D.useCallback(function(te){te.preventDefault(),te.persist(),Te(te),V.current=[].concat(RM(V.current),[te.target]),Mo(te)&&Promise.resolve(i(te)).then(function(ae){if(!(Do(te)&&!I)){var j=ae.length,q=j>0&&EM({files:ae,accept:T,minSize:s,maxSize:o,multiple:a,maxFiles:l,validator:L}),oe=j>0&&!q;W({isDragAccept:q,isDragReject:oe,isDragActive:!0,type:"setDraggedFiles"}),u&&u(te)}}).catch(function(ae){return Y(ae)})},[i,u,Y,I,T,s,o,a,l,L]),J=D.useCallback(function(te){te.preventDefault(),te.persist(),Te(te);var ae=Mo(te);if(ae&&te.dataTransfer)try{te.dataTransfer.dropEffect="copy"}catch{}return ae&&c&&c(te),!1},[c,I]),se=D.useCallback(function(te){te.preventDefault(),te.persist(),Te(te);var ae=V.current.filter(function(q){return F.current&&F.current.contains(q)}),j=ae.indexOf(te.target);j!==-1&&ae.splice(j,1),V.current=ae,!(ae.length>0)&&(W({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Mo(te)&&f&&f(te))},[F,f,I]),K=D.useCallback(function(te,ae){var j=[],q=[];te.forEach(function(oe){var le=Lg(oe,T),he=Bl(le,2),je=he[0],Qe=he[1],Je=_g(oe,s,o),Ct=Bl(Je,2),Bt=Ct[0],Ze=Ct[1],At=L?L(oe):null;if(je&&Bt&&!At)j.push(oe);else{var lt=[Qe,Ze];At&&(lt=lt.concat(At)),q.push({file:oe,errors:lt.filter(function(ts){return ts})})}}),(!a&&j.length>1||a&&l>=1&&j.length>l)&&(j.forEach(function(oe){q.push({file:oe,errors:[xM]})}),j.splice(0)),W({acceptedFiles:j,fileRejections:q,type:"setFiles"}),h&&h(j,q,ae),q.length>0&&m&&m(q,ae),j.length>0&&d&&d(j,ae)},[W,a,T,s,o,l,h,d,m,L]),re=D.useCallback(function(te){te.preventDefault(),te.persist(),Te(te),V.current=[],Mo(te)&&Promise.resolve(i(te)).then(function(ae){Do(te)&&!I||K(ae,te)}).catch(function(ae){return Y(ae)}),W({type:"reset"})},[i,K,Y,I]),B=D.useCallback(function(){if(R.current){W({type:"openDialog"}),H();var te={multiple:a,types:O};window.showOpenFilePicker(te).then(function(ae){return i(ae)}).then(function(ae){K(ae,null),W({type:"closeDialog"})}).catch(function(ae){MM(ae)?(P(ae),W({type:"closeDialog"})):NM(ae)?(R.current=!1,_.current?(_.current.value=null,_.current.click()):Y(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."))):Y(ae)});return}_.current&&(W({type:"openDialog"}),H(),_.current.value=null,_.current.click())},[W,H,P,v,K,Y,O,a]),ne=D.useCallback(function(te){!F.current||!F.current.isEqualNode(te.target)||(te.key===" "||te.key==="Enter"||te.keyCode===32||te.keyCode===13)&&(te.preventDefault(),B())},[F,B]),me=D.useCallback(function(){W({type:"focus"})},[]),we=D.useCallback(function(){W({type:"blur"})},[]),Q=D.useCallback(function(){A||(TM()?setTimeout(B,0):B())},[A,B]),ue=function(ae){return r?null:ae},de=function(ae){return k?null:ue(ae)},fe=function(ae){return E?null:ue(ae)},Te=function(ae){I&&ae.stopPropagation()},Fe=D.useMemo(function(){return function(){var te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ae=te.refKey,j=ae===void 0?"ref":ae,q=te.role,oe=te.onKeyDown,le=te.onFocus,he=te.onBlur,je=te.onClick,Qe=te.onDragEnter,Je=te.onDragOver,Ct=te.onDragLeave,Bt=te.onDrop,Ze=No(te,PM);return $e($e(zl({onKeyDown:de(Vt(oe,ne)),onFocus:de(Vt(le,me)),onBlur:de(Vt(he,we)),onClick:ue(Vt(je,Q)),onDragEnter:fe(Vt(Qe,G)),onDragOver:fe(Vt(Je,J)),onDragLeave:fe(Vt(Ct,se)),onDrop:fe(Vt(Bt,re)),role:typeof q=="string"&&q!==""?q:"presentation"},j,F),!r&&!k?{tabIndex:0}:{}),Ze)}},[F,ne,me,we,Q,G,J,se,re,k,E,r]),De=D.useCallback(function(te){te.stopPropagation()},[]),Ue=D.useMemo(function(){return function(){var te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ae=te.refKey,j=ae===void 0?"ref":ae,q=te.onChange,oe=te.onClick,le=No(te,FM),he=zl({accept:T,multiple:a,type:"file",style:{display:"none"},onChange:ue(Vt(q,re)),onClick:ue(Vt(oe,De)),tabIndex:-1},j,_);return $e($e({},he),le)}},[_,n,a,re,r]);return $e($e({},U),{},{isFocused:b&&!r,getRootProps:Fe,getInputProps:Ue,rootRef:F,inputRef:_,open:ue(B)})}function WM(e,t){switch(t.type){case"focus":return $e($e({},e),{},{isFocused:!0});case"blur":return $e($e({},e),{},{isFocused:!1});case"openDialog":return $e($e({},Ul),{},{isFileDialogActive:!0});case"closeDialog":return $e($e({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return $e($e({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return $e($e({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return $e({},Ul);default:return e}}function Ug(){}const jg=({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?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(Ka.Provider,{value:{showInputModal:i},children:[x.jsx(Sr,{open:n.open,onOpenChange:s=>r(a=>({...a,open:s})),children:x.jsx(Sr.Content,{title:n.title,description:n.description,confirmButtonText:n.confirmButtonText,cancelButtonText:n.cancelButtonText,onConfirm:n.onConfirm,onCancel:n.onCancel,children:n.content})}),e]})},qM=(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)},Vg=({color:e,fontFamily:t,radius:n,themeMode:r,variant:i,headerVariant:o,additionalStylesheet:s,additionalStylesheetUrl:a})=>{D.useMemo(()=>{t&&qM(t,["100","200","300","400","500","600","700","800"])},[t]);const l=D.useMemo(()=>jf({color:e,fontFamily:t,radius:n,themeMode:r,variant:i,headerVariant:o}),[e,t,n,r,i,o]);return x.jsxs(x.Fragment,{children:[a&&x.jsx("link",{rel:"stylesheet",href:a}),x.jsxs("style",{children:[l,`
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
- `]}),s&&x.jsx("style",{children:s})]})};let No;const ND=new Uint8Array(16);function _D(){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(ND)}const Xe=[];for(let e=0;e<256;++e)Xe.push((e+256).toString(16).slice(1));function PD(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 Pg={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function LD(e,t,n){if(Pg.randomUUID&&!e)return Pg.randomUUID();e=e||{};const r=e.random||(e.rng||_D)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,PD(r)}function lr(e){var s;const{metadata:t,conversationId:n,userId:r}=e,{payload:i,disableInput:o}=Lg(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 Lg=e=>{switch(e.type){case"audio":return Fg(e);case"card":return FD(e);case"carousel":return RD(e);case"choice":return $D(e);case"dropdown":return BD(e);case"file":return Rg(e);case"image":return $g(e);case"location":return Bg(e);case"markdown":return zg(e);case"text":return Ug(e);case"video":return Hg(e);case"bloc":return zD(e);case"custom":return{payload:e};default:{const t=e;throw new Error(`Unsuported message type ${t}`)}}},ci=e=>({block:e,type:"bubble"}),Fg=e=>({payload:{type:"audio",url:e.audioUrl}}),FD=e=>({payload:ci(jg(e))}),RD=e=>({payload:{type:"carousel",blocks:e.items.map(t=>jg({...t}))}}),$D=e=>{const t=e.options.map(o=>({title:o.label,value:o.value})),n=e.text,r=LD(),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}))}]}}},BD=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})}},Rg=e=>({payload:{type:"file",url:e.fileUrl,title:e.title}}),$g=e=>({payload:{type:"image",url:e.imageUrl}}),Bg=e=>({payload:{type:"location",latitude:e.latitude,longitude:e.longitude,title:e.title??e.address??"View on map"}}),zg=e=>({payload:ci({type:"text",text:e.markdown})}),Ug=e=>({payload:ci({type:"text",text:e.text,value:e.value})}),Hg=e=>({payload:{type:"video",url:e.videoUrl}}),zD=e=>({payload:{type:"column",blocks:e.items.map(n=>{switch(n.type){case"audio":return Fg({...n.payload,type:n.type}).payload;case"file":return Rg({...n.payload,type:n.type}).payload;case"image":return $g({...n.payload,type:n.type}).payload;case"location":return Bg({...n.payload,type:n.type}).payload;case"markdown":return zg({...n.payload,type:n.type}).payload;case"text":return Ug({...n.payload,type:n.type}).payload;case"video":return Hg({...n.payload,type:n.type}).payload;default:throw new Error("Unsuported message type")}})}}),jg=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 UD=Object.defineProperty,HD=(e,t,n)=>t in e?UD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jD=(e,t,n)=>HD(e,t+"",n),VD=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},WD={bodySerializer:e=>JSON.stringify(e,(t,n)=>typeof n=="bigint"?n.toString():n)},qD=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},YD=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},KD=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},Vg=({allowReserved:e,explode:t,name:n,style:r,value:i})=>{if(!t){let a=(e?i:i.map(l=>encodeURIComponent(l))).join(YD(r));switch(r){case"label":return`.${a}`;case"matrix":return`;${n}=${a}`;case"simple":return a;default:return`${n}=${a}`}}let o=qD(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)}`},Wg=({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=KD(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},GD=/\{[^{}]+\}/g,QD=({path:e,url:t})=>{let n=t,r=t.match(GD);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,Vg({explode:o,name:s,style:a,value:l}));continue}if(typeof l=="object"){n=n.replace(i,Wg({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},qg=({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,Vg({allowReserved:e,explode:!0,name:o,style:"form",value:s,...t})];continue}if(typeof s=="object"){i=[...i,Wg({allowReserved:e,explode:!0,name:o,style:"deepObject",value:s,...n})];continue}i=[...i,_o({allowReserved:e,name:o,value:s})]}}return i.join("&")},ZD=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"}},JD=async({security:e,...t})=>{for(let n of e){let r=await VD(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}},Yg=e=>XD({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:qg(e.querySerializer),url:e.url}),XD=({baseUrl:e,path:t,query:n,querySerializer:r,url:i})=>{let o=i.startsWith("/")?i:`/${i}`,s=(e??"")+o;t&&(s=QD({path:t,url:s}));let a=n?r(n):"";return a.startsWith("?")&&(a=a.substring(1)),a&&(s+=`?${a}`),s},Kg=(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=Gg(e.headers,t.headers),r},Gg=(...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},Hl=class{constructor(){jD(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]}},eN=()=>({error:new Hl,request:new Hl,response:new Hl}),tN=qg({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),nN={"Content-Type":"application/json"},Qg=(e={})=>({...WD,headers:nN,parseAs:"auto",querySerializer:tN,...e}),rN=(e={})=>{let t=Kg(Qg(),e),n=()=>({...t}),r=s=>(t=Kg(t,s),n()),i=eN(),o=async s=>{let a={...t,...s,fetch:s.fetch??t.fetch??globalThis.fetch,headers:Gg(t.headers,s.headers)};a.security&&await JD({...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=Yg(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"?ZD(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 p=await h.text();try{p=JSON.parse(p)}catch{}let m=p;for(let g of i.error._fns)m=await g(p,h,f,a);if(m=m||{},a.throwOnError)throw m;return{error:m,...d}};return{buildUrl:Yg,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"})}},iN=rN,oN=Qg;const Pe=iN((e=>({...e,withCredentials:!0,timeout:6e4,maxBodyLength:104857600,maxContentLength:104857600,throwOnError:!0,parseAs:"json"}))(oN({baseUrl:"https://webchat.botpress.cloud/"}))),sN=e=>(e.client??Pe).delete({url:"/conversations/{id}",...e}),aN=e=>(e.client??Pe).get({url:"/conversations/{id}",...e}),lN=e=>(e.client??Pe).get({url:"/conversations",...e}),uN=e=>(e.client??Pe).post({url:"/conversations",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),cN=e=>(e.client??Pe).get({url:"/conversations/{id}/messages",...e}),fN=e=>(e.client??Pe).get({url:"/conversations/{id}/participants",...e}),dN=e=>(e.client??Pe).post({url:"/conversations/{id}/participants",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),hN=e=>(e.client??Pe).delete({url:"/conversations/{id}/participants/{userId}",...e}),pN=e=>(e.client??Pe).get({url:"/conversations/{id}/participants/{userId}",...e}),mN=e=>(e.client??Pe).delete({url:"/messages/{id}",...e}),gN=e=>(e.client??Pe).get({url:"/messages/{id}",...e}),yN=e=>(e.client??Pe).put({url:"/messages/{id}",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),vN=e=>(e.client??Pe).post({url:"/messages",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),bN=e=>(e.client??Pe).delete({url:"/messages/{id}/feedback",...e}),wN=e=>(e.client??Pe).put({url:"/messages/{id}/feedback",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),SN=e=>(e.client??Pe).delete({url:"/users/me",...e}),xN=e=>(e.client??Pe).get({url:"/users/me",...e}),kN=e=>(e.client??Pe).put({url:"/users/me",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),EN=e=>((e==null?void 0:e.client)??Pe).post({url:"/users/key",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),CN=e=>(e.client??Pe).get({url:"/events/{id}",...e}),AN=e=>(e.client??Pe).post({url:"/events",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),TN=e=>(e.client??Pe).post({url:"/files",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}});let Zg=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 jl(e){}function IN(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=jl,onError:n=jl,onRetry:r=jl,onComment:i}=e;let o="",s=!0,a,l="",u="";function f(m){const g=s?m.replace(/^\xEF\xBB\xBF/,""):m,[v,y]=ON(`${o}${g}`);for(const w of v)c(w);o=y,s=!1}function c(m){if(m===""){d();return}if(m.startsWith(":")){i&&i(m.slice(m.startsWith(": ")?2:1));return}const g=m.indexOf(":");if(g!==-1){const v=m.slice(0,g),y=m[g+1]===" "?2:1,w=m.slice(g+y);h(v,w,m);return}h(m,"",m)}function h(m,g,v){switch(m){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 Zg(`Invalid \`retry\` value: "${g}"`,{type:"invalid-retry",value:g,line:v}));break;default:n(new Zg(`Unknown field "${m.length>20?`${m.slice(0,20)}…`:m}"`,{type:"unknown-field",field:m,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 p(m={}){o&&m.consume&&c(o),s=!0,a=void 0,l="",u="",o=""}return{feed:f,reset:p}}function ON(e){const t=[];let n="",r=0;for(;r<e.length;){const i=e.indexOf("\r",r),o=e.indexOf(`
319
+ `]}),s&&x.jsx("style",{children:s})]})};let Lo;const YM=new Uint8Array(16);function KM(){if(!Lo&&(Lo=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Lo))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Lo(YM)}const et=[];for(let e=0;e<256;++e)et.push((e+256).toString(16).slice(1));function GM(e,t=0){return et[e[t+0]]+et[e[t+1]]+et[e[t+2]]+et[e[t+3]]+"-"+et[e[t+4]]+et[e[t+5]]+"-"+et[e[t+6]]+et[e[t+7]]+"-"+et[e[t+8]]+et[e[t+9]]+"-"+et[e[t+10]]+et[e[t+11]]+et[e[t+12]]+et[e[t+13]]+et[e[t+14]]+et[e[t+15]]}const Wg={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function QM(e,t,n){if(Wg.randomUUID&&!e)return Wg.randomUUID();e=e||{};const r=e.random||(e.rng||KM)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,GM(r)}function cr(e){var s;const{metadata:t,conversationId:n,userId:r}=e,{payload:i,disableInput:o}=qg(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 qg=e=>{switch(e.type){case"audio":return Yg(e);case"card":return ZM(e);case"carousel":return JM(e);case"choice":return XM(e);case"dropdown":return eN(e);case"file":return Kg(e);case"image":return Gg(e);case"location":return Qg(e);case"markdown":return Zg(e);case"text":return Jg(e);case"video":return Xg(e);case"bloc":return tN(e);case"custom":return{payload:e};default:{const t=e;throw new Error(`Unsuported message type ${t}`)}}},hi=e=>({block:e,type:"bubble"}),Yg=e=>({payload:{type:"audio",url:e.audioUrl}}),ZM=e=>({payload:hi(ey(e))}),JM=e=>({payload:{type:"carousel",blocks:e.items.map(t=>ey({...t}))}}),XM=e=>{const t=e.options.map(o=>({title:o.label,value:o.value})),n=e.text,r=QM(),i=hi({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}))}]}}},eN=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:hi({type:"column",blocks:r})}},Kg=e=>({payload:{type:"file",url:e.fileUrl,title:e.title}}),Gg=e=>({payload:{type:"image",url:e.imageUrl}}),Qg=e=>({payload:{type:"location",latitude:e.latitude,longitude:e.longitude,title:e.title??e.address??"View on map"}}),Zg=e=>({payload:hi({type:"text",text:e.markdown})}),Jg=e=>({payload:hi({type:"text",text:e.text,value:e.value})}),Xg=e=>({payload:{type:"video",url:e.videoUrl}}),tN=e=>({payload:{type:"column",blocks:e.items.map(n=>{switch(n.type){case"audio":return Yg({...n.payload,type:n.type}).payload;case"file":return Kg({...n.payload,type:n.type}).payload;case"image":return Gg({...n.payload,type:n.type}).payload;case"location":return Qg({...n.payload,type:n.type}).payload;case"markdown":return Zg({...n.payload,type:n.type}).payload;case"text":return Jg({...n.payload,type:n.type}).payload;case"video":return Xg({...n.payload,type:n.type}).payload;default:throw new Error("Unsuported message type")}})}}),ey=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 nN=Object.defineProperty,rN=(e,t,n)=>t in e?nN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,iN=(e,t,n)=>rN(e,t+"",n),oN=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},sN={bodySerializer:e=>JSON.stringify(e,(t,n)=>typeof n=="bigint"?n.toString():n)},aN=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},lN=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},uN=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},ty=({allowReserved:e,explode:t,name:n,style:r,value:i})=>{if(!t){let a=(e?i:i.map(l=>encodeURIComponent(l))).join(lN(r));switch(r){case"label":return`.${a}`;case"matrix":return`;${n}=${a}`;case"simple":return a;default:return`${n}=${a}`}}let o=aN(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)}`},ny=({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=uN(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},cN=/\{[^{}]+\}/g,fN=({path:e,url:t})=>{let n=t,r=t.match(cN);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,ty({explode:o,name:s,style:a,value:l}));continue}if(typeof l=="object"){n=n.replace(i,ny({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},ry=({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,ty({allowReserved:e,explode:!0,name:o,style:"form",value:s,...t})];continue}if(typeof s=="object"){i=[...i,ny({allowReserved:e,explode:!0,name:o,style:"deepObject",value:s,...n})];continue}i=[...i,_o({allowReserved:e,name:o,value:s})]}}return i.join("&")},dN=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"}},hN=async({security:e,...t})=>{for(let n of e){let r=await oN(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}},iy=e=>pN({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:ry(e.querySerializer),url:e.url}),pN=({baseUrl:e,path:t,query:n,querySerializer:r,url:i})=>{let o=i.startsWith("/")?i:`/${i}`,s=(e??"")+o;t&&(s=fN({path:t,url:s}));let a=n?r(n):"";return a.startsWith("?")&&(a=a.substring(1)),a&&(s+=`?${a}`),s},oy=(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=sy(e.headers,t.headers),r},sy=(...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(){iN(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]}},mN=()=>({error:new jl,request:new jl,response:new jl}),gN=ry({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),yN={"Content-Type":"application/json"},ay=(e={})=>({...sN,headers:yN,parseAs:"auto",querySerializer:gN,...e}),vN=(e={})=>{let t=oy(ay(),e),n=()=>({...t}),r=s=>(t=oy(t,s),n()),i=mN(),o=async s=>{let a={...t,...s,fetch:s.fetch??t.fetch??globalThis.fetch,headers:sy(t.headers,s.headers)};a.security&&await hN({...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=iy(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"?dN(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:iy,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"})}},bN=vN,wN=ay;const _e=bN((e=>({...e,withCredentials:!0,timeout:6e4,maxBodyLength:104857600,maxContentLength:104857600,throwOnError:!0,parseAs:"json"}))(wN({baseUrl:"https://webchat.botpress.cloud/"}))),SN=e=>(e.client??_e).delete({url:"/conversations/{id}",...e}),kN=e=>(e.client??_e).get({url:"/conversations/{id}",...e}),xN=e=>(e.client??_e).get({url:"/conversations",...e}),EN=e=>(e.client??_e).post({url:"/conversations",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),CN=e=>(e.client??_e).get({url:"/conversations/{id}/messages",...e}),AN=e=>(e.client??_e).get({url:"/conversations/{id}/participants",...e}),TN=e=>(e.client??_e).post({url:"/conversations/{id}/participants",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),IN=e=>(e.client??_e).delete({url:"/conversations/{id}/participants/{userId}",...e}),ON=e=>(e.client??_e).get({url:"/conversations/{id}/participants/{userId}",...e}),DN=e=>(e.client??_e).delete({url:"/messages/{id}",...e}),MN=e=>(e.client??_e).get({url:"/messages/{id}",...e}),NN=e=>(e.client??_e).put({url:"/messages/{id}",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),LN=e=>(e.client??_e).post({url:"/messages",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),_N=e=>(e.client??_e).delete({url:"/messages/{id}/feedback",...e}),PN=e=>(e.client??_e).put({url:"/messages/{id}/feedback",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),FN=e=>(e.client??_e).delete({url:"/users/me",...e}),RN=e=>(e.client??_e).get({url:"/users/me",...e}),BN=e=>(e.client??_e).put({url:"/users/me",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),$N=e=>((e==null?void 0:e.client)??_e).post({url:"/users/key",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),zN=e=>(e.client??_e).get({url:"/events/{id}",...e}),HN=e=>(e.client??_e).post({url:"/events",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),UN=e=>(e.client??_e).post({url:"/files",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}});let ly=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 Vl(e){}function jN(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=Vl,onError:n=Vl,onRetry:r=Vl,onComment:i}=e;let o="",s=!0,a,l="",u="";function f(p){const g=s?p.replace(/^\xEF\xBB\xBF/,""):p,[v,y]=VN(`${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 ly(`Invalid \`retry\` value: "${g}"`,{type:"invalid-retry",value:g,line:v}));break;default:n(new ly(`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 VN(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 Jg 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(Xg(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(Xg(this),n)}}function MN(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 Xg(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var ey=e=>{throw TypeError(e)},Wl=(e,t,n)=>t.has(e)||ey("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)?ey("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,ur,Po,Lo,fi,cr,di,pn,fr,dr,hr,hi,Lt,ql,Yl,Kl,ty,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,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,Yl,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 p=!0;do{const{done:m,value:g}=await d.read();g&&be(this,fr).feed(h.decode(g,{stream:!m})),m&&(p=!1,be(this,fr).reset(),Qt(this,Lt,Zl).call(this))}while(p)}),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,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,Ql,o=>{Le(this,fi,o)}),Ke(this,Jl,()=>{Le(this,cr,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,DN()));else throw new Error("Invalid URL")}catch{throw MN("An invalid or illegal string was specified")}Le(this,fr,IN({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,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,ql=function(){Le(this,dt,this.CONNECTING),Le(this,pn,new AbortController),be(this,Lo)(be(this,_n),Qt(this,Lt,ty).call(this)).then(be(this,Yl)).catch(be(this,Kl))},Yl=new WeakMap,Kl=new WeakMap,ty=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 Jg("error",{code:t,message:e});(n=be(this,dr))==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 Jg("error",{code:t,message:e});(n=be(this,dr))==null||n.call(this,r),this.dispatchEvent(r),Le(this,cr,setTimeout(be(this,Jl),be(this,fi)))},Jl=new WeakMap,Fo.CONNECTING=0,Fo.OPEN=1,Fo.CLOSED=2;function DN(){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 NN(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 ny=()=>{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,ry=10,iy=3e3,_N="60000",PN={throwOnError:!0},LN=({conversationId:e,userToken:t,clientId:n,apiUrl:r,adminSecret:i})=>{let o=0,s=null;const a=ny();let l=e,u=t;const f=()=>{s&&s.close();const c=`${`${r||Pe.getConfig().baseUrl}/${n}`}/initialize${l?`?conversationId=${l}`:""}`,h={...i?{"x-admin-secret":i}:{},...u?{"x-user-key":u}:{}};s=sy(c,h),s.addEventListener("open",()=>a.emit("open")),s.addEventListener("error",d=>{o<ry?(o++,setTimeout(()=>f(),iy)):a.emit("error",d)}),s.addEventListener("message",d=>{const p=oy(d.data);p.type==="init"&&(l=p.data.conversation.id??l,u=p.data.user.userKey??u),a.emit(p.type,p.data)})};return f(),a.on},FN=({userKey:e,clientId:t,apiUrl:n,customHeaders:r,advancedOptions:i})=>{const o={"x-user-key":e,...r},s=`${n||Pe.getConfig().baseUrl}/${t}`,a={...PN,baseUrl:s};return Pe.interceptors.response._fns.length===0&&Pe.interceptors.response.use(NN),{createConversation:()=>uN({...a,headers:o,body:{}}).then(Ue),getConversation:({conversationId:l})=>aN({...a,headers:o,path:{id:l}}).then(Ue),deleteConversation:({conversationId:l})=>sN({...a,headers:o,path:{id:l}}).then(Ue),listConversations:({nextToken:l})=>lN({...a,headers:o,query:{nextToken:l}}).then(Ue),listConversationMessages:({conversationId:l,nextToken:u})=>cN({...a,headers:o,path:{id:l},query:{nextToken:u}}).then(Ue),addParticipant:({conversationId:l,userId:u})=>dN({...a,headers:o,path:{id:l},body:{userId:u}}).then(Ue),removeParticipant:({conversationId:l,userId:u})=>hN({...a,headers:o,path:{id:l,userId:u}}).then(Ue),getParticipant:({conversationId:l,userId:u})=>pN({...a,headers:o,path:{id:l,userId:u}}).then(Ue),listParticipants:({conversationId:l,nextToken:u})=>fN({...a,headers:o,path:{id:l},query:{nextToken:u}}).then(Ue),createMessage:l=>vN({...a,headers:o,body:l}).then(Ue),updateMessage:({messageId:l,...u})=>yN({...a,headers:o,path:{id:l},body:u}).then(Ue),getMessage:({messageId:l})=>gN({...a,headers:o,path:{id:l}}).then(Ue),deleteMessage:({messageId:l})=>mN({...a,headers:o,path:{id:l}}).then(Ue),createFile:l=>TN({...a,headers:o,body:l}).then(Ue),getUser:()=>xN({...a,headers:o}).then(Ue),updateUser:l=>kN({...a,headers:o,body:l}).then(Ue),deleteUser:()=>SN({...a,headers:o}).then(Ue),createEvent:l=>AN({...a,headers:o,body:l}).then(Ue),getEvent:({eventId:l})=>CN({...a,headers:o,path:{id:l}}).then(Ue),addMessageFeedback:({messageId:l,...u})=>wN({...a,headers:o,path:{id:l},body:u}).then(Ue),removeMessageFeedback:({messageId:l})=>bN({...a,headers:o,path:{id:l}}).then(Ue),generateUserKey:({adminSecret:l,...u})=>EN({...a,headers:{"x-admin-secret":l},body:u}).then(Ue),listenConversation:({conversationId:l})=>{let u=0,f=null;const c=ny(),h=()=>{f&&f.close();const d=`${s}/conversations/${l}/listen`,p=i==null?void 0:i.eventSource;f=p?p({url:d,headers:o}):sy(d,o),f.addEventListener("open",()=>c.emit("open")),f.addEventListener("error",m=>{u<ry?(u++,setTimeout(()=>h(),iy)):c.emit("error",m)}),f.addEventListener("message",m=>{const g=oy(m.data);c.emit(g.type,g.data)})};return h(),c.on}}},oy=e=>{try{return JSON.parse(e)}catch{return e}},sy=(e,t)=>new Fo(e,{fetch:(n,r)=>fetch(n,{...r,headers:{...r==null?void 0:r.headers,...t,timeout:_N}})}),RN=async({apiUrl:e,clientId:t,adminSecret:n,clientHeaders:r,emitter:i,conversationId:o,userToken:s})=>new Promise(a=>{const l=LN({apiUrl:e,clientId:t,userToken:s,conversationId:o,adminSecret:n}),u=l("init",({conversation:f,messages:c,participants:h,user:d})=>{const p=za(f.id),m=c.reverse().map(lr).filter(Boolean);p.getState().setMessages(m),Va(f.id).getState().setParticipants(h);const v=FN({clientId:t,apiUrl:e,userKey:d.userKey,customHeaders:r});v.createEvent({conversationId:f.id,payload:{type:"conversation_started",data:{}}}).then(({event:y})=>{var w,C;(C=(w=y.payload.data)==null?void 0:w.status)!=null&&C.isInitial&&i.emit("conversation",f.id)}),a({on:l,conversation:f,messages:c,participants:h,user:d,client:v,onCleanup:()=>{u()}})})}),$N={webchat:"#9C27B0",client:"#2196F3",store:"#4CAF50",events:"#00BCD4"},BN={debug:"#9E9E9E",info:"#2196F3",warn:"#FF9800",error:"#F44336"};let ay=!1,Xl=null,ly=Date.now();const zN=e=>{ay=e,ly=Date.now()},UN=e=>{Xl=e},HN=()=>{const e=Date.now()-ly,t=Math.floor(e/1e3),n=e%1e3;return`+${t}.${n.toString().padStart(3,"0")}s`},jN=e=>e===void 0?"undefined":e===null?"null":e instanceof Error?{error:e.message,stack:e.stack}:e,Ro=e=>{const t=$N[e]||"#666",n=(r,...i)=>{if(!ay&&r!=="warn"&&r!=="error")return;const o=HN(),s=`%c[bp:${e}]%c ${o} %c${r.toUpperCase()}%c`,a=[`color: ${t}; font-weight: bold;`,"color: #999; font-size: 10px;",`color: ${BN[r]}; font-weight: bold;`,"color: inherit;"],l=i.map(jN);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)}},uy={webchat:Ro("webchat"),client:Ro("client"),store:Ro("store"),events:Ro("events")};function cy(){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=uy.webchat;function fy({apiUrl:e="https://webchat.botpress.cloud",clientId:t,storageKey:n,storageLocation:r,adminSecret:i,clientHeaders:o,playNotificationSound:s,...a}){const l=kp(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:p}=cy(),{state:m,setState:g}=cy(),v=M.useMemo(()=>ic(),[]),[y,w]=M.useState("connecting"),[C,k]=M.useState(void 0),[E,I]=M.useState(void 0),D=M.useRef(null),P=Ww(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 U=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=jw(t,e);if(L){mi.error("configuration error",L),I(L),w("error");return}return U(),()=>{O=!0,D.current&&(D.current(),D.current=null)}},[a.conversationId,a.userToken,t,e]);const T=async({conversationId:O,userToken:U})=>{var _;(_=D.current)==null||_.call(D),I(void 0),p(!1),g(!1),w("connecting");const{on:L,conversation:F,user:R,client:N,onCleanup:j}=await RN({apiUrl:e,clientId:t,clientHeaders:o,emitter:v,adminSecret:i,conversationId:O,userToken:U});k(N),c(F.id),h({userId:R.id,userToken:R.userKey});const z=za(F.id),V=Va(F.id),b=[j,L("open",()=>{I(void 0),w("connected")}),L("error",B=>{mi.error("connection error",{error:B,conversationId:F.id}),I(S=>S||Pr(B)),w("error"),v.emit("error",new Error(`Connection to conversation lost: ${B==null?void 0:B.message}`))}),L("message_created",B=>{const S=lr(B);z.getState().saveMessage(S),R.id!==S.authorId&&(s==null||s(),p(!1),g(!1),v.emit("isTyping",{isTyping:!1,timeout:0})),v.emit("message",S)}),L("message_updated",B=>{const S=lr(B);z.getState().saveMessage(S)}),L("message_status_changed",B=>{var S;B.newStatus==="processing"&&z.getState().updateMessage((S=B.message.metadata)==null?void 0:S.clientMessageId,{status:B.newStatus})}),L("typing_stopped",()=>{p(!1),g(!1)}),L("typing_started",()=>{p(!0,5e3),g(!0,5e3),v.emit("isTyping",{isTyping:!0,timeout:5e3})}),L("participant_added",B=>{V.getState().addParticipant(B.participant),v.emit("participantAdded",B.participant)}),L("participant_removed",B=>{V.getState().removeParticipant(B.participantId),v.emit("participantRemoved",B.participantId)}),L("webchat_visibility",B=>v.emit("webchatVisibility",B.visibility)),L("webchat_config",B=>v.emit("webchatConfig",B.config)),L("custom",B=>v.emit("customEvent",B.event))];w("connected"),mi.info("client fully connected with event handlers ready",{conversationId:F.id}),D.current=()=>{b.forEach(B=>B())}};return{clientState:y,httpClient:C,error:E,activeConversationId:u,userCredentials:f,isTyping:d,isAwaitingResponse:m,openConversation:T,setAwaitingResponse:g,emitter:v,setError:I,setClientState:w}}const dy=M.createContext(null);function $o(){const e=M.useContext(dy);if(!e)throw new Error("useWebchatContext must be used inside <WebchatProvider>");return e}function hy({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:p,openConversation:m,setClientState:g,setError:v,setAwaitingResponse:y,emitter:w}=fy({apiUrl:t,clientId:e,storageKey:n,storageLocation:r,adminSecret:i,clientHeaders:o,conversationId:a.conversationId,userToken:(k=a.userCredentials)==null?void 0:k.userToken}),C={client:u,clientState:l,setClientState:g,conversationId:c,userCredentials:h,error:f,setError:v,isTyping:d,isAwaitingResponse:p,openConversation:m,setAwaitingResponse:y,emitter:w};return x.jsx(dy.Provider,{value:C,children:s})}const eu=({children:e,className:t,uploadFile:n,allowFileUpload:r,storageKey:i,conversationId:o,...s})=>{const{container:a}=ye,l=Qn(g=>g.setMessageContainerRef),f=Ep(o||"default",i)(g=>g.uploadFile),[c,h]=M.useState(0),d=M.useRef(null);M.useEffect(()=>{l(d)},[d,l]);const p=M.useCallback(g=>{n&&(g.forEach(v=>f(v,n)),h(0))},[f,n]),{getRootProps:m}=Mg({noClick:!0,noKeyboard:!0,onDrop:p,disabled:!(r&&n),onDragEnter:()=>h(g=>g+1),onDragLeave:()=>h(g=>g-1)});return x.jsxs("div",{...s,className:ar(a.className,t),...m(),ref:d,children:[x.jsxs("div",{"data-hover":c>0,...a.dropzone.overlay,children:["Drop files to upload",x.jsx(PA,{style:{width:"50px"}})]}),x.jsx(Ng,{children:e})]})};eu.displayName="Container";const py=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})})});py.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 VN(e,t){const n=A.createContext(t),r=o=>{const{children:s,...a}=o,l=A.useMemo(()=>a,Object.values(a));return x.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 my(e,t=[]){let n=[];function r(o,s){const a=A.createContext(s),l=n.length;n=[...n,s];const u=c=>{var v;const{scope:h,children:d,...p}=c,m=((v=h==null?void 0:h[e])==null?void 0:v[l])||a,g=A.useMemo(()=>p,Object.values(p));return x.jsx(m.Provider,{value:g,children:d})};u.displayName=o+"Provider";function f(c,h){var m;const d=((m=h==null?void 0:h[e])==null?void 0:m[l])||a,p=A.useContext(d);if(p)return p;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,WN(i,...t)]}function WN(...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 qN=A[" useInsertionEffect ".trim().toString()]||en;function gy({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,s]=YN({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=KN(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 YN({defaultProp:e,onChange:t}){const[n,r]=A.useState(e),i=A.useRef(n),o=A.useRef(t);return qN(()=>{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 KN(e){return typeof e=="function"}function yy(e){const t=GN(e),n=A.forwardRef((r,i)=>{const{children:o,...s}=r,a=A.Children.toArray(o),l=a.find(ZN);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 x.jsx(t,{...s,ref:i,children:A.isValidElement(u)?A.cloneElement(u,void 0,f):null})}return x.jsx(t,{...s,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function GN(e){const t=A.forwardRef((n,r)=>{const{children:i,...o}=n;if(A.isValidElement(i)){const s=XN(i),a=JN(o,i.props);return i.type!==A.Fragment&&(a.ref=r?ns(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 QN=Symbol("radix.slottable");function ZN(e){return A.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===QN}function JN(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 XN(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 e2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ft=e2.reduce((e,t)=>{const n=yy(`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),x.jsx(l,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function t2(e,t){e&&zu.flushSync(()=>e.dispatchEvent(t))}function n2(e,t){return A.useReducer((n,r)=>t[n][r]??n,e)}var Bo=e=>{const{present:t,children:n}=e,r=r2(t),i=typeof n=="function"?n({present:r.isPresent}):A.Children.only(n),o=tn(r.ref,i2(i));return typeof n=="function"||r.isPresent?A.cloneElement(i,{ref:o}):null};Bo.displayName="Presence";function r2(e){const[t,n]=A.useState(),r=A.useRef(null),i=A.useRef(e),o=A.useRef("none"),s=e?"mounted":"unmounted",[a,l]=n2(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 m=zo(r.current).includes(CSS.escape(d.animationName));if(d.target===t&&m&&(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 i2(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 o2=A[" useId ".trim().toString()]||(()=>{}),s2=0;function Uo(e){const[t,n]=A.useState(o2());return en(()=>{n(r=>r??String(s2++))},[e]),e||(t?`radix-${t}`:"")}var Ho="Collapsible",[a2]=my(Ho),[l2,tu]=a2(Ho),vy=A.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:s,...a}=e,[l,u]=gy({prop:r,defaultProp:i??!1,onChange:s,caller:Ho});return x.jsx(l2,{scope:n,disabled:o,contentId:Uo(),open:l,onOpenToggle:A.useCallback(()=>u(f=>!f),[u]),children:x.jsx(Ft.div,{"data-state":ru(l),"data-disabled":o?"":void 0,...a,ref:t})})});vy.displayName=Ho;var by="CollapsibleTrigger",wy=A.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=tu(by,n);return x.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)})});wy.displayName=by;var nu="CollapsibleContent",Sy=A.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=tu(nu,e.__scopeCollapsible);return x.jsx(Bo,{present:n||i.open,children:({present:o})=>x.jsx(u2,{...r,ref:t,present:o})})});Sy.displayName=nu;var u2=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),p=d.current,m=s.open||a,g=A.useRef(m),v=A.useRef(void 0);return A.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":ru(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!m,...o,ref:f,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":p?`${p}px`:void 0,...e.style},children:m&&i})});function ru(e){return e?"open":"closed"}var c2=vy,f2=Sy;const iu=({restartConversation:e,...t})=>{var o,s;const{header:n}=ye,{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 x.jsx(KA,{...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}=ye,r=i=>{i.stopPropagation(),e==null||e()};return x.jsx(fp,{...t,...n.content.actions.icons,role:"button",tabIndex:0,"aria-label":"Close Chatbot Button",onClick:r,onKeyDown:i=>{i.key==="Enter"&&r(i)}})},d2=({onClick:e,...t})=>{const{header:n}=ye,r=i=>{i.stopPropagation(),e==null||e()};return x.jsx(op,{...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,p,m,g,v;const{header:i}=ye,o=e??LA;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,{...(m=(p=i.expandedContent)==null?void 0:p.descriptionItems)==null?void 0:m.icon}),x.jsx("p",{...(v=(g=i.expandedContent)==null?void 0:g.descriptionItems)==null?void 0:v.text,children:t})]}):null},h2=({soundOn:e,toggleSound:t})=>{const n=o=>{o.stopPropagation(),t==null||t()},{header:r}=ye,i=e?cp:tT;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})})},xy=({defaultOpen:e,closeWindow:t,configuration:n,restartConversation:r,showConversationHistory:i,disabled:o,soundOn:s,toggleSound:a,clientId:l,...u})=>{var m,g,v,y,w,C,k,E,I,D,P,T,O,U,L,F,R,N,j,z,V,b,_,B;const{header:f}=ye,[c,h]=M.useState(e),d=!!((m=n.email)!=null&&m.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),p=d&&!o;return x.jsxs(c2,{open:p?c:!1,onOpenChange:p?h:void 0,"data-disabled":p?void 0:"",...f.container,...u,children:[x.jsxs(wy,{"aria-label":"Expand Header Button",...f.content.container,children:[x.jsx("div",{...f.content.conversationHistory,children:i&&!c&&x.jsx(d2,{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(h2,{soundOn:s,toggleSound:a}),r&&x.jsx(iu,{restartConversation:r}),t&&x.jsx(ou,{onClick:t})]})]}),d&&x.jsxs(f2,{...f.expandedContent.container,children:[x.jsxs("div",{"data-links":"",...f.expandedContent.group,children:[x.jsx(gi,{"data-email":"",icon:HA,title:(C=n.email)==null?void 0:C.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:qA,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:${(L=n.phone)==null?void 0:L.link}`}),x.jsx(gi,{"data-website":"",link:(F=n.website)==null?void 0:F.link,icon:$A,title:(R=n.website)==null?void 0:R.title})]}),x.jsxs("div",{"data-legal":"",...(N=f.expandedContent)==null?void 0:N.group,children:[((j=n.termsOfService)==null?void 0:j.link)&&x.jsx(gi,{"data-terms":"",link:(z=n.termsOfService)==null?void 0:z.link,icon:lp,title:(V=n.termsOfService)==null?void 0:V.title}),((b=n.privacyPolicy)==null?void 0:b.link)&&x.jsx(gi,{"data-privacy":"",link:(_=n.privacyPolicy)==null?void 0:_.link,icon:UA,title:(B=n.privacyPolicy)==null?void 0:B.title})]})]})]})},su=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})})});su.displayName="TypingIndicator";const au=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:p,addMessageFeedback:m,showAvatar:g},v)=>{const[y,w]=M.useState([]),{message:{container:C,deliveryStatus:k}}=ye;return g=g??e==="incoming",x.jsx(qa.Provider,{value:{isLoading:y,setIsLoading:w},children:x.jsxs("div",{...C,className:ar(C==null?void 0:C.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(ky,{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:p,addMessageFeedback:m},renderers:l}),e==="outgoing"&&g&&x.jsx(ky,{authorId:s,sender:i}),r]})})})),ky=({authorId:e,sender:t})=>{const{message:{avatar:n}}=ye,[r,i]=M.useState("idle"),o=Qu(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 p2({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 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),"");const m2=70,g2=300;function y2(e,t={}){const n=t.nearBottomThreshold??m2,[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=g2)=>{cancelAnimationFrame(f.current);const C=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=C+(T-C)*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]),p=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]),m=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",p),w.removeEventListener("wheel",m),w.removeEventListener("touchstart",g)),o.current=y,y&&(y.addEventListener("scroll",p,{passive:!0}),y.addEventListener("wheel",m,{passive:!0}),y.addEventListener("touchstart",g,{passive:!0}),s.current=y.scrollTop)},[p,m,g]);return M.useLayoutEffect(()=>{const y=o.current;if(y)if(a.current){const w=y.scrollHeight-y.clientHeight,C=w-y.scrollTop;C>0&&C<=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 C=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 C.observe(w),()=>C.disconnect()},[]),M.useEffect(()=>{const y=window.visualViewport;if(!y)return;const w=()=>{const C=o.current;C&&(u.current||a.current&&(l.current=!0,C.scrollTop=C.scrollHeight-C.clientHeight,s.current=C.scrollTop))};return y.addEventListener("resize",w),()=>y.removeEventListener("resize",w)},[]),M.useEffect(()=>{const y=o.current;if(!y)return;let w=!1;const C=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 C.observe(y),()=>C.disconnect()},[]),M.useEffect(()=>()=>cancelAnimationFrame(f.current),[]),{scrollRef:v,isAtBottom:r,scrollToBottom:d}}const v2={height:"100%",width:"100%",overflowY:"auto",scrollbarWidth:"none",overscrollBehaviorY:"contain"},uu=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:p=!1,...m})=>{var T;const{messageList:g}=ye,v=M.useMemo(()=>c?hb(t):t,[t]),y=M.useMemo(()=>{var U;const O=v.filter(L=>L.direction==="outgoing"&&L.status!=="pending");return(U=O[O.length-1])==null?void 0:U.id},[v]),w=v[v.length-1],C=(w==null?void 0:w.id)??"",k=`${v.length}:${C}:${n}`,{scrollRef:E,isAtBottom:I,scrollToBottom:D}=y2(k);M.useEffect(()=>{(w==null?void 0:w.direction)==="outgoing"&&D()},[C]);const P=O=>{if(O.direction==="incoming")return d;if(O.direction==="outgoing")return p};return x.jsxs("div",{...m,className:ar(g.container.className,e),children:[x.jsx("div",{ref:E,style:v2,children:x.jsxs("div",{className:g.viewPort.className,children:[r&&x.jsx("span",{...g.headerMessage,children:r}),f&&x.jsx(p2,{botAvatar:o,botDescription:s,botName:a}),v.map(O=>{var U;return x.jsx(au,{renderers:i,sendMessage:l,addMessageFeedback:u,isLastDeliveredMessage:h&&O.id===y,showAvatar:P(O),...O},((U=O.metadata)==null?void 0:U.clientMessageId)||O.id)}),n&&x.jsx(au,{id:lu(),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(su,{})})]})}),!I&&x.jsx("button",{className:g.scrollDownButton.className,onClick:()=>D()})]})});uu.displayName="MessageList";const Ey=({className:e,...t})=>{const{className:n}=ye.loader;return x.jsx("div",{...t,className:ar(e,n)})};function Cy({error:e,restartConversation:t,closeWindow:n}){let r,i;const{error:o}=ye;return e.type==="configuration"?(r="Configuration error",i=x.jsx(WA,{...o.icon})):e.type==="bot"?(r="Bot error",i=x.jsx(ip,{...o.icon})):e.type==="network"?(r="Network error",i=x.jsx(nT,{...o.icon})):e.type==="disconnected"?(r="Disconnected",i=x.jsx(JA,{...o.icon})):(r="Unexpected error",i=x.jsx(ip,{...o.icon})),x.jsx(b2,{error:e,title:r,icon:i,restartConversation:t,closeWindow:n})}function b2({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(iu,{restartConversation:r,style:{color:"white",backgroundColor:"transparent"}}),i&&x.jsx(ou,{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=uy.webchat;async function w2(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 Qf(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 S2(e,t){return async(...n)=>{try{return await e(...n)}catch(r){await w2(Pr(r),t)}}}function Ay(e,t){const n={};for(const[r,i]of Object.entries(e))n[r]=S2(i,t);return n}function Ty({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 Iy({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 Vw(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()??"",p=Rf(d)?d:"file";return{fileUrl:c,name:s,type:p,fileId:h}}}}function Oy({client:e,conversationId:t,userId:n,setAwaitingResponse:r}){const i=za(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 p=lu(),m={id:p,createdAt:new Date().toISOString(),userId:n,conversationId:t,payload:d,metadata:{clientMessageId:p,delivered:!1}},g=lr(m);g.status="pending",s(g),await e.createMessage({conversationId:t,payload:d,metadata:{clientMessageId:p}})},setMessages:d=>{const p=d.map(m=>lr(m)).filter(Boolean);l(p)},clearMessages:u,saveMessageFeedback:async(d,p)=>{if(!e)throw new Error("Cannot update feedback: client not available");a(d,{feedback:p.value}),await e.addMessageFeedback({messageId:d,...p})}}}function My({client:e,conversationId:t}){const n=Va(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 Dy={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 Ny({storageKey:e,soundEnabled:t}){const n=Cp(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=Dy.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 x2({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}=Ny({storageKey:n,soundEnabled:o}),{clientState:c,httpClient:h,error:d,activeConversationId:p,userCredentials:m,isTyping:g,isAwaitingResponse:v,openConversation:y,setAwaitingResponse:w,emitter:C,setError:k,setClientState:E}=fy({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}=Oy({client:h,conversationId:p,userId:m==null?void 0:m.userId,setAwaitingResponse:w}),{participants:T}=My({client:h,conversationId:p}),{uploadFile:O}=Iy({client:h,conversationId:p,user:m}),{sendEvent:U}=Ty({client:h,conversationId:p});if(c!=="connected"||!m||!p||!h)return{clientState:c,on:C.on,client:void 0,messages:[],conversationId:void 0,newConversation:j=>{y({conversationId:j,userToken:m==null?void 0:m.userToken}).catch(z=>{C.emit("error",z)})},user:void 0,isTyping:void 0,participants:[],toggleSound:u,soundOn:l,error:d,disableSendButton:v};const L={userId:m==null?void 0:m.userId,conversationId:p,userToken:m==null?void 0:m.userToken,openConversation:y,setClientState:E,setError:k,emitter:C},R={...Ay({sendMessage:async j=>D(j),sendEvent:U,uploadFile:O,addMessageFeedback:P},L),getUser:async()=>{const{user:j}=await h.getUser();return j},updateUser:async j=>{const{user:z}=await h.updateUser({name:j.name,pictureUrl:j.pictureUrl,userData:j.data});return z},listConversations:async()=>h.listConversations({})};return{clientState:"connected",on:C.on,client:R,messages:I,conversationId:p,newConversation:j=>{y({conversationId:j,userToken:m.userToken}).catch(z=>{C.emit("error",z)})},user:m,isTyping:g,participants:T,error:d,soundOn:l,toggleSound:u,disableSendButton:v}}const _y=()=>{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 Py(){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:p}=Oy({client:e,conversationId:t,userId:n==null?void 0:n.userId,setAwaitingResponse:r}),{participants:m}=My({client:e,conversationId:t}),{sendEvent:g}=Ty({client:e,conversationId:t}),{uploadFile:v}=Iy({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=Ay({sendMessage:d,saveMessageFeedback:p,sendEvent:g,uploadFile:v},y);return{conversationId:t,messages:h,participants:m,sendMessage:w.sendMessage,saveMessageFeedback:w.saveMessageFeedback,sendEvent:w.sendEvent,uploadFile:w.uploadFile,on:i.on,status:o,error:u,isAwaitingResponse:f,isTyping:c}}function Ly(){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 Fy=0,Ry=1,$y=2,By=3;var zy=Object.prototype.hasOwnProperty;function cu(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--&&cu(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(zy.call(e,n)&&++r&&!zy.call(t,n)||!(n in t)||!cu(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const Jt=new WeakMap,Xt=()=>{},rt=Xt(),fu=Object,we=e=>e===rt,Vt=e=>typeof e=="function",mn=(e,t)=>({...e,...t}),Uy=e=>Vt(e.then),du={},jo={},hu="undefined",vi=typeof window!=hu,pu=typeof document!=hu,k2=vi&&"Deno"in window,E2=()=>vi&&typeof window.requestAnimationFrame!=hu,Hy=(e,t)=>{const n=Jt.get(e);return[()=>!we(t)&&e.get(t)||du,r=>{if(!we(t)){const i=e.get(t);t in jo||(jo[t]=i),n[5](t,mn(i,r),i||du)}},n[6],()=>!we(t)&&t in jo?jo[t]:!we(t)&&e.get(t)||du]};let mu=!0;const C2=()=>mu,[gu,yu]=vi&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Xt,Xt],A2=()=>{const e=pu&&document.visibilityState;return we(e)||e!=="hidden"},T2=e=>(pu&&document.addEventListener("visibilitychange",e),gu("focus",e),()=>{pu&&document.removeEventListener("visibilitychange",e),yu("focus",e)}),I2=e=>{const t=()=>{mu=!0,e()},n=()=>{mu=!1};return gu("online",t),gu("offline",n),()=>{yu("online",t),yu("offline",n)}},O2={isOnline:C2,isVisible:A2},M2={initFocus:T2,initReconnect:I2},jy=!M.useId,pr=!vi||k2,D2=e=>E2()?window.requestAnimationFrame(e):setTimeout(e,1),vu=pr?M.useEffect:M.useLayoutEffect,bu=typeof navigator<"u"&&navigator.connection,Vy=!pr&&bu&&(["slow-2g","2g"].includes(bu.effectiveType)||bu.saveData),Vo=new WeakMap,N2=e=>fu.prototype.toString.call(e),wu=(e,t)=>e===`[object ${t}]`;let _2=0;const Su=e=>{const t=typeof e,n=N2(e),r=wu(n,"Date"),i=wu(n,"RegExp"),o=wu(n,"Object");let s,a;if(fu(e)===e&&!r&&!i){if(s=Vo.get(e),s)return s;if(s=++_2+"~",Vo.set(e,s),Array.isArray(e)){for(s="@",a=0;a<e.length;a++)s+=Su(e[a])+",";Vo.set(e,s)}if(o){s="#";const l=fu.keys(e).sort();for(;!we(a=l.pop());)we(e[a])||(s+=a+":"+Su(e[a])+",");Vo.set(e,s)}}else s=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return s},xu=e=>{if(Vt(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?Su(e):"",[e,t]};let P2=0;const ku=()=>++P2;async function Wy(...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=[],p=t.keys();for(const m of p)!/^\$(inf|sub)\$/.test(m)&&h(t.get(m)._k)&&d.push(m);return Promise.all(d.map(c))}return c(n);async function c(h){const[d]=xu(h);if(!d)return;const[p,m]=Hy(t,d),[g,v,y,w]=Jt.get(t),C=()=>{const F=g[d];return(Vt(o.revalidate)?o.revalidate(p().data,h):o.revalidate!==!1)&&(delete y[d],delete w[d],F&&F[0])?F[0]($y).then(()=>p().data):p().data};if(e.length<3)return C();let k=r,E,I=!1;const D=ku();v[d]=[D,0];const P=!we(l),T=p(),O=T.data,U=T._c,L=we(U)?O:U;if(P&&(l=Vt(l)?l(L,O):l,m({data:l,_c:L})),Vt(k))try{k=k(L)}catch(F){E=F,I=!0}if(k&&Uy(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,m({data:L,_c:rt}));if(s&&!I)if(Vt(s)){const F=s(k,L);m({data:F,error:rt,_c:rt})}else m({data:k,error:rt,_c:rt});if(v[d][1]=ku(),Promise.resolve(C()).then(()=>{m({_c:rt})}),I){if(f)throw E;return}return k}}const qy=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},L2=(e,t)=>{if(!Jt.has(e)){const n=mn(M2,t),r=Object.create(null),i=Wy.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 p of d)p(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,qy.bind(rt,r,Fy))),c=n.initReconnect(setTimeout.bind(rt,qy.bind(rt,r,Ry)));o=()=>{f&&f(),c&&c(),Jt.delete(e)}}};return u(),[e,i,u,o]}return[e,Jt.get(e)[4]]},F2=(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)},R2=cu,[Yy,$2]=L2(new Map),B2=mn({onLoadingSlow:Xt,onSuccess:Xt,onError:Xt,onErrorRetry:F2,onDiscarded:Xt,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:Vy?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:Vy?5e3:3e3,compare:R2,isPaused:()=>!1,cache:Yy,mutate:$2,fallback:{}},O2),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},U2=M.createContext({}),H2="$inf$",Ky=vi&&window.__SWR_DEVTOOLS_USE__,j2=Ky?window.__SWR_DEVTOOLS_USE__:[],V2=()=>{Ky&&(window.__SWR_DEVTOOLS_REACT__=M)},W2=e=>Vt(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],q2=()=>{const e=M.useContext(U2);return M.useMemo(()=>mn(B2,e),[e])},Y2=e=>(t,n,r)=>e(t,n&&((...o)=>{const[s]=xu(t),[,,,a]=Jt.get(Yy);if(s.startsWith(H2))return n(...o);const l=a[s];return we(l)?n(...o):(delete a[s],l)}),r),K2=j2.concat(Y2),G2=e=>function(...n){const r=q2(),[i,o,s]=W2(n),a=z2(r,s);let l=e;const{use:u}=a,f=(u||[]).concat(K2);for(let c=f.length;c--;)l=f[c](l);return l(i,o||a.fetcher||null,a)},Q2=(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())}};V2();const Eu=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}}),Cu={dedupe:!0},Gy=Promise.resolve(rt),Z2=()=>Xt,J2=G2((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,[p,m,g,v]=Jt.get(r),[y,w]=xu(e),C=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,U,L,F]=Hy(r,y),R=M.useRef({}).current,N=we(s)?we(n.fallback)?rt:n.fallback[y]:s,j=(Z,ue)=>{for(const de in R){const fe=de;if(fe==="data"){if(!i(Z[fe],ue[fe])&&(!we(Z[fe])||!i(Y,ue[fe])))return!1}else if(ue[fe]!==Z[fe])return!1}return!0},z=!C.current,V=M.useMemo(()=>{const Z=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(Z),Ae=Z===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,y]),b=as.useSyncExternalStore(M.useCallback(Z=>L(y,(ue,de)=>{j(de,ue)||Z()}),[r,y]),V[0],V[1]),_=p[y]&&p[y].length>0,B=b.data,S=we(B)?N&&Uy(N)?Eu(N):N:B,W=b.error,J=M.useRef(S),Y=h?we(B)?we(J.current)?S:J.current:B:S,G=y&&we(S),X=M.useRef(null);!pr&&as.useSyncExternalStore(Z2,()=>(X.current=!1,X),()=>(X.current=!0,X));const se=X.current;d&&se&&!o&&G&&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 K=!y||!t||P().isPaused()||_&&!we(W)?!1:z&&!we(a)?a:o?we(S)?!1:l:we(S)||l,ne=we(b.isValidating)?K:b.isValidating,$=we(b.isLoading)?K:b.isLoading,te=M.useCallback(async Z=>{const ue=I.current;if(!y||!ue||k.current||P().isPaused())return!1;let de,fe,Ae=!0;const Fe=Z||{},Me=!g[y]||!Fe.dedupe,He=()=>jy?!k.current&&y===E.current&&C.current:y===E.current,ee={isValidating:!1,isLoading:!1},ae=()=>{U(ee)},H=()=>{const oe=g[y];oe&&oe[1]===fe&&delete g[y]},q={isValidating:!0};we(O().data)&&(q.isLoading=!0);try{if(Me&&(U(q),n.loadingTimeout&&we(O().data)&&setTimeout(()=>{Ae&&He()&&P().onLoadingSlow(y,n)},n.loadingTimeout),g[y]=[ue(w),ku()]),[de,fe]=g[y],de=await de,Me&&setTimeout(H,n.dedupingInterval),!g[y]||g[y][1]!==fe)return Me&&He()&&P().onDiscarded(y),!1;ee.error=rt;const oe=m[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){H();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=p[y];Ge&&Ge[0]&&Ge[0](By,je)},{retryCount:(Fe.retryCount||0)+1,dedupe:!0})))}return Ae=!1,ae(),!0},[y,r]),me=M.useCallback((...Z)=>Wy(r,E.current,...Z),[]);if(vu(()=>{I.current=t,D.current=n,we(B)||(J.current=B)}),vu(()=>{if(!y)return;const Z=te.bind(rt,Cu);let ue=0;P().revalidateOnFocus&&(ue=Date.now()+P().focusThrottleInterval);const fe=Q2(y,p,(Ae,Fe={})=>{if(Ae==Fy){const Me=Date.now();P().revalidateOnFocus&&Me>ue&&T()&&(ue=Me+P().focusThrottleInterval,Z())}else if(Ae==Ry)P().revalidateOnReconnect&&T()&&Z();else{if(Ae==$y)return te();if(Ae==By)return te(Fe)}});return k.current=!1,E.current=y,C.current=!0,U({_k:w}),K&&(g[y]||(we(S)||pr?Z():D2(Z))),()=>{k.current=!0,fe()}},[y]),vu(()=>{let Z;function ue(){const fe=Vt(u)?u(O().data):u;fe&&Z!==-1&&(Z=setTimeout(de,fe))}function de(){!O().error&&(f||P().isVisible())&&(c||P().isOnline())?te(Cu).then(ue):ue()}return ue(),()=>{Z&&(clearTimeout(Z),Z=-1)}},[u,f,c,y]),M.useDebugValue(Y),o){if(!jy&&pr&&G)throw new Error("Fallback data is required when using Suspense in SSR.");G&&(I.current=t,D.current=n,k.current=!1);const Z=v[y],ue=!we(Z)&&G?me(Z):Gy;if(Eu(ue),!we(W)&&G)throw W;const de=G?te(Cu):Gy;!we(Y)&&G&&(de.status="fulfilled",de.value=!0),Eu(de)}return{mutate:me,get data(){return R.data=!0,Y},get error(){return R.error=!0,W},get isValidating(){return R.isValidating=!0,ne},get isLoading(){return R.isLoading=!0,$}}});function Qy({userCredentials:e,listConversations:t,clientId:n}){const r=!!e&&n&&t,{data:i,error:o,isValidating:s,mutate:a}=J2(r?[n,"conversations",e==null?void 0:e.userId]:null,async()=>(await t({})).conversations.filter(X2).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 X2=e=>!!e.lastMessage,e_=e=>e==null||e.length===0?"":e.charAt(0).toUpperCase()+e.slice(1),Au=({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(ou,{onClick:r})})]}),o?x.jsx("div",{...f.loaderContainer,children:x.jsx(Ey,{})}):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(p=>p.type==="text")){const p=h.payload.items.find(m=>m.type==="text");d=(p==null?void 0:p.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(XA,{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:e_(yw(h.createdAt))})]}),x.jsx(sp,{strokeWidth:1.5,...f.conversation.chevron})]},c)})}),x.jsxs("button",{...f.newConversation.button,onClick:n,children:[x.jsx(GA,{...f.newConversation.icon}),"New conversation"]})]})};Au.displayName="ConversationHistory";const Zy=({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:p,listConversations:m,restartConversation:g,clientId:v,storageKey:y,soundOn:w,toggleSound:C,disableSendButton:k,conversationId:E,...I})=>{const{color:D,fontFamily:P,radius:T,themeMode:O,variant:U,headerVariant:L,botAvatar:F,botDescription:R,botName:N,composerPlaceholder:j,footer:z,feedbackEnabled:V,additionalStylesheet:b,additionalStylesheetUrl:_,allowFileUpload:B,conversationHistory:S}=t,W={color:D,fontFamily:P,radius:T,themeMode:O,variant:U,headerVariant:L,additionalStylesheet:b,additionalStylesheetUrl:_},[J,Y]=M.useState("chat"),G=Qy({clientId:v,listConversations:m,userCredentials:i});M.useEffect(()=>{J==="conversations"&&G.refresh()},[J]),V||(p=void 0);const X=M.useMemo(()=>i?ec(r,f,i.userId,N,F):[],[F,N,r,i,f]),se=M.useMemo(()=>{var $,te;return((te=($=r.at(-1))==null?void 0:$.metadata)==null?void 0:te.conversationStatus)==="closed"},[r]),K=M.useRef(null),ne=Qn($=>$.setPortalContainer);return M.useEffect(()=>(ne(K.current),()=>{ne(null)}),[ne]),x.jsxs(x.Fragment,{children:[x.jsx(_g,{...W}),x.jsx("div",{ref:K,style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none",zIndex:10}}),x.jsx(eu,{connected:e,allowFileUpload:B,uploadFile:d,storageKey:y,conversationId:E,...I,children:u||G.error?x.jsx(Cy,{error:u||G.error,restartConversation:g,closeWindow:c}):J==="conversations"?x.jsx(Au,{onClose:c,conversations:G.conversations,isLoading:G.isLoading,onNewConversation:()=>{g==null||g(),Y("chat")},onConversationClick:$=>{g==null||g($),Y("chat")},botAvatar:F,botName:N}):x.jsxs(x.Fragment,{children:[x.jsx(xy,{showConversationHistory:S?()=>Y("conversations"):void 0,closeWindow:c,configuration:t,restartConversation:g,clientId:v,soundOn:w,toggleSound:C}),o?x.jsx(Ey,{}):x.jsx(uu,{botAvatar:F,botDescription:R,botName:N,renderers:s,isTyping:n,sendMessage:h,addMessageFeedback:p,messages:X},E),!se&&x.jsx(Xm,{sendMessage:h,uploadFile:d,connected:e,isReadOnly:a,disableComposer:l,footer:z,composerPlaceholder:j,allowFileUpload:B,storageKey:y,disableSendButton:k,conversationId:E})]})})]})};function t_({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:p}=Py(),{openConversation:m,listConversations:g}=Ly(),{userCredentials:v}=_y(),{soundOn:y,toggleSound:w}=Ny({storageKey:i,soundEnabled:e==null?void 0:e.soundEnabled});return x.jsx(Zy,{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:m,participants:s,error:h,clientId:n,soundOn:y,toggleSound:w,disableSendButton:p,conversationId:f,storageKey:i,...r})}const n_=({clientId:e,storageKey:t,configuration:n,apiUrl:r,user:i,conversationId:o,...s})=>{const a=t||`bp-webchat-${e}`;return x.jsx(hy,{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(t_,{configuration:n,storageKey:t,clientId:e,...s})})};function r_(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 i_="DismissableLayer",Tu="dismissableLayer.update",o_="dismissableLayer.pointerDownOutside",s_="dismissableLayer.focusOutside",Jy,Xy=A.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ev=A.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,onDismiss:a,...l}=e,u=A.useContext(Xy),[f,c]=A.useState(null),h=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,d]=A.useState({}),p=tn(t,I=>c(I)),m=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=m.indexOf(g),y=f?m.indexOf(f):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,C=y>=v,k=u_(I=>{const D=I.target,P=[...u.branches].some(T=>T.contains(D));!C||P||(i==null||i(I),s==null||s(I),I.defaultPrevented||a==null||a())},h),E=c_(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 r_(I=>{y===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&&(Jy=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),tv(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Jy)}},[f,h,n,u]),A.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),tv())},[f,u]),A.useEffect(()=>{const I=()=>d({});return document.addEventListener(Tu,I),()=>document.removeEventListener(Tu,I)},[]),x.jsx(Ft.div,{...l,ref:p,style:{pointerEvents:w?C?"auto":"none":void 0,...e.style},onFocusCapture:Zt(e.onFocusCapture,E.onFocusCapture),onBlurCapture:Zt(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Zt(e.onPointerDownCapture,k.onPointerDownCapture)})});ev.displayName=i_;var a_="DismissableLayerBranch",l_=A.forwardRef((e,t)=>{const n=A.useContext(Xy),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]),x.jsx(Ft.div,{...e,ref:i})});l_.displayName=a_;function u_(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(){nv(o_,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 c_(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&&nv(s_,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 tv(){const e=new CustomEvent(Tu);document.dispatchEvent(e)}function nv(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?t2(i,o):i.dispatchEvent(o)}var Iu="focusScope.autoFocusOnMount",Ou="focusScope.autoFocusOnUnmount",rv={bubbles:!1,cancelable:!0},f_="FocusScope",iv=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,m=>l(m)),d=A.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;A.useEffect(()=>{if(r){let m=function(w){if(d.paused||!a)return;const C=w.target;a.contains(C)?c.current=C:gn(c.current,{select:!0})},g=function(w){if(d.paused||!a)return;const C=w.relatedTarget;C!==null&&(a.contains(C)||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",m),document.addEventListener("focusout",g);const y=new MutationObserver(v);return a&&y.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",g),y.disconnect()}}},[r,a,d.paused]),A.useEffect(()=>{if(a){av.add(d);const m=document.activeElement;if(!a.contains(m)){const v=new CustomEvent(Iu,rv);a.addEventListener(Iu,u),a.dispatchEvent(v),v.defaultPrevented||(d_(y_(ov(a)),{select:!0}),document.activeElement===m&&gn(a))}return()=>{a.removeEventListener(Iu,u),setTimeout(()=>{const v=new CustomEvent(Ou,rv);a.addEventListener(Ou,f),a.dispatchEvent(v),v.defaultPrevented||gn(m??document.body,{select:!0}),a.removeEventListener(Ou,f),av.remove(d)},0)}}},[a,u,f,d]);const p=A.useCallback(m=>{if(!n&&!r||d.paused)return;const g=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,v=document.activeElement;if(g&&v){const y=m.currentTarget,[w,C]=h_(y);w&&C?!m.shiftKey&&v===C?(m.preventDefault(),n&&gn(w,{select:!0})):m.shiftKey&&v===w&&(m.preventDefault(),n&&gn(C,{select:!0})):v===y&&m.preventDefault()}},[n,r,d.paused]);return x.jsx(Ft.div,{tabIndex:-1,...s,ref:h,onKeyDown:p})});iv.displayName=f_;function d_(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(gn(r,{select:t}),document.activeElement!==n)return}function h_(e){const t=ov(e),n=sv(t,e),r=sv(t.reverse(),e);return[n,r]}function ov(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 sv(e,t){for(const n of e)if(!p_(n,{upTo:t}))return n}function p_(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 m_(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&&m_(e)&&t&&e.select()}}var av=g_();function g_(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=lv(e,t),e.unshift(t)},remove(t){var n;e=lv(e,t),(n=e[0])==null||n.resume()}}}function lv(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function y_(e){return e.filter(t=>t.tagName!=="A")}var Mu=0;function v_(){A.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??uv()),document.body.insertAdjacentElement("beforeend",e[1]??uv()),Mu++,()=>{Mu===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Mu--}},[])}function uv(){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",b_="with-scroll-bars-hidden",w_="--removed-body-scroll-bar-size";function Du(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function S_(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 x_=typeof window<"u"?A.useLayoutEffect:A.useEffect,cv=new WeakMap;function k_(e,t){var n=S_(null,function(r){return e.forEach(function(i){return Du(i,r)})});return x_(function(){var r=cv.get(n);if(r){var i=new Set(r),o=new Set(e),s=n.current;i.forEach(function(a){o.has(a)||Du(a,null)}),o.forEach(function(a){i.has(a)||Du(a,s)})}cv.set(n,e)},[e]),n}function E_(e){return e}function C_(e,t){t===void 0&&(t=E_);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 A_(e){e===void 0&&(e={});var t=C_(null);return t.options=xt({async:!0,ssr:!1},e),t}var fv=function(e){var t=e.sideCar,n=Op(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))};fv.isSideCarExport=!0;function T_(e,t){return e.useMedium(t),fv}var dv=A_(),Nu=function(){},Yo=A.forwardRef(function(e,t){var n=A.useRef(null),r=A.useState({onScrollCapture:Nu,onWheelCapture:Nu,onTouchMoveCapture:Nu}),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,p=e.noIsolation,m=e.inert,g=e.allowPinchZoom,v=e.as,y=v===void 0?"div":v,w=e.gapMode,C=Op(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=h,E=k_([n,t]),I=xt(xt({},C),i);return A.createElement(A.Fragment,null,f&&A.createElement(k,{sideCar:dv,removeScrollBar:u,shards:c,noRelative:d,noIsolation:p,inert:m,setCallbacks:o,allowPinchZoom:!!g,lockRef:n,gapMode:w}),s?A.cloneElement(A.Children.only(a),xt(xt({},I),{ref:E})):A.createElement(y,xt({},I,{className:l,ref:E}),a))});Yo.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Yo.classNames={fullWidth:qo,zeroRight:Wo};var I_=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function O_(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=I_();return t&&e.setAttribute("nonce",t),e}function M_(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function D_(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var N_=function(){var e=0,t=null;return{add:function(n){e==0&&(t=O_())&&(M_(t,n),D_(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},__=function(){var e=N_();return function(t,n){A.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},hv=function(){var e=__(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},P_={left:0,top:0,right:0,gap:0},_u=function(e){return parseInt(e||"",10)||0},L_=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[_u(n),_u(r),_u(i)]},F_=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return P_;var t=L_(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])}},R_=hv(),mr="data-scroll-locked",$_=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(b_,` {
323
+ `&&r++}}return[t,n]}class uy 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(cy(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(cy(this),n)}}function WN(e){const t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function Wl(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(Wl).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${Wl(e.cause)}`:e.message:`${e}`}function cy(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var fy=e=>{throw TypeError(e)},ql=(e,t,n)=>t.has(e)||fy("Cannot "+n),be=(e,t,n)=>(ql(e,t,"read from private field"),n?n.call(e):t.get(e)),Ge=(e,t,n)=>t.has(e)?fy("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Pe=(e,t,n,r)=>(ql(e,t,"write to private field"),t.set(e,n),n),Zt=(e,t,n)=>(ql(e,t,"access private method"),n),ht,_n,fr,Po,Fo,pi,dr,mi,mn,hr,pr,mr,gi,Ft,Yl,Kl,Gl,dy,Ql,Zl,yi,Jl,Xl;let Ro=class extends EventTarget{constructor(t,n){var r,i;super(),Ge(this,Ft),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,Ge(this,ht),Ge(this,_n),Ge(this,fr),Ge(this,Po),Ge(this,Fo),Ge(this,pi),Ge(this,dr),Ge(this,mi,null),Ge(this,mn),Ge(this,hr),Ge(this,pr,null),Ge(this,mr,null),Ge(this,gi,null),Ge(this,Kl,async o=>{var s;be(this,hr).reset();const{body:a,redirected:l,status:u,headers:f}=o;if(u===204){Zt(this,Ft,yi).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(l?Pe(this,fr,new URL(o.url)):Pe(this,fr,void 0),u!==200){Zt(this,Ft,yi).call(this,`Non-200 status code (${u})`,u);return}if(!(f.get("content-type")||"").startsWith("text/event-stream")){Zt(this,Ft,yi).call(this,'Invalid content type, expected "text/event-stream"',u);return}if(be(this,ht)===this.CLOSED)return;Pe(this,ht,this.OPEN);const c=new Event("open");if((s=be(this,gi))==null||s.call(this,c),this.dispatchEvent(c),typeof a!="object"||!a||!("getReader"in a)){Zt(this,Ft,yi).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,hr).feed(h.decode(g,{stream:!p})),p&&(m=!1,be(this,hr).reset(),Zt(this,Ft,Jl).call(this))}while(m)}),Ge(this,Gl,o=>{Pe(this,mn,void 0),!(o.name==="AbortError"||o.type==="aborted")&&Zt(this,Ft,Jl).call(this,Wl(o))}),Ge(this,Ql,o=>{typeof o.id=="string"&&Pe(this,mi,o.id);const s=new MessageEvent(o.event||"message",{data:o.data,origin:be(this,fr)?be(this,fr).origin:be(this,_n).origin,lastEventId:o.id||""});be(this,mr)&&(!o.event||o.event==="message")&&be(this,mr).call(this,s),this.dispatchEvent(s)}),Ge(this,Zl,o=>{Pe(this,pi,o)}),Ge(this,Xl,()=>{Pe(this,dr,void 0),be(this,ht)===this.CONNECTING&&Zt(this,Ft,Yl).call(this)});try{if(t instanceof URL)Pe(this,_n,t);else if(typeof t=="string")Pe(this,_n,new URL(t,qN()));else throw new Error("Invalid URL")}catch{throw WN("An invalid or illegal string was specified")}Pe(this,hr,jN({onEvent:be(this,Ql),onRetry:be(this,Zl)})),Pe(this,ht,this.CONNECTING),Pe(this,pi,3e3),Pe(this,Fo,(r=n==null?void 0:n.fetch)!=null?r:globalThis.fetch),Pe(this,Po,(i=n==null?void 0:n.withCredentials)!=null?i:!1),Zt(this,Ft,Yl).call(this)}get readyState(){return be(this,ht)}get url(){return be(this,_n).href}get withCredentials(){return be(this,Po)}get onerror(){return be(this,pr)}set onerror(t){Pe(this,pr,t)}get onmessage(){return be(this,mr)}set onmessage(t){Pe(this,mr,t)}get onopen(){return be(this,gi)}set onopen(t){Pe(this,gi,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,dr)&&clearTimeout(be(this,dr)),be(this,ht)!==this.CLOSED&&(be(this,mn)&&be(this,mn).abort(),Pe(this,ht,this.CLOSED),Pe(this,mn,void 0))}};ht=new WeakMap,_n=new WeakMap,fr=new WeakMap,Po=new WeakMap,Fo=new WeakMap,pi=new WeakMap,dr=new WeakMap,mi=new WeakMap,mn=new WeakMap,hr=new WeakMap,pr=new WeakMap,mr=new WeakMap,gi=new WeakMap,Ft=new WeakSet,Yl=function(){Pe(this,ht,this.CONNECTING),Pe(this,mn,new AbortController),be(this,Fo)(be(this,_n),Zt(this,Ft,dy).call(this)).then(be(this,Kl)).catch(be(this,Gl))},Kl=new WeakMap,Gl=new WeakMap,dy=function(){var e;const t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...be(this,mi)?{"Last-Event-ID":be(this,mi)}:void 0},cache:"no-store",signal:(e=be(this,mn))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},Ql=new WeakMap,Zl=new WeakMap,yi=function(e,t){var n;be(this,ht)!==this.CLOSED&&Pe(this,ht,this.CLOSED);const r=new uy("error",{code:t,message:e});(n=be(this,pr))==null||n.call(this,r),this.dispatchEvent(r)},Jl=function(e,t){var n;if(be(this,ht)===this.CLOSED)return;Pe(this,ht,this.CONNECTING);const r=new uy("error",{code:t,message:e});(n=be(this,pr))==null||n.call(this,r),this.dispatchEvent(r),Pe(this,dr,setTimeout(be(this,Xl),be(this,pi)))},Xl=new WeakMap,Ro.CONNECTING=0,Ro.OPEN=1,Ro.CLOSED=2;function qN(){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 YN(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 hy=()=>{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}))},cleanup:()=>{for(const t in e)delete e[t]}}},He=e=>e.data,py=10,my=3e3,KN="60000",gy=(e,t)=>{const n=(...r)=>e.on(...r);return new Proxy(n,{get:(r,i)=>i==="on"?e.on:i==="disconnect"?t:i==="cleanup"?e.cleanup:Reflect.get(r,i)})},GN={throwOnError:!0},QN=({conversationId:e,userToken:t,clientId:n,apiUrl:r,adminSecret:i})=>{let o=0,s=null,a=null;const l=hy();let u=e,f=t;const c=()=>{s&&(clearTimeout(s),s=null),a&&(a.close(),a=null)},h=()=>{a&&a.close();const d=`${`${r||_e.getConfig().baseUrl}/${n}`}/initialize${u?`?conversationId=${u}`:""}`,m={...i?{"x-admin-secret":i}:{},...f?{"x-user-key":f}:{}};a=vy(d,m),a.addEventListener("open",()=>l.emit("open")),a.addEventListener("error",p=>{o<py?(o++,s=setTimeout(()=>h(),my)):l.emit("error",p)}),a.addEventListener("message",p=>{const g=yy(p.data);g.type==="init"&&(u=g.data.conversation.id??u,f=g.data.user.userKey??f),l.emit(g.type,g.data)})};return h(),gy(l,c)},ZN=({userKey:e,clientId:t,apiUrl:n,customHeaders:r,advancedOptions:i})=>{const o={"x-user-key":e,...r},s=`${n||_e.getConfig().baseUrl}/${t}`,a={...GN,baseUrl:s};return _e.interceptors.response._fns.length===0&&_e.interceptors.response.use(YN),{createConversation:()=>EN({...a,headers:o,body:{}}).then(He),getConversation:({conversationId:l})=>kN({...a,headers:o,path:{id:l}}).then(He),deleteConversation:({conversationId:l})=>SN({...a,headers:o,path:{id:l}}).then(He),listConversations:({nextToken:l})=>xN({...a,headers:o,query:{nextToken:l}}).then(He),listConversationMessages:({conversationId:l,nextToken:u})=>CN({...a,headers:o,path:{id:l},query:{nextToken:u}}).then(He),addParticipant:({conversationId:l,userId:u})=>TN({...a,headers:o,path:{id:l},body:{userId:u}}).then(He),removeParticipant:({conversationId:l,userId:u})=>IN({...a,headers:o,path:{id:l,userId:u}}).then(He),getParticipant:({conversationId:l,userId:u})=>ON({...a,headers:o,path:{id:l,userId:u}}).then(He),listParticipants:({conversationId:l,nextToken:u})=>AN({...a,headers:o,path:{id:l},query:{nextToken:u}}).then(He),createMessage:l=>LN({...a,headers:o,body:l}).then(He),updateMessage:({messageId:l,...u})=>NN({...a,headers:o,path:{id:l},body:u}).then(He),getMessage:({messageId:l})=>MN({...a,headers:o,path:{id:l}}).then(He),deleteMessage:({messageId:l})=>DN({...a,headers:o,path:{id:l}}).then(He),createFile:l=>UN({...a,headers:o,body:l}).then(He),getUser:()=>RN({...a,headers:o}).then(He),updateUser:l=>BN({...a,headers:o,body:l}).then(He),deleteUser:()=>FN({...a,headers:o}).then(He),createEvent:l=>HN({...a,headers:o,body:l}).then(He),getEvent:({eventId:l})=>zN({...a,headers:o,path:{id:l}}).then(He),addMessageFeedback:({messageId:l,...u})=>PN({...a,headers:o,path:{id:l},body:u}).then(He),removeMessageFeedback:({messageId:l})=>_N({...a,headers:o,path:{id:l}}).then(He),generateUserKey:({adminSecret:l,...u})=>$N({...a,headers:{"x-admin-secret":l},body:u}).then(He),listenConversation:({conversationId:l})=>{let u=0,f=null,c=null;const h=hy(),d=()=>{f&&(clearTimeout(f),f=null),c&&(c.close(),c=null)},m=()=>{c&&c.close();const p=`${s}/conversations/${l}/listen`,g=i==null?void 0:i.eventSource;c=g?g({url:p,headers:o}):vy(p,o),c.addEventListener("open",()=>h.emit("open")),c.addEventListener("error",v=>{u<py?(u++,f=setTimeout(()=>m(),my)):h.emit("error",v)}),c.addEventListener("message",v=>{const y=yy(v.data);h.emit(y.type,y.data)})};return m(),gy(h,d)}}},yy=e=>{try{return JSON.parse(e)}catch{return e}},vy=(e,t)=>new Ro(e,{fetch:(n,r)=>fetch(n,{...r,headers:{...r==null?void 0:r.headers,...t,timeout:KN}})}),JN=async({apiUrl:e,clientId:t,adminSecret:n,clientHeaders:r,emitter:i,conversationId:o,userToken:s})=>new Promise(a=>{const l=QN({apiUrl:e,clientId:t,userToken:s,conversationId:o,adminSecret:n}),u=l("init",({conversation:f,messages:c,participants:h,user:d})=>{const m=Ha(f.id),p=c.reverse().map(cr).filter(Boolean);m.getState().setMessages(p),Wa(f.id).getState().setParticipants(h);const v=ZN({clientId:t,apiUrl:e,userKey:d.userKey,customHeaders:r});v.createEvent({conversationId:f.id,payload:{type:"conversation_started",data:{}}}).then(({event:y})=>{var w,A;(A=(w=y.payload.data)==null?void 0:w.status)!=null&&A.isInitial&&i.emit("conversation",f.id)}),a({on:l,conversation:f,messages:c,participants:h,user:d,client:v,onCleanup:()=>{u(),l.disconnect(),l.cleanup()}})})}),XN={webchat:"#9C27B0",client:"#2196F3",store:"#4CAF50",events:"#00BCD4"},eL={debug:"#9E9E9E",info:"#2196F3",warn:"#FF9800",error:"#F44336"};let by=!1,eu=null,wy=Date.now();const tL=e=>{by=e,wy=Date.now()},nL=e=>{eu=e},rL=()=>{const e=Date.now()-wy,t=Math.floor(e/1e3),n=e%1e3;return`+${t}.${n.toString().padStart(3,"0")}s`},iL=e=>e===void 0?"undefined":e===null?"null":e instanceof Error?{error:e.message,stack:e.stack}:e,Bo=e=>{const t=XN[e]||"#666",n=(r,...i)=>{if(!by&&r!=="warn"&&r!=="error")return;const o=rL(),s=`%c[bp:${e}]%c ${o} %c${r.toUpperCase()}%c`,a=[`color: ${t}; font-weight: bold;`,"color: #999; font-size: 10px;",`color: ${eL[r]}; font-weight: bold;`,"color: inherit;"],l=i.map(iL);if(console[r](s,...a,...l),eu){const[u,f]=i;eu(`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)}},Sy={webchat:Bo("webchat"),client:Bo("client"),store:Bo("store"),events:Bo("events")};function ky(){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 vi=Sy.webchat;function xy({apiUrl:e="https://webchat.botpress.cloud",clientId:t,storageKey:n,storageLocation:r,adminSecret:i,clientHeaders:o,playNotificationSound:s,...a}){const l=Np(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}=ky(),{state:p,setState:g}=ky(),v=D.useMemo(()=>hc(),[]),[y,w]=D.useState("connecting"),[A,k]=D.useState(void 0),[E,I]=D.useState(void 0),M=D.useRef(null),L=o1(a.conversationId,a.userToken,u,f==null?void 0:f.userToken);D.useEffect(()=>{let O=!1;vi.info("starting initialization",{clientId:t,apiUrl:e,storageKey:n});const H=async()=>{var F;await T(L),O&&(vi.debug("initialization completed but effect was cleaned up, tearing down"),(F=M.current)==null||F.call(M),M.current=null)},P=r1(t,e);if(P){vi.error("configuration error",P),I(P),w("error");return}return H(),()=>{O=!0,M.current&&(M.current(),M.current=null)}},[a.conversationId,a.userToken,t,e]);const T=async({conversationId:O,userToken:H})=>{var N;(N=M.current)==null||N.call(M),I(void 0),m(!1),g(!1),w("connecting");const{on:P,conversation:F,user:_,client:z,onCleanup:$}=await JN({apiUrl:e,clientId:t,clientHeaders:o,emitter:v,adminSecret:i,conversationId:O,userToken:H});k(z),c(F.id),h({userId:_.id,userToken:_.userKey});const U=Ha(F.id),W=Wa(F.id),b=[$,P("open",()=>{I(void 0),w("connected")}),P("error",R=>{vi.error("connection error",{error:R,conversationId:F.id}),I(S=>S||Rr(R)),w("error"),v.emit("error",new Error(`Connection to conversation lost: ${R==null?void 0:R.message}`))}),P("message_created",R=>{const S=cr(R);U.getState().saveMessage(S),_.id!==S.authorId&&(s==null||s(),m(!1),g(!1),v.emit("isTyping",{isTyping:!1,timeout:0})),v.emit("message",S)}),P("message_updated",R=>{const S=cr(R);U.getState().saveMessage(S)}),P("message_status_changed",R=>{var S;R.newStatus==="processing"&&U.getState().updateMessage((S=R.message.metadata)==null?void 0:S.clientMessageId,{status:R.newStatus})}),P("typing_stopped",()=>{m(!1),g(!1)}),P("typing_started",()=>{m(!0,5e3),g(!0,5e3),v.emit("isTyping",{isTyping:!0,timeout:5e3})}),P("participant_added",R=>{W.getState().addParticipant(R.participant),v.emit("participantAdded",R.participant)}),P("participant_removed",R=>{W.getState().removeParticipant(R.participantId),v.emit("participantRemoved",R.participantId)}),P("webchat_visibility",R=>v.emit("webchatVisibility",R.visibility)),P("webchat_config",R=>v.emit("webchatConfig",R.config)),P("custom",R=>v.emit("customEvent",R.event))];w("connected"),vi.info("client fully connected with event handlers ready",{conversationId:F.id}),M.current=()=>{b.forEach(R=>R())}};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 Ey=D.createContext(null);function $o(){const e=D.useContext(Ey);if(!e)throw new Error("useWebchatContext must be used inside <WebchatProvider>");return e}function Cy({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}=xy({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(Ey.Provider,{value:A,children:s})}const tu=({children:e,className:t,uploadFile:n,allowFileUpload:r,storageKey:i,conversationId:o,...s})=>{const{container:a}=ye,l=Jn(g=>g.setMessageContainerRef),f=Lp(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(v=>f(v,n)),h(0))},[f,n]),{getRootProps:p}=Hg({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:ur(a.className,t),...p(),ref:d,children:[x.jsxs("div",{"data-hover":c>0,...a.dropzone.overlay,children:["Drop files to upload",x.jsx(KA,{style:{width:"50px"}})]}),x.jsx(jg,{children:e})]})};tu.displayName="Container";const Ay=D.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})})});Ay.displayName="Fab";function Jt(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 oL(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 Ty(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,sL(i,...t)]}function sL(...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 aL=C[" useInsertionEffect ".trim().toString()]||tn;function Iy({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,s]=lL({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=uL(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 lL({defaultProp:e,onChange:t}){const[n,r]=C.useState(e),i=C.useRef(n),o=C.useRef(t);return aL(()=>{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 uL(e){return typeof e=="function"}function Oy(e){const t=cL(e),n=C.forwardRef((r,i)=>{const{children:o,...s}=r,a=C.Children.toArray(o),l=a.find(dL);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 cL(e){const t=C.forwardRef((n,r)=>{const{children:i,...o}=n;if(C.isValidElement(i)){const s=pL(i),a=hL(o,i.props);return i.type!==C.Fragment&&(a.ref=r?rs(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 fL=Symbol("radix.slottable");function dL(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===fL}function hL(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 pL(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 mL=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Rt=mL.reduce((e,t)=>{const n=Oy(`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 gL(e,t){e&&Hu.flushSync(()=>e.dispatchEvent(t))}function yL(e,t){return C.useReducer((n,r)=>t[n][r]??n,e)}var zo=e=>{const{present:t,children:n}=e,r=vL(t),i=typeof n=="function"?n({present:r.isPresent}):C.Children.only(n),o=nn(r.ref,bL(i));return typeof n=="function"||r.isPresent?C.cloneElement(i,{ref:o}):null};zo.displayName="Presence";function vL(e){const[t,n]=C.useState(),r=C.useRef(null),i=C.useRef(e),o=C.useRef("none"),s=e?"mounted":"unmounted",[a,l]=yL(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{const u=Ho(r.current);o.current=a==="mounted"?u:"none"},[a]),tn(()=>{const u=r.current,f=i.current;if(f!==e){const h=o.current,d=Ho(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]),tn(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,c=d=>{const p=Ho(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=Ho(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 Ho(e){return(e==null?void 0:e.animationName)||"none"}function bL(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 wL=C[" useId ".trim().toString()]||(()=>{}),SL=0;function Uo(e){const[t,n]=C.useState(wL());return tn(()=>{n(r=>r??String(SL++))},[e]),e||(t?`radix-${t}`:"")}var jo="Collapsible",[kL]=Ty(jo),[xL,nu]=kL(jo),Dy=C.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:s,...a}=e,[l,u]=Iy({prop:r,defaultProp:i??!1,onChange:s,caller:jo});return x.jsx(xL,{scope:n,disabled:o,contentId:Uo(),open:l,onOpenToggle:C.useCallback(()=>u(f=>!f),[u]),children:x.jsx(Rt.div,{"data-state":iu(l),"data-disabled":o?"":void 0,...a,ref:t})})});Dy.displayName=jo;var My="CollapsibleTrigger",Ny=C.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=nu(My,n);return x.jsx(Rt.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":iu(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:Jt(e.onClick,i.onOpenToggle)})});Ny.displayName=My;var ru="CollapsibleContent",Ly=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=nu(ru,e.__scopeCollapsible);return x.jsx(zo,{present:n||i.open,children:({present:o})=>x.jsx(EL,{...r,ref:t,present:o})})});Ly.displayName=ru;var EL=C.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=e,s=nu(ru,n),[a,l]=C.useState(r),u=C.useRef(null),f=nn(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)},[]),tn(()=>{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(Rt.div,{"data-state":iu(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 iu(e){return e?"open":"closed"}var CL=Dy,AL=Ly;const ou=({restartConversation:e,...t})=>{var s,a;const{header:n}=ye,{showInputModal:r}=Ga(),i=Ye(),o=async l=>{l.stopPropagation(),r?r({title:i["restartConversation.title"],description:i["restartConversation.description"],confirmButtonText:i["restartConversation.confirm"],cancelButtonText:i["restartConversation.cancel"]}).then(()=>e()):e()};return x.jsx(lT,{...t,...(a=(s=n==null?void 0:n.content)==null?void 0:s.actions)==null?void 0:a.icons,"aria-label":i["restartConversation.button.ariaLabel"],tabIndex:0,role:"button",onClick:o})},su=({onClick:e,...t})=>{const{header:n}=ye,r=Ye(),i=o=>{o.stopPropagation(),e==null||e()};return x.jsx(wp,{...t,...n.content.actions.icons,role:"button",tabIndex:0,"aria-label":r["closeButton.ariaLabel"],onClick:i,onKeyDown:o=>{o.key==="Enter"&&i(o)}})},TL=({onClick:e,...t})=>{const{header:n}=ye,r=Ye(),i=o=>{o.stopPropagation(),e==null||e()};return x.jsx(pp,{...t,...n.content.actions.icons,role:"button",tabIndex:0,"aria-label":r["conversationHistory.showButton.ariaLabel"],onClick:i,onKeyDown:o=>{o.key==="Enter"&&i(o)}})},bi=({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??GA;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},IL=({soundOn:e,toggleSound:t})=>{const n=Ye(),r=s=>{s.stopPropagation(),t==null||t()},{header:i}=ye,o=e?bp:mT;return x.jsx("div",{role:"button",tabIndex:0,onClick:r,onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),r(s))},title:e?n["header.sound.disable"]:n["header.sound.enable"],...i.content.actions.icons,children:x.jsx(o,{size:16})})},_y=({defaultOpen:e,closeWindow:t,configuration:n,restartConversation:r,showConversationHistory:i,disabled:o,soundOn:s,toggleSound:a,clientId:l,...u})=>{var g,v,y,w,A,k,E,I,M,L,T,O,H,P,F,_,z,$,U,W,b,N,R,S;const{header:f}=ye,c=Ye(),[h,d]=D.useState(e),m=!!((g=n.email)!=null&&g.title)||!!((v=n.phone)!=null&&v.title)||!!((y=n.website)!=null&&y.title)||!!((w=n.termsOfService)!=null&&w.link)||!!((A=n.privacyPolicy)!=null&&A.link),p=m&&!o;return x.jsxs(CL,{open:p?h:!1,onOpenChange:p?d:void 0,"data-disabled":p?void 0:"",...f.container,...u,children:[x.jsxs(Ny,{"aria-label":c["header.expandButton.ariaLabel"],...f.content.container,children:[x.jsx("div",{...f.content.conversationHistory,children:i&&!h&&x.jsx(TL,{onClick:i})}),x.jsx(Cn,{userId:l,src:n.botAvatar,...f.content.avatar,children:n.botName||c["header.defaultBotName"]}),x.jsx("h2",{...f.content.title,children:n.botName||c["header.defaultBotName"]}),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(IL,{soundOn:s,toggleSound:a}),r&&x.jsx(ou,{restartConversation:r}),t&&x.jsx(su,{onClick:t})]})]}),m&&x.jsxs(AL,{...f.expandedContent.container,children:[x.jsxs("div",{"data-links":"",...f.expandedContent.group,children:[x.jsx(bi,{"data-email":"",icon:nT,title:(k=n.email)==null?void 0:k.title,link:(I=(E=n.email)==null?void 0:E.link)!=null&&I.startsWith("mailto:")?(M=n.email)==null?void 0:M.link:`mailto:${(L=n.email)==null?void 0:L.link}`}),x.jsx(bi,{"data-phone":"",icon:sT,title:(T=n.phone)==null?void 0:T.title,link:(H=(O=n.phone)==null?void 0:O.link)!=null&&H.startsWith("tel:")?(P=n.phone)==null?void 0:P.link:`tel:${(F=n.phone)==null?void 0:F.link}`}),x.jsx(bi,{"data-website":"",link:(_=n.website)==null?void 0:_.link,icon:JA,title:(z=n.website)==null?void 0:z.title})]}),x.jsxs("div",{"data-legal":"",...($=f.expandedContent)==null?void 0:$.group,children:[((U=n.termsOfService)==null?void 0:U.link)&&x.jsx(bi,{"data-terms":"",link:(W=n.termsOfService)==null?void 0:W.link,icon:yp,title:(b=n.termsOfService)==null?void 0:b.title}),((N=n.privacyPolicy)==null?void 0:N.link)&&x.jsx(bi,{"data-privacy":"",link:(R=n.privacyPolicy)==null?void 0:R.link,icon:tT,title:(S=n.privacyPolicy)==null?void 0:S.title})]})]})]})},au=D.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})})});au.displayName="TypingIndicator";const lu=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},v)=>{const[y,w]=D.useState([]),{message:{container:A,deliveryStatus:k,deliveryStatusLabel:E}}=ye,I=Ye();return g=g??e==="incoming",x.jsx(Ya.Provider,{value:{isLoading:y,setIsLoading:w},children:x.jsxs("div",{...A,className:ur(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(Py,{authorId:s,sender:i}),t&&x.jsx(Nn,{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(Py,{authorId:s,sender:i}),r,e==="outgoing"&&x.jsx("span",{...E,"aria-hidden":!f,children:I["message.status.delivered"]})]})})})),Py=({authorId:e,sender:t})=>{const{message:{avatar:n}}=ye,[r,i]=D.useState("idle"),o=Zu(e??"",15);return x.jsxs(cs,{"data-color":o,"data-loading-status":r,...n==null?void 0:n.container,children:[x.jsx(fs,{...n==null?void 0:n.image,onLoadingStatusChange:i,src:t==null?void 0:t.avatar}),x.jsxs(ds,{...n==null?void 0:n.fallback,children:[t==null?void 0:t.name[0]," "]})]})};function OL({botAvatar:e,botDescription:t,botName:n}){const{messageList:{marquee:r}}=ye;return x.jsxs("li",{...r.container,children:[x.jsx(Cn,{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 uu=(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 DL=70,ML=300;function NL(e,t={}){const n=t.nearBottomThreshold??DL,[r,i]=D.useState(!0),o=D.useRef(null),s=D.useRef(0),a=D.useRef(!0),l=D.useRef(!1),u=D.useRef(!1),f=D.useRef(0),c=D.useCallback(y=>y.scrollHeight-y.clientHeight-y.scrollTop<n,[n]),h=D.useCallback((y,w=ML)=>{cancelAnimationFrame(f.current);const A=y.scrollTop,k=performance.now(),E=()=>{const I=performance.now()-k,M=Math.min(I/w,1),L=1-Math.pow(1-M,3),T=y.scrollHeight-y.clientHeight;y.scrollTop=A+(T-A)*L,s.current=y.scrollTop,M<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=D.useCallback(()=>{const y=o.current;y&&(a.current=!0,i(!0),h(y))},[h]),m=D.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=D.useCallback(y=>{y.deltaY<0&&(cancelAnimationFrame(f.current),u.current=!1,a.current=!1,i(!1))},[]),g=D.useCallback(()=>{u.current&&(cancelAnimationFrame(f.current),u.current=!1)},[]),v=D.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 D.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]),D.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()},[]),D.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)},[]),D.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()},[]),D.useEffect(()=>()=>cancelAnimationFrame(f.current),[]),{scrollRef:v,isAtBottom:r,scrollToBottom:d}}const LL={height:"100%",width:"100%",overflowY:"auto",scrollbarWidth:"none",overscrollBehaviorY:"contain"},cu=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 O;const{messageList:g}=ye,v=Ye(),y=D.useMemo(()=>c?Ab(t,v):t,[t,v]),w=D.useMemo(()=>{var P;const H=y.filter(F=>F.direction==="outgoing"&&F.status!=="pending");return(P=H[H.length-1])==null?void 0:P.id},[y]),A=y[y.length-1],k=(A==null?void 0:A.id)??"",E=`${y.length}:${k}:${n}`,{scrollRef:I,isAtBottom:M,scrollToBottom:L}=NL(E);D.useEffect(()=>{(A==null?void 0:A.direction)==="outgoing"&&L()},[k]);const T=H=>{if(H.direction==="incoming")return d;if(H.direction==="outgoing")return m};return x.jsxs("div",{...p,className:ur(g.container.className,e),children:[x.jsx("div",{ref:I,style:LL,children:x.jsxs("div",{className:g.viewPort.className,children:[r&&x.jsx("span",{...g.headerMessage,children:r}),f&&x.jsx(OL,{botAvatar:o,botDescription:s,botName:a}),y.map(H=>{var P;return x.jsx(lu,{renderers:i,sendMessage:l,addMessageFeedback:u,isLastDeliveredMessage:h&&H.id===w,showAvatar:T(H),...H},((P=H.metadata)==null?void 0:P.clientMessageId)||H.id)}),n&&x.jsx(lu,{id:uu(),renderers:i,sendMessage:l,direction:"incoming",timestamp:new Date,showAvatar:d,block:void 0,sender:((O=t.filter(H=>H.direction==="incoming").at(-1))==null?void 0:O.sender)??{name:a||"Bot",avatar:o},children:x.jsx(au,{})})]})}),!M&&x.jsx("button",{className:g.scrollDownButton.className,onClick:()=>L()})]})});cu.displayName="MessageList";const Fy=({className:e,...t})=>{const{className:n}=ye.loader;return x.jsx("div",{...t,className:ur(e,n)})};function Ry({error:e,restartConversation:t,closeWindow:n}){const r=Ye();let i,o;const{error:s}=ye;return e.type==="configuration"?(i=r["error.configuration"],o=x.jsx(oT,{...s.icon})):e.type==="bot"?(i=r["error.bot"],o=x.jsx(hp,{...s.icon})):e.type==="network"?(i=r["error.network"],o=x.jsx(gT,{...s.icon})):e.type==="disconnected"?(i=r["error.disconnected"],o=x.jsx(dT,{...s.icon})):(i=r["error.unexpected"],o=x.jsx(hp,{...s.icon})),x.jsx(_L,{error:e,title:i,icon:o,restartConversation:t,closeWindow:n})}function _L({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:[t,x.jsxs("div",{...o.header.actions,children:[r&&x.jsx(ou,{restartConversation:r,style:{color:"white",backgroundColor:"transparent"}}),i&&x.jsx(su,{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 wi=Sy.webchat;async function PL(e,t){const{userId:n,conversationId:r,userToken:i,openConversation:o,setClientState:s,setError:a,emitter:l}=t;wi.warn("handleWebchatError",{userId:n,conversationId:r,type:e.type,message:e.message});const f=[{name:"startNewConversation",predicate:c=>c.message===Rs||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){wi.error("no recovery strategy found, setting error state",{userId:n,conversationId:r}),s("error"),a(e);return}wi.info("attempting recovery",{userId:n,conversationId:r,strategy:f.name});try{await od(f.recover,3,5e3),wi.info("recovery successful",{userId:n,conversationId:r}),a(void 0),s("connected")}catch(c){wi.error("recovery failed",{error:c,userId:n,conversationId:r}),a(Rr(c)),s("error"),l.emit("error",c)}}function FL(e,t){return async(...n)=>{try{return await e(...n)}catch(r){await PL(Rr(r),t)}}}function By(e,t){const n={};for(const[r,i]of Object.entries(e))n[r]=FL(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 zy({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 i1(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:`${uu(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=qf(d)?d:"file";return{fileUrl:c,name:s,type:m,fileId:h}}}}function Hy({client:e,conversationId:t,userId:n,setAwaitingResponse:r}){const i=Ha(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,1e3);const m=uu(),p={id:m,createdAt:new Date().toISOString(),userId:n,conversationId:t,payload:d,metadata:{clientMessageId:m,delivered:!1}},g=cr(p);g.status="pending",s(g),await e.createMessage({conversationId:t,payload:d,metadata:{clientMessageId:m}})},setMessages:d=>{const m=d.map(p=>cr(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 Uy({client:e,conversationId:t}){const n=Wa(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 jy={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:ns&&ns.tagName.toUpperCase()==="SCRIPT"&&ns.src||new URL("index.umd.cjs",document.baseURI).href).href};function Vy({storageKey:e,soundEnabled:t}){const n=_p(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=jy.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 RL({apiUrl:e="https://webchat.botpress.cloud",clientId:t,storageKey:n,storageLocation:r,adminSecret:i,soundEnabled:o,clientHeaders:s,...a}){var z;const{soundOn:l,toggleSound:u,playNotificationSound:f}=Vy({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}=xy({apiUrl:e,clientId:t,storageKey:n,storageLocation:r,adminSecret:i,clientHeaders:s,conversationId:a.conversationId,userToken:(z=a.user)==null?void 0:z.userToken,playNotificationSound:f}),{messages:I,sendMessage:M,saveMessageFeedback:L}=Hy({client:h,conversationId:m,userId:p==null?void 0:p.userId,setAwaitingResponse:w}),{participants:T}=Uy({client:h,conversationId:m}),{uploadFile:O}=zy({client:h,conversationId:m,user:p}),{sendEvent:H}=$y({client:h,conversationId:m});if(c!=="connected"||!p||!m||!h)return{clientState:c,on:A.on,client:void 0,messages:[],conversationId:void 0,newConversation:$=>{y({conversationId:$,userToken:p==null?void 0:p.userToken}).catch(U=>{A.emit("error",U)})},user:void 0,isTyping:void 0,participants:[],toggleSound:u,soundOn:l,error:d,disableSendButton:v};const P={userId:p==null?void 0:p.userId,conversationId:m,userToken:p==null?void 0:p.userToken,openConversation:y,setClientState:E,setError:k,emitter:A},_={...By({sendMessage:async $=>M($),sendEvent:H,uploadFile:O,addMessageFeedback:L},P),getUser:async()=>{const{user:$}=await h.getUser();return $},updateUser:async $=>{const{user:U}=await h.updateUser({name:$.name,pictureUrl:$.pictureUrl,userData:$.data});return U},listConversations:async()=>h.listConversations({})};return{clientState:"connected",on:A.on,client:_,messages:I,conversationId:m,newConversation:$=>{y({conversationId:$,userToken:p.userToken}).catch(U=>{A.emit("error",U)})},user:p,isTyping:g,participants:T,error:d,soundOn:l,toggleSound:u,disableSendButton:v}}const Wy=()=>{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 qy(){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}=Hy({client:e,conversationId:t,userId:n==null?void 0:n.userId,setAwaitingResponse:r}),{participants:p}=Uy({client:e,conversationId:t}),{sendEvent:g}=$y({client:e,conversationId:t}),{uploadFile:v}=zy({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=By({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 Yy(){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 Ky=0,Gy=1,Qy=2,Zy=3;var Jy=Object.prototype.hasOwnProperty;function fu(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--&&fu(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(Jy.call(e,n)&&++r&&!Jy.call(t,n)||!(n in t)||!fu(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const Xt=new WeakMap,en=()=>{},it=en(),du=Object,Se=e=>e===it,Wt=e=>typeof e=="function",gn=(e,t)=>({...e,...t}),Xy=e=>Wt(e.then),hu={},Vo={},pu="undefined",Si=typeof window!=pu,mu=typeof document!=pu,BL=Si&&"Deno"in window,$L=()=>Si&&typeof window.requestAnimationFrame!=pu,ev=(e,t)=>{const n=Xt.get(e);return[()=>!Se(t)&&e.get(t)||hu,r=>{if(!Se(t)){const i=e.get(t);t in Vo||(Vo[t]=i),n[5](t,gn(i,r),i||hu)}},n[6],()=>!Se(t)&&t in Vo?Vo[t]:!Se(t)&&e.get(t)||hu]};let gu=!0;const zL=()=>gu,[yu,vu]=Si&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[en,en],HL=()=>{const e=mu&&document.visibilityState;return Se(e)||e!=="hidden"},UL=e=>(mu&&document.addEventListener("visibilitychange",e),yu("focus",e),()=>{mu&&document.removeEventListener("visibilitychange",e),vu("focus",e)}),jL=e=>{const t=()=>{gu=!0,e()},n=()=>{gu=!1};return yu("online",t),yu("offline",n),()=>{vu("online",t),vu("offline",n)}},VL={isOnline:zL,isVisible:HL},WL={initFocus:UL,initReconnect:jL},tv=!D.useId,gr=!Si||BL,qL=e=>$L()?window.requestAnimationFrame(e):setTimeout(e,1),bu=gr?D.useEffect:D.useLayoutEffect,wu=typeof navigator<"u"&&navigator.connection,nv=!gr&&wu&&(["slow-2g","2g"].includes(wu.effectiveType)||wu.saveData),Wo=new WeakMap,YL=e=>du.prototype.toString.call(e),Su=(e,t)=>e===`[object ${t}]`;let KL=0;const ku=e=>{const t=typeof e,n=YL(e),r=Su(n,"Date"),i=Su(n,"RegExp"),o=Su(n,"Object");let s,a;if(du(e)===e&&!r&&!i){if(s=Wo.get(e),s)return s;if(s=++KL+"~",Wo.set(e,s),Array.isArray(e)){for(s="@",a=0;a<e.length;a++)s+=ku(e[a])+",";Wo.set(e,s)}if(o){s="#";const l=du.keys(e).sort();for(;!Se(a=l.pop());)Se(e[a])||(s+=a+":"+ku(e[a])+",");Wo.set(e,s)}}else s=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return s},xu=e=>{if(Wt(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 GL=0;const Eu=()=>++GL;async function rv(...e){const[t,n,r,i]=e,o=gn({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(Wt(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]=xu(h);if(!d)return;const[m,p]=ev(t,d),[g,v,y,w]=Xt.get(t),A=()=>{const F=g[d];return(Wt(o.revalidate)?o.revalidate(m().data,h):o.revalidate!==!1)&&(delete y[d],delete w[d],F&&F[0])?F[0](Qy).then(()=>m().data):m().data};if(e.length<3)return A();let k=r,E,I=!1;const M=Eu();v[d]=[M,0];const L=!Se(l),T=m(),O=T.data,H=T._c,P=Se(H)?O:H;if(L&&(l=Wt(l)?l(P,O):l,p({data:l,_c:P})),Wt(k))try{k=k(P)}catch(F){E=F,I=!0}if(k&&Xy(k))if(k=await k.catch(F=>{E=F,I=!0}),M!==v[d][0]){if(I)throw E;return k}else I&&L&&u(E)&&(s=!0,p({data:P,_c:it}));if(s&&!I)if(Wt(s)){const F=s(k,P);p({data:F,error:it,_c:it})}else p({data:k,error:it,_c:it});if(v[d][1]=Eu(),Promise.resolve(A()).then(()=>{p({_c:it})}),I){if(f)throw E;return}return k}}const iv=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},QL=(e,t)=>{if(!Xt.has(e)){const n=gn(WL,t),r=Object.create(null),i=rv.bind(it,e);let o=en;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(!Xt.has(e)&&(Xt.set(e,[r,Object.create(null),Object.create(null),Object.create(null),i,l,a]),!gr)){const f=n.initFocus(setTimeout.bind(it,iv.bind(it,r,Ky))),c=n.initReconnect(setTimeout.bind(it,iv.bind(it,r,Gy)));o=()=>{f&&f(),c&&c(),Xt.delete(e)}}};return u(),[e,i,u,o]}return[e,Xt.get(e)[4]]},ZL=(e,t,n,r,i)=>{const o=n.errorRetryCount,s=i.retryCount,a=~~((Math.random()+.5)*(1<<(s<8?s:8)))*n.errorRetryInterval;!Se(o)&&s>o||setTimeout(r,a,i)},JL=fu,[ov,XL]=QL(new Map),e_=gn({onLoadingSlow:en,onSuccess:en,onError:en,onErrorRetry:ZL,onDiscarded:en,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:nv?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:nv?5e3:3e3,compare:JL,isPaused:()=>!1,cache:ov,mutate:XL,fallback:{}},VL),t_=(e,t)=>{const n=gn(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=gn(i,s))}return n},n_=D.createContext({}),r_="$inf$",sv=Si&&window.__SWR_DEVTOOLS_USE__,i_=sv?window.__SWR_DEVTOOLS_USE__:[],o_=()=>{sv&&(window.__SWR_DEVTOOLS_REACT__=D)},s_=e=>Wt(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],a_=()=>{const e=D.useContext(n_);return D.useMemo(()=>gn(e_,e),[e])},l_=e=>(t,n,r)=>e(t,n&&((...o)=>{const[s]=xu(t),[,,,a]=Xt.get(ov);if(s.startsWith(r_))return n(...o);const l=a[s];return Se(l)?n(...o):(delete a[s],l)}),r),u_=i_.concat(l_),c_=e=>function(...n){const r=a_(),[i,o,s]=s_(n),a=t_(r,s);let l=e;const{use:u}=a,f=(u||[]).concat(u_);for(let c=f.length;c--;)l=f[c](l);return l(i,o||a.fetcher||null,a)},f_=(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())}};o_();const Cu=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}}),Au={dedupe:!0},av=Promise.resolve(it),d_=()=>en,h_=c_((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]=Xt.get(r),[y,w]=xu(e),A=D.useRef(!1),k=D.useRef(!1),E=D.useRef(y),I=D.useRef(t),M=D.useRef(n),L=()=>M.current,T=()=>L().isVisible()&&L().isOnline(),[O,H,P,F]=ev(r,y),_=D.useRef({}).current,z=Se(s)?Se(n.fallback)?it:n.fallback[y]:s,$=(Q,ue)=>{for(const de in _){const fe=de;if(fe==="data"){if(!i(Q[fe],ue[fe])&&(!Se(Q[fe])||!i(Y,ue[fe])))return!1}else if(ue[fe]!==Q[fe])return!1}return!0},U=!A.current,W=D.useMemo(()=>{const Q=O(),ue=F(),de=De=>{const Ue=gn(De);return delete Ue._k,(()=>{if(!y||!t||L().isPaused())return!1;if(U&&!Se(a))return a;const ae=Se(z)?Ue.data:z;return Se(ae)||l})()?{isValidating:!0,isLoading:!0,...Ue}:Ue},fe=de(Q),Te=Q===ue?fe:de(ue);let Fe=fe;return[()=>{const De=de(O());return $(De,Fe)?(Fe.data=De.data,Fe.isLoading=De.isLoading,Fe.isValidating=De.isValidating,Fe.error=De.error,Fe):(Fe=De,De)},()=>Te]},[r,y]),b=ls.useSyncExternalStore(D.useCallback(Q=>P(y,(ue,de)=>{$(de,ue)||Q()}),[r,y]),W[0],W[1]),N=m[y]&&m[y].length>0,R=b.data,S=Se(R)?z&&Xy(z)?Cu(z):z:R,V=b.error,ee=D.useRef(S),Y=h?Se(R)?Se(ee.current)?S:ee.current:R:S,G=y&&Se(S),J=D.useRef(null);!gr&&ls.useSyncExternalStore(d_,()=>(J.current=!1,J),()=>(J.current=!0,J));const se=J.current;d&&se&&!o&&G&&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 K=!y||!t||L().isPaused()||N&&!Se(V)?!1:U&&!Se(a)?a:o?Se(S)?!1:l:Se(S)||l,re=Se(b.isValidating)?K:b.isValidating,B=Se(b.isLoading)?K:b.isLoading,ne=D.useCallback(async Q=>{const ue=I.current;if(!y||!ue||k.current||L().isPaused())return!1;let de,fe,Te=!0;const Fe=Q||{},De=!g[y]||!Fe.dedupe,Ue=()=>tv?!k.current&&y===E.current&&A.current:y===E.current,te={isValidating:!1,isLoading:!1},ae=()=>{H(te)},j=()=>{const oe=g[y];oe&&oe[1]===fe&&delete g[y]},q={isValidating:!0};Se(O().data)&&(q.isLoading=!0);try{if(De&&(H(q),n.loadingTimeout&&Se(O().data)&&setTimeout(()=>{Te&&Ue()&&L().onLoadingSlow(y,n)},n.loadingTimeout),g[y]=[ue(w),Eu()]),[de,fe]=g[y],de=await de,De&&setTimeout(j,n.dedupingInterval),!g[y]||g[y][1]!==fe)return De&&Ue()&&L().onDiscarded(y),!1;te.error=it;const oe=p[y];if(!Se(oe)&&(fe<=oe[0]||fe<=oe[1]||oe[1]===0))return ae(),De&&Ue()&&L().onDiscarded(y),!1;const le=O().data;te.data=i(le,de)?le:de,De&&Ue()&&L().onSuccess(de,y,n)}catch(oe){j();const le=L(),{shouldRetryOnError:he}=le;le.isPaused()||(te.error=oe,De&&Ue()&&(le.onError(oe,y,le),(he===!0||Wt(he)&&he(oe))&&(!L().revalidateOnFocus||!L().revalidateOnReconnect||T())&&le.onErrorRetry(oe,y,le,je=>{const Qe=m[y];Qe&&Qe[0]&&Qe[0](Zy,je)},{retryCount:(Fe.retryCount||0)+1,dedupe:!0})))}return Te=!1,ae(),!0},[y,r]),me=D.useCallback((...Q)=>rv(r,E.current,...Q),[]);if(bu(()=>{I.current=t,M.current=n,Se(R)||(ee.current=R)}),bu(()=>{if(!y)return;const Q=ne.bind(it,Au);let ue=0;L().revalidateOnFocus&&(ue=Date.now()+L().focusThrottleInterval);const fe=f_(y,m,(Te,Fe={})=>{if(Te==Ky){const De=Date.now();L().revalidateOnFocus&&De>ue&&T()&&(ue=De+L().focusThrottleInterval,Q())}else if(Te==Gy)L().revalidateOnReconnect&&T()&&Q();else{if(Te==Qy)return ne();if(Te==Zy)return ne(Fe)}});return k.current=!1,E.current=y,A.current=!0,H({_k:w}),K&&(g[y]||(Se(S)||gr?Q():qL(Q))),()=>{k.current=!0,fe()}},[y]),bu(()=>{let Q;function ue(){const fe=Wt(u)?u(O().data):u;fe&&Q!==-1&&(Q=setTimeout(de,fe))}function de(){!O().error&&(f||L().isVisible())&&(c||L().isOnline())?ne(Au).then(ue):ue()}return ue(),()=>{Q&&(clearTimeout(Q),Q=-1)}},[u,f,c,y]),D.useDebugValue(Y),o){if(!tv&&gr&&G)throw new Error("Fallback data is required when using Suspense in SSR.");G&&(I.current=t,M.current=n,k.current=!1);const Q=v[y],ue=!Se(Q)&&G?me(Q):av;if(Cu(ue),!Se(V)&&G)throw V;const de=G?ne(Au):av;!Se(Y)&&G&&(de.status="fulfilled",de.value=!0),Cu(de)}return{mutate:me,get data(){return _.data=!0,Y},get error(){return _.error=!0,V},get isValidating(){return _.isValidating=!0,re},get isLoading(){return _.isLoading=!0,B}}});function lv({userCredentials:e,listConversations:t,clientId:n}){const r=!!e&&n&&t,{data:i,error:o,isValidating:s,mutate:a}=h_(r?[n,"conversations",e==null?void 0:e.userId]:null,async()=>(await t({})).conversations.filter(p_).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&&Rr(o),refresh:async()=>await a()}}const p_=e=>!!e.lastMessage,m_=e=>e==null||e.length===0?"":e.charAt(0).toUpperCase()+e.slice(1),Tu=({className:e,onConversationClick:t,onNewConversation:n,onClose:r,currentConversationId:i,isLoading:o,conversations:s,botAvatar:a,botName:l,...u})=>{const{conversationHistory:f}=ye,c=Ye();return x.jsxs("div",{...u,...f.container,className:ur(f.container.className,e),children:[x.jsxs("div",{...f.header,children:[c["conversationHistory.title"],r&&x.jsx("div",{...f.closeButton,children:x.jsx(su,{onClick:r})})]}),o?x.jsx("div",{...f.loaderContainer,children:x.jsx(Fy,{})}):x.jsx("div",{...f.scrollContainer,children:s.length===0?x.jsx("div",{...f.loaderContainer,children:c["conversationHistory.empty"]}):s.map(({id:h,lastMessage:d})=>{let m="";if(d.payload.type==="text")m=d.payload.text;else if(d.payload.type==="bloc"&&d.payload.items.some(p=>p.type==="text")){const p=d.payload.items.find(g=>g.type==="text");m=(p==null?void 0:p.payload.text)??""}else m=c["conversationHistory.sentAttachment"];return x.jsxs("button",{...f.conversation.container,onClick:()=>t==null?void 0:t(h),"data-active":i===h?"":void 0,children:[d.author.type==="bot"?x.jsx(Cn,{userId:d.userId,src:a,...f.conversation.avatar,children:l??c["header.defaultBotName"]}):x.jsx(Cn,{userId:d.userId,...f.conversation.avatar,fallback:f.conversation.userAvatar.className,children:x.jsx(hT,{strokeWidth:1.5})}),x.jsxs("div",{...f.conversation.content,children:[x.jsx("span",{...f.conversation.name,children:m}),x.jsx("span",{...f.conversation.timestamp,children:m_(M0(d.createdAt))})]}),x.jsx(mp,{strokeWidth:1.5,...f.conversation.chevron})]},h)})}),x.jsxs("button",{...f.newConversation.button,onClick:n,children:[x.jsx(uT,{...f.newConversation.icon}),c["conversationHistory.newConversation"]]})]})};Tu.displayName="ConversationHistory";const uv=({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,locale:I,...M})=>{const{color:L,fontFamily:T,radius:O,themeMode:H,variant:P,headerVariant:F,botAvatar:_,botDescription:z,botName:$,composerPlaceholder:U,footer:W,feedbackEnabled:b,additionalStylesheet:N,additionalStylesheetUrl:R,allowFileUpload:S,conversationHistory:V}=t,ee={color:L,fontFamily:T,radius:O,themeMode:H,variant:P,headerVariant:F,additionalStylesheet:N,additionalStylesheetUrl:R},[Y,G]=D.useState("chat"),J=lv({clientId:v,listConversations:p,userCredentials:i});D.useEffect(()=>{Y==="conversations"&&J.refresh()},[Y]),b||(m=void 0);const se=D.useMemo(()=>i?cc(r,f,i.userId,$,_):[],[_,$,r,i,f]),K=D.useMemo(()=>{var we,Q;return((Q=(we=r.at(-1))==null?void 0:we.metadata)==null?void 0:Q.conversationStatus)==="closed"},[r]),re=D.useRef(null),B=Jn(we=>we.setPortalContainer);D.useEffect(()=>(B(re.current),()=>{B(null)}),[B]);const ne=I?JSON.stringify(I):void 0,me=D.useMemo(()=>ne?{...Rn,...JSON.parse(ne)}:uc(),[ne]);return x.jsxs(Rp,{value:me,children:[x.jsx(Vg,{...ee}),x.jsx("div",{ref:re,style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none",zIndex:10}}),x.jsx(tu,{connected:e,allowFileUpload:S,uploadFile:d,storageKey:y,conversationId:E,...M,children:u||J.error?x.jsx(Ry,{error:u||J.error,restartConversation:g,closeWindow:c}):Y==="conversations"?x.jsx(Tu,{onClose:c,conversations:J.conversations,isLoading:J.isLoading,onNewConversation:()=>{g==null||g(),G("chat")},onConversationClick:we=>{g==null||g(we),G("chat")},botAvatar:_,botName:$}):x.jsxs(x.Fragment,{children:[x.jsx(_y,{showConversationHistory:V?()=>G("conversations"):void 0,closeWindow:c,configuration:t,restartConversation:g,clientId:v,soundOn:w,toggleSound:A}),o?x.jsx(Fy,{}):x.jsx(cu,{botAvatar:_,botDescription:z,botName:$,renderers:s,isTyping:n,sendMessage:h,addMessageFeedback:m,messages:se},E),!K&&x.jsx(cg,{sendMessage:h,uploadFile:d,connected:e,isReadOnly:a,disableComposer:l,footer:W,composerPlaceholder:U,allowFileUpload:S,storageKey:y,disableSendButton:k,conversationId:E})]})})]})};function g_({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}=qy(),{openConversation:p,listConversations:g}=Yy(),{userCredentials:v}=Wy(),{soundOn:y,toggleSound:w}=Vy({storageKey:i,soundEnabled:e==null?void 0:e.soundEnabled});return x.jsx(uv,{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 y_=({clientId:e,storageKey:t,configuration:n,apiUrl:r,user:i,conversationId:o,...s})=>{const a=t||`bp-webchat-${e}`;return x.jsx(Cy,{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(g_,{configuration:n,storageKey:t,clientId:e,...s})})};function v_(e,t=globalThis==null?void 0:globalThis.document){const n=Fn(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 b_="DismissableLayer",Iu="dismissableLayer.update",w_="dismissableLayer.pointerDownOutside",S_="dismissableLayer.focusOutside",cv,fv=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),dv=C.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,onDismiss:a,...l}=e,u=C.useContext(fv),[f,c]=C.useState(null),h=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,d]=C.useState({}),m=nn(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=E_(I=>{const M=I.target,L=[...u.branches].some(T=>T.contains(M));!A||L||(i==null||i(I),s==null||s(I),I.defaultPrevented||a==null||a())},h),E=C_(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 v_(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&&(cv=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),hv(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=cv)}},[f,h,n,u]),C.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),hv())},[f,u]),C.useEffect(()=>{const I=()=>d({});return document.addEventListener(Iu,I),()=>document.removeEventListener(Iu,I)},[]),x.jsx(Rt.div,{...l,ref:m,style:{pointerEvents:w?A?"auto":"none":void 0,...e.style},onFocusCapture:Jt(e.onFocusCapture,E.onFocusCapture),onBlurCapture:Jt(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Jt(e.onPointerDownCapture,k.onPointerDownCapture)})});dv.displayName=b_;var k_="DismissableLayerBranch",x_=C.forwardRef((e,t)=>{const n=C.useContext(fv),r=C.useRef(null),i=nn(t,r);return C.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),x.jsx(Rt.div,{...e,ref:i})});x_.displayName=k_;function E_(e,t=globalThis==null?void 0:globalThis.document){const n=Fn(e),r=C.useRef(!1),i=C.useRef(()=>{});return C.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let l=function(){pv(w_,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 C_(e,t=globalThis==null?void 0:globalThis.document){const n=Fn(e),r=C.useRef(!1);return C.useEffect(()=>{const i=o=>{o.target&&!r.current&&pv(S_,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 hv(){const e=new CustomEvent(Iu);document.dispatchEvent(e)}function pv(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?gL(i,o):i.dispatchEvent(o)}var Ou="focusScope.autoFocusOnMount",Du="focusScope.autoFocusOnUnmount",mv={bubbles:!1,cancelable:!0},A_="FocusScope",gv=C.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[a,l]=C.useState(null),u=Fn(i),f=Fn(o),c=C.useRef(null),h=nn(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:yn(c.current,{select:!0})},g=function(w){if(d.paused||!a)return;const A=w.relatedTarget;A!==null&&(a.contains(A)||yn(c.current,{select:!0}))},v=function(w){if(document.activeElement===document.body)for(const k of w)k.removedNodes.length>0&&yn(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){bv.add(d);const p=document.activeElement;if(!a.contains(p)){const v=new CustomEvent(Ou,mv);a.addEventListener(Ou,u),a.dispatchEvent(v),v.defaultPrevented||(T_(N_(yv(a)),{select:!0}),document.activeElement===p&&yn(a))}return()=>{a.removeEventListener(Ou,u),setTimeout(()=>{const v=new CustomEvent(Du,mv);a.addEventListener(Du,f),a.dispatchEvent(v),v.defaultPrevented||yn(p??document.body,{select:!0}),a.removeEventListener(Du,f),bv.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]=I_(y);w&&A?!p.shiftKey&&v===A?(p.preventDefault(),n&&yn(w,{select:!0})):p.shiftKey&&v===w&&(p.preventDefault(),n&&yn(A,{select:!0})):v===y&&p.preventDefault()}},[n,r,d.paused]);return x.jsx(Rt.div,{tabIndex:-1,...s,ref:h,onKeyDown:m})});gv.displayName=A_;function T_(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(yn(r,{select:t}),document.activeElement!==n)return}function I_(e){const t=yv(e),n=vv(t,e),r=vv(t.reverse(),e);return[n,r]}function yv(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 vv(e,t){for(const n of e)if(!O_(n,{upTo:t}))return n}function O_(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 D_(e){return e instanceof HTMLInputElement&&"select"in e}function yn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&D_(e)&&t&&e.select()}}var bv=M_();function M_(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=wv(e,t),e.unshift(t)},remove(t){var n;e=wv(e,t),(n=e[0])==null||n.resume()}}}function wv(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function N_(e){return e.filter(t=>t.tagName!=="A")}var Mu=0;function L_(){C.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Sv()),document.body.insertAdjacentElement("beforeend",e[1]??Sv()),Mu++,()=>{Mu===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Mu--}},[])}function Sv(){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 qo="right-scroll-bar-position",Yo="width-before-scroll-bar",__="with-scroll-bars-hidden",P_="--removed-body-scroll-bar-size";function Nu(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function F_(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 R_=typeof window<"u"?C.useLayoutEffect:C.useEffect,kv=new WeakMap;function B_(e,t){var n=F_(null,function(r){return e.forEach(function(i){return Nu(i,r)})});return R_(function(){var r=kv.get(n);if(r){var i=new Set(r),o=new Set(e),s=n.current;i.forEach(function(a){o.has(a)||Nu(a,null)}),o.forEach(function(a){i.has(a)||Nu(a,s)})}kv.set(n,e)},[e]),n}function $_(e){return e}function z_(e,t){t===void 0&&(t=$_);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 H_(e){e===void 0&&(e={});var t=z_(null);return t.options=xt({async:!0,ssr:!1},e),t}var xv=function(e){var t=e.sideCar,n=zp(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))};xv.isSideCarExport=!0;function U_(e,t){return e.useMedium(t),xv}var Ev=H_(),Lu=function(){},Ko=C.forwardRef(function(e,t){var n=C.useRef(null),r=C.useState({onScrollCapture:Lu,onWheelCapture:Lu,onTouchMoveCapture:Lu}),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=zp(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=h,E=B_([n,t]),I=xt(xt({},A),i);return C.createElement(C.Fragment,null,f&&C.createElement(k,{sideCar:Ev,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))});Ko.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Ko.classNames={fullWidth:Yo,zeroRight:qo};var j_=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function V_(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=j_();return t&&e.setAttribute("nonce",t),e}function W_(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function q_(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Y_=function(){var e=0,t=null;return{add:function(n){e==0&&(t=V_())&&(W_(t,n),q_(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},K_=function(){var e=Y_();return function(t,n){C.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Cv=function(){var e=K_(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},G_={left:0,top:0,right:0,gap:0},_u=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[_u(n),_u(r),_u(i)]},Z_=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return G_;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])}},J_=Cv(),yr="data-scroll-locked",X_=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(__,` {
325
325
  overflow: hidden `).concat(r,`;
326
326
  padding-right: `).concat(a,"px ").concat(r,`;
327
327
  }
328
- body[`).concat(mr,`] {
328
+ body[`).concat(yr,`] {
329
329
  overflow: hidden `).concat(r,`;
330
330
  overscroll-behavior: contain;
331
331
  `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
@@ -338,30 +338,30 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
338
338
  `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
339
339
  }
340
340
 
341
- .`).concat(Wo,` {
341
+ .`).concat(qo,` {
342
342
  right: `).concat(a,"px ").concat(r,`;
343
343
  }
344
344
 
345
- .`).concat(qo,` {
345
+ .`).concat(Yo,` {
346
346
  margin-right: `).concat(a,"px ").concat(r,`;
347
347
  }
348
348
 
349
- .`).concat(Wo," .").concat(Wo,` {
349
+ .`).concat(qo," .").concat(qo,` {
350
350
  right: 0 `).concat(r,`;
351
351
  }
352
352
 
353
- .`).concat(qo," .").concat(qo,` {
353
+ .`).concat(Yo," .").concat(Yo,` {
354
354
  margin-right: 0 `).concat(r,`;
355
355
  }
356
356
 
357
- body[`).concat(mr,`] {
358
- `).concat(w_,": ").concat(a,`px;
357
+ body[`).concat(yr,`] {
358
+ `).concat(P_,": ").concat(a,`px;
359
359
  }
360
- `)},pv=function(){var e=parseInt(document.body.getAttribute(mr)||"0",10);return isFinite(e)?e:0},B_=function(){A.useEffect(function(){return document.body.setAttribute(mr,(pv()+1).toString()),function(){var e=pv()-1;e<=0?document.body.removeAttribute(mr):document.body.setAttribute(mr,e.toString())}},[])},z_=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;B_();var o=A.useMemo(function(){return F_(i)},[i]);return A.createElement(R_,{styles:$_(o,!t,i,n?"":"!important")})},Pu=!1;if(typeof window<"u")try{var Ko=Object.defineProperty({},"passive",{get:function(){return Pu=!0,!0}});window.addEventListener("test",Ko,Ko),window.removeEventListener("test",Ko,Ko)}catch{Pu=!1}var gr=Pu?{passive:!1}:!1,U_=function(e){return e.tagName==="TEXTAREA"},mv=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!U_(e)&&n[t]==="visible")},H_=function(e){return mv(e,"overflowY")},j_=function(e){return mv(e,"overflowX")},gv=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=yv(e,r);if(i){var o=vv(e,r),s=o[1],a=o[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},V_=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},W_=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},yv=function(e,t){return e==="v"?H_(t):j_(t)},vv=function(e,t){return e==="v"?V_(t):W_(t)},q_=function(e,t){return e==="h"&&t==="rtl"?-1:1},Y_=function(e,t,n,r,i){var o=q_(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=vv(e,a),p=d[0],m=d[1],g=d[2],v=m-g-o*p;(p||v)&&yv(e,a)&&(c+=v,h+=p);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]},bv=function(e){return[e.deltaX,e.deltaY]},wv=function(e){return e&&"current"in e?e.current:e},K_=function(e,t){return e[0]===t[0]&&e[1]===t[1]},G_=function(e){return`
360
+ `)},Av=function(){var e=parseInt(document.body.getAttribute(yr)||"0",10);return isFinite(e)?e:0},e2=function(){C.useEffect(function(){return document.body.setAttribute(yr,(Av()+1).toString()),function(){var e=Av()-1;e<=0?document.body.removeAttribute(yr):document.body.setAttribute(yr,e.toString())}},[])},t2=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;e2();var o=C.useMemo(function(){return Z_(i)},[i]);return C.createElement(J_,{styles:X_(o,!t,i,n?"":"!important")})},Pu=!1;if(typeof window<"u")try{var Go=Object.defineProperty({},"passive",{get:function(){return Pu=!0,!0}});window.addEventListener("test",Go,Go),window.removeEventListener("test",Go,Go)}catch{Pu=!1}var vr=Pu?{passive:!1}:!1,n2=function(e){return e.tagName==="TEXTAREA"},Tv=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!n2(e)&&n[t]==="visible")},r2=function(e){return Tv(e,"overflowY")},i2=function(e){return Tv(e,"overflowX")},Iv=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=Ov(e,r);if(i){var o=Dv(e,r),s=o[1],a=o[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},o2=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},s2=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Ov=function(e,t){return e==="v"?r2(t):i2(t)},Dv=function(e,t){return e==="v"?o2(t):s2(t)},a2=function(e,t){return e==="h"&&t==="rtl"?-1:1},l2=function(e,t,n,r,i){var o=a2(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=Dv(e,a),m=d[0],p=d[1],g=d[2],v=p-g-o*m;(m||v)&&Ov(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},Qo=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Mv=function(e){return[e.deltaX,e.deltaY]},Nv=function(e){return e&&"current"in e?e.current:e},u2=function(e,t){return e[0]===t[0]&&e[1]===t[1]},c2=function(e){return`
361
361
  .block-interactivity-`.concat(e,` {pointer-events: none;}
362
362
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
363
- `)},Q_=0,yr=[];function Z_(e){var t=A.useRef([]),n=A.useRef([0,0]),r=A.useRef(),i=A.useState(Q_++)[0],o=A.useState(hv)[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 m=Ga([e.lockRef.current],(e.shards||[]).map(wv),!0).filter(Boolean);return m.forEach(function(g){return g.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),m.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=A.useCallback(function(m,g){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!s.current.allowPinchZoom;var v=Go(m),y=n.current,w="deltaX"in m?m.deltaX:y[0]-v[0],C="deltaY"in m?m.deltaY:y[1]-v[1],k,E=m.target,I=Math.abs(w)>Math.abs(C)?"h":"v";if("touches"in m&&I==="h"&&E.type==="range")return!1;var D=gv(I,E);if(!D)return!0;if(D?k=I:(k=I==="v"?"h":"v",D=gv(I,E)),!D)return!1;if(!r.current&&"changedTouches"in m&&(w||C)&&(r.current=k),!k)return!0;var P=r.current||k;return Y_(P,g,m,P==="h"?w:C)},[]),l=A.useCallback(function(m){var g=m;if(!(!yr.length||yr[yr.length-1]!==o)){var v="deltaY"in g?bv(g):Go(g),y=t.current.filter(function(k){return k.name===g.type&&(k.target===g.target||g.target===k.shadowParent)&&K_(k.delta,v)})[0];if(y&&y.should){g.cancelable&&g.preventDefault();return}if(!y){var w=(s.current.shards||[]).map(wv).filter(Boolean).filter(function(k){return k.contains(g.target)}),C=w.length>0?a(g,w[0]):!s.current.noIsolation;C&&g.cancelable&&g.preventDefault()}}},[]),u=A.useCallback(function(m,g,v,y){var w={name:m,delta:g,target:v,should:y,shadowParent:J_(v)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(C){return C!==w})},1)},[]),f=A.useCallback(function(m){n.current=Go(m),r.current=void 0},[]),c=A.useCallback(function(m){u(m.type,bv(m),m.target,a(m,e.lockRef.current))},[]),h=A.useCallback(function(m){u(m.type,Go(m),m.target,a(m,e.lockRef.current))},[]);A.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(m){return m!==o}),document.removeEventListener("wheel",l,gr),document.removeEventListener("touchmove",l,gr),document.removeEventListener("touchstart",f,gr)}},[]);var d=e.removeScrollBar,p=e.inert;return A.createElement(A.Fragment,null,p?A.createElement(o,{styles:G_(i)}):null,d?A.createElement(z_,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function J_(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const X_=T_(dv,Z_);var Sv=A.forwardRef(function(e,t){return A.createElement(Yo,xt({},e,{ref:t,sideCar:X_}))});Sv.classNames=Yo.classNames;var eP=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={},Lu=0,xv=function(e){return e&&(e.host||xv(e.parentNode))},tP=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=xv(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})},nP=function(e,t,n,r){var i=tP(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),p=d!==null&&d!=="false",m=(vr.get(h)||0)+1,g=(o.get(h)||0)+1;vr.set(h,m),o.set(h,g),s.push(h),m===1&&p&&Qo.set(h,!0),g===1&&h.setAttribute(n,"true"),p||h.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",h,v)}})};return f(t),a.clear(),Lu++,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)}),Lu--,Lu||(vr=new WeakMap,vr=new WeakMap,Qo=new WeakMap,Zo={})}},rP=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=eP(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),nP(r,i,n,"aria-hidden")):function(){return null}},Jo="Dialog",[kv]=my(Jo),[iP,Wt]=kv(Jo),Ev=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]=gy({prop:r,defaultProp:i??!1,onChange:o,caller:Jo});return x.jsx(iP,{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})};Ev.displayName=Jo;var Cv="DialogTrigger",Av=A.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt(Cv,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":Ru(i.open),...r,ref:o,onClick:Zt(e.onClick,i.onOpenToggle)})});Av.displayName=Cv;var oP="DialogPortal",[AL,Tv]=kv(oP,{forceMount:void 0}),Xo="DialogOverlay",sP=A.forwardRef((e,t)=>{const n=Tv(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(lP,{...i,ref:t})}):null});sP.displayName=Xo;var aP=yy("DialogOverlay.RemoveScroll"),lP=A.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt(Xo,n);return x.jsx(Sv,{as:aP,allowPinchZoom:!0,shards:[i.contentRef],children:x.jsx(Ft.div,{"data-state":Ru(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Pn="DialogContent",Iv=A.forwardRef((e,t)=>{const n=Tv(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(uP,{...i,ref:t}):x.jsx(cP,{...i,ref:t})})});Iv.displayName=Pn;var uP=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 rP(o)},[]),x.jsx(Ov,{...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())})}),cP=A.forwardRef((e,t)=>{const n=Wt(Pn,e.__scopeDialog),r=A.useRef(!1),i=A.useRef(!1);return x.jsx(Ov,{...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()}})}),Ov=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 v_(),x.jsxs(x.Fragment,{children:[x.jsx(iv,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:x.jsx(ev,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Ru(a.open),...s,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),x.jsxs(x.Fragment,{children:[x.jsx(fP,{titleId:a.titleId}),x.jsx(hP,{contentRef:l,descriptionId:a.descriptionId})]})]})}),Fu="DialogTitle",Mv=A.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt(Fu,n);return x.jsx(Ft.h2,{id:i.titleId,...r,ref:t})});Mv.displayName=Fu;var Dv="DialogDescription",Nv=A.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt(Dv,n);return x.jsx(Ft.p,{id:i.descriptionId,...r,ref:t})});Nv.displayName=Dv;var _v="DialogClose",Pv=A.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt(_v,n);return x.jsx(Ft.button,{type:"button",...r,ref:t,onClick:Zt(e.onClick,()=>i.onOpenChange(!1))})});Pv.displayName=_v;function Ru(e){return e?"open":"closed"}var Lv="DialogTitleWarning",[TL,Fv]=VN(Lv,{contentName:Pn,titleName:Fu,docsSlug:"dialog"}),fP=({titleId:e})=>{const t=Fv(Lv),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
363
+ `)},f2=0,br=[];function d2(e){var t=C.useRef([]),n=C.useRef([0,0]),r=C.useRef(),i=C.useState(f2++)[0],o=C.useState(Cv)[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=Qa([e.lockRef.current],(e.shards||[]).map(Nv),!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=Qo(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 M=Iv(I,E);if(!M)return!0;if(M?k=I:(k=I==="v"?"h":"v",M=Iv(I,E)),!M)return!1;if(!r.current&&"changedTouches"in p&&(w||A)&&(r.current=k),!k)return!0;var L=r.current||k;return l2(L,g,p,L==="h"?w:A)},[]),l=C.useCallback(function(p){var g=p;if(!(!br.length||br[br.length-1]!==o)){var v="deltaY"in g?Mv(g):Qo(g),y=t.current.filter(function(k){return k.name===g.type&&(k.target===g.target||g.target===k.shadowParent)&&u2(k.delta,v)})[0];if(y&&y.should){g.cancelable&&g.preventDefault();return}if(!y){var w=(s.current.shards||[]).map(Nv).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:h2(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=Qo(p),r.current=void 0},[]),c=C.useCallback(function(p){u(p.type,Mv(p),p.target,a(p,e.lockRef.current))},[]),h=C.useCallback(function(p){u(p.type,Qo(p),p.target,a(p,e.lockRef.current))},[]);C.useEffect(function(){return br.push(o),e.setCallbacks({onScrollCapture:c,onWheelCapture:c,onTouchMoveCapture:h}),document.addEventListener("wheel",l,vr),document.addEventListener("touchmove",l,vr),document.addEventListener("touchstart",f,vr),function(){br=br.filter(function(p){return p!==o}),document.removeEventListener("wheel",l,vr),document.removeEventListener("touchmove",l,vr),document.removeEventListener("touchstart",f,vr)}},[]);var d=e.removeScrollBar,m=e.inert;return C.createElement(C.Fragment,null,m?C.createElement(o,{styles:c2(i)}):null,d?C.createElement(t2,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function h2(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const p2=U_(Ev,d2);var Lv=C.forwardRef(function(e,t){return C.createElement(Ko,xt({},e,{ref:t,sideCar:p2}))});Lv.classNames=Ko.classNames;var m2=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},wr=new WeakMap,Zo=new WeakMap,Jo={},Fu=0,_v=function(e){return e&&(e.host||_v(e.parentNode))},g2=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=_v(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})},y2=function(e,t,n,r){var i=g2(t,Array.isArray(e)?e:[e]);Jo[n]||(Jo[n]=new WeakMap);var o=Jo[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=(wr.get(h)||0)+1,g=(o.get(h)||0)+1;wr.set(h,p),o.set(h,g),s.push(h),p===1&&m&&Zo.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(),Fu++,function(){s.forEach(function(c){var h=wr.get(c)-1,d=o.get(c)-1;wr.set(c,h),o.set(c,d),h||(Zo.has(c)||c.removeAttribute(r),Zo.delete(c)),d||c.removeAttribute(n)}),Fu--,Fu||(wr=new WeakMap,wr=new WeakMap,Zo=new WeakMap,Jo={})}},v2=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=m2(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),y2(r,i,n,"aria-hidden")):function(){return null}},Xo="Dialog",[Pv]=Ty(Xo),[b2,qt]=Pv(Xo),Fv=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]=Iy({prop:r,defaultProp:i??!1,onChange:o,caller:Xo});return x.jsx(b2,{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})};Fv.displayName=Xo;var Rv="DialogTrigger",Bv=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=qt(Rv,n),o=nn(t,i.triggerRef);return x.jsx(Rt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Bu(i.open),...r,ref:o,onClick:Jt(e.onClick,i.onOpenToggle)})});Bv.displayName=Rv;var w2="DialogPortal",[HP,$v]=Pv(w2,{forceMount:void 0}),es="DialogOverlay",S2=C.forwardRef((e,t)=>{const n=$v(es,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=qt(es,e.__scopeDialog);return o.modal?x.jsx(zo,{present:r||o.open,children:x.jsx(x2,{...i,ref:t})}):null});S2.displayName=es;var k2=Oy("DialogOverlay.RemoveScroll"),x2=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=qt(es,n);return x.jsx(Lv,{as:k2,allowPinchZoom:!0,shards:[i.contentRef],children:x.jsx(Rt.div,{"data-state":Bu(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Pn="DialogContent",zv=C.forwardRef((e,t)=>{const n=$v(Pn,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=qt(Pn,e.__scopeDialog);return x.jsx(zo,{present:r||o.open,children:o.modal?x.jsx(E2,{...i,ref:t}):x.jsx(C2,{...i,ref:t})})});zv.displayName=Pn;var E2=C.forwardRef((e,t)=>{const n=qt(Pn,e.__scopeDialog),r=C.useRef(null),i=nn(t,n.contentRef,r);return C.useEffect(()=>{const o=r.current;if(o)return v2(o)},[]),x.jsx(Hv,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Jt(e.onCloseAutoFocus,o=>{var s;o.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:Jt(e.onPointerDownOutside,o=>{const s=o.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&o.preventDefault()}),onFocusOutside:Jt(e.onFocusOutside,o=>o.preventDefault())})}),C2=C.forwardRef((e,t)=>{const n=qt(Pn,e.__scopeDialog),r=C.useRef(!1),i=C.useRef(!1);return x.jsx(Hv,{...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()}})}),Hv=C.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...s}=e,a=qt(Pn,n),l=C.useRef(null),u=nn(t,l);return L_(),x.jsxs(x.Fragment,{children:[x.jsx(gv,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:x.jsx(dv,{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)})}),x.jsxs(x.Fragment,{children:[x.jsx(A2,{titleId:a.titleId}),x.jsx(I2,{contentRef:l,descriptionId:a.descriptionId})]})]})}),Ru="DialogTitle",Uv=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=qt(Ru,n);return x.jsx(Rt.h2,{id:i.titleId,...r,ref:t})});Uv.displayName=Ru;var jv="DialogDescription",Vv=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=qt(jv,n);return x.jsx(Rt.p,{id:i.descriptionId,...r,ref:t})});Vv.displayName=jv;var Wv="DialogClose",qv=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=qt(Wv,n);return x.jsx(Rt.button,{type:"button",...r,ref:t,onClick:Jt(e.onClick,()=>i.onOpenChange(!1))})});qv.displayName=Wv;function Bu(e){return e?"open":"closed"}var Yv="DialogTitleWarning",[UP,Kv]=oL(Yv,{contentName:Pn,titleName:Ru,docsSlug:"dialog"}),A2=({titleId:e})=>{const t=Kv(Yv),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
364
364
 
365
365
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
366
366
 
367
- 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},dP="DialogDescriptionWarning",hP=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Fv(dP).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},pP=Ev,mP=Av,gP=Iv,yP=Mv,vP=Nv,bP=Pv;function br({open:e,onOpenChange:t,children:n}){const{modal:r}=ye;return x.jsxs(pP,{open:e,modal:!1,onOpenChange:t,children:[e&&x.jsx("div",{...r==null?void 0:r.overlay}),n]})}function wP({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(gP,{...a.dialog.container,children:[x.jsx(yP,{...a.dialog.title,children:e}),x.jsx(vP,{...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=mP,br.Close=bP,br.Content=wP;const Rv=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(fp,{...f,onClick:p=>{p.stopPropagation(),o==null||o()}})]})});Rv.displayName="MessagePreview",re.Avatar=En,re.BOT_IS_BLOCKED=Hf,re.Block=Dn,re.CONFIG_ACCESS_DENIED=Uw,re.Chat=Zy,re.Composer=Xm,re.Container=eu,re.ConversationHistory=Au,re.ErrorState=Cy,re.Fab=py,re.Header=xy,re.INVALID_API_URL=Bf,re.INVALID_BOTPRESS_URL=Uf,re.INVALID_CLIENT_ID=zf,re.INVALID_CONFIGURATION=zw,re.INVALID_CONFIG_URL=Bw,re.INVALID_MESSAGE_CONTENT_TYPE=Wf,re.MISSING_API_URL=Fw,re.MISSING_BOT_ID=Rw,re.MISSING_CLIENT_ID=$f,re.MISSING_CONFIG_URL=$w,re.Message=au,re.MessageContext=qa,re.MessageList=uu,re.MessagePreview=Rv,re.Modal=br,re.ModalContext=Ya,re.ModalProvider=Ng,re.NETWORK_ERROR=Li,re.NOT_A_PARTICIPANT=Fs,re.QUOTA_EXCEEDED=jf,re.RestartConversationButton=iu,re.SOUND_EFFECTS=Dy,re.SSE_DISCONNECTED_ERROR=Vf,re.StylesheetProvider=_g,re.TypingIndicator=su,re.Webchat=n_,re.WebchatProvider=hy,re._setDebugEnabled=zN,re._setTrackFn=UN,re.commonApiErrorMap=$s,re.enrichMessage=ec,re.fileTypes=Ff,re.generateThemeOverride=Lf,re.generateThemeStylesheet=Pf,re.getUseChatSoundStore=Cp,re.getUseWebchatClientStore=kp,re.integrationMessagePayloadToBlockPayload=Lg,re.integrationMessageToBlockMessage=lr,re.isCommonApiErrorType=Yf,re.isEventError=Gf,re.isFileType=Rf,re.isIntegrationError=Kf,re.isWebhookHandlerErrorType=qf,re.mapToWebchatError=Pr,re.renderers=Vm,re.retryWithBackoff=Qf,re.useActiveConversation=Py,re.useConversationList=Qy,re.useConversations=Ly,re.useMessageContext=Ap,re.useModalContext=Ka,re.useUser=_y,re.useWebchat=x2,re.useWebchatContext=$o,re.useWebchatStore=Qn,re.webchatClasses=ye,re.webhookHandlerErrorMap=Rs,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},T2="DialogDescriptionWarning",I2=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Kv(T2).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},O2=Fv,D2=Bv,M2=zv,N2=Uv,L2=Vv,_2=qv;function Sr({open:e,onOpenChange:t,children:n}){const{modal:r}=ye;return x.jsxs(O2,{open:e,modal:!1,onOpenChange:t,children:[e&&x.jsx("div",{...r==null?void 0:r.overlay}),n]})}function P2({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(M2,{...a.dialog.container,children:[x.jsx(N2,{...a.dialog.title,children:e}),x.jsx(L2,{...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})]})]})})}Sr.Button=D2,Sr.Close=_2,Sr.Content=P2;const Gv=D.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(Cn,{src:n,...h,children:r||"Bot"}),x.jsx("p",{...c,children:e}),x.jsx("p",{...d,children:i}),x.jsx(wp,{...f,onClick:m=>{m.stopPropagation(),o==null||o()}})]})});Gv.displayName="MessagePreview",X.Avatar=Cn,X.BOT_IS_BLOCKED=Zf,X.Block=Nn,X.CONFIG_ACCESS_DENIED=t1,X.Chat=uv,X.Composer=cg,X.Container=tu,X.ConversationHistory=Tu,X.ErrorState=Ry,X.Fab=Ay,X.Header=_y,X.INVALID_API_URL=Kf,X.INVALID_BOTPRESS_URL=Qf,X.INVALID_CLIENT_ID=Gf,X.INVALID_CONFIGURATION=e1,X.INVALID_CONFIG_URL=X0,X.INVALID_MESSAGE_CONTENT_TYPE=ed,X.MISSING_API_URL=Q0,X.MISSING_BOT_ID=Z0,X.MISSING_CLIENT_ID=Yf,X.MISSING_CONFIG_URL=J0,X.Message=lu,X.MessageContext=Ya,X.MessageList=cu,X.MessagePreview=Gv,X.Modal=Sr,X.ModalContext=Ka,X.ModalProvider=jg,X.NETWORK_ERROR=Ri,X.NOT_A_PARTICIPANT=Rs,X.QUOTA_EXCEEDED=Jf,X.RestartConversationButton=ou,X.SOUND_EFFECTS=jy,X.SSE_DISCONNECTED_ERROR=Xf,X.StylesheetProvider=Vg,X.TranslationProvider=Rp,X.TypingIndicator=au,X.Webchat=y_,X.WebchatProvider=Cy,X._setDebugEnabled=tL,X._setTrackFn=nL,X.ar=lc,X.commonApiErrorMap=$s,X.de=ic,X.defaultTranslations=Rn,X.detectLocale=uc,X.enrichMessage=cc,X.es=nc,X.fileTypes=Wf,X.fr=tc,X.generateThemeOverride=Vf,X.generateThemeStylesheet=jf,X.getUseChatSoundStore=_p,X.getUseWebchatClientStore=Np,X.integrationMessagePayloadToBlockPayload=qg,X.integrationMessageToBlockMessage=cr,X.isCommonApiErrorType=nd,X.isEventError=id,X.isFileType=qf,X.isIntegrationError=rd,X.isWebhookHandlerErrorType=td,X.it=oc,X.ja=sc,X.ko=ac,X.mapToWebchatError=Rr,X.pt=rc,X.renderers=tg,X.retryWithBackoff=od,X.useActiveConversation=qy,X.useConversationList=lv,X.useConversations=Yy,X.useMessageContext=Pp,X.useModalContext=Ga,X.useTranslations=Ye,X.useUser=Wy,X.useWebchat=RL,X.useWebchatContext=$o,X.useWebchatStore=Jn,X.webchatClasses=ye,X.webhookHandlerErrorMap=Bs,Object.defineProperty(X,Symbol.toStringTag,{value:"Module"})});