@botpress/webchat 4.2.2 → 4.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (function(re,S){typeof exports=="object"&&typeof module<"u"?S(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],S):(re=typeof globalThis<"u"?globalThis:re||self,S(re.Webchat={},re.ReactJsxRuntime,re.React,re.ReactDOM))})(this,function(re,S,_,Ps){"use strict";var FT=Object.defineProperty;var RT=(re,S,_)=>S in re?FT(re,S,{enumerable:!0,configurable:!0,writable:!0,value:_}):re[S]=_;var zi=(re,S,_)=>RT(re,typeof S!="symbol"?S+"":S,_);var Rh,Bh,zh;var $i=typeof document<"u"?document.currentScript:null;function Ns(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 E=Ns(_),Ls=Ns(Ps);function Vh(e,t=[]){let n=[];function r(o,a){const s=E.createContext(a);s.displayName=o+"Context";const l=n.length;n=[...n,a];const u=c=>{var y;const{scope:p,children:d,...m}=c,h=((y=p==null?void 0:p[e])==null?void 0:y[l])||s,g=E.useMemo(()=>m,Object.values(m));return S.jsx(h.Provider,{value:g,children:d})};u.displayName=o+"Provider";function f(c,p){var h;const d=((h=p==null?void 0:p[e])==null?void 0:h[l])||s,m=E.useContext(d);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${c}\` must be used within \`${o}\``)}return[u,f]}const i=()=>{const o=n.map(a=>E.createContext(a));return function(s){const l=(s==null?void 0:s[e])||o;return E.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[r,qh(i,...t)]}function qh(...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 a=r.reduce((s,{useScope:l,scopeName:u})=>{const c=l(o)[`__scope${u}`];return{...s,...c}},{});return E.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Zt(e){const t=E.useRef(e);return E.useEffect(()=>{t.current=e}),E.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var Tt=globalThis!=null&&globalThis.document?E.useLayoutEffect:()=>{};function Fs(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ji(...e){return t=>{let n=!1;const r=e.map(i=>{const o=Fs(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():Fs(e[i],null)}}}}function Ot(...e){return E.useCallback(ji(...e),e)}var Kh=Symbol.for("react.lazy"),wr=E[" use ".trim().toString()];function Yh(e){return typeof e=="object"&&e!==null&&"then"in e}function Rs(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Kh&&"_payload"in e&&Yh(e._payload)}function Gh(e){const t=Qh(e),n=E.forwardRef((r,i)=>{let{children:o,...a}=r;Rs(o)&&typeof wr=="function"&&(o=wr(o._payload));const s=E.Children.toArray(o),l=s.find(Zh);if(l){const u=l.props.children,f=s.map(c=>c===l?E.Children.count(u)>1?E.Children.only(null):E.isValidElement(u)?u.props.children:null:c);return S.jsx(t,{...a,ref:i,children:E.isValidElement(u)?E.cloneElement(u,void 0,f):null})}return S.jsx(t,{...a,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function Qh(e){const t=E.forwardRef((n,r)=>{let{children:i,...o}=n;if(Rs(i)&&typeof wr=="function"&&(i=wr(i._payload)),E.isValidElement(i)){const a=em(i),s=Xh(o,i.props);return i.type!==E.Fragment&&(s.ref=r?ji(r,a):a),E.cloneElement(i,s)}return E.Children.count(i)>1?E.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Jh=Symbol("radix.slottable");function Zh(e){return E.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Jh}function Xh(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]=(...s)=>{const l=o(...s);return i(...s),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function em(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 tm=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ui=tm.reduce((e,t)=>{const n=Gh(`Primitive.${t}`),r=E.forwardRef((i,o)=>{const{asChild:a,...s}=i,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(l,{...s,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),$t=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function jt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Hi={exports:{}},Wi={};/**
1
+ (function(ie,S){typeof exports=="object"&&typeof module<"u"?S(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],S):(ie=typeof globalThis<"u"?globalThis:ie||self,S(ie.Webchat={},ie.ReactJsxRuntime,ie.React,ie.ReactDOM))})(this,function(ie,S,N,Os){"use strict";var Ph,Nh,Lh;var Fi=typeof document<"u"?document.currentScript:null;function Ds(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 E=Ds(N),Ms=Ds(Os);function jh(e,t=[]){let n=[];function r(o,a){const s=E.createContext(a);s.displayName=o+"Context";const l=n.length;n=[...n,a];const u=c=>{var y;const{scope:p,children:d,...m}=c,h=((y=p==null?void 0:p[e])==null?void 0:y[l])||s,g=E.useMemo(()=>m,Object.values(m));return S.jsx(h.Provider,{value:g,children:d})};u.displayName=o+"Provider";function f(c,p){var h;const d=((h=p==null?void 0:p[e])==null?void 0:h[l])||s,m=E.useContext(d);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${c}\` must be used within \`${o}\``)}return[u,f]}const i=()=>{const o=n.map(a=>E.createContext(a));return function(s){const l=(s==null?void 0:s[e])||o;return E.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[r,Uh(i,...t)]}function Uh(...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 a=r.reduce((s,{useScope:l,scopeName:u})=>{const c=l(o)[`__scope${u}`];return{...s,...c}},{});return E.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Zt(e){const t=E.useRef(e);return E.useEffect(()=>{t.current=e}),E.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var Tt=globalThis!=null&&globalThis.document?E.useLayoutEffect:()=>{};function _s(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ri(...e){return t=>{let n=!1;const r=e.map(i=>{const o=_s(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():_s(e[i],null)}}}}function Ot(...e){return E.useCallback(Ri(...e),e)}var Hh=Symbol.for("react.lazy"),yr=E[" use ".trim().toString()];function Wh(e){return typeof e=="object"&&e!==null&&"then"in e}function Ps(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Hh&&"_payload"in e&&Wh(e._payload)}function Vh(e){const t=qh(e),n=E.forwardRef((r,i)=>{let{children:o,...a}=r;Ps(o)&&typeof yr=="function"&&(o=yr(o._payload));const s=E.Children.toArray(o),l=s.find(Yh);if(l){const u=l.props.children,f=s.map(c=>c===l?E.Children.count(u)>1?E.Children.only(null):E.isValidElement(u)?u.props.children:null:c);return S.jsx(t,{...a,ref:i,children:E.isValidElement(u)?E.cloneElement(u,void 0,f):null})}return S.jsx(t,{...a,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function qh(e){const t=E.forwardRef((n,r)=>{let{children:i,...o}=n;if(Ps(i)&&typeof yr=="function"&&(i=yr(i._payload)),E.isValidElement(i)){const a=Qh(i),s=Gh(o,i.props);return i.type!==E.Fragment&&(s.ref=r?Ri(r,a):a),E.cloneElement(i,s)}return E.Children.count(i)>1?E.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Kh=Symbol("radix.slottable");function Yh(e){return E.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Kh}function Gh(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]=(...s)=>{const l=o(...s);return i(...s),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function Qh(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 Jh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Bi=Jh.reduce((e,t)=>{const n=Vh(`Primitive.${t}`),r=E.forwardRef((i,o)=>{const{asChild:a,...s}=i,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(l,{...s,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),$t=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function jt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zi={exports:{}},$i={};/**
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 Bs;function nm(){if(Bs)return Wi;Bs=1;var e=_;function t(c,p){return c===p&&(c!==0||1/c===1/p)||c!==c&&p!==p}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,a=e.useDebugValue;function s(c,p){var d=p(),m=r({inst:{value:d,getSnapshot:p}}),h=m[0].inst,g=m[1];return o(function(){h.value=d,h.getSnapshot=p,l(h)&&g({inst:h})},[c,d,p]),i(function(){return l(h)&&g({inst:h}),c(function(){l(h)&&g({inst:h})})},[c]),a(d),d}function l(c){var p=c.getSnapshot;c=c.value;try{var d=p();return!n(c,d)}catch{return!0}}function u(c,p){return p()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:s;return Wi.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,Wi}var Vi={};/**
9
+ */var Ns;function Zh(){if(Ns)return $i;Ns=1;var e=N;function t(c,p){return c===p&&(c!==0||1/c===1/p)||c!==c&&p!==p}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,a=e.useDebugValue;function s(c,p){var d=p(),m=r({inst:{value:d,getSnapshot:p}}),h=m[0].inst,g=m[1];return o(function(){h.value=d,h.getSnapshot=p,l(h)&&g({inst:h})},[c,d,p]),i(function(){return l(h)&&g({inst:h}),c(function(){l(h)&&g({inst:h})})},[c]),a(d),d}function l(c){var p=c.getSnapshot;c=c.value;try{var d=p();return!n(c,d)}catch{return!0}}function u(c,p){return p()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:s;return $i.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,$i}var ji={};/**
10
10
  * @license React
11
11
  * use-sync-external-store-shim.development.js
12
12
  *
@@ -14,229 +14,229 @@
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 zs;function rm(){return zs||(zs=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 h=m();if(!c){var g=m();o(h,g)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}g=a({inst:{value:h,getSnapshot:m}});var y=g[0].inst,v=g[1];return l(function(){y.value=h,y.getSnapshot=m,n(y)&&v({inst:y})},[d,h,m]),s(function(){return n(y)&&v({inst:y}),d(function(){n(y)&&v({inst:y})})},[d]),u(h),h}function n(d){var m=d.getSnapshot;d=d.value;try{var h=m();return!o(d,h)}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=_,o=typeof Object.is=="function"?Object.is:e,a=i.useState,s=i.useEffect,l=i.useLayoutEffect,u=i.useDebugValue,f=!1,c=!1,p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;Vi.useSyncExternalStore=i.useSyncExternalStore!==void 0?i.useSyncExternalStore:p,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Vi}process.env.NODE_ENV==="production"?Hi.exports=nm():Hi.exports=rm();var im=Hi.exports;function om(){return im.useSyncExternalStore(am,()=>!0,()=>!1)}function am(){return()=>{}}var qi="Avatar",[sm]=Vh(qi),[lm,$s]=sm(qi),Ki=E.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,o]=E.useState("idle");return S.jsx(lm,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:o,children:S.jsx(Ui.span,{...r,ref:t})})});Ki.displayName=qi;var js="AvatarImage",Yi=E.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...o}=e,a=$s(js,n),s=um(r,o),l=Zt(u=>{i(u),a.onImageLoadingStatusChange(u)});return Tt(()=>{s!=="idle"&&l(s)},[s,l]),s==="loaded"?S.jsx(Ui.img,{...o,ref:t,src:r}):null});Yi.displayName=js;var Us="AvatarFallback",Gi=E.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,o=$s(Us,n),[a,s]=E.useState(r===void 0);return E.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>s(!0),r);return()=>window.clearTimeout(l)}},[r]),a&&o.imageLoadingStatus!=="loaded"?S.jsx(Ui.span,{...i,ref:t}):null});Gi.displayName=Us;function Hs(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function um(e,{referrerPolicy:t,crossOrigin:n}){const r=om(),i=E.useRef(null),o=r?(i.current||(i.current=new window.Image),i.current):null,[a,s]=E.useState(()=>Hs(o,e));return Tt(()=>{s(Hs(o,e))},[o,e]),Tt(()=>{const l=c=>()=>{s(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]),a}function Ws(e,t){let n=`${e} {`;for(const[r,i]of Object.entries(t))n+=`${r}: ${i}; `;return n+="}",n}function Vs(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 cm=(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",a=>{i&&clearTimeout(i),r(`${a.type}: ${a.message}`)}),o.src=e,t.timeout&&(i=setTimeout(()=>r("Timeout"),t.timeout))});var qs={exports:{}};(function(e,t){(function(n,r){e.exports=r()})($t,function(){var n=1e3,r=6e4,i=36e5,o="millisecond",a="second",s="minute",l="hour",u="day",f="week",c="month",p="quarter",d="year",m="date",h="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(M){var D=["th","st","nd","rd"],B=M%100;return"["+M+(D[(B-20)%10]||D[B]||D[0])+"]"}},w=function(M,D,B){var U=String(M);return!U||U.length>=D?M:""+Array(D+1-U.length).join(B)+M},A={s:w,z:function(M){var D=-M.utcOffset(),B=Math.abs(D),U=Math.floor(B/60),$=B%60;return(D<=0?"+":"-")+w(U,2,"0")+":"+w($,2,"0")},m:function M(D,B){if(D.date()<B.date())return-M(B,D);var U=12*(B.year()-D.year())+(B.month()-D.month()),$=D.clone().add(U,c),V=B-$<0,b=D.clone().add(U+(V?-1:1),c);return+(-(U+(B-$)/(V?$-b:b-$))||0)},a:function(M){return M<0?Math.ceil(M)||0:Math.floor(M)},p:function(M){return{M:c,y:d,w:f,d:u,D:m,h:l,m:s,s:a,ms:o,Q:p}[M]||String(M||"").toLowerCase().replace(/s$/,"")},u:function(M){return M===void 0}},k="en",C={};C[k]=v;var T="$isDayjsObject",P=function(M){return M instanceof j||!(!M||!M[T])},F=function M(D,B,U){var $;if(!D)return k;if(typeof D=="string"){var V=D.toLowerCase();C[V]&&($=V),B&&(C[V]=B,$=V);var b=D.split("-");if(!$&&b.length>1)return M(b[0])}else{var N=D.name;C[N]=D,$=N}return!U&&$&&(k=$),$||!U&&k},I=function(M,D){if(P(M))return M.clone();var B=typeof D=="object"?D:{};return B.date=M,B.args=arguments,new j(B)},O=A;O.l=F,O.i=P,O.w=function(M,D){return I(M,{locale:D.$L,utc:D.$u,x:D.$x,$offset:D.$offset})};var j=function(){function M(B){this.$L=F(B.locale,null,!0),this.parse(B),this.$x=this.$x||B.x||{},this[T]=!0}var D=M.prototype;return D.parse=function(B){this.$d=function(U){var $=U.date,V=U.utc;if($===null)return new Date(NaN);if(O.u($))return new Date;if($ instanceof Date)return new Date($);if(typeof $=="string"&&!/Z$/i.test($)){var b=$.match(g);if(b){var N=b[2]-1||0,H=(b[7]||"0").substring(0,3);return V?new Date(Date.UTC(b[1],N,b[3]||1,b[4]||0,b[5]||0,b[6]||0,H)):new Date(b[1],N,b[3]||1,b[4]||0,b[5]||0,b[6]||0,H)}}return new Date($)}(B),this.init()},D.init=function(){var B=this.$d;this.$y=B.getFullYear(),this.$M=B.getMonth(),this.$D=B.getDate(),this.$W=B.getDay(),this.$H=B.getHours(),this.$m=B.getMinutes(),this.$s=B.getSeconds(),this.$ms=B.getMilliseconds()},D.$utils=function(){return O},D.isValid=function(){return this.$d.toString()!==h},D.isSame=function(B,U){var $=I(B);return this.startOf(U)<=$&&$<=this.endOf(U)},D.isAfter=function(B,U){return I(B)<this.startOf(U)},D.isBefore=function(B,U){return this.endOf(U)<I(B)},D.$g=function(B,U,$){return O.u(B)?this[U]:this.set($,B)},D.unix=function(){return Math.floor(this.valueOf()/1e3)},D.valueOf=function(){return this.$d.getTime()},D.startOf=function(B,U){var $=this,V=!!O.u(U)||U,b=O.p(B),N=function(ie,K){var te=O.w($.$u?Date.UTC($.$y,K,ie):new Date($.$y,K,ie),$);return V?te:te.endOf(u)},H=function(ie,K){return O.w($.toDate()[ie].apply($.toDate("s"),(V?[0,0,0,0]:[23,59,59,999]).slice(K)),$)},x=this.$W,W=this.$M,ee=this.$D,Y="set"+(this.$u?"UTC":"");switch(b){case d:return V?N(1,0):N(31,11);case c:return V?N(1,W):N(0,W+1);case f:var J=this.$locale().weekStart||0,X=(x<J?x+7:x)-J;return N(V?ee-X:ee+(6-X),W);case u:case m:return H(Y+"Hours",0);case l:return H(Y+"Minutes",1);case s:return H(Y+"Seconds",2);case a:return H(Y+"Milliseconds",3);default:return this.clone()}},D.endOf=function(B){return this.startOf(B,!1)},D.$set=function(B,U){var $,V=O.p(B),b="set"+(this.$u?"UTC":""),N=($={},$[u]=b+"Date",$[m]=b+"Date",$[c]=b+"Month",$[d]=b+"FullYear",$[l]=b+"Hours",$[s]=b+"Minutes",$[a]=b+"Seconds",$[o]=b+"Milliseconds",$)[V],H=V===u?this.$D+(U-this.$W):U;if(V===c||V===d){var x=this.clone().set(m,1);x.$d[N](H),x.init(),this.$d=x.set(m,Math.min(this.$D,x.daysInMonth())).$d}else N&&this.$d[N](H);return this.init(),this},D.set=function(B,U){return this.clone().$set(B,U)},D.get=function(B){return this[O.p(B)]()},D.add=function(B,U){var $,V=this;B=Number(B);var b=O.p(U),N=function(W){var ee=I(V);return O.w(ee.date(ee.date()+Math.round(W*B)),V)};if(b===c)return this.set(c,this.$M+B);if(b===d)return this.set(d,this.$y+B);if(b===u)return N(1);if(b===f)return N(7);var H=($={},$[s]=r,$[l]=i,$[a]=n,$)[b]||1,x=this.$d.getTime()+B*H;return O.w(x,this)},D.subtract=function(B,U){return this.add(-1*B,U)},D.format=function(B){var U=this,$=this.$locale();if(!this.isValid())return $.invalidDate||h;var V=B||"YYYY-MM-DDTHH:mm:ssZ",b=O.z(this),N=this.$H,H=this.$m,x=this.$M,W=$.weekdays,ee=$.months,Y=$.meridiem,J=function(K,te,L,ne){return K&&(K[te]||K(U,V))||L[te].slice(0,ne)},X=function(K){return O.s(N%12||12,K,"0")},ie=Y||function(K,te,L){var ne=K<12?"AM":"PM";return L?ne.toLowerCase():ne};return V.replace(y,function(K,te){return te||function(L){switch(L){case"YY":return String(U.$y).slice(-2);case"YYYY":return O.s(U.$y,4,"0");case"M":return x+1;case"MM":return O.s(x+1,2,"0");case"MMM":return J($.monthsShort,x,ee,3);case"MMMM":return J(ee,x);case"D":return U.$D;case"DD":return O.s(U.$D,2,"0");case"d":return String(U.$W);case"dd":return J($.weekdaysMin,U.$W,W,2);case"ddd":return J($.weekdaysShort,U.$W,W,3);case"dddd":return W[U.$W];case"H":return String(N);case"HH":return O.s(N,2,"0");case"h":return X(1);case"hh":return X(2);case"a":return ie(N,H,!0);case"A":return ie(N,H,!1);case"m":return String(H);case"mm":return O.s(H,2,"0");case"s":return String(U.$s);case"ss":return O.s(U.$s,2,"0");case"SSS":return O.s(U.$ms,3,"0");case"Z":return b}return null}(K)||b.replace(":","")})},D.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},D.diff=function(B,U,$){var V,b=this,N=O.p(U),H=I(B),x=(H.utcOffset()-this.utcOffset())*r,W=this-H,ee=function(){return O.m(b,H)};switch(N){case d:V=ee()/12;break;case c:V=ee();break;case p:V=ee()/3;break;case f:V=(W-x)/6048e5;break;case u:V=(W-x)/864e5;break;case l:V=W/i;break;case s:V=W/r;break;case a:V=W/n;break;default:V=W}return $?V:O.a(V)},D.daysInMonth=function(){return this.endOf(c).$D},D.$locale=function(){return C[this.$L]},D.locale=function(B,U){if(!B)return this.$L;var $=this.clone(),V=F(B,U,!0);return V&&($.$L=V),$},D.clone=function(){return O.w(this.$d,this)},D.toDate=function(){return new Date(this.valueOf())},D.toJSON=function(){return this.isValid()?this.toISOString():null},D.toISOString=function(){return this.$d.toISOString()},D.toString=function(){return this.$d.toUTCString()},M}(),z=j.prototype;return I.prototype=z,[["$ms",o],["$s",a],["$m",s],["$H",l],["$W",u],["$M",c],["$y",d],["$D",m]].forEach(function(M){z[M[1]]=function(D){return this.$g(D,M[0],M[1])}}),I.extend=function(M,D){return M.$i||(M(D,j,I),M.$i=!0),I},I.locale=F,I.isDayjs=P,I.unix=function(M){return I(1e3*M)},I.en=C[k],I.Ls=C,I.p={},I})})(qs);var fm=qs.exports;const xr=jt(fm);var Ks={exports:{}};(function(e,t){(function(n,r){e.exports=r()})($t,function(){return function(n,r,i){r.prototype.isToday=function(){var o="YYYY-MM-DD",a=i();return this.format(o)===a.format(o)}}})})(Ks);var dm=Ks.exports;const pm=jt(dm);var Ys={exports:{}};(function(e,t){(function(n,r){e.exports=r()})($t,function(){return function(n,r,i){r.prototype.isYesterday=function(){var o="YYYY-MM-DD",a=i().subtract(1,"day");return this.format(o)===a.format(o)}}})})(Ys);var hm=Ys.exports;const mm=jt(hm);xr.extend(pm),xr.extend(mm);function Gs(e,t,n,r,i){return e.map(o=>{const{authorId:a}=o,s=a===n?"outgoing":"incoming",l=t.find(f=>f.id===a);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:s,sender:u}})}function gm(e,t="day"){var r,i,o;if(!e||e.length===0)return[];const n=[];(r=e[0])!=null&&r.timestamp&&n.push(Qs(e[0].timestamp));for(let a=0;a<e.length;a++)if(e[a]&&n.push(e[a]),a+1<e.length){const s=(i=e[a])==null?void 0:i.timestamp,l=(o=e[a+1])==null?void 0:o.timestamp;!xr(s).isSame(l,t)&&l&&n.push(Qs(l))}return n}function Qs(e){return{id:Js(e),direction:"system",sender:{name:"system"},timestamp:e,block:{type:"text",text:Js(e)}}}function Js(e,t=!1){const n=xr(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 ym(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 vm(e){return"#"+e.map(t=>`0${t.toString(16).toUpperCase()}`.slice(-2)).join("")}function bm(e,t){return e.map(n=>Math.round(n+(255-n)*t))}function wm(e,t){return e.map(n=>Math.round(n*t))}const Mn=e=>t=>bm(t,e),_n=e=>t=>wm(t,e),xm={50:Mn(.95),100:Mn(.9),200:Mn(.75),300:Mn(.6),400:Mn(.3),500:e=>e,600:_n(.9),700:_n(.6),800:_n(.45),900:_n(.3),950:_n(.2)};function Zs(e,t=xm){const n={},r=ym(e);for(const[i,o]of Object.entries(t))n[i]=vm(o(r));return n}const Xs=()=>{const e={};return{on:(i,o)=>{var a;return e[i]||(e[i]=new Set),(a=e[i])==null||a.add(o),()=>{var s;return(s=e[i])==null?void 0:s.delete(o)}},emit:(i,o)=>{var a,s;(a=e[i])==null||a.forEach(l=>l(o)),(s=e["*"])==null||s.forEach(l=>l({type:i,payload:o}))},removeAllListeners:i=>{var o;i?(o=e[i])==null||o.clear():Object.keys(e).forEach(a=>{var s;(s=e[a])==null||s.clear()})}}};function Qi(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,a=i>>8&255,s=i&255;return{r:o,g:a,b:s}}function km(e){return`#${((1<<24)+(e.r<<16)+(e.g<<8)+e.b).toString(16).slice(1)}`}const Sm=(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 el(e){return Object.entries(e).reduce((t,[n,r])=>{const i=n.replace(/(\d+)/,o=>(1e3-parseInt(o)).toString());return{...t,[i]:r}},{})}const Em=2.4,Cm=.2126729,Am=.7151522,Im=.072175,Tm=.56,Om=.57,Dm=.62,Mm=.65,kr=.022,tl=1.414,_m=1.14,Pm=1.14,Nm=.035991,Lm=27.7847239587675,Fm=27.7847239587675,nl=.027,rl=.027,il=.001,Rm=5e-4;function ol(e){const{r:t,g:n,b:r}=e,i=o=>(o/255)**Em;return Cm*i(t)+Am*i(n)+Im*i(r)}function al(e,t){if(!e||!t)return 0;let n=ol(Qi(e)),r=ol(Qi(t)),i=0,o=0;return n=n>kr?n:n+(kr-n)**tl,r=r>kr?r:r+(kr-r)**tl,Math.abs(r-n)<Rm?0:(r>n?(i=(r**Tm-n**Om)*_m,o=i<il?0:i<Nm?i-i*Lm*nl:i-nl):(i=(r**Mm-n**Dm)*Pm,o=i>-il?0:i>-.035991?i-i*Fm*rl:i+rl),Math.abs(o*100))}const Bm=(e,t,n)=>{const r=e;let i=0;for(;t.some(o=>n(o)===e);)i+=1,e=`${r} (${i})`;return e};function sl(e){const{fontFamily:t,...n}=e,r=ll(n);return Ws(".bpReset",{...r,"font-family":`'${t}', sans-serif`})+Ws(":host, :root",{...r})}function ll(e){const{radius:t,themeMode:n,color:r,variant:i,headerVariant:o}=e;let a={},s={};if(r){const p=Zs(r),d=n==="dark"?el(p):p,m=Zs(km(Sm(Qi(r)))),h=n==="dark"?el(m):m,g=n==="dark"?"#101010":"#fdfdfd";s=Object.entries({...d,1:g}).reduce((v,[w,A])=>({...v,[`--bpPrimary-${w}`]:A}),{});const y=Object.entries({...h,1:g}).reduce((v,[w,A])=>({...v,[`--bpGray-${w}`]:A}),{});a={...s,...y}}t&&(a={...a,"--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=s?al(s["--bpPrimary-600"],s["--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":s?al(s["--bpPrimary-500"],s["--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{...a,...f,...c}}const zm=e=>{if(typeof URL.canParse=="function")return URL.canParse(e);try{return new URL(e),!0}catch{return!1}},ul=["audio","file","image","video"],cl=e=>ul.includes(e),fl="The Client ID is required to initialize the webchat.",$m="The API url is required to initialize the webchat.",jm="The Bot ID is required to initialize the webchat.",Um="No config URL provided.",dl=`Invalid API URL.
18
- Please use a valid API URL.`,pl=`Invalid Client ID.
19
- Please use a valid Botpress Client ID.`,hl=`Invalid URL.
20
- Please make sure your client ID and API URL are valid`,Hm=`Invalid config URL.
21
- Please make sure your config URL is valid`,Wm=`Invalid webchat configuration.
22
- Please make sure your config file is valid`,Vm="Access denied to configuration file. Please check your credentials or your configuration URL and try again.",ml=`This bot has temporarily paused.
23
- Please check back later.`,gl=`This bot has temporarily paused.
24
- Please check back later.`,Ji="Something went wrong. To fix it, please clear your browser's local and session storage and then refresh the page",Pn="Please check your internet connection and refresh the page.",yl=`You've been disconnected from the conversation.
25
- Please refresh the page.`,vl=`Unable to process the message.
26
- Please start a new conversation.`,Zi={ResourceNotFound:{type:"configuration",message:pl},Forbidden:{type:"bot",message:ml}},Xi={MethodNotFound:{type:"configuration",message:hl},QuotaExceeded:{type:"bot",message:gl},Forbidden:{type:"bot",message:Ji}};function bl(e){return e in Zi}function wl(e){return e in Xi}function xl(e){return e!==null&&typeof e=="object"&&"id"in e&&"code"in e&&"type"in e}function kl(e){return e!==null&&typeof e=="object"&&"type"in e&&e.type==="error"&&"message"in e&&typeof e.message=="string"}const Sl=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 a=n*Math.pow(2,i-1);await new Promise(s=>setTimeout(s,a))}throw new Error("Unreachable: retry loop should always return or throw")},qm=["networkerror","failedtofetch","errorininputstream"],Sr=e=>{var n;console.error("An error occurred:",e);let t={type:"unknown",message:"An unexpected error occurred"};if(xl(e))e.type==="network"?t={id:e.id,type:"network",message:Pn}:(n=e.message)!=null&&n.includes("[Webhook Handler]")&&bl(e.type)?t={id:e.id,...Zi[e.type]}:wl(e.type)?t={id:e.id,...Xi[e.type]}:t={id:e.id,type:e.type,message:e.message||"An error occurred"};else if(kl(e))El(e.message)?t={type:"disconnected",message:yl}:Cl(e.message).includes("invalidcontenttype")?t={type:"bot",message:vl}:t={type:"event",message:e.message};else if(e instanceof Error&&El(e.message))t={type:"network",message:Pn};else if(e&&typeof e=="object"&&"type"in e&&"message"in e){const r=e;r.type==="network"?t={type:"network",message:Pn}:t={type:r.type,message:r.message}}return t};function El(e){return qm.some(t=>Cl(e).includes(t))}function Cl(e){return e.replaceAll(" ","").toLowerCase()}const Nn=_.forwardRef(({userId:e,src:t,container:n,image:r,fallback:i,...o},a)=>{const s=Vs(e??"",15);return S.jsxs(Ki,{ref:a,"data-color":s,...n,...o,children:[S.jsx(Yi,{src:t,...r}),S.jsx(Gi,{...i,children:typeof o.children=="string"?o.children[0]:o.children})]})});Nn.displayName="Avatar";function BT(){}function zT(){}function Km(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Ym=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Gm=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Qm={};function Al(e,t){return(Qm.jsx?Gm:Ym).test(e)}const Jm=/[ \t\n\f\r]/g;function Zm(e){return typeof e=="object"?e.type==="text"?Il(e.value):!1:Il(e)}function Il(e){return e.replace(Jm,"")===""}class Ln{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Ln.prototype.normal={},Ln.prototype.property={},Ln.prototype.space=void 0;function Tl(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Ln(n,r,t)}function eo(e){return e.toLowerCase()}class Qe{constructor(t,n){this.attribute=n,this.property=t}}Qe.prototype.attribute="",Qe.prototype.booleanish=!1,Qe.prototype.boolean=!1,Qe.prototype.commaOrSpaceSeparated=!1,Qe.prototype.commaSeparated=!1,Qe.prototype.defined=!1,Qe.prototype.mustUseProperty=!1,Qe.prototype.number=!1,Qe.prototype.overloadedBoolean=!1,Qe.prototype.property="",Qe.prototype.spaceSeparated=!1,Qe.prototype.space=void 0;let Xm=0;const he=Ut(),Fe=Ut(),to=Ut(),Q=Ut(),De=Ut(),Xt=Ut(),et=Ut();function Ut(){return 2**++Xm}const no=Object.freeze(Object.defineProperty({__proto__:null,boolean:he,booleanish:Fe,commaOrSpaceSeparated:et,commaSeparated:Xt,number:Q,overloadedBoolean:to,spaceSeparated:De},Symbol.toStringTag,{value:"Module"})),ro=Object.keys(no);class io extends Qe{constructor(t,n,r,i){let o=-1;if(super(t,n),Ol(this,"space",i),typeof r=="number")for(;++o<ro.length;){const a=ro[o];Ol(this,ro[o],(r&no[a])===no[a])}}}io.prototype.defined=!0;function Ol(e,t,n){n&&(e[t]=n)}function en(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new io(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[eo(r)]=r,n[eo(o.attribute)]=r}return new Ln(t,n,e.space)}const Dl=en({properties:{ariaActiveDescendant:null,ariaAtomic:Fe,ariaAutoComplete:null,ariaBusy:Fe,ariaChecked:Fe,ariaColCount:Q,ariaColIndex:Q,ariaColSpan:Q,ariaControls:De,ariaCurrent:null,ariaDescribedBy:De,ariaDetails:null,ariaDisabled:Fe,ariaDropEffect:De,ariaErrorMessage:null,ariaExpanded:Fe,ariaFlowTo:De,ariaGrabbed:Fe,ariaHasPopup:null,ariaHidden:Fe,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:De,ariaLevel:Q,ariaLive:null,ariaModal:Fe,ariaMultiLine:Fe,ariaMultiSelectable:Fe,ariaOrientation:null,ariaOwns:De,ariaPlaceholder:null,ariaPosInSet:Q,ariaPressed:Fe,ariaReadOnly:Fe,ariaRelevant:null,ariaRequired:Fe,ariaRoleDescription:De,ariaRowCount:Q,ariaRowIndex:Q,ariaRowSpan:Q,ariaSelected:Fe,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 Ml(e,t){return t in e?e[t]:t}function _l(e,t){return Ml(e,t.toLowerCase())}const eg=en({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Xt,acceptCharset:De,accessKey:De,action:null,allow:null,allowFullScreen:he,allowPaymentRequest:he,allowUserMedia:he,alt:null,as:null,async:he,autoCapitalize:null,autoComplete:De,autoFocus:he,autoPlay:he,blocking:De,capture:null,charSet:null,checked:he,cite:null,className:De,cols:Q,colSpan:null,content:null,contentEditable:Fe,controls:he,controlsList:De,coords:Q|Xt,crossOrigin:null,data:null,dateTime:null,decoding:null,default:he,defer:he,dir:null,dirName:null,disabled:he,download:to,draggable:Fe,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:he,formTarget:null,headers:De,height:Q,hidden:to,high:Q,href:null,hrefLang:null,htmlFor:De,httpEquiv:De,id:null,imageSizes:null,imageSrcSet:null,inert:he,inputMode:null,integrity:null,is:null,isMap:he,itemId:null,itemProp:De,itemRef:De,itemScope:he,itemType:De,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:he,low:Q,manifest:null,max:null,maxLength:Q,media:null,method:null,min:null,minLength:Q,multiple:he,muted:he,name:null,nonce:null,noModule:he,noValidate:he,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:he,optimum:Q,pattern:null,ping:De,placeholder:null,playsInline:he,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:he,referrerPolicy:null,rel:De,required:he,reversed:he,rows:Q,rowSpan:Q,sandbox:De,scope:null,scoped:he,seamless:he,selected:he,shadowRootClonable:he,shadowRootDelegatesFocus:he,shadowRootMode:null,shape:null,size:Q,sizes:null,slot:null,span:Q,spellCheck:Fe,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:he,useMap:null,value:Fe,width:Q,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:De,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:he,declare:he,event:null,face:null,frame:null,frameBorder:null,hSpace:Q,leftMargin:Q,link:null,longDesc:null,lowSrc:null,marginHeight:Q,marginWidth:Q,noResize:he,noHref:he,noShade:he,noWrap:he,object:null,profile:null,prompt:null,rev:null,rightMargin:Q,rules:null,scheme:null,scrolling:Fe,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:he,disableRemotePlayback:he,prefix:null,property:null,results:Q,security:null,unselectable:null},space:"html",transform:_l}),tg=en({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:et,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:De,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:he,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:Xt,g2:Xt,glyphName:Xt,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:et,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:De,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Q,pointsAtY:Q,pointsAtZ:Q,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:et,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:et,rev:et,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:et,requiredFeatures:et,requiredFonts:et,requiredFormats:et,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:et,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:et,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:et,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:Ml}),Pl=en({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()}}),Nl=en({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:_l}),Ll=en({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),ng={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"},rg=/[A-Z]/g,Fl=/-[a-z]/g,ig=/^data[-\w.:]+$/i;function og(e,t){const n=eo(t);let r=t,i=Qe;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&ig.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Fl,sg);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Fl.test(o)){let a=o.replace(rg,ag);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=io}return new i(r,t)}function ag(e){return"-"+e.toLowerCase()}function sg(e){return e.charAt(1).toUpperCase()}const lg=Tl([Dl,eg,Pl,Nl,Ll],"html"),oo=Tl([Dl,tg,Pl,Nl,Ll],"svg");function ug(e){return e.join(" ").trim()}var ao={},Rl=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,cg=/\n/g,fg=/^\s*/,dg=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,pg=/^:\s*/,hg=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,mg=/^[;\s]*/,gg=/^\s+|\s+$/g,yg=`
27
- `,Bl="/",zl="*",Ht="",vg="comment",bg="declaration";function wg(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 h=m.match(cg);h&&(n+=h.length);var g=m.lastIndexOf(yg);r=~g?m.length-g:r+m.length}function o(){var m={line:n,column:r};return function(h){return h.position=new a(m),u(),h}}function a(m){this.start=m,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function s(m){var h=new Error(t.source+":"+n+":"+r+": "+m);if(h.reason=m,h.filename=t.source,h.line=n,h.column=r,h.source=e,!t.silent)throw h}function l(m){var h=m.exec(e);if(h){var g=h[0];return i(g),e=e.slice(g.length),h}}function u(){l(fg)}function f(m){var h;for(m=m||[];h=c();)h!==!1&&m.push(h);return m}function c(){var m=o();if(!(Bl!=e.charAt(0)||zl!=e.charAt(1))){for(var h=2;Ht!=e.charAt(h)&&(zl!=e.charAt(h)||Bl!=e.charAt(h+1));)++h;if(h+=2,Ht===e.charAt(h-1))return s("End of comment missing");var g=e.slice(2,h-2);return r+=2,i(g),e=e.slice(h),r+=2,m({type:vg,comment:g})}}function p(){var m=o(),h=l(dg);if(h){if(c(),!l(pg))return s("property missing ':'");var g=l(hg),y=m({type:bg,property:$l(h[0].replace(Rl,Ht)),value:g?$l(g[0].replace(Rl,Ht)):Ht});return l(mg),y}}function d(){var m=[];f(m);for(var h;h=p();)h!==!1&&(m.push(h),f(m));return m}return u(),d()}function $l(e){return e?e.replace(gg,Ht):Ht}var xg=wg,kg=$t&&$t.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ao,"__esModule",{value:!0}),ao.default=Eg;const Sg=kg(xg);function Eg(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,Sg.default)(e),i=typeof t=="function";return r.forEach(o=>{if(o.type!=="declaration")return;const{property:a,value:s}=o;i?t(a,s,o):s&&(n=n||{},n[a]=s)}),n}var Er={};Object.defineProperty(Er,"__esModule",{value:!0}),Er.camelCase=void 0;var Cg=/^--[a-zA-Z0-9_-]+$/,Ag=/-([a-z])/g,Ig=/^[^-]+$/,Tg=/^-(webkit|moz|ms|o|khtml)-/,Og=/^-(ms)-/,Dg=function(e){return!e||Ig.test(e)||Cg.test(e)},Mg=function(e,t){return t.toUpperCase()},jl=function(e,t){return"".concat(t,"-")},_g=function(e,t){return t===void 0&&(t={}),Dg(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(Og,jl):e=e.replace(Tg,jl),e.replace(Ag,Mg))};Er.camelCase=_g;var Pg=$t&&$t.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Ng=Pg(ao),Lg=Er;function so(e,t){var n={};return!e||typeof e!="string"||(0,Ng.default)(e,function(r,i){r&&i&&(n[(0,Lg.camelCase)(r,t)]=i)}),n}so.default=so;var Fg=so;const Rg=jt(Fg),Ul=Hl("end"),lo=Hl("start");function Hl(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 Bg(e){const t=lo(e),n=Ul(e);if(t&&n)return{start:t,end:n}}function Fn(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Wl(e.position):"start"in e||"end"in e?Wl(e):"line"in e||"column"in e?uo(e):""}function uo(e){return Vl(e&&e.line)+":"+Vl(e&&e.column)}function Wl(e){return uo(e&&e.start)+"-"+uo(e&&e.end)}function Vl(e){return e&&typeof e=="number"?e:1}class He extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},a=!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&&(a=!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 s=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=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=Fn(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=a&&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}}He.prototype.file="",He.prototype.name="",He.prototype.reason="",He.prototype.message="",He.prototype.stack="",He.prototype.column=void 0,He.prototype.line=void 0,He.prototype.ancestors=void 0,He.prototype.cause=void 0,He.prototype.fatal=void 0,He.prototype.place=void 0,He.prototype.ruleId=void 0,He.prototype.source=void 0;const co={}.hasOwnProperty,zg=new Map,$g=/[A-Z]/g,jg=new Set(["table","tbody","thead","tfoot","tr"]),Ug=new Set(["td","th"]),ql="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Hg(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=Jg(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=Qg(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"?oo:lg,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=Kl(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function Kl(e,t,n){if(t.type==="element")return Wg(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Vg(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Kg(e,t,n);if(t.type==="mdxjsEsm")return qg(e,t);if(t.type==="root")return Yg(e,t,n);if(t.type==="text")return Gg(e,t)}function Wg(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=oo,e.schema=i),e.ancestors.push(t);const o=Gl(e,t.tagName,!1),a=Zg(e,t);let s=po(e,t);return jg.has(t.tagName)&&(s=s.filter(function(l){return typeof l=="string"?!Zm(l):!0})),Yl(e,a,o,t),fo(a,s),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function Vg(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)}Rn(e,t.position)}function qg(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Rn(e,t.position)}function Kg(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=oo,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:Gl(e,t.name,!0),a=Xg(e,t),s=po(e,t);return Yl(e,a,o,t),fo(a,s),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function Yg(e,t,n){const r={};return fo(r,po(e,t)),e.create(t,e.Fragment,r,n)}function Gg(e,t){return t.value}function Yl(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function fo(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Qg(e,t,n){return r;function r(i,o,a,s){const u=Array.isArray(a.children)?n:t;return s?u(o,a,s):u(o,a)}}function Jg(e,t){return n;function n(r,i,o,a){const s=Array.isArray(o.children),l=lo(r);return t(i,o,a,s,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function Zg(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&co.call(t.properties,i)){const o=ey(e,i,t.properties[i]);if(o){const[a,s]=o;e.tableCellAlignToStyle&&a==="align"&&typeof s=="string"&&Ug.has(t.tagName)?r=s:n[a]=s}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Xg(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 a=o.expression;a.type;const s=a.properties[0];s.type,Object.assign(n,e.evaluater.evaluateExpression(s.argument))}else Rn(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 s=r.value.data.estree.body[0];s.type,o=e.evaluater.evaluateExpression(s.expression)}else Rn(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function po(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:zg;for(;++r<t.children.length;){const o=t.children[r];let a;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;a=l+"-"+u,i.set(l,u+1)}}const s=Kl(e,o,a);s!==void 0&&n.push(s)}return n}function ey(e,t,n){const r=og(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Km(n):ug(n)),r.property==="style"){let i=typeof n=="object"?n:ty(e,String(n));return e.stylePropertyNameCase==="css"&&(i=ny(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?ng[r.property]||r.property:r.attribute,n]}}function ty(e,t){try{return Rg(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new He("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=ql+"#cannot-parse-style-attribute",i}}function Gl(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,a;for(;++o<i.length;){const s=Al(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};a=a?{type:"MemberExpression",object:a,property:s,computed:!!(o&&s.type==="Literal"),optional:!1}:s}r=a}else r=Al(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return co.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Rn(e)}function Rn(e,t){const n=new He("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=ql+"#cannot-handle-mdx-estrees-without-createevaluater",n}function ny(e){const t={};let n;for(n in e)co.call(e,n)&&(t[ry(n)]=e[n]);return t}function ry(e){let t=e.replace($g,iy);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function iy(e){return"-"+e.toLowerCase()}const ho={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"]},oy={};function mo(e,t){const n=oy,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Ql(e,r,i)}function Ql(e,t,n){if(ay(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 Jl(e.children,t,n)}return Array.isArray(e)?Jl(e,t,n):""}function Jl(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Ql(e[i],t,n);return r.join("")}function ay(e){return!!(e&&typeof e=="object")}const Zl=document.createElement("i");function go(e){const t="&"+e+";";Zl.innerHTML=t;const n=Zl.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function tt(e,t,n,r){const i=e.length;let o=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);o<r.length;)a=r.slice(o,o+1e4),a.unshift(t,0),e.splice(...a),o+=1e4,t+=1e4}function it(e,t){return e.length>0?(tt(e,e.length,0,t),e):t}const Xl={}.hasOwnProperty;function eu(e){const t={};let n=-1;for(;++n<e.length;)sy(t,e[n]);return t}function sy(e,t){let n;for(n in t){const i=(Xl.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let a;if(o)for(a in o){Xl.call(i,a)||(i[a]=[]);const s=o[a];ly(i[a],Array.isArray(s)?s:s?[s]:[])}}}function ly(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);tt(e,0,0,r)}function tu(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 ut(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const qe=Dt(/[A-Za-z]/),We=Dt(/[\dA-Za-z]/),uy=Dt(/[#-'*+\--9=?A-Z^-~]/);function Cr(e){return e!==null&&(e<32||e===127)}const yo=Dt(/\d/),cy=Dt(/[\dA-Fa-f]/),fy=Dt(/[!-/:-@[-`{-~]/);function ce(e){return e!==null&&e<-2}function Ie(e){return e!==null&&(e<0||e===32)}function ye(e){return e===-2||e===-1||e===32}const Ar=Dt(new RegExp("\\p{P}|\\p{S}","u")),Wt=Dt(/\s/);function Dt(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function tn(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let a="";if(o===37&&We(e.charCodeAt(n+1))&&We(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(a=String.fromCharCode(o));else if(o>55295&&o<57344){const s=e.charCodeAt(n+1);o<56320&&s>56319&&s<57344?(a=String.fromCharCode(o,s),i=1):a="�"}else a=String.fromCharCode(o);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function be(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(l){return ye(l)?(e.enter(n),s(l)):t(l)}function s(l){return ye(l)&&o++<i?(e.consume(l),s):(e.exit(n),t(l))}}const dy={tokenize:py};function py(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),be(e,t,"linePrefix")}function i(s){return e.enter("paragraph"),o(s)}function o(s){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,a(s)}function a(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return ce(s)?(e.consume(s),e.exit("chunkText"),o):(e.consume(s),a)}}const hy={tokenize:my},nu={tokenize:gy};function my(e){const t=this,n=[];let r=0,i,o,a;return s;function s(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&&v();const A=t.events.length;let k=A,C;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){C=t.events[k][1].end;break}y(r);let T=A;for(;T<t.events.length;)t.events[T][1].end={...C},T++;return tt(t.events,k+1,0,t.events.slice(A)),t.events.length=T,u(w)}return s(w)}function u(w){if(r===n.length){if(!i)return p(w);if(i.currentConstruct&&i.currentConstruct.concrete)return m(w);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(nu,f,c)(w)}function f(w){return i&&v(),y(r),p(w)}function c(w){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,m(w)}function p(w){return t.containerState={},e.attempt(nu,d,m)(w)}function d(w){return r++,n.push([t.currentConstruct,t.containerState]),p(w)}function m(w){if(w===null){i&&v(),y(0),e.consume(w);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),h(w)}function h(w){if(w===null){g(e.exit("chunkFlow"),!0),y(0),e.consume(w);return}return ce(w)?(e.consume(w),g(e.exit("chunkFlow")),r=0,t.interrupt=void 0,s):(e.consume(w),h)}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 C=i.events.length;for(;C--;)if(i.events[C][1].start.offset<a&&(!i.events[C][1].end||i.events[C][1].end.offset>a))return;const T=t.events.length;let P=T,F,I;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){if(F){I=t.events[P][1].end;break}F=!0}for(y(r),C=T;C<t.events.length;)t.events[C][1].end={...I},C++;tt(t.events,P+1,0,t.events.slice(T)),t.events.length=C}}function y(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 v(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function gy(e,t,n){return be(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function nn(e){if(e===null||Ie(e)||Wt(e))return 1;if(Ar(e))return 2}function Ir(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 vo={name:"attention",resolveAll:yy,tokenize:vy};function yy(e,t){let n=-1,r,i,o,a,s,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},p={...e[n][1].start};ru(c,-l),ru(p,l),a={type:l>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},s={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},o={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...a.start},end:{...s.end}},e[r][1].end={...a.start},e[n][1].start={...s.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=it(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=it(u,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",o,t]]),u=it(u,Ir(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=it(u,[["exit",o,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,u=it(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,tt(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 vy(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=nn(r);let o;return a;function a(l){return o=l,e.enter("attentionSequence"),s(l)}function s(l){if(l===o)return e.consume(l),s;const u=e.exit("attentionSequence"),f=nn(l),c=!f||f===2&&i||n.includes(l),p=!i||i===2&&f||n.includes(r);return u._open=!!(o===42?c:c&&(i||!p)),u._close=!!(o===42?p:p&&(f||!c)),t(l)}}function ru(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const by={name:"autolink",tokenize:wy};function wy(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 qe(d)?(e.consume(d),a):d===64?n(d):u(d)}function a(d){return d===43||d===45||d===46||We(d)?(r=1,s(d)):u(d)}function s(d){return d===58?(e.consume(d),r=0,l):(d===43||d===45||d===46||We(d))&&r++<32?(e.consume(d),s):(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||Cr(d)?n(d):(e.consume(d),l)}function u(d){return d===64?(e.consume(d),f):uy(d)?(e.consume(d),u):n(d)}function f(d){return We(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):p(d)}function p(d){if((d===45||We(d))&&r++<63){const m=d===45?p:c;return e.consume(d),m}return n(d)}}const Bn={partial:!0,tokenize:xy};function xy(e,t,n){return r;function r(o){return ye(o)?be(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||ce(o)?t(o):n(o)}}const iu={continuation:{tokenize:Sy},exit:Ey,name:"blockQuote",tokenize:ky};function ky(e,t,n){const r=this;return i;function i(a){if(a===62){const s=r.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),o}return n(a)}function o(a){return ye(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function Sy(e,t,n){const r=this;return i;function i(a){return ye(a)?be(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):o(a)}function o(a){return e.attempt(iu,t,n)(a)}}function Ey(e){e.exit("blockQuote")}const ou={name:"characterEscape",tokenize:Cy};function Cy(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 fy(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const au={name:"characterReference",tokenize:Ay};function Ay(e,t,n){const r=this;let i=0,o,a;return s;function s(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,a=We,f(c))}function u(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,a=cy,f):(e.enter("characterReferenceValue"),o=7,a=yo,f(c))}function f(c){if(c===59&&i){const p=e.exit("characterReferenceValue");return a===We&&!go(r.sliceSerialize(p))?n(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(c)&&i++<o?(e.consume(c),f):n(c)}}const su={partial:!0,tokenize:Ty},lu={concrete:!0,name:"codeFenced",tokenize:Iy};function Iy(e,t,n){const r=this,i={partial:!0,tokenize:k};let o=0,a=0,s;return l;function l(C){return u(C)}function u(C){const T=r.events[r.events.length-1];return o=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,s=C,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(C)}function f(C){return C===s?(a++,e.consume(C),f):a<3?n(C):(e.exit("codeFencedFenceSequence"),ye(C)?be(e,c,"whitespace")(C):c(C))}function c(C){return C===null||ce(C)?(e.exit("codeFencedFence"),r.interrupt?t(C):e.check(su,h,A)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(C))}function p(C){return C===null||ce(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(C)):ye(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),be(e,d,"whitespace")(C)):C===96&&C===s?n(C):(e.consume(C),p)}function d(C){return C===null||ce(C)?c(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(C))}function m(C){return C===null||ce(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(C)):C===96&&C===s?n(C):(e.consume(C),m)}function h(C){return e.attempt(i,A,g)(C)}function g(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),y}function y(C){return o>0&&ye(C)?be(e,v,"linePrefix",o+1)(C):v(C)}function v(C){return C===null||ce(C)?e.check(su,h,A)(C):(e.enter("codeFlowValue"),w(C))}function w(C){return C===null||ce(C)?(e.exit("codeFlowValue"),v(C)):(e.consume(C),w)}function A(C){return e.exit("codeFenced"),t(C)}function k(C,T,P){let F=0;return I;function I(D){return C.enter("lineEnding"),C.consume(D),C.exit("lineEnding"),O}function O(D){return C.enter("codeFencedFence"),ye(D)?be(C,j,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):j(D)}function j(D){return D===s?(C.enter("codeFencedFenceSequence"),z(D)):P(D)}function z(D){return D===s?(F++,C.consume(D),z):F>=a?(C.exit("codeFencedFenceSequence"),ye(D)?be(C,M,"whitespace")(D):M(D)):P(D)}function M(D){return D===null||ce(D)?(C.exit("codeFencedFence"),T(D)):P(D)}}}function Ty(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const bo={name:"codeIndented",tokenize:Dy},Oy={partial:!0,tokenize:My};function Dy(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),be(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?a(u):n(u)}function a(u){return u===null?l(u):ce(u)?e.attempt(Oy,a,l)(u):(e.enter("codeFlowValue"),s(u))}function s(u){return u===null||ce(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),s)}function l(u){return e.exit("codeIndented"),t(u)}}function My(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):ce(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):be(e,o,"linePrefix",5)(a)}function o(a){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):ce(a)?i(a):n(a)}}const _y={name:"codeText",previous:Ny,resolve:Py,tokenize:Ly};function Py(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 Ny(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Ly(e,t,n){let r=0,i,o;return a;function a(c){return e.enter("codeText"),e.enter("codeTextSequence"),s(c)}function s(c){return c===96?(e.consume(c),r++,s):(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 Fy{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&&zn(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),zn(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),zn(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);zn(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);zn(this.left,n.reverse())}}}function zn(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 uu(e){const t={};let n=-1,r,i,o,a,s,l,u;const f=new Fy(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,Ry(f,n)),n=t[n],u=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(a=f.get(o),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=o);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},s=f.slice(i,n),s.unshift(r),f.splice(i,n-i+1,s))}}return tt(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!u}function Ry(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const s=a.events,l=[],u={};let f,c,p=-1,d=n,m=0,h=0;const g=[h];for(;d;){for(;e.get(++i)[1]!==d;);o.push(i),d._tokenizer||(f=r.sliceStream(d),d.next||f.push(null),c&&a.defineSkip(d.start),d._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(f),d._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),c=d,d=d.next}for(d=n;++p<s.length;)s[p][0]==="exit"&&s[p-1][0]==="enter"&&s[p][1].type===s[p-1][1].type&&s[p][1].start.line!==s[p][1].end.line&&(h=p+1,g.push(h),d._tokenizer=void 0,d.previous=void 0,d=d.next);for(a.events=[],d?(d._tokenizer=void 0,d.previous=void 0):g.pop(),p=g.length;p--;){const y=s.slice(g[p],g[p+1]),v=o.pop();l.push([v,v+y.length-1]),e.splice(v,2,y)}for(l.reverse(),p=-1;++p<l.length;)u[m+l[p][0]]=m+l[p][1],m+=l[p][1]-l[p][0]-1;return u}const By={resolve:$y,tokenize:jy},zy={partial:!0,tokenize:Uy};function $y(e){return uu(e),e}function jy(e,t){let n;return r;function r(s){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(s)}function i(s){return s===null?o(s):ce(s)?e.check(zy,a,o)(s):(e.consume(s),i)}function o(s){return e.exit("chunkContent"),e.exit("content"),t(s)}function a(s){return e.consume(s),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function Uy(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),be(e,o,"linePrefix")}function o(a){if(a===null||ce(a))return n(a);const s=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function cu(e,t,n,r,i,o,a,s,l){const u=l||Number.POSITIVE_INFINITY;let f=0;return c;function c(y){return y===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(y),e.exit(o),p):y===null||y===32||y===41||Cr(y)?n(y):(e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),h(y))}function p(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),d(y))}function d(y){return y===62?(e.exit("chunkString"),e.exit(s),p(y)):y===null||y===60||ce(y)?n(y):(e.consume(y),y===92?m:d)}function m(y){return y===60||y===62||y===92?(e.consume(y),d):d(y)}function h(y){return!f&&(y===null||y===41||Ie(y))?(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(y)):f<u&&y===40?(e.consume(y),f++,h):y===41?(e.consume(y),f--,h):y===null||y===32||y===40||Cr(y)?n(y):(e.consume(y),y===92?g:h)}function g(y){return y===40||y===41||y===92?(e.consume(y),h):h(y)}}function fu(e,t,n,r,i,o){const a=this;let s=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 s>999||d===null||d===91||d===93&&!l||d===94&&!s&&"_hiddenFootnoteSupport"in a.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)||s++>999?(e.exit("chunkString"),f(d)):(e.consume(d),l||(l=!ye(d)),d===92?p:c)}function p(d){return d===91||d===92||d===93?(e.consume(d),s++,c):c(d)}}function du(e,t,n,r,i,o){let a;return s;function s(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),a=p===40?41:p,l):n(p)}function l(p){return p===a?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(o),u(p))}function u(p){return p===a?(e.exit(o),l(a)):p===null?n(p):ce(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),be(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===a||p===null||ce(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?c:f)}function c(p){return p===a||p===92?(e.consume(p),f):f(p)}}function $n(e,t){let n;return r;function r(i){return ce(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ye(i)?be(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Hy={name:"definition",tokenize:Vy},Wy={partial:!0,tokenize:qy};function Vy(e,t,n){const r=this;let i;return o;function o(d){return e.enter("definition"),a(d)}function a(d){return fu.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function s(d){return i=ut(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 Ie(d)?$n(e,u)(d):u(d)}function u(d){return cu(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function f(d){return e.attempt(Wy,c,c)(d)}function c(d){return ye(d)?be(e,p,"whitespace")(d):p(d)}function p(d){return d===null||ce(d)?(e.exit("definition"),r.parser.defined.push(i),t(d)):n(d)}}function qy(e,t,n){return r;function r(s){return Ie(s)?$n(e,i)(s):n(s)}function i(s){return du(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return ye(s)?be(e,a,"whitespace")(s):a(s)}function a(s){return s===null||ce(s)?t(s):n(s)}}const Ky={name:"hardBreakEscape",tokenize:Yy};function Yy(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 Gy={name:"headingAtx",resolve:Qy,tokenize:Jy};function Qy(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"},tt(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function Jy(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),a(f)}function a(f){return f===35&&r++<6?(e.consume(f),a):f===null||Ie(f)?(e.exit("atxHeadingSequence"),s(f)):n(f)}function s(f){return f===35?(e.enter("atxHeadingSequence"),l(f)):f===null||ce(f)?(e.exit("atxHeading"),t(f)):ye(f)?be(e,s,"whitespace")(f):(e.enter("atxHeadingText"),u(f))}function l(f){return f===35?(e.consume(f),l):(e.exit("atxHeadingSequence"),s(f))}function u(f){return f===null||f===35||Ie(f)?(e.exit("atxHeadingText"),s(f)):(e.consume(f),u)}}const Zy=["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"],pu=["pre","script","style","textarea"],Xy={concrete:!0,name:"htmlFlow",resolveTo:nv,tokenize:rv},ev={partial:!0,tokenize:ov},tv={partial:!0,tokenize:iv};function nv(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 rv(e,t,n){const r=this;let i,o,a,s,l;return u;function u(x){return f(x)}function f(x){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(x),c}function c(x){return x===33?(e.consume(x),p):x===47?(e.consume(x),o=!0,h):x===63?(e.consume(x),i=3,r.interrupt?t:b):qe(x)?(e.consume(x),a=String.fromCharCode(x),g):n(x)}function p(x){return x===45?(e.consume(x),i=2,d):x===91?(e.consume(x),i=5,s=0,m):qe(x)?(e.consume(x),i=4,r.interrupt?t:b):n(x)}function d(x){return x===45?(e.consume(x),r.interrupt?t:b):n(x)}function m(x){const W="CDATA[";return x===W.charCodeAt(s++)?(e.consume(x),s===W.length?r.interrupt?t:j:m):n(x)}function h(x){return qe(x)?(e.consume(x),a=String.fromCharCode(x),g):n(x)}function g(x){if(x===null||x===47||x===62||Ie(x)){const W=x===47,ee=a.toLowerCase();return!W&&!o&&pu.includes(ee)?(i=1,r.interrupt?t(x):j(x)):Zy.includes(a.toLowerCase())?(i=6,W?(e.consume(x),y):r.interrupt?t(x):j(x)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(x):o?v(x):w(x))}return x===45||We(x)?(e.consume(x),a+=String.fromCharCode(x),g):n(x)}function y(x){return x===62?(e.consume(x),r.interrupt?t:j):n(x)}function v(x){return ye(x)?(e.consume(x),v):I(x)}function w(x){return x===47?(e.consume(x),I):x===58||x===95||qe(x)?(e.consume(x),A):ye(x)?(e.consume(x),w):I(x)}function A(x){return x===45||x===46||x===58||x===95||We(x)?(e.consume(x),A):k(x)}function k(x){return x===61?(e.consume(x),C):ye(x)?(e.consume(x),k):w(x)}function C(x){return x===null||x===60||x===61||x===62||x===96?n(x):x===34||x===39?(e.consume(x),l=x,T):ye(x)?(e.consume(x),C):P(x)}function T(x){return x===l?(e.consume(x),l=null,F):x===null||ce(x)?n(x):(e.consume(x),T)}function P(x){return x===null||x===34||x===39||x===47||x===60||x===61||x===62||x===96||Ie(x)?k(x):(e.consume(x),P)}function F(x){return x===47||x===62||ye(x)?w(x):n(x)}function I(x){return x===62?(e.consume(x),O):n(x)}function O(x){return x===null||ce(x)?j(x):ye(x)?(e.consume(x),O):n(x)}function j(x){return x===45&&i===2?(e.consume(x),B):x===60&&i===1?(e.consume(x),U):x===62&&i===4?(e.consume(x),N):x===63&&i===3?(e.consume(x),b):x===93&&i===5?(e.consume(x),V):ce(x)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(ev,H,z)(x)):x===null||ce(x)?(e.exit("htmlFlowData"),z(x)):(e.consume(x),j)}function z(x){return e.check(tv,M,H)(x)}function M(x){return e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),D}function D(x){return x===null||ce(x)?z(x):(e.enter("htmlFlowData"),j(x))}function B(x){return x===45?(e.consume(x),b):j(x)}function U(x){return x===47?(e.consume(x),a="",$):j(x)}function $(x){if(x===62){const W=a.toLowerCase();return pu.includes(W)?(e.consume(x),N):j(x)}return qe(x)&&a.length<8?(e.consume(x),a+=String.fromCharCode(x),$):j(x)}function V(x){return x===93?(e.consume(x),b):j(x)}function b(x){return x===62?(e.consume(x),N):x===45&&i===2?(e.consume(x),b):j(x)}function N(x){return x===null||ce(x)?(e.exit("htmlFlowData"),H(x)):(e.consume(x),N)}function H(x){return e.exit("htmlFlow"),t(x)}}function iv(e,t,n){const r=this;return i;function i(a){return ce(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):n(a)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function ov(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Bn,t,n)}}const av={name:"htmlText",tokenize:sv};function sv(e,t,n){const r=this;let i,o,a;return s;function s(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):qe(b)?(e.consume(b),P):n(b)}function u(b){return b===45?(e.consume(b),f):b===91?(e.consume(b),o=0,m):qe(b)?(e.consume(b),v):n(b)}function f(b){return b===45?(e.consume(b),d):n(b)}function c(b){return b===null?n(b):b===45?(e.consume(b),p):ce(b)?(a=c,U(b)):(e.consume(b),c)}function p(b){return b===45?(e.consume(b),d):c(b)}function d(b){return b===62?B(b):b===45?p(b):c(b)}function m(b){const N="CDATA[";return b===N.charCodeAt(o++)?(e.consume(b),o===N.length?h:m):n(b)}function h(b){return b===null?n(b):b===93?(e.consume(b),g):ce(b)?(a=h,U(b)):(e.consume(b),h)}function g(b){return b===93?(e.consume(b),y):h(b)}function y(b){return b===62?B(b):b===93?(e.consume(b),y):h(b)}function v(b){return b===null||b===62?B(b):ce(b)?(a=v,U(b)):(e.consume(b),v)}function w(b){return b===null?n(b):b===63?(e.consume(b),A):ce(b)?(a=w,U(b)):(e.consume(b),w)}function A(b){return b===62?B(b):w(b)}function k(b){return qe(b)?(e.consume(b),C):n(b)}function C(b){return b===45||We(b)?(e.consume(b),C):T(b)}function T(b){return ce(b)?(a=T,U(b)):ye(b)?(e.consume(b),T):B(b)}function P(b){return b===45||We(b)?(e.consume(b),P):b===47||b===62||Ie(b)?F(b):n(b)}function F(b){return b===47?(e.consume(b),B):b===58||b===95||qe(b)?(e.consume(b),I):ce(b)?(a=F,U(b)):ye(b)?(e.consume(b),F):B(b)}function I(b){return b===45||b===46||b===58||b===95||We(b)?(e.consume(b),I):O(b)}function O(b){return b===61?(e.consume(b),j):ce(b)?(a=O,U(b)):ye(b)?(e.consume(b),O):F(b)}function j(b){return b===null||b===60||b===61||b===62||b===96?n(b):b===34||b===39?(e.consume(b),i=b,z):ce(b)?(a=j,U(b)):ye(b)?(e.consume(b),j):(e.consume(b),M)}function z(b){return b===i?(e.consume(b),i=void 0,D):b===null?n(b):ce(b)?(a=z,U(b)):(e.consume(b),z)}function M(b){return b===null||b===34||b===39||b===60||b===61||b===96?n(b):b===47||b===62||Ie(b)?F(b):(e.consume(b),M)}function D(b){return b===47||b===62||Ie(b)?F(b):n(b)}function B(b){return b===62?(e.consume(b),e.exit("htmlTextData"),e.exit("htmlText"),t):n(b)}function U(b){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),$}function $(b){return ye(b)?be(e,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):V(b)}function V(b){return e.enter("htmlTextData"),a(b)}}const wo={name:"labelEnd",resolveAll:fv,resolveTo:dv,tokenize:pv},lv={tokenize:hv},uv={tokenize:mv},cv={tokenize:gv};function fv(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&&tt(e,0,e.length,n),e}function dv(e,t){let n=e.length,r=0,i,o,a,s;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(a){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"&&(a=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[a][1].end}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[a-2][1].start}};return s=[["enter",l,t],["enter",u,t]],s=it(s,e.slice(o+1,o+r+3)),s=it(s,[["enter",f,t]]),s=it(s,Ir(t.parser.constructs.insideSpan.null,e.slice(o+r+4,a-3),t)),s=it(s,[["exit",f,t],e[a-2],e[a-1],["exit",u,t]]),s=it(s,e.slice(a+1)),s=it(s,[["exit",l,t]]),tt(e,o,e.length,s),e}function pv(e,t,n){const r=this;let i=r.events.length,o,a;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 s;function s(p){return o?o._inactive?c(p):(a=r.parser.defined.includes(ut(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),l):n(p)}function l(p){return p===40?e.attempt(lv,f,a?f:c)(p):p===91?e.attempt(uv,f,a?u:c)(p):a?f(p):c(p)}function u(p){return e.attempt(cv,f,c)(p)}function f(p){return t(p)}function c(p){return o._balanced=!0,n(p)}}function hv(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 Ie(c)?$n(e,o)(c):o(c)}function o(c){return c===41?f(c):cu(e,a,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function a(c){return Ie(c)?$n(e,l)(c):f(c)}function s(c){return n(c)}function l(c){return c===34||c===39||c===40?du(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):f(c)}function u(c){return Ie(c)?$n(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 mv(e,t,n){const r=this;return i;function i(s){return fu.call(r,e,o,a,"reference","referenceMarker","referenceString")(s)}function o(s){return r.parser.defined.includes(ut(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(s):n(s)}function a(s){return n(s)}}function gv(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 yv={name:"labelStartImage",resolveAll:wo.resolveAll,tokenize:vv};function vv(e,t,n){const r=this;return i;function i(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),o}function o(s){return s===91?(e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),a):n(s)}function a(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const bv={name:"labelStartLink",resolveAll:wo.resolveAll,tokenize:wv};function wv(e,t,n){const r=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),o}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const xo={name:"lineEnding",tokenize:xv};function xv(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),be(e,t,"linePrefix")}}const Tr={name:"thematicBreak",tokenize:kv};function kv(e,t,n){let r=0,i;return o;function o(u){return e.enter("thematicBreak"),a(u)}function a(u){return i=u,s(u)}function s(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"),ye(u)?be(e,s,"whitespace")(u):s(u))}}const Je={continuation:{tokenize:Av},exit:Tv,name:"list",tokenize:Cv},Sv={partial:!0,tokenize:Ov},Ev={partial:!0,tokenize:Iv};function Cv(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,a=0;return s;function s(d){const m=r.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||d===r.containerState.marker:yo(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(Tr,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 yo(d)&&++a<10?(e.consume(d),l):(!r.interrupt||a<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(Bn,r.interrupt?n:f,e.attempt(Sv,p,c))}function f(d){return r.containerState.initialBlankLine=!0,o++,p(d)}function c(d){return ye(d)?(e.enter("listItemPrefixWhitespace"),e.consume(d),e.exit("listItemPrefixWhitespace"),p):n(d)}function p(d){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(d)}}function Av(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Bn,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,be(e,t,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!ye(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Ev,t,a)(s))}function a(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,be(e,e.attempt(Je,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function Iv(e,t,n){const r=this;return be(e,i,"listItemIndent",r.containerState.size+1);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(o):n(o)}}function Tv(e){e.exit(this.containerState.type)}function Ov(e,t,n){const r=this;return be(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const a=r.events[r.events.length-1];return!ye(o)&&a&&a[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const hu={name:"setextUnderline",resolveTo:Dv,tokenize:Mv};function Dv(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 a={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",a,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function Mv(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,a(u)):n(u)}function a(u){return e.enter("setextHeadingLineSequence"),s(u)}function s(u){return u===i?(e.consume(u),s):(e.exit("setextHeadingLineSequence"),ye(u)?be(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||ce(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const _v={tokenize:Pv};function Pv(e){const t=this,n=e.attempt(Bn,r,e.attempt(this.parser.constructs.flowInitial,i,be(e,e.attempt(this.parser.constructs.flow,i,e.attempt(By,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 Nv={resolveAll:gu()},Lv=mu("string"),Fv=mu("text");function mu(e){return{resolveAll:gu(e==="text"?Rv:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,a,s);return a;function a(f){return u(f)?o(f):s(f)}function s(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 p=-1;if(c)for(;++p<c.length;){const d=c[p];if(!d.previous||d.previous.call(r,r.previous))return!0}return!1}}}function gu(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 Rv(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,a=-1,s=0,l;for(;o--;){const u=i[o];if(typeof u=="string"){for(a=u.length;u.charCodeAt(a-1)===32;)s++,a--;if(a)break;a=-1}else if(u===-2)l=!0,s++;else if(u!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){const u={type:n===e.length||l||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?a:r.start._bufferIndex+a,_index:r.start._index+o,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},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 Bv=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:Hy},disable:{null:[]},document:{42:Je,43:Je,45:Je,48:Je,49:Je,50:Je,51:Je,52:Je,53:Je,54:Je,55:Je,56:Je,57:Je,62:iu},flow:{35:Gy,42:Tr,45:[hu,Tr],60:Xy,61:hu,95:Tr,96:lu,126:lu},flowInitial:{[-2]:bo,[-1]:bo,32:bo},insideSpan:{null:[vo,Nv]},string:{38:au,92:ou},text:{[-5]:xo,[-4]:xo,[-3]:xo,33:yv,38:au,42:vo,60:[by,av],91:bv,92:[Ky,ou],93:wo,95:vo,96:_y}},Symbol.toStringTag,{value:"Module"}));function zv(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 a=[],s=[];const l={attempt:T(k),check:T(C),consume:v,enter:w,exit:A,interrupt:T(C,{interrupt:!0})},u={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:p,sliceStream:d,write:c};let f=t.tokenize.call(u,l);return t.resolveAll&&o.push(t),u;function c(O){return a=it(a,O),g(),a[a.length-1]!==null?[]:(P(t,0),u.events=Ir(o,u.events,u),u.events)}function p(O,j){return jv(d(O),j)}function d(O){return $v(a,O)}function m(){const{_bufferIndex:O,_index:j,line:z,column:M,offset:D}=r;return{_bufferIndex:O,_index:j,line:z,column:M,offset:D}}function h(O){i[O.line]=O.column,I()}function g(){let O;for(;r._index<a.length;){const j=a[r._index];if(typeof j=="string")for(O=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===O&&r._bufferIndex<j.length;)y(j.charCodeAt(r._bufferIndex));else y(j)}}function y(O){f=f(O)}function v(O){ce(O)?(r.line++,r.column=1,r.offset+=O===-3?2:1,I()):O!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=O}function w(O,j){const z=j||{};return z.type=O,z.start=m(),u.events.push(["enter",z,u]),s.push(z),z}function A(O){const j=s.pop();return j.end=m(),u.events.push(["exit",j,u]),j}function k(O,j){P(O,j.from)}function C(O,j){j.restore()}function T(O,j){return z;function z(M,D,B){let U,$,V,b;return Array.isArray(M)?H(M):"tokenize"in M?H([M]):N(M);function N(Y){return J;function J(X){const ie=X!==null&&Y[X],K=X!==null&&Y.null,te=[...Array.isArray(ie)?ie:ie?[ie]:[],...Array.isArray(K)?K:K?[K]:[]];return H(te)(X)}}function H(Y){return U=Y,$=0,Y.length===0?B:x(Y[$])}function x(Y){return J;function J(X){return b=F(),V=Y,Y.partial||(u.currentConstruct=Y),Y.name&&u.parser.constructs.disable.null.includes(Y.name)?ee():Y.tokenize.call(j?Object.assign(Object.create(u),j):u,l,W,ee)(X)}}function W(Y){return O(V,b),D}function ee(Y){return b.restore(),++$<U.length?x(U[$]):B}}}function P(O,j){O.resolveAll&&!o.includes(O)&&o.push(O),O.resolve&&tt(u.events,j,u.events.length-j,O.resolve(u.events.slice(j),u)),O.resolveTo&&(u.events=O.resolveTo(u.events,u))}function F(){const O=m(),j=u.previous,z=u.currentConstruct,M=u.events.length,D=Array.from(s);return{from:M,restore:B};function B(){r=O,u.previous=j,u.currentConstruct=z,u.events.length=M,s=D,I()}}function I(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function $v(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,o)];else{if(a=e.slice(n,i),r>-1){const s=a[0];typeof s=="string"?a[0]=s.slice(r):a.shift()}o>0&&a.push(e[i].slice(0,o))}return a}function jv(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let a;if(typeof o=="string")a=o;else switch(o){case-5:{a="\r";break}case-4:{a=`
17
+ */var Ls;function Xh(){return Ls||(Ls=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 h=m();if(!c){var g=m();o(h,g)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}g=a({inst:{value:h,getSnapshot:m}});var y=g[0].inst,v=g[1];return l(function(){y.value=h,y.getSnapshot=m,n(y)&&v({inst:y})},[d,h,m]),s(function(){return n(y)&&v({inst:y}),d(function(){n(y)&&v({inst:y})})},[d]),u(h),h}function n(d){var m=d.getSnapshot;d=d.value;try{var h=m();return!o(d,h)}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=N,o=typeof Object.is=="function"?Object.is:e,a=i.useState,s=i.useEffect,l=i.useLayoutEffect,u=i.useDebugValue,f=!1,c=!1,p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;ji.useSyncExternalStore=i.useSyncExternalStore!==void 0?i.useSyncExternalStore:p,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),ji}process.env.NODE_ENV==="production"?zi.exports=Zh():zi.exports=Xh();var em=zi.exports;function tm(){return em.useSyncExternalStore(nm,()=>!0,()=>!1)}function nm(){return()=>{}}var Ui="Avatar",[rm]=jh(Ui),[im,Fs]=rm(Ui),Hi=E.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,o]=E.useState("idle");return S.jsx(im,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:o,children:S.jsx(Bi.span,{...r,ref:t})})});Hi.displayName=Ui;var Rs="AvatarImage",Wi=E.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...o}=e,a=Fs(Rs,n),s=om(r,o),l=Zt(u=>{i(u),a.onImageLoadingStatusChange(u)});return Tt(()=>{s!=="idle"&&l(s)},[s,l]),s==="loaded"?S.jsx(Bi.img,{...o,ref:t,src:r}):null});Wi.displayName=Rs;var Bs="AvatarFallback",Vi=E.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,o=Fs(Bs,n),[a,s]=E.useState(r===void 0);return E.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>s(!0),r);return()=>window.clearTimeout(l)}},[r]),a&&o.imageLoadingStatus!=="loaded"?S.jsx(Bi.span,{...i,ref:t}):null});Vi.displayName=Bs;function zs(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function om(e,{referrerPolicy:t,crossOrigin:n}){const r=tm(),i=E.useRef(null),o=r?(i.current||(i.current=new window.Image),i.current):null,[a,s]=E.useState(()=>zs(o,e));return Tt(()=>{s(zs(o,e))},[o,e]),Tt(()=>{const l=c=>()=>{s(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]),a}function $s(e,t){let n=`${e} {`;for(const[r,i]of Object.entries(t))n+=`${r}: ${i}; `;return n+="}",n}function js(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 am=(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",a=>{i&&clearTimeout(i),r(`${a.type}: ${a.message}`)}),o.src=e,t.timeout&&(i=setTimeout(()=>r("Timeout"),t.timeout))});var Us={exports:{}};(function(e,t){(function(n,r){e.exports=r()})($t,function(){var n=1e3,r=6e4,i=36e5,o="millisecond",a="second",s="minute",l="hour",u="day",f="week",c="month",p="quarter",d="year",m="date",h="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(M){var D=["th","st","nd","rd"],B=M%100;return"["+M+(D[(B-20)%10]||D[B]||D[0])+"]"}},w=function(M,D,B){var U=String(M);return!U||U.length>=D?M:""+Array(D+1-U.length).join(B)+M},A={s:w,z:function(M){var D=-M.utcOffset(),B=Math.abs(D),U=Math.floor(B/60),$=B%60;return(D<=0?"+":"-")+w(U,2,"0")+":"+w($,2,"0")},m:function M(D,B){if(D.date()<B.date())return-M(B,D);var U=12*(B.year()-D.year())+(B.month()-D.month()),$=D.clone().add(U,c),W=B-$<0,b=D.clone().add(U+(W?-1:1),c);return+(-(U+(B-$)/(W?$-b:b-$))||0)},a:function(M){return M<0?Math.ceil(M)||0:Math.floor(M)},p:function(M){return{M:c,y:d,w:f,d:u,D:m,h:l,m:s,s:a,ms:o,Q:p}[M]||String(M||"").toLowerCase().replace(/s$/,"")},u:function(M){return M===void 0}},k="en",C={};C[k]=v;var T="$isDayjsObject",_=function(M){return M instanceof j||!(!M||!M[T])},F=function M(D,B,U){var $;if(!D)return k;if(typeof D=="string"){var W=D.toLowerCase();C[W]&&($=W),B&&(C[W]=B,$=W);var b=D.split("-");if(!$&&b.length>1)return M(b[0])}else{var P=D.name;C[P]=D,$=P}return!U&&$&&(k=$),$||!U&&k},I=function(M,D){if(_(M))return M.clone();var B=typeof D=="object"?D:{};return B.date=M,B.args=arguments,new j(B)},O=A;O.l=F,O.i=_,O.w=function(M,D){return I(M,{locale:D.$L,utc:D.$u,x:D.$x,$offset:D.$offset})};var j=function(){function M(B){this.$L=F(B.locale,null,!0),this.parse(B),this.$x=this.$x||B.x||{},this[T]=!0}var D=M.prototype;return D.parse=function(B){this.$d=function(U){var $=U.date,W=U.utc;if($===null)return new Date(NaN);if(O.u($))return new Date;if($ instanceof Date)return new Date($);if(typeof $=="string"&&!/Z$/i.test($)){var b=$.match(g);if(b){var P=b[2]-1||0,H=(b[7]||"0").substring(0,3);return W?new Date(Date.UTC(b[1],P,b[3]||1,b[4]||0,b[5]||0,b[6]||0,H)):new Date(b[1],P,b[3]||1,b[4]||0,b[5]||0,b[6]||0,H)}}return new Date($)}(B),this.init()},D.init=function(){var B=this.$d;this.$y=B.getFullYear(),this.$M=B.getMonth(),this.$D=B.getDate(),this.$W=B.getDay(),this.$H=B.getHours(),this.$m=B.getMinutes(),this.$s=B.getSeconds(),this.$ms=B.getMilliseconds()},D.$utils=function(){return O},D.isValid=function(){return this.$d.toString()!==h},D.isSame=function(B,U){var $=I(B);return this.startOf(U)<=$&&$<=this.endOf(U)},D.isAfter=function(B,U){return I(B)<this.startOf(U)},D.isBefore=function(B,U){return this.endOf(U)<I(B)},D.$g=function(B,U,$){return O.u(B)?this[U]:this.set($,B)},D.unix=function(){return Math.floor(this.valueOf()/1e3)},D.valueOf=function(){return this.$d.getTime()},D.startOf=function(B,U){var $=this,W=!!O.u(U)||U,b=O.p(B),P=function(re,K){var te=O.w($.$u?Date.UTC($.$y,K,re):new Date($.$y,K,re),$);return W?te:te.endOf(u)},H=function(re,K){return O.w($.toDate()[re].apply($.toDate("s"),(W?[0,0,0,0]:[23,59,59,999]).slice(K)),$)},x=this.$W,V=this.$M,ee=this.$D,Y="set"+(this.$u?"UTC":"");switch(b){case d:return W?P(1,0):P(31,11);case c:return W?P(1,V):P(0,V+1);case f:var J=this.$locale().weekStart||0,X=(x<J?x+7:x)-J;return P(W?ee-X:ee+(6-X),V);case u:case m:return H(Y+"Hours",0);case l:return H(Y+"Minutes",1);case s:return H(Y+"Seconds",2);case a:return H(Y+"Milliseconds",3);default:return this.clone()}},D.endOf=function(B){return this.startOf(B,!1)},D.$set=function(B,U){var $,W=O.p(B),b="set"+(this.$u?"UTC":""),P=($={},$[u]=b+"Date",$[m]=b+"Date",$[c]=b+"Month",$[d]=b+"FullYear",$[l]=b+"Hours",$[s]=b+"Minutes",$[a]=b+"Seconds",$[o]=b+"Milliseconds",$)[W],H=W===u?this.$D+(U-this.$W):U;if(W===c||W===d){var x=this.clone().set(m,1);x.$d[P](H),x.init(),this.$d=x.set(m,Math.min(this.$D,x.daysInMonth())).$d}else P&&this.$d[P](H);return this.init(),this},D.set=function(B,U){return this.clone().$set(B,U)},D.get=function(B){return this[O.p(B)]()},D.add=function(B,U){var $,W=this;B=Number(B);var b=O.p(U),P=function(V){var ee=I(W);return O.w(ee.date(ee.date()+Math.round(V*B)),W)};if(b===c)return this.set(c,this.$M+B);if(b===d)return this.set(d,this.$y+B);if(b===u)return P(1);if(b===f)return P(7);var H=($={},$[s]=r,$[l]=i,$[a]=n,$)[b]||1,x=this.$d.getTime()+B*H;return O.w(x,this)},D.subtract=function(B,U){return this.add(-1*B,U)},D.format=function(B){var U=this,$=this.$locale();if(!this.isValid())return $.invalidDate||h;var W=B||"YYYY-MM-DDTHH:mm:ssZ",b=O.z(this),P=this.$H,H=this.$m,x=this.$M,V=$.weekdays,ee=$.months,Y=$.meridiem,J=function(K,te,L,ne){return K&&(K[te]||K(U,W))||L[te].slice(0,ne)},X=function(K){return O.s(P%12||12,K,"0")},re=Y||function(K,te,L){var ne=K<12?"AM":"PM";return L?ne.toLowerCase():ne};return W.replace(y,function(K,te){return te||function(L){switch(L){case"YY":return String(U.$y).slice(-2);case"YYYY":return O.s(U.$y,4,"0");case"M":return x+1;case"MM":return O.s(x+1,2,"0");case"MMM":return J($.monthsShort,x,ee,3);case"MMMM":return J(ee,x);case"D":return U.$D;case"DD":return O.s(U.$D,2,"0");case"d":return String(U.$W);case"dd":return J($.weekdaysMin,U.$W,V,2);case"ddd":return J($.weekdaysShort,U.$W,V,3);case"dddd":return V[U.$W];case"H":return String(P);case"HH":return O.s(P,2,"0");case"h":return X(1);case"hh":return X(2);case"a":return re(P,H,!0);case"A":return re(P,H,!1);case"m":return String(H);case"mm":return O.s(H,2,"0");case"s":return String(U.$s);case"ss":return O.s(U.$s,2,"0");case"SSS":return O.s(U.$ms,3,"0");case"Z":return b}return null}(K)||b.replace(":","")})},D.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},D.diff=function(B,U,$){var W,b=this,P=O.p(U),H=I(B),x=(H.utcOffset()-this.utcOffset())*r,V=this-H,ee=function(){return O.m(b,H)};switch(P){case d:W=ee()/12;break;case c:W=ee();break;case p:W=ee()/3;break;case f:W=(V-x)/6048e5;break;case u:W=(V-x)/864e5;break;case l:W=V/i;break;case s:W=V/r;break;case a:W=V/n;break;default:W=V}return $?W:O.a(W)},D.daysInMonth=function(){return this.endOf(c).$D},D.$locale=function(){return C[this.$L]},D.locale=function(B,U){if(!B)return this.$L;var $=this.clone(),W=F(B,U,!0);return W&&($.$L=W),$},D.clone=function(){return O.w(this.$d,this)},D.toDate=function(){return new Date(this.valueOf())},D.toJSON=function(){return this.isValid()?this.toISOString():null},D.toISOString=function(){return this.$d.toISOString()},D.toString=function(){return this.$d.toUTCString()},M}(),z=j.prototype;return I.prototype=z,[["$ms",o],["$s",a],["$m",s],["$H",l],["$W",u],["$M",c],["$y",d],["$D",m]].forEach(function(M){z[M[1]]=function(D){return this.$g(D,M[0],M[1])}}),I.extend=function(M,D){return M.$i||(M(D,j,I),M.$i=!0),I},I.locale=F,I.isDayjs=_,I.unix=function(M){return I(1e3*M)},I.en=C[k],I.Ls=C,I.p={},I})})(Us);var sm=Us.exports;const vr=jt(sm);var Hs={exports:{}};(function(e,t){(function(n,r){e.exports=r()})($t,function(){return function(n,r,i){r.prototype.isToday=function(){var o="YYYY-MM-DD",a=i();return this.format(o)===a.format(o)}}})})(Hs);var lm=Hs.exports;const um=jt(lm);var Ws={exports:{}};(function(e,t){(function(n,r){e.exports=r()})($t,function(){return function(n,r,i){r.prototype.isYesterday=function(){var o="YYYY-MM-DD",a=i().subtract(1,"day");return this.format(o)===a.format(o)}}})})(Ws);var cm=Ws.exports;const fm=jt(cm);vr.extend(um),vr.extend(fm);function Vs(e,t,n,r,i){return e.map(o=>{const{authorId:a}=o,s=a===n?"outgoing":"incoming",l=t.find(f=>f.id===a);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:s,sender:u}})}function dm(e,t="day"){var r,i,o;if(!e||e.length===0)return[];const n=[];(r=e[0])!=null&&r.timestamp&&n.push(qs(e[0].timestamp));for(let a=0;a<e.length;a++)if(e[a]&&n.push(e[a]),a+1<e.length){const s=(i=e[a])==null?void 0:i.timestamp,l=(o=e[a+1])==null?void 0:o.timestamp;!vr(s).isSame(l,t)&&l&&n.push(qs(l))}return n}function qs(e){return{id:Ks(e),direction:"system",sender:{name:"system"},timestamp:e,block:{type:"text",text:Ks(e)}}}function Ks(e,t=!1){const n=vr(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 pm(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 hm(e){return"#"+e.map(t=>`0${t.toString(16).toUpperCase()}`.slice(-2)).join("")}function mm(e,t){return e.map(n=>Math.round(n+(255-n)*t))}function gm(e,t){return e.map(n=>Math.round(n*t))}const Tn=e=>t=>mm(t,e),On=e=>t=>gm(t,e),ym={50:Tn(.95),100:Tn(.9),200:Tn(.75),300:Tn(.6),400:Tn(.3),500:e=>e,600:On(.9),700:On(.6),800:On(.45),900:On(.3),950:On(.2)};function Ys(e,t=ym){const n={},r=pm(e);for(const[i,o]of Object.entries(t))n[i]=hm(o(r));return n}const Gs=()=>{const e={};return{on:(i,o)=>{var a;return e[i]||(e[i]=new Set),(a=e[i])==null||a.add(o),()=>{var s;return(s=e[i])==null?void 0:s.delete(o)}},emit:(i,o)=>{var a,s;(a=e[i])==null||a.forEach(l=>l(o)),(s=e["*"])==null||s.forEach(l=>l({type:i,payload:o}))},removeAllListeners:i=>{var o;i?(o=e[i])==null||o.clear():Object.keys(e).forEach(a=>{var s;(s=e[a])==null||s.clear()})}}};function qi(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,a=i>>8&255,s=i&255;return{r:o,g:a,b:s}}function vm(e){return`#${((1<<24)+(e.r<<16)+(e.g<<8)+e.b).toString(16).slice(1)}`}const bm=(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 Qs(e){return Object.entries(e).reduce((t,[n,r])=>{const i=n.replace(/(\d+)/,o=>(1e3-parseInt(o)).toString());return{...t,[i]:r}},{})}const wm=2.4,xm=.2126729,km=.7151522,Sm=.072175,Em=.56,Cm=.57,Am=.62,Im=.65,br=.022,Js=1.414,Tm=1.14,Om=1.14,Dm=.035991,Mm=27.7847239587675,_m=27.7847239587675,Zs=.027,Xs=.027,el=.001,Pm=5e-4;function tl(e){const{r:t,g:n,b:r}=e,i=o=>(o/255)**wm;return xm*i(t)+km*i(n)+Sm*i(r)}function nl(e,t){if(!e||!t)return 0;let n=tl(qi(e)),r=tl(qi(t)),i=0,o=0;return n=n>br?n:n+(br-n)**Js,r=r>br?r:r+(br-r)**Js,Math.abs(r-n)<Pm?0:(r>n?(i=(r**Em-n**Cm)*Tm,o=i<el?0:i<Dm?i-i*Mm*Zs:i-Zs):(i=(r**Im-n**Am)*Om,o=i>-el?0:i>-.035991?i-i*_m*Xs:i+Xs),Math.abs(o*100))}const Nm=(e,t,n)=>{const r=e;let i=0;for(;t.some(o=>n(o)===e);)i+=1,e=`${r} (${i})`;return e};function rl(e){const{fontFamily:t,...n}=e,r=il(n);return $s(".bpReset",{...r,"font-family":`'${t}', sans-serif`})+$s(":host, :root",{...r})}function il(e){const{radius:t,themeMode:n,color:r,variant:i,headerVariant:o}=e;let a={},s={};if(r){const p=Ys(r),d=n==="dark"?Qs(p):p,m=Ys(vm(bm(qi(r)))),h=n==="dark"?Qs(m):m,g=n==="dark"?"#101010":"#fdfdfd";s=Object.entries({...d,1:g}).reduce((v,[w,A])=>({...v,[`--bpPrimary-${w}`]:A}),{});const y=Object.entries({...h,1:g}).reduce((v,[w,A])=>({...v,[`--bpGray-${w}`]:A}),{});a={...s,...y}}t&&(a={...a,"--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=s?nl(s["--bpPrimary-600"],s["--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":s?nl(s["--bpPrimary-500"],s["--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{...a,...f,...c}}const Lm=e=>{if(typeof URL.canParse=="function")return URL.canParse(e);try{return new URL(e),!0}catch{return!1}},ol=["audio","file","image","video"],al=e=>ol.includes(e),sl="The Client ID is required to initialize the webchat.",Fm="The API url is required to initialize the webchat.",Rm="The Bot ID is required to initialize the webchat.",Bm="No config URL provided.",ll=`Invalid API URL.
18
+ Please use a valid API URL.`,ul=`Invalid Client ID.
19
+ Please use a valid Botpress Client ID.`,cl=`Invalid URL.
20
+ Please make sure your client ID and API URL are valid`,zm=`Invalid config URL.
21
+ Please make sure your config URL is valid`,$m=`Invalid webchat configuration.
22
+ Please make sure your config file is valid`,jm="Access denied to configuration file. Please check your credentials or your configuration URL and try again.",fl=`This bot has temporarily paused.
23
+ Please check back later.`,dl=`This bot has temporarily paused.
24
+ Please check back later.`,Ki="Something went wrong. To fix it, please clear your browser's local and session storage and then refresh the page",Dn="Please check your internet connection and refresh the page.",pl=`You've been disconnected from the conversation.
25
+ Please refresh the page.`,hl=`Unable to process the message.
26
+ Please start a new conversation.`,Yi={ResourceNotFound:{type:"configuration",message:ul},Forbidden:{type:"bot",message:fl}},Gi={MethodNotFound:{type:"configuration",message:cl},QuotaExceeded:{type:"bot",message:dl},Forbidden:{type:"bot",message:Ki}};function ml(e){return e in Yi}function gl(e){return e in Gi}function yl(e){return e!==null&&typeof e=="object"&&"id"in e&&"code"in e&&"type"in e}function vl(e){return e!==null&&typeof e=="object"&&"type"in e&&e.type==="error"&&"message"in e&&typeof e.message=="string"}const bl=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 a=n*Math.pow(2,i-1);await new Promise(s=>setTimeout(s,a))}throw new Error("Unreachable: retry loop should always return or throw")},Um=["networkerror","failedtofetch","errorininputstream"],wr=e=>{var n;console.error("An error occurred:",e);let t={type:"unknown",message:"An unexpected error occurred"};if(yl(e))e.type==="network"?t={id:e.id,type:"network",message:Dn}:(n=e.message)!=null&&n.includes("[Webhook Handler]")&&ml(e.type)?t={id:e.id,...Yi[e.type]}:gl(e.type)?t={id:e.id,...Gi[e.type]}:t={id:e.id,type:e.type,message:e.message||"An error occurred"};else if(vl(e))wl(e.message)?t={type:"disconnected",message:pl}:xl(e.message).includes("invalidcontenttype")?t={type:"bot",message:hl}:t={type:"event",message:e.message};else if(e instanceof Error&&wl(e.message))t={type:"network",message:Dn};else if(e&&typeof e=="object"&&"type"in e&&"message"in e){const r=e;r.type==="network"?t={type:"network",message:Dn}:t={type:r.type,message:r.message}}return t};function wl(e){return Um.some(t=>xl(e).includes(t))}function xl(e){return e.replaceAll(" ","").toLowerCase()}const Mn=N.forwardRef(({userId:e,src:t,container:n,image:r,fallback:i,...o},a)=>{const s=js(e??"",15);return S.jsxs(Hi,{ref:a,"data-color":s,...n,...o,children:[S.jsx(Wi,{src:t,...r}),S.jsx(Vi,{...i,children:typeof o.children=="string"?o.children[0]:o.children})]})});Mn.displayName="Avatar";function _T(){}function PT(){}function Hm(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Wm=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Vm=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,qm={};function kl(e,t){return(qm.jsx?Vm:Wm).test(e)}const Km=/[ \t\n\f\r]/g;function Ym(e){return typeof e=="object"?e.type==="text"?Sl(e.value):!1:Sl(e)}function Sl(e){return e.replace(Km,"")===""}class _n{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}_n.prototype.normal={},_n.prototype.property={},_n.prototype.space=void 0;function El(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new _n(n,r,t)}function Qi(e){return e.toLowerCase()}class Je{constructor(t,n){this.attribute=n,this.property=t}}Je.prototype.attribute="",Je.prototype.booleanish=!1,Je.prototype.boolean=!1,Je.prototype.commaOrSpaceSeparated=!1,Je.prototype.commaSeparated=!1,Je.prototype.defined=!1,Je.prototype.mustUseProperty=!1,Je.prototype.number=!1,Je.prototype.overloadedBoolean=!1,Je.prototype.property="",Je.prototype.spaceSeparated=!1,Je.prototype.space=void 0;let Gm=0;const he=Ut(),Fe=Ut(),Ji=Ut(),Q=Ut(),Oe=Ut(),Xt=Ut(),tt=Ut();function Ut(){return 2**++Gm}const Zi=Object.freeze(Object.defineProperty({__proto__:null,boolean:he,booleanish:Fe,commaOrSpaceSeparated:tt,commaSeparated:Xt,number:Q,overloadedBoolean:Ji,spaceSeparated:Oe},Symbol.toStringTag,{value:"Module"})),Xi=Object.keys(Zi);class eo extends Je{constructor(t,n,r,i){let o=-1;if(super(t,n),Cl(this,"space",i),typeof r=="number")for(;++o<Xi.length;){const a=Xi[o];Cl(this,Xi[o],(r&Zi[a])===Zi[a])}}}eo.prototype.defined=!0;function Cl(e,t,n){n&&(e[t]=n)}function en(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new eo(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Qi(r)]=r,n[Qi(o.attribute)]=r}return new _n(t,n,e.space)}const Al=en({properties:{ariaActiveDescendant:null,ariaAtomic:Fe,ariaAutoComplete:null,ariaBusy:Fe,ariaChecked:Fe,ariaColCount:Q,ariaColIndex:Q,ariaColSpan:Q,ariaControls:Oe,ariaCurrent:null,ariaDescribedBy:Oe,ariaDetails:null,ariaDisabled:Fe,ariaDropEffect:Oe,ariaErrorMessage:null,ariaExpanded:Fe,ariaFlowTo:Oe,ariaGrabbed:Fe,ariaHasPopup:null,ariaHidden:Fe,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Oe,ariaLevel:Q,ariaLive:null,ariaModal:Fe,ariaMultiLine:Fe,ariaMultiSelectable:Fe,ariaOrientation:null,ariaOwns:Oe,ariaPlaceholder:null,ariaPosInSet:Q,ariaPressed:Fe,ariaReadOnly:Fe,ariaRelevant:null,ariaRequired:Fe,ariaRoleDescription:Oe,ariaRowCount:Q,ariaRowIndex:Q,ariaRowSpan:Q,ariaSelected:Fe,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 Il(e,t){return t in e?e[t]:t}function Tl(e,t){return Il(e,t.toLowerCase())}const Qm=en({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Xt,acceptCharset:Oe,accessKey:Oe,action:null,allow:null,allowFullScreen:he,allowPaymentRequest:he,allowUserMedia:he,alt:null,as:null,async:he,autoCapitalize:null,autoComplete:Oe,autoFocus:he,autoPlay:he,blocking:Oe,capture:null,charSet:null,checked:he,cite:null,className:Oe,cols:Q,colSpan:null,content:null,contentEditable:Fe,controls:he,controlsList:Oe,coords:Q|Xt,crossOrigin:null,data:null,dateTime:null,decoding:null,default:he,defer:he,dir:null,dirName:null,disabled:he,download:Ji,draggable:Fe,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:he,formTarget:null,headers:Oe,height:Q,hidden:Ji,high:Q,href:null,hrefLang:null,htmlFor:Oe,httpEquiv:Oe,id:null,imageSizes:null,imageSrcSet:null,inert:he,inputMode:null,integrity:null,is:null,isMap:he,itemId:null,itemProp:Oe,itemRef:Oe,itemScope:he,itemType:Oe,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:he,low:Q,manifest:null,max:null,maxLength:Q,media:null,method:null,min:null,minLength:Q,multiple:he,muted:he,name:null,nonce:null,noModule:he,noValidate:he,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:he,optimum:Q,pattern:null,ping:Oe,placeholder:null,playsInline:he,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:he,referrerPolicy:null,rel:Oe,required:he,reversed:he,rows:Q,rowSpan:Q,sandbox:Oe,scope:null,scoped:he,seamless:he,selected:he,shadowRootClonable:he,shadowRootDelegatesFocus:he,shadowRootMode:null,shape:null,size:Q,sizes:null,slot:null,span:Q,spellCheck:Fe,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:he,useMap:null,value:Fe,width:Q,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Oe,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:he,declare:he,event:null,face:null,frame:null,frameBorder:null,hSpace:Q,leftMargin:Q,link:null,longDesc:null,lowSrc:null,marginHeight:Q,marginWidth:Q,noResize:he,noHref:he,noShade:he,noWrap:he,object:null,profile:null,prompt:null,rev:null,rightMargin:Q,rules:null,scheme:null,scrolling:Fe,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:he,disableRemotePlayback:he,prefix:null,property:null,results:Q,security:null,unselectable:null},space:"html",transform:Tl}),Jm=en({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:tt,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:Oe,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:he,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:Xt,g2:Xt,glyphName:Xt,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:tt,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:Oe,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Q,pointsAtY:Q,pointsAtZ:Q,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:tt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:tt,rev:tt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:tt,requiredFeatures:tt,requiredFonts:tt,requiredFormats:tt,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:tt,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:tt,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:tt,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:Il}),Ol=en({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()}}),Dl=en({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Tl}),Ml=en({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Zm={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"},Xm=/[A-Z]/g,_l=/-[a-z]/g,eg=/^data[-\w.:]+$/i;function tg(e,t){const n=Qi(t);let r=t,i=Je;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&eg.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(_l,rg);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!_l.test(o)){let a=o.replace(Xm,ng);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=eo}return new i(r,t)}function ng(e){return"-"+e.toLowerCase()}function rg(e){return e.charAt(1).toUpperCase()}const ig=El([Al,Qm,Ol,Dl,Ml],"html"),to=El([Al,Jm,Ol,Dl,Ml],"svg");function og(e){return e.join(" ").trim()}var no={},Pl=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,ag=/\n/g,sg=/^\s*/,lg=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,ug=/^:\s*/,cg=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,fg=/^[;\s]*/,dg=/^\s+|\s+$/g,pg=`
27
+ `,Nl="/",Ll="*",Ht="",hg="comment",mg="declaration";function gg(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 h=m.match(ag);h&&(n+=h.length);var g=m.lastIndexOf(pg);r=~g?m.length-g:r+m.length}function o(){var m={line:n,column:r};return function(h){return h.position=new a(m),u(),h}}function a(m){this.start=m,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function s(m){var h=new Error(t.source+":"+n+":"+r+": "+m);if(h.reason=m,h.filename=t.source,h.line=n,h.column=r,h.source=e,!t.silent)throw h}function l(m){var h=m.exec(e);if(h){var g=h[0];return i(g),e=e.slice(g.length),h}}function u(){l(sg)}function f(m){var h;for(m=m||[];h=c();)h!==!1&&m.push(h);return m}function c(){var m=o();if(!(Nl!=e.charAt(0)||Ll!=e.charAt(1))){for(var h=2;Ht!=e.charAt(h)&&(Ll!=e.charAt(h)||Nl!=e.charAt(h+1));)++h;if(h+=2,Ht===e.charAt(h-1))return s("End of comment missing");var g=e.slice(2,h-2);return r+=2,i(g),e=e.slice(h),r+=2,m({type:hg,comment:g})}}function p(){var m=o(),h=l(lg);if(h){if(c(),!l(ug))return s("property missing ':'");var g=l(cg),y=m({type:mg,property:Fl(h[0].replace(Pl,Ht)),value:g?Fl(g[0].replace(Pl,Ht)):Ht});return l(fg),y}}function d(){var m=[];f(m);for(var h;h=p();)h!==!1&&(m.push(h),f(m));return m}return u(),d()}function Fl(e){return e?e.replace(dg,Ht):Ht}var yg=gg,vg=$t&&$t.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(no,"__esModule",{value:!0}),no.default=wg;const bg=vg(yg);function wg(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,bg.default)(e),i=typeof t=="function";return r.forEach(o=>{if(o.type!=="declaration")return;const{property:a,value:s}=o;i?t(a,s,o):s&&(n=n||{},n[a]=s)}),n}var xr={};Object.defineProperty(xr,"__esModule",{value:!0}),xr.camelCase=void 0;var xg=/^--[a-zA-Z0-9_-]+$/,kg=/-([a-z])/g,Sg=/^[^-]+$/,Eg=/^-(webkit|moz|ms|o|khtml)-/,Cg=/^-(ms)-/,Ag=function(e){return!e||Sg.test(e)||xg.test(e)},Ig=function(e,t){return t.toUpperCase()},Rl=function(e,t){return"".concat(t,"-")},Tg=function(e,t){return t===void 0&&(t={}),Ag(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(Cg,Rl):e=e.replace(Eg,Rl),e.replace(kg,Ig))};xr.camelCase=Tg;var Og=$t&&$t.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Dg=Og(no),Mg=xr;function ro(e,t){var n={};return!e||typeof e!="string"||(0,Dg.default)(e,function(r,i){r&&i&&(n[(0,Mg.camelCase)(r,t)]=i)}),n}ro.default=ro;var _g=ro;const Pg=jt(_g),Bl=zl("end"),io=zl("start");function zl(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 Ng(e){const t=io(e),n=Bl(e);if(t&&n)return{start:t,end:n}}function Pn(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?$l(e.position):"start"in e||"end"in e?$l(e):"line"in e||"column"in e?oo(e):""}function oo(e){return jl(e&&e.line)+":"+jl(e&&e.column)}function $l(e){return oo(e&&e.start)+"-"+oo(e&&e.end)}function jl(e){return e&&typeof e=="number"?e:1}class We extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},a=!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&&(a=!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 s=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=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=Pn(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=a&&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}}We.prototype.file="",We.prototype.name="",We.prototype.reason="",We.prototype.message="",We.prototype.stack="",We.prototype.column=void 0,We.prototype.line=void 0,We.prototype.ancestors=void 0,We.prototype.cause=void 0,We.prototype.fatal=void 0,We.prototype.place=void 0,We.prototype.ruleId=void 0,We.prototype.source=void 0;const ao={}.hasOwnProperty,Lg=new Map,Fg=/[A-Z]/g,Rg=new Set(["table","tbody","thead","tfoot","tr"]),Bg=new Set(["td","th"]),Ul="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function zg(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=Kg(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=qg(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"?to:ig,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=Hl(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function Hl(e,t,n){if(t.type==="element")return $g(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return jg(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Hg(e,t,n);if(t.type==="mdxjsEsm")return Ug(e,t);if(t.type==="root")return Wg(e,t,n);if(t.type==="text")return Vg(e,t)}function $g(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=to,e.schema=i),e.ancestors.push(t);const o=Vl(e,t.tagName,!1),a=Yg(e,t);let s=lo(e,t);return Rg.has(t.tagName)&&(s=s.filter(function(l){return typeof l=="string"?!Ym(l):!0})),Wl(e,a,o,t),so(a,s),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function jg(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)}Nn(e,t.position)}function Ug(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Nn(e,t.position)}function Hg(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=to,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:Vl(e,t.name,!0),a=Gg(e,t),s=lo(e,t);return Wl(e,a,o,t),so(a,s),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function Wg(e,t,n){const r={};return so(r,lo(e,t)),e.create(t,e.Fragment,r,n)}function Vg(e,t){return t.value}function Wl(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function so(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function qg(e,t,n){return r;function r(i,o,a,s){const u=Array.isArray(a.children)?n:t;return s?u(o,a,s):u(o,a)}}function Kg(e,t){return n;function n(r,i,o,a){const s=Array.isArray(o.children),l=io(r);return t(i,o,a,s,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function Yg(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&ao.call(t.properties,i)){const o=Qg(e,i,t.properties[i]);if(o){const[a,s]=o;e.tableCellAlignToStyle&&a==="align"&&typeof s=="string"&&Bg.has(t.tagName)?r=s:n[a]=s}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Gg(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 a=o.expression;a.type;const s=a.properties[0];s.type,Object.assign(n,e.evaluater.evaluateExpression(s.argument))}else Nn(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 s=r.value.data.estree.body[0];s.type,o=e.evaluater.evaluateExpression(s.expression)}else Nn(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function lo(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Lg;for(;++r<t.children.length;){const o=t.children[r];let a;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;a=l+"-"+u,i.set(l,u+1)}}const s=Hl(e,o,a);s!==void 0&&n.push(s)}return n}function Qg(e,t,n){const r=tg(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Hm(n):og(n)),r.property==="style"){let i=typeof n=="object"?n:Jg(e,String(n));return e.stylePropertyNameCase==="css"&&(i=Zg(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Zm[r.property]||r.property:r.attribute,n]}}function Jg(e,t){try{return Pg(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new We("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=Ul+"#cannot-parse-style-attribute",i}}function Vl(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,a;for(;++o<i.length;){const s=kl(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};a=a?{type:"MemberExpression",object:a,property:s,computed:!!(o&&s.type==="Literal"),optional:!1}:s}r=a}else r=kl(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return ao.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Nn(e)}function Nn(e,t){const n=new We("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=Ul+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Zg(e){const t={};let n;for(n in e)ao.call(e,n)&&(t[Xg(n)]=e[n]);return t}function Xg(e){let t=e.replace(Fg,ey);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function ey(e){return"-"+e.toLowerCase()}const uo={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"]},ty={};function co(e,t){const n=ty,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return ql(e,r,i)}function ql(e,t,n){if(ny(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 Kl(e.children,t,n)}return Array.isArray(e)?Kl(e,t,n):""}function Kl(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=ql(e[i],t,n);return r.join("")}function ny(e){return!!(e&&typeof e=="object")}const Yl=document.createElement("i");function fo(e){const t="&"+e+";";Yl.innerHTML=t;const n=Yl.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function nt(e,t,n,r){const i=e.length;let o=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);o<r.length;)a=r.slice(o,o+1e4),a.unshift(t,0),e.splice(...a),o+=1e4,t+=1e4}function ot(e,t){return e.length>0?(nt(e,e.length,0,t),e):t}const Gl={}.hasOwnProperty;function Ql(e){const t={};let n=-1;for(;++n<e.length;)ry(t,e[n]);return t}function ry(e,t){let n;for(n in t){const i=(Gl.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let a;if(o)for(a in o){Gl.call(i,a)||(i[a]=[]);const s=o[a];iy(i[a],Array.isArray(s)?s:s?[s]:[])}}}function iy(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);nt(e,0,0,r)}function Jl(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 ut(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ke=Dt(/[A-Za-z]/),Ve=Dt(/[\dA-Za-z]/),oy=Dt(/[#-'*+\--9=?A-Z^-~]/);function kr(e){return e!==null&&(e<32||e===127)}const po=Dt(/\d/),ay=Dt(/[\dA-Fa-f]/),sy=Dt(/[!-/:-@[-`{-~]/);function ce(e){return e!==null&&e<-2}function Ie(e){return e!==null&&(e<0||e===32)}function ye(e){return e===-2||e===-1||e===32}const Sr=Dt(new RegExp("\\p{P}|\\p{S}","u")),Wt=Dt(/\s/);function Dt(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function tn(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let a="";if(o===37&&Ve(e.charCodeAt(n+1))&&Ve(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(a=String.fromCharCode(o));else if(o>55295&&o<57344){const s=e.charCodeAt(n+1);o<56320&&s>56319&&s<57344?(a=String.fromCharCode(o,s),i=1):a="�"}else a=String.fromCharCode(o);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function be(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(l){return ye(l)?(e.enter(n),s(l)):t(l)}function s(l){return ye(l)&&o++<i?(e.consume(l),s):(e.exit(n),t(l))}}const ly={tokenize:uy};function uy(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),be(e,t,"linePrefix")}function i(s){return e.enter("paragraph"),o(s)}function o(s){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,a(s)}function a(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return ce(s)?(e.consume(s),e.exit("chunkText"),o):(e.consume(s),a)}}const cy={tokenize:fy},Zl={tokenize:dy};function fy(e){const t=this,n=[];let r=0,i,o,a;return s;function s(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&&v();const A=t.events.length;let k=A,C;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){C=t.events[k][1].end;break}y(r);let T=A;for(;T<t.events.length;)t.events[T][1].end={...C},T++;return nt(t.events,k+1,0,t.events.slice(A)),t.events.length=T,u(w)}return s(w)}function u(w){if(r===n.length){if(!i)return p(w);if(i.currentConstruct&&i.currentConstruct.concrete)return m(w);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Zl,f,c)(w)}function f(w){return i&&v(),y(r),p(w)}function c(w){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,m(w)}function p(w){return t.containerState={},e.attempt(Zl,d,m)(w)}function d(w){return r++,n.push([t.currentConstruct,t.containerState]),p(w)}function m(w){if(w===null){i&&v(),y(0),e.consume(w);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),h(w)}function h(w){if(w===null){g(e.exit("chunkFlow"),!0),y(0),e.consume(w);return}return ce(w)?(e.consume(w),g(e.exit("chunkFlow")),r=0,t.interrupt=void 0,s):(e.consume(w),h)}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 C=i.events.length;for(;C--;)if(i.events[C][1].start.offset<a&&(!i.events[C][1].end||i.events[C][1].end.offset>a))return;const T=t.events.length;let _=T,F,I;for(;_--;)if(t.events[_][0]==="exit"&&t.events[_][1].type==="chunkFlow"){if(F){I=t.events[_][1].end;break}F=!0}for(y(r),C=T;C<t.events.length;)t.events[C][1].end={...I},C++;nt(t.events,_+1,0,t.events.slice(T)),t.events.length=C}}function y(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 v(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function dy(e,t,n){return be(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function nn(e){if(e===null||Ie(e)||Wt(e))return 1;if(Sr(e))return 2}function Er(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 ho={name:"attention",resolveAll:py,tokenize:hy};function py(e,t){let n=-1,r,i,o,a,s,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},p={...e[n][1].start};Xl(c,-l),Xl(p,l),a={type:l>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},s={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},o={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...a.start},end:{...s.end}},e[r][1].end={...a.start},e[n][1].start={...s.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=ot(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=ot(u,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",o,t]]),u=ot(u,Er(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=ot(u,[["exit",o,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,u=ot(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,nt(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 hy(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=nn(r);let o;return a;function a(l){return o=l,e.enter("attentionSequence"),s(l)}function s(l){if(l===o)return e.consume(l),s;const u=e.exit("attentionSequence"),f=nn(l),c=!f||f===2&&i||n.includes(l),p=!i||i===2&&f||n.includes(r);return u._open=!!(o===42?c:c&&(i||!p)),u._close=!!(o===42?p:p&&(f||!c)),t(l)}}function Xl(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const my={name:"autolink",tokenize:gy};function gy(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 Ke(d)?(e.consume(d),a):d===64?n(d):u(d)}function a(d){return d===43||d===45||d===46||Ve(d)?(r=1,s(d)):u(d)}function s(d){return d===58?(e.consume(d),r=0,l):(d===43||d===45||d===46||Ve(d))&&r++<32?(e.consume(d),s):(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||kr(d)?n(d):(e.consume(d),l)}function u(d){return d===64?(e.consume(d),f):oy(d)?(e.consume(d),u):n(d)}function f(d){return Ve(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):p(d)}function p(d){if((d===45||Ve(d))&&r++<63){const m=d===45?p:c;return e.consume(d),m}return n(d)}}const Ln={partial:!0,tokenize:yy};function yy(e,t,n){return r;function r(o){return ye(o)?be(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||ce(o)?t(o):n(o)}}const eu={continuation:{tokenize:by},exit:wy,name:"blockQuote",tokenize:vy};function vy(e,t,n){const r=this;return i;function i(a){if(a===62){const s=r.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),o}return n(a)}function o(a){return ye(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function by(e,t,n){const r=this;return i;function i(a){return ye(a)?be(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):o(a)}function o(a){return e.attempt(eu,t,n)(a)}}function wy(e){e.exit("blockQuote")}const tu={name:"characterEscape",tokenize:xy};function xy(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 sy(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const nu={name:"characterReference",tokenize:ky};function ky(e,t,n){const r=this;let i=0,o,a;return s;function s(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,a=Ve,f(c))}function u(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,a=ay,f):(e.enter("characterReferenceValue"),o=7,a=po,f(c))}function f(c){if(c===59&&i){const p=e.exit("characterReferenceValue");return a===Ve&&!fo(r.sliceSerialize(p))?n(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(c)&&i++<o?(e.consume(c),f):n(c)}}const ru={partial:!0,tokenize:Ey},iu={concrete:!0,name:"codeFenced",tokenize:Sy};function Sy(e,t,n){const r=this,i={partial:!0,tokenize:k};let o=0,a=0,s;return l;function l(C){return u(C)}function u(C){const T=r.events[r.events.length-1];return o=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,s=C,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(C)}function f(C){return C===s?(a++,e.consume(C),f):a<3?n(C):(e.exit("codeFencedFenceSequence"),ye(C)?be(e,c,"whitespace")(C):c(C))}function c(C){return C===null||ce(C)?(e.exit("codeFencedFence"),r.interrupt?t(C):e.check(ru,h,A)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(C))}function p(C){return C===null||ce(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(C)):ye(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),be(e,d,"whitespace")(C)):C===96&&C===s?n(C):(e.consume(C),p)}function d(C){return C===null||ce(C)?c(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(C))}function m(C){return C===null||ce(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(C)):C===96&&C===s?n(C):(e.consume(C),m)}function h(C){return e.attempt(i,A,g)(C)}function g(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),y}function y(C){return o>0&&ye(C)?be(e,v,"linePrefix",o+1)(C):v(C)}function v(C){return C===null||ce(C)?e.check(ru,h,A)(C):(e.enter("codeFlowValue"),w(C))}function w(C){return C===null||ce(C)?(e.exit("codeFlowValue"),v(C)):(e.consume(C),w)}function A(C){return e.exit("codeFenced"),t(C)}function k(C,T,_){let F=0;return I;function I(D){return C.enter("lineEnding"),C.consume(D),C.exit("lineEnding"),O}function O(D){return C.enter("codeFencedFence"),ye(D)?be(C,j,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):j(D)}function j(D){return D===s?(C.enter("codeFencedFenceSequence"),z(D)):_(D)}function z(D){return D===s?(F++,C.consume(D),z):F>=a?(C.exit("codeFencedFenceSequence"),ye(D)?be(C,M,"whitespace")(D):M(D)):_(D)}function M(D){return D===null||ce(D)?(C.exit("codeFencedFence"),T(D)):_(D)}}}function Ey(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const mo={name:"codeIndented",tokenize:Ay},Cy={partial:!0,tokenize:Iy};function Ay(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),be(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?a(u):n(u)}function a(u){return u===null?l(u):ce(u)?e.attempt(Cy,a,l)(u):(e.enter("codeFlowValue"),s(u))}function s(u){return u===null||ce(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),s)}function l(u){return e.exit("codeIndented"),t(u)}}function Iy(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):ce(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):be(e,o,"linePrefix",5)(a)}function o(a){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):ce(a)?i(a):n(a)}}const Ty={name:"codeText",previous:Dy,resolve:Oy,tokenize:My};function Oy(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 Dy(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function My(e,t,n){let r=0,i,o;return a;function a(c){return e.enter("codeText"),e.enter("codeTextSequence"),s(c)}function s(c){return c===96?(e.consume(c),r++,s):(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 _y{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&&Fn(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),Fn(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Fn(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);Fn(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Fn(this.left,n.reverse())}}}function Fn(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 ou(e){const t={};let n=-1,r,i,o,a,s,l,u;const f=new _y(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,Py(f,n)),n=t[n],u=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(a=f.get(o),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=o);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},s=f.slice(i,n),s.unshift(r),f.splice(i,n-i+1,s))}}return nt(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!u}function Py(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const s=a.events,l=[],u={};let f,c,p=-1,d=n,m=0,h=0;const g=[h];for(;d;){for(;e.get(++i)[1]!==d;);o.push(i),d._tokenizer||(f=r.sliceStream(d),d.next||f.push(null),c&&a.defineSkip(d.start),d._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(f),d._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),c=d,d=d.next}for(d=n;++p<s.length;)s[p][0]==="exit"&&s[p-1][0]==="enter"&&s[p][1].type===s[p-1][1].type&&s[p][1].start.line!==s[p][1].end.line&&(h=p+1,g.push(h),d._tokenizer=void 0,d.previous=void 0,d=d.next);for(a.events=[],d?(d._tokenizer=void 0,d.previous=void 0):g.pop(),p=g.length;p--;){const y=s.slice(g[p],g[p+1]),v=o.pop();l.push([v,v+y.length-1]),e.splice(v,2,y)}for(l.reverse(),p=-1;++p<l.length;)u[m+l[p][0]]=m+l[p][1],m+=l[p][1]-l[p][0]-1;return u}const Ny={resolve:Fy,tokenize:Ry},Ly={partial:!0,tokenize:By};function Fy(e){return ou(e),e}function Ry(e,t){let n;return r;function r(s){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(s)}function i(s){return s===null?o(s):ce(s)?e.check(Ly,a,o)(s):(e.consume(s),i)}function o(s){return e.exit("chunkContent"),e.exit("content"),t(s)}function a(s){return e.consume(s),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function By(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),be(e,o,"linePrefix")}function o(a){if(a===null||ce(a))return n(a);const s=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function au(e,t,n,r,i,o,a,s,l){const u=l||Number.POSITIVE_INFINITY;let f=0;return c;function c(y){return y===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(y),e.exit(o),p):y===null||y===32||y===41||kr(y)?n(y):(e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),h(y))}function p(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),d(y))}function d(y){return y===62?(e.exit("chunkString"),e.exit(s),p(y)):y===null||y===60||ce(y)?n(y):(e.consume(y),y===92?m:d)}function m(y){return y===60||y===62||y===92?(e.consume(y),d):d(y)}function h(y){return!f&&(y===null||y===41||Ie(y))?(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(y)):f<u&&y===40?(e.consume(y),f++,h):y===41?(e.consume(y),f--,h):y===null||y===32||y===40||kr(y)?n(y):(e.consume(y),y===92?g:h)}function g(y){return y===40||y===41||y===92?(e.consume(y),h):h(y)}}function su(e,t,n,r,i,o){const a=this;let s=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 s>999||d===null||d===91||d===93&&!l||d===94&&!s&&"_hiddenFootnoteSupport"in a.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)||s++>999?(e.exit("chunkString"),f(d)):(e.consume(d),l||(l=!ye(d)),d===92?p:c)}function p(d){return d===91||d===92||d===93?(e.consume(d),s++,c):c(d)}}function lu(e,t,n,r,i,o){let a;return s;function s(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),a=p===40?41:p,l):n(p)}function l(p){return p===a?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(o),u(p))}function u(p){return p===a?(e.exit(o),l(a)):p===null?n(p):ce(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),be(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===a||p===null||ce(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?c:f)}function c(p){return p===a||p===92?(e.consume(p),f):f(p)}}function Rn(e,t){let n;return r;function r(i){return ce(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ye(i)?be(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const zy={name:"definition",tokenize:jy},$y={partial:!0,tokenize:Uy};function jy(e,t,n){const r=this;let i;return o;function o(d){return e.enter("definition"),a(d)}function a(d){return su.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function s(d){return i=ut(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 Ie(d)?Rn(e,u)(d):u(d)}function u(d){return au(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function f(d){return e.attempt($y,c,c)(d)}function c(d){return ye(d)?be(e,p,"whitespace")(d):p(d)}function p(d){return d===null||ce(d)?(e.exit("definition"),r.parser.defined.push(i),t(d)):n(d)}}function Uy(e,t,n){return r;function r(s){return Ie(s)?Rn(e,i)(s):n(s)}function i(s){return lu(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return ye(s)?be(e,a,"whitespace")(s):a(s)}function a(s){return s===null||ce(s)?t(s):n(s)}}const Hy={name:"hardBreakEscape",tokenize:Wy};function Wy(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 Vy={name:"headingAtx",resolve:qy,tokenize:Ky};function qy(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"},nt(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function Ky(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),a(f)}function a(f){return f===35&&r++<6?(e.consume(f),a):f===null||Ie(f)?(e.exit("atxHeadingSequence"),s(f)):n(f)}function s(f){return f===35?(e.enter("atxHeadingSequence"),l(f)):f===null||ce(f)?(e.exit("atxHeading"),t(f)):ye(f)?be(e,s,"whitespace")(f):(e.enter("atxHeadingText"),u(f))}function l(f){return f===35?(e.consume(f),l):(e.exit("atxHeadingSequence"),s(f))}function u(f){return f===null||f===35||Ie(f)?(e.exit("atxHeadingText"),s(f)):(e.consume(f),u)}}const Yy=["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"],uu=["pre","script","style","textarea"],Gy={concrete:!0,name:"htmlFlow",resolveTo:Zy,tokenize:Xy},Qy={partial:!0,tokenize:tv},Jy={partial:!0,tokenize:ev};function Zy(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 Xy(e,t,n){const r=this;let i,o,a,s,l;return u;function u(x){return f(x)}function f(x){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(x),c}function c(x){return x===33?(e.consume(x),p):x===47?(e.consume(x),o=!0,h):x===63?(e.consume(x),i=3,r.interrupt?t:b):Ke(x)?(e.consume(x),a=String.fromCharCode(x),g):n(x)}function p(x){return x===45?(e.consume(x),i=2,d):x===91?(e.consume(x),i=5,s=0,m):Ke(x)?(e.consume(x),i=4,r.interrupt?t:b):n(x)}function d(x){return x===45?(e.consume(x),r.interrupt?t:b):n(x)}function m(x){const V="CDATA[";return x===V.charCodeAt(s++)?(e.consume(x),s===V.length?r.interrupt?t:j:m):n(x)}function h(x){return Ke(x)?(e.consume(x),a=String.fromCharCode(x),g):n(x)}function g(x){if(x===null||x===47||x===62||Ie(x)){const V=x===47,ee=a.toLowerCase();return!V&&!o&&uu.includes(ee)?(i=1,r.interrupt?t(x):j(x)):Yy.includes(a.toLowerCase())?(i=6,V?(e.consume(x),y):r.interrupt?t(x):j(x)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(x):o?v(x):w(x))}return x===45||Ve(x)?(e.consume(x),a+=String.fromCharCode(x),g):n(x)}function y(x){return x===62?(e.consume(x),r.interrupt?t:j):n(x)}function v(x){return ye(x)?(e.consume(x),v):I(x)}function w(x){return x===47?(e.consume(x),I):x===58||x===95||Ke(x)?(e.consume(x),A):ye(x)?(e.consume(x),w):I(x)}function A(x){return x===45||x===46||x===58||x===95||Ve(x)?(e.consume(x),A):k(x)}function k(x){return x===61?(e.consume(x),C):ye(x)?(e.consume(x),k):w(x)}function C(x){return x===null||x===60||x===61||x===62||x===96?n(x):x===34||x===39?(e.consume(x),l=x,T):ye(x)?(e.consume(x),C):_(x)}function T(x){return x===l?(e.consume(x),l=null,F):x===null||ce(x)?n(x):(e.consume(x),T)}function _(x){return x===null||x===34||x===39||x===47||x===60||x===61||x===62||x===96||Ie(x)?k(x):(e.consume(x),_)}function F(x){return x===47||x===62||ye(x)?w(x):n(x)}function I(x){return x===62?(e.consume(x),O):n(x)}function O(x){return x===null||ce(x)?j(x):ye(x)?(e.consume(x),O):n(x)}function j(x){return x===45&&i===2?(e.consume(x),B):x===60&&i===1?(e.consume(x),U):x===62&&i===4?(e.consume(x),P):x===63&&i===3?(e.consume(x),b):x===93&&i===5?(e.consume(x),W):ce(x)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Qy,H,z)(x)):x===null||ce(x)?(e.exit("htmlFlowData"),z(x)):(e.consume(x),j)}function z(x){return e.check(Jy,M,H)(x)}function M(x){return e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),D}function D(x){return x===null||ce(x)?z(x):(e.enter("htmlFlowData"),j(x))}function B(x){return x===45?(e.consume(x),b):j(x)}function U(x){return x===47?(e.consume(x),a="",$):j(x)}function $(x){if(x===62){const V=a.toLowerCase();return uu.includes(V)?(e.consume(x),P):j(x)}return Ke(x)&&a.length<8?(e.consume(x),a+=String.fromCharCode(x),$):j(x)}function W(x){return x===93?(e.consume(x),b):j(x)}function b(x){return x===62?(e.consume(x),P):x===45&&i===2?(e.consume(x),b):j(x)}function P(x){return x===null||ce(x)?(e.exit("htmlFlowData"),H(x)):(e.consume(x),P)}function H(x){return e.exit("htmlFlow"),t(x)}}function ev(e,t,n){const r=this;return i;function i(a){return ce(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):n(a)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function tv(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Ln,t,n)}}const nv={name:"htmlText",tokenize:rv};function rv(e,t,n){const r=this;let i,o,a;return s;function s(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):Ke(b)?(e.consume(b),_):n(b)}function u(b){return b===45?(e.consume(b),f):b===91?(e.consume(b),o=0,m):Ke(b)?(e.consume(b),v):n(b)}function f(b){return b===45?(e.consume(b),d):n(b)}function c(b){return b===null?n(b):b===45?(e.consume(b),p):ce(b)?(a=c,U(b)):(e.consume(b),c)}function p(b){return b===45?(e.consume(b),d):c(b)}function d(b){return b===62?B(b):b===45?p(b):c(b)}function m(b){const P="CDATA[";return b===P.charCodeAt(o++)?(e.consume(b),o===P.length?h:m):n(b)}function h(b){return b===null?n(b):b===93?(e.consume(b),g):ce(b)?(a=h,U(b)):(e.consume(b),h)}function g(b){return b===93?(e.consume(b),y):h(b)}function y(b){return b===62?B(b):b===93?(e.consume(b),y):h(b)}function v(b){return b===null||b===62?B(b):ce(b)?(a=v,U(b)):(e.consume(b),v)}function w(b){return b===null?n(b):b===63?(e.consume(b),A):ce(b)?(a=w,U(b)):(e.consume(b),w)}function A(b){return b===62?B(b):w(b)}function k(b){return Ke(b)?(e.consume(b),C):n(b)}function C(b){return b===45||Ve(b)?(e.consume(b),C):T(b)}function T(b){return ce(b)?(a=T,U(b)):ye(b)?(e.consume(b),T):B(b)}function _(b){return b===45||Ve(b)?(e.consume(b),_):b===47||b===62||Ie(b)?F(b):n(b)}function F(b){return b===47?(e.consume(b),B):b===58||b===95||Ke(b)?(e.consume(b),I):ce(b)?(a=F,U(b)):ye(b)?(e.consume(b),F):B(b)}function I(b){return b===45||b===46||b===58||b===95||Ve(b)?(e.consume(b),I):O(b)}function O(b){return b===61?(e.consume(b),j):ce(b)?(a=O,U(b)):ye(b)?(e.consume(b),O):F(b)}function j(b){return b===null||b===60||b===61||b===62||b===96?n(b):b===34||b===39?(e.consume(b),i=b,z):ce(b)?(a=j,U(b)):ye(b)?(e.consume(b),j):(e.consume(b),M)}function z(b){return b===i?(e.consume(b),i=void 0,D):b===null?n(b):ce(b)?(a=z,U(b)):(e.consume(b),z)}function M(b){return b===null||b===34||b===39||b===60||b===61||b===96?n(b):b===47||b===62||Ie(b)?F(b):(e.consume(b),M)}function D(b){return b===47||b===62||Ie(b)?F(b):n(b)}function B(b){return b===62?(e.consume(b),e.exit("htmlTextData"),e.exit("htmlText"),t):n(b)}function U(b){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),$}function $(b){return ye(b)?be(e,W,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):W(b)}function W(b){return e.enter("htmlTextData"),a(b)}}const go={name:"labelEnd",resolveAll:sv,resolveTo:lv,tokenize:uv},iv={tokenize:cv},ov={tokenize:fv},av={tokenize:dv};function sv(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&&nt(e,0,e.length,n),e}function lv(e,t){let n=e.length,r=0,i,o,a,s;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(a){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"&&(a=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[a][1].end}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[a-2][1].start}};return s=[["enter",l,t],["enter",u,t]],s=ot(s,e.slice(o+1,o+r+3)),s=ot(s,[["enter",f,t]]),s=ot(s,Er(t.parser.constructs.insideSpan.null,e.slice(o+r+4,a-3),t)),s=ot(s,[["exit",f,t],e[a-2],e[a-1],["exit",u,t]]),s=ot(s,e.slice(a+1)),s=ot(s,[["exit",l,t]]),nt(e,o,e.length,s),e}function uv(e,t,n){const r=this;let i=r.events.length,o,a;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 s;function s(p){return o?o._inactive?c(p):(a=r.parser.defined.includes(ut(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),l):n(p)}function l(p){return p===40?e.attempt(iv,f,a?f:c)(p):p===91?e.attempt(ov,f,a?u:c)(p):a?f(p):c(p)}function u(p){return e.attempt(av,f,c)(p)}function f(p){return t(p)}function c(p){return o._balanced=!0,n(p)}}function cv(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 Ie(c)?Rn(e,o)(c):o(c)}function o(c){return c===41?f(c):au(e,a,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function a(c){return Ie(c)?Rn(e,l)(c):f(c)}function s(c){return n(c)}function l(c){return c===34||c===39||c===40?lu(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):f(c)}function u(c){return Ie(c)?Rn(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 fv(e,t,n){const r=this;return i;function i(s){return su.call(r,e,o,a,"reference","referenceMarker","referenceString")(s)}function o(s){return r.parser.defined.includes(ut(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(s):n(s)}function a(s){return n(s)}}function dv(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 pv={name:"labelStartImage",resolveAll:go.resolveAll,tokenize:hv};function hv(e,t,n){const r=this;return i;function i(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),o}function o(s){return s===91?(e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),a):n(s)}function a(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const mv={name:"labelStartLink",resolveAll:go.resolveAll,tokenize:gv};function gv(e,t,n){const r=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),o}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const yo={name:"lineEnding",tokenize:yv};function yv(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),be(e,t,"linePrefix")}}const Cr={name:"thematicBreak",tokenize:vv};function vv(e,t,n){let r=0,i;return o;function o(u){return e.enter("thematicBreak"),a(u)}function a(u){return i=u,s(u)}function s(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"),ye(u)?be(e,s,"whitespace")(u):s(u))}}const Ze={continuation:{tokenize:kv},exit:Ev,name:"list",tokenize:xv},bv={partial:!0,tokenize:Cv},wv={partial:!0,tokenize:Sv};function xv(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,a=0;return s;function s(d){const m=r.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||d===r.containerState.marker:po(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(Cr,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 po(d)&&++a<10?(e.consume(d),l):(!r.interrupt||a<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(Ln,r.interrupt?n:f,e.attempt(bv,p,c))}function f(d){return r.containerState.initialBlankLine=!0,o++,p(d)}function c(d){return ye(d)?(e.enter("listItemPrefixWhitespace"),e.consume(d),e.exit("listItemPrefixWhitespace"),p):n(d)}function p(d){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(d)}}function kv(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Ln,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,be(e,t,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!ye(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(wv,t,a)(s))}function a(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,be(e,e.attempt(Ze,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function Sv(e,t,n){const r=this;return be(e,i,"listItemIndent",r.containerState.size+1);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(o):n(o)}}function Ev(e){e.exit(this.containerState.type)}function Cv(e,t,n){const r=this;return be(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const a=r.events[r.events.length-1];return!ye(o)&&a&&a[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const cu={name:"setextUnderline",resolveTo:Av,tokenize:Iv};function Av(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 a={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",a,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function Iv(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,a(u)):n(u)}function a(u){return e.enter("setextHeadingLineSequence"),s(u)}function s(u){return u===i?(e.consume(u),s):(e.exit("setextHeadingLineSequence"),ye(u)?be(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||ce(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const Tv={tokenize:Ov};function Ov(e){const t=this,n=e.attempt(Ln,r,e.attempt(this.parser.constructs.flowInitial,i,be(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Ny,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 Dv={resolveAll:du()},Mv=fu("string"),_v=fu("text");function fu(e){return{resolveAll:du(e==="text"?Pv:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,a,s);return a;function a(f){return u(f)?o(f):s(f)}function s(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 p=-1;if(c)for(;++p<c.length;){const d=c[p];if(!d.previous||d.previous.call(r,r.previous))return!0}return!1}}}function du(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 Pv(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,a=-1,s=0,l;for(;o--;){const u=i[o];if(typeof u=="string"){for(a=u.length;u.charCodeAt(a-1)===32;)s++,a--;if(a)break;a=-1}else if(u===-2)l=!0,s++;else if(u!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){const u={type:n===e.length||l||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?a:r.start._bufferIndex+a,_index:r.start._index+o,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},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 Nv=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:zy},disable:{null:[]},document:{42:Ze,43:Ze,45:Ze,48:Ze,49:Ze,50:Ze,51:Ze,52:Ze,53:Ze,54:Ze,55:Ze,56:Ze,57:Ze,62:eu},flow:{35:Vy,42:Cr,45:[cu,Cr],60:Gy,61:cu,95:Cr,96:iu,126:iu},flowInitial:{[-2]:mo,[-1]:mo,32:mo},insideSpan:{null:[ho,Dv]},string:{38:nu,92:tu},text:{[-5]:yo,[-4]:yo,[-3]:yo,33:pv,38:nu,42:ho,60:[my,nv],91:mv,92:[Hy,tu],93:go,95:ho,96:Ty}},Symbol.toStringTag,{value:"Module"}));function Lv(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 a=[],s=[];const l={attempt:T(k),check:T(C),consume:v,enter:w,exit:A,interrupt:T(C,{interrupt:!0})},u={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:p,sliceStream:d,write:c};let f=t.tokenize.call(u,l);return t.resolveAll&&o.push(t),u;function c(O){return a=ot(a,O),g(),a[a.length-1]!==null?[]:(_(t,0),u.events=Er(o,u.events,u),u.events)}function p(O,j){return Rv(d(O),j)}function d(O){return Fv(a,O)}function m(){const{_bufferIndex:O,_index:j,line:z,column:M,offset:D}=r;return{_bufferIndex:O,_index:j,line:z,column:M,offset:D}}function h(O){i[O.line]=O.column,I()}function g(){let O;for(;r._index<a.length;){const j=a[r._index];if(typeof j=="string")for(O=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===O&&r._bufferIndex<j.length;)y(j.charCodeAt(r._bufferIndex));else y(j)}}function y(O){f=f(O)}function v(O){ce(O)?(r.line++,r.column=1,r.offset+=O===-3?2:1,I()):O!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=O}function w(O,j){const z=j||{};return z.type=O,z.start=m(),u.events.push(["enter",z,u]),s.push(z),z}function A(O){const j=s.pop();return j.end=m(),u.events.push(["exit",j,u]),j}function k(O,j){_(O,j.from)}function C(O,j){j.restore()}function T(O,j){return z;function z(M,D,B){let U,$,W,b;return Array.isArray(M)?H(M):"tokenize"in M?H([M]):P(M);function P(Y){return J;function J(X){const re=X!==null&&Y[X],K=X!==null&&Y.null,te=[...Array.isArray(re)?re:re?[re]:[],...Array.isArray(K)?K:K?[K]:[]];return H(te)(X)}}function H(Y){return U=Y,$=0,Y.length===0?B:x(Y[$])}function x(Y){return J;function J(X){return b=F(),W=Y,Y.partial||(u.currentConstruct=Y),Y.name&&u.parser.constructs.disable.null.includes(Y.name)?ee():Y.tokenize.call(j?Object.assign(Object.create(u),j):u,l,V,ee)(X)}}function V(Y){return O(W,b),D}function ee(Y){return b.restore(),++$<U.length?x(U[$]):B}}}function _(O,j){O.resolveAll&&!o.includes(O)&&o.push(O),O.resolve&&nt(u.events,j,u.events.length-j,O.resolve(u.events.slice(j),u)),O.resolveTo&&(u.events=O.resolveTo(u.events,u))}function F(){const O=m(),j=u.previous,z=u.currentConstruct,M=u.events.length,D=Array.from(s);return{from:M,restore:B};function B(){r=O,u.previous=j,u.currentConstruct=z,u.events.length=M,s=D,I()}}function I(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Fv(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,o)];else{if(a=e.slice(n,i),r>-1){const s=a[0];typeof s=="string"?a[0]=s.slice(r):a.shift()}o>0&&a.push(e[i].slice(0,o))}return a}function Rv(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let a;if(typeof o=="string")a=o;else switch(o){case-5:{a="\r";break}case-4:{a=`
28
28
  `;break}case-3:{a=`\r
29
- `;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(o)}i=o===-2,r.push(a)}return r.join("")}function Uv(e){const r={constructs:eu([Bv,...(e||{}).extensions||[]]),content:i(dy),defined:[],document:i(hy),flow:i(_v),lazy:{},string:i(Lv),text:i(Fv)};return r;function i(o){return a;function a(s){return zv(r,o,s)}}}function Hv(e){for(;!uu(e););return e}const yu=/[\0\t\n\r]/g;function Wv(){let e=1,t="",n=!0,r;return i;function i(o,a,s){const l=[];let u,f,c,p,d;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(a||void 0).decode(o)),c=0,t="",n&&(o.charCodeAt(0)===65279&&c++,n=void 0);c<o.length;){if(yu.lastIndex=c,u=yu.exec(o),p=u&&u.index!==void 0?u.index:o.length,d=o.charCodeAt(p),!u){t=o.slice(c);break}if(d===10&&c===p&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),c<p&&(l.push(o.slice(c,p)),e+=p-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=p+1}return s&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const Vv=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function qv(e){return e.replace(Vv,Kv)}function Kv(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return tu(n.slice(o?2:1),o?16:10)}return go(n)||e}const vu={}.hasOwnProperty;function Yv(e,t,n){return typeof t!="string"&&(n=t,t=void 0),Gv(n)(Hv(Uv(n).document().write(Wv()(e,t,!0))))}function Gv(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(de),autolinkProtocol:F,autolinkEmail:F,atxHeading:o(ke),blockQuote:o(K),characterEscape:F,characterReference:F,codeFenced:o(te),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:o(te,a),codeText:o(L,a),codeTextData:F,data:F,codeFlowValue:F,definition:o(ne),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:o(me),hardBreakEscape:o(oe),hardBreakTrailing:o(oe),htmlFlow:o(G,a),htmlFlowData:F,htmlText:o(G,a),htmlTextData:F,image:o(ue),label:a,link:o(de),listItem:o(Se),listItemValue:p,listOrdered:o(we,c),listUnordered:o(we),paragraph:o(Ue),reference:x,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:o(ke),strong:o(Ye),thematicBreak:o(se)},exit:{atxHeading:l(),atxHeadingSequence:k,autolink:l(),autolinkEmail:ie,autolinkProtocol:X,blockQuote:l(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:ee,characterReferenceMarkerNumeric:ee,characterReferenceValue:Y,characterReference:J,codeFenced:l(g),codeFencedFence:h,codeFencedFenceInfo:d,codeFencedFenceMeta:m,codeFlowValue:I,codeIndented:l(y),codeText:l(D),codeTextData:I,data:I,definition:l(),definitionDestinationString:A,definitionLabelString:v,definitionTitleString:w,emphasis:l(),hardBreakEscape:l(j),hardBreakTrailing:l(j),htmlFlow:l(z),htmlFlowData:I,htmlText:l(M),htmlTextData:I,image:l(U),label:V,labelText:$,lineEnding:O,link:l(B),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:W,resourceDestinationString:b,resourceTitleString:N,resource:H,setextHeading:l(P),setextHeadingLineSequence:T,setextHeadingText:C,strong:l(),thematicBreak:l()}};bu(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(R){let q={type:"root",children:[]};const ae={stack:[q],tokenStack:[],config:t,enter:s,exit:u,buffer:a,resume:f,data:n},le=[];let pe=-1;for(;++pe<R.length;)if(R[pe][1].type==="listOrdered"||R[pe][1].type==="listUnordered")if(R[pe][0]==="enter")le.push(pe);else{const fe=le.pop();pe=i(R,fe,pe)}for(pe=-1;++pe<R.length;){const fe=t[R[pe][0]];vu.call(fe,R[pe][1].type)&&fe[R[pe][1].type].call(Object.assign({sliceSerialize:R[pe][2].sliceSerialize},ae),R[pe][1])}if(ae.tokenStack.length>0){const fe=ae.tokenStack[ae.tokenStack.length-1];(fe[1]||wu).call(ae,void 0,fe[0])}for(q.position={start:Mt(R.length>0?R[0][1].start:{line:1,column:1,offset:0}),end:Mt(R.length>0?R[R.length-2][1].end:{line:1,column:1,offset:0})},pe=-1;++pe<t.transforms.length;)q=t.transforms[pe](q)||q;return q}function i(R,q,ae){let le=q-1,pe=-1,fe=!1,Ee,Oe,st,gt;for(;++le<=ae;){const ze=R[le];switch(ze[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ze[0]==="enter"?pe++:pe--,gt=void 0;break}case"lineEndingBlank":{ze[0]==="enter"&&(Ee&&!gt&&!pe&&!st&&(st=le),gt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:gt=void 0}if(!pe&&ze[0]==="enter"&&ze[1].type==="listItemPrefix"||pe===-1&&ze[0]==="exit"&&(ze[1].type==="listUnordered"||ze[1].type==="listOrdered")){if(Ee){let lt=le;for(Oe=void 0;lt--;){const Ge=R[lt];if(Ge[1].type==="lineEnding"||Ge[1].type==="lineEndingBlank"){if(Ge[0]==="exit")continue;Oe&&(R[Oe][1].type="lineEndingBlank",fe=!0),Ge[1].type="lineEnding",Oe=lt}else if(!(Ge[1].type==="linePrefix"||Ge[1].type==="blockQuotePrefix"||Ge[1].type==="blockQuotePrefixWhitespace"||Ge[1].type==="blockQuoteMarker"||Ge[1].type==="listItemIndent"))break}st&&(!Oe||st<Oe)&&(Ee._spread=!0),Ee.end=Object.assign({},Oe?R[Oe][1].start:ze[1].end),R.splice(Oe||le,0,["exit",Ee,ze[2]]),le++,ae++}if(ze[1].type==="listItemPrefix"){const lt={type:"listItem",_spread:!1,start:Object.assign({},ze[1].start),end:void 0};Ee=lt,R.splice(le,0,["enter",lt,ze[2]]),le++,ae++,st=void 0,gt=!0}}}return R[q][1]._spread=fe,ae}function o(R,q){return ae;function ae(le){s.call(this,R(le),le),q&&q.call(this,le)}}function a(){this.stack.push({type:"fragment",children:[]})}function s(R,q,ae){this.stack[this.stack.length-1].children.push(R),this.stack.push(R),this.tokenStack.push([q,ae||void 0]),R.position={start:Mt(q.start),end:void 0}}function l(R){return q;function q(ae){R&&R.call(this,ae),u.call(this,ae)}}function u(R,q){const ae=this.stack.pop(),le=this.tokenStack.pop();if(le)le[0].type!==R.type&&(q?q.call(this,R,le[0]):(le[1]||wu).call(this,R,le[0]));else throw new Error("Cannot close `"+R.type+"` ("+Fn({start:R.start,end:R.end})+"): it’s not open");ae.position.end=Mt(R.end)}function f(){return mo(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function p(R){if(this.data.expectingFirstListItemValue){const q=this.stack[this.stack.length-2];q.start=Number.parseInt(this.sliceSerialize(R),10),this.data.expectingFirstListItemValue=void 0}}function d(){const R=this.resume(),q=this.stack[this.stack.length-1];q.lang=R}function m(){const R=this.resume(),q=this.stack[this.stack.length-1];q.meta=R}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){const R=this.resume(),q=this.stack[this.stack.length-1];q.value=R.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const R=this.resume(),q=this.stack[this.stack.length-1];q.value=R.replace(/(\r?\n|\r)$/g,"")}function v(R){const q=this.resume(),ae=this.stack[this.stack.length-1];ae.label=q,ae.identifier=ut(this.sliceSerialize(R)).toLowerCase()}function w(){const R=this.resume(),q=this.stack[this.stack.length-1];q.title=R}function A(){const R=this.resume(),q=this.stack[this.stack.length-1];q.url=R}function k(R){const q=this.stack[this.stack.length-1];if(!q.depth){const ae=this.sliceSerialize(R).length;q.depth=ae}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function T(R){const q=this.stack[this.stack.length-1];q.depth=this.sliceSerialize(R).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function F(R){const ae=this.stack[this.stack.length-1].children;let le=ae[ae.length-1];(!le||le.type!=="text")&&(le=Z(),le.position={start:Mt(R.start),end:void 0},ae.push(le)),this.stack.push(le)}function I(R){const q=this.stack.pop();q.value+=this.sliceSerialize(R),q.position.end=Mt(R.end)}function O(R){const q=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ae=q.children[q.children.length-1];ae.position.end=Mt(R.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(q.type)&&(F.call(this,R),I.call(this,R))}function j(){this.data.atHardBreak=!0}function z(){const R=this.resume(),q=this.stack[this.stack.length-1];q.value=R}function M(){const R=this.resume(),q=this.stack[this.stack.length-1];q.value=R}function D(){const R=this.resume(),q=this.stack[this.stack.length-1];q.value=R}function B(){const R=this.stack[this.stack.length-1];if(this.data.inReference){const q=this.data.referenceType||"shortcut";R.type+="Reference",R.referenceType=q,delete R.url,delete R.title}else delete R.identifier,delete R.label;this.data.referenceType=void 0}function U(){const R=this.stack[this.stack.length-1];if(this.data.inReference){const q=this.data.referenceType||"shortcut";R.type+="Reference",R.referenceType=q,delete R.url,delete R.title}else delete R.identifier,delete R.label;this.data.referenceType=void 0}function $(R){const q=this.sliceSerialize(R),ae=this.stack[this.stack.length-2];ae.label=qv(q),ae.identifier=ut(q).toLowerCase()}function V(){const R=this.stack[this.stack.length-1],q=this.resume(),ae=this.stack[this.stack.length-1];if(this.data.inReference=!0,ae.type==="link"){const le=R.children;ae.children=le}else ae.alt=q}function b(){const R=this.resume(),q=this.stack[this.stack.length-1];q.url=R}function N(){const R=this.resume(),q=this.stack[this.stack.length-1];q.title=R}function H(){this.data.inReference=void 0}function x(){this.data.referenceType="collapsed"}function W(R){const q=this.resume(),ae=this.stack[this.stack.length-1];ae.label=q,ae.identifier=ut(this.sliceSerialize(R)).toLowerCase(),this.data.referenceType="full"}function ee(R){this.data.characterReferenceType=R.type}function Y(R){const q=this.sliceSerialize(R),ae=this.data.characterReferenceType;let le;ae?(le=tu(q,ae==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):le=go(q);const pe=this.stack[this.stack.length-1];pe.value+=le}function J(R){const q=this.stack.pop();q.position.end=Mt(R.end)}function X(R){I.call(this,R);const q=this.stack[this.stack.length-1];q.url=this.sliceSerialize(R)}function ie(R){I.call(this,R);const q=this.stack[this.stack.length-1];q.url="mailto:"+this.sliceSerialize(R)}function K(){return{type:"blockquote",children:[]}}function te(){return{type:"code",lang:null,meta:null,value:""}}function L(){return{type:"inlineCode",value:""}}function ne(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function me(){return{type:"emphasis",children:[]}}function ke(){return{type:"heading",depth:0,children:[]}}function oe(){return{type:"break"}}function G(){return{type:"html",value:""}}function ue(){return{type:"image",title:null,url:"",alt:null}}function de(){return{type:"link",title:null,url:"",children:[]}}function we(R){return{type:"list",ordered:R.type==="listOrdered",start:null,spread:R._spread,children:[]}}function Se(R){return{type:"listItem",spread:R._spread,checked:null,children:[]}}function Ue(){return{type:"paragraph",children:[]}}function Ye(){return{type:"strong",children:[]}}function Z(){return{type:"text",value:""}}function se(){return{type:"thematicBreak"}}}function Mt(e){return{line:e.line,column:e.column,offset:e.offset}}function bu(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?bu(e,r):Qv(e,r)}}function Qv(e,t){let n;for(n in t)if(vu.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 wu(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Fn({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Fn({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Fn({start:t.start,end:t.end})+") is still open")}function Jv(e){const t=this;t.parser=n;function n(r){return Yv(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Zv(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 Xv(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
30
- `}]}function eb(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 tb(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function nb(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function rb(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=tn(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let a,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=o+1,s+=1,e.footnoteCounts.set(r,s);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)}function ib(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 ob(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function xu(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 a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function ab(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return xu(e,t);const i={src:tn(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 sb(e,t){const n={src:tn(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 lb(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 ub(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return xu(e,t);const i={href:tn(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 cb(e,t){const n={href:tn(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 fb(e,t,n){const r=e.all(t),i=n?db(n):ku(t),o={},a=[];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 s=-1;for(;++s<r.length;){const f=r[s];(i||s!==0||f.type!=="element"||f.tagName!=="p")&&a.push({type:"text",value:`
29
+ `;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(o)}i=o===-2,r.push(a)}return r.join("")}function Bv(e){const r={constructs:Ql([Nv,...(e||{}).extensions||[]]),content:i(ly),defined:[],document:i(cy),flow:i(Tv),lazy:{},string:i(Mv),text:i(_v)};return r;function i(o){return a;function a(s){return Lv(r,o,s)}}}function zv(e){for(;!ou(e););return e}const pu=/[\0\t\n\r]/g;function $v(){let e=1,t="",n=!0,r;return i;function i(o,a,s){const l=[];let u,f,c,p,d;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(a||void 0).decode(o)),c=0,t="",n&&(o.charCodeAt(0)===65279&&c++,n=void 0);c<o.length;){if(pu.lastIndex=c,u=pu.exec(o),p=u&&u.index!==void 0?u.index:o.length,d=o.charCodeAt(p),!u){t=o.slice(c);break}if(d===10&&c===p&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),c<p&&(l.push(o.slice(c,p)),e+=p-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=p+1}return s&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const jv=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Uv(e){return e.replace(jv,Hv)}function Hv(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return Jl(n.slice(o?2:1),o?16:10)}return fo(n)||e}const hu={}.hasOwnProperty;function Wv(e,t,n){return typeof t!="string"&&(n=t,t=void 0),Vv(n)(zv(Bv(n).document().write($v()(e,t,!0))))}function Vv(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(de),autolinkProtocol:F,autolinkEmail:F,atxHeading:o(ke),blockQuote:o(K),characterEscape:F,characterReference:F,codeFenced:o(te),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:o(te,a),codeText:o(L,a),codeTextData:F,data:F,codeFlowValue:F,definition:o(ne),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:o(me),hardBreakEscape:o(oe),hardBreakTrailing:o(oe),htmlFlow:o(G,a),htmlFlowData:F,htmlText:o(G,a),htmlTextData:F,image:o(ue),label:a,link:o(de),listItem:o(Se),listItemValue:p,listOrdered:o(we,c),listUnordered:o(we),paragraph:o(He),reference:x,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:o(ke),strong:o(Ge),thematicBreak:o(se)},exit:{atxHeading:l(),atxHeadingSequence:k,autolink:l(),autolinkEmail:re,autolinkProtocol:X,blockQuote:l(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:ee,characterReferenceMarkerNumeric:ee,characterReferenceValue:Y,characterReference:J,codeFenced:l(g),codeFencedFence:h,codeFencedFenceInfo:d,codeFencedFenceMeta:m,codeFlowValue:I,codeIndented:l(y),codeText:l(D),codeTextData:I,data:I,definition:l(),definitionDestinationString:A,definitionLabelString:v,definitionTitleString:w,emphasis:l(),hardBreakEscape:l(j),hardBreakTrailing:l(j),htmlFlow:l(z),htmlFlowData:I,htmlText:l(M),htmlTextData:I,image:l(U),label:W,labelText:$,lineEnding:O,link:l(B),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:V,resourceDestinationString:b,resourceTitleString:P,resource:H,setextHeading:l(_),setextHeadingLineSequence:T,setextHeadingText:C,strong:l(),thematicBreak:l()}};mu(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(R){let q={type:"root",children:[]};const ae={stack:[q],tokenStack:[],config:t,enter:s,exit:u,buffer:a,resume:f,data:n},le=[];let pe=-1;for(;++pe<R.length;)if(R[pe][1].type==="listOrdered"||R[pe][1].type==="listUnordered")if(R[pe][0]==="enter")le.push(pe);else{const fe=le.pop();pe=i(R,fe,pe)}for(pe=-1;++pe<R.length;){const fe=t[R[pe][0]];hu.call(fe,R[pe][1].type)&&fe[R[pe][1].type].call(Object.assign({sliceSerialize:R[pe][2].sliceSerialize},ae),R[pe][1])}if(ae.tokenStack.length>0){const fe=ae.tokenStack[ae.tokenStack.length-1];(fe[1]||gu).call(ae,void 0,fe[0])}for(q.position={start:Mt(R.length>0?R[0][1].start:{line:1,column:1,offset:0}),end:Mt(R.length>0?R[R.length-2][1].end:{line:1,column:1,offset:0})},pe=-1;++pe<t.transforms.length;)q=t.transforms[pe](q)||q;return q}function i(R,q,ae){let le=q-1,pe=-1,fe=!1,Ee,Me,$e,gt;for(;++le<=ae;){const ze=R[le];switch(ze[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ze[0]==="enter"?pe++:pe--,gt=void 0;break}case"lineEndingBlank":{ze[0]==="enter"&&(Ee&&!gt&&!pe&&!$e&&($e=le),gt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:gt=void 0}if(!pe&&ze[0]==="enter"&&ze[1].type==="listItemPrefix"||pe===-1&&ze[0]==="exit"&&(ze[1].type==="listUnordered"||ze[1].type==="listOrdered")){if(Ee){let lt=le;for(Me=void 0;lt--;){const Qe=R[lt];if(Qe[1].type==="lineEnding"||Qe[1].type==="lineEndingBlank"){if(Qe[0]==="exit")continue;Me&&(R[Me][1].type="lineEndingBlank",fe=!0),Qe[1].type="lineEnding",Me=lt}else if(!(Qe[1].type==="linePrefix"||Qe[1].type==="blockQuotePrefix"||Qe[1].type==="blockQuotePrefixWhitespace"||Qe[1].type==="blockQuoteMarker"||Qe[1].type==="listItemIndent"))break}$e&&(!Me||$e<Me)&&(Ee._spread=!0),Ee.end=Object.assign({},Me?R[Me][1].start:ze[1].end),R.splice(Me||le,0,["exit",Ee,ze[2]]),le++,ae++}if(ze[1].type==="listItemPrefix"){const lt={type:"listItem",_spread:!1,start:Object.assign({},ze[1].start),end:void 0};Ee=lt,R.splice(le,0,["enter",lt,ze[2]]),le++,ae++,$e=void 0,gt=!0}}}return R[q][1]._spread=fe,ae}function o(R,q){return ae;function ae(le){s.call(this,R(le),le),q&&q.call(this,le)}}function a(){this.stack.push({type:"fragment",children:[]})}function s(R,q,ae){this.stack[this.stack.length-1].children.push(R),this.stack.push(R),this.tokenStack.push([q,ae||void 0]),R.position={start:Mt(q.start),end:void 0}}function l(R){return q;function q(ae){R&&R.call(this,ae),u.call(this,ae)}}function u(R,q){const ae=this.stack.pop(),le=this.tokenStack.pop();if(le)le[0].type!==R.type&&(q?q.call(this,R,le[0]):(le[1]||gu).call(this,R,le[0]));else throw new Error("Cannot close `"+R.type+"` ("+Pn({start:R.start,end:R.end})+"): it’s not open");ae.position.end=Mt(R.end)}function f(){return co(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function p(R){if(this.data.expectingFirstListItemValue){const q=this.stack[this.stack.length-2];q.start=Number.parseInt(this.sliceSerialize(R),10),this.data.expectingFirstListItemValue=void 0}}function d(){const R=this.resume(),q=this.stack[this.stack.length-1];q.lang=R}function m(){const R=this.resume(),q=this.stack[this.stack.length-1];q.meta=R}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){const R=this.resume(),q=this.stack[this.stack.length-1];q.value=R.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const R=this.resume(),q=this.stack[this.stack.length-1];q.value=R.replace(/(\r?\n|\r)$/g,"")}function v(R){const q=this.resume(),ae=this.stack[this.stack.length-1];ae.label=q,ae.identifier=ut(this.sliceSerialize(R)).toLowerCase()}function w(){const R=this.resume(),q=this.stack[this.stack.length-1];q.title=R}function A(){const R=this.resume(),q=this.stack[this.stack.length-1];q.url=R}function k(R){const q=this.stack[this.stack.length-1];if(!q.depth){const ae=this.sliceSerialize(R).length;q.depth=ae}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function T(R){const q=this.stack[this.stack.length-1];q.depth=this.sliceSerialize(R).codePointAt(0)===61?1:2}function _(){this.data.setextHeadingSlurpLineEnding=void 0}function F(R){const ae=this.stack[this.stack.length-1].children;let le=ae[ae.length-1];(!le||le.type!=="text")&&(le=Z(),le.position={start:Mt(R.start),end:void 0},ae.push(le)),this.stack.push(le)}function I(R){const q=this.stack.pop();q.value+=this.sliceSerialize(R),q.position.end=Mt(R.end)}function O(R){const q=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ae=q.children[q.children.length-1];ae.position.end=Mt(R.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(q.type)&&(F.call(this,R),I.call(this,R))}function j(){this.data.atHardBreak=!0}function z(){const R=this.resume(),q=this.stack[this.stack.length-1];q.value=R}function M(){const R=this.resume(),q=this.stack[this.stack.length-1];q.value=R}function D(){const R=this.resume(),q=this.stack[this.stack.length-1];q.value=R}function B(){const R=this.stack[this.stack.length-1];if(this.data.inReference){const q=this.data.referenceType||"shortcut";R.type+="Reference",R.referenceType=q,delete R.url,delete R.title}else delete R.identifier,delete R.label;this.data.referenceType=void 0}function U(){const R=this.stack[this.stack.length-1];if(this.data.inReference){const q=this.data.referenceType||"shortcut";R.type+="Reference",R.referenceType=q,delete R.url,delete R.title}else delete R.identifier,delete R.label;this.data.referenceType=void 0}function $(R){const q=this.sliceSerialize(R),ae=this.stack[this.stack.length-2];ae.label=Uv(q),ae.identifier=ut(q).toLowerCase()}function W(){const R=this.stack[this.stack.length-1],q=this.resume(),ae=this.stack[this.stack.length-1];if(this.data.inReference=!0,ae.type==="link"){const le=R.children;ae.children=le}else ae.alt=q}function b(){const R=this.resume(),q=this.stack[this.stack.length-1];q.url=R}function P(){const R=this.resume(),q=this.stack[this.stack.length-1];q.title=R}function H(){this.data.inReference=void 0}function x(){this.data.referenceType="collapsed"}function V(R){const q=this.resume(),ae=this.stack[this.stack.length-1];ae.label=q,ae.identifier=ut(this.sliceSerialize(R)).toLowerCase(),this.data.referenceType="full"}function ee(R){this.data.characterReferenceType=R.type}function Y(R){const q=this.sliceSerialize(R),ae=this.data.characterReferenceType;let le;ae?(le=Jl(q,ae==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):le=fo(q);const pe=this.stack[this.stack.length-1];pe.value+=le}function J(R){const q=this.stack.pop();q.position.end=Mt(R.end)}function X(R){I.call(this,R);const q=this.stack[this.stack.length-1];q.url=this.sliceSerialize(R)}function re(R){I.call(this,R);const q=this.stack[this.stack.length-1];q.url="mailto:"+this.sliceSerialize(R)}function K(){return{type:"blockquote",children:[]}}function te(){return{type:"code",lang:null,meta:null,value:""}}function L(){return{type:"inlineCode",value:""}}function ne(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function me(){return{type:"emphasis",children:[]}}function ke(){return{type:"heading",depth:0,children:[]}}function oe(){return{type:"break"}}function G(){return{type:"html",value:""}}function ue(){return{type:"image",title:null,url:"",alt:null}}function de(){return{type:"link",title:null,url:"",children:[]}}function we(R){return{type:"list",ordered:R.type==="listOrdered",start:null,spread:R._spread,children:[]}}function Se(R){return{type:"listItem",spread:R._spread,checked:null,children:[]}}function He(){return{type:"paragraph",children:[]}}function Ge(){return{type:"strong",children:[]}}function Z(){return{type:"text",value:""}}function se(){return{type:"thematicBreak"}}}function Mt(e){return{line:e.line,column:e.column,offset:e.offset}}function mu(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?mu(e,r):qv(e,r)}}function qv(e,t){let n;for(n in t)if(hu.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 gu(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Pn({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Pn({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Pn({start:t.start,end:t.end})+") is still open")}function Kv(e){const t=this;t.parser=n;function n(r){return Wv(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Yv(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 Gv(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
30
+ `}]}function Qv(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 Jv(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Zv(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Xv(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=tn(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let a,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=o+1,s+=1,e.footnoteCounts.set(r,s);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)}function eb(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 tb(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function yu(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 a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function nb(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return yu(e,t);const i={src:tn(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 rb(e,t){const n={src:tn(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 ib(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 ob(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return yu(e,t);const i={href:tn(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 ab(e,t){const n={href:tn(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 sb(e,t,n){const r=e.all(t),i=n?lb(n):vu(t),o={},a=[];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 s=-1;for(;++s<r.length;){const f=r[s];(i||s!==0||f.type!=="element"||f.tagName!=="p")&&a.push({type:"text",value:`
32
32
  `}),f.type==="element"&&f.tagName==="p"&&!i?a.push(...f.children):a.push(f)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&a.push({type:"text",value:`
33
- `});const u={type:"element",tagName:"li",properties:o,children:a};return e.patch(t,u),e.applyData(t,u)}function db(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=ku(n[r])}return t}function ku(e){const t=e.spread;return t??e.children.length>1}function pb(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 a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.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 hb(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function mb(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function gb(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function yb(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},s=lo(t.children[1]),l=Ul(t.children[t.children.length-1]);s&&l&&(a.position={start:s,end:l}),i.push(a)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function vb(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,s=a?a.length:t.children.length;let l=-1;const u=[];for(;++l<s;){const c=t.children[l],p={},d=a?a[l]:void 0;d&&(p.align=d);let m={type:"element",tagName:o,properties:p,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 bb(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Su=9,Eu=32;function wb(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(Cu(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(Cu(t.slice(i),i>0,!1)),o.join("")}function Cu(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===Su||o===Eu;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===Su||o===Eu;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function xb(e,t){const n={type:"text",value:wb(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function kb(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Sb={blockquote:Zv,break:Xv,code:eb,delete:tb,emphasis:nb,footnoteReference:rb,heading:ib,html:ob,imageReference:ab,image:sb,inlineCode:lb,linkReference:ub,link:cb,listItem:fb,list:pb,paragraph:hb,root:mb,strong:gb,table:yb,tableCell:bb,tableRow:vb,text:xb,thematicBreak:kb,toml:Or,yaml:Or,definition:Or,footnoteDefinition:Or};function Or(){}const Au=-1,Dr=0,jn=1,Mr=2,ko=3,So=4,Eo=5,Co=6,Iu=7,Tu=8,Ou=typeof self=="object"?self:globalThis,Eb=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,a]=t[i];switch(o){case Dr:case Au:return n(a,i);case jn:{const s=n([],i);for(const l of a)s.push(r(l));return s}case Mr:{const s=n({},i);for(const[l,u]of a)s[r(l)]=r(u);return s}case ko:return n(new Date(a),i);case So:{const{source:s,flags:l}=a;return n(new RegExp(s,l),i)}case Eo:{const s=n(new Map,i);for(const[l,u]of a)s.set(r(l),r(u));return s}case Co:{const s=n(new Set,i);for(const l of a)s.add(r(l));return s}case Iu:{const{name:s,message:l}=a;return n(new Ou[s](l),i)}case Tu:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:s}=new Uint8Array(a);return n(new DataView(s),a)}}return n(new Ou[o](a),i)};return r},Du=e=>Eb(new Map,e)(0),rn="",{toString:Cb}={},{keys:Ab}=Object,Un=e=>{const t=typeof e;if(t!=="object"||!e)return[Dr,t];const n=Cb.call(e).slice(8,-1);switch(n){case"Array":return[jn,rn];case"Object":return[Mr,rn];case"Date":return[ko,rn];case"RegExp":return[So,rn];case"Map":return[Eo,rn];case"Set":return[Co,rn];case"DataView":return[jn,n]}return n.includes("Array")?[jn,n]:n.includes("Error")?[Iu,n]:[Mr,n]},_r=([e,t])=>e===Dr&&(t==="function"||t==="symbol"),Ib=(e,t,n,r)=>{const i=(a,s)=>{const l=r.push(a)-1;return n.set(s,l),l},o=a=>{if(n.has(a))return n.get(a);let[s,l]=Un(a);switch(s){case Dr:{let f=a;switch(l){case"bigint":s=Tu,f=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);f=null;break;case"undefined":return i([Au],a)}return i([s,f],a)}case jn:{if(l){let p=a;return l==="DataView"?p=new Uint8Array(a.buffer):l==="ArrayBuffer"&&(p=new Uint8Array(a)),i([l,[...p]],a)}const f=[],c=i([s,f],a);for(const p of a)f.push(o(p));return c}case Mr:{if(l)switch(l){case"BigInt":return i([l,a.toString()],a);case"Boolean":case"Number":case"String":return i([l,a.valueOf()],a)}if(t&&"toJSON"in a)return o(a.toJSON());const f=[],c=i([s,f],a);for(const p of Ab(a))(e||!_r(Un(a[p])))&&f.push([o(p),o(a[p])]);return c}case ko:return i([s,a.toISOString()],a);case So:{const{source:f,flags:c}=a;return i([s,{source:f,flags:c}],a)}case Eo:{const f=[],c=i([s,f],a);for(const[p,d]of a)(e||!(_r(Un(p))||_r(Un(d))))&&f.push([o(p),o(d)]);return c}case Co:{const f=[],c=i([s,f],a);for(const p of a)(e||!_r(Un(p)))&&f.push(o(p));return c}}const{message:u}=a;return i([s,{name:l,message:u}],a)};return o},Mu=(e,{json:t,lossy:n}={})=>{const r=[];return Ib(!(t||n),!!t,new Map,r)(e),r},Pr=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Du(Mu(e,t)):structuredClone(e):(e,t)=>Du(Mu(e,t));function Tb(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 Ob(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Db(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Tb,r=e.options.footnoteBackLabel||Ob,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];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(),p=tn(c.toLowerCase());let d=0;const m=[],h=e.footnoteCounts.get(c);for(;h!==void 0&&++d<=h;){m.length>0&&m.push({type:"text",value:" "});let v=typeof n=="string"?n:n(l,d);typeof v=="string"&&(v={type:"text",value:v}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(d>1?"-"+d:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,d),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const g=f[f.length-1];if(g&&g.type==="element"&&g.tagName==="p"){const v=g.children[g.children.length-1];v&&v.type==="text"?v.value+=" ":g.children.push({type:"text",value:" "}),g.children.push(...m)}else f.push(...m);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(f,!0)};e.patch(u,y),s.push(y)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Pr(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
33
+ `});const u={type:"element",tagName:"li",properties:o,children:a};return e.patch(t,u),e.applyData(t,u)}function lb(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=vu(n[r])}return t}function vu(e){const t=e.spread;return t??e.children.length>1}function ub(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 a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.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 cb(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function fb(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function db(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function pb(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},s=io(t.children[1]),l=Bl(t.children[t.children.length-1]);s&&l&&(a.position={start:s,end:l}),i.push(a)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function hb(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,s=a?a.length:t.children.length;let l=-1;const u=[];for(;++l<s;){const c=t.children[l],p={},d=a?a[l]:void 0;d&&(p.align=d);let m={type:"element",tagName:o,properties:p,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 mb(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const bu=9,wu=32;function gb(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(xu(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(xu(t.slice(i),i>0,!1)),o.join("")}function xu(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===bu||o===wu;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===bu||o===wu;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function yb(e,t){const n={type:"text",value:gb(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function vb(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const bb={blockquote:Yv,break:Gv,code:Qv,delete:Jv,emphasis:Zv,footnoteReference:Xv,heading:eb,html:tb,imageReference:nb,image:rb,inlineCode:ib,linkReference:ob,link:ab,listItem:sb,list:ub,paragraph:cb,root:fb,strong:db,table:pb,tableCell:mb,tableRow:hb,text:yb,thematicBreak:vb,toml:Ar,yaml:Ar,definition:Ar,footnoteDefinition:Ar};function Ar(){}const ku=-1,Ir=0,Bn=1,Tr=2,vo=3,bo=4,wo=5,xo=6,Su=7,Eu=8,Cu=typeof self=="object"?self:globalThis,wb=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,a]=t[i];switch(o){case Ir:case ku:return n(a,i);case Bn:{const s=n([],i);for(const l of a)s.push(r(l));return s}case Tr:{const s=n({},i);for(const[l,u]of a)s[r(l)]=r(u);return s}case vo:return n(new Date(a),i);case bo:{const{source:s,flags:l}=a;return n(new RegExp(s,l),i)}case wo:{const s=n(new Map,i);for(const[l,u]of a)s.set(r(l),r(u));return s}case xo:{const s=n(new Set,i);for(const l of a)s.add(r(l));return s}case Su:{const{name:s,message:l}=a;return n(new Cu[s](l),i)}case Eu:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:s}=new Uint8Array(a);return n(new DataView(s),a)}}return n(new Cu[o](a),i)};return r},Au=e=>wb(new Map,e)(0),rn="",{toString:xb}={},{keys:kb}=Object,zn=e=>{const t=typeof e;if(t!=="object"||!e)return[Ir,t];const n=xb.call(e).slice(8,-1);switch(n){case"Array":return[Bn,rn];case"Object":return[Tr,rn];case"Date":return[vo,rn];case"RegExp":return[bo,rn];case"Map":return[wo,rn];case"Set":return[xo,rn];case"DataView":return[Bn,n]}return n.includes("Array")?[Bn,n]:n.includes("Error")?[Su,n]:[Tr,n]},Or=([e,t])=>e===Ir&&(t==="function"||t==="symbol"),Sb=(e,t,n,r)=>{const i=(a,s)=>{const l=r.push(a)-1;return n.set(s,l),l},o=a=>{if(n.has(a))return n.get(a);let[s,l]=zn(a);switch(s){case Ir:{let f=a;switch(l){case"bigint":s=Eu,f=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);f=null;break;case"undefined":return i([ku],a)}return i([s,f],a)}case Bn:{if(l){let p=a;return l==="DataView"?p=new Uint8Array(a.buffer):l==="ArrayBuffer"&&(p=new Uint8Array(a)),i([l,[...p]],a)}const f=[],c=i([s,f],a);for(const p of a)f.push(o(p));return c}case Tr:{if(l)switch(l){case"BigInt":return i([l,a.toString()],a);case"Boolean":case"Number":case"String":return i([l,a.valueOf()],a)}if(t&&"toJSON"in a)return o(a.toJSON());const f=[],c=i([s,f],a);for(const p of kb(a))(e||!Or(zn(a[p])))&&f.push([o(p),o(a[p])]);return c}case vo:return i([s,a.toISOString()],a);case bo:{const{source:f,flags:c}=a;return i([s,{source:f,flags:c}],a)}case wo:{const f=[],c=i([s,f],a);for(const[p,d]of a)(e||!(Or(zn(p))||Or(zn(d))))&&f.push([o(p),o(d)]);return c}case xo:{const f=[],c=i([s,f],a);for(const p of a)(e||!Or(zn(p)))&&f.push(o(p));return c}}const{message:u}=a;return i([s,{name:l,message:u}],a)};return o},Iu=(e,{json:t,lossy:n}={})=>{const r=[];return Sb(!(t||n),!!t,new Map,r)(e),r},Dr=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Au(Iu(e,t)):structuredClone(e):(e,t)=>Au(Iu(e,t));function Eb(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 Cb(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Ab(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Eb,r=e.options.footnoteBackLabel||Cb,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];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(),p=tn(c.toLowerCase());let d=0;const m=[],h=e.footnoteCounts.get(c);for(;h!==void 0&&++d<=h;){m.length>0&&m.push({type:"text",value:" "});let v=typeof n=="string"?n:n(l,d);typeof v=="string"&&(v={type:"text",value:v}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(d>1?"-"+d:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,d),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const g=f[f.length-1];if(g&&g.type==="element"&&g.tagName==="p"){const v=g.children[g.children.length-1];v&&v.type==="text"?v.value+=" ":g.children.push({type:"text",value:" "}),g.children.push(...m)}else f.push(...m);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(f,!0)};e.patch(u,y),s.push(y)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Dr(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
34
34
  `},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:`
35
- `}]}}const Nr=function(e){if(e==null)return Nb;if(typeof e=="function")return Lr(e);if(typeof e=="object")return Array.isArray(e)?Mb(e):_b(e);if(typeof e=="string")return Pb(e);throw new Error("Expected function, string, or object as test")};function Mb(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Nr(e[n]);return Lr(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function _b(e){const t=e;return Lr(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function Pb(e){return Lr(t);function t(n){return n&&n.type===e}}function Lr(e){return t;function t(n,r,i){return!!(Lb(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Nb(){return!0}function Lb(e){return e!==null&&typeof e=="object"&&"type"in e}function GT(e){return e}const _u=[],Fb=!0,Ao=!1,Rb="skip";function Pu(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=Nr(i),a=r?-1:1;s(e,void 0,[])();function s(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(p,"name",{value:"node ("+(l.type+(d?"<"+d+">":""))+")"})}return p;function p(){let d=_u,m,h,g;if((!t||o(l,u,f[f.length-1]||void 0))&&(d=Bb(n(l,f)),d[0]===Ao))return d;if("children"in l&&l.children){const y=l;if(y.children&&d[0]!==Rb)for(h=(r?y.children.length:-1)+a,g=f.concat(y);h>-1&&h<y.children.length;){const v=y.children[h];if(m=s(v,h,g)(),m[0]===Ao)return m;h=typeof m[1]=="number"?m[1]:h+a}}return d}}}function Bb(e){return Array.isArray(e)?e:typeof e=="number"?[Fb,e]:e==null?_u:[e]}function Io(e,t,n,r){let i,o,a;typeof t=="function"&&typeof n!="function"?(o=void 0,a=t,i=n):(o=t,a=n,i=r),Pu(e,o,s,i);function s(l,u){const f=u[u.length-1],c=f?f.children.indexOf(l):void 0;return a(l,c,f)}}const To={}.hasOwnProperty,zb={};function $b(e,t){const n=t||zb,r=new Map,i=new Map,o=new Map,a={...Sb,...n.handlers},s={all:u,applyData:Ub,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:a,one:l,options:n,patch:jb,wrap:Wb};return Io(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const c=f.type==="definition"?r:i,p=String(f.identifier).toUpperCase();c.has(p)||c.set(p,f)}}),s;function l(f,c){const p=f.type,d=s.handlers[p];if(To.call(s.handlers,p)&&d)return d(s,f,c);if(s.options.passThrough&&s.options.passThrough.includes(p)){if("children"in f){const{children:h,...g}=f,y=Pr(g);return y.children=s.all(f),y}return Pr(f)}return(s.options.unknownHandler||Hb)(s,f,c)}function u(f){const c=[];if("children"in f){const p=f.children;let d=-1;for(;++d<p.length;){const m=s.one(p[d],f);if(m){if(d&&p[d-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=Nu(m.value)),!Array.isArray(m)&&m.type==="element")){const h=m.children[0];h&&h.type==="text"&&(h.value=Nu(h.value))}Array.isArray(m)?c.push(...m):c.push(m)}}}return c}}function jb(e,t){e.position&&(t.position=Bg(e))}function Ub(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 a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&o&&Object.assign(n.properties,Pr(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Hb(e,t){const n=t.data||{},r="value"in t&&!(To.call(n,"hProperties")||To.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 Wb(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
35
+ `}]}}const Mr=function(e){if(e==null)return Db;if(typeof e=="function")return _r(e);if(typeof e=="object")return Array.isArray(e)?Ib(e):Tb(e);if(typeof e=="string")return Ob(e);throw new Error("Expected function, string, or object as test")};function Ib(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Mr(e[n]);return _r(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function Tb(e){const t=e;return _r(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function Ob(e){return _r(t);function t(n){return n&&n.type===e}}function _r(e){return t;function t(n,r,i){return!!(Mb(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Db(){return!0}function Mb(e){return e!==null&&typeof e=="object"&&"type"in e}function HT(e){return e}const Tu=[],_b=!0,ko=!1,Pb="skip";function Ou(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=Mr(i),a=r?-1:1;s(e,void 0,[])();function s(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(p,"name",{value:"node ("+(l.type+(d?"<"+d+">":""))+")"})}return p;function p(){let d=Tu,m,h,g;if((!t||o(l,u,f[f.length-1]||void 0))&&(d=Nb(n(l,f)),d[0]===ko))return d;if("children"in l&&l.children){const y=l;if(y.children&&d[0]!==Pb)for(h=(r?y.children.length:-1)+a,g=f.concat(y);h>-1&&h<y.children.length;){const v=y.children[h];if(m=s(v,h,g)(),m[0]===ko)return m;h=typeof m[1]=="number"?m[1]:h+a}}return d}}}function Nb(e){return Array.isArray(e)?e:typeof e=="number"?[_b,e]:e==null?Tu:[e]}function So(e,t,n,r){let i,o,a;typeof t=="function"&&typeof n!="function"?(o=void 0,a=t,i=n):(o=t,a=n,i=r),Ou(e,o,s,i);function s(l,u){const f=u[u.length-1],c=f?f.children.indexOf(l):void 0;return a(l,c,f)}}const Eo={}.hasOwnProperty,Lb={};function Fb(e,t){const n=t||Lb,r=new Map,i=new Map,o=new Map,a={...bb,...n.handlers},s={all:u,applyData:Bb,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:a,one:l,options:n,patch:Rb,wrap:$b};return So(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const c=f.type==="definition"?r:i,p=String(f.identifier).toUpperCase();c.has(p)||c.set(p,f)}}),s;function l(f,c){const p=f.type,d=s.handlers[p];if(Eo.call(s.handlers,p)&&d)return d(s,f,c);if(s.options.passThrough&&s.options.passThrough.includes(p)){if("children"in f){const{children:h,...g}=f,y=Dr(g);return y.children=s.all(f),y}return Dr(f)}return(s.options.unknownHandler||zb)(s,f,c)}function u(f){const c=[];if("children"in f){const p=f.children;let d=-1;for(;++d<p.length;){const m=s.one(p[d],f);if(m){if(d&&p[d-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=Du(m.value)),!Array.isArray(m)&&m.type==="element")){const h=m.children[0];h&&h.type==="text"&&(h.value=Du(h.value))}Array.isArray(m)?c.push(...m):c.push(m)}}}return c}}function Rb(e,t){e.position&&(t.position=Ng(e))}function Bb(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 a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&o&&Object.assign(n.properties,Dr(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function zb(e,t){const n=t.data||{},r="value"in t&&!(Eo.call(n,"hProperties")||Eo.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 $b(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 Nu(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Lu(e,t){const n=$b(e,t),r=n.one(e,void 0),i=Db(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 Vb(e,t){return e&&"run"in e?async function(n,r){const i=Lu(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Lu(n,{file:r,...e||t})}}function Fu(e){if(e)throw e}var Fr=Object.prototype.hasOwnProperty,Ru=Object.prototype.toString,Bu=Object.defineProperty,zu=Object.getOwnPropertyDescriptor,$u=function(t){return typeof Array.isArray=="function"?Array.isArray(t):Ru.call(t)==="[object Array]"},ju=function(t){if(!t||Ru.call(t)!=="[object Object]")return!1;var n=Fr.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Fr.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Fr.call(t,i)},Uu=function(t,n){Bu&&n.name==="__proto__"?Bu(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Hu=function(t,n){if(n==="__proto__")if(Fr.call(t,n)){if(zu)return zu(t,n).value}else return;return t[n]},qb=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,u=arguments.length,f=!1;for(typeof s=="boolean"&&(f=s,s=arguments[1]||{},l=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});l<u;++l)if(t=arguments[l],t!=null)for(n in t)r=Hu(s,n),i=Hu(t,n),s!==i&&(f&&i&&(ju(i)||(o=$u(i)))?(o?(o=!1,a=r&&$u(r)?r:[]):a=r&&ju(r)?r:{},Uu(s,{name:n,newValue:e(f,a,i)})):typeof i<"u"&&Uu(s,{name:n,newValue:i}));return s};const Oo=jt(qb);function Do(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 Kb(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);s(null,...i);function s(l,...u){const f=e[++o];let c=-1;if(l){a(l);return}for(;++c<i.length;)(u[c]===null||u[c]===void 0)&&(u[c]=i[c]);i=u,f?Yb(f,s)(...u):a(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 Yb(e,t){let n;return r;function r(...a){const s=e.length>a.length;let l;s&&a.push(i);try{l=e.apply(this,a)}catch(u){const f=u;if(s&&n)throw f;return i(f)}s||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(a,...s){n||(n=!0,t(a,...s))}function o(a){i(null,a)}}const yt={basename:Gb,dirname:Qb,extname:Jb,join:Zb,sep:"/"};function Gb(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Hn(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 a=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else a<0&&(o=!0,a=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function Qb(e){if(Hn(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 Jb(e){Hn(e);let t=e.length,n=-1,r=0,i=-1,o=0,a;for(;t--;){const s=e.codePointAt(t);if(s===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),s===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 Zb(...e){let t=-1,n;for(;++t<e.length;)Hn(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Xb(n)}function Xb(e){Hn(e);const t=e.codePointAt(0)===47;let n=ew(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function ew(e,t){let n="",r=0,i=-1,o=0,a=-1,s,l;for(;++a<=e.length;){if(a<e.length)s=e.codePointAt(a);else{if(s===47)break;s=47}if(s===47){if(!(i===a-1||o===1))if(i!==a-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=a,o=0;continue}}else if(n.length>0){n="",r=0,i=a,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,o=0}else s===46&&o>-1?o++:o=-1}return n}function Hn(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const tw={cwd:nw};function nw(){return"/"}function Mo(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function rw(e){if(typeof e=="string")e=new URL(e);else if(!Mo(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 iw(e)}function iw(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 _o=["history","path","basename","stem","extname","dirname"];class Wu{constructor(t){let n;t?Mo(t)?n={path:t}:typeof t=="string"||ow(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":tw.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<_o.length;){const o=_o[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)_o.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?yt.basename(this.path):void 0}set basename(t){No(t,"basename"),Po(t,"basename"),this.path=yt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?yt.dirname(this.path):void 0}set dirname(t){Vu(this.basename,"dirname"),this.path=yt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?yt.extname(this.path):void 0}set extname(t){if(Po(t,"extname"),Vu(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=yt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Mo(t)&&(t=rw(t)),No(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?yt.basename(this.path,this.extname):void 0}set stem(t){No(t,"stem"),Po(t,"stem"),this.path=yt.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 He(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 Po(e,t){if(e&&e.includes(yt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+yt.sep+"`")}function No(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Vu(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function ow(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const aw=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},sw={}.hasOwnProperty;class Lo extends aw{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=Kb()}copy(){const t=new Lo;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Oo(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Bo("data",this.frozen),this.namespace[t]=n,this):sw.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Bo("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=Rr(t),r=this.parser||this.Parser;return Fo("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Fo("process",this.parser||this.Parser),Ro("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,a){const s=Rr(t),l=r.parse(s);r.run(l,s,function(f,c,p){if(f||!c||!p)return u(f);const d=c,m=r.stringify(d,p);cw(m)?p.value=m:p.result=m,u(f,p)});function u(f,c){f||!c?a(f):o?o(c):n(void 0,c)}}}processSync(t){let n=!1,r;return this.freeze(),Fo("processSync",this.parser||this.Parser),Ro("processSync",this.compiler||this.Compiler),this.process(t,i),Ku("processSync","process",n),r;function i(o,a){n=!0,Fu(o),r=a}}run(t,n,r){qu(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(a,s){const l=Rr(n);i.run(t,l,u);function u(f,c,p){const d=c||t;f?s(f):a?a(d):r(void 0,d,p)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),Ku("runSync","run",r),i;function o(a,s){Fu(a),i=s,r=!0}}stringify(t,n){this.freeze();const r=Rr(n),i=this.compiler||this.Compiler;return Ro("stringify",i),qu(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Bo("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?s(t):a(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 a(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function a(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");s(u.plugins),u.settings&&(i.settings=Oo(!0,i.settings,u.settings))}function s(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,p=-1;for(;++c<r.length;)if(r[c][0]===u){p=c;break}if(p===-1)r.push([u,...f]);else if(f.length>0){let[d,...m]=f;const h=r[p][1];Do(h)&&Do(d)&&(d=Oo(!0,h,d)),r[p]=[u,d,...m]}}}}const lw=new Lo().freeze();function Fo(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ro(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Bo(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 qu(e){if(!Do(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Ku(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Rr(e){return uw(e)?e:new Wu(e)}function uw(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function cw(e){return typeof e=="string"||fw(e)}function fw(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const dw="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Yu=[],Gu={allowDangerousHtml:!0},pw=/^(https?|ircs?|mailto|xmpp)$/i,hw=[{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 Qu(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,o=e.components,a=e.disallowedElements,s=e.rehypePlugins||Yu,l=e.remarkPlugins||Yu,u=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Gu}:Gu,f=e.skipHtml,c=e.unwrapDisallowed,p=e.urlTransform||Ju,d=lw().use(Jv).use(l).use(Vb,u).use(s),m=new Wu;typeof r=="string"&&(m.value=r);for(const v of hw)Object.hasOwn(e,v.from)&&(""+v.from+(v.to?"use `"+v.to+"` instead":"remove it")+dw+v.id,void 0);const h=d.parse(m);let g=d.runSync(h,m);return i&&(g={type:"element",tagName:"div",properties:{className:i},children:g.type==="root"?g.children:[g]}),Io(g,y),Hg(g,{Fragment:S.Fragment,components:o,ignoreInvalidStyle:!0,jsx:S.jsx,jsxs:S.jsxs,passKeys:!0,passNode:!0});function y(v,w,A){if(v.type==="raw"&&A&&typeof w=="number")return f?A.children.splice(w,1):A.children[w]={type:"text",value:v.value},w;if(v.type==="element"){let k;for(k in ho)if(Object.hasOwn(ho,k)&&Object.hasOwn(v.properties,k)){const C=v.properties[k],T=ho[k];(T===null||T.includes(v.tagName))&&(v.properties[k]=p(String(C||""),k,v))}}if(v.type==="element"){let k=t?!t.includes(v.tagName):a?a.includes(v.tagName):!1;if(!k&&n&&typeof w=="number"&&(k=!n(v,w,A)),k&&A&&typeof w=="number")return c&&v.children?A.children.splice(w,1,...v.children):A.children.splice(w,1),w}}}function Ju(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||pw.test(e.slice(0,t))?e:""}function mw(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Zu(e,t,n){const i=Nr((n||{}).ignore||[]),o=gw(t);let a=-1;for(;++a<o.length;)Pu(e,"text",s);function s(u,f){let c=-1,p;for(;++c<f.length;){const d=f[c],m=p?p.children:void 0;if(i(d,m?m.indexOf(d):void 0,p))return;p=d}if(p)return l(u,f)}function l(u,f){const c=f[f.length-1],p=o[a][0],d=o[a][1];let m=0;const g=c.children.indexOf(u);let y=!1,v=[];p.lastIndex=0;let w=p.exec(u.value);for(;w;){const A=w.index,k={index:w.index,input:w.input,stack:[...f,u]};let C=d(...w,k);if(typeof C=="string"&&(C=C.length>0?{type:"text",value:C}:void 0),C===!1?p.lastIndex=A+1:(m!==A&&v.push({type:"text",value:u.value.slice(m,A)}),Array.isArray(C)?v.push(...C):C&&v.push(C),m=A+w[0].length,y=!0),!p.global)break;w=p.exec(u.value)}return y?(m<u.value.length&&v.push({type:"text",value:u.value.slice(m)}),c.children.splice(g,1,...v)):v=[u],g+v.length}}function gw(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([yw(i[0]),vw(i[1])])}return t}function yw(e){return typeof e=="string"?new RegExp(mw(e),"g"):e}function vw(e){return typeof e=="function"?e:function(){return e}}function bw(e){Zu(e,[/\r?\n|\r/g,ww])}function ww(){return{type:"break"}}function xw(){return function(e){bw(e)}}function Xu(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 zo="phrasing",$o=["autolink","link","image","label"];function kw(){return{transforms:[Ow],enter:{literalAutolink:Ew,literalAutolinkEmail:jo,literalAutolinkHttp:jo,literalAutolinkWww:jo},exit:{literalAutolink:Tw,literalAutolinkEmail:Iw,literalAutolinkHttp:Cw,literalAutolinkWww:Aw}}}function Sw(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:zo,notInConstruct:$o},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:zo,notInConstruct:$o},{character:":",before:"[ps]",after:"\\/",inConstruct:zo,notInConstruct:$o}]}}function Ew(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function jo(e){this.config.enter.autolinkProtocol.call(this,e)}function Cw(e){this.config.exit.autolinkProtocol.call(this,e)}function Aw(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 Iw(e){this.config.exit.autolinkEmail.call(this,e)}function Tw(e){this.exit(e)}function Ow(e){Zu(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Dw],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Mw]],{ignore:["link","linkReference"]})}function Dw(e,t,n,r,i){let o="";if(!ec(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!_w(n)))return!1;const a=Pw(n+r);if(!a[0])return!1;const s={type:"link",title:null,url:o+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[s,{type:"text",value:a[1]}]:s}function Mw(e,t,n,r){return!ec(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function _w(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 Pw(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=Xu(e,"(");let o=Xu(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 ec(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Wt(n)||Ar(n))&&(!t||n!==47)}tc.peek=Uw;function Nw(){this.buffer()}function Lw(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Fw(){this.buffer()}function Rw(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Bw(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ut(this.sliceSerialize(e)).toLowerCase(),n.label=t}function zw(e){this.exit(e)}function $w(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ut(this.sliceSerialize(e)).toLowerCase(),n.label=t}function jw(e){this.exit(e)}function Uw(){return"["}function tc(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const a=n.enter("footnoteReference"),s=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),s(),a(),o+=i.move("]"),o}function Hw(){return{enter:{gfmFootnoteCallString:Nw,gfmFootnoteCall:Lw,gfmFootnoteDefinitionLabelString:Fw,gfmFootnoteDefinition:Rw},exit:{gfmFootnoteCallString:Bw,gfmFootnoteCall:zw,gfmFootnoteDefinitionLabelString:$w,gfmFootnoteDefinition:jw}}}function Ww(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:tc},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,a){const s=o.createTracker(a);let l=s.move("[^");const u=o.enter("footnoteDefinition"),f=o.enter("label");return l+=s.move(o.safe(o.associationId(r),{before:l,after:"]"})),f(),l+=s.move("]:"),r.children&&r.children.length>0&&(s.shift(4),l+=s.move((t?`
40
- `:" ")+o.indentLines(o.containerFlow(r,s.current()),t?nc:Vw))),u(),l}}function Vw(e,t,n){return t===0?e:nc(e,t,n)}function nc(e,t,n){return(n?"":" ")+e}const qw=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];rc.peek=Jw;function Kw(){return{canContainEols:["delete"],enter:{strikethrough:Gw},exit:{strikethrough:Qw}}}function Yw(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:qw}],handlers:{delete:rc}}}function Gw(e){this.enter({type:"delete",children:[]},e)}function Qw(e){this.exit(e)}function rc(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let a=i.move("~~");return a+=n.containerPhrasing(e,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),o(),a}function Jw(){return"~"}function Zw(e){return e.length}function Xw(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Zw,o=[],a=[],s=[],l=[];let u=0,f=-1;for(;++f<e.length;){const h=[],g=[];let y=-1;for(e[f].length>u&&(u=e[f].length);++y<e[f].length;){const v=ex(e[f][y]);if(n.alignDelimiters!==!1){const w=i(v);g[y]=w,(l[y]===void 0||w>l[y])&&(l[y]=w)}h.push(v)}a[f]=h,s[f]=g}let c=-1;if(typeof r=="object"&&"length"in r)for(;++c<u;)o[c]=ic(r[c]);else{const h=ic(r);for(;++c<u;)o[c]=h}c=-1;const p=[],d=[];for(;++c<u;){const h=o[c];let g="",y="";h===99?(g=":",y=":"):h===108?g=":":h===114&&(y=":");let v=n.alignDelimiters===!1?1:Math.max(1,l[c]-g.length-y.length);const w=g+"-".repeat(v)+y;n.alignDelimiters!==!1&&(v=g.length+v+y.length,v>l[c]&&(l[c]=v),d[c]=v),p[c]=w}a.splice(1,0,p),s.splice(1,0,d),f=-1;const m=[];for(;++f<a.length;){const h=a[f],g=s[f];c=-1;const y=[];for(;++c<u;){const v=h[c]||"";let w="",A="";if(n.alignDelimiters!==!1){const k=l[c]-(g[c]||0),C=o[c];C===114?w=" ".repeat(k):C===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&&y.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&v==="")&&(n.delimiterStart!==!1||c)&&y.push(" "),n.alignDelimiters!==!1&&y.push(w),y.push(v),n.alignDelimiters!==!1&&y.push(A),n.padding!==!1&&y.push(" "),(n.delimiterEnd!==!1||c!==u-1)&&y.push("|")}m.push(n.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return m.join(`
41
- `)}function ex(e){return e==null?"":String(e)}function ic(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 tx(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const a=n.indentLines(n.containerFlow(e,o.current()),nx);return i(),a}function nx(e,t,n){return">"+(n?"":" ")+e}function rx(e,t){return oc(e,t.inConstruct,!0)&&!oc(e,t.notInConstruct,!1)}function oc(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 ac(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
42
- `&&rx(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
43
- `}function ix(e,t){const n=String(e);let r=n.indexOf(t),i=r,o=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>a&&(a=o):o=1,i=r+t.length,r=n.indexOf(t,i);return a}function ox(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 ax(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 sx(e,t,n,r){const i=ax(n),o=e.value||"",a=i==="`"?"GraveAccent":"Tilde";if(ox(e,n)){const c=n.enter("codeIndented"),p=n.indentLines(o,lx);return c(),p}const s=n.createTracker(r),l=i.repeat(Math.max(ix(o,i)+1,3)),u=n.enter("codeFenced");let f=s.move(l);if(e.lang){const c=n.enter(`codeFencedLang${a}`);f+=s.move(n.safe(e.lang,{before:f,after:" ",encode:["`"],...s.current()})),c()}if(e.lang&&e.meta){const c=n.enter(`codeFencedMeta${a}`);f+=s.move(" "),f+=s.move(n.safe(e.meta,{before:f,after:`
38
+ `}),n}function Du(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Mu(e,t){const n=Fb(e,t),r=n.one(e,void 0),i=Ab(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 jb(e,t){return e&&"run"in e?async function(n,r){const i=Mu(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Mu(n,{file:r,...e||t})}}function _u(e){if(e)throw e}var Pr=Object.prototype.hasOwnProperty,Pu=Object.prototype.toString,Nu=Object.defineProperty,Lu=Object.getOwnPropertyDescriptor,Fu=function(t){return typeof Array.isArray=="function"?Array.isArray(t):Pu.call(t)==="[object Array]"},Ru=function(t){if(!t||Pu.call(t)!=="[object Object]")return!1;var n=Pr.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Pr.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Pr.call(t,i)},Bu=function(t,n){Nu&&n.name==="__proto__"?Nu(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},zu=function(t,n){if(n==="__proto__")if(Pr.call(t,n)){if(Lu)return Lu(t,n).value}else return;return t[n]},Ub=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,u=arguments.length,f=!1;for(typeof s=="boolean"&&(f=s,s=arguments[1]||{},l=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});l<u;++l)if(t=arguments[l],t!=null)for(n in t)r=zu(s,n),i=zu(t,n),s!==i&&(f&&i&&(Ru(i)||(o=Fu(i)))?(o?(o=!1,a=r&&Fu(r)?r:[]):a=r&&Ru(r)?r:{},Bu(s,{name:n,newValue:e(f,a,i)})):typeof i<"u"&&Bu(s,{name:n,newValue:i}));return s};const Co=jt(Ub);function Ao(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 Hb(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);s(null,...i);function s(l,...u){const f=e[++o];let c=-1;if(l){a(l);return}for(;++c<i.length;)(u[c]===null||u[c]===void 0)&&(u[c]=i[c]);i=u,f?Wb(f,s)(...u):a(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 Wb(e,t){let n;return r;function r(...a){const s=e.length>a.length;let l;s&&a.push(i);try{l=e.apply(this,a)}catch(u){const f=u;if(s&&n)throw f;return i(f)}s||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(a,...s){n||(n=!0,t(a,...s))}function o(a){i(null,a)}}const yt={basename:Vb,dirname:qb,extname:Kb,join:Yb,sep:"/"};function Vb(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');$n(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 a=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else a<0&&(o=!0,a=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function qb(e){if($n(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 Kb(e){$n(e);let t=e.length,n=-1,r=0,i=-1,o=0,a;for(;t--;){const s=e.codePointAt(t);if(s===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),s===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 Yb(...e){let t=-1,n;for(;++t<e.length;)$n(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Gb(n)}function Gb(e){$n(e);const t=e.codePointAt(0)===47;let n=Qb(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Qb(e,t){let n="",r=0,i=-1,o=0,a=-1,s,l;for(;++a<=e.length;){if(a<e.length)s=e.codePointAt(a);else{if(s===47)break;s=47}if(s===47){if(!(i===a-1||o===1))if(i!==a-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=a,o=0;continue}}else if(n.length>0){n="",r=0,i=a,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,o=0}else s===46&&o>-1?o++:o=-1}return n}function $n(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Jb={cwd:Zb};function Zb(){return"/"}function Io(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Xb(e){if(typeof e=="string")e=new URL(e);else if(!Io(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 ew(e)}function ew(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 To=["history","path","basename","stem","extname","dirname"];class $u{constructor(t){let n;t?Io(t)?n={path:t}:typeof t=="string"||tw(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Jb.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<To.length;){const o=To[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)To.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?yt.basename(this.path):void 0}set basename(t){Do(t,"basename"),Oo(t,"basename"),this.path=yt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?yt.dirname(this.path):void 0}set dirname(t){ju(this.basename,"dirname"),this.path=yt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?yt.extname(this.path):void 0}set extname(t){if(Oo(t,"extname"),ju(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=yt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Io(t)&&(t=Xb(t)),Do(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?yt.basename(this.path,this.extname):void 0}set stem(t){Do(t,"stem"),Oo(t,"stem"),this.path=yt.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 We(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 Oo(e,t){if(e&&e.includes(yt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+yt.sep+"`")}function Do(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function ju(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function tw(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const nw=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},rw={}.hasOwnProperty;class Mo extends nw{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=Hb()}copy(){const t=new Mo;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Co(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(No("data",this.frozen),this.namespace[t]=n,this):rw.call(this.namespace,t)&&this.namespace[t]||void 0:t?(No("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=Nr(t),r=this.parser||this.Parser;return _o("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),_o("process",this.parser||this.Parser),Po("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,a){const s=Nr(t),l=r.parse(s);r.run(l,s,function(f,c,p){if(f||!c||!p)return u(f);const d=c,m=r.stringify(d,p);aw(m)?p.value=m:p.result=m,u(f,p)});function u(f,c){f||!c?a(f):o?o(c):n(void 0,c)}}}processSync(t){let n=!1,r;return this.freeze(),_o("processSync",this.parser||this.Parser),Po("processSync",this.compiler||this.Compiler),this.process(t,i),Hu("processSync","process",n),r;function i(o,a){n=!0,_u(o),r=a}}run(t,n,r){Uu(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(a,s){const l=Nr(n);i.run(t,l,u);function u(f,c,p){const d=c||t;f?s(f):a?a(d):r(void 0,d,p)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),Hu("runSync","run",r),i;function o(a,s){_u(a),i=s,r=!0}}stringify(t,n){this.freeze();const r=Nr(n),i=this.compiler||this.Compiler;return Po("stringify",i),Uu(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(No("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?s(t):a(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 a(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function a(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");s(u.plugins),u.settings&&(i.settings=Co(!0,i.settings,u.settings))}function s(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,p=-1;for(;++c<r.length;)if(r[c][0]===u){p=c;break}if(p===-1)r.push([u,...f]);else if(f.length>0){let[d,...m]=f;const h=r[p][1];Ao(h)&&Ao(d)&&(d=Co(!0,h,d)),r[p]=[u,d,...m]}}}}const iw=new Mo().freeze();function _o(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Po(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function No(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 Uu(e){if(!Ao(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Hu(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Nr(e){return ow(e)?e:new $u(e)}function ow(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function aw(e){return typeof e=="string"||sw(e)}function sw(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const lw="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Wu=[],Vu={allowDangerousHtml:!0},uw=/^(https?|ircs?|mailto|xmpp)$/i,cw=[{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 qu(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,o=e.components,a=e.disallowedElements,s=e.rehypePlugins||Wu,l=e.remarkPlugins||Wu,u=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Vu}:Vu,f=e.skipHtml,c=e.unwrapDisallowed,p=e.urlTransform||Ku,d=iw().use(Kv).use(l).use(jb,u).use(s),m=new $u;typeof r=="string"&&(m.value=r);for(const v of cw)Object.hasOwn(e,v.from)&&(""+v.from+(v.to?"use `"+v.to+"` instead":"remove it")+lw+v.id,void 0);const h=d.parse(m);let g=d.runSync(h,m);return i&&(g={type:"element",tagName:"div",properties:{className:i},children:g.type==="root"?g.children:[g]}),So(g,y),zg(g,{Fragment:S.Fragment,components:o,ignoreInvalidStyle:!0,jsx:S.jsx,jsxs:S.jsxs,passKeys:!0,passNode:!0});function y(v,w,A){if(v.type==="raw"&&A&&typeof w=="number")return f?A.children.splice(w,1):A.children[w]={type:"text",value:v.value},w;if(v.type==="element"){let k;for(k in uo)if(Object.hasOwn(uo,k)&&Object.hasOwn(v.properties,k)){const C=v.properties[k],T=uo[k];(T===null||T.includes(v.tagName))&&(v.properties[k]=p(String(C||""),k,v))}}if(v.type==="element"){let k=t?!t.includes(v.tagName):a?a.includes(v.tagName):!1;if(!k&&n&&typeof w=="number"&&(k=!n(v,w,A)),k&&A&&typeof w=="number")return c&&v.children?A.children.splice(w,1,...v.children):A.children.splice(w,1),w}}}function Ku(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||uw.test(e.slice(0,t))?e:""}function fw(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Yu(e,t,n){const i=Mr((n||{}).ignore||[]),o=dw(t);let a=-1;for(;++a<o.length;)Ou(e,"text",s);function s(u,f){let c=-1,p;for(;++c<f.length;){const d=f[c],m=p?p.children:void 0;if(i(d,m?m.indexOf(d):void 0,p))return;p=d}if(p)return l(u,f)}function l(u,f){const c=f[f.length-1],p=o[a][0],d=o[a][1];let m=0;const g=c.children.indexOf(u);let y=!1,v=[];p.lastIndex=0;let w=p.exec(u.value);for(;w;){const A=w.index,k={index:w.index,input:w.input,stack:[...f,u]};let C=d(...w,k);if(typeof C=="string"&&(C=C.length>0?{type:"text",value:C}:void 0),C===!1?p.lastIndex=A+1:(m!==A&&v.push({type:"text",value:u.value.slice(m,A)}),Array.isArray(C)?v.push(...C):C&&v.push(C),m=A+w[0].length,y=!0),!p.global)break;w=p.exec(u.value)}return y?(m<u.value.length&&v.push({type:"text",value:u.value.slice(m)}),c.children.splice(g,1,...v)):v=[u],g+v.length}}function dw(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([pw(i[0]),hw(i[1])])}return t}function pw(e){return typeof e=="string"?new RegExp(fw(e),"g"):e}function hw(e){return typeof e=="function"?e:function(){return e}}function mw(e){Yu(e,[/\r?\n|\r/g,gw])}function gw(){return{type:"break"}}function yw(){return function(e){mw(e)}}function Gu(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 Lo="phrasing",Fo=["autolink","link","image","label"];function vw(){return{transforms:[Cw],enter:{literalAutolink:ww,literalAutolinkEmail:Ro,literalAutolinkHttp:Ro,literalAutolinkWww:Ro},exit:{literalAutolink:Ew,literalAutolinkEmail:Sw,literalAutolinkHttp:xw,literalAutolinkWww:kw}}}function bw(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Lo,notInConstruct:Fo},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Lo,notInConstruct:Fo},{character:":",before:"[ps]",after:"\\/",inConstruct:Lo,notInConstruct:Fo}]}}function ww(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Ro(e){this.config.enter.autolinkProtocol.call(this,e)}function xw(e){this.config.exit.autolinkProtocol.call(this,e)}function kw(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 Sw(e){this.config.exit.autolinkEmail.call(this,e)}function Ew(e){this.exit(e)}function Cw(e){Yu(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Aw],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Iw]],{ignore:["link","linkReference"]})}function Aw(e,t,n,r,i){let o="";if(!Qu(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!Tw(n)))return!1;const a=Ow(n+r);if(!a[0])return!1;const s={type:"link",title:null,url:o+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[s,{type:"text",value:a[1]}]:s}function Iw(e,t,n,r){return!Qu(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function Tw(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 Ow(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=Gu(e,"(");let o=Gu(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 Qu(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Wt(n)||Sr(n))&&(!t||n!==47)}Ju.peek=Bw;function Dw(){this.buffer()}function Mw(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function _w(){this.buffer()}function Pw(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Nw(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ut(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Lw(e){this.exit(e)}function Fw(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ut(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Rw(e){this.exit(e)}function Bw(){return"["}function Ju(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const a=n.enter("footnoteReference"),s=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),s(),a(),o+=i.move("]"),o}function zw(){return{enter:{gfmFootnoteCallString:Dw,gfmFootnoteCall:Mw,gfmFootnoteDefinitionLabelString:_w,gfmFootnoteDefinition:Pw},exit:{gfmFootnoteCallString:Nw,gfmFootnoteCall:Lw,gfmFootnoteDefinitionLabelString:Fw,gfmFootnoteDefinition:Rw}}}function $w(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Ju},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,a){const s=o.createTracker(a);let l=s.move("[^");const u=o.enter("footnoteDefinition"),f=o.enter("label");return l+=s.move(o.safe(o.associationId(r),{before:l,after:"]"})),f(),l+=s.move("]:"),r.children&&r.children.length>0&&(s.shift(4),l+=s.move((t?`
40
+ `:" ")+o.indentLines(o.containerFlow(r,s.current()),t?Zu:jw))),u(),l}}function jw(e,t,n){return t===0?e:Zu(e,t,n)}function Zu(e,t,n){return(n?"":" ")+e}const Uw=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Xu.peek=Kw;function Hw(){return{canContainEols:["delete"],enter:{strikethrough:Vw},exit:{strikethrough:qw}}}function Ww(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Uw}],handlers:{delete:Xu}}}function Vw(e){this.enter({type:"delete",children:[]},e)}function qw(e){this.exit(e)}function Xu(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let a=i.move("~~");return a+=n.containerPhrasing(e,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),o(),a}function Kw(){return"~"}function Yw(e){return e.length}function Gw(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Yw,o=[],a=[],s=[],l=[];let u=0,f=-1;for(;++f<e.length;){const h=[],g=[];let y=-1;for(e[f].length>u&&(u=e[f].length);++y<e[f].length;){const v=Qw(e[f][y]);if(n.alignDelimiters!==!1){const w=i(v);g[y]=w,(l[y]===void 0||w>l[y])&&(l[y]=w)}h.push(v)}a[f]=h,s[f]=g}let c=-1;if(typeof r=="object"&&"length"in r)for(;++c<u;)o[c]=ec(r[c]);else{const h=ec(r);for(;++c<u;)o[c]=h}c=-1;const p=[],d=[];for(;++c<u;){const h=o[c];let g="",y="";h===99?(g=":",y=":"):h===108?g=":":h===114&&(y=":");let v=n.alignDelimiters===!1?1:Math.max(1,l[c]-g.length-y.length);const w=g+"-".repeat(v)+y;n.alignDelimiters!==!1&&(v=g.length+v+y.length,v>l[c]&&(l[c]=v),d[c]=v),p[c]=w}a.splice(1,0,p),s.splice(1,0,d),f=-1;const m=[];for(;++f<a.length;){const h=a[f],g=s[f];c=-1;const y=[];for(;++c<u;){const v=h[c]||"";let w="",A="";if(n.alignDelimiters!==!1){const k=l[c]-(g[c]||0),C=o[c];C===114?w=" ".repeat(k):C===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&&y.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&v==="")&&(n.delimiterStart!==!1||c)&&y.push(" "),n.alignDelimiters!==!1&&y.push(w),y.push(v),n.alignDelimiters!==!1&&y.push(A),n.padding!==!1&&y.push(" "),(n.delimiterEnd!==!1||c!==u-1)&&y.push("|")}m.push(n.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return m.join(`
41
+ `)}function Qw(e){return e==null?"":String(e)}function ec(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 Jw(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const a=n.indentLines(n.containerFlow(e,o.current()),Zw);return i(),a}function Zw(e,t,n){return">"+(n?"":" ")+e}function Xw(e,t){return tc(e,t.inConstruct,!0)&&!tc(e,t.notInConstruct,!1)}function tc(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 nc(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
42
+ `&&Xw(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
43
+ `}function ex(e,t){const n=String(e);let r=n.indexOf(t),i=r,o=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>a&&(a=o):o=1,i=r+t.length,r=n.indexOf(t,i);return a}function tx(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 nx(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 rx(e,t,n,r){const i=nx(n),o=e.value||"",a=i==="`"?"GraveAccent":"Tilde";if(tx(e,n)){const c=n.enter("codeIndented"),p=n.indentLines(o,ix);return c(),p}const s=n.createTracker(r),l=i.repeat(Math.max(ex(o,i)+1,3)),u=n.enter("codeFenced");let f=s.move(l);if(e.lang){const c=n.enter(`codeFencedLang${a}`);f+=s.move(n.safe(e.lang,{before:f,after:" ",encode:["`"],...s.current()})),c()}if(e.lang&&e.meta){const c=n.enter(`codeFencedMeta${a}`);f+=s.move(" "),f+=s.move(n.safe(e.meta,{before:f,after:`
44
44
  `,encode:["`"],...s.current()})),c()}return f+=s.move(`
45
45
  `),o&&(f+=s.move(o+`
46
- `)),f+=s.move(l),u(),f}function lx(e,t,n){return(n?"":" ")+e}function Uo(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 ux(e,t,n,r){const i=Uo(n),o=i==='"'?"Quote":"Apostrophe",a=n.enter("definition");let s=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("]: "),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(s=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":`
47
- `,...l.current()}))),s(),e.title&&(s=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),s()),a(),u}function cx(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 Wn(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Br(e,t,n){const r=nn(e),i=nn(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}}sc.peek=fx;function sc(e,t,n,r){const i=cx(n),o=n.enter("emphasis"),a=n.createTracker(r),s=a.move(i);let l=a.move(n.containerPhrasing(e,{after:i,before:s,...a.current()}));const u=l.charCodeAt(0),f=Br(r.before.charCodeAt(r.before.length-1),u,i);f.inside&&(l=Wn(u)+l.slice(1));const c=l.charCodeAt(l.length-1),p=Br(r.after.charCodeAt(0),c,i);p.inside&&(l=l.slice(0,-1)+Wn(c));const d=a.move(i);return o(),n.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},s+l+d}function fx(e,t,n){return n.options.emphasis||"*"}function dx(e,t){let n=!1;return Io(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Ao}),!!((!e.depth||e.depth<3)&&mo(e)&&(t.options.setext||n))}function px(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(dx(e,n)){const f=n.enter("headingSetext"),c=n.enter("phrasing"),p=n.containerPhrasing(e,{...o.current(),before:`
46
+ `)),f+=s.move(l),u(),f}function ix(e,t,n){return(n?"":" ")+e}function Bo(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 ox(e,t,n,r){const i=Bo(n),o=i==='"'?"Quote":"Apostrophe",a=n.enter("definition");let s=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("]: "),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(s=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":`
47
+ `,...l.current()}))),s(),e.title&&(s=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),s()),a(),u}function ax(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 jn(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Lr(e,t,n){const r=nn(e),i=nn(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}}rc.peek=sx;function rc(e,t,n,r){const i=ax(n),o=n.enter("emphasis"),a=n.createTracker(r),s=a.move(i);let l=a.move(n.containerPhrasing(e,{after:i,before:s,...a.current()}));const u=l.charCodeAt(0),f=Lr(r.before.charCodeAt(r.before.length-1),u,i);f.inside&&(l=jn(u)+l.slice(1));const c=l.charCodeAt(l.length-1),p=Lr(r.after.charCodeAt(0),c,i);p.inside&&(l=l.slice(0,-1)+jn(c));const d=a.move(i);return o(),n.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},s+l+d}function sx(e,t,n){return n.options.emphasis||"*"}function lx(e,t){let n=!1;return So(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,ko}),!!((!e.depth||e.depth<3)&&co(e)&&(t.options.setext||n))}function ux(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(lx(e,n)){const f=n.enter("headingSetext"),c=n.enter("phrasing"),p=n.containerPhrasing(e,{...o.current(),before:`
48
48
  `,after:`
49
49
  `});return c(),f(),p+`
50
50
  `+(i===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
51
51
  `))+1))}const a="#".repeat(i),s=n.enter("headingAtx"),l=n.enter("phrasing");o.move(a+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
52
- `,...o.current()});return/^[\t ]/.test(u)&&(u=Wn(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,n.options.closeAtx&&(u+=" "+a),l(),s(),u}lc.peek=hx;function lc(e){return e.value||""}function hx(){return"<"}uc.peek=mx;function uc(e,t,n,r){const i=Uo(n),o=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let s=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("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(s=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),s(),e.title&&(s=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),s()),u+=l.move(")"),a(),u}function mx(){return"!"}cc.peek=gx;function cc(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let a=n.enter("label");const s=n.createTracker(r);let l=s.move("![");const u=n.safe(e.alt,{before:l,after:"]",...s.current()});l+=s.move(u+"]["),a();const f=n.stack;n.stack=[],a=n.enter("reference");const c=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return a(),n.stack=f,o(),i==="full"||!u||u!==c?l+=s.move(c+"]"):i==="shortcut"?l=l.slice(0,-1):l+=s.move("]"),l}function gx(){return"!"}fc.peek=yx;function fc(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 a=n.unsafe[o],s=n.compilePattern(a);let l;if(a.atBreak)for(;l=s.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 yx(){return"`"}function dc(e,t){const n=mo(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))}pc.peek=vx;function pc(e,t,n,r){const i=Uo(n),o=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let s,l;if(dc(e,n)){const f=n.stack;n.stack=[],s=n.enter("autolink");let c=a.move("<");return c+=a.move(n.containerPhrasing(e,{before:c,after:">",...a.current()})),c+=a.move(">"),s(),n.stack=f,c}s=n.enter("link"),l=n.enter("label");let u=a.move("[");return u+=a.move(n.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(n.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(l=n.enter("destinationRaw"),u+=a.move(n.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=n.enter(`title${o}`),u+=a.move(" "+i),u+=a.move(n.safe(e.title,{before:u,after:i,...a.current()})),u+=a.move(i),l()),u+=a.move(")"),s(),u}function vx(e,t,n){return dc(e,n)?"<":"["}hc.peek=bx;function hc(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let a=n.enter("label");const s=n.createTracker(r);let l=s.move("[");const u=n.containerPhrasing(e,{before:l,after:"]",...s.current()});l+=s.move(u+"]["),a();const f=n.stack;n.stack=[],a=n.enter("reference");const c=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return a(),n.stack=f,o(),i==="full"||!u||u!==c?l+=s.move(c+"]"):i==="shortcut"?l=l.slice(0,-1):l+=s.move("]"),l}function bx(){return"["}function Ho(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 wx(e){const t=Ho(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 xx(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 mc(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 kx(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let a=e.ordered?xx(n):Ho(n);const s=e.ordered?a==="."?")":".":wx(n);let l=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&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),mc(n)===a&&f){let c=-1;for(;++c<e.children.length;){const p=e.children[c];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(a=s),n.bulletCurrent=a;const u=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=o,i(),u}function Sx(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 Ex(e,t,n,r){const i=Sx(n);let o=n.bulletCurrent||Ho(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 a=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const s=n.createTracker(r);s.move(o+" ".repeat(a-o.length)),s.shift(a);const l=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,s.current()),f);return l(),u;function f(c,p,d){return p?(d?"":" ".repeat(a))+c:(d?o:o+" ".repeat(a-o.length))+c}}function Cx(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),a=n.containerPhrasing(e,r);return o(),i(),a}const Ax=Nr(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Ix(e,t,n,r){return(e.children.some(function(a){return Ax(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Tx(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}gc.peek=Ox;function gc(e,t,n,r){const i=Tx(n),o=n.enter("strong"),a=n.createTracker(r),s=a.move(i+i);let l=a.move(n.containerPhrasing(e,{after:i,before:s,...a.current()}));const u=l.charCodeAt(0),f=Br(r.before.charCodeAt(r.before.length-1),u,i);f.inside&&(l=Wn(u)+l.slice(1));const c=l.charCodeAt(l.length-1),p=Br(r.after.charCodeAt(0),c,i);p.inside&&(l=l.slice(0,-1)+Wn(c));const d=a.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},s+l+d}function Ox(e,t,n){return n.options.strong||"*"}function Dx(e,t,n,r){return n.safe(e.value,r)}function Mx(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 _x(e,t,n){const r=(mc(n)+(n.options.ruleSpaces?" ":"")).repeat(Mx(n));return n.options.ruleSpaces?r.slice(0,-1):r}const yc={blockquote:tx,break:ac,code:sx,definition:ux,emphasis:sc,hardBreak:ac,heading:px,html:lc,image:uc,imageReference:cc,inlineCode:fc,link:pc,linkReference:hc,list:kx,listItem:Ex,paragraph:Cx,root:Ix,strong:gc,text:Dx,thematicBreak:_x};function Px(){return{enter:{table:Nx,tableData:vc,tableHeader:vc,tableRow:Fx},exit:{codeText:Rx,table:Lx,tableData:Wo,tableHeader:Wo,tableRow:Wo}}}function Nx(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 Lx(e){this.exit(e),this.data.inTable=void 0}function Fx(e){this.enter({type:"tableRow",children:[]},e)}function Wo(e){this.exit(e)}function vc(e){this.enter({type:"tableCell",children:[]},e)}function Rx(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Bx));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Bx(e,t){return t==="|"?t:e}function zx(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
52
+ `,...o.current()});return/^[\t ]/.test(u)&&(u=jn(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,n.options.closeAtx&&(u+=" "+a),l(),s(),u}ic.peek=cx;function ic(e){return e.value||""}function cx(){return"<"}oc.peek=fx;function oc(e,t,n,r){const i=Bo(n),o=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let s=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("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(s=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),s(),e.title&&(s=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),s()),u+=l.move(")"),a(),u}function fx(){return"!"}ac.peek=dx;function ac(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let a=n.enter("label");const s=n.createTracker(r);let l=s.move("![");const u=n.safe(e.alt,{before:l,after:"]",...s.current()});l+=s.move(u+"]["),a();const f=n.stack;n.stack=[],a=n.enter("reference");const c=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return a(),n.stack=f,o(),i==="full"||!u||u!==c?l+=s.move(c+"]"):i==="shortcut"?l=l.slice(0,-1):l+=s.move("]"),l}function dx(){return"!"}sc.peek=px;function sc(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 a=n.unsafe[o],s=n.compilePattern(a);let l;if(a.atBreak)for(;l=s.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 px(){return"`"}function lc(e,t){const n=co(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))}uc.peek=hx;function uc(e,t,n,r){const i=Bo(n),o=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let s,l;if(lc(e,n)){const f=n.stack;n.stack=[],s=n.enter("autolink");let c=a.move("<");return c+=a.move(n.containerPhrasing(e,{before:c,after:">",...a.current()})),c+=a.move(">"),s(),n.stack=f,c}s=n.enter("link"),l=n.enter("label");let u=a.move("[");return u+=a.move(n.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(n.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(l=n.enter("destinationRaw"),u+=a.move(n.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=n.enter(`title${o}`),u+=a.move(" "+i),u+=a.move(n.safe(e.title,{before:u,after:i,...a.current()})),u+=a.move(i),l()),u+=a.move(")"),s(),u}function hx(e,t,n){return lc(e,n)?"<":"["}cc.peek=mx;function cc(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let a=n.enter("label");const s=n.createTracker(r);let l=s.move("[");const u=n.containerPhrasing(e,{before:l,after:"]",...s.current()});l+=s.move(u+"]["),a();const f=n.stack;n.stack=[],a=n.enter("reference");const c=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return a(),n.stack=f,o(),i==="full"||!u||u!==c?l+=s.move(c+"]"):i==="shortcut"?l=l.slice(0,-1):l+=s.move("]"),l}function mx(){return"["}function zo(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 gx(e){const t=zo(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 yx(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 fc(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 vx(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let a=e.ordered?yx(n):zo(n);const s=e.ordered?a==="."?")":".":gx(n);let l=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&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),fc(n)===a&&f){let c=-1;for(;++c<e.children.length;){const p=e.children[c];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(a=s),n.bulletCurrent=a;const u=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=o,i(),u}function bx(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 wx(e,t,n,r){const i=bx(n);let o=n.bulletCurrent||zo(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 a=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const s=n.createTracker(r);s.move(o+" ".repeat(a-o.length)),s.shift(a);const l=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,s.current()),f);return l(),u;function f(c,p,d){return p?(d?"":" ".repeat(a))+c:(d?o:o+" ".repeat(a-o.length))+c}}function xx(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),a=n.containerPhrasing(e,r);return o(),i(),a}const kx=Mr(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Sx(e,t,n,r){return(e.children.some(function(a){return kx(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Ex(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}dc.peek=Cx;function dc(e,t,n,r){const i=Ex(n),o=n.enter("strong"),a=n.createTracker(r),s=a.move(i+i);let l=a.move(n.containerPhrasing(e,{after:i,before:s,...a.current()}));const u=l.charCodeAt(0),f=Lr(r.before.charCodeAt(r.before.length-1),u,i);f.inside&&(l=jn(u)+l.slice(1));const c=l.charCodeAt(l.length-1),p=Lr(r.after.charCodeAt(0),c,i);p.inside&&(l=l.slice(0,-1)+jn(c));const d=a.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},s+l+d}function Cx(e,t,n){return n.options.strong||"*"}function Ax(e,t,n,r){return n.safe(e.value,r)}function Ix(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 Tx(e,t,n){const r=(fc(n)+(n.options.ruleSpaces?" ":"")).repeat(Ix(n));return n.options.ruleSpaces?r.slice(0,-1):r}const pc={blockquote:Jw,break:nc,code:rx,definition:ox,emphasis:rc,hardBreak:nc,heading:ux,html:ic,image:oc,imageReference:ac,inlineCode:sc,link:uc,linkReference:cc,list:vx,listItem:wx,paragraph:xx,root:Sx,strong:dc,text:Ax,thematicBreak:Tx};function Ox(){return{enter:{table:Dx,tableData:hc,tableHeader:hc,tableRow:_x},exit:{codeText:Px,table:Mx,tableData:$o,tableHeader:$o,tableRow:$o}}}function Dx(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 Mx(e){this.exit(e),this.data.inTable=void 0}function _x(e){this.enter({type:"tableRow",children:[]},e)}function $o(e){this.exit(e)}function hc(e){this.enter({type:"tableCell",children:[]},e)}function Px(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Nx));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Nx(e,t){return t==="|"?t:e}function Lx(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
53
53
  `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:a,tableCell:l,tableRow:s}};function a(d,m,h,g){return u(f(d,h,g),d.align)}function s(d,m,h,g){const y=c(d,h,g),v=u([y]);return v.slice(0,v.indexOf(`
54
- `))}function l(d,m,h,g){const y=h.enter("tableCell"),v=h.enter("phrasing"),w=h.containerPhrasing(d,{...g,before:o,after:o});return v(),y(),w}function u(d,m){return Xw(d,{align:m,alignDelimiters:r,padding:n,stringLength:i})}function f(d,m,h){const g=d.children;let y=-1;const v=[],w=m.enter("table");for(;++y<g.length;)v[y]=c(g[y],m,h);return w(),v}function c(d,m,h){const g=d.children;let y=-1;const v=[],w=m.enter("tableRow");for(;++y<g.length;)v[y]=l(g[y],d,m,h);return w(),v}function p(d,m,h){let g=yc.inlineCode(d,m,h);return h.stack.includes("tableCell")&&(g=g.replace(/\|/g,"\\$&")),g}}function $x(){return{exit:{taskListCheckValueChecked:bc,taskListCheckValueUnchecked:bc,paragraph:Ux}}}function jx(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Hx}}}function bc(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Ux(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,a;for(;++o<i.length;){const s=i[o];if(s.type==="paragraph"){a=s;break}}a===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 Hx(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",s=n.createTracker(r);o&&s.move(a);let l=yc.listItem(e,t,n,{...r,...s.current()});return o&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),l;function u(f){return f+a}}function Wx(){return[kw(),Hw(),Kw(),Px(),$x()]}function Vx(e){return{extensions:[Sw(),Ww(e),Yw(),zx(e),jx()]}}const qx={tokenize:Zx,partial:!0},wc={tokenize:Xx,partial:!0},xc={tokenize:e0,partial:!0},kc={tokenize:t0,partial:!0},Kx={tokenize:n0,partial:!0},Sc={name:"wwwAutolink",tokenize:Qx,previous:Cc},Ec={name:"protocolAutolink",tokenize:Jx,previous:Ac},Et={name:"emailAutolink",tokenize:Gx,previous:Ic},vt={};function Yx(){return{text:vt}}let Vt=48;for(;Vt<123;)vt[Vt]=Et,Vt++,Vt===58?Vt=65:Vt===91&&(Vt=97);vt[43]=Et,vt[45]=Et,vt[46]=Et,vt[95]=Et,vt[72]=[Et,Ec],vt[104]=[Et,Ec],vt[87]=[Et,Sc],vt[119]=[Et,Sc];function Gx(e,t,n){const r=this;let i,o;return a;function a(c){return!Vo(c)||!Ic.call(r,r.previous)||qo(r.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(c))}function s(c){return Vo(c)?(e.consume(c),s):c===64?(e.consume(c),l):n(c)}function l(c){return c===46?e.check(Kx,f,u)(c):c===45||c===95||We(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&&qe(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(c)):n(c)}}function Qx(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!Cc.call(r,r.previous)||qo(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(qx,e.attempt(wc,e.attempt(xc,o),n),n)(a))}function o(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function Jx(e,t,n){const r=this;let i="",o=!1;return a;function a(c){return(c===72||c===104)&&Ac.call(r,r.previous)&&!qo(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(c),e.consume(c),s):n(c)}function s(c){if(qe(c)&&i.length<5)return i+=String.fromCodePoint(c),e.consume(c),s;if(c===58){const p=i.toLowerCase();if(p==="http"||p==="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||Cr(c)||Ie(c)||Wt(c)||Ar(c)?n(c):e.attempt(wc,e.attempt(xc,f),n)(c)}function f(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(c)}}function Zx(e,t,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),i):a===46&&r===3?(e.consume(a),o):n(a)}function o(a){return a===null?n(a):t(a)}}function Xx(e,t,n){let r,i,o;return a;function a(u){return u===46||u===95?e.check(kc,l,s)(u):u===null||Ie(u)||Wt(u)||u!==45&&Ar(u)?l(u):(o=!0,e.consume(u),a)}function s(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),a}function l(u){return i||r||!o?n(u):t(u)}}function e0(e,t){let n=0,r=0;return i;function i(a){return a===40?(n++,e.consume(a),i):a===41&&r<n?o(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(kc,t,o)(a):a===null||Ie(a)||Wt(a)?t(a):(e.consume(a),i)}function o(a){return a===41&&r++,e.consume(a),i}}function t0(e,t,n){return r;function r(s){return s===33||s===34||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===63||s===95||s===126?(e.consume(s),r):s===38?(e.consume(s),o):s===93?(e.consume(s),i):s===60||s===null||Ie(s)||Wt(s)?t(s):n(s)}function i(s){return s===null||s===40||s===91||Ie(s)||Wt(s)?t(s):r(s)}function o(s){return qe(s)?a(s):n(s)}function a(s){return s===59?(e.consume(s),r):qe(s)?(e.consume(s),a):n(s)}}function n0(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return We(o)?n(o):t(o)}}function Cc(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ie(e)}function Ac(e){return!qe(e)}function Ic(e){return!(e===47||Vo(e))}function Vo(e){return e===43||e===45||e===46||e===95||We(e)}function qo(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 r0={tokenize:f0,partial:!0};function i0(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:l0,continuation:{tokenize:u0},exit:c0}},text:{91:{name:"gfmFootnoteCall",tokenize:s0},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:o0,resolveTo:a0}}}}function o0(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return s;function s(l){if(!a||!a._balanced)return n(l);const u=ut(r.sliceSerialize({start:a.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 a0(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)},a={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},s=[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",a,t],["exit",a,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...s),e}function s0(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,a;return s;function s(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&&!a||c===null||c===91||Ie(c))return n(c);if(c===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return i.includes(ut(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(c)}return Ie(c)||(a=!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 l0(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,a=0,s;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(a>999||m===93&&!s||m===null||m===91||Ie(m))return n(m);if(m===93){e.exit("chunkString");const h=e.exit("gfmFootnoteDefinitionLabelString");return o=ut(r.sliceSerialize(h)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return Ie(m)||(s=!0),a++,e.consume(m),m===92?c:f}function c(m){return m===91||m===92||m===93?(e.consume(m),a++,f):f(m)}function p(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),i.includes(o)||i.push(o),be(e,d,"gfmFootnoteDefinitionWhitespace")):n(m)}function d(m){return t(m)}}function u0(e,t,n){return e.check(Bn,t,e.attempt(r0,t,n))}function c0(e){e.exit("gfmFootnoteDefinition")}function f0(e,t,n){const r=this;return be(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(o):n(o)}}function d0(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(a,s){let l=-1;for(;++l<a.length;)if(a[l][0]==="enter"&&a[l][1].type==="strikethroughSequenceTemporary"&&a[l][1]._close){let u=l;for(;u--;)if(a[u][0]==="exit"&&a[u][1].type==="strikethroughSequenceTemporary"&&a[u][1]._open&&a[l][1].end.offset-a[l][1].start.offset===a[u][1].end.offset-a[u][1].start.offset){a[l][1].type="strikethroughSequence",a[u][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},a[u][1].start),end:Object.assign({},a[l][1].end)},c={type:"strikethroughText",start:Object.assign({},a[u][1].end),end:Object.assign({},a[l][1].start)},p=[["enter",f,s],["enter",a[u][1],s],["exit",a[u][1],s],["enter",c,s]],d=s.parser.constructs.insideSpan.null;d&&tt(p,p.length,0,Ir(d,a.slice(u+1,l),s)),tt(p,p.length,0,[["exit",c,s],["enter",a[l][1],s],["exit",a[l][1],s],["exit",f,s]]),tt(a,u-1,l-u+3,p),l=u+p.length-2;break}}for(l=-1;++l<a.length;)a[l][1].type==="strikethroughSequenceTemporary"&&(a[l][1].type="data");return a}function o(a,s,l){const u=this.previous,f=this.events;let c=0;return p;function p(m){return u===126&&f[f.length-1][1].type!=="characterEscape"?l(m):(a.enter("strikethroughSequenceTemporary"),d(m))}function d(m){const h=nn(u);if(m===126)return c>1?l(m):(a.consume(m),c++,d);if(c<2&&!n)return l(m);const g=a.exit("strikethroughSequenceTemporary"),y=nn(m);return g._open=!y||y===2&&!!h,g._close=!h||h===2&&!!y,s(m)}}}class p0{constructor(){this.map=[]}add(t,n,r){h0(this,t,n,r)}consume(t){if(this.map.sort(function(o,a){return o[0]-a[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 h0(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 m0(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 g0(){return{flow:{null:{name:"table",tokenize:y0,resolveAll:v0}}}}function y0(e,t,n){const r=this;let i=0,o=0,a;return s;function s(I){let O=r.events.length-1;for(;O>-1;){const M=r.events[O][1].type;if(M==="lineEnding"||M==="linePrefix")O--;else break}const j=O>-1?r.events[O][1].type:null,z=j==="tableHead"||j==="tableRow"?C:l;return z===C&&r.parser.lazy[r.now().line]?n(I):z(I)}function l(I){return e.enter("tableHead"),e.enter("tableRow"),u(I)}function u(I){return I===124||(a=!0,o+=1),f(I)}function f(I){return I===null?n(I):ce(I)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),d):n(I):ye(I)?be(e,f,"whitespace")(I):(o+=1,a&&(a=!1,i+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),a=!0,f):(e.enter("data"),c(I)))}function c(I){return I===null||I===124||Ie(I)?(e.exit("data"),f(I)):(e.consume(I),I===92?p:c)}function p(I){return I===92||I===124?(e.consume(I),c):c(I)}function d(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(I):(e.enter("tableDelimiterRow"),a=!1,ye(I)?be(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):m(I))}function m(I){return I===45||I===58?g(I):I===124?(a=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),h):k(I)}function h(I){return ye(I)?be(e,g,"whitespace")(I):g(I)}function g(I){return I===58?(o+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),y):I===45?(o+=1,y(I)):I===null||ce(I)?A(I):k(I)}function y(I){return I===45?(e.enter("tableDelimiterFiller"),v(I)):k(I)}function v(I){return I===45?(e.consume(I),v):I===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),w):(e.exit("tableDelimiterFiller"),w(I))}function w(I){return ye(I)?be(e,A,"whitespace")(I):A(I)}function A(I){return I===124?m(I):I===null||ce(I)?!a||i!==o?k(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):k(I)}function k(I){return n(I)}function C(I){return e.enter("tableRow"),T(I)}function T(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),T):I===null||ce(I)?(e.exit("tableRow"),t(I)):ye(I)?be(e,T,"whitespace")(I):(e.enter("data"),P(I))}function P(I){return I===null||I===124||Ie(I)?(e.exit("data"),T(I)):(e.consume(I),I===92?F:P)}function F(I){return I===92||I===124?(e.consume(I),P):P(I)}}function v0(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],a=[0,0,0,0],s=!1,l=0,u,f,c;const p=new p0;for(;++n<e.length;){const d=e[n],m=d[1];d[0]==="enter"?m.type==="tableHead"?(s=!1,l!==0&&(Tc(p,t,l,u,f),f=void 0,l=0),u={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},p.add(n,0,[["enter",u,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(r=!0,c=void 0,o=[0,0,0,0],a=[0,n+1,0,0],s&&(s=!1,f={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},p.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,a[2]===0&&(o[1]!==0&&(a[0]=a[1],c=zr(p,t,o,i,void 0,c),o=[0,0,0,0]),a[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(a[0]=a[1],c=zr(p,t,o,i,void 0,c)),o=a,a=[o[1],n,0,0])):m.type==="tableHead"?(s=!0,l=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(l=n,o[1]!==0?(a[0]=a[1],c=zr(p,t,o,i,n,c)):a[1]!==0&&(c=zr(p,t,a,i,n,c)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(a[3]=n)}for(l!==0&&Tc(p,t,l,u,f),p.consume(t.events),n=-1;++n<t.events.length;){const d=t.events[n];d[0]==="enter"&&d[1].type==="table"&&(d[1]._align=m0(t.events,n))}return e}function zr(e,t,n,r,i,o){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",s="tableContent";n[0]!==0&&(o.end=Object.assign({},on(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const l=on(t.events,n[1]);if(o={type:a,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const u=on(t.events,n[2]),f=on(t.events,n[3]),c={type:s,start:Object.assign({},u),end:Object.assign({},f)};if(e.add(n[2],0,[["enter",c,t]]),r!==2){const p=t.events[n[2]],d=t.events[n[3]];if(p[1].end=Object.assign({},d[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,h=n[3]-n[2]-1;e.add(m,h,[])}}e.add(n[3]+1,0,[["exit",c,t]])}return i!==void 0&&(o.end=Object.assign({},on(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function Tc(e,t,n,r,i){const o=[],a=on(t.events,n);i&&(i.end=Object.assign({},a),o.push(["exit",i,t])),r.end=Object.assign({},a),o.push(["exit",r,t]),e.add(n+1,0,o)}function on(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const b0={name:"tasklistCheck",tokenize:x0};function w0(){return{text:{91:b0}}}function x0(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 Ie(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),a):n(l)}function a(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):n(l)}function s(l){return ce(l)?t(l):ye(l)?e.check({tokenize:k0},t,n)(l):n(l)}}function k0(e,t,n){return be(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function S0(e){return eu([Yx(),i0(),d0(e),g0(),w0()])}const E0={};function C0(e){const t=this,n=e||E0,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(S0(n)),o.push(Wx()),a.push(Vx(n))}const ge={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"},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"}}};/**
54
+ `))}function l(d,m,h,g){const y=h.enter("tableCell"),v=h.enter("phrasing"),w=h.containerPhrasing(d,{...g,before:o,after:o});return v(),y(),w}function u(d,m){return Gw(d,{align:m,alignDelimiters:r,padding:n,stringLength:i})}function f(d,m,h){const g=d.children;let y=-1;const v=[],w=m.enter("table");for(;++y<g.length;)v[y]=c(g[y],m,h);return w(),v}function c(d,m,h){const g=d.children;let y=-1;const v=[],w=m.enter("tableRow");for(;++y<g.length;)v[y]=l(g[y],d,m,h);return w(),v}function p(d,m,h){let g=pc.inlineCode(d,m,h);return h.stack.includes("tableCell")&&(g=g.replace(/\|/g,"\\$&")),g}}function Fx(){return{exit:{taskListCheckValueChecked:mc,taskListCheckValueUnchecked:mc,paragraph:Bx}}}function Rx(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:zx}}}function mc(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Bx(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,a;for(;++o<i.length;){const s=i[o];if(s.type==="paragraph"){a=s;break}}a===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 zx(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",s=n.createTracker(r);o&&s.move(a);let l=pc.listItem(e,t,n,{...r,...s.current()});return o&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),l;function u(f){return f+a}}function $x(){return[vw(),zw(),Hw(),Ox(),Fx()]}function jx(e){return{extensions:[bw(),$w(e),Ww(),Lx(e),Rx()]}}const Ux={tokenize:Yx,partial:!0},gc={tokenize:Gx,partial:!0},yc={tokenize:Qx,partial:!0},vc={tokenize:Jx,partial:!0},Hx={tokenize:Zx,partial:!0},bc={name:"wwwAutolink",tokenize:qx,previous:xc},wc={name:"protocolAutolink",tokenize:Kx,previous:kc},Et={name:"emailAutolink",tokenize:Vx,previous:Sc},vt={};function Wx(){return{text:vt}}let Vt=48;for(;Vt<123;)vt[Vt]=Et,Vt++,Vt===58?Vt=65:Vt===91&&(Vt=97);vt[43]=Et,vt[45]=Et,vt[46]=Et,vt[95]=Et,vt[72]=[Et,wc],vt[104]=[Et,wc],vt[87]=[Et,bc],vt[119]=[Et,bc];function Vx(e,t,n){const r=this;let i,o;return a;function a(c){return!jo(c)||!Sc.call(r,r.previous)||Uo(r.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(c))}function s(c){return jo(c)?(e.consume(c),s):c===64?(e.consume(c),l):n(c)}function l(c){return c===46?e.check(Hx,f,u)(c):c===45||c===95||Ve(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&&Ke(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(c)):n(c)}}function qx(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!xc.call(r,r.previous)||Uo(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Ux,e.attempt(gc,e.attempt(yc,o),n),n)(a))}function o(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function Kx(e,t,n){const r=this;let i="",o=!1;return a;function a(c){return(c===72||c===104)&&kc.call(r,r.previous)&&!Uo(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(c),e.consume(c),s):n(c)}function s(c){if(Ke(c)&&i.length<5)return i+=String.fromCodePoint(c),e.consume(c),s;if(c===58){const p=i.toLowerCase();if(p==="http"||p==="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||kr(c)||Ie(c)||Wt(c)||Sr(c)?n(c):e.attempt(gc,e.attempt(yc,f),n)(c)}function f(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(c)}}function Yx(e,t,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),i):a===46&&r===3?(e.consume(a),o):n(a)}function o(a){return a===null?n(a):t(a)}}function Gx(e,t,n){let r,i,o;return a;function a(u){return u===46||u===95?e.check(vc,l,s)(u):u===null||Ie(u)||Wt(u)||u!==45&&Sr(u)?l(u):(o=!0,e.consume(u),a)}function s(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),a}function l(u){return i||r||!o?n(u):t(u)}}function Qx(e,t){let n=0,r=0;return i;function i(a){return a===40?(n++,e.consume(a),i):a===41&&r<n?o(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(vc,t,o)(a):a===null||Ie(a)||Wt(a)?t(a):(e.consume(a),i)}function o(a){return a===41&&r++,e.consume(a),i}}function Jx(e,t,n){return r;function r(s){return s===33||s===34||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===63||s===95||s===126?(e.consume(s),r):s===38?(e.consume(s),o):s===93?(e.consume(s),i):s===60||s===null||Ie(s)||Wt(s)?t(s):n(s)}function i(s){return s===null||s===40||s===91||Ie(s)||Wt(s)?t(s):r(s)}function o(s){return Ke(s)?a(s):n(s)}function a(s){return s===59?(e.consume(s),r):Ke(s)?(e.consume(s),a):n(s)}}function Zx(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return Ve(o)?n(o):t(o)}}function xc(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ie(e)}function kc(e){return!Ke(e)}function Sc(e){return!(e===47||jo(e))}function jo(e){return e===43||e===45||e===46||e===95||Ve(e)}function Uo(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 Xx={tokenize:s0,partial:!0};function e0(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:i0,continuation:{tokenize:o0},exit:a0}},text:{91:{name:"gfmFootnoteCall",tokenize:r0},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:t0,resolveTo:n0}}}}function t0(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return s;function s(l){if(!a||!a._balanced)return n(l);const u=ut(r.sliceSerialize({start:a.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 n0(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)},a={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},s=[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",a,t],["exit",a,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...s),e}function r0(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,a;return s;function s(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&&!a||c===null||c===91||Ie(c))return n(c);if(c===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return i.includes(ut(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(c)}return Ie(c)||(a=!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 i0(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,a=0,s;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(a>999||m===93&&!s||m===null||m===91||Ie(m))return n(m);if(m===93){e.exit("chunkString");const h=e.exit("gfmFootnoteDefinitionLabelString");return o=ut(r.sliceSerialize(h)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return Ie(m)||(s=!0),a++,e.consume(m),m===92?c:f}function c(m){return m===91||m===92||m===93?(e.consume(m),a++,f):f(m)}function p(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),i.includes(o)||i.push(o),be(e,d,"gfmFootnoteDefinitionWhitespace")):n(m)}function d(m){return t(m)}}function o0(e,t,n){return e.check(Ln,t,e.attempt(Xx,t,n))}function a0(e){e.exit("gfmFootnoteDefinition")}function s0(e,t,n){const r=this;return be(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(o):n(o)}}function l0(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(a,s){let l=-1;for(;++l<a.length;)if(a[l][0]==="enter"&&a[l][1].type==="strikethroughSequenceTemporary"&&a[l][1]._close){let u=l;for(;u--;)if(a[u][0]==="exit"&&a[u][1].type==="strikethroughSequenceTemporary"&&a[u][1]._open&&a[l][1].end.offset-a[l][1].start.offset===a[u][1].end.offset-a[u][1].start.offset){a[l][1].type="strikethroughSequence",a[u][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},a[u][1].start),end:Object.assign({},a[l][1].end)},c={type:"strikethroughText",start:Object.assign({},a[u][1].end),end:Object.assign({},a[l][1].start)},p=[["enter",f,s],["enter",a[u][1],s],["exit",a[u][1],s],["enter",c,s]],d=s.parser.constructs.insideSpan.null;d&&nt(p,p.length,0,Er(d,a.slice(u+1,l),s)),nt(p,p.length,0,[["exit",c,s],["enter",a[l][1],s],["exit",a[l][1],s],["exit",f,s]]),nt(a,u-1,l-u+3,p),l=u+p.length-2;break}}for(l=-1;++l<a.length;)a[l][1].type==="strikethroughSequenceTemporary"&&(a[l][1].type="data");return a}function o(a,s,l){const u=this.previous,f=this.events;let c=0;return p;function p(m){return u===126&&f[f.length-1][1].type!=="characterEscape"?l(m):(a.enter("strikethroughSequenceTemporary"),d(m))}function d(m){const h=nn(u);if(m===126)return c>1?l(m):(a.consume(m),c++,d);if(c<2&&!n)return l(m);const g=a.exit("strikethroughSequenceTemporary"),y=nn(m);return g._open=!y||y===2&&!!h,g._close=!h||h===2&&!!y,s(m)}}}class u0{constructor(){this.map=[]}add(t,n,r){c0(this,t,n,r)}consume(t){if(this.map.sort(function(o,a){return o[0]-a[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 c0(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 f0(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 d0(){return{flow:{null:{name:"table",tokenize:p0,resolveAll:h0}}}}function p0(e,t,n){const r=this;let i=0,o=0,a;return s;function s(I){let O=r.events.length-1;for(;O>-1;){const M=r.events[O][1].type;if(M==="lineEnding"||M==="linePrefix")O--;else break}const j=O>-1?r.events[O][1].type:null,z=j==="tableHead"||j==="tableRow"?C:l;return z===C&&r.parser.lazy[r.now().line]?n(I):z(I)}function l(I){return e.enter("tableHead"),e.enter("tableRow"),u(I)}function u(I){return I===124||(a=!0,o+=1),f(I)}function f(I){return I===null?n(I):ce(I)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),d):n(I):ye(I)?be(e,f,"whitespace")(I):(o+=1,a&&(a=!1,i+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),a=!0,f):(e.enter("data"),c(I)))}function c(I){return I===null||I===124||Ie(I)?(e.exit("data"),f(I)):(e.consume(I),I===92?p:c)}function p(I){return I===92||I===124?(e.consume(I),c):c(I)}function d(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(I):(e.enter("tableDelimiterRow"),a=!1,ye(I)?be(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):m(I))}function m(I){return I===45||I===58?g(I):I===124?(a=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),h):k(I)}function h(I){return ye(I)?be(e,g,"whitespace")(I):g(I)}function g(I){return I===58?(o+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),y):I===45?(o+=1,y(I)):I===null||ce(I)?A(I):k(I)}function y(I){return I===45?(e.enter("tableDelimiterFiller"),v(I)):k(I)}function v(I){return I===45?(e.consume(I),v):I===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),w):(e.exit("tableDelimiterFiller"),w(I))}function w(I){return ye(I)?be(e,A,"whitespace")(I):A(I)}function A(I){return I===124?m(I):I===null||ce(I)?!a||i!==o?k(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):k(I)}function k(I){return n(I)}function C(I){return e.enter("tableRow"),T(I)}function T(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),T):I===null||ce(I)?(e.exit("tableRow"),t(I)):ye(I)?be(e,T,"whitespace")(I):(e.enter("data"),_(I))}function _(I){return I===null||I===124||Ie(I)?(e.exit("data"),T(I)):(e.consume(I),I===92?F:_)}function F(I){return I===92||I===124?(e.consume(I),_):_(I)}}function h0(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],a=[0,0,0,0],s=!1,l=0,u,f,c;const p=new u0;for(;++n<e.length;){const d=e[n],m=d[1];d[0]==="enter"?m.type==="tableHead"?(s=!1,l!==0&&(Ec(p,t,l,u,f),f=void 0,l=0),u={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},p.add(n,0,[["enter",u,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(r=!0,c=void 0,o=[0,0,0,0],a=[0,n+1,0,0],s&&(s=!1,f={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},p.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,a[2]===0&&(o[1]!==0&&(a[0]=a[1],c=Fr(p,t,o,i,void 0,c),o=[0,0,0,0]),a[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(a[0]=a[1],c=Fr(p,t,o,i,void 0,c)),o=a,a=[o[1],n,0,0])):m.type==="tableHead"?(s=!0,l=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(l=n,o[1]!==0?(a[0]=a[1],c=Fr(p,t,o,i,n,c)):a[1]!==0&&(c=Fr(p,t,a,i,n,c)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(a[3]=n)}for(l!==0&&Ec(p,t,l,u,f),p.consume(t.events),n=-1;++n<t.events.length;){const d=t.events[n];d[0]==="enter"&&d[1].type==="table"&&(d[1]._align=f0(t.events,n))}return e}function Fr(e,t,n,r,i,o){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",s="tableContent";n[0]!==0&&(o.end=Object.assign({},on(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const l=on(t.events,n[1]);if(o={type:a,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const u=on(t.events,n[2]),f=on(t.events,n[3]),c={type:s,start:Object.assign({},u),end:Object.assign({},f)};if(e.add(n[2],0,[["enter",c,t]]),r!==2){const p=t.events[n[2]],d=t.events[n[3]];if(p[1].end=Object.assign({},d[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,h=n[3]-n[2]-1;e.add(m,h,[])}}e.add(n[3]+1,0,[["exit",c,t]])}return i!==void 0&&(o.end=Object.assign({},on(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function Ec(e,t,n,r,i){const o=[],a=on(t.events,n);i&&(i.end=Object.assign({},a),o.push(["exit",i,t])),r.end=Object.assign({},a),o.push(["exit",r,t]),e.add(n+1,0,o)}function on(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const m0={name:"tasklistCheck",tokenize:y0};function g0(){return{text:{91:m0}}}function y0(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 Ie(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),a):n(l)}function a(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):n(l)}function s(l){return ce(l)?t(l):ye(l)?e.check({tokenize:v0},t,n)(l):n(l)}}function v0(e,t,n){return be(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function b0(e){return Ql([Wx(),e0(),l0(e),d0(),g0()])}const w0={};function x0(e){const t=this,n=e||w0,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(b0(n)),o.push($x()),a.push(jx(n))}const ge={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"},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"}}};/**
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 A0=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),I0=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Oc=e=>{const t=I0(e);return t.charAt(0).toUpperCase()+t.slice(1)},Dc=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),T0=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
59
+ */const k0=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),S0=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Cc=e=>{const t=S0(e);return t.charAt(0).toUpperCase()+t.slice(1)},Ac=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),E0=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 O0={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 C0={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 D0=_.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:a,...s},l)=>_.createElement("svg",{ref:l,...O0,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Dc("lucide",i),...!o&&!T0(s)&&{"aria-hidden":"true"},...s},[...a.map(([u,f])=>_.createElement(u,f)),...Array.isArray(o)?o:[o]]));/**
69
+ */const A0=N.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:a,...s},l)=>N.createElement("svg",{ref:l,...C0,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Ac("lucide",i),...!o&&!E0(s)&&{"aria-hidden":"true"},...s},[...a.map(([u,f])=>N.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 xe=(e,t)=>{const n=_.forwardRef(({className:r,...i},o)=>_.createElement(D0,{ref:o,iconNode:t,className:Dc(`lucide-${A0(Oc(e))}`,`lucide-${e}`,r),...i}));return n.displayName=Oc(e),n};/**
74
+ */const xe=(e,t)=>{const n=N.forwardRef(({className:r,...i},o)=>N.createElement(A0,{ref:o,iconNode:t,className:Ac(`lucide-${k0(Cc(e))}`,`lucide-${e}`,r),...i}));return n.displayName=Cc(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 M0=xe("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
79
+ */const I0=xe("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 Mc=xe("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 Ic=xe("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 _0=xe("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
89
+ */const T0=xe("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 P0=xe("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
94
+ */const O0=xe("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 N0=xe("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
99
+ */const D0=xe("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 L0=xe("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
104
+ */const M0=xe("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 F0=xe("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 _0=xe("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 _c=xe("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 Tc=xe("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 R0=xe("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 P0=xe("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 B0=xe("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 N0=xe("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 z0=xe("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 L0=xe("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 Pc=xe("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 Oc=xe("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 $0=xe("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 F0=xe("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 j0=xe("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 R0=xe("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 Nc=xe("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 Dc=xe("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 U0=xe("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 B0=xe("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 H0=xe("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 z0=xe("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 W0=xe("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 $0=xe("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 V0=xe("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 j0=xe("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 q0=xe("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 U0=xe("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 K0=xe("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 H0=xe("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 Y0=xe("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 W0=xe("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 G0=xe("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 V0=xe("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 Q0=xe("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
194
+ */const q0=xe("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 J0=xe("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 K0=xe("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 Z0=xe("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"}]]);/**
204
+ */const Y0=xe("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"}]]);/**
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 X0=xe("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"}]]);/**
209
+ */const G0=xe("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"}]]);/**
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 e1=xe("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"}]]);/**
214
+ */const Q0=xe("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"}]]);/**
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 t1=xe("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"}]]);/**
219
+ */const J0=xe("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"}]]);/**
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 Lc=xe("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"}]]);/**
224
+ */const Mc=xe("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"}]]);/**
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 n1=xe("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"}]]);/**
229
+ */const Z0=xe("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"}]]);/**
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 r1=xe("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"}]]);/**
234
+ */const X0=xe("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"}]]);/**
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 Fc=xe("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),i1=({text:e})=>{const{message:{blocks:{text:t}}}=ge,[n,r]=_.useState(new Map);function i(a){if(n.has(a))return;const s=new Image;s.src=a,s.onerror=()=>{r(l=>new Map(l).set(a,!0))},s.onload=()=>{r(l=>new Map(l).set(a,!1))}}_.useEffect(()=>{const a=/!\[.*?\]\((.*?)\)/g,s=[];let l;for(;(l=a.exec(e))!==null;){const u=l[1];u&&!s.includes(u)&&s.push(u)}s.forEach(u=>{i(u)})},[e]);const o={h1:({node:a,...s})=>S.jsx("h1",{...s,...t.heading1}),h2:({node:a,...s})=>S.jsx("h2",{...s,...t.heading2}),h3:({node:a,...s})=>S.jsx("h3",{...s,...t.heading3}),h4:({node:a,...s})=>S.jsx("h4",{...s,...t.heading4}),h5:"h4",h6:"h4",em:({node:a,...s})=>S.jsx("em",{...s,...t.italic}),strong:({node:a,...s})=>S.jsx("strong",{...s,...t.bold}),p:({node:a,...s})=>S.jsx("p",{...s,...t.text}),hr:({node:a,...s})=>S.jsx("hr",{...s,...t.horizontalRule}),a:({node:a,href:s,children:l,...u})=>S.jsx("a",{...u,...t.link,onMouseUp:f=>{window.open(s,"_blank","noopener,noreferrer")},children:l}),img:({node:a,...s})=>{const l=s.src;return n.get(l)||!1?S.jsx("div",{"data-error":!0,...t.image,children:S.jsx(Nc,{strokeWidth:"1"})}):S.jsx("img",{...s,...t.image})},ol:({node:a,...s})=>S.jsx("ol",{...s,...t.orderedList}),ul:({node:a,...s})=>S.jsx("ul",{...s,...t.unorderedList}),li:({node:a,...s})=>S.jsx("li",{...s,...t.listItem}),br:({node:a,...s})=>S.jsx("br",{...s,...t.lineBreak}),pre:({node:a,...s})=>{var m,h;const l=a==null?void 0:a.children[0],u=o1(((h=(m=l==null?void 0:l.properties)==null?void 0:m.className)==null?void 0:h[0])||""),[f,c]=_.useState(!1),p=_.useRef(null),d=()=>{if(!p.current)return;const g=p.current.textContent||"";navigator.clipboard.writeText(g).then(()=>{c(!0),setTimeout(()=>{c(!1)},1500)}).catch(y=>{console.error("Failed to copy code to clipboard:",y)})};return S.jsxs("div",{...t.codeBlockContainer,children:[S.jsxs("div",{...t.codeBlockTitle,children:[u?S.jsx("span",{children:u}):"Code",f?S.jsx(_0,{...t.codeBlockCopyIcon}):S.jsx($0,{...t.codeBlockCopyIcon,onClick:d})]}),S.jsx("pre",{ref:p,...s,...t.codeBlock})]})},input:({node:a,...s})=>S.jsx("input",{...s,...t.input,disabled:!1}),code:({node:a,...s})=>S.jsx("code",{...s,...t.code}),table:({node:a,...s})=>S.jsx("div",{...t.tableContainer,children:S.jsx("table",{...s,...t.table})}),th:({node:a,...s})=>S.jsx("th",{...s,...t.tableHeader}),tr:({node:a,...s})=>S.jsx("tr",{...s,...t.tableRow}),td:({node:a,...s})=>S.jsx("td",{...s,...t.tableData})};return S.jsx(Qu,{urlTransform:a=>a.startsWith("tel:")?a:Ju(a),components:o,remarkPlugins:[C0,xw],children:e})},o1=e=>{if(!e)return"";const t=e.match(/language-(\w+)/);return t?t[1]:""},a1={},Rc=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(p=>p(t,c))}},i=()=>t,s={setState:r,getState:i,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{(a1?"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,s),s},s1=e=>e?Rc(e):Rc;var Ko={exports:{}},Yo={},$r={exports:{}},Go={};/**
239
+ */const _c=xe("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),e1=({text:e})=>{const{message:{blocks:{text:t}}}=ge,[n,r]=N.useState(new Map);function i(a){if(n.has(a))return;const s=new Image;s.src=a,s.onerror=()=>{r(l=>new Map(l).set(a,!0))},s.onload=()=>{r(l=>new Map(l).set(a,!1))}}N.useEffect(()=>{const a=/!\[.*?\]\((.*?)\)/g,s=[];let l;for(;(l=a.exec(e))!==null;){const u=l[1];u&&!s.includes(u)&&s.push(u)}s.forEach(u=>{i(u)})},[e]);const o={h1:({node:a,...s})=>S.jsx("h1",{...s,...t.heading1}),h2:({node:a,...s})=>S.jsx("h2",{...s,...t.heading2}),h3:({node:a,...s})=>S.jsx("h3",{...s,...t.heading3}),h4:({node:a,...s})=>S.jsx("h4",{...s,...t.heading4}),h5:"h4",h6:"h4",em:({node:a,...s})=>S.jsx("em",{...s,...t.italic}),strong:({node:a,...s})=>S.jsx("strong",{...s,...t.bold}),p:({node:a,...s})=>S.jsx("p",{...s,...t.text}),hr:({node:a,...s})=>S.jsx("hr",{...s,...t.horizontalRule}),a:({node:a,href:s,children:l,...u})=>S.jsx("a",{...u,...t.link,onMouseUp:f=>{window.open(s,"_blank","noopener,noreferrer")},children:l}),img:({node:a,...s})=>{const l=s.src;return n.get(l)||!1?S.jsx("div",{"data-error":!0,...t.image,children:S.jsx(Dc,{strokeWidth:"1"})}):S.jsx("img",{...s,...t.image})},ol:({node:a,...s})=>S.jsx("ol",{...s,...t.orderedList}),ul:({node:a,...s})=>S.jsx("ul",{...s,...t.unorderedList}),li:({node:a,...s})=>S.jsx("li",{...s,...t.listItem}),br:({node:a,...s})=>S.jsx("br",{...s,...t.lineBreak}),pre:({node:a,...s})=>{var m,h;const l=a==null?void 0:a.children[0],u=t1(((h=(m=l==null?void 0:l.properties)==null?void 0:m.className)==null?void 0:h[0])||""),[f,c]=N.useState(!1),p=N.useRef(null),d=()=>{if(!p.current)return;const g=p.current.textContent||"";navigator.clipboard.writeText(g).then(()=>{c(!0),setTimeout(()=>{c(!1)},1500)}).catch(y=>{console.error("Failed to copy code to clipboard:",y)})};return S.jsxs("div",{...t.codeBlockContainer,children:[S.jsxs("div",{...t.codeBlockTitle,children:[u?S.jsx("span",{children:u}):"Code",f?S.jsx(T0,{...t.codeBlockCopyIcon}):S.jsx(F0,{...t.codeBlockCopyIcon,onClick:d})]}),S.jsx("pre",{ref:p,...s,...t.codeBlock})]})},input:({node:a,...s})=>S.jsx("input",{...s,...t.input,disabled:!1}),code:({node:a,...s})=>S.jsx("code",{...s,...t.code}),table:({node:a,...s})=>S.jsx("div",{...t.tableContainer,children:S.jsx("table",{...s,...t.table})}),th:({node:a,...s})=>S.jsx("th",{...s,...t.tableHeader}),tr:({node:a,...s})=>S.jsx("tr",{...s,...t.tableRow}),td:({node:a,...s})=>S.jsx("td",{...s,...t.tableData})};return S.jsx(qu,{urlTransform:a=>a.startsWith("tel:")?a:Ku(a),components:o,remarkPlugins:[x0,yw],children:e})},t1=e=>{if(!e)return"";const t=e.match(/language-(\w+)/);return t?t[1]:""},n1={},Pc=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(p=>p(t,c))}},i=()=>t,s={setState:r,getState:i,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{(n1?"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,s),s},r1=e=>e?Pc(e):Pc;var Ho={exports:{}},Wo={},Rr={exports:{}},Vo={};/**
240
240
  * @license React
241
241
  * use-sync-external-store-shim.production.min.js
242
242
  *
@@ -244,7 +244,7 @@ Please start a new conversation.`,Zi={ResourceNotFound:{type:"configuration",mes
244
244
  *
245
245
  * This source code is licensed under the MIT license found in the
246
246
  * LICENSE file in the root directory of this source tree.
247
- */var Bc;function l1(){if(Bc)return Go;Bc=1;var e=_;function t(c,p){return c===p&&(c!==0||1/c===1/p)||c!==c&&p!==p}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,a=e.useDebugValue;function s(c,p){var d=p(),m=r({inst:{value:d,getSnapshot:p}}),h=m[0].inst,g=m[1];return o(function(){h.value=d,h.getSnapshot=p,l(h)&&g({inst:h})},[c,d,p]),i(function(){return l(h)&&g({inst:h}),c(function(){l(h)&&g({inst:h})})},[c]),a(d),d}function l(c){var p=c.getSnapshot;c=c.value;try{var d=p();return!n(c,d)}catch{return!0}}function u(c,p){return p()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:s;return Go.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,Go}var Qo={};/**
247
+ */var Nc;function i1(){if(Nc)return Vo;Nc=1;var e=N;function t(c,p){return c===p&&(c!==0||1/c===1/p)||c!==c&&p!==p}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,a=e.useDebugValue;function s(c,p){var d=p(),m=r({inst:{value:d,getSnapshot:p}}),h=m[0].inst,g=m[1];return o(function(){h.value=d,h.getSnapshot=p,l(h)&&g({inst:h})},[c,d,p]),i(function(){return l(h)&&g({inst:h}),c(function(){l(h)&&g({inst:h})})},[c]),a(d),d}function l(c){var p=c.getSnapshot;c=c.value;try{var d=p();return!n(c,d)}catch{return!0}}function u(c,p){return p()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:s;return Vo.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,Vo}var qo={};/**
248
248
  * @license React
249
249
  * use-sync-external-store-shim.development.js
250
250
  *
@@ -252,7 +252,7 @@ Please start a new conversation.`,Zi={ResourceNotFound:{type:"configuration",mes
252
252
  *
253
253
  * This source code is licensed under the MIT license found in the
254
254
  * LICENSE file in the root directory of this source tree.
255
- */var zc;function u1(){return zc||(zc=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=_,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(w){{for(var A=arguments.length,k=new Array(A>1?A-1:0),C=1;C<A;C++)k[C-1]=arguments[C];r("error",w,k)}}function r(w,A,k){{var C=t.ReactDebugCurrentFrame,T=C.getStackAddendum();T!==""&&(A+="%s",k=k.concat([T]));var P=k.map(function(F){return String(F)});P.unshift("Warning: "+A),Function.prototype.apply.call(console[w],console,P)}}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,a=e.useState,s=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue,f=!1,c=!1;function p(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 C=A();if(!c){var T=A();o(C,T)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}var P=a({inst:{value:C,getSnapshot:A}}),F=P[0].inst,I=P[1];return l(function(){F.value=C,F.getSnapshot=A,d(F)&&I({inst:F})},[w,C,A]),s(function(){d(F)&&I({inst:F});var O=function(){d(F)&&I({inst:F})};return w(O)},[w]),u(C),C}function d(w){var A=w.getSnapshot,k=w.value;try{var C=A();return!o(k,C)}catch{return!0}}function m(w,A,k){return A()}var h=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",g=!h,y=g?m:p,v=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:y;Qo.useSyncExternalStore=v,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Qo}var $c;function jc(){return $c||($c=1,process.env.NODE_ENV==="production"?$r.exports=l1():$r.exports=u1()),$r.exports}/**
255
+ */var Lc;function o1(){return Lc||(Lc=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=N,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),C=1;C<A;C++)k[C-1]=arguments[C];r("error",w,k)}}function r(w,A,k){{var C=t.ReactDebugCurrentFrame,T=C.getStackAddendum();T!==""&&(A+="%s",k=k.concat([T]));var _=k.map(function(F){return String(F)});_.unshift("Warning: "+A),Function.prototype.apply.call(console[w],console,_)}}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,a=e.useState,s=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue,f=!1,c=!1;function p(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 C=A();if(!c){var T=A();o(C,T)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}var _=a({inst:{value:C,getSnapshot:A}}),F=_[0].inst,I=_[1];return l(function(){F.value=C,F.getSnapshot=A,d(F)&&I({inst:F})},[w,C,A]),s(function(){d(F)&&I({inst:F});var O=function(){d(F)&&I({inst:F})};return w(O)},[w]),u(C),C}function d(w){var A=w.getSnapshot,k=w.value;try{var C=A();return!o(k,C)}catch{return!0}}function m(w,A,k){return A()}var h=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",g=!h,y=g?m:p,v=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:y;qo.useSyncExternalStore=v,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),qo}var Fc;function Rc(){return Fc||(Fc=1,process.env.NODE_ENV==="production"?Rr.exports=i1():Rr.exports=o1()),Rr.exports}/**
256
256
  * @license React
257
257
  * use-sync-external-store-shim/with-selector.production.min.js
258
258
  *
@@ -260,7 +260,7 @@ Please start a new conversation.`,Zi={ResourceNotFound:{type:"configuration",mes
260
260
  *
261
261
  * This source code is licensed under the MIT license found in the
262
262
  * LICENSE file in the root directory of this source tree.
263
- */var Uc;function c1(){if(Uc)return Yo;Uc=1;var e=_,t=jc();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,a=e.useEffect,s=e.useMemo,l=e.useDebugValue;return Yo.useSyncExternalStoreWithSelector=function(u,f,c,p,d){var m=o(null);if(m.current===null){var h={hasValue:!1,value:null};m.current=h}else h=m.current;m=s(function(){function y(C){if(!v){if(v=!0,w=C,C=p(C),d!==void 0&&h.hasValue){var T=h.value;if(d(T,C))return A=T}return A=C}if(T=A,r(w,C))return T;var P=p(C);return d!==void 0&&d(T,P)?T:(w=C,A=P)}var v=!1,w,A,k=c===void 0?null:c;return[function(){return y(f())},k===null?void 0:function(){return y(k())}]},[f,c,p,d]);var g=i(u,m[0],m[1]);return a(function(){h.hasValue=!0,h.value=g},[g]),l(g),g},Yo}var Jo={};/**
263
+ */var Bc;function a1(){if(Bc)return Wo;Bc=1;var e=N,t=Rc();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,a=e.useEffect,s=e.useMemo,l=e.useDebugValue;return Wo.useSyncExternalStoreWithSelector=function(u,f,c,p,d){var m=o(null);if(m.current===null){var h={hasValue:!1,value:null};m.current=h}else h=m.current;m=s(function(){function y(C){if(!v){if(v=!0,w=C,C=p(C),d!==void 0&&h.hasValue){var T=h.value;if(d(T,C))return A=T}return A=C}if(T=A,r(w,C))return T;var _=p(C);return d!==void 0&&d(T,_)?T:(w=C,A=_)}var v=!1,w,A,k=c===void 0?null:c;return[function(){return y(f())},k===null?void 0:function(){return y(k())}]},[f,c,p,d]);var g=i(u,m[0],m[1]);return a(function(){h.hasValue=!0,h.value=g},[g]),l(g),g},Wo}var Ko={};/**
264
264
  * @license React
265
265
  * use-sync-external-store-shim/with-selector.development.js
266
266
  *
@@ -268,54 +268,54 @@ Please start a new conversation.`,Zi={ResourceNotFound:{type:"configuration",mes
268
268
  *
269
269
  * This source code is licensed under the MIT license found in the
270
270
  * LICENSE file in the root directory of this source tree.
271
- */var Hc;function f1(){return Hc||(Hc=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=_,t=jc();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,a=e.useEffect,s=e.useMemo,l=e.useDebugValue;function u(f,c,p,d,m){var h=o(null),g;h.current===null?(g={hasValue:!1,value:null},h.current=g):g=h.current;var y=s(function(){var k=!1,C,T,P=function(j){if(!k){k=!0,C=j;var z=d(j);if(m!==void 0&&g.hasValue){var M=g.value;if(m(M,z))return T=M,M}return T=z,z}var D=C,B=T;if(r(D,j))return B;var U=d(j);return m!==void 0&&m(B,U)?B:(C=j,T=U,U)},F=p===void 0?null:p,I=function(){return P(c())},O=F===null?void 0:function(){return P(F())};return[I,O]},[c,p,d,m]),v=y[0],w=y[1],A=i(f,v,w);return a(function(){g.hasValue=!0,g.value=A},[A]),l(A),A}Jo.useSyncExternalStoreWithSelector=u,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Jo}process.env.NODE_ENV==="production"?Ko.exports=c1():Ko.exports=f1();var d1=Ko.exports;const p1=jt(d1),Wc={},{useSyncExternalStoreWithSelector:h1}=p1;let Vc=!1;function m1(e,t=e.getState,n){(Wc?"production":void 0)!=="production"&&n&&!Vc&&(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"),Vc=!0);const r=h1(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return _.useDebugValue(r),r}const g1=e=>{(Wc?"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"?s1(e):e,n=(r,i)=>m1(t,r,i);return Object.assign(n,t),n},_t=e=>g1,jr={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},Zo=new Map,Ur=e=>{const t=Zo.get(e);return t?Object.fromEntries(Object.entries(t.stores).map(([n,r])=>[n,r.getState()])):{}},y1=(e,t,n)=>{if(e===void 0)return{type:"untracked",connection:t.connect(n)};const r=Zo.get(n.name);if(r)return{type:"tracked",store:e,...r};const i={connection:t.connect(n),stores:{}};return Zo.set(n.name,i),{type:"tracked",store:e,...i}},Vn=(e,t={})=>(n,r,i)=>{const{enabled:o,anonymousActionType:a,store:s,...l}=t;let u;try{u=(o??(jr?"production":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!u)return(jr?"production":void 0)!=="production"&&o&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),e(n,r,i);const{connection:f,...c}=y1(s,u,l);let p=!0;i.setState=(h,g,y)=>{const v=n(h,g);if(!p)return v;const w=y===void 0?{type:a||"anonymous"}:typeof y=="string"?{type:y}:y;return s===void 0?(f==null||f.send(w,r()),v):(f==null||f.send({...w,type:`${s}/${w.type}`},{...Ur(l.name),[s]:i.getState()}),v)};const d=(...h)=>{const g=p;p=!1,n(...h),p=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(([h,g])=>[h,h===c.store?m:g.getState()])))),i.dispatchFromDevtools&&typeof i.dispatch=="function"){let h=!1;const g=i.dispatch;i.dispatch=(...y)=>{(jr?"production":void 0)!=="production"&&y[0].type==="__setState"&&!h&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),h=!0),g(...y)}}return f.subscribe(h=>{var g;switch(h.type){case"ACTION":if(typeof h.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return Xo(h.payload,y=>{if(y.type==="__setState"){if(s===void 0){d(y.state);return}Object.keys(y.state).length!==1&&console.error(`
271
+ */var zc;function s1(){return zc||(zc=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=N,t=Rc();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,a=e.useEffect,s=e.useMemo,l=e.useDebugValue;function u(f,c,p,d,m){var h=o(null),g;h.current===null?(g={hasValue:!1,value:null},h.current=g):g=h.current;var y=s(function(){var k=!1,C,T,_=function(j){if(!k){k=!0,C=j;var z=d(j);if(m!==void 0&&g.hasValue){var M=g.value;if(m(M,z))return T=M,M}return T=z,z}var D=C,B=T;if(r(D,j))return B;var U=d(j);return m!==void 0&&m(B,U)?B:(C=j,T=U,U)},F=p===void 0?null:p,I=function(){return _(c())},O=F===null?void 0:function(){return _(F())};return[I,O]},[c,p,d,m]),v=y[0],w=y[1],A=i(f,v,w);return a(function(){g.hasValue=!0,g.value=A},[A]),l(A),A}Ko.useSyncExternalStoreWithSelector=u,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Ko}process.env.NODE_ENV==="production"?Ho.exports=a1():Ho.exports=s1();var l1=Ho.exports;const u1=jt(l1),$c={},{useSyncExternalStoreWithSelector:c1}=u1;let jc=!1;function f1(e,t=e.getState,n){($c?"production":void 0)!=="production"&&n&&!jc&&(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"),jc=!0);const r=c1(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return N.useDebugValue(r),r}const d1=e=>{($c?"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"?r1(e):e,n=(r,i)=>f1(t,r,i);return Object.assign(n,t),n},_t=e=>d1,Br={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},Yo=new Map,zr=e=>{const t=Yo.get(e);return t?Object.fromEntries(Object.entries(t.stores).map(([n,r])=>[n,r.getState()])):{}},p1=(e,t,n)=>{if(e===void 0)return{type:"untracked",connection:t.connect(n)};const r=Yo.get(n.name);if(r)return{type:"tracked",store:e,...r};const i={connection:t.connect(n),stores:{}};return Yo.set(n.name,i),{type:"tracked",store:e,...i}},Un=(e,t={})=>(n,r,i)=>{const{enabled:o,anonymousActionType:a,store:s,...l}=t;let u;try{u=(o??(Br?"production":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!u)return(Br?"production":void 0)!=="production"&&o&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),e(n,r,i);const{connection:f,...c}=p1(s,u,l);let p=!0;i.setState=(h,g,y)=>{const v=n(h,g);if(!p)return v;const w=y===void 0?{type:a||"anonymous"}:typeof y=="string"?{type:y}:y;return s===void 0?(f==null||f.send(w,r()),v):(f==null||f.send({...w,type:`${s}/${w.type}`},{...zr(l.name),[s]:i.getState()}),v)};const d=(...h)=>{const g=p;p=!1,n(...h),p=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(([h,g])=>[h,h===c.store?m:g.getState()])))),i.dispatchFromDevtools&&typeof i.dispatch=="function"){let h=!1;const g=i.dispatch;i.dispatch=(...y)=>{(Br?"production":void 0)!=="production"&&y[0].type==="__setState"&&!h&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),h=!0),g(...y)}}return f.subscribe(h=>{var g;switch(h.type){case"ACTION":if(typeof h.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return Go(h.payload,y=>{if(y.type==="__setState"){if(s===void 0){d(y.state);return}Object.keys(y.state).length!==1&&console.error(`
272
272
  [zustand devtools middleware] Unsupported __setState action format.
273
273
  When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
274
274
  and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }
275
- `);const v=y.state[s];if(v==null)return;JSON.stringify(i.getState())!==JSON.stringify(v)&&d(v);return}i.dispatchFromDevtools&&typeof i.dispatch=="function"&&i.dispatch(y)});case"DISPATCH":switch(h.payload.type){case"RESET":return d(m),s===void 0?f==null?void 0:f.init(i.getState()):f==null?void 0:f.init(Ur(l.name));case"COMMIT":if(s===void 0){f==null||f.init(i.getState());return}return f==null?void 0:f.init(Ur(l.name));case"ROLLBACK":return Xo(h.state,y=>{if(s===void 0){d(y),f==null||f.init(i.getState());return}d(y[s]),f==null||f.init(Ur(l.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return Xo(h.state,y=>{if(s===void 0){d(y);return}JSON.stringify(i.getState())!==JSON.stringify(y[s])&&d(y[s])});case"IMPORT_STATE":{const{nextLiftedState:y}=h.payload,v=(g=y.computedStates.slice(-1)[0])==null?void 0:g.state;if(!v)return;d(s===void 0?v:v[s]),f==null||f.send(null,y);return}case"PAUSE_RECORDING":return p=!p}return}}),m},Xo=(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 ea(e,t){let n;try{n=e()}catch{return}return{getItem:i=>{var o;const a=l=>l===null?null:JSON.parse(l,void 0),s=(o=n.getItem(i))!=null?o:null;return s instanceof Promise?s.then(a):a(s)},setItem:(i,o)=>n.setItem(i,JSON.stringify(o,void 0)),removeItem:i=>n.removeItem(i)}}const qn=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return qn(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return qn(r)(n)}}}},v1=(e,t)=>(n,r,i)=>{let o={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:g=>g,version:0,merge:(g,y)=>({...y,...g}),...t},a=!1;const s=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=qn(o.serialize),c=()=>{const g=o.partialize({...r()});let y;const v=f({state:g,version:o.version}).then(w=>u.setItem(o.name,w)).catch(w=>{y=w});if(y)throw y;return v},p=i.setState;i.setState=(g,y)=>{p(g,y),c()};const d=e((...g)=>{n(...g),c()},r,i);let m;const h=()=>{var g;if(!u)return;a=!1,s.forEach(v=>v(r()));const y=((g=o.onRehydrateStorage)==null?void 0:g.call(o,r()))||void 0;return qn(u.getItem.bind(u))(o.name).then(v=>{if(v)return o.deserialize(v)}).then(v=>{if(v)if(typeof v.version=="number"&&v.version!==o.version){if(o.migrate)return o.migrate(v.state,v.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return v.state}).then(v=>{var w;return m=o.merge(v,(w=r())!=null?w:d),n(m,!0),c()}).then(()=>{y==null||y(m,void 0),a=!0,l.forEach(v=>v(m))}).catch(v=>{y==null||y(void 0,v)})};return i.persist={setOptions:g=>{o={...o,...g},g.getStorage&&(u=g.getStorage())},clearStorage:()=>{u==null||u.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>h(),hasHydrated:()=>a,onHydrate:g=>(s.add(g),()=>{s.delete(g)}),onFinishHydration:g=>(l.add(g),()=>{l.delete(g)})},h(),m||d},b1=(e,t)=>(n,r,i)=>{let o={storage:ea(()=>localStorage),partialize:h=>h,version:0,merge:(h,g)=>({...g,...h}),...t},a=!1;const s=new Set,l=new Set;let u=o.storage;if(!u)return e((...h)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...h)},r,i);const f=()=>{const h=o.partialize({...r()});return u.setItem(o.name,{state:h,version:o.version})},c=i.setState;i.setState=(h,g)=>{c(h,g),f()};const p=e((...h)=>{n(...h),f()},r,i);let d;const m=()=>{var h,g;if(!u)return;a=!1,s.forEach(v=>{var w;return v((w=r())!=null?w:p)});const y=((g=o.onRehydrateStorage)==null?void 0:g.call(o,(h=r())!=null?h:p))||void 0;return qn(u.getItem.bind(u))(o.name).then(v=>{if(v)if(typeof v.version=="number"&&v.version!==o.version){if(o.migrate)return o.migrate(v.state,v.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return v.state}).then(v=>{var w;return d=o.merge(v,(w=r())!=null?w:p),n(d,!0),f()}).then(()=>{y==null||y(d,void 0),d=r(),a=!0,l.forEach(v=>v(d))}).catch(v=>{y==null||y(void 0,v)})};return i.persist={setOptions:h=>{o={...o,...h},h.storage&&(u=h.storage)},clearStorage:()=>{u==null||u.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>m(),hasHydrated:()=>a,onHydrate:h=>(s.add(h),()=>{s.delete(h)}),onFinishHydration:h=>(l.add(h),()=>{l.delete(h)})},o.skipHydration||m(),d||p},Hr=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?((jr?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),v1(e,t)):b1(e,t),qc=_t()(Vn(Hr(e=>({messageHistory:[],addMessageToHistory:t=>e(n=>({...n,messageHistory:[t,...(n.messageHistory??[]).slice(0,100).filter(String)]}))}),{name:"botpress-message-history"})));let Wr;const w1=new Uint8Array(16);function x1(){if(!Wr&&(Wr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Wr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Wr(w1)}const $e=[];for(let e=0;e<256;++e)$e.push((e+256).toString(16).slice(1));function k1(e,t=0){return $e[e[t+0]]+$e[e[t+1]]+$e[e[t+2]]+$e[e[t+3]]+"-"+$e[e[t+4]]+$e[e[t+5]]+"-"+$e[e[t+6]]+$e[e[t+7]]+"-"+$e[e[t+8]]+$e[e[t+9]]+"-"+$e[e[t+10]]+$e[e[t+11]]+$e[e[t+12]]+$e[e[t+13]]+$e[e[t+14]]+$e[e[t+15]]}const Kc={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function S1(e,t,n){if(Kc.randomUUID&&!e)return Kc.randomUUID();e=e||{};const r=e.random||(e.rng||x1)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,k1(r)}function Kn(e){var a;const{metadata:t,conversationId:n,userId:r}=e,{payload:i,disableInput:o}=Yc(e.payload);return{id:e.id,conversationId:n,authorId:r,timestamp:new Date(e.createdAt),block:i,feedback:(a=e.feedback)==null?void 0:a.value,disableInput:o,metadata:t}}const Yc=e=>{switch(e.type){case"audio":return Gc(e);case"card":return E1(e);case"carousel":return C1(e);case"choice":return A1(e);case"dropdown":return I1(e);case"file":return Qc(e);case"image":return Jc(e);case"location":return Zc(e);case"markdown":return Xc(e);case"text":return ef(e);case"video":return tf(e);case"bloc":return T1(e);case"custom":return{payload:e};default:{const t=e;throw new Error(`Unsuported message type ${t}`)}}},Yn=e=>({block:e,type:"bubble"}),Gc=e=>({payload:{type:"audio",url:e.audioUrl}}),E1=e=>({payload:Yn(nf(e))}),C1=e=>({payload:{type:"carousel",blocks:e.items.map(t=>nf({...t}))}}),A1=e=>{const t=e.options.map(o=>({title:o.label,value:o.value})),n=e.text,r=S1(),i=Yn({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:a})=>({type:"button",variant:"action",text:o,buttonValue:a,groupId:r}))}]}}},I1=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:Yn({type:"column",blocks:r})}},Qc=e=>({payload:{type:"file",url:e.fileUrl,title:e.title}}),Jc=e=>({payload:{type:"image",url:e.imageUrl}}),Zc=e=>({payload:{type:"location",latitude:e.latitude,longitude:e.longitude,title:e.title??e.address??"View on map"}}),Xc=e=>({payload:Yn({type:"text",text:e.markdown})}),ef=e=>({payload:Yn({type:"text",text:e.text,value:e.value})}),tf=e=>({payload:{type:"video",url:e.videoUrl}}),T1=e=>({payload:{type:"column",blocks:e.items.map(n=>{switch(n.type){case"audio":return Gc({...n.payload,type:n.type}).payload;case"file":return Qc({...n.payload,type:n.type}).payload;case"image":return Jc({...n.payload,type:n.type}).payload;case"location":return Zc({...n.payload,type:n.type}).payload;case"markdown":return Xc({...n.payload,type:n.type}).payload;case"text":return ef({...n.payload,type:n.type}).payload;case"video":return tf({...n.payload,type:n.type}).payload;default:throw new Error("Unsuported message type")}})}}),nf=e=>{const t=e.title,n=e.subtitle,r=e.imageUrl,i=e.actions.map(a=>{switch(a.action){case"postback":return{type:"button",variant:"action",text:a.label,buttonValue:a.value,reusable:!0};case"url":return{type:"button",variant:"link",text:a.label,buttonValue:a.value,reusable:!0};case"say":return{type:"button",variant:"action",text:a.label,buttonValue:a.value,reusable:!0};default:throw new Error(`Unknown action type ${a.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]}},an=_t()(Vn(e=>({messages:[],isFetching:!1,setMessages:t=>e({messages:t}),saveMessage:t=>e(({messages:n})=>{var i;const r=(i=t.metadata)==null?void 0:i.clientMessageId;if(r){const o=n.findIndex(s=>{var l;return((l=s.metadata)==null?void 0:l.clientMessageId)===r}),a=n[o];if(o!==-1)return{messages:[...n.slice(0,o),{...a,...t},...n.slice(o+1)]}}return{messages:[...n.filter(o=>o.id!==t.id),t]}}),updateMessage:(t,n)=>e(({messages:r})=>({messages:r.map(i=>i.id===t?{...i,...n}:i)})),clearMessages:()=>e({messages:[]}),fetchMessages:async({client:t,conversationId:n})=>{const r=[];e({isFetching:!0});try{let i;do{const{messages:o,meta:a}=await t.listConversationMessages({conversationId:n,nextToken:i});r.push(...o),i=a.nextToken}while(i);return r.reverse().map(o=>Kn(o)).filter(Boolean)}finally{e({isFetching:!1})}}}),{name:"messagesStore"})),O1=(e,t)=>_t()(Vn(Hr(n=>({setUser:r=>n(i=>({...i,user:r})),setConversationId:r=>n(i=>({...i,conversationId:r})),clearConversationId:()=>n(r=>({...r,conversationId:void 0})),clearAll:()=>{n(r=>({...r,user:void 0,conversationId:void 0}))}}),{name:e,storage:ea(()=>t==="sessionStorage"?sessionStorage:localStorage)}))),Tn=class Tn{constructor(){}static getInstance(t="bp-webchat",n){return Tn._instances[t]||(Tn._instances[t]=O1(t,n)),Tn._instances[t]}};zi(Tn,"_instances",{});let ta=Tn;const rf=ta.getInstance,sn=_t()(Vn(e=>({eventEmitter:Xs(),messageContainerRef:_.createRef(),setMessageContainerRef:t=>e({messageContainerRef:t}),portalContainer:null,setPortalContainer:t=>e({portalContainer:t})}),{name:"webchatStore"})),D1=8,M1=e=>_t()(Hr((t,n)=>({files:[],setFiles:r=>t({files:r}),upsertFile:r=>t(({files:i})=>({files:i.some(s=>s.name===r.name)?i.map(s=>s.name===r.name?{...s,...r}:s):[...i,{...r}]})),uploadFile:async(r,i)=>{if(n().files.length===D1)return;const o=r.name.lastIndexOf("."),a=o>0&&o<r.name.length-1,s=a?r.name.substring(0,o):r.name,l=a?r.name.substring(o):"",u=Bm(s,n().files,p=>p.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:p,type:d}=await i(c);n().upsertFile({name:u,type:d,url:p,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:ea(()=>sessionStorage)})),On=class On{constructor(){}static getInstance(t="bp-composer-file-store"){return On._instances[t]||(On._instances[t]=M1(t)),On._instances[t]}};zi(On,"_instances",{});let na=On;const of=na.getInstance,Gn=_t()(e=>({participants:[],setParticipants:t=>e({participants:t}),addParticipant:t=>e(n=>({participants:[...n.participants,t]})),removeParticipant:t=>e(n=>({participants:n.participants.filter(r=>r.id!==t)})),clearParticipants:()=>e({participants:[]})})),_1=e=>_t()(Vn(Hr((t,n)=>({soundOn:!0,setSoundEnabled:r=>t({soundOn:r}),toggleSound:()=>t({soundOn:!n().soundOn})}),{name:e}))),Dn=class Dn{constructor(){}static getInstance(t="webchat:soundEnabled"){return Dn._instances[t]||(Dn._instances[t]=_1(t)),Dn._instances[t]}};zi(Dn,"_instances",{});let ra=Dn;const af=ra.getInstance,P1=({text:e,buttonValue:t,variant:n,groupId:r,reusable:i,sendMessage:o,isReadOnly:a,...s})=>{const l=sn(w=>w.eventEmitter),[u,f]=_.useState(!1),[c,p]=_.useState(!1),[d,m]=_.useState(!1),{message:{blocks:{button:h}}}=ge;_.useEffect(()=>{if(r)return l.on(`button-group-${r}-click`,()=>{p(!0),i||m(!0)})},[l,r,i]);const y={...s,onClick:w=>{if((d||a)&&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,...h},v=d||a;return n==="link"?S.jsx("a",{...y,style:a?{pointerEvents:"none"}:void 0,href:t,target:"_blank",rel:"noopener noreferrer",children:e}):S.jsx("button",{...y,style:a?{pointerEvents:"none"}:void 0,disabled:v,children:e})},ia=_.createContext(null);function sf(){const e=_.useContext(ia);if(!e)throw new Error("useMessageContext must be used within a Message");return e}const oa=_.createContext({showInputModal:void 0});function aa(){return _.useContext(oa)}const lf=_.forwardRef(({block:e,direction:t,sender:n,timestamp:r,messageId:i,feedback:o,metadata:a,isReadOnly:s,sendMessage:l,addMessageFeedback:u,...f},c)=>{const{showInputModal:p}=aa(),{message:{blocks:{bubble:{container:d,feedbackContainer:m,feedbackIcon:h}}}}=ge;return t=="incoming"?S.jsxs("div",{"data-direction":"incoming","data-feedback":!!o,...f,...d,ref:c,children:[S.jsx(Yt,{block:{...e,direction:t,timestamp:r,sender:n,messageId:i,isReadOnly:s,metadata:a,sendMessage:l}}),u&&p&&e.type==="text"&&S.jsxs("div",{...m,children:[S.jsx(X0,{...h,"data-selected":o==="positive",onClick:()=>u(i,{value:"positive"})}),S.jsx(Z0,{...h,"data-selected":o==="negative",onClick:async()=>{const g=await p({title:"Help us improve",description:"Please provide feedback to help us improve.",confirmButtonText:"Send feedback",cancelButtonText:"Cancel",Content:N1});u(i,{value:"negative",comment:g})}})]})]}):S.jsx("div",{"data-direction":"outgoing",...f,...d,ref:c,children:S.jsx(Yt,{block:{...e,direction:t,timestamp:r,sender:n,messageId:i,isReadOnly:s,metadata:a,sendMessage:l,addMessageFeedback:u}})})});lf.displayName="Bubble";const N1=({setValue:e})=>{const{modal:{dialog:{content:t}}}=ge;return S.jsx("textarea",{...t.textarea,placeholder:"Let us know what went wrong...",onChange:n=>e(n.target.value)})},uf=({className:e,...t})=>S.jsx("div",{"data-slot":"skeleton",className:`bpSkeleton ${e||""}`,...t});uf.displayName="Skeleton";var ot=function(){return ot=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},ot.apply(this,arguments)};function cf(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 ln(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(f){try{u(r.next(f))}catch(c){a(c)}}function l(f){try{u(r.throw(f))}catch(c){a(c)}}function u(f){f.done?o(f.value):i(f.value).then(s,l)}u((r=r.apply(e,t||[])).next())})}function un(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(f){return l([u,f])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=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 ff(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function sa(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 L1(){var e=_.useRef(!1),t=_.useCallback(function(){return e.current},[]);return _.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),t}function F1(e,t,n){t===void 0&&(t=[]),n===void 0&&(n={loading:!1});var r=_.useRef(0),i=L1(),o=_.useState(n),a=o[0],s=o[1],l=_.useCallback(function(){for(var u=[],f=0;f<arguments.length;f++)u[f]=arguments[f];var c=++r.current;return a.loading||s(function(p){return ot(ot({},p),{loading:!0})}),e.apply(void 0,u).then(function(p){return i()&&c===r.current&&s({value:p,loading:!1}),p},function(p){return i()&&c===r.current&&s({error:p,loading:!1}),p})},t);return[a,l]}function R1(e,t){t===void 0&&(t=[]);var n=F1(e,t,{loading:!0}),r=n[0],i=n[1];return _.useEffect(function(){i()},[i]),r}const df=_.forwardRef(({url:e,type:t,orientation:n="auto",...r},i)=>{const o=_.useId(),{setIsLoading:a}=sf(),[s,l]=_.useState(n==="auto"?"square":n),[u,f]=_.useState("initial"),{message:{blocks:{image:c}}}=ge;return _.useLayoutEffect(()=>(a(p=>[...p,o]),()=>{a(p=>p.filter(d=>d!==o))}),[o,a]),R1(async()=>{if(!e)return;const p=new Image;try{const{width:d,height:m}=await cm(e);n==="auto"&&l(B1(d,m)),p.onload=()=>{f("loaded"),a(h=>h.filter(g=>g!==o))},p.onerror=()=>{f("error"),l("square"),a(h=>h.filter(g=>g!==o))},p.src=e,p.complete&&(p.naturalWidth>0?(f("loaded"),a(h=>h.filter(g=>g!==o))):(f("error"),l("square"),a(h=>h.filter(g=>g!==o))))}catch(d){console.error(d),f("error"),a(m=>m.filter(h=>h!==o))}return()=>{p.onload=null,p.onerror=null}},[e,o,a,n]),e?u==="error"?S.jsx("div",{"data-error":"true","data-orientation":s,...r,...c.image,ref:i,children:S.jsx(Nc,{size:"25%",strokeWidth:"5%"})}):u==="initial"?S.jsx(uf,{"data-orientation":s,...c.placeholder}):S.jsx("img",{"data-orientation":s,"data-loaded":u==="loaded",...r,...c.image,src:e,alt:"",ref:i}):null});df.displayName="Image";function B1(e,t){const n={square:1,portrait:.75,landscape:1.3333333333333333},r=e/t;return Object.keys(n).reduce((o,a)=>Math.abs(n[a]-r)<Math.abs(n[o]-r)?a:o)}const pf=_.forwardRef(({url:e,isReadOnly:t,...n},r)=>{const{message:{blocks:{video:i}}}=ge;return S.jsx("div",{children:S.jsx("video",{...n,"data-chromatic":"ignore",style:t?{pointerEvents:"none"}:void 0,controls:!0,src:e,...i,ref:r})})});pf.displayName="Video";const hf=_.forwardRef(({url:e,isReadOnly:t,...n},r)=>{const{message:{blocks:{audio:i}}}=ge;return S.jsx("div",{children:S.jsx("audio",{...n,controls:!0,style:t?{pointerEvents:"none"}:void 0,src:e,...i,ref:r})})});hf.displayName="Audio";const mf=_.forwardRef(({latitude:e,longitude:t,title:n,isReadOnly:r,...i},o)=>{const a=`https://www.google.com/maps/search/?api=1&query=${e},${t}`,{message:{blocks:{location:s}}}=ge;return S.jsxs("a",{...i,...s.container,style:r?{pointerEvents:"none"}:void 0,href:a,type:"_blank",rel:"noopener",ref:o,children:[S.jsx("p",{...s.title,children:n}),S.jsx(q0,{...s.icon})]})});mf.displayName="Location";const gf=_.forwardRef(({blocks:e,horizontalAlignment:t,verticalAlignment:n,direction:r,sender:i,timestamp:o,messageId:a,isReadOnly:s,sendMessage:l,...u},f)=>{const{message:{blocks:{column:c}}}=ge;return S.jsx("div",{"data-horizontal":t,"data-vertical":n,...u,...c,ref:f,children:e.map((p,d)=>S.jsx(Yt,{block:{...p,direction:r,timestamp:o,sender:i,messageId:a,isReadOnly:s,sendMessage:l}},d))})});gf.displayName="Column";const yf=_.forwardRef(({blocks:e,horizontalAlignment:t,verticalAlignment:n,direction:r,sender:i,timestamp:o,metadata:a,messageId:s,isReadOnly:l,sendMessage:u,...f},c)=>{const{message:{blocks:{row:p}}}=ge;return S.jsx("div",{"data-horizontal":t,"data-vertical":n,...f,...p,ref:c,children:e.map((d,m)=>S.jsx(Yt,{block:{...d,direction:r,timestamp:o,sender:i,messageId:s,isReadOnly:l,sendMessage:u}},m))})});yf.displayName="Row";function z1(e){return Object.prototype.toString.call(e)==="[object Object]"}function vf(e){return z1(e)||Array.isArray(e)}function $1(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function la(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(a=>{const s=e[a],l=t[a];return typeof s=="function"?`${s}`==`${l}`:!vf(s)||!vf(l)?s===l:la(s,l)})}function bf(e){return e.concat().sort((t,n)=>t.name>n.name?1:-1).map(t=>t.options)}function j1(e,t){if(e.length!==t.length)return!1;const n=bf(e),r=bf(t);return n.every((i,o)=>{const a=r[o];return la(i,a)})}function ua(e){return typeof e=="number"}function ca(e){return typeof e=="string"}function Vr(e){return typeof e=="boolean"}function wf(e){return Object.prototype.toString.call(e)==="[object Object]"}function Pe(e){return Math.abs(e)}function fa(e){return Math.sign(e)}function Qn(e,t){return Pe(e-t)}function U1(e,t){if(e===0||t===0||Pe(e)<=Pe(t))return 0;const n=Qn(Pe(e),Pe(t));return Pe(n/e)}function H1(e){return Math.round(e*100)/100}function Jn(e){return Xn(e).map(Number)}function ct(e){return e[Zn(e)]}function Zn(e){return Math.max(0,e.length-1)}function da(e,t){return t===Zn(e)}function xf(e,t=0){return Array.from(Array(e),(n,r)=>t+r)}function Xn(e){return Object.keys(e)}function kf(e,t){return[e,t].reduce((n,r)=>(Xn(r).forEach(i=>{const o=n[i],a=r[i],s=wf(o)&&wf(a);n[i]=s?kf(o,a):a}),n),{})}function pa(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function W1(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 a(l,u){return ca(e)?n[e](l):e(t,l,u)}return{measure:a}}function er(){let e=[];function t(i,o,a,s={passive:!0}){let l;if("addEventListener"in i)i.addEventListener(o,a,s),l=()=>i.removeEventListener(o,a,s);else{const u=i;u.addListener(a),l=()=>u.removeListener(a)}return e.push(l),r}function n(){e=e.filter(i=>i())}const r={add:t,clear:n};return r}function V1(e,t,n,r){const i=er(),o=1e3/60;let a=null,s=0,l=0;function u(){i.add(e,"visibilitychange",()=>{e.hidden&&m()})}function f(){d(),i.clear()}function c(g){if(!l)return;a||(a=g,n(),n());const y=g-a;for(a=g,s+=y;s>=o;)n(),s-=o;const v=s/o;r(v),l&&(l=t.requestAnimationFrame(c))}function p(){l||(l=t.requestAnimationFrame(c))}function d(){t.cancelAnimationFrame(l),a=null,s=0,l=0}function m(){a=null,s=0}return{init:u,destroy:f,start:p,stop:d,update:n,render:r}}function q1(e,t){const n=t==="rtl",r=e==="y",i=r?"y":"x",o=r?"x":"y",a=!r&&n?-1:1,s=f(),l=c();function u(m){const{height:h,width:g}=m;return r?h:g}function f(){return r?"top":n?"right":"left"}function c(){return r?"bottom":n?"left":"right"}function p(m){return m*a}return{scroll:i,cross:o,startEdge:s,endEdge:l,measureSize:u,direction:p}}function qt(e=0,t=0){const n=Pe(e-t);function r(u){return u<e}function i(u){return u>t}function o(u){return r(u)||i(u)}function a(u){return o(u)?r(u)?e:t:u}function s(u){return n?u-n*Math.ceil((u-t)/n):u}return{length:n,max:t,min:e,constrain:a,reachedAny:o,reachedMax:i,reachedMin:r,removeOffset:s}}function Sf(e,t,n){const{constrain:r}=qt(0,e),i=e+1;let o=a(t);function a(p){return n?Pe((i+p)%i):r(p)}function s(){return o}function l(p){return o=a(p),c}function u(p){return f().set(s()+p)}function f(){return Sf(e,s(),n)}const c={get:s,set:l,add:u,clone:f};return c}function K1(e,t,n,r,i,o,a,s,l,u,f,c,p,d,m,h,g,y,v){const{cross:w,direction:A}=e,k=["INPUT","SELECT","TEXTAREA"],C={passive:!1},T=er(),P=er(),F=qt(50,225).constrain(d.measure(20)),I={mouse:300,touch:400},O={mouse:500,touch:600},j=m?43:25;let z=!1,M=0,D=0,B=!1,U=!1,$=!1,V=!1;function b(L){if(!v)return;function ne(ke){(Vr(v)||v(L,ke))&&Y(ke)}const me=t;T.add(me,"dragstart",ke=>ke.preventDefault(),C).add(me,"touchmove",()=>{},C).add(me,"touchend",()=>{}).add(me,"touchstart",ne).add(me,"mousedown",ne).add(me,"touchcancel",X).add(me,"contextmenu",X).add(me,"click",ie,!0)}function N(){T.clear(),P.clear()}function H(){const L=V?n:t;P.add(L,"touchmove",J,C).add(L,"touchend",X).add(L,"mousemove",J,C).add(L,"mouseup",X)}function x(L){const ne=L.nodeName||"";return k.includes(ne)}function W(){return(m?O:I)[V?"mouse":"touch"]}function ee(L,ne){const me=c.add(fa(L)*-1),ke=f.byDistance(L,!m).distance;return m||Pe(L)<F?ke:g&&ne?ke*.5:f.byIndex(me.get(),0).distance}function Y(L){const ne=pa(L,r);V=ne,$=m&&ne&&!L.buttons&&z,z=Qn(i.get(),a.get())>=2,!(ne&&L.button!==0)&&(x(L.target)||(B=!0,o.pointerDown(L),u.useFriction(0).useDuration(0),i.set(a),H(),M=o.readPoint(L),D=o.readPoint(L,w),p.emit("pointerDown")))}function J(L){if(!pa(L,r)&&L.touches.length>=2)return X(L);const me=o.readPoint(L),ke=o.readPoint(L,w),oe=Qn(me,M),G=Qn(ke,D);if(!U&&!V&&(!L.cancelable||(U=oe>G,!U)))return X(L);const ue=o.pointerMove(L);oe>h&&($=!0),u.useFriction(.3).useDuration(.75),s.start(),i.add(A(ue)),L.preventDefault()}function X(L){const me=f.byDistance(0,!1).index!==c.get(),ke=o.pointerUp(L)*W(),oe=ee(A(ke),me),G=U1(ke,oe),ue=j-10*G,de=y+G/50;U=!1,B=!1,P.clear(),u.useDuration(ue).useFriction(de),l.distance(oe,!m),V=!1,p.emit("pointerUp")}function ie(L){$&&(L.stopPropagation(),L.preventDefault(),$=!1)}function K(){return B}return{init:b,destroy:N,pointerDown:K}}function Y1(e,t){let r,i;function o(c){return c.timeStamp}function a(c,p){const m=`client${(p||e.scroll)==="x"?"X":"Y"}`;return(pa(c,t)?c:c.touches[0])[m]}function s(c){return r=c,i=c,a(c)}function l(c){const p=a(c)-a(i),d=o(c)-o(r)>170;return i=c,d&&(r=c),p}function u(c){if(!r||!i)return 0;const p=a(i)-a(r),d=o(c)-o(r),m=o(c)-o(i)>170,h=p/d;return d&&!m&&Pe(h)>.1?h:0}return{pointerDown:s,pointerMove:l,pointerUp:u,readPoint:a}}function G1(){function e(n){const{offsetTop:r,offsetLeft:i,offsetWidth:o,offsetHeight:a}=n;return{top:r,right:i+o,bottom:r+a,left:i,width:o,height:a}}return{measure:e}}function Q1(e){function t(r){return e*(r/100)}return{measure:t}}function J1(e,t,n,r,i,o,a){const s=[e].concat(r);let l,u,f=[],c=!1;function p(g){return i.measureSize(a.measure(g))}function d(g){if(!o)return;u=p(e),f=r.map(p);function y(v){for(const w of v){if(c)return;const A=w.target===e,k=r.indexOf(w.target),C=A?u:f[k],T=p(A?e:r[k]);if(Pe(T-C)>=.5){g.reInit(),t.emit("resize");break}}}l=new ResizeObserver(v=>{(Vr(o)||o(g,v))&&y(v)}),n.requestAnimationFrame(()=>{s.forEach(v=>l.observe(v))})}function m(){c=!0,l&&l.disconnect()}return{init:d,destroy:m}}function Z1(e,t,n,r,i,o){let a=0,s=0,l=i,u=o,f=e.get(),c=0;function p(){const C=r.get()-e.get(),T=!l;let P=0;return T?(a=0,n.set(r),e.set(r),P=C):(n.set(e),a+=C/l,a*=u,f+=a,e.add(a),P=f-c),s=fa(P),c=f,k}function d(){const C=r.get()-t.get();return Pe(C)<.001}function m(){return l}function h(){return s}function g(){return a}function y(){return w(i)}function v(){return A(o)}function w(C){return l=C,k}function A(C){return u=C,k}const k={direction:h,duration:m,velocity:g,seek:p,settled:d,useBaseFriction:v,useBaseDuration:y,useFriction:A,useDuration:w};return k}function X1(e,t,n,r,i){const o=i.measure(10),a=i.measure(50),s=qt(.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",h=Pe(e[m]-t.get()),g=n.get()-t.get(),y=s.constrain(h/a);n.subtract(g*y),!d&&Pe(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 ek(e,t,n,r,i){const o=qt(-t+e,0),a=c(),s=f(),l=p();function u(m,h){return Qn(m,h)<=1}function f(){const m=a[0],h=ct(a),g=a.lastIndexOf(m),y=a.indexOf(h)+1;return qt(g,y)}function c(){return n.map((m,h)=>{const{min:g,max:y}=o,v=o.constrain(m),w=!h,A=da(n,h);return w?y:A||u(g,v)?g:u(y,v)?y:v}).map(m=>parseFloat(m.toFixed(3)))}function p(){if(t<=e+i)return[o.max];if(r==="keepSnaps")return a;const{min:m,max:h}=s;return a.slice(m,h)}return{snapsContained:l,scrollContainLimit:s}}function tk(e,t,n){const r=t[0],i=n?r-e:ct(t);return{limit:qt(i,r)}}function nk(e,t,n,r){const o=t.min+.1,a=t.max+.1,{reachedMin:s,reachedMax:l}=qt(o,a);function u(p){return p===1?l(n.get()):p===-1?s(n.get()):!1}function f(p){if(!u(p))return;const d=e*(p*-1);r.forEach(m=>m.add(d))}return{loop:f}}function rk(e){const{max:t,length:n}=e;function r(o){const a=o-t;return n?a/-n:0}return{get:r}}function ik(e,t,n,r,i){const{startEdge:o,endEdge:a}=e,{groupSlides:s}=i,l=c().map(t.measure),u=p(),f=d();function c(){return s(r).map(h=>ct(h)[a]-h[0][o]).map(Pe)}function p(){return r.map(h=>n[o]-h[o]).map(h=>-Pe(h))}function d(){return s(u).map(h=>h[0]).map((h,g)=>h+l[g])}return{snaps:u,snapsAligned:f}}function ok(e,t,n,r,i,o){const{groupSlides:a}=i,{min:s,max:l}=r,u=f();function f(){const p=a(o),d=!e||t==="keepSnaps";return n.length===1?[o]:d?p:p.slice(s,l).map((m,h,g)=>{const y=!h,v=da(g,h);if(y){const w=ct(g[0])+1;return xf(w)}if(v){const w=Zn(o)-ct(g)[0]+1;return xf(w,ct(g)[0])}return m})}return{slideRegistry:u}}function ak(e,t,n,r,i){const{reachedAny:o,removeOffset:a,constrain:s}=r;function l(m){return m.concat().sort((h,g)=>Pe(h)-Pe(g))[0]}function u(m){const h=e?a(m):s(m),g=t.map((v,w)=>({diff:f(v-h,0),index:w})).sort((v,w)=>Pe(v.diff)-Pe(w.diff)),{index:y}=g[0];return{index:y,distance:h}}function f(m,h){const g=[m,m+n,m-n];if(!e)return m;if(!h)return l(g);const y=g.filter(v=>fa(v)===h);return y.length?l(y):ct(g)-n}function c(m,h){const g=t[m]-i.get(),y=f(g,h);return{index:m,distance:y}}function p(m,h){const g=i.get()+m,{index:y,distance:v}=u(g),w=!e&&o(g);if(!h||w)return{index:y,distance:m};const A=t[y]-v,k=m+f(A,0);return{index:y,distance:k}}return{byDistance:p,byIndex:c,shortcut:f}}function sk(e,t,n,r,i,o,a){function s(c){const p=c.distance,d=c.index!==t.get();o.add(p),p&&(r.duration()?e.start():(e.update(),e.render(1),e.update())),d&&(n.set(t.get()),t.set(c.index),a.emit("select"))}function l(c,p){const d=i.byDistance(c,p);s(d)}function u(c,p){const d=t.clone().set(c),m=i.byIndex(d.get(),p);s(m)}return{distance:l,index:u}}function lk(e,t,n,r,i,o,a,s){const l={passive:!0,capture:!0};let u=0;function f(d){if(!s)return;function m(h){if(new Date().getTime()-u>10)return;a.emit("slideFocusStart"),e.scrollLeft=0;const v=n.findIndex(w=>w.includes(h));ua(v)&&(i.useDuration(0),r.index(v,0),a.emit("slideFocus"))}o.add(document,"keydown",c,!1),t.forEach((h,g)=>{o.add(h,"focus",y=>{(Vr(s)||s(d,y))&&m(g)},l)})}function c(d){d.code==="Tab"&&(u=new Date().getTime())}return{init:f}}function tr(e){let t=e;function n(){return t}function r(l){t=a(l)}function i(l){t+=a(l)}function o(l){t-=a(l)}function a(l){return ua(l)?l:l.get()}return{get:n,set:r,add:i,subtract:o}}function Ef(e,t){const n=e.scroll==="x"?a:s,r=t.style;let i=null,o=!1;function a(p){return`translate3d(${p}px,0px,0px)`}function s(p){return`translate3d(0px,${p}px,0px)`}function l(p){if(o)return;const d=H1(e.direction(p));d!==i&&(r.transform=n(d),i=d)}function u(p){o=!p}function f(){o||(r.transform="",t.getAttribute("style")||t.removeAttribute("style"))}return{clear:f,to:l,toggleActive:u}}function uk(e,t,n,r,i,o,a,s,l){const f=Jn(i),c=Jn(i).reverse(),p=y().concat(v());function d(T,P){return T.reduce((F,I)=>F-i[I],P)}function m(T,P){return T.reduce((F,I)=>d(F,P)>0?F.concat([I]):F,[])}function h(T){return o.map((P,F)=>({start:P-r[F]+.5+T,end:P+t-.5+T}))}function g(T,P,F){const I=h(P);return T.map(O=>{const j=F?0:-n,z=F?n:0,M=F?"end":"start",D=I[O][M];return{index:O,loopPoint:D,slideLocation:tr(-1),translate:Ef(e,l[O]),target:()=>s.get()>D?j:z}})}function y(){const T=a[0],P=m(c,T);return g(P,n,!1)}function v(){const T=t-a[0]-1,P=m(f,T);return g(P,-n,!0)}function w(){return p.every(({index:T})=>{const P=f.filter(F=>F!==T);return d(P,t)<=.1})}function A(){p.forEach(T=>{const{target:P,translate:F,slideLocation:I}=T,O=P();O!==I.get()&&(F.to(O),I.set(O))})}function k(){p.forEach(T=>T.translate.clear())}return{canLoop:w,clear:k,loop:A,loopPoints:p}}function ck(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||(Vr(n)||n(l,f))&&u(f)}),r.observe(e,{childList:!0})}function a(){r&&r.disconnect(),i=!0}return{init:o,destroy:a}}function fk(e,t,n,r){const i={};let o=null,a=null,s,l=!1;function u(){s=new IntersectionObserver(m=>{l||(m.forEach(h=>{const g=t.indexOf(h.target);i[g]=h}),o=null,a=null,n.emit("slidesInView"))},{root:e.parentElement,threshold:r}),t.forEach(m=>s.observe(m))}function f(){s&&s.disconnect(),l=!0}function c(m){return Xn(i).reduce((h,g)=>{const y=parseInt(g),{isIntersecting:v}=i[y];return(m&&v||!m&&!v)&&h.push(y),h},[])}function p(m=!0){if(m&&o)return o;if(!m&&a)return a;const h=c(m);return m&&(o=h),m||(a=h),h}return{init:u,destroy:f,get:p}}function dk(e,t,n,r,i,o){const{measureSize:a,startEdge:s,endEdge:l}=e,u=n[0]&&i,f=m(),c=h(),p=n.map(a),d=g();function m(){if(!u)return 0;const v=n[0];return Pe(t[s]-v[s])}function h(){if(!u)return 0;const v=o.getComputedStyle(ct(r));return parseFloat(v.getPropertyValue(`margin-${l}`))}function g(){return n.map((v,w,A)=>{const k=!w,C=da(A,w);return k?p[w]+f:C?p[w]+c:A[w+1][s]-v[s]}).map(Pe)}return{slideSizes:p,slideSizesWithGaps:d,startGap:f,endGap:c}}function pk(e,t,n,r,i,o,a,s,l){const{startEdge:u,endEdge:f,direction:c}=e,p=ua(n);function d(y,v){return Jn(y).filter(w=>w%v===0).map(w=>y.slice(w,w+v))}function m(y){return y.length?Jn(y).reduce((v,w,A)=>{const k=ct(v)||0,C=k===0,T=w===Zn(y),P=i[u]-o[k][u],F=i[u]-o[w][f],I=!r&&C?c(a):0,O=!r&&T?c(s):0,j=Pe(F-O-(P+I));return A&&j>t+l&&v.push(w),T&&v.push(y.length),v},[]).map((v,w,A)=>{const k=Math.max(A[w-1]||0);return y.slice(k,v)}):[]}function h(y){return p?d(y,n):m(y)}return{groupSlides:h}}function hk(e,t,n,r,i,o,a){const{align:s,axis:l,direction:u,startIndex:f,loop:c,duration:p,dragFree:d,dragThreshold:m,inViewThreshold:h,slidesToScroll:g,skipSnaps:y,containScroll:v,watchResize:w,watchSlides:A,watchDrag:k,watchFocus:C}=o,T=2,P=G1(),F=P.measure(t),I=n.map(P.measure),O=q1(l,u),j=O.measureSize(F),z=Q1(j),M=W1(s,j),D=!c&&!!v,B=c||!!v,{slideSizes:U,slideSizesWithGaps:$,startGap:V,endGap:b}=dk(O,F,I,n,B,i),N=pk(O,j,g,c,F,I,V,b,T),{snaps:H,snapsAligned:x}=ik(O,M,F,I,N),W=-ct(H)+ct($),{snapsContained:ee,scrollContainLimit:Y}=ek(j,W,x,v,T),J=D?ee:x,{limit:X}=tk(W,J,c),ie=Sf(Zn(J),f,c),K=ie.clone(),te=Jn(n),L=({dragHandler:pe,scrollBody:fe,scrollBounds:Ee,options:{loop:Oe}})=>{Oe||Ee.constrain(pe.pointerDown()),fe.seek()},ne=({scrollBody:pe,translate:fe,location:Ee,offsetLocation:Oe,previousLocation:st,scrollLooper:gt,slideLooper:ze,dragHandler:lt,animation:Ge,eventHandler:Bi,scrollBounds:PT,options:{loop:$h}},jh)=>{const Uh=pe.settled(),NT=!PT.shouldConstrain(),Hh=$h?Uh:Uh&&NT,Wh=Hh&&!lt.pointerDown();Wh&&Ge.stop();const LT=Ee.get()*jh+st.get()*(1-jh);Oe.set(LT),$h&&(gt.loop(pe.direction()),ze.loop()),fe.to(Oe.get()),Wh&&Bi.emit("settle"),Hh||Bi.emit("scroll")},me=V1(r,i,()=>L(le),pe=>ne(le,pe)),ke=.68,oe=J[ie.get()],G=tr(oe),ue=tr(oe),de=tr(oe),we=tr(oe),Se=Z1(G,de,ue,we,p,ke),Ue=ak(c,J,W,X,we),Ye=sk(me,ie,K,Se,Ue,we,a),Z=rk(X),se=er(),R=fk(t,n,a,h),{slideRegistry:q}=ok(D,v,J,Y,N,te),ae=lk(e,n,q,Ye,Se,se,a,C),le={ownerDocument:r,ownerWindow:i,eventHandler:a,containerRect:F,slideRects:I,animation:me,axis:O,dragHandler:K1(O,e,r,i,we,Y1(O,i),G,me,Ye,Se,Ue,ie,a,z,d,m,y,ke,k),eventStore:se,percentOfView:z,index:ie,indexPrevious:K,limit:X,location:G,offsetLocation:de,previousLocation:ue,options:o,resizeHandler:J1(t,a,i,n,O,w,P),scrollBody:Se,scrollBounds:X1(X,de,we,Se,z),scrollLooper:nk(W,X,de,[G,de,ue,we]),scrollProgress:Z,scrollSnapList:J.map(Z.get),scrollSnaps:J,scrollTarget:Ue,scrollTo:Ye,slideLooper:uk(O,j,W,U,$,H,J,de,n),slideFocus:ae,slidesHandler:ck(t,a,A),slidesInView:R,slideIndexes:te,slideRegistry:q,slidesToScroll:N,target:we,translate:Ef(O,t)};return le}function mk(){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 a(u,f){return e[u]=r(u).filter(c=>c!==f),l}function s(){e={}}const l={init:n,emit:i,off:a,on:o,clear:s};return l}const gk={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 yk(e){function t(o,a){return kf(o,a||{})}function n(o){const a=o.breakpoints||{},s=Xn(a).filter(l=>e.matchMedia(l).matches).map(l=>a[l]).reduce((l,u)=>t(l,u),{});return t(o,s)}function r(o){return o.map(a=>Xn(a.breakpoints||{})).reduce((a,s)=>a.concat(s),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:n,optionsMediaQueries:r}}function vk(e){let t=[];function n(o,a){return t=a.filter(({options:s})=>e.optionsAtMedia(s).active!==!1),t.forEach(s=>s.init(o,e)),a.reduce((s,l)=>Object.assign(s,{[l.name]:l}),{})}function r(){t=t.filter(o=>o.destroy())}return{init:n,destroy:r}}function qr(e,t,n){const r=e.ownerDocument,i=r.defaultView,o=yk(i),a=vk(o),s=er(),l=mk(),{mergeOptions:u,optionsAtMedia:f,optionsMediaQueries:c}=o,{on:p,off:d,emit:m}=l,h=O;let g=!1,y,v=u(gk,qr.globalOptions),w=u(v),A=[],k,C,T;function P(){const{container:te,slides:L}=w;C=(ca(te)?e.querySelector(te):te)||e.children[0];const me=ca(L)?C.querySelectorAll(L):L;T=[].slice.call(me||C.children)}function F(te){const L=hk(e,C,T,r,i,te,l);if(te.loop&&!L.slideLooper.canLoop()){const ne=Object.assign({},te,{loop:!1});return F(ne)}return L}function I(te,L){g||(v=u(v,te),w=f(v),A=L||A,P(),y=F(w),c([v,...A.map(({options:ne})=>ne)]).forEach(ne=>s.add(ne,"change",O)),w.active&&(y.translate.to(y.location.get()),y.animation.init(),y.slidesInView.init(),y.slideFocus.init(K),y.eventHandler.init(K),y.resizeHandler.init(K),y.slidesHandler.init(K),y.options.loop&&y.slideLooper.loop(),C.offsetParent&&T.length&&y.dragHandler.init(K),k=a.init(K,A)))}function O(te,L){const ne=N();j(),I(u({startIndex:ne},te),L),l.emit("reInit")}function j(){y.dragHandler.destroy(),y.eventStore.clear(),y.translate.clear(),y.slideLooper.clear(),y.resizeHandler.destroy(),y.slidesHandler.destroy(),y.slidesInView.destroy(),y.animation.destroy(),a.destroy(),s.clear()}function z(){g||(g=!0,s.clear(),j(),l.emit("destroy"),l.clear())}function M(te,L,ne){!w.active||g||(y.scrollBody.useBaseFriction().useDuration(L===!0?0:w.duration),y.scrollTo.index(te,ne||0))}function D(te){const L=y.index.add(1).get();M(L,te,-1)}function B(te){const L=y.index.add(-1).get();M(L,te,1)}function U(){return y.index.add(1).get()!==N()}function $(){return y.index.add(-1).get()!==N()}function V(){return y.scrollSnapList}function b(){return y.scrollProgress.get(y.offsetLocation.get())}function N(){return y.index.get()}function H(){return y.indexPrevious.get()}function x(){return y.slidesInView.get()}function W(){return y.slidesInView.get(!1)}function ee(){return k}function Y(){return y}function J(){return e}function X(){return C}function ie(){return T}const K={canScrollNext:U,canScrollPrev:$,containerNode:X,internalEngine:Y,destroy:z,off:d,on:p,emit:m,plugins:ee,previousScrollSnap:H,reInit:h,rootNode:J,scrollNext:D,scrollPrev:B,scrollProgress:b,scrollSnapList:V,scrollTo:M,selectedScrollSnap:N,slideNodes:ie,slidesInView:x,slidesNotInView:W};return I(t,n),setTimeout(()=>l.emit("init"),0),K}qr.globalOptions=void 0;function ha(e={},t=[]){const n=_.useRef(e),r=_.useRef(t),[i,o]=_.useState(),[a,s]=_.useState(),l=_.useCallback(()=>{i&&i.reInit(n.current,r.current)},[i]);return _.useEffect(()=>{la(n.current,e)||(n.current=e,l())},[e,l]),_.useEffect(()=>{j1(r.current,t)||(r.current=t,l())},[t,l]),_.useEffect(()=>{if($1()&&a){qr.globalOptions=ha.globalOptions;const u=qr(a,n.current,r.current);return o(u),()=>u.destroy()}else o(void 0)},[a,o]),[s,i]}ha.globalOptions=void 0;const Cf=_.forwardRef(({blocks:e,direction:t,sender:n,timestamp:r,messageId:i,isReadOnly:o,sendMessage:a},s)=>{const[l,u]=ha({skipSnaps:!0,loop:!0}),[f,c]=_.useState(!0),[p,d]=_.useState(!0),m=_.useCallback(()=>u==null?void 0:u.scrollPrev(),[u]),h=_.useCallback(()=>u==null?void 0:u.scrollNext(),[u]),{message:{blocks:{carousel:g}}}=ge,y=_.useCallback(v=>{c(!(v!=null&&v.canScrollPrev())),d(!(v!=null&&v.canScrollNext()))},[]);return _.useEffect(()=>{u&&(y(u),u.on("reInit",y),u.on("select",y))},[u,y]),S.jsxs("div",{...g==null?void 0:g.container,"data-container":"carousel",ref:l,children:[S.jsx("div",{ref:s,...g==null?void 0:g.slidesContainer,children:e.map((v,w)=>S.jsx(Yt,{block:{...v,direction:t,timestamp:r,sender:n,messageId:i,sendMessage:a,isReadOnly:o}},w))}),e.length>1&&S.jsxs(S.Fragment,{children:[S.jsx(N0,{...g==null?void 0:g.backButton,"data-disabled":f?"":void 0,onClick:m}),S.jsx(L0,{...g==null?void 0:g.nextButton,"data-disabled":p?"":void 0,onClick:h})]})]})});Cf.displayName="Carousel";const Af=Math.floor;function If(e){return Tf(e)?(e.nodeName||"").toLowerCase():"#document"}function nr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function bk(e){var t;return(t=(Tf(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Tf(e){return e instanceof Node||e instanceof nr(e).Node}function at(e){return e instanceof Element||e instanceof nr(e).Element}function cn(e){return e instanceof HTMLElement||e instanceof nr(e).HTMLElement}function ma(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof nr(e).ShadowRoot}function wk(e){return["html","body","#document"].includes(If(e))}function xk(e){return nr(e).getComputedStyle(e)}function kk(e){if(If(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ma(e)&&e.host||bk(e);return ma(t)?t.host:t}function Pt(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 Ze(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&ma(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Of(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Sk(){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 Df(e){if(e.mozInputSource===0&&e.isTrusted)return!0;const t=/Android/i;return(t.test(Of())||t.test(Sk()))&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Mf(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 _f(){return/apple/i.test(navigator.vendor)}function Ek(){return Of().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Pf(e,t){return["mouse","pen"].includes(e)}function Ck(e){return"nativeEvent"in e}function Ak(e){return e.matches("html,body")}function ft(e){return(e==null?void 0:e.ownerDocument)||document}function ga(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 Nf(e){return"composedPath"in e?e.composedPath()[0]:e.target}const Ik="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Lf(e){return cn(e)&&e.matches(Ik)}function je(e){e.preventDefault(),e.stopPropagation()}const fn=Math.min,nt=Math.max,Kr=Math.round,Yr=Math.floor,bt=e=>({x:e,y:e});function Ff(e,t,n){return nt(e,fn(t,n))}function Gr(e,t){return typeof e=="function"?e(t):e}function rr(e){return e.split("-")[0]}function ya(e){return e.split("-")[1]}function Rf(e){return e==="x"?"y":"x"}function Tk(e){return e==="y"?"height":"width"}const Ok=new Set(["top","bottom"]);function ir(e){return Ok.has(rr(e))?"y":"x"}function Dk(e){return Rf(ir(e))}function Mk(e){return{top:0,right:0,bottom:0,left:0,...e}}function _k(e){return typeof e!="number"?Mk(e):{top:e,right:e,bottom:e,left:e}}function Qr(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 Bf(e,t,n){let{reference:r,floating:i}=e;const o=ir(t),a=Dk(t),s=Tk(a),l=rr(t),u=o==="y",f=r.x+r.width/2-i.width/2,c=r.y+r.height/2-i.height/2,p=r[s]/2-i[s]/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(ya(t)){case"start":d[a]-=p*(n&&u?-1:1);break;case"end":d[a]+=p*(n&&u?-1:1);break}return d}const Pk=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=o.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:f,y:c}=Bf(u,r,l),p=r,d={},m=0;for(let h=0;h<s.length;h++){const{name:g,fn:y}=s[h],{x:v,y:w,data:A,reset:k}=await y({x:f,y:c,initialPlacement:r,placement:p,strategy:i,middlewareData:d,rects:u,platform:a,elements:{reference:e,floating:t}});f=v??f,c=w??c,d={...d,[g]:{...d[g],...A}},k&&m<=50&&(m++,typeof k=="object"&&(k.placement&&(p=k.placement),k.rects&&(u=k.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):k.rects),{x:f,y:c}=Bf(u,p,l)),h=-1)}return{x:f,y:c,placement:p,strategy:i,middlewareData:d}};async function zf(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:s,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:c="floating",altBoundary:p=!1,padding:d=0}=Gr(t,e),m=_k(d),g=s[p?c==="floating"?"reference":"floating":c],y=Qr(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(s.floating)),boundary:u,rootBoundary:f,strategy:l})),v=c==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,w=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.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=Qr(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:w,strategy:l}):v);return{top:(y.top-k.top+m.top)/A.y,bottom:(k.bottom-y.bottom+m.bottom)/A.y,left:(y.left-k.left+m.left)/A.x,right:(k.right-y.right+m.right)/A.x}}const Nk=new Set(["left","top"]);async function Lk(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=rr(n),s=ya(n),l=ir(n)==="y",u=Nk.has(a)?-1:1,f=o&&l?-1:1,c=Gr(t,e);let{mainAxis:p,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 s&&typeof m=="number"&&(d=s==="end"?m*-1:m),l?{x:d*f,y:p*u}:{x:p*u,y:d*f}}const Fk=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:a,middlewareData:s}=t,l=await Lk(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:a}}}}},Rk=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:a=!1,limiter:s={fn:g=>{let{x:y,y:v}=g;return{x:y,y:v}}},...l}=Gr(e,t),u={x:n,y:r},f=await zf(t,l),c=ir(rr(i)),p=Rf(c);let d=u[p],m=u[c];if(o){const g=p==="y"?"top":"left",y=p==="y"?"bottom":"right",v=d+f[g],w=d-f[y];d=Ff(v,d,w)}if(a){const g=c==="y"?"top":"left",y=c==="y"?"bottom":"right",v=m+f[g],w=m-f[y];m=Ff(v,m,w)}const h=s.fn({...t,[p]:d,[c]:m});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[p]:o,[c]:a}}}}}},Bk=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:a,elements:s}=t,{apply:l=()=>{},...u}=Gr(e,t),f=await zf(t,u),c=rr(i),p=ya(i),d=ir(i)==="y",{width:m,height:h}=o.floating;let g,y;c==="top"||c==="bottom"?(g=c,y=p===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(y=c,g=p==="end"?"top":"bottom");const v=h-f.top-f.bottom,w=m-f.left-f.right,A=fn(h-f[g],v),k=fn(m-f[y],w),C=!t.middlewareData.shift;let T=A,P=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=v),C&&!p){const I=nt(f.left,0),O=nt(f.right,0),j=nt(f.top,0),z=nt(f.bottom,0);d?P=m-2*(I!==0||O!==0?I+O:nt(f.left,f.right)):T=h-2*(j!==0||z!==0?j+z:nt(f.top,f.bottom))}await l({...t,availableWidth:P,availableHeight:T});const F=await a.getDimensions(s.floating);return m!==F.width||h!==F.height?{reset:{rects:!0}}:{}}}};function Jr(){return typeof window<"u"}function dn(e){return $f(e)?(e.nodeName||"").toLowerCase():"#document"}function rt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function wt(e){var t;return(t=($f(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function $f(e){return Jr()?e instanceof Node||e instanceof rt(e).Node:!1}function dt(e){return Jr()?e instanceof Element||e instanceof rt(e).Element:!1}function xt(e){return Jr()?e instanceof HTMLElement||e instanceof rt(e).HTMLElement:!1}function jf(e){return!Jr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof rt(e).ShadowRoot}const zk=new Set(["inline","contents"]);function or(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=pt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!zk.has(i)}const $k=new Set(["table","td","th"]);function jk(e){return $k.has(dn(e))}const Uk=[":popover-open",":modal"];function Zr(e){return Uk.some(t=>{try{return e.matches(t)}catch{return!1}})}const Hk=["transform","translate","scale","rotate","perspective"],Wk=["transform","translate","scale","rotate","perspective","filter"],Vk=["paint","layout","strict","content"];function va(e){const t=ba(),n=dt(e)?pt(e):e;return Hk.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)||Wk.some(r=>(n.willChange||"").includes(r))||Vk.some(r=>(n.contain||"").includes(r))}function qk(e){let t=Nt(e);for(;xt(t)&&!pn(t);){if(va(t))return t;if(Zr(t))return null;t=Nt(t)}return null}function ba(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Kk=new Set(["html","body","#document"]);function pn(e){return Kk.has(dn(e))}function pt(e){return rt(e).getComputedStyle(e)}function Xr(e){return dt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Nt(e){if(dn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||jf(e)&&e.host||wt(e);return jf(t)?t.host:t}function Uf(e){const t=Nt(e);return pn(t)?e.ownerDocument?e.ownerDocument.body:e.body:xt(t)&&or(t)?t:Uf(t)}function Lt(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Uf(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=rt(i);if(o){const s=wa(a);return t.concat(a,a.visualViewport||[],or(i)?i:[],s&&n?Lt(s):[])}return t.concat(i,Lt(i,[],n))}function wa(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Hf(e){const t=pt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=xt(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,s=Kr(n)!==o||Kr(r)!==a;return s&&(n=o,r=a),{width:n,height:r,$:s}}function xa(e){return dt(e)?e:e.contextElement}function hn(e){const t=xa(e);if(!xt(t))return bt(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=Hf(t);let a=(o?Kr(n.width):n.width)/r,s=(o?Kr(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const Yk=bt(0);function Wf(e){const t=rt(e);return!ba()||!t.visualViewport?Yk:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Gk(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==rt(e)?!1:t}function Kt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=xa(e);let a=bt(1);t&&(r?dt(r)&&(a=hn(r)):a=hn(e));const s=Gk(o,n,r)?Wf(o):bt(0);let l=(i.left+s.x)/a.x,u=(i.top+s.y)/a.y,f=i.width/a.x,c=i.height/a.y;if(o){const p=rt(o),d=r&&dt(r)?rt(r):r;let m=p,h=wa(m);for(;h&&r&&d!==m;){const g=hn(h),y=h.getBoundingClientRect(),v=pt(h),w=y.left+(h.clientLeft+parseFloat(v.paddingLeft))*g.x,A=y.top+(h.clientTop+parseFloat(v.paddingTop))*g.y;l*=g.x,u*=g.y,f*=g.x,c*=g.y,l+=w,u+=A,m=rt(h),h=wa(m)}}return Qr({width:f,height:c,x:l,y:u})}function ei(e,t){const n=Xr(e).scrollLeft;return t?t.left+n:Kt(wt(e)).left+n}function Vf(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-ei(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function Qk(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",a=wt(r),s=t?Zr(t.floating):!1;if(r===a||s&&o)return n;let l={scrollLeft:0,scrollTop:0},u=bt(1);const f=bt(0),c=xt(r);if((c||!c&&!o)&&((dn(r)!=="body"||or(a))&&(l=Xr(r)),xt(r))){const d=Kt(r);u=hn(r),f.x=d.x+r.clientLeft,f.y=d.y+r.clientTop}const p=a&&!c&&!o?Vf(a,l):bt(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+f.x+p.x,y:n.y*u.y-l.scrollTop*u.y+f.y+p.y}}function Jk(e){return Array.from(e.getClientRects())}function Zk(e){const t=wt(e),n=Xr(e),r=e.ownerDocument.body,i=nt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=nt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+ei(e);const s=-n.scrollTop;return pt(r).direction==="rtl"&&(a+=nt(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:s}}const qf=25;function Xk(e,t){const n=rt(e),r=wt(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;const f=ba();(!f||f&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}const u=ei(r);if(u<=0){const f=r.ownerDocument,c=f.body,p=getComputedStyle(c),d=f.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,m=Math.abs(r.clientWidth-c.clientWidth-d);m<=qf&&(o-=m)}else u<=qf&&(o+=u);return{width:o,height:a,x:s,y:l}}const eS=new Set(["absolute","fixed"]);function tS(e,t){const n=Kt(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=xt(e)?hn(e):bt(1),a=e.clientWidth*o.x,s=e.clientHeight*o.y,l=i*o.x,u=r*o.y;return{width:a,height:s,x:l,y:u}}function Kf(e,t,n){let r;if(t==="viewport")r=Xk(e,n);else if(t==="document")r=Zk(wt(e));else if(dt(t))r=tS(t,n);else{const i=Wf(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Qr(r)}function Yf(e,t){const n=Nt(e);return n===t||!dt(n)||pn(n)?!1:pt(n).position==="fixed"||Yf(n,t)}function nS(e,t){const n=t.get(e);if(n)return n;let r=Lt(e,[],!1).filter(s=>dt(s)&&dn(s)!=="body"),i=null;const o=pt(e).position==="fixed";let a=o?Nt(e):e;for(;dt(a)&&!pn(a);){const s=pt(a),l=va(a);!l&&s.position==="fixed"&&(i=null),(o?!l&&!i:!l&&s.position==="static"&&!!i&&eS.has(i.position)||or(a)&&!l&&Yf(e,a))?r=r.filter(f=>f!==a):i=s,a=Nt(a)}return t.set(e,r),r}function rS(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?Zr(t)?[]:nS(t,this._c):[].concat(n),r],s=a[0],l=a.reduce((u,f)=>{const c=Kf(t,f,i);return u.top=nt(c.top,u.top),u.right=fn(c.right,u.right),u.bottom=fn(c.bottom,u.bottom),u.left=nt(c.left,u.left),u},Kf(t,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function iS(e){const{width:t,height:n}=Hf(e);return{width:t,height:n}}function oS(e,t,n){const r=xt(t),i=wt(t),o=n==="fixed",a=Kt(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const l=bt(0);function u(){l.x=ei(i)}if(r||!r&&!o)if((dn(t)!=="body"||or(i))&&(s=Xr(t)),r){const d=Kt(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?Vf(i,s):bt(0),c=a.left+s.scrollLeft-l.x-f.x,p=a.top+s.scrollTop-l.y-f.y;return{x:c,y:p,width:a.width,height:a.height}}function ka(e){return pt(e).position==="static"}function Gf(e,t){if(!xt(e)||pt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return wt(e)===n&&(n=n.ownerDocument.body),n}function Qf(e,t){const n=rt(e);if(Zr(e))return n;if(!xt(e)){let i=Nt(e);for(;i&&!pn(i);){if(dt(i)&&!ka(i))return i;i=Nt(i)}return n}let r=Gf(e,t);for(;r&&jk(r)&&ka(r);)r=Gf(r,t);return r&&pn(r)&&ka(r)&&!va(r)?n:r||qk(e)||n}const aS=async function(e){const t=this.getOffsetParent||Qf,n=this.getDimensions,r=await n(e.floating);return{reference:oS(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function sS(e){return pt(e).direction==="rtl"}const lS={convertOffsetParentRelativeRectToViewportRelativeRect:Qk,getDocumentElement:wt,getClippingRect:rS,getOffsetParent:Qf,getElementRects:aS,getClientRects:Jk,getDimensions:iS,getScale:hn,isElement:dt,isRTL:sS};function Jf(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function uS(e,t){let n=null,r;const i=wt(e);function o(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),o();const u=e.getBoundingClientRect(),{left:f,top:c,width:p,height:d}=u;if(s||t(),!p||!d)return;const m=Yr(c),h=Yr(i.clientWidth-(f+p)),g=Yr(i.clientHeight-(c+d)),y=Yr(f),w={rootMargin:-m+"px "+-h+"px "+-g+"px "+-y+"px",threshold:nt(0,fn(1,l))||1};let A=!0;function k(C){const T=C[0].intersectionRatio;if(T!==l){if(!A)return a();T?a(!1,T):r=setTimeout(()=>{a(!1,1e-7)},1e3)}T===1&&!Jf(u,e.getBoundingClientRect())&&a(),A=!1}try{n=new IntersectionObserver(k,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(k,w)}n.observe(e)}return a(!0),o}function cS(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=xa(e),f=i||o?[...u?Lt(u):[],...Lt(t)]:[];f.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),o&&y.addEventListener("resize",n)});const c=u&&s?uS(u,n):null;let p=-1,d=null;a&&(d=new ResizeObserver(y=>{let[v]=y;v&&v.target===u&&d&&(d.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var w;(w=d)==null||w.observe(t)})),n()}),u&&!l&&d.observe(u),d.observe(t));let m,h=l?Kt(e):null;l&&g();function g(){const y=Kt(e);h&&!Jf(h,y)&&n(),h=y,m=requestAnimationFrame(g)}return n(),()=>{var y;f.forEach(v=>{i&&v.removeEventListener("scroll",n),o&&v.removeEventListener("resize",n)}),c==null||c(),(y=d)==null||y.disconnect(),d=null,l&&cancelAnimationFrame(m)}}const fS=Fk,dS=Rk,pS=Bk,hS=(e,t,n)=>{const r=new Map,i={platform:lS,...n},o={...i.platform,_c:r};return Pk(e,t,{...i,platform:o})};var mS=typeof document<"u",gS=function(){},ti=mS?_.useLayoutEffect:gS;function ni(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(!ni(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)&&!ni(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Zf(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Xf(e,t){const n=Zf(e);return Math.round(t*n)/n}function Sa(e){const t=E.useRef(e);return ti(()=>{t.current=e}),t}function yS(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:a}={},transform:s=!0,whileElementsMounted:l,open:u}=e,[f,c]=E.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,d]=E.useState(r);ni(p,r)||d(r);const[m,h]=E.useState(null),[g,y]=E.useState(null),v=E.useCallback($=>{$!==C.current&&(C.current=$,h($))},[]),w=E.useCallback($=>{$!==T.current&&(T.current=$,y($))},[]),A=o||m,k=a||g,C=E.useRef(null),T=E.useRef(null),P=E.useRef(f),F=l!=null,I=Sa(l),O=Sa(i),j=Sa(u),z=E.useCallback(()=>{if(!C.current||!T.current)return;const $={placement:t,strategy:n,middleware:p};O.current&&($.platform=O.current),hS(C.current,T.current,$).then(V=>{const b={...V,isPositioned:j.current!==!1};M.current&&!ni(P.current,b)&&(P.current=b,Ls.flushSync(()=>{c(b)}))})},[p,t,n,O,j]);ti(()=>{u===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,c($=>({...$,isPositioned:!1})))},[u]);const M=E.useRef(!1);ti(()=>(M.current=!0,()=>{M.current=!1}),[]),ti(()=>{if(A&&(C.current=A),k&&(T.current=k),A&&k){if(I.current)return I.current(A,k,z);z()}},[A,k,z,I,F]);const D=E.useMemo(()=>({reference:C,floating:T,setReference:v,setFloating:w}),[v,w]),B=E.useMemo(()=>({reference:A,floating:k}),[A,k]),U=E.useMemo(()=>{const $={position:n,left:0,top:0};if(!B.floating)return $;const V=Xf(B.floating,f.x),b=Xf(B.floating,f.y);return s?{...$,transform:"translate("+V+"px, "+b+"px)",...Zf(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:b}},[n,s,B.floating,f.x,f.y]);return E.useMemo(()=>({...f,update:z,refs:D,elements:B,floatingStyles:U}),[f,z,D,B,U])}const vS=(e,t)=>({...fS(e),options:[e,t]}),bS=(e,t)=>({...dS(e),options:[e,t]}),wS=(e,t)=>({...pS(e),options:[e,t]});/*!
275
+ `);const v=y.state[s];if(v==null)return;JSON.stringify(i.getState())!==JSON.stringify(v)&&d(v);return}i.dispatchFromDevtools&&typeof i.dispatch=="function"&&i.dispatch(y)});case"DISPATCH":switch(h.payload.type){case"RESET":return d(m),s===void 0?f==null?void 0:f.init(i.getState()):f==null?void 0:f.init(zr(l.name));case"COMMIT":if(s===void 0){f==null||f.init(i.getState());return}return f==null?void 0:f.init(zr(l.name));case"ROLLBACK":return Go(h.state,y=>{if(s===void 0){d(y),f==null||f.init(i.getState());return}d(y[s]),f==null||f.init(zr(l.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return Go(h.state,y=>{if(s===void 0){d(y);return}JSON.stringify(i.getState())!==JSON.stringify(y[s])&&d(y[s])});case"IMPORT_STATE":{const{nextLiftedState:y}=h.payload,v=(g=y.computedStates.slice(-1)[0])==null?void 0:g.state;if(!v)return;d(s===void 0?v:v[s]),f==null||f.send(null,y);return}case"PAUSE_RECORDING":return p=!p}return}}),m},Go=(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 Qo(e,t){let n;try{n=e()}catch{return}return{getItem:i=>{var o;const a=l=>l===null?null:JSON.parse(l,void 0),s=(o=n.getItem(i))!=null?o:null;return s instanceof Promise?s.then(a):a(s)},setItem:(i,o)=>n.setItem(i,JSON.stringify(o,void 0)),removeItem:i=>n.removeItem(i)}}const Hn=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Hn(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Hn(r)(n)}}}},h1=(e,t)=>(n,r,i)=>{let o={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:g=>g,version:0,merge:(g,y)=>({...y,...g}),...t},a=!1;const s=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=Hn(o.serialize),c=()=>{const g=o.partialize({...r()});let y;const v=f({state:g,version:o.version}).then(w=>u.setItem(o.name,w)).catch(w=>{y=w});if(y)throw y;return v},p=i.setState;i.setState=(g,y)=>{p(g,y),c()};const d=e((...g)=>{n(...g),c()},r,i);let m;const h=()=>{var g;if(!u)return;a=!1,s.forEach(v=>v(r()));const y=((g=o.onRehydrateStorage)==null?void 0:g.call(o,r()))||void 0;return Hn(u.getItem.bind(u))(o.name).then(v=>{if(v)return o.deserialize(v)}).then(v=>{if(v)if(typeof v.version=="number"&&v.version!==o.version){if(o.migrate)return o.migrate(v.state,v.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return v.state}).then(v=>{var w;return m=o.merge(v,(w=r())!=null?w:d),n(m,!0),c()}).then(()=>{y==null||y(m,void 0),a=!0,l.forEach(v=>v(m))}).catch(v=>{y==null||y(void 0,v)})};return i.persist={setOptions:g=>{o={...o,...g},g.getStorage&&(u=g.getStorage())},clearStorage:()=>{u==null||u.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>h(),hasHydrated:()=>a,onHydrate:g=>(s.add(g),()=>{s.delete(g)}),onFinishHydration:g=>(l.add(g),()=>{l.delete(g)})},h(),m||d},m1=(e,t)=>(n,r,i)=>{let o={storage:Qo(()=>localStorage),partialize:h=>h,version:0,merge:(h,g)=>({...g,...h}),...t},a=!1;const s=new Set,l=new Set;let u=o.storage;if(!u)return e((...h)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...h)},r,i);const f=()=>{const h=o.partialize({...r()});return u.setItem(o.name,{state:h,version:o.version})},c=i.setState;i.setState=(h,g)=>{c(h,g),f()};const p=e((...h)=>{n(...h),f()},r,i);let d;const m=()=>{var h,g;if(!u)return;a=!1,s.forEach(v=>{var w;return v((w=r())!=null?w:p)});const y=((g=o.onRehydrateStorage)==null?void 0:g.call(o,(h=r())!=null?h:p))||void 0;return Hn(u.getItem.bind(u))(o.name).then(v=>{if(v)if(typeof v.version=="number"&&v.version!==o.version){if(o.migrate)return o.migrate(v.state,v.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return v.state}).then(v=>{var w;return d=o.merge(v,(w=r())!=null?w:p),n(d,!0),f()}).then(()=>{y==null||y(d,void 0),d=r(),a=!0,l.forEach(v=>v(d))}).catch(v=>{y==null||y(void 0,v)})};return i.persist={setOptions:h=>{o={...o,...h},h.storage&&(u=h.storage)},clearStorage:()=>{u==null||u.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>m(),hasHydrated:()=>a,onHydrate:h=>(s.add(h),()=>{s.delete(h)}),onFinishHydration:h=>(l.add(h),()=>{l.delete(h)})},o.skipHydration||m(),d||p},$r=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?((Br?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),h1(e,t)):m1(e,t),Uc=_t()(Un($r(e=>({messageHistory:[],addMessageToHistory:t=>e(n=>({...n,messageHistory:[t,...(n.messageHistory??[]).slice(0,100).filter(String)]}))}),{name:"botpress-message-history"})));let jr;const g1=new Uint8Array(16);function y1(){if(!jr&&(jr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!jr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return jr(g1)}const je=[];for(let e=0;e<256;++e)je.push((e+256).toString(16).slice(1));function v1(e,t=0){return je[e[t+0]]+je[e[t+1]]+je[e[t+2]]+je[e[t+3]]+"-"+je[e[t+4]]+je[e[t+5]]+"-"+je[e[t+6]]+je[e[t+7]]+"-"+je[e[t+8]]+je[e[t+9]]+"-"+je[e[t+10]]+je[e[t+11]]+je[e[t+12]]+je[e[t+13]]+je[e[t+14]]+je[e[t+15]]}const Hc={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function b1(e,t,n){if(Hc.randomUUID&&!e)return Hc.randomUUID();e=e||{};const r=e.random||(e.rng||y1)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,v1(r)}function Wn(e){var a;const{metadata:t,conversationId:n,userId:r}=e,{payload:i,disableInput:o}=Wc(e.payload);return{id:e.id,conversationId:n,authorId:r,timestamp:new Date(e.createdAt),block:i,feedback:(a=e.feedback)==null?void 0:a.value,disableInput:o,metadata:t}}const Wc=e=>{switch(e.type){case"audio":return Vc(e);case"card":return w1(e);case"carousel":return x1(e);case"choice":return k1(e);case"dropdown":return S1(e);case"file":return qc(e);case"image":return Kc(e);case"location":return Yc(e);case"markdown":return Gc(e);case"text":return Qc(e);case"video":return Jc(e);case"bloc":return E1(e);case"custom":return{payload:e};default:{const t=e;throw new Error(`Unsuported message type ${t}`)}}},Vn=e=>({block:e,type:"bubble"}),Vc=e=>({payload:{type:"audio",url:e.audioUrl}}),w1=e=>({payload:Vn(Zc(e))}),x1=e=>({payload:{type:"carousel",blocks:e.items.map(t=>Zc({...t}))}}),k1=e=>{const t=e.options.map(o=>({title:o.label,value:o.value})),n=e.text,r=b1(),i=Vn({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:a})=>({type:"button",variant:"action",text:o,buttonValue:a,groupId:r}))}]}}},S1=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:Vn({type:"column",blocks:r})}},qc=e=>({payload:{type:"file",url:e.fileUrl,title:e.title}}),Kc=e=>({payload:{type:"image",url:e.imageUrl}}),Yc=e=>({payload:{type:"location",latitude:e.latitude,longitude:e.longitude,title:e.title??e.address??"View on map"}}),Gc=e=>({payload:Vn({type:"text",text:e.markdown})}),Qc=e=>({payload:Vn({type:"text",text:e.text,value:e.value})}),Jc=e=>({payload:{type:"video",url:e.videoUrl}}),E1=e=>({payload:{type:"column",blocks:e.items.map(n=>{switch(n.type){case"audio":return Vc({...n.payload,type:n.type}).payload;case"file":return qc({...n.payload,type:n.type}).payload;case"image":return Kc({...n.payload,type:n.type}).payload;case"location":return Yc({...n.payload,type:n.type}).payload;case"markdown":return Gc({...n.payload,type:n.type}).payload;case"text":return Qc({...n.payload,type:n.type}).payload;case"video":return Jc({...n.payload,type:n.type}).payload;default:throw new Error("Unsuported message type")}})}}),Zc=e=>{const t=e.title,n=e.subtitle,r=e.imageUrl,i=e.actions.map(a=>{switch(a.action){case"postback":return{type:"button",variant:"action",text:a.label,buttonValue:a.value,reusable:!0};case"url":return{type:"button",variant:"link",text:a.label,buttonValue:a.value,reusable:!0};case"say":return{type:"button",variant:"action",text:a.label,buttonValue:a.value,reusable:!0};default:throw new Error(`Unknown action type ${a.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]}},an=_t()(Un(e=>({messages:[],isFetching:!1,setMessages:t=>e({messages:t}),saveMessage:t=>e(({messages:n})=>{var i;const r=(i=t.metadata)==null?void 0:i.clientMessageId;if(r){const o=n.findIndex(s=>{var l;return((l=s.metadata)==null?void 0:l.clientMessageId)===r}),a=n[o];if(o!==-1)return{messages:[...n.slice(0,o),{...a,...t},...n.slice(o+1)]}}return{messages:[...n.filter(o=>o.id!==t.id),t]}}),updateMessage:(t,n)=>e(({messages:r})=>({messages:r.map(i=>i.id===t?{...i,...n}:i)})),clearMessages:()=>e({messages:[]}),fetchMessages:async({client:t,conversationId:n})=>{const r=[];e({isFetching:!0});try{let i;do{const{messages:o,meta:a}=await t.listConversationMessages({conversationId:n,nextToken:i});r.push(...o),i=a.nextToken}while(i);return r.reverse().map(o=>Wn(o)).filter(Boolean)}finally{e({isFetching:!1})}}}),{name:"messagesStore"})),C1=(e,t)=>_t()(Un($r(n=>({setUser:r=>n(i=>({...i,user:r})),setConversationId:r=>n(i=>({...i,conversationId:r})),clearConversationId:()=>n(r=>({...r,conversationId:void 0})),clearAll:()=>{n(r=>({...r,user:void 0,conversationId:void 0}))}}),{name:e,storage:Qo(()=>t==="sessionStorage"?sessionStorage:localStorage)}))),Jo={},Xc=(e="bp-webchat",t)=>(Jo[e]||(Jo[e]=C1(e,t)),Jo[e]),sn=_t()(Un(e=>({eventEmitter:Gs(),messageContainerRef:N.createRef(),setMessageContainerRef:t=>e({messageContainerRef:t}),portalContainer:null,setPortalContainer:t=>e({portalContainer:t})}),{name:"webchatStore"})),A1=8,I1=e=>_t()($r((t,n)=>({files:[],setFiles:r=>t({files:r}),upsertFile:r=>t(({files:i})=>({files:i.some(s=>s.name===r.name)?i.map(s=>s.name===r.name?{...s,...r}:s):[...i,{...r}]})),uploadFile:async(r,i)=>{if(n().files.length===A1)return;const o=r.name.lastIndexOf("."),a=o>0&&o<r.name.length-1,s=a?r.name.substring(0,o):r.name,l=a?r.name.substring(o):"",u=Nm(s,n().files,p=>p.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:p,type:d,fileId:m}=await i(c);n().upsertFile({fileId:m,name:u,type:d,url:p,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:Qo(()=>sessionStorage)})),Zo={},ef=(e="bp-composer-file-store")=>(Zo[e]||(Zo[e]=I1(e)),Zo[e]),qn=_t()(e=>({participants:[],setParticipants:t=>e({participants:t}),addParticipant:t=>e(n=>({participants:[...n.participants,t]})),removeParticipant:t=>e(n=>({participants:n.participants.filter(r=>r.id!==t)})),clearParticipants:()=>e({participants:[]})})),T1=e=>_t()(Un($r((t,n)=>({soundOn:!0,setSoundEnabled:r=>t({soundOn:r}),toggleSound:()=>t({soundOn:!n().soundOn})}),{name:e}))),Xo={},tf=(e="webchat:soundEnabled")=>(Xo[e]||(Xo[e]=T1(e)),Xo[e]),O1=({text:e,buttonValue:t,variant:n,groupId:r,reusable:i,sendMessage:o,isReadOnly:a,...s})=>{const l=sn(w=>w.eventEmitter),[u,f]=N.useState(!1),[c,p]=N.useState(!1),[d,m]=N.useState(!1),{message:{blocks:{button:h}}}=ge;N.useEffect(()=>{if(r)return l.on(`button-group-${r}-click`,()=>{p(!0),i||m(!0)})},[l,r,i]);const y={...s,onClick:w=>{if((d||a)&&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,...h},v=d||a;return n==="link"?S.jsx("a",{...y,style:a?{pointerEvents:"none"}:void 0,href:t,target:"_blank",rel:"noopener noreferrer",children:e}):S.jsx("button",{...y,style:a?{pointerEvents:"none"}:void 0,disabled:v,children:e})},ea=N.createContext(null);function nf(){const e=N.useContext(ea);if(!e)throw new Error("useMessageContext must be used within a Message");return e}const ta=N.createContext({showInputModal:void 0});function na(){return N.useContext(ta)}const rf=N.forwardRef(({block:e,direction:t,sender:n,timestamp:r,messageId:i,feedback:o,metadata:a,isReadOnly:s,sendMessage:l,addMessageFeedback:u,...f},c)=>{const{showInputModal:p}=na(),{message:{blocks:{bubble:{container:d,feedbackContainer:m,feedbackIcon:h}}}}=ge;return t=="incoming"?S.jsxs("div",{"data-direction":"incoming","data-feedback":!!o,...f,...d,ref:c,children:[S.jsx(Yt,{block:{...e,direction:t,timestamp:r,sender:n,messageId:i,isReadOnly:s,metadata:a,sendMessage:l}}),u&&p&&e.type==="text"&&S.jsxs("div",{...m,children:[S.jsx(G0,{...h,"data-selected":o==="positive",onClick:()=>u(i,{value:"positive"})}),S.jsx(Y0,{...h,"data-selected":o==="negative",onClick:async()=>{const g=await p({title:"Help us improve",description:"Please provide feedback to help us improve.",confirmButtonText:"Send feedback",cancelButtonText:"Cancel",Content:D1});u(i,{value:"negative",comment:g})}})]})]}):S.jsx("div",{"data-direction":"outgoing",...f,...d,ref:c,children:S.jsx(Yt,{block:{...e,direction:t,timestamp:r,sender:n,messageId:i,isReadOnly:s,metadata:a,sendMessage:l,addMessageFeedback:u}})})});rf.displayName="Bubble";const D1=({setValue:e})=>{const{modal:{dialog:{content:t}}}=ge;return S.jsx("textarea",{...t.textarea,placeholder:"Let us know what went wrong...",onChange:n=>e(n.target.value)})},of=({className:e,...t})=>S.jsx("div",{"data-slot":"skeleton",className:`bpSkeleton ${e||""}`,...t});of.displayName="Skeleton";var at=function(){return at=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},at.apply(this,arguments)};function af(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 ln(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(f){try{u(r.next(f))}catch(c){a(c)}}function l(f){try{u(r.throw(f))}catch(c){a(c)}}function u(f){f.done?o(f.value):i(f.value).then(s,l)}u((r=r.apply(e,t||[])).next())})}function un(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(f){return l([u,f])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=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 sf(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function ra(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 M1(){var e=N.useRef(!1),t=N.useCallback(function(){return e.current},[]);return N.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),t}function _1(e,t,n){t===void 0&&(t=[]),n===void 0&&(n={loading:!1});var r=N.useRef(0),i=M1(),o=N.useState(n),a=o[0],s=o[1],l=N.useCallback(function(){for(var u=[],f=0;f<arguments.length;f++)u[f]=arguments[f];var c=++r.current;return a.loading||s(function(p){return at(at({},p),{loading:!0})}),e.apply(void 0,u).then(function(p){return i()&&c===r.current&&s({value:p,loading:!1}),p},function(p){return i()&&c===r.current&&s({error:p,loading:!1}),p})},t);return[a,l]}function P1(e,t){t===void 0&&(t=[]);var n=_1(e,t,{loading:!0}),r=n[0],i=n[1];return N.useEffect(function(){i()},[i]),r}const lf=N.forwardRef(({url:e,type:t,orientation:n="auto",...r},i)=>{const o=N.useId(),{setIsLoading:a}=nf(),[s,l]=N.useState(n==="auto"?"square":n),[u,f]=N.useState("initial"),{message:{blocks:{image:c}}}=ge;return N.useLayoutEffect(()=>(a(p=>[...p,o]),()=>{a(p=>p.filter(d=>d!==o))}),[o,a]),P1(async()=>{if(!e)return;const p=new Image;try{const{width:d,height:m}=await am(e);n==="auto"&&l(N1(d,m)),p.onload=()=>{f("loaded"),a(h=>h.filter(g=>g!==o))},p.onerror=()=>{f("error"),l("square"),a(h=>h.filter(g=>g!==o))},p.src=e,p.complete&&(p.naturalWidth>0?(f("loaded"),a(h=>h.filter(g=>g!==o))):(f("error"),l("square"),a(h=>h.filter(g=>g!==o))))}catch(d){console.error(d),f("error"),a(m=>m.filter(h=>h!==o))}return()=>{p.onload=null,p.onerror=null}},[e,o,a,n]),e?u==="error"?S.jsx("div",{"data-error":"true","data-orientation":s,...r,...c.image,ref:i,children:S.jsx(Dc,{size:"25%",strokeWidth:"5%"})}):u==="initial"?S.jsx(of,{"data-orientation":s,...c.placeholder}):S.jsx("img",{"data-orientation":s,"data-loaded":u==="loaded",...r,...c.image,src:e,alt:"",ref:i}):null});lf.displayName="Image";function N1(e,t){const n={square:1,portrait:.75,landscape:1.3333333333333333},r=e/t;return Object.keys(n).reduce((o,a)=>Math.abs(n[a]-r)<Math.abs(n[o]-r)?a:o)}const uf=N.forwardRef(({url:e,isReadOnly:t,...n},r)=>{const{message:{blocks:{video:i}}}=ge;return S.jsx("div",{children:S.jsx("video",{...n,"data-chromatic":"ignore",style:t?{pointerEvents:"none"}:void 0,controls:!0,src:e,...i,ref:r})})});uf.displayName="Video";const cf=N.forwardRef(({url:e,isReadOnly:t,...n},r)=>{const{message:{blocks:{audio:i}}}=ge;return S.jsx("div",{children:S.jsx("audio",{...n,controls:!0,style:t?{pointerEvents:"none"}:void 0,src:e,...i,ref:r})})});cf.displayName="Audio";const ff=N.forwardRef(({latitude:e,longitude:t,title:n,isReadOnly:r,...i},o)=>{const a=`https://www.google.com/maps/search/?api=1&query=${e},${t}`,{message:{blocks:{location:s}}}=ge;return S.jsxs("a",{...i,...s.container,style:r?{pointerEvents:"none"}:void 0,href:a,type:"_blank",rel:"noopener",ref:o,children:[S.jsx("p",{...s.title,children:n}),S.jsx(U0,{...s.icon})]})});ff.displayName="Location";const df=N.forwardRef(({blocks:e,horizontalAlignment:t,verticalAlignment:n,direction:r,sender:i,timestamp:o,messageId:a,isReadOnly:s,sendMessage:l,...u},f)=>{const{message:{blocks:{column:c}}}=ge;return S.jsx("div",{"data-horizontal":t,"data-vertical":n,...u,...c,ref:f,children:e.map((p,d)=>S.jsx(Yt,{block:{...p,direction:r,timestamp:o,sender:i,messageId:a,isReadOnly:s,sendMessage:l}},d))})});df.displayName="Column";const pf=N.forwardRef(({blocks:e,horizontalAlignment:t,verticalAlignment:n,direction:r,sender:i,timestamp:o,metadata:a,messageId:s,isReadOnly:l,sendMessage:u,...f},c)=>{const{message:{blocks:{row:p}}}=ge;return S.jsx("div",{"data-horizontal":t,"data-vertical":n,...f,...p,ref:c,children:e.map((d,m)=>S.jsx(Yt,{block:{...d,direction:r,timestamp:o,sender:i,messageId:s,isReadOnly:l,sendMessage:u}},m))})});pf.displayName="Row";function L1(e){return Object.prototype.toString.call(e)==="[object Object]"}function hf(e){return L1(e)||Array.isArray(e)}function F1(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function ia(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(a=>{const s=e[a],l=t[a];return typeof s=="function"?`${s}`==`${l}`:!hf(s)||!hf(l)?s===l:ia(s,l)})}function mf(e){return e.concat().sort((t,n)=>t.name>n.name?1:-1).map(t=>t.options)}function R1(e,t){if(e.length!==t.length)return!1;const n=mf(e),r=mf(t);return n.every((i,o)=>{const a=r[o];return ia(i,a)})}function oa(e){return typeof e=="number"}function aa(e){return typeof e=="string"}function Ur(e){return typeof e=="boolean"}function gf(e){return Object.prototype.toString.call(e)==="[object Object]"}function Pe(e){return Math.abs(e)}function sa(e){return Math.sign(e)}function Kn(e,t){return Pe(e-t)}function B1(e,t){if(e===0||t===0||Pe(e)<=Pe(t))return 0;const n=Kn(Pe(e),Pe(t));return Pe(n/e)}function z1(e){return Math.round(e*100)/100}function Yn(e){return Qn(e).map(Number)}function ct(e){return e[Gn(e)]}function Gn(e){return Math.max(0,e.length-1)}function la(e,t){return t===Gn(e)}function yf(e,t=0){return Array.from(Array(e),(n,r)=>t+r)}function Qn(e){return Object.keys(e)}function vf(e,t){return[e,t].reduce((n,r)=>(Qn(r).forEach(i=>{const o=n[i],a=r[i],s=gf(o)&&gf(a);n[i]=s?vf(o,a):a}),n),{})}function ua(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function $1(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 a(l,u){return aa(e)?n[e](l):e(t,l,u)}return{measure:a}}function Jn(){let e=[];function t(i,o,a,s={passive:!0}){let l;if("addEventListener"in i)i.addEventListener(o,a,s),l=()=>i.removeEventListener(o,a,s);else{const u=i;u.addListener(a),l=()=>u.removeListener(a)}return e.push(l),r}function n(){e=e.filter(i=>i())}const r={add:t,clear:n};return r}function j1(e,t,n,r){const i=Jn(),o=1e3/60;let a=null,s=0,l=0;function u(){i.add(e,"visibilitychange",()=>{e.hidden&&m()})}function f(){d(),i.clear()}function c(g){if(!l)return;a||(a=g,n(),n());const y=g-a;for(a=g,s+=y;s>=o;)n(),s-=o;const v=s/o;r(v),l&&(l=t.requestAnimationFrame(c))}function p(){l||(l=t.requestAnimationFrame(c))}function d(){t.cancelAnimationFrame(l),a=null,s=0,l=0}function m(){a=null,s=0}return{init:u,destroy:f,start:p,stop:d,update:n,render:r}}function U1(e,t){const n=t==="rtl",r=e==="y",i=r?"y":"x",o=r?"x":"y",a=!r&&n?-1:1,s=f(),l=c();function u(m){const{height:h,width:g}=m;return r?h:g}function f(){return r?"top":n?"right":"left"}function c(){return r?"bottom":n?"left":"right"}function p(m){return m*a}return{scroll:i,cross:o,startEdge:s,endEdge:l,measureSize:u,direction:p}}function qt(e=0,t=0){const n=Pe(e-t);function r(u){return u<e}function i(u){return u>t}function o(u){return r(u)||i(u)}function a(u){return o(u)?r(u)?e:t:u}function s(u){return n?u-n*Math.ceil((u-t)/n):u}return{length:n,max:t,min:e,constrain:a,reachedAny:o,reachedMax:i,reachedMin:r,removeOffset:s}}function bf(e,t,n){const{constrain:r}=qt(0,e),i=e+1;let o=a(t);function a(p){return n?Pe((i+p)%i):r(p)}function s(){return o}function l(p){return o=a(p),c}function u(p){return f().set(s()+p)}function f(){return bf(e,s(),n)}const c={get:s,set:l,add:u,clone:f};return c}function H1(e,t,n,r,i,o,a,s,l,u,f,c,p,d,m,h,g,y,v){const{cross:w,direction:A}=e,k=["INPUT","SELECT","TEXTAREA"],C={passive:!1},T=Jn(),_=Jn(),F=qt(50,225).constrain(d.measure(20)),I={mouse:300,touch:400},O={mouse:500,touch:600},j=m?43:25;let z=!1,M=0,D=0,B=!1,U=!1,$=!1,W=!1;function b(L){if(!v)return;function ne(ke){(Ur(v)||v(L,ke))&&Y(ke)}const me=t;T.add(me,"dragstart",ke=>ke.preventDefault(),C).add(me,"touchmove",()=>{},C).add(me,"touchend",()=>{}).add(me,"touchstart",ne).add(me,"mousedown",ne).add(me,"touchcancel",X).add(me,"contextmenu",X).add(me,"click",re,!0)}function P(){T.clear(),_.clear()}function H(){const L=W?n:t;_.add(L,"touchmove",J,C).add(L,"touchend",X).add(L,"mousemove",J,C).add(L,"mouseup",X)}function x(L){const ne=L.nodeName||"";return k.includes(ne)}function V(){return(m?O:I)[W?"mouse":"touch"]}function ee(L,ne){const me=c.add(sa(L)*-1),ke=f.byDistance(L,!m).distance;return m||Pe(L)<F?ke:g&&ne?ke*.5:f.byIndex(me.get(),0).distance}function Y(L){const ne=ua(L,r);W=ne,$=m&&ne&&!L.buttons&&z,z=Kn(i.get(),a.get())>=2,!(ne&&L.button!==0)&&(x(L.target)||(B=!0,o.pointerDown(L),u.useFriction(0).useDuration(0),i.set(a),H(),M=o.readPoint(L),D=o.readPoint(L,w),p.emit("pointerDown")))}function J(L){if(!ua(L,r)&&L.touches.length>=2)return X(L);const me=o.readPoint(L),ke=o.readPoint(L,w),oe=Kn(me,M),G=Kn(ke,D);if(!U&&!W&&(!L.cancelable||(U=oe>G,!U)))return X(L);const ue=o.pointerMove(L);oe>h&&($=!0),u.useFriction(.3).useDuration(.75),s.start(),i.add(A(ue)),L.preventDefault()}function X(L){const me=f.byDistance(0,!1).index!==c.get(),ke=o.pointerUp(L)*V(),oe=ee(A(ke),me),G=B1(ke,oe),ue=j-10*G,de=y+G/50;U=!1,B=!1,_.clear(),u.useDuration(ue).useFriction(de),l.distance(oe,!m),W=!1,p.emit("pointerUp")}function re(L){$&&(L.stopPropagation(),L.preventDefault(),$=!1)}function K(){return B}return{init:b,destroy:P,pointerDown:K}}function W1(e,t){let r,i;function o(c){return c.timeStamp}function a(c,p){const m=`client${(p||e.scroll)==="x"?"X":"Y"}`;return(ua(c,t)?c:c.touches[0])[m]}function s(c){return r=c,i=c,a(c)}function l(c){const p=a(c)-a(i),d=o(c)-o(r)>170;return i=c,d&&(r=c),p}function u(c){if(!r||!i)return 0;const p=a(i)-a(r),d=o(c)-o(r),m=o(c)-o(i)>170,h=p/d;return d&&!m&&Pe(h)>.1?h:0}return{pointerDown:s,pointerMove:l,pointerUp:u,readPoint:a}}function V1(){function e(n){const{offsetTop:r,offsetLeft:i,offsetWidth:o,offsetHeight:a}=n;return{top:r,right:i+o,bottom:r+a,left:i,width:o,height:a}}return{measure:e}}function q1(e){function t(r){return e*(r/100)}return{measure:t}}function K1(e,t,n,r,i,o,a){const s=[e].concat(r);let l,u,f=[],c=!1;function p(g){return i.measureSize(a.measure(g))}function d(g){if(!o)return;u=p(e),f=r.map(p);function y(v){for(const w of v){if(c)return;const A=w.target===e,k=r.indexOf(w.target),C=A?u:f[k],T=p(A?e:r[k]);if(Pe(T-C)>=.5){g.reInit(),t.emit("resize");break}}}l=new ResizeObserver(v=>{(Ur(o)||o(g,v))&&y(v)}),n.requestAnimationFrame(()=>{s.forEach(v=>l.observe(v))})}function m(){c=!0,l&&l.disconnect()}return{init:d,destroy:m}}function Y1(e,t,n,r,i,o){let a=0,s=0,l=i,u=o,f=e.get(),c=0;function p(){const C=r.get()-e.get(),T=!l;let _=0;return T?(a=0,n.set(r),e.set(r),_=C):(n.set(e),a+=C/l,a*=u,f+=a,e.add(a),_=f-c),s=sa(_),c=f,k}function d(){const C=r.get()-t.get();return Pe(C)<.001}function m(){return l}function h(){return s}function g(){return a}function y(){return w(i)}function v(){return A(o)}function w(C){return l=C,k}function A(C){return u=C,k}const k={direction:h,duration:m,velocity:g,seek:p,settled:d,useBaseFriction:v,useBaseDuration:y,useFriction:A,useDuration:w};return k}function G1(e,t,n,r,i){const o=i.measure(10),a=i.measure(50),s=qt(.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",h=Pe(e[m]-t.get()),g=n.get()-t.get(),y=s.constrain(h/a);n.subtract(g*y),!d&&Pe(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 Q1(e,t,n,r,i){const o=qt(-t+e,0),a=c(),s=f(),l=p();function u(m,h){return Kn(m,h)<=1}function f(){const m=a[0],h=ct(a),g=a.lastIndexOf(m),y=a.indexOf(h)+1;return qt(g,y)}function c(){return n.map((m,h)=>{const{min:g,max:y}=o,v=o.constrain(m),w=!h,A=la(n,h);return w?y:A||u(g,v)?g:u(y,v)?y:v}).map(m=>parseFloat(m.toFixed(3)))}function p(){if(t<=e+i)return[o.max];if(r==="keepSnaps")return a;const{min:m,max:h}=s;return a.slice(m,h)}return{snapsContained:l,scrollContainLimit:s}}function J1(e,t,n){const r=t[0],i=n?r-e:ct(t);return{limit:qt(i,r)}}function Z1(e,t,n,r){const o=t.min+.1,a=t.max+.1,{reachedMin:s,reachedMax:l}=qt(o,a);function u(p){return p===1?l(n.get()):p===-1?s(n.get()):!1}function f(p){if(!u(p))return;const d=e*(p*-1);r.forEach(m=>m.add(d))}return{loop:f}}function X1(e){const{max:t,length:n}=e;function r(o){const a=o-t;return n?a/-n:0}return{get:r}}function ek(e,t,n,r,i){const{startEdge:o,endEdge:a}=e,{groupSlides:s}=i,l=c().map(t.measure),u=p(),f=d();function c(){return s(r).map(h=>ct(h)[a]-h[0][o]).map(Pe)}function p(){return r.map(h=>n[o]-h[o]).map(h=>-Pe(h))}function d(){return s(u).map(h=>h[0]).map((h,g)=>h+l[g])}return{snaps:u,snapsAligned:f}}function tk(e,t,n,r,i,o){const{groupSlides:a}=i,{min:s,max:l}=r,u=f();function f(){const p=a(o),d=!e||t==="keepSnaps";return n.length===1?[o]:d?p:p.slice(s,l).map((m,h,g)=>{const y=!h,v=la(g,h);if(y){const w=ct(g[0])+1;return yf(w)}if(v){const w=Gn(o)-ct(g)[0]+1;return yf(w,ct(g)[0])}return m})}return{slideRegistry:u}}function nk(e,t,n,r,i){const{reachedAny:o,removeOffset:a,constrain:s}=r;function l(m){return m.concat().sort((h,g)=>Pe(h)-Pe(g))[0]}function u(m){const h=e?a(m):s(m),g=t.map((v,w)=>({diff:f(v-h,0),index:w})).sort((v,w)=>Pe(v.diff)-Pe(w.diff)),{index:y}=g[0];return{index:y,distance:h}}function f(m,h){const g=[m,m+n,m-n];if(!e)return m;if(!h)return l(g);const y=g.filter(v=>sa(v)===h);return y.length?l(y):ct(g)-n}function c(m,h){const g=t[m]-i.get(),y=f(g,h);return{index:m,distance:y}}function p(m,h){const g=i.get()+m,{index:y,distance:v}=u(g),w=!e&&o(g);if(!h||w)return{index:y,distance:m};const A=t[y]-v,k=m+f(A,0);return{index:y,distance:k}}return{byDistance:p,byIndex:c,shortcut:f}}function rk(e,t,n,r,i,o,a){function s(c){const p=c.distance,d=c.index!==t.get();o.add(p),p&&(r.duration()?e.start():(e.update(),e.render(1),e.update())),d&&(n.set(t.get()),t.set(c.index),a.emit("select"))}function l(c,p){const d=i.byDistance(c,p);s(d)}function u(c,p){const d=t.clone().set(c),m=i.byIndex(d.get(),p);s(m)}return{distance:l,index:u}}function ik(e,t,n,r,i,o,a,s){const l={passive:!0,capture:!0};let u=0;function f(d){if(!s)return;function m(h){if(new Date().getTime()-u>10)return;a.emit("slideFocusStart"),e.scrollLeft=0;const v=n.findIndex(w=>w.includes(h));oa(v)&&(i.useDuration(0),r.index(v,0),a.emit("slideFocus"))}o.add(document,"keydown",c,!1),t.forEach((h,g)=>{o.add(h,"focus",y=>{(Ur(s)||s(d,y))&&m(g)},l)})}function c(d){d.code==="Tab"&&(u=new Date().getTime())}return{init:f}}function Zn(e){let t=e;function n(){return t}function r(l){t=a(l)}function i(l){t+=a(l)}function o(l){t-=a(l)}function a(l){return oa(l)?l:l.get()}return{get:n,set:r,add:i,subtract:o}}function wf(e,t){const n=e.scroll==="x"?a:s,r=t.style;let i=null,o=!1;function a(p){return`translate3d(${p}px,0px,0px)`}function s(p){return`translate3d(0px,${p}px,0px)`}function l(p){if(o)return;const d=z1(e.direction(p));d!==i&&(r.transform=n(d),i=d)}function u(p){o=!p}function f(){o||(r.transform="",t.getAttribute("style")||t.removeAttribute("style"))}return{clear:f,to:l,toggleActive:u}}function ok(e,t,n,r,i,o,a,s,l){const f=Yn(i),c=Yn(i).reverse(),p=y().concat(v());function d(T,_){return T.reduce((F,I)=>F-i[I],_)}function m(T,_){return T.reduce((F,I)=>d(F,_)>0?F.concat([I]):F,[])}function h(T){return o.map((_,F)=>({start:_-r[F]+.5+T,end:_+t-.5+T}))}function g(T,_,F){const I=h(_);return T.map(O=>{const j=F?0:-n,z=F?n:0,M=F?"end":"start",D=I[O][M];return{index:O,loopPoint:D,slideLocation:Zn(-1),translate:wf(e,l[O]),target:()=>s.get()>D?j:z}})}function y(){const T=a[0],_=m(c,T);return g(_,n,!1)}function v(){const T=t-a[0]-1,_=m(f,T);return g(_,-n,!0)}function w(){return p.every(({index:T})=>{const _=f.filter(F=>F!==T);return d(_,t)<=.1})}function A(){p.forEach(T=>{const{target:_,translate:F,slideLocation:I}=T,O=_();O!==I.get()&&(F.to(O),I.set(O))})}function k(){p.forEach(T=>T.translate.clear())}return{canLoop:w,clear:k,loop:A,loopPoints:p}}function ak(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||(Ur(n)||n(l,f))&&u(f)}),r.observe(e,{childList:!0})}function a(){r&&r.disconnect(),i=!0}return{init:o,destroy:a}}function sk(e,t,n,r){const i={};let o=null,a=null,s,l=!1;function u(){s=new IntersectionObserver(m=>{l||(m.forEach(h=>{const g=t.indexOf(h.target);i[g]=h}),o=null,a=null,n.emit("slidesInView"))},{root:e.parentElement,threshold:r}),t.forEach(m=>s.observe(m))}function f(){s&&s.disconnect(),l=!0}function c(m){return Qn(i).reduce((h,g)=>{const y=parseInt(g),{isIntersecting:v}=i[y];return(m&&v||!m&&!v)&&h.push(y),h},[])}function p(m=!0){if(m&&o)return o;if(!m&&a)return a;const h=c(m);return m&&(o=h),m||(a=h),h}return{init:u,destroy:f,get:p}}function lk(e,t,n,r,i,o){const{measureSize:a,startEdge:s,endEdge:l}=e,u=n[0]&&i,f=m(),c=h(),p=n.map(a),d=g();function m(){if(!u)return 0;const v=n[0];return Pe(t[s]-v[s])}function h(){if(!u)return 0;const v=o.getComputedStyle(ct(r));return parseFloat(v.getPropertyValue(`margin-${l}`))}function g(){return n.map((v,w,A)=>{const k=!w,C=la(A,w);return k?p[w]+f:C?p[w]+c:A[w+1][s]-v[s]}).map(Pe)}return{slideSizes:p,slideSizesWithGaps:d,startGap:f,endGap:c}}function uk(e,t,n,r,i,o,a,s,l){const{startEdge:u,endEdge:f,direction:c}=e,p=oa(n);function d(y,v){return Yn(y).filter(w=>w%v===0).map(w=>y.slice(w,w+v))}function m(y){return y.length?Yn(y).reduce((v,w,A)=>{const k=ct(v)||0,C=k===0,T=w===Gn(y),_=i[u]-o[k][u],F=i[u]-o[w][f],I=!r&&C?c(a):0,O=!r&&T?c(s):0,j=Pe(F-O-(_+I));return A&&j>t+l&&v.push(w),T&&v.push(y.length),v},[]).map((v,w,A)=>{const k=Math.max(A[w-1]||0);return y.slice(k,v)}):[]}function h(y){return p?d(y,n):m(y)}return{groupSlides:h}}function ck(e,t,n,r,i,o,a){const{align:s,axis:l,direction:u,startIndex:f,loop:c,duration:p,dragFree:d,dragThreshold:m,inViewThreshold:h,slidesToScroll:g,skipSnaps:y,containScroll:v,watchResize:w,watchSlides:A,watchDrag:k,watchFocus:C}=o,T=2,_=V1(),F=_.measure(t),I=n.map(_.measure),O=U1(l,u),j=O.measureSize(F),z=q1(j),M=$1(s,j),D=!c&&!!v,B=c||!!v,{slideSizes:U,slideSizesWithGaps:$,startGap:W,endGap:b}=lk(O,F,I,n,B,i),P=uk(O,j,g,c,F,I,W,b,T),{snaps:H,snapsAligned:x}=ek(O,M,F,I,P),V=-ct(H)+ct($),{snapsContained:ee,scrollContainLimit:Y}=Q1(j,V,x,v,T),J=D?ee:x,{limit:X}=J1(V,J,c),re=bf(Gn(J),f,c),K=re.clone(),te=Yn(n),L=({dragHandler:pe,scrollBody:fe,scrollBounds:Ee,options:{loop:Me}})=>{Me||Ee.constrain(pe.pointerDown()),fe.seek()},ne=({scrollBody:pe,translate:fe,location:Ee,offsetLocation:Me,previousLocation:$e,scrollLooper:gt,slideLooper:ze,dragHandler:lt,animation:Qe,eventHandler:Li,scrollBounds:OT,options:{loop:Fh}},Rh)=>{const Bh=pe.settled(),DT=!OT.shouldConstrain(),zh=Fh?Bh:Bh&&DT,$h=zh&&!lt.pointerDown();$h&&Qe.stop();const MT=Ee.get()*Rh+$e.get()*(1-Rh);Me.set(MT),Fh&&(gt.loop(pe.direction()),ze.loop()),fe.to(Me.get()),$h&&Li.emit("settle"),zh||Li.emit("scroll")},me=j1(r,i,()=>L(le),pe=>ne(le,pe)),ke=.68,oe=J[re.get()],G=Zn(oe),ue=Zn(oe),de=Zn(oe),we=Zn(oe),Se=Y1(G,de,ue,we,p,ke),He=nk(c,J,V,X,we),Ge=rk(me,re,K,Se,He,we,a),Z=X1(X),se=Jn(),R=sk(t,n,a,h),{slideRegistry:q}=tk(D,v,J,Y,P,te),ae=ik(e,n,q,Ge,Se,se,a,C),le={ownerDocument:r,ownerWindow:i,eventHandler:a,containerRect:F,slideRects:I,animation:me,axis:O,dragHandler:H1(O,e,r,i,we,W1(O,i),G,me,Ge,Se,He,re,a,z,d,m,y,ke,k),eventStore:se,percentOfView:z,index:re,indexPrevious:K,limit:X,location:G,offsetLocation:de,previousLocation:ue,options:o,resizeHandler:K1(t,a,i,n,O,w,_),scrollBody:Se,scrollBounds:G1(X,de,we,Se,z),scrollLooper:Z1(V,X,de,[G,de,ue,we]),scrollProgress:Z,scrollSnapList:J.map(Z.get),scrollSnaps:J,scrollTarget:He,scrollTo:Ge,slideLooper:ok(O,j,V,U,$,H,J,de,n),slideFocus:ae,slidesHandler:ak(t,a,A),slidesInView:R,slideIndexes:te,slideRegistry:q,slidesToScroll:P,target:we,translate:wf(O,t)};return le}function fk(){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 a(u,f){return e[u]=r(u).filter(c=>c!==f),l}function s(){e={}}const l={init:n,emit:i,off:a,on:o,clear:s};return l}const dk={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 pk(e){function t(o,a){return vf(o,a||{})}function n(o){const a=o.breakpoints||{},s=Qn(a).filter(l=>e.matchMedia(l).matches).map(l=>a[l]).reduce((l,u)=>t(l,u),{});return t(o,s)}function r(o){return o.map(a=>Qn(a.breakpoints||{})).reduce((a,s)=>a.concat(s),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:n,optionsMediaQueries:r}}function hk(e){let t=[];function n(o,a){return t=a.filter(({options:s})=>e.optionsAtMedia(s).active!==!1),t.forEach(s=>s.init(o,e)),a.reduce((s,l)=>Object.assign(s,{[l.name]:l}),{})}function r(){t=t.filter(o=>o.destroy())}return{init:n,destroy:r}}function Hr(e,t,n){const r=e.ownerDocument,i=r.defaultView,o=pk(i),a=hk(o),s=Jn(),l=fk(),{mergeOptions:u,optionsAtMedia:f,optionsMediaQueries:c}=o,{on:p,off:d,emit:m}=l,h=O;let g=!1,y,v=u(dk,Hr.globalOptions),w=u(v),A=[],k,C,T;function _(){const{container:te,slides:L}=w;C=(aa(te)?e.querySelector(te):te)||e.children[0];const me=aa(L)?C.querySelectorAll(L):L;T=[].slice.call(me||C.children)}function F(te){const L=ck(e,C,T,r,i,te,l);if(te.loop&&!L.slideLooper.canLoop()){const ne=Object.assign({},te,{loop:!1});return F(ne)}return L}function I(te,L){g||(v=u(v,te),w=f(v),A=L||A,_(),y=F(w),c([v,...A.map(({options:ne})=>ne)]).forEach(ne=>s.add(ne,"change",O)),w.active&&(y.translate.to(y.location.get()),y.animation.init(),y.slidesInView.init(),y.slideFocus.init(K),y.eventHandler.init(K),y.resizeHandler.init(K),y.slidesHandler.init(K),y.options.loop&&y.slideLooper.loop(),C.offsetParent&&T.length&&y.dragHandler.init(K),k=a.init(K,A)))}function O(te,L){const ne=P();j(),I(u({startIndex:ne},te),L),l.emit("reInit")}function j(){y.dragHandler.destroy(),y.eventStore.clear(),y.translate.clear(),y.slideLooper.clear(),y.resizeHandler.destroy(),y.slidesHandler.destroy(),y.slidesInView.destroy(),y.animation.destroy(),a.destroy(),s.clear()}function z(){g||(g=!0,s.clear(),j(),l.emit("destroy"),l.clear())}function M(te,L,ne){!w.active||g||(y.scrollBody.useBaseFriction().useDuration(L===!0?0:w.duration),y.scrollTo.index(te,ne||0))}function D(te){const L=y.index.add(1).get();M(L,te,-1)}function B(te){const L=y.index.add(-1).get();M(L,te,1)}function U(){return y.index.add(1).get()!==P()}function $(){return y.index.add(-1).get()!==P()}function W(){return y.scrollSnapList}function b(){return y.scrollProgress.get(y.offsetLocation.get())}function P(){return y.index.get()}function H(){return y.indexPrevious.get()}function x(){return y.slidesInView.get()}function V(){return y.slidesInView.get(!1)}function ee(){return k}function Y(){return y}function J(){return e}function X(){return C}function re(){return T}const K={canScrollNext:U,canScrollPrev:$,containerNode:X,internalEngine:Y,destroy:z,off:d,on:p,emit:m,plugins:ee,previousScrollSnap:H,reInit:h,rootNode:J,scrollNext:D,scrollPrev:B,scrollProgress:b,scrollSnapList:W,scrollTo:M,selectedScrollSnap:P,slideNodes:re,slidesInView:x,slidesNotInView:V};return I(t,n),setTimeout(()=>l.emit("init"),0),K}Hr.globalOptions=void 0;function ca(e={},t=[]){const n=N.useRef(e),r=N.useRef(t),[i,o]=N.useState(),[a,s]=N.useState(),l=N.useCallback(()=>{i&&i.reInit(n.current,r.current)},[i]);return N.useEffect(()=>{ia(n.current,e)||(n.current=e,l())},[e,l]),N.useEffect(()=>{R1(r.current,t)||(r.current=t,l())},[t,l]),N.useEffect(()=>{if(F1()&&a){Hr.globalOptions=ca.globalOptions;const u=Hr(a,n.current,r.current);return o(u),()=>u.destroy()}else o(void 0)},[a,o]),[s,i]}ca.globalOptions=void 0;const xf=N.forwardRef(({blocks:e,direction:t,sender:n,timestamp:r,messageId:i,isReadOnly:o,sendMessage:a},s)=>{const[l,u]=ca({skipSnaps:!0,loop:!0}),[f,c]=N.useState(!0),[p,d]=N.useState(!0),m=N.useCallback(()=>u==null?void 0:u.scrollPrev(),[u]),h=N.useCallback(()=>u==null?void 0:u.scrollNext(),[u]),{message:{blocks:{carousel:g}}}=ge,y=N.useCallback(v=>{c(!(v!=null&&v.canScrollPrev())),d(!(v!=null&&v.canScrollNext()))},[]);return N.useEffect(()=>{u&&(y(u),u.on("reInit",y),u.on("select",y))},[u,y]),S.jsxs("div",{...g==null?void 0:g.container,"data-container":"carousel",ref:l,children:[S.jsx("div",{ref:s,...g==null?void 0:g.slidesContainer,children:e.map((v,w)=>S.jsx(Yt,{block:{...v,direction:t,timestamp:r,sender:n,messageId:i,sendMessage:a,isReadOnly:o}},w))}),e.length>1&&S.jsxs(S.Fragment,{children:[S.jsx(D0,{...g==null?void 0:g.backButton,"data-disabled":f?"":void 0,onClick:m}),S.jsx(M0,{...g==null?void 0:g.nextButton,"data-disabled":p?"":void 0,onClick:h})]})]})});xf.displayName="Carousel";const kf=Math.floor;function Sf(e){return Ef(e)?(e.nodeName||"").toLowerCase():"#document"}function Xn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function mk(e){var t;return(t=(Ef(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ef(e){return e instanceof Node||e instanceof Xn(e).Node}function st(e){return e instanceof Element||e instanceof Xn(e).Element}function cn(e){return e instanceof HTMLElement||e instanceof Xn(e).HTMLElement}function fa(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Xn(e).ShadowRoot}function gk(e){return["html","body","#document"].includes(Sf(e))}function yk(e){return Xn(e).getComputedStyle(e)}function vk(e){if(Sf(e)==="html")return e;const t=e.assignedSlot||e.parentNode||fa(e)&&e.host||mk(e);return fa(t)?t.host:t}function Pt(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 Xe(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&fa(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Cf(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function bk(){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 Af(e){if(e.mozInputSource===0&&e.isTrusted)return!0;const t=/Android/i;return(t.test(Cf())||t.test(bk()))&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function If(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 Tf(){return/apple/i.test(navigator.vendor)}function wk(){return Cf().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Of(e,t){return["mouse","pen"].includes(e)}function xk(e){return"nativeEvent"in e}function kk(e){return e.matches("html,body")}function ft(e){return(e==null?void 0:e.ownerDocument)||document}function da(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 Df(e){return"composedPath"in e?e.composedPath()[0]:e.target}const Sk="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Mf(e){return cn(e)&&e.matches(Sk)}function Ue(e){e.preventDefault(),e.stopPropagation()}const fn=Math.min,rt=Math.max,Wr=Math.round,Vr=Math.floor,bt=e=>({x:e,y:e});function _f(e,t,n){return rt(e,fn(t,n))}function qr(e,t){return typeof e=="function"?e(t):e}function er(e){return e.split("-")[0]}function pa(e){return e.split("-")[1]}function Pf(e){return e==="x"?"y":"x"}function Ek(e){return e==="y"?"height":"width"}const Ck=new Set(["top","bottom"]);function tr(e){return Ck.has(er(e))?"y":"x"}function Ak(e){return Pf(tr(e))}function Ik(e){return{top:0,right:0,bottom:0,left:0,...e}}function Tk(e){return typeof e!="number"?Ik(e):{top:e,right:e,bottom:e,left:e}}function Kr(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 Nf(e,t,n){let{reference:r,floating:i}=e;const o=tr(t),a=Ak(t),s=Ek(a),l=er(t),u=o==="y",f=r.x+r.width/2-i.width/2,c=r.y+r.height/2-i.height/2,p=r[s]/2-i[s]/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(pa(t)){case"start":d[a]-=p*(n&&u?-1:1);break;case"end":d[a]+=p*(n&&u?-1:1);break}return d}const Ok=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=o.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:f,y:c}=Nf(u,r,l),p=r,d={},m=0;for(let h=0;h<s.length;h++){const{name:g,fn:y}=s[h],{x:v,y:w,data:A,reset:k}=await y({x:f,y:c,initialPlacement:r,placement:p,strategy:i,middlewareData:d,rects:u,platform:a,elements:{reference:e,floating:t}});f=v??f,c=w??c,d={...d,[g]:{...d[g],...A}},k&&m<=50&&(m++,typeof k=="object"&&(k.placement&&(p=k.placement),k.rects&&(u=k.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):k.rects),{x:f,y:c}=Nf(u,p,l)),h=-1)}return{x:f,y:c,placement:p,strategy:i,middlewareData:d}};async function Lf(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:s,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:c="floating",altBoundary:p=!1,padding:d=0}=qr(t,e),m=Tk(d),g=s[p?c==="floating"?"reference":"floating":c],y=Kr(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(s.floating)),boundary:u,rootBoundary:f,strategy:l})),v=c==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,w=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.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=Kr(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:w,strategy:l}):v);return{top:(y.top-k.top+m.top)/A.y,bottom:(k.bottom-y.bottom+m.bottom)/A.y,left:(y.left-k.left+m.left)/A.x,right:(k.right-y.right+m.right)/A.x}}const Dk=new Set(["left","top"]);async function Mk(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=er(n),s=pa(n),l=tr(n)==="y",u=Dk.has(a)?-1:1,f=o&&l?-1:1,c=qr(t,e);let{mainAxis:p,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 s&&typeof m=="number"&&(d=s==="end"?m*-1:m),l?{x:d*f,y:p*u}:{x:p*u,y:d*f}}const _k=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:a,middlewareData:s}=t,l=await Mk(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:a}}}}},Pk=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:a=!1,limiter:s={fn:g=>{let{x:y,y:v}=g;return{x:y,y:v}}},...l}=qr(e,t),u={x:n,y:r},f=await Lf(t,l),c=tr(er(i)),p=Pf(c);let d=u[p],m=u[c];if(o){const g=p==="y"?"top":"left",y=p==="y"?"bottom":"right",v=d+f[g],w=d-f[y];d=_f(v,d,w)}if(a){const g=c==="y"?"top":"left",y=c==="y"?"bottom":"right",v=m+f[g],w=m-f[y];m=_f(v,m,w)}const h=s.fn({...t,[p]:d,[c]:m});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[p]:o,[c]:a}}}}}},Nk=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:a,elements:s}=t,{apply:l=()=>{},...u}=qr(e,t),f=await Lf(t,u),c=er(i),p=pa(i),d=tr(i)==="y",{width:m,height:h}=o.floating;let g,y;c==="top"||c==="bottom"?(g=c,y=p===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(y=c,g=p==="end"?"top":"bottom");const v=h-f.top-f.bottom,w=m-f.left-f.right,A=fn(h-f[g],v),k=fn(m-f[y],w),C=!t.middlewareData.shift;let T=A,_=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(_=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=v),C&&!p){const I=rt(f.left,0),O=rt(f.right,0),j=rt(f.top,0),z=rt(f.bottom,0);d?_=m-2*(I!==0||O!==0?I+O:rt(f.left,f.right)):T=h-2*(j!==0||z!==0?j+z:rt(f.top,f.bottom))}await l({...t,availableWidth:_,availableHeight:T});const F=await a.getDimensions(s.floating);return m!==F.width||h!==F.height?{reset:{rects:!0}}:{}}}};function Yr(){return typeof window<"u"}function dn(e){return Ff(e)?(e.nodeName||"").toLowerCase():"#document"}function it(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function wt(e){var t;return(t=(Ff(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ff(e){return Yr()?e instanceof Node||e instanceof it(e).Node:!1}function dt(e){return Yr()?e instanceof Element||e instanceof it(e).Element:!1}function xt(e){return Yr()?e instanceof HTMLElement||e instanceof it(e).HTMLElement:!1}function Rf(e){return!Yr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof it(e).ShadowRoot}const Lk=new Set(["inline","contents"]);function nr(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=pt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Lk.has(i)}const Fk=new Set(["table","td","th"]);function Rk(e){return Fk.has(dn(e))}const Bk=[":popover-open",":modal"];function Gr(e){return Bk.some(t=>{try{return e.matches(t)}catch{return!1}})}const zk=["transform","translate","scale","rotate","perspective"],$k=["transform","translate","scale","rotate","perspective","filter"],jk=["paint","layout","strict","content"];function ha(e){const t=ma(),n=dt(e)?pt(e):e;return zk.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)||$k.some(r=>(n.willChange||"").includes(r))||jk.some(r=>(n.contain||"").includes(r))}function Uk(e){let t=Nt(e);for(;xt(t)&&!pn(t);){if(ha(t))return t;if(Gr(t))return null;t=Nt(t)}return null}function ma(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Hk=new Set(["html","body","#document"]);function pn(e){return Hk.has(dn(e))}function pt(e){return it(e).getComputedStyle(e)}function Qr(e){return dt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Nt(e){if(dn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Rf(e)&&e.host||wt(e);return Rf(t)?t.host:t}function Bf(e){const t=Nt(e);return pn(t)?e.ownerDocument?e.ownerDocument.body:e.body:xt(t)&&nr(t)?t:Bf(t)}function Lt(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Bf(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=it(i);if(o){const s=ga(a);return t.concat(a,a.visualViewport||[],nr(i)?i:[],s&&n?Lt(s):[])}return t.concat(i,Lt(i,[],n))}function ga(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function zf(e){const t=pt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=xt(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,s=Wr(n)!==o||Wr(r)!==a;return s&&(n=o,r=a),{width:n,height:r,$:s}}function ya(e){return dt(e)?e:e.contextElement}function hn(e){const t=ya(e);if(!xt(t))return bt(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=zf(t);let a=(o?Wr(n.width):n.width)/r,s=(o?Wr(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const Wk=bt(0);function $f(e){const t=it(e);return!ma()||!t.visualViewport?Wk:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Vk(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==it(e)?!1:t}function Kt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=ya(e);let a=bt(1);t&&(r?dt(r)&&(a=hn(r)):a=hn(e));const s=Vk(o,n,r)?$f(o):bt(0);let l=(i.left+s.x)/a.x,u=(i.top+s.y)/a.y,f=i.width/a.x,c=i.height/a.y;if(o){const p=it(o),d=r&&dt(r)?it(r):r;let m=p,h=ga(m);for(;h&&r&&d!==m;){const g=hn(h),y=h.getBoundingClientRect(),v=pt(h),w=y.left+(h.clientLeft+parseFloat(v.paddingLeft))*g.x,A=y.top+(h.clientTop+parseFloat(v.paddingTop))*g.y;l*=g.x,u*=g.y,f*=g.x,c*=g.y,l+=w,u+=A,m=it(h),h=ga(m)}}return Kr({width:f,height:c,x:l,y:u})}function Jr(e,t){const n=Qr(e).scrollLeft;return t?t.left+n:Kt(wt(e)).left+n}function jf(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Jr(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function qk(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",a=wt(r),s=t?Gr(t.floating):!1;if(r===a||s&&o)return n;let l={scrollLeft:0,scrollTop:0},u=bt(1);const f=bt(0),c=xt(r);if((c||!c&&!o)&&((dn(r)!=="body"||nr(a))&&(l=Qr(r)),xt(r))){const d=Kt(r);u=hn(r),f.x=d.x+r.clientLeft,f.y=d.y+r.clientTop}const p=a&&!c&&!o?jf(a,l):bt(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+f.x+p.x,y:n.y*u.y-l.scrollTop*u.y+f.y+p.y}}function Kk(e){return Array.from(e.getClientRects())}function Yk(e){const t=wt(e),n=Qr(e),r=e.ownerDocument.body,i=rt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=rt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Jr(e);const s=-n.scrollTop;return pt(r).direction==="rtl"&&(a+=rt(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:s}}const Uf=25;function Gk(e,t){const n=it(e),r=wt(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;const f=ma();(!f||f&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}const u=Jr(r);if(u<=0){const f=r.ownerDocument,c=f.body,p=getComputedStyle(c),d=f.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,m=Math.abs(r.clientWidth-c.clientWidth-d);m<=Uf&&(o-=m)}else u<=Uf&&(o+=u);return{width:o,height:a,x:s,y:l}}const Qk=new Set(["absolute","fixed"]);function Jk(e,t){const n=Kt(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=xt(e)?hn(e):bt(1),a=e.clientWidth*o.x,s=e.clientHeight*o.y,l=i*o.x,u=r*o.y;return{width:a,height:s,x:l,y:u}}function Hf(e,t,n){let r;if(t==="viewport")r=Gk(e,n);else if(t==="document")r=Yk(wt(e));else if(dt(t))r=Jk(t,n);else{const i=$f(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Kr(r)}function Wf(e,t){const n=Nt(e);return n===t||!dt(n)||pn(n)?!1:pt(n).position==="fixed"||Wf(n,t)}function Zk(e,t){const n=t.get(e);if(n)return n;let r=Lt(e,[],!1).filter(s=>dt(s)&&dn(s)!=="body"),i=null;const o=pt(e).position==="fixed";let a=o?Nt(e):e;for(;dt(a)&&!pn(a);){const s=pt(a),l=ha(a);!l&&s.position==="fixed"&&(i=null),(o?!l&&!i:!l&&s.position==="static"&&!!i&&Qk.has(i.position)||nr(a)&&!l&&Wf(e,a))?r=r.filter(f=>f!==a):i=s,a=Nt(a)}return t.set(e,r),r}function Xk(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?Gr(t)?[]:Zk(t,this._c):[].concat(n),r],s=a[0],l=a.reduce((u,f)=>{const c=Hf(t,f,i);return u.top=rt(c.top,u.top),u.right=fn(c.right,u.right),u.bottom=fn(c.bottom,u.bottom),u.left=rt(c.left,u.left),u},Hf(t,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function eS(e){const{width:t,height:n}=zf(e);return{width:t,height:n}}function tS(e,t,n){const r=xt(t),i=wt(t),o=n==="fixed",a=Kt(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const l=bt(0);function u(){l.x=Jr(i)}if(r||!r&&!o)if((dn(t)!=="body"||nr(i))&&(s=Qr(t)),r){const d=Kt(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?jf(i,s):bt(0),c=a.left+s.scrollLeft-l.x-f.x,p=a.top+s.scrollTop-l.y-f.y;return{x:c,y:p,width:a.width,height:a.height}}function va(e){return pt(e).position==="static"}function Vf(e,t){if(!xt(e)||pt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return wt(e)===n&&(n=n.ownerDocument.body),n}function qf(e,t){const n=it(e);if(Gr(e))return n;if(!xt(e)){let i=Nt(e);for(;i&&!pn(i);){if(dt(i)&&!va(i))return i;i=Nt(i)}return n}let r=Vf(e,t);for(;r&&Rk(r)&&va(r);)r=Vf(r,t);return r&&pn(r)&&va(r)&&!ha(r)?n:r||Uk(e)||n}const nS=async function(e){const t=this.getOffsetParent||qf,n=this.getDimensions,r=await n(e.floating);return{reference:tS(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function rS(e){return pt(e).direction==="rtl"}const iS={convertOffsetParentRelativeRectToViewportRelativeRect:qk,getDocumentElement:wt,getClippingRect:Xk,getOffsetParent:qf,getElementRects:nS,getClientRects:Kk,getDimensions:eS,getScale:hn,isElement:dt,isRTL:rS};function Kf(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function oS(e,t){let n=null,r;const i=wt(e);function o(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),o();const u=e.getBoundingClientRect(),{left:f,top:c,width:p,height:d}=u;if(s||t(),!p||!d)return;const m=Vr(c),h=Vr(i.clientWidth-(f+p)),g=Vr(i.clientHeight-(c+d)),y=Vr(f),w={rootMargin:-m+"px "+-h+"px "+-g+"px "+-y+"px",threshold:rt(0,fn(1,l))||1};let A=!0;function k(C){const T=C[0].intersectionRatio;if(T!==l){if(!A)return a();T?a(!1,T):r=setTimeout(()=>{a(!1,1e-7)},1e3)}T===1&&!Kf(u,e.getBoundingClientRect())&&a(),A=!1}try{n=new IntersectionObserver(k,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(k,w)}n.observe(e)}return a(!0),o}function aS(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=ya(e),f=i||o?[...u?Lt(u):[],...Lt(t)]:[];f.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),o&&y.addEventListener("resize",n)});const c=u&&s?oS(u,n):null;let p=-1,d=null;a&&(d=new ResizeObserver(y=>{let[v]=y;v&&v.target===u&&d&&(d.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var w;(w=d)==null||w.observe(t)})),n()}),u&&!l&&d.observe(u),d.observe(t));let m,h=l?Kt(e):null;l&&g();function g(){const y=Kt(e);h&&!Kf(h,y)&&n(),h=y,m=requestAnimationFrame(g)}return n(),()=>{var y;f.forEach(v=>{i&&v.removeEventListener("scroll",n),o&&v.removeEventListener("resize",n)}),c==null||c(),(y=d)==null||y.disconnect(),d=null,l&&cancelAnimationFrame(m)}}const sS=_k,lS=Pk,uS=Nk,cS=(e,t,n)=>{const r=new Map,i={platform:iS,...n},o={...i.platform,_c:r};return Ok(e,t,{...i,platform:o})};var fS=typeof document<"u",dS=function(){},Zr=fS?N.useLayoutEffect:dS;function Xr(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(!Xr(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)&&!Xr(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Yf(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Gf(e,t){const n=Yf(e);return Math.round(t*n)/n}function ba(e){const t=E.useRef(e);return Zr(()=>{t.current=e}),t}function pS(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:a}={},transform:s=!0,whileElementsMounted:l,open:u}=e,[f,c]=E.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,d]=E.useState(r);Xr(p,r)||d(r);const[m,h]=E.useState(null),[g,y]=E.useState(null),v=E.useCallback($=>{$!==C.current&&(C.current=$,h($))},[]),w=E.useCallback($=>{$!==T.current&&(T.current=$,y($))},[]),A=o||m,k=a||g,C=E.useRef(null),T=E.useRef(null),_=E.useRef(f),F=l!=null,I=ba(l),O=ba(i),j=ba(u),z=E.useCallback(()=>{if(!C.current||!T.current)return;const $={placement:t,strategy:n,middleware:p};O.current&&($.platform=O.current),cS(C.current,T.current,$).then(W=>{const b={...W,isPositioned:j.current!==!1};M.current&&!Xr(_.current,b)&&(_.current=b,Ms.flushSync(()=>{c(b)}))})},[p,t,n,O,j]);Zr(()=>{u===!1&&_.current.isPositioned&&(_.current.isPositioned=!1,c($=>({...$,isPositioned:!1})))},[u]);const M=E.useRef(!1);Zr(()=>(M.current=!0,()=>{M.current=!1}),[]),Zr(()=>{if(A&&(C.current=A),k&&(T.current=k),A&&k){if(I.current)return I.current(A,k,z);z()}},[A,k,z,I,F]);const D=E.useMemo(()=>({reference:C,floating:T,setReference:v,setFloating:w}),[v,w]),B=E.useMemo(()=>({reference:A,floating:k}),[A,k]),U=E.useMemo(()=>{const $={position:n,left:0,top:0};if(!B.floating)return $;const W=Gf(B.floating,f.x),b=Gf(B.floating,f.y);return s?{...$,transform:"translate("+W+"px, "+b+"px)",...Yf(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:W,top:b}},[n,s,B.floating,f.x,f.y]);return E.useMemo(()=>({...f,update:z,refs:D,elements:B,floatingStyles:U}),[f,z,D,B,U])}const hS=(e,t)=>({...sS(e),options:[e,t]}),mS=(e,t)=>({...lS(e),options:[e,t]}),gS=(e,t)=>({...uS(e),options:[e,t]});/*!
276
276
  * tabbable 6.3.0
277
277
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
278
- */var xS=["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])"],Ea=xS.join(","),ed=typeof Element>"u",ar=ed?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ri=!ed&&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},sr=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",a=o||n&&t&&sr(t.parentNode);return a},kS=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},SS=function(t,n,r){if(sr(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(Ea));return n&&ar.call(t,Ea)&&i.unshift(t),i=i.filter(r),i},Ca=function(t,n,r){for(var i=[],o=Array.from(t);o.length;){var a=o.shift();if(!sr(a,!1))if(a.tagName==="SLOT"){var s=a.assignedElements(),l=s.length?s:a.children,u=Ca(l,!0,r);r.flatten?i.push.apply(i,u):i.push({scopeParent:a,candidates:u})}else{var f=ar.call(a,Ea);f&&r.filter(a)&&(n||!t.includes(a))&&i.push(a);var c=a.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(a),p=!sr(c,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(c&&p){var d=Ca(c===!0?a.children:c.children,!0,r);r.flatten?i.push.apply(i,d):i.push({scopeParent:a,candidates:d})}else o.unshift.apply(o,a.children)}}return i},td=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},nd=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||kS(t))&&!td(t)?0:t.tabIndex},ES=function(t,n){var r=nd(t);return r<0&&n&&!td(t)?0:r},CS=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},rd=function(t){return t.tagName==="INPUT"},AS=function(t){return rd(t)&&t.type==="hidden"},IS=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},TS=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},OS=function(t){if(!t.name)return!0;var n=t.form||ri(t),r=function(s){return n.querySelectorAll('input[type="radio"][name="'+s+'"]')},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(a){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",a.message),!1}var o=TS(i,t.form);return!o||o===t},DS=function(t){return rd(t)&&t.type==="radio"},MS=function(t){return DS(t)&&!OS(t)},_S=function(t){var n,r=t&&ri(t),i=(n=r)===null||n===void 0?void 0:n.host,o=!1;if(r&&r!==t){var a,s,l;for(o=!!((a=i)!==null&&a!==void 0&&(s=a.ownerDocument)!==null&&s!==void 0&&s.contains(i)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!o&&i;){var u,f,c;r=ri(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},id=function(t){var n=t.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},PS=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 a=ar.call(t,"details>summary:first-of-type"),s=a?t.parentElement:t;if(ar.call(s,"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=ri(t);if(u&&!u.shadowRoot&&i(u)===!0)return id(t);t.assignedSlot?t=t.assignedSlot:!u&&f!==t.ownerDocument?t=f.host:t=u}t=l}if(_S(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return id(t);return!1},NS=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 ar.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},LS=function(t,n){return!(n.disabled||sr(n)||AS(n)||PS(n,t)||IS(n)||NS(n))},od=function(t,n){return!(MS(n)||nd(n)<0||!LS(t,n))},FS=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},ad=function(t){var n=[],r=[];return t.forEach(function(i,o){var a=!!i.scopeParent,s=a?i.scopeParent:i,l=ES(s,a),u=a?ad(i.candidates):s;l===0?a?n.push.apply(n,u):n.push(s):r.push({documentOrder:o,tabIndex:l,item:i,isScope:a,content:u})}),r.sort(CS).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},Aa=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Ca([t],n.includeContainer,{filter:od.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:FS}):r=SS(t,n.includeContainer,od.bind(null,n)),ad(r)};const Ia="ArrowUp",ii="ArrowDown",mn="ArrowLeft",lr="ArrowRight";function oi(e,t,n){return Math.floor(e/t)!==n}function ur(e,t){return t<0||t>=e.current.length}function Ta(e,t){return Ve(e,{disabledIndices:t})}function sd(e,t){return Ve(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Ve(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:i,amount:o=1}=t===void 0?{}:t;const a=e.current;let s=n;do{var l,u;s=s+(r?-o:o)}while(s>=0&&s<=a.length-1&&(i?i.includes(s):a[s]==null||(l=a[s])!=null&&l.hasAttribute("disabled")||((u=a[s])==null?void 0:u.getAttribute("aria-disabled"))==="true"));return s}function RS(e,t){let{event:n,orientation:r,loop:i,cols:o,disabledIndices:a,minIndex:s,maxIndex:l,prevIndex:u,stopEvent:f=!1}=t,c=u;if(n.key===Ia){if(f&&je(n),u===-1)c=l;else if(c=Ve(e,{startingIndex:c,amount:o,decrement:!0,disabledIndices:a}),i&&(u-o<s||c<0)){const p=u%o,d=l%o,m=l-(d-p);d===p?c=l:c=d>p?m:m-o}ur(e,c)&&(c=u)}if(n.key===ii&&(f&&je(n),u===-1?c=s:(c=Ve(e,{startingIndex:u,amount:o,disabledIndices:a}),i&&u+o>l&&(c=Ve(e,{startingIndex:u%o-o,amount:o,disabledIndices:a}))),ur(e,c)&&(c=u)),r==="both"){const p=Af(u/o);n.key===lr&&(f&&je(n),u%o!==o-1?(c=Ve(e,{startingIndex:u,disabledIndices:a}),i&&oi(c,o,p)&&(c=Ve(e,{startingIndex:u-u%o-1,disabledIndices:a}))):i&&(c=Ve(e,{startingIndex:u-u%o-1,disabledIndices:a})),oi(c,o,p)&&(c=u)),n.key===mn&&(f&&je(n),u%o!==0?(c=Ve(e,{startingIndex:u,disabledIndices:a,decrement:!0}),i&&oi(c,o,p)&&(c=Ve(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:a}))):i&&(c=Ve(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:a})),oi(c,o,p)&&(c=u));const d=Af(l/o)===p;ur(e,c)&&(i&&d?c=n.key===mn?l:Ve(e,{startingIndex:u-u%o-1,disabledIndices:a}):c=u)}return c}let ld=0;function Ct(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(ld);const o=()=>e==null?void 0:e.focus({preventScroll:n});i?o():ld=requestAnimationFrame(o)}var Re=typeof document<"u"?_.useLayoutEffect:_.useEffect;function ai(){return ai=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},ai.apply(this,arguments)}let Oa=!1,BS=0;const ud=()=>"floating-ui-"+BS++;function zS(){const[e,t]=E.useState(()=>Oa?ud():void 0);return Re(()=>{e==null&&t(ud())},[]),E.useEffect(()=>{Oa||(Oa=!0)},[]),e}const Da=E.useId||zS;function $S(){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 jS=E.createContext(null),US=E.createContext(null),cd=()=>{var e;return((e=E.useContext(jS))==null?void 0:e.id)||null},si=()=>E.useContext(US);function cr(e){return"data-floating-ui-"+e}function Ft(e){const t=_.useRef(e);return Re(()=>{t.current=e}),t}function HS(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(a=>a.id===i);i=o==null?void 0:o.parentId,o&&(r=r.concat(o))}return r}function gn(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(a=>{var s;return i.parentId===a.id&&((s=i.context)==null?void 0:s.open)})}),n=n.concat(r);return n}function WS(e,t){let n,r=-1;function i(o,a){a>r&&(n=o,r=a),gn(e,o).forEach(l=>{i(l.id,a+1)})}return i(t,0),e.find(o=>o.id===n)}let yn=new WeakMap,li=new WeakSet,ui={},Ma=0;const VS=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,fd=e=>e&&(e.host||fd(e.parentNode)),qS=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=fd(n);return e.contains(r)?r:null}).filter(n=>n!=null);function KS(e,t,n,r){const i="data-floating-ui-inert",o=r?"inert":n?"aria-hidden":null,a=qS(t,e),s=new Set,l=new Set(a),u=[];ui[i]||(ui[i]=new WeakMap);const f=ui[i];a.forEach(c),p(t),s.clear();function c(d){!d||s.has(d)||(s.add(d),d.parentNode&&c(d.parentNode))}function p(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,m=>{if(s.has(m))p(m);else{const h=o?m.getAttribute(o):null,g=h!==null&&h!=="false",y=(yn.get(m)||0)+1,v=(f.get(m)||0)+1;yn.set(m,y),f.set(m,v),u.push(m),y===1&&g&&li.add(m),v===1&&m.setAttribute(i,""),!g&&o&&m.setAttribute(o,"true")}})}return Ma++,()=>{u.forEach(d=>{const m=(yn.get(d)||0)-1,h=(f.get(d)||0)-1;yn.set(d,m),f.set(d,h),m||(!li.has(d)&&o&&d.removeAttribute(o),li.delete(d)),h||d.removeAttribute(i)}),Ma--,Ma||(yn=new WeakMap,yn=new WeakMap,li=new WeakSet,ui={})}}function dd(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=ft(e[0]).body;return KS(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const _a=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function pd(e,t){const n=Aa(e,_a());t==="prev"&&n.reverse();const r=n.indexOf(Pt(ft(e)));return n.slice(r+1)[0]}function hd(){return pd(document.body,"next")}function md(){return pd(document.body,"prev")}function fr(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Ze(n,r)}function YS(e){Aa(e,_a()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function GS(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 Pa={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 QS;function gd(e){e.key==="Tab"&&(e.target,clearTimeout(QS))}const ci=E.forwardRef(function(t,n){const[r,i]=E.useState();Re(()=>(_f()&&i("button"),document.addEventListener("keydown",gd),()=>{document.removeEventListener("keydown",gd)}),[]);const o={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[cr("focus-guard")]:"",style:Pa};return E.createElement("span",ai({},t,o))}),yd=E.createContext(null);function JS(e){let{id:t,root:n}=e===void 0?{}:e;const[r,i]=E.useState(null),o=Da(),a=vd(),s=E.useMemo(()=>({id:t,root:n,portalContext:a,uniqueId:o}),[t,n,a,o]),l=E.useRef();return Re(()=>()=>{r==null||r.remove()},[r,s]),Re(()=>{if(l.current===s)return;l.current=s;const{id:u,root:f,portalContext:c,uniqueId:p}=s,d=u?document.getElementById(u):null,m=cr("portal");if(d){const h=document.createElement("div");h.id=p,h.setAttribute(m,""),d.appendChild(h),i(h)}else{let h=f||(c==null?void 0:c.portalNode);h&&!at(h)&&(h=h.current),h=h||document.body;let g=null;u&&(g=document.createElement("div"),g.id=u,h.appendChild(g));const y=document.createElement("div");y.id=p,y.setAttribute(m,""),h=g||h,h.appendChild(y),i(y)}},[s]),r}function ZS(e){let{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e;const o=JS({id:n,root:r}),[a,s]=E.useState(null),l=E.useRef(null),u=E.useRef(null),f=E.useRef(null),c=E.useRef(null),p=!!a&&!a.modal&&a.open&&i&&!!(r||o);return E.useEffect(()=>{if(!o||!i||a!=null&&a.modal)return;function d(m){o&&fr(m)&&(m.type==="focusin"?GS:YS)(o)}return o.addEventListener("focusin",d,!0),o.addEventListener("focusout",d,!0),()=>{o.removeEventListener("focusin",d,!0),o.removeEventListener("focusout",d,!0)}},[o,i,a==null?void 0:a.modal]),E.createElement(yd.Provider,{value:E.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:f,afterInsideRef:c,portalNode:o,setFocusManagerState:s}),[i,o])},p&&o&&E.createElement(ci,{"data-type":"outside",ref:l,onFocus:d=>{if(fr(d,o)){var m;(m=f.current)==null||m.focus()}else{const h=md()||(a==null?void 0:a.refs.domReference.current);h==null||h.focus()}}}),p&&o&&E.createElement("span",{"aria-owns":o.id,style:Pa}),o&&Ps.createPortal(t,o),p&&o&&E.createElement(ci,{"data-type":"outside",ref:u,onFocus:d=>{if(fr(d,o)){var m;(m=c.current)==null||m.focus()}else{const h=hd()||(a==null?void 0:a.refs.domReference.current);h==null||h.focus(),a!=null&&a.closeOnFocusOut&&(a==null||a.onOpenChange(!1,d.nativeEvent))}}}))}const vd=()=>E.useContext(yd),XS=E.forwardRef(function(t,n){return E.createElement("button",ai({},t,{type:"button",ref:n,tabIndex:-1,style:Pa}))});function eE(e){const{context:t,children:n,disabled:r=!1,order:i=["content"],guards:o=!0,initialFocus:a=0,returnFocus:s=!0,modal:l=!0,visuallyHiddenDismiss:u=!1,closeOnFocusOut:f=!0}=e,{open:c,refs:p,nodeId:d,onOpenChange:m,events:h,dataRef:g,elements:{domReference:y,floating:v}}=t,w=VS()?o:!0,A=Ft(i),k=Ft(a),C=Ft(s),T=si(),P=vd(),F=typeof a=="number"&&a<0,I=E.useRef(null),O=E.useRef(null),j=E.useRef(!1),z=E.useRef(null),M=E.useRef(!1),D=P!=null,B=y&&y.getAttribute("role")==="combobox"&&Lf(y)&&F,U=E.useCallback(function(N){return N===void 0&&(N=v),N?Aa(N,_a()):[]},[v]),$=E.useCallback(N=>{const H=U(N);return A.current.map(x=>y&&x==="reference"?y:v&&x==="floating"?v:H).filter(Boolean).flat()},[y,v,A,U]);E.useEffect(()=>{if(r||!l)return;function N(x){if(x.key==="Tab"){Ze(v,Pt(ft(v)))&&U().length===0&&!B&&je(x);const W=$(),ee=Nf(x);A.current[0]==="reference"&&ee===y&&(je(x),x.shiftKey?Ct(W[W.length-1]):Ct(W[1])),A.current[1]==="floating"&&ee===v&&x.shiftKey&&(je(x),Ct(W[0]))}}const H=ft(v);return H.addEventListener("keydown",N),()=>{H.removeEventListener("keydown",N)}},[r,y,v,l,A,p,B,U,$]),E.useEffect(()=>{if(r||!f)return;function N(){M.current=!0,setTimeout(()=>{M.current=!1})}function H(x){const W=x.relatedTarget;queueMicrotask(()=>{const ee=!(Ze(y,W)||Ze(v,W)||Ze(W,v)||Ze(P==null?void 0:P.portalNode,W)||W!=null&&W.hasAttribute(cr("focus-guard"))||T&&(gn(T.nodesRef.current,d).find(Y=>{var J,X;return Ze((J=Y.context)==null?void 0:J.elements.floating,W)||Ze((X=Y.context)==null?void 0:X.elements.domReference,W)})||HS(T.nodesRef.current,d).find(Y=>{var J,X;return((J=Y.context)==null?void 0:J.elements.floating)===W||((X=Y.context)==null?void 0:X.elements.domReference)===W})));W&&ee&&!M.current&&W!==z.current&&(j.current=!0,m(!1,x))})}if(v&&cn(y))return y.addEventListener("focusout",H),y.addEventListener("pointerdown",N),!l&&v.addEventListener("focusout",H),()=>{y.removeEventListener("focusout",H),y.removeEventListener("pointerdown",N),!l&&v.removeEventListener("focusout",H)}},[r,y,v,l,d,T,P,m,f]),E.useEffect(()=>{var N;if(r)return;const H=Array.from((P==null||(N=P.portalNode)==null?void 0:N.querySelectorAll("["+cr("portal")+"]"))||[]);if(v){const x=[v,...H,I.current,O.current,A.current.includes("reference")||B?y:null].filter(ee=>ee!=null),W=l?dd(x,w,!w):dd(x);return()=>{W()}}},[r,y,v,l,A,P,B,w]),Re(()=>{if(r||!v)return;const N=ft(v),H=Pt(N);queueMicrotask(()=>{const x=$(v),W=k.current,ee=(typeof W=="number"?x[W]:W.current)||v,Y=Ze(v,H);!F&&!Y&&c&&Ct(ee,{preventScroll:ee===v})})},[r,c,v,F,$,k]),Re(()=>{if(r||!v)return;let N=!1;const H=ft(v),x=Pt(H),W=g.current;z.current=x;function ee(Y){if(Y.type==="escapeKey"&&p.domReference.current&&(z.current=p.domReference.current),["referencePress","escapeKey"].includes(Y.type))return;const J=Y.data.returnFocus;typeof J=="object"?(j.current=!1,N=J.preventScroll):j.current=!J}return h.on("dismiss",ee),()=>{h.off("dismiss",ee);const Y=Pt(H);(Ze(v,Y)||T&&gn(T.nodesRef.current,d).some(X=>{var ie;return Ze((ie=X.context)==null?void 0:ie.elements.floating,Y)})||W.openEvent&&["click","mousedown"].includes(W.openEvent.type))&&p.domReference.current&&(z.current=p.domReference.current),C.current&&cn(z.current)&&!j.current&&Ct(z.current,{cancelPrevious:!1,preventScroll:N})}},[r,v,C,g,p,h,T,d]),Re(()=>{if(!(r||!P))return P.setFocusManagerState({modal:l,closeOnFocusOut:f,open:c,onOpenChange:m,refs:p}),()=>{P.setFocusManagerState(null)}},[r,P,l,c,m,p,f]),Re(()=>{if(!r&&v&&typeof MutationObserver=="function"&&!F){const N=()=>{const x=v.getAttribute("tabindex");A.current.includes("floating")||Pt(ft(v))!==p.domReference.current&&U().length===0?x!=="0"&&v.setAttribute("tabindex","0"):x!=="-1"&&v.setAttribute("tabindex","-1")};N();const H=new MutationObserver(N);return H.observe(v,{childList:!0,subtree:!0,attributes:!0}),()=>{H.disconnect()}}},[r,v,p,A,U,F]);function V(N){return r||!u||!l?null:E.createElement(XS,{ref:N==="start"?I:O,onClick:H=>m(!1,H.nativeEvent)},typeof u=="string"?u:"Dismiss")}const b=!r&&w&&!B&&(D||l);return E.createElement(E.Fragment,null,b&&E.createElement(ci,{"data-type":"inside",ref:P==null?void 0:P.beforeInsideRef,onFocus:N=>{if(l){const x=$();Ct(i[0]==="reference"?x[0]:x[x.length-1])}else if(P!=null&&P.preserveTabOrder&&P.portalNode)if(j.current=!1,fr(N,P.portalNode)){const x=hd()||y;x==null||x.focus()}else{var H;(H=P.beforeOutsideRef.current)==null||H.focus()}}}),!B&&V("start"),n,V("end"),b&&E.createElement(ci,{"data-type":"inside",ref:P==null?void 0:P.afterInsideRef,onFocus:N=>{if(l)Ct($()[0]);else if(P!=null&&P.preserveTabOrder&&P.portalNode)if(f&&(j.current=!0),fr(N,P.portalNode)){const x=md()||y;x==null||x.focus()}else{var H;(H=P.afterOutsideRef.current)==null||H.focus()}}}))}function bd(e){return cn(e.target)&&e.target.tagName==="BUTTON"}function wd(e){return Lf(e)}function tE(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:i,elements:{domReference:o}}=e,{enabled:a=!0,event:s="click",toggle:l=!0,ignoreMouse:u=!1,keyboardHandlers:f=!0}=t,c=E.useRef(),p=E.useRef(!1);return E.useMemo(()=>a?{reference:{onPointerDown(d){c.current=d.pointerType},onMouseDown(d){d.button===0&&(Pf(c.current)&&u||s!=="click"&&(n&&l&&(!i.current.openEvent||i.current.openEvent.type==="mousedown")?r(!1,d.nativeEvent):(d.preventDefault(),r(!0,d.nativeEvent))))},onClick(d){if(s==="mousedown"&&c.current){c.current=void 0;return}Pf(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||bd(d))&&(d.key===" "&&!wd(o)&&(d.preventDefault(),p.current=!0),d.key==="Enter"&&r(!(n&&l),d.nativeEvent))},onKeyUp(d){d.defaultPrevented||!f||bd(d)||wd(o)||d.key===" "&&p.current&&(p.current=!1,r(!(n&&l),d.nativeEvent))}}}:{},[a,i,s,u,f,o,l,n,r])}const nE=E.useInsertionEffect||(e=>e());function Rt(e){const t=E.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return nE(()=>{t.current=e}),E.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 rE={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},iE={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},oE=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 aE(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:i,nodeId:o,elements:{reference:a,domReference:s,floating:l},dataRef:u}=e,{enabled:f=!0,escapeKey:c=!0,outsidePress:p=!0,outsidePressEvent:d="pointerdown",referencePress:m=!1,referencePressEvent:h="pointerdown",ancestorScroll:g=!1,bubbles:y}=t,v=si(),w=cd()!=null,A=Rt(typeof p=="function"?p:()=>!1),k=typeof p=="function"?A:p,C=E.useRef(!1),{escapeKeyBubbles:T,outsidePressBubbles:P}=oE(y),F=Rt(O=>{if(!n||!f||!c||O.key!=="Escape")return;const j=v?gn(v.nodesRef.current,o):[];if(!T&&(O.stopPropagation(),j.length>0)){let z=!0;if(j.forEach(M=>{var D;if((D=M.context)!=null&&D.open&&!M.context.dataRef.current.__escapeKeyBubbles){z=!1;return}}),!z)return}i.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),r(!1,Ck(O)?O.nativeEvent:O)}),I=Rt(O=>{const j=C.current;if(C.current=!1,j||typeof k=="function"&&!k(O))return;const z=Nf(O),M="["+cr("inert")+"]",D=ft(l).querySelectorAll(M);let B=at(z)?z:null;for(;B&&!wk(B);){const V=kk(B);if(V===ft(l).body||!at(V))break;B=V}if(D.length&&at(z)&&!Ak(z)&&!Ze(z,l)&&Array.from(D).every(V=>!Ze(B,V)))return;if(cn(z)&&l){const V=z.clientWidth>0&&z.scrollWidth>z.clientWidth,b=z.clientHeight>0&&z.scrollHeight>z.clientHeight;let N=b&&O.offsetX>z.clientWidth;if(b&&xk(z).direction==="rtl"&&(N=O.offsetX<=z.offsetWidth-z.clientWidth),N||V&&O.offsetY>z.clientHeight)return}const U=v&&gn(v.nodesRef.current,o).some(V=>{var b;return ga(O,(b=V.context)==null?void 0:b.elements.floating)});if(ga(O,l)||ga(O,s)||U)return;const $=v?gn(v.nodesRef.current,o):[];if($.length>0){let V=!0;if($.forEach(b=>{var N;if((N=b.context)!=null&&N.open&&!b.context.dataRef.current.__outsidePressBubbles){V=!1;return}}),!V)return}i.emit("dismiss",{type:"outsidePress",data:{returnFocus:w?{preventScroll:!0}:Df(O)||Mf(O)}}),r(!1,O)});return E.useEffect(()=>{if(!n||!f)return;u.current.__escapeKeyBubbles=T,u.current.__outsidePressBubbles=P;function O(M){r(!1,M)}const j=ft(l);c&&j.addEventListener("keydown",F),k&&j.addEventListener(d,I);let z=[];return g&&(at(s)&&(z=Lt(s)),at(l)&&(z=z.concat(Lt(l))),!at(a)&&a&&a.contextElement&&(z=z.concat(Lt(a.contextElement)))),z=z.filter(M=>{var D;return M!==((D=j.defaultView)==null?void 0:D.visualViewport)}),z.forEach(M=>{M.addEventListener("scroll",O,{passive:!0})}),()=>{c&&j.removeEventListener("keydown",F),k&&j.removeEventListener(d,I),z.forEach(M=>{M.removeEventListener("scroll",O)})}},[u,l,s,a,c,k,d,n,r,g,f,T,P,F,I]),E.useEffect(()=>{C.current=!1},[k,d]),E.useMemo(()=>f?{reference:{onKeyDown:F,[rE[h]]:O=>{m&&(i.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),r(!1,O.nativeEvent))}},floating:{onKeyDown:F,[iE[d]]:()=>{C.current=!0}}}:{},[f,i,m,d,h,r,F])}let Na;process.env.NODE_ENV!=="production"&&(Na=new Set);function sE(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 T="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&&!at(e.elements.reference)){var a;if(!((a=Na)!=null&&a.has(T))){var s;(s=Na)==null||s.add(T),console.error(T)}}}const[l,u]=E.useState(null),f=((t=e.elements)==null?void 0:t.reference)||l,c=yS(e),p=si(),d=Rt((T,P)=>{T&&(h.current.openEvent=P),r==null||r(T,P)}),m=E.useRef(null),h=E.useRef({}),g=E.useState(()=>$S())[0],y=Da(),v=E.useCallback(T=>{const P=at(T)?{getBoundingClientRect:()=>T.getBoundingClientRect(),contextElement:T}:T;c.refs.setReference(P)},[c.refs]),w=E.useCallback(T=>{(at(T)||T===null)&&(m.current=T,u(T)),(at(c.refs.reference.current)||c.refs.reference.current===null||T!==null&&!at(T))&&c.refs.setReference(T)},[c.refs]),A=E.useMemo(()=>({...c.refs,setReference:w,setPositionReference:v,domReference:m}),[c.refs,w,v]),k=E.useMemo(()=>({...c.elements,domReference:f}),[c.elements,f]),C=E.useMemo(()=>({...c,refs:A,elements:k,dataRef:h,nodeId:i,floatingId:y,events:g,open:n,onOpenChange:d}),[c,i,y,g,n,d,A,k]);return Re(()=>{const T=p==null?void 0:p.nodesRef.current.find(P=>P.id===i);T&&(T.context=C)}),E.useMemo(()=>({...c,context:C,refs:A,elements:k}),[c,A,k,C])}function La(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(a=>{let[s,l]=a;if(s.indexOf("on")===0){if(r.has(s)||r.set(s,[]),typeof l=="function"){var u;(u=r.get(s))==null||u.push(l),i[s]=function(){for(var f,c=arguments.length,p=new Array(c),d=0;d<c;d++)p[d]=arguments[d];return(f=r.get(s))==null?void 0:f.map(m=>m(...p)).find(m=>m!==void 0)}}}else i[s]=l}),i),{})}}function lE(e){e===void 0&&(e=[]);const t=e,n=E.useCallback(o=>La(o,e,"reference"),t),r=E.useCallback(o=>La(o,e,"floating"),t),i=E.useCallback(o=>La(o,e,"item"),e.map(o=>o==null?void 0:o.item));return E.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:i}),[n,r,i])}let xd=!1;function fi(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function kd(e,t){return fi(t,e===Ia||e===ii,e===mn||e===lr)}function Fa(e,t,n){return fi(t,e===ii,n?e===mn:e===lr)||e==="Enter"||e==" "||e===""}function uE(e,t,n){return fi(t,n?e===mn:e===lr,e===ii)}function Sd(e,t,n){return fi(t,n?e===lr:e===mn,e===Ia)}function cE(e,t){const{open:n,onOpenChange:r,refs:i,elements:{domReference:o,floating:a}}=e,{listRef:s,activeIndex:l,onNavigate:u=()=>{},enabled:f=!0,selectedIndex:c=null,allowEscape:p=!1,loop:d=!1,nested:m=!1,rtl:h=!1,virtual:g=!1,focusItemOnOpen:y="auto",focusItemOnHover:v=!0,openOnArrowKeyDown:w=!0,disabledIndices:A=void 0,orientation:k="vertical",cols:C=1,scrollItemIntoView:T=!0,virtualItemRef:P}=t;process.env.NODE_ENV!=="production"&&(p&&(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"&&C>1&&console.warn(["Floating UI: In grid list navigation mode (`cols` > 1), the",'`orientation` should be either "horizontal" or "both".'].join(" ")));const F=cd(),I=si(),O=Rt(u),j=E.useRef(y),z=E.useRef(c??-1),M=E.useRef(null),D=E.useRef(!0),B=E.useRef(O),U=E.useRef(!!a),$=E.useRef(!1),V=E.useRef(!1),b=Ft(A),N=Ft(n),H=Ft(T),[x,W]=E.useState(),[ee,Y]=E.useState(),J=Rt(function(K,te,L){L===void 0&&(L=!1);const ne=K.current[te.current];ne&&(g?(W(ne.id),I==null||I.events.emit("virtualfocus",ne),P&&(P.current=ne)):Ct(ne,{preventScroll:!0,sync:Ek()&&_f()?xd||$.current:!1}),requestAnimationFrame(()=>{const me=H.current;me&&ne&&(L||!D.current)&&(ne.scrollIntoView==null||ne.scrollIntoView(typeof me=="boolean"?{block:"nearest",inline:"nearest"}:me))}))});Re(()=>{document.createElement("div").focus({get preventScroll(){return xd=!0,!1}})},[]),Re(()=>{f&&(n&&a?j.current&&c!=null&&(V.current=!0,O(c)):U.current&&(z.current=-1,B.current(null)))},[f,n,a,c,O]),Re(()=>{if(f&&n&&a)if(l==null){if($.current=!1,c!=null)return;if(U.current&&(z.current=-1,J(s,z)),!U.current&&j.current&&(M.current!=null||j.current===!0&&M.current==null)){let K=0;const te=()=>{s.current[0]==null?(K<2&&(K?requestAnimationFrame:queueMicrotask)(te),K++):(z.current=M.current==null||Fa(M.current,k,h)||m?Ta(s,b.current):sd(s,b.current),M.current=null,O(z.current))};te()}}else ur(s,l)||(z.current=l,J(s,z,V.current),V.current=!1)},[f,n,a,l,c,m,s,k,h,O,J,b]),Re(()=>{var K,te;if(!f||a||!I||g||!U.current)return;const L=I.nodesRef.current,ne=(K=L.find(oe=>oe.id===F))==null||(te=K.context)==null?void 0:te.elements.floating,me=Pt(ft(a)),ke=L.some(oe=>oe.context&&Ze(oe.context.elements.floating,me));ne&&!ke&&D.current&&ne.focus({preventScroll:!0})},[f,a,I,F,g]),Re(()=>{if(!f||!I||!g||F)return;function K(te){Y(te.id),P&&(P.current=te)}return I.events.on("virtualfocus",K),()=>{I.events.off("virtualfocus",K)}},[f,I,g,F,P]),Re(()=>{B.current=O,U.current=!!a}),Re(()=>{n||(M.current=null)},[n]);const X=l!=null,ie=E.useMemo(()=>{function K(L){if(!n)return;const ne=s.current.indexOf(L);ne!==-1&&O(ne)}return{onFocus(L){let{currentTarget:ne}=L;K(ne)},onClick:L=>{let{currentTarget:ne}=L;return ne.focus({preventScroll:!0})},...v&&{onMouseMove(L){let{currentTarget:ne}=L;K(ne)},onPointerLeave(L){let{pointerType:ne}=L;!D.current||ne==="touch"||(z.current=-1,J(s,z),O(null),g||Ct(i.floating.current,{preventScroll:!0}))}}}},[n,i,J,v,s,O,g]);return E.useMemo(()=>{if(!f)return{};const K=b.current;function te(oe){if(D.current=!1,$.current=!0,!N.current&&oe.currentTarget===i.floating.current)return;if(m&&Sd(oe.key,k,h)){je(oe),r(!1,oe.nativeEvent),cn(o)&&!g&&o.focus();return}const G=z.current,ue=Ta(s,K),de=sd(s,K);if(oe.key==="Home"&&(je(oe),z.current=ue,O(z.current)),oe.key==="End"&&(je(oe),z.current=de,O(z.current)),!(C>1&&(z.current=RS(s,{event:oe,orientation:k,loop:d,cols:C,disabledIndices:K,minIndex:ue,maxIndex:de,prevIndex:z.current,stopEvent:!0}),O(z.current),k==="both"))&&kd(oe.key,k)){if(je(oe),n&&!g&&Pt(oe.currentTarget.ownerDocument)===oe.currentTarget){z.current=Fa(oe.key,k,h)?ue:de,O(z.current);return}Fa(oe.key,k,h)?d?z.current=G>=de?p&&G!==s.current.length?-1:ue:Ve(s,{startingIndex:G,disabledIndices:K}):z.current=Math.min(de,Ve(s,{startingIndex:G,disabledIndices:K})):d?z.current=G<=ue?p&&G!==-1?s.current.length:de:Ve(s,{startingIndex:G,decrement:!0,disabledIndices:K}):z.current=Math.max(ue,Ve(s,{startingIndex:G,decrement:!0,disabledIndices:K})),ur(s,z.current)?O(null):O(z.current)}}function L(oe){y==="auto"&&Df(oe.nativeEvent)&&(j.current=!0)}function ne(oe){j.current=y,y==="auto"&&Mf(oe.nativeEvent)&&(j.current=!0)}const me=g&&n&&X&&{"aria-activedescendant":ee||x},ke=s.current.find(oe=>(oe==null?void 0:oe.id)===x);return{reference:{...me,onKeyDown(oe){D.current=!1;const G=oe.key.indexOf("Arrow")===0,ue=uE(oe.key,k,h),de=Sd(oe.key,k,h),we=kd(oe.key,k),Se=(m?ue:we)||oe.key==="Enter"||oe.key.trim()==="";if(g&&n){const se=I==null?void 0:I.nodesRef.current.find(q=>q.parentId==null),R=I&&se?WS(I.nodesRef.current,se.id):null;if(G&&R&&P){const q=new KeyboardEvent("keydown",{key:oe.key,bubbles:!0});if(ue||de){var Ue,Ye;const ae=((Ue=R.context)==null?void 0:Ue.elements.domReference)===oe.currentTarget,le=de&&!ae?(Ye=R.context)==null?void 0:Ye.elements.domReference:ue?ke:null;le&&(je(oe),le.dispatchEvent(q),Y(void 0))}if(we&&R.context&&R.context.open&&R.parentId&&oe.currentTarget!==R.context.elements.domReference){var Z;je(oe),(Z=R.context.elements.domReference)==null||Z.dispatchEvent(q);return}}return te(oe)}if(!(!n&&!w&&G)){if(Se&&(M.current=m&&we?null:oe.key),m){ue&&(je(oe),n?(z.current=Ta(s,K),O(z.current)):r(!0,oe.nativeEvent));return}we&&(c!=null&&(z.current=c),je(oe),!n&&w?r(!0,oe.nativeEvent):te(oe),n&&O(z.current))}},onFocus(){n&&O(null)},onPointerDown:ne,onMouseDown:L,onClick:L},floating:{"aria-orientation":k==="both"?void 0:k,...me,onKeyDown:te,onPointerMove(){D.current=!0}},item:ie}},[o,i,x,ee,b,N,s,f,k,h,g,n,X,m,c,w,p,C,d,y,O,r,ie,I,P])}function fE(e,t){t===void 0&&(t={});const{open:n,floatingId:r}=e,{enabled:i=!0,role:o="dialog"}=t,a=Da();return E.useMemo(()=>{const s={id:r,role:o};return i?o==="tooltip"?{reference:{"aria-describedby":n?r:void 0},floating:s}:{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:a}},floating:{...s,...o==="menu"&&{"aria-labelledby":a}}}:{}},[i,o,n,r,a])}function dE(e,t){var n;const{open:r,dataRef:i}=e,{listRef:o,activeIndex:a,onMatch:s,onTypingChange:l,enabled:u=!0,findMatch:f=null,resetMs:c=750,ignoreKeys:p=[],selectedIndex:d=null}=t,m=E.useRef(),h=E.useRef(""),g=E.useRef((n=d??a)!=null?n:-1),y=E.useRef(null),v=Rt(s),w=Rt(l),A=Ft(f),k=Ft(p);return Re(()=>{r&&(clearTimeout(m.current),y.current=null,h.current="")},[r]),Re(()=>{if(r&&h.current===""){var C;g.current=(C=d??a)!=null?C:-1}},[r,d,a]),E.useMemo(()=>{if(!u)return{};function C(F){F?i.current.typing||(i.current.typing=F,w(F)):i.current.typing&&(i.current.typing=F,w(F))}function T(F,I,O){const j=A.current?A.current(I,O):I.find(z=>(z==null?void 0:z.toLocaleLowerCase().indexOf(O.toLocaleLowerCase()))===0);return j?F.indexOf(j):-1}function P(F){const I=o.current;if(h.current.length>0&&h.current[0]!==" "&&(T(I,I,h.current)===-1?C(!1):F.key===" "&&je(F)),I==null||k.current.includes(F.key)||F.key.length!==1||F.ctrlKey||F.metaKey||F.altKey)return;r&&F.key!==" "&&(je(F),C(!0)),I.every(M=>{var D,B;return M?((D=M[0])==null?void 0:D.toLocaleLowerCase())!==((B=M[1])==null?void 0:B.toLocaleLowerCase()):!0})&&h.current===F.key&&(h.current="",g.current=y.current),h.current+=F.key,clearTimeout(m.current),m.current=setTimeout(()=>{h.current="",g.current=y.current,C(!1)},c);const j=g.current,z=T(I,[...I.slice((j||0)+1),...I.slice(0,(j||0)+1)],h.current);z!==-1?(v(z),y.current=z):F.key!==" "&&(h.current="",C(!1))}return{reference:{onKeyDown:P},floating:{onKeyDown:P,onKeyUp(F){F.key===" "&&C(!1)}}}},[u,r,i,o,c,k,A,v,w])}const pE=({options:e,reusable:t,sendMessage:n,isReadOnly:r})=>{var D,B,U,$,V;const i=sn(b=>b.messageContainerRef),o=sn(b=>b.portalContainer),[a,s]=E.useState(!1),[l,u]=E.useState(null),[f,c]=E.useState(null),{message:{blocks:{dropdown:p}}}=ge,d=e.reduce((b,N)=>(b[N.label]=N.value,b),{}),m=d?Object.keys(d):[],h=b=>{s(f!==null&&!t?!1:b)},{refs:g,floatingStyles:y,context:v}=sE({placement:"bottom-start",open:a,onOpenChange:h,whileElementsMounted:cS,middleware:[vS(5),bS({padding:10,boundary:(i==null?void 0:i.current)??void 0,crossAxis:!0}),wS({apply({rects:b,elements:N,availableHeight:H}){Object.assign(N.floating.style,{maxHeight:`${H}px`,minWidth:`${b.reference.width}px`})},padding:10})]}),w=E.useRef([]),A=E.useRef(m),k=E.useRef(!1),C=tE(v,{event:"mousedown"}),T=aE(v),P=fE(v,{role:"listbox"}),F=cE(v,{listRef:w,activeIndex:l,selectedIndex:f,onNavigate:u,loop:!0}),I=dE(v,{listRef:A,activeIndex:l,selectedIndex:f,onMatch:a?u:c,onTypingChange(b){k.current=b}}),{getReferenceProps:O,getFloatingProps:j,getItemProps:z}=lE([T,P,F,I,C]),M=b=>{c(b),m[b]!==void 0&&(n==null||n({type:"text",text:m[b]??"",value:d[m[b]]??""})),s(!1)};return S.jsxs(S.Fragment,{children:[S.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,...(D=p.button)==null?void 0:D.container,...O(),children:[S.jsx("span",{...(B=p.button)==null?void 0:B.text,children:f?m[f]:"Select..."}),S.jsx(P0,{...(U=p.button)==null?void 0:U.icon})]}),a&&S.jsx(ZS,{root:o??void 0,children:S.jsx(eE,{context:v,modal:!1,children:S.jsx("div",{ref:g.setFloating,className:(V=($=p.content)==null?void 0:$.container)==null?void 0:V.className,style:{...y,pointerEvents:"auto"},...j(),children:m.map((b,N)=>{var H;return S.jsx("div",{ref:x=>{w.current[N]=x},role:"option",tabIndex:N===l?0:-1,"aria-selected":N===f&&N===l,"data-active":N===l?"":void 0,...(H=p.content)==null?void 0:H.item,...z({onClick(){M(N)},onKeyDown(x){x.key==="Enter"&&(x.preventDefault(),M(N)),x.key===" "&&!k.current&&(x.preventDefault(),M(N))}}),children:b},b)})})})})]})},Ed=_.forwardRef(({title:e,url:t,isReadOnly:n,...r},i)=>{const{message:{blocks:{file:o}}}=ge;return S.jsxs("a",{...r,...o.container,href:t,style:n?{pointerEvents:"none"}:void 0,download:!0,ref:i,target:"_blank",rel:"noreferrer",children:[S.jsx("p",{...o.title,children:e||t}),S.jsx(z0,{...o.icon})]})});Ed.displayName="File";const hE=_t()((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"}),s=await import(URL.createObjectURL(o)),l=()=>s.default;return e(u=>({components:{...u.components,[n]:l}})),l}}));globalThis.React=_;const Cd={audio:hf,bubble:lf,button:P1,carousel:Cf,column:gf,dropdown:pE,file:Ed,image:df,location:mf,row:yf,text:i1,video:pf,custom:({url:e,name:t,data:n,...r})=>{const i=hE(u=>u.getCustomComponent),[o,a]=_.useState(null),[s,l]=_.useState(null);return _.useEffect(()=>{i(e).then(a).catch(u=>{l(u.message)})},[e]),s?S.jsx("div",{style:{color:"red"},children:s}):o?S.jsx(o,{...n,...r}):null}},Yt=({block:e,renderers:t,...n})=>{const r=(t==null?void 0:t[e.type])??Cd[e.type],i={...n,...e};return S.jsx(r,{...i})};function Ad(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=Ad(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function dr(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Ad(e))&&(r&&(r+=" "),r+=t);return r}const mE=({disabled:e,onFileSelected:t})=>{const n=_.useRef(null),{uploadButton:r}=ge.composer,i=()=>{n.current&&n.current.click()},o=a=>{const s=a.target.files;s&&s.length>0&&Array.from(s).forEach(l=>{t(l)})};return S.jsxs(S.Fragment,{children:[S.jsx(Q0,{...r,role:"button",tabIndex:0,"aria-label":"Upload File Button","data-disabled":e,onClick:i}),S.jsx("input",{value:"",multiple:!0,type:"file",ref:n,style:{display:"none"},onChange:o})]})},gE=({name:e,type:t,instance:n,status:r,removeFile:i})=>{const{loader:o,fileIcon:a,removeIcon:s,errorIcon:l,previewImage:u}=ge.composer.fileWidget,f=["PNG","JPEG","JPG"].includes(pi(n.name));return r==="loading"?S.jsx(di,{name:e,status:r,removeButton:S.jsx("div",{...o}),extension:pi(n.name),children:S.jsx("div",{...a.container,children:S.jsx(Ra,{type:t,...a.icon})})}):r==="error"?S.jsx(di,{name:e,status:r,removeButton:S.jsx(Id,{removeFile:()=>i(e)}),extension:"Upload Error",children:S.jsxs("div",{...a.container,children:[S.jsx(F0,{...l}),S.jsx(Ra,{type:t,...a.icon})]})}):r=="uploaded"&&f?S.jsx(di,{name:e,status:r,removeButton:S.jsx(Id,{removeFile:()=>i(e)}),extension:pi(n.name),children:S.jsx("div",{...a.container,children:S.jsx("img",{src:URL.createObjectURL(n),alt:e,...u})})}):S.jsx(di,{name:e,status:r,removeButton:S.jsx(_c,{onClick:()=>i(e),...s}),extension:pi(n.name),children:S.jsx("div",{...a.container,children:S.jsx(Ra,{type:t,...a.icon})})})},di=({name:e,status:t,removeButton:n,children:r,extension:i})=>{const{container:o,metadata:a}=ge.composer.fileWidget;return S.jsxs("div",{"data-status":t,title:e,...o,children:[n,r,S.jsxs("div",{...a.container,children:[S.jsx("div",{...a.name,children:e}),S.jsx("div",{...a.type,children:i})]})]})},Ra=({type:e,...t})=>e==="image"?S.jsx(U0,{...t}):e==="video"?S.jsx(t1,{...t}):e==="audio"?S.jsx(Lc,{...t}):S.jsx(Pc,{...t}),pi=e=>{if(!e)return"File";const t=e.split(".").pop();return t?t.toUpperCase():"File"},Id=({removeFile:e})=>{const{composer:{fileWidget:{removeIcon:t}}}=ge;return S.jsx(_c,{role:"button",tabIndex:0,"aria-label":"Remove File Button",onClick:()=>e(),...t})};function Ba(){return Ba=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},Ba.apply(null,arguments)}function yE(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 vE=_.useLayoutEffect,bE=function(t){var n=_.useRef(t);return vE(function(){n.current=t}),n},Td=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},wE=function(t,n){var r=_.useRef();return _.useCallback(function(i){t.current=i,r.current&&Td(r.current,null),r.current=n,n&&Td(n,i)},[n])},Od={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},xE=function(t){Object.keys(Od).forEach(function(n){t.style.setProperty(n,Od[n],"important")})},Dd=xE,Ke=null,Md=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function kE(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),Ke||(Ke=document.createElement("textarea"),Ke.setAttribute("tabindex","-1"),Ke.setAttribute("aria-hidden","true"),Dd(Ke)),Ke.parentNode===null&&document.body.appendChild(Ke);var i=e.paddingSize,o=e.borderSize,a=e.sizingStyle,s=a.boxSizing;Object.keys(a).forEach(function(p){var d=p;Ke.style[d]=a[d]}),Dd(Ke),Ke.value=t;var l=Md(Ke,e);Ke.value=t,l=Md(Ke,e),Ke.value="x";var u=Ke.scrollHeight-i,f=u*n;s==="border-box"&&(f=f+i+o),l=Math.max(f,l);var c=u*r;return s==="border-box"&&(c=c+i+o),l=Math.min(c,l),[l,u]}var _d=function(){},SE=function(t,n){return t.reduce(function(r,i){return r[i]=n[i],r},{})},EE=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],CE=!!document.documentElement.currentStyle,AE=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=SE(EE,n),i=r.boxSizing;if(i==="")return null;CE&&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),a=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:o,borderSize:a}},IE=AE;function Pd(e,t,n){var r=bE(n);E.useLayoutEffect(function(){var i=function(a){return r.current(a)};if(e)return e.addEventListener(t,i),function(){return e.removeEventListener(t,i)}},[])}var TE=function(t){Pd(window,"resize",t)},OE=function(t){Pd(document.fonts,"loadingdone",t)},DE=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],ME=function(t,n){var r=t.cacheMeasurements,i=t.maxRows,o=t.minRows,a=t.onChange,s=a===void 0?_d:a,l=t.onHeightChange,u=l===void 0?_d:l,f=yE(t,DE),c=f.value!==void 0,p=E.useRef(null),d=wE(p,n),m=E.useRef(0),h=E.useRef(),g=function(){var w=p.current,A=r&&h.current?h.current:IE(w);if(A){h.current=A;var k=kE(A,w.value||w.placeholder||"x",o,i),C=k[0],T=k[1];m.current!==C&&(m.current=C,w.style.setProperty("height",C+"px","important"),u(C,{rowHeight:T}))}},y=function(w){c||g(),s(w)};return E.useLayoutEffect(g),TE(g),OE(g),E.createElement("textarea",Ba({},f,{onChange:y,ref:d}))},_E=E.forwardRef(ME);const PE=({inputRef:e,composerPlaceholder:t,composerDisabled:n,textInput:r,historyIndex:i,setTextInput:o,setHistoryIndex:a,sendComposerMessage:s,allowFileUpload:l,onFilePasted:u})=>{const f=qc(h=>h.messageHistory),[c,p]=_.useState(""),{input:d}=ge.composer,m=h=>{if(!l||!u||!h.clipboardData)return;const g=Array.from(h.clipboardData.files);g.length>0&&(h.preventDefault(),g.forEach(y=>{u(y)}))};return S.jsx(_E,{...d,"aria-label":"Message Input",ref:e,placeholder:t??"Type your message...",disabled:n,value:r,"data-has-value":!!r,onChange:h=>{const g=h.target.value;o(g),f.includes(g)||a(-1)},onPaste:m,maxRows:5,onKeyDown:h=>{if(n)return;const g=h.nativeEvent;if(!(g.isComposing||g.keyCode===229)&&(h.key==="Enter"&&h.shiftKey?(h.preventDefault(),o(`${r}
278
+ */var yS=["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])"],wa=yS.join(","),Qf=typeof Element>"u",rr=Qf?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ei=!Qf&&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},ir=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",a=o||n&&t&&ir(t.parentNode);return a},vS=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},bS=function(t,n,r){if(ir(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(wa));return n&&rr.call(t,wa)&&i.unshift(t),i=i.filter(r),i},xa=function(t,n,r){for(var i=[],o=Array.from(t);o.length;){var a=o.shift();if(!ir(a,!1))if(a.tagName==="SLOT"){var s=a.assignedElements(),l=s.length?s:a.children,u=xa(l,!0,r);r.flatten?i.push.apply(i,u):i.push({scopeParent:a,candidates:u})}else{var f=rr.call(a,wa);f&&r.filter(a)&&(n||!t.includes(a))&&i.push(a);var c=a.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(a),p=!ir(c,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(c&&p){var d=xa(c===!0?a.children:c.children,!0,r);r.flatten?i.push.apply(i,d):i.push({scopeParent:a,candidates:d})}else o.unshift.apply(o,a.children)}}return i},Jf=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Zf=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||vS(t))&&!Jf(t)?0:t.tabIndex},wS=function(t,n){var r=Zf(t);return r<0&&n&&!Jf(t)?0:r},xS=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Xf=function(t){return t.tagName==="INPUT"},kS=function(t){return Xf(t)&&t.type==="hidden"},SS=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},ES=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},CS=function(t){if(!t.name)return!0;var n=t.form||ei(t),r=function(s){return n.querySelectorAll('input[type="radio"][name="'+s+'"]')},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(a){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",a.message),!1}var o=ES(i,t.form);return!o||o===t},AS=function(t){return Xf(t)&&t.type==="radio"},IS=function(t){return AS(t)&&!CS(t)},TS=function(t){var n,r=t&&ei(t),i=(n=r)===null||n===void 0?void 0:n.host,o=!1;if(r&&r!==t){var a,s,l;for(o=!!((a=i)!==null&&a!==void 0&&(s=a.ownerDocument)!==null&&s!==void 0&&s.contains(i)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!o&&i;){var u,f,c;r=ei(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},ed=function(t){var n=t.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},OS=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 a=rr.call(t,"details>summary:first-of-type"),s=a?t.parentElement:t;if(rr.call(s,"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=ei(t);if(u&&!u.shadowRoot&&i(u)===!0)return ed(t);t.assignedSlot?t=t.assignedSlot:!u&&f!==t.ownerDocument?t=f.host:t=u}t=l}if(TS(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return ed(t);return!1},DS=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 rr.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},MS=function(t,n){return!(n.disabled||ir(n)||kS(n)||OS(n,t)||SS(n)||DS(n))},td=function(t,n){return!(IS(n)||Zf(n)<0||!MS(t,n))},_S=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},nd=function(t){var n=[],r=[];return t.forEach(function(i,o){var a=!!i.scopeParent,s=a?i.scopeParent:i,l=wS(s,a),u=a?nd(i.candidates):s;l===0?a?n.push.apply(n,u):n.push(s):r.push({documentOrder:o,tabIndex:l,item:i,isScope:a,content:u})}),r.sort(xS).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},ka=function(t,n){n=n||{};var r;return n.getShadowRoot?r=xa([t],n.includeContainer,{filter:td.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:_S}):r=bS(t,n.includeContainer,td.bind(null,n)),nd(r)};const Sa="ArrowUp",ti="ArrowDown",mn="ArrowLeft",or="ArrowRight";function ni(e,t,n){return Math.floor(e/t)!==n}function ar(e,t){return t<0||t>=e.current.length}function Ea(e,t){return qe(e,{disabledIndices:t})}function rd(e,t){return qe(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function qe(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:i,amount:o=1}=t===void 0?{}:t;const a=e.current;let s=n;do{var l,u;s=s+(r?-o:o)}while(s>=0&&s<=a.length-1&&(i?i.includes(s):a[s]==null||(l=a[s])!=null&&l.hasAttribute("disabled")||((u=a[s])==null?void 0:u.getAttribute("aria-disabled"))==="true"));return s}function PS(e,t){let{event:n,orientation:r,loop:i,cols:o,disabledIndices:a,minIndex:s,maxIndex:l,prevIndex:u,stopEvent:f=!1}=t,c=u;if(n.key===Sa){if(f&&Ue(n),u===-1)c=l;else if(c=qe(e,{startingIndex:c,amount:o,decrement:!0,disabledIndices:a}),i&&(u-o<s||c<0)){const p=u%o,d=l%o,m=l-(d-p);d===p?c=l:c=d>p?m:m-o}ar(e,c)&&(c=u)}if(n.key===ti&&(f&&Ue(n),u===-1?c=s:(c=qe(e,{startingIndex:u,amount:o,disabledIndices:a}),i&&u+o>l&&(c=qe(e,{startingIndex:u%o-o,amount:o,disabledIndices:a}))),ar(e,c)&&(c=u)),r==="both"){const p=kf(u/o);n.key===or&&(f&&Ue(n),u%o!==o-1?(c=qe(e,{startingIndex:u,disabledIndices:a}),i&&ni(c,o,p)&&(c=qe(e,{startingIndex:u-u%o-1,disabledIndices:a}))):i&&(c=qe(e,{startingIndex:u-u%o-1,disabledIndices:a})),ni(c,o,p)&&(c=u)),n.key===mn&&(f&&Ue(n),u%o!==0?(c=qe(e,{startingIndex:u,disabledIndices:a,decrement:!0}),i&&ni(c,o,p)&&(c=qe(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:a}))):i&&(c=qe(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:a})),ni(c,o,p)&&(c=u));const d=kf(l/o)===p;ar(e,c)&&(i&&d?c=n.key===mn?l:qe(e,{startingIndex:u-u%o-1,disabledIndices:a}):c=u)}return c}let id=0;function Ct(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(id);const o=()=>e==null?void 0:e.focus({preventScroll:n});i?o():id=requestAnimationFrame(o)}var Re=typeof document<"u"?N.useLayoutEffect:N.useEffect;function ri(){return ri=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},ri.apply(this,arguments)}let Ca=!1,NS=0;const od=()=>"floating-ui-"+NS++;function LS(){const[e,t]=E.useState(()=>Ca?od():void 0);return Re(()=>{e==null&&t(od())},[]),E.useEffect(()=>{Ca||(Ca=!0)},[]),e}const Aa=E.useId||LS;function FS(){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 RS=E.createContext(null),BS=E.createContext(null),ad=()=>{var e;return((e=E.useContext(RS))==null?void 0:e.id)||null},ii=()=>E.useContext(BS);function sr(e){return"data-floating-ui-"+e}function Ft(e){const t=N.useRef(e);return Re(()=>{t.current=e}),t}function zS(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(a=>a.id===i);i=o==null?void 0:o.parentId,o&&(r=r.concat(o))}return r}function gn(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(a=>{var s;return i.parentId===a.id&&((s=i.context)==null?void 0:s.open)})}),n=n.concat(r);return n}function $S(e,t){let n,r=-1;function i(o,a){a>r&&(n=o,r=a),gn(e,o).forEach(l=>{i(l.id,a+1)})}return i(t,0),e.find(o=>o.id===n)}let yn=new WeakMap,oi=new WeakSet,ai={},Ia=0;const jS=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,sd=e=>e&&(e.host||sd(e.parentNode)),US=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=sd(n);return e.contains(r)?r:null}).filter(n=>n!=null);function HS(e,t,n,r){const i="data-floating-ui-inert",o=r?"inert":n?"aria-hidden":null,a=US(t,e),s=new Set,l=new Set(a),u=[];ai[i]||(ai[i]=new WeakMap);const f=ai[i];a.forEach(c),p(t),s.clear();function c(d){!d||s.has(d)||(s.add(d),d.parentNode&&c(d.parentNode))}function p(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,m=>{if(s.has(m))p(m);else{const h=o?m.getAttribute(o):null,g=h!==null&&h!=="false",y=(yn.get(m)||0)+1,v=(f.get(m)||0)+1;yn.set(m,y),f.set(m,v),u.push(m),y===1&&g&&oi.add(m),v===1&&m.setAttribute(i,""),!g&&o&&m.setAttribute(o,"true")}})}return Ia++,()=>{u.forEach(d=>{const m=(yn.get(d)||0)-1,h=(f.get(d)||0)-1;yn.set(d,m),f.set(d,h),m||(!oi.has(d)&&o&&d.removeAttribute(o),oi.delete(d)),h||d.removeAttribute(i)}),Ia--,Ia||(yn=new WeakMap,yn=new WeakMap,oi=new WeakSet,ai={})}}function ld(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=ft(e[0]).body;return HS(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Ta=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ud(e,t){const n=ka(e,Ta());t==="prev"&&n.reverse();const r=n.indexOf(Pt(ft(e)));return n.slice(r+1)[0]}function cd(){return ud(document.body,"next")}function fd(){return ud(document.body,"prev")}function lr(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Xe(n,r)}function WS(e){ka(e,Ta()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function VS(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 Oa={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 qS;function dd(e){e.key==="Tab"&&(e.target,clearTimeout(qS))}const si=E.forwardRef(function(t,n){const[r,i]=E.useState();Re(()=>(Tf()&&i("button"),document.addEventListener("keydown",dd),()=>{document.removeEventListener("keydown",dd)}),[]);const o={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[sr("focus-guard")]:"",style:Oa};return E.createElement("span",ri({},t,o))}),pd=E.createContext(null);function KS(e){let{id:t,root:n}=e===void 0?{}:e;const[r,i]=E.useState(null),o=Aa(),a=hd(),s=E.useMemo(()=>({id:t,root:n,portalContext:a,uniqueId:o}),[t,n,a,o]),l=E.useRef();return Re(()=>()=>{r==null||r.remove()},[r,s]),Re(()=>{if(l.current===s)return;l.current=s;const{id:u,root:f,portalContext:c,uniqueId:p}=s,d=u?document.getElementById(u):null,m=sr("portal");if(d){const h=document.createElement("div");h.id=p,h.setAttribute(m,""),d.appendChild(h),i(h)}else{let h=f||(c==null?void 0:c.portalNode);h&&!st(h)&&(h=h.current),h=h||document.body;let g=null;u&&(g=document.createElement("div"),g.id=u,h.appendChild(g));const y=document.createElement("div");y.id=p,y.setAttribute(m,""),h=g||h,h.appendChild(y),i(y)}},[s]),r}function YS(e){let{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e;const o=KS({id:n,root:r}),[a,s]=E.useState(null),l=E.useRef(null),u=E.useRef(null),f=E.useRef(null),c=E.useRef(null),p=!!a&&!a.modal&&a.open&&i&&!!(r||o);return E.useEffect(()=>{if(!o||!i||a!=null&&a.modal)return;function d(m){o&&lr(m)&&(m.type==="focusin"?VS:WS)(o)}return o.addEventListener("focusin",d,!0),o.addEventListener("focusout",d,!0),()=>{o.removeEventListener("focusin",d,!0),o.removeEventListener("focusout",d,!0)}},[o,i,a==null?void 0:a.modal]),E.createElement(pd.Provider,{value:E.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:f,afterInsideRef:c,portalNode:o,setFocusManagerState:s}),[i,o])},p&&o&&E.createElement(si,{"data-type":"outside",ref:l,onFocus:d=>{if(lr(d,o)){var m;(m=f.current)==null||m.focus()}else{const h=fd()||(a==null?void 0:a.refs.domReference.current);h==null||h.focus()}}}),p&&o&&E.createElement("span",{"aria-owns":o.id,style:Oa}),o&&Os.createPortal(t,o),p&&o&&E.createElement(si,{"data-type":"outside",ref:u,onFocus:d=>{if(lr(d,o)){var m;(m=c.current)==null||m.focus()}else{const h=cd()||(a==null?void 0:a.refs.domReference.current);h==null||h.focus(),a!=null&&a.closeOnFocusOut&&(a==null||a.onOpenChange(!1,d.nativeEvent))}}}))}const hd=()=>E.useContext(pd),GS=E.forwardRef(function(t,n){return E.createElement("button",ri({},t,{type:"button",ref:n,tabIndex:-1,style:Oa}))});function QS(e){const{context:t,children:n,disabled:r=!1,order:i=["content"],guards:o=!0,initialFocus:a=0,returnFocus:s=!0,modal:l=!0,visuallyHiddenDismiss:u=!1,closeOnFocusOut:f=!0}=e,{open:c,refs:p,nodeId:d,onOpenChange:m,events:h,dataRef:g,elements:{domReference:y,floating:v}}=t,w=jS()?o:!0,A=Ft(i),k=Ft(a),C=Ft(s),T=ii(),_=hd(),F=typeof a=="number"&&a<0,I=E.useRef(null),O=E.useRef(null),j=E.useRef(!1),z=E.useRef(null),M=E.useRef(!1),D=_!=null,B=y&&y.getAttribute("role")==="combobox"&&Mf(y)&&F,U=E.useCallback(function(P){return P===void 0&&(P=v),P?ka(P,Ta()):[]},[v]),$=E.useCallback(P=>{const H=U(P);return A.current.map(x=>y&&x==="reference"?y:v&&x==="floating"?v:H).filter(Boolean).flat()},[y,v,A,U]);E.useEffect(()=>{if(r||!l)return;function P(x){if(x.key==="Tab"){Xe(v,Pt(ft(v)))&&U().length===0&&!B&&Ue(x);const V=$(),ee=Df(x);A.current[0]==="reference"&&ee===y&&(Ue(x),x.shiftKey?Ct(V[V.length-1]):Ct(V[1])),A.current[1]==="floating"&&ee===v&&x.shiftKey&&(Ue(x),Ct(V[0]))}}const H=ft(v);return H.addEventListener("keydown",P),()=>{H.removeEventListener("keydown",P)}},[r,y,v,l,A,p,B,U,$]),E.useEffect(()=>{if(r||!f)return;function P(){M.current=!0,setTimeout(()=>{M.current=!1})}function H(x){const V=x.relatedTarget;queueMicrotask(()=>{const ee=!(Xe(y,V)||Xe(v,V)||Xe(V,v)||Xe(_==null?void 0:_.portalNode,V)||V!=null&&V.hasAttribute(sr("focus-guard"))||T&&(gn(T.nodesRef.current,d).find(Y=>{var J,X;return Xe((J=Y.context)==null?void 0:J.elements.floating,V)||Xe((X=Y.context)==null?void 0:X.elements.domReference,V)})||zS(T.nodesRef.current,d).find(Y=>{var J,X;return((J=Y.context)==null?void 0:J.elements.floating)===V||((X=Y.context)==null?void 0:X.elements.domReference)===V})));V&&ee&&!M.current&&V!==z.current&&(j.current=!0,m(!1,x))})}if(v&&cn(y))return y.addEventListener("focusout",H),y.addEventListener("pointerdown",P),!l&&v.addEventListener("focusout",H),()=>{y.removeEventListener("focusout",H),y.removeEventListener("pointerdown",P),!l&&v.removeEventListener("focusout",H)}},[r,y,v,l,d,T,_,m,f]),E.useEffect(()=>{var P;if(r)return;const H=Array.from((_==null||(P=_.portalNode)==null?void 0:P.querySelectorAll("["+sr("portal")+"]"))||[]);if(v){const x=[v,...H,I.current,O.current,A.current.includes("reference")||B?y:null].filter(ee=>ee!=null),V=l?ld(x,w,!w):ld(x);return()=>{V()}}},[r,y,v,l,A,_,B,w]),Re(()=>{if(r||!v)return;const P=ft(v),H=Pt(P);queueMicrotask(()=>{const x=$(v),V=k.current,ee=(typeof V=="number"?x[V]:V.current)||v,Y=Xe(v,H);!F&&!Y&&c&&Ct(ee,{preventScroll:ee===v})})},[r,c,v,F,$,k]),Re(()=>{if(r||!v)return;let P=!1;const H=ft(v),x=Pt(H),V=g.current;z.current=x;function ee(Y){if(Y.type==="escapeKey"&&p.domReference.current&&(z.current=p.domReference.current),["referencePress","escapeKey"].includes(Y.type))return;const J=Y.data.returnFocus;typeof J=="object"?(j.current=!1,P=J.preventScroll):j.current=!J}return h.on("dismiss",ee),()=>{h.off("dismiss",ee);const Y=Pt(H);(Xe(v,Y)||T&&gn(T.nodesRef.current,d).some(X=>{var re;return Xe((re=X.context)==null?void 0:re.elements.floating,Y)})||V.openEvent&&["click","mousedown"].includes(V.openEvent.type))&&p.domReference.current&&(z.current=p.domReference.current),C.current&&cn(z.current)&&!j.current&&Ct(z.current,{cancelPrevious:!1,preventScroll:P})}},[r,v,C,g,p,h,T,d]),Re(()=>{if(!(r||!_))return _.setFocusManagerState({modal:l,closeOnFocusOut:f,open:c,onOpenChange:m,refs:p}),()=>{_.setFocusManagerState(null)}},[r,_,l,c,m,p,f]),Re(()=>{if(!r&&v&&typeof MutationObserver=="function"&&!F){const P=()=>{const x=v.getAttribute("tabindex");A.current.includes("floating")||Pt(ft(v))!==p.domReference.current&&U().length===0?x!=="0"&&v.setAttribute("tabindex","0"):x!=="-1"&&v.setAttribute("tabindex","-1")};P();const H=new MutationObserver(P);return H.observe(v,{childList:!0,subtree:!0,attributes:!0}),()=>{H.disconnect()}}},[r,v,p,A,U,F]);function W(P){return r||!u||!l?null:E.createElement(GS,{ref:P==="start"?I:O,onClick:H=>m(!1,H.nativeEvent)},typeof u=="string"?u:"Dismiss")}const b=!r&&w&&!B&&(D||l);return E.createElement(E.Fragment,null,b&&E.createElement(si,{"data-type":"inside",ref:_==null?void 0:_.beforeInsideRef,onFocus:P=>{if(l){const x=$();Ct(i[0]==="reference"?x[0]:x[x.length-1])}else if(_!=null&&_.preserveTabOrder&&_.portalNode)if(j.current=!1,lr(P,_.portalNode)){const x=cd()||y;x==null||x.focus()}else{var H;(H=_.beforeOutsideRef.current)==null||H.focus()}}}),!B&&W("start"),n,W("end"),b&&E.createElement(si,{"data-type":"inside",ref:_==null?void 0:_.afterInsideRef,onFocus:P=>{if(l)Ct($()[0]);else if(_!=null&&_.preserveTabOrder&&_.portalNode)if(f&&(j.current=!0),lr(P,_.portalNode)){const x=fd()||y;x==null||x.focus()}else{var H;(H=_.afterOutsideRef.current)==null||H.focus()}}}))}function md(e){return cn(e.target)&&e.target.tagName==="BUTTON"}function gd(e){return Mf(e)}function JS(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:i,elements:{domReference:o}}=e,{enabled:a=!0,event:s="click",toggle:l=!0,ignoreMouse:u=!1,keyboardHandlers:f=!0}=t,c=E.useRef(),p=E.useRef(!1);return E.useMemo(()=>a?{reference:{onPointerDown(d){c.current=d.pointerType},onMouseDown(d){d.button===0&&(Of(c.current)&&u||s!=="click"&&(n&&l&&(!i.current.openEvent||i.current.openEvent.type==="mousedown")?r(!1,d.nativeEvent):(d.preventDefault(),r(!0,d.nativeEvent))))},onClick(d){if(s==="mousedown"&&c.current){c.current=void 0;return}Of(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||md(d))&&(d.key===" "&&!gd(o)&&(d.preventDefault(),p.current=!0),d.key==="Enter"&&r(!(n&&l),d.nativeEvent))},onKeyUp(d){d.defaultPrevented||!f||md(d)||gd(o)||d.key===" "&&p.current&&(p.current=!1,r(!(n&&l),d.nativeEvent))}}}:{},[a,i,s,u,f,o,l,n,r])}const ZS=E.useInsertionEffect||(e=>e());function Rt(e){const t=E.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return ZS(()=>{t.current=e}),E.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 XS={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},eE={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},tE=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 nE(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:i,nodeId:o,elements:{reference:a,domReference:s,floating:l},dataRef:u}=e,{enabled:f=!0,escapeKey:c=!0,outsidePress:p=!0,outsidePressEvent:d="pointerdown",referencePress:m=!1,referencePressEvent:h="pointerdown",ancestorScroll:g=!1,bubbles:y}=t,v=ii(),w=ad()!=null,A=Rt(typeof p=="function"?p:()=>!1),k=typeof p=="function"?A:p,C=E.useRef(!1),{escapeKeyBubbles:T,outsidePressBubbles:_}=tE(y),F=Rt(O=>{if(!n||!f||!c||O.key!=="Escape")return;const j=v?gn(v.nodesRef.current,o):[];if(!T&&(O.stopPropagation(),j.length>0)){let z=!0;if(j.forEach(M=>{var D;if((D=M.context)!=null&&D.open&&!M.context.dataRef.current.__escapeKeyBubbles){z=!1;return}}),!z)return}i.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),r(!1,xk(O)?O.nativeEvent:O)}),I=Rt(O=>{const j=C.current;if(C.current=!1,j||typeof k=="function"&&!k(O))return;const z=Df(O),M="["+sr("inert")+"]",D=ft(l).querySelectorAll(M);let B=st(z)?z:null;for(;B&&!gk(B);){const W=vk(B);if(W===ft(l).body||!st(W))break;B=W}if(D.length&&st(z)&&!kk(z)&&!Xe(z,l)&&Array.from(D).every(W=>!Xe(B,W)))return;if(cn(z)&&l){const W=z.clientWidth>0&&z.scrollWidth>z.clientWidth,b=z.clientHeight>0&&z.scrollHeight>z.clientHeight;let P=b&&O.offsetX>z.clientWidth;if(b&&yk(z).direction==="rtl"&&(P=O.offsetX<=z.offsetWidth-z.clientWidth),P||W&&O.offsetY>z.clientHeight)return}const U=v&&gn(v.nodesRef.current,o).some(W=>{var b;return da(O,(b=W.context)==null?void 0:b.elements.floating)});if(da(O,l)||da(O,s)||U)return;const $=v?gn(v.nodesRef.current,o):[];if($.length>0){let W=!0;if($.forEach(b=>{var P;if((P=b.context)!=null&&P.open&&!b.context.dataRef.current.__outsidePressBubbles){W=!1;return}}),!W)return}i.emit("dismiss",{type:"outsidePress",data:{returnFocus:w?{preventScroll:!0}:Af(O)||If(O)}}),r(!1,O)});return E.useEffect(()=>{if(!n||!f)return;u.current.__escapeKeyBubbles=T,u.current.__outsidePressBubbles=_;function O(M){r(!1,M)}const j=ft(l);c&&j.addEventListener("keydown",F),k&&j.addEventListener(d,I);let z=[];return g&&(st(s)&&(z=Lt(s)),st(l)&&(z=z.concat(Lt(l))),!st(a)&&a&&a.contextElement&&(z=z.concat(Lt(a.contextElement)))),z=z.filter(M=>{var D;return M!==((D=j.defaultView)==null?void 0:D.visualViewport)}),z.forEach(M=>{M.addEventListener("scroll",O,{passive:!0})}),()=>{c&&j.removeEventListener("keydown",F),k&&j.removeEventListener(d,I),z.forEach(M=>{M.removeEventListener("scroll",O)})}},[u,l,s,a,c,k,d,n,r,g,f,T,_,F,I]),E.useEffect(()=>{C.current=!1},[k,d]),E.useMemo(()=>f?{reference:{onKeyDown:F,[XS[h]]:O=>{m&&(i.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),r(!1,O.nativeEvent))}},floating:{onKeyDown:F,[eE[d]]:()=>{C.current=!0}}}:{},[f,i,m,d,h,r,F])}let Da;process.env.NODE_ENV!=="production"&&(Da=new Set);function rE(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 T="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&&!st(e.elements.reference)){var a;if(!((a=Da)!=null&&a.has(T))){var s;(s=Da)==null||s.add(T),console.error(T)}}}const[l,u]=E.useState(null),f=((t=e.elements)==null?void 0:t.reference)||l,c=pS(e),p=ii(),d=Rt((T,_)=>{T&&(h.current.openEvent=_),r==null||r(T,_)}),m=E.useRef(null),h=E.useRef({}),g=E.useState(()=>FS())[0],y=Aa(),v=E.useCallback(T=>{const _=st(T)?{getBoundingClientRect:()=>T.getBoundingClientRect(),contextElement:T}:T;c.refs.setReference(_)},[c.refs]),w=E.useCallback(T=>{(st(T)||T===null)&&(m.current=T,u(T)),(st(c.refs.reference.current)||c.refs.reference.current===null||T!==null&&!st(T))&&c.refs.setReference(T)},[c.refs]),A=E.useMemo(()=>({...c.refs,setReference:w,setPositionReference:v,domReference:m}),[c.refs,w,v]),k=E.useMemo(()=>({...c.elements,domReference:f}),[c.elements,f]),C=E.useMemo(()=>({...c,refs:A,elements:k,dataRef:h,nodeId:i,floatingId:y,events:g,open:n,onOpenChange:d}),[c,i,y,g,n,d,A,k]);return Re(()=>{const T=p==null?void 0:p.nodesRef.current.find(_=>_.id===i);T&&(T.context=C)}),E.useMemo(()=>({...c,context:C,refs:A,elements:k}),[c,A,k,C])}function Ma(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(a=>{let[s,l]=a;if(s.indexOf("on")===0){if(r.has(s)||r.set(s,[]),typeof l=="function"){var u;(u=r.get(s))==null||u.push(l),i[s]=function(){for(var f,c=arguments.length,p=new Array(c),d=0;d<c;d++)p[d]=arguments[d];return(f=r.get(s))==null?void 0:f.map(m=>m(...p)).find(m=>m!==void 0)}}}else i[s]=l}),i),{})}}function iE(e){e===void 0&&(e=[]);const t=e,n=E.useCallback(o=>Ma(o,e,"reference"),t),r=E.useCallback(o=>Ma(o,e,"floating"),t),i=E.useCallback(o=>Ma(o,e,"item"),e.map(o=>o==null?void 0:o.item));return E.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:i}),[n,r,i])}let yd=!1;function li(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function vd(e,t){return li(t,e===Sa||e===ti,e===mn||e===or)}function _a(e,t,n){return li(t,e===ti,n?e===mn:e===or)||e==="Enter"||e==" "||e===""}function oE(e,t,n){return li(t,n?e===mn:e===or,e===ti)}function bd(e,t,n){return li(t,n?e===or:e===mn,e===Sa)}function aE(e,t){const{open:n,onOpenChange:r,refs:i,elements:{domReference:o,floating:a}}=e,{listRef:s,activeIndex:l,onNavigate:u=()=>{},enabled:f=!0,selectedIndex:c=null,allowEscape:p=!1,loop:d=!1,nested:m=!1,rtl:h=!1,virtual:g=!1,focusItemOnOpen:y="auto",focusItemOnHover:v=!0,openOnArrowKeyDown:w=!0,disabledIndices:A=void 0,orientation:k="vertical",cols:C=1,scrollItemIntoView:T=!0,virtualItemRef:_}=t;process.env.NODE_ENV!=="production"&&(p&&(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"&&C>1&&console.warn(["Floating UI: In grid list navigation mode (`cols` > 1), the",'`orientation` should be either "horizontal" or "both".'].join(" ")));const F=ad(),I=ii(),O=Rt(u),j=E.useRef(y),z=E.useRef(c??-1),M=E.useRef(null),D=E.useRef(!0),B=E.useRef(O),U=E.useRef(!!a),$=E.useRef(!1),W=E.useRef(!1),b=Ft(A),P=Ft(n),H=Ft(T),[x,V]=E.useState(),[ee,Y]=E.useState(),J=Rt(function(K,te,L){L===void 0&&(L=!1);const ne=K.current[te.current];ne&&(g?(V(ne.id),I==null||I.events.emit("virtualfocus",ne),_&&(_.current=ne)):Ct(ne,{preventScroll:!0,sync:wk()&&Tf()?yd||$.current:!1}),requestAnimationFrame(()=>{const me=H.current;me&&ne&&(L||!D.current)&&(ne.scrollIntoView==null||ne.scrollIntoView(typeof me=="boolean"?{block:"nearest",inline:"nearest"}:me))}))});Re(()=>{document.createElement("div").focus({get preventScroll(){return yd=!0,!1}})},[]),Re(()=>{f&&(n&&a?j.current&&c!=null&&(W.current=!0,O(c)):U.current&&(z.current=-1,B.current(null)))},[f,n,a,c,O]),Re(()=>{if(f&&n&&a)if(l==null){if($.current=!1,c!=null)return;if(U.current&&(z.current=-1,J(s,z)),!U.current&&j.current&&(M.current!=null||j.current===!0&&M.current==null)){let K=0;const te=()=>{s.current[0]==null?(K<2&&(K?requestAnimationFrame:queueMicrotask)(te),K++):(z.current=M.current==null||_a(M.current,k,h)||m?Ea(s,b.current):rd(s,b.current),M.current=null,O(z.current))};te()}}else ar(s,l)||(z.current=l,J(s,z,W.current),W.current=!1)},[f,n,a,l,c,m,s,k,h,O,J,b]),Re(()=>{var K,te;if(!f||a||!I||g||!U.current)return;const L=I.nodesRef.current,ne=(K=L.find(oe=>oe.id===F))==null||(te=K.context)==null?void 0:te.elements.floating,me=Pt(ft(a)),ke=L.some(oe=>oe.context&&Xe(oe.context.elements.floating,me));ne&&!ke&&D.current&&ne.focus({preventScroll:!0})},[f,a,I,F,g]),Re(()=>{if(!f||!I||!g||F)return;function K(te){Y(te.id),_&&(_.current=te)}return I.events.on("virtualfocus",K),()=>{I.events.off("virtualfocus",K)}},[f,I,g,F,_]),Re(()=>{B.current=O,U.current=!!a}),Re(()=>{n||(M.current=null)},[n]);const X=l!=null,re=E.useMemo(()=>{function K(L){if(!n)return;const ne=s.current.indexOf(L);ne!==-1&&O(ne)}return{onFocus(L){let{currentTarget:ne}=L;K(ne)},onClick:L=>{let{currentTarget:ne}=L;return ne.focus({preventScroll:!0})},...v&&{onMouseMove(L){let{currentTarget:ne}=L;K(ne)},onPointerLeave(L){let{pointerType:ne}=L;!D.current||ne==="touch"||(z.current=-1,J(s,z),O(null),g||Ct(i.floating.current,{preventScroll:!0}))}}}},[n,i,J,v,s,O,g]);return E.useMemo(()=>{if(!f)return{};const K=b.current;function te(oe){if(D.current=!1,$.current=!0,!P.current&&oe.currentTarget===i.floating.current)return;if(m&&bd(oe.key,k,h)){Ue(oe),r(!1,oe.nativeEvent),cn(o)&&!g&&o.focus();return}const G=z.current,ue=Ea(s,K),de=rd(s,K);if(oe.key==="Home"&&(Ue(oe),z.current=ue,O(z.current)),oe.key==="End"&&(Ue(oe),z.current=de,O(z.current)),!(C>1&&(z.current=PS(s,{event:oe,orientation:k,loop:d,cols:C,disabledIndices:K,minIndex:ue,maxIndex:de,prevIndex:z.current,stopEvent:!0}),O(z.current),k==="both"))&&vd(oe.key,k)){if(Ue(oe),n&&!g&&Pt(oe.currentTarget.ownerDocument)===oe.currentTarget){z.current=_a(oe.key,k,h)?ue:de,O(z.current);return}_a(oe.key,k,h)?d?z.current=G>=de?p&&G!==s.current.length?-1:ue:qe(s,{startingIndex:G,disabledIndices:K}):z.current=Math.min(de,qe(s,{startingIndex:G,disabledIndices:K})):d?z.current=G<=ue?p&&G!==-1?s.current.length:de:qe(s,{startingIndex:G,decrement:!0,disabledIndices:K}):z.current=Math.max(ue,qe(s,{startingIndex:G,decrement:!0,disabledIndices:K})),ar(s,z.current)?O(null):O(z.current)}}function L(oe){y==="auto"&&Af(oe.nativeEvent)&&(j.current=!0)}function ne(oe){j.current=y,y==="auto"&&If(oe.nativeEvent)&&(j.current=!0)}const me=g&&n&&X&&{"aria-activedescendant":ee||x},ke=s.current.find(oe=>(oe==null?void 0:oe.id)===x);return{reference:{...me,onKeyDown(oe){D.current=!1;const G=oe.key.indexOf("Arrow")===0,ue=oE(oe.key,k,h),de=bd(oe.key,k,h),we=vd(oe.key,k),Se=(m?ue:we)||oe.key==="Enter"||oe.key.trim()==="";if(g&&n){const se=I==null?void 0:I.nodesRef.current.find(q=>q.parentId==null),R=I&&se?$S(I.nodesRef.current,se.id):null;if(G&&R&&_){const q=new KeyboardEvent("keydown",{key:oe.key,bubbles:!0});if(ue||de){var He,Ge;const ae=((He=R.context)==null?void 0:He.elements.domReference)===oe.currentTarget,le=de&&!ae?(Ge=R.context)==null?void 0:Ge.elements.domReference:ue?ke:null;le&&(Ue(oe),le.dispatchEvent(q),Y(void 0))}if(we&&R.context&&R.context.open&&R.parentId&&oe.currentTarget!==R.context.elements.domReference){var Z;Ue(oe),(Z=R.context.elements.domReference)==null||Z.dispatchEvent(q);return}}return te(oe)}if(!(!n&&!w&&G)){if(Se&&(M.current=m&&we?null:oe.key),m){ue&&(Ue(oe),n?(z.current=Ea(s,K),O(z.current)):r(!0,oe.nativeEvent));return}we&&(c!=null&&(z.current=c),Ue(oe),!n&&w?r(!0,oe.nativeEvent):te(oe),n&&O(z.current))}},onFocus(){n&&O(null)},onPointerDown:ne,onMouseDown:L,onClick:L},floating:{"aria-orientation":k==="both"?void 0:k,...me,onKeyDown:te,onPointerMove(){D.current=!0}},item:re}},[o,i,x,ee,b,P,s,f,k,h,g,n,X,m,c,w,p,C,d,y,O,r,re,I,_])}function sE(e,t){t===void 0&&(t={});const{open:n,floatingId:r}=e,{enabled:i=!0,role:o="dialog"}=t,a=Aa();return E.useMemo(()=>{const s={id:r,role:o};return i?o==="tooltip"?{reference:{"aria-describedby":n?r:void 0},floating:s}:{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:a}},floating:{...s,...o==="menu"&&{"aria-labelledby":a}}}:{}},[i,o,n,r,a])}function lE(e,t){var n;const{open:r,dataRef:i}=e,{listRef:o,activeIndex:a,onMatch:s,onTypingChange:l,enabled:u=!0,findMatch:f=null,resetMs:c=750,ignoreKeys:p=[],selectedIndex:d=null}=t,m=E.useRef(),h=E.useRef(""),g=E.useRef((n=d??a)!=null?n:-1),y=E.useRef(null),v=Rt(s),w=Rt(l),A=Ft(f),k=Ft(p);return Re(()=>{r&&(clearTimeout(m.current),y.current=null,h.current="")},[r]),Re(()=>{if(r&&h.current===""){var C;g.current=(C=d??a)!=null?C:-1}},[r,d,a]),E.useMemo(()=>{if(!u)return{};function C(F){F?i.current.typing||(i.current.typing=F,w(F)):i.current.typing&&(i.current.typing=F,w(F))}function T(F,I,O){const j=A.current?A.current(I,O):I.find(z=>(z==null?void 0:z.toLocaleLowerCase().indexOf(O.toLocaleLowerCase()))===0);return j?F.indexOf(j):-1}function _(F){const I=o.current;if(h.current.length>0&&h.current[0]!==" "&&(T(I,I,h.current)===-1?C(!1):F.key===" "&&Ue(F)),I==null||k.current.includes(F.key)||F.key.length!==1||F.ctrlKey||F.metaKey||F.altKey)return;r&&F.key!==" "&&(Ue(F),C(!0)),I.every(M=>{var D,B;return M?((D=M[0])==null?void 0:D.toLocaleLowerCase())!==((B=M[1])==null?void 0:B.toLocaleLowerCase()):!0})&&h.current===F.key&&(h.current="",g.current=y.current),h.current+=F.key,clearTimeout(m.current),m.current=setTimeout(()=>{h.current="",g.current=y.current,C(!1)},c);const j=g.current,z=T(I,[...I.slice((j||0)+1),...I.slice(0,(j||0)+1)],h.current);z!==-1?(v(z),y.current=z):F.key!==" "&&(h.current="",C(!1))}return{reference:{onKeyDown:_},floating:{onKeyDown:_,onKeyUp(F){F.key===" "&&C(!1)}}}},[u,r,i,o,c,k,A,v,w])}const uE=({options:e,reusable:t,sendMessage:n,isReadOnly:r})=>{var D,B,U,$,W;const i=sn(b=>b.messageContainerRef),o=sn(b=>b.portalContainer),[a,s]=E.useState(!1),[l,u]=E.useState(null),[f,c]=E.useState(null),{message:{blocks:{dropdown:p}}}=ge,d=e.reduce((b,P)=>(b[P.label]=P.value,b),{}),m=d?Object.keys(d):[],h=b=>{s(f!==null&&!t?!1:b)},{refs:g,floatingStyles:y,context:v}=rE({placement:"bottom-start",open:a,onOpenChange:h,whileElementsMounted:aS,middleware:[hS(5),mS({padding:10,boundary:(i==null?void 0:i.current)??void 0,crossAxis:!0}),gS({apply({rects:b,elements:P,availableHeight:H}){Object.assign(P.floating.style,{maxHeight:`${H}px`,minWidth:`${b.reference.width}px`})},padding:10})]}),w=E.useRef([]),A=E.useRef(m),k=E.useRef(!1),C=JS(v,{event:"mousedown"}),T=nE(v),_=sE(v,{role:"listbox"}),F=aE(v,{listRef:w,activeIndex:l,selectedIndex:f,onNavigate:u,loop:!0}),I=lE(v,{listRef:A,activeIndex:l,selectedIndex:f,onMatch:a?u:c,onTypingChange(b){k.current=b}}),{getReferenceProps:O,getFloatingProps:j,getItemProps:z}=iE([T,_,F,I,C]),M=b=>{c(b),m[b]!==void 0&&(n==null||n({type:"text",text:m[b]??"",value:d[m[b]]??""})),s(!1)};return S.jsxs(S.Fragment,{children:[S.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,...(D=p.button)==null?void 0:D.container,...O(),children:[S.jsx("span",{...(B=p.button)==null?void 0:B.text,children:f?m[f]:"Select..."}),S.jsx(O0,{...(U=p.button)==null?void 0:U.icon})]}),a&&S.jsx(YS,{root:o??void 0,children:S.jsx(QS,{context:v,modal:!1,children:S.jsx("div",{ref:g.setFloating,className:(W=($=p.content)==null?void 0:$.container)==null?void 0:W.className,style:{...y,pointerEvents:"auto"},...j(),children:m.map((b,P)=>{var H;return S.jsx("div",{ref:x=>{w.current[P]=x},role:"option",tabIndex:P===l?0:-1,"aria-selected":P===f&&P===l,"data-active":P===l?"":void 0,...(H=p.content)==null?void 0:H.item,...z({onClick(){M(P)},onKeyDown(x){x.key==="Enter"&&(x.preventDefault(),M(P)),x.key===" "&&!k.current&&(x.preventDefault(),M(P))}}),children:b},b)})})})})]})},wd=N.forwardRef(({title:e,url:t,isReadOnly:n,...r},i)=>{const{message:{blocks:{file:o}}}=ge;return S.jsxs("a",{...r,...o.container,href:t,style:n?{pointerEvents:"none"}:void 0,download:!0,ref:i,target:"_blank",rel:"noreferrer",children:[S.jsx("p",{...o.title,children:e||t}),S.jsx(L0,{...o.icon})]})});wd.displayName="File";const cE=_t()((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"}),s=await import(URL.createObjectURL(o)),l=()=>s.default;return e(u=>({components:{...u.components,[n]:l}})),l}}));globalThis.React=N;const xd={audio:cf,bubble:rf,button:O1,carousel:xf,column:df,dropdown:uE,file:wd,image:lf,location:ff,row:pf,text:e1,video:uf,custom:({url:e,name:t,data:n,...r})=>{const i=cE(u=>u.getCustomComponent),[o,a]=N.useState(null),[s,l]=N.useState(null);return N.useEffect(()=>{i(e).then(a).catch(u=>{l(u.message)})},[e]),s?S.jsx("div",{style:{color:"red"},children:s}):o?S.jsx(o,{...n,...r}):null}},Yt=({block:e,renderers:t,...n})=>{const r=(t==null?void 0:t[e.type])??xd[e.type],i={...n,...e};return S.jsx(r,{...i})};function kd(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=kd(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=kd(e))&&(r&&(r+=" "),r+=t);return r}const fE=({disabled:e,onFileSelected:t})=>{const n=N.useRef(null),{uploadButton:r}=ge.composer,i=()=>{n.current&&n.current.click()},o=a=>{const s=a.target.files;s&&s.length>0&&Array.from(s).forEach(l=>{t(l)})};return S.jsxs(S.Fragment,{children:[S.jsx(q0,{...r,role:"button",tabIndex:0,"aria-label":"Upload File Button","data-disabled":e,onClick:i}),S.jsx("input",{value:"",multiple:!0,type:"file",ref:n,style:{display:"none"},onChange:o})]})},dE=({name:e,type:t,instance:n,status:r,removeFile:i})=>{const{loader:o,fileIcon:a,removeIcon:s,errorIcon:l,previewImage:u}=ge.composer.fileWidget,f=["PNG","JPEG","JPG"].includes(ci(n.name));return r==="loading"?S.jsx(ui,{name:e,status:r,removeButton:S.jsx("div",{...o}),extension:ci(n.name),children:S.jsx("div",{...a.container,children:S.jsx(Pa,{type:t,...a.icon})})}):r==="error"?S.jsx(ui,{name:e,status:r,removeButton:S.jsx(Sd,{removeFile:()=>i(e)}),extension:"Upload Error",children:S.jsxs("div",{...a.container,children:[S.jsx(_0,{...l}),S.jsx(Pa,{type:t,...a.icon})]})}):r=="uploaded"&&f?S.jsx(ui,{name:e,status:r,removeButton:S.jsx(Sd,{removeFile:()=>i(e)}),extension:ci(n.name),children:S.jsx("div",{...a.container,children:S.jsx("img",{src:URL.createObjectURL(n),alt:e,...u})})}):S.jsx(ui,{name:e,status:r,removeButton:S.jsx(Tc,{onClick:()=>i(e),...s}),extension:ci(n.name),children:S.jsx("div",{...a.container,children:S.jsx(Pa,{type:t,...a.icon})})})},ui=({name:e,status:t,removeButton:n,children:r,extension:i})=>{const{container:o,metadata:a}=ge.composer.fileWidget;return S.jsxs("div",{"data-status":t,title:e,...o,children:[n,r,S.jsxs("div",{...a.container,children:[S.jsx("div",{...a.name,children:e}),S.jsx("div",{...a.type,children:i})]})]})},Pa=({type:e,...t})=>e==="image"?S.jsx(B0,{...t}):e==="video"?S.jsx(J0,{...t}):e==="audio"?S.jsx(Mc,{...t}):S.jsx(Oc,{...t}),ci=e=>{if(!e)return"File";const t=e.split(".").pop();return t?t.toUpperCase():"File"},Sd=({removeFile:e})=>{const{composer:{fileWidget:{removeIcon:t}}}=ge;return S.jsx(Tc,{role:"button",tabIndex:0,"aria-label":"Remove File Button",onClick:()=>e(),...t})};function Na(){return Na=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},Na.apply(null,arguments)}function pE(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 hE=N.useLayoutEffect,mE=function(t){var n=N.useRef(t);return hE(function(){n.current=t}),n},Ed=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},gE=function(t,n){var r=N.useRef();return N.useCallback(function(i){t.current=i,r.current&&Ed(r.current,null),r.current=n,n&&Ed(n,i)},[n])},Cd={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},yE=function(t){Object.keys(Cd).forEach(function(n){t.style.setProperty(n,Cd[n],"important")})},Ad=yE,Ye=null,Id=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function vE(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),Ye||(Ye=document.createElement("textarea"),Ye.setAttribute("tabindex","-1"),Ye.setAttribute("aria-hidden","true"),Ad(Ye)),Ye.parentNode===null&&document.body.appendChild(Ye);var i=e.paddingSize,o=e.borderSize,a=e.sizingStyle,s=a.boxSizing;Object.keys(a).forEach(function(p){var d=p;Ye.style[d]=a[d]}),Ad(Ye),Ye.value=t;var l=Id(Ye,e);Ye.value=t,l=Id(Ye,e),Ye.value="x";var u=Ye.scrollHeight-i,f=u*n;s==="border-box"&&(f=f+i+o),l=Math.max(f,l);var c=u*r;return s==="border-box"&&(c=c+i+o),l=Math.min(c,l),[l,u]}var Td=function(){},bE=function(t,n){return t.reduce(function(r,i){return r[i]=n[i],r},{})},wE=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],xE=!!document.documentElement.currentStyle,kE=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=bE(wE,n),i=r.boxSizing;if(i==="")return null;xE&&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),a=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:o,borderSize:a}},SE=kE;function Od(e,t,n){var r=mE(n);E.useLayoutEffect(function(){var i=function(a){return r.current(a)};if(e)return e.addEventListener(t,i),function(){return e.removeEventListener(t,i)}},[])}var EE=function(t){Od(window,"resize",t)},CE=function(t){Od(document.fonts,"loadingdone",t)},AE=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],IE=function(t,n){var r=t.cacheMeasurements,i=t.maxRows,o=t.minRows,a=t.onChange,s=a===void 0?Td:a,l=t.onHeightChange,u=l===void 0?Td:l,f=pE(t,AE),c=f.value!==void 0,p=E.useRef(null),d=gE(p,n),m=E.useRef(0),h=E.useRef(),g=function(){var w=p.current,A=r&&h.current?h.current:SE(w);if(A){h.current=A;var k=vE(A,w.value||w.placeholder||"x",o,i),C=k[0],T=k[1];m.current!==C&&(m.current=C,w.style.setProperty("height",C+"px","important"),u(C,{rowHeight:T}))}},y=function(w){c||g(),s(w)};return E.useLayoutEffect(g),EE(g),CE(g),E.createElement("textarea",Na({},f,{onChange:y,ref:d}))},TE=E.forwardRef(IE);const OE=({inputRef:e,composerPlaceholder:t,composerDisabled:n,textInput:r,historyIndex:i,setTextInput:o,setHistoryIndex:a,sendComposerMessage:s,allowFileUpload:l,onFilePasted:u})=>{const f=Uc(h=>h.messageHistory),[c,p]=N.useState(""),{input:d}=ge.composer,m=h=>{if(!l||!u||!h.clipboardData)return;const g=Array.from(h.clipboardData.files);g.length>0&&(h.preventDefault(),g.forEach(y=>{u(y)}))};return S.jsx(TE,{...d,"aria-label":"Message Input",ref:e,placeholder:t??"Type your message...",disabled:n,value:r,"data-has-value":!!r,onChange:h=>{const g=h.target.value;o(g),f.includes(g)||a(-1)},onPaste:m,maxRows:5,onKeyDown:h=>{if(n)return;const g=h.nativeEvent;if(!(g.isComposing||g.keyCode===229)&&(h.key==="Enter"&&h.shiftKey?(h.preventDefault(),o(`${r}
279
279
  `)):h.key==="Enter"&&(h.preventDefault(),s()),!(r.trim().includes(`
280
- `)||r.trim().includes("\r")))){if(h.key==="ArrowUp"){h.preventDefault(),i===-1&&r.trim()!==""&&p(r);const y=Math.min(i+1,f.length-1);a(y),o(f[y]??"")}if(h.key==="ArrowDown"){h.preventDefault();const y=Math.max(i-1,-1);o(i===-1?r.trim():y===-1?c:f[y]??""),a(y)}}}})},NE=({disabled:e,setTextInput:t})=>{const[n,r]=_.useState(!1),i=_.useRef(null),{voiceButton:o}=ge.composer,a=window.SpeechRecognition||window.webkitSpeechRecognition,s=()=>{i.current||(i.current=new a);const l=i.current;l&&(l.continuous=!0,l.onresult=u=>{var c,p,d;const f=((d=(p=(c=u.results)==null?void 0:c[0])==null?void 0:p[0])==null?void 0:d.transcript)??"";t(f??""),l.stop(),r(!1)},n?(l.stop(),r(!1)):(l.start(),r(!0)))};if(a)return S.jsx(K0,{...o,tabIndex:0,"aria-label":"Voice Input Button",role:"button","data-show":!e,"data-listens":!!n,onClick:s})},Nd=_.memo(_.forwardRef(({className:e,inputRef:t,disableComposer:n,isReadOnly:r,allowFileUpload:i,disableSendButton:o,connected:a,composerPlaceholder:s,footer:l,sendMessage:u,uploadFile:f,storageKey:c,children:p,...d},m)=>{const{composer:h}=ge,g=n||r||!a,[y,v]=_.useState(""),[w,A]=_.useState(-1),k=of(c),C=k(M=>M.files),T=k(M=>M.setFiles),P=k(M=>M.deleteFile),F=k(M=>M.uploadFile),I=qc(M=>M.addMessageToHistory),O=C.filter(M=>M.status==="uploaded"),j=!!y.trim()||O.length>0,z=()=>{if(o||!j)return;const M=(O==null?void 0:O.map(B=>{const U=B.url,$=B.type;return{video:{type:"video",videoUrl:U},audio:{type:"audio",audioUrl:U},image:{type:"image",imageUrl:U}}[$]??{title:B.name,type:"file",fileUrl:U}}))??[];y&&M.push({type:"text",text:y});let D;M.length==1?D=M[0]:D={type:"bloc",items:M.map(U=>{const{type:$,...V}=U;return{type:$,payload:V}})},v(""),u==null||u(D),T([]),I(y),A(-1)};return r?null:S.jsxs(S.Fragment,{children:[S.jsxs("div",{"data-disabled":g,"data-waiting":o,className:dr(h.container.className,e),ref:m,...d,children:[p,C.length>0&&S.jsx("div",{...h==null?void 0:h.fileContainer,children:C.map(M=>S.jsx(gE,{...M,removeFile:P},M.name))}),S.jsxs("div",{...h.inputContainer,onClick:()=>{t&&"current"in t&&t.current&&t.current.focus()},children:[i&&S.jsx(mE,{disabled:g,onFileSelected:M=>{f&&F(M,f)}}),S.jsx(PE,{inputRef:t,composerPlaceholder:s,composerDisabled:g,textInput:y,historyIndex:w,setTextInput:v,setHistoryIndex:A,sendComposerMessage:z,allowFileUpload:i,onFilePasted:M=>{f&&F(M,f)}}),o&&S.jsx(H0,{...h.inputLoader,role:"status","data-show":o}),!g&&!o&&S.jsxs(S.Fragment,{children:[S.jsx(M0,{...h.sendbutton,role:"button",tabIndex:0,"aria-label":"Send Message Button","data-show":j,onClick:()=>z()}),S.jsx(NE,{disabled:j,setTextInput:v})]})]})]}),S.jsx(Qu,{components:{a:({node:M,...D})=>S.jsx("a",{...D,target:"_blank",rel:"noreferrer noopener"})},allowedElements:["a","strong","code","em","p","span"],...h.footer,children:l})]})}));var za={exports:{}},hi={exports:{}},Ce={};/** @license React v16.13.1
280
+ `)||r.trim().includes("\r")))){if(h.key==="ArrowUp"){h.preventDefault(),i===-1&&r.trim()!==""&&p(r);const y=Math.min(i+1,f.length-1);a(y),o(f[y]??"")}if(h.key==="ArrowDown"){h.preventDefault();const y=Math.max(i-1,-1);o(i===-1?r.trim():y===-1?c:f[y]??""),a(y)}}}})},DE=({disabled:e,setTextInput:t})=>{const[n,r]=N.useState(!1),i=N.useRef(null),{voiceButton:o}=ge.composer,a=window.SpeechRecognition||window.webkitSpeechRecognition,s=()=>{i.current||(i.current=new a);const l=i.current;l&&(l.continuous=!0,l.onresult=u=>{var c,p,d;const f=((d=(p=(c=u.results)==null?void 0:c[0])==null?void 0:p[0])==null?void 0:d.transcript)??"";t(f??""),l.stop(),r(!1)},n?(l.stop(),r(!1)):(l.start(),r(!0)))};if(a)return S.jsx(H0,{...o,tabIndex:0,"aria-label":"Voice Input Button",role:"button","data-show":!e,"data-listens":!!n,onClick:s})},Dd=N.memo(N.forwardRef(({className:e,inputRef:t,disableComposer:n,isReadOnly:r,allowFileUpload:i,disableSendButton:o,connected:a,composerPlaceholder:s,footer:l,sendMessage:u,uploadFile:f,storageKey:c,children:p,...d},m)=>{const{composer:h}=ge,g=n||r||!a,[y,v]=N.useState(""),[w,A]=N.useState(-1),k=ef(c),C=k(M=>M.files),T=k(M=>M.setFiles),_=k(M=>M.deleteFile),F=k(M=>M.uploadFile),I=Uc(M=>M.addMessageToHistory),O=C.filter(M=>M.status==="uploaded"),j=!!y.trim()||O.length>0,z=()=>{if(o||!j)return;const M=O.map(B=>{const U=B.url,$=B.type,W=B.fileId;return{video:{type:"video",videoUrl:U,fileId:W},audio:{type:"audio",audioUrl:U,fileId:W},image:{type:"image",imageUrl:U,fileId:W}}[$]??{title:B.name,type:"file",fileUrl:U,fileId:W}})??[];y&&M.push({type:"text",text:y});let D;M.length==1?D=M[0]:D={type:"bloc",items:M.map(U=>{const{type:$,...W}=U;return{type:$,payload:W}})},v(""),u==null||u(D),T([]),I(y),A(-1)};return r?null:S.jsxs(S.Fragment,{children:[S.jsxs("div",{"data-disabled":g,"data-waiting":o,className:ur(h.container.className,e),ref:m,...d,children:[p,C.length>0&&S.jsx("div",{...h==null?void 0:h.fileContainer,children:C.map(M=>S.jsx(dE,{...M,removeFile:_},M.name))}),S.jsxs("div",{...h.inputContainer,onClick:()=>{t&&"current"in t&&t.current&&t.current.focus()},children:[i&&S.jsx(fE,{disabled:g,onFileSelected:M=>{f&&F(M,f)}}),S.jsx(OE,{inputRef:t,composerPlaceholder:s,composerDisabled:g,textInput:y,historyIndex:w,setTextInput:v,setHistoryIndex:A,sendComposerMessage:z,allowFileUpload:i,onFilePasted:M=>{f&&F(M,f)}}),o&&S.jsx(z0,{...h.inputLoader,role:"status","data-show":o}),!g&&!o&&S.jsxs(S.Fragment,{children:[S.jsx(I0,{...h.sendbutton,role:"button",tabIndex:0,"aria-label":"Send Message Button","data-show":j,onClick:()=>z()}),S.jsx(DE,{disabled:j,setTextInput:v})]})]})]}),S.jsx(qu,{components:{a:({node:M,...D})=>S.jsx("a",{...D,target:"_blank",rel:"noreferrer noopener"})},allowedElements:["a","strong","code","em","p","span"],...h.footer,children:l})]})}));var La={exports:{}},fi={exports:{}},Ce={};/** @license React v16.13.1
281
281
  * react-is.production.min.js
282
282
  *
283
283
  * Copyright (c) Facebook, Inc. and its affiliates.
284
284
  *
285
285
  * This source code is licensed under the MIT license found in the
286
286
  * LICENSE file in the root directory of this source tree.
287
- */var Ld;function LE(){if(Ld)return Ce;Ld=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,a=e?Symbol.for("react.provider"):60109,s=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,p=e?Symbol.for("react.suspense_list"):60120,d=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,h=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,v=e?Symbol.for("react.scope"):60119;function w(k){if(typeof k=="object"&&k!==null){var C=k.$$typeof;switch(C){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 s:case f:case m:case d:case a:return k;default:return C}}case n:return C}}}function A(k){return w(k)===u}return Ce.AsyncMode=l,Ce.ConcurrentMode=u,Ce.ContextConsumer=s,Ce.ContextProvider=a,Ce.Element=t,Ce.ForwardRef=f,Ce.Fragment=r,Ce.Lazy=m,Ce.Memo=d,Ce.Portal=n,Ce.Profiler=o,Ce.StrictMode=i,Ce.Suspense=c,Ce.isAsyncMode=function(k){return A(k)||w(k)===l},Ce.isConcurrentMode=A,Ce.isContextConsumer=function(k){return w(k)===s},Ce.isContextProvider=function(k){return w(k)===a},Ce.isElement=function(k){return typeof k=="object"&&k!==null&&k.$$typeof===t},Ce.isForwardRef=function(k){return w(k)===f},Ce.isFragment=function(k){return w(k)===r},Ce.isLazy=function(k){return w(k)===m},Ce.isMemo=function(k){return w(k)===d},Ce.isPortal=function(k){return w(k)===n},Ce.isProfiler=function(k){return w(k)===o},Ce.isStrictMode=function(k){return w(k)===i},Ce.isSuspense=function(k){return w(k)===c},Ce.isValidElementType=function(k){return typeof k=="string"||typeof k=="function"||k===r||k===u||k===o||k===i||k===c||k===p||typeof k=="object"&&k!==null&&(k.$$typeof===m||k.$$typeof===d||k.$$typeof===a||k.$$typeof===s||k.$$typeof===f||k.$$typeof===g||k.$$typeof===y||k.$$typeof===v||k.$$typeof===h)},Ce.typeOf=w,Ce}var Ae={};/** @license React v16.13.1
287
+ */var Md;function ME(){if(Md)return Ce;Md=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,a=e?Symbol.for("react.provider"):60109,s=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,p=e?Symbol.for("react.suspense_list"):60120,d=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,h=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,v=e?Symbol.for("react.scope"):60119;function w(k){if(typeof k=="object"&&k!==null){var C=k.$$typeof;switch(C){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 s:case f:case m:case d:case a:return k;default:return C}}case n:return C}}}function A(k){return w(k)===u}return Ce.AsyncMode=l,Ce.ConcurrentMode=u,Ce.ContextConsumer=s,Ce.ContextProvider=a,Ce.Element=t,Ce.ForwardRef=f,Ce.Fragment=r,Ce.Lazy=m,Ce.Memo=d,Ce.Portal=n,Ce.Profiler=o,Ce.StrictMode=i,Ce.Suspense=c,Ce.isAsyncMode=function(k){return A(k)||w(k)===l},Ce.isConcurrentMode=A,Ce.isContextConsumer=function(k){return w(k)===s},Ce.isContextProvider=function(k){return w(k)===a},Ce.isElement=function(k){return typeof k=="object"&&k!==null&&k.$$typeof===t},Ce.isForwardRef=function(k){return w(k)===f},Ce.isFragment=function(k){return w(k)===r},Ce.isLazy=function(k){return w(k)===m},Ce.isMemo=function(k){return w(k)===d},Ce.isPortal=function(k){return w(k)===n},Ce.isProfiler=function(k){return w(k)===o},Ce.isStrictMode=function(k){return w(k)===i},Ce.isSuspense=function(k){return w(k)===c},Ce.isValidElementType=function(k){return typeof k=="string"||typeof k=="function"||k===r||k===u||k===o||k===i||k===c||k===p||typeof k=="object"&&k!==null&&(k.$$typeof===m||k.$$typeof===d||k.$$typeof===a||k.$$typeof===s||k.$$typeof===f||k.$$typeof===g||k.$$typeof===y||k.$$typeof===v||k.$$typeof===h)},Ce.typeOf=w,Ce}var Ae={};/** @license React v16.13.1
288
288
  * react-is.development.js
289
289
  *
290
290
  * Copyright (c) Facebook, Inc. and its affiliates.
291
291
  *
292
292
  * This source code is licensed under the MIT license found in the
293
293
  * LICENSE file in the root directory of this source tree.
294
- */var Fd;function FE(){return Fd||(Fd=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,a=e?Symbol.for("react.provider"):60109,s=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,p=e?Symbol.for("react.suspense_list"):60120,d=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,h=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,v=e?Symbol.for("react.scope"):60119;function w(L){return typeof L=="string"||typeof L=="function"||L===r||L===u||L===o||L===i||L===c||L===p||typeof L=="object"&&L!==null&&(L.$$typeof===m||L.$$typeof===d||L.$$typeof===a||L.$$typeof===s||L.$$typeof===f||L.$$typeof===g||L.$$typeof===y||L.$$typeof===v||L.$$typeof===h)}function A(L){if(typeof L=="object"&&L!==null){var ne=L.$$typeof;switch(ne){case t:var me=L.type;switch(me){case l:case u:case r:case o:case i:case c:return me;default:var ke=me&&me.$$typeof;switch(ke){case s:case f:case m:case d:case a:return ke;default:return ne}}case n:return ne}}}var k=l,C=u,T=s,P=a,F=t,I=f,O=r,j=m,z=d,M=n,D=o,B=i,U=c,$=!1;function V(L){return $||($=!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(L)||A(L)===l}function b(L){return A(L)===u}function N(L){return A(L)===s}function H(L){return A(L)===a}function x(L){return typeof L=="object"&&L!==null&&L.$$typeof===t}function W(L){return A(L)===f}function ee(L){return A(L)===r}function Y(L){return A(L)===m}function J(L){return A(L)===d}function X(L){return A(L)===n}function ie(L){return A(L)===o}function K(L){return A(L)===i}function te(L){return A(L)===c}Ae.AsyncMode=k,Ae.ConcurrentMode=C,Ae.ContextConsumer=T,Ae.ContextProvider=P,Ae.Element=F,Ae.ForwardRef=I,Ae.Fragment=O,Ae.Lazy=j,Ae.Memo=z,Ae.Portal=M,Ae.Profiler=D,Ae.StrictMode=B,Ae.Suspense=U,Ae.isAsyncMode=V,Ae.isConcurrentMode=b,Ae.isContextConsumer=N,Ae.isContextProvider=H,Ae.isElement=x,Ae.isForwardRef=W,Ae.isFragment=ee,Ae.isLazy=Y,Ae.isMemo=J,Ae.isPortal=X,Ae.isProfiler=ie,Ae.isStrictMode=K,Ae.isSuspense=te,Ae.isValidElementType=w,Ae.typeOf=A}()),Ae}var Rd;function Bd(){return Rd||(Rd=1,process.env.NODE_ENV==="production"?hi.exports=LE():hi.exports=FE()),hi.exports}/*
294
+ */var _d;function _E(){return _d||(_d=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,a=e?Symbol.for("react.provider"):60109,s=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,p=e?Symbol.for("react.suspense_list"):60120,d=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,h=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,v=e?Symbol.for("react.scope"):60119;function w(L){return typeof L=="string"||typeof L=="function"||L===r||L===u||L===o||L===i||L===c||L===p||typeof L=="object"&&L!==null&&(L.$$typeof===m||L.$$typeof===d||L.$$typeof===a||L.$$typeof===s||L.$$typeof===f||L.$$typeof===g||L.$$typeof===y||L.$$typeof===v||L.$$typeof===h)}function A(L){if(typeof L=="object"&&L!==null){var ne=L.$$typeof;switch(ne){case t:var me=L.type;switch(me){case l:case u:case r:case o:case i:case c:return me;default:var ke=me&&me.$$typeof;switch(ke){case s:case f:case m:case d:case a:return ke;default:return ne}}case n:return ne}}}var k=l,C=u,T=s,_=a,F=t,I=f,O=r,j=m,z=d,M=n,D=o,B=i,U=c,$=!1;function W(L){return $||($=!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(L)||A(L)===l}function b(L){return A(L)===u}function P(L){return A(L)===s}function H(L){return A(L)===a}function x(L){return typeof L=="object"&&L!==null&&L.$$typeof===t}function V(L){return A(L)===f}function ee(L){return A(L)===r}function Y(L){return A(L)===m}function J(L){return A(L)===d}function X(L){return A(L)===n}function re(L){return A(L)===o}function K(L){return A(L)===i}function te(L){return A(L)===c}Ae.AsyncMode=k,Ae.ConcurrentMode=C,Ae.ContextConsumer=T,Ae.ContextProvider=_,Ae.Element=F,Ae.ForwardRef=I,Ae.Fragment=O,Ae.Lazy=j,Ae.Memo=z,Ae.Portal=M,Ae.Profiler=D,Ae.StrictMode=B,Ae.Suspense=U,Ae.isAsyncMode=W,Ae.isConcurrentMode=b,Ae.isContextConsumer=P,Ae.isContextProvider=H,Ae.isElement=x,Ae.isForwardRef=V,Ae.isFragment=ee,Ae.isLazy=Y,Ae.isMemo=J,Ae.isPortal=X,Ae.isProfiler=re,Ae.isStrictMode=K,Ae.isSuspense=te,Ae.isValidElementType=w,Ae.typeOf=A}()),Ae}var Pd;function Nd(){return Pd||(Pd=1,process.env.NODE_ENV==="production"?fi.exports=ME():fi.exports=_E()),fi.exports}/*
295
295
  object-assign
296
296
  (c) Sindre Sorhus
297
297
  @license MIT
298
- */var $a,zd;function RE(){if(zd)return $a;zd=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 a={},s=0;s<10;s++)a["_"+String.fromCharCode(s)]=s;var l=Object.getOwnPropertyNames(a).map(function(f){return a[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 $a=i()?Object.assign:function(o,a){for(var s,l=r(o),u,f=1;f<arguments.length;f++){s=Object(arguments[f]);for(var c in s)t.call(s,c)&&(l[c]=s[c]);if(e){u=e(s);for(var p=0;p<u.length;p++)n.call(s,u[p])&&(l[u[p]]=s[u[p]])}}return l},$a}var ja,$d;function Ua(){if($d)return ja;$d=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ja=e,ja}var Ha,jd;function Ud(){return jd||(jd=1,Ha=Function.call.bind(Object.prototype.hasOwnProperty)),Ha}var Wa,Hd;function BE(){if(Hd)return Wa;Hd=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Ua(),n={},r=Ud();e=function(o){var a="Warning: "+o;typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}}}function i(o,a,s,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 p=Error((l||"React class")+": "+s+" 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 p.name="Invariant Violation",p}c=o[f](a,f,l,s,null,t)}catch(m){c=m}if(c&&!(c instanceof Error)&&e((l||"React class")+": type specification of "+s+" `"+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 "+s+" type: "+c.message+(d??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Wa=i,Wa}var Va,Wd;function zE(){if(Wd)return Va;Wd=1;var e=Bd(),t=RE(),n=Ua(),r=Ud(),i=BE(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(s){var l="Warning: "+s;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function a(){return null}return Va=function(s,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 p="<<anonymous>>",d={array:y("array"),bigint:y("bigint"),bool:y("boolean"),func:y("function"),number:y("number"),object:y("object"),string:y("string"),symbol:y("symbol"),any:v(),arrayOf:w,element:A(),elementType:k(),instanceOf:C,node:I(),objectOf:P,oneOf:T,oneOfType:F,shape:j,exact:z};function m(b,N){return b===N?b!==0||1/b===1/N:b!==b&&N!==N}function h(b,N){this.message=b,this.data=N&&typeof N=="object"?N:{},this.stack=""}h.prototype=Error.prototype;function g(b){if(process.env.NODE_ENV!=="production")var N={},H=0;function x(ee,Y,J,X,ie,K,te){if(X=X||p,K=K||J,te!==n){if(l){var L=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 L.name="Invariant Violation",L}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ne=X+":"+J;!N[ne]&&H<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."),N[ne]=!0,H++)}}return Y[J]==null?ee?Y[J]===null?new h("The "+ie+" `"+K+"` is marked as required "+("in `"+X+"`, but its value is `null`.")):new h("The "+ie+" `"+K+"` is marked as required in "+("`"+X+"`, but its value is `undefined`.")):null:b(Y,J,X,ie,K)}var W=x.bind(null,!1);return W.isRequired=x.bind(null,!0),W}function y(b){function N(H,x,W,ee,Y,J){var X=H[x],ie=B(X);if(ie!==b){var K=U(X);return new h("Invalid "+ee+" `"+Y+"` of type "+("`"+K+"` supplied to `"+W+"`, expected ")+("`"+b+"`."),{expectedType:b})}return null}return g(N)}function v(){return g(a)}function w(b){function N(H,x,W,ee,Y){if(typeof b!="function")return new h("Property `"+Y+"` of component `"+W+"` has invalid PropType notation inside arrayOf.");var J=H[x];if(!Array.isArray(J)){var X=B(J);return new h("Invalid "+ee+" `"+Y+"` of type "+("`"+X+"` supplied to `"+W+"`, expected an array."))}for(var ie=0;ie<J.length;ie++){var K=b(J,ie,W,ee,Y+"["+ie+"]",n);if(K instanceof Error)return K}return null}return g(N)}function A(){function b(N,H,x,W,ee){var Y=N[H];if(!s(Y)){var J=B(Y);return new h("Invalid "+W+" `"+ee+"` of type "+("`"+J+"` supplied to `"+x+"`, expected a single ReactElement."))}return null}return g(b)}function k(){function b(N,H,x,W,ee){var Y=N[H];if(!e.isValidElementType(Y)){var J=B(Y);return new h("Invalid "+W+" `"+ee+"` of type "+("`"+J+"` supplied to `"+x+"`, expected a single ReactElement type."))}return null}return g(b)}function C(b){function N(H,x,W,ee,Y){if(!(H[x]instanceof b)){var J=b.name||p,X=V(H[x]);return new h("Invalid "+ee+" `"+Y+"` of type "+("`"+X+"` supplied to `"+W+"`, expected ")+("instance of `"+J+"`."))}return null}return g(N)}function T(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.")),a;function N(H,x,W,ee,Y){for(var J=H[x],X=0;X<b.length;X++)if(m(J,b[X]))return null;var ie=JSON.stringify(b,function(te,L){var ne=U(L);return ne==="symbol"?String(L):L});return new h("Invalid "+ee+" `"+Y+"` of value `"+String(J)+"` "+("supplied to `"+W+"`, expected one of "+ie+"."))}return g(N)}function P(b){function N(H,x,W,ee,Y){if(typeof b!="function")return new h("Property `"+Y+"` of component `"+W+"` has invalid PropType notation inside objectOf.");var J=H[x],X=B(J);if(X!=="object")return new h("Invalid "+ee+" `"+Y+"` of type "+("`"+X+"` supplied to `"+W+"`, expected an object."));for(var ie in J)if(r(J,ie)){var K=b(J,ie,W,ee,Y+"."+ie,n);if(K instanceof Error)return K}return null}return g(N)}function F(b){if(!Array.isArray(b))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var N=0;N<b.length;N++){var H=b[N];if(typeof H!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+$(H)+" at index "+N+"."),a}function x(W,ee,Y,J,X){for(var ie=[],K=0;K<b.length;K++){var te=b[K],L=te(W,ee,Y,J,X,n);if(L==null)return null;L.data&&r(L.data,"expectedType")&&ie.push(L.data.expectedType)}var ne=ie.length>0?", expected one of type ["+ie.join(", ")+"]":"";return new h("Invalid "+J+" `"+X+"` supplied to "+("`"+Y+"`"+ne+"."))}return g(x)}function I(){function b(N,H,x,W,ee){return M(N[H])?null:new h("Invalid "+W+" `"+ee+"` supplied to "+("`"+x+"`, expected a ReactNode."))}return g(b)}function O(b,N,H,x,W){return new h((b||"React class")+": "+N+" type `"+H+"."+x+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+W+"`.")}function j(b){function N(H,x,W,ee,Y){var J=H[x],X=B(J);if(X!=="object")return new h("Invalid "+ee+" `"+Y+"` of type `"+X+"` "+("supplied to `"+W+"`, expected `object`."));for(var ie in b){var K=b[ie];if(typeof K!="function")return O(W,ee,Y,ie,U(K));var te=K(J,ie,W,ee,Y+"."+ie,n);if(te)return te}return null}return g(N)}function z(b){function N(H,x,W,ee,Y){var J=H[x],X=B(J);if(X!=="object")return new h("Invalid "+ee+" `"+Y+"` of type `"+X+"` "+("supplied to `"+W+"`, expected `object`."));var ie=t({},H[x],b);for(var K in ie){var te=b[K];if(r(b,K)&&typeof te!="function")return O(W,ee,Y,K,U(te));if(!te)return new h("Invalid "+ee+" `"+Y+"` key `"+K+"` supplied to `"+W+"`.\nBad object: "+JSON.stringify(H[x],null," ")+`
299
- Valid keys: `+JSON.stringify(Object.keys(b),null," "));var L=te(J,K,W,ee,Y+"."+K,n);if(L)return L}return null}return g(N)}function M(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(M);if(b===null||s(b))return!0;var N=c(b);if(N){var H=N.call(b),x;if(N!==b.entries){for(;!(x=H.next()).done;)if(!M(x.value))return!1}else for(;!(x=H.next()).done;){var W=x.value;if(W&&!M(W[1]))return!1}}else return!1;return!0;default:return!1}}function D(b,N){return b==="symbol"?!0:N?N["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&N instanceof Symbol:!1}function B(b){var N=typeof b;return Array.isArray(b)?"array":b instanceof RegExp?"object":D(N,b)?"symbol":N}function U(b){if(typeof b>"u"||b===null)return""+b;var N=B(b);if(N==="object"){if(b instanceof Date)return"date";if(b instanceof RegExp)return"regexp"}return N}function $(b){var N=U(b);switch(N){case"array":case"object":return"an "+N;case"boolean":case"date":case"regexp":return"a "+N;default:return N}}function V(b){return!b.constructor||!b.constructor.name?p:b.constructor.name}return d.checkPropTypes=i,d.resetWarningCache=i.resetWarningCache,d.PropTypes=d,d},Va}var qa,Vd;function $E(){if(Vd)return qa;Vd=1;var e=Ua();function t(){}function n(){}return n.resetWarningCache=t,qa=function(){function r(a,s,l,u,f,c){if(c!==e){var p=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 p.name="Invariant Violation",p}}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},qa}if(process.env.NODE_ENV!=="production"){var jE=Bd(),UE=!0;za.exports=zE()(jE.isElement,UE)}else za.exports=$E()();var HE=za.exports;const Te=jt(HE);var WE=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 pr(e,t){var n=VE(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 VE(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),i=WE.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var qE=[".DS_Store","Thumbs.db"];function KE(e){return ln(this,void 0,void 0,function(){return un(this,function(t){return mi(e)&&YE(e.dataTransfer)?[2,ZE(e.dataTransfer,e.type)]:GE(e)?[2,QE(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,JE(e)]:[2,[]]})})}function YE(e){return mi(e)}function GE(e){return mi(e)&&mi(e.target)}function mi(e){return typeof e=="object"&&e!==null}function QE(e){return Ka(e.target.files).map(function(t){return pr(t)})}function JE(e){return ln(this,void 0,void 0,function(){var t;return un(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 pr(r)})]}})})}function ZE(e,t){return ln(this,void 0,void 0,function(){var n,r;return un(this,function(i){switch(i.label){case 0:return e.items?(n=Ka(e.items).filter(function(o){return o.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(XE))]):[3,2];case 1:return r=i.sent(),[2,qd(Kd(r))];case 2:return[2,qd(Ka(e.files).map(function(o){return pr(o)}))]}})})}function qd(e){return e.filter(function(t){return qE.indexOf(t.name)===-1})}function Ka(e){if(e===null)return[];for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r)}return t}function XE(e){if(typeof e.webkitGetAsEntry!="function")return Yd(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?Gd(t):Yd(e)}function Kd(e){return e.reduce(function(t,n){return sa(sa([],ff(t),!1),ff(Array.isArray(n)?Kd(n):[n]),!1)},[])}function Yd(e){var t=e.getAsFile();if(!t)return Promise.reject("".concat(e," is not a File"));var n=pr(t);return Promise.resolve(n)}function eC(e){return ln(this,void 0,void 0,function(){return un(this,function(t){return[2,e.isDirectory?Gd(e):tC(e)]})})}function Gd(e){var t=e.createReader();return new Promise(function(n,r){var i=[];function o(){var a=this;t.readEntries(function(s){return ln(a,void 0,void 0,function(){var l,u,f;return un(this,function(c){switch(c.label){case 0:if(s.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(s.map(eC)),i.push(f),o(),c.label=6;case 6:return[2]}})})},function(s){r(s)})}o()})}function tC(e){return ln(this,void 0,void 0,function(){return un(this,function(t){return[2,new Promise(function(n,r){e.file(function(i){var o=pr(i,e.fullPath);n(o)},function(i){r(i)})})]})})}var nC=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(a){var s=a.trim().toLowerCase();return s.charAt(0)==="."?r.toLowerCase().endsWith(s):s.endsWith("/*")?o===s.replace(/\/.*$/,""):i===s})}return!0};function Qd(e){return oC(e)||iC(e)||ep(e)||rC()}function rC(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
300
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function iC(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function oC(e){if(Array.isArray(e))return Ya(e)}function Jd(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 Zd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Jd(Object(n),!0).forEach(function(r){Xd(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jd(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Xd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hr(e,t){return lC(e)||sC(e,t)||ep(e,t)||aC()}function aC(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
301
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ep(e,t){if(e){if(typeof e=="string")return Ya(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 Ya(e,t)}}function Ya(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 sC(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,a,s;try{for(n=n.call(e);!(i=(a=n.next()).done)&&(r.push(a.value),!(t&&r.length===t));i=!0);}catch(l){o=!0,s=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw s}}return r}}function lC(e){if(Array.isArray(e))return e}var uC="file-invalid-type",cC="file-too-large",fC="file-too-small",dC="too-many-files",pC=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:uC,message:"File type must be ".concat(n)}},tp=function(t){return{code:cC,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},np=function(t){return{code:fC,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},hC={code:dC,message:"Too many files"};function rp(e,t){var n=e.type==="application/x-moz-file"||nC(e,t);return[n,n?null:pC(t)]}function ip(e,t,n){if(Gt(e.size))if(Gt(t)&&Gt(n)){if(e.size>n)return[!1,tp(n)];if(e.size<t)return[!1,np(t)]}else{if(Gt(t)&&e.size<t)return[!1,np(t)];if(Gt(n)&&e.size>n)return[!1,tp(n)]}return[!0,null]}function Gt(e){return e!=null}function mC(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,o=e.multiple,a=e.maxFiles,s=e.validator;return!o&&t.length>1||o&&a>=1&&t.length>a?!1:t.every(function(l){var u=rp(l,n),f=hr(u,1),c=f[0],p=ip(l,r,i),d=hr(p,1),m=d[0],h=s?s(l):null;return c&&m&&!h})}function gi(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function yi(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 op(e){e.preventDefault()}function gC(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function yC(e){return e.indexOf("Edge/")!==-1}function vC(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return gC(e)||yC(e)}function kt(){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),a=1;a<i;a++)o[a-1]=arguments[a];return t.some(function(s){return!gi(r)&&s&&s.apply(void 0,[r].concat(o)),gi(r)})}}function bC(){return"showOpenFilePicker"in window}function wC(e){if(Gt(e)){var t=Object.entries(e).filter(function(n){var r=hr(n,2),i=r[0],o=r[1],a=!0;return ap(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.')),a=!1),(!Array.isArray(o)||!o.every(sp))&&(console.warn('Skipped "'.concat(i,'" because an invalid file extension was provided.')),a=!1),a}).reduce(function(n,r){var i=hr(r,2),o=i[0],a=i[1];return Zd(Zd({},n),{},Xd({},o,a))},{});return[{description:"Files",accept:t}]}return e}function xC(e){if(Gt(e))return Object.entries(e).reduce(function(t,n){var r=hr(n,2),i=r[0],o=r[1];return[].concat(Qd(t),[i],Qd(o))},[]).filter(function(t){return ap(t)||sp(t)}).join(",")}function kC(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function SC(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function ap(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function sp(e){return/^.*\.[\w]+$/.test(e)}var EC=["children"],CC=["open"],AC=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],IC=["refKey","onChange","onClick"];function TC(e){return MC(e)||DC(e)||lp(e)||OC()}function OC(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
302
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function DC(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function MC(e){if(Array.isArray(e))return Qa(e)}function Ga(e,t){return NC(e)||PC(e,t)||lp(e,t)||_C()}function _C(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
303
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lp(e,t){if(e){if(typeof e=="string")return Qa(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 Qa(e,t)}}function Qa(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 PC(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,a,s;try{for(n=n.call(e);!(i=(a=n.next()).done)&&(r.push(a.value),!(t&&r.length===t));i=!0);}catch(l){o=!0,s=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw s}}return r}}function NC(e){if(Array.isArray(e))return e}function up(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 Ne(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?up(Object(n),!0).forEach(function(r){Ja(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):up(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ja(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vi(e,t){if(e==null)return{};var n=LC(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 LC(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 Za=_.forwardRef(function(e,t){var n=e.children,r=vi(e,EC),i=fp(r),o=i.open,a=vi(i,CC);return _.useImperativeHandle(t,function(){return{open:o}},[o]),_.createElement(_.Fragment,null,n(Ne(Ne({},a),{},{open:o})))});Za.displayName="Dropzone";var cp={disabled:!1,getFilesFromEvent:KE,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};Za.defaultProps=cp,Za.propTypes={children:Te.func,accept:Te.objectOf(Te.arrayOf(Te.string)),multiple:Te.bool,preventDropOnDocument:Te.bool,noClick:Te.bool,noKeyboard:Te.bool,noDrag:Te.bool,noDragEventsBubbling:Te.bool,minSize:Te.number,maxSize:Te.number,maxFiles:Te.number,disabled:Te.bool,getFilesFromEvent:Te.func,onFileDialogCancel:Te.func,onFileDialogOpen:Te.func,useFsAccessApi:Te.bool,autoFocus:Te.bool,onDragEnter:Te.func,onDragLeave:Te.func,onDragOver:Te.func,onDrop:Te.func,onDropAccepted:Te.func,onDropRejected:Te.func,onError:Te.func,validator:Te.func};var Xa={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function fp(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Ne(Ne({},cp),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,o=t.maxSize,a=t.minSize,s=t.multiple,l=t.maxFiles,u=t.onDragEnter,f=t.onDragLeave,c=t.onDragOver,p=t.onDrop,d=t.onDropAccepted,m=t.onDropRejected,h=t.onFileDialogCancel,g=t.onFileDialogOpen,y=t.useFsAccessApi,v=t.autoFocus,w=t.preventDropOnDocument,A=t.noClick,k=t.noKeyboard,C=t.noDrag,T=t.noDragEventsBubbling,P=t.onError,F=t.validator,I=_.useMemo(function(){return xC(n)},[n]),O=_.useMemo(function(){return wC(n)},[n]),j=_.useMemo(function(){return typeof g=="function"?g:dp},[g]),z=_.useMemo(function(){return typeof h=="function"?h:dp},[h]),M=_.useRef(null),D=_.useRef(null),B=_.useReducer(FC,Xa),U=Ga(B,2),$=U[0],V=U[1],b=$.isFocused,N=$.isFileDialogActive,H=_.useRef(typeof window<"u"&&window.isSecureContext&&y&&bC()),x=function(){!H.current&&N&&setTimeout(function(){if(D.current){var se=D.current.files;se.length||(V({type:"closeDialog"}),z())}},300)};_.useEffect(function(){return window.addEventListener("focus",x,!1),function(){window.removeEventListener("focus",x,!1)}},[D,N,z,H]);var W=_.useRef([]),ee=function(se){M.current&&M.current.contains(se.target)||(se.preventDefault(),W.current=[])};_.useEffect(function(){return w&&(document.addEventListener("dragover",op,!1),document.addEventListener("drop",ee,!1)),function(){w&&(document.removeEventListener("dragover",op),document.removeEventListener("drop",ee))}},[M,w]),_.useEffect(function(){return!r&&v&&M.current&&M.current.focus(),function(){}},[M,v,r]);var Y=_.useCallback(function(Z){P?P(Z):console.error(Z)},[P]),J=_.useCallback(function(Z){Z.preventDefault(),Z.persist(),we(Z),W.current=[].concat(TC(W.current),[Z.target]),yi(Z)&&Promise.resolve(i(Z)).then(function(se){if(!(gi(Z)&&!T)){var R=se.length,q=R>0&&mC({files:se,accept:I,minSize:a,maxSize:o,multiple:s,maxFiles:l,validator:F}),ae=R>0&&!q;V({isDragAccept:q,isDragReject:ae,isDragActive:!0,type:"setDraggedFiles"}),u&&u(Z)}}).catch(function(se){return Y(se)})},[i,u,Y,T,I,a,o,s,l,F]),X=_.useCallback(function(Z){Z.preventDefault(),Z.persist(),we(Z);var se=yi(Z);if(se&&Z.dataTransfer)try{Z.dataTransfer.dropEffect="copy"}catch{}return se&&c&&c(Z),!1},[c,T]),ie=_.useCallback(function(Z){Z.preventDefault(),Z.persist(),we(Z);var se=W.current.filter(function(q){return M.current&&M.current.contains(q)}),R=se.indexOf(Z.target);R!==-1&&se.splice(R,1),W.current=se,!(se.length>0)&&(V({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),yi(Z)&&f&&f(Z))},[M,f,T]),K=_.useCallback(function(Z,se){var R=[],q=[];Z.forEach(function(ae){var le=rp(ae,I),pe=Ga(le,2),fe=pe[0],Ee=pe[1],Oe=ip(ae,a,o),st=Ga(Oe,2),gt=st[0],ze=st[1],lt=F?F(ae):null;if(fe&&gt&&!lt)R.push(ae);else{var Ge=[Ee,ze];lt&&(Ge=Ge.concat(lt)),q.push({file:ae,errors:Ge.filter(function(Bi){return Bi})})}}),(!s&&R.length>1||s&&l>=1&&R.length>l)&&(R.forEach(function(ae){q.push({file:ae,errors:[hC]})}),R.splice(0)),V({acceptedFiles:R,fileRejections:q,type:"setFiles"}),p&&p(R,q,se),q.length>0&&m&&m(q,se),R.length>0&&d&&d(R,se)},[V,s,I,a,o,l,p,d,m,F]),te=_.useCallback(function(Z){Z.preventDefault(),Z.persist(),we(Z),W.current=[],yi(Z)&&Promise.resolve(i(Z)).then(function(se){gi(Z)&&!T||K(se,Z)}).catch(function(se){return Y(se)}),V({type:"reset"})},[i,K,Y,T]),L=_.useCallback(function(){if(H.current){V({type:"openDialog"}),j();var Z={multiple:s,types:O};window.showOpenFilePicker(Z).then(function(se){return i(se)}).then(function(se){K(se,null),V({type:"closeDialog"})}).catch(function(se){kC(se)?(z(se),V({type:"closeDialog"})):SC(se)?(H.current=!1,D.current?(D.current.value=null,D.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(se)});return}D.current&&(V({type:"openDialog"}),j(),D.current.value=null,D.current.click())},[V,j,z,y,K,Y,O,s]),ne=_.useCallback(function(Z){!M.current||!M.current.isEqualNode(Z.target)||(Z.key===" "||Z.key==="Enter"||Z.keyCode===32||Z.keyCode===13)&&(Z.preventDefault(),L())},[M,L]),me=_.useCallback(function(){V({type:"focus"})},[]),ke=_.useCallback(function(){V({type:"blur"})},[]),oe=_.useCallback(function(){A||(vC()?setTimeout(L,0):L())},[A,L]),G=function(se){return r?null:se},ue=function(se){return k?null:G(se)},de=function(se){return C?null:G(se)},we=function(se){T&&se.stopPropagation()},Se=_.useMemo(function(){return function(){var Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},se=Z.refKey,R=se===void 0?"ref":se,q=Z.role,ae=Z.onKeyDown,le=Z.onFocus,pe=Z.onBlur,fe=Z.onClick,Ee=Z.onDragEnter,Oe=Z.onDragOver,st=Z.onDragLeave,gt=Z.onDrop,ze=vi(Z,AC);return Ne(Ne(Ja({onKeyDown:ue(kt(ae,ne)),onFocus:ue(kt(le,me)),onBlur:ue(kt(pe,ke)),onClick:G(kt(fe,oe)),onDragEnter:de(kt(Ee,J)),onDragOver:de(kt(Oe,X)),onDragLeave:de(kt(st,ie)),onDrop:de(kt(gt,te)),role:typeof q=="string"&&q!==""?q:"presentation"},R,M),!r&&!k?{tabIndex:0}:{}),ze)}},[M,ne,me,ke,oe,J,X,ie,te,k,C,r]),Ue=_.useCallback(function(Z){Z.stopPropagation()},[]),Ye=_.useMemo(function(){return function(){var Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},se=Z.refKey,R=se===void 0?"ref":se,q=Z.onChange,ae=Z.onClick,le=vi(Z,IC),pe=Ja({accept:I,multiple:s,type:"file",style:{display:"none"},onChange:G(kt(q,te)),onClick:G(kt(ae,Ue)),tabIndex:-1},R,D);return Ne(Ne({},pe),le)}},[D,n,s,te,r]);return Ne(Ne({},$),{},{isFocused:b&&!r,getRootProps:Se,getInputProps:Ye,rootRef:M,inputRef:D,open:G(L)})}function FC(e,t){switch(t.type){case"focus":return Ne(Ne({},e),{},{isFocused:!0});case"blur":return Ne(Ne({},e),{},{isFocused:!1});case"openDialog":return Ne(Ne({},Xa),{},{isFileDialogActive:!0});case"closeDialog":return Ne(Ne({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Ne(Ne({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Ne(Ne({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return Ne({},Xa);default:return e}}function dp(){}const pp=({children:e})=>{const t=_.useRef(null),[n,r]=_.useState({open:!1}),i=({title:a,description:s,confirmButtonText:l,cancelButtonText:u,onConfirm:f,onCancel:c,initialValue:p,Content:d})=>new Promise((m,h)=>{t.current=p,r({open:!0,title:a,description:s,confirmButtonText:l,cancelButtonText:u,content:d?S.jsx(d,{value:p,setValue:g=>{t.current=g}}):null,onConfirm:()=>{f==null||f(),m(t.current),o()},onCancel:()=>{c==null||c(),h(),o()}})}),o=()=>{r(a=>({...a,open:!1}))};return S.jsxs(oa.Provider,{value:{showInputModal:i},children:[S.jsx(In,{open:n.open,onOpenChange:a=>r(s=>({...s,open:a})),children:S.jsx(In.Content,{title:n.title,description:n.description,confirmButtonText:n.confirmButtonText,cancelButtonText:n.cancelButtonText,onConfirm:n.onConfirm,onCancel:n.onCancel,children:n.content})}),e]})},RC=(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 s=document.createElement("link");s.rel="stylesheet",s.href=o,document.head.appendChild(s)},hp=({color:e,fontFamily:t,radius:n,themeMode:r,variant:i,headerVariant:o,additionalStylesheetUrl:a})=>{_.useMemo(()=>{t&&RC(t,["100","200","300","400","500","600","700","800"])},[t]);const s=_.useMemo(()=>sl({color:e,fontFamily:t,radius:n,themeMode:r,variant:i,headerVariant:o}),[e,t,n,r,i,o]);return S.jsxs(S.Fragment,{children:[a&&S.jsx("link",{rel:"stylesheet",href:a}),S.jsxs("style",{children:[s,`
298
+ */var Fa,Ld;function PE(){if(Ld)return Fa;Ld=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 a={},s=0;s<10;s++)a["_"+String.fromCharCode(s)]=s;var l=Object.getOwnPropertyNames(a).map(function(f){return a[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 Fa=i()?Object.assign:function(o,a){for(var s,l=r(o),u,f=1;f<arguments.length;f++){s=Object(arguments[f]);for(var c in s)t.call(s,c)&&(l[c]=s[c]);if(e){u=e(s);for(var p=0;p<u.length;p++)n.call(s,u[p])&&(l[u[p]]=s[u[p]])}}return l},Fa}var Ra,Fd;function Ba(){if(Fd)return Ra;Fd=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Ra=e,Ra}var za,Rd;function Bd(){return Rd||(Rd=1,za=Function.call.bind(Object.prototype.hasOwnProperty)),za}var $a,zd;function NE(){if(zd)return $a;zd=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Ba(),n={},r=Bd();e=function(o){var a="Warning: "+o;typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}}}function i(o,a,s,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 p=Error((l||"React class")+": "+s+" 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 p.name="Invariant Violation",p}c=o[f](a,f,l,s,null,t)}catch(m){c=m}if(c&&!(c instanceof Error)&&e((l||"React class")+": type specification of "+s+" `"+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 "+s+" type: "+c.message+(d??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},$a=i,$a}var ja,$d;function LE(){if($d)return ja;$d=1;var e=Nd(),t=PE(),n=Ba(),r=Bd(),i=NE(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(s){var l="Warning: "+s;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function a(){return null}return ja=function(s,l){var u=typeof Symbol=="function"&&Symbol.iterator,f="@@iterator";function c(b){var P=b&&(u&&b[u]||b[f]);if(typeof P=="function")return P}var p="<<anonymous>>",d={array:y("array"),bigint:y("bigint"),bool:y("boolean"),func:y("function"),number:y("number"),object:y("object"),string:y("string"),symbol:y("symbol"),any:v(),arrayOf:w,element:A(),elementType:k(),instanceOf:C,node:I(),objectOf:_,oneOf:T,oneOfType:F,shape:j,exact:z};function m(b,P){return b===P?b!==0||1/b===1/P:b!==b&&P!==P}function h(b,P){this.message=b,this.data=P&&typeof P=="object"?P:{},this.stack=""}h.prototype=Error.prototype;function g(b){if(process.env.NODE_ENV!=="production")var P={},H=0;function x(ee,Y,J,X,re,K,te){if(X=X||p,K=K||J,te!==n){if(l){var L=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 L.name="Invariant Violation",L}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ne=X+":"+J;!P[ne]&&H<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."),P[ne]=!0,H++)}}return Y[J]==null?ee?Y[J]===null?new h("The "+re+" `"+K+"` is marked as required "+("in `"+X+"`, but its value is `null`.")):new h("The "+re+" `"+K+"` is marked as required in "+("`"+X+"`, but its value is `undefined`.")):null:b(Y,J,X,re,K)}var V=x.bind(null,!1);return V.isRequired=x.bind(null,!0),V}function y(b){function P(H,x,V,ee,Y,J){var X=H[x],re=B(X);if(re!==b){var K=U(X);return new h("Invalid "+ee+" `"+Y+"` of type "+("`"+K+"` supplied to `"+V+"`, expected ")+("`"+b+"`."),{expectedType:b})}return null}return g(P)}function v(){return g(a)}function w(b){function P(H,x,V,ee,Y){if(typeof b!="function")return new h("Property `"+Y+"` of component `"+V+"` has invalid PropType notation inside arrayOf.");var J=H[x];if(!Array.isArray(J)){var X=B(J);return new h("Invalid "+ee+" `"+Y+"` of type "+("`"+X+"` supplied to `"+V+"`, expected an array."))}for(var re=0;re<J.length;re++){var K=b(J,re,V,ee,Y+"["+re+"]",n);if(K instanceof Error)return K}return null}return g(P)}function A(){function b(P,H,x,V,ee){var Y=P[H];if(!s(Y)){var J=B(Y);return new h("Invalid "+V+" `"+ee+"` of type "+("`"+J+"` supplied to `"+x+"`, expected a single ReactElement."))}return null}return g(b)}function k(){function b(P,H,x,V,ee){var Y=P[H];if(!e.isValidElementType(Y)){var J=B(Y);return new h("Invalid "+V+" `"+ee+"` of type "+("`"+J+"` supplied to `"+x+"`, expected a single ReactElement type."))}return null}return g(b)}function C(b){function P(H,x,V,ee,Y){if(!(H[x]instanceof b)){var J=b.name||p,X=W(H[x]);return new h("Invalid "+ee+" `"+Y+"` of type "+("`"+X+"` supplied to `"+V+"`, expected ")+("instance of `"+J+"`."))}return null}return g(P)}function T(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.")),a;function P(H,x,V,ee,Y){for(var J=H[x],X=0;X<b.length;X++)if(m(J,b[X]))return null;var re=JSON.stringify(b,function(te,L){var ne=U(L);return ne==="symbol"?String(L):L});return new h("Invalid "+ee+" `"+Y+"` of value `"+String(J)+"` "+("supplied to `"+V+"`, expected one of "+re+"."))}return g(P)}function _(b){function P(H,x,V,ee,Y){if(typeof b!="function")return new h("Property `"+Y+"` of component `"+V+"` has invalid PropType notation inside objectOf.");var J=H[x],X=B(J);if(X!=="object")return new h("Invalid "+ee+" `"+Y+"` of type "+("`"+X+"` supplied to `"+V+"`, expected an object."));for(var re in J)if(r(J,re)){var K=b(J,re,V,ee,Y+"."+re,n);if(K instanceof Error)return K}return null}return g(P)}function F(b){if(!Array.isArray(b))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var P=0;P<b.length;P++){var H=b[P];if(typeof H!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+$(H)+" at index "+P+"."),a}function x(V,ee,Y,J,X){for(var re=[],K=0;K<b.length;K++){var te=b[K],L=te(V,ee,Y,J,X,n);if(L==null)return null;L.data&&r(L.data,"expectedType")&&re.push(L.data.expectedType)}var ne=re.length>0?", expected one of type ["+re.join(", ")+"]":"";return new h("Invalid "+J+" `"+X+"` supplied to "+("`"+Y+"`"+ne+"."))}return g(x)}function I(){function b(P,H,x,V,ee){return M(P[H])?null:new h("Invalid "+V+" `"+ee+"` supplied to "+("`"+x+"`, expected a ReactNode."))}return g(b)}function O(b,P,H,x,V){return new h((b||"React class")+": "+P+" type `"+H+"."+x+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+V+"`.")}function j(b){function P(H,x,V,ee,Y){var J=H[x],X=B(J);if(X!=="object")return new h("Invalid "+ee+" `"+Y+"` of type `"+X+"` "+("supplied to `"+V+"`, expected `object`."));for(var re in b){var K=b[re];if(typeof K!="function")return O(V,ee,Y,re,U(K));var te=K(J,re,V,ee,Y+"."+re,n);if(te)return te}return null}return g(P)}function z(b){function P(H,x,V,ee,Y){var J=H[x],X=B(J);if(X!=="object")return new h("Invalid "+ee+" `"+Y+"` of type `"+X+"` "+("supplied to `"+V+"`, expected `object`."));var re=t({},H[x],b);for(var K in re){var te=b[K];if(r(b,K)&&typeof te!="function")return O(V,ee,Y,K,U(te));if(!te)return new h("Invalid "+ee+" `"+Y+"` key `"+K+"` supplied to `"+V+"`.\nBad object: "+JSON.stringify(H[x],null," ")+`
299
+ Valid keys: `+JSON.stringify(Object.keys(b),null," "));var L=te(J,K,V,ee,Y+"."+K,n);if(L)return L}return null}return g(P)}function M(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(M);if(b===null||s(b))return!0;var P=c(b);if(P){var H=P.call(b),x;if(P!==b.entries){for(;!(x=H.next()).done;)if(!M(x.value))return!1}else for(;!(x=H.next()).done;){var V=x.value;if(V&&!M(V[1]))return!1}}else return!1;return!0;default:return!1}}function D(b,P){return b==="symbol"?!0:P?P["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&P instanceof Symbol:!1}function B(b){var P=typeof b;return Array.isArray(b)?"array":b instanceof RegExp?"object":D(P,b)?"symbol":P}function U(b){if(typeof b>"u"||b===null)return""+b;var P=B(b);if(P==="object"){if(b instanceof Date)return"date";if(b instanceof RegExp)return"regexp"}return P}function $(b){var P=U(b);switch(P){case"array":case"object":return"an "+P;case"boolean":case"date":case"regexp":return"a "+P;default:return P}}function W(b){return!b.constructor||!b.constructor.name?p:b.constructor.name}return d.checkPropTypes=i,d.resetWarningCache=i.resetWarningCache,d.PropTypes=d,d},ja}var Ua,jd;function FE(){if(jd)return Ua;jd=1;var e=Ba();function t(){}function n(){}return n.resetWarningCache=t,Ua=function(){function r(a,s,l,u,f,c){if(c!==e){var p=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 p.name="Invariant Violation",p}}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},Ua}if(process.env.NODE_ENV!=="production"){var RE=Nd(),BE=!0;La.exports=LE()(RE.isElement,BE)}else La.exports=FE()();var zE=La.exports;const Te=jt(zE);var $E=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 cr(e,t){var n=jE(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 jE(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),i=$E.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var UE=[".DS_Store","Thumbs.db"];function HE(e){return ln(this,void 0,void 0,function(){return un(this,function(t){return di(e)&&WE(e.dataTransfer)?[2,YE(e.dataTransfer,e.type)]:VE(e)?[2,qE(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,KE(e)]:[2,[]]})})}function WE(e){return di(e)}function VE(e){return di(e)&&di(e.target)}function di(e){return typeof e=="object"&&e!==null}function qE(e){return Ha(e.target.files).map(function(t){return cr(t)})}function KE(e){return ln(this,void 0,void 0,function(){var t;return un(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 cr(r)})]}})})}function YE(e,t){return ln(this,void 0,void 0,function(){var n,r;return un(this,function(i){switch(i.label){case 0:return e.items?(n=Ha(e.items).filter(function(o){return o.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(GE))]):[3,2];case 1:return r=i.sent(),[2,Ud(Hd(r))];case 2:return[2,Ud(Ha(e.files).map(function(o){return cr(o)}))]}})})}function Ud(e){return e.filter(function(t){return UE.indexOf(t.name)===-1})}function Ha(e){if(e===null)return[];for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r)}return t}function GE(e){if(typeof e.webkitGetAsEntry!="function")return Wd(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?Vd(t):Wd(e)}function Hd(e){return e.reduce(function(t,n){return ra(ra([],sf(t),!1),sf(Array.isArray(n)?Hd(n):[n]),!1)},[])}function Wd(e){var t=e.getAsFile();if(!t)return Promise.reject("".concat(e," is not a File"));var n=cr(t);return Promise.resolve(n)}function QE(e){return ln(this,void 0,void 0,function(){return un(this,function(t){return[2,e.isDirectory?Vd(e):JE(e)]})})}function Vd(e){var t=e.createReader();return new Promise(function(n,r){var i=[];function o(){var a=this;t.readEntries(function(s){return ln(a,void 0,void 0,function(){var l,u,f;return un(this,function(c){switch(c.label){case 0:if(s.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(s.map(QE)),i.push(f),o(),c.label=6;case 6:return[2]}})})},function(s){r(s)})}o()})}function JE(e){return ln(this,void 0,void 0,function(){return un(this,function(t){return[2,new Promise(function(n,r){e.file(function(i){var o=cr(i,e.fullPath);n(o)},function(i){r(i)})})]})})}var ZE=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(a){var s=a.trim().toLowerCase();return s.charAt(0)==="."?r.toLowerCase().endsWith(s):s.endsWith("/*")?o===s.replace(/\/.*$/,""):i===s})}return!0};function qd(e){return tC(e)||eC(e)||Qd(e)||XE()}function XE(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
300
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eC(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function tC(e){if(Array.isArray(e))return Wa(e)}function Kd(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 Yd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Kd(Object(n),!0).forEach(function(r){Gd(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kd(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Gd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fr(e,t){return iC(e)||rC(e,t)||Qd(e,t)||nC()}function nC(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
301
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qd(e,t){if(e){if(typeof e=="string")return Wa(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 Wa(e,t)}}function Wa(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 rC(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,a,s;try{for(n=n.call(e);!(i=(a=n.next()).done)&&(r.push(a.value),!(t&&r.length===t));i=!0);}catch(l){o=!0,s=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw s}}return r}}function iC(e){if(Array.isArray(e))return e}var oC="file-invalid-type",aC="file-too-large",sC="file-too-small",lC="too-many-files",uC=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:oC,message:"File type must be ".concat(n)}},Jd=function(t){return{code:aC,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},Zd=function(t){return{code:sC,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},cC={code:lC,message:"Too many files"};function Xd(e,t){var n=e.type==="application/x-moz-file"||ZE(e,t);return[n,n?null:uC(t)]}function ep(e,t,n){if(Gt(e.size))if(Gt(t)&&Gt(n)){if(e.size>n)return[!1,Jd(n)];if(e.size<t)return[!1,Zd(t)]}else{if(Gt(t)&&e.size<t)return[!1,Zd(t)];if(Gt(n)&&e.size>n)return[!1,Jd(n)]}return[!0,null]}function Gt(e){return e!=null}function fC(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,o=e.multiple,a=e.maxFiles,s=e.validator;return!o&&t.length>1||o&&a>=1&&t.length>a?!1:t.every(function(l){var u=Xd(l,n),f=fr(u,1),c=f[0],p=ep(l,r,i),d=fr(p,1),m=d[0],h=s?s(l):null;return c&&m&&!h})}function pi(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function hi(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 tp(e){e.preventDefault()}function dC(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function pC(e){return e.indexOf("Edge/")!==-1}function hC(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return dC(e)||pC(e)}function kt(){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),a=1;a<i;a++)o[a-1]=arguments[a];return t.some(function(s){return!pi(r)&&s&&s.apply(void 0,[r].concat(o)),pi(r)})}}function mC(){return"showOpenFilePicker"in window}function gC(e){if(Gt(e)){var t=Object.entries(e).filter(function(n){var r=fr(n,2),i=r[0],o=r[1],a=!0;return np(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.')),a=!1),(!Array.isArray(o)||!o.every(rp))&&(console.warn('Skipped "'.concat(i,'" because an invalid file extension was provided.')),a=!1),a}).reduce(function(n,r){var i=fr(r,2),o=i[0],a=i[1];return Yd(Yd({},n),{},Gd({},o,a))},{});return[{description:"Files",accept:t}]}return e}function yC(e){if(Gt(e))return Object.entries(e).reduce(function(t,n){var r=fr(n,2),i=r[0],o=r[1];return[].concat(qd(t),[i],qd(o))},[]).filter(function(t){return np(t)||rp(t)}).join(",")}function vC(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function bC(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function np(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function rp(e){return/^.*\.[\w]+$/.test(e)}var wC=["children"],xC=["open"],kC=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],SC=["refKey","onChange","onClick"];function EC(e){return IC(e)||AC(e)||ip(e)||CC()}function CC(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
302
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function AC(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function IC(e){if(Array.isArray(e))return qa(e)}function Va(e,t){return DC(e)||OC(e,t)||ip(e,t)||TC()}function TC(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
303
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ip(e,t){if(e){if(typeof e=="string")return qa(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 qa(e,t)}}function qa(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 OC(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,a,s;try{for(n=n.call(e);!(i=(a=n.next()).done)&&(r.push(a.value),!(t&&r.length===t));i=!0);}catch(l){o=!0,s=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw s}}return r}}function DC(e){if(Array.isArray(e))return e}function op(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 Ne(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?op(Object(n),!0).forEach(function(r){Ka(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):op(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ka(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mi(e,t){if(e==null)return{};var n=MC(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 MC(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 Ya=N.forwardRef(function(e,t){var n=e.children,r=mi(e,wC),i=sp(r),o=i.open,a=mi(i,xC);return N.useImperativeHandle(t,function(){return{open:o}},[o]),N.createElement(N.Fragment,null,n(Ne(Ne({},a),{},{open:o})))});Ya.displayName="Dropzone";var ap={disabled:!1,getFilesFromEvent:HE,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};Ya.defaultProps=ap,Ya.propTypes={children:Te.func,accept:Te.objectOf(Te.arrayOf(Te.string)),multiple:Te.bool,preventDropOnDocument:Te.bool,noClick:Te.bool,noKeyboard:Te.bool,noDrag:Te.bool,noDragEventsBubbling:Te.bool,minSize:Te.number,maxSize:Te.number,maxFiles:Te.number,disabled:Te.bool,getFilesFromEvent:Te.func,onFileDialogCancel:Te.func,onFileDialogOpen:Te.func,useFsAccessApi:Te.bool,autoFocus:Te.bool,onDragEnter:Te.func,onDragLeave:Te.func,onDragOver:Te.func,onDrop:Te.func,onDropAccepted:Te.func,onDropRejected:Te.func,onError:Te.func,validator:Te.func};var Ga={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function sp(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Ne(Ne({},ap),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,o=t.maxSize,a=t.minSize,s=t.multiple,l=t.maxFiles,u=t.onDragEnter,f=t.onDragLeave,c=t.onDragOver,p=t.onDrop,d=t.onDropAccepted,m=t.onDropRejected,h=t.onFileDialogCancel,g=t.onFileDialogOpen,y=t.useFsAccessApi,v=t.autoFocus,w=t.preventDropOnDocument,A=t.noClick,k=t.noKeyboard,C=t.noDrag,T=t.noDragEventsBubbling,_=t.onError,F=t.validator,I=N.useMemo(function(){return yC(n)},[n]),O=N.useMemo(function(){return gC(n)},[n]),j=N.useMemo(function(){return typeof g=="function"?g:lp},[g]),z=N.useMemo(function(){return typeof h=="function"?h:lp},[h]),M=N.useRef(null),D=N.useRef(null),B=N.useReducer(_C,Ga),U=Va(B,2),$=U[0],W=U[1],b=$.isFocused,P=$.isFileDialogActive,H=N.useRef(typeof window<"u"&&window.isSecureContext&&y&&mC()),x=function(){!H.current&&P&&setTimeout(function(){if(D.current){var se=D.current.files;se.length||(W({type:"closeDialog"}),z())}},300)};N.useEffect(function(){return window.addEventListener("focus",x,!1),function(){window.removeEventListener("focus",x,!1)}},[D,P,z,H]);var V=N.useRef([]),ee=function(se){M.current&&M.current.contains(se.target)||(se.preventDefault(),V.current=[])};N.useEffect(function(){return w&&(document.addEventListener("dragover",tp,!1),document.addEventListener("drop",ee,!1)),function(){w&&(document.removeEventListener("dragover",tp),document.removeEventListener("drop",ee))}},[M,w]),N.useEffect(function(){return!r&&v&&M.current&&M.current.focus(),function(){}},[M,v,r]);var Y=N.useCallback(function(Z){_?_(Z):console.error(Z)},[_]),J=N.useCallback(function(Z){Z.preventDefault(),Z.persist(),we(Z),V.current=[].concat(EC(V.current),[Z.target]),hi(Z)&&Promise.resolve(i(Z)).then(function(se){if(!(pi(Z)&&!T)){var R=se.length,q=R>0&&fC({files:se,accept:I,minSize:a,maxSize:o,multiple:s,maxFiles:l,validator:F}),ae=R>0&&!q;W({isDragAccept:q,isDragReject:ae,isDragActive:!0,type:"setDraggedFiles"}),u&&u(Z)}}).catch(function(se){return Y(se)})},[i,u,Y,T,I,a,o,s,l,F]),X=N.useCallback(function(Z){Z.preventDefault(),Z.persist(),we(Z);var se=hi(Z);if(se&&Z.dataTransfer)try{Z.dataTransfer.dropEffect="copy"}catch{}return se&&c&&c(Z),!1},[c,T]),re=N.useCallback(function(Z){Z.preventDefault(),Z.persist(),we(Z);var se=V.current.filter(function(q){return M.current&&M.current.contains(q)}),R=se.indexOf(Z.target);R!==-1&&se.splice(R,1),V.current=se,!(se.length>0)&&(W({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),hi(Z)&&f&&f(Z))},[M,f,T]),K=N.useCallback(function(Z,se){var R=[],q=[];Z.forEach(function(ae){var le=Xd(ae,I),pe=Va(le,2),fe=pe[0],Ee=pe[1],Me=ep(ae,a,o),$e=Va(Me,2),gt=$e[0],ze=$e[1],lt=F?F(ae):null;if(fe&&gt&&!lt)R.push(ae);else{var Qe=[Ee,ze];lt&&(Qe=Qe.concat(lt)),q.push({file:ae,errors:Qe.filter(function(Li){return Li})})}}),(!s&&R.length>1||s&&l>=1&&R.length>l)&&(R.forEach(function(ae){q.push({file:ae,errors:[cC]})}),R.splice(0)),W({acceptedFiles:R,fileRejections:q,type:"setFiles"}),p&&p(R,q,se),q.length>0&&m&&m(q,se),R.length>0&&d&&d(R,se)},[W,s,I,a,o,l,p,d,m,F]),te=N.useCallback(function(Z){Z.preventDefault(),Z.persist(),we(Z),V.current=[],hi(Z)&&Promise.resolve(i(Z)).then(function(se){pi(Z)&&!T||K(se,Z)}).catch(function(se){return Y(se)}),W({type:"reset"})},[i,K,Y,T]),L=N.useCallback(function(){if(H.current){W({type:"openDialog"}),j();var Z={multiple:s,types:O};window.showOpenFilePicker(Z).then(function(se){return i(se)}).then(function(se){K(se,null),W({type:"closeDialog"})}).catch(function(se){vC(se)?(z(se),W({type:"closeDialog"})):bC(se)?(H.current=!1,D.current?(D.current.value=null,D.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(se)});return}D.current&&(W({type:"openDialog"}),j(),D.current.value=null,D.current.click())},[W,j,z,y,K,Y,O,s]),ne=N.useCallback(function(Z){!M.current||!M.current.isEqualNode(Z.target)||(Z.key===" "||Z.key==="Enter"||Z.keyCode===32||Z.keyCode===13)&&(Z.preventDefault(),L())},[M,L]),me=N.useCallback(function(){W({type:"focus"})},[]),ke=N.useCallback(function(){W({type:"blur"})},[]),oe=N.useCallback(function(){A||(hC()?setTimeout(L,0):L())},[A,L]),G=function(se){return r?null:se},ue=function(se){return k?null:G(se)},de=function(se){return C?null:G(se)},we=function(se){T&&se.stopPropagation()},Se=N.useMemo(function(){return function(){var Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},se=Z.refKey,R=se===void 0?"ref":se,q=Z.role,ae=Z.onKeyDown,le=Z.onFocus,pe=Z.onBlur,fe=Z.onClick,Ee=Z.onDragEnter,Me=Z.onDragOver,$e=Z.onDragLeave,gt=Z.onDrop,ze=mi(Z,kC);return Ne(Ne(Ka({onKeyDown:ue(kt(ae,ne)),onFocus:ue(kt(le,me)),onBlur:ue(kt(pe,ke)),onClick:G(kt(fe,oe)),onDragEnter:de(kt(Ee,J)),onDragOver:de(kt(Me,X)),onDragLeave:de(kt($e,re)),onDrop:de(kt(gt,te)),role:typeof q=="string"&&q!==""?q:"presentation"},R,M),!r&&!k?{tabIndex:0}:{}),ze)}},[M,ne,me,ke,oe,J,X,re,te,k,C,r]),He=N.useCallback(function(Z){Z.stopPropagation()},[]),Ge=N.useMemo(function(){return function(){var Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},se=Z.refKey,R=se===void 0?"ref":se,q=Z.onChange,ae=Z.onClick,le=mi(Z,SC),pe=Ka({accept:I,multiple:s,type:"file",style:{display:"none"},onChange:G(kt(q,te)),onClick:G(kt(ae,He)),tabIndex:-1},R,D);return Ne(Ne({},pe),le)}},[D,n,s,te,r]);return Ne(Ne({},$),{},{isFocused:b&&!r,getRootProps:Se,getInputProps:Ge,rootRef:M,inputRef:D,open:G(L)})}function _C(e,t){switch(t.type){case"focus":return Ne(Ne({},e),{},{isFocused:!0});case"blur":return Ne(Ne({},e),{},{isFocused:!1});case"openDialog":return Ne(Ne({},Ga),{},{isFileDialogActive:!0});case"closeDialog":return Ne(Ne({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Ne(Ne({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Ne(Ne({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return Ne({},Ga);default:return e}}function lp(){}const up=({children:e})=>{const t=N.useRef(null),[n,r]=N.useState({open:!1}),i=({title:a,description:s,confirmButtonText:l,cancelButtonText:u,onConfirm:f,onCancel:c,initialValue:p,Content:d})=>new Promise((m,h)=>{t.current=p,r({open:!0,title:a,description:s,confirmButtonText:l,cancelButtonText:u,content:d?S.jsx(d,{value:p,setValue:g=>{t.current=g}}):null,onConfirm:()=>{f==null||f(),m(t.current),o()},onCancel:()=>{c==null||c(),h(),o()}})}),o=()=>{r(a=>({...a,open:!1}))};return S.jsxs(ta.Provider,{value:{showInputModal:i},children:[S.jsx(In,{open:n.open,onOpenChange:a=>r(s=>({...s,open:a})),children:S.jsx(In.Content,{title:n.title,description:n.description,confirmButtonText:n.confirmButtonText,cancelButtonText:n.cancelButtonText,onConfirm:n.onConfirm,onCancel:n.onCancel,children:n.content})}),e]})},PC=(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 s=document.createElement("link");s.rel="stylesheet",s.href=o,document.head.appendChild(s)},cp=({color:e,fontFamily:t,radius:n,themeMode:r,variant:i,headerVariant:o,additionalStylesheetUrl:a})=>{N.useMemo(()=>{t&&PC(t,["100","200","300","400","500","600","700","800"])},[t]);const s=N.useMemo(()=>rl({color:e,fontFamily:t,radius:n,themeMode:r,variant:i,headerVariant:o}),[e,t,n,r,i,o]);return S.jsxs(S.Fragment,{children:[a&&S.jsx("link",{rel:"stylesheet",href:a}),S.jsxs("style",{children:[s,`
304
304
  .bpWebchat {
305
305
  border-radius: ${.375*(n??1)}rem;
306
306
  }
307
307
  .bpMessagePreview {
308
308
  border-radius: ${.125*(n??1)}rem;
309
309
  }
310
- `]})]})},es=({children:e,className:t,uploadFile:n,allowFileUpload:r,storageKey:i,connected:o,...a})=>{const{container:s}=ge,l=sn(g=>g.setMessageContainerRef),f=of(i)(g=>g.uploadFile),[c,p]=_.useState(0),d=_.useRef(null);_.useEffect(()=>{l(d)},[d,l]);const m=_.useCallback(g=>{n&&(g.forEach(y=>f(y,n)),p(0))},[f,n]),{getRootProps:h}=fp({noClick:!0,noKeyboard:!0,onDrop:m,disabled:!(r&&n),onDragEnter:()=>p(g=>g+1),onDragLeave:()=>p(g=>g-1)});return S.jsxs("div",{...a,className:dr(s.className,t),...h(),ref:d,children:[S.jsxs("div",{"data-hover":c>0,...s.dropzone.overlay,children:["Drop files to upload",S.jsx(R0,{style:{width:"50px"}})]}),S.jsx(pp,{children:e})]})};es.displayName="Container";const mp=_.forwardRef(({onClick:e,imgUrl:t,...n},r)=>{const{fab:i}=ge,{container:o,icon:a,image:s}=i??{};return t?S.jsx("img",{src:t,role:"button",tabIndex:0,...s,draggable:"false",onClick:e}):S.jsx("div",{...n,...o,ref:r,onClick:e,children:S.jsx("div",{...a})})});mp.displayName="Fab";function At(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 BC(e,t){const n=E.createContext(t),r=o=>{const{children:a,...s}=o,l=E.useMemo(()=>s,Object.values(s));return S.jsx(n.Provider,{value:l,children:a})};r.displayName=e+"Provider";function i(o){const a=E.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function gp(e,t=[]){let n=[];function r(o,a){const s=E.createContext(a),l=n.length;n=[...n,a];const u=c=>{var y;const{scope:p,children:d,...m}=c,h=((y=p==null?void 0:p[e])==null?void 0:y[l])||s,g=E.useMemo(()=>m,Object.values(m));return S.jsx(h.Provider,{value:g,children:d})};u.displayName=o+"Provider";function f(c,p){var h;const d=((h=p==null?void 0:p[e])==null?void 0:h[l])||s,m=E.useContext(d);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${c}\` must be used within \`${o}\``)}return[u,f]}const i=()=>{const o=n.map(a=>E.createContext(a));return function(s){const l=(s==null?void 0:s[e])||o;return E.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[r,zC(i,...t)]}function zC(...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 a=r.reduce((s,{useScope:l,scopeName:u})=>{const c=l(o)[`__scope${u}`];return{...s,...c}},{});return E.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var $C=E[" useInsertionEffect ".trim().toString()]||Tt;function yp({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,a]=jC({defaultProp:t,onChange:n}),s=e!==void 0,l=s?e:i;{const f=E.useRef(e!==void 0);E.useEffect(()=>{const c=f.current;c!==s&&console.warn(`${r} is changing from ${c?"controlled":"uncontrolled"} to ${s?"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=s},[s,r])}const u=E.useCallback(f=>{var c;if(s){const p=UC(f)?f(e):f;p!==e&&((c=a.current)==null||c.call(a,p))}else o(f)},[s,e,o,a]);return[l,u]}function jC({defaultProp:e,onChange:t}){const[n,r]=E.useState(e),i=E.useRef(n),o=E.useRef(t);return $C(()=>{o.current=t},[t]),E.useEffect(()=>{var a;i.current!==n&&((a=o.current)==null||a.call(o,n),i.current=n)},[n,i]),[n,r,o]}function UC(e){return typeof e=="function"}function vp(e){const t=HC(e),n=E.forwardRef((r,i)=>{const{children:o,...a}=r,s=E.Children.toArray(o),l=s.find(VC);if(l){const u=l.props.children,f=s.map(c=>c===l?E.Children.count(u)>1?E.Children.only(null):E.isValidElement(u)?u.props.children:null:c);return S.jsx(t,{...a,ref:i,children:E.isValidElement(u)?E.cloneElement(u,void 0,f):null})}return S.jsx(t,{...a,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function HC(e){const t=E.forwardRef((n,r)=>{const{children:i,...o}=n;if(E.isValidElement(i)){const a=KC(i),s=qC(o,i.props);return i.type!==E.Fragment&&(s.ref=r?ji(r,a):a),E.cloneElement(i,s)}return E.Children.count(i)>1?E.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var WC=Symbol("radix.slottable");function VC(e){return E.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===WC}function qC(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]=(...s)=>{const l=o(...s);return i(...s),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function KC(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 YC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ht=YC.reduce((e,t)=>{const n=vp(`Primitive.${t}`),r=E.forwardRef((i,o)=>{const{asChild:a,...s}=i,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(l,{...s,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function GC(e,t){e&&Ls.flushSync(()=>e.dispatchEvent(t))}function QC(e,t){return E.useReducer((n,r)=>t[n][r]??n,e)}var bi=e=>{const{present:t,children:n}=e,r=JC(t),i=typeof n=="function"?n({present:r.isPresent}):E.Children.only(n),o=Ot(r.ref,ZC(i));return typeof n=="function"||r.isPresent?E.cloneElement(i,{ref:o}):null};bi.displayName="Presence";function JC(e){const[t,n]=E.useState(),r=E.useRef(null),i=E.useRef(e),o=E.useRef("none"),a=e?"mounted":"unmounted",[s,l]=QC(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return E.useEffect(()=>{const u=wi(r.current);o.current=s==="mounted"?u:"none"},[s]),Tt(()=>{const u=r.current,f=i.current;if(f!==e){const p=o.current,d=wi(u);e?l("MOUNT"):d==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(f&&p!==d?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),Tt(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,c=d=>{const h=wi(r.current).includes(CSS.escape(d.animationName));if(d.target===t&&h&&(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)})}},p=d=>{d.target===t&&(o.current=wi(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:E.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function wi(e){return(e==null?void 0:e.animationName)||"none"}function ZC(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 XC=E[" useId ".trim().toString()]||(()=>{}),eA=0;function xi(e){const[t,n]=E.useState(XC());return Tt(()=>{n(r=>r??String(eA++))},[e]),e||(t?`radix-${t}`:"")}var ki="Collapsible",[tA]=gp(ki),[nA,ts]=tA(ki),bp=E.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:a,...s}=e,[l,u]=yp({prop:r,defaultProp:i??!1,onChange:a,caller:ki});return S.jsx(nA,{scope:n,disabled:o,contentId:xi(),open:l,onOpenToggle:E.useCallback(()=>u(f=>!f),[u]),children:S.jsx(ht.div,{"data-state":rs(l),"data-disabled":o?"":void 0,...s,ref:t})})});bp.displayName=ki;var wp="CollapsibleTrigger",xp=E.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=ts(wp,n);return S.jsx(ht.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":rs(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:At(e.onClick,i.onOpenToggle)})});xp.displayName=wp;var ns="CollapsibleContent",kp=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=ts(ns,e.__scopeCollapsible);return S.jsx(bi,{present:n||i.open,children:({present:o})=>S.jsx(rA,{...r,ref:t,present:o})})});kp.displayName=ns;var rA=E.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=e,a=ts(ns,n),[s,l]=E.useState(r),u=E.useRef(null),f=Ot(t,u),c=E.useRef(0),p=c.current,d=E.useRef(0),m=d.current,h=a.open||s,g=E.useRef(h),y=E.useRef(void 0);return E.useEffect(()=>{const v=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(v)},[]),Tt(()=>{const v=u.current;if(v){y.current=y.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const w=v.getBoundingClientRect();c.current=w.height,d.current=w.width,g.current||(v.style.transitionDuration=y.current.transitionDuration,v.style.animationName=y.current.animationName),l(r)}},[a.open,r]),S.jsx(ht.div,{"data-state":rs(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!h,...o,ref:f,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:h&&i})});function rs(e){return e?"open":"closed"}var iA=bp,oA=kp;const is=({restartConversation:e,...t})=>{var o,a;const{header:n}=ge,{showInputModal:r}=aa(),i=async s=>{s.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 S.jsx(J0,{...t,...(a=(o=n==null?void 0:n.content)==null?void 0:o.actions)==null?void 0:a.icons,"aria-label":"Restart Conversation Button",tabIndex:0,role:"button",onClick:i})},Sp=({onClick:e,...t})=>{const{header:n}=ge,r=i=>{i.stopPropagation(),e==null||e()};return S.jsx(Fc,{...t,...n.content.actions.icons,role:"button",tabIndex:0,"aria-label":"Close Chatbot Button",onClick:r,onKeyDown:i=>{i.key==="Enter"&&r(i)}})},mr=({icon:e,title:t,link:n,...r})=>{var a,s,l,u,f,c,p,d,m,h,g,y;const{header:i}=ge,o=e??B0;return t?n?S.jsxs("a",{...r,...(s=(a=i.expandedContent)==null?void 0:a.descriptionItems)==null?void 0:s.container,href:n,target:"_blank",rel:"noreferrer noopener",children:[S.jsx(o,{...(u=(l=i.expandedContent)==null?void 0:l.descriptionItems)==null?void 0:u.icon}),S.jsx("p",{...(c=(f=i.expandedContent)==null?void 0:f.descriptionItems)==null?void 0:c.link,children:t})]}):S.jsxs("div",{...r,...(d=(p=i.expandedContent)==null?void 0:p.descriptionItems)==null?void 0:d.container,children:[S.jsx(o,{...(h=(m=i.expandedContent)==null?void 0:m.descriptionItems)==null?void 0:h.icon}),S.jsx("p",{...(y=(g=i.expandedContent)==null?void 0:g.descriptionItems)==null?void 0:y.text,children:t})]}):null},aA=({soundOn:e,toggleSound:t})=>{const n=o=>{o.stopPropagation(),t==null||t()},{header:r}=ge,i=e?Lc:n1;return S.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:S.jsx(i,{size:16})})},Ep=({defaultOpen:e,closeWindow:t,configuration:n,restartConversation:r,disabled:i,soundOn:o,toggleSound:a,clientId:s,...l})=>{var m,h,g,y,v,w,A,k,C,T,P,F,I,O,j,z,M,D,B,U,$,V,b,N;const{header:u}=ge,[f,c]=_.useState(e),p=!!((m=n.email)!=null&&m.title)||!!((h=n.phone)!=null&&h.title)||!!((g=n.website)!=null&&g.title)||!!((y=n.termsOfService)!=null&&y.link)||!!((v=n.privacyPolicy)!=null&&v.link),d=p&&!i;return S.jsxs(iA,{open:d?f:!1,onOpenChange:c,"data-disabled":d?void 0:"",...u.container,...l,children:[S.jsxs(xp,{"aria-label":"Expand Header Button",...u.content.container,children:[S.jsx(Nn,{userId:s,src:n.botAvatar,...u.content.avatar,children:n.botName||"Bot"}),S.jsx("h2",{...u.content.title,children:n.botName||"Bot"}),n.botDescription&&S.jsx("p",{...u.content.description,children:n.botDescription}),S.jsxs("div",{...u.content.actions.container,children:[n.soundEnabled&&o!==void 0&&a&&S.jsx(aA,{soundOn:o,toggleSound:a})," ",r&&S.jsx(is,{restartConversation:r}),t&&S.jsx(Sp,{onClick:t})]})]}),p&&S.jsxs(oA,{...u.expandedContent.container,children:[S.jsxs("div",{"data-links":"",...u.expandedContent.group,children:[S.jsx(mr,{"data-email":"",icon:V0,title:(w=n.email)==null?void 0:w.title,link:(k=(A=n.email)==null?void 0:A.link)!=null&&k.startsWith("mailto:")?(C=n.email)==null?void 0:C.link:`mailto:${(T=n.email)==null?void 0:T.link}`}),S.jsx(mr,{"data-phone":"",icon:G0,title:(P=n.phone)==null?void 0:P.title,link:(I=(F=n.phone)==null?void 0:F.link)!=null&&I.startsWith("tel:")?(O=n.phone)==null?void 0:O.link:`tel:${(j=n.phone)==null?void 0:j.link}`}),S.jsx(mr,{"data-website":"",link:(z=n.website)==null?void 0:z.link,icon:j0,title:(M=n.website)==null?void 0:M.title})]}),S.jsxs("div",{"data-legal":"",...(D=u.expandedContent)==null?void 0:D.group,children:[((B=n.termsOfService)==null?void 0:B.link)&&S.jsx(mr,{"data-terms":"",link:(U=n.termsOfService)==null?void 0:U.link,icon:Pc,title:($=n.termsOfService)==null?void 0:$.title}),((V=n.privacyPolicy)==null?void 0:V.link)&&S.jsx(mr,{"data-privacy":"",link:(b=n.privacyPolicy)==null?void 0:b.link,icon:W0,title:(N=n.privacyPolicy)==null?void 0:N.title})]})]})]})},os=_.memo(({...e})=>{const{typingIndicator:t}=ge;return S.jsx("div",{...e,...t==null?void 0:t.container,children:S.jsx("div",{...t==null?void 0:t.loader})})});os.displayName="TypingIndicator";const as=_.memo(_.forwardRef(({direction:e,block:t,disableInput:n,children:r,sender:i,id:o,authorId:a,status:s,renderers:l,isReadOnly:u,isLastDeliveredMessage:f,feedback:c,timestamp:p,metadata:d,sendMessage:m,addMessageFeedback:h,showAvatar:g},y)=>{const[v,w]=_.useState([]),{message:{container:A,deliveryStatus:k}}=ge;return g=g??e==="incoming",S.jsx(ia.Provider,{value:{isLoading:v,setIsLoading:w},children:S.jsxs("div",{...A,className:dr(A==null?void 0:A.className,f&&(k==null?void 0:k.className)),"data-loaded":v.length===0,"data-disable-input":!!n,"data-direction":e,dir:"auto",ref:y,children:[e==="incoming"&&g&&S.jsx(Cp,{authorId:a,sender:i}),t&&S.jsx(Yt,{block:{...t,isReadOnly:u,direction:e,timestamp:p,sender:i,feedback:c,messageId:o,status:s,metadata:d,sendMessage:m,addMessageFeedback:h},renderers:l}),e==="outgoing"&&g&&S.jsx(Cp,{authorId:a,sender:i}),r]})})})),Cp=({authorId:e,sender:t})=>{const{message:{avatar:n}}=ge,[r,i]=_.useState("idle"),o=Vs(e??"",15);return S.jsxs(Ki,{"data-color":o,"data-loading-status":r,...n==null?void 0:n.container,children:[S.jsx(Yi,{...n==null?void 0:n.image,onLoadingStatusChange:i,src:t==null?void 0:t.avatar}),S.jsxs(Gi,{...n==null?void 0:n.fallback,children:[t==null?void 0:t.name[0]," "]})]})};function sA({botAvatar:e,botDescription:t,botName:n}){const{messageList:{marquee:r}}=ge;return S.jsxs("li",{...r.container,children:[S.jsx(Nn,{src:e,...r.avatar,children:(n||"Bot").slice(0,1)}),S.jsxs("div",{...r.content,children:[S.jsx("h1",{...r.title,children:n||"Bot"}),S.jsx("p",{...r.description,children:t})]})]})}let ss=(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),"");/*!---------------------------------------------------------------------------------------------
310
+ `]})]})},Qa=({children:e,className:t,uploadFile:n,allowFileUpload:r,storageKey:i,...o})=>{const{container:a}=ge,s=sn(h=>h.setMessageContainerRef),u=ef(i)(h=>h.uploadFile),[f,c]=N.useState(0),p=N.useRef(null);N.useEffect(()=>{s(p)},[p,s]);const d=N.useCallback(h=>{n&&(h.forEach(g=>u(g,n)),c(0))},[u,n]),{getRootProps:m}=sp({noClick:!0,noKeyboard:!0,onDrop:d,disabled:!(r&&n),onDragEnter:()=>c(h=>h+1),onDragLeave:()=>c(h=>h-1)});return S.jsxs("div",{...o,className:ur(a.className,t),...m(),ref:p,children:[S.jsxs("div",{"data-hover":f>0,...a.dropzone.overlay,children:["Drop files to upload",S.jsx(P0,{style:{width:"50px"}})]}),S.jsx(up,{children:e})]})};Qa.displayName="Container";const fp=N.forwardRef(({onClick:e,imgUrl:t,...n},r)=>{const{fab:i}=ge,{container:o,icon:a,image:s}=i??{};return t?S.jsx("img",{src:t,role:"button",tabIndex:0,...s,draggable:"false",onClick:e}):S.jsx("div",{...n,...o,ref:r,onClick:e,children:S.jsx("div",{...a})})});fp.displayName="Fab";function At(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 NC(e,t){const n=E.createContext(t),r=o=>{const{children:a,...s}=o,l=E.useMemo(()=>s,Object.values(s));return S.jsx(n.Provider,{value:l,children:a})};r.displayName=e+"Provider";function i(o){const a=E.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function dp(e,t=[]){let n=[];function r(o,a){const s=E.createContext(a),l=n.length;n=[...n,a];const u=c=>{var y;const{scope:p,children:d,...m}=c,h=((y=p==null?void 0:p[e])==null?void 0:y[l])||s,g=E.useMemo(()=>m,Object.values(m));return S.jsx(h.Provider,{value:g,children:d})};u.displayName=o+"Provider";function f(c,p){var h;const d=((h=p==null?void 0:p[e])==null?void 0:h[l])||s,m=E.useContext(d);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${c}\` must be used within \`${o}\``)}return[u,f]}const i=()=>{const o=n.map(a=>E.createContext(a));return function(s){const l=(s==null?void 0:s[e])||o;return E.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[r,LC(i,...t)]}function LC(...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 a=r.reduce((s,{useScope:l,scopeName:u})=>{const c=l(o)[`__scope${u}`];return{...s,...c}},{});return E.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var FC=E[" useInsertionEffect ".trim().toString()]||Tt;function pp({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,a]=RC({defaultProp:t,onChange:n}),s=e!==void 0,l=s?e:i;{const f=E.useRef(e!==void 0);E.useEffect(()=>{const c=f.current;c!==s&&console.warn(`${r} is changing from ${c?"controlled":"uncontrolled"} to ${s?"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=s},[s,r])}const u=E.useCallback(f=>{var c;if(s){const p=BC(f)?f(e):f;p!==e&&((c=a.current)==null||c.call(a,p))}else o(f)},[s,e,o,a]);return[l,u]}function RC({defaultProp:e,onChange:t}){const[n,r]=E.useState(e),i=E.useRef(n),o=E.useRef(t);return FC(()=>{o.current=t},[t]),E.useEffect(()=>{var a;i.current!==n&&((a=o.current)==null||a.call(o,n),i.current=n)},[n,i]),[n,r,o]}function BC(e){return typeof e=="function"}function hp(e){const t=zC(e),n=E.forwardRef((r,i)=>{const{children:o,...a}=r,s=E.Children.toArray(o),l=s.find(jC);if(l){const u=l.props.children,f=s.map(c=>c===l?E.Children.count(u)>1?E.Children.only(null):E.isValidElement(u)?u.props.children:null:c);return S.jsx(t,{...a,ref:i,children:E.isValidElement(u)?E.cloneElement(u,void 0,f):null})}return S.jsx(t,{...a,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function zC(e){const t=E.forwardRef((n,r)=>{const{children:i,...o}=n;if(E.isValidElement(i)){const a=HC(i),s=UC(o,i.props);return i.type!==E.Fragment&&(s.ref=r?Ri(r,a):a),E.cloneElement(i,s)}return E.Children.count(i)>1?E.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var $C=Symbol("radix.slottable");function jC(e){return E.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===$C}function UC(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]=(...s)=>{const l=o(...s);return i(...s),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function HC(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 WC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ht=WC.reduce((e,t)=>{const n=hp(`Primitive.${t}`),r=E.forwardRef((i,o)=>{const{asChild:a,...s}=i,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(l,{...s,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function VC(e,t){e&&Ms.flushSync(()=>e.dispatchEvent(t))}function qC(e,t){return E.useReducer((n,r)=>t[n][r]??n,e)}var gi=e=>{const{present:t,children:n}=e,r=KC(t),i=typeof n=="function"?n({present:r.isPresent}):E.Children.only(n),o=Ot(r.ref,YC(i));return typeof n=="function"||r.isPresent?E.cloneElement(i,{ref:o}):null};gi.displayName="Presence";function KC(e){const[t,n]=E.useState(),r=E.useRef(null),i=E.useRef(e),o=E.useRef("none"),a=e?"mounted":"unmounted",[s,l]=qC(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return E.useEffect(()=>{const u=yi(r.current);o.current=s==="mounted"?u:"none"},[s]),Tt(()=>{const u=r.current,f=i.current;if(f!==e){const p=o.current,d=yi(u);e?l("MOUNT"):d==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(f&&p!==d?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),Tt(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,c=d=>{const h=yi(r.current).includes(CSS.escape(d.animationName));if(d.target===t&&h&&(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)})}},p=d=>{d.target===t&&(o.current=yi(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:E.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function yi(e){return(e==null?void 0:e.animationName)||"none"}function YC(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 GC=E[" useId ".trim().toString()]||(()=>{}),QC=0;function vi(e){const[t,n]=E.useState(GC());return Tt(()=>{n(r=>r??String(QC++))},[e]),e||(t?`radix-${t}`:"")}var bi="Collapsible",[JC]=dp(bi),[ZC,Ja]=JC(bi),mp=E.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:a,...s}=e,[l,u]=pp({prop:r,defaultProp:i??!1,onChange:a,caller:bi});return S.jsx(ZC,{scope:n,disabled:o,contentId:vi(),open:l,onOpenToggle:E.useCallback(()=>u(f=>!f),[u]),children:S.jsx(ht.div,{"data-state":Xa(l),"data-disabled":o?"":void 0,...s,ref:t})})});mp.displayName=bi;var gp="CollapsibleTrigger",yp=E.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=Ja(gp,n);return S.jsx(ht.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":Xa(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:At(e.onClick,i.onOpenToggle)})});yp.displayName=gp;var Za="CollapsibleContent",vp=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Ja(Za,e.__scopeCollapsible);return S.jsx(gi,{present:n||i.open,children:({present:o})=>S.jsx(XC,{...r,ref:t,present:o})})});vp.displayName=Za;var XC=E.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=e,a=Ja(Za,n),[s,l]=E.useState(r),u=E.useRef(null),f=Ot(t,u),c=E.useRef(0),p=c.current,d=E.useRef(0),m=d.current,h=a.open||s,g=E.useRef(h),y=E.useRef(void 0);return E.useEffect(()=>{const v=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(v)},[]),Tt(()=>{const v=u.current;if(v){y.current=y.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const w=v.getBoundingClientRect();c.current=w.height,d.current=w.width,g.current||(v.style.transitionDuration=y.current.transitionDuration,v.style.animationName=y.current.animationName),l(r)}},[a.open,r]),S.jsx(ht.div,{"data-state":Xa(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!h,...o,ref:f,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:h&&i})});function Xa(e){return e?"open":"closed"}var eA=mp,tA=vp;const es=({restartConversation:e,...t})=>{var o,a;const{header:n}=ge,{showInputModal:r}=na(),i=async s=>{s.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 S.jsx(K0,{...t,...(a=(o=n==null?void 0:n.content)==null?void 0:o.actions)==null?void 0:a.icons,"aria-label":"Restart Conversation Button",tabIndex:0,role:"button",onClick:i})},bp=({onClick:e,...t})=>{const{header:n}=ge,r=i=>{i.stopPropagation(),e==null||e()};return S.jsx(_c,{...t,...n.content.actions.icons,role:"button",tabIndex:0,"aria-label":"Close Chatbot Button",onClick:r,onKeyDown:i=>{i.key==="Enter"&&r(i)}})},dr=({icon:e,title:t,link:n,...r})=>{var a,s,l,u,f,c,p,d,m,h,g,y;const{header:i}=ge,o=e??N0;return t?n?S.jsxs("a",{...r,...(s=(a=i.expandedContent)==null?void 0:a.descriptionItems)==null?void 0:s.container,href:n,target:"_blank",rel:"noreferrer noopener",children:[S.jsx(o,{...(u=(l=i.expandedContent)==null?void 0:l.descriptionItems)==null?void 0:u.icon}),S.jsx("p",{...(c=(f=i.expandedContent)==null?void 0:f.descriptionItems)==null?void 0:c.link,children:t})]}):S.jsxs("div",{...r,...(d=(p=i.expandedContent)==null?void 0:p.descriptionItems)==null?void 0:d.container,children:[S.jsx(o,{...(h=(m=i.expandedContent)==null?void 0:m.descriptionItems)==null?void 0:h.icon}),S.jsx("p",{...(y=(g=i.expandedContent)==null?void 0:g.descriptionItems)==null?void 0:y.text,children:t})]}):null},nA=({soundOn:e,toggleSound:t})=>{const n=o=>{o.stopPropagation(),t==null||t()},{header:r}=ge,i=e?Mc:Z0;return S.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:S.jsx(i,{size:16})})},wp=({defaultOpen:e,closeWindow:t,configuration:n,restartConversation:r,disabled:i,soundOn:o,toggleSound:a,clientId:s,...l})=>{var m,h,g,y,v,w,A,k,C,T,_,F,I,O,j,z,M,D,B,U,$,W,b,P;const{header:u}=ge,[f,c]=N.useState(e),p=!!((m=n.email)!=null&&m.title)||!!((h=n.phone)!=null&&h.title)||!!((g=n.website)!=null&&g.title)||!!((y=n.termsOfService)!=null&&y.link)||!!((v=n.privacyPolicy)!=null&&v.link),d=p&&!i;return S.jsxs(eA,{open:d?f:!1,onOpenChange:c,"data-disabled":d?void 0:"",...u.container,...l,children:[S.jsxs(yp,{"aria-label":"Expand Header Button",...u.content.container,children:[S.jsx(Mn,{userId:s,src:n.botAvatar,...u.content.avatar,children:n.botName||"Bot"}),S.jsx("h2",{...u.content.title,children:n.botName||"Bot"}),n.botDescription&&S.jsx("p",{...u.content.description,children:n.botDescription}),S.jsxs("div",{...u.content.actions.container,children:[n.soundEnabled&&o!==void 0&&a&&S.jsx(nA,{soundOn:o,toggleSound:a})," ",r&&S.jsx(es,{restartConversation:r}),t&&S.jsx(bp,{onClick:t})]})]}),p&&S.jsxs(tA,{...u.expandedContent.container,children:[S.jsxs("div",{"data-links":"",...u.expandedContent.group,children:[S.jsx(dr,{"data-email":"",icon:j0,title:(w=n.email)==null?void 0:w.title,link:(k=(A=n.email)==null?void 0:A.link)!=null&&k.startsWith("mailto:")?(C=n.email)==null?void 0:C.link:`mailto:${(T=n.email)==null?void 0:T.link}`}),S.jsx(dr,{"data-phone":"",icon:V0,title:(_=n.phone)==null?void 0:_.title,link:(I=(F=n.phone)==null?void 0:F.link)!=null&&I.startsWith("tel:")?(O=n.phone)==null?void 0:O.link:`tel:${(j=n.phone)==null?void 0:j.link}`}),S.jsx(dr,{"data-website":"",link:(z=n.website)==null?void 0:z.link,icon:R0,title:(M=n.website)==null?void 0:M.title})]}),S.jsxs("div",{"data-legal":"",...(D=u.expandedContent)==null?void 0:D.group,children:[((B=n.termsOfService)==null?void 0:B.link)&&S.jsx(dr,{"data-terms":"",link:(U=n.termsOfService)==null?void 0:U.link,icon:Oc,title:($=n.termsOfService)==null?void 0:$.title}),((W=n.privacyPolicy)==null?void 0:W.link)&&S.jsx(dr,{"data-privacy":"",link:(b=n.privacyPolicy)==null?void 0:b.link,icon:$0,title:(P=n.privacyPolicy)==null?void 0:P.title})]})]})]})},ts=N.memo(({...e})=>{const{typingIndicator:t}=ge;return S.jsx("div",{...e,...t==null?void 0:t.container,children:S.jsx("div",{...t==null?void 0:t.loader})})});ts.displayName="TypingIndicator";const ns=N.memo(N.forwardRef(({direction:e,block:t,disableInput:n,children:r,sender:i,id:o,authorId:a,status:s,renderers:l,isReadOnly:u,isLastDeliveredMessage:f,feedback:c,timestamp:p,metadata:d,sendMessage:m,addMessageFeedback:h,showAvatar:g},y)=>{const[v,w]=N.useState([]),{message:{container:A,deliveryStatus:k}}=ge;return g=g??e==="incoming",S.jsx(ea.Provider,{value:{isLoading:v,setIsLoading:w},children:S.jsxs("div",{...A,className:ur(A==null?void 0:A.className,f&&(k==null?void 0:k.className)),"data-loaded":v.length===0,"data-disable-input":!!n,"data-direction":e,dir:"auto",ref:y,children:[e==="incoming"&&g&&S.jsx(xp,{authorId:a,sender:i}),t&&S.jsx(Yt,{block:{...t,isReadOnly:u,direction:e,timestamp:p,sender:i,feedback:c,messageId:o,status:s,metadata:d,sendMessage:m,addMessageFeedback:h},renderers:l}),e==="outgoing"&&g&&S.jsx(xp,{authorId:a,sender:i}),r]})})})),xp=({authorId:e,sender:t})=>{const{message:{avatar:n}}=ge,[r,i]=N.useState("idle"),o=js(e??"",15);return S.jsxs(Hi,{"data-color":o,"data-loading-status":r,...n==null?void 0:n.container,children:[S.jsx(Wi,{...n==null?void 0:n.image,onLoadingStatusChange:i,src:t==null?void 0:t.avatar}),S.jsxs(Vi,{...n==null?void 0:n.fallback,children:[t==null?void 0:t.name[0]," "]})]})};function rA({botAvatar:e,botDescription:t,botName:n}){const{messageList:{marquee:r}}=ge;return S.jsxs("li",{...r.container,children:[S.jsx(Mn,{src:e,...r.avatar,children:(n||"Bot").slice(0,1)}),S.jsxs("div",{...r.content,children:[S.jsx("h1",{...r.title,children:n||"Bot"}),S.jsx("p",{...r.description,children:t})]})]})}let rs=(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),"");/*!---------------------------------------------------------------------------------------------
311
311
  * Copyright (c) StackBlitz. All rights reserved.
312
312
  * Licensed under the MIT License. See License.txt in the project root for license information.
313
- *--------------------------------------------------------------------------------------------*/const lA={damping:.7,stiffness:.05,mass:1.25},uA=70,cA=1e3/60,fA=350;let Si=!1;(Rh=globalThis.document)==null||Rh.addEventListener("mousedown",()=>{Si=!0}),(Bh=globalThis.document)==null||Bh.addEventListener("mouseup",()=>{Si=!1}),(zh=globalThis.document)==null||zh.addEventListener("click",()=>{Si=!1});const dA=(e={})=>{const[t,n]=_.useState(!1),[r,i]=_.useState(e.initial!==!1),[o,a]=_.useState(!1),s=_.useRef(null);s.current=e;const l=_.useCallback(()=>{var A;if(!Si)return!1;const v=window.getSelection();if(!v||!v.rangeCount)return!1;const w=v.getRangeAt(0);return w.commonAncestorContainer.contains(g.current)||((A=g.current)==null?void 0:A.contains(w.commonAncestorContainer))},[]),u=_.useCallback(v=>{c.isAtBottom=v,i(v)},[]),f=_.useCallback(v=>{c.escapedFromLock=v,n(v)},[]),c=_.useMemo(()=>{let v;return{escapedFromLock:t,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){var w;return((w=g.current)==null?void 0:w.scrollTop)??0},set scrollTop(w){g.current&&(g.current.scrollTop=w,c.ignoreScrollToTop=g.current.scrollTop)},get targetScrollTop(){return!g.current||!y.current?0:g.current.scrollHeight-1-g.current.clientHeight},get calculatedTargetScrollTop(){if(!g.current||!y.current)return 0;const{targetScrollTop:w}=this;if(!e.targetScrollTop)return w;if((v==null?void 0:v.targetScrollTop)===w)return v.calculatedScrollTop;const A=Math.max(Math.min(e.targetScrollTop(w,{scrollElement:g.current,contentElement:y.current}),w),0);return v={targetScrollTop:w,calculatedScrollTop:A},requestAnimationFrame(()=>{v=void 0}),A},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=uA}}},[]),p=_.useCallback((v={})=>{var F;typeof v=="string"&&(v={animation:v}),v.preserveScrollPosition||u(!0);const w=Date.now()+(Number(v.wait)||0),A=us(s.current,v.animation),{ignoreEscapes:k=!1}=v;let C,T=c.calculatedTargetScrollTop;v.duration instanceof Promise?v.duration.finally(()=>{C=Date.now()}):C=w+(v.duration??0);const P=async()=>{const I=new Promise(requestAnimationFrame).then(()=>{var M;if(!c.isAtBottom)return c.animation=void 0,!1;const{scrollTop:O}=c,j=performance.now(),z=(j-(c.lastTick??j))/cA;if(c.animation||(c.animation={behavior:A,promise:I,ignoreEscapes:k}),c.animation.behavior===A&&(c.lastTick=j),l()||w>Date.now())return P();if(O<Math.min(T,c.calculatedTargetScrollTop)){if(((M=c.animation)==null?void 0:M.behavior)===A){if(A==="instant")return c.scrollTop=c.calculatedTargetScrollTop,P();c.velocity=(A.damping*c.velocity+A.stiffness*c.scrollDifference)/A.mass,c.accumulated+=c.velocity*z,c.scrollTop+=c.accumulated,c.scrollTop!==O&&(c.accumulated=0)}return P()}return C>Date.now()?(T=c.calculatedTargetScrollTop,P()):(c.animation=void 0,c.scrollTop<c.calculatedTargetScrollTop?p({animation:us(s.current,s.current.resize),ignoreEscapes:k,duration:Math.max(0,C-Date.now())||void 0}):c.isAtBottom)});return I.then(O=>(requestAnimationFrame(()=>{c.animation||(c.lastTick=void 0,c.velocity=0)}),O))};return v.wait!==!0&&(c.animation=void 0),((F=c.animation)==null?void 0:F.behavior)===A?c.animation.promise:P()},[u,l,c]),d=_.useCallback(()=>{f(!0),u(!1)},[f,u]),m=_.useCallback(({target:v})=>{if(v!==g.current)return;const{scrollTop:w,ignoreScrollToTop:A}=c;let{lastScrollTop:k=w}=c;c.lastScrollTop=w,c.ignoreScrollToTop=void 0,A&&A>w&&(k=A),a(c.isNearBottom),setTimeout(()=>{var P;if(c.resizeDifference||w===A)return;if(l()){f(!0),u(!1);return}const C=w>k,T=w<k;if((P=c.animation)!=null&&P.ignoreEscapes){c.scrollTop=k;return}T&&(f(!0),u(!1)),C&&f(!1),!c.escapedFromLock&&c.isNearBottom&&u(!0)},1)},[f,u,l,c]),h=_.useCallback(({target:v,deltaY:w})=>{var k;let A=v;for(;!["scroll","auto"].includes(getComputedStyle(A).overflow);){if(!A.parentElement)return;A=A.parentElement}A===g.current&&w<0&&g.current.scrollHeight>g.current.clientHeight&&!((k=c.animation)!=null&&k.ignoreEscapes)&&(f(!0),u(!1))},[f,u,c]),g=Ap(v=>{var w,A;(w=g.current)==null||w.removeEventListener("scroll",m),(A=g.current)==null||A.removeEventListener("wheel",h),v==null||v.addEventListener("scroll",m,{passive:!0}),v==null||v.addEventListener("wheel",h,{passive:!0})},[]),y=Ap(v=>{var A,k;if((A=c.resizeObserver)==null||A.disconnect(),!v)return;let w;c.resizeObserver=new ResizeObserver(([C])=>{const{height:T}=C.contentRect,P=T-(w??T);if(c.resizeDifference=P,c.scrollTop>c.targetScrollTop&&(c.scrollTop=c.targetScrollTop),a(c.isNearBottom),P>=0){const F=us(s.current,w?s.current.resize:s.current.initial);p({animation:F,wait:!0,preserveScrollPosition:!0,duration:F==="instant"?void 0:fA})}else c.isNearBottom&&(f(!1),u(!0));w=T,requestAnimationFrame(()=>{setTimeout(()=>{c.resizeDifference===P&&(c.resizeDifference=0)},1)})}),(k=c.resizeObserver)==null||k.observe(v)},[]);return{contentRef:y,scrollRef:g,scrollToBottom:p,stopScroll:d,isAtBottom:r||o,isNearBottom:o,escapedFromLock:t,state:c}};function Ap(e,t){const n=_.useCallback(r=>(n.current=r,e(r)),t);return n}const ls=new Map;function us(...e){const t={...lA};let n=!1;for(const i of e){if(i==="instant"){n=!0;continue}typeof i=="object"&&(n=!1,t.damping=i.damping??t.damping,t.stiffness=i.stiffness??t.stiffness,t.mass=i.mass??t.mass)}const r=JSON.stringify(t);return ls.has(r)||ls.set(r,Object.freeze(t)),n?"instant":ls.get(r)}const Ip=_.createContext(null),pA=typeof window<"u"?_.useLayoutEffect:_.useEffect;function Ei({instance:e,children:t,resize:n,initial:r,mass:i,damping:o,stiffness:a,targetScrollTop:s,contextRef:l,...u}){const f=_.useRef(null),c=E.useCallback((k,C)=>{const T=(A==null?void 0:A.targetScrollTop)??s;return(T==null?void 0:T(k,C))??k},[s]),p=dA({mass:i,damping:o,stiffness:a,resize:n,initial:r,targetScrollTop:c}),{scrollRef:d,contentRef:m,scrollToBottom:h,stopScroll:g,isAtBottom:y,escapedFromLock:v,state:w}=e??p,A=_.useMemo(()=>({scrollToBottom:h,stopScroll:g,scrollRef:d,isAtBottom:y,escapedFromLock:v,contentRef:m,state:w,get targetScrollTop(){return f.current},set targetScrollTop(k){f.current=k}}),[h,y,m,d,g,v,w]);return _.useImperativeHandle(l,()=>A,[A]),pA(()=>{d.current&&getComputedStyle(d.current).overflow==="visible"&&(d.current.style.overflow="auto")},[]),S.jsx(Ip.Provider,{value:A,children:S.jsx("div",{...u,children:typeof t=="function"?t(A):t})})}(function(e){function t({children:n,...r}){const i=Tp();return S.jsx("div",{ref:i.scrollRef,style:{height:"100%",width:"100%"},children:S.jsx("div",{...r,ref:i.contentRef,children:typeof n=="function"?n(i):n})})}e.Content=t})(Ei||(Ei={}));function Tp(){const e=_.useContext(Ip);if(!e)throw new Error("use-stick-to-bottom component context must be used within a StickToBottom component");return e}const cs=_.memo(({className:e,messages:t=[],isTyping:n,headerMessage:r,renderers:i,botAvatar:o,botDescription:a,botName:s,sendMessage:l,addMessageFeedback:u,showMarquee:f=!0,showDateSystemMessage:c=!0,showMessageStatus:p=!0,showIncomingMessageAvatar:d=!0,showOutgoingMessageAvatar:m=!1,...h})=>{var A;const{messageList:g}=ge,y=_.useMemo(()=>c?gm(t):t,[t]),v=_.useMemo(()=>{var C;const k=y.filter(T=>T.direction==="outgoing"&&T.status!=="pending");return(C=k[k.length-1])==null?void 0:C.id},[y]),w=k=>{if(k.direction==="incoming")return d;if(k.direction==="outgoing")return m};return S.jsxs(Ei,{...h,resize:"smooth",initial:"instant",className:dr(g.container.className,e),children:[S.jsxs(Ei.Content,{className:g.viewPort.className,children:[r&&S.jsx("span",{...g.headerMessage,children:r}),f&&S.jsx(sA,{botAvatar:o,botDescription:a,botName:s}),y.map(k=>{var C;return S.jsx(as,{renderers:i,sendMessage:l,addMessageFeedback:u,isLastDeliveredMessage:p&&k.id===v,showAvatar:w(k),...k},((C=k.metadata)==null?void 0:C.clientMessageId)||k.id)}),n&&S.jsx(as,{id:ss(),renderers:i,sendMessage:l,direction:"incoming",timestamp:new Date,showAvatar:d,block:void 0,sender:((A=t.filter(k=>k.direction==="incoming").at(-1))==null?void 0:A.sender)??{name:s||"Bot",avatar:o},children:S.jsx(os,{})})]}),S.jsx(hA,{})]})}),hA=()=>{const{isAtBottom:e,scrollToBottom:t}=Tp(),{messageList:n}=ge;return e?null:S.jsx("button",{className:n.scrollDownButton.className,onClick:()=>t()})};cs.displayName="MessageList";function Op({error:e,restartConversation:t,closeWindow:n}){let r,i;const{error:o}=ge;return e.type==="configuration"?(r="Configuration error",i=S.jsx(Y0,{...o.icon})):e.type==="bot"?(r="Bot error",i=S.jsx(Mc,{...o.icon})):e.type==="network"?(r="Network error",i=S.jsx(r1,{...o.icon})):e.type==="disconnected"?(r="Disconnected",i=S.jsx(e1,{...o.icon})):(r="Unexpected error",i=S.jsx(Mc,{...o.icon})),S.jsx(mA,{error:e,title:r,icon:i,restartConversation:t,closeWindow:n})}function mA({error:e,title:t,icon:n,restartConversation:r,closeWindow:i}){const{error:o}=ge;return S.jsxs("div",{...o.container,children:[S.jsxs("div",{...o.header.container,children:[`Webchat ${e.type} error`,S.jsxs("div",{...o.header.actions,children:[r&&S.jsx(is,{restartConversation:r,style:{color:"white",backgroundColor:"transparent"}}),i&&S.jsx(Sp,{onClick:i,style:{color:"white",backgroundColor:"transparent"}})]})]}),S.jsxs("div",{...o.content,children:[n,S.jsx("div",{...o.errorTitle,children:t}),S.jsx("div",{...o.errorMessage,children:e.message}),e.id&&S.jsx("div",{...o.id,children:e.id})]})]})}const gA=({className:e,...t})=>{const{className:n}=ge.loader;return S.jsx("div",{...t,className:dr(e,n)})},Dp=({connected:e,configuration:t,isTyping:n,messages:r,user:i,isLoading:o,renderers:a,isReadOnly:s,disableComposer:l,allowFileUpload:u,error:f,participants:c,closeWindow:p,sendMessage:d,uploadFile:m,addMessageFeedback:h,restartConversation:g,clientId:y,storageKey:v,soundOn:w,toggleSound:A,disableSendButton:k,...C})=>{const{color:T,fontFamily:P,radius:F,themeMode:I,variant:O,headerVariant:j,botAvatar:z,botDescription:M,botName:D,composerPlaceholder:B,footer:U,feedbackEnabled:$,additionalStylesheetUrl:V}=t,b={color:T,fontFamily:P,radius:F,themeMode:I,variant:O,headerVariant:j,additionalStylesheetUrl:V};$||(h=void 0);const N=_.useMemo(()=>i?Gs(r,c,i.id,D,z):[],[z,D,r,i,c]),H=_.useRef(null),x=sn(W=>W.setPortalContainer);return _.useEffect(()=>(x(H.current),()=>{x(null)}),[x]),S.jsxs(S.Fragment,{children:[S.jsx(hp,{...b}),S.jsx("div",{ref:H,style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none",zIndex:10}}),S.jsx(es,{connected:e,allowFileUpload:u,uploadFile:m,storageKey:v,...C,children:f?S.jsx(Op,{error:f,restartConversation:g,closeWindow:p}):S.jsxs(S.Fragment,{children:[S.jsx(Ep,{closeWindow:p,configuration:t,restartConversation:g,clientId:y,soundOn:w,toggleSound:A}),o?S.jsx(gA,{}):S.jsx(cs,{botAvatar:z,botDescription:M,botName:D,renderers:a,isTyping:n,sendMessage:d,addMessageFeedback:h,messages:N}),S.jsx(Nd,{sendMessage:d,uploadFile:m,connected:e,isReadOnly:s,disableComposer:l,footer:U,composerPlaceholder:B,allowFileUpload:u,disableSendButton:k,storageKey:v})]})})]})};function Mp(){const[e,t]=_.useState(!1),n=_.useRef(null);return{state:e,setState:(r,i)=>{if(t(r),!r)return()=>{};if(n.current=new Date,!i)return()=>{};const o=setTimeout(()=>{const a=n.current;a&&new Date().getTime()-a.getTime()>i&&t(!1)},i+100);return()=>clearTimeout(o)}}}var yA=Object.defineProperty,vA=(e,t,n)=>t in e?yA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,bA=(e,t,n)=>vA(e,t+"",n),wA=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},xA={bodySerializer:e=>JSON.stringify(e,(t,n)=>typeof n=="bigint"?n.toString():n)},kA=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},SA=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},EA=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},_p=({allowReserved:e,explode:t,name:n,style:r,value:i})=>{if(!t){let s=(e?i:i.map(l=>encodeURIComponent(l))).join(SA(r));switch(r){case"label":return`.${s}`;case"matrix":return`;${n}=${s}`;case"simple":return s;default:return`${n}=${s}`}}let o=kA(r),a=i.map(s=>r==="label"||r==="simple"?e?s:encodeURIComponent(s):Ci({allowReserved:e,name:n,value:s})).join(o);return r==="label"||r==="matrix"?o+a:a},Ci=({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)}`},Pp=({allowReserved:e,explode:t,name:n,style:r,value:i})=>{if(i instanceof Date)return`${n}=${i.toISOString()}`;if(r!=="deepObject"&&!t){let s=[];Object.entries(i).forEach(([u,f])=>{s=[...s,u,e?f:encodeURIComponent(f)]});let l=s.join(",");switch(r){case"form":return`${n}=${l}`;case"label":return`.${l}`;case"matrix":return`;${n}=${l}`;default:return l}}let o=EA(r),a=Object.entries(i).map(([s,l])=>Ci({allowReserved:e,name:r==="deepObject"?`${n}[${s}]`:s,value:l})).join(o);return r==="label"||r==="matrix"?o+a:a},CA=/\{[^{}]+\}/g,AA=({path:e,url:t})=>{let n=t,r=t.match(CA);if(r)for(let i of r){let o=!1,a=i.substring(1,i.length-1),s="simple";a.endsWith("*")&&(o=!0,a=a.substring(0,a.length-1)),a.startsWith(".")?(a=a.substring(1),s="label"):a.startsWith(";")&&(a=a.substring(1),s="matrix");let l=e[a];if(l==null)continue;if(Array.isArray(l)){n=n.replace(i,_p({explode:o,name:a,style:s,value:l}));continue}if(typeof l=="object"){n=n.replace(i,Pp({explode:o,name:a,style:s,value:l}));continue}if(s==="matrix"){n=n.replace(i,`;${Ci({name:a,value:l})}`);continue}let u=encodeURIComponent(s==="label"?`.${l}`:l);n=n.replace(i,u)}return n},Np=({allowReserved:e,array:t,object:n}={})=>r=>{let i=[];if(r&&typeof r=="object")for(let o in r){let a=r[o];if(a!=null){if(Array.isArray(a)){i=[...i,_p({allowReserved:e,explode:!0,name:o,style:"form",value:a,...t})];continue}if(typeof a=="object"){i=[...i,Pp({allowReserved:e,explode:!0,name:o,style:"deepObject",value:a,...n})];continue}i=[...i,Ci({allowReserved:e,name:o,value:a})]}}return i.join("&")},IA=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"}},TA=async({security:e,...t})=>{for(let n of e){let r=await wA(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}},Lp=e=>OA({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:Np(e.querySerializer),url:e.url}),OA=({baseUrl:e,path:t,query:n,querySerializer:r,url:i})=>{let o=i.startsWith("/")?i:`/${i}`,a=(e??"")+o;t&&(a=AA({path:t,url:a}));let s=n?r(n):"";return s.startsWith("?")&&(s=s.substring(1)),s&&(a+=`?${s}`),a},Fp=(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=Rp(e.headers,t.headers),r},Rp=(...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 a of o)t.append(i,a);else o!==void 0&&t.set(i,typeof o=="object"?JSON.stringify(o):o)}return t},fs=class{constructor(){bA(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]}},DA=()=>({error:new fs,request:new fs,response:new fs}),MA=Np({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),_A={"Content-Type":"application/json"},Bp=(e={})=>({...xA,headers:_A,parseAs:"auto",querySerializer:MA,...e}),PA=(e={})=>{let t=Fp(Bp(),e),n=()=>({...t}),r=a=>(t=Fp(t,a),n()),i=DA(),o=async a=>{let s={...t,...a,fetch:a.fetch??t.fetch??globalThis.fetch,headers:Rp(t.headers,a.headers)};s.security&&await TA({...s,security:s.security}),s.body&&s.bodySerializer&&(s.body=s.bodySerializer(s.body)),(s.body===void 0||s.body==="")&&s.headers.delete("Content-Type");let l=Lp(s),u={redirect:"follow",...s},f=new Request(l,u);for(let g of i.request._fns)f=await g(f,s);let c=s.fetch,p=await c(f);for(let g of i.response._fns)p=await g(p,f,s);let d={request:f,response:p};if(p.ok){if(p.status===204||p.headers.get("Content-Length")==="0")return{data:{},...d};let g=(s.parseAs==="auto"?IA(p.headers.get("Content-Type")):s.parseAs)??"json";if(g==="stream")return{data:p.body,...d};let y=await p[g]();return g==="json"&&(s.responseValidator&&await s.responseValidator(y),s.responseTransformer&&(y=await s.responseTransformer(y))),{data:y,...d}}let m=await p.text();try{m=JSON.parse(m)}catch{}let h=m;for(let g of i.error._fns)h=await g(m,p,f,s);if(h=h||{},s.throwOnError)throw h;return{error:h,...d}};return{buildUrl:Lp,connect:a=>o({...a,method:"CONNECT"}),delete:a=>o({...a,method:"DELETE"}),get:a=>o({...a,method:"GET"}),getConfig:n,head:a=>o({...a,method:"HEAD"}),interceptors:i,options:a=>o({...a,method:"OPTIONS"}),patch:a=>o({...a,method:"PATCH"}),post:a=>o({...a,method:"POST"}),put:a=>o({...a,method:"PUT"}),request:o,setConfig:r,trace:a=>o({...a,method:"TRACE"})}},NA=PA,LA=Bp;const Me=NA((e=>({...e,withCredentials:!0,timeout:6e4,maxBodyLength:104857600,maxContentLength:104857600,throwOnError:!0}))(LA({baseUrl:"https://webchat.botpress.cloud/"}))),FA=e=>(e.client??Me).delete({url:"/conversations/{id}",...e}),RA=e=>(e.client??Me).get({url:"/conversations/{id}",...e}),BA=e=>(e.client??Me).get({url:"/conversations",...e}),zA=e=>(e.client??Me).post({url:"/conversations",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),$A=e=>(e.client??Me).get({url:"/conversations/{id}/messages",...e}),jA=e=>(e.client??Me).get({url:"/conversations/{id}/participants",...e}),UA=e=>(e.client??Me).post({url:"/conversations/{id}/participants",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),HA=e=>(e.client??Me).delete({url:"/conversations/{id}/participants/{userId}",...e}),WA=e=>(e.client??Me).get({url:"/conversations/{id}/participants/{userId}",...e}),VA=e=>(e.client??Me).delete({url:"/messages/{id}",...e}),qA=e=>(e.client??Me).get({url:"/messages/{id}",...e}),KA=e=>(e.client??Me).put({url:"/messages/{id}",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),YA=e=>(e.client??Me).post({url:"/messages",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),GA=e=>(e.client??Me).delete({url:"/messages/{id}/feedback",...e}),QA=e=>(e.client??Me).put({url:"/messages/{id}/feedback",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),JA=e=>(e.client??Me).delete({url:"/users/me",...e}),ZA=e=>(e.client??Me).get({url:"/users/me",...e}),XA=e=>(e.client??Me).put({url:"/users/me",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),eI=e=>((e==null?void 0:e.client)??Me).post({url:"/users/key",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),tI=e=>(e.client??Me).get({url:"/events/{id}",...e}),nI=e=>(e.client??Me).post({url:"/events",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),rI=e=>(e.client??Me).post({url:"/files",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}});let zp=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 ds(e){}function iI(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=ds,onError:n=ds,onRetry:r=ds,onComment:i}=e;let o="",a=!0,s,l="",u="";function f(h){const g=a?h.replace(/^\xEF\xBB\xBF/,""):h,[y,v]=oI(`${o}${g}`);for(const w of y)c(w);o=v,a=!1}function c(h){if(h===""){d();return}if(h.startsWith(":")){i&&i(h.slice(h.startsWith(": ")?2:1));return}const g=h.indexOf(":");if(g!==-1){const y=h.slice(0,g),v=h[g+1]===" "?2:1,w=h.slice(g+v);p(y,w,h);return}p(h,"",h)}function p(h,g,y){switch(h){case"event":u=g;break;case"data":l=`${l}${g}
314
- `;break;case"id":s=g.includes("\0")?void 0:g;break;case"retry":/^\d+$/.test(g)?r(parseInt(g,10)):n(new zp(`Invalid \`retry\` value: "${g}"`,{type:"invalid-retry",value:g,line:y}));break;default:n(new zp(`Unknown field "${h.length>20?`${h.slice(0,20)}…`:h}"`,{type:"unknown-field",field:h,value:g,line:y}));break}}function d(){l.length>0&&t({id:s,event:u||void 0,data:l.endsWith(`
315
- `)?l.slice(0,-1):l}),s=void 0,l="",u=""}function m(h={}){o&&h.consume&&c(o),a=!0,s=void 0,l="",u="",o=""}return{feed:f,reset:m}}function oI(e){const t=[];let n="",r=0;for(;r<e.length;){const i=e.indexOf("\r",r),o=e.indexOf(`
313
+ *--------------------------------------------------------------------------------------------*/const iA={damping:.7,stiffness:.05,mass:1.25},oA=70,aA=1e3/60,sA=350;let wi=!1;(Ph=globalThis.document)==null||Ph.addEventListener("mousedown",()=>{wi=!0}),(Nh=globalThis.document)==null||Nh.addEventListener("mouseup",()=>{wi=!1}),(Lh=globalThis.document)==null||Lh.addEventListener("click",()=>{wi=!1});const lA=(e={})=>{const[t,n]=N.useState(!1),[r,i]=N.useState(e.initial!==!1),[o,a]=N.useState(!1),s=N.useRef(null);s.current=e;const l=N.useCallback(()=>{var A;if(!wi)return!1;const v=window.getSelection();if(!v||!v.rangeCount)return!1;const w=v.getRangeAt(0);return w.commonAncestorContainer.contains(g.current)||((A=g.current)==null?void 0:A.contains(w.commonAncestorContainer))},[]),u=N.useCallback(v=>{c.isAtBottom=v,i(v)},[]),f=N.useCallback(v=>{c.escapedFromLock=v,n(v)},[]),c=N.useMemo(()=>{let v;return{escapedFromLock:t,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){var w;return((w=g.current)==null?void 0:w.scrollTop)??0},set scrollTop(w){g.current&&(g.current.scrollTop=w,c.ignoreScrollToTop=g.current.scrollTop)},get targetScrollTop(){return!g.current||!y.current?0:g.current.scrollHeight-1-g.current.clientHeight},get calculatedTargetScrollTop(){if(!g.current||!y.current)return 0;const{targetScrollTop:w}=this;if(!e.targetScrollTop)return w;if((v==null?void 0:v.targetScrollTop)===w)return v.calculatedScrollTop;const A=Math.max(Math.min(e.targetScrollTop(w,{scrollElement:g.current,contentElement:y.current}),w),0);return v={targetScrollTop:w,calculatedScrollTop:A},requestAnimationFrame(()=>{v=void 0}),A},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=oA}}},[]),p=N.useCallback((v={})=>{var F;typeof v=="string"&&(v={animation:v}),v.preserveScrollPosition||u(!0);const w=Date.now()+(Number(v.wait)||0),A=os(s.current,v.animation),{ignoreEscapes:k=!1}=v;let C,T=c.calculatedTargetScrollTop;v.duration instanceof Promise?v.duration.finally(()=>{C=Date.now()}):C=w+(v.duration??0);const _=async()=>{const I=new Promise(requestAnimationFrame).then(()=>{var M;if(!c.isAtBottom)return c.animation=void 0,!1;const{scrollTop:O}=c,j=performance.now(),z=(j-(c.lastTick??j))/aA;if(c.animation||(c.animation={behavior:A,promise:I,ignoreEscapes:k}),c.animation.behavior===A&&(c.lastTick=j),l()||w>Date.now())return _();if(O<Math.min(T,c.calculatedTargetScrollTop)){if(((M=c.animation)==null?void 0:M.behavior)===A){if(A==="instant")return c.scrollTop=c.calculatedTargetScrollTop,_();c.velocity=(A.damping*c.velocity+A.stiffness*c.scrollDifference)/A.mass,c.accumulated+=c.velocity*z,c.scrollTop+=c.accumulated,c.scrollTop!==O&&(c.accumulated=0)}return _()}return C>Date.now()?(T=c.calculatedTargetScrollTop,_()):(c.animation=void 0,c.scrollTop<c.calculatedTargetScrollTop?p({animation:os(s.current,s.current.resize),ignoreEscapes:k,duration:Math.max(0,C-Date.now())||void 0}):c.isAtBottom)});return I.then(O=>(requestAnimationFrame(()=>{c.animation||(c.lastTick=void 0,c.velocity=0)}),O))};return v.wait!==!0&&(c.animation=void 0),((F=c.animation)==null?void 0:F.behavior)===A?c.animation.promise:_()},[u,l,c]),d=N.useCallback(()=>{f(!0),u(!1)},[f,u]),m=N.useCallback(({target:v})=>{if(v!==g.current)return;const{scrollTop:w,ignoreScrollToTop:A}=c;let{lastScrollTop:k=w}=c;c.lastScrollTop=w,c.ignoreScrollToTop=void 0,A&&A>w&&(k=A),a(c.isNearBottom),setTimeout(()=>{var _;if(c.resizeDifference||w===A)return;if(l()){f(!0),u(!1);return}const C=w>k,T=w<k;if((_=c.animation)!=null&&_.ignoreEscapes){c.scrollTop=k;return}T&&(f(!0),u(!1)),C&&f(!1),!c.escapedFromLock&&c.isNearBottom&&u(!0)},1)},[f,u,l,c]),h=N.useCallback(({target:v,deltaY:w})=>{var k;let A=v;for(;!["scroll","auto"].includes(getComputedStyle(A).overflow);){if(!A.parentElement)return;A=A.parentElement}A===g.current&&w<0&&g.current.scrollHeight>g.current.clientHeight&&!((k=c.animation)!=null&&k.ignoreEscapes)&&(f(!0),u(!1))},[f,u,c]),g=kp(v=>{var w,A;(w=g.current)==null||w.removeEventListener("scroll",m),(A=g.current)==null||A.removeEventListener("wheel",h),v==null||v.addEventListener("scroll",m,{passive:!0}),v==null||v.addEventListener("wheel",h,{passive:!0})},[]),y=kp(v=>{var A,k;if((A=c.resizeObserver)==null||A.disconnect(),!v)return;let w;c.resizeObserver=new ResizeObserver(([C])=>{const{height:T}=C.contentRect,_=T-(w??T);if(c.resizeDifference=_,c.scrollTop>c.targetScrollTop&&(c.scrollTop=c.targetScrollTop),a(c.isNearBottom),_>=0){const F=os(s.current,w?s.current.resize:s.current.initial);p({animation:F,wait:!0,preserveScrollPosition:!0,duration:F==="instant"?void 0:sA})}else c.isNearBottom&&(f(!1),u(!0));w=T,requestAnimationFrame(()=>{setTimeout(()=>{c.resizeDifference===_&&(c.resizeDifference=0)},1)})}),(k=c.resizeObserver)==null||k.observe(v)},[]);return{contentRef:y,scrollRef:g,scrollToBottom:p,stopScroll:d,isAtBottom:r||o,isNearBottom:o,escapedFromLock:t,state:c}};function kp(e,t){const n=N.useCallback(r=>(n.current=r,e(r)),t);return n}const is=new Map;function os(...e){const t={...iA};let n=!1;for(const i of e){if(i==="instant"){n=!0;continue}typeof i=="object"&&(n=!1,t.damping=i.damping??t.damping,t.stiffness=i.stiffness??t.stiffness,t.mass=i.mass??t.mass)}const r=JSON.stringify(t);return is.has(r)||is.set(r,Object.freeze(t)),n?"instant":is.get(r)}const Sp=N.createContext(null),uA=typeof window<"u"?N.useLayoutEffect:N.useEffect;function xi({instance:e,children:t,resize:n,initial:r,mass:i,damping:o,stiffness:a,targetScrollTop:s,contextRef:l,...u}){const f=N.useRef(null),c=E.useCallback((k,C)=>{const T=(A==null?void 0:A.targetScrollTop)??s;return(T==null?void 0:T(k,C))??k},[s]),p=lA({mass:i,damping:o,stiffness:a,resize:n,initial:r,targetScrollTop:c}),{scrollRef:d,contentRef:m,scrollToBottom:h,stopScroll:g,isAtBottom:y,escapedFromLock:v,state:w}=e??p,A=N.useMemo(()=>({scrollToBottom:h,stopScroll:g,scrollRef:d,isAtBottom:y,escapedFromLock:v,contentRef:m,state:w,get targetScrollTop(){return f.current},set targetScrollTop(k){f.current=k}}),[h,y,m,d,g,v,w]);return N.useImperativeHandle(l,()=>A,[A]),uA(()=>{d.current&&getComputedStyle(d.current).overflow==="visible"&&(d.current.style.overflow="auto")},[]),S.jsx(Sp.Provider,{value:A,children:S.jsx("div",{...u,children:typeof t=="function"?t(A):t})})}(function(e){function t({children:n,...r}){const i=Ep();return S.jsx("div",{ref:i.scrollRef,style:{height:"100%",width:"100%"},children:S.jsx("div",{...r,ref:i.contentRef,children:typeof n=="function"?n(i):n})})}e.Content=t})(xi||(xi={}));function Ep(){const e=N.useContext(Sp);if(!e)throw new Error("use-stick-to-bottom component context must be used within a StickToBottom component");return e}const as=N.memo(({className:e,messages:t=[],isTyping:n,headerMessage:r,renderers:i,botAvatar:o,botDescription:a,botName:s,sendMessage:l,addMessageFeedback:u,showMarquee:f=!0,showDateSystemMessage:c=!0,showMessageStatus:p=!0,showIncomingMessageAvatar:d=!0,showOutgoingMessageAvatar:m=!1,...h})=>{var A;const{messageList:g}=ge,y=N.useMemo(()=>c?dm(t):t,[t]),v=N.useMemo(()=>{var C;const k=y.filter(T=>T.direction==="outgoing"&&T.status!=="pending");return(C=k[k.length-1])==null?void 0:C.id},[y]),w=k=>{if(k.direction==="incoming")return d;if(k.direction==="outgoing")return m};return S.jsxs(xi,{...h,resize:"smooth",initial:"instant",className:ur(g.container.className,e),children:[S.jsxs(xi.Content,{className:g.viewPort.className,children:[r&&S.jsx("span",{...g.headerMessage,children:r}),f&&S.jsx(rA,{botAvatar:o,botDescription:a,botName:s}),y.map(k=>{var C;return S.jsx(ns,{renderers:i,sendMessage:l,addMessageFeedback:u,isLastDeliveredMessage:p&&k.id===v,showAvatar:w(k),...k},((C=k.metadata)==null?void 0:C.clientMessageId)||k.id)}),n&&S.jsx(ns,{id:rs(),renderers:i,sendMessage:l,direction:"incoming",timestamp:new Date,showAvatar:d,block:void 0,sender:((A=t.filter(k=>k.direction==="incoming").at(-1))==null?void 0:A.sender)??{name:s||"Bot",avatar:o},children:S.jsx(ts,{})})]}),S.jsx(cA,{})]})}),cA=()=>{const{isAtBottom:e,scrollToBottom:t}=Ep(),{messageList:n}=ge;return e?null:S.jsx("button",{className:n.scrollDownButton.className,onClick:()=>t()})};as.displayName="MessageList";function Cp({error:e,restartConversation:t,closeWindow:n}){let r,i;const{error:o}=ge;return e.type==="configuration"?(r="Configuration error",i=S.jsx(W0,{...o.icon})):e.type==="bot"?(r="Bot error",i=S.jsx(Ic,{...o.icon})):e.type==="network"?(r="Network error",i=S.jsx(X0,{...o.icon})):e.type==="disconnected"?(r="Disconnected",i=S.jsx(Q0,{...o.icon})):(r="Unexpected error",i=S.jsx(Ic,{...o.icon})),S.jsx(fA,{error:e,title:r,icon:i,restartConversation:t,closeWindow:n})}function fA({error:e,title:t,icon:n,restartConversation:r,closeWindow:i}){const{error:o}=ge;return S.jsxs("div",{...o.container,children:[S.jsxs("div",{...o.header.container,children:[`Webchat ${e.type} error`,S.jsxs("div",{...o.header.actions,children:[r&&S.jsx(es,{restartConversation:r,style:{color:"white",backgroundColor:"transparent"}}),i&&S.jsx(bp,{onClick:i,style:{color:"white",backgroundColor:"transparent"}})]})]}),S.jsxs("div",{...o.content,children:[n,S.jsx("div",{...o.errorTitle,children:t}),S.jsx("div",{...o.errorMessage,children:e.message}),e.id&&S.jsx("div",{...o.id,children:e.id})]})]})}const dA=({className:e,...t})=>{const{className:n}=ge.loader;return S.jsx("div",{...t,className:ur(e,n)})},Ap=({connected:e,configuration:t,isTyping:n,messages:r,user:i,isLoading:o,renderers:a,isReadOnly:s,disableComposer:l,allowFileUpload:u,error:f,participants:c,closeWindow:p,sendMessage:d,uploadFile:m,addMessageFeedback:h,restartConversation:g,clientId:y,storageKey:v,soundOn:w,toggleSound:A,disableSendButton:k,...C})=>{const{color:T,fontFamily:_,radius:F,themeMode:I,variant:O,headerVariant:j,botAvatar:z,botDescription:M,botName:D,composerPlaceholder:B,footer:U,feedbackEnabled:$,additionalStylesheetUrl:W}=t,b={color:T,fontFamily:_,radius:F,themeMode:I,variant:O,headerVariant:j,additionalStylesheetUrl:W};$||(h=void 0);const P=N.useMemo(()=>i?Vs(r,c,i.id,D,z):[],[z,D,r,i,c]),H=N.useRef(null),x=sn(V=>V.setPortalContainer);return N.useEffect(()=>(x(H.current),()=>{x(null)}),[x]),S.jsxs(S.Fragment,{children:[S.jsx(cp,{...b}),S.jsx("div",{ref:H,style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none",zIndex:10}}),S.jsx(Qa,{connected:e,allowFileUpload:u,uploadFile:m,storageKey:v,...C,children:f?S.jsx(Cp,{error:f,restartConversation:g,closeWindow:p}):S.jsxs(S.Fragment,{children:[S.jsx(wp,{closeWindow:p,configuration:t,restartConversation:g,clientId:y,soundOn:w,toggleSound:A}),o?S.jsx(dA,{}):S.jsx(as,{botAvatar:z,botDescription:M,botName:D,renderers:a,isTyping:n,sendMessage:d,addMessageFeedback:h,messages:P}),S.jsx(Dd,{sendMessage:d,uploadFile:m,connected:e,isReadOnly:s,disableComposer:l,footer:U,composerPlaceholder:B,allowFileUpload:u,disableSendButton:k,storageKey:v})]})})]})};function Ip(){const[e,t]=N.useState(!1),n=N.useRef(null);return{state:e,setState:(r,i)=>{if(t(r),!r)return()=>{};if(n.current=new Date,!i)return()=>{};const o=setTimeout(()=>{const a=n.current;a&&new Date().getTime()-a.getTime()>i&&t(!1)},i+100);return()=>clearTimeout(o)}}}var pA=Object.defineProperty,hA=(e,t,n)=>t in e?pA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mA=(e,t,n)=>hA(e,t+"",n),gA=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},yA={bodySerializer:e=>JSON.stringify(e,(t,n)=>typeof n=="bigint"?n.toString():n)},vA=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},bA=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},wA=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},Tp=({allowReserved:e,explode:t,name:n,style:r,value:i})=>{if(!t){let s=(e?i:i.map(l=>encodeURIComponent(l))).join(bA(r));switch(r){case"label":return`.${s}`;case"matrix":return`;${n}=${s}`;case"simple":return s;default:return`${n}=${s}`}}let o=vA(r),a=i.map(s=>r==="label"||r==="simple"?e?s:encodeURIComponent(s):ki({allowReserved:e,name:n,value:s})).join(o);return r==="label"||r==="matrix"?o+a:a},ki=({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)}`},Op=({allowReserved:e,explode:t,name:n,style:r,value:i})=>{if(i instanceof Date)return`${n}=${i.toISOString()}`;if(r!=="deepObject"&&!t){let s=[];Object.entries(i).forEach(([u,f])=>{s=[...s,u,e?f:encodeURIComponent(f)]});let l=s.join(",");switch(r){case"form":return`${n}=${l}`;case"label":return`.${l}`;case"matrix":return`;${n}=${l}`;default:return l}}let o=wA(r),a=Object.entries(i).map(([s,l])=>ki({allowReserved:e,name:r==="deepObject"?`${n}[${s}]`:s,value:l})).join(o);return r==="label"||r==="matrix"?o+a:a},xA=/\{[^{}]+\}/g,kA=({path:e,url:t})=>{let n=t,r=t.match(xA);if(r)for(let i of r){let o=!1,a=i.substring(1,i.length-1),s="simple";a.endsWith("*")&&(o=!0,a=a.substring(0,a.length-1)),a.startsWith(".")?(a=a.substring(1),s="label"):a.startsWith(";")&&(a=a.substring(1),s="matrix");let l=e[a];if(l==null)continue;if(Array.isArray(l)){n=n.replace(i,Tp({explode:o,name:a,style:s,value:l}));continue}if(typeof l=="object"){n=n.replace(i,Op({explode:o,name:a,style:s,value:l}));continue}if(s==="matrix"){n=n.replace(i,`;${ki({name:a,value:l})}`);continue}let u=encodeURIComponent(s==="label"?`.${l}`:l);n=n.replace(i,u)}return n},Dp=({allowReserved:e,array:t,object:n}={})=>r=>{let i=[];if(r&&typeof r=="object")for(let o in r){let a=r[o];if(a!=null){if(Array.isArray(a)){i=[...i,Tp({allowReserved:e,explode:!0,name:o,style:"form",value:a,...t})];continue}if(typeof a=="object"){i=[...i,Op({allowReserved:e,explode:!0,name:o,style:"deepObject",value:a,...n})];continue}i=[...i,ki({allowReserved:e,name:o,value:a})]}}return i.join("&")},SA=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"}},EA=async({security:e,...t})=>{for(let n of e){let r=await gA(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}},Mp=e=>CA({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:Dp(e.querySerializer),url:e.url}),CA=({baseUrl:e,path:t,query:n,querySerializer:r,url:i})=>{let o=i.startsWith("/")?i:`/${i}`,a=(e??"")+o;t&&(a=kA({path:t,url:a}));let s=n?r(n):"";return s.startsWith("?")&&(s=s.substring(1)),s&&(a+=`?${s}`),a},_p=(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=Pp(e.headers,t.headers),r},Pp=(...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 a of o)t.append(i,a);else o!==void 0&&t.set(i,typeof o=="object"?JSON.stringify(o):o)}return t},ss=class{constructor(){mA(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]}},AA=()=>({error:new ss,request:new ss,response:new ss}),IA=Dp({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),TA={"Content-Type":"application/json"},Np=(e={})=>({...yA,headers:TA,parseAs:"auto",querySerializer:IA,...e}),OA=(e={})=>{let t=_p(Np(),e),n=()=>({...t}),r=a=>(t=_p(t,a),n()),i=AA(),o=async a=>{let s={...t,...a,fetch:a.fetch??t.fetch??globalThis.fetch,headers:Pp(t.headers,a.headers)};s.security&&await EA({...s,security:s.security}),s.body&&s.bodySerializer&&(s.body=s.bodySerializer(s.body)),(s.body===void 0||s.body==="")&&s.headers.delete("Content-Type");let l=Mp(s),u={redirect:"follow",...s},f=new Request(l,u);for(let g of i.request._fns)f=await g(f,s);let c=s.fetch,p=await c(f);for(let g of i.response._fns)p=await g(p,f,s);let d={request:f,response:p};if(p.ok){if(p.status===204||p.headers.get("Content-Length")==="0")return{data:{},...d};let g=(s.parseAs==="auto"?SA(p.headers.get("Content-Type")):s.parseAs)??"json";if(g==="stream")return{data:p.body,...d};let y=await p[g]();return g==="json"&&(s.responseValidator&&await s.responseValidator(y),s.responseTransformer&&(y=await s.responseTransformer(y))),{data:y,...d}}let m=await p.text();try{m=JSON.parse(m)}catch{}let h=m;for(let g of i.error._fns)h=await g(m,p,f,s);if(h=h||{},s.throwOnError)throw h;return{error:h,...d}};return{buildUrl:Mp,connect:a=>o({...a,method:"CONNECT"}),delete:a=>o({...a,method:"DELETE"}),get:a=>o({...a,method:"GET"}),getConfig:n,head:a=>o({...a,method:"HEAD"}),interceptors:i,options:a=>o({...a,method:"OPTIONS"}),patch:a=>o({...a,method:"PATCH"}),post:a=>o({...a,method:"POST"}),put:a=>o({...a,method:"PUT"}),request:o,setConfig:r,trace:a=>o({...a,method:"TRACE"})}},DA=OA,MA=Np;const De=DA((e=>({...e,withCredentials:!0,timeout:6e4,maxBodyLength:104857600,maxContentLength:104857600,throwOnError:!0}))(MA({baseUrl:"https://webchat.botpress.cloud/"}))),_A=e=>(e.client??De).delete({url:"/conversations/{id}",...e}),PA=e=>(e.client??De).get({url:"/conversations/{id}",...e}),NA=e=>(e.client??De).get({url:"/conversations",...e}),LA=e=>(e.client??De).post({url:"/conversations",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),FA=e=>(e.client??De).get({url:"/conversations/{id}/messages",...e}),RA=e=>(e.client??De).get({url:"/conversations/{id}/participants",...e}),BA=e=>(e.client??De).post({url:"/conversations/{id}/participants",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),zA=e=>(e.client??De).delete({url:"/conversations/{id}/participants/{userId}",...e}),$A=e=>(e.client??De).get({url:"/conversations/{id}/participants/{userId}",...e}),jA=e=>(e.client??De).delete({url:"/messages/{id}",...e}),UA=e=>(e.client??De).get({url:"/messages/{id}",...e}),HA=e=>(e.client??De).put({url:"/messages/{id}",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),WA=e=>(e.client??De).post({url:"/messages",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),VA=e=>(e.client??De).delete({url:"/messages/{id}/feedback",...e}),qA=e=>(e.client??De).put({url:"/messages/{id}/feedback",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),KA=e=>(e.client??De).delete({url:"/users/me",...e}),YA=e=>(e.client??De).get({url:"/users/me",...e}),GA=e=>(e.client??De).put({url:"/users/me",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),QA=e=>((e==null?void 0:e.client)??De).post({url:"/users/key",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),JA=e=>(e.client??De).get({url:"/events/{id}",...e}),ZA=e=>(e.client??De).post({url:"/events",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),XA=e=>(e.client??De).post({url:"/files",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}});let Lp=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 ls(e){}function eI(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=ls,onError:n=ls,onRetry:r=ls,onComment:i}=e;let o="",a=!0,s,l="",u="";function f(h){const g=a?h.replace(/^\xEF\xBB\xBF/,""):h,[y,v]=tI(`${o}${g}`);for(const w of y)c(w);o=v,a=!1}function c(h){if(h===""){d();return}if(h.startsWith(":")){i&&i(h.slice(h.startsWith(": ")?2:1));return}const g=h.indexOf(":");if(g!==-1){const y=h.slice(0,g),v=h[g+1]===" "?2:1,w=h.slice(g+v);p(y,w,h);return}p(h,"",h)}function p(h,g,y){switch(h){case"event":u=g;break;case"data":l=`${l}${g}
314
+ `;break;case"id":s=g.includes("\0")?void 0:g;break;case"retry":/^\d+$/.test(g)?r(parseInt(g,10)):n(new Lp(`Invalid \`retry\` value: "${g}"`,{type:"invalid-retry",value:g,line:y}));break;default:n(new Lp(`Unknown field "${h.length>20?`${h.slice(0,20)}…`:h}"`,{type:"unknown-field",field:h,value:g,line:y}));break}}function d(){l.length>0&&t({id:s,event:u||void 0,data:l.endsWith(`
315
+ `)?l.slice(0,-1):l}),s=void 0,l="",u=""}function m(h={}){o&&h.consume&&c(o),a=!0,s=void 0,l="",u="",o=""}return{feed:f,reset:m}}function tI(e){const t=[];let n="",r=0;for(;r<e.length;){const i=e.indexOf("\r",r),o=e.indexOf(`
316
316
  `,r);let a=-1;if(i!==-1&&o!==-1?a=Math.min(i,o):i!==-1?i===e.length-1?a=-1:a=i:o!==-1&&(a=o),a===-1){n=e.slice(r);break}else{const s=e.slice(r,a);t.push(s),r=a+1,e[r-1]==="\r"&&e[r]===`
317
- `&&r++}}return[t,n]}class $p 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(jp(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(jp(this),n)}}function aI(e){const t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function ps(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(ps).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${ps(e.cause)}`:e.message:`${e}`}function jp(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var Up=e=>{throw TypeError(e)},hs=(e,t,n)=>t.has(e)||Up("Cannot "+n),ve=(e,t,n)=>(hs(e,t,"read from private field"),n?n.call(e):t.get(e)),Be=(e,t,n)=>t.has(e)?Up("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),_e=(e,t,n,r)=>(hs(e,t,"write to private field"),t.set(e,n),n),It=(e,t,n)=>(hs(e,t,"access private method"),n),Xe,Qt,vn,Ai,Ii,gr,bn,yr,Bt,wn,xn,kn,vr,mt,ms,gs,ys,Hp,vs,bs,br,ws,xs;class Ti extends EventTarget{constructor(t,n){var r,i;super(),Be(this,mt),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,Be(this,Xe),Be(this,Qt),Be(this,vn),Be(this,Ai),Be(this,Ii),Be(this,gr),Be(this,bn),Be(this,yr,null),Be(this,Bt),Be(this,wn),Be(this,xn,null),Be(this,kn,null),Be(this,vr,null),Be(this,gs,async o=>{var a;ve(this,wn).reset();const{body:s,redirected:l,status:u,headers:f}=o;if(u===204){It(this,mt,br).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(l?_e(this,vn,new URL(o.url)):_e(this,vn,void 0),u!==200){It(this,mt,br).call(this,`Non-200 status code (${u})`,u);return}if(!(f.get("content-type")||"").startsWith("text/event-stream")){It(this,mt,br).call(this,'Invalid content type, expected "text/event-stream"',u);return}if(ve(this,Xe)===this.CLOSED)return;_e(this,Xe,this.OPEN);const c=new Event("open");if((a=ve(this,vr))==null||a.call(this,c),this.dispatchEvent(c),typeof s!="object"||!s||!("getReader"in s)){It(this,mt,br).call(this,"Invalid response body, expected a web ReadableStream",u),this.close();return}const p=new TextDecoder,d=s.getReader();let m=!0;do{const{done:h,value:g}=await d.read();g&&ve(this,wn).feed(p.decode(g,{stream:!h})),h&&(m=!1,ve(this,wn).reset(),It(this,mt,ws).call(this))}while(m)}),Be(this,ys,o=>{_e(this,Bt,void 0),!(o.name==="AbortError"||o.type==="aborted")&&It(this,mt,ws).call(this,ps(o))}),Be(this,vs,o=>{typeof o.id=="string"&&_e(this,yr,o.id);const a=new MessageEvent(o.event||"message",{data:o.data,origin:ve(this,vn)?ve(this,vn).origin:ve(this,Qt).origin,lastEventId:o.id||""});ve(this,kn)&&(!o.event||o.event==="message")&&ve(this,kn).call(this,a),this.dispatchEvent(a)}),Be(this,bs,o=>{_e(this,gr,o)}),Be(this,xs,()=>{_e(this,bn,void 0),ve(this,Xe)===this.CONNECTING&&It(this,mt,ms).call(this)});try{if(t instanceof URL)_e(this,Qt,t);else if(typeof t=="string")_e(this,Qt,new URL(t,sI()));else throw new Error("Invalid URL")}catch{throw aI("An invalid or illegal string was specified")}_e(this,wn,iI({onEvent:ve(this,vs),onRetry:ve(this,bs)})),_e(this,Xe,this.CONNECTING),_e(this,gr,3e3),_e(this,Ii,(r=n==null?void 0:n.fetch)!=null?r:globalThis.fetch),_e(this,Ai,(i=n==null?void 0:n.withCredentials)!=null?i:!1),It(this,mt,ms).call(this)}get readyState(){return ve(this,Xe)}get url(){return ve(this,Qt).href}get withCredentials(){return ve(this,Ai)}get onerror(){return ve(this,xn)}set onerror(t){_e(this,xn,t)}get onmessage(){return ve(this,kn)}set onmessage(t){_e(this,kn,t)}get onopen(){return ve(this,vr)}set onopen(t){_e(this,vr,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(){ve(this,bn)&&clearTimeout(ve(this,bn)),ve(this,Xe)!==this.CLOSED&&(ve(this,Bt)&&ve(this,Bt).abort(),_e(this,Xe,this.CLOSED),_e(this,Bt,void 0))}}Xe=new WeakMap,Qt=new WeakMap,vn=new WeakMap,Ai=new WeakMap,Ii=new WeakMap,gr=new WeakMap,bn=new WeakMap,yr=new WeakMap,Bt=new WeakMap,wn=new WeakMap,xn=new WeakMap,kn=new WeakMap,vr=new WeakMap,mt=new WeakSet,ms=function(){_e(this,Xe,this.CONNECTING),_e(this,Bt,new AbortController),ve(this,Ii)(ve(this,Qt),It(this,mt,Hp).call(this)).then(ve(this,gs)).catch(ve(this,ys))},gs=new WeakMap,ys=new WeakMap,Hp=function(){var e;const t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...ve(this,yr)?{"Last-Event-ID":ve(this,yr)}:void 0},cache:"no-store",signal:(e=ve(this,Bt))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},vs=new WeakMap,bs=new WeakMap,br=function(e,t){var n;ve(this,Xe)!==this.CLOSED&&_e(this,Xe,this.CLOSED);const r=new $p("error",{code:t,message:e});(n=ve(this,xn))==null||n.call(this,r),this.dispatchEvent(r)},ws=function(e,t){var n;if(ve(this,Xe)===this.CLOSED)return;_e(this,Xe,this.CONNECTING);const r=new $p("error",{code:t,message:e});(n=ve(this,xn))==null||n.call(this,r),this.dispatchEvent(r),_e(this,bn,setTimeout(ve(this,xs),ve(this,gr)))},xs=new WeakMap,Ti.CONNECTING=0,Ti.OPEN=1,Ti.CLOSED=2;function sI(){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 lI(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 Wp=()=>{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}))}}},Le=e=>e.data,Vp=10,qp=3e3,uI="60000",cI={throwOnError:!0},fI=({conversationId:e,userToken:t,clientId:n,apiUrl:r,adminSecret:i})=>{let o=0,a=null;const s=Wp(),l=()=>{a&&a.close();const u=`${`${r||Me.getConfig().baseUrl}/${n}`}/initialize${e?`?conversationId=${e}`:""}`,f={...i?{"x-admin-secret":i}:{},...t?{"x-user-key":t}:{}};a=Yp(u,f),a.onopen=()=>s.emit("open"),a.onerror=c=>{o<Vp?(o++,setTimeout(()=>l(),qp)):s.emit("error",c)},a.onmessage=c=>{const p=Kp(c.data);s.emit(p.type,p.data)}};return l(),s.on},dI=({userKey:e,clientId:t,apiUrl:n,customHeaders:r})=>{const i={"x-user-key":e,...r},o=`${n||Me.getConfig().baseUrl}/${t}`,a={...cI,baseUrl:o};return Me.interceptors.response._fns.length===0&&Me.interceptors.response.use(lI),{createConversation:()=>zA({...a,headers:i,body:{}}).then(Le),getConversation:({conversationId:s})=>RA({...a,headers:i,path:{id:s}}).then(Le),deleteConversation:({conversationId:s})=>FA({...a,headers:i,path:{id:s}}).then(Le),listConversations:({nextToken:s})=>BA({...a,headers:i,query:{nextToken:s}}).then(Le),listConversationMessages:({conversationId:s,nextToken:l})=>$A({...a,headers:i,path:{id:s},query:{nextToken:l}}).then(Le),addParticipant:({conversationId:s,userId:l})=>UA({...a,headers:i,path:{id:s},body:{userId:l}}).then(Le),removeParticipant:({conversationId:s,userId:l})=>HA({...a,headers:i,path:{id:s,userId:l}}).then(Le),getParticipant:({conversationId:s,userId:l})=>WA({...a,headers:i,path:{id:s,userId:l}}).then(Le),listParticipants:({conversationId:s,nextToken:l})=>jA({...a,headers:i,path:{id:s},query:{nextToken:l}}).then(Le),createMessage:s=>YA({...a,headers:i,body:s}).then(Le),updateMessage:({messageId:s,...l})=>KA({...a,headers:i,path:{id:s},body:l}).then(Le),getMessage:({messageId:s})=>qA({...a,headers:i,path:{id:s}}).then(Le),deleteMessage:({messageId:s})=>VA({...a,headers:i,path:{id:s}}).then(Le),createFile:s=>rI({...a,headers:i,body:s}).then(Le),getUser:()=>ZA({...a,headers:i}).then(Le),updateUser:s=>XA({...a,headers:i,body:s}).then(Le),deleteUser:()=>JA({...a,headers:i}).then(Le),createEvent:s=>nI({...a,headers:i,body:s}).then(Le),getEvent:({eventId:s})=>tI({...a,headers:i,path:{id:s}}).then(Le),addMessageFeedback:({messageId:s,...l})=>QA({...a,headers:i,path:{id:s},body:l}).then(Le),removeMessageFeedback:({messageId:s})=>GA({...a,headers:i,path:{id:s}}).then(Le),generateUserKey:({adminSecret:s,...l})=>eI({...a,headers:{"x-admin-secret":s},body:l}).then(Le),listenConversation:({conversationId:s})=>{let l=0,u=null;const f=Wp(),c=()=>{u&&u.close();const p=`${o}/conversations/${s}/listen`;u=Yp(p,i),u.onopen=()=>f.emit("open"),u.onerror=d=>{l<Vp?(l++,setTimeout(()=>c(),qp)):f.emit("error",d)},u.onmessage=d=>{const m=Kp(d.data);f.emit(m.type,m.data)}};return c(),f.on}}},Kp=e=>{try{return JSON.parse(e)}catch{return e}},Yp=(e,t)=>new Ti(e,{fetch:(n,r)=>fetch(n,{...r,headers:{...r==null?void 0:r.headers,...t,timeout:uI}})}),Gp={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:$i&&$i.tagName.toUpperCase()==="SCRIPT"&&$i.src||new URL("index.umd.cjs",document.baseURI).href).href};function Qp({apiUrl:e="https://webchat.botpress.cloud",clientId:t,storageKey:n,storageLocation:r,adminSecret:i,soundEnabled:o,...a}){var oe;const s=rf(n,r),l=s(G=>G.conversationId),u=s(G=>G.user),f=s(G=>G.setConversationId),c=s(G=>G.setUser),p=s(G=>G.clearConversationId),d=an(G=>G.messages),m=an(G=>G.saveMessage),h=an(G=>G.updateMessage),g=an(G=>G.fetchMessages),y=an(G=>G.setMessages),v=an(G=>G.clearMessages),w=Gn(G=>G.participants),A=Gn(G=>G.setParticipants),k=Gn(G=>G.addParticipant),C=Gn(G=>G.removeParticipant),T=Gn(G=>G.clearParticipants),P=af(`webchat-sound-${t}`),F=P(G=>G.soundOn),I=P(G=>G.toggleSound),{state:O,setState:j}=Mp(),{state:z,setState:M}=Mp(),D=_.useMemo(()=>Xs(),[]),[B,U]=_.useState("connecting"),[$,V]=_.useState(a.conversationId),[b,N]=_.useState(a.user),[H,x]=_.useState(void 0),[W,ee]=_.useState(!1),[Y,J]=_.useState(void 0),X=_.useRef(!1),ie=_.useRef(null),K=_.useRef(o??!1);_.useEffect(()=>{K.current=o??!1},[o]);const te=_.useRef(F);_.useEffect(()=>{te.current=F},[F]),_.useEffect(()=>{var Ue,Ye,Z,se;const G=pI(t,e);if(G){J(G),U("error");return}if(X.current)return;X.current=!0,j(!1),U("connecting");try{ie.current=new Audio,ie.current.preload="auto",ie.current.src=Gp.chatMessageNotification,ie.current.volume=.9}catch(R){console.error("Error loading sound effect:",R),ie.current=null}let ue;(Ue=a.user)!=null&&Ue.userToken&&a.conversationId?ue={conversationId:a.conversationId,userToken:(Ye=a.user)==null?void 0:Ye.userToken}:(Z=a.user)!=null&&Z.userToken?ue={conversationId:void 0,userToken:(se=a.user)==null?void 0:se.userToken}:ue={conversationId:l,userToken:u==null?void 0:u.userToken};const de=fI({apiUrl:e,clientId:t,userToken:ue.userToken,conversationId:ue.conversationId,adminSecret:i});let we=[];const Se=de("init",({conversation:R,messages:q,participants:ae,user:le})=>{const pe=dI({clientId:t,apiUrl:e,userKey:le.userKey});pe.createEvent({conversationId:R.id,payload:{type:"conversation_started",data:{}}}).then(({event:fe})=>{var Ee,Oe;(Oe=(Ee=fe.payload.data)==null?void 0:Ee.status)!=null&&Oe.isInitial&&D.emit("conversation",R.id)}),we=[...we,de("error",fe=>{J(Ee=>Ee||Sr(fe)),U("error"),D.emit("error",new Error(`Connection to conversation lost: ${fe==null?void 0:fe.message}`))}),de("message_created",fe=>{const Ee=Kn(fe);le.id!==Ee.authorId&&(K.current&&te.current&&ie.current&&ie.current.play().catch(()=>{}),j(!1),M(!1),D.emit("isTyping",{isTyping:!1,timeout:0})),m(Ee),D.emit("message",Ee)}),de("message_status_changed",fe=>{var Ee;fe.newStatus==="processing"&&h((Ee=fe.message.metadata)==null?void 0:Ee.clientMessageId,{status:fe.newStatus})}),de("typing_stopped",()=>{j(!1),M(!1)}),de("typing_started",()=>{j(!0,5e3),M(!0,5e3),D.emit("isTyping",{isTyping:!0,timeout:5e3})}),de("participant_added",fe=>{k(fe.participant),D.emit("participantAdded",fe.participant)}),de("participant_removed",fe=>{C(fe.participantId),D.emit("participantRemoved",fe.participantId)}),de("webchat_visibility",fe=>D.emit("webchatVisibility",fe.visibility)),de("webchat_config",fe=>D.emit("webchatConfig",fe.config)),de("custom",fe=>D.emit("customEvent",fe.event))],V(R.id),f(R.id),N({userId:le.id,userToken:le.userKey}),c({userId:le.id,userToken:le.userKey}),A(ae),y(q.reverse().map(fe=>Kn(fe)).filter(Boolean)),J(void 0),U("connected"),x(pe)});return we.push(Se),()=>{X.current=!1,we.forEach(R=>R())}},[a.conversationId,(oe=a.user)==null?void 0:oe.userToken,W]);const L=async(G,ue)=>{const de=ue||$;if(!G||!de)return;const we=await g({client:G,conversationId:de});y(we);const{participants:Se}=await G.listParticipants({conversationId:de});A(Se)},ne=async G=>{if(!G)throw new Error("Cannot start new conversation: client is not initialized");p(),v(),T(),V(void 0),ee(ue=>!ue)};async function me(G,ue){const we=[{predicate:Se=>Se.message===Ji||Se.type==="ResourceNotFound",recover:()=>ne(ue)},{predicate:Se=>Se.type==="network"||Se.type==="disconnected"||Se.message===Pn,recover:()=>L(ue,$)}].find(Se=>Se.predicate(G));if(!we){U("error"),J(G);return}try{await Sl(we.recover,3,5e3),J(void 0),U("connected")}catch(Se){J(Sr(Se)),U("error")}}if(B!=="connected"||!b||!$||!H)return{clientState:B,on:D.on,client:void 0,messages:[],conversationId:void 0,newConversation:async()=>{await ne(H)},user:void 0,isTyping:void 0,participants:[],toggleSound:I,soundOn:F,error:Y,disableSendButton:z};const ke={sendMessage:async G=>{const ue=ss(),de={id:ue,createdAt:new Date().toISOString(),userId:b.userId,conversationId:$,payload:G,metadata:{clientMessageId:ue,delivered:!1}},we=Kn(de);we.status="pending",m(we),M(!0,5e3);try{await H.createMessage({conversationId:$,payload:G,metadata:{clientMessageId:ue}})}catch(Se){await me(Sr(Se),H),D.emit("error",Se)}},sendEvent:async(G,ue)=>{await H.createEvent({conversationId:$,payload:{type:"custom",data:G},bindConversation:(ue==null?void 0:ue.bindConversation)??!0,bindUser:(ue==null?void 0:ue.bindUser)??!0})},uploadFile:async G=>{const{size:ue,name:de}=G,Se=await(ae=>new Promise((le,pe)=>{const fe=new FileReader;fe.onload=Ee=>{var Oe;return le((Oe=Ee.target)==null?void 0:Oe.result)},fe.onerror=Ee=>{var Oe;return pe((Oe=Ee.target)==null?void 0:Oe.error)},fe.readAsArrayBuffer(ae)}))(G),Ue=new Date;Ue.setDate(Ue.getDate()+30);const{file:{uploadUrl:Ye,contentType:Z,url:se}}=await H.createFile({size:ue,key:`${ss(6)}-${G.name}`,accessPolicies:["public_content"],index:!1,tags:{source:"integration",integrationName:"webchat",conversation:$,user:b.userId},expiresAt:Ue.toISOString()});await fetch(Ye,{method:"PUT",headers:{"x-amz-tagging":"public=true","content-type":Z},body:Se});const R=Z.split("/").shift()??"",q=cl(R)?R:"file";return{fileUrl:se,name:de,type:q}},addMessageFeedback:async(G,ue)=>{h(G,{feedback:ue.value}),await H.addMessageFeedback({messageId:G,...ue})},getUser:async()=>{const{user:G}=await H.getUser();return G},updateUser:async G=>{const{user:ue}=await H.updateUser({name:G.name,pictureUrl:G.pictureUrl,userData:G.data});return ue}};return{clientState:"connected",on:D.on,client:ke,messages:d,conversationId:$,newConversation:async()=>{await ne(H)},user:b,isTyping:O,participants:w,error:Y,soundOn:F,toggleSound:I,disableSendButton:z}}const pI=(e,t)=>{if(!e)return{type:"configuration",message:fl};if(!zm(t))return{type:"configuration",message:dl}},hI=({clientId:e,storageKey:t,configuration:n,allowFileUpload:r,apiUrl:i,user:o,conversationId:a,...s})=>{const l=t||`bp-webchat-${e}`,{clientState:u,client:f,isTyping:c,newConversation:p,messages:d,participants:m,user:h,error:g,soundOn:y,toggleSound:v,disableSendButton:w}=Qp({clientId:e,apiUrl:i,conversationId:a,user:o,storageKey:l,storageLocation:n==null?void 0:n.storageLocation,adminSecret:n==null?void 0:n.adminSecret,soundEnabled:n==null?void 0:n.soundEnabled}),{sendMessage:A,uploadFile:k,addMessageFeedback:C}=f??{};return S.jsx(Dp,{configuration:n??{},user:h!=null&&h.userId?{id:h==null?void 0:h.userId}:void 0,isLoading:u==="connecting",isTyping:c,connected:u==="connected"?!0:u==="disconnected"?!1:void 0,messages:d,sendMessage:A,uploadFile:k,addMessageFeedback:C,allowFileUpload:r,restartConversation:p,...s,participants:m,error:g,clientId:e,soundOn:y,toggleSound:v,disableSendButton:w})};function mI(e,t=globalThis==null?void 0:globalThis.document){const n=Zt(e);E.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 gI="DismissableLayer",ks="dismissableLayer.update",yI="dismissableLayer.pointerDownOutside",vI="dismissableLayer.focusOutside",Jp,Zp=E.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Xp=E.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:a,onDismiss:s,...l}=e,u=E.useContext(Zp),[f,c]=E.useState(null),p=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,d]=E.useState({}),m=Ot(t,T=>c(T)),h=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=h.indexOf(g),v=f?h.indexOf(f):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,A=v>=y,k=xI(T=>{const P=T.target,F=[...u.branches].some(I=>I.contains(P));!A||F||(i==null||i(T),a==null||a(T),T.defaultPrevented||s==null||s())},p),C=kI(T=>{const P=T.target;[...u.branches].some(I=>I.contains(P))||(o==null||o(T),a==null||a(T),T.defaultPrevented||s==null||s())},p);return mI(T=>{v===u.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&s&&(T.preventDefault(),s()))},p),E.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Jp=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),eh(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Jp)}},[f,p,n,u]),E.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),eh())},[f,u]),E.useEffect(()=>{const T=()=>d({});return document.addEventListener(ks,T),()=>document.removeEventListener(ks,T)},[]),S.jsx(ht.div,{...l,ref:m,style:{pointerEvents:w?A?"auto":"none":void 0,...e.style},onFocusCapture:At(e.onFocusCapture,C.onFocusCapture),onBlurCapture:At(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:At(e.onPointerDownCapture,k.onPointerDownCapture)})});Xp.displayName=gI;var bI="DismissableLayerBranch",wI=E.forwardRef((e,t)=>{const n=E.useContext(Zp),r=E.useRef(null),i=Ot(t,r);return E.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),S.jsx(ht.div,{...e,ref:i})});wI.displayName=bI;function xI(e,t=globalThis==null?void 0:globalThis.document){const n=Zt(e),r=E.useRef(!1),i=E.useRef(()=>{});return E.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let l=function(){th(yI,n,u,{discrete:!0})};const u={originalEvent:s};s.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},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function kI(e,t=globalThis==null?void 0:globalThis.document){const n=Zt(e),r=E.useRef(!1);return E.useEffect(()=>{const i=o=>{o.target&&!r.current&&th(vI,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 eh(){const e=new CustomEvent(ks);document.dispatchEvent(e)}function th(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?GC(i,o):i.dispatchEvent(o)}var Ss="focusScope.autoFocusOnMount",Es="focusScope.autoFocusOnUnmount",nh={bubbles:!1,cancelable:!0},SI="FocusScope",rh=E.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[s,l]=E.useState(null),u=Zt(i),f=Zt(o),c=E.useRef(null),p=Ot(t,h=>l(h)),d=E.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;E.useEffect(()=>{if(r){let h=function(w){if(d.paused||!s)return;const A=w.target;s.contains(A)?c.current=A:zt(c.current,{select:!0})},g=function(w){if(d.paused||!s)return;const A=w.relatedTarget;A!==null&&(s.contains(A)||zt(c.current,{select:!0}))},y=function(w){if(document.activeElement===document.body)for(const k of w)k.removedNodes.length>0&&zt(s)};document.addEventListener("focusin",h),document.addEventListener("focusout",g);const v=new MutationObserver(y);return s&&v.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",g),v.disconnect()}}},[r,s,d.paused]),E.useEffect(()=>{if(s){ah.add(d);const h=document.activeElement;if(!s.contains(h)){const y=new CustomEvent(Ss,nh);s.addEventListener(Ss,u),s.dispatchEvent(y),y.defaultPrevented||(EI(OI(ih(s)),{select:!0}),document.activeElement===h&&zt(s))}return()=>{s.removeEventListener(Ss,u),setTimeout(()=>{const y=new CustomEvent(Es,nh);s.addEventListener(Es,f),s.dispatchEvent(y),y.defaultPrevented||zt(h??document.body,{select:!0}),s.removeEventListener(Es,f),ah.remove(d)},0)}}},[s,u,f,d]);const m=E.useCallback(h=>{if(!n&&!r||d.paused)return;const g=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,y=document.activeElement;if(g&&y){const v=h.currentTarget,[w,A]=CI(v);w&&A?!h.shiftKey&&y===A?(h.preventDefault(),n&&zt(w,{select:!0})):h.shiftKey&&y===w&&(h.preventDefault(),n&&zt(A,{select:!0})):y===v&&h.preventDefault()}},[n,r,d.paused]);return S.jsx(ht.div,{tabIndex:-1,...a,ref:p,onKeyDown:m})});rh.displayName=SI;function EI(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(zt(r,{select:t}),document.activeElement!==n)return}function CI(e){const t=ih(e),n=oh(t,e),r=oh(t.reverse(),e);return[n,r]}function ih(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 oh(e,t){for(const n of e)if(!AI(n,{upTo:t}))return n}function AI(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 II(e){return e instanceof HTMLInputElement&&"select"in e}function zt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&II(e)&&t&&e.select()}}var ah=TI();function TI(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=sh(e,t),e.unshift(t)},remove(t){var n;e=sh(e,t),(n=e[0])==null||n.resume()}}}function sh(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function OI(e){return e.filter(t=>t.tagName!=="A")}var Cs=0;function DI(){E.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??lh()),document.body.insertAdjacentElement("beforeend",e[1]??lh()),Cs++,()=>{Cs===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Cs--}},[])}function lh(){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 Oi="right-scroll-bar-position",Di="width-before-scroll-bar",MI="with-scroll-bars-hidden",_I="--removed-body-scroll-bar-size";function As(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function PI(e,t){var n=_.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var NI=typeof window<"u"?E.useLayoutEffect:E.useEffect,uh=new WeakMap;function LI(e,t){var n=PI(null,function(r){return e.forEach(function(i){return As(i,r)})});return NI(function(){var r=uh.get(n);if(r){var i=new Set(r),o=new Set(e),a=n.current;i.forEach(function(s){o.has(s)||As(s,null)}),o.forEach(function(s){i.has(s)||As(s,a)})}uh.set(n,e)},[e]),n}function FI(e){return e}function RI(e,t){t===void 0&&(t=FI);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 a=t(o,r);return n.push(a),function(){n=n.filter(function(s){return s!==a})}},assignSyncMedium:function(o){for(r=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(s){return o(s)},filter:function(){return n}}},assignMedium:function(o){r=!0;var a=[];if(n.length){var s=n;n=[],s.forEach(o),a=n}var l=function(){var f=a;a=[],f.forEach(o)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(f){a.push(f),u()},filter:function(f){return a=a.filter(f),n}}}};return i}function BI(e){e===void 0&&(e={});var t=RI(null);return t.options=ot({async:!0,ssr:!1},e),t}var ch=function(e){var t=e.sideCar,n=cf(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 E.createElement(r,ot({},n))};ch.isSideCarExport=!0;function zI(e,t){return e.useMedium(t),ch}var fh=BI(),Is=function(){},Mi=E.forwardRef(function(e,t){var n=E.useRef(null),r=E.useState({onScrollCapture:Is,onWheelCapture:Is,onTouchMoveCapture:Is}),i=r[0],o=r[1],a=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,f=e.enabled,c=e.shards,p=e.sideCar,d=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,y=e.as,v=y===void 0?"div":y,w=e.gapMode,A=cf(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=p,C=LI([n,t]),T=ot(ot({},A),i);return E.createElement(E.Fragment,null,f&&E.createElement(k,{sideCar:fh,removeScrollBar:u,shards:c,noRelative:d,noIsolation:m,inert:h,setCallbacks:o,allowPinchZoom:!!g,lockRef:n,gapMode:w}),a?E.cloneElement(E.Children.only(s),ot(ot({},T),{ref:C})):E.createElement(v,ot({},T,{className:l,ref:C}),s))});Mi.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Mi.classNames={fullWidth:Di,zeroRight:Oi};var $I=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function jI(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=$I();return t&&e.setAttribute("nonce",t),e}function UI(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function HI(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var WI=function(){var e=0,t=null;return{add:function(n){e==0&&(t=jI())&&(UI(t,n),HI(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},VI=function(){var e=WI();return function(t,n){E.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},dh=function(){var e=VI(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},qI={left:0,top:0,right:0,gap:0},Ts=function(e){return parseInt(e||"",10)||0},KI=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[Ts(n),Ts(r),Ts(i)]},YI=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return qI;var t=KI(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])}},GI=dh(),Sn="data-scroll-locked",QI=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),`
318
- .`.concat(MI,` {
317
+ `&&r++}}return[t,n]}class Fp 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(Rp(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(Rp(this),n)}}function nI(e){const t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function us(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(us).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${us(e.cause)}`:e.message:`${e}`}function Rp(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var Bp=e=>{throw TypeError(e)},cs=(e,t,n)=>t.has(e)||Bp("Cannot "+n),ve=(e,t,n)=>(cs(e,t,"read from private field"),n?n.call(e):t.get(e)),Be=(e,t,n)=>t.has(e)?Bp("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),_e=(e,t,n,r)=>(cs(e,t,"write to private field"),t.set(e,n),n),It=(e,t,n)=>(cs(e,t,"access private method"),n),et,Qt,vn,Si,Ei,pr,bn,hr,Bt,wn,xn,kn,mr,mt,fs,ds,ps,zp,hs,ms,gr,gs,ys;class Ci extends EventTarget{constructor(t,n){var r,i;super(),Be(this,mt),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,Be(this,et),Be(this,Qt),Be(this,vn),Be(this,Si),Be(this,Ei),Be(this,pr),Be(this,bn),Be(this,hr,null),Be(this,Bt),Be(this,wn),Be(this,xn,null),Be(this,kn,null),Be(this,mr,null),Be(this,ds,async o=>{var a;ve(this,wn).reset();const{body:s,redirected:l,status:u,headers:f}=o;if(u===204){It(this,mt,gr).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(l?_e(this,vn,new URL(o.url)):_e(this,vn,void 0),u!==200){It(this,mt,gr).call(this,`Non-200 status code (${u})`,u);return}if(!(f.get("content-type")||"").startsWith("text/event-stream")){It(this,mt,gr).call(this,'Invalid content type, expected "text/event-stream"',u);return}if(ve(this,et)===this.CLOSED)return;_e(this,et,this.OPEN);const c=new Event("open");if((a=ve(this,mr))==null||a.call(this,c),this.dispatchEvent(c),typeof s!="object"||!s||!("getReader"in s)){It(this,mt,gr).call(this,"Invalid response body, expected a web ReadableStream",u),this.close();return}const p=new TextDecoder,d=s.getReader();let m=!0;do{const{done:h,value:g}=await d.read();g&&ve(this,wn).feed(p.decode(g,{stream:!h})),h&&(m=!1,ve(this,wn).reset(),It(this,mt,gs).call(this))}while(m)}),Be(this,ps,o=>{_e(this,Bt,void 0),!(o.name==="AbortError"||o.type==="aborted")&&It(this,mt,gs).call(this,us(o))}),Be(this,hs,o=>{typeof o.id=="string"&&_e(this,hr,o.id);const a=new MessageEvent(o.event||"message",{data:o.data,origin:ve(this,vn)?ve(this,vn).origin:ve(this,Qt).origin,lastEventId:o.id||""});ve(this,kn)&&(!o.event||o.event==="message")&&ve(this,kn).call(this,a),this.dispatchEvent(a)}),Be(this,ms,o=>{_e(this,pr,o)}),Be(this,ys,()=>{_e(this,bn,void 0),ve(this,et)===this.CONNECTING&&It(this,mt,fs).call(this)});try{if(t instanceof URL)_e(this,Qt,t);else if(typeof t=="string")_e(this,Qt,new URL(t,rI()));else throw new Error("Invalid URL")}catch{throw nI("An invalid or illegal string was specified")}_e(this,wn,eI({onEvent:ve(this,hs),onRetry:ve(this,ms)})),_e(this,et,this.CONNECTING),_e(this,pr,3e3),_e(this,Ei,(r=n==null?void 0:n.fetch)!=null?r:globalThis.fetch),_e(this,Si,(i=n==null?void 0:n.withCredentials)!=null?i:!1),It(this,mt,fs).call(this)}get readyState(){return ve(this,et)}get url(){return ve(this,Qt).href}get withCredentials(){return ve(this,Si)}get onerror(){return ve(this,xn)}set onerror(t){_e(this,xn,t)}get onmessage(){return ve(this,kn)}set onmessage(t){_e(this,kn,t)}get onopen(){return ve(this,mr)}set onopen(t){_e(this,mr,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(){ve(this,bn)&&clearTimeout(ve(this,bn)),ve(this,et)!==this.CLOSED&&(ve(this,Bt)&&ve(this,Bt).abort(),_e(this,et,this.CLOSED),_e(this,Bt,void 0))}}et=new WeakMap,Qt=new WeakMap,vn=new WeakMap,Si=new WeakMap,Ei=new WeakMap,pr=new WeakMap,bn=new WeakMap,hr=new WeakMap,Bt=new WeakMap,wn=new WeakMap,xn=new WeakMap,kn=new WeakMap,mr=new WeakMap,mt=new WeakSet,fs=function(){_e(this,et,this.CONNECTING),_e(this,Bt,new AbortController),ve(this,Ei)(ve(this,Qt),It(this,mt,zp).call(this)).then(ve(this,ds)).catch(ve(this,ps))},ds=new WeakMap,ps=new WeakMap,zp=function(){var e;const t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...ve(this,hr)?{"Last-Event-ID":ve(this,hr)}:void 0},cache:"no-store",signal:(e=ve(this,Bt))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},hs=new WeakMap,ms=new WeakMap,gr=function(e,t){var n;ve(this,et)!==this.CLOSED&&_e(this,et,this.CLOSED);const r=new Fp("error",{code:t,message:e});(n=ve(this,xn))==null||n.call(this,r),this.dispatchEvent(r)},gs=function(e,t){var n;if(ve(this,et)===this.CLOSED)return;_e(this,et,this.CONNECTING);const r=new Fp("error",{code:t,message:e});(n=ve(this,xn))==null||n.call(this,r),this.dispatchEvent(r),_e(this,bn,setTimeout(ve(this,ys),ve(this,pr)))},ys=new WeakMap,Ci.CONNECTING=0,Ci.OPEN=1,Ci.CLOSED=2;function rI(){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 iI(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 $p=()=>{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}))}}},Le=e=>e.data,jp=10,Up=3e3,oI="60000",aI={throwOnError:!0},sI=({conversationId:e,userToken:t,clientId:n,apiUrl:r,adminSecret:i})=>{let o=0,a=null;const s=$p(),l=()=>{a&&a.close();const u=`${`${r||De.getConfig().baseUrl}/${n}`}/initialize${e?`?conversationId=${e}`:""}`,f={...i?{"x-admin-secret":i}:{},...t?{"x-user-key":t}:{}};a=Wp(u,f),a.onopen=()=>s.emit("open"),a.onerror=c=>{o<jp?(o++,setTimeout(()=>l(),Up)):s.emit("error",c)},a.onmessage=c=>{const p=Hp(c.data);s.emit(p.type,p.data)}};return l(),s.on},lI=({userKey:e,clientId:t,apiUrl:n,customHeaders:r})=>{const i={"x-user-key":e,...r},o=`${n||De.getConfig().baseUrl}/${t}`,a={...aI,baseUrl:o};return De.interceptors.response._fns.length===0&&De.interceptors.response.use(iI),{createConversation:()=>LA({...a,headers:i,body:{}}).then(Le),getConversation:({conversationId:s})=>PA({...a,headers:i,path:{id:s}}).then(Le),deleteConversation:({conversationId:s})=>_A({...a,headers:i,path:{id:s}}).then(Le),listConversations:({nextToken:s})=>NA({...a,headers:i,query:{nextToken:s}}).then(Le),listConversationMessages:({conversationId:s,nextToken:l})=>FA({...a,headers:i,path:{id:s},query:{nextToken:l}}).then(Le),addParticipant:({conversationId:s,userId:l})=>BA({...a,headers:i,path:{id:s},body:{userId:l}}).then(Le),removeParticipant:({conversationId:s,userId:l})=>zA({...a,headers:i,path:{id:s,userId:l}}).then(Le),getParticipant:({conversationId:s,userId:l})=>$A({...a,headers:i,path:{id:s,userId:l}}).then(Le),listParticipants:({conversationId:s,nextToken:l})=>RA({...a,headers:i,path:{id:s},query:{nextToken:l}}).then(Le),createMessage:s=>WA({...a,headers:i,body:s}).then(Le),updateMessage:({messageId:s,...l})=>HA({...a,headers:i,path:{id:s},body:l}).then(Le),getMessage:({messageId:s})=>UA({...a,headers:i,path:{id:s}}).then(Le),deleteMessage:({messageId:s})=>jA({...a,headers:i,path:{id:s}}).then(Le),createFile:s=>XA({...a,headers:i,body:s}).then(Le),getUser:()=>YA({...a,headers:i}).then(Le),updateUser:s=>GA({...a,headers:i,body:s}).then(Le),deleteUser:()=>KA({...a,headers:i}).then(Le),createEvent:s=>ZA({...a,headers:i,body:s}).then(Le),getEvent:({eventId:s})=>JA({...a,headers:i,path:{id:s}}).then(Le),addMessageFeedback:({messageId:s,...l})=>qA({...a,headers:i,path:{id:s},body:l}).then(Le),removeMessageFeedback:({messageId:s})=>VA({...a,headers:i,path:{id:s}}).then(Le),generateUserKey:({adminSecret:s,...l})=>QA({...a,headers:{"x-admin-secret":s},body:l}).then(Le),listenConversation:({conversationId:s})=>{let l=0,u=null;const f=$p(),c=()=>{u&&u.close();const p=`${o}/conversations/${s}/listen`;u=Wp(p,i),u.onopen=()=>f.emit("open"),u.onerror=d=>{l<jp?(l++,setTimeout(()=>c(),Up)):f.emit("error",d)},u.onmessage=d=>{const m=Hp(d.data);f.emit(m.type,m.data)}};return c(),f.on}}},Hp=e=>{try{return JSON.parse(e)}catch{return e}},Wp=(e,t)=>new Ci(e,{fetch:(n,r)=>fetch(n,{...r,headers:{...r==null?void 0:r.headers,...t,timeout:oI}})}),Vp={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:Fi&&Fi.tagName.toUpperCase()==="SCRIPT"&&Fi.src||new URL("index.umd.cjs",document.baseURI).href).href};function qp({apiUrl:e="https://webchat.botpress.cloud",clientId:t,storageKey:n,storageLocation:r,adminSecret:i,soundEnabled:o,...a}){var oe;const s=Xc(n,r),l=s(G=>G.conversationId),u=s(G=>G.user),f=s(G=>G.setConversationId),c=s(G=>G.setUser),p=s(G=>G.clearConversationId),d=an(G=>G.messages),m=an(G=>G.saveMessage),h=an(G=>G.updateMessage),g=an(G=>G.fetchMessages),y=an(G=>G.setMessages),v=an(G=>G.clearMessages),w=qn(G=>G.participants),A=qn(G=>G.setParticipants),k=qn(G=>G.addParticipant),C=qn(G=>G.removeParticipant),T=qn(G=>G.clearParticipants),_=tf(`webchat-sound-${t}`),F=_(G=>G.soundOn),I=_(G=>G.toggleSound),{state:O,setState:j}=Ip(),{state:z,setState:M}=Ip(),D=N.useMemo(()=>Gs(),[]),[B,U]=N.useState("connecting"),[$,W]=N.useState(a.conversationId),[b,P]=N.useState(a.user),[H,x]=N.useState(void 0),[V,ee]=N.useState(!1),[Y,J]=N.useState(void 0),X=N.useRef(!1),re=N.useRef(null),K=N.useRef(o??!1);N.useEffect(()=>{K.current=o??!1},[o]);const te=N.useRef(F);N.useEffect(()=>{te.current=F},[F]),N.useEffect(()=>{var He,Ge,Z,se;const G=uI(t,e);if(G){J(G),U("error");return}if(X.current)return;X.current=!0,j(!1),U("connecting");try{re.current=new Audio,re.current.preload="auto",re.current.src=Vp.chatMessageNotification,re.current.volume=.9}catch(R){console.error("Error loading sound effect:",R),re.current=null}let ue;(He=a.user)!=null&&He.userToken&&a.conversationId?ue={conversationId:a.conversationId,userToken:(Ge=a.user)==null?void 0:Ge.userToken}:(Z=a.user)!=null&&Z.userToken?ue={conversationId:void 0,userToken:(se=a.user)==null?void 0:se.userToken}:ue={conversationId:l,userToken:u==null?void 0:u.userToken};const de=sI({apiUrl:e,clientId:t,userToken:ue.userToken,conversationId:ue.conversationId,adminSecret:i});let we=[];const Se=de("init",({conversation:R,messages:q,participants:ae,user:le})=>{const pe=lI({clientId:t,apiUrl:e,userKey:le.userKey});pe.createEvent({conversationId:R.id,payload:{type:"conversation_started",data:{}}}).then(({event:fe})=>{var Ee,Me;(Me=(Ee=fe.payload.data)==null?void 0:Ee.status)!=null&&Me.isInitial&&D.emit("conversation",R.id)}),we=[...we,de("error",fe=>{J(Ee=>Ee||wr(fe)),U("error"),D.emit("error",new Error(`Connection to conversation lost: ${fe==null?void 0:fe.message}`))}),de("message_created",fe=>{const Ee=Wn(fe);le.id!==Ee.authorId&&(K.current&&te.current&&re.current&&re.current.play().catch(()=>{}),j(!1),M(!1),D.emit("isTyping",{isTyping:!1,timeout:0})),m(Ee),D.emit("message",Ee)}),de("message_status_changed",fe=>{var Ee;fe.newStatus==="processing"&&h((Ee=fe.message.metadata)==null?void 0:Ee.clientMessageId,{status:fe.newStatus})}),de("typing_stopped",()=>{j(!1),M(!1)}),de("typing_started",()=>{j(!0,5e3),M(!0,5e3),D.emit("isTyping",{isTyping:!0,timeout:5e3})}),de("participant_added",fe=>{k(fe.participant),D.emit("participantAdded",fe.participant)}),de("participant_removed",fe=>{C(fe.participantId),D.emit("participantRemoved",fe.participantId)}),de("webchat_visibility",fe=>D.emit("webchatVisibility",fe.visibility)),de("webchat_config",fe=>D.emit("webchatConfig",fe.config)),de("custom",fe=>D.emit("customEvent",fe.event))],W(R.id),f(R.id),P({userId:le.id,userToken:le.userKey}),c({userId:le.id,userToken:le.userKey}),A(ae),y(q.reverse().map(fe=>Wn(fe)).filter(Boolean)),J(void 0),U("connected"),x(pe)});return we.push(Se),()=>{X.current=!1,we.forEach(R=>R())}},[a.conversationId,(oe=a.user)==null?void 0:oe.userToken,V]);const L=async(G,ue)=>{const de=ue||$;if(!G||!de)return;const we=await g({client:G,conversationId:de});y(we);const{participants:Se}=await G.listParticipants({conversationId:de});A(Se)},ne=async G=>{if(!G)throw new Error("Cannot start new conversation: client is not initialized");p(),v(),T(),W(void 0),ee(ue=>!ue)};async function me(G,ue){const we=[{predicate:Se=>Se.message===Ki||Se.type==="ResourceNotFound",recover:()=>ne(ue)},{predicate:Se=>Se.type==="network"||Se.type==="disconnected"||Se.message===Dn,recover:()=>L(ue,$)}].find(Se=>Se.predicate(G));if(!we){U("error"),J(G);return}try{await bl(we.recover,3,5e3),J(void 0),U("connected")}catch(Se){J(wr(Se)),U("error")}}if(B!=="connected"||!b||!$||!H)return{clientState:B,on:D.on,client:void 0,messages:[],conversationId:void 0,newConversation:async()=>{await ne(H)},user:void 0,isTyping:void 0,participants:[],toggleSound:I,soundOn:F,error:Y,disableSendButton:z};const ke={sendMessage:async G=>{const ue=rs(),de={id:ue,createdAt:new Date().toISOString(),userId:b.userId,conversationId:$,payload:G,metadata:{clientMessageId:ue,delivered:!1}},we=Wn(de);we.status="pending",m(we),M(!0,5e3);try{await H.createMessage({conversationId:$,payload:G,metadata:{clientMessageId:ue}})}catch(Se){await me(wr(Se),H),D.emit("error",Se)}},sendEvent:async(G,ue)=>{await H.createEvent({conversationId:$,payload:{type:"custom",data:G},bindConversation:(ue==null?void 0:ue.bindConversation)??!0,bindUser:(ue==null?void 0:ue.bindUser)??!0})},uploadFile:async G=>{const{size:ue,name:de}=G,Se=await(le=>new Promise((pe,fe)=>{const Ee=new FileReader;Ee.onload=Me=>{var $e;return pe(($e=Me.target)==null?void 0:$e.result)},Ee.onerror=Me=>{var $e;return fe(($e=Me.target)==null?void 0:$e.error)},Ee.readAsArrayBuffer(le)}))(G),He=new Date;He.setDate(He.getDate()+30);const{file:{uploadUrl:Ge,contentType:Z,url:se,id:R}}=await H.createFile({size:ue,key:`${rs(6)}-${G.name}`,accessPolicies:["public_content"],index:!1,tags:{source:"integration",integrationName:"webchat",conversation:$,user:b.userId},expiresAt:He.toISOString()});await fetch(Ge,{method:"PUT",headers:{"x-amz-tagging":"public=true","content-type":Z},body:Se});const q=Z.split("/").shift()??"",ae=al(q)?q:"file";return{fileUrl:se,name:de,type:ae,fileId:R}},addMessageFeedback:async(G,ue)=>{h(G,{feedback:ue.value}),await H.addMessageFeedback({messageId:G,...ue})},getUser:async()=>{const{user:G}=await H.getUser();return G},updateUser:async G=>{const{user:ue}=await H.updateUser({name:G.name,pictureUrl:G.pictureUrl,userData:G.data});return ue}};return{clientState:"connected",on:D.on,client:ke,messages:d,conversationId:$,newConversation:async()=>{await ne(H)},user:b,isTyping:O,participants:w,error:Y,soundOn:F,toggleSound:I,disableSendButton:z}}const uI=(e,t)=>{if(!e)return{type:"configuration",message:sl};if(!Lm(t))return{type:"configuration",message:ll}},cI=({clientId:e,storageKey:t,configuration:n,allowFileUpload:r,apiUrl:i,user:o,conversationId:a,...s})=>{const l=t||`bp-webchat-${e}`,{clientState:u,client:f,isTyping:c,newConversation:p,messages:d,participants:m,user:h,error:g,soundOn:y,toggleSound:v,disableSendButton:w}=qp({clientId:e,apiUrl:i,conversationId:a,user:o,storageKey:l,storageLocation:n==null?void 0:n.storageLocation,adminSecret:n==null?void 0:n.adminSecret,soundEnabled:n==null?void 0:n.soundEnabled}),{sendMessage:A,uploadFile:k,addMessageFeedback:C}=f??{};return S.jsx(Ap,{configuration:n??{},user:h!=null&&h.userId?{id:h==null?void 0:h.userId}:void 0,isLoading:u==="connecting",isTyping:c,connected:u==="connected"?!0:u==="disconnected"?!1:void 0,messages:d,sendMessage:A,uploadFile:k,addMessageFeedback:C,allowFileUpload:r,restartConversation:p,...s,participants:m,error:g,clientId:e,soundOn:y,toggleSound:v,disableSendButton:w})};function fI(e,t=globalThis==null?void 0:globalThis.document){const n=Zt(e);E.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 dI="DismissableLayer",vs="dismissableLayer.update",pI="dismissableLayer.pointerDownOutside",hI="dismissableLayer.focusOutside",Kp,Yp=E.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Gp=E.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:a,onDismiss:s,...l}=e,u=E.useContext(Yp),[f,c]=E.useState(null),p=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,d]=E.useState({}),m=Ot(t,T=>c(T)),h=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=h.indexOf(g),v=f?h.indexOf(f):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,A=v>=y,k=yI(T=>{const _=T.target,F=[...u.branches].some(I=>I.contains(_));!A||F||(i==null||i(T),a==null||a(T),T.defaultPrevented||s==null||s())},p),C=vI(T=>{const _=T.target;[...u.branches].some(I=>I.contains(_))||(o==null||o(T),a==null||a(T),T.defaultPrevented||s==null||s())},p);return fI(T=>{v===u.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&s&&(T.preventDefault(),s()))},p),E.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Kp=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),Qp(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Kp)}},[f,p,n,u]),E.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),Qp())},[f,u]),E.useEffect(()=>{const T=()=>d({});return document.addEventListener(vs,T),()=>document.removeEventListener(vs,T)},[]),S.jsx(ht.div,{...l,ref:m,style:{pointerEvents:w?A?"auto":"none":void 0,...e.style},onFocusCapture:At(e.onFocusCapture,C.onFocusCapture),onBlurCapture:At(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:At(e.onPointerDownCapture,k.onPointerDownCapture)})});Gp.displayName=dI;var mI="DismissableLayerBranch",gI=E.forwardRef((e,t)=>{const n=E.useContext(Yp),r=E.useRef(null),i=Ot(t,r);return E.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),S.jsx(ht.div,{...e,ref:i})});gI.displayName=mI;function yI(e,t=globalThis==null?void 0:globalThis.document){const n=Zt(e),r=E.useRef(!1),i=E.useRef(()=>{});return E.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let l=function(){Jp(pI,n,u,{discrete:!0})};const u={originalEvent:s};s.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},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function vI(e,t=globalThis==null?void 0:globalThis.document){const n=Zt(e),r=E.useRef(!1);return E.useEffect(()=>{const i=o=>{o.target&&!r.current&&Jp(hI,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 Qp(){const e=new CustomEvent(vs);document.dispatchEvent(e)}function Jp(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?VC(i,o):i.dispatchEvent(o)}var bs="focusScope.autoFocusOnMount",ws="focusScope.autoFocusOnUnmount",Zp={bubbles:!1,cancelable:!0},bI="FocusScope",Xp=E.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[s,l]=E.useState(null),u=Zt(i),f=Zt(o),c=E.useRef(null),p=Ot(t,h=>l(h)),d=E.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;E.useEffect(()=>{if(r){let h=function(w){if(d.paused||!s)return;const A=w.target;s.contains(A)?c.current=A:zt(c.current,{select:!0})},g=function(w){if(d.paused||!s)return;const A=w.relatedTarget;A!==null&&(s.contains(A)||zt(c.current,{select:!0}))},y=function(w){if(document.activeElement===document.body)for(const k of w)k.removedNodes.length>0&&zt(s)};document.addEventListener("focusin",h),document.addEventListener("focusout",g);const v=new MutationObserver(y);return s&&v.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",g),v.disconnect()}}},[r,s,d.paused]),E.useEffect(()=>{if(s){nh.add(d);const h=document.activeElement;if(!s.contains(h)){const y=new CustomEvent(bs,Zp);s.addEventListener(bs,u),s.dispatchEvent(y),y.defaultPrevented||(wI(CI(eh(s)),{select:!0}),document.activeElement===h&&zt(s))}return()=>{s.removeEventListener(bs,u),setTimeout(()=>{const y=new CustomEvent(ws,Zp);s.addEventListener(ws,f),s.dispatchEvent(y),y.defaultPrevented||zt(h??document.body,{select:!0}),s.removeEventListener(ws,f),nh.remove(d)},0)}}},[s,u,f,d]);const m=E.useCallback(h=>{if(!n&&!r||d.paused)return;const g=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,y=document.activeElement;if(g&&y){const v=h.currentTarget,[w,A]=xI(v);w&&A?!h.shiftKey&&y===A?(h.preventDefault(),n&&zt(w,{select:!0})):h.shiftKey&&y===w&&(h.preventDefault(),n&&zt(A,{select:!0})):y===v&&h.preventDefault()}},[n,r,d.paused]);return S.jsx(ht.div,{tabIndex:-1,...a,ref:p,onKeyDown:m})});Xp.displayName=bI;function wI(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(zt(r,{select:t}),document.activeElement!==n)return}function xI(e){const t=eh(e),n=th(t,e),r=th(t.reverse(),e);return[n,r]}function eh(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 th(e,t){for(const n of e)if(!kI(n,{upTo:t}))return n}function kI(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 SI(e){return e instanceof HTMLInputElement&&"select"in e}function zt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&SI(e)&&t&&e.select()}}var nh=EI();function EI(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=rh(e,t),e.unshift(t)},remove(t){var n;e=rh(e,t),(n=e[0])==null||n.resume()}}}function rh(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function CI(e){return e.filter(t=>t.tagName!=="A")}var xs=0;function AI(){E.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ih()),document.body.insertAdjacentElement("beforeend",e[1]??ih()),xs++,()=>{xs===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),xs--}},[])}function ih(){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 Ai="right-scroll-bar-position",Ii="width-before-scroll-bar",II="with-scroll-bars-hidden",TI="--removed-body-scroll-bar-size";function ks(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function OI(e,t){var n=N.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var DI=typeof window<"u"?E.useLayoutEffect:E.useEffect,oh=new WeakMap;function MI(e,t){var n=OI(null,function(r){return e.forEach(function(i){return ks(i,r)})});return DI(function(){var r=oh.get(n);if(r){var i=new Set(r),o=new Set(e),a=n.current;i.forEach(function(s){o.has(s)||ks(s,null)}),o.forEach(function(s){i.has(s)||ks(s,a)})}oh.set(n,e)},[e]),n}function _I(e){return e}function PI(e,t){t===void 0&&(t=_I);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 a=t(o,r);return n.push(a),function(){n=n.filter(function(s){return s!==a})}},assignSyncMedium:function(o){for(r=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(s){return o(s)},filter:function(){return n}}},assignMedium:function(o){r=!0;var a=[];if(n.length){var s=n;n=[],s.forEach(o),a=n}var l=function(){var f=a;a=[],f.forEach(o)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(f){a.push(f),u()},filter:function(f){return a=a.filter(f),n}}}};return i}function NI(e){e===void 0&&(e={});var t=PI(null);return t.options=at({async:!0,ssr:!1},e),t}var ah=function(e){var t=e.sideCar,n=af(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 E.createElement(r,at({},n))};ah.isSideCarExport=!0;function LI(e,t){return e.useMedium(t),ah}var sh=NI(),Ss=function(){},Ti=E.forwardRef(function(e,t){var n=E.useRef(null),r=E.useState({onScrollCapture:Ss,onWheelCapture:Ss,onTouchMoveCapture:Ss}),i=r[0],o=r[1],a=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,f=e.enabled,c=e.shards,p=e.sideCar,d=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,y=e.as,v=y===void 0?"div":y,w=e.gapMode,A=af(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=p,C=MI([n,t]),T=at(at({},A),i);return E.createElement(E.Fragment,null,f&&E.createElement(k,{sideCar:sh,removeScrollBar:u,shards:c,noRelative:d,noIsolation:m,inert:h,setCallbacks:o,allowPinchZoom:!!g,lockRef:n,gapMode:w}),a?E.cloneElement(E.Children.only(s),at(at({},T),{ref:C})):E.createElement(v,at({},T,{className:l,ref:C}),s))});Ti.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Ti.classNames={fullWidth:Ii,zeroRight:Ai};var FI=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function RI(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=FI();return t&&e.setAttribute("nonce",t),e}function BI(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function zI(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var $I=function(){var e=0,t=null;return{add:function(n){e==0&&(t=RI())&&(BI(t,n),zI(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},jI=function(){var e=$I();return function(t,n){E.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},lh=function(){var e=jI(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},UI={left:0,top:0,right:0,gap:0},Es=function(e){return parseInt(e||"",10)||0},HI=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[Es(n),Es(r),Es(i)]},WI=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return UI;var t=HI(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])}},VI=lh(),Sn="data-scroll-locked",qI=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),`
318
+ .`.concat(II,` {
319
319
  overflow: hidden `).concat(r,`;
320
320
  padding-right: `).concat(s,"px ").concat(r,`;
321
321
  }
@@ -332,30 +332,30 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
332
332
  `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),`
333
333
  }
334
334
 
335
- .`).concat(Oi,` {
335
+ .`).concat(Ai,` {
336
336
  right: `).concat(s,"px ").concat(r,`;
337
337
  }
338
338
 
339
- .`).concat(Di,` {
339
+ .`).concat(Ii,` {
340
340
  margin-right: `).concat(s,"px ").concat(r,`;
341
341
  }
342
342
 
343
- .`).concat(Oi," .").concat(Oi,` {
343
+ .`).concat(Ai," .").concat(Ai,` {
344
344
  right: 0 `).concat(r,`;
345
345
  }
346
346
 
347
- .`).concat(Di," .").concat(Di,` {
347
+ .`).concat(Ii," .").concat(Ii,` {
348
348
  margin-right: 0 `).concat(r,`;
349
349
  }
350
350
 
351
351
  body[`).concat(Sn,`] {
352
- `).concat(_I,": ").concat(s,`px;
352
+ `).concat(TI,": ").concat(s,`px;
353
353
  }
354
- `)},ph=function(){var e=parseInt(document.body.getAttribute(Sn)||"0",10);return isFinite(e)?e:0},JI=function(){E.useEffect(function(){return document.body.setAttribute(Sn,(ph()+1).toString()),function(){var e=ph()-1;e<=0?document.body.removeAttribute(Sn):document.body.setAttribute(Sn,e.toString())}},[])},ZI=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;JI();var o=E.useMemo(function(){return YI(i)},[i]);return E.createElement(GI,{styles:QI(o,!t,i,n?"":"!important")})},Os=!1;if(typeof window<"u")try{var _i=Object.defineProperty({},"passive",{get:function(){return Os=!0,!0}});window.addEventListener("test",_i,_i),window.removeEventListener("test",_i,_i)}catch{Os=!1}var En=Os?{passive:!1}:!1,XI=function(e){return e.tagName==="TEXTAREA"},hh=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!XI(e)&&n[t]==="visible")},eT=function(e){return hh(e,"overflowY")},tT=function(e){return hh(e,"overflowX")},mh=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=gh(e,r);if(i){var o=yh(e,r),a=o[1],s=o[2];if(a>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},nT=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},rT=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},gh=function(e,t){return e==="v"?eT(t):tT(t)},yh=function(e,t){return e==="v"?nT(t):rT(t)},iT=function(e,t){return e==="h"&&t==="rtl"?-1:1},oT=function(e,t,n,r,i){var o=iT(e,window.getComputedStyle(t).direction),a=o*r,s=n.target,l=t.contains(s),u=!1,f=a>0,c=0,p=0;do{if(!s)break;var d=yh(e,s),m=d[0],h=d[1],g=d[2],y=h-g-o*m;(m||y)&&gh(e,s)&&(c+=y,p+=m);var v=s.parentNode;s=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(f&&Math.abs(c)<1||!f&&Math.abs(p)<1)&&(u=!0),u},Pi=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},vh=function(e){return[e.deltaX,e.deltaY]},bh=function(e){return e&&"current"in e?e.current:e},aT=function(e,t){return e[0]===t[0]&&e[1]===t[1]},sT=function(e){return`
354
+ `)},uh=function(){var e=parseInt(document.body.getAttribute(Sn)||"0",10);return isFinite(e)?e:0},KI=function(){E.useEffect(function(){return document.body.setAttribute(Sn,(uh()+1).toString()),function(){var e=uh()-1;e<=0?document.body.removeAttribute(Sn):document.body.setAttribute(Sn,e.toString())}},[])},YI=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;KI();var o=E.useMemo(function(){return WI(i)},[i]);return E.createElement(VI,{styles:qI(o,!t,i,n?"":"!important")})},Cs=!1;if(typeof window<"u")try{var Oi=Object.defineProperty({},"passive",{get:function(){return Cs=!0,!0}});window.addEventListener("test",Oi,Oi),window.removeEventListener("test",Oi,Oi)}catch{Cs=!1}var En=Cs?{passive:!1}:!1,GI=function(e){return e.tagName==="TEXTAREA"},ch=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!GI(e)&&n[t]==="visible")},QI=function(e){return ch(e,"overflowY")},JI=function(e){return ch(e,"overflowX")},fh=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=dh(e,r);if(i){var o=ph(e,r),a=o[1],s=o[2];if(a>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},ZI=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},XI=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},dh=function(e,t){return e==="v"?QI(t):JI(t)},ph=function(e,t){return e==="v"?ZI(t):XI(t)},eT=function(e,t){return e==="h"&&t==="rtl"?-1:1},tT=function(e,t,n,r,i){var o=eT(e,window.getComputedStyle(t).direction),a=o*r,s=n.target,l=t.contains(s),u=!1,f=a>0,c=0,p=0;do{if(!s)break;var d=ph(e,s),m=d[0],h=d[1],g=d[2],y=h-g-o*m;(m||y)&&dh(e,s)&&(c+=y,p+=m);var v=s.parentNode;s=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(f&&Math.abs(c)<1||!f&&Math.abs(p)<1)&&(u=!0),u},Di=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},hh=function(e){return[e.deltaX,e.deltaY]},mh=function(e){return e&&"current"in e?e.current:e},nT=function(e,t){return e[0]===t[0]&&e[1]===t[1]},rT=function(e){return`
355
355
  .block-interactivity-`.concat(e,` {pointer-events: none;}
356
356
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
357
- `)},lT=0,Cn=[];function uT(e){var t=E.useRef([]),n=E.useRef([0,0]),r=E.useRef(),i=E.useState(lT++)[0],o=E.useState(dh)[0],a=E.useRef(e);E.useEffect(function(){a.current=e},[e]),E.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var h=sa([e.lockRef.current],(e.shards||[]).map(bh),!0).filter(Boolean);return h.forEach(function(g){return g.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),h.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=E.useCallback(function(h,g){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!a.current.allowPinchZoom;var y=Pi(h),v=n.current,w="deltaX"in h?h.deltaX:v[0]-y[0],A="deltaY"in h?h.deltaY:v[1]-y[1],k,C=h.target,T=Math.abs(w)>Math.abs(A)?"h":"v";if("touches"in h&&T==="h"&&C.type==="range")return!1;var P=mh(T,C);if(!P)return!0;if(P?k=T:(k=T==="v"?"h":"v",P=mh(T,C)),!P)return!1;if(!r.current&&"changedTouches"in h&&(w||A)&&(r.current=k),!k)return!0;var F=r.current||k;return oT(F,g,h,F==="h"?w:A)},[]),l=E.useCallback(function(h){var g=h;if(!(!Cn.length||Cn[Cn.length-1]!==o)){var y="deltaY"in g?vh(g):Pi(g),v=t.current.filter(function(k){return k.name===g.type&&(k.target===g.target||g.target===k.shadowParent)&&aT(k.delta,y)})[0];if(v&&v.should){g.cancelable&&g.preventDefault();return}if(!v){var w=(a.current.shards||[]).map(bh).filter(Boolean).filter(function(k){return k.contains(g.target)}),A=w.length>0?s(g,w[0]):!a.current.noIsolation;A&&g.cancelable&&g.preventDefault()}}},[]),u=E.useCallback(function(h,g,y,v){var w={name:h,delta:g,target:y,should:v,shadowParent:cT(y)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(A){return A!==w})},1)},[]),f=E.useCallback(function(h){n.current=Pi(h),r.current=void 0},[]),c=E.useCallback(function(h){u(h.type,vh(h),h.target,s(h,e.lockRef.current))},[]),p=E.useCallback(function(h){u(h.type,Pi(h),h.target,s(h,e.lockRef.current))},[]);E.useEffect(function(){return Cn.push(o),e.setCallbacks({onScrollCapture:c,onWheelCapture:c,onTouchMoveCapture:p}),document.addEventListener("wheel",l,En),document.addEventListener("touchmove",l,En),document.addEventListener("touchstart",f,En),function(){Cn=Cn.filter(function(h){return h!==o}),document.removeEventListener("wheel",l,En),document.removeEventListener("touchmove",l,En),document.removeEventListener("touchstart",f,En)}},[]);var d=e.removeScrollBar,m=e.inert;return E.createElement(E.Fragment,null,m?E.createElement(o,{styles:sT(i)}):null,d?E.createElement(ZI,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function cT(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const fT=zI(fh,uT);var wh=E.forwardRef(function(e,t){return E.createElement(Mi,ot({},e,{ref:t,sideCar:fT}))});wh.classNames=Mi.classNames;var dT=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},An=new WeakMap,Ni=new WeakMap,Li={},Ds=0,xh=function(e){return e&&(e.host||xh(e.parentNode))},pT=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=xh(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})},hT=function(e,t,n,r){var i=pT(t,Array.isArray(e)?e:[e]);Li[n]||(Li[n]=new WeakMap);var o=Li[n],a=[],s=new Set,l=new Set(i),u=function(c){!c||s.has(c)||(s.add(c),u(c.parentNode))};i.forEach(u);var f=function(c){!c||l.has(c)||Array.prototype.forEach.call(c.children,function(p){if(s.has(p))f(p);else try{var d=p.getAttribute(r),m=d!==null&&d!=="false",h=(An.get(p)||0)+1,g=(o.get(p)||0)+1;An.set(p,h),o.set(p,g),a.push(p),h===1&&m&&Ni.set(p,!0),g===1&&p.setAttribute(n,"true"),m||p.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",p,y)}})};return f(t),s.clear(),Ds++,function(){a.forEach(function(c){var p=An.get(c)-1,d=o.get(c)-1;An.set(c,p),o.set(c,d),p||(Ni.has(c)||c.removeAttribute(r),Ni.delete(c)),d||c.removeAttribute(n)}),Ds--,Ds||(An=new WeakMap,An=new WeakMap,Ni=new WeakMap,Li={})}},mT=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=dT(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),hT(r,i,n,"aria-hidden")):function(){return null}},Fi="Dialog",[kh]=gp(Fi),[gT,St]=kh(Fi),Sh=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:a=!0}=e,s=E.useRef(null),l=E.useRef(null),[u,f]=yp({prop:r,defaultProp:i??!1,onChange:o,caller:Fi});return S.jsx(gT,{scope:t,triggerRef:s,contentRef:l,contentId:xi(),titleId:xi(),descriptionId:xi(),open:u,onOpenChange:f,onOpenToggle:E.useCallback(()=>f(c=>!c),[f]),modal:a,children:n})};Sh.displayName=Fi;var Eh="DialogTrigger",Ch=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=St(Eh,n),o=Ot(t,i.triggerRef);return S.jsx(ht.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":_s(i.open),...r,ref:o,onClick:At(e.onClick,i.onOpenToggle)})});Ch.displayName=Eh;var yT="DialogPortal",[FO,Ah]=kh(yT,{forceMount:void 0}),Ri="DialogOverlay",vT=E.forwardRef((e,t)=>{const n=Ah(Ri,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=St(Ri,e.__scopeDialog);return o.modal?S.jsx(bi,{present:r||o.open,children:S.jsx(wT,{...i,ref:t})}):null});vT.displayName=Ri;var bT=vp("DialogOverlay.RemoveScroll"),wT=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=St(Ri,n);return S.jsx(wh,{as:bT,allowPinchZoom:!0,shards:[i.contentRef],children:S.jsx(ht.div,{"data-state":_s(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Jt="DialogContent",Ih=E.forwardRef((e,t)=>{const n=Ah(Jt,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=St(Jt,e.__scopeDialog);return S.jsx(bi,{present:r||o.open,children:o.modal?S.jsx(xT,{...i,ref:t}):S.jsx(kT,{...i,ref:t})})});Ih.displayName=Jt;var xT=E.forwardRef((e,t)=>{const n=St(Jt,e.__scopeDialog),r=E.useRef(null),i=Ot(t,n.contentRef,r);return E.useEffect(()=>{const o=r.current;if(o)return mT(o)},[]),S.jsx(Th,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:At(e.onCloseAutoFocus,o=>{var a;o.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:At(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&o.preventDefault()}),onFocusOutside:At(e.onFocusOutside,o=>o.preventDefault())})}),kT=E.forwardRef((e,t)=>{const n=St(Jt,e.__scopeDialog),r=E.useRef(!1),i=E.useRef(!1);return S.jsx(Th,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a,s;(a=e.onCloseAutoFocus)==null||a.call(e,o),o.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.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 a=o.target;((u=n.triggerRef.current)==null?void 0:u.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),Th=E.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...a}=e,s=St(Jt,n),l=E.useRef(null),u=Ot(t,l);return DI(),S.jsxs(S.Fragment,{children:[S.jsx(rh,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:S.jsx(Xp,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":_s(s.open),...a,ref:u,onDismiss:()=>s.onOpenChange(!1)})}),S.jsxs(S.Fragment,{children:[S.jsx(ST,{titleId:s.titleId}),S.jsx(CT,{contentRef:l,descriptionId:s.descriptionId})]})]})}),Ms="DialogTitle",Oh=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=St(Ms,n);return S.jsx(ht.h2,{id:i.titleId,...r,ref:t})});Oh.displayName=Ms;var Dh="DialogDescription",Mh=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=St(Dh,n);return S.jsx(ht.p,{id:i.descriptionId,...r,ref:t})});Mh.displayName=Dh;var _h="DialogClose",Ph=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=St(_h,n);return S.jsx(ht.button,{type:"button",...r,ref:t,onClick:At(e.onClick,()=>i.onOpenChange(!1))})});Ph.displayName=_h;function _s(e){return e?"open":"closed"}var Nh="DialogTitleWarning",[RO,Lh]=BC(Nh,{contentName:Jt,titleName:Ms,docsSlug:"dialog"}),ST=({titleId:e})=>{const t=Lh(Nh),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
357
+ `)},iT=0,Cn=[];function oT(e){var t=E.useRef([]),n=E.useRef([0,0]),r=E.useRef(),i=E.useState(iT++)[0],o=E.useState(lh)[0],a=E.useRef(e);E.useEffect(function(){a.current=e},[e]),E.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var h=ra([e.lockRef.current],(e.shards||[]).map(mh),!0).filter(Boolean);return h.forEach(function(g){return g.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),h.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=E.useCallback(function(h,g){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!a.current.allowPinchZoom;var y=Di(h),v=n.current,w="deltaX"in h?h.deltaX:v[0]-y[0],A="deltaY"in h?h.deltaY:v[1]-y[1],k,C=h.target,T=Math.abs(w)>Math.abs(A)?"h":"v";if("touches"in h&&T==="h"&&C.type==="range")return!1;var _=fh(T,C);if(!_)return!0;if(_?k=T:(k=T==="v"?"h":"v",_=fh(T,C)),!_)return!1;if(!r.current&&"changedTouches"in h&&(w||A)&&(r.current=k),!k)return!0;var F=r.current||k;return tT(F,g,h,F==="h"?w:A)},[]),l=E.useCallback(function(h){var g=h;if(!(!Cn.length||Cn[Cn.length-1]!==o)){var y="deltaY"in g?hh(g):Di(g),v=t.current.filter(function(k){return k.name===g.type&&(k.target===g.target||g.target===k.shadowParent)&&nT(k.delta,y)})[0];if(v&&v.should){g.cancelable&&g.preventDefault();return}if(!v){var w=(a.current.shards||[]).map(mh).filter(Boolean).filter(function(k){return k.contains(g.target)}),A=w.length>0?s(g,w[0]):!a.current.noIsolation;A&&g.cancelable&&g.preventDefault()}}},[]),u=E.useCallback(function(h,g,y,v){var w={name:h,delta:g,target:y,should:v,shadowParent:aT(y)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(A){return A!==w})},1)},[]),f=E.useCallback(function(h){n.current=Di(h),r.current=void 0},[]),c=E.useCallback(function(h){u(h.type,hh(h),h.target,s(h,e.lockRef.current))},[]),p=E.useCallback(function(h){u(h.type,Di(h),h.target,s(h,e.lockRef.current))},[]);E.useEffect(function(){return Cn.push(o),e.setCallbacks({onScrollCapture:c,onWheelCapture:c,onTouchMoveCapture:p}),document.addEventListener("wheel",l,En),document.addEventListener("touchmove",l,En),document.addEventListener("touchstart",f,En),function(){Cn=Cn.filter(function(h){return h!==o}),document.removeEventListener("wheel",l,En),document.removeEventListener("touchmove",l,En),document.removeEventListener("touchstart",f,En)}},[]);var d=e.removeScrollBar,m=e.inert;return E.createElement(E.Fragment,null,m?E.createElement(o,{styles:rT(i)}):null,d?E.createElement(YI,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function aT(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const sT=LI(sh,oT);var gh=E.forwardRef(function(e,t){return E.createElement(Ti,at({},e,{ref:t,sideCar:sT}))});gh.classNames=Ti.classNames;var lT=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},An=new WeakMap,Mi=new WeakMap,_i={},As=0,yh=function(e){return e&&(e.host||yh(e.parentNode))},uT=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=yh(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})},cT=function(e,t,n,r){var i=uT(t,Array.isArray(e)?e:[e]);_i[n]||(_i[n]=new WeakMap);var o=_i[n],a=[],s=new Set,l=new Set(i),u=function(c){!c||s.has(c)||(s.add(c),u(c.parentNode))};i.forEach(u);var f=function(c){!c||l.has(c)||Array.prototype.forEach.call(c.children,function(p){if(s.has(p))f(p);else try{var d=p.getAttribute(r),m=d!==null&&d!=="false",h=(An.get(p)||0)+1,g=(o.get(p)||0)+1;An.set(p,h),o.set(p,g),a.push(p),h===1&&m&&Mi.set(p,!0),g===1&&p.setAttribute(n,"true"),m||p.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",p,y)}})};return f(t),s.clear(),As++,function(){a.forEach(function(c){var p=An.get(c)-1,d=o.get(c)-1;An.set(c,p),o.set(c,d),p||(Mi.has(c)||c.removeAttribute(r),Mi.delete(c)),d||c.removeAttribute(n)}),As--,As||(An=new WeakMap,An=new WeakMap,Mi=new WeakMap,_i={})}},fT=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=lT(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),cT(r,i,n,"aria-hidden")):function(){return null}},Pi="Dialog",[vh]=dp(Pi),[dT,St]=vh(Pi),bh=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:a=!0}=e,s=E.useRef(null),l=E.useRef(null),[u,f]=pp({prop:r,defaultProp:i??!1,onChange:o,caller:Pi});return S.jsx(dT,{scope:t,triggerRef:s,contentRef:l,contentId:vi(),titleId:vi(),descriptionId:vi(),open:u,onOpenChange:f,onOpenToggle:E.useCallback(()=>f(c=>!c),[f]),modal:a,children:n})};bh.displayName=Pi;var wh="DialogTrigger",xh=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=St(wh,n),o=Ot(t,i.triggerRef);return S.jsx(ht.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Ts(i.open),...r,ref:o,onClick:At(e.onClick,i.onOpenToggle)})});xh.displayName=wh;var pT="DialogPortal",[DO,kh]=vh(pT,{forceMount:void 0}),Ni="DialogOverlay",hT=E.forwardRef((e,t)=>{const n=kh(Ni,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=St(Ni,e.__scopeDialog);return o.modal?S.jsx(gi,{present:r||o.open,children:S.jsx(gT,{...i,ref:t})}):null});hT.displayName=Ni;var mT=hp("DialogOverlay.RemoveScroll"),gT=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=St(Ni,n);return S.jsx(gh,{as:mT,allowPinchZoom:!0,shards:[i.contentRef],children:S.jsx(ht.div,{"data-state":Ts(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Jt="DialogContent",Sh=E.forwardRef((e,t)=>{const n=kh(Jt,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=St(Jt,e.__scopeDialog);return S.jsx(gi,{present:r||o.open,children:o.modal?S.jsx(yT,{...i,ref:t}):S.jsx(vT,{...i,ref:t})})});Sh.displayName=Jt;var yT=E.forwardRef((e,t)=>{const n=St(Jt,e.__scopeDialog),r=E.useRef(null),i=Ot(t,n.contentRef,r);return E.useEffect(()=>{const o=r.current;if(o)return fT(o)},[]),S.jsx(Eh,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:At(e.onCloseAutoFocus,o=>{var a;o.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:At(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&o.preventDefault()}),onFocusOutside:At(e.onFocusOutside,o=>o.preventDefault())})}),vT=E.forwardRef((e,t)=>{const n=St(Jt,e.__scopeDialog),r=E.useRef(!1),i=E.useRef(!1);return S.jsx(Eh,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a,s;(a=e.onCloseAutoFocus)==null||a.call(e,o),o.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.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 a=o.target;((u=n.triggerRef.current)==null?void 0:u.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),Eh=E.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...a}=e,s=St(Jt,n),l=E.useRef(null),u=Ot(t,l);return AI(),S.jsxs(S.Fragment,{children:[S.jsx(Xp,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:S.jsx(Gp,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Ts(s.open),...a,ref:u,onDismiss:()=>s.onOpenChange(!1)})}),S.jsxs(S.Fragment,{children:[S.jsx(bT,{titleId:s.titleId}),S.jsx(xT,{contentRef:l,descriptionId:s.descriptionId})]})]})}),Is="DialogTitle",Ch=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=St(Is,n);return S.jsx(ht.h2,{id:i.titleId,...r,ref:t})});Ch.displayName=Is;var Ah="DialogDescription",Ih=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=St(Ah,n);return S.jsx(ht.p,{id:i.descriptionId,...r,ref:t})});Ih.displayName=Ah;var Th="DialogClose",Oh=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=St(Th,n);return S.jsx(ht.button,{type:"button",...r,ref:t,onClick:At(e.onClick,()=>i.onOpenChange(!1))})});Oh.displayName=Th;function Ts(e){return e?"open":"closed"}var Dh="DialogTitleWarning",[MO,Mh]=NC(Dh,{contentName:Jt,titleName:Is,docsSlug:"dialog"}),bT=({titleId:e})=>{const t=Mh(Dh),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
358
358
 
359
359
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
360
360
 
361
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return E.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},ET="DialogDescriptionWarning",CT=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Lh(ET).contentName}}.`;return E.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},AT=Sh,IT=Ch,TT=Ih,OT=Oh,DT=Mh,MT=Ph;function In({open:e,onOpenChange:t,children:n}){const{modal:r}=ge;return S.jsxs(AT,{open:e,modal:!1,onOpenChange:t,children:[e&&S.jsx("div",{...r==null?void 0:r.overlay}),n]})}function _T({title:e,description:t,onConfirm:n,onCancel:r,confirmButtonText:i,cancelButtonText:o,children:a}){const{modal:s}=ge;return S.jsx(S.Fragment,{children:S.jsxs(TT,{...s.dialog.container,children:[S.jsx(OT,{...s.dialog.title,children:e}),S.jsx(DT,{...s.dialog.description,children:t}),S.jsx("div",{...s.dialog.content.container,children:a}),S.jsxs("div",{...s.dialog.button.container,children:[i&&S.jsx("button",{...s.dialog.button.confirm,type:"button",onClick:n,children:i}),o&&S.jsx("button",{...s.dialog.button.cancel,type:"button",onClick:r,children:o})]})]})})}In.Button=IT,In.Close=MT,In.Content=_T;const Fh=_.forwardRef(({children:e,onClick:t,avatarUrl:n,botName:r,description:i,onClose:o,...a},s)=>{const{messagePreview:l}=ge,{container:u,closeButton:f,message:c,avatar:p,description:d}=l??{};return S.jsxs("div",{...a,...u,ref:s,onClick:t,children:[S.jsx(Nn,{src:n,...p,children:r||"Bot"}),S.jsx("p",{...c,children:e}),S.jsx("p",{...d,children:i}),S.jsx(Fc,{...f,onClick:m=>{m.stopPropagation(),o==null||o()}})]})});Fh.displayName="MessagePreview",re.Avatar=Nn,re.BOT_IS_BLOCKED=ml,re.Block=Yt,re.CONFIG_ACCESS_DENIED=Vm,re.Chat=Dp,re.Composer=Nd,re.Container=es,re.ErrorState=Op,re.Fab=mp,re.Header=Ep,re.INVALID_API_URL=dl,re.INVALID_BOTPRESS_URL=hl,re.INVALID_CLIENT_ID=pl,re.INVALID_CONFIGURATION=Wm,re.INVALID_CONFIG_URL=Hm,re.INVALID_MESSAGE_CONTENT_TYPE=vl,re.MISSING_API_URL=$m,re.MISSING_BOT_ID=jm,re.MISSING_CLIENT_ID=fl,re.MISSING_CONFIG_URL=Um,re.Message=as,re.MessageContext=ia,re.MessageList=cs,re.MessagePreview=Fh,re.Modal=In,re.ModalContext=oa,re.ModalProvider=pp,re.NETWORK_ERROR=Pn,re.NOT_A_PARTICIPANT=Ji,re.QUOTA_EXCEEDED=gl,re.RestartConversationButton=is,re.SOUND_EFFECTS=Gp,re.SSE_DISCONNECTED_ERROR=yl,re.StylesheetProvider=hp,re.TypingIndicator=os,re.Webchat=hI,re.commonApiErrorMap=Xi,re.enrichMessage=Gs,re.fileTypes=ul,re.generateThemeOverride=ll,re.generateThemeStylesheet=sl,re.getUseChatSoundStore=af,re.getUseWebchatClientStore=rf,re.integrationMessagePayloadToBlockPayload=Yc,re.integrationMessageToBlockMessage=Kn,re.isCommonApiErrorType=wl,re.isEventError=kl,re.isFileType=cl,re.isIntegrationError=xl,re.isWebhookHandlerErrorType=bl,re.mapToWebchatError=Sr,re.renderers=Cd,re.retryWithBackoff=Sl,re.useMessageContext=sf,re.useModalContext=aa,re.useWebchat=Qp,re.useWebchatStore=sn,re.webchatClasses=ge,re.webhookHandlerErrorMap=Zi,Object.defineProperty(re,Symbol.toStringTag,{value:"Module"})});
361
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return E.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},wT="DialogDescriptionWarning",xT=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Mh(wT).contentName}}.`;return E.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},kT=bh,ST=xh,ET=Sh,CT=Ch,AT=Ih,IT=Oh;function In({open:e,onOpenChange:t,children:n}){const{modal:r}=ge;return S.jsxs(kT,{open:e,modal:!1,onOpenChange:t,children:[e&&S.jsx("div",{...r==null?void 0:r.overlay}),n]})}function TT({title:e,description:t,onConfirm:n,onCancel:r,confirmButtonText:i,cancelButtonText:o,children:a}){const{modal:s}=ge;return S.jsx(S.Fragment,{children:S.jsxs(ET,{...s.dialog.container,children:[S.jsx(CT,{...s.dialog.title,children:e}),S.jsx(AT,{...s.dialog.description,children:t}),S.jsx("div",{...s.dialog.content.container,children:a}),S.jsxs("div",{...s.dialog.button.container,children:[i&&S.jsx("button",{...s.dialog.button.confirm,type:"button",onClick:n,children:i}),o&&S.jsx("button",{...s.dialog.button.cancel,type:"button",onClick:r,children:o})]})]})})}In.Button=ST,In.Close=IT,In.Content=TT;const _h=N.forwardRef(({children:e,onClick:t,avatarUrl:n,botName:r,description:i,onClose:o,...a},s)=>{const{messagePreview:l}=ge,{container:u,closeButton:f,message:c,avatar:p,description:d}=l??{};return S.jsxs("div",{...a,...u,ref:s,onClick:t,children:[S.jsx(Mn,{src:n,...p,children:r||"Bot"}),S.jsx("p",{...c,children:e}),S.jsx("p",{...d,children:i}),S.jsx(_c,{...f,onClick:m=>{m.stopPropagation(),o==null||o()}})]})});_h.displayName="MessagePreview",ie.Avatar=Mn,ie.BOT_IS_BLOCKED=fl,ie.Block=Yt,ie.CONFIG_ACCESS_DENIED=jm,ie.Chat=Ap,ie.Composer=Dd,ie.Container=Qa,ie.ErrorState=Cp,ie.Fab=fp,ie.Header=wp,ie.INVALID_API_URL=ll,ie.INVALID_BOTPRESS_URL=cl,ie.INVALID_CLIENT_ID=ul,ie.INVALID_CONFIGURATION=$m,ie.INVALID_CONFIG_URL=zm,ie.INVALID_MESSAGE_CONTENT_TYPE=hl,ie.MISSING_API_URL=Fm,ie.MISSING_BOT_ID=Rm,ie.MISSING_CLIENT_ID=sl,ie.MISSING_CONFIG_URL=Bm,ie.Message=ns,ie.MessageContext=ea,ie.MessageList=as,ie.MessagePreview=_h,ie.Modal=In,ie.ModalContext=ta,ie.ModalProvider=up,ie.NETWORK_ERROR=Dn,ie.NOT_A_PARTICIPANT=Ki,ie.QUOTA_EXCEEDED=dl,ie.RestartConversationButton=es,ie.SOUND_EFFECTS=Vp,ie.SSE_DISCONNECTED_ERROR=pl,ie.StylesheetProvider=cp,ie.TypingIndicator=ts,ie.Webchat=cI,ie.commonApiErrorMap=Gi,ie.enrichMessage=Vs,ie.fileTypes=ol,ie.generateThemeOverride=il,ie.generateThemeStylesheet=rl,ie.getUseChatSoundStore=tf,ie.getUseWebchatClientStore=Xc,ie.integrationMessagePayloadToBlockPayload=Wc,ie.integrationMessageToBlockMessage=Wn,ie.isCommonApiErrorType=gl,ie.isEventError=vl,ie.isFileType=al,ie.isIntegrationError=yl,ie.isWebhookHandlerErrorType=ml,ie.mapToWebchatError=wr,ie.renderers=xd,ie.retryWithBackoff=bl,ie.useMessageContext=nf,ie.useModalContext=na,ie.useWebchat=qp,ie.useWebchatStore=sn,ie.webchatClasses=ge,ie.webhookHandlerErrorMap=Yi,Object.defineProperty(ie,Symbol.toStringTag,{value:"Module"})});