@botpress/webchat 4.5.1 → 4.5.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(X,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],x):(X=typeof globalThis<"u"?globalThis:X||self,x(X.Webchat={},X.ReactJsxRuntime,X.React,X.ReactDOM))})(this,function(X,x,D,$u){"use strict";var ns=typeof document<"u"?document.currentScript:null;function zu(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const C=zu(D),Hu=zu($u);function tb(e,t=[]){let n=[];function r(o,s){const a=C.createContext(s);a.displayName=o+"Context";const l=n.length;n=[...n,s];const u=c=>{var v;const{scope:h,children:d,...m}=c,p=((v=h==null?void 0:h[e])==null?void 0:v[l])||a,g=C.useMemo(()=>m,Object.values(m));return x.jsx(p.Provider,{value:g,children:d})};u.displayName=o+"Provider";function f(c,h){var p;const d=((p=h==null?void 0:h[e])==null?void 0:p[l])||a,m=C.useContext(d);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${c}\` must be used within \`${o}\``)}return[u,f]}const i=()=>{const o=n.map(s=>C.createContext(s));return function(a){const l=(a==null?void 0:a[e])||o;return C.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,nb(i,...t)]}function nb(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const c=l(o)[`__scope${u}`];return{...a,...c}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Fn(e){const t=C.useRef(e);return C.useEffect(()=>{t.current=e}),C.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var tn=globalThis!=null&&globalThis.document?C.useLayoutEffect:()=>{};function Uu(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function rs(...e){return t=>{let n=!1;const r=e.map(i=>{const o=Uu(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():Uu(e[i],null)}}}}function nn(...e){return C.useCallback(rs(...e),e)}var rb=Symbol.for("react.lazy"),ki=C[" use ".trim().toString()];function ib(e){return typeof e=="object"&&e!==null&&"then"in e}function ju(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===rb&&"_payload"in e&&ib(e._payload)}function ob(e){const t=sb(e),n=C.forwardRef((r,i)=>{let{children:o,...s}=r;ju(o)&&typeof ki=="function"&&(o=ki(o._payload));const a=C.Children.toArray(o),l=a.find(lb);if(l){const u=l.props.children,f=a.map(c=>c===l?C.Children.count(u)>1?C.Children.only(null):C.isValidElement(u)?u.props.children:null:c);return x.jsx(t,{...s,ref:i,children:C.isValidElement(u)?C.cloneElement(u,void 0,f):null})}return x.jsx(t,{...s,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function sb(e){const t=C.forwardRef((n,r)=>{let{children:i,...o}=n;if(ju(i)&&typeof ki=="function"&&(i=ki(i._payload)),C.isValidElement(i)){const s=cb(i),a=ub(o,i.props);return i.type!==C.Fragment&&(a.ref=r?rs(r,s):s),C.cloneElement(i,a)}return C.Children.count(i)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ab=Symbol("radix.slottable");function lb(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ab}function ub(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{const l=o(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function cb(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var fb=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],is=fb.reduce((e,t)=>{const n=ob(`Primitive.${t}`),r=C.forwardRef((i,o)=>{const{asChild:s,...a}=i,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(l,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),vn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function bn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var os={exports:{}},ss={};/**
1
+ (function(J,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],x):(J=typeof globalThis<"u"?globalThis:J||self,x(J.Webchat={},J.ReactJsxRuntime,J.React,J.ReactDOM))})(this,function(J,x,D,$u){"use strict";var ns=typeof document<"u"?document.currentScript:null;function zu(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const C=zu(D),Hu=zu($u);function tb(e,t=[]){let n=[];function r(o,s){const a=C.createContext(s);a.displayName=o+"Context";const l=n.length;n=[...n,s];const u=c=>{var y;const{scope:h,children:d,...m}=c,p=((y=h==null?void 0:h[e])==null?void 0:y[l])||a,g=C.useMemo(()=>m,Object.values(m));return x.jsx(p.Provider,{value:g,children:d})};u.displayName=o+"Provider";function f(c,h){var p;const d=((p=h==null?void 0:h[e])==null?void 0:p[l])||a,m=C.useContext(d);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${c}\` must be used within \`${o}\``)}return[u,f]}const i=()=>{const o=n.map(s=>C.createContext(s));return function(a){const l=(a==null?void 0:a[e])||o;return C.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,nb(i,...t)]}function nb(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const c=l(o)[`__scope${u}`];return{...a,...c}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Fn(e){const t=C.useRef(e);return C.useEffect(()=>{t.current=e}),C.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var tn=globalThis!=null&&globalThis.document?C.useLayoutEffect:()=>{};function Uu(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function rs(...e){return t=>{let n=!1;const r=e.map(i=>{const o=Uu(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():Uu(e[i],null)}}}}function nn(...e){return C.useCallback(rs(...e),e)}var rb=Symbol.for("react.lazy"),ki=C[" use ".trim().toString()];function ib(e){return typeof e=="object"&&e!==null&&"then"in e}function ju(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===rb&&"_payload"in e&&ib(e._payload)}function ob(e){const t=sb(e),n=C.forwardRef((r,i)=>{let{children:o,...s}=r;ju(o)&&typeof ki=="function"&&(o=ki(o._payload));const a=C.Children.toArray(o),l=a.find(lb);if(l){const u=l.props.children,f=a.map(c=>c===l?C.Children.count(u)>1?C.Children.only(null):C.isValidElement(u)?u.props.children:null:c);return x.jsx(t,{...s,ref:i,children:C.isValidElement(u)?C.cloneElement(u,void 0,f):null})}return x.jsx(t,{...s,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function sb(e){const t=C.forwardRef((n,r)=>{let{children:i,...o}=n;if(ju(i)&&typeof ki=="function"&&(i=ki(i._payload)),C.isValidElement(i)){const s=cb(i),a=ub(o,i.props);return i.type!==C.Fragment&&(a.ref=r?rs(r,s):s),C.cloneElement(i,a)}return C.Children.count(i)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ab=Symbol("radix.slottable");function lb(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ab}function ub(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{const l=o(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function cb(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var fb=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],is=fb.reduce((e,t)=>{const n=ob(`Primitive.${t}`),r=C.forwardRef((i,o)=>{const{asChild:s,...a}=i,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(l,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),vn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function bn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var os={exports:{}},ss={};/**
2
2
  * @license React
3
3
  * use-sync-external-store-shim.production.js
4
4
  *
@@ -14,7 +14,7 @@
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 Wu;function hb(){return Wu||(Wu=1,process.env.NODE_ENV!=="production"&&function(){function e(d,m){return d===m&&(d!==0||1/d===1/m)||d!==d&&m!==m}function t(d,m){f||i.startTransition===void 0||(f=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var p=m();if(!c){var g=m();o(p,g)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}g=s({inst:{value:p,getSnapshot:m}});var v=g[0].inst,y=g[1];return l(function(){v.value=p,v.getSnapshot=m,n(v)&&y({inst:v})},[d,p,m]),a(function(){return n(v)&&y({inst:v}),d(function(){n(v)&&y({inst:v})})},[d]),u(p),p}function n(d){var m=d.getSnapshot;d=d.value;try{var p=m();return!o(d,p)}catch{return!0}}function r(d,m){return m()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var i=D,o=typeof Object.is=="function"?Object.is:e,s=i.useState,a=i.useEffect,l=i.useLayoutEffect,u=i.useDebugValue,f=!1,c=!1,h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;as.useSyncExternalStore=i.useSyncExternalStore!==void 0?i.useSyncExternalStore:h,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),as}process.env.NODE_ENV==="production"?os.exports=db():os.exports=hb();var ls=os.exports;function pb(){return ls.useSyncExternalStore(mb,()=>!0,()=>!1)}function mb(){return()=>{}}var us="Avatar",[gb]=tb(us),[yb,qu]=gb(us),cs=C.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,o]=C.useState("idle");return x.jsx(yb,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:o,children:x.jsx(is.span,{...r,ref:t})})});cs.displayName=us;var Yu="AvatarImage",fs=C.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...o}=e,s=qu(Yu,n),a=vb(r,o),l=Fn(u=>{i(u),s.onImageLoadingStatusChange(u)});return tn(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?x.jsx(is.img,{...o,ref:t,src:r}):null});fs.displayName=Yu;var Ku="AvatarFallback",ds=C.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,o=qu(Ku,n),[s,a]=C.useState(r===void 0);return C.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(l)}},[r]),s&&o.imageLoadingStatus!=="loaded"?x.jsx(is.span,{...i,ref:t}):null});ds.displayName=Ku;function Gu(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function vb(e,{referrerPolicy:t,crossOrigin:n}){const r=pb(),i=C.useRef(null),o=r?(i.current||(i.current=new window.Image),i.current):null,[s,a]=C.useState(()=>Gu(o,e));return tn(()=>{a(Gu(o,e))},[o,e]),tn(()=>{const l=c=>()=>{a(c)};if(!o)return;const u=l("loaded"),f=l("error");return o.addEventListener("load",u),o.addEventListener("error",f),t&&(o.referrerPolicy=t),typeof n=="string"&&(o.crossOrigin=n),()=>{o.removeEventListener("load",u),o.removeEventListener("error",f)}},[o,n,t]),s}function Qu(e,t){let n=`${e} {`;for(const[r,i]of Object.entries(t))n+=`${r}: ${i}; `;return n+="}",n}function Zu(e,t){let n=0;if(e.length==0)return n;for(let r=0;r<e.length;r++){const i=e.charCodeAt(r);n=(n<<5)-n+i,n=n&n}return Math.abs(n)%t}const bb=(e,t={})=>new Promise((n,r)=>{if(typeof window>"u")return r("Window is not defined");if(!e)return r("Url is not defined");let i=null;const o=new Image;o.addEventListener("load",()=>{i&&clearTimeout(i),n({width:o.naturalWidth,height:o.naturalHeight})}),o.addEventListener("error",s=>{i&&clearTimeout(i),r(`${s.type}: ${s.message}`)}),o.src=e,t.timeout&&(i=setTimeout(()=>r("Timeout"),t.timeout))});var Ju={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(vn,function(){var n=1e3,r=6e4,i=36e5,o="millisecond",s="second",a="minute",l="hour",u="day",f="week",c="month",h="quarter",d="year",m="date",p="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(F){var _=["th","st","nd","rd"],z=F%100;return"["+F+(_[(z-20)%10]||_[z]||_[0])+"]"}},w=function(F,_,z){var $=String(F);return!$||$.length>=_?F:""+Array(_+1-$.length).join(z)+F},A={s:w,z:function(F){var _=-F.utcOffset(),z=Math.abs(_),$=Math.floor(z/60),U=z%60;return(_<=0?"+":"-")+w($,2,"0")+":"+w(U,2,"0")},m:function F(_,z){if(_.date()<z.date())return-F(z,_);var $=12*(z.year()-_.year())+(z.month()-_.month()),U=_.clone().add($,c),W=z-U<0,b=_.clone().add($+(W?-1:1),c);return+(-($+(z-U)/(W?U-b:b-U))||0)},a:function(F){return F<0?Math.ceil(F)||0:Math.floor(F)},p:function(F){return{M:c,y:d,w:f,d:u,D:m,h:l,m:a,s,ms:o,Q:h}[F]||String(F||"").toLowerCase().replace(/s$/,"")},u:function(F){return F===void 0}},k="en",E={};E[k]=y;var I="$isDayjsObject",M=function(F){return F instanceof H||!(!F||!F[I])},L=function F(_,z,$){var U;if(!_)return k;if(typeof _=="string"){var W=_.toLowerCase();E[W]&&(U=W),z&&(E[W]=z,U=W);var b=_.split("-");if(!U&&b.length>1)return F(b[0])}else{var N=_.name;E[N]=_,U=N}return!$&&U&&(k=U),U||!$&&k},T=function(F,_){if(M(F))return F.clone();var z=typeof _=="object"?_:{};return z.date=F,z.args=arguments,new H(z)},O=A;O.l=L,O.i=M,O.w=function(F,_){return T(F,{locale:_.$L,utc:_.$u,x:_.$x,$offset:_.$offset})};var H=function(){function F(z){this.$L=L(z.locale,null,!0),this.parse(z),this.$x=this.$x||z.x||{},this[I]=!0}var _=F.prototype;return _.parse=function(z){this.$d=function($){var U=$.date,W=$.utc;if(U===null)return new Date(NaN);if(O.u(U))return new Date;if(U instanceof Date)return new Date(U);if(typeof U=="string"&&!/Z$/i.test(U)){var b=U.match(g);if(b){var N=b[2]-1||0,R=(b[7]||"0").substring(0,3);return W?new Date(Date.UTC(b[1],N,b[3]||1,b[4]||0,b[5]||0,b[6]||0,R)):new Date(b[1],N,b[3]||1,b[4]||0,b[5]||0,b[6]||0,R)}}return new Date(U)}(z),this.init()},_.init=function(){var z=this.$d;this.$y=z.getFullYear(),this.$M=z.getMonth(),this.$D=z.getDate(),this.$W=z.getDay(),this.$H=z.getHours(),this.$m=z.getMinutes(),this.$s=z.getSeconds(),this.$ms=z.getMilliseconds()},_.$utils=function(){return O},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(z,$){var U=T(z);return this.startOf($)<=U&&U<=this.endOf($)},_.isAfter=function(z,$){return T(z)<this.startOf($)},_.isBefore=function(z,$){return this.endOf($)<T(z)},_.$g=function(z,$,U){return O.u(z)?this[$]:this.set(U,z)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(z,$){var U=this,W=!!O.u($)||$,b=O.p(z),N=function(se,K){var re=O.w(U.$u?Date.UTC(U.$y,K,se):new Date(U.$y,K,se),U);return W?re:re.endOf(u)},R=function(se,K){return O.w(U.toDate()[se].apply(U.toDate("s"),(W?[0,0,0,0]:[23,59,59,999]).slice(K)),U)},S=this.$W,V=this.$M,ee=this.$D,Y="set"+(this.$u?"UTC":"");switch(b){case d:return W?N(1,0):N(31,11);case c:return W?N(1,V):N(0,V+1);case f:var G=this.$locale().weekStart||0,J=(S<G?S+7:S)-G;return N(W?ee-J:ee+(6-J),V);case u:case m:return R(Y+"Hours",0);case l:return R(Y+"Minutes",1);case a:return R(Y+"Seconds",2);case s:return R(Y+"Milliseconds",3);default:return this.clone()}},_.endOf=function(z){return this.startOf(z,!1)},_.$set=function(z,$){var U,W=O.p(z),b="set"+(this.$u?"UTC":""),N=(U={},U[u]=b+"Date",U[m]=b+"Date",U[c]=b+"Month",U[d]=b+"FullYear",U[l]=b+"Hours",U[a]=b+"Minutes",U[s]=b+"Seconds",U[o]=b+"Milliseconds",U)[W],R=W===u?this.$D+($-this.$W):$;if(W===c||W===d){var S=this.clone().set(m,1);S.$d[N](R),S.init(),this.$d=S.set(m,Math.min(this.$D,S.daysInMonth())).$d}else N&&this.$d[N](R);return this.init(),this},_.set=function(z,$){return this.clone().$set(z,$)},_.get=function(z){return this[O.p(z)]()},_.add=function(z,$){var U,W=this;z=Number(z);var b=O.p($),N=function(V){var ee=T(W);return O.w(ee.date(ee.date()+Math.round(V*z)),W)};if(b===c)return this.set(c,this.$M+z);if(b===d)return this.set(d,this.$y+z);if(b===u)return N(1);if(b===f)return N(7);var R=(U={},U[a]=r,U[l]=i,U[s]=n,U)[b]||1,S=this.$d.getTime()+z*R;return O.w(S,this)},_.subtract=function(z,$){return this.add(-1*z,$)},_.format=function(z){var $=this,U=this.$locale();if(!this.isValid())return U.invalidDate||p;var W=z||"YYYY-MM-DDTHH:mm:ssZ",b=O.z(this),N=this.$H,R=this.$m,S=this.$M,V=U.weekdays,ee=U.months,Y=U.meridiem,G=function(K,re,B,ne){return K&&(K[re]||K($,W))||B[re].slice(0,ne)},J=function(K){return O.s(N%12||12,K,"0")},se=Y||function(K,re,B){var ne=K<12?"AM":"PM";return B?ne.toLowerCase():ne};return W.replace(v,function(K,re){return re||function(B){switch(B){case"YY":return String($.$y).slice(-2);case"YYYY":return O.s($.$y,4,"0");case"M":return S+1;case"MM":return O.s(S+1,2,"0");case"MMM":return G(U.monthsShort,S,ee,3);case"MMMM":return G(ee,S);case"D":return $.$D;case"DD":return O.s($.$D,2,"0");case"d":return String($.$W);case"dd":return G(U.weekdaysMin,$.$W,V,2);case"ddd":return G(U.weekdaysShort,$.$W,V,3);case"dddd":return V[$.$W];case"H":return String(N);case"HH":return O.s(N,2,"0");case"h":return J(1);case"hh":return J(2);case"a":return se(N,R,!0);case"A":return se(N,R,!1);case"m":return String(R);case"mm":return O.s(R,2,"0");case"s":return String($.$s);case"ss":return O.s($.$s,2,"0");case"SSS":return O.s($.$ms,3,"0");case"Z":return b}return null}(K)||b.replace(":","")})},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(z,$,U){var W,b=this,N=O.p($),R=T(z),S=(R.utcOffset()-this.utcOffset())*r,V=this-R,ee=function(){return O.m(b,R)};switch(N){case d:W=ee()/12;break;case c:W=ee();break;case h:W=ee()/3;break;case f:W=(V-S)/6048e5;break;case u:W=(V-S)/864e5;break;case l:W=V/i;break;case a:W=V/r;break;case s:W=V/n;break;default:W=V}return U?W:O.a(W)},_.daysInMonth=function(){return this.endOf(c).$D},_.$locale=function(){return E[this.$L]},_.locale=function(z,$){if(!z)return this.$L;var U=this.clone(),W=L(z,$,!0);return W&&(U.$L=W),U},_.clone=function(){return O.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},F}(),P=H.prototype;return T.prototype=P,[["$ms",o],["$s",s],["$m",a],["$H",l],["$W",u],["$M",c],["$y",d],["$D",m]].forEach(function(F){P[F[1]]=function(_){return this.$g(_,F[0],F[1])}}),T.extend=function(F,_){return F.$i||(F(_,H,T),F.$i=!0),T},T.locale=L,T.isDayjs=M,T.unix=function(F){return T(1e3*F)},T.en=E[k],T.Ls=E,T.p={},T})})(Ju);var wb=Ju.exports;const kr=bn(wb);var Xu={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(vn,function(){return function(n,r,i){r.prototype.isToday=function(){var o="YYYY-MM-DD",s=i();return this.format(o)===s.format(o)}}})})(Xu);var Sb=Xu.exports;const kb=bn(Sb);var ec={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(vn,function(){return function(n,r,i){r.prototype.isYesterday=function(){var o="YYYY-MM-DD",s=i().subtract(1,"day");return this.format(o)===s.format(o)}}})})(ec);var xb=ec.exports;const Eb=bn(xb),tc={"composer.placeholder":"Écrivez votre message...","composer.sendButton.ariaLabel":"Bouton Envoyer le message","composer.voiceButton.ariaLabel":"Bouton Saisie vocale","composer.fileButton.ariaLabel":"Bouton Téléverser un fichier","composer.messageInput.ariaLabel":"Saisie du message","fileAttachment.uploadError":"Erreur de téléversement","fileAttachment.fallbackExtension":"Fichier","fileAttachment.removeButton.ariaLabel":"Bouton Supprimer le fichier","header.defaultBotName":"Bot","header.expandButton.ariaLabel":"Bouton Développer l'en-tête","header.sound.enable":"Activer les sons du chat","header.sound.disable":"Désactiver les sons du chat","conversationHistory.title":"Conversations","conversationHistory.empty":"Aucune conversation commencée","conversationHistory.newConversation":"Nouvelle conversation","conversationHistory.sentAttachment":"A envoyé une pièce jointe","conversationHistory.showButton.ariaLabel":"Bouton Afficher les conversations récentes","restartConversation.title":"Créer une nouvelle conversation","restartConversation.description":"Cela effacera la conversation en cours et en démarrera une nouvelle.","restartConversation.confirm":"Nouvelle conversation","restartConversation.cancel":"Annuler","restartConversation.button.ariaLabel":"Bouton Redémarrer la conversation","closeButton.ariaLabel":"Bouton Fermer le chatbot","feedback.title":"Aidez-nous à nous améliorer","feedback.description":"Veuillez nous faire part de vos commentaires pour nous aider à nous améliorer.","feedback.confirm":"Envoyer le commentaire","feedback.cancel":"Annuler","feedback.placeholder":"Dites-nous ce qui n'a pas fonctionné...","error.configuration":"Erreur de configuration","error.bot":"Erreur du bot","error.network":"Erreur réseau","error.disconnected":"Déconnecté","error.unexpected":"Erreur inattendue","dropdown.placeholder":"Sélectionner...","message.status.delivered":"Distribué","date.today":"Aujourd'hui","date.yesterday":"Hier"},nc={"composer.placeholder":"Escribe tu mensaje...","composer.sendButton.ariaLabel":"Botón Enviar mensaje","composer.voiceButton.ariaLabel":"Botón Entrada de voz","composer.fileButton.ariaLabel":"Botón Subir archivo","composer.messageInput.ariaLabel":"Entrada de mensaje","fileAttachment.uploadError":"Error de carga","fileAttachment.fallbackExtension":"Archivo","fileAttachment.removeButton.ariaLabel":"Botón Eliminar archivo","header.defaultBotName":"Bot","header.expandButton.ariaLabel":"Botón Expandir encabezado","header.sound.enable":"Activar sonidos del chat","header.sound.disable":"Desactivar sonidos del chat","conversationHistory.title":"Conversaciones","conversationHistory.empty":"Aún no se ha iniciado ninguna conversación","conversationHistory.newConversation":"Nueva conversación","conversationHistory.sentAttachment":"Envió un archivo adjunto","conversationHistory.showButton.ariaLabel":"Botón Mostrar conversaciones recientes","restartConversation.title":"Crear nueva conversación","restartConversation.description":"Esto borrará la conversación actual y comenzará una nueva.","restartConversation.confirm":"Nueva conversación","restartConversation.cancel":"Cancelar","restartConversation.button.ariaLabel":"Botón Reiniciar conversación","closeButton.ariaLabel":"Botón Cerrar chatbot","feedback.title":"Ayúdanos a mejorar","feedback.description":"Por favor, envíanos tus comentarios para ayudarnos a mejorar.","feedback.confirm":"Enviar comentario","feedback.cancel":"Cancelar","feedback.placeholder":"Cuéntanos qué salió mal...","error.configuration":"Error de configuración","error.bot":"Error del bot","error.network":"Error de red","error.disconnected":"Desconectado","error.unexpected":"Error inesperado","dropdown.placeholder":"Seleccionar...","message.status.delivered":"Entregado","date.today":"Hoy","date.yesterday":"Ayer"},rc={"composer.placeholder":"Digite sua mensagem...","composer.sendButton.ariaLabel":"Botão Enviar mensagem","composer.voiceButton.ariaLabel":"Botão Entrada de voz","composer.fileButton.ariaLabel":"Botão Enviar arquivo","composer.messageInput.ariaLabel":"Entrada de mensagem","fileAttachment.uploadError":"Erro no envio","fileAttachment.fallbackExtension":"Arquivo","fileAttachment.removeButton.ariaLabel":"Botão Remover arquivo","header.defaultBotName":"Bot","header.expandButton.ariaLabel":"Botão Expandir cabeçalho","header.sound.enable":"Ativar sons do chat","header.sound.disable":"Desativar sons do chat","conversationHistory.title":"Conversas","conversationHistory.empty":"Nenhuma conversa iniciada ainda","conversationHistory.newConversation":"Nova conversa","conversationHistory.sentAttachment":"Enviou um anexo","conversationHistory.showButton.ariaLabel":"Botão Mostrar conversas recentes","restartConversation.title":"Criar nova conversa","restartConversation.description":"Isso apagará a conversa atual e iniciará uma nova.","restartConversation.confirm":"Nova conversa","restartConversation.cancel":"Cancelar","restartConversation.button.ariaLabel":"Botão Reiniciar conversa","closeButton.ariaLabel":"Botão Fechar chatbot","feedback.title":"Ajude-nos a melhorar","feedback.description":"Por favor, envie seu feedback para nos ajudar a melhorar.","feedback.confirm":"Enviar feedback","feedback.cancel":"Cancelar","feedback.placeholder":"Conte-nos o que deu errado...","error.configuration":"Erro de configuração","error.bot":"Erro do bot","error.network":"Erro de rede","error.disconnected":"Desconectado","error.unexpected":"Erro inesperado","dropdown.placeholder":"Selecionar...","message.status.delivered":"Entregue","date.today":"Hoje","date.yesterday":"Ontem"},ic={"composer.placeholder":"Nachricht eingeben...","composer.sendButton.ariaLabel":"Schaltfläche Nachricht senden","composer.voiceButton.ariaLabel":"Schaltfläche Spracheingabe","composer.fileButton.ariaLabel":"Schaltfläche Datei hochladen","composer.messageInput.ariaLabel":"Nachrichteneingabe","fileAttachment.uploadError":"Fehler beim Hochladen","fileAttachment.fallbackExtension":"Datei","fileAttachment.removeButton.ariaLabel":"Schaltfläche Datei entfernen","header.defaultBotName":"Bot","header.expandButton.ariaLabel":"Schaltfläche Kopfzeile erweitern","header.sound.enable":"Chat-Töne aktivieren","header.sound.disable":"Chat-Töne deaktivieren","conversationHistory.title":"Unterhaltungen","conversationHistory.empty":"Noch keine Unterhaltung begonnen","conversationHistory.newConversation":"Neue Unterhaltung","conversationHistory.sentAttachment":"Anhang gesendet","conversationHistory.showButton.ariaLabel":"Schaltfläche Letzte Unterhaltungen anzeigen","restartConversation.title":"Neue Unterhaltung erstellen","restartConversation.description":"Dies löscht die aktuelle Unterhaltung und startet eine neue.","restartConversation.confirm":"Neue Unterhaltung","restartConversation.cancel":"Abbrechen","restartConversation.button.ariaLabel":"Schaltfläche Unterhaltung neu starten","closeButton.ariaLabel":"Schaltfläche Chatbot schließen","feedback.title":"Helfen Sie uns, besser zu werden","feedback.description":"Bitte geben Sie uns Feedback, damit wir uns verbessern können.","feedback.confirm":"Feedback senden","feedback.cancel":"Abbrechen","feedback.placeholder":"Sagen Sie uns, was schiefgelaufen ist...","error.configuration":"Konfigurationsfehler","error.bot":"Bot-Fehler","error.network":"Netzwerkfehler","error.disconnected":"Getrennt","error.unexpected":"Unerwarteter Fehler","dropdown.placeholder":"Auswählen...","message.status.delivered":"Zugestellt","date.today":"Heute","date.yesterday":"Gestern"},oc={"composer.placeholder":"Scrivi il tuo messaggio...","composer.sendButton.ariaLabel":"Pulsante Invia messaggio","composer.voiceButton.ariaLabel":"Pulsante Inserimento vocale","composer.fileButton.ariaLabel":"Pulsante Carica file","composer.messageInput.ariaLabel":"Campo di inserimento messaggio","fileAttachment.uploadError":"Errore di caricamento","fileAttachment.fallbackExtension":"File","fileAttachment.removeButton.ariaLabel":"Pulsante Rimuovi file","header.defaultBotName":"Bot","header.expandButton.ariaLabel":"Pulsante Espandi intestazione","header.sound.enable":"Attiva suoni della chat","header.sound.disable":"Disattiva suoni della chat","conversationHistory.title":"Conversazioni","conversationHistory.empty":"Nessuna conversazione avviata","conversationHistory.newConversation":"Nuova conversazione","conversationHistory.sentAttachment":"Ha inviato un allegato","conversationHistory.showButton.ariaLabel":"Pulsante Mostra conversazioni recenti","restartConversation.title":"Crea nuova conversazione","restartConversation.description":"Questo cancellerà la conversazione corrente e ne avvierà una nuova.","restartConversation.confirm":"Nuova conversazione","restartConversation.cancel":"Annulla","restartConversation.button.ariaLabel":"Pulsante Riavvia conversazione","closeButton.ariaLabel":"Pulsante Chiudi chatbot","feedback.title":"Aiutaci a migliorare","feedback.description":"Inviaci il tuo feedback per aiutarci a migliorare.","feedback.confirm":"Invia feedback","feedback.cancel":"Annulla","feedback.placeholder":"Dicci cosa non ha funzionato...","error.configuration":"Errore di configurazione","error.bot":"Errore del bot","error.network":"Errore di rete","error.disconnected":"Disconnesso","error.unexpected":"Errore imprevisto","dropdown.placeholder":"Seleziona...","message.status.delivered":"Consegnato","date.today":"Oggi","date.yesterday":"Ieri"},sc={"composer.placeholder":"メッセージを入力...","composer.sendButton.ariaLabel":"メッセージ送信ボタン","composer.voiceButton.ariaLabel":"音声入力ボタン","composer.fileButton.ariaLabel":"ファイルアップロードボタン","composer.messageInput.ariaLabel":"メッセージ入力","fileAttachment.uploadError":"アップロードエラー","fileAttachment.fallbackExtension":"ファイル","fileAttachment.removeButton.ariaLabel":"ファイル削除ボタン","header.defaultBotName":"ボット","header.expandButton.ariaLabel":"ヘッダー展開ボタン","header.sound.enable":"チャット音を有効にする","header.sound.disable":"チャット音を無効にする","conversationHistory.title":"会話履歴","conversationHistory.empty":"まだ会話がありません","conversationHistory.newConversation":"新しい会話","conversationHistory.sentAttachment":"添付ファイルを送信しました","conversationHistory.showButton.ariaLabel":"最近の会話を表示ボタン","restartConversation.title":"新しい会話を作成","restartConversation.description":"現在の会話を消去し、新しい会話を開始します。","restartConversation.confirm":"新しい会話","restartConversation.cancel":"キャンセル","restartConversation.button.ariaLabel":"会話を再開ボタン","closeButton.ariaLabel":"チャットボットを閉じるボタン","feedback.title":"改善にご協力ください","feedback.description":"サービス向上のため、フィードバックをお寄せください。","feedback.confirm":"フィードバックを送信","feedback.cancel":"キャンセル","feedback.placeholder":"問題点をお知らせください...","error.configuration":"設定エラー","error.bot":"ボットエラー","error.network":"ネットワークエラー","error.disconnected":"切断されました","error.unexpected":"予期しないエラー","dropdown.placeholder":"選択...","message.status.delivered":"配信済み","date.today":"今日","date.yesterday":"昨日"},ac={"composer.placeholder":"메시지를 입력하세요...","composer.sendButton.ariaLabel":"메시지 보내기 버튼","composer.voiceButton.ariaLabel":"음성 입력 버튼","composer.fileButton.ariaLabel":"파일 업로드 버튼","composer.messageInput.ariaLabel":"메시지 입력","fileAttachment.uploadError":"업로드 오류","fileAttachment.fallbackExtension":"파일","fileAttachment.removeButton.ariaLabel":"파일 삭제 버튼","header.defaultBotName":"봇","header.expandButton.ariaLabel":"헤더 펼치기 버튼","header.sound.enable":"채팅 소리 켜기","header.sound.disable":"채팅 소리 끄기","conversationHistory.title":"대화 목록","conversationHistory.empty":"아직 시작된 대화가 없습니다","conversationHistory.newConversation":"새 대화","conversationHistory.sentAttachment":"첨부 파일을 보냈습니다","conversationHistory.showButton.ariaLabel":"최근 대화 보기 버튼","restartConversation.title":"새 대화 만들기","restartConversation.description":"현재 대화를 지우고 새 대화를 시작합니다.","restartConversation.confirm":"새 대화","restartConversation.cancel":"취소","restartConversation.button.ariaLabel":"대화 다시 시작 버튼","closeButton.ariaLabel":"챗봇 닫기 버튼","feedback.title":"개선에 도움을 주세요","feedback.description":"서비스 개선을 위해 피드백을 보내주세요.","feedback.confirm":"피드백 보내기","feedback.cancel":"취소","feedback.placeholder":"어떤 점이 문제였는지 알려주세요...","error.configuration":"설정 오류","error.bot":"봇 오류","error.network":"네트워크 오류","error.disconnected":"연결 끊김","error.unexpected":"예기치 않은 오류","dropdown.placeholder":"선택...","message.status.delivered":"전달됨","date.today":"오늘","date.yesterday":"어제"},lc={"composer.placeholder":"اكتب رسالتك...","composer.sendButton.ariaLabel":"زر إرسال الرسالة","composer.voiceButton.ariaLabel":"زر الإدخال الصوتي","composer.fileButton.ariaLabel":"زر رفع ملف","composer.messageInput.ariaLabel":"إدخال الرسالة","fileAttachment.uploadError":"خطأ في الرفع","fileAttachment.fallbackExtension":"ملف","fileAttachment.removeButton.ariaLabel":"زر إزالة الملف","header.defaultBotName":"بوت","header.expandButton.ariaLabel":"زر توسيع الرأس","header.sound.enable":"تفعيل أصوات المحادثة","header.sound.disable":"تعطيل أصوات المحادثة","conversationHistory.title":"المحادثات","conversationHistory.empty":"لم تبدأ أي محادثة بعد","conversationHistory.newConversation":"محادثة جديدة","conversationHistory.sentAttachment":"أرسل مرفقاً","conversationHistory.showButton.ariaLabel":"زر عرض المحادثات الأخيرة","restartConversation.title":"إنشاء محادثة جديدة","restartConversation.description":"سيؤدي هذا إلى مسح المحادثة الحالية وبدء محادثة جديدة.","restartConversation.confirm":"محادثة جديدة","restartConversation.cancel":"إلغاء","restartConversation.button.ariaLabel":"زر إعادة بدء المحادثة","closeButton.ariaLabel":"زر إغلاق الشات بوت","feedback.title":"ساعدنا على التحسين","feedback.description":"يرجى تقديم ملاحظاتك لمساعدتنا على التحسين.","feedback.confirm":"إرسال الملاحظات","feedback.cancel":"إلغاء","feedback.placeholder":"أخبرنا ما الخطأ الذي حدث...","error.configuration":"خطأ في الإعدادات","error.bot":"خطأ في البوت","error.network":"خطأ في الشبكة","error.disconnected":"غير متصل","error.unexpected":"خطأ غير متوقع","dropdown.placeholder":"اختر...","message.status.delivered":"تم التسليم","date.today":"اليوم","date.yesterday":"أمس"},Rn={"composer.placeholder":"Type your message...","composer.sendButton.ariaLabel":"Send Message Button","composer.voiceButton.ariaLabel":"Voice Input Button","composer.fileButton.ariaLabel":"Upload File Button","composer.messageInput.ariaLabel":"Message Input","fileAttachment.uploadError":"Upload Error","fileAttachment.fallbackExtension":"File","fileAttachment.removeButton.ariaLabel":"Remove File Button","header.defaultBotName":"Bot","header.expandButton.ariaLabel":"Expand Header Button","header.sound.enable":"Enable chat sounds","header.sound.disable":"Disable chat sounds","conversationHistory.title":"Conversations","conversationHistory.empty":"No conversation started yet","conversationHistory.newConversation":"New conversation","conversationHistory.sentAttachment":"Sent an attachment","conversationHistory.showButton.ariaLabel":"Show Recent Conversations Button","restartConversation.title":"Create New Conversation","restartConversation.description":"This will clear the current conversation and start a new one.","restartConversation.confirm":"New conversation","restartConversation.cancel":"Cancel","restartConversation.button.ariaLabel":"Restart Conversation Button","closeButton.ariaLabel":"Close Chatbot Button","feedback.title":"Help us improve","feedback.description":"Please provide feedback to help us improve.","feedback.confirm":"Send feedback","feedback.cancel":"Cancel","feedback.placeholder":"Let us know what went wrong...","error.configuration":"Configuration error","error.bot":"Bot error","error.network":"Network error","error.disconnected":"Disconnected","error.unexpected":"Unexpected error","dropdown.placeholder":"Select...","message.status.delivered":"Delivered","date.today":"Today","date.yesterday":"Yesterday"},Cb={fr:tc,es:nc,pt:rc,de:ic,it:oc,ja:sc,ko:ac,ar:lc};function uc(e){const n=((e??(typeof navigator<"u"?navigator.language:"en")).split("-")[0]??"en").toLowerCase();return Cb[n]??Rn}kr.extend(kb),kr.extend(Eb);function cc(e,t,n,r,i){return e.map(o=>{const{authorId:s}=o,a=s===n?"outgoing":"incoming",l=t.find(f=>f.id===s);let u;return l&&l.id===n?u={name:l.name||"You",avatar:l.pictureUrl}:l?u={name:l.name||"Agent",avatar:l.pictureUrl}:u={name:r||"Bot",avatar:i},{...o,direction:a,sender:u}})}function Ab(e,t=Rn,n="day"){var i,o,s;if(!e||e.length===0)return[];const r=[];(i=e[0])!=null&&i.timestamp&&r.push(fc(e[0].timestamp,t));for(let a=0;a<e.length;a++)if(e[a]&&r.push(e[a]),a+1<e.length){const l=(o=e[a])==null?void 0:o.timestamp,u=(s=e[a+1])==null?void 0:s.timestamp;!kr(l).isSame(u,n)&&u&&r.push(fc(u,t))}return r}function fc(e,t){return{id:`system-date-${kr(e).format("YYYY-MM-DD")}`,direction:"system",sender:{name:"system"},timestamp:e,block:{type:"text",text:Tb(e,t)}}}function Tb(e,t=Rn,n=!1){const r=kr(e),i="h:mma",o=t["date.today"],s=t["date.yesterday"];return r.isToday()?n?`${o} • ${r.format(i)}`:o:r.isYesterday()?n?`${s} • ${r.format(i)}`:s:n?r.format(`YYYY-MM-DD • ${i}`):r.format("YYYY-MM-DD")}function Ib(e=""){if(typeof e!="string")throw new TypeError("Color should be string!");const t=/^#?([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i.exec(e);if(t)return t.splice(1).map(r=>Number.parseInt(r,16));const n=/^#?([\da-f])([\da-f])([\da-f])$/i.exec(e);if(n)return n.splice(1).map(r=>Number.parseInt(r+r,16));if(e.includes(","))return e.split(",").map(r=>Number.parseInt(r));throw new Error("Invalid color format! Use #ABC or #AABBCC or r,g,b")}function Ob(e){return"#"+e.map(t=>`0${t.toString(16).toUpperCase()}`.slice(-2)).join("")}function Db(e,t){return e.map(n=>Math.round(n+(255-n)*t))}function Mb(e,t){return e.map(n=>Math.round(n*t))}const xr=e=>t=>Db(t,e),Er=e=>t=>Mb(t,e),Nb={50:xr(.95),100:xr(.9),200:xr(.75),300:xr(.6),400:xr(.3),500:e=>e,600:Er(.9),700:Er(.6),800:Er(.45),900:Er(.3),950:Er(.2)};function dc(e,t=Nb){const n={},r=Ib(e);for(const[i,o]of Object.entries(t))n[i]=Ob(o(r));return n}const hc=()=>{const e={};return{on:(i,o)=>{var s;return e[i]||(e[i]=new Set),(s=e[i])==null||s.add(o),()=>{var a;return(a=e[i])==null?void 0:a.delete(o)}},emit:(i,o)=>{var s,a;(s=e[i])==null||s.forEach(l=>l(o)),(a=e["*"])==null||a.forEach(l=>l({type:i,payload:o}))},removeAllListeners:i=>{var o;i?(o=e[i])==null||o.clear():Object.keys(e).forEach(s=>{var a;(a=e[s])==null||a.clear()})}}};class wn extends Error{}class Lb extends wn{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class _b extends wn{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class Pb extends wn{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class Cr extends wn{}class pc extends wn{constructor(t){super(`Invalid unit ${t}`)}}class bt extends wn{}class rn extends wn{constructor(){super("Zone is an abstract class")}}const ie="numeric",Tt="short",pt="long",hs={year:ie,month:ie,day:ie},mc={year:ie,month:Tt,day:ie},Fb={year:ie,month:Tt,day:ie,weekday:Tt},gc={year:ie,month:pt,day:ie},yc={year:ie,month:pt,day:ie,weekday:pt},vc={hour:ie,minute:ie},bc={hour:ie,minute:ie,second:ie},wc={hour:ie,minute:ie,second:ie,timeZoneName:Tt},Sc={hour:ie,minute:ie,second:ie,timeZoneName:pt},kc={hour:ie,minute:ie,hourCycle:"h23"},xc={hour:ie,minute:ie,second:ie,hourCycle:"h23"},Ec={hour:ie,minute:ie,second:ie,hourCycle:"h23",timeZoneName:Tt},Cc={hour:ie,minute:ie,second:ie,hourCycle:"h23",timeZoneName:pt},Ac={year:ie,month:ie,day:ie,hour:ie,minute:ie},Tc={year:ie,month:ie,day:ie,hour:ie,minute:ie,second:ie},Ic={year:ie,month:Tt,day:ie,hour:ie,minute:ie},Oc={year:ie,month:Tt,day:ie,hour:ie,minute:ie,second:ie},Rb={year:ie,month:Tt,day:ie,weekday:Tt,hour:ie,minute:ie},Dc={year:ie,month:pt,day:ie,hour:ie,minute:ie,timeZoneName:Tt},Mc={year:ie,month:pt,day:ie,hour:ie,minute:ie,second:ie,timeZoneName:Tt},Nc={year:ie,month:pt,day:ie,weekday:pt,hour:ie,minute:ie,timeZoneName:pt},Lc={year:ie,month:pt,day:ie,weekday:pt,hour:ie,minute:ie,second:ie,timeZoneName:pt};function xe(e){return typeof e>"u"}function Sn(e){return typeof e=="number"}function xi(e){return typeof e=="number"&&e%1===0}function Bb(e){return typeof e=="string"}function $b(e){return Object.prototype.toString.call(e)==="[object Date]"}function _c(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function zb(e){return Array.isArray(e)?e:[e]}function Pc(e,t,n){if(e.length!==0)return e.reduce((r,i)=>{const o=[t(i),i];return r&&n(r[0],o[0])===r[0]?r:o},null)[1]}function Hb(e,t){return t.reduce((n,r)=>(n[r]=e[r],n),{})}function Bn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Yt(e,t,n){return xi(e)&&e>=t&&e<=n}function Ub(e,t){return e-t*Math.floor(e/t)}function Ve(e,t=2){const n=e<0;let r;return n?r="-"+(""+-e).padStart(t,"0"):r=(""+e).padStart(t,"0"),r}function on(e){if(!(xe(e)||e===null||e===""))return parseInt(e,10)}function kn(e){if(!(xe(e)||e===null||e===""))return parseFloat(e)}function ps(e){if(!(xe(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function ms(e,t,n=!1){const r=10**t;return(n?Math.trunc:Math.round)(e*r)/r}function Ar(e){return e%4===0&&(e%100!==0||e%400===0)}function Tr(e){return Ar(e)?366:365}function Ei(e,t){const n=Ub(t-1,12)+1,r=e+(t-n)/12;return n===2?Ar(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function gs(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(t.getUTCFullYear()-1900)),+t}function Ci(e){const t=(e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))%7,n=e-1,r=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7;return t===4||r===3?53:52}function ys(e){return e>99?e:e>60?1900+e:2e3+e}function Fc(e,t,n,r=null){const i=new Date(e),o={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(o.timeZone=r);const s={timeZoneName:t,...o},a=new Intl.DateTimeFormat(n,s).formatToParts(i).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function Ai(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0,i=n<0||Object.is(n,-0)?-r:r;return n*60+i}function Rc(e){const t=Number(e);if(typeof e=="boolean"||e===""||Number.isNaN(t))throw new bt(`Invalid unit value ${e}`);return t}function Ti(e,t){const n={};for(const r in e)if(Bn(e,r)){const i=e[r];if(i==null)continue;n[t(r)]=Rc(i)}return n}function Ir(e,t){const n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),i=e>=0?"+":"-";switch(t){case"short":return`${i}${Ve(n,2)}:${Ve(r,2)}`;case"narrow":return`${i}${n}${r>0?`:${r}`:""}`;case"techie":return`${i}${Ve(n,2)}${Ve(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function Ii(e){return Hb(e,["hour","minute","second","millisecond"])}const Bc=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,jb=["January","February","March","April","May","June","July","August","September","October","November","December"],$c=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Vb=["J","F","M","A","M","J","J","A","S","O","N","D"];function zc(e){switch(e){case"narrow":return[...Vb];case"short":return[...$c];case"long":return[...jb];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const Hc=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Uc=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Wb=["M","T","W","T","F","S","S"];function jc(e){switch(e){case"narrow":return[...Wb];case"short":return[...Uc];case"long":return[...Hc];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Vc=["AM","PM"],qb=["Before Christ","Anno Domini"],Yb=["BC","AD"],Kb=["B","A"];function Wc(e){switch(e){case"narrow":return[...Kb];case"short":return[...Yb];case"long":return[...qb];default:return null}}function Gb(e){return Vc[e.hour<12?0:1]}function Qb(e,t){return jc(t)[e.weekday-1]}function Zb(e,t){return zc(t)[e.month-1]}function Jb(e,t){return Wc(t)[e.year<0?0:1]}function Xb(e,t,n="always",r=!1){const i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},o=["hours","minutes","seconds"].indexOf(e)===-1;if(n==="auto"&&o){const c=e==="days";switch(t){case 1:return c?"tomorrow":`next ${i[e][0]}`;case-1:return c?"yesterday":`last ${i[e][0]}`;case 0:return c?"today":`this ${i[e][0]}`}}const s=Object.is(t,-0)||t<0,a=Math.abs(t),l=a===1,u=i[e],f=r?l?u[1]:u[2]||u[1]:l?i[e][0]:e;return s?`${a} ${f} ago`:`in ${a} ${f}`}function qc(e,t){let n="";for(const r of e)r.literal?n+=r.val:n+=t(r.val);return n}const ew={D:hs,DD:mc,DDD:gc,DDDD:yc,t:vc,tt:bc,ttt:wc,tttt:Sc,T:kc,TT:xc,TTT:Ec,TTTT:Cc,f:Ac,ff:Ic,fff:Dc,ffff:Nc,F:Tc,FF:Oc,FFF:Mc,FFFF:Lc};class ut{static create(t,n={}){return new ut(t,n)}static parseFormat(t){let n=null,r="",i=!1;const o=[];for(let s=0;s<t.length;s++){const a=t.charAt(s);a==="'"?(r.length>0&&o.push({literal:i,val:r}),n=null,r="",i=!i):i||a===n?r+=a:(r.length>0&&o.push({literal:!1,val:r}),r=a,n=a)}return r.length>0&&o.push({literal:i,val:r}),o}static macroTokenToFormatOpts(t){return ew[t]}constructor(t,n){this.opts=n,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...n}).format()}formatDateTime(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n}).format()}formatDateTimeParts(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n}).formatToParts()}resolvedOptions(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n}).resolvedOptions()}num(t,n=0){if(this.opts.forceSimple)return Ve(t,n);const r={...this.opts};return n>0&&(r.padTo=n),this.loc.numberFormatter(r).format(t)}formatDateTimeFromString(t,n){const r=this.loc.listingMode()==="en",i=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",o=(d,m)=>this.loc.extract(t,d,m),s=d=>t.isOffsetFixed&&t.offset===0&&d.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,d.format):"",a=()=>r?Gb(t):o({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(d,m)=>r?Zb(t,d):o(m?{month:d}:{month:d,day:"numeric"},"month"),u=(d,m)=>r?Qb(t,d):o(m?{weekday:d}:{weekday:d,month:"long",day:"numeric"},"weekday"),f=d=>{const m=ut.macroTokenToFormatOpts(d);return m?this.formatWithSystemDefault(t,m):d},c=d=>r?Jb(t,d):o({era:d},"era"),h=d=>{switch(d){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return s({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return s({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return s({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return a();case"d":return i?o({day:"numeric"},"day"):this.num(t.day);case"dd":return i?o({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return i?o({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return i?o({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return l("short",!0);case"LLLL":return l("long",!0);case"LLLLL":return l("narrow",!0);case"M":return i?o({month:"numeric"},"month"):this.num(t.month);case"MM":return i?o({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return l("short",!1);case"MMMM":return l("long",!1);case"MMMMM":return l("narrow",!1);case"y":return i?o({year:"numeric"},"year"):this.num(t.year);case"yy":return i?o({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return i?o({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return i?o({year:"numeric"},"year"):this.num(t.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return f(d)}};return qc(ut.parseFormat(n),h)}formatDurationFromString(t,n){const r=l=>{switch(l[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},i=l=>u=>{const f=r(u);return f?this.num(l.get(f),u.length):u},o=ut.parseFormat(n),s=o.reduce((l,{literal:u,val:f})=>u?l:l.concat(f),[]),a=t.shiftTo(...s.map(r).filter(l=>l));return qc(o,i(a))}}class It{constructor(t,n){this.reason=t,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class Or{get type(){throw new rn}get name(){throw new rn}get ianaName(){return this.name}get isUniversal(){throw new rn}offsetName(t,n){throw new rn}formatOffset(t,n){throw new rn}offset(t){throw new rn}equals(t){throw new rn}get isValid(){throw new rn}}let vs=null;class bs extends Or{static get instance(){return vs===null&&(vs=new bs),vs}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return Fc(t,n,r)}formatOffset(t,n){return Ir(this.offset(t),n)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}let Oi={};function tw(e){return Oi[e]||(Oi[e]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),Oi[e]}const nw={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function rw(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,i,o,s,a,l,u,f]=r;return[s,i,o,a,l,u,f]}function iw(e,t){const n=e.formatToParts(t),r=[];for(let i=0;i<n.length;i++){const{type:o,value:s}=n[i],a=nw[o];o==="era"?r[a]=s:xe(a)||(r[a]=parseInt(s,10))}return r}let Di={};class Kt extends Or{static create(t){return Di[t]||(Di[t]=new Kt(t)),Di[t]}static resetCache(){Di={},Oi={}}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=Kt.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return Fc(t,n,r,this.name)}formatOffset(t,n){return Ir(this.offset(t),n)}offset(t){const n=new Date(t);if(isNaN(n))return NaN;const r=tw(this.name);let[i,o,s,a,l,u,f]=r.formatToParts?iw(r,n):rw(r,n);a==="BC"&&(i=-Math.abs(i)+1);const h=gs({year:i,month:o,day:s,hour:l===24?0:l,minute:u,second:f,millisecond:0});let d=+n;const m=d%1e3;return d-=m>=0?m:1e3+m,(h-d)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let ws=null;class ot extends Or{static get utcInstance(){return ws===null&&(ws=new ot(0)),ws}static instance(t){return t===0?ot.utcInstance:new ot(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new ot(Ai(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Ir(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Ir(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return Ir(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}class ow extends Or{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function sn(e,t){if(xe(e)||e===null)return t;if(e instanceof Or)return e;if(Bb(e)){const n=e.toLowerCase();return n==="local"||n==="system"?t:n==="utc"||n==="gmt"?ot.utcInstance:ot.parseSpecifier(n)||Kt.create(e)}else return Sn(e)?ot.instance(e):typeof e=="object"&&e.offset&&typeof e.offset=="number"?e:new ow(e)}let Yc=()=>Date.now(),Kc="system",Gc=null,Qc=null,Zc=null,Jc;class qe{static get now(){return Yc}static set now(t){Yc=t}static set defaultZone(t){Kc=t}static get defaultZone(){return sn(Kc,bs.instance)}static get defaultLocale(){return Gc}static set defaultLocale(t){Gc=t}static get defaultNumberingSystem(){return Qc}static set defaultNumberingSystem(t){Qc=t}static get defaultOutputCalendar(){return Zc}static set defaultOutputCalendar(t){Zc=t}static get throwOnInvalid(){return Jc}static set throwOnInvalid(t){Jc=t}static resetCaches(){Re.resetCache(),Kt.resetCache()}}let Xc={};function sw(e,t={}){const n=JSON.stringify([e,t]);let r=Xc[n];return r||(r=new Intl.ListFormat(e,t),Xc[n]=r),r}let Ss={};function ks(e,t={}){const n=JSON.stringify([e,t]);let r=Ss[n];return r||(r=new Intl.DateTimeFormat(e,t),Ss[n]=r),r}let xs={};function aw(e,t={}){const n=JSON.stringify([e,t]);let r=xs[n];return r||(r=new Intl.NumberFormat(e,t),xs[n]=r),r}let Es={};function lw(e,t={}){const{base:n,...r}=t,i=JSON.stringify([e,r]);let o=Es[i];return o||(o=new Intl.RelativeTimeFormat(e,t),Es[i]=o),o}let Dr=null;function uw(){return Dr||(Dr=new Intl.DateTimeFormat().resolvedOptions().locale,Dr)}function cw(e){const t=e.indexOf("-u-");if(t===-1)return[e];{let n;const r=e.substring(0,t);try{n=ks(e).resolvedOptions()}catch{n=ks(r).resolvedOptions()}const{numberingSystem:i,calendar:o}=n;return[r,i,o]}}function fw(e,t,n){return(n||t)&&(e+="-u",n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`)),e}function dw(e){const t=[];for(let n=1;n<=12;n++){const r=pe.utc(2016,n,1);t.push(e(r))}return t}function hw(e){const t=[];for(let n=1;n<=7;n++){const r=pe.utc(2016,11,13+n);t.push(e(r))}return t}function Mi(e,t,n,r,i){const o=e.listingMode(n);return o==="error"?null:o==="en"?r(t):i(t)}function pw(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem==="latn"}class mw{constructor(t,n,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:i,floor:o,...s}=r;if(!n||Object.keys(s).length>0){const a={useGrouping:!1,...r};r.padTo>0&&(a.minimumIntegerDigits=r.padTo),this.inf=aw(t,a)}}format(t){if(this.inf){const n=this.floor?Math.floor(t):t;return this.inf.format(n)}else{const n=this.floor?Math.floor(t):ms(t,3);return Ve(n,this.padTo)}}}class gw{constructor(t,n,r){this.opts=r;let i;if(t.zone.isUniversal){const s=-1*(t.offset/60),a=s>=0?`Etc/GMT+${s}`:`Etc/GMT${s}`;t.offset!==0&&Kt.create(a).valid?(i=a,this.dt=t):(i="UTC",r.timeZoneName?this.dt=t:this.dt=t.offset===0?t:pe.fromMillis(t.ts+t.offset*60*1e3))}else t.zone.type==="system"?this.dt=t:(this.dt=t,i=t.zone.name);const o={...this.opts};i&&(o.timeZone=i),this.dtf=ks(n,o)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class yw{constructor(t,n,r){this.opts={style:"long",...r},!n&&_c()&&(this.rtf=lw(t,r))}format(t,n){return this.rtf?this.rtf.format(t,n):Xb(n,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,n){return this.rtf?this.rtf.formatToParts(t,n):[]}}class Re{static fromOpts(t){return Re.create(t.locale,t.numberingSystem,t.outputCalendar,t.defaultToEN)}static create(t,n,r,i=!1){const o=t||qe.defaultLocale,s=o||(i?"en-US":uw()),a=n||qe.defaultNumberingSystem,l=r||qe.defaultOutputCalendar;return new Re(s,a,l,o)}static resetCache(){Dr=null,Ss={},xs={},Es={}}static fromObject({locale:t,numberingSystem:n,outputCalendar:r}={}){return Re.create(t,n,r)}constructor(t,n,r,i){const[o,s,a]=cw(t);this.locale=o,this.numberingSystem=n||s||null,this.outputCalendar=r||a||null,this.intl=fw(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=pw(this)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&n?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:Re.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,n=!1,r=!0){return Mi(this,t,r,zc,()=>{const i=n?{month:t,day:"numeric"}:{month:t},o=n?"format":"standalone";return this.monthsCache[o][t]||(this.monthsCache[o][t]=dw(s=>this.extract(s,i,"month"))),this.monthsCache[o][t]})}weekdays(t,n=!1,r=!0){return Mi(this,t,r,jc,()=>{const i=n?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},o=n?"format":"standalone";return this.weekdaysCache[o][t]||(this.weekdaysCache[o][t]=hw(s=>this.extract(s,i,"weekday"))),this.weekdaysCache[o][t]})}meridiems(t=!0){return Mi(this,void 0,t,()=>Vc,()=>{if(!this.meridiemCache){const n={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[pe.utc(2016,11,13,9),pe.utc(2016,11,13,19)].map(r=>this.extract(r,n,"dayperiod"))}return this.meridiemCache})}eras(t,n=!0){return Mi(this,t,n,Wc,()=>{const r={era:t};return this.eraCache[t]||(this.eraCache[t]=[pe.utc(-40,1,1),pe.utc(2017,1,1)].map(i=>this.extract(i,r,"era"))),this.eraCache[t]})}extract(t,n,r){const i=this.dtFormatter(t,n),o=i.formatToParts(),s=o.find(a=>a.type.toLowerCase()===r);return s?s.value:null}numberFormatter(t={}){return new mw(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,n={}){return new gw(t,this.intl,n)}relFormatter(t={}){return new yw(this.intl,this.isEnglish(),t)}listFormatter(t={}){return sw(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}}function $n(...e){const t=e.reduce((n,r)=>n+r.source,"");return RegExp(`^${t}$`)}function zn(...e){return t=>e.reduce(([n,r,i],o)=>{const[s,a,l]=o(t,i);return[{...n,...s},a||r,l]},[{},null,1]).slice(0,2)}function Hn(e,...t){if(e==null)return[null,null];for(const[n,r]of t){const i=n.exec(e);if(i)return r(i)}return[null,null]}function ef(...e){return(t,n)=>{const r={};let i;for(i=0;i<e.length;i++)r[e[i]]=on(t[n+i]);return[r,null,n+i]}}const tf=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,vw=`(?:${tf.source}?(?:\\[(${Bc.source})\\])?)?`,Cs=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,nf=RegExp(`${Cs.source}${vw}`),As=RegExp(`(?:T${nf.source})?`),bw=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,ww=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Sw=/(\d{4})-?(\d{3})/,kw=ef("weekYear","weekNumber","weekDay"),xw=ef("year","ordinal"),Ew=/(\d{4})-(\d\d)-(\d\d)/,rf=RegExp(`${Cs.source} ?(?:${tf.source}|(${Bc.source}))?`),Cw=RegExp(`(?: ${rf.source})?`);function Un(e,t,n){const r=e[t];return xe(r)?n:on(r)}function Aw(e,t){return[{year:Un(e,t),month:Un(e,t+1,1),day:Un(e,t+2,1)},null,t+3]}function jn(e,t){return[{hours:Un(e,t,0),minutes:Un(e,t+1,0),seconds:Un(e,t+2,0),milliseconds:ps(e[t+3])},null,t+4]}function Mr(e,t){const n=!e[t]&&!e[t+1],r=Ai(e[t+1],e[t+2]),i=n?null:ot.instance(r);return[{},i,t+3]}function Nr(e,t){const n=e[t]?Kt.create(e[t]):null;return[{},n,t+1]}const Tw=RegExp(`^T?${Cs.source}$`),Iw=/^-?P(?:(?:(-?\d{1,9}(?:\.\d{1,9})?)Y)?(?:(-?\d{1,9}(?:\.\d{1,9})?)M)?(?:(-?\d{1,9}(?:\.\d{1,9})?)W)?(?:(-?\d{1,9}(?:\.\d{1,9})?)D)?(?:T(?:(-?\d{1,9}(?:\.\d{1,9})?)H)?(?:(-?\d{1,9}(?:\.\d{1,9})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,9}))?S)?)?)$/;function Ow(e){const[t,n,r,i,o,s,a,l,u]=e,f=t[0]==="-",c=l&&l[0]==="-",h=(d,m=!1)=>d!==void 0&&(m||d&&f)?-d:d;return[{years:h(kn(n)),months:h(kn(r)),weeks:h(kn(i)),days:h(kn(o)),hours:h(kn(s)),minutes:h(kn(a)),seconds:h(kn(l),l==="-0"),milliseconds:h(ps(u),c)}]}const Dw={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Ts(e,t,n,r,i,o,s){const a={year:t.length===2?ys(on(t)):on(t),month:$c.indexOf(n)+1,day:on(r),hour:on(i),minute:on(o)};return s&&(a.second=on(s)),e&&(a.weekday=e.length>3?Hc.indexOf(e)+1:Uc.indexOf(e)+1),a}const Mw=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Nw(e){const[,t,n,r,i,o,s,a,l,u,f,c]=e,h=Ts(t,i,r,n,o,s,a);let d;return l?d=Dw[l]:u?d=0:d=Ai(f,c),[h,new ot(d)]}function Lw(e){return e.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const _w=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Pw=/^(Monday|Tuesday|Wedsday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Fw=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function of(e){const[,t,n,r,i,o,s,a]=e;return[Ts(t,i,r,n,o,s,a),ot.utcInstance]}function Rw(e){const[,t,n,r,i,o,s,a]=e;return[Ts(t,a,n,r,i,o,s),ot.utcInstance]}const Bw=$n(bw,As),$w=$n(ww,As),zw=$n(Sw,As),Hw=$n(nf),sf=zn(Aw,jn,Mr,Nr),Uw=zn(kw,jn,Mr,Nr),jw=zn(xw,jn,Mr,Nr),Vw=zn(jn,Mr,Nr);function Ww(e){return Hn(e,[Bw,sf],[$w,Uw],[zw,jw],[Hw,Vw])}function qw(e){return Hn(Lw(e),[Mw,Nw])}function Yw(e){return Hn(e,[_w,of],[Pw,of],[Fw,Rw])}function Kw(e){return Hn(e,[Iw,Ow])}const Gw=zn(jn);function Qw(e){return Hn(e,[Tw,Gw])}const Zw=$n(Ew,Cw),Jw=$n(rf),Xw=zn(jn,Mr,Nr);function e0(e){return Hn(e,[Zw,sf],[Jw,Xw])}const t0="Invalid Duration",af={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},n0={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...af},wt=146097/400,Vn=146097/4800,r0={years:{quarters:4,months:12,weeks:wt/7,days:wt,hours:wt*24,minutes:wt*24*60,seconds:wt*24*60*60,milliseconds:wt*24*60*60*1e3},quarters:{months:3,weeks:wt/28,days:wt/4,hours:wt*24/4,minutes:wt*24*60/4,seconds:wt*24*60*60/4,milliseconds:wt*24*60*60*1e3/4},months:{weeks:Vn/7,days:Vn,hours:Vn*24,minutes:Vn*24*60,seconds:Vn*24*60*60,milliseconds:Vn*24*60*60*1e3},...af},xn=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],i0=xn.slice(0).reverse();function En(e,t,n=!1){const r={values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy};return new Ce(r)}function o0(e){return e<0?Math.floor(e):Math.ceil(e)}function lf(e,t,n,r,i){const o=e[i][n],s=t[n]/o,a=Math.sign(s)===Math.sign(r[i]),l=!a&&r[i]!==0&&Math.abs(s)<=1?o0(s):Math.trunc(s);r[i]+=l,t[n]-=l*o}function s0(e,t){i0.reduce((n,r)=>xe(t[r])?n:(n&&lf(e,t,n,t,r),r),null)}class Ce{constructor(t){const n=t.conversionAccuracy==="longterm"||!1;this.values=t.values,this.loc=t.loc||Re.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=n?r0:n0,this.isLuxonDuration=!0}static fromMillis(t,n){return Ce.fromObject({milliseconds:t},n)}static fromObject(t,n={}){if(t==null||typeof t!="object")throw new bt(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new Ce({values:Ti(t,Ce.normalizeUnit),loc:Re.fromObject(n),conversionAccuracy:n.conversionAccuracy})}static fromDurationLike(t){if(Sn(t))return Ce.fromMillis(t);if(Ce.isDuration(t))return t;if(typeof t=="object")return Ce.fromObject(t);throw new bt(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){const[r]=Kw(t);return r?Ce.fromObject(r,n):Ce.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){const[r]=Qw(t);return r?Ce.fromObject(r,n):Ce.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,n=null){if(!t)throw new bt("need to specify a reason the Duration is invalid");const r=t instanceof It?t:new It(t,n);if(qe.throwOnInvalid)throw new Pb(r);return new Ce({invalid:r})}static normalizeUnit(t){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!n)throw new pc(t);return n}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,n={}){const r={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?ut.create(this.loc,r).formatDurationFromString(this,t):t0}toHuman(t={}){const n=xn.map(r=>{const i=this.values[r];return xe(i)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:r.slice(0,-1)}).format(i)}).filter(r=>r);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=ms(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const n=this.toMillis();if(n<0||n>=864e5)return null;t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t};const r=this.shiftTo("hours","minutes","seconds","milliseconds");let i=t.format==="basic"?"hhmm":"hh:mm";(!t.suppressSeconds||r.seconds!==0||r.milliseconds!==0)&&(i+=t.format==="basic"?"ss":":ss",(!t.suppressMilliseconds||r.milliseconds!==0)&&(i+=".SSS"));let o=r.toFormat(i);return t.includePrefix&&(o="T"+o),o}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const n=Ce.fromDurationLike(t),r={};for(const i of xn)(Bn(n.values,i)||Bn(this.values,i))&&(r[i]=n.get(i)+this.get(i));return En(this,{values:r},!0)}minus(t){if(!this.isValid)return this;const n=Ce.fromDurationLike(t);return this.plus(n.negate())}mapUnits(t){if(!this.isValid)return this;const n={};for(const r of Object.keys(this.values))n[r]=Rc(t(this.values[r],r));return En(this,{values:n},!0)}get(t){return this[Ce.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const n={...this.values,...Ti(t,Ce.normalizeUnit)};return En(this,{values:n})}reconfigure({locale:t,numberingSystem:n,conversionAccuracy:r}={}){const i=this.loc.clone({locale:t,numberingSystem:n}),o={loc:i};return r&&(o.conversionAccuracy=r),En(this,o)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return s0(this.matrix,t),En(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(s=>Ce.normalizeUnit(s));const n={},r={},i=this.toObject();let o;for(const s of xn)if(t.indexOf(s)>=0){o=s;let a=0;for(const u in r)a+=this.matrix[u][s]*r[u],r[u]=0;Sn(i[s])&&(a+=i[s]);const l=Math.trunc(a);n[s]=l,r[s]=(a*1e3-l*1e3)/1e3;for(const u in i)xn.indexOf(u)>xn.indexOf(s)&&lf(this.matrix,i,u,n,s)}else Sn(i[s])&&(r[s]=i[s]);for(const s in r)r[s]!==0&&(n[o]+=s===o?r[s]:r[s]/this.matrix[o][s]);return En(this,{values:n},!0).normalize()}negate(){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=this.values[n]===0?0:-this.values[n];return En(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function n(r,i){return r===void 0||r===0?i===void 0||i===0:r===i}for(const r of xn)if(!n(this.values[r],t.values[r]))return!1;return!0}}const Lr="Invalid Interval";function a0(e,t){return!e||!e.isValid?ze.invalid("missing or invalid start"):!t||!t.isValid?ze.invalid("missing or invalid end"):t<e?ze.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null}class ze{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,n=null){if(!t)throw new bt("need to specify a reason the Interval is invalid");const r=t instanceof It?t:new It(t,n);if(qe.throwOnInvalid)throw new _b(r);return new ze({invalid:r})}static fromDateTimes(t,n){const r=Fr(t),i=Fr(n),o=a0(r,i);return o??new ze({start:r,end:i})}static after(t,n){const r=Ce.fromDurationLike(n),i=Fr(t);return ze.fromDateTimes(i,i.plus(r))}static before(t,n){const r=Ce.fromDurationLike(n),i=Fr(t);return ze.fromDateTimes(i.minus(r),i)}static fromISO(t,n){const[r,i]=(t||"").split("/",2);if(r&&i){let o,s;try{o=pe.fromISO(r,n),s=o.isValid}catch{s=!1}let a,l;try{a=pe.fromISO(i,n),l=a.isValid}catch{l=!1}if(s&&l)return ze.fromDateTimes(o,a);if(s){const u=Ce.fromISO(i,n);if(u.isValid)return ze.after(o,u)}else if(l){const u=Ce.fromISO(r,n);if(u.isValid)return ze.before(a,u)}}return ze.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds"){if(!this.isValid)return NaN;const n=this.start.startOf(t),r=this.end.startOf(t);return Math.floor(r.diff(n,t).get(t))+1}hasSame(t){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,t):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return this.isValid?this.s>t:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:n}={}){return this.isValid?ze.fromDateTimes(t||this.s,n||this.e):this}splitAt(...t){if(!this.isValid)return[];const n=t.map(Fr).filter(s=>this.contains(s)).sort(),r=[];let{s:i}=this,o=0;for(;i<this.e;){const s=n[o]||this.e,a=+s>+this.e?this.e:s;r.push(ze.fromDateTimes(i,a)),i=a,o+=1}return r}splitBy(t){const n=Ce.fromDurationLike(t);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,i=1,o;const s=[];for(;r<this.e;){const a=this.start.plus(n.mapUnits(l=>l*i));o=+a>+this.e?this.e:a,s.push(ze.fromDateTimes(r,o)),r=o,i+=1}return s}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return this.isValid?+this.e==+t.s:!1}abutsEnd(t){return this.isValid?+t.e==+this.s:!1}engulfs(t){return this.isValid?this.s<=t.s&&this.e>=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const n=this.s>t.s?this.s:t.s,r=this.e<t.e?this.e:t.e;return n>=r?null:ze.fromDateTimes(n,r)}union(t){if(!this.isValid)return this;const n=this.s<t.s?this.s:t.s,r=this.e>t.e?this.e:t.e;return ze.fromDateTimes(n,r)}static merge(t){const[n,r]=t.sort((i,o)=>i.s-o.s).reduce(([i,o],s)=>o?o.overlaps(s)||o.abutsStart(s)?[i,o.union(s)]:[i.concat([o]),s]:[i,s],[[],null]);return r&&n.push(r),n}static xor(t){let n=null,r=0;const i=[],o=t.map(l=>[{time:l.s,type:"s"},{time:l.e,type:"e"}]),s=Array.prototype.concat(...o),a=s.sort((l,u)=>l.time-u.time);for(const l of a)r+=l.type==="s"?1:-1,r===1?n=l.time:(n&&+n!=+l.time&&i.push(ze.fromDateTimes(n,l.time)),n=null);return ze.merge(i)}difference(...t){return ze.xor([this].concat(t)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Lr}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:Lr}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Lr}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:Lr}toFormat(t,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${n}${this.e.toFormat(t)}`:Lr}toDuration(t,n){return this.isValid?this.e.diff(this.s,t,n):Ce.invalid(this.invalidReason)}mapEndpoints(t){return ze.fromDateTimes(t(this.s),t(this.e))}}let Ni=class{static hasDST(t=qe.defaultZone){const n=pe.now().setZone(t).set({month:12});return!t.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(t){return Kt.isValidZone(t)}static normalizeZone(t){return sn(t,qe.defaultZone)}static months(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null,outputCalendar:o="gregory"}={}){return(i||Re.create(n,r,o)).months(t)}static monthsFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null,outputCalendar:o="gregory"}={}){return(i||Re.create(n,r,o)).months(t,!0)}static weekdays(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null}={}){return(i||Re.create(n,r,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null}={}){return(i||Re.create(n,r,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return Re.create(t).meridiems()}static eras(t="short",{locale:n=null}={}){return Re.create(n,null,"gregory").eras(t)}static features(){return{relative:_c()}}};function uf(e,t){const n=i=>i.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(t)-n(e);return Math.floor(Ce.fromMillis(r).as("days"))}function l0(e,t,n){const r=[["years",(a,l)=>l.year-a.year],["quarters",(a,l)=>l.quarter-a.quarter],["months",(a,l)=>l.month-a.month+(l.year-a.year)*12],["weeks",(a,l)=>{const u=uf(a,l);return(u-u%7)/7}],["days",uf]],i={};let o,s;for(const[a,l]of r)if(n.indexOf(a)>=0){o=a;let u=l(e,t);s=e.plus({[a]:u}),s>t?(e=e.plus({[a]:u-1}),u-=1):e=s,i[a]=u}return[e,i,s,o]}function u0(e,t,n,r){let[i,o,s,a]=l0(e,t,n);const l=t-i,u=n.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);u.length===0&&(s<t&&(s=i.plus({[a]:1})),s!==i&&(o[a]=(o[a]||0)+l/(s-i)));const f=Ce.fromObject(o,r);return u.length>0?Ce.fromMillis(l,r).shiftTo(...u).plus(f):f}const Is={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},cf={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},c0=Is.hanidec.replace(/[\[|\]]/g,"").split("");function f0(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(e[n].search(Is.hanidec)!==-1)t+=c0.indexOf(e[n]);else for(const i in cf){const[o,s]=cf[i];r>=o&&r<=s&&(t+=r-o)}}return parseInt(t,10)}else return t}function Ot({numberingSystem:e},t=""){return new RegExp(`${Is[e||"latn"]}${t}`)}const d0="missing Intl.DateTimeFormat.formatToParts support";function Ae(e,t=n=>n){return{regex:e,deser:([n])=>t(f0(n))}}const ff="[  ]",df=new RegExp(ff,"g");function h0(e){return e.replace(/\./g,"\\.?").replace(df,ff)}function hf(e){return e.replace(/\./g,"").replace(df," ").toLowerCase()}function Dt(e,t){return e===null?null:{regex:RegExp(e.map(h0).join("|")),deser:([n])=>e.findIndex(r=>hf(n)===hf(r))+t}}function pf(e,t){return{regex:e,deser:([,n,r])=>Ai(n,r),groups:t}}function Os(e){return{regex:e,deser:([t])=>t}}function p0(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function m0(e,t){const n=Ot(t),r=Ot(t,"{2}"),i=Ot(t,"{3}"),o=Ot(t,"{4}"),s=Ot(t,"{6}"),a=Ot(t,"{1,2}"),l=Ot(t,"{1,3}"),u=Ot(t,"{1,6}"),f=Ot(t,"{1,9}"),c=Ot(t,"{2,4}"),h=Ot(t,"{4,6}"),d=g=>({regex:RegExp(p0(g.val)),deser:([v])=>v,literal:!0}),p=(g=>{if(e.literal)return d(g);switch(g.val){case"G":return Dt(t.eras("short",!1),0);case"GG":return Dt(t.eras("long",!1),0);case"y":return Ae(u);case"yy":return Ae(c,ys);case"yyyy":return Ae(o);case"yyyyy":return Ae(h);case"yyyyyy":return Ae(s);case"M":return Ae(a);case"MM":return Ae(r);case"MMM":return Dt(t.months("short",!0,!1),1);case"MMMM":return Dt(t.months("long",!0,!1),1);case"L":return Ae(a);case"LL":return Ae(r);case"LLL":return Dt(t.months("short",!1,!1),1);case"LLLL":return Dt(t.months("long",!1,!1),1);case"d":return Ae(a);case"dd":return Ae(r);case"o":return Ae(l);case"ooo":return Ae(i);case"HH":return Ae(r);case"H":return Ae(a);case"hh":return Ae(r);case"h":return Ae(a);case"mm":return Ae(r);case"m":return Ae(a);case"q":return Ae(a);case"qq":return Ae(r);case"s":return Ae(a);case"ss":return Ae(r);case"S":return Ae(l);case"SSS":return Ae(i);case"u":return Os(f);case"uu":return Os(a);case"uuu":return Ae(n);case"a":return Dt(t.meridiems(),0);case"kkkk":return Ae(o);case"kk":return Ae(c,ys);case"W":return Ae(a);case"WW":return Ae(r);case"E":case"c":return Ae(n);case"EEE":return Dt(t.weekdays("short",!1,!1),1);case"EEEE":return Dt(t.weekdays("long",!1,!1),1);case"ccc":return Dt(t.weekdays("short",!0,!1),1);case"cccc":return Dt(t.weekdays("long",!0,!1),1);case"Z":case"ZZ":return pf(new RegExp(`([+-]${a.source})(?::(${r.source}))?`),2);case"ZZZ":return pf(new RegExp(`([+-]${a.source})(${r.source})?`),2);case"z":return Os(/[a-z_+-/]{1,256}?/i);default:return d(g)}})(e)||{invalidReason:d0};return p.token=e,p}const g0={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"}};function y0(e,t,n){const{type:r,value:i}=e;if(r==="literal")return{literal:!0,val:i};const o=n[r];let s=g0[r];if(typeof s=="object"&&(s=s[o]),s)return{literal:!1,val:s}}function v0(e){return[`^${e.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,e]}function b0(e,t,n){const r=e.match(t);if(r){const i={};let o=1;for(const s in n)if(Bn(n,s)){const a=n[s],l=a.groups?a.groups+1:1;!a.literal&&a.token&&(i[a.token.val[0]]=a.deser(r.slice(o,o+l))),o+=l}return[r,i]}else return[r,{}]}function w0(e){const t=o=>{switch(o){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,r;return xe(e.z)||(n=Kt.create(e.z)),xe(e.Z)||(n||(n=new ot(e.Z)),r=e.Z),xe(e.q)||(e.M=(e.q-1)*3+1),xe(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),xe(e.u)||(e.S=ps(e.u)),[Object.keys(e).reduce((o,s)=>{const a=t(s);return a&&(o[a]=e[s]),o},{}),n,r]}let Ds=null;function S0(){return Ds||(Ds=pe.fromMillis(1555555555555)),Ds}function k0(e,t){if(e.literal)return e;const n=ut.macroTokenToFormatOpts(e.val);if(!n)return e;const o=ut.create(t,n).formatDateTimeParts(S0()).map(s=>y0(s,t,n));return o.includes(void 0)?e:o}function x0(e,t){return Array.prototype.concat(...e.map(n=>k0(n,t)))}function mf(e,t,n){const r=x0(ut.parseFormat(n),e),i=r.map(s=>m0(s,e)),o=i.find(s=>s.invalidReason);if(o)return{input:t,tokens:r,invalidReason:o.invalidReason};{const[s,a]=v0(i),l=RegExp(s,"i"),[u,f]=b0(t,l,a),[c,h,d]=f?w0(f):[null,null,void 0];if(Bn(f,"a")&&Bn(f,"H"))throw new Cr("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:r,regex:l,rawMatches:u,matches:f,result:c,zone:h,specificOffset:d}}}function E0(e,t,n){const{result:r,zone:i,specificOffset:o,invalidReason:s}=mf(e,t,n);return[r,i,o,s]}const gf=[0,31,59,90,120,151,181,212,243,273,304,334],yf=[0,31,60,91,121,152,182,213,244,274,305,335];function St(e,t){return new It("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function vf(e,t,n){const r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const i=r.getUTCDay();return i===0?7:i}function bf(e,t,n){return n+(Ar(e)?yf:gf)[t-1]}function wf(e,t){const n=Ar(e)?yf:gf,r=n.findIndex(o=>o<t),i=t-n[r];return{month:r+1,day:i}}function Ms(e){const{year:t,month:n,day:r}=e,i=bf(t,n,r),o=vf(t,n,r);let s=Math.floor((i-o+10)/7),a;return s<1?(a=t-1,s=Ci(a)):s>Ci(t)?(a=t+1,s=1):a=t,{weekYear:a,weekNumber:s,weekday:o,...Ii(e)}}function Sf(e){const{weekYear:t,weekNumber:n,weekday:r}=e,i=vf(t,1,4),o=Tr(t);let s=n*7+r-i-3,a;s<1?(a=t-1,s+=Tr(a)):s>o?(a=t+1,s-=Tr(t)):a=t;const{month:l,day:u}=wf(a,s);return{year:a,month:l,day:u,...Ii(e)}}function Ns(e){const{year:t,month:n,day:r}=e,i=bf(t,n,r);return{year:t,ordinal:i,...Ii(e)}}function kf(e){const{year:t,ordinal:n}=e,{month:r,day:i}=wf(t,n);return{year:t,month:r,day:i,...Ii(e)}}function C0(e){const t=xi(e.weekYear),n=Yt(e.weekNumber,1,Ci(e.weekYear)),r=Yt(e.weekday,1,7);return t?n?r?!1:St("weekday",e.weekday):St("week",e.week):St("weekYear",e.weekYear)}function A0(e){const t=xi(e.year),n=Yt(e.ordinal,1,Tr(e.year));return t?n?!1:St("ordinal",e.ordinal):St("year",e.year)}function xf(e){const t=xi(e.year),n=Yt(e.month,1,12),r=Yt(e.day,1,Ei(e.year,e.month));return t?n?r?!1:St("day",e.day):St("month",e.month):St("year",e.year)}function Ef(e){const{hour:t,minute:n,second:r,millisecond:i}=e,o=Yt(t,0,23)||t===24&&n===0&&r===0&&i===0,s=Yt(n,0,59),a=Yt(r,0,59),l=Yt(i,0,999);return o?s?a?l?!1:St("millisecond",i):St("second",r):St("minute",n):St("hour",t)}const Ls="Invalid DateTime",Cf=864e13;function Li(e){return new It("unsupported zone",`the zone "${e.name}" is not supported`)}function _s(e){return e.weekData===null&&(e.weekData=Ms(e.c)),e.weekData}function _r(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new pe({...n,...t,old:n})}function Af(e,t,n){let r=e-t*60*1e3;const i=n.offset(r);if(t===i)return[r,t];r-=(i-t)*60*1e3;const o=n.offset(r);return i===o?[r,i]:[e-Math.min(i,o)*60*1e3,Math.max(i,o)]}function Tf(e,t){e+=t*60*1e3;const n=new Date(e);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function _i(e,t,n){return Af(gs(e),t,n)}function If(e,t){const n=e.o,r=e.c.year+Math.trunc(t.years),i=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,o={...e.c,year:r,month:i,day:Math.min(e.c.day,Ei(r,i))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},s=Ce.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),a=gs(o);let[l,u]=Af(a,n,e.zone);return s!==0&&(l+=s,u=e.zone.offset(l)),{ts:l,o:u}}function Pr(e,t,n,r,i,o){const{setZone:s,zone:a}=n;if(e&&Object.keys(e).length!==0){const l=t||a,u=pe.fromObject(e,{...n,zone:l,specificOffset:o});return s?u:u.setZone(a)}else return pe.invalid(new It("unparsable",`the input "${i}" can't be parsed as ${r}`))}function Pi(e,t,n=!0){return e.isValid?ut.create(Re.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function Ps(e,t){const n=e.c.year>9999||e.c.year<0;let r="";return n&&e.c.year>=0&&(r+="+"),r+=Ve(e.c.year,n?6:4),t?(r+="-",r+=Ve(e.c.month),r+="-",r+=Ve(e.c.day)):(r+=Ve(e.c.month),r+=Ve(e.c.day)),r}function Of(e,t,n,r,i,o){let s=Ve(e.c.hour);return t?(s+=":",s+=Ve(e.c.minute),(e.c.second!==0||!n)&&(s+=":")):s+=Ve(e.c.minute),(e.c.second!==0||!n)&&(s+=Ve(e.c.second),(e.c.millisecond!==0||!r)&&(s+=".",s+=Ve(e.c.millisecond,3))),i&&(e.isOffsetFixed&&e.offset===0&&!o?s+="Z":e.o<0?(s+="-",s+=Ve(Math.trunc(-e.o/60)),s+=":",s+=Ve(Math.trunc(-e.o%60))):(s+="+",s+=Ve(Math.trunc(e.o/60)),s+=":",s+=Ve(Math.trunc(e.o%60)))),o&&(s+="["+e.zone.ianaName+"]"),s}const Df={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},T0={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},I0={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Mf=["year","month","day","hour","minute","second","millisecond"],O0=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],D0=["year","ordinal","hour","minute","second","millisecond"];function Nf(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new pc(e);return t}function Lf(e,t){const n=sn(t.zone,qe.defaultZone),r=Re.fromObject(t),i=qe.now();let o,s;if(xe(e.year))o=i;else{for(const u of Mf)xe(e[u])&&(e[u]=Df[u]);const a=xf(e)||Ef(e);if(a)return pe.invalid(a);const l=n.offset(i);[o,s]=_i(e,l,n)}return new pe({ts:o,zone:n,loc:r,o:s})}function _f(e,t,n){const r=xe(n.round)?!0:n.round,i=(s,a)=>(s=ms(s,r||n.calendary?0:2,!0),t.loc.clone(n).relFormatter(n).format(s,a)),o=s=>n.calendary?t.hasSame(e,s)?0:t.startOf(s).diff(e.startOf(s),s).get(s):t.diff(e,s).get(s);if(n.unit)return i(o(n.unit),n.unit);for(const s of n.units){const a=o(s);if(Math.abs(a)>=1)return i(a,s)}return i(e>t?-0:0,n.units[n.units.length-1])}function Pf(e){let t={},n;return e.length>0&&typeof e[e.length-1]=="object"?(t=e[e.length-1],n=Array.from(e).slice(0,e.length-1)):n=Array.from(e),[t,n]}class pe{constructor(t){const n=t.zone||qe.defaultZone;let r=t.invalid||(Number.isNaN(t.ts)?new It("invalid input"):null)||(n.isValid?null:Li(n));this.ts=xe(t.ts)?qe.now():t.ts;let i=null,o=null;if(!r)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(n))[i,o]=[t.old.c,t.old.o];else{const a=n.offset(this.ts);i=Tf(this.ts,a),r=Number.isNaN(i.year)?new It("invalid input"):null,i=r?null:i,o=r?null:a}this._zone=n,this.loc=t.loc||Re.create(),this.invalid=r,this.weekData=null,this.c=i,this.o=o,this.isLuxonDateTime=!0}static now(){return new pe({})}static local(){const[t,n]=Pf(arguments),[r,i,o,s,a,l,u]=n;return Lf({year:r,month:i,day:o,hour:s,minute:a,second:l,millisecond:u},t)}static utc(){const[t,n]=Pf(arguments),[r,i,o,s,a,l,u]=n;return t.zone=ot.utcInstance,Lf({year:r,month:i,day:o,hour:s,minute:a,second:l,millisecond:u},t)}static fromJSDate(t,n={}){const r=$b(t)?t.valueOf():NaN;if(Number.isNaN(r))return pe.invalid("invalid input");const i=sn(n.zone,qe.defaultZone);return i.isValid?new pe({ts:r,zone:i,loc:Re.fromObject(n)}):pe.invalid(Li(i))}static fromMillis(t,n={}){if(Sn(t))return t<-Cf||t>Cf?pe.invalid("Timestamp out of range"):new pe({ts:t,zone:sn(n.zone,qe.defaultZone),loc:Re.fromObject(n)});throw new bt(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,n={}){if(Sn(t))return new pe({ts:t*1e3,zone:sn(n.zone,qe.defaultZone),loc:Re.fromObject(n)});throw new bt("fromSeconds requires a numerical input")}static fromObject(t,n={}){t=t||{};const r=sn(n.zone,qe.defaultZone);if(!r.isValid)return pe.invalid(Li(r));const i=qe.now(),o=xe(n.specificOffset)?r.offset(i):n.specificOffset,s=Ti(t,Nf),a=!xe(s.ordinal),l=!xe(s.year),u=!xe(s.month)||!xe(s.day),f=l||u,c=s.weekYear||s.weekNumber,h=Re.fromObject(n);if((f||a)&&c)throw new Cr("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&a)throw new Cr("Can't mix ordinal dates with month/day");const d=c||s.weekday&&!f;let m,p,g=Tf(i,o);d?(m=O0,p=T0,g=Ms(g)):a?(m=D0,p=I0,g=Ns(g)):(m=Mf,p=Df);let v=!1;for(const M of m){const L=s[M];xe(L)?v?s[M]=p[M]:s[M]=g[M]:v=!0}const y=d?C0(s):a?A0(s):xf(s),w=y||Ef(s);if(w)return pe.invalid(w);const A=d?Sf(s):a?kf(s):s,[k,E]=_i(A,o,r),I=new pe({ts:k,zone:r,o:E,loc:h});return s.weekday&&f&&t.weekday!==I.weekday?pe.invalid("mismatched weekday",`you can't specify both a weekday of ${s.weekday} and a date of ${I.toISO()}`):I}static fromISO(t,n={}){const[r,i]=Ww(t);return Pr(r,i,n,"ISO 8601",t)}static fromRFC2822(t,n={}){const[r,i]=qw(t);return Pr(r,i,n,"RFC 2822",t)}static fromHTTP(t,n={}){const[r,i]=Yw(t);return Pr(r,i,n,"HTTP",n)}static fromFormat(t,n,r={}){if(xe(t)||xe(n))throw new bt("fromFormat requires an input string and a format");const{locale:i=null,numberingSystem:o=null}=r,s=Re.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0}),[a,l,u,f]=E0(s,t,n);return f?pe.invalid(f):Pr(a,l,r,`format ${n}`,t,u)}static fromString(t,n,r={}){return pe.fromFormat(t,n,r)}static fromSQL(t,n={}){const[r,i]=e0(t);return Pr(r,i,n,"SQL",t)}static invalid(t,n=null){if(!t)throw new bt("need to specify a reason the DateTime is invalid");const r=t instanceof It?t:new It(t,n);if(qe.throwOnInvalid)throw new Lb(r);return new pe({invalid:r})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?_s(this).weekYear:NaN}get weekNumber(){return this.isValid?_s(this).weekNumber:NaN}get weekday(){return this.isValid?_s(this).weekday:NaN}get ordinal(){return this.isValid?Ns(this.c).ordinal:NaN}get monthShort(){return this.isValid?Ni.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Ni.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Ni.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Ni.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}get isInLeapYear(){return Ar(this.year)}get daysInMonth(){return Ei(this.year,this.month)}get daysInYear(){return this.isValid?Tr(this.year):NaN}get weeksInWeekYear(){return this.isValid?Ci(this.weekYear):NaN}resolvedLocaleOptions(t={}){const{locale:n,numberingSystem:r,calendar:i}=ut.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:i}}toUTC(t=0,n={}){return this.setZone(ot.instance(t),n)}toLocal(){return this.setZone(qe.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(t=sn(t,qe.defaultZone),t.equals(this.zone))return this;if(t.isValid){let i=this.ts;if(n||r){const o=t.offset(this.ts),s=this.toObject();[i]=_i(s,o,t)}return _r(this,{ts:i,zone:t})}else return pe.invalid(Li(t))}reconfigure({locale:t,numberingSystem:n,outputCalendar:r}={}){const i=this.loc.clone({locale:t,numberingSystem:n,outputCalendar:r});return _r(this,{loc:i})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const n=Ti(t,Nf),r=!xe(n.weekYear)||!xe(n.weekNumber)||!xe(n.weekday),i=!xe(n.ordinal),o=!xe(n.year),s=!xe(n.month)||!xe(n.day),a=o||s,l=n.weekYear||n.weekNumber;if((a||i)&&l)throw new Cr("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(s&&i)throw new Cr("Can't mix ordinal dates with month/day");let u;r?u=Sf({...Ms(this.c),...n}):xe(n.ordinal)?(u={...this.toObject(),...n},xe(n.day)&&(u.day=Math.min(Ei(u.year,u.month),u.day))):u=kf({...Ns(this.c),...n});const[f,c]=_i(u,this.o,this.zone);return _r(this,{ts:f,o:c})}plus(t){if(!this.isValid)return this;const n=Ce.fromDurationLike(t);return _r(this,If(this,n))}minus(t){if(!this.isValid)return this;const n=Ce.fromDurationLike(t).negate();return _r(this,If(this,n))}startOf(t){if(!this.isValid)return this;const n={},r=Ce.normalizeUnit(t);switch(r){case"years":n.month=1;case"quarters":case"months":n.day=1;case"weeks":case"days":n.hour=0;case"hours":n.minute=0;case"minutes":n.second=0;case"seconds":n.millisecond=0;break}if(r==="weeks"&&(n.weekday=1),r==="quarters"){const i=Math.ceil(this.month/3);n.month=(i-1)*3+1}return this.set(n)}endOf(t){return this.isValid?this.plus({[t]:1}).startOf(t).minus(1):this}toFormat(t,n={}){return this.isValid?ut.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,t):Ls}toLocaleString(t=hs,n={}){return this.isValid?ut.create(this.loc.clone(n),t).formatDateTime(this):Ls}toLocaleParts(t={}){return this.isValid?ut.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:n=!1,suppressMilliseconds:r=!1,includeOffset:i=!0,extendedZone:o=!1}={}){if(!this.isValid)return null;const s=t==="extended";let a=Ps(this,s);return a+="T",a+=Of(this,s,n,r,i,o),a}toISODate({format:t="extended"}={}){return this.isValid?Ps(this,t==="extended"):null}toISOWeekDate(){return Pi(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:n=!1,includeOffset:r=!0,includePrefix:i=!1,extendedZone:o=!1,format:s="extended"}={}){return this.isValid?(i?"T":"")+Of(this,s==="extended",n,t,r,o):null}toRFC2822(){return Pi(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Pi(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?Ps(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:n=!1,includeOffsetSpace:r=!0}={}){let i="HH:mm:ss.SSS";return(n||t)&&(r&&(i+=" "),n?i+="z":t&&(i+="ZZ")),Pi(this,i,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():Ls}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const n={...this.c};return t.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,n="milliseconds",r={}){if(!this.isValid||!t.isValid)return Ce.invalid("created by diffing an invalid DateTime");const i={locale:this.locale,numberingSystem:this.numberingSystem,...r},o=zb(n).map(Ce.normalizeUnit),s=t.valueOf()>this.valueOf(),a=s?this:t,l=s?t:this,u=u0(a,l,o,i);return s?u.negate():u}diffNow(t="milliseconds",n={}){return this.diff(pe.now(),t,n)}until(t){return this.isValid?ze.fromDateTimes(this,t):this}hasSame(t,n){if(!this.isValid)return!1;const r=t.valueOf(),i=this.setZone(t.zone,{keepLocalTime:!0});return i.startOf(n)<=r&&r<=i.endOf(n)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const n=t.base||pe.fromObject({},{zone:this.zone}),r=t.padding?this<n?-t.padding:t.padding:0;let i=["years","months","days","hours","minutes","seconds"],o=t.unit;return Array.isArray(t.unit)&&(i=t.unit,o=void 0),_f(n,this.plus(r),{...t,numeric:"always",units:i,unit:o})}toRelativeCalendar(t={}){return this.isValid?_f(t.base||pe.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(pe.isDateTime))throw new bt("min requires all arguments be DateTimes");return Pc(t,n=>n.valueOf(),Math.min)}static max(...t){if(!t.every(pe.isDateTime))throw new bt("max requires all arguments be DateTimes");return Pc(t,n=>n.valueOf(),Math.max)}static fromFormatExplain(t,n,r={}){const{locale:i=null,numberingSystem:o=null}=r,s=Re.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0});return mf(s,t,n)}static fromStringExplain(t,n,r={}){return pe.fromFormatExplain(t,n,r)}static get DATE_SHORT(){return hs}static get DATE_MED(){return mc}static get DATE_MED_WITH_WEEKDAY(){return Fb}static get DATE_FULL(){return gc}static get DATE_HUGE(){return yc}static get TIME_SIMPLE(){return vc}static get TIME_WITH_SECONDS(){return bc}static get TIME_WITH_SHORT_OFFSET(){return wc}static get TIME_WITH_LONG_OFFSET(){return Sc}static get TIME_24_SIMPLE(){return kc}static get TIME_24_WITH_SECONDS(){return xc}static get TIME_24_WITH_SHORT_OFFSET(){return Ec}static get TIME_24_WITH_LONG_OFFSET(){return Cc}static get DATETIME_SHORT(){return Ac}static get DATETIME_SHORT_WITH_SECONDS(){return Tc}static get DATETIME_MED(){return Ic}static get DATETIME_MED_WITH_SECONDS(){return Oc}static get DATETIME_MED_WITH_WEEKDAY(){return Rb}static get DATETIME_FULL(){return Dc}static get DATETIME_FULL_WITH_SECONDS(){return Mc}static get DATETIME_HUGE(){return Nc}static get DATETIME_HUGE_WITH_SECONDS(){return Lc}}function Fr(e){if(pe.isDateTime(e))return e;if(e&&e.valueOf&&Sn(e.valueOf()))return pe.fromJSDate(e);if(e&&typeof e=="object")return pe.fromObject(e);throw new bt(`Unknown datetime argument: ${e}, of type ${typeof e}`)}function M0(e){const t=typeof e=="string"?pe.fromISO(e):pe.fromJSDate(e);if(!t.isValid)return"Invalid date";const r=pe.now().diff(t,["years","months","days","hours","minutes"]).toObject();return r.years&&r.years>=1?`${Math.floor(r.years)} year${Math.floor(r.years)>1?"s":""} ago`:r.months&&r.months>=1?`${Math.floor(r.months)} month${Math.floor(r.months)>1?"s":""} ago`:r.days&&r.days>=1?`${Math.floor(r.days)} day${Math.floor(r.days)>1?"s":""} ago`:r.hours&&r.hours>=1?`${Math.floor(r.hours)}h ago`:r.minutes&&r.minutes>=1?`${Math.floor(r.minutes)}m ago`:"just now"}function Fs(e){if(!/^#?([a-fA-F\d]{6}|[a-fA-F\d]{3})$/.test(e))return{r:0,g:0,b:0};const n=e.replace(/^#/,"");let r=n;n.length===3&&(r=n.split("").map(l=>l+l).join(""));const i=parseInt(r,16),o=i>>16&255,s=i>>8&255,a=i&255;return{r:o,g:s,b:a}}function N0(e){return`#${((1<<24)+(e.r<<16)+(e.g<<8)+e.b).toString(16).slice(1)}`}const L0=(e,t=30)=>{const n=Math.min(e.r,e.g,e.b),r=Math.max(e.r,e.g,e.b,n+1);return{r:Math.floor((e.r-n)/(r-n)*t*(1-.299)+120-t/2),g:Math.floor((e.g-n)/(r-n)*t*(1-.587)+120-t/2),b:Math.floor((e.b-n)/(r-n)*t*(1-.114)+120-t/2)}};function Ff(e){return Object.entries(e).reduce((t,[n,r])=>{const i=n.replace(/(\d+)/,o=>(1e3-parseInt(o)).toString());return{...t,[i]:r}},{})}const _0=2.4,P0=.2126729,F0=.7151522,R0=.072175,B0=.56,$0=.57,z0=.62,H0=.65,Fi=.022,Rf=1.414,U0=1.14,j0=1.14,V0=.035991,W0=27.7847239587675,q0=27.7847239587675,Bf=.027,$f=.027,zf=.001,Y0=5e-4;function Hf(e){const{r:t,g:n,b:r}=e,i=o=>(o/255)**_0;return P0*i(t)+F0*i(n)+R0*i(r)}function Uf(e,t){if(!e||!t)return 0;let n=Hf(Fs(e)),r=Hf(Fs(t)),i=0,o=0;return n=n>Fi?n:n+(Fi-n)**Rf,r=r>Fi?r:r+(Fi-r)**Rf,Math.abs(r-n)<Y0?0:(r>n?(i=(r**B0-n**$0)*U0,o=i<zf?0:i<V0?i-i*W0*Bf:i-Bf):(i=(r**H0-n**z0)*j0,o=i>-zf?0:i>-.035991?i-i*q0*$f:i+$f),Math.abs(o*100))}const K0=(e,t,n)=>{const r=e;let i=0;for(;t.some(o=>n(o)===e);)i+=1,e=`${r} (${i})`;return e};function jf(e){const{fontFamily:t,...n}=e,r=Vf(n);return Qu(".bpReset",{...r,"font-family":`'${t}', sans-serif`})+Qu(":host, :root",{...r})}function Vf(e){const{radius:t,themeMode:n,color:r,variant:i,headerVariant:o}=e;let s={},a={};if(r){const h=dc(r),d=n==="dark"?Ff(h):h,m=dc(N0(L0(Fs(r)))),p=n==="dark"?Ff(m):m,g=n==="dark"?"#101010":"#fdfdfd";a=Object.entries({...d,1:g}).reduce((y,[w,A])=>({...y,[`--bpPrimary-${w}`]:A}),{});const v=Object.entries({...p,1:g}).reduce((y,[w,A])=>({...y,[`--bpGray-${w}`]:A}),{});s={...a,...v}}t&&(s={...s,"--bpRadius-scale":t.toString()});const l=n==="dark"?{bg:"var(--transparent-dark)",bgHover:"var(--transparent-dark-hover)"}:{bg:"var(--transparent-light)",bgHover:"var(--transparent-light-hover)"},u=a?Uf(a["--bpPrimary-600"],a["--bpPrimary-50"])>40?"var(--bpPrimary-50)":"var(--bpPrimary-900)":"var(--bpPrimary-50)",f=i==="solid"?{"--message-bg":"var(--bpPrimary-600)","--message-bg-hover":"var(--bpPrimary-700)","--message-text":u,"--send-button-bg":"var(--bpPrimary-600)","--send-button-bg-hover":"var(--bpPrimary-700)","--send-button-text":"var(--bpPrimary-50)","--button-bg":"var(--bpPrimary-200)","--button-bg-hover":"var(--bpPrimary-300)","--button-text":"var(--bpPrimary-800)","--fab-bg":"var(--bpPrimary-600)","--fab-bg-hover":"var(--bpPrimary-700)","--fab-icon":u,"--modal-submit-bg":"var(--bpPrimary-600)","--modal-submit-bg-hover":"var(--bpPrimary-700)"}:{"--message-bg":"var(--bpPrimary-100)","--message-bg-hover":"var(--bpPrimary-200)","--message-text":"var(--bpPrimary-900)","--send-button-bg":"var(--bpPrimary-600)","--send-button-bg-hover":"var(--bpPrimary-700)","--send-button-text":"var(--bpPrimary-50)","--button-bg":"var(--bpPrimary-500)","--button-bg-hover":"var(--bpPrimary-600)","--button-text":a?Uf(a["--bpPrimary-500"],a["--bpPrimary-50"])>40?"var(--bpPrimary-50)":"var(--bpPrimary-900)":"var(--bpPrimary-50)","--fab-bg":"var(--bpPrimary-100)","--fab-bg-hover":"var(--bpPrimary-200)","--fab-icon":"var(--bpPrimary-700)","--scrollbar":"var(--bpGray-500)","--scrollbar-hover":"var(--bpGray-400)","--modal-submit-bg":"var(--bpPrimary-200)","--modal-submit-bg-hover":"var(--bpPrimary-300)"},c=o==="solid"?{"--header-bg":"var(--bpPrimary-600)","--header-bg-hover":"var(--bpPrimary-700)","--header-hover-dark":"var(--bpPrimary-800)","--header-title":u,"--header-description":u,"--header-description-icon":u,"--header-description-link":u,"--header-avatar-bg":"var(--bpPrimary-300)","--header-avatar-text":"var(--bpPrimary-700)"}:{"--header-bg":l.bg,"--header-bg-hover":l.bgHover,"--header-hover-dark":"var(--bpGray-200)","--header-title":"var(--bpGray-900)","--header-description":"var(--bpGray-600)","--header-description-icon":"var(--bpPrimary-700)","--header-description-link":"var(--bpPrimary-800)","--header-avatar-bg":"var(--bpPrimary-600)","--header-avatar-text":"var(--bpPrimary-50)"};return{...s,...f,...c}}const G0=e=>{if(typeof URL.canParse=="function")return URL.canParse(e);try{return new URL(e),!0}catch{return!1}},Wf=["audio","file","image","video"],qf=e=>Wf.includes(e),Yf="The Client ID is required to initialize the webchat.",Q0="The API url is required to initialize the webchat.",Z0="The Bot ID is required to initialize the webchat.",J0="No config URL provided.",Kf=`Invalid API URL.
17
+ */var Wu;function hb(){return Wu||(Wu=1,process.env.NODE_ENV!=="production"&&function(){function e(d,m){return d===m&&(d!==0||1/d===1/m)||d!==d&&m!==m}function t(d,m){f||i.startTransition===void 0||(f=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var p=m();if(!c){var g=m();o(p,g)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}g=s({inst:{value:p,getSnapshot:m}});var y=g[0].inst,v=g[1];return l(function(){y.value=p,y.getSnapshot=m,n(y)&&v({inst:y})},[d,p,m]),a(function(){return n(y)&&v({inst:y}),d(function(){n(y)&&v({inst:y})})},[d]),u(p),p}function n(d){var m=d.getSnapshot;d=d.value;try{var p=m();return!o(d,p)}catch{return!0}}function r(d,m){return m()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var i=D,o=typeof Object.is=="function"?Object.is:e,s=i.useState,a=i.useEffect,l=i.useLayoutEffect,u=i.useDebugValue,f=!1,c=!1,h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;as.useSyncExternalStore=i.useSyncExternalStore!==void 0?i.useSyncExternalStore:h,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),as}process.env.NODE_ENV==="production"?os.exports=db():os.exports=hb();var ls=os.exports;function pb(){return ls.useSyncExternalStore(mb,()=>!0,()=>!1)}function mb(){return()=>{}}var us="Avatar",[gb]=tb(us),[yb,qu]=gb(us),cs=C.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,o]=C.useState("idle");return x.jsx(yb,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:o,children:x.jsx(is.span,{...r,ref:t})})});cs.displayName=us;var Yu="AvatarImage",fs=C.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...o}=e,s=qu(Yu,n),a=vb(r,o),l=Fn(u=>{i(u),s.onImageLoadingStatusChange(u)});return tn(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?x.jsx(is.img,{...o,ref:t,src:r}):null});fs.displayName=Yu;var Ku="AvatarFallback",ds=C.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,o=qu(Ku,n),[s,a]=C.useState(r===void 0);return C.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(l)}},[r]),s&&o.imageLoadingStatus!=="loaded"?x.jsx(is.span,{...i,ref:t}):null});ds.displayName=Ku;function Gu(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function vb(e,{referrerPolicy:t,crossOrigin:n}){const r=pb(),i=C.useRef(null),o=r?(i.current||(i.current=new window.Image),i.current):null,[s,a]=C.useState(()=>Gu(o,e));return tn(()=>{a(Gu(o,e))},[o,e]),tn(()=>{const l=c=>()=>{a(c)};if(!o)return;const u=l("loaded"),f=l("error");return o.addEventListener("load",u),o.addEventListener("error",f),t&&(o.referrerPolicy=t),typeof n=="string"&&(o.crossOrigin=n),()=>{o.removeEventListener("load",u),o.removeEventListener("error",f)}},[o,n,t]),s}function Qu(e,t){let n=`${e} {`;for(const[r,i]of Object.entries(t))n+=`${r}: ${i}; `;return n+="}",n}function Zu(e,t){let n=0;if(e.length==0)return n;for(let r=0;r<e.length;r++){const i=e.charCodeAt(r);n=(n<<5)-n+i,n=n&n}return Math.abs(n)%t}const bb=(e,t={})=>new Promise((n,r)=>{if(typeof window>"u")return r("Window is not defined");if(!e)return r("Url is not defined");let i=null;const o=new Image;o.addEventListener("load",()=>{i&&clearTimeout(i),n({width:o.naturalWidth,height:o.naturalHeight})}),o.addEventListener("error",s=>{i&&clearTimeout(i),r(`${s.type}: ${s.message}`)}),o.src=e,t.timeout&&(i=setTimeout(()=>r("Timeout"),t.timeout))});var Ju={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(vn,function(){var n=1e3,r=6e4,i=36e5,o="millisecond",s="second",a="minute",l="hour",u="day",f="week",c="month",h="quarter",d="year",m="date",p="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(L){var _=["th","st","nd","rd"],B=L%100;return"["+L+(_[(B-20)%10]||_[B]||_[0])+"]"}},w=function(L,_,B){var z=String(L);return!z||z.length>=_?L:""+Array(_+1-z.length).join(B)+L},A={s:w,z:function(L){var _=-L.utcOffset(),B=Math.abs(_),z=Math.floor(B/60),H=B%60;return(_<=0?"+":"-")+w(z,2,"0")+":"+w(H,2,"0")},m:function L(_,B){if(_.date()<B.date())return-L(B,_);var z=12*(B.year()-_.year())+(B.month()-_.month()),H=_.clone().add(z,c),W=B-H<0,b=_.clone().add(z+(W?-1:1),c);return+(-(z+(B-H)/(W?H-b:b-H))||0)},a:function(L){return L<0?Math.ceil(L)||0:Math.floor(L)},p:function(L){return{M:c,y:d,w:f,d:u,D:m,h:l,m:a,s,ms:o,Q:h}[L]||String(L||"").toLowerCase().replace(/s$/,"")},u:function(L){return L===void 0}},k="en",E={};E[k]=v;var I="$isDayjsObject",M=function(L){return L instanceof j||!(!L||!L[I])},P=function L(_,B,z){var H;if(!_)return k;if(typeof _=="string"){var W=_.toLowerCase();E[W]&&(H=W),B&&(E[W]=B,H=W);var b=_.split("-");if(!H&&b.length>1)return L(b[0])}else{var N=_.name;E[N]=_,H=N}return!z&&H&&(k=H),H||!z&&k},T=function(L,_){if(M(L))return L.clone();var B=typeof _=="object"?_:{};return B.date=L,B.args=arguments,new j(B)},O=A;O.l=P,O.i=M,O.w=function(L,_){return T(L,{locale:_.$L,utc:_.$u,x:_.$x,$offset:_.$offset})};var j=function(){function L(B){this.$L=P(B.locale,null,!0),this.parse(B),this.$x=this.$x||B.x||{},this[I]=!0}var _=L.prototype;return _.parse=function(B){this.$d=function(z){var H=z.date,W=z.utc;if(H===null)return new Date(NaN);if(O.u(H))return new Date;if(H instanceof Date)return new Date(H);if(typeof H=="string"&&!/Z$/i.test(H)){var b=H.match(g);if(b){var N=b[2]-1||0,R=(b[7]||"0").substring(0,3);return W?new Date(Date.UTC(b[1],N,b[3]||1,b[4]||0,b[5]||0,b[6]||0,R)):new Date(b[1],N,b[3]||1,b[4]||0,b[5]||0,b[6]||0,R)}}return new Date(H)}(B),this.init()},_.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()},_.$utils=function(){return O},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(B,z){var H=T(B);return this.startOf(z)<=H&&H<=this.endOf(z)},_.isAfter=function(B,z){return T(B)<this.startOf(z)},_.isBefore=function(B,z){return this.endOf(z)<T(B)},_.$g=function(B,z,H){return O.u(B)?this[z]:this.set(H,B)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(B,z){var H=this,W=!!O.u(z)||z,b=O.p(B),N=function(se,Y){var re=O.w(H.$u?Date.UTC(H.$y,Y,se):new Date(H.$y,Y,se),H);return W?re:re.endOf(u)},R=function(se,Y){return O.w(H.toDate()[se].apply(H.toDate("s"),(W?[0,0,0,0]:[23,59,59,999]).slice(Y)),H)},S=this.$W,V=this.$M,ee=this.$D,K="set"+(this.$u?"UTC":"");switch(b){case d:return W?N(1,0):N(31,11);case c:return W?N(1,V):N(0,V+1);case f:var Q=this.$locale().weekStart||0,X=(S<Q?S+7:S)-Q;return N(W?ee-X:ee+(6-X),V);case u:case m:return R(K+"Hours",0);case l:return R(K+"Minutes",1);case a:return R(K+"Seconds",2);case s:return R(K+"Milliseconds",3);default:return this.clone()}},_.endOf=function(B){return this.startOf(B,!1)},_.$set=function(B,z){var H,W=O.p(B),b="set"+(this.$u?"UTC":""),N=(H={},H[u]=b+"Date",H[m]=b+"Date",H[c]=b+"Month",H[d]=b+"FullYear",H[l]=b+"Hours",H[a]=b+"Minutes",H[s]=b+"Seconds",H[o]=b+"Milliseconds",H)[W],R=W===u?this.$D+(z-this.$W):z;if(W===c||W===d){var S=this.clone().set(m,1);S.$d[N](R),S.init(),this.$d=S.set(m,Math.min(this.$D,S.daysInMonth())).$d}else N&&this.$d[N](R);return this.init(),this},_.set=function(B,z){return this.clone().$set(B,z)},_.get=function(B){return this[O.p(B)]()},_.add=function(B,z){var H,W=this;B=Number(B);var b=O.p(z),N=function(V){var ee=T(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 N(1);if(b===f)return N(7);var R=(H={},H[a]=r,H[l]=i,H[s]=n,H)[b]||1,S=this.$d.getTime()+B*R;return O.w(S,this)},_.subtract=function(B,z){return this.add(-1*B,z)},_.format=function(B){var z=this,H=this.$locale();if(!this.isValid())return H.invalidDate||p;var W=B||"YYYY-MM-DDTHH:mm:ssZ",b=O.z(this),N=this.$H,R=this.$m,S=this.$M,V=H.weekdays,ee=H.months,K=H.meridiem,Q=function(Y,re,$,ne){return Y&&(Y[re]||Y(z,W))||$[re].slice(0,ne)},X=function(Y){return O.s(N%12||12,Y,"0")},se=K||function(Y,re,$){var ne=Y<12?"AM":"PM";return $?ne.toLowerCase():ne};return W.replace(y,function(Y,re){return re||function($){switch($){case"YY":return String(z.$y).slice(-2);case"YYYY":return O.s(z.$y,4,"0");case"M":return S+1;case"MM":return O.s(S+1,2,"0");case"MMM":return Q(H.monthsShort,S,ee,3);case"MMMM":return Q(ee,S);case"D":return z.$D;case"DD":return O.s(z.$D,2,"0");case"d":return String(z.$W);case"dd":return Q(H.weekdaysMin,z.$W,V,2);case"ddd":return Q(H.weekdaysShort,z.$W,V,3);case"dddd":return V[z.$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 se(N,R,!0);case"A":return se(N,R,!1);case"m":return String(R);case"mm":return O.s(R,2,"0");case"s":return String(z.$s);case"ss":return O.s(z.$s,2,"0");case"SSS":return O.s(z.$ms,3,"0");case"Z":return b}return null}(Y)||b.replace(":","")})},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(B,z,H){var W,b=this,N=O.p(z),R=T(B),S=(R.utcOffset()-this.utcOffset())*r,V=this-R,ee=function(){return O.m(b,R)};switch(N){case d:W=ee()/12;break;case c:W=ee();break;case h:W=ee()/3;break;case f:W=(V-S)/6048e5;break;case u:W=(V-S)/864e5;break;case l:W=V/i;break;case a:W=V/r;break;case s:W=V/n;break;default:W=V}return H?W:O.a(W)},_.daysInMonth=function(){return this.endOf(c).$D},_.$locale=function(){return E[this.$L]},_.locale=function(B,z){if(!B)return this.$L;var H=this.clone(),W=P(B,z,!0);return W&&(H.$L=W),H},_.clone=function(){return O.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},L}(),F=j.prototype;return T.prototype=F,[["$ms",o],["$s",s],["$m",a],["$H",l],["$W",u],["$M",c],["$y",d],["$D",m]].forEach(function(L){F[L[1]]=function(_){return this.$g(_,L[0],L[1])}}),T.extend=function(L,_){return L.$i||(L(_,j,T),L.$i=!0),T},T.locale=P,T.isDayjs=M,T.unix=function(L){return T(1e3*L)},T.en=E[k],T.Ls=E,T.p={},T})})(Ju);var wb=Ju.exports;const kr=bn(wb);var Xu={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(vn,function(){return function(n,r,i){r.prototype.isToday=function(){var o="YYYY-MM-DD",s=i();return this.format(o)===s.format(o)}}})})(Xu);var Sb=Xu.exports;const kb=bn(Sb);var ec={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(vn,function(){return function(n,r,i){r.prototype.isYesterday=function(){var o="YYYY-MM-DD",s=i().subtract(1,"day");return this.format(o)===s.format(o)}}})})(ec);var xb=ec.exports;const Eb=bn(xb),tc={"composer.placeholder":"Écrivez votre message...","composer.sendButton.ariaLabel":"Bouton Envoyer le message","composer.voiceButton.ariaLabel":"Bouton Saisie vocale","composer.fileButton.ariaLabel":"Bouton Téléverser un fichier","composer.messageInput.ariaLabel":"Saisie du message","fileAttachment.uploadError":"Erreur de téléversement","fileAttachment.fallbackExtension":"Fichier","fileAttachment.removeButton.ariaLabel":"Bouton Supprimer le fichier","header.defaultBotName":"Bot","header.expandButton.ariaLabel":"Bouton Développer l'en-tête","header.sound.enable":"Activer les sons du chat","header.sound.disable":"Désactiver les sons du chat","conversationHistory.title":"Conversations","conversationHistory.empty":"Aucune conversation commencée","conversationHistory.newConversation":"Nouvelle conversation","conversationHistory.sentAttachment":"A envoyé une pièce jointe","conversationHistory.showButton.ariaLabel":"Bouton Afficher les conversations récentes","restartConversation.title":"Créer une nouvelle conversation","restartConversation.description":"Cela effacera la conversation en cours et en démarrera une nouvelle.","restartConversation.confirm":"Nouvelle conversation","restartConversation.cancel":"Annuler","restartConversation.button.ariaLabel":"Bouton Redémarrer la conversation","closeButton.ariaLabel":"Bouton Fermer le chatbot","feedback.title":"Aidez-nous à nous améliorer","feedback.description":"Veuillez nous faire part de vos commentaires pour nous aider à nous améliorer.","feedback.confirm":"Envoyer le commentaire","feedback.cancel":"Annuler","feedback.placeholder":"Dites-nous ce qui n'a pas fonctionné...","error.configuration":"Erreur de configuration","error.bot":"Erreur du bot","error.network":"Erreur réseau","error.disconnected":"Déconnecté","error.unexpected":"Erreur inattendue","dropdown.placeholder":"Sélectionner...","message.status.delivered":"Distribué","date.today":"Aujourd'hui","date.yesterday":"Hier"},nc={"composer.placeholder":"Escribe tu mensaje...","composer.sendButton.ariaLabel":"Botón Enviar mensaje","composer.voiceButton.ariaLabel":"Botón Entrada de voz","composer.fileButton.ariaLabel":"Botón Subir archivo","composer.messageInput.ariaLabel":"Entrada de mensaje","fileAttachment.uploadError":"Error de carga","fileAttachment.fallbackExtension":"Archivo","fileAttachment.removeButton.ariaLabel":"Botón Eliminar archivo","header.defaultBotName":"Bot","header.expandButton.ariaLabel":"Botón Expandir encabezado","header.sound.enable":"Activar sonidos del chat","header.sound.disable":"Desactivar sonidos del chat","conversationHistory.title":"Conversaciones","conversationHistory.empty":"Aún no se ha iniciado ninguna conversación","conversationHistory.newConversation":"Nueva conversación","conversationHistory.sentAttachment":"Envió un archivo adjunto","conversationHistory.showButton.ariaLabel":"Botón Mostrar conversaciones recientes","restartConversation.title":"Crear nueva conversación","restartConversation.description":"Esto borrará la conversación actual y comenzará una nueva.","restartConversation.confirm":"Nueva conversación","restartConversation.cancel":"Cancelar","restartConversation.button.ariaLabel":"Botón Reiniciar conversación","closeButton.ariaLabel":"Botón Cerrar chatbot","feedback.title":"Ayúdanos a mejorar","feedback.description":"Por favor, envíanos tus comentarios para ayudarnos a mejorar.","feedback.confirm":"Enviar comentario","feedback.cancel":"Cancelar","feedback.placeholder":"Cuéntanos qué salió mal...","error.configuration":"Error de configuración","error.bot":"Error del bot","error.network":"Error de red","error.disconnected":"Desconectado","error.unexpected":"Error inesperado","dropdown.placeholder":"Seleccionar...","message.status.delivered":"Entregado","date.today":"Hoy","date.yesterday":"Ayer"},rc={"composer.placeholder":"Digite sua mensagem...","composer.sendButton.ariaLabel":"Botão Enviar mensagem","composer.voiceButton.ariaLabel":"Botão Entrada de voz","composer.fileButton.ariaLabel":"Botão Enviar arquivo","composer.messageInput.ariaLabel":"Entrada de mensagem","fileAttachment.uploadError":"Erro no envio","fileAttachment.fallbackExtension":"Arquivo","fileAttachment.removeButton.ariaLabel":"Botão Remover arquivo","header.defaultBotName":"Bot","header.expandButton.ariaLabel":"Botão Expandir cabeçalho","header.sound.enable":"Ativar sons do chat","header.sound.disable":"Desativar sons do chat","conversationHistory.title":"Conversas","conversationHistory.empty":"Nenhuma conversa iniciada ainda","conversationHistory.newConversation":"Nova conversa","conversationHistory.sentAttachment":"Enviou um anexo","conversationHistory.showButton.ariaLabel":"Botão Mostrar conversas recentes","restartConversation.title":"Criar nova conversa","restartConversation.description":"Isso apagará a conversa atual e iniciará uma nova.","restartConversation.confirm":"Nova conversa","restartConversation.cancel":"Cancelar","restartConversation.button.ariaLabel":"Botão Reiniciar conversa","closeButton.ariaLabel":"Botão Fechar chatbot","feedback.title":"Ajude-nos a melhorar","feedback.description":"Por favor, envie seu feedback para nos ajudar a melhorar.","feedback.confirm":"Enviar feedback","feedback.cancel":"Cancelar","feedback.placeholder":"Conte-nos o que deu errado...","error.configuration":"Erro de configuração","error.bot":"Erro do bot","error.network":"Erro de rede","error.disconnected":"Desconectado","error.unexpected":"Erro inesperado","dropdown.placeholder":"Selecionar...","message.status.delivered":"Entregue","date.today":"Hoje","date.yesterday":"Ontem"},ic={"composer.placeholder":"Nachricht eingeben...","composer.sendButton.ariaLabel":"Schaltfläche Nachricht senden","composer.voiceButton.ariaLabel":"Schaltfläche Spracheingabe","composer.fileButton.ariaLabel":"Schaltfläche Datei hochladen","composer.messageInput.ariaLabel":"Nachrichteneingabe","fileAttachment.uploadError":"Fehler beim Hochladen","fileAttachment.fallbackExtension":"Datei","fileAttachment.removeButton.ariaLabel":"Schaltfläche Datei entfernen","header.defaultBotName":"Bot","header.expandButton.ariaLabel":"Schaltfläche Kopfzeile erweitern","header.sound.enable":"Chat-Töne aktivieren","header.sound.disable":"Chat-Töne deaktivieren","conversationHistory.title":"Unterhaltungen","conversationHistory.empty":"Noch keine Unterhaltung begonnen","conversationHistory.newConversation":"Neue Unterhaltung","conversationHistory.sentAttachment":"Anhang gesendet","conversationHistory.showButton.ariaLabel":"Schaltfläche Letzte Unterhaltungen anzeigen","restartConversation.title":"Neue Unterhaltung erstellen","restartConversation.description":"Dies löscht die aktuelle Unterhaltung und startet eine neue.","restartConversation.confirm":"Neue Unterhaltung","restartConversation.cancel":"Abbrechen","restartConversation.button.ariaLabel":"Schaltfläche Unterhaltung neu starten","closeButton.ariaLabel":"Schaltfläche Chatbot schließen","feedback.title":"Helfen Sie uns, besser zu werden","feedback.description":"Bitte geben Sie uns Feedback, damit wir uns verbessern können.","feedback.confirm":"Feedback senden","feedback.cancel":"Abbrechen","feedback.placeholder":"Sagen Sie uns, was schiefgelaufen ist...","error.configuration":"Konfigurationsfehler","error.bot":"Bot-Fehler","error.network":"Netzwerkfehler","error.disconnected":"Getrennt","error.unexpected":"Unerwarteter Fehler","dropdown.placeholder":"Auswählen...","message.status.delivered":"Zugestellt","date.today":"Heute","date.yesterday":"Gestern"},oc={"composer.placeholder":"Scrivi il tuo messaggio...","composer.sendButton.ariaLabel":"Pulsante Invia messaggio","composer.voiceButton.ariaLabel":"Pulsante Inserimento vocale","composer.fileButton.ariaLabel":"Pulsante Carica file","composer.messageInput.ariaLabel":"Campo di inserimento messaggio","fileAttachment.uploadError":"Errore di caricamento","fileAttachment.fallbackExtension":"File","fileAttachment.removeButton.ariaLabel":"Pulsante Rimuovi file","header.defaultBotName":"Bot","header.expandButton.ariaLabel":"Pulsante Espandi intestazione","header.sound.enable":"Attiva suoni della chat","header.sound.disable":"Disattiva suoni della chat","conversationHistory.title":"Conversazioni","conversationHistory.empty":"Nessuna conversazione avviata","conversationHistory.newConversation":"Nuova conversazione","conversationHistory.sentAttachment":"Ha inviato un allegato","conversationHistory.showButton.ariaLabel":"Pulsante Mostra conversazioni recenti","restartConversation.title":"Crea nuova conversazione","restartConversation.description":"Questo cancellerà la conversazione corrente e ne avvierà una nuova.","restartConversation.confirm":"Nuova conversazione","restartConversation.cancel":"Annulla","restartConversation.button.ariaLabel":"Pulsante Riavvia conversazione","closeButton.ariaLabel":"Pulsante Chiudi chatbot","feedback.title":"Aiutaci a migliorare","feedback.description":"Inviaci il tuo feedback per aiutarci a migliorare.","feedback.confirm":"Invia feedback","feedback.cancel":"Annulla","feedback.placeholder":"Dicci cosa non ha funzionato...","error.configuration":"Errore di configurazione","error.bot":"Errore del bot","error.network":"Errore di rete","error.disconnected":"Disconnesso","error.unexpected":"Errore imprevisto","dropdown.placeholder":"Seleziona...","message.status.delivered":"Consegnato","date.today":"Oggi","date.yesterday":"Ieri"},sc={"composer.placeholder":"メッセージを入力...","composer.sendButton.ariaLabel":"メッセージ送信ボタン","composer.voiceButton.ariaLabel":"音声入力ボタン","composer.fileButton.ariaLabel":"ファイルアップロードボタン","composer.messageInput.ariaLabel":"メッセージ入力","fileAttachment.uploadError":"アップロードエラー","fileAttachment.fallbackExtension":"ファイル","fileAttachment.removeButton.ariaLabel":"ファイル削除ボタン","header.defaultBotName":"ボット","header.expandButton.ariaLabel":"ヘッダー展開ボタン","header.sound.enable":"チャット音を有効にする","header.sound.disable":"チャット音を無効にする","conversationHistory.title":"会話履歴","conversationHistory.empty":"まだ会話がありません","conversationHistory.newConversation":"新しい会話","conversationHistory.sentAttachment":"添付ファイルを送信しました","conversationHistory.showButton.ariaLabel":"最近の会話を表示ボタン","restartConversation.title":"新しい会話を作成","restartConversation.description":"現在の会話を消去し、新しい会話を開始します。","restartConversation.confirm":"新しい会話","restartConversation.cancel":"キャンセル","restartConversation.button.ariaLabel":"会話を再開ボタン","closeButton.ariaLabel":"チャットボットを閉じるボタン","feedback.title":"改善にご協力ください","feedback.description":"サービス向上のため、フィードバックをお寄せください。","feedback.confirm":"フィードバックを送信","feedback.cancel":"キャンセル","feedback.placeholder":"問題点をお知らせください...","error.configuration":"設定エラー","error.bot":"ボットエラー","error.network":"ネットワークエラー","error.disconnected":"切断されました","error.unexpected":"予期しないエラー","dropdown.placeholder":"選択...","message.status.delivered":"配信済み","date.today":"今日","date.yesterday":"昨日"},ac={"composer.placeholder":"메시지를 입력하세요...","composer.sendButton.ariaLabel":"메시지 보내기 버튼","composer.voiceButton.ariaLabel":"음성 입력 버튼","composer.fileButton.ariaLabel":"파일 업로드 버튼","composer.messageInput.ariaLabel":"메시지 입력","fileAttachment.uploadError":"업로드 오류","fileAttachment.fallbackExtension":"파일","fileAttachment.removeButton.ariaLabel":"파일 삭제 버튼","header.defaultBotName":"봇","header.expandButton.ariaLabel":"헤더 펼치기 버튼","header.sound.enable":"채팅 소리 켜기","header.sound.disable":"채팅 소리 끄기","conversationHistory.title":"대화 목록","conversationHistory.empty":"아직 시작된 대화가 없습니다","conversationHistory.newConversation":"새 대화","conversationHistory.sentAttachment":"첨부 파일을 보냈습니다","conversationHistory.showButton.ariaLabel":"최근 대화 보기 버튼","restartConversation.title":"새 대화 만들기","restartConversation.description":"현재 대화를 지우고 새 대화를 시작합니다.","restartConversation.confirm":"새 대화","restartConversation.cancel":"취소","restartConversation.button.ariaLabel":"대화 다시 시작 버튼","closeButton.ariaLabel":"챗봇 닫기 버튼","feedback.title":"개선에 도움을 주세요","feedback.description":"서비스 개선을 위해 피드백을 보내주세요.","feedback.confirm":"피드백 보내기","feedback.cancel":"취소","feedback.placeholder":"어떤 점이 문제였는지 알려주세요...","error.configuration":"설정 오류","error.bot":"봇 오류","error.network":"네트워크 오류","error.disconnected":"연결 끊김","error.unexpected":"예기치 않은 오류","dropdown.placeholder":"선택...","message.status.delivered":"전달됨","date.today":"오늘","date.yesterday":"어제"},lc={"composer.placeholder":"اكتب رسالتك...","composer.sendButton.ariaLabel":"زر إرسال الرسالة","composer.voiceButton.ariaLabel":"زر الإدخال الصوتي","composer.fileButton.ariaLabel":"زر رفع ملف","composer.messageInput.ariaLabel":"إدخال الرسالة","fileAttachment.uploadError":"خطأ في الرفع","fileAttachment.fallbackExtension":"ملف","fileAttachment.removeButton.ariaLabel":"زر إزالة الملف","header.defaultBotName":"بوت","header.expandButton.ariaLabel":"زر توسيع الرأس","header.sound.enable":"تفعيل أصوات المحادثة","header.sound.disable":"تعطيل أصوات المحادثة","conversationHistory.title":"المحادثات","conversationHistory.empty":"لم تبدأ أي محادثة بعد","conversationHistory.newConversation":"محادثة جديدة","conversationHistory.sentAttachment":"أرسل مرفقاً","conversationHistory.showButton.ariaLabel":"زر عرض المحادثات الأخيرة","restartConversation.title":"إنشاء محادثة جديدة","restartConversation.description":"سيؤدي هذا إلى مسح المحادثة الحالية وبدء محادثة جديدة.","restartConversation.confirm":"محادثة جديدة","restartConversation.cancel":"إلغاء","restartConversation.button.ariaLabel":"زر إعادة بدء المحادثة","closeButton.ariaLabel":"زر إغلاق الشات بوت","feedback.title":"ساعدنا على التحسين","feedback.description":"يرجى تقديم ملاحظاتك لمساعدتنا على التحسين.","feedback.confirm":"إرسال الملاحظات","feedback.cancel":"إلغاء","feedback.placeholder":"أخبرنا ما الخطأ الذي حدث...","error.configuration":"خطأ في الإعدادات","error.bot":"خطأ في البوت","error.network":"خطأ في الشبكة","error.disconnected":"غير متصل","error.unexpected":"خطأ غير متوقع","dropdown.placeholder":"اختر...","message.status.delivered":"تم التسليم","date.today":"اليوم","date.yesterday":"أمس"},Rn={"composer.placeholder":"Type your message...","composer.sendButton.ariaLabel":"Send Message Button","composer.voiceButton.ariaLabel":"Voice Input Button","composer.fileButton.ariaLabel":"Upload File Button","composer.messageInput.ariaLabel":"Message Input","fileAttachment.uploadError":"Upload Error","fileAttachment.fallbackExtension":"File","fileAttachment.removeButton.ariaLabel":"Remove File Button","header.defaultBotName":"Bot","header.expandButton.ariaLabel":"Expand Header Button","header.sound.enable":"Enable chat sounds","header.sound.disable":"Disable chat sounds","conversationHistory.title":"Conversations","conversationHistory.empty":"No conversation started yet","conversationHistory.newConversation":"New conversation","conversationHistory.sentAttachment":"Sent an attachment","conversationHistory.showButton.ariaLabel":"Show Recent Conversations Button","restartConversation.title":"Create New Conversation","restartConversation.description":"This will clear the current conversation and start a new one.","restartConversation.confirm":"New conversation","restartConversation.cancel":"Cancel","restartConversation.button.ariaLabel":"Restart Conversation Button","closeButton.ariaLabel":"Close Chatbot Button","feedback.title":"Help us improve","feedback.description":"Please provide feedback to help us improve.","feedback.confirm":"Send feedback","feedback.cancel":"Cancel","feedback.placeholder":"Let us know what went wrong...","error.configuration":"Configuration error","error.bot":"Bot error","error.network":"Network error","error.disconnected":"Disconnected","error.unexpected":"Unexpected error","dropdown.placeholder":"Select...","message.status.delivered":"Delivered","date.today":"Today","date.yesterday":"Yesterday"},Cb={fr:tc,es:nc,pt:rc,de:ic,it:oc,ja:sc,ko:ac,ar:lc};function uc(e){const n=((e??(typeof navigator<"u"?navigator.language:"en")).split("-")[0]??"en").toLowerCase();return Cb[n]??Rn}kr.extend(kb),kr.extend(Eb);function cc(e,t,n,r,i){return e.map(o=>{const{authorId:s}=o,a=s===n?"outgoing":"incoming",l=t.find(f=>f.id===s);let u;return l&&l.id===n?u={name:l.name||"You",avatar:l.pictureUrl}:l?u={name:l.name||"Agent",avatar:l.pictureUrl}:u={name:r||"Bot",avatar:i},{...o,direction:a,sender:u}})}function Ab(e,t=Rn,n="day"){var i,o,s;if(!e||e.length===0)return[];const r=[];(i=e[0])!=null&&i.timestamp&&r.push(fc(e[0].timestamp,t));for(let a=0;a<e.length;a++)if(e[a]&&r.push(e[a]),a+1<e.length){const l=(o=e[a])==null?void 0:o.timestamp,u=(s=e[a+1])==null?void 0:s.timestamp;!kr(l).isSame(u,n)&&u&&r.push(fc(u,t))}return r}function fc(e,t){return{id:`system-date-${kr(e).format("YYYY-MM-DD")}`,direction:"system",sender:{name:"system"},timestamp:e,block:{type:"text",text:Tb(e,t)}}}function Tb(e,t=Rn,n=!1){const r=kr(e),i="h:mma",o=t["date.today"],s=t["date.yesterday"];return r.isToday()?n?`${o} • ${r.format(i)}`:o:r.isYesterday()?n?`${s} • ${r.format(i)}`:s:n?r.format(`YYYY-MM-DD • ${i}`):r.format("YYYY-MM-DD")}function Ib(e=""){if(typeof e!="string")throw new TypeError("Color should be string!");const t=/^#?([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i.exec(e);if(t)return t.splice(1).map(r=>Number.parseInt(r,16));const n=/^#?([\da-f])([\da-f])([\da-f])$/i.exec(e);if(n)return n.splice(1).map(r=>Number.parseInt(r+r,16));if(e.includes(","))return e.split(",").map(r=>Number.parseInt(r));throw new Error("Invalid color format! Use #ABC or #AABBCC or r,g,b")}function Ob(e){return"#"+e.map(t=>`0${t.toString(16).toUpperCase()}`.slice(-2)).join("")}function Db(e,t){return e.map(n=>Math.round(n+(255-n)*t))}function Mb(e,t){return e.map(n=>Math.round(n*t))}const xr=e=>t=>Db(t,e),Er=e=>t=>Mb(t,e),Nb={50:xr(.95),100:xr(.9),200:xr(.75),300:xr(.6),400:xr(.3),500:e=>e,600:Er(.9),700:Er(.6),800:Er(.45),900:Er(.3),950:Er(.2)};function dc(e,t=Nb){const n={},r=Ib(e);for(const[i,o]of Object.entries(t))n[i]=Ob(o(r));return n}const hc=()=>{const e={};return{on:(i,o)=>{var s;return e[i]||(e[i]=new Set),(s=e[i])==null||s.add(o),()=>{var a;return(a=e[i])==null?void 0:a.delete(o)}},emit:(i,o)=>{var s,a;(s=e[i])==null||s.forEach(l=>l(o)),(a=e["*"])==null||a.forEach(l=>l({type:i,payload:o}))},removeAllListeners:i=>{var o;i?(o=e[i])==null||o.clear():Object.keys(e).forEach(s=>{var a;(a=e[s])==null||a.clear()})}}};class wn extends Error{}class Lb extends wn{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class _b extends wn{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class Pb extends wn{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class Cr extends wn{}class pc extends wn{constructor(t){super(`Invalid unit ${t}`)}}class bt extends wn{}class rn extends wn{constructor(){super("Zone is an abstract class")}}const ie="numeric",Tt="short",pt="long",hs={year:ie,month:ie,day:ie},mc={year:ie,month:Tt,day:ie},Fb={year:ie,month:Tt,day:ie,weekday:Tt},gc={year:ie,month:pt,day:ie},yc={year:ie,month:pt,day:ie,weekday:pt},vc={hour:ie,minute:ie},bc={hour:ie,minute:ie,second:ie},wc={hour:ie,minute:ie,second:ie,timeZoneName:Tt},Sc={hour:ie,minute:ie,second:ie,timeZoneName:pt},kc={hour:ie,minute:ie,hourCycle:"h23"},xc={hour:ie,minute:ie,second:ie,hourCycle:"h23"},Ec={hour:ie,minute:ie,second:ie,hourCycle:"h23",timeZoneName:Tt},Cc={hour:ie,minute:ie,second:ie,hourCycle:"h23",timeZoneName:pt},Ac={year:ie,month:ie,day:ie,hour:ie,minute:ie},Tc={year:ie,month:ie,day:ie,hour:ie,minute:ie,second:ie},Ic={year:ie,month:Tt,day:ie,hour:ie,minute:ie},Oc={year:ie,month:Tt,day:ie,hour:ie,minute:ie,second:ie},Rb={year:ie,month:Tt,day:ie,weekday:Tt,hour:ie,minute:ie},Dc={year:ie,month:pt,day:ie,hour:ie,minute:ie,timeZoneName:Tt},Mc={year:ie,month:pt,day:ie,hour:ie,minute:ie,second:ie,timeZoneName:Tt},Nc={year:ie,month:pt,day:ie,weekday:pt,hour:ie,minute:ie,timeZoneName:pt},Lc={year:ie,month:pt,day:ie,weekday:pt,hour:ie,minute:ie,second:ie,timeZoneName:pt};function ke(e){return typeof e>"u"}function Sn(e){return typeof e=="number"}function xi(e){return typeof e=="number"&&e%1===0}function Bb(e){return typeof e=="string"}function $b(e){return Object.prototype.toString.call(e)==="[object Date]"}function _c(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function zb(e){return Array.isArray(e)?e:[e]}function Pc(e,t,n){if(e.length!==0)return e.reduce((r,i)=>{const o=[t(i),i];return r&&n(r[0],o[0])===r[0]?r:o},null)[1]}function Hb(e,t){return t.reduce((n,r)=>(n[r]=e[r],n),{})}function Bn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Yt(e,t,n){return xi(e)&&e>=t&&e<=n}function Ub(e,t){return e-t*Math.floor(e/t)}function Ve(e,t=2){const n=e<0;let r;return n?r="-"+(""+-e).padStart(t,"0"):r=(""+e).padStart(t,"0"),r}function on(e){if(!(ke(e)||e===null||e===""))return parseInt(e,10)}function kn(e){if(!(ke(e)||e===null||e===""))return parseFloat(e)}function ps(e){if(!(ke(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function ms(e,t,n=!1){const r=10**t;return(n?Math.trunc:Math.round)(e*r)/r}function Ar(e){return e%4===0&&(e%100!==0||e%400===0)}function Tr(e){return Ar(e)?366:365}function Ei(e,t){const n=Ub(t-1,12)+1,r=e+(t-n)/12;return n===2?Ar(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function gs(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(t.getUTCFullYear()-1900)),+t}function Ci(e){const t=(e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))%7,n=e-1,r=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7;return t===4||r===3?53:52}function ys(e){return e>99?e:e>60?1900+e:2e3+e}function Fc(e,t,n,r=null){const i=new Date(e),o={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(o.timeZone=r);const s={timeZoneName:t,...o},a=new Intl.DateTimeFormat(n,s).formatToParts(i).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function Ai(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0,i=n<0||Object.is(n,-0)?-r:r;return n*60+i}function Rc(e){const t=Number(e);if(typeof e=="boolean"||e===""||Number.isNaN(t))throw new bt(`Invalid unit value ${e}`);return t}function Ti(e,t){const n={};for(const r in e)if(Bn(e,r)){const i=e[r];if(i==null)continue;n[t(r)]=Rc(i)}return n}function Ir(e,t){const n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),i=e>=0?"+":"-";switch(t){case"short":return`${i}${Ve(n,2)}:${Ve(r,2)}`;case"narrow":return`${i}${n}${r>0?`:${r}`:""}`;case"techie":return`${i}${Ve(n,2)}${Ve(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function Ii(e){return Hb(e,["hour","minute","second","millisecond"])}const Bc=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,jb=["January","February","March","April","May","June","July","August","September","October","November","December"],$c=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Vb=["J","F","M","A","M","J","J","A","S","O","N","D"];function zc(e){switch(e){case"narrow":return[...Vb];case"short":return[...$c];case"long":return[...jb];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const Hc=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Uc=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Wb=["M","T","W","T","F","S","S"];function jc(e){switch(e){case"narrow":return[...Wb];case"short":return[...Uc];case"long":return[...Hc];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Vc=["AM","PM"],qb=["Before Christ","Anno Domini"],Yb=["BC","AD"],Kb=["B","A"];function Wc(e){switch(e){case"narrow":return[...Kb];case"short":return[...Yb];case"long":return[...qb];default:return null}}function Gb(e){return Vc[e.hour<12?0:1]}function Qb(e,t){return jc(t)[e.weekday-1]}function Zb(e,t){return zc(t)[e.month-1]}function Jb(e,t){return Wc(t)[e.year<0?0:1]}function Xb(e,t,n="always",r=!1){const i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},o=["hours","minutes","seconds"].indexOf(e)===-1;if(n==="auto"&&o){const c=e==="days";switch(t){case 1:return c?"tomorrow":`next ${i[e][0]}`;case-1:return c?"yesterday":`last ${i[e][0]}`;case 0:return c?"today":`this ${i[e][0]}`}}const s=Object.is(t,-0)||t<0,a=Math.abs(t),l=a===1,u=i[e],f=r?l?u[1]:u[2]||u[1]:l?i[e][0]:e;return s?`${a} ${f} ago`:`in ${a} ${f}`}function qc(e,t){let n="";for(const r of e)r.literal?n+=r.val:n+=t(r.val);return n}const ew={D:hs,DD:mc,DDD:gc,DDDD:yc,t:vc,tt:bc,ttt:wc,tttt:Sc,T:kc,TT:xc,TTT:Ec,TTTT:Cc,f:Ac,ff:Ic,fff:Dc,ffff:Nc,F:Tc,FF:Oc,FFF:Mc,FFFF:Lc};class ut{static create(t,n={}){return new ut(t,n)}static parseFormat(t){let n=null,r="",i=!1;const o=[];for(let s=0;s<t.length;s++){const a=t.charAt(s);a==="'"?(r.length>0&&o.push({literal:i,val:r}),n=null,r="",i=!i):i||a===n?r+=a:(r.length>0&&o.push({literal:!1,val:r}),r=a,n=a)}return r.length>0&&o.push({literal:i,val:r}),o}static macroTokenToFormatOpts(t){return ew[t]}constructor(t,n){this.opts=n,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...n}).format()}formatDateTime(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n}).format()}formatDateTimeParts(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n}).formatToParts()}resolvedOptions(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n}).resolvedOptions()}num(t,n=0){if(this.opts.forceSimple)return Ve(t,n);const r={...this.opts};return n>0&&(r.padTo=n),this.loc.numberFormatter(r).format(t)}formatDateTimeFromString(t,n){const r=this.loc.listingMode()==="en",i=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",o=(d,m)=>this.loc.extract(t,d,m),s=d=>t.isOffsetFixed&&t.offset===0&&d.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,d.format):"",a=()=>r?Gb(t):o({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(d,m)=>r?Zb(t,d):o(m?{month:d}:{month:d,day:"numeric"},"month"),u=(d,m)=>r?Qb(t,d):o(m?{weekday:d}:{weekday:d,month:"long",day:"numeric"},"weekday"),f=d=>{const m=ut.macroTokenToFormatOpts(d);return m?this.formatWithSystemDefault(t,m):d},c=d=>r?Jb(t,d):o({era:d},"era"),h=d=>{switch(d){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return s({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return s({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return s({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return a();case"d":return i?o({day:"numeric"},"day"):this.num(t.day);case"dd":return i?o({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return i?o({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return i?o({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return l("short",!0);case"LLLL":return l("long",!0);case"LLLLL":return l("narrow",!0);case"M":return i?o({month:"numeric"},"month"):this.num(t.month);case"MM":return i?o({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return l("short",!1);case"MMMM":return l("long",!1);case"MMMMM":return l("narrow",!1);case"y":return i?o({year:"numeric"},"year"):this.num(t.year);case"yy":return i?o({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return i?o({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return i?o({year:"numeric"},"year"):this.num(t.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return f(d)}};return qc(ut.parseFormat(n),h)}formatDurationFromString(t,n){const r=l=>{switch(l[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},i=l=>u=>{const f=r(u);return f?this.num(l.get(f),u.length):u},o=ut.parseFormat(n),s=o.reduce((l,{literal:u,val:f})=>u?l:l.concat(f),[]),a=t.shiftTo(...s.map(r).filter(l=>l));return qc(o,i(a))}}class It{constructor(t,n){this.reason=t,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class Or{get type(){throw new rn}get name(){throw new rn}get ianaName(){return this.name}get isUniversal(){throw new rn}offsetName(t,n){throw new rn}formatOffset(t,n){throw new rn}offset(t){throw new rn}equals(t){throw new rn}get isValid(){throw new rn}}let vs=null;class bs extends Or{static get instance(){return vs===null&&(vs=new bs),vs}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return Fc(t,n,r)}formatOffset(t,n){return Ir(this.offset(t),n)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}let Oi={};function tw(e){return Oi[e]||(Oi[e]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),Oi[e]}const nw={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function rw(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,i,o,s,a,l,u,f]=r;return[s,i,o,a,l,u,f]}function iw(e,t){const n=e.formatToParts(t),r=[];for(let i=0;i<n.length;i++){const{type:o,value:s}=n[i],a=nw[o];o==="era"?r[a]=s:ke(a)||(r[a]=parseInt(s,10))}return r}let Di={};class Kt extends Or{static create(t){return Di[t]||(Di[t]=new Kt(t)),Di[t]}static resetCache(){Di={},Oi={}}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=Kt.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return Fc(t,n,r,this.name)}formatOffset(t,n){return Ir(this.offset(t),n)}offset(t){const n=new Date(t);if(isNaN(n))return NaN;const r=tw(this.name);let[i,o,s,a,l,u,f]=r.formatToParts?iw(r,n):rw(r,n);a==="BC"&&(i=-Math.abs(i)+1);const h=gs({year:i,month:o,day:s,hour:l===24?0:l,minute:u,second:f,millisecond:0});let d=+n;const m=d%1e3;return d-=m>=0?m:1e3+m,(h-d)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let ws=null;class ot extends Or{static get utcInstance(){return ws===null&&(ws=new ot(0)),ws}static instance(t){return t===0?ot.utcInstance:new ot(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new ot(Ai(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Ir(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Ir(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return Ir(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}class ow extends Or{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function sn(e,t){if(ke(e)||e===null)return t;if(e instanceof Or)return e;if(Bb(e)){const n=e.toLowerCase();return n==="local"||n==="system"?t:n==="utc"||n==="gmt"?ot.utcInstance:ot.parseSpecifier(n)||Kt.create(e)}else return Sn(e)?ot.instance(e):typeof e=="object"&&e.offset&&typeof e.offset=="number"?e:new ow(e)}let Yc=()=>Date.now(),Kc="system",Gc=null,Qc=null,Zc=null,Jc;class qe{static get now(){return Yc}static set now(t){Yc=t}static set defaultZone(t){Kc=t}static get defaultZone(){return sn(Kc,bs.instance)}static get defaultLocale(){return Gc}static set defaultLocale(t){Gc=t}static get defaultNumberingSystem(){return Qc}static set defaultNumberingSystem(t){Qc=t}static get defaultOutputCalendar(){return Zc}static set defaultOutputCalendar(t){Zc=t}static get throwOnInvalid(){return Jc}static set throwOnInvalid(t){Jc=t}static resetCaches(){Re.resetCache(),Kt.resetCache()}}let Xc={};function sw(e,t={}){const n=JSON.stringify([e,t]);let r=Xc[n];return r||(r=new Intl.ListFormat(e,t),Xc[n]=r),r}let Ss={};function ks(e,t={}){const n=JSON.stringify([e,t]);let r=Ss[n];return r||(r=new Intl.DateTimeFormat(e,t),Ss[n]=r),r}let xs={};function aw(e,t={}){const n=JSON.stringify([e,t]);let r=xs[n];return r||(r=new Intl.NumberFormat(e,t),xs[n]=r),r}let Es={};function lw(e,t={}){const{base:n,...r}=t,i=JSON.stringify([e,r]);let o=Es[i];return o||(o=new Intl.RelativeTimeFormat(e,t),Es[i]=o),o}let Dr=null;function uw(){return Dr||(Dr=new Intl.DateTimeFormat().resolvedOptions().locale,Dr)}function cw(e){const t=e.indexOf("-u-");if(t===-1)return[e];{let n;const r=e.substring(0,t);try{n=ks(e).resolvedOptions()}catch{n=ks(r).resolvedOptions()}const{numberingSystem:i,calendar:o}=n;return[r,i,o]}}function fw(e,t,n){return(n||t)&&(e+="-u",n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`)),e}function dw(e){const t=[];for(let n=1;n<=12;n++){const r=me.utc(2016,n,1);t.push(e(r))}return t}function hw(e){const t=[];for(let n=1;n<=7;n++){const r=me.utc(2016,11,13+n);t.push(e(r))}return t}function Mi(e,t,n,r,i){const o=e.listingMode(n);return o==="error"?null:o==="en"?r(t):i(t)}function pw(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem==="latn"}class mw{constructor(t,n,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:i,floor:o,...s}=r;if(!n||Object.keys(s).length>0){const a={useGrouping:!1,...r};r.padTo>0&&(a.minimumIntegerDigits=r.padTo),this.inf=aw(t,a)}}format(t){if(this.inf){const n=this.floor?Math.floor(t):t;return this.inf.format(n)}else{const n=this.floor?Math.floor(t):ms(t,3);return Ve(n,this.padTo)}}}class gw{constructor(t,n,r){this.opts=r;let i;if(t.zone.isUniversal){const s=-1*(t.offset/60),a=s>=0?`Etc/GMT+${s}`:`Etc/GMT${s}`;t.offset!==0&&Kt.create(a).valid?(i=a,this.dt=t):(i="UTC",r.timeZoneName?this.dt=t:this.dt=t.offset===0?t:me.fromMillis(t.ts+t.offset*60*1e3))}else t.zone.type==="system"?this.dt=t:(this.dt=t,i=t.zone.name);const o={...this.opts};i&&(o.timeZone=i),this.dtf=ks(n,o)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class yw{constructor(t,n,r){this.opts={style:"long",...r},!n&&_c()&&(this.rtf=lw(t,r))}format(t,n){return this.rtf?this.rtf.format(t,n):Xb(n,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,n){return this.rtf?this.rtf.formatToParts(t,n):[]}}class Re{static fromOpts(t){return Re.create(t.locale,t.numberingSystem,t.outputCalendar,t.defaultToEN)}static create(t,n,r,i=!1){const o=t||qe.defaultLocale,s=o||(i?"en-US":uw()),a=n||qe.defaultNumberingSystem,l=r||qe.defaultOutputCalendar;return new Re(s,a,l,o)}static resetCache(){Dr=null,Ss={},xs={},Es={}}static fromObject({locale:t,numberingSystem:n,outputCalendar:r}={}){return Re.create(t,n,r)}constructor(t,n,r,i){const[o,s,a]=cw(t);this.locale=o,this.numberingSystem=n||s||null,this.outputCalendar=r||a||null,this.intl=fw(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=pw(this)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&n?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:Re.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,n=!1,r=!0){return Mi(this,t,r,zc,()=>{const i=n?{month:t,day:"numeric"}:{month:t},o=n?"format":"standalone";return this.monthsCache[o][t]||(this.monthsCache[o][t]=dw(s=>this.extract(s,i,"month"))),this.monthsCache[o][t]})}weekdays(t,n=!1,r=!0){return Mi(this,t,r,jc,()=>{const i=n?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},o=n?"format":"standalone";return this.weekdaysCache[o][t]||(this.weekdaysCache[o][t]=hw(s=>this.extract(s,i,"weekday"))),this.weekdaysCache[o][t]})}meridiems(t=!0){return Mi(this,void 0,t,()=>Vc,()=>{if(!this.meridiemCache){const n={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[me.utc(2016,11,13,9),me.utc(2016,11,13,19)].map(r=>this.extract(r,n,"dayperiod"))}return this.meridiemCache})}eras(t,n=!0){return Mi(this,t,n,Wc,()=>{const r={era:t};return this.eraCache[t]||(this.eraCache[t]=[me.utc(-40,1,1),me.utc(2017,1,1)].map(i=>this.extract(i,r,"era"))),this.eraCache[t]})}extract(t,n,r){const i=this.dtFormatter(t,n),o=i.formatToParts(),s=o.find(a=>a.type.toLowerCase()===r);return s?s.value:null}numberFormatter(t={}){return new mw(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,n={}){return new gw(t,this.intl,n)}relFormatter(t={}){return new yw(this.intl,this.isEnglish(),t)}listFormatter(t={}){return sw(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}}function $n(...e){const t=e.reduce((n,r)=>n+r.source,"");return RegExp(`^${t}$`)}function zn(...e){return t=>e.reduce(([n,r,i],o)=>{const[s,a,l]=o(t,i);return[{...n,...s},a||r,l]},[{},null,1]).slice(0,2)}function Hn(e,...t){if(e==null)return[null,null];for(const[n,r]of t){const i=n.exec(e);if(i)return r(i)}return[null,null]}function ef(...e){return(t,n)=>{const r={};let i;for(i=0;i<e.length;i++)r[e[i]]=on(t[n+i]);return[r,null,n+i]}}const tf=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,vw=`(?:${tf.source}?(?:\\[(${Bc.source})\\])?)?`,Cs=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,nf=RegExp(`${Cs.source}${vw}`),As=RegExp(`(?:T${nf.source})?`),bw=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,ww=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Sw=/(\d{4})-?(\d{3})/,kw=ef("weekYear","weekNumber","weekDay"),xw=ef("year","ordinal"),Ew=/(\d{4})-(\d\d)-(\d\d)/,rf=RegExp(`${Cs.source} ?(?:${tf.source}|(${Bc.source}))?`),Cw=RegExp(`(?: ${rf.source})?`);function Un(e,t,n){const r=e[t];return ke(r)?n:on(r)}function Aw(e,t){return[{year:Un(e,t),month:Un(e,t+1,1),day:Un(e,t+2,1)},null,t+3]}function jn(e,t){return[{hours:Un(e,t,0),minutes:Un(e,t+1,0),seconds:Un(e,t+2,0),milliseconds:ps(e[t+3])},null,t+4]}function Mr(e,t){const n=!e[t]&&!e[t+1],r=Ai(e[t+1],e[t+2]),i=n?null:ot.instance(r);return[{},i,t+3]}function Nr(e,t){const n=e[t]?Kt.create(e[t]):null;return[{},n,t+1]}const Tw=RegExp(`^T?${Cs.source}$`),Iw=/^-?P(?:(?:(-?\d{1,9}(?:\.\d{1,9})?)Y)?(?:(-?\d{1,9}(?:\.\d{1,9})?)M)?(?:(-?\d{1,9}(?:\.\d{1,9})?)W)?(?:(-?\d{1,9}(?:\.\d{1,9})?)D)?(?:T(?:(-?\d{1,9}(?:\.\d{1,9})?)H)?(?:(-?\d{1,9}(?:\.\d{1,9})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,9}))?S)?)?)$/;function Ow(e){const[t,n,r,i,o,s,a,l,u]=e,f=t[0]==="-",c=l&&l[0]==="-",h=(d,m=!1)=>d!==void 0&&(m||d&&f)?-d:d;return[{years:h(kn(n)),months:h(kn(r)),weeks:h(kn(i)),days:h(kn(o)),hours:h(kn(s)),minutes:h(kn(a)),seconds:h(kn(l),l==="-0"),milliseconds:h(ps(u),c)}]}const Dw={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Ts(e,t,n,r,i,o,s){const a={year:t.length===2?ys(on(t)):on(t),month:$c.indexOf(n)+1,day:on(r),hour:on(i),minute:on(o)};return s&&(a.second=on(s)),e&&(a.weekday=e.length>3?Hc.indexOf(e)+1:Uc.indexOf(e)+1),a}const Mw=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Nw(e){const[,t,n,r,i,o,s,a,l,u,f,c]=e,h=Ts(t,i,r,n,o,s,a);let d;return l?d=Dw[l]:u?d=0:d=Ai(f,c),[h,new ot(d)]}function Lw(e){return e.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const _w=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Pw=/^(Monday|Tuesday|Wedsday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Fw=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function of(e){const[,t,n,r,i,o,s,a]=e;return[Ts(t,i,r,n,o,s,a),ot.utcInstance]}function Rw(e){const[,t,n,r,i,o,s,a]=e;return[Ts(t,a,n,r,i,o,s),ot.utcInstance]}const Bw=$n(bw,As),$w=$n(ww,As),zw=$n(Sw,As),Hw=$n(nf),sf=zn(Aw,jn,Mr,Nr),Uw=zn(kw,jn,Mr,Nr),jw=zn(xw,jn,Mr,Nr),Vw=zn(jn,Mr,Nr);function Ww(e){return Hn(e,[Bw,sf],[$w,Uw],[zw,jw],[Hw,Vw])}function qw(e){return Hn(Lw(e),[Mw,Nw])}function Yw(e){return Hn(e,[_w,of],[Pw,of],[Fw,Rw])}function Kw(e){return Hn(e,[Iw,Ow])}const Gw=zn(jn);function Qw(e){return Hn(e,[Tw,Gw])}const Zw=$n(Ew,Cw),Jw=$n(rf),Xw=zn(jn,Mr,Nr);function e0(e){return Hn(e,[Zw,sf],[Jw,Xw])}const t0="Invalid Duration",af={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},n0={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...af},wt=146097/400,Vn=146097/4800,r0={years:{quarters:4,months:12,weeks:wt/7,days:wt,hours:wt*24,minutes:wt*24*60,seconds:wt*24*60*60,milliseconds:wt*24*60*60*1e3},quarters:{months:3,weeks:wt/28,days:wt/4,hours:wt*24/4,minutes:wt*24*60/4,seconds:wt*24*60*60/4,milliseconds:wt*24*60*60*1e3/4},months:{weeks:Vn/7,days:Vn,hours:Vn*24,minutes:Vn*24*60,seconds:Vn*24*60*60,milliseconds:Vn*24*60*60*1e3},...af},xn=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],i0=xn.slice(0).reverse();function En(e,t,n=!1){const r={values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy};return new Ee(r)}function o0(e){return e<0?Math.floor(e):Math.ceil(e)}function lf(e,t,n,r,i){const o=e[i][n],s=t[n]/o,a=Math.sign(s)===Math.sign(r[i]),l=!a&&r[i]!==0&&Math.abs(s)<=1?o0(s):Math.trunc(s);r[i]+=l,t[n]-=l*o}function s0(e,t){i0.reduce((n,r)=>ke(t[r])?n:(n&&lf(e,t,n,t,r),r),null)}class Ee{constructor(t){const n=t.conversionAccuracy==="longterm"||!1;this.values=t.values,this.loc=t.loc||Re.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=n?r0:n0,this.isLuxonDuration=!0}static fromMillis(t,n){return Ee.fromObject({milliseconds:t},n)}static fromObject(t,n={}){if(t==null||typeof t!="object")throw new bt(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new Ee({values:Ti(t,Ee.normalizeUnit),loc:Re.fromObject(n),conversionAccuracy:n.conversionAccuracy})}static fromDurationLike(t){if(Sn(t))return Ee.fromMillis(t);if(Ee.isDuration(t))return t;if(typeof t=="object")return Ee.fromObject(t);throw new bt(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){const[r]=Kw(t);return r?Ee.fromObject(r,n):Ee.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){const[r]=Qw(t);return r?Ee.fromObject(r,n):Ee.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,n=null){if(!t)throw new bt("need to specify a reason the Duration is invalid");const r=t instanceof It?t:new It(t,n);if(qe.throwOnInvalid)throw new Pb(r);return new Ee({invalid:r})}static normalizeUnit(t){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!n)throw new pc(t);return n}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,n={}){const r={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?ut.create(this.loc,r).formatDurationFromString(this,t):t0}toHuman(t={}){const n=xn.map(r=>{const i=this.values[r];return ke(i)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:r.slice(0,-1)}).format(i)}).filter(r=>r);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=ms(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const n=this.toMillis();if(n<0||n>=864e5)return null;t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t};const r=this.shiftTo("hours","minutes","seconds","milliseconds");let i=t.format==="basic"?"hhmm":"hh:mm";(!t.suppressSeconds||r.seconds!==0||r.milliseconds!==0)&&(i+=t.format==="basic"?"ss":":ss",(!t.suppressMilliseconds||r.milliseconds!==0)&&(i+=".SSS"));let o=r.toFormat(i);return t.includePrefix&&(o="T"+o),o}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const n=Ee.fromDurationLike(t),r={};for(const i of xn)(Bn(n.values,i)||Bn(this.values,i))&&(r[i]=n.get(i)+this.get(i));return En(this,{values:r},!0)}minus(t){if(!this.isValid)return this;const n=Ee.fromDurationLike(t);return this.plus(n.negate())}mapUnits(t){if(!this.isValid)return this;const n={};for(const r of Object.keys(this.values))n[r]=Rc(t(this.values[r],r));return En(this,{values:n},!0)}get(t){return this[Ee.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const n={...this.values,...Ti(t,Ee.normalizeUnit)};return En(this,{values:n})}reconfigure({locale:t,numberingSystem:n,conversionAccuracy:r}={}){const i=this.loc.clone({locale:t,numberingSystem:n}),o={loc:i};return r&&(o.conversionAccuracy=r),En(this,o)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return s0(this.matrix,t),En(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(s=>Ee.normalizeUnit(s));const n={},r={},i=this.toObject();let o;for(const s of xn)if(t.indexOf(s)>=0){o=s;let a=0;for(const u in r)a+=this.matrix[u][s]*r[u],r[u]=0;Sn(i[s])&&(a+=i[s]);const l=Math.trunc(a);n[s]=l,r[s]=(a*1e3-l*1e3)/1e3;for(const u in i)xn.indexOf(u)>xn.indexOf(s)&&lf(this.matrix,i,u,n,s)}else Sn(i[s])&&(r[s]=i[s]);for(const s in r)r[s]!==0&&(n[o]+=s===o?r[s]:r[s]/this.matrix[o][s]);return En(this,{values:n},!0).normalize()}negate(){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=this.values[n]===0?0:-this.values[n];return En(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function n(r,i){return r===void 0||r===0?i===void 0||i===0:r===i}for(const r of xn)if(!n(this.values[r],t.values[r]))return!1;return!0}}const Lr="Invalid Interval";function a0(e,t){return!e||!e.isValid?ze.invalid("missing or invalid start"):!t||!t.isValid?ze.invalid("missing or invalid end"):t<e?ze.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null}class ze{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,n=null){if(!t)throw new bt("need to specify a reason the Interval is invalid");const r=t instanceof It?t:new It(t,n);if(qe.throwOnInvalid)throw new _b(r);return new ze({invalid:r})}static fromDateTimes(t,n){const r=Fr(t),i=Fr(n),o=a0(r,i);return o??new ze({start:r,end:i})}static after(t,n){const r=Ee.fromDurationLike(n),i=Fr(t);return ze.fromDateTimes(i,i.plus(r))}static before(t,n){const r=Ee.fromDurationLike(n),i=Fr(t);return ze.fromDateTimes(i.minus(r),i)}static fromISO(t,n){const[r,i]=(t||"").split("/",2);if(r&&i){let o,s;try{o=me.fromISO(r,n),s=o.isValid}catch{s=!1}let a,l;try{a=me.fromISO(i,n),l=a.isValid}catch{l=!1}if(s&&l)return ze.fromDateTimes(o,a);if(s){const u=Ee.fromISO(i,n);if(u.isValid)return ze.after(o,u)}else if(l){const u=Ee.fromISO(r,n);if(u.isValid)return ze.before(a,u)}}return ze.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds"){if(!this.isValid)return NaN;const n=this.start.startOf(t),r=this.end.startOf(t);return Math.floor(r.diff(n,t).get(t))+1}hasSame(t){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,t):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return this.isValid?this.s>t:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:n}={}){return this.isValid?ze.fromDateTimes(t||this.s,n||this.e):this}splitAt(...t){if(!this.isValid)return[];const n=t.map(Fr).filter(s=>this.contains(s)).sort(),r=[];let{s:i}=this,o=0;for(;i<this.e;){const s=n[o]||this.e,a=+s>+this.e?this.e:s;r.push(ze.fromDateTimes(i,a)),i=a,o+=1}return r}splitBy(t){const n=Ee.fromDurationLike(t);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,i=1,o;const s=[];for(;r<this.e;){const a=this.start.plus(n.mapUnits(l=>l*i));o=+a>+this.e?this.e:a,s.push(ze.fromDateTimes(r,o)),r=o,i+=1}return s}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return this.isValid?+this.e==+t.s:!1}abutsEnd(t){return this.isValid?+t.e==+this.s:!1}engulfs(t){return this.isValid?this.s<=t.s&&this.e>=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const n=this.s>t.s?this.s:t.s,r=this.e<t.e?this.e:t.e;return n>=r?null:ze.fromDateTimes(n,r)}union(t){if(!this.isValid)return this;const n=this.s<t.s?this.s:t.s,r=this.e>t.e?this.e:t.e;return ze.fromDateTimes(n,r)}static merge(t){const[n,r]=t.sort((i,o)=>i.s-o.s).reduce(([i,o],s)=>o?o.overlaps(s)||o.abutsStart(s)?[i,o.union(s)]:[i.concat([o]),s]:[i,s],[[],null]);return r&&n.push(r),n}static xor(t){let n=null,r=0;const i=[],o=t.map(l=>[{time:l.s,type:"s"},{time:l.e,type:"e"}]),s=Array.prototype.concat(...o),a=s.sort((l,u)=>l.time-u.time);for(const l of a)r+=l.type==="s"?1:-1,r===1?n=l.time:(n&&+n!=+l.time&&i.push(ze.fromDateTimes(n,l.time)),n=null);return ze.merge(i)}difference(...t){return ze.xor([this].concat(t)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Lr}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:Lr}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Lr}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:Lr}toFormat(t,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${n}${this.e.toFormat(t)}`:Lr}toDuration(t,n){return this.isValid?this.e.diff(this.s,t,n):Ee.invalid(this.invalidReason)}mapEndpoints(t){return ze.fromDateTimes(t(this.s),t(this.e))}}let Ni=class{static hasDST(t=qe.defaultZone){const n=me.now().setZone(t).set({month:12});return!t.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(t){return Kt.isValidZone(t)}static normalizeZone(t){return sn(t,qe.defaultZone)}static months(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null,outputCalendar:o="gregory"}={}){return(i||Re.create(n,r,o)).months(t)}static monthsFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null,outputCalendar:o="gregory"}={}){return(i||Re.create(n,r,o)).months(t,!0)}static weekdays(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null}={}){return(i||Re.create(n,r,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null}={}){return(i||Re.create(n,r,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return Re.create(t).meridiems()}static eras(t="short",{locale:n=null}={}){return Re.create(n,null,"gregory").eras(t)}static features(){return{relative:_c()}}};function uf(e,t){const n=i=>i.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(t)-n(e);return Math.floor(Ee.fromMillis(r).as("days"))}function l0(e,t,n){const r=[["years",(a,l)=>l.year-a.year],["quarters",(a,l)=>l.quarter-a.quarter],["months",(a,l)=>l.month-a.month+(l.year-a.year)*12],["weeks",(a,l)=>{const u=uf(a,l);return(u-u%7)/7}],["days",uf]],i={};let o,s;for(const[a,l]of r)if(n.indexOf(a)>=0){o=a;let u=l(e,t);s=e.plus({[a]:u}),s>t?(e=e.plus({[a]:u-1}),u-=1):e=s,i[a]=u}return[e,i,s,o]}function u0(e,t,n,r){let[i,o,s,a]=l0(e,t,n);const l=t-i,u=n.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);u.length===0&&(s<t&&(s=i.plus({[a]:1})),s!==i&&(o[a]=(o[a]||0)+l/(s-i)));const f=Ee.fromObject(o,r);return u.length>0?Ee.fromMillis(l,r).shiftTo(...u).plus(f):f}const Is={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},cf={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},c0=Is.hanidec.replace(/[\[|\]]/g,"").split("");function f0(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(e[n].search(Is.hanidec)!==-1)t+=c0.indexOf(e[n]);else for(const i in cf){const[o,s]=cf[i];r>=o&&r<=s&&(t+=r-o)}}return parseInt(t,10)}else return t}function Ot({numberingSystem:e},t=""){return new RegExp(`${Is[e||"latn"]}${t}`)}const d0="missing Intl.DateTimeFormat.formatToParts support";function Ae(e,t=n=>n){return{regex:e,deser:([n])=>t(f0(n))}}const ff="[  ]",df=new RegExp(ff,"g");function h0(e){return e.replace(/\./g,"\\.?").replace(df,ff)}function hf(e){return e.replace(/\./g,"").replace(df," ").toLowerCase()}function Dt(e,t){return e===null?null:{regex:RegExp(e.map(h0).join("|")),deser:([n])=>e.findIndex(r=>hf(n)===hf(r))+t}}function pf(e,t){return{regex:e,deser:([,n,r])=>Ai(n,r),groups:t}}function Os(e){return{regex:e,deser:([t])=>t}}function p0(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function m0(e,t){const n=Ot(t),r=Ot(t,"{2}"),i=Ot(t,"{3}"),o=Ot(t,"{4}"),s=Ot(t,"{6}"),a=Ot(t,"{1,2}"),l=Ot(t,"{1,3}"),u=Ot(t,"{1,6}"),f=Ot(t,"{1,9}"),c=Ot(t,"{2,4}"),h=Ot(t,"{4,6}"),d=g=>({regex:RegExp(p0(g.val)),deser:([y])=>y,literal:!0}),p=(g=>{if(e.literal)return d(g);switch(g.val){case"G":return Dt(t.eras("short",!1),0);case"GG":return Dt(t.eras("long",!1),0);case"y":return Ae(u);case"yy":return Ae(c,ys);case"yyyy":return Ae(o);case"yyyyy":return Ae(h);case"yyyyyy":return Ae(s);case"M":return Ae(a);case"MM":return Ae(r);case"MMM":return Dt(t.months("short",!0,!1),1);case"MMMM":return Dt(t.months("long",!0,!1),1);case"L":return Ae(a);case"LL":return Ae(r);case"LLL":return Dt(t.months("short",!1,!1),1);case"LLLL":return Dt(t.months("long",!1,!1),1);case"d":return Ae(a);case"dd":return Ae(r);case"o":return Ae(l);case"ooo":return Ae(i);case"HH":return Ae(r);case"H":return Ae(a);case"hh":return Ae(r);case"h":return Ae(a);case"mm":return Ae(r);case"m":return Ae(a);case"q":return Ae(a);case"qq":return Ae(r);case"s":return Ae(a);case"ss":return Ae(r);case"S":return Ae(l);case"SSS":return Ae(i);case"u":return Os(f);case"uu":return Os(a);case"uuu":return Ae(n);case"a":return Dt(t.meridiems(),0);case"kkkk":return Ae(o);case"kk":return Ae(c,ys);case"W":return Ae(a);case"WW":return Ae(r);case"E":case"c":return Ae(n);case"EEE":return Dt(t.weekdays("short",!1,!1),1);case"EEEE":return Dt(t.weekdays("long",!1,!1),1);case"ccc":return Dt(t.weekdays("short",!0,!1),1);case"cccc":return Dt(t.weekdays("long",!0,!1),1);case"Z":case"ZZ":return pf(new RegExp(`([+-]${a.source})(?::(${r.source}))?`),2);case"ZZZ":return pf(new RegExp(`([+-]${a.source})(${r.source})?`),2);case"z":return Os(/[a-z_+-/]{1,256}?/i);default:return d(g)}})(e)||{invalidReason:d0};return p.token=e,p}const g0={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"}};function y0(e,t,n){const{type:r,value:i}=e;if(r==="literal")return{literal:!0,val:i};const o=n[r];let s=g0[r];if(typeof s=="object"&&(s=s[o]),s)return{literal:!1,val:s}}function v0(e){return[`^${e.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,e]}function b0(e,t,n){const r=e.match(t);if(r){const i={};let o=1;for(const s in n)if(Bn(n,s)){const a=n[s],l=a.groups?a.groups+1:1;!a.literal&&a.token&&(i[a.token.val[0]]=a.deser(r.slice(o,o+l))),o+=l}return[r,i]}else return[r,{}]}function w0(e){const t=o=>{switch(o){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,r;return ke(e.z)||(n=Kt.create(e.z)),ke(e.Z)||(n||(n=new ot(e.Z)),r=e.Z),ke(e.q)||(e.M=(e.q-1)*3+1),ke(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),ke(e.u)||(e.S=ps(e.u)),[Object.keys(e).reduce((o,s)=>{const a=t(s);return a&&(o[a]=e[s]),o},{}),n,r]}let Ds=null;function S0(){return Ds||(Ds=me.fromMillis(1555555555555)),Ds}function k0(e,t){if(e.literal)return e;const n=ut.macroTokenToFormatOpts(e.val);if(!n)return e;const o=ut.create(t,n).formatDateTimeParts(S0()).map(s=>y0(s,t,n));return o.includes(void 0)?e:o}function x0(e,t){return Array.prototype.concat(...e.map(n=>k0(n,t)))}function mf(e,t,n){const r=x0(ut.parseFormat(n),e),i=r.map(s=>m0(s,e)),o=i.find(s=>s.invalidReason);if(o)return{input:t,tokens:r,invalidReason:o.invalidReason};{const[s,a]=v0(i),l=RegExp(s,"i"),[u,f]=b0(t,l,a),[c,h,d]=f?w0(f):[null,null,void 0];if(Bn(f,"a")&&Bn(f,"H"))throw new Cr("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:r,regex:l,rawMatches:u,matches:f,result:c,zone:h,specificOffset:d}}}function E0(e,t,n){const{result:r,zone:i,specificOffset:o,invalidReason:s}=mf(e,t,n);return[r,i,o,s]}const gf=[0,31,59,90,120,151,181,212,243,273,304,334],yf=[0,31,60,91,121,152,182,213,244,274,305,335];function St(e,t){return new It("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function vf(e,t,n){const r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const i=r.getUTCDay();return i===0?7:i}function bf(e,t,n){return n+(Ar(e)?yf:gf)[t-1]}function wf(e,t){const n=Ar(e)?yf:gf,r=n.findIndex(o=>o<t),i=t-n[r];return{month:r+1,day:i}}function Ms(e){const{year:t,month:n,day:r}=e,i=bf(t,n,r),o=vf(t,n,r);let s=Math.floor((i-o+10)/7),a;return s<1?(a=t-1,s=Ci(a)):s>Ci(t)?(a=t+1,s=1):a=t,{weekYear:a,weekNumber:s,weekday:o,...Ii(e)}}function Sf(e){const{weekYear:t,weekNumber:n,weekday:r}=e,i=vf(t,1,4),o=Tr(t);let s=n*7+r-i-3,a;s<1?(a=t-1,s+=Tr(a)):s>o?(a=t+1,s-=Tr(t)):a=t;const{month:l,day:u}=wf(a,s);return{year:a,month:l,day:u,...Ii(e)}}function Ns(e){const{year:t,month:n,day:r}=e,i=bf(t,n,r);return{year:t,ordinal:i,...Ii(e)}}function kf(e){const{year:t,ordinal:n}=e,{month:r,day:i}=wf(t,n);return{year:t,month:r,day:i,...Ii(e)}}function C0(e){const t=xi(e.weekYear),n=Yt(e.weekNumber,1,Ci(e.weekYear)),r=Yt(e.weekday,1,7);return t?n?r?!1:St("weekday",e.weekday):St("week",e.week):St("weekYear",e.weekYear)}function A0(e){const t=xi(e.year),n=Yt(e.ordinal,1,Tr(e.year));return t?n?!1:St("ordinal",e.ordinal):St("year",e.year)}function xf(e){const t=xi(e.year),n=Yt(e.month,1,12),r=Yt(e.day,1,Ei(e.year,e.month));return t?n?r?!1:St("day",e.day):St("month",e.month):St("year",e.year)}function Ef(e){const{hour:t,minute:n,second:r,millisecond:i}=e,o=Yt(t,0,23)||t===24&&n===0&&r===0&&i===0,s=Yt(n,0,59),a=Yt(r,0,59),l=Yt(i,0,999);return o?s?a?l?!1:St("millisecond",i):St("second",r):St("minute",n):St("hour",t)}const Ls="Invalid DateTime",Cf=864e13;function Li(e){return new It("unsupported zone",`the zone "${e.name}" is not supported`)}function _s(e){return e.weekData===null&&(e.weekData=Ms(e.c)),e.weekData}function _r(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new me({...n,...t,old:n})}function Af(e,t,n){let r=e-t*60*1e3;const i=n.offset(r);if(t===i)return[r,t];r-=(i-t)*60*1e3;const o=n.offset(r);return i===o?[r,i]:[e-Math.min(i,o)*60*1e3,Math.max(i,o)]}function Tf(e,t){e+=t*60*1e3;const n=new Date(e);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function _i(e,t,n){return Af(gs(e),t,n)}function If(e,t){const n=e.o,r=e.c.year+Math.trunc(t.years),i=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,o={...e.c,year:r,month:i,day:Math.min(e.c.day,Ei(r,i))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},s=Ee.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),a=gs(o);let[l,u]=Af(a,n,e.zone);return s!==0&&(l+=s,u=e.zone.offset(l)),{ts:l,o:u}}function Pr(e,t,n,r,i,o){const{setZone:s,zone:a}=n;if(e&&Object.keys(e).length!==0){const l=t||a,u=me.fromObject(e,{...n,zone:l,specificOffset:o});return s?u:u.setZone(a)}else return me.invalid(new It("unparsable",`the input "${i}" can't be parsed as ${r}`))}function Pi(e,t,n=!0){return e.isValid?ut.create(Re.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function Ps(e,t){const n=e.c.year>9999||e.c.year<0;let r="";return n&&e.c.year>=0&&(r+="+"),r+=Ve(e.c.year,n?6:4),t?(r+="-",r+=Ve(e.c.month),r+="-",r+=Ve(e.c.day)):(r+=Ve(e.c.month),r+=Ve(e.c.day)),r}function Of(e,t,n,r,i,o){let s=Ve(e.c.hour);return t?(s+=":",s+=Ve(e.c.minute),(e.c.second!==0||!n)&&(s+=":")):s+=Ve(e.c.minute),(e.c.second!==0||!n)&&(s+=Ve(e.c.second),(e.c.millisecond!==0||!r)&&(s+=".",s+=Ve(e.c.millisecond,3))),i&&(e.isOffsetFixed&&e.offset===0&&!o?s+="Z":e.o<0?(s+="-",s+=Ve(Math.trunc(-e.o/60)),s+=":",s+=Ve(Math.trunc(-e.o%60))):(s+="+",s+=Ve(Math.trunc(e.o/60)),s+=":",s+=Ve(Math.trunc(e.o%60)))),o&&(s+="["+e.zone.ianaName+"]"),s}const Df={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},T0={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},I0={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Mf=["year","month","day","hour","minute","second","millisecond"],O0=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],D0=["year","ordinal","hour","minute","second","millisecond"];function Nf(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new pc(e);return t}function Lf(e,t){const n=sn(t.zone,qe.defaultZone),r=Re.fromObject(t),i=qe.now();let o,s;if(ke(e.year))o=i;else{for(const u of Mf)ke(e[u])&&(e[u]=Df[u]);const a=xf(e)||Ef(e);if(a)return me.invalid(a);const l=n.offset(i);[o,s]=_i(e,l,n)}return new me({ts:o,zone:n,loc:r,o:s})}function _f(e,t,n){const r=ke(n.round)?!0:n.round,i=(s,a)=>(s=ms(s,r||n.calendary?0:2,!0),t.loc.clone(n).relFormatter(n).format(s,a)),o=s=>n.calendary?t.hasSame(e,s)?0:t.startOf(s).diff(e.startOf(s),s).get(s):t.diff(e,s).get(s);if(n.unit)return i(o(n.unit),n.unit);for(const s of n.units){const a=o(s);if(Math.abs(a)>=1)return i(a,s)}return i(e>t?-0:0,n.units[n.units.length-1])}function Pf(e){let t={},n;return e.length>0&&typeof e[e.length-1]=="object"?(t=e[e.length-1],n=Array.from(e).slice(0,e.length-1)):n=Array.from(e),[t,n]}class me{constructor(t){const n=t.zone||qe.defaultZone;let r=t.invalid||(Number.isNaN(t.ts)?new It("invalid input"):null)||(n.isValid?null:Li(n));this.ts=ke(t.ts)?qe.now():t.ts;let i=null,o=null;if(!r)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(n))[i,o]=[t.old.c,t.old.o];else{const a=n.offset(this.ts);i=Tf(this.ts,a),r=Number.isNaN(i.year)?new It("invalid input"):null,i=r?null:i,o=r?null:a}this._zone=n,this.loc=t.loc||Re.create(),this.invalid=r,this.weekData=null,this.c=i,this.o=o,this.isLuxonDateTime=!0}static now(){return new me({})}static local(){const[t,n]=Pf(arguments),[r,i,o,s,a,l,u]=n;return Lf({year:r,month:i,day:o,hour:s,minute:a,second:l,millisecond:u},t)}static utc(){const[t,n]=Pf(arguments),[r,i,o,s,a,l,u]=n;return t.zone=ot.utcInstance,Lf({year:r,month:i,day:o,hour:s,minute:a,second:l,millisecond:u},t)}static fromJSDate(t,n={}){const r=$b(t)?t.valueOf():NaN;if(Number.isNaN(r))return me.invalid("invalid input");const i=sn(n.zone,qe.defaultZone);return i.isValid?new me({ts:r,zone:i,loc:Re.fromObject(n)}):me.invalid(Li(i))}static fromMillis(t,n={}){if(Sn(t))return t<-Cf||t>Cf?me.invalid("Timestamp out of range"):new me({ts:t,zone:sn(n.zone,qe.defaultZone),loc:Re.fromObject(n)});throw new bt(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,n={}){if(Sn(t))return new me({ts:t*1e3,zone:sn(n.zone,qe.defaultZone),loc:Re.fromObject(n)});throw new bt("fromSeconds requires a numerical input")}static fromObject(t,n={}){t=t||{};const r=sn(n.zone,qe.defaultZone);if(!r.isValid)return me.invalid(Li(r));const i=qe.now(),o=ke(n.specificOffset)?r.offset(i):n.specificOffset,s=Ti(t,Nf),a=!ke(s.ordinal),l=!ke(s.year),u=!ke(s.month)||!ke(s.day),f=l||u,c=s.weekYear||s.weekNumber,h=Re.fromObject(n);if((f||a)&&c)throw new Cr("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&a)throw new Cr("Can't mix ordinal dates with month/day");const d=c||s.weekday&&!f;let m,p,g=Tf(i,o);d?(m=O0,p=T0,g=Ms(g)):a?(m=D0,p=I0,g=Ns(g)):(m=Mf,p=Df);let y=!1;for(const M of m){const P=s[M];ke(P)?y?s[M]=p[M]:s[M]=g[M]:y=!0}const v=d?C0(s):a?A0(s):xf(s),w=v||Ef(s);if(w)return me.invalid(w);const A=d?Sf(s):a?kf(s):s,[k,E]=_i(A,o,r),I=new me({ts:k,zone:r,o:E,loc:h});return s.weekday&&f&&t.weekday!==I.weekday?me.invalid("mismatched weekday",`you can't specify both a weekday of ${s.weekday} and a date of ${I.toISO()}`):I}static fromISO(t,n={}){const[r,i]=Ww(t);return Pr(r,i,n,"ISO 8601",t)}static fromRFC2822(t,n={}){const[r,i]=qw(t);return Pr(r,i,n,"RFC 2822",t)}static fromHTTP(t,n={}){const[r,i]=Yw(t);return Pr(r,i,n,"HTTP",n)}static fromFormat(t,n,r={}){if(ke(t)||ke(n))throw new bt("fromFormat requires an input string and a format");const{locale:i=null,numberingSystem:o=null}=r,s=Re.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0}),[a,l,u,f]=E0(s,t,n);return f?me.invalid(f):Pr(a,l,r,`format ${n}`,t,u)}static fromString(t,n,r={}){return me.fromFormat(t,n,r)}static fromSQL(t,n={}){const[r,i]=e0(t);return Pr(r,i,n,"SQL",t)}static invalid(t,n=null){if(!t)throw new bt("need to specify a reason the DateTime is invalid");const r=t instanceof It?t:new It(t,n);if(qe.throwOnInvalid)throw new Lb(r);return new me({invalid:r})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?_s(this).weekYear:NaN}get weekNumber(){return this.isValid?_s(this).weekNumber:NaN}get weekday(){return this.isValid?_s(this).weekday:NaN}get ordinal(){return this.isValid?Ns(this.c).ordinal:NaN}get monthShort(){return this.isValid?Ni.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Ni.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Ni.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Ni.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}get isInLeapYear(){return Ar(this.year)}get daysInMonth(){return Ei(this.year,this.month)}get daysInYear(){return this.isValid?Tr(this.year):NaN}get weeksInWeekYear(){return this.isValid?Ci(this.weekYear):NaN}resolvedLocaleOptions(t={}){const{locale:n,numberingSystem:r,calendar:i}=ut.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:i}}toUTC(t=0,n={}){return this.setZone(ot.instance(t),n)}toLocal(){return this.setZone(qe.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(t=sn(t,qe.defaultZone),t.equals(this.zone))return this;if(t.isValid){let i=this.ts;if(n||r){const o=t.offset(this.ts),s=this.toObject();[i]=_i(s,o,t)}return _r(this,{ts:i,zone:t})}else return me.invalid(Li(t))}reconfigure({locale:t,numberingSystem:n,outputCalendar:r}={}){const i=this.loc.clone({locale:t,numberingSystem:n,outputCalendar:r});return _r(this,{loc:i})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const n=Ti(t,Nf),r=!ke(n.weekYear)||!ke(n.weekNumber)||!ke(n.weekday),i=!ke(n.ordinal),o=!ke(n.year),s=!ke(n.month)||!ke(n.day),a=o||s,l=n.weekYear||n.weekNumber;if((a||i)&&l)throw new Cr("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(s&&i)throw new Cr("Can't mix ordinal dates with month/day");let u;r?u=Sf({...Ms(this.c),...n}):ke(n.ordinal)?(u={...this.toObject(),...n},ke(n.day)&&(u.day=Math.min(Ei(u.year,u.month),u.day))):u=kf({...Ns(this.c),...n});const[f,c]=_i(u,this.o,this.zone);return _r(this,{ts:f,o:c})}plus(t){if(!this.isValid)return this;const n=Ee.fromDurationLike(t);return _r(this,If(this,n))}minus(t){if(!this.isValid)return this;const n=Ee.fromDurationLike(t).negate();return _r(this,If(this,n))}startOf(t){if(!this.isValid)return this;const n={},r=Ee.normalizeUnit(t);switch(r){case"years":n.month=1;case"quarters":case"months":n.day=1;case"weeks":case"days":n.hour=0;case"hours":n.minute=0;case"minutes":n.second=0;case"seconds":n.millisecond=0;break}if(r==="weeks"&&(n.weekday=1),r==="quarters"){const i=Math.ceil(this.month/3);n.month=(i-1)*3+1}return this.set(n)}endOf(t){return this.isValid?this.plus({[t]:1}).startOf(t).minus(1):this}toFormat(t,n={}){return this.isValid?ut.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,t):Ls}toLocaleString(t=hs,n={}){return this.isValid?ut.create(this.loc.clone(n),t).formatDateTime(this):Ls}toLocaleParts(t={}){return this.isValid?ut.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:n=!1,suppressMilliseconds:r=!1,includeOffset:i=!0,extendedZone:o=!1}={}){if(!this.isValid)return null;const s=t==="extended";let a=Ps(this,s);return a+="T",a+=Of(this,s,n,r,i,o),a}toISODate({format:t="extended"}={}){return this.isValid?Ps(this,t==="extended"):null}toISOWeekDate(){return Pi(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:n=!1,includeOffset:r=!0,includePrefix:i=!1,extendedZone:o=!1,format:s="extended"}={}){return this.isValid?(i?"T":"")+Of(this,s==="extended",n,t,r,o):null}toRFC2822(){return Pi(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Pi(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?Ps(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:n=!1,includeOffsetSpace:r=!0}={}){let i="HH:mm:ss.SSS";return(n||t)&&(r&&(i+=" "),n?i+="z":t&&(i+="ZZ")),Pi(this,i,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():Ls}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const n={...this.c};return t.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,n="milliseconds",r={}){if(!this.isValid||!t.isValid)return Ee.invalid("created by diffing an invalid DateTime");const i={locale:this.locale,numberingSystem:this.numberingSystem,...r},o=zb(n).map(Ee.normalizeUnit),s=t.valueOf()>this.valueOf(),a=s?this:t,l=s?t:this,u=u0(a,l,o,i);return s?u.negate():u}diffNow(t="milliseconds",n={}){return this.diff(me.now(),t,n)}until(t){return this.isValid?ze.fromDateTimes(this,t):this}hasSame(t,n){if(!this.isValid)return!1;const r=t.valueOf(),i=this.setZone(t.zone,{keepLocalTime:!0});return i.startOf(n)<=r&&r<=i.endOf(n)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const n=t.base||me.fromObject({},{zone:this.zone}),r=t.padding?this<n?-t.padding:t.padding:0;let i=["years","months","days","hours","minutes","seconds"],o=t.unit;return Array.isArray(t.unit)&&(i=t.unit,o=void 0),_f(n,this.plus(r),{...t,numeric:"always",units:i,unit:o})}toRelativeCalendar(t={}){return this.isValid?_f(t.base||me.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(me.isDateTime))throw new bt("min requires all arguments be DateTimes");return Pc(t,n=>n.valueOf(),Math.min)}static max(...t){if(!t.every(me.isDateTime))throw new bt("max requires all arguments be DateTimes");return Pc(t,n=>n.valueOf(),Math.max)}static fromFormatExplain(t,n,r={}){const{locale:i=null,numberingSystem:o=null}=r,s=Re.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0});return mf(s,t,n)}static fromStringExplain(t,n,r={}){return me.fromFormatExplain(t,n,r)}static get DATE_SHORT(){return hs}static get DATE_MED(){return mc}static get DATE_MED_WITH_WEEKDAY(){return Fb}static get DATE_FULL(){return gc}static get DATE_HUGE(){return yc}static get TIME_SIMPLE(){return vc}static get TIME_WITH_SECONDS(){return bc}static get TIME_WITH_SHORT_OFFSET(){return wc}static get TIME_WITH_LONG_OFFSET(){return Sc}static get TIME_24_SIMPLE(){return kc}static get TIME_24_WITH_SECONDS(){return xc}static get TIME_24_WITH_SHORT_OFFSET(){return Ec}static get TIME_24_WITH_LONG_OFFSET(){return Cc}static get DATETIME_SHORT(){return Ac}static get DATETIME_SHORT_WITH_SECONDS(){return Tc}static get DATETIME_MED(){return Ic}static get DATETIME_MED_WITH_SECONDS(){return Oc}static get DATETIME_MED_WITH_WEEKDAY(){return Rb}static get DATETIME_FULL(){return Dc}static get DATETIME_FULL_WITH_SECONDS(){return Mc}static get DATETIME_HUGE(){return Nc}static get DATETIME_HUGE_WITH_SECONDS(){return Lc}}function Fr(e){if(me.isDateTime(e))return e;if(e&&e.valueOf&&Sn(e.valueOf()))return me.fromJSDate(e);if(e&&typeof e=="object")return me.fromObject(e);throw new bt(`Unknown datetime argument: ${e}, of type ${typeof e}`)}function M0(e){const t=typeof e=="string"?me.fromISO(e):me.fromJSDate(e);if(!t.isValid)return"Invalid date";const r=me.now().diff(t,["years","months","days","hours","minutes"]).toObject();return r.years&&r.years>=1?`${Math.floor(r.years)} year${Math.floor(r.years)>1?"s":""} ago`:r.months&&r.months>=1?`${Math.floor(r.months)} month${Math.floor(r.months)>1?"s":""} ago`:r.days&&r.days>=1?`${Math.floor(r.days)} day${Math.floor(r.days)>1?"s":""} ago`:r.hours&&r.hours>=1?`${Math.floor(r.hours)}h ago`:r.minutes&&r.minutes>=1?`${Math.floor(r.minutes)}m ago`:"just now"}function Fs(e){if(!/^#?([a-fA-F\d]{6}|[a-fA-F\d]{3})$/.test(e))return{r:0,g:0,b:0};const n=e.replace(/^#/,"");let r=n;n.length===3&&(r=n.split("").map(l=>l+l).join(""));const i=parseInt(r,16),o=i>>16&255,s=i>>8&255,a=i&255;return{r:o,g:s,b:a}}function N0(e){return`#${((1<<24)+(e.r<<16)+(e.g<<8)+e.b).toString(16).slice(1)}`}const L0=(e,t=30)=>{const n=Math.min(e.r,e.g,e.b),r=Math.max(e.r,e.g,e.b,n+1);return{r:Math.floor((e.r-n)/(r-n)*t*(1-.299)+120-t/2),g:Math.floor((e.g-n)/(r-n)*t*(1-.587)+120-t/2),b:Math.floor((e.b-n)/(r-n)*t*(1-.114)+120-t/2)}};function Ff(e){return Object.entries(e).reduce((t,[n,r])=>{const i=n.replace(/(\d+)/,o=>(1e3-parseInt(o)).toString());return{...t,[i]:r}},{})}const _0=2.4,P0=.2126729,F0=.7151522,R0=.072175,B0=.56,$0=.57,z0=.62,H0=.65,Fi=.022,Rf=1.414,U0=1.14,j0=1.14,V0=.035991,W0=27.7847239587675,q0=27.7847239587675,Bf=.027,$f=.027,zf=.001,Y0=5e-4;function Hf(e){const{r:t,g:n,b:r}=e,i=o=>(o/255)**_0;return P0*i(t)+F0*i(n)+R0*i(r)}function Uf(e,t){if(!e||!t)return 0;let n=Hf(Fs(e)),r=Hf(Fs(t)),i=0,o=0;return n=n>Fi?n:n+(Fi-n)**Rf,r=r>Fi?r:r+(Fi-r)**Rf,Math.abs(r-n)<Y0?0:(r>n?(i=(r**B0-n**$0)*U0,o=i<zf?0:i<V0?i-i*W0*Bf:i-Bf):(i=(r**H0-n**z0)*j0,o=i>-zf?0:i>-.035991?i-i*q0*$f:i+$f),Math.abs(o*100))}const K0=(e,t,n)=>{const r=e;let i=0;for(;t.some(o=>n(o)===e);)i+=1,e=`${r} (${i})`;return e};function jf(e){const{fontFamily:t,...n}=e,r=Vf(n);return Qu(".bpReset",{...r,"font-family":`'${t}', sans-serif`})+Qu(":host, :root",{...r})}function Vf(e){const{radius:t,themeMode:n,color:r,variant:i,headerVariant:o}=e;let s={},a={};if(r){const h=dc(r),d=n==="dark"?Ff(h):h,m=dc(N0(L0(Fs(r)))),p=n==="dark"?Ff(m):m,g=n==="dark"?"#101010":"#fdfdfd";a=Object.entries({...d,1:g}).reduce((v,[w,A])=>({...v,[`--bpPrimary-${w}`]:A}),{});const y=Object.entries({...p,1:g}).reduce((v,[w,A])=>({...v,[`--bpGray-${w}`]:A}),{});s={...a,...y}}t&&(s={...s,"--bpRadius-scale":t.toString()});const l=n==="dark"?{bg:"var(--transparent-dark)",bgHover:"var(--transparent-dark-hover)"}:{bg:"var(--transparent-light)",bgHover:"var(--transparent-light-hover)"},u=a?Uf(a["--bpPrimary-600"],a["--bpPrimary-50"])>40?"var(--bpPrimary-50)":"var(--bpPrimary-900)":"var(--bpPrimary-50)",f=i==="solid"?{"--message-bg":"var(--bpPrimary-600)","--message-bg-hover":"var(--bpPrimary-700)","--message-text":u,"--send-button-bg":"var(--bpPrimary-600)","--send-button-bg-hover":"var(--bpPrimary-700)","--send-button-text":"var(--bpPrimary-50)","--button-bg":"var(--bpPrimary-200)","--button-bg-hover":"var(--bpPrimary-300)","--button-text":"var(--bpPrimary-800)","--fab-bg":"var(--bpPrimary-600)","--fab-bg-hover":"var(--bpPrimary-700)","--fab-icon":u,"--modal-submit-bg":"var(--bpPrimary-600)","--modal-submit-bg-hover":"var(--bpPrimary-700)"}:{"--message-bg":"var(--bpPrimary-100)","--message-bg-hover":"var(--bpPrimary-200)","--message-text":"var(--bpPrimary-900)","--send-button-bg":"var(--bpPrimary-600)","--send-button-bg-hover":"var(--bpPrimary-700)","--send-button-text":"var(--bpPrimary-50)","--button-bg":"var(--bpPrimary-500)","--button-bg-hover":"var(--bpPrimary-600)","--button-text":a?Uf(a["--bpPrimary-500"],a["--bpPrimary-50"])>40?"var(--bpPrimary-50)":"var(--bpPrimary-900)":"var(--bpPrimary-50)","--fab-bg":"var(--bpPrimary-100)","--fab-bg-hover":"var(--bpPrimary-200)","--fab-icon":"var(--bpPrimary-700)","--scrollbar":"var(--bpGray-500)","--scrollbar-hover":"var(--bpGray-400)","--modal-submit-bg":"var(--bpPrimary-200)","--modal-submit-bg-hover":"var(--bpPrimary-300)"},c=o==="solid"?{"--header-bg":"var(--bpPrimary-600)","--header-bg-hover":"var(--bpPrimary-700)","--header-hover-dark":"var(--bpPrimary-800)","--header-title":u,"--header-description":u,"--header-description-icon":u,"--header-description-link":u,"--header-avatar-bg":"var(--bpPrimary-300)","--header-avatar-text":"var(--bpPrimary-700)"}:{"--header-bg":l.bg,"--header-bg-hover":l.bgHover,"--header-hover-dark":"var(--bpGray-200)","--header-title":"var(--bpGray-900)","--header-description":"var(--bpGray-600)","--header-description-icon":"var(--bpPrimary-700)","--header-description-link":"var(--bpPrimary-800)","--header-avatar-bg":"var(--bpPrimary-600)","--header-avatar-text":"var(--bpPrimary-50)"};return{...s,...f,...c}}const G0=e=>{if(typeof URL.canParse=="function")return URL.canParse(e);try{return new URL(e),!0}catch{return!1}},Wf=["audio","file","image","video"],qf=e=>Wf.includes(e),Yf="The Client ID is required to initialize the webchat.",Q0="The API url is required to initialize the webchat.",Z0="The Bot ID is required to initialize the webchat.",J0="No config URL provided.",Kf=`Invalid API URL.
18
18
  Please use a valid API URL.`,Gf=`Invalid Client ID.
19
19
  Please use a valid Botpress Client ID.`,Qf=`Invalid URL.
20
20
  Please make sure your client ID and API URL are valid`,X0=`Invalid config URL.
@@ -23,21 +23,21 @@ Please make sure your config file is valid`,t1="Access denied to configuration f
23
23
  Please check back later.`,Jf=`This bot has temporarily paused.
24
24
  Please check back later.`,Rs="Something went wrong. To fix it, please clear your browser's local and session storage and then refresh the page",Ri="Please check your internet connection and refresh the page.",Xf=`You've been disconnected from the conversation.
25
25
  Please refresh the page.`,ed=`Unable to process the message.
26
- Please start a new conversation.`,Bs={ResourceNotFound:{type:"configuration",message:Gf},Forbidden:{type:"bot",message:Zf}},$s={MethodNotFound:{type:"configuration",message:Qf},QuotaExceeded:{type:"bot",message:Jf},Forbidden:{type:"bot",message:Rs}};function td(e){return e in Bs}function nd(e){return e in $s}function rd(e){return e!==null&&typeof e=="object"&&"id"in e&&"code"in e&&"type"in e}function id(e){return e!==null&&typeof e=="object"&&"type"in e&&e.type==="error"&&"message"in e&&typeof e.message=="string"}const od=async(e,t=3,n=1e3)=>{let r;for(let i=1;i<=t;i++)try{return await e()}catch(o){if(r=o,i===t)throw r;const s=n*Math.pow(2,i-1);await new Promise(a=>setTimeout(a,s))}throw new Error("Unreachable: retry loop should always return or throw")},n1=["networkerror","failedtofetch","errorininputstream"],Rr=e=>{var n;console.error("An error occurred:",e);let t={type:"unknown",message:"An unexpected error occurred"};if(rd(e))e.type==="network"?t={id:e.id,type:"network",message:Ri}:(n=e.message)!=null&&n.includes("[Webhook Handler]")&&td(e.type)?t={id:e.id,...Bs[e.type]}:nd(e.type)?t={id:e.id,...$s[e.type]}:t={id:e.id,type:e.type,message:e.message||"An error occurred"};else if(id(e))sd(e.message)?t={type:"disconnected",message:Xf}:ad(e.message).includes("invalidcontenttype")?t={type:"bot",message:ed}:t={type:"event",message:e.message};else if(e instanceof Error&&sd(e.message))t={type:"network",message:Ri};else if(e&&typeof e=="object"&&"type"in e&&"message"in e){const r=e;r.type==="network"?t={type:"network",message:Ri}:t={type:r.type,message:r.message}}return t};function sd(e){return n1.some(t=>ad(e).includes(t))}function ad(e){return e.replaceAll(" ","").toLowerCase()}const r1=(e,t)=>{if(!e)return{type:"configuration",message:Yf};if(!G0(t))return{type:"configuration",message:Kf}},i1=e=>new Promise((t,n)=>{const r=new FileReader;r.onload=i=>{var o;return t((o=i.target)==null?void 0:o.result)},r.onerror=i=>{var o;return n((o=i.target)==null?void 0:o.error)},r.readAsArrayBuffer(e)});function o1(e,t,n,r){let i;return t&&e?i={conversationId:e,userToken:t}:t?i={conversationId:void 0,userToken:t}:i={conversationId:n,userToken:r},i}const Cn=D.forwardRef(({userId:e,src:t,container:n,image:r,fallback:i,...o},s)=>{const a=Zu(e??"",15);return x.jsxs(cs,{ref:s,"data-color":a,...n,...o,children:[x.jsx(fs,{src:t,...r}),x.jsx(ds,{...i,children:typeof o.children=="string"?o.children[0]:o.children})]})});Cn.displayName="Avatar";function z2(){}function H2(){}function s1(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const a1=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,l1=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,u1={};function ld(e,t){return(u1.jsx?l1:a1).test(e)}const c1=/[ \t\n\f\r]/g;function f1(e){return typeof e=="object"?e.type==="text"?ud(e.value):!1:ud(e)}function ud(e){return e.replace(c1,"")===""}class Br{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Br.prototype.normal={},Br.prototype.property={},Br.prototype.space=void 0;function cd(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Br(n,r,t)}function zs(e){return e.toLowerCase()}class ct{constructor(t,n){this.attribute=n,this.property=t}}ct.prototype.attribute="",ct.prototype.booleanish=!1,ct.prototype.boolean=!1,ct.prototype.commaOrSpaceSeparated=!1,ct.prototype.commaSeparated=!1,ct.prototype.defined=!1,ct.prototype.mustUseProperty=!1,ct.prototype.number=!1,ct.prototype.overloadedBoolean=!1,ct.prototype.property="",ct.prototype.spaceSeparated=!1,ct.prototype.space=void 0;let d1=0;const ge=An(),We=An(),Hs=An(),Z=An(),Le=An(),Wn=An(),mt=An();function An(){return 2**++d1}const Us=Object.freeze(Object.defineProperty({__proto__:null,boolean:ge,booleanish:We,commaOrSpaceSeparated:mt,commaSeparated:Wn,number:Z,overloadedBoolean:Hs,spaceSeparated:Le},Symbol.toStringTag,{value:"Module"})),js=Object.keys(Us);class Vs extends ct{constructor(t,n,r,i){let o=-1;if(super(t,n),fd(this,"space",i),typeof r=="number")for(;++o<js.length;){const s=js[o];fd(this,js[o],(r&Us[s])===Us[s])}}}Vs.prototype.defined=!0;function fd(e,t,n){n&&(e[t]=n)}function qn(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new Vs(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[zs(r)]=r,n[zs(o.attribute)]=r}return new Br(t,n,e.space)}const dd=qn({properties:{ariaActiveDescendant:null,ariaAtomic:We,ariaAutoComplete:null,ariaBusy:We,ariaChecked:We,ariaColCount:Z,ariaColIndex:Z,ariaColSpan:Z,ariaControls:Le,ariaCurrent:null,ariaDescribedBy:Le,ariaDetails:null,ariaDisabled:We,ariaDropEffect:Le,ariaErrorMessage:null,ariaExpanded:We,ariaFlowTo:Le,ariaGrabbed:We,ariaHasPopup:null,ariaHidden:We,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Le,ariaLevel:Z,ariaLive:null,ariaModal:We,ariaMultiLine:We,ariaMultiSelectable:We,ariaOrientation:null,ariaOwns:Le,ariaPlaceholder:null,ariaPosInSet:Z,ariaPressed:We,ariaReadOnly:We,ariaRelevant:null,ariaRequired:We,ariaRoleDescription:Le,ariaRowCount:Z,ariaRowIndex:Z,ariaRowSpan:Z,ariaSelected:We,ariaSetSize:Z,ariaSort:null,ariaValueMax:Z,ariaValueMin:Z,ariaValueNow:Z,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function hd(e,t){return t in e?e[t]:t}function pd(e,t){return hd(e,t.toLowerCase())}const h1=qn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Wn,acceptCharset:Le,accessKey:Le,action:null,allow:null,allowFullScreen:ge,allowPaymentRequest:ge,allowUserMedia:ge,alt:null,as:null,async:ge,autoCapitalize:null,autoComplete:Le,autoFocus:ge,autoPlay:ge,blocking:Le,capture:null,charSet:null,checked:ge,cite:null,className:Le,cols:Z,colSpan:null,content:null,contentEditable:We,controls:ge,controlsList:Le,coords:Z|Wn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ge,defer:ge,dir:null,dirName:null,disabled:ge,download:Hs,draggable:We,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ge,formTarget:null,headers:Le,height:Z,hidden:Hs,high:Z,href:null,hrefLang:null,htmlFor:Le,httpEquiv:Le,id:null,imageSizes:null,imageSrcSet:null,inert:ge,inputMode:null,integrity:null,is:null,isMap:ge,itemId:null,itemProp:Le,itemRef:Le,itemScope:ge,itemType:Le,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ge,low:Z,manifest:null,max:null,maxLength:Z,media:null,method:null,min:null,minLength:Z,multiple:ge,muted:ge,name:null,nonce:null,noModule:ge,noValidate:ge,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ge,optimum:Z,pattern:null,ping:Le,placeholder:null,playsInline:ge,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ge,referrerPolicy:null,rel:Le,required:ge,reversed:ge,rows:Z,rowSpan:Z,sandbox:Le,scope:null,scoped:ge,seamless:ge,selected:ge,shadowRootClonable:ge,shadowRootDelegatesFocus:ge,shadowRootMode:null,shape:null,size:Z,sizes:null,slot:null,span:Z,spellCheck:We,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Z,step:null,style:null,tabIndex:Z,target:null,title:null,translate:null,type:null,typeMustMatch:ge,useMap:null,value:We,width:Z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Le,axis:null,background:null,bgColor:null,border:Z,borderColor:null,bottomMargin:Z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ge,declare:ge,event:null,face:null,frame:null,frameBorder:null,hSpace:Z,leftMargin:Z,link:null,longDesc:null,lowSrc:null,marginHeight:Z,marginWidth:Z,noResize:ge,noHref:ge,noShade:ge,noWrap:ge,object:null,profile:null,prompt:null,rev:null,rightMargin:Z,rules:null,scheme:null,scrolling:We,standby:null,summary:null,text:null,topMargin:Z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Z,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ge,disableRemotePlayback:ge,prefix:null,property:null,results:Z,security:null,unselectable:null},space:"html",transform:pd}),p1=qn({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:mt,accentHeight:Z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Z,amplitude:Z,arabicForm:null,ascent:Z,attributeName:null,attributeType:null,azimuth:Z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Z,by:null,calcMode:null,capHeight:Z,className:Le,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Z,diffuseConstant:Z,direction:null,display:null,dur:null,divisor:Z,dominantBaseline:null,download:ge,dx:null,dy:null,edgeMode:null,editable:null,elevation:Z,enableBackground:null,end:null,event:null,exponent:Z,externalResourcesRequired:null,fill:null,fillOpacity:Z,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Wn,g2:Wn,glyphName:Wn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Z,horizOriginX:Z,horizOriginY:Z,id:null,ideographic:Z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Z,k:Z,k1:Z,k2:Z,k3:Z,k4:Z,kernelMatrix:mt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Z,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Z,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Z,overlineThickness:Z,paintOrder:null,panose1:null,path:null,pathLength:Z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Le,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Z,pointsAtY:Z,pointsAtZ:Z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:mt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:mt,rev:mt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:mt,requiredFeatures:mt,requiredFonts:mt,requiredFormats:mt,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Z,specularExponent:Z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Z,strikethroughThickness:Z,string:null,stroke:null,strokeDashArray:mt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Z,strokeOpacity:Z,strokeWidth:null,style:null,surfaceScale:Z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:mt,tabIndex:Z,tableValues:null,target:null,targetX:Z,targetY:Z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:mt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Z,underlineThickness:Z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Z,values:null,vAlphabetic:Z,vMathematical:Z,vectorEffect:null,vHanging:Z,vIdeographic:Z,version:null,vertAdvY:Z,vertOriginX:Z,vertOriginY:Z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:hd}),md=qn({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),gd=qn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:pd}),yd=qn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),m1={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},g1=/[A-Z]/g,vd=/-[a-z]/g,y1=/^data[-\w.:]+$/i;function v1(e,t){const n=zs(t);let r=t,i=ct;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&y1.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(vd,w1);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!vd.test(o)){let s=o.replace(g1,b1);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=Vs}return new i(r,t)}function b1(e){return"-"+e.toLowerCase()}function w1(e){return e.charAt(1).toUpperCase()}const S1=cd([dd,h1,md,gd,yd],"html"),Ws=cd([dd,p1,md,gd,yd],"svg");function k1(e){return e.join(" ").trim()}var qs={},bd=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,x1=/\n/g,E1=/^\s*/,C1=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,A1=/^:\s*/,T1=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,I1=/^[;\s]*/,O1=/^\s+|\s+$/g,D1=`
27
- `,wd="/",Sd="*",Tn="",M1="comment",N1="declaration";function L1(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(m){var p=m.match(x1);p&&(n+=p.length);var g=m.lastIndexOf(D1);r=~g?m.length-g:r+m.length}function o(){var m={line:n,column:r};return function(p){return p.position=new s(m),u(),p}}function s(m){this.start=m,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function a(m){var p=new Error(t.source+":"+n+":"+r+": "+m);if(p.reason=m,p.filename=t.source,p.line=n,p.column=r,p.source=e,!t.silent)throw p}function l(m){var p=m.exec(e);if(p){var g=p[0];return i(g),e=e.slice(g.length),p}}function u(){l(E1)}function f(m){var p;for(m=m||[];p=c();)p!==!1&&m.push(p);return m}function c(){var m=o();if(!(wd!=e.charAt(0)||Sd!=e.charAt(1))){for(var p=2;Tn!=e.charAt(p)&&(Sd!=e.charAt(p)||wd!=e.charAt(p+1));)++p;if(p+=2,Tn===e.charAt(p-1))return a("End of comment missing");var g=e.slice(2,p-2);return r+=2,i(g),e=e.slice(p),r+=2,m({type:M1,comment:g})}}function h(){var m=o(),p=l(C1);if(p){if(c(),!l(A1))return a("property missing ':'");var g=l(T1),v=m({type:N1,property:kd(p[0].replace(bd,Tn)),value:g?kd(g[0].replace(bd,Tn)):Tn});return l(I1),v}}function d(){var m=[];f(m);for(var p;p=h();)p!==!1&&(m.push(p),f(m));return m}return u(),d()}function kd(e){return e?e.replace(O1,Tn):Tn}var _1=L1,P1=vn&&vn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(qs,"__esModule",{value:!0}),qs.default=R1;const F1=P1(_1);function R1(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,F1.default)(e),i=typeof t=="function";return r.forEach(o=>{if(o.type!=="declaration")return;const{property:s,value:a}=o;i?t(s,a,o):a&&(n=n||{},n[s]=a)}),n}var Bi={};Object.defineProperty(Bi,"__esModule",{value:!0}),Bi.camelCase=void 0;var B1=/^--[a-zA-Z0-9_-]+$/,$1=/-([a-z])/g,z1=/^[^-]+$/,H1=/^-(webkit|moz|ms|o|khtml)-/,U1=/^-(ms)-/,j1=function(e){return!e||z1.test(e)||B1.test(e)},V1=function(e,t){return t.toUpperCase()},xd=function(e,t){return"".concat(t,"-")},W1=function(e,t){return t===void 0&&(t={}),j1(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(U1,xd):e=e.replace(H1,xd),e.replace($1,V1))};Bi.camelCase=W1;var q1=vn&&vn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Y1=q1(qs),K1=Bi;function Ys(e,t){var n={};return!e||typeof e!="string"||(0,Y1.default)(e,function(r,i){r&&i&&(n[(0,K1.camelCase)(r,t)]=i)}),n}Ys.default=Ys;var G1=Ys;const Q1=bn(G1),Ed=Cd("end"),Ks=Cd("start");function Cd(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Z1(e){const t=Ks(e),n=Ed(e);if(t&&n)return{start:t,end:n}}function $r(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Ad(e.position):"start"in e||"end"in e?Ad(e):"line"in e||"column"in e?Gs(e):""}function Gs(e){return Td(e&&e.line)+":"+Td(e&&e.column)}function Ad(e){return Gs(e&&e.start)+"-"+Gs(e&&e.end)}function Td(e){return e&&typeof e=="number"?e:1}class tt extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=$r(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}tt.prototype.file="",tt.prototype.name="",tt.prototype.reason="",tt.prototype.message="",tt.prototype.stack="",tt.prototype.column=void 0,tt.prototype.line=void 0,tt.prototype.ancestors=void 0,tt.prototype.cause=void 0,tt.prototype.fatal=void 0,tt.prototype.place=void 0,tt.prototype.ruleId=void 0,tt.prototype.source=void 0;const Qs={}.hasOwnProperty,J1=new Map,X1=/[A-Z]/g,eS=new Set(["table","tbody","thead","tfoot","tr"]),tS=new Set(["td","th"]),Id="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function nS(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=cS(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=uS(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Ws:S1,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=Od(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function Od(e,t,n){if(t.type==="element")return rS(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return iS(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return sS(e,t,n);if(t.type==="mdxjsEsm")return oS(e,t);if(t.type==="root")return aS(e,t,n);if(t.type==="text")return lS(e,t)}function rS(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Ws,e.schema=i),e.ancestors.push(t);const o=Md(e,t.tagName,!1),s=fS(e,t);let a=Js(e,t);return eS.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!f1(l):!0})),Dd(e,s,o,t),Zs(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function iS(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}zr(e,t.position)}function oS(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);zr(e,t.position)}function sS(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Ws,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:Md(e,t.name,!0),s=dS(e,t),a=Js(e,t);return Dd(e,s,o,t),Zs(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function aS(e,t,n){const r={};return Zs(r,Js(e,t)),e.create(t,e.Fragment,r,n)}function lS(e,t){return t.value}function Dd(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Zs(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function uS(e,t,n){return r;function r(i,o,s,a){const u=Array.isArray(s.children)?n:t;return a?u(o,s,a):u(o,s)}}function cS(e,t){return n;function n(r,i,o,s){const a=Array.isArray(o.children),l=Ks(r);return t(i,o,s,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function fS(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Qs.call(t.properties,i)){const o=hS(e,i,t.properties[i]);if(o){const[s,a]=o;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&tS.has(t.tagName)?r=a:n[s]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function dS(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else zr(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else zr(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Js(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:J1;for(;++r<t.children.length;){const o=t.children[r];let s;if(e.passKeys){const l=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(l){const u=i.get(l)||0;s=l+"-"+u,i.set(l,u+1)}}const a=Od(e,o,s);a!==void 0&&n.push(a)}return n}function hS(e,t,n){const r=v1(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?s1(n):k1(n)),r.property==="style"){let i=typeof n=="object"?n:pS(e,String(n));return e.stylePropertyNameCase==="css"&&(i=mS(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?m1[r.property]||r.property:r.attribute,n]}}function pS(e,t){try{return Q1(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new tt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Id+"#cannot-parse-style-attribute",i}}function Md(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,s;for(;++o<i.length;){const a=ld(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=s}else r=ld(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Qs.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);zr(e)}function zr(e,t){const n=new tt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Id+"#cannot-handle-mdx-estrees-without-createevaluater",n}function mS(e){const t={};let n;for(n in e)Qs.call(e,n)&&(t[gS(n)]=e[n]);return t}function gS(e){let t=e.replace(X1,yS);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function yS(e){return"-"+e.toLowerCase()}const Xs={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},vS={};function ea(e,t){const n=vS,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Nd(e,r,i)}function Nd(e,t,n){if(bS(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Ld(e.children,t,n)}return Array.isArray(e)?Ld(e,t,n):""}function Ld(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Nd(e[i],t,n);return r.join("")}function bS(e){return!!(e&&typeof e=="object")}const _d=document.createElement("i");function ta(e){const t="&"+e+";";_d.innerHTML=t;const n=_d.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function gt(e,t,n,r){const i=e.length;let o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function kt(e,t){return e.length>0?(gt(e,e.length,0,t),e):t}const Pd={}.hasOwnProperty;function Fd(e){const t={};let n=-1;for(;++n<e.length;)wS(t,e[n]);return t}function wS(e,t){let n;for(n in t){const i=(Pd.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){Pd.call(i,s)||(i[s]=[]);const a=o[s];SS(i[s],Array.isArray(a)?a:a?[a]:[])}}}function SS(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);gt(e,0,0,r)}function Rd(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Mt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const st=an(/[A-Za-z]/),nt=an(/[\dA-Za-z]/),kS=an(/[#-'*+\--9=?A-Z^-~]/);function $i(e){return e!==null&&(e<32||e===127)}const na=an(/\d/),xS=an(/[\dA-Fa-f]/),ES=an(/[!-/:-@[-`{-~]/);function ce(e){return e!==null&&e<-2}function Me(e){return e!==null&&(e<0||e===32)}function ve(e){return e===-2||e===-1||e===32}const zi=an(new RegExp("\\p{P}|\\p{S}","u")),In=an(/\s/);function an(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Yn(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(o===37&&nt(e.charCodeAt(n+1))&&nt(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Ee(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(l){return ve(l)?(e.enter(n),a(l)):t(l)}function a(l){return ve(l)&&o++<i?(e.consume(l),a):(e.exit(n),t(l))}}const CS={tokenize:AS};function AS(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Ee(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return ce(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),s)}}const TS={tokenize:IS},Bd={tokenize:OS};function IS(e){const t=this,n=[];let r=0,i,o,s;return a;function a(w){if(r<n.length){const A=n[r];return t.containerState=A[1],e.attempt(A[0].continuation,l,u)(w)}return u(w)}function l(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&y();const A=t.events.length;let k=A,E;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){E=t.events[k][1].end;break}v(r);let I=A;for(;I<t.events.length;)t.events[I][1].end={...E},I++;return gt(t.events,k+1,0,t.events.slice(A)),t.events.length=I,u(w)}return a(w)}function u(w){if(r===n.length){if(!i)return h(w);if(i.currentConstruct&&i.currentConstruct.concrete)return m(w);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Bd,f,c)(w)}function f(w){return i&&y(),v(r),h(w)}function c(w){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,m(w)}function h(w){return t.containerState={},e.attempt(Bd,d,m)(w)}function d(w){return r++,n.push([t.currentConstruct,t.containerState]),h(w)}function m(w){if(w===null){i&&y(),v(0),e.consume(w);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),p(w)}function p(w){if(w===null){g(e.exit("chunkFlow"),!0),v(0),e.consume(w);return}return ce(w)?(e.consume(w),g(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(w),p)}function g(w,A){const k=t.sliceStream(w);if(A&&k.push(null),w.previous=o,o&&(o.next=w),o=w,i.defineSkip(w.start),i.write(k),t.parser.lazy[w.start.line]){let E=i.events.length;for(;E--;)if(i.events[E][1].start.offset<s&&(!i.events[E][1].end||i.events[E][1].end.offset>s))return;const I=t.events.length;let M=I,L,T;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){if(L){T=t.events[M][1].end;break}L=!0}for(v(r),E=I;E<t.events.length;)t.events[E][1].end={...T},E++;gt(t.events,M+1,0,t.events.slice(I)),t.events.length=E}}function v(w){let A=n.length;for(;A-- >w;){const k=n[A];t.containerState=k[1],k[0].exit.call(t,e)}n.length=w}function y(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function OS(e,t,n){return Ee(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Kn(e){if(e===null||Me(e)||In(e))return 1;if(zi(e))return 2}function Hi(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const ra={name:"attention",resolveAll:DS,tokenize:MS};function DS(e,t){let n=-1,r,i,o,s,a,l,u,f;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const c={...e[r][1].end},h={...e[n][1].start};$d(c,-l),$d(h,l),s={type:l>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},o={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[r][1].end={...s.start},e[n][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=kt(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=kt(u,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),u=kt(u,Hi(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=kt(u,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,u=kt(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,gt(e,r-1,n-r+3,u),n=r+u.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function MS(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Kn(r);let o;return s;function s(l){return o=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===o)return e.consume(l),a;const u=e.exit("attentionSequence"),f=Kn(l),c=!f||f===2&&i||n.includes(l),h=!i||i===2&&f||n.includes(r);return u._open=!!(o===42?c:c&&(i||!h)),u._close=!!(o===42?h:h&&(f||!c)),t(l)}}function $d(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const NS={name:"autolink",tokenize:LS};function LS(e,t,n){let r=0;return i;function i(d){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(d){return st(d)?(e.consume(d),s):d===64?n(d):u(d)}function s(d){return d===43||d===45||d===46||nt(d)?(r=1,a(d)):u(d)}function a(d){return d===58?(e.consume(d),r=0,l):(d===43||d===45||d===46||nt(d))&&r++<32?(e.consume(d),a):(r=0,u(d))}function l(d){return d===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):d===null||d===32||d===60||$i(d)?n(d):(e.consume(d),l)}function u(d){return d===64?(e.consume(d),f):kS(d)?(e.consume(d),u):n(d)}function f(d){return nt(d)?c(d):n(d)}function c(d){return d===46?(e.consume(d),r=0,f):d===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):h(d)}function h(d){if((d===45||nt(d))&&r++<63){const m=d===45?h:c;return e.consume(d),m}return n(d)}}const Hr={partial:!0,tokenize:_S};function _S(e,t,n){return r;function r(o){return ve(o)?Ee(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||ce(o)?t(o):n(o)}}const zd={continuation:{tokenize:FS},exit:RS,name:"blockQuote",tokenize:PS};function PS(e,t,n){const r=this;return i;function i(s){if(s===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return ve(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function FS(e,t,n){const r=this;return i;function i(s){return ve(s)?Ee(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(zd,t,n)(s)}}function RS(e){e.exit("blockQuote")}const Hd={name:"characterEscape",tokenize:BS};function BS(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return ES(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const Ud={name:"characterReference",tokenize:$S};function $S(e,t,n){const r=this;let i=0,o,s;return a;function a(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),l}function l(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),o=31,s=nt,f(c))}function u(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=xS,f):(e.enter("characterReferenceValue"),o=7,s=na,f(c))}function f(c){if(c===59&&i){const h=e.exit("characterReferenceValue");return s===nt&&!ta(r.sliceSerialize(h))?n(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(c)&&i++<o?(e.consume(c),f):n(c)}}const jd={partial:!0,tokenize:HS},Vd={concrete:!0,name:"codeFenced",tokenize:zS};function zS(e,t,n){const r=this,i={partial:!0,tokenize:k};let o=0,s=0,a;return l;function l(E){return u(E)}function u(E){const I=r.events[r.events.length-1];return o=I&&I[1].type==="linePrefix"?I[2].sliceSerialize(I[1],!0).length:0,a=E,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(E)}function f(E){return E===a?(s++,e.consume(E),f):s<3?n(E):(e.exit("codeFencedFenceSequence"),ve(E)?Ee(e,c,"whitespace")(E):c(E))}function c(E){return E===null||ce(E)?(e.exit("codeFencedFence"),r.interrupt?t(E):e.check(jd,p,A)(E)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(E))}function h(E){return E===null||ce(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(E)):ve(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ee(e,d,"whitespace")(E)):E===96&&E===a?n(E):(e.consume(E),h)}function d(E){return E===null||ce(E)?c(E):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(E))}function m(E){return E===null||ce(E)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(E)):E===96&&E===a?n(E):(e.consume(E),m)}function p(E){return e.attempt(i,A,g)(E)}function g(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),v}function v(E){return o>0&&ve(E)?Ee(e,y,"linePrefix",o+1)(E):y(E)}function y(E){return E===null||ce(E)?e.check(jd,p,A)(E):(e.enter("codeFlowValue"),w(E))}function w(E){return E===null||ce(E)?(e.exit("codeFlowValue"),y(E)):(e.consume(E),w)}function A(E){return e.exit("codeFenced"),t(E)}function k(E,I,M){let L=0;return T;function T(_){return E.enter("lineEnding"),E.consume(_),E.exit("lineEnding"),O}function O(_){return E.enter("codeFencedFence"),ve(_)?Ee(E,H,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):H(_)}function H(_){return _===a?(E.enter("codeFencedFenceSequence"),P(_)):M(_)}function P(_){return _===a?(L++,E.consume(_),P):L>=s?(E.exit("codeFencedFenceSequence"),ve(_)?Ee(E,F,"whitespace")(_):F(_)):M(_)}function F(_){return _===null||ce(_)?(E.exit("codeFencedFence"),I(_)):M(_)}}}function HS(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const ia={name:"codeIndented",tokenize:jS},US={partial:!0,tokenize:VS};function jS(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),Ee(e,o,"linePrefix",5)(u)}function o(u){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?s(u):n(u)}function s(u){return u===null?l(u):ce(u)?e.attempt(US,s,l)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||ce(u)?(e.exit("codeFlowValue"),s(u)):(e.consume(u),a)}function l(u){return e.exit("codeIndented"),t(u)}}function VS(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):ce(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):Ee(e,o,"linePrefix",5)(s)}function o(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):ce(s)?i(s):n(s)}}const WS={name:"codeText",previous:YS,resolve:qS,tokenize:KS};function qS(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function YS(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function KS(e,t,n){let r=0,i,o;return s;function s(c){return e.enter("codeText"),e.enter("codeTextSequence"),a(c)}function a(c){return c===96?(e.consume(c),r++,a):(e.exit("codeTextSequence"),l(c))}function l(c){return c===null?n(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),l):c===96?(o=e.enter("codeTextSequence"),i=0,f(c)):ce(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l):(e.enter("codeTextData"),u(c))}function u(c){return c===null||c===32||c===96||ce(c)?(e.exit("codeTextData"),l(c)):(e.consume(c),u)}function f(c){return c===96?(e.consume(c),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(c)):(o.type="codeTextData",u(c))}}class GS{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Ur(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Ur(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ur(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Ur(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ur(this.left,n.reverse())}}}function Ur(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Wd(e){const t={};let n=-1,r,i,o,s,a,l,u;const f=new GS(e);for(;++n<f.length;){for(;n in t;)n=t[n];if(r=f.get(n),n&&r[1].type==="chunkFlow"&&f.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,QS(f,n)),n=t[n],u=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(s=f.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},a=f.slice(i,n),a.unshift(r),f.splice(i,n-i+1,a))}}return gt(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!u}function QS(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const a=s.events,l=[],u={};let f,c,h=-1,d=n,m=0,p=0;const g=[p];for(;d;){for(;e.get(++i)[1]!==d;);o.push(i),d._tokenizer||(f=r.sliceStream(d),d.next||f.push(null),c&&s.defineSkip(d.start),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(f),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),c=d,d=d.next}for(d=n;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(p=h+1,g.push(p),d._tokenizer=void 0,d.previous=void 0,d=d.next);for(s.events=[],d?(d._tokenizer=void 0,d.previous=void 0):g.pop(),h=g.length;h--;){const v=a.slice(g[h],g[h+1]),y=o.pop();l.push([y,y+v.length-1]),e.splice(y,2,v)}for(l.reverse(),h=-1;++h<l.length;)u[m+l[h][0]]=m+l[h][1],m+=l[h][1]-l[h][0]-1;return u}const ZS={resolve:XS,tokenize:ek},JS={partial:!0,tokenize:tk};function XS(e){return Wd(e),e}function ek(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):ce(a)?e.check(JS,s,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function tk(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Ee(e,o,"linePrefix")}function o(s){if(s===null||ce(s))return n(s);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function qd(e,t,n,r,i,o,s,a,l){const u=l||Number.POSITIVE_INFINITY;let f=0;return c;function c(v){return v===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(v),e.exit(o),h):v===null||v===32||v===41||$i(v)?n(v):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),p(v))}function h(v){return v===62?(e.enter(o),e.consume(v),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),d(v))}function d(v){return v===62?(e.exit("chunkString"),e.exit(a),h(v)):v===null||v===60||ce(v)?n(v):(e.consume(v),v===92?m:d)}function m(v){return v===60||v===62||v===92?(e.consume(v),d):d(v)}function p(v){return!f&&(v===null||v===41||Me(v))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(v)):f<u&&v===40?(e.consume(v),f++,p):v===41?(e.consume(v),f--,p):v===null||v===32||v===40||$i(v)?n(v):(e.consume(v),v===92?g:p)}function g(v){return v===40||v===41||v===92?(e.consume(v),p):p(v)}}function Yd(e,t,n,r,i,o){const s=this;let a=0,l;return u;function u(d){return e.enter(r),e.enter(i),e.consume(d),e.exit(i),e.enter(o),f}function f(d){return a>999||d===null||d===91||d===93&&!l||d===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(d):d===93?(e.exit(o),e.enter(i),e.consume(d),e.exit(i),e.exit(r),t):ce(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),c(d))}function c(d){return d===null||d===91||d===93||ce(d)||a++>999?(e.exit("chunkString"),f(d)):(e.consume(d),l||(l=!ve(d)),d===92?h:c)}function h(d){return d===91||d===92||d===93?(e.consume(d),a++,c):c(d)}}function Kd(e,t,n,r,i,o){let s;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),s=h===40?41:h,l):n(h)}function l(h){return h===s?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(o),u(h))}function u(h){return h===s?(e.exit(o),l(s)):h===null?n(h):ce(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Ee(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===s||h===null||ce(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?c:f)}function c(h){return h===s||h===92?(e.consume(h),f):f(h)}}function jr(e,t){let n;return r;function r(i){return ce(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ve(i)?Ee(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const nk={name:"definition",tokenize:ik},rk={partial:!0,tokenize:ok};function ik(e,t,n){const r=this;let i;return o;function o(d){return e.enter("definition"),s(d)}function s(d){return Yd.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function a(d){return i=Mt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),d===58?(e.enter("definitionMarker"),e.consume(d),e.exit("definitionMarker"),l):n(d)}function l(d){return Me(d)?jr(e,u)(d):u(d)}function u(d){return qd(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function f(d){return e.attempt(rk,c,c)(d)}function c(d){return ve(d)?Ee(e,h,"whitespace")(d):h(d)}function h(d){return d===null||ce(d)?(e.exit("definition"),r.parser.defined.push(i),t(d)):n(d)}}function ok(e,t,n){return r;function r(a){return Me(a)?jr(e,i)(a):n(a)}function i(a){return Kd(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return ve(a)?Ee(e,s,"whitespace")(a):s(a)}function s(a){return a===null||ce(a)?t(a):n(a)}}const sk={name:"hardBreakEscape",tokenize:ak};function ak(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return ce(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const lk={name:"headingAtx",resolve:uk,tokenize:ck};function uk(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},gt(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function ck(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),s(f)}function s(f){return f===35&&r++<6?(e.consume(f),s):f===null||Me(f)?(e.exit("atxHeadingSequence"),a(f)):n(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),l(f)):f===null||ce(f)?(e.exit("atxHeading"),t(f)):ve(f)?Ee(e,a,"whitespace")(f):(e.enter("atxHeadingText"),u(f))}function l(f){return f===35?(e.consume(f),l):(e.exit("atxHeadingSequence"),a(f))}function u(f){return f===null||f===35||Me(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),u)}}const fk=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Gd=["pre","script","style","textarea"],dk={concrete:!0,name:"htmlFlow",resolveTo:mk,tokenize:gk},hk={partial:!0,tokenize:vk},pk={partial:!0,tokenize:yk};function mk(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function gk(e,t,n){const r=this;let i,o,s,a,l;return u;function u(S){return f(S)}function f(S){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(S),c}function c(S){return S===33?(e.consume(S),h):S===47?(e.consume(S),o=!0,p):S===63?(e.consume(S),i=3,r.interrupt?t:b):st(S)?(e.consume(S),s=String.fromCharCode(S),g):n(S)}function h(S){return S===45?(e.consume(S),i=2,d):S===91?(e.consume(S),i=5,a=0,m):st(S)?(e.consume(S),i=4,r.interrupt?t:b):n(S)}function d(S){return S===45?(e.consume(S),r.interrupt?t:b):n(S)}function m(S){const V="CDATA[";return S===V.charCodeAt(a++)?(e.consume(S),a===V.length?r.interrupt?t:H:m):n(S)}function p(S){return st(S)?(e.consume(S),s=String.fromCharCode(S),g):n(S)}function g(S){if(S===null||S===47||S===62||Me(S)){const V=S===47,ee=s.toLowerCase();return!V&&!o&&Gd.includes(ee)?(i=1,r.interrupt?t(S):H(S)):fk.includes(s.toLowerCase())?(i=6,V?(e.consume(S),v):r.interrupt?t(S):H(S)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(S):o?y(S):w(S))}return S===45||nt(S)?(e.consume(S),s+=String.fromCharCode(S),g):n(S)}function v(S){return S===62?(e.consume(S),r.interrupt?t:H):n(S)}function y(S){return ve(S)?(e.consume(S),y):T(S)}function w(S){return S===47?(e.consume(S),T):S===58||S===95||st(S)?(e.consume(S),A):ve(S)?(e.consume(S),w):T(S)}function A(S){return S===45||S===46||S===58||S===95||nt(S)?(e.consume(S),A):k(S)}function k(S){return S===61?(e.consume(S),E):ve(S)?(e.consume(S),k):w(S)}function E(S){return S===null||S===60||S===61||S===62||S===96?n(S):S===34||S===39?(e.consume(S),l=S,I):ve(S)?(e.consume(S),E):M(S)}function I(S){return S===l?(e.consume(S),l=null,L):S===null||ce(S)?n(S):(e.consume(S),I)}function M(S){return S===null||S===34||S===39||S===47||S===60||S===61||S===62||S===96||Me(S)?k(S):(e.consume(S),M)}function L(S){return S===47||S===62||ve(S)?w(S):n(S)}function T(S){return S===62?(e.consume(S),O):n(S)}function O(S){return S===null||ce(S)?H(S):ve(S)?(e.consume(S),O):n(S)}function H(S){return S===45&&i===2?(e.consume(S),z):S===60&&i===1?(e.consume(S),$):S===62&&i===4?(e.consume(S),N):S===63&&i===3?(e.consume(S),b):S===93&&i===5?(e.consume(S),W):ce(S)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(hk,R,P)(S)):S===null||ce(S)?(e.exit("htmlFlowData"),P(S)):(e.consume(S),H)}function P(S){return e.check(pk,F,R)(S)}function F(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),_}function _(S){return S===null||ce(S)?P(S):(e.enter("htmlFlowData"),H(S))}function z(S){return S===45?(e.consume(S),b):H(S)}function $(S){return S===47?(e.consume(S),s="",U):H(S)}function U(S){if(S===62){const V=s.toLowerCase();return Gd.includes(V)?(e.consume(S),N):H(S)}return st(S)&&s.length<8?(e.consume(S),s+=String.fromCharCode(S),U):H(S)}function W(S){return S===93?(e.consume(S),b):H(S)}function b(S){return S===62?(e.consume(S),N):S===45&&i===2?(e.consume(S),b):H(S)}function N(S){return S===null||ce(S)?(e.exit("htmlFlowData"),R(S)):(e.consume(S),N)}function R(S){return e.exit("htmlFlow"),t(S)}}function yk(e,t,n){const r=this;return i;function i(s){return ce(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function vk(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Hr,t,n)}}const bk={name:"htmlText",tokenize:wk};function wk(e,t,n){const r=this;let i,o,s;return a;function a(b){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(b),l}function l(b){return b===33?(e.consume(b),u):b===47?(e.consume(b),k):b===63?(e.consume(b),w):st(b)?(e.consume(b),M):n(b)}function u(b){return b===45?(e.consume(b),f):b===91?(e.consume(b),o=0,m):st(b)?(e.consume(b),y):n(b)}function f(b){return b===45?(e.consume(b),d):n(b)}function c(b){return b===null?n(b):b===45?(e.consume(b),h):ce(b)?(s=c,$(b)):(e.consume(b),c)}function h(b){return b===45?(e.consume(b),d):c(b)}function d(b){return b===62?z(b):b===45?h(b):c(b)}function m(b){const N="CDATA[";return b===N.charCodeAt(o++)?(e.consume(b),o===N.length?p:m):n(b)}function p(b){return b===null?n(b):b===93?(e.consume(b),g):ce(b)?(s=p,$(b)):(e.consume(b),p)}function g(b){return b===93?(e.consume(b),v):p(b)}function v(b){return b===62?z(b):b===93?(e.consume(b),v):p(b)}function y(b){return b===null||b===62?z(b):ce(b)?(s=y,$(b)):(e.consume(b),y)}function w(b){return b===null?n(b):b===63?(e.consume(b),A):ce(b)?(s=w,$(b)):(e.consume(b),w)}function A(b){return b===62?z(b):w(b)}function k(b){return st(b)?(e.consume(b),E):n(b)}function E(b){return b===45||nt(b)?(e.consume(b),E):I(b)}function I(b){return ce(b)?(s=I,$(b)):ve(b)?(e.consume(b),I):z(b)}function M(b){return b===45||nt(b)?(e.consume(b),M):b===47||b===62||Me(b)?L(b):n(b)}function L(b){return b===47?(e.consume(b),z):b===58||b===95||st(b)?(e.consume(b),T):ce(b)?(s=L,$(b)):ve(b)?(e.consume(b),L):z(b)}function T(b){return b===45||b===46||b===58||b===95||nt(b)?(e.consume(b),T):O(b)}function O(b){return b===61?(e.consume(b),H):ce(b)?(s=O,$(b)):ve(b)?(e.consume(b),O):L(b)}function H(b){return b===null||b===60||b===61||b===62||b===96?n(b):b===34||b===39?(e.consume(b),i=b,P):ce(b)?(s=H,$(b)):ve(b)?(e.consume(b),H):(e.consume(b),F)}function P(b){return b===i?(e.consume(b),i=void 0,_):b===null?n(b):ce(b)?(s=P,$(b)):(e.consume(b),P)}function F(b){return b===null||b===34||b===39||b===60||b===61||b===96?n(b):b===47||b===62||Me(b)?L(b):(e.consume(b),F)}function _(b){return b===47||b===62||Me(b)?L(b):n(b)}function z(b){return b===62?(e.consume(b),e.exit("htmlTextData"),e.exit("htmlText"),t):n(b)}function $(b){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),U}function U(b){return ve(b)?Ee(e,W,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):W(b)}function W(b){return e.enter("htmlTextData"),s(b)}}const oa={name:"labelEnd",resolveAll:Ek,resolveTo:Ck,tokenize:Ak},Sk={tokenize:Tk},kk={tokenize:Ik},xk={tokenize:Ok};function Ek(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&gt(e,0,e.length,n),e}function Ck(e,t){let n=e.length,r=0,i,o,s,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const l={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[o][1].start},end:{...e[s][1].end}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",l,t],["enter",u,t]],a=kt(a,e.slice(o+1,o+r+3)),a=kt(a,[["enter",f,t]]),a=kt(a,Hi(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),a=kt(a,[["exit",f,t],e[s-2],e[s-1],["exit",u,t]]),a=kt(a,e.slice(s+1)),a=kt(a,[["exit",l,t]]),gt(e,o,e.length,a),e}function Ak(e,t,n){const r=this;let i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(h){return o?o._inactive?c(h):(s=r.parser.defined.includes(Mt(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(Sk,f,s?f:c)(h):h===91?e.attempt(kk,f,s?u:c)(h):s?f(h):c(h)}function u(h){return e.attempt(xk,f,c)(h)}function f(h){return t(h)}function c(h){return o._balanced=!0,n(h)}}function Tk(e,t,n){return r;function r(c){return e.enter("resource"),e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),i}function i(c){return Me(c)?jr(e,o)(c):o(c)}function o(c){return c===41?f(c):qd(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function s(c){return Me(c)?jr(e,l)(c):f(c)}function a(c){return n(c)}function l(c){return c===34||c===39||c===40?Kd(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):f(c)}function u(c){return Me(c)?jr(e,f)(c):f(c)}function f(c){return c===41?(e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),e.exit("resource"),t):n(c)}}function Ik(e,t,n){const r=this;return i;function i(a){return Yd.call(r,e,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(Mt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function Ok(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const Dk={name:"labelStartImage",resolveAll:oa.resolveAll,tokenize:Mk};function Mk(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const Nk={name:"labelStartLink",resolveAll:oa.resolveAll,tokenize:Lk};function Lk(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const sa={name:"lineEnding",tokenize:_k};function _k(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ee(e,t,"linePrefix")}}const Ui={name:"thematicBreak",tokenize:Pk};function Pk(e,t,n){let r=0,i;return o;function o(u){return e.enter("thematicBreak"),s(u)}function s(u){return i=u,a(u)}function a(u){return u===i?(e.enter("thematicBreakSequence"),l(u)):r>=3&&(u===null||ce(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===i?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),ve(u)?Ee(e,a,"whitespace")(u):a(u))}}const ft={continuation:{tokenize:$k},exit:Hk,name:"list",tokenize:Bk},Fk={partial:!0,tokenize:Uk},Rk={partial:!0,tokenize:zk};function Bk(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(d){const m=r.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||d===r.containerState.marker:na(d)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),d===42||d===45?e.check(Ui,n,u)(d):u(d);if(!r.interrupt||d===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(d)}return n(d)}function l(d){return na(d)&&++s<10?(e.consume(d),l):(!r.interrupt||s<2)&&(r.containerState.marker?d===r.containerState.marker:d===41||d===46)?(e.exit("listItemValue"),u(d)):n(d)}function u(d){return e.enter("listItemMarker"),e.consume(d),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||d,e.check(Hr,r.interrupt?n:f,e.attempt(Fk,h,c))}function f(d){return r.containerState.initialBlankLine=!0,o++,h(d)}function c(d){return ve(d)?(e.enter("listItemPrefixWhitespace"),e.consume(d),e.exit("listItemPrefixWhitespace"),h):n(d)}function h(d){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(d)}}function $k(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Hr,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ee(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!ve(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Rk,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ee(e,e.attempt(ft,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function zk(e,t,n){const r=this;return Ee(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function Hk(e){e.exit(this.containerState.type)}function Uk(e,t,n){const r=this;return Ee(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!ve(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Qd={name:"setextUnderline",resolveTo:jk,tokenize:Vk};function jk(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function Vk(e,t,n){const r=this;let i;return o;function o(u){let f=r.events.length,c;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){c=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=u,s(u)):n(u)}function s(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),ve(u)?Ee(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||ce(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const Wk={tokenize:qk};function qk(e){const t=this,n=e.attempt(Hr,r,e.attempt(this.parser.constructs.flowInitial,i,Ee(e,e.attempt(this.parser.constructs.flow,i,e.attempt(ZS,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Yk={resolveAll:Jd()},Kk=Zd("string"),Gk=Zd("text");function Zd(e){return{resolveAll:Jd(e==="text"?Qk:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,a);return s;function s(f){return u(f)?o(f):a(f)}function a(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),l}function l(f){return u(f)?(n.exit("data"),o(f)):(n.consume(f),l)}function u(f){if(f===null)return!0;const c=i[f];let h=-1;if(c)for(;++h<c.length;){const d=c[h];if(!d.previous||d.previous.call(r,r.previous))return!0}return!1}}}function Jd(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function Qk(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,s=-1,a=0,l;for(;o--;){const u=i[o];if(typeof u=="string"){for(s=u.length;u.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(u===-2)l=!0,a++;else if(u!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const u={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:r.start._bufferIndex+s,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const Zk=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:nk},disable:{null:[]},document:{42:ft,43:ft,45:ft,48:ft,49:ft,50:ft,51:ft,52:ft,53:ft,54:ft,55:ft,56:ft,57:ft,62:zd},flow:{35:lk,42:Ui,45:[Qd,Ui],60:dk,61:Qd,95:Ui,96:Vd,126:Vd},flowInitial:{[-2]:ia,[-1]:ia,32:ia},insideSpan:{null:[ra,Yk]},string:{38:Ud,92:Hd},text:{[-5]:sa,[-4]:sa,[-3]:sa,33:Dk,38:Ud,42:ra,60:[NS,bk],91:Nk,92:[sk,Hd],93:oa,95:ra,96:WS}},Symbol.toStringTag,{value:"Module"}));function Jk(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let s=[],a=[];const l={attempt:I(k),check:I(E),consume:y,enter:w,exit:A,interrupt:I(E,{interrupt:!0})},u={code:null,containerState:{},defineSkip:p,events:[],now:m,parser:e,previous:null,sliceSerialize:h,sliceStream:d,write:c};let f=t.tokenize.call(u,l);return t.resolveAll&&o.push(t),u;function c(O){return s=kt(s,O),g(),s[s.length-1]!==null?[]:(M(t,0),u.events=Hi(o,u.events,u),u.events)}function h(O,H){return ex(d(O),H)}function d(O){return Xk(s,O)}function m(){const{_bufferIndex:O,_index:H,line:P,column:F,offset:_}=r;return{_bufferIndex:O,_index:H,line:P,column:F,offset:_}}function p(O){i[O.line]=O.column,T()}function g(){let O;for(;r._index<s.length;){const H=s[r._index];if(typeof H=="string")for(O=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===O&&r._bufferIndex<H.length;)v(H.charCodeAt(r._bufferIndex));else v(H)}}function v(O){f=f(O)}function y(O){ce(O)?(r.line++,r.column=1,r.offset+=O===-3?2:1,T()):O!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=O}function w(O,H){const P=H||{};return P.type=O,P.start=m(),u.events.push(["enter",P,u]),a.push(P),P}function A(O){const H=a.pop();return H.end=m(),u.events.push(["exit",H,u]),H}function k(O,H){M(O,H.from)}function E(O,H){H.restore()}function I(O,H){return P;function P(F,_,z){let $,U,W,b;return Array.isArray(F)?R(F):"tokenize"in F?R([F]):N(F);function N(Y){return G;function G(J){const se=J!==null&&Y[J],K=J!==null&&Y.null,re=[...Array.isArray(se)?se:se?[se]:[],...Array.isArray(K)?K:K?[K]:[]];return R(re)(J)}}function R(Y){return $=Y,U=0,Y.length===0?z:S(Y[U])}function S(Y){return G;function G(J){return b=L(),W=Y,Y.partial||(u.currentConstruct=Y),Y.name&&u.parser.constructs.disable.null.includes(Y.name)?ee():Y.tokenize.call(H?Object.assign(Object.create(u),H):u,l,V,ee)(J)}}function V(Y){return O(W,b),_}function ee(Y){return b.restore(),++U<$.length?S($[U]):z}}}function M(O,H){O.resolveAll&&!o.includes(O)&&o.push(O),O.resolve&&gt(u.events,H,u.events.length-H,O.resolve(u.events.slice(H),u)),O.resolveTo&&(u.events=O.resolveTo(u.events,u))}function L(){const O=m(),H=u.previous,P=u.currentConstruct,F=u.events.length,_=Array.from(a);return{from:F,restore:z};function z(){r=O,u.previous=H,u.currentConstruct=P,u.events.length=F,a=_,T()}}function T(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Xk(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function ex(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
26
+ Please start a new conversation.`,Bs={ResourceNotFound:{type:"configuration",message:Gf},Forbidden:{type:"bot",message:Zf}},$s={MethodNotFound:{type:"configuration",message:Qf},QuotaExceeded:{type:"bot",message:Jf},Forbidden:{type:"bot",message:Rs}};function td(e){return e in Bs}function nd(e){return e in $s}function rd(e){return e!==null&&typeof e=="object"&&"id"in e&&"code"in e&&"type"in e}function id(e){return e!==null&&typeof e=="object"&&"type"in e&&e.type==="error"&&"message"in e&&typeof e.message=="string"}const od=async(e,t=3,n=1e3)=>{let r;for(let i=1;i<=t;i++)try{return await e()}catch(o){if(r=o,i===t)throw r;const s=n*Math.pow(2,i-1);await new Promise(a=>setTimeout(a,s))}throw new Error("Unreachable: retry loop should always return or throw")},n1=["networkerror","failedtofetch","errorininputstream"],Rr=e=>{var n;console.error("An error occurred:",e);let t={type:"unknown",message:"An unexpected error occurred"};if(rd(e))e.type==="network"?t={id:e.id,type:"network",message:Ri}:(n=e.message)!=null&&n.includes("[Webhook Handler]")&&td(e.type)?t={id:e.id,...Bs[e.type]}:nd(e.type)?t={id:e.id,...$s[e.type]}:t={id:e.id,type:e.type,message:e.message||"An error occurred"};else if(id(e))sd(e.message)?t={type:"disconnected",message:Xf}:ad(e.message).includes("invalidcontenttype")?t={type:"bot",message:ed}:t={type:"event",message:e.message};else if(e instanceof Error&&sd(e.message))t={type:"network",message:Ri};else if(e&&typeof e=="object"&&"type"in e&&"message"in e){const r=e;r.type==="network"?t={type:"network",message:Ri}:t={type:r.type,message:r.message}}return t};function sd(e){return n1.some(t=>ad(e).includes(t))}function ad(e){return e.replaceAll(" ","").toLowerCase()}const r1=(e,t)=>{if(!e)return{type:"configuration",message:Yf};if(!G0(t))return{type:"configuration",message:Kf}},i1=e=>new Promise((t,n)=>{const r=new FileReader;r.onload=i=>{var o;return t((o=i.target)==null?void 0:o.result)},r.onerror=i=>{var o;return n((o=i.target)==null?void 0:o.error)},r.readAsArrayBuffer(e)});function o1(e,t,n,r){let i;return t&&e?i={conversationId:e,userToken:t}:t?i={conversationId:void 0,userToken:t}:i={conversationId:n,userToken:r},i}const Cn=D.forwardRef(({userId:e,src:t,container:n,image:r,fallback:i,...o},s)=>{const a=Zu(e??"",15);return x.jsxs(cs,{ref:s,"data-color":a,...n,...o,children:[x.jsx(fs,{src:t,...r}),x.jsx(ds,{...i,children:typeof o.children=="string"?o.children[0]:o.children})]})});Cn.displayName="Avatar";function U2(){}function j2(){}function s1(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const a1=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,l1=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,u1={};function ld(e,t){return(u1.jsx?l1:a1).test(e)}const c1=/[ \t\n\f\r]/g;function f1(e){return typeof e=="object"?e.type==="text"?ud(e.value):!1:ud(e)}function ud(e){return e.replace(c1,"")===""}class Br{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Br.prototype.normal={},Br.prototype.property={},Br.prototype.space=void 0;function cd(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Br(n,r,t)}function zs(e){return e.toLowerCase()}class ct{constructor(t,n){this.attribute=n,this.property=t}}ct.prototype.attribute="",ct.prototype.booleanish=!1,ct.prototype.boolean=!1,ct.prototype.commaOrSpaceSeparated=!1,ct.prototype.commaSeparated=!1,ct.prototype.defined=!1,ct.prototype.mustUseProperty=!1,ct.prototype.number=!1,ct.prototype.overloadedBoolean=!1,ct.prototype.property="",ct.prototype.spaceSeparated=!1,ct.prototype.space=void 0;let d1=0;const ge=An(),We=An(),Hs=An(),Z=An(),Le=An(),Wn=An(),mt=An();function An(){return 2**++d1}const Us=Object.freeze(Object.defineProperty({__proto__:null,boolean:ge,booleanish:We,commaOrSpaceSeparated:mt,commaSeparated:Wn,number:Z,overloadedBoolean:Hs,spaceSeparated:Le},Symbol.toStringTag,{value:"Module"})),js=Object.keys(Us);class Vs extends ct{constructor(t,n,r,i){let o=-1;if(super(t,n),fd(this,"space",i),typeof r=="number")for(;++o<js.length;){const s=js[o];fd(this,js[o],(r&Us[s])===Us[s])}}}Vs.prototype.defined=!0;function fd(e,t,n){n&&(e[t]=n)}function qn(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new Vs(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[zs(r)]=r,n[zs(o.attribute)]=r}return new Br(t,n,e.space)}const dd=qn({properties:{ariaActiveDescendant:null,ariaAtomic:We,ariaAutoComplete:null,ariaBusy:We,ariaChecked:We,ariaColCount:Z,ariaColIndex:Z,ariaColSpan:Z,ariaControls:Le,ariaCurrent:null,ariaDescribedBy:Le,ariaDetails:null,ariaDisabled:We,ariaDropEffect:Le,ariaErrorMessage:null,ariaExpanded:We,ariaFlowTo:Le,ariaGrabbed:We,ariaHasPopup:null,ariaHidden:We,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Le,ariaLevel:Z,ariaLive:null,ariaModal:We,ariaMultiLine:We,ariaMultiSelectable:We,ariaOrientation:null,ariaOwns:Le,ariaPlaceholder:null,ariaPosInSet:Z,ariaPressed:We,ariaReadOnly:We,ariaRelevant:null,ariaRequired:We,ariaRoleDescription:Le,ariaRowCount:Z,ariaRowIndex:Z,ariaRowSpan:Z,ariaSelected:We,ariaSetSize:Z,ariaSort:null,ariaValueMax:Z,ariaValueMin:Z,ariaValueNow:Z,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function hd(e,t){return t in e?e[t]:t}function pd(e,t){return hd(e,t.toLowerCase())}const h1=qn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Wn,acceptCharset:Le,accessKey:Le,action:null,allow:null,allowFullScreen:ge,allowPaymentRequest:ge,allowUserMedia:ge,alt:null,as:null,async:ge,autoCapitalize:null,autoComplete:Le,autoFocus:ge,autoPlay:ge,blocking:Le,capture:null,charSet:null,checked:ge,cite:null,className:Le,cols:Z,colSpan:null,content:null,contentEditable:We,controls:ge,controlsList:Le,coords:Z|Wn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ge,defer:ge,dir:null,dirName:null,disabled:ge,download:Hs,draggable:We,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ge,formTarget:null,headers:Le,height:Z,hidden:Hs,high:Z,href:null,hrefLang:null,htmlFor:Le,httpEquiv:Le,id:null,imageSizes:null,imageSrcSet:null,inert:ge,inputMode:null,integrity:null,is:null,isMap:ge,itemId:null,itemProp:Le,itemRef:Le,itemScope:ge,itemType:Le,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ge,low:Z,manifest:null,max:null,maxLength:Z,media:null,method:null,min:null,minLength:Z,multiple:ge,muted:ge,name:null,nonce:null,noModule:ge,noValidate:ge,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ge,optimum:Z,pattern:null,ping:Le,placeholder:null,playsInline:ge,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ge,referrerPolicy:null,rel:Le,required:ge,reversed:ge,rows:Z,rowSpan:Z,sandbox:Le,scope:null,scoped:ge,seamless:ge,selected:ge,shadowRootClonable:ge,shadowRootDelegatesFocus:ge,shadowRootMode:null,shape:null,size:Z,sizes:null,slot:null,span:Z,spellCheck:We,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Z,step:null,style:null,tabIndex:Z,target:null,title:null,translate:null,type:null,typeMustMatch:ge,useMap:null,value:We,width:Z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Le,axis:null,background:null,bgColor:null,border:Z,borderColor:null,bottomMargin:Z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ge,declare:ge,event:null,face:null,frame:null,frameBorder:null,hSpace:Z,leftMargin:Z,link:null,longDesc:null,lowSrc:null,marginHeight:Z,marginWidth:Z,noResize:ge,noHref:ge,noShade:ge,noWrap:ge,object:null,profile:null,prompt:null,rev:null,rightMargin:Z,rules:null,scheme:null,scrolling:We,standby:null,summary:null,text:null,topMargin:Z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Z,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ge,disableRemotePlayback:ge,prefix:null,property:null,results:Z,security:null,unselectable:null},space:"html",transform:pd}),p1=qn({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:mt,accentHeight:Z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Z,amplitude:Z,arabicForm:null,ascent:Z,attributeName:null,attributeType:null,azimuth:Z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Z,by:null,calcMode:null,capHeight:Z,className:Le,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Z,diffuseConstant:Z,direction:null,display:null,dur:null,divisor:Z,dominantBaseline:null,download:ge,dx:null,dy:null,edgeMode:null,editable:null,elevation:Z,enableBackground:null,end:null,event:null,exponent:Z,externalResourcesRequired:null,fill:null,fillOpacity:Z,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Wn,g2:Wn,glyphName:Wn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Z,horizOriginX:Z,horizOriginY:Z,id:null,ideographic:Z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Z,k:Z,k1:Z,k2:Z,k3:Z,k4:Z,kernelMatrix:mt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Z,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Z,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Z,overlineThickness:Z,paintOrder:null,panose1:null,path:null,pathLength:Z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Le,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Z,pointsAtY:Z,pointsAtZ:Z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:mt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:mt,rev:mt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:mt,requiredFeatures:mt,requiredFonts:mt,requiredFormats:mt,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Z,specularExponent:Z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Z,strikethroughThickness:Z,string:null,stroke:null,strokeDashArray:mt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Z,strokeOpacity:Z,strokeWidth:null,style:null,surfaceScale:Z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:mt,tabIndex:Z,tableValues:null,target:null,targetX:Z,targetY:Z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:mt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Z,underlineThickness:Z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Z,values:null,vAlphabetic:Z,vMathematical:Z,vectorEffect:null,vHanging:Z,vIdeographic:Z,version:null,vertAdvY:Z,vertOriginX:Z,vertOriginY:Z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:hd}),md=qn({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),gd=qn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:pd}),yd=qn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),m1={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},g1=/[A-Z]/g,vd=/-[a-z]/g,y1=/^data[-\w.:]+$/i;function v1(e,t){const n=zs(t);let r=t,i=ct;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&y1.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(vd,w1);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!vd.test(o)){let s=o.replace(g1,b1);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=Vs}return new i(r,t)}function b1(e){return"-"+e.toLowerCase()}function w1(e){return e.charAt(1).toUpperCase()}const S1=cd([dd,h1,md,gd,yd],"html"),Ws=cd([dd,p1,md,gd,yd],"svg");function k1(e){return e.join(" ").trim()}var qs={},bd=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,x1=/\n/g,E1=/^\s*/,C1=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,A1=/^:\s*/,T1=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,I1=/^[;\s]*/,O1=/^\s+|\s+$/g,D1=`
27
+ `,wd="/",Sd="*",Tn="",M1="comment",N1="declaration";function L1(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(m){var p=m.match(x1);p&&(n+=p.length);var g=m.lastIndexOf(D1);r=~g?m.length-g:r+m.length}function o(){var m={line:n,column:r};return function(p){return p.position=new s(m),u(),p}}function s(m){this.start=m,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function a(m){var p=new Error(t.source+":"+n+":"+r+": "+m);if(p.reason=m,p.filename=t.source,p.line=n,p.column=r,p.source=e,!t.silent)throw p}function l(m){var p=m.exec(e);if(p){var g=p[0];return i(g),e=e.slice(g.length),p}}function u(){l(E1)}function f(m){var p;for(m=m||[];p=c();)p!==!1&&m.push(p);return m}function c(){var m=o();if(!(wd!=e.charAt(0)||Sd!=e.charAt(1))){for(var p=2;Tn!=e.charAt(p)&&(Sd!=e.charAt(p)||wd!=e.charAt(p+1));)++p;if(p+=2,Tn===e.charAt(p-1))return a("End of comment missing");var g=e.slice(2,p-2);return r+=2,i(g),e=e.slice(p),r+=2,m({type:M1,comment:g})}}function h(){var m=o(),p=l(C1);if(p){if(c(),!l(A1))return a("property missing ':'");var g=l(T1),y=m({type:N1,property:kd(p[0].replace(bd,Tn)),value:g?kd(g[0].replace(bd,Tn)):Tn});return l(I1),y}}function d(){var m=[];f(m);for(var p;p=h();)p!==!1&&(m.push(p),f(m));return m}return u(),d()}function kd(e){return e?e.replace(O1,Tn):Tn}var _1=L1,P1=vn&&vn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(qs,"__esModule",{value:!0}),qs.default=R1;const F1=P1(_1);function R1(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,F1.default)(e),i=typeof t=="function";return r.forEach(o=>{if(o.type!=="declaration")return;const{property:s,value:a}=o;i?t(s,a,o):a&&(n=n||{},n[s]=a)}),n}var Bi={};Object.defineProperty(Bi,"__esModule",{value:!0}),Bi.camelCase=void 0;var B1=/^--[a-zA-Z0-9_-]+$/,$1=/-([a-z])/g,z1=/^[^-]+$/,H1=/^-(webkit|moz|ms|o|khtml)-/,U1=/^-(ms)-/,j1=function(e){return!e||z1.test(e)||B1.test(e)},V1=function(e,t){return t.toUpperCase()},xd=function(e,t){return"".concat(t,"-")},W1=function(e,t){return t===void 0&&(t={}),j1(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(U1,xd):e=e.replace(H1,xd),e.replace($1,V1))};Bi.camelCase=W1;var q1=vn&&vn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Y1=q1(qs),K1=Bi;function Ys(e,t){var n={};return!e||typeof e!="string"||(0,Y1.default)(e,function(r,i){r&&i&&(n[(0,K1.camelCase)(r,t)]=i)}),n}Ys.default=Ys;var G1=Ys;const Q1=bn(G1),Ed=Cd("end"),Ks=Cd("start");function Cd(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Z1(e){const t=Ks(e),n=Ed(e);if(t&&n)return{start:t,end:n}}function $r(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Ad(e.position):"start"in e||"end"in e?Ad(e):"line"in e||"column"in e?Gs(e):""}function Gs(e){return Td(e&&e.line)+":"+Td(e&&e.column)}function Ad(e){return Gs(e&&e.start)+"-"+Gs(e&&e.end)}function Td(e){return e&&typeof e=="number"?e:1}class tt extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=$r(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}tt.prototype.file="",tt.prototype.name="",tt.prototype.reason="",tt.prototype.message="",tt.prototype.stack="",tt.prototype.column=void 0,tt.prototype.line=void 0,tt.prototype.ancestors=void 0,tt.prototype.cause=void 0,tt.prototype.fatal=void 0,tt.prototype.place=void 0,tt.prototype.ruleId=void 0,tt.prototype.source=void 0;const Qs={}.hasOwnProperty,J1=new Map,X1=/[A-Z]/g,eS=new Set(["table","tbody","thead","tfoot","tr"]),tS=new Set(["td","th"]),Id="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function nS(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=cS(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=uS(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Ws:S1,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=Od(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function Od(e,t,n){if(t.type==="element")return rS(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return iS(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return sS(e,t,n);if(t.type==="mdxjsEsm")return oS(e,t);if(t.type==="root")return aS(e,t,n);if(t.type==="text")return lS(e,t)}function rS(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Ws,e.schema=i),e.ancestors.push(t);const o=Md(e,t.tagName,!1),s=fS(e,t);let a=Js(e,t);return eS.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!f1(l):!0})),Dd(e,s,o,t),Zs(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function iS(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}zr(e,t.position)}function oS(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);zr(e,t.position)}function sS(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Ws,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:Md(e,t.name,!0),s=dS(e,t),a=Js(e,t);return Dd(e,s,o,t),Zs(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function aS(e,t,n){const r={};return Zs(r,Js(e,t)),e.create(t,e.Fragment,r,n)}function lS(e,t){return t.value}function Dd(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Zs(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function uS(e,t,n){return r;function r(i,o,s,a){const u=Array.isArray(s.children)?n:t;return a?u(o,s,a):u(o,s)}}function cS(e,t){return n;function n(r,i,o,s){const a=Array.isArray(o.children),l=Ks(r);return t(i,o,s,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function fS(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Qs.call(t.properties,i)){const o=hS(e,i,t.properties[i]);if(o){const[s,a]=o;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&tS.has(t.tagName)?r=a:n[s]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function dS(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else zr(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else zr(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Js(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:J1;for(;++r<t.children.length;){const o=t.children[r];let s;if(e.passKeys){const l=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(l){const u=i.get(l)||0;s=l+"-"+u,i.set(l,u+1)}}const a=Od(e,o,s);a!==void 0&&n.push(a)}return n}function hS(e,t,n){const r=v1(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?s1(n):k1(n)),r.property==="style"){let i=typeof n=="object"?n:pS(e,String(n));return e.stylePropertyNameCase==="css"&&(i=mS(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?m1[r.property]||r.property:r.attribute,n]}}function pS(e,t){try{return Q1(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new tt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Id+"#cannot-parse-style-attribute",i}}function Md(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,s;for(;++o<i.length;){const a=ld(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=s}else r=ld(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Qs.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);zr(e)}function zr(e,t){const n=new tt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Id+"#cannot-handle-mdx-estrees-without-createevaluater",n}function mS(e){const t={};let n;for(n in e)Qs.call(e,n)&&(t[gS(n)]=e[n]);return t}function gS(e){let t=e.replace(X1,yS);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function yS(e){return"-"+e.toLowerCase()}const Xs={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},vS={};function ea(e,t){const n=vS,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Nd(e,r,i)}function Nd(e,t,n){if(bS(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Ld(e.children,t,n)}return Array.isArray(e)?Ld(e,t,n):""}function Ld(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Nd(e[i],t,n);return r.join("")}function bS(e){return!!(e&&typeof e=="object")}const _d=document.createElement("i");function ta(e){const t="&"+e+";";_d.innerHTML=t;const n=_d.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function gt(e,t,n,r){const i=e.length;let o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function kt(e,t){return e.length>0?(gt(e,e.length,0,t),e):t}const Pd={}.hasOwnProperty;function Fd(e){const t={};let n=-1;for(;++n<e.length;)wS(t,e[n]);return t}function wS(e,t){let n;for(n in t){const i=(Pd.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){Pd.call(i,s)||(i[s]=[]);const a=o[s];SS(i[s],Array.isArray(a)?a:a?[a]:[])}}}function SS(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);gt(e,0,0,r)}function Rd(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Mt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const st=an(/[A-Za-z]/),nt=an(/[\dA-Za-z]/),kS=an(/[#-'*+\--9=?A-Z^-~]/);function $i(e){return e!==null&&(e<32||e===127)}const na=an(/\d/),xS=an(/[\dA-Fa-f]/),ES=an(/[!-/:-@[-`{-~]/);function ce(e){return e!==null&&e<-2}function Me(e){return e!==null&&(e<0||e===32)}function ve(e){return e===-2||e===-1||e===32}const zi=an(new RegExp("\\p{P}|\\p{S}","u")),In=an(/\s/);function an(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Yn(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(o===37&&nt(e.charCodeAt(n+1))&&nt(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function xe(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(l){return ve(l)?(e.enter(n),a(l)):t(l)}function a(l){return ve(l)&&o++<i?(e.consume(l),a):(e.exit(n),t(l))}}const CS={tokenize:AS};function AS(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),xe(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return ce(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),s)}}const TS={tokenize:IS},Bd={tokenize:OS};function IS(e){const t=this,n=[];let r=0,i,o,s;return a;function a(w){if(r<n.length){const A=n[r];return t.containerState=A[1],e.attempt(A[0].continuation,l,u)(w)}return u(w)}function l(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();const A=t.events.length;let k=A,E;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){E=t.events[k][1].end;break}y(r);let I=A;for(;I<t.events.length;)t.events[I][1].end={...E},I++;return gt(t.events,k+1,0,t.events.slice(A)),t.events.length=I,u(w)}return a(w)}function u(w){if(r===n.length){if(!i)return h(w);if(i.currentConstruct&&i.currentConstruct.concrete)return m(w);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Bd,f,c)(w)}function f(w){return i&&v(),y(r),h(w)}function c(w){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,m(w)}function h(w){return t.containerState={},e.attempt(Bd,d,m)(w)}function d(w){return r++,n.push([t.currentConstruct,t.containerState]),h(w)}function m(w){if(w===null){i&&v(),y(0),e.consume(w);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),p(w)}function p(w){if(w===null){g(e.exit("chunkFlow"),!0),y(0),e.consume(w);return}return ce(w)?(e.consume(w),g(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(w),p)}function g(w,A){const k=t.sliceStream(w);if(A&&k.push(null),w.previous=o,o&&(o.next=w),o=w,i.defineSkip(w.start),i.write(k),t.parser.lazy[w.start.line]){let E=i.events.length;for(;E--;)if(i.events[E][1].start.offset<s&&(!i.events[E][1].end||i.events[E][1].end.offset>s))return;const I=t.events.length;let M=I,P,T;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){if(P){T=t.events[M][1].end;break}P=!0}for(y(r),E=I;E<t.events.length;)t.events[E][1].end={...T},E++;gt(t.events,M+1,0,t.events.slice(I)),t.events.length=E}}function 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 OS(e,t,n){return xe(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Kn(e){if(e===null||Me(e)||In(e))return 1;if(zi(e))return 2}function Hi(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const ra={name:"attention",resolveAll:DS,tokenize:MS};function DS(e,t){let n=-1,r,i,o,s,a,l,u,f;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const c={...e[r][1].end},h={...e[n][1].start};$d(c,-l),$d(h,l),s={type:l>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},o={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[r][1].end={...s.start},e[n][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=kt(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=kt(u,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),u=kt(u,Hi(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=kt(u,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,u=kt(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,gt(e,r-1,n-r+3,u),n=r+u.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function MS(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Kn(r);let o;return s;function s(l){return o=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===o)return e.consume(l),a;const u=e.exit("attentionSequence"),f=Kn(l),c=!f||f===2&&i||n.includes(l),h=!i||i===2&&f||n.includes(r);return u._open=!!(o===42?c:c&&(i||!h)),u._close=!!(o===42?h:h&&(f||!c)),t(l)}}function $d(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const NS={name:"autolink",tokenize:LS};function LS(e,t,n){let r=0;return i;function i(d){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(d){return st(d)?(e.consume(d),s):d===64?n(d):u(d)}function s(d){return d===43||d===45||d===46||nt(d)?(r=1,a(d)):u(d)}function a(d){return d===58?(e.consume(d),r=0,l):(d===43||d===45||d===46||nt(d))&&r++<32?(e.consume(d),a):(r=0,u(d))}function l(d){return d===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):d===null||d===32||d===60||$i(d)?n(d):(e.consume(d),l)}function u(d){return d===64?(e.consume(d),f):kS(d)?(e.consume(d),u):n(d)}function f(d){return nt(d)?c(d):n(d)}function c(d){return d===46?(e.consume(d),r=0,f):d===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):h(d)}function h(d){if((d===45||nt(d))&&r++<63){const m=d===45?h:c;return e.consume(d),m}return n(d)}}const Hr={partial:!0,tokenize:_S};function _S(e,t,n){return r;function r(o){return ve(o)?xe(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||ce(o)?t(o):n(o)}}const zd={continuation:{tokenize:FS},exit:RS,name:"blockQuote",tokenize:PS};function PS(e,t,n){const r=this;return i;function i(s){if(s===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return ve(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function FS(e,t,n){const r=this;return i;function i(s){return ve(s)?xe(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(zd,t,n)(s)}}function RS(e){e.exit("blockQuote")}const Hd={name:"characterEscape",tokenize:BS};function BS(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return ES(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const Ud={name:"characterReference",tokenize:$S};function $S(e,t,n){const r=this;let i=0,o,s;return a;function a(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),l}function l(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),o=31,s=nt,f(c))}function u(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=xS,f):(e.enter("characterReferenceValue"),o=7,s=na,f(c))}function f(c){if(c===59&&i){const h=e.exit("characterReferenceValue");return s===nt&&!ta(r.sliceSerialize(h))?n(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(c)&&i++<o?(e.consume(c),f):n(c)}}const jd={partial:!0,tokenize:HS},Vd={concrete:!0,name:"codeFenced",tokenize:zS};function zS(e,t,n){const r=this,i={partial:!0,tokenize:k};let o=0,s=0,a;return l;function l(E){return u(E)}function u(E){const I=r.events[r.events.length-1];return o=I&&I[1].type==="linePrefix"?I[2].sliceSerialize(I[1],!0).length:0,a=E,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(E)}function f(E){return E===a?(s++,e.consume(E),f):s<3?n(E):(e.exit("codeFencedFenceSequence"),ve(E)?xe(e,c,"whitespace")(E):c(E))}function c(E){return E===null||ce(E)?(e.exit("codeFencedFence"),r.interrupt?t(E):e.check(jd,p,A)(E)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(E))}function h(E){return E===null||ce(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(E)):ve(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),xe(e,d,"whitespace")(E)):E===96&&E===a?n(E):(e.consume(E),h)}function d(E){return E===null||ce(E)?c(E):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(E))}function m(E){return E===null||ce(E)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(E)):E===96&&E===a?n(E):(e.consume(E),m)}function p(E){return e.attempt(i,A,g)(E)}function g(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),y}function y(E){return o>0&&ve(E)?xe(e,v,"linePrefix",o+1)(E):v(E)}function v(E){return E===null||ce(E)?e.check(jd,p,A)(E):(e.enter("codeFlowValue"),w(E))}function w(E){return E===null||ce(E)?(e.exit("codeFlowValue"),v(E)):(e.consume(E),w)}function A(E){return e.exit("codeFenced"),t(E)}function k(E,I,M){let P=0;return T;function T(_){return E.enter("lineEnding"),E.consume(_),E.exit("lineEnding"),O}function O(_){return E.enter("codeFencedFence"),ve(_)?xe(E,j,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):j(_)}function j(_){return _===a?(E.enter("codeFencedFenceSequence"),F(_)):M(_)}function F(_){return _===a?(P++,E.consume(_),F):P>=s?(E.exit("codeFencedFenceSequence"),ve(_)?xe(E,L,"whitespace")(_):L(_)):M(_)}function L(_){return _===null||ce(_)?(E.exit("codeFencedFence"),I(_)):M(_)}}}function HS(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const ia={name:"codeIndented",tokenize:jS},US={partial:!0,tokenize:VS};function jS(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),xe(e,o,"linePrefix",5)(u)}function o(u){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?s(u):n(u)}function s(u){return u===null?l(u):ce(u)?e.attempt(US,s,l)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||ce(u)?(e.exit("codeFlowValue"),s(u)):(e.consume(u),a)}function l(u){return e.exit("codeIndented"),t(u)}}function VS(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):ce(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):xe(e,o,"linePrefix",5)(s)}function o(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):ce(s)?i(s):n(s)}}const WS={name:"codeText",previous:YS,resolve:qS,tokenize:KS};function qS(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function YS(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function KS(e,t,n){let r=0,i,o;return s;function s(c){return e.enter("codeText"),e.enter("codeTextSequence"),a(c)}function a(c){return c===96?(e.consume(c),r++,a):(e.exit("codeTextSequence"),l(c))}function l(c){return c===null?n(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),l):c===96?(o=e.enter("codeTextSequence"),i=0,f(c)):ce(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l):(e.enter("codeTextData"),u(c))}function u(c){return c===null||c===32||c===96||ce(c)?(e.exit("codeTextData"),l(c)):(e.consume(c),u)}function f(c){return c===96?(e.consume(c),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(c)):(o.type="codeTextData",u(c))}}class GS{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Ur(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Ur(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ur(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Ur(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ur(this.left,n.reverse())}}}function Ur(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Wd(e){const t={};let n=-1,r,i,o,s,a,l,u;const f=new GS(e);for(;++n<f.length;){for(;n in t;)n=t[n];if(r=f.get(n),n&&r[1].type==="chunkFlow"&&f.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,QS(f,n)),n=t[n],u=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(s=f.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},a=f.slice(i,n),a.unshift(r),f.splice(i,n-i+1,a))}}return gt(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!u}function QS(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const a=s.events,l=[],u={};let f,c,h=-1,d=n,m=0,p=0;const g=[p];for(;d;){for(;e.get(++i)[1]!==d;);o.push(i),d._tokenizer||(f=r.sliceStream(d),d.next||f.push(null),c&&s.defineSkip(d.start),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(f),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),c=d,d=d.next}for(d=n;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(p=h+1,g.push(p),d._tokenizer=void 0,d.previous=void 0,d=d.next);for(s.events=[],d?(d._tokenizer=void 0,d.previous=void 0):g.pop(),h=g.length;h--;){const y=a.slice(g[h],g[h+1]),v=o.pop();l.push([v,v+y.length-1]),e.splice(v,2,y)}for(l.reverse(),h=-1;++h<l.length;)u[m+l[h][0]]=m+l[h][1],m+=l[h][1]-l[h][0]-1;return u}const ZS={resolve:XS,tokenize:ek},JS={partial:!0,tokenize:tk};function XS(e){return Wd(e),e}function ek(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):ce(a)?e.check(JS,s,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function tk(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),xe(e,o,"linePrefix")}function o(s){if(s===null||ce(s))return n(s);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function qd(e,t,n,r,i,o,s,a,l){const u=l||Number.POSITIVE_INFINITY;let f=0;return c;function c(y){return y===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(y),e.exit(o),h):y===null||y===32||y===41||$i(y)?n(y):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),p(y))}function h(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),d(y))}function d(y){return y===62?(e.exit("chunkString"),e.exit(a),h(y)):y===null||y===60||ce(y)?n(y):(e.consume(y),y===92?m:d)}function m(y){return y===60||y===62||y===92?(e.consume(y),d):d(y)}function p(y){return!f&&(y===null||y===41||Me(y))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(y)):f<u&&y===40?(e.consume(y),f++,p):y===41?(e.consume(y),f--,p):y===null||y===32||y===40||$i(y)?n(y):(e.consume(y),y===92?g:p)}function g(y){return y===40||y===41||y===92?(e.consume(y),p):p(y)}}function Yd(e,t,n,r,i,o){const s=this;let a=0,l;return u;function u(d){return e.enter(r),e.enter(i),e.consume(d),e.exit(i),e.enter(o),f}function f(d){return a>999||d===null||d===91||d===93&&!l||d===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(d):d===93?(e.exit(o),e.enter(i),e.consume(d),e.exit(i),e.exit(r),t):ce(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),c(d))}function c(d){return d===null||d===91||d===93||ce(d)||a++>999?(e.exit("chunkString"),f(d)):(e.consume(d),l||(l=!ve(d)),d===92?h:c)}function h(d){return d===91||d===92||d===93?(e.consume(d),a++,c):c(d)}}function Kd(e,t,n,r,i,o){let s;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),s=h===40?41:h,l):n(h)}function l(h){return h===s?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(o),u(h))}function u(h){return h===s?(e.exit(o),l(s)):h===null?n(h):ce(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),xe(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===s||h===null||ce(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?c:f)}function c(h){return h===s||h===92?(e.consume(h),f):f(h)}}function jr(e,t){let n;return r;function r(i){return ce(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ve(i)?xe(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const nk={name:"definition",tokenize:ik},rk={partial:!0,tokenize:ok};function ik(e,t,n){const r=this;let i;return o;function o(d){return e.enter("definition"),s(d)}function s(d){return Yd.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function a(d){return i=Mt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),d===58?(e.enter("definitionMarker"),e.consume(d),e.exit("definitionMarker"),l):n(d)}function l(d){return Me(d)?jr(e,u)(d):u(d)}function u(d){return qd(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function f(d){return e.attempt(rk,c,c)(d)}function c(d){return ve(d)?xe(e,h,"whitespace")(d):h(d)}function h(d){return d===null||ce(d)?(e.exit("definition"),r.parser.defined.push(i),t(d)):n(d)}}function ok(e,t,n){return r;function r(a){return Me(a)?jr(e,i)(a):n(a)}function i(a){return Kd(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return ve(a)?xe(e,s,"whitespace")(a):s(a)}function s(a){return a===null||ce(a)?t(a):n(a)}}const sk={name:"hardBreakEscape",tokenize:ak};function ak(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return ce(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const lk={name:"headingAtx",resolve:uk,tokenize:ck};function uk(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},gt(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function ck(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),s(f)}function s(f){return f===35&&r++<6?(e.consume(f),s):f===null||Me(f)?(e.exit("atxHeadingSequence"),a(f)):n(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),l(f)):f===null||ce(f)?(e.exit("atxHeading"),t(f)):ve(f)?xe(e,a,"whitespace")(f):(e.enter("atxHeadingText"),u(f))}function l(f){return f===35?(e.consume(f),l):(e.exit("atxHeadingSequence"),a(f))}function u(f){return f===null||f===35||Me(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),u)}}const fk=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Gd=["pre","script","style","textarea"],dk={concrete:!0,name:"htmlFlow",resolveTo:mk,tokenize:gk},hk={partial:!0,tokenize:vk},pk={partial:!0,tokenize:yk};function mk(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function gk(e,t,n){const r=this;let i,o,s,a,l;return u;function u(S){return f(S)}function f(S){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(S),c}function c(S){return S===33?(e.consume(S),h):S===47?(e.consume(S),o=!0,p):S===63?(e.consume(S),i=3,r.interrupt?t:b):st(S)?(e.consume(S),s=String.fromCharCode(S),g):n(S)}function h(S){return S===45?(e.consume(S),i=2,d):S===91?(e.consume(S),i=5,a=0,m):st(S)?(e.consume(S),i=4,r.interrupt?t:b):n(S)}function d(S){return S===45?(e.consume(S),r.interrupt?t:b):n(S)}function m(S){const V="CDATA[";return S===V.charCodeAt(a++)?(e.consume(S),a===V.length?r.interrupt?t:j:m):n(S)}function p(S){return st(S)?(e.consume(S),s=String.fromCharCode(S),g):n(S)}function g(S){if(S===null||S===47||S===62||Me(S)){const V=S===47,ee=s.toLowerCase();return!V&&!o&&Gd.includes(ee)?(i=1,r.interrupt?t(S):j(S)):fk.includes(s.toLowerCase())?(i=6,V?(e.consume(S),y):r.interrupt?t(S):j(S)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(S):o?v(S):w(S))}return S===45||nt(S)?(e.consume(S),s+=String.fromCharCode(S),g):n(S)}function y(S){return S===62?(e.consume(S),r.interrupt?t:j):n(S)}function v(S){return ve(S)?(e.consume(S),v):T(S)}function w(S){return S===47?(e.consume(S),T):S===58||S===95||st(S)?(e.consume(S),A):ve(S)?(e.consume(S),w):T(S)}function A(S){return S===45||S===46||S===58||S===95||nt(S)?(e.consume(S),A):k(S)}function k(S){return S===61?(e.consume(S),E):ve(S)?(e.consume(S),k):w(S)}function E(S){return S===null||S===60||S===61||S===62||S===96?n(S):S===34||S===39?(e.consume(S),l=S,I):ve(S)?(e.consume(S),E):M(S)}function I(S){return S===l?(e.consume(S),l=null,P):S===null||ce(S)?n(S):(e.consume(S),I)}function M(S){return S===null||S===34||S===39||S===47||S===60||S===61||S===62||S===96||Me(S)?k(S):(e.consume(S),M)}function P(S){return S===47||S===62||ve(S)?w(S):n(S)}function T(S){return S===62?(e.consume(S),O):n(S)}function O(S){return S===null||ce(S)?j(S):ve(S)?(e.consume(S),O):n(S)}function j(S){return S===45&&i===2?(e.consume(S),B):S===60&&i===1?(e.consume(S),z):S===62&&i===4?(e.consume(S),N):S===63&&i===3?(e.consume(S),b):S===93&&i===5?(e.consume(S),W):ce(S)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(hk,R,F)(S)):S===null||ce(S)?(e.exit("htmlFlowData"),F(S)):(e.consume(S),j)}function F(S){return e.check(pk,L,R)(S)}function L(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),_}function _(S){return S===null||ce(S)?F(S):(e.enter("htmlFlowData"),j(S))}function B(S){return S===45?(e.consume(S),b):j(S)}function z(S){return S===47?(e.consume(S),s="",H):j(S)}function H(S){if(S===62){const V=s.toLowerCase();return Gd.includes(V)?(e.consume(S),N):j(S)}return st(S)&&s.length<8?(e.consume(S),s+=String.fromCharCode(S),H):j(S)}function W(S){return S===93?(e.consume(S),b):j(S)}function b(S){return S===62?(e.consume(S),N):S===45&&i===2?(e.consume(S),b):j(S)}function N(S){return S===null||ce(S)?(e.exit("htmlFlowData"),R(S)):(e.consume(S),N)}function R(S){return e.exit("htmlFlow"),t(S)}}function yk(e,t,n){const r=this;return i;function i(s){return ce(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function vk(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Hr,t,n)}}const bk={name:"htmlText",tokenize:wk};function wk(e,t,n){const r=this;let i,o,s;return a;function a(b){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(b),l}function l(b){return b===33?(e.consume(b),u):b===47?(e.consume(b),k):b===63?(e.consume(b),w):st(b)?(e.consume(b),M):n(b)}function u(b){return b===45?(e.consume(b),f):b===91?(e.consume(b),o=0,m):st(b)?(e.consume(b),v):n(b)}function f(b){return b===45?(e.consume(b),d):n(b)}function c(b){return b===null?n(b):b===45?(e.consume(b),h):ce(b)?(s=c,z(b)):(e.consume(b),c)}function h(b){return b===45?(e.consume(b),d):c(b)}function d(b){return b===62?B(b):b===45?h(b):c(b)}function m(b){const N="CDATA[";return b===N.charCodeAt(o++)?(e.consume(b),o===N.length?p:m):n(b)}function p(b){return b===null?n(b):b===93?(e.consume(b),g):ce(b)?(s=p,z(b)):(e.consume(b),p)}function g(b){return b===93?(e.consume(b),y):p(b)}function y(b){return b===62?B(b):b===93?(e.consume(b),y):p(b)}function v(b){return b===null||b===62?B(b):ce(b)?(s=v,z(b)):(e.consume(b),v)}function w(b){return b===null?n(b):b===63?(e.consume(b),A):ce(b)?(s=w,z(b)):(e.consume(b),w)}function A(b){return b===62?B(b):w(b)}function k(b){return st(b)?(e.consume(b),E):n(b)}function E(b){return b===45||nt(b)?(e.consume(b),E):I(b)}function I(b){return ce(b)?(s=I,z(b)):ve(b)?(e.consume(b),I):B(b)}function M(b){return b===45||nt(b)?(e.consume(b),M):b===47||b===62||Me(b)?P(b):n(b)}function P(b){return b===47?(e.consume(b),B):b===58||b===95||st(b)?(e.consume(b),T):ce(b)?(s=P,z(b)):ve(b)?(e.consume(b),P):B(b)}function T(b){return b===45||b===46||b===58||b===95||nt(b)?(e.consume(b),T):O(b)}function O(b){return b===61?(e.consume(b),j):ce(b)?(s=O,z(b)):ve(b)?(e.consume(b),O):P(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,F):ce(b)?(s=j,z(b)):ve(b)?(e.consume(b),j):(e.consume(b),L)}function F(b){return b===i?(e.consume(b),i=void 0,_):b===null?n(b):ce(b)?(s=F,z(b)):(e.consume(b),F)}function L(b){return b===null||b===34||b===39||b===60||b===61||b===96?n(b):b===47||b===62||Me(b)?P(b):(e.consume(b),L)}function _(b){return b===47||b===62||Me(b)?P(b):n(b)}function B(b){return b===62?(e.consume(b),e.exit("htmlTextData"),e.exit("htmlText"),t):n(b)}function z(b){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),H}function H(b){return ve(b)?xe(e,W,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):W(b)}function W(b){return e.enter("htmlTextData"),s(b)}}const oa={name:"labelEnd",resolveAll:Ek,resolveTo:Ck,tokenize:Ak},Sk={tokenize:Tk},kk={tokenize:Ik},xk={tokenize:Ok};function Ek(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&gt(e,0,e.length,n),e}function Ck(e,t){let n=e.length,r=0,i,o,s,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const l={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[o][1].start},end:{...e[s][1].end}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",l,t],["enter",u,t]],a=kt(a,e.slice(o+1,o+r+3)),a=kt(a,[["enter",f,t]]),a=kt(a,Hi(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),a=kt(a,[["exit",f,t],e[s-2],e[s-1],["exit",u,t]]),a=kt(a,e.slice(s+1)),a=kt(a,[["exit",l,t]]),gt(e,o,e.length,a),e}function Ak(e,t,n){const r=this;let i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(h){return o?o._inactive?c(h):(s=r.parser.defined.includes(Mt(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(Sk,f,s?f:c)(h):h===91?e.attempt(kk,f,s?u:c)(h):s?f(h):c(h)}function u(h){return e.attempt(xk,f,c)(h)}function f(h){return t(h)}function c(h){return o._balanced=!0,n(h)}}function Tk(e,t,n){return r;function r(c){return e.enter("resource"),e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),i}function i(c){return Me(c)?jr(e,o)(c):o(c)}function o(c){return c===41?f(c):qd(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function s(c){return Me(c)?jr(e,l)(c):f(c)}function a(c){return n(c)}function l(c){return c===34||c===39||c===40?Kd(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):f(c)}function u(c){return Me(c)?jr(e,f)(c):f(c)}function f(c){return c===41?(e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),e.exit("resource"),t):n(c)}}function Ik(e,t,n){const r=this;return i;function i(a){return Yd.call(r,e,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(Mt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function Ok(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const Dk={name:"labelStartImage",resolveAll:oa.resolveAll,tokenize:Mk};function Mk(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const Nk={name:"labelStartLink",resolveAll:oa.resolveAll,tokenize:Lk};function Lk(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const sa={name:"lineEnding",tokenize:_k};function _k(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),xe(e,t,"linePrefix")}}const Ui={name:"thematicBreak",tokenize:Pk};function Pk(e,t,n){let r=0,i;return o;function o(u){return e.enter("thematicBreak"),s(u)}function s(u){return i=u,a(u)}function a(u){return u===i?(e.enter("thematicBreakSequence"),l(u)):r>=3&&(u===null||ce(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===i?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),ve(u)?xe(e,a,"whitespace")(u):a(u))}}const ft={continuation:{tokenize:$k},exit:Hk,name:"list",tokenize:Bk},Fk={partial:!0,tokenize:Uk},Rk={partial:!0,tokenize:zk};function Bk(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(d){const m=r.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||d===r.containerState.marker:na(d)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),d===42||d===45?e.check(Ui,n,u)(d):u(d);if(!r.interrupt||d===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(d)}return n(d)}function l(d){return na(d)&&++s<10?(e.consume(d),l):(!r.interrupt||s<2)&&(r.containerState.marker?d===r.containerState.marker:d===41||d===46)?(e.exit("listItemValue"),u(d)):n(d)}function u(d){return e.enter("listItemMarker"),e.consume(d),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||d,e.check(Hr,r.interrupt?n:f,e.attempt(Fk,h,c))}function f(d){return r.containerState.initialBlankLine=!0,o++,h(d)}function c(d){return ve(d)?(e.enter("listItemPrefixWhitespace"),e.consume(d),e.exit("listItemPrefixWhitespace"),h):n(d)}function h(d){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(d)}}function $k(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Hr,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,xe(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!ve(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Rk,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,xe(e,e.attempt(ft,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function zk(e,t,n){const r=this;return xe(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function Hk(e){e.exit(this.containerState.type)}function Uk(e,t,n){const r=this;return xe(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!ve(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Qd={name:"setextUnderline",resolveTo:jk,tokenize:Vk};function jk(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function Vk(e,t,n){const r=this;let i;return o;function o(u){let f=r.events.length,c;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){c=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=u,s(u)):n(u)}function s(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),ve(u)?xe(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||ce(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const Wk={tokenize:qk};function qk(e){const t=this,n=e.attempt(Hr,r,e.attempt(this.parser.constructs.flowInitial,i,xe(e,e.attempt(this.parser.constructs.flow,i,e.attempt(ZS,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Yk={resolveAll:Jd()},Kk=Zd("string"),Gk=Zd("text");function Zd(e){return{resolveAll:Jd(e==="text"?Qk:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,a);return s;function s(f){return u(f)?o(f):a(f)}function a(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),l}function l(f){return u(f)?(n.exit("data"),o(f)):(n.consume(f),l)}function u(f){if(f===null)return!0;const c=i[f];let h=-1;if(c)for(;++h<c.length;){const d=c[h];if(!d.previous||d.previous.call(r,r.previous))return!0}return!1}}}function Jd(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function Qk(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,s=-1,a=0,l;for(;o--;){const u=i[o];if(typeof u=="string"){for(s=u.length;u.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(u===-2)l=!0,a++;else if(u!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const u={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:r.start._bufferIndex+s,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const Zk=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:nk},disable:{null:[]},document:{42:ft,43:ft,45:ft,48:ft,49:ft,50:ft,51:ft,52:ft,53:ft,54:ft,55:ft,56:ft,57:ft,62:zd},flow:{35:lk,42:Ui,45:[Qd,Ui],60:dk,61:Qd,95:Ui,96:Vd,126:Vd},flowInitial:{[-2]:ia,[-1]:ia,32:ia},insideSpan:{null:[ra,Yk]},string:{38:Ud,92:Hd},text:{[-5]:sa,[-4]:sa,[-3]:sa,33:Dk,38:Ud,42:ra,60:[NS,bk],91:Nk,92:[sk,Hd],93:oa,95:ra,96:WS}},Symbol.toStringTag,{value:"Module"}));function Jk(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let s=[],a=[];const l={attempt:I(k),check:I(E),consume:v,enter:w,exit:A,interrupt:I(E,{interrupt:!0})},u={code:null,containerState:{},defineSkip:p,events:[],now:m,parser:e,previous:null,sliceSerialize:h,sliceStream:d,write:c};let f=t.tokenize.call(u,l);return t.resolveAll&&o.push(t),u;function c(O){return s=kt(s,O),g(),s[s.length-1]!==null?[]:(M(t,0),u.events=Hi(o,u.events,u),u.events)}function h(O,j){return ex(d(O),j)}function d(O){return Xk(s,O)}function m(){const{_bufferIndex:O,_index:j,line:F,column:L,offset:_}=r;return{_bufferIndex:O,_index:j,line:F,column:L,offset:_}}function p(O){i[O.line]=O.column,T()}function g(){let O;for(;r._index<s.length;){const j=s[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,T()):O!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=O}function w(O,j){const F=j||{};return F.type=O,F.start=m(),u.events.push(["enter",F,u]),a.push(F),F}function A(O){const j=a.pop();return j.end=m(),u.events.push(["exit",j,u]),j}function k(O,j){M(O,j.from)}function E(O,j){j.restore()}function I(O,j){return F;function F(L,_,B){let z,H,W,b;return Array.isArray(L)?R(L):"tokenize"in L?R([L]):N(L);function N(K){return Q;function Q(X){const se=X!==null&&K[X],Y=X!==null&&K.null,re=[...Array.isArray(se)?se:se?[se]:[],...Array.isArray(Y)?Y:Y?[Y]:[]];return R(re)(X)}}function R(K){return z=K,H=0,K.length===0?B:S(K[H])}function S(K){return Q;function Q(X){return b=P(),W=K,K.partial||(u.currentConstruct=K),K.name&&u.parser.constructs.disable.null.includes(K.name)?ee():K.tokenize.call(j?Object.assign(Object.create(u),j):u,l,V,ee)(X)}}function V(K){return O(W,b),_}function ee(K){return b.restore(),++H<z.length?S(z[H]):B}}}function M(O,j){O.resolveAll&&!o.includes(O)&&o.push(O),O.resolve&&gt(u.events,j,u.events.length-j,O.resolve(u.events.slice(j),u)),O.resolveTo&&(u.events=O.resolveTo(u.events,u))}function P(){const O=m(),j=u.previous,F=u.currentConstruct,L=u.events.length,_=Array.from(a);return{from:L,restore:B};function B(){r=O,u.previous=j,u.currentConstruct=F,u.events.length=L,a=_,T()}}function T(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Xk(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function ex(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
28
28
  `;break}case-3:{s=`\r
29
- `;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}function tx(e){const r={constructs:Fd([Zk,...(e||{}).extensions||[]]),content:i(CS),defined:[],document:i(TS),flow:i(Wk),lazy:{},string:i(Kk),text:i(Gk)};return r;function i(o){return s;function s(a){return Jk(r,o,a)}}}function nx(e){for(;!Wd(e););return e}const Xd=/[\0\t\n\r]/g;function rx(){let e=1,t="",n=!0,r;return i;function i(o,s,a){const l=[];let u,f,c,h,d;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),c=0,t="",n&&(o.charCodeAt(0)===65279&&c++,n=void 0);c<o.length;){if(Xd.lastIndex=c,u=Xd.exec(o),h=u&&u.index!==void 0?u.index:o.length,d=o.charCodeAt(h),!u){t=o.slice(c);break}if(d===10&&c===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),c<h&&(l.push(o.slice(c,h)),e+=h-c),d){case 0:{l.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,l.push(-2);e++<f;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}c=h+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const ix=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ox(e){return e.replace(ix,sx)}function sx(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return Rd(n.slice(o?2:1),o?16:10)}return ta(n)||e}const eh={}.hasOwnProperty;function ax(e,t,n){return typeof t!="string"&&(n=t,t=void 0),lx(n)(nx(tx(n).document().write(rx()(e,t,!0))))}function lx(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(fe),autolinkProtocol:L,autolinkEmail:L,atxHeading:o(we),blockQuote:o(K),characterEscape:L,characterReference:L,codeFenced:o(re),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(re,s),codeText:o(B,s),codeTextData:L,data:L,codeFlowValue:L,definition:o(ne),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(me),hardBreakEscape:o(Q),hardBreakTrailing:o(Q),htmlFlow:o(ue,s),htmlFlowData:L,htmlText:o(ue,s),htmlTextData:L,image:o(de),label:s,link:o(fe),listItem:o(Fe),listItemValue:h,listOrdered:o(Te,c),listUnordered:o(Te),paragraph:o(De),reference:S,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(we),strong:o(Ue),thematicBreak:o(ae)},exit:{atxHeading:l(),atxHeadingSequence:k,autolink:l(),autolinkEmail:se,autolinkProtocol:J,blockQuote:l(),characterEscapeValue:T,characterReferenceMarkerHexadecimal:ee,characterReferenceMarkerNumeric:ee,characterReferenceValue:Y,characterReference:G,codeFenced:l(g),codeFencedFence:p,codeFencedFenceInfo:d,codeFencedFenceMeta:m,codeFlowValue:T,codeIndented:l(v),codeText:l(_),codeTextData:T,data:T,definition:l(),definitionDestinationString:A,definitionLabelString:y,definitionTitleString:w,emphasis:l(),hardBreakEscape:l(H),hardBreakTrailing:l(H),htmlFlow:l(P),htmlFlowData:T,htmlText:l(F),htmlTextData:T,image:l($),label:W,labelText:U,lineEnding:O,link:l(z),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:V,resourceDestinationString:b,resourceTitleString:N,resource:R,setextHeading:l(M),setextHeadingLineSequence:I,setextHeadingText:E,strong:l(),thematicBreak:l()}};th(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(j){let q={type:"root",children:[]};const oe={stack:[q],tokenStack:[],config:t,enter:a,exit:u,buffer:s,resume:f,data:n},le=[];let he=-1;for(;++he<j.length;)if(j[he][1].type==="listOrdered"||j[he][1].type==="listUnordered")if(j[he][0]==="enter")le.push(he);else{const je=le.pop();he=i(j,je,he)}for(he=-1;++he<j.length;){const je=t[j[he][0]];eh.call(je,j[he][1].type)&&je[j[he][1].type].call(Object.assign({sliceSerialize:j[he][2].sliceSerialize},oe),j[he][1])}if(oe.tokenStack.length>0){const je=oe.tokenStack[oe.tokenStack.length-1];(je[1]||nh).call(oe,void 0,je[0])}for(q.position={start:ln(j.length>0?j[0][1].start:{line:1,column:1,offset:0}),end:ln(j.length>0?j[j.length-2][1].end:{line:1,column:1,offset:0})},he=-1;++he<t.transforms.length;)q=t.transforms[he](q)||q;return q}function i(j,q,oe){let le=q-1,he=-1,je=!1,Qe,Je,Ct,Bt;for(;++le<=oe;){const Ze=j[le];switch(Ze[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ze[0]==="enter"?he++:he--,Bt=void 0;break}case"lineEndingBlank":{Ze[0]==="enter"&&(Qe&&!Bt&&!he&&!Ct&&(Ct=le),Bt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Bt=void 0}if(!he&&Ze[0]==="enter"&&Ze[1].type==="listItemPrefix"||he===-1&&Ze[0]==="exit"&&(Ze[1].type==="listUnordered"||Ze[1].type==="listOrdered")){if(Qe){let At=le;for(Je=void 0;At--;){const lt=j[At];if(lt[1].type==="lineEnding"||lt[1].type==="lineEndingBlank"){if(lt[0]==="exit")continue;Je&&(j[Je][1].type="lineEndingBlank",je=!0),lt[1].type="lineEnding",Je=At}else if(!(lt[1].type==="linePrefix"||lt[1].type==="blockQuotePrefix"||lt[1].type==="blockQuotePrefixWhitespace"||lt[1].type==="blockQuoteMarker"||lt[1].type==="listItemIndent"))break}Ct&&(!Je||Ct<Je)&&(Qe._spread=!0),Qe.end=Object.assign({},Je?j[Je][1].start:Ze[1].end),j.splice(Je||le,0,["exit",Qe,Ze[2]]),le++,oe++}if(Ze[1].type==="listItemPrefix"){const At={type:"listItem",_spread:!1,start:Object.assign({},Ze[1].start),end:void 0};Qe=At,j.splice(le,0,["enter",At,Ze[2]]),le++,oe++,Ct=void 0,Bt=!0}}}return j[q][1]._spread=je,oe}function o(j,q){return oe;function oe(le){a.call(this,j(le),le),q&&q.call(this,le)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(j,q,oe){this.stack[this.stack.length-1].children.push(j),this.stack.push(j),this.tokenStack.push([q,oe||void 0]),j.position={start:ln(q.start),end:void 0}}function l(j){return q;function q(oe){j&&j.call(this,oe),u.call(this,oe)}}function u(j,q){const oe=this.stack.pop(),le=this.tokenStack.pop();if(le)le[0].type!==j.type&&(q?q.call(this,j,le[0]):(le[1]||nh).call(this,j,le[0]));else throw new Error("Cannot close `"+j.type+"` ("+$r({start:j.start,end:j.end})+"): it’s not open");oe.position.end=ln(j.end)}function f(){return ea(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function h(j){if(this.data.expectingFirstListItemValue){const q=this.stack[this.stack.length-2];q.start=Number.parseInt(this.sliceSerialize(j),10),this.data.expectingFirstListItemValue=void 0}}function d(){const j=this.resume(),q=this.stack[this.stack.length-1];q.lang=j}function m(){const j=this.resume(),q=this.stack[this.stack.length-1];q.meta=j}function p(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){const j=this.resume(),q=this.stack[this.stack.length-1];q.value=j.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const j=this.resume(),q=this.stack[this.stack.length-1];q.value=j.replace(/(\r?\n|\r)$/g,"")}function y(j){const q=this.resume(),oe=this.stack[this.stack.length-1];oe.label=q,oe.identifier=Mt(this.sliceSerialize(j)).toLowerCase()}function w(){const j=this.resume(),q=this.stack[this.stack.length-1];q.title=j}function A(){const j=this.resume(),q=this.stack[this.stack.length-1];q.url=j}function k(j){const q=this.stack[this.stack.length-1];if(!q.depth){const oe=this.sliceSerialize(j).length;q.depth=oe}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function I(j){const q=this.stack[this.stack.length-1];q.depth=this.sliceSerialize(j).codePointAt(0)===61?1:2}function M(){this.data.setextHeadingSlurpLineEnding=void 0}function L(j){const oe=this.stack[this.stack.length-1].children;let le=oe[oe.length-1];(!le||le.type!=="text")&&(le=te(),le.position={start:ln(j.start),end:void 0},oe.push(le)),this.stack.push(le)}function T(j){const q=this.stack.pop();q.value+=this.sliceSerialize(j),q.position.end=ln(j.end)}function O(j){const q=this.stack[this.stack.length-1];if(this.data.atHardBreak){const oe=q.children[q.children.length-1];oe.position.end=ln(j.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(q.type)&&(L.call(this,j),T.call(this,j))}function H(){this.data.atHardBreak=!0}function P(){const j=this.resume(),q=this.stack[this.stack.length-1];q.value=j}function F(){const j=this.resume(),q=this.stack[this.stack.length-1];q.value=j}function _(){const j=this.resume(),q=this.stack[this.stack.length-1];q.value=j}function z(){const j=this.stack[this.stack.length-1];if(this.data.inReference){const q=this.data.referenceType||"shortcut";j.type+="Reference",j.referenceType=q,delete j.url,delete j.title}else delete j.identifier,delete j.label;this.data.referenceType=void 0}function $(){const j=this.stack[this.stack.length-1];if(this.data.inReference){const q=this.data.referenceType||"shortcut";j.type+="Reference",j.referenceType=q,delete j.url,delete j.title}else delete j.identifier,delete j.label;this.data.referenceType=void 0}function U(j){const q=this.sliceSerialize(j),oe=this.stack[this.stack.length-2];oe.label=ox(q),oe.identifier=Mt(q).toLowerCase()}function W(){const j=this.stack[this.stack.length-1],q=this.resume(),oe=this.stack[this.stack.length-1];if(this.data.inReference=!0,oe.type==="link"){const le=j.children;oe.children=le}else oe.alt=q}function b(){const j=this.resume(),q=this.stack[this.stack.length-1];q.url=j}function N(){const j=this.resume(),q=this.stack[this.stack.length-1];q.title=j}function R(){this.data.inReference=void 0}function S(){this.data.referenceType="collapsed"}function V(j){const q=this.resume(),oe=this.stack[this.stack.length-1];oe.label=q,oe.identifier=Mt(this.sliceSerialize(j)).toLowerCase(),this.data.referenceType="full"}function ee(j){this.data.characterReferenceType=j.type}function Y(j){const q=this.sliceSerialize(j),oe=this.data.characterReferenceType;let le;oe?(le=Rd(q,oe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):le=ta(q);const he=this.stack[this.stack.length-1];he.value+=le}function G(j){const q=this.stack.pop();q.position.end=ln(j.end)}function J(j){T.call(this,j);const q=this.stack[this.stack.length-1];q.url=this.sliceSerialize(j)}function se(j){T.call(this,j);const q=this.stack[this.stack.length-1];q.url="mailto:"+this.sliceSerialize(j)}function K(){return{type:"blockquote",children:[]}}function re(){return{type:"code",lang:null,meta:null,value:""}}function B(){return{type:"inlineCode",value:""}}function ne(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function me(){return{type:"emphasis",children:[]}}function we(){return{type:"heading",depth:0,children:[]}}function Q(){return{type:"break"}}function ue(){return{type:"html",value:""}}function de(){return{type:"image",title:null,url:"",alt:null}}function fe(){return{type:"link",title:null,url:"",children:[]}}function Te(j){return{type:"list",ordered:j.type==="listOrdered",start:null,spread:j._spread,children:[]}}function Fe(j){return{type:"listItem",spread:j._spread,checked:null,children:[]}}function De(){return{type:"paragraph",children:[]}}function Ue(){return{type:"strong",children:[]}}function te(){return{type:"text",value:""}}function ae(){return{type:"thematicBreak"}}}function ln(e){return{line:e.line,column:e.column,offset:e.offset}}function th(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?th(e,r):ux(e,r)}}function ux(e,t){let n;for(n in t)if(eh.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function nh(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+$r({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+$r({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+$r({start:t.start,end:t.end})+") is still open")}function cx(e){const t=this;t.parser=n;function n(r){return ax(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function fx(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function dx(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
29
+ `;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}function tx(e){const r={constructs:Fd([Zk,...(e||{}).extensions||[]]),content:i(CS),defined:[],document:i(TS),flow:i(Wk),lazy:{},string:i(Kk),text:i(Gk)};return r;function i(o){return s;function s(a){return Jk(r,o,a)}}}function nx(e){for(;!Wd(e););return e}const Xd=/[\0\t\n\r]/g;function rx(){let e=1,t="",n=!0,r;return i;function i(o,s,a){const l=[];let u,f,c,h,d;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),c=0,t="",n&&(o.charCodeAt(0)===65279&&c++,n=void 0);c<o.length;){if(Xd.lastIndex=c,u=Xd.exec(o),h=u&&u.index!==void 0?u.index:o.length,d=o.charCodeAt(h),!u){t=o.slice(c);break}if(d===10&&c===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),c<h&&(l.push(o.slice(c,h)),e+=h-c),d){case 0:{l.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,l.push(-2);e++<f;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}c=h+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const ix=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ox(e){return e.replace(ix,sx)}function sx(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return Rd(n.slice(o?2:1),o?16:10)}return ta(n)||e}const eh={}.hasOwnProperty;function ax(e,t,n){return typeof t!="string"&&(n=t,t=void 0),lx(n)(nx(tx(n).document().write(rx()(e,t,!0))))}function lx(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(fe),autolinkProtocol:P,autolinkEmail:P,atxHeading:o(Ce),blockQuote:o(Y),characterEscape:P,characterReference:P,codeFenced:o(re),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(re,s),codeText:o($,s),codeTextData:P,data:P,codeFlowValue:P,definition:o(ne),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(he),hardBreakEscape:o(G),hardBreakTrailing:o(G),htmlFlow:o(ue,s),htmlFlowData:P,htmlText:o(ue,s),htmlTextData:P,image:o(de),label:s,link:o(fe),listItem:o(Fe),listItemValue:h,listOrdered:o(Te,c),listUnordered:o(Te),paragraph:o(De),reference:S,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(Ce),strong:o(Ue),thematicBreak:o(ae)},exit:{atxHeading:l(),atxHeadingSequence:k,autolink:l(),autolinkEmail:se,autolinkProtocol:X,blockQuote:l(),characterEscapeValue:T,characterReferenceMarkerHexadecimal:ee,characterReferenceMarkerNumeric:ee,characterReferenceValue:K,characterReference:Q,codeFenced:l(g),codeFencedFence:p,codeFencedFenceInfo:d,codeFencedFenceMeta:m,codeFlowValue:T,codeIndented:l(y),codeText:l(_),codeTextData:T,data:T,definition:l(),definitionDestinationString:A,definitionLabelString:v,definitionTitleString:w,emphasis:l(),hardBreakEscape:l(j),hardBreakTrailing:l(j),htmlFlow:l(F),htmlFlowData:T,htmlText:l(L),htmlTextData:T,image:l(z),label:W,labelText:H,lineEnding:O,link:l(B),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:V,resourceDestinationString:b,resourceTitleString:N,resource:R,setextHeading:l(M),setextHeadingLineSequence:I,setextHeadingText:E,strong:l(),thematicBreak:l()}};th(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(U){let q={type:"root",children:[]};const oe={stack:[q],tokenStack:[],config:t,enter:a,exit:u,buffer:s,resume:f,data:n},le=[];let pe=-1;for(;++pe<U.length;)if(U[pe][1].type==="listOrdered"||U[pe][1].type==="listUnordered")if(U[pe][0]==="enter")le.push(pe);else{const je=le.pop();pe=i(U,je,pe)}for(pe=-1;++pe<U.length;){const je=t[U[pe][0]];eh.call(je,U[pe][1].type)&&je[U[pe][1].type].call(Object.assign({sliceSerialize:U[pe][2].sliceSerialize},oe),U[pe][1])}if(oe.tokenStack.length>0){const je=oe.tokenStack[oe.tokenStack.length-1];(je[1]||nh).call(oe,void 0,je[0])}for(q.position={start:ln(U.length>0?U[0][1].start:{line:1,column:1,offset:0}),end:ln(U.length>0?U[U.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(U,q,oe){let le=q-1,pe=-1,je=!1,Qe,Je,Ct,Bt;for(;++le<=oe;){const Ze=U[le];switch(Ze[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ze[0]==="enter"?pe++:pe--,Bt=void 0;break}case"lineEndingBlank":{Ze[0]==="enter"&&(Qe&&!Bt&&!pe&&!Ct&&(Ct=le),Bt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Bt=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(Qe){let At=le;for(Je=void 0;At--;){const lt=U[At];if(lt[1].type==="lineEnding"||lt[1].type==="lineEndingBlank"){if(lt[0]==="exit")continue;Je&&(U[Je][1].type="lineEndingBlank",je=!0),lt[1].type="lineEnding",Je=At}else if(!(lt[1].type==="linePrefix"||lt[1].type==="blockQuotePrefix"||lt[1].type==="blockQuotePrefixWhitespace"||lt[1].type==="blockQuoteMarker"||lt[1].type==="listItemIndent"))break}Ct&&(!Je||Ct<Je)&&(Qe._spread=!0),Qe.end=Object.assign({},Je?U[Je][1].start:Ze[1].end),U.splice(Je||le,0,["exit",Qe,Ze[2]]),le++,oe++}if(Ze[1].type==="listItemPrefix"){const At={type:"listItem",_spread:!1,start:Object.assign({},Ze[1].start),end:void 0};Qe=At,U.splice(le,0,["enter",At,Ze[2]]),le++,oe++,Ct=void 0,Bt=!0}}}return U[q][1]._spread=je,oe}function o(U,q){return oe;function oe(le){a.call(this,U(le),le),q&&q.call(this,le)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(U,q,oe){this.stack[this.stack.length-1].children.push(U),this.stack.push(U),this.tokenStack.push([q,oe||void 0]),U.position={start:ln(q.start),end:void 0}}function l(U){return q;function q(oe){U&&U.call(this,oe),u.call(this,oe)}}function u(U,q){const oe=this.stack.pop(),le=this.tokenStack.pop();if(le)le[0].type!==U.type&&(q?q.call(this,U,le[0]):(le[1]||nh).call(this,U,le[0]));else throw new Error("Cannot close `"+U.type+"` ("+$r({start:U.start,end:U.end})+"): it’s not open");oe.position.end=ln(U.end)}function f(){return ea(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function h(U){if(this.data.expectingFirstListItemValue){const q=this.stack[this.stack.length-2];q.start=Number.parseInt(this.sliceSerialize(U),10),this.data.expectingFirstListItemValue=void 0}}function d(){const U=this.resume(),q=this.stack[this.stack.length-1];q.lang=U}function m(){const U=this.resume(),q=this.stack[this.stack.length-1];q.meta=U}function p(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){const U=this.resume(),q=this.stack[this.stack.length-1];q.value=U.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const U=this.resume(),q=this.stack[this.stack.length-1];q.value=U.replace(/(\r?\n|\r)$/g,"")}function v(U){const q=this.resume(),oe=this.stack[this.stack.length-1];oe.label=q,oe.identifier=Mt(this.sliceSerialize(U)).toLowerCase()}function w(){const U=this.resume(),q=this.stack[this.stack.length-1];q.title=U}function A(){const U=this.resume(),q=this.stack[this.stack.length-1];q.url=U}function k(U){const q=this.stack[this.stack.length-1];if(!q.depth){const oe=this.sliceSerialize(U).length;q.depth=oe}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function I(U){const q=this.stack[this.stack.length-1];q.depth=this.sliceSerialize(U).codePointAt(0)===61?1:2}function M(){this.data.setextHeadingSlurpLineEnding=void 0}function P(U){const oe=this.stack[this.stack.length-1].children;let le=oe[oe.length-1];(!le||le.type!=="text")&&(le=te(),le.position={start:ln(U.start),end:void 0},oe.push(le)),this.stack.push(le)}function T(U){const q=this.stack.pop();q.value+=this.sliceSerialize(U),q.position.end=ln(U.end)}function O(U){const q=this.stack[this.stack.length-1];if(this.data.atHardBreak){const oe=q.children[q.children.length-1];oe.position.end=ln(U.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(q.type)&&(P.call(this,U),T.call(this,U))}function j(){this.data.atHardBreak=!0}function F(){const U=this.resume(),q=this.stack[this.stack.length-1];q.value=U}function L(){const U=this.resume(),q=this.stack[this.stack.length-1];q.value=U}function _(){const U=this.resume(),q=this.stack[this.stack.length-1];q.value=U}function B(){const U=this.stack[this.stack.length-1];if(this.data.inReference){const q=this.data.referenceType||"shortcut";U.type+="Reference",U.referenceType=q,delete U.url,delete U.title}else delete U.identifier,delete U.label;this.data.referenceType=void 0}function z(){const U=this.stack[this.stack.length-1];if(this.data.inReference){const q=this.data.referenceType||"shortcut";U.type+="Reference",U.referenceType=q,delete U.url,delete U.title}else delete U.identifier,delete U.label;this.data.referenceType=void 0}function H(U){const q=this.sliceSerialize(U),oe=this.stack[this.stack.length-2];oe.label=ox(q),oe.identifier=Mt(q).toLowerCase()}function W(){const U=this.stack[this.stack.length-1],q=this.resume(),oe=this.stack[this.stack.length-1];if(this.data.inReference=!0,oe.type==="link"){const le=U.children;oe.children=le}else oe.alt=q}function b(){const U=this.resume(),q=this.stack[this.stack.length-1];q.url=U}function N(){const U=this.resume(),q=this.stack[this.stack.length-1];q.title=U}function R(){this.data.inReference=void 0}function S(){this.data.referenceType="collapsed"}function V(U){const q=this.resume(),oe=this.stack[this.stack.length-1];oe.label=q,oe.identifier=Mt(this.sliceSerialize(U)).toLowerCase(),this.data.referenceType="full"}function ee(U){this.data.characterReferenceType=U.type}function K(U){const q=this.sliceSerialize(U),oe=this.data.characterReferenceType;let le;oe?(le=Rd(q,oe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):le=ta(q);const pe=this.stack[this.stack.length-1];pe.value+=le}function Q(U){const q=this.stack.pop();q.position.end=ln(U.end)}function X(U){T.call(this,U);const q=this.stack[this.stack.length-1];q.url=this.sliceSerialize(U)}function se(U){T.call(this,U);const q=this.stack[this.stack.length-1];q.url="mailto:"+this.sliceSerialize(U)}function Y(){return{type:"blockquote",children:[]}}function re(){return{type:"code",lang:null,meta:null,value:""}}function $(){return{type:"inlineCode",value:""}}function ne(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function he(){return{type:"emphasis",children:[]}}function Ce(){return{type:"heading",depth:0,children:[]}}function G(){return{type:"break"}}function ue(){return{type:"html",value:""}}function de(){return{type:"image",title:null,url:"",alt:null}}function fe(){return{type:"link",title:null,url:"",children:[]}}function Te(U){return{type:"list",ordered:U.type==="listOrdered",start:null,spread:U._spread,children:[]}}function Fe(U){return{type:"listItem",spread:U._spread,checked:null,children:[]}}function De(){return{type:"paragraph",children:[]}}function Ue(){return{type:"strong",children:[]}}function te(){return{type:"text",value:""}}function ae(){return{type:"thematicBreak"}}}function ln(e){return{line:e.line,column:e.column,offset:e.offset}}function th(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?th(e,r):ux(e,r)}}function ux(e,t){let n;for(n in t)if(eh.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function nh(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+$r({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+$r({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+$r({start:t.start,end:t.end})+") is still open")}function cx(e){const t=this;t.parser=n;function n(r){return ax(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function fx(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function dx(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
30
30
  `}]}function hx(e,t){const n=t.value?t.value+`
31
31
  `:"",r={};t.lang&&(r.className=["language-"+t.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function px(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function mx(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function gx(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Yn(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let s,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=o+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)}function yx(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function vx(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function rh(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function bx(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return rh(e,t);const i={src:Yn(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function wx(e,t){const n={src:Yn(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Sx(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function kx(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return rh(e,t);const i={href:Yn(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function xx(e,t){const n={href:Yn(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Ex(e,t,n){const r=e.all(t),i=n?Cx(n):ih(t),o={},s=[];if(typeof t.checked=="boolean"){const f=r[0];let c;f&&f.type==="element"&&f.tagName==="p"?c=f:(c={type:"element",tagName:"p",properties:{},children:[]},r.unshift(c)),c.children.length>0&&c.children.unshift({type:"text",value:" "}),c.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const f=r[a];(i||a!==0||f.type!=="element"||f.tagName!=="p")&&s.push({type:"text",value:`
32
32
  `}),f.type==="element"&&f.tagName==="p"&&!i?s.push(...f.children):s.push(f)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&s.push({type:"text",value:`
33
- `});const u={type:"element",tagName:"li",properties:o,children:s};return e.patch(t,u),e.applyData(t,u)}function Cx(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=ih(n[r])}return t}function ih(e){const t=e.spread;return t??e.children.length>1}function Ax(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function Tx(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ix(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Ox(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Dx(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=Ks(t.children[1]),l=Ed(t.children[t.children.length-1]);a&&l&&(s.position={start:a,end:l}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function Mx(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length;let l=-1;const u=[];for(;++l<a;){const c=t.children[l],h={},d=s?s[l]:void 0;d&&(h.align=d);let m={type:"element",tagName:o,properties:h,children:[]};c&&(m.children=e.all(c),e.patch(c,m),m=e.applyData(c,m)),u.push(m)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,f),e.applyData(t,f)}function Nx(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const oh=9,sh=32;function Lx(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(ah(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(ah(t.slice(i),i>0,!1)),o.join("")}function ah(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===oh||o===sh;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===oh||o===sh;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function _x(e,t){const n={type:"text",value:Lx(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Px(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Fx={blockquote:fx,break:dx,code:hx,delete:px,emphasis:mx,footnoteReference:gx,heading:yx,html:vx,imageReference:bx,image:wx,inlineCode:Sx,linkReference:kx,link:xx,listItem:Ex,list:Ax,paragraph:Tx,root:Ix,strong:Ox,table:Dx,tableCell:Nx,tableRow:Mx,text:_x,thematicBreak:Px,toml:ji,yaml:ji,definition:ji,footnoteDefinition:ji};function ji(){}const lh=-1,Vi=0,Vr=1,Wi=2,aa=3,la=4,ua=5,ca=6,uh=7,ch=8,fh=typeof self=="object"?self:globalThis,Rx=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,s]=t[i];switch(o){case Vi:case lh:return n(s,i);case Vr:{const a=n([],i);for(const l of s)a.push(r(l));return a}case Wi:{const a=n({},i);for(const[l,u]of s)a[r(l)]=r(u);return a}case aa:return n(new Date(s),i);case la:{const{source:a,flags:l}=s;return n(new RegExp(a,l),i)}case ua:{const a=n(new Map,i);for(const[l,u]of s)a.set(r(l),r(u));return a}case ca:{const a=n(new Set,i);for(const l of s)a.add(r(l));return a}case uh:{const{name:a,message:l}=s;return n(new fh[a](l),i)}case ch:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:a}=new Uint8Array(s);return n(new DataView(a),s)}}return n(new fh[o](s),i)};return r},dh=e=>Rx(new Map,e)(0),Gn="",{toString:Bx}={},{keys:$x}=Object,Wr=e=>{const t=typeof e;if(t!=="object"||!e)return[Vi,t];const n=Bx.call(e).slice(8,-1);switch(n){case"Array":return[Vr,Gn];case"Object":return[Wi,Gn];case"Date":return[aa,Gn];case"RegExp":return[la,Gn];case"Map":return[ua,Gn];case"Set":return[ca,Gn];case"DataView":return[Vr,n]}return n.includes("Array")?[Vr,n]:n.includes("Error")?[uh,n]:[Wi,n]},qi=([e,t])=>e===Vi&&(t==="function"||t==="symbol"),zx=(e,t,n,r)=>{const i=(s,a)=>{const l=r.push(s)-1;return n.set(a,l),l},o=s=>{if(n.has(s))return n.get(s);let[a,l]=Wr(s);switch(a){case Vi:{let f=s;switch(l){case"bigint":a=ch,f=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);f=null;break;case"undefined":return i([lh],s)}return i([a,f],s)}case Vr:{if(l){let h=s;return l==="DataView"?h=new Uint8Array(s.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(s)),i([l,[...h]],s)}const f=[],c=i([a,f],s);for(const h of s)f.push(o(h));return c}case Wi:{if(l)switch(l){case"BigInt":return i([l,s.toString()],s);case"Boolean":case"Number":case"String":return i([l,s.valueOf()],s)}if(t&&"toJSON"in s)return o(s.toJSON());const f=[],c=i([a,f],s);for(const h of $x(s))(e||!qi(Wr(s[h])))&&f.push([o(h),o(s[h])]);return c}case aa:return i([a,s.toISOString()],s);case la:{const{source:f,flags:c}=s;return i([a,{source:f,flags:c}],s)}case ua:{const f=[],c=i([a,f],s);for(const[h,d]of s)(e||!(qi(Wr(h))||qi(Wr(d))))&&f.push([o(h),o(d)]);return c}case ca:{const f=[],c=i([a,f],s);for(const h of s)(e||!qi(Wr(h)))&&f.push(o(h));return c}}const{message:u}=s;return i([a,{name:l,message:u}],s)};return o},hh=(e,{json:t,lossy:n}={})=>{const r=[];return zx(!(t||n),!!t,new Map,r)(e),r},Yi=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?dh(hh(e,t)):structuredClone(e):(e,t)=>dh(hh(e,t));function Hx(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Ux(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function jx(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Hx,r=e.options.footnoteBackLabel||Ux,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[l]);if(!u)continue;const f=e.all(u),c=String(u.identifier).toUpperCase(),h=Yn(c.toLowerCase());let d=0;const m=[],p=e.footnoteCounts.get(c);for(;p!==void 0&&++d<=p;){m.length>0&&m.push({type:"text",value:" "});let y=typeof n=="string"?n:n(l,d);typeof y=="string"&&(y={type:"text",value:y}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(d>1?"-"+d:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,d),className:["data-footnote-backref"]},children:Array.isArray(y)?y:[y]})}const g=f[f.length-1];if(g&&g.type==="element"&&g.tagName==="p"){const y=g.children[g.children.length-1];y&&y.type==="text"?y.value+=" ":g.children.push({type:"text",value:" "}),g.children.push(...m)}else f.push(...m);const v={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(f,!0)};e.patch(u,v),a.push(v)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Yi(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
33
+ `});const u={type:"element",tagName:"li",properties:o,children:s};return e.patch(t,u),e.applyData(t,u)}function Cx(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=ih(n[r])}return t}function ih(e){const t=e.spread;return t??e.children.length>1}function Ax(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function Tx(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ix(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Ox(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Dx(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=Ks(t.children[1]),l=Ed(t.children[t.children.length-1]);a&&l&&(s.position={start:a,end:l}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function Mx(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length;let l=-1;const u=[];for(;++l<a;){const c=t.children[l],h={},d=s?s[l]:void 0;d&&(h.align=d);let m={type:"element",tagName:o,properties:h,children:[]};c&&(m.children=e.all(c),e.patch(c,m),m=e.applyData(c,m)),u.push(m)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,f),e.applyData(t,f)}function Nx(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const oh=9,sh=32;function Lx(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(ah(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(ah(t.slice(i),i>0,!1)),o.join("")}function ah(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===oh||o===sh;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===oh||o===sh;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function _x(e,t){const n={type:"text",value:Lx(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Px(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Fx={blockquote:fx,break:dx,code:hx,delete:px,emphasis:mx,footnoteReference:gx,heading:yx,html:vx,imageReference:bx,image:wx,inlineCode:Sx,linkReference:kx,link:xx,listItem:Ex,list:Ax,paragraph:Tx,root:Ix,strong:Ox,table:Dx,tableCell:Nx,tableRow:Mx,text:_x,thematicBreak:Px,toml:ji,yaml:ji,definition:ji,footnoteDefinition:ji};function ji(){}const lh=-1,Vi=0,Vr=1,Wi=2,aa=3,la=4,ua=5,ca=6,uh=7,ch=8,fh=typeof self=="object"?self:globalThis,Rx=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,s]=t[i];switch(o){case Vi:case lh:return n(s,i);case Vr:{const a=n([],i);for(const l of s)a.push(r(l));return a}case Wi:{const a=n({},i);for(const[l,u]of s)a[r(l)]=r(u);return a}case aa:return n(new Date(s),i);case la:{const{source:a,flags:l}=s;return n(new RegExp(a,l),i)}case ua:{const a=n(new Map,i);for(const[l,u]of s)a.set(r(l),r(u));return a}case ca:{const a=n(new Set,i);for(const l of s)a.add(r(l));return a}case uh:{const{name:a,message:l}=s;return n(new fh[a](l),i)}case ch:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:a}=new Uint8Array(s);return n(new DataView(a),s)}}return n(new fh[o](s),i)};return r},dh=e=>Rx(new Map,e)(0),Gn="",{toString:Bx}={},{keys:$x}=Object,Wr=e=>{const t=typeof e;if(t!=="object"||!e)return[Vi,t];const n=Bx.call(e).slice(8,-1);switch(n){case"Array":return[Vr,Gn];case"Object":return[Wi,Gn];case"Date":return[aa,Gn];case"RegExp":return[la,Gn];case"Map":return[ua,Gn];case"Set":return[ca,Gn];case"DataView":return[Vr,n]}return n.includes("Array")?[Vr,n]:n.includes("Error")?[uh,n]:[Wi,n]},qi=([e,t])=>e===Vi&&(t==="function"||t==="symbol"),zx=(e,t,n,r)=>{const i=(s,a)=>{const l=r.push(s)-1;return n.set(a,l),l},o=s=>{if(n.has(s))return n.get(s);let[a,l]=Wr(s);switch(a){case Vi:{let f=s;switch(l){case"bigint":a=ch,f=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);f=null;break;case"undefined":return i([lh],s)}return i([a,f],s)}case Vr:{if(l){let h=s;return l==="DataView"?h=new Uint8Array(s.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(s)),i([l,[...h]],s)}const f=[],c=i([a,f],s);for(const h of s)f.push(o(h));return c}case Wi:{if(l)switch(l){case"BigInt":return i([l,s.toString()],s);case"Boolean":case"Number":case"String":return i([l,s.valueOf()],s)}if(t&&"toJSON"in s)return o(s.toJSON());const f=[],c=i([a,f],s);for(const h of $x(s))(e||!qi(Wr(s[h])))&&f.push([o(h),o(s[h])]);return c}case aa:return i([a,s.toISOString()],s);case la:{const{source:f,flags:c}=s;return i([a,{source:f,flags:c}],s)}case ua:{const f=[],c=i([a,f],s);for(const[h,d]of s)(e||!(qi(Wr(h))||qi(Wr(d))))&&f.push([o(h),o(d)]);return c}case ca:{const f=[],c=i([a,f],s);for(const h of s)(e||!qi(Wr(h)))&&f.push(o(h));return c}}const{message:u}=s;return i([a,{name:l,message:u}],s)};return o},hh=(e,{json:t,lossy:n}={})=>{const r=[];return zx(!(t||n),!!t,new Map,r)(e),r},Yi=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?dh(hh(e,t)):structuredClone(e):(e,t)=>dh(hh(e,t));function Hx(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Ux(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function jx(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Hx,r=e.options.footnoteBackLabel||Ux,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[l]);if(!u)continue;const f=e.all(u),c=String(u.identifier).toUpperCase(),h=Yn(c.toLowerCase());let d=0;const m=[],p=e.footnoteCounts.get(c);for(;p!==void 0&&++d<=p;){m.length>0&&m.push({type:"text",value:" "});let v=typeof n=="string"?n:n(l,d);typeof v=="string"&&(v={type:"text",value:v}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(d>1?"-"+d:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,d),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const g=f[f.length-1];if(g&&g.type==="element"&&g.tagName==="p"){const v=g.children[g.children.length-1];v&&v.type==="text"?v.value+=" ":g.children.push({type:"text",value:" "}),g.children.push(...m)}else f.push(...m);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(f,!0)};e.patch(u,y),a.push(y)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Yi(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
34
34
  `},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
35
- `}]}}const Ki=function(e){if(e==null)return Yx;if(typeof e=="function")return Gi(e);if(typeof e=="object")return Array.isArray(e)?Vx(e):Wx(e);if(typeof e=="string")return qx(e);throw new Error("Expected function, string, or object as test")};function Vx(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Ki(e[n]);return Gi(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function Wx(e){const t=e;return Gi(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function qx(e){return Gi(t);function t(n){return n&&n.type===e}}function Gi(e){return t;function t(n,r,i){return!!(Kx(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Yx(){return!0}function Kx(e){return e!==null&&typeof e=="object"&&"type"in e}function Z2(e){return e}const ph=[],Gx=!0,fa=!1,Qx="skip";function mh(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=Ki(i),s=r?-1:1;a(e,void 0,[])();function a(l,u,f){const c=l&&typeof l=="object"?l:{};if(typeof c.type=="string"){const d=typeof c.tagName=="string"?c.tagName:typeof c.name=="string"?c.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(d?"<"+d+">":""))+")"})}return h;function h(){let d=ph,m,p,g;if((!t||o(l,u,f[f.length-1]||void 0))&&(d=Zx(n(l,f)),d[0]===fa))return d;if("children"in l&&l.children){const v=l;if(v.children&&d[0]!==Qx)for(p=(r?v.children.length:-1)+s,g=f.concat(v);p>-1&&p<v.children.length;){const y=v.children[p];if(m=a(y,p,g)(),m[0]===fa)return m;p=typeof m[1]=="number"?m[1]:p+s}}return d}}}function Zx(e){return Array.isArray(e)?e:typeof e=="number"?[Gx,e]:e==null?ph:[e]}function da(e,t,n,r){let i,o,s;typeof t=="function"&&typeof n!="function"?(o=void 0,s=t,i=n):(o=t,s=n,i=r),mh(e,o,a,i);function a(l,u){const f=u[u.length-1],c=f?f.children.indexOf(l):void 0;return s(l,c,f)}}const ha={}.hasOwnProperty,Jx={};function Xx(e,t){const n=t||Jx,r=new Map,i=new Map,o=new Map,s={...Fx,...n.handlers},a={all:u,applyData:tE,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:s,one:l,options:n,patch:eE,wrap:rE};return da(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const c=f.type==="definition"?r:i,h=String(f.identifier).toUpperCase();c.has(h)||c.set(h,f)}}),a;function l(f,c){const h=f.type,d=a.handlers[h];if(ha.call(a.handlers,h)&&d)return d(a,f,c);if(a.options.passThrough&&a.options.passThrough.includes(h)){if("children"in f){const{children:p,...g}=f,v=Yi(g);return v.children=a.all(f),v}return Yi(f)}return(a.options.unknownHandler||nE)(a,f,c)}function u(f){const c=[];if("children"in f){const h=f.children;let d=-1;for(;++d<h.length;){const m=a.one(h[d],f);if(m){if(d&&h[d-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=gh(m.value)),!Array.isArray(m)&&m.type==="element")){const p=m.children[0];p&&p.type==="text"&&(p.value=gh(p.value))}Array.isArray(m)?c.push(...m):c.push(m)}}}return c}}function eE(e,t){e.position&&(t.position=Z1(e))}function tE(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&o&&Object.assign(n.properties,Yi(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function nE(e,t){const n=t.data||{},r="value"in t&&!(ha.call(n,"hProperties")||ha.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function rE(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
35
+ `}]}}const Ki=function(e){if(e==null)return Yx;if(typeof e=="function")return Gi(e);if(typeof e=="object")return Array.isArray(e)?Vx(e):Wx(e);if(typeof e=="string")return qx(e);throw new Error("Expected function, string, or object as test")};function Vx(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Ki(e[n]);return Gi(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function Wx(e){const t=e;return Gi(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function qx(e){return Gi(t);function t(n){return n&&n.type===e}}function Gi(e){return t;function t(n,r,i){return!!(Kx(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Yx(){return!0}function Kx(e){return e!==null&&typeof e=="object"&&"type"in e}function X2(e){return e}const ph=[],Gx=!0,fa=!1,Qx="skip";function mh(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=Ki(i),s=r?-1:1;a(e,void 0,[])();function a(l,u,f){const c=l&&typeof l=="object"?l:{};if(typeof c.type=="string"){const d=typeof c.tagName=="string"?c.tagName:typeof c.name=="string"?c.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(d?"<"+d+">":""))+")"})}return h;function h(){let d=ph,m,p,g;if((!t||o(l,u,f[f.length-1]||void 0))&&(d=Zx(n(l,f)),d[0]===fa))return d;if("children"in l&&l.children){const y=l;if(y.children&&d[0]!==Qx)for(p=(r?y.children.length:-1)+s,g=f.concat(y);p>-1&&p<y.children.length;){const v=y.children[p];if(m=a(v,p,g)(),m[0]===fa)return m;p=typeof m[1]=="number"?m[1]:p+s}}return d}}}function Zx(e){return Array.isArray(e)?e:typeof e=="number"?[Gx,e]:e==null?ph:[e]}function da(e,t,n,r){let i,o,s;typeof t=="function"&&typeof n!="function"?(o=void 0,s=t,i=n):(o=t,s=n,i=r),mh(e,o,a,i);function a(l,u){const f=u[u.length-1],c=f?f.children.indexOf(l):void 0;return s(l,c,f)}}const ha={}.hasOwnProperty,Jx={};function Xx(e,t){const n=t||Jx,r=new Map,i=new Map,o=new Map,s={...Fx,...n.handlers},a={all:u,applyData:tE,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:s,one:l,options:n,patch:eE,wrap:rE};return da(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const c=f.type==="definition"?r:i,h=String(f.identifier).toUpperCase();c.has(h)||c.set(h,f)}}),a;function l(f,c){const h=f.type,d=a.handlers[h];if(ha.call(a.handlers,h)&&d)return d(a,f,c);if(a.options.passThrough&&a.options.passThrough.includes(h)){if("children"in f){const{children:p,...g}=f,y=Yi(g);return y.children=a.all(f),y}return Yi(f)}return(a.options.unknownHandler||nE)(a,f,c)}function u(f){const c=[];if("children"in f){const h=f.children;let d=-1;for(;++d<h.length;){const m=a.one(h[d],f);if(m){if(d&&h[d-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=gh(m.value)),!Array.isArray(m)&&m.type==="element")){const p=m.children[0];p&&p.type==="text"&&(p.value=gh(p.value))}Array.isArray(m)?c.push(...m):c.push(m)}}}return c}}function eE(e,t){e.position&&(t.position=Z1(e))}function tE(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&o&&Object.assign(n.properties,Yi(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function nE(e,t){const n=t.data||{},r="value"in t&&!(ha.call(n,"hProperties")||ha.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function rE(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
36
36
  `});++r<e.length;)r&&n.push({type:"text",value:`
37
37
  `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
38
38
  `}),n}function gh(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function yh(e,t){const n=Xx(e,t),r=n.one(e,void 0),i=jx(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
39
- `},i),o}function iE(e,t){return e&&"run"in e?async function(n,r){const i=yh(n,{file:r,...t});await e.run(i,r)}:function(n,r){return yh(n,{file:r,...e||t})}}function vh(e){if(e)throw e}var Qi=Object.prototype.hasOwnProperty,bh=Object.prototype.toString,wh=Object.defineProperty,Sh=Object.getOwnPropertyDescriptor,kh=function(t){return typeof Array.isArray=="function"?Array.isArray(t):bh.call(t)==="[object Array]"},xh=function(t){if(!t||bh.call(t)!=="[object Object]")return!1;var n=Qi.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Qi.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Qi.call(t,i)},Eh=function(t,n){wh&&n.name==="__proto__"?wh(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Ch=function(t,n){if(n==="__proto__")if(Qi.call(t,n)){if(Sh)return Sh(t,n).value}else return;return t[n]},oE=function e(){var t,n,r,i,o,s,a=arguments[0],l=1,u=arguments.length,f=!1;for(typeof a=="boolean"&&(f=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<u;++l)if(t=arguments[l],t!=null)for(n in t)r=Ch(a,n),i=Ch(t,n),a!==i&&(f&&i&&(xh(i)||(o=kh(i)))?(o?(o=!1,s=r&&kh(r)?r:[]):s=r&&xh(r)?r:{},Eh(a,{name:n,newValue:e(f,s,i)})):typeof i<"u"&&Eh(a,{name:n,newValue:i}));return a};const pa=bn(oE);function ma(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function sE(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...i);function a(l,...u){const f=e[++o];let c=-1;if(l){s(l);return}for(;++c<i.length;)(u[c]===null||u[c]===void 0)&&(u[c]=i[c]);i=u,f?aE(f,a)(...u):s(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function aE(e,t){let n;return r;function r(...s){const a=e.length>s.length;let l;a&&s.push(i);try{l=e.apply(this,s)}catch(u){const f=u;if(a&&n)throw f;return i(f)}a||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(s,...a){n||(n=!0,t(s,...a))}function o(s){i(null,s)}}const $t={basename:lE,dirname:uE,extname:cE,join:fE,sep:"/"};function lE(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');qr(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function uE(e){if(qr(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function cE(e){qr(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function fE(...e){let t=-1,n;for(;++t<e.length;)qr(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":dE(n)}function dE(e){qr(e);const t=e.codePointAt(0)===47;let n=hE(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function hE(e,t){let n="",r=0,i=-1,o=0,s=-1,a,l;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(i===s-1||o===1))if(i!==s-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function qr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const pE={cwd:mE};function mE(){return"/"}function ga(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function gE(e){if(typeof e=="string")e=new URL(e);else if(!ga(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return yE(e)}function yE(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const ya=["history","path","basename","stem","extname","dirname"];class Ah{constructor(t){let n;t?ga(t)?n={path:t}:typeof t=="string"||vE(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":pE.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<ya.length;){const o=ya[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)ya.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?$t.basename(this.path):void 0}set basename(t){ba(t,"basename"),va(t,"basename"),this.path=$t.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?$t.dirname(this.path):void 0}set dirname(t){Th(this.basename,"dirname"),this.path=$t.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?$t.extname(this.path):void 0}set extname(t){if(va(t,"extname"),Th(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=$t.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){ga(t)&&(t=gE(t)),ba(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?$t.basename(this.path,this.extname):void 0}set stem(t){ba(t,"stem"),va(t,"stem"),this.path=$t.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new tt(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function va(e,t){if(e&&e.includes($t.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+$t.sep+"`")}function ba(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Th(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function vE(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const bE=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},wE={}.hasOwnProperty;class wa extends bE{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=sE()}copy(){const t=new wa;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(pa(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(xa("data",this.frozen),this.namespace[t]=n,this):wE.call(this.namespace,t)&&this.namespace[t]||void 0:t?(xa("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Zi(t),r=this.parser||this.Parser;return Sa("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Sa("process",this.parser||this.Parser),ka("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,s){const a=Zi(t),l=r.parse(a);r.run(l,a,function(f,c,h){if(f||!c||!h)return u(f);const d=c,m=r.stringify(d,h);xE(m)?h.value=m:h.result=m,u(f,h)});function u(f,c){f||!c?s(f):o?o(c):n(void 0,c)}}}processSync(t){let n=!1,r;return this.freeze(),Sa("processSync",this.parser||this.Parser),ka("processSync",this.compiler||this.Compiler),this.process(t,i),Oh("processSync","process",n),r;function i(o,s){n=!0,vh(o),r=s}}run(t,n,r){Ih(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(s,a){const l=Zi(n);i.run(t,l,u);function u(f,c,h){const d=c||t;f?a(f):s?s(d):r(void 0,d,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),Oh("runSync","run",r),i;function o(s,a){vh(s),i=a,r=!0}}stringify(t,n){this.freeze();const r=Zi(n),i=this.compiler||this.Compiler;return ka("stringify",i),Ih(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(xa("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[f,...c]=u;l(f,c)}else s(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function s(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(u.plugins),u.settings&&(i.settings=pa(!0,i.settings,u.settings))}function a(u){let f=-1;if(u!=null)if(Array.isArray(u))for(;++f<u.length;){const c=u[f];o(c)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,f){let c=-1,h=-1;for(;++c<r.length;)if(r[c][0]===u){h=c;break}if(h===-1)r.push([u,...f]);else if(f.length>0){let[d,...m]=f;const p=r[h][1];ma(p)&&ma(d)&&(d=pa(!0,p,d)),r[h]=[u,d,...m]}}}}const SE=new wa().freeze();function Sa(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function ka(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function xa(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Ih(e){if(!ma(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Oh(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Zi(e){return kE(e)?e:new Ah(e)}function kE(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function xE(e){return typeof e=="string"||EE(e)}function EE(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const CE="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Dh=[],Mh={allowDangerousHtml:!0},AE=/^(https?|ircs?|mailto|xmpp)$/i,TE=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Nh(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,o=e.components,s=e.disallowedElements,a=e.rehypePlugins||Dh,l=e.remarkPlugins||Dh,u=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Mh}:Mh,f=e.skipHtml,c=e.unwrapDisallowed,h=e.urlTransform||Lh,d=SE().use(cx).use(l).use(iE,u).use(a),m=new Ah;typeof r=="string"&&(m.value=r);for(const y of TE)Object.hasOwn(e,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+CE+y.id,void 0);const p=d.parse(m);let g=d.runSync(p,m);return i&&(g={type:"element",tagName:"div",properties:{className:i},children:g.type==="root"?g.children:[g]}),da(g,v),nS(g,{Fragment:x.Fragment,components:o,ignoreInvalidStyle:!0,jsx:x.jsx,jsxs:x.jsxs,passKeys:!0,passNode:!0});function v(y,w,A){if(y.type==="raw"&&A&&typeof w=="number")return f?A.children.splice(w,1):A.children[w]={type:"text",value:y.value},w;if(y.type==="element"){let k;for(k in Xs)if(Object.hasOwn(Xs,k)&&Object.hasOwn(y.properties,k)){const E=y.properties[k],I=Xs[k];(I===null||I.includes(y.tagName))&&(y.properties[k]=h(String(E||""),k,y))}}if(y.type==="element"){let k=t?!t.includes(y.tagName):s?s.includes(y.tagName):!1;if(!k&&n&&typeof w=="number"&&(k=!n(y,w,A)),k&&A&&typeof w=="number")return c&&y.children?A.children.splice(w,1,...y.children):A.children.splice(w,1),w}}}function Lh(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t<0||i>-1&&t>i||n>-1&&t>n||r>-1&&t>r||AE.test(e.slice(0,t))?e:""}function IE(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function _h(e,t,n){const i=Ki((n||{}).ignore||[]),o=OE(t);let s=-1;for(;++s<o.length;)mh(e,"text",a);function a(u,f){let c=-1,h;for(;++c<f.length;){const d=f[c],m=h?h.children:void 0;if(i(d,m?m.indexOf(d):void 0,h))return;h=d}if(h)return l(u,f)}function l(u,f){const c=f[f.length-1],h=o[s][0],d=o[s][1];let m=0;const g=c.children.indexOf(u);let v=!1,y=[];h.lastIndex=0;let w=h.exec(u.value);for(;w;){const A=w.index,k={index:w.index,input:w.input,stack:[...f,u]};let E=d(...w,k);if(typeof E=="string"&&(E=E.length>0?{type:"text",value:E}:void 0),E===!1?h.lastIndex=A+1:(m!==A&&y.push({type:"text",value:u.value.slice(m,A)}),Array.isArray(E)?y.push(...E):E&&y.push(E),m=A+w[0].length,v=!0),!h.global)break;w=h.exec(u.value)}return v?(m<u.value.length&&y.push({type:"text",value:u.value.slice(m)}),c.children.splice(g,1,...y)):y=[u],g+y.length}}function OE(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([DE(i[0]),ME(i[1])])}return t}function DE(e){return typeof e=="string"?new RegExp(IE(e),"g"):e}function ME(e){return typeof e=="function"?e:function(){return e}}function NE(e){_h(e,[/\r?\n|\r/g,LE])}function LE(){return{type:"break"}}function _E(){return function(e){NE(e)}}function Ph(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const Ea="phrasing",Ca=["autolink","link","image","label"];function PE(){return{transforms:[UE],enter:{literalAutolink:RE,literalAutolinkEmail:Aa,literalAutolinkHttp:Aa,literalAutolinkWww:Aa},exit:{literalAutolink:HE,literalAutolinkEmail:zE,literalAutolinkHttp:BE,literalAutolinkWww:$E}}}function FE(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Ea,notInConstruct:Ca},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Ea,notInConstruct:Ca},{character:":",before:"[ps]",after:"\\/",inConstruct:Ea,notInConstruct:Ca}]}}function RE(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Aa(e){this.config.enter.autolinkProtocol.call(this,e)}function BE(e){this.config.exit.autolinkProtocol.call(this,e)}function $E(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function zE(e){this.config.exit.autolinkEmail.call(this,e)}function HE(e){this.exit(e)}function UE(e){_h(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,jE],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),VE]],{ignore:["link","linkReference"]})}function jE(e,t,n,r,i){let o="";if(!Fh(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!WE(n)))return!1;const s=qE(n+r);if(!s[0])return!1;const a={type:"link",title:null,url:o+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function VE(e,t,n,r){return!Fh(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function WE(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function qE(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=Ph(e,"(");let o=Ph(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function Fh(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||In(n)||zi(n))&&(!t||n!==47)}Rh.peek=tC;function YE(){this.buffer()}function KE(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function GE(){this.buffer()}function QE(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function ZE(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Mt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function JE(e){this.exit(e)}function XE(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Mt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function eC(e){this.exit(e)}function tC(){return"["}function Rh(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const s=n.enter("footnoteReference"),a=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),a(),s(),o+=i.move("]"),o}function nC(){return{enter:{gfmFootnoteCallString:YE,gfmFootnoteCall:KE,gfmFootnoteDefinitionLabelString:GE,gfmFootnoteDefinition:QE},exit:{gfmFootnoteCallString:ZE,gfmFootnoteCall:JE,gfmFootnoteDefinitionLabelString:XE,gfmFootnoteDefinition:eC}}}function rC(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Rh},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,s){const a=o.createTracker(s);let l=a.move("[^");const u=o.enter("footnoteDefinition"),f=o.enter("label");return l+=a.move(o.safe(o.associationId(r),{before:l,after:"]"})),f(),l+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),l+=a.move((t?`
40
- `:" ")+o.indentLines(o.containerFlow(r,a.current()),t?Bh:iC))),u(),l}}function iC(e,t,n){return t===0?e:Bh(e,t,n)}function Bh(e,t,n){return(n?"":" ")+e}const oC=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];$h.peek=cC;function sC(){return{canContainEols:["delete"],enter:{strikethrough:lC},exit:{strikethrough:uC}}}function aC(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:oC}],handlers:{delete:$h}}}function lC(e){this.enter({type:"delete",children:[]},e)}function uC(e){this.exit(e)}function $h(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function cC(){return"~"}function fC(e){return e.length}function dC(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||fC,o=[],s=[],a=[],l=[];let u=0,f=-1;for(;++f<e.length;){const p=[],g=[];let v=-1;for(e[f].length>u&&(u=e[f].length);++v<e[f].length;){const y=hC(e[f][v]);if(n.alignDelimiters!==!1){const w=i(y);g[v]=w,(l[v]===void 0||w>l[v])&&(l[v]=w)}p.push(y)}s[f]=p,a[f]=g}let c=-1;if(typeof r=="object"&&"length"in r)for(;++c<u;)o[c]=zh(r[c]);else{const p=zh(r);for(;++c<u;)o[c]=p}c=-1;const h=[],d=[];for(;++c<u;){const p=o[c];let g="",v="";p===99?(g=":",v=":"):p===108?g=":":p===114&&(v=":");let y=n.alignDelimiters===!1?1:Math.max(1,l[c]-g.length-v.length);const w=g+"-".repeat(y)+v;n.alignDelimiters!==!1&&(y=g.length+y+v.length,y>l[c]&&(l[c]=y),d[c]=y),h[c]=w}s.splice(1,0,h),a.splice(1,0,d),f=-1;const m=[];for(;++f<s.length;){const p=s[f],g=a[f];c=-1;const v=[];for(;++c<u;){const y=p[c]||"";let w="",A="";if(n.alignDelimiters!==!1){const k=l[c]-(g[c]||0),E=o[c];E===114?w=" ".repeat(k):E===99?k%2?(w=" ".repeat(k/2+.5),A=" ".repeat(k/2-.5)):(w=" ".repeat(k/2),A=w):A=" ".repeat(k)}n.delimiterStart!==!1&&!c&&v.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&y==="")&&(n.delimiterStart!==!1||c)&&v.push(" "),n.alignDelimiters!==!1&&v.push(w),v.push(y),n.alignDelimiters!==!1&&v.push(A),n.padding!==!1&&v.push(" "),(n.delimiterEnd!==!1||c!==u-1)&&v.push("|")}m.push(n.delimiterEnd===!1?v.join("").replace(/ +$/,""):v.join(""))}return m.join(`
39
+ `},i),o}function iE(e,t){return e&&"run"in e?async function(n,r){const i=yh(n,{file:r,...t});await e.run(i,r)}:function(n,r){return yh(n,{file:r,...e||t})}}function vh(e){if(e)throw e}var Qi=Object.prototype.hasOwnProperty,bh=Object.prototype.toString,wh=Object.defineProperty,Sh=Object.getOwnPropertyDescriptor,kh=function(t){return typeof Array.isArray=="function"?Array.isArray(t):bh.call(t)==="[object Array]"},xh=function(t){if(!t||bh.call(t)!=="[object Object]")return!1;var n=Qi.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Qi.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Qi.call(t,i)},Eh=function(t,n){wh&&n.name==="__proto__"?wh(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Ch=function(t,n){if(n==="__proto__")if(Qi.call(t,n)){if(Sh)return Sh(t,n).value}else return;return t[n]},oE=function e(){var t,n,r,i,o,s,a=arguments[0],l=1,u=arguments.length,f=!1;for(typeof a=="boolean"&&(f=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<u;++l)if(t=arguments[l],t!=null)for(n in t)r=Ch(a,n),i=Ch(t,n),a!==i&&(f&&i&&(xh(i)||(o=kh(i)))?(o?(o=!1,s=r&&kh(r)?r:[]):s=r&&xh(r)?r:{},Eh(a,{name:n,newValue:e(f,s,i)})):typeof i<"u"&&Eh(a,{name:n,newValue:i}));return a};const pa=bn(oE);function ma(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function sE(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...i);function a(l,...u){const f=e[++o];let c=-1;if(l){s(l);return}for(;++c<i.length;)(u[c]===null||u[c]===void 0)&&(u[c]=i[c]);i=u,f?aE(f,a)(...u):s(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function aE(e,t){let n;return r;function r(...s){const a=e.length>s.length;let l;a&&s.push(i);try{l=e.apply(this,s)}catch(u){const f=u;if(a&&n)throw f;return i(f)}a||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(s,...a){n||(n=!0,t(s,...a))}function o(s){i(null,s)}}const $t={basename:lE,dirname:uE,extname:cE,join:fE,sep:"/"};function lE(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');qr(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function uE(e){if(qr(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function cE(e){qr(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function fE(...e){let t=-1,n;for(;++t<e.length;)qr(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":dE(n)}function dE(e){qr(e);const t=e.codePointAt(0)===47;let n=hE(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function hE(e,t){let n="",r=0,i=-1,o=0,s=-1,a,l;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(i===s-1||o===1))if(i!==s-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function qr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const pE={cwd:mE};function mE(){return"/"}function ga(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function gE(e){if(typeof e=="string")e=new URL(e);else if(!ga(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return yE(e)}function yE(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const ya=["history","path","basename","stem","extname","dirname"];class Ah{constructor(t){let n;t?ga(t)?n={path:t}:typeof t=="string"||vE(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":pE.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<ya.length;){const o=ya[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)ya.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?$t.basename(this.path):void 0}set basename(t){ba(t,"basename"),va(t,"basename"),this.path=$t.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?$t.dirname(this.path):void 0}set dirname(t){Th(this.basename,"dirname"),this.path=$t.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?$t.extname(this.path):void 0}set extname(t){if(va(t,"extname"),Th(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=$t.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){ga(t)&&(t=gE(t)),ba(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?$t.basename(this.path,this.extname):void 0}set stem(t){ba(t,"stem"),va(t,"stem"),this.path=$t.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new tt(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function va(e,t){if(e&&e.includes($t.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+$t.sep+"`")}function ba(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Th(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function vE(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const bE=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},wE={}.hasOwnProperty;class wa extends bE{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=sE()}copy(){const t=new wa;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(pa(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(xa("data",this.frozen),this.namespace[t]=n,this):wE.call(this.namespace,t)&&this.namespace[t]||void 0:t?(xa("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Zi(t),r=this.parser||this.Parser;return Sa("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Sa("process",this.parser||this.Parser),ka("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,s){const a=Zi(t),l=r.parse(a);r.run(l,a,function(f,c,h){if(f||!c||!h)return u(f);const d=c,m=r.stringify(d,h);xE(m)?h.value=m:h.result=m,u(f,h)});function u(f,c){f||!c?s(f):o?o(c):n(void 0,c)}}}processSync(t){let n=!1,r;return this.freeze(),Sa("processSync",this.parser||this.Parser),ka("processSync",this.compiler||this.Compiler),this.process(t,i),Oh("processSync","process",n),r;function i(o,s){n=!0,vh(o),r=s}}run(t,n,r){Ih(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(s,a){const l=Zi(n);i.run(t,l,u);function u(f,c,h){const d=c||t;f?a(f):s?s(d):r(void 0,d,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),Oh("runSync","run",r),i;function o(s,a){vh(s),i=a,r=!0}}stringify(t,n){this.freeze();const r=Zi(n),i=this.compiler||this.Compiler;return ka("stringify",i),Ih(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(xa("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[f,...c]=u;l(f,c)}else s(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function s(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(u.plugins),u.settings&&(i.settings=pa(!0,i.settings,u.settings))}function a(u){let f=-1;if(u!=null)if(Array.isArray(u))for(;++f<u.length;){const c=u[f];o(c)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,f){let c=-1,h=-1;for(;++c<r.length;)if(r[c][0]===u){h=c;break}if(h===-1)r.push([u,...f]);else if(f.length>0){let[d,...m]=f;const p=r[h][1];ma(p)&&ma(d)&&(d=pa(!0,p,d)),r[h]=[u,d,...m]}}}}const SE=new wa().freeze();function Sa(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function ka(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function xa(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Ih(e){if(!ma(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Oh(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Zi(e){return kE(e)?e:new Ah(e)}function kE(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function xE(e){return typeof e=="string"||EE(e)}function EE(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const CE="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Dh=[],Mh={allowDangerousHtml:!0},AE=/^(https?|ircs?|mailto|xmpp)$/i,TE=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Nh(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,o=e.components,s=e.disallowedElements,a=e.rehypePlugins||Dh,l=e.remarkPlugins||Dh,u=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Mh}:Mh,f=e.skipHtml,c=e.unwrapDisallowed,h=e.urlTransform||Lh,d=SE().use(cx).use(l).use(iE,u).use(a),m=new Ah;typeof r=="string"&&(m.value=r);for(const v of TE)Object.hasOwn(e,v.from)&&(""+v.from+(v.to?"use `"+v.to+"` instead":"remove it")+CE+v.id,void 0);const p=d.parse(m);let g=d.runSync(p,m);return i&&(g={type:"element",tagName:"div",properties:{className:i},children:g.type==="root"?g.children:[g]}),da(g,y),nS(g,{Fragment:x.Fragment,components:o,ignoreInvalidStyle:!0,jsx:x.jsx,jsxs:x.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 Xs)if(Object.hasOwn(Xs,k)&&Object.hasOwn(v.properties,k)){const E=v.properties[k],I=Xs[k];(I===null||I.includes(v.tagName))&&(v.properties[k]=h(String(E||""),k,v))}}if(v.type==="element"){let k=t?!t.includes(v.tagName):s?s.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 Lh(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t<0||i>-1&&t>i||n>-1&&t>n||r>-1&&t>r||AE.test(e.slice(0,t))?e:""}function IE(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function _h(e,t,n){const i=Ki((n||{}).ignore||[]),o=OE(t);let s=-1;for(;++s<o.length;)mh(e,"text",a);function a(u,f){let c=-1,h;for(;++c<f.length;){const d=f[c],m=h?h.children:void 0;if(i(d,m?m.indexOf(d):void 0,h))return;h=d}if(h)return l(u,f)}function l(u,f){const c=f[f.length-1],h=o[s][0],d=o[s][1];let m=0;const g=c.children.indexOf(u);let y=!1,v=[];h.lastIndex=0;let w=h.exec(u.value);for(;w;){const A=w.index,k={index:w.index,input:w.input,stack:[...f,u]};let E=d(...w,k);if(typeof E=="string"&&(E=E.length>0?{type:"text",value:E}:void 0),E===!1?h.lastIndex=A+1:(m!==A&&v.push({type:"text",value:u.value.slice(m,A)}),Array.isArray(E)?v.push(...E):E&&v.push(E),m=A+w[0].length,y=!0),!h.global)break;w=h.exec(u.value)}return y?(m<u.value.length&&v.push({type:"text",value:u.value.slice(m)}),c.children.splice(g,1,...v)):v=[u],g+v.length}}function OE(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([DE(i[0]),ME(i[1])])}return t}function DE(e){return typeof e=="string"?new RegExp(IE(e),"g"):e}function ME(e){return typeof e=="function"?e:function(){return e}}function NE(e){_h(e,[/\r?\n|\r/g,LE])}function LE(){return{type:"break"}}function _E(){return function(e){NE(e)}}function Ph(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const Ea="phrasing",Ca=["autolink","link","image","label"];function PE(){return{transforms:[UE],enter:{literalAutolink:RE,literalAutolinkEmail:Aa,literalAutolinkHttp:Aa,literalAutolinkWww:Aa},exit:{literalAutolink:HE,literalAutolinkEmail:zE,literalAutolinkHttp:BE,literalAutolinkWww:$E}}}function FE(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Ea,notInConstruct:Ca},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Ea,notInConstruct:Ca},{character:":",before:"[ps]",after:"\\/",inConstruct:Ea,notInConstruct:Ca}]}}function RE(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Aa(e){this.config.enter.autolinkProtocol.call(this,e)}function BE(e){this.config.exit.autolinkProtocol.call(this,e)}function $E(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function zE(e){this.config.exit.autolinkEmail.call(this,e)}function HE(e){this.exit(e)}function UE(e){_h(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,jE],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),VE]],{ignore:["link","linkReference"]})}function jE(e,t,n,r,i){let o="";if(!Fh(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!WE(n)))return!1;const s=qE(n+r);if(!s[0])return!1;const a={type:"link",title:null,url:o+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function VE(e,t,n,r){return!Fh(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function WE(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function qE(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=Ph(e,"(");let o=Ph(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function Fh(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||In(n)||zi(n))&&(!t||n!==47)}Rh.peek=tC;function YE(){this.buffer()}function KE(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function GE(){this.buffer()}function QE(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function ZE(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Mt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function JE(e){this.exit(e)}function XE(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Mt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function eC(e){this.exit(e)}function tC(){return"["}function Rh(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const s=n.enter("footnoteReference"),a=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),a(),s(),o+=i.move("]"),o}function nC(){return{enter:{gfmFootnoteCallString:YE,gfmFootnoteCall:KE,gfmFootnoteDefinitionLabelString:GE,gfmFootnoteDefinition:QE},exit:{gfmFootnoteCallString:ZE,gfmFootnoteCall:JE,gfmFootnoteDefinitionLabelString:XE,gfmFootnoteDefinition:eC}}}function rC(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Rh},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,s){const a=o.createTracker(s);let l=a.move("[^");const u=o.enter("footnoteDefinition"),f=o.enter("label");return l+=a.move(o.safe(o.associationId(r),{before:l,after:"]"})),f(),l+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),l+=a.move((t?`
40
+ `:" ")+o.indentLines(o.containerFlow(r,a.current()),t?Bh:iC))),u(),l}}function iC(e,t,n){return t===0?e:Bh(e,t,n)}function Bh(e,t,n){return(n?"":" ")+e}const oC=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];$h.peek=cC;function sC(){return{canContainEols:["delete"],enter:{strikethrough:lC},exit:{strikethrough:uC}}}function aC(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:oC}],handlers:{delete:$h}}}function lC(e){this.enter({type:"delete",children:[]},e)}function uC(e){this.exit(e)}function $h(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function cC(){return"~"}function fC(e){return e.length}function dC(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||fC,o=[],s=[],a=[],l=[];let u=0,f=-1;for(;++f<e.length;){const p=[],g=[];let y=-1;for(e[f].length>u&&(u=e[f].length);++y<e[f].length;){const v=hC(e[f][y]);if(n.alignDelimiters!==!1){const w=i(v);g[y]=w,(l[y]===void 0||w>l[y])&&(l[y]=w)}p.push(v)}s[f]=p,a[f]=g}let c=-1;if(typeof r=="object"&&"length"in r)for(;++c<u;)o[c]=zh(r[c]);else{const p=zh(r);for(;++c<u;)o[c]=p}c=-1;const h=[],d=[];for(;++c<u;){const p=o[c];let g="",y="";p===99?(g=":",y=":"):p===108?g=":":p===114&&(y=":");let v=n.alignDelimiters===!1?1:Math.max(1,l[c]-g.length-y.length);const w=g+"-".repeat(v)+y;n.alignDelimiters!==!1&&(v=g.length+v+y.length,v>l[c]&&(l[c]=v),d[c]=v),h[c]=w}s.splice(1,0,h),a.splice(1,0,d),f=-1;const m=[];for(;++f<s.length;){const p=s[f],g=a[f];c=-1;const y=[];for(;++c<u;){const v=p[c]||"";let w="",A="";if(n.alignDelimiters!==!1){const k=l[c]-(g[c]||0),E=o[c];E===114?w=" ".repeat(k):E===99?k%2?(w=" ".repeat(k/2+.5),A=" ".repeat(k/2-.5)):(w=" ".repeat(k/2),A=w):A=" ".repeat(k)}n.delimiterStart!==!1&&!c&&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
41
  `)}function hC(e){return e==null?"":String(e)}function zh(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function pC(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const s=n.indentLines(n.containerFlow(e,o.current()),mC);return i(),s}function mC(e,t,n){return">"+(n?"":" ")+e}function gC(e,t){return Hh(e,t.inConstruct,!0)&&!Hh(e,t.notInConstruct,!1)}function Hh(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Uh(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
42
42
  `&&gC(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
43
43
  `}function yC(e,t){const n=String(e);let r=n.indexOf(t),i=r,o=0,s=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>s&&(s=o):o=1,i=r+t.length,r=n.indexOf(t,i);return s}function vC(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function bC(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function wC(e,t,n,r){const i=bC(n),o=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(vC(e,n)){const c=n.enter("codeIndented"),h=n.indentLines(o,SC);return c(),h}const a=n.createTracker(r),l=i.repeat(Math.max(yC(o,i)+1,3)),u=n.enter("codeFenced");let f=a.move(l);if(e.lang){const c=n.enter(`codeFencedLang${s}`);f+=a.move(n.safe(e.lang,{before:f,after:" ",encode:["`"],...a.current()})),c()}if(e.lang&&e.meta){const c=n.enter(`codeFencedMeta${s}`);f+=a.move(" "),f+=a.move(n.safe(e.meta,{before:f,after:`
@@ -50,8 +50,8 @@ Please start a new conversation.`,Bs={ResourceNotFound:{type:"configuration",mes
50
50
  `+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
51
51
  `))+1))}const s="#".repeat(i),a=n.enter("headingAtx"),l=n.enter("phrasing");o.move(s+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
52
52
  `,...o.current()});return/^[\t ]/.test(u)&&(u=Yr(u.charCodeAt(0))+u.slice(1)),u=u?s+" "+u:s,n.options.closeAtx&&(u+=" "+s),l(),a(),u}Vh.peek=TC;function Vh(e){return e.value||""}function TC(){return"<"}Wh.peek=IC;function Wh(e,t,n,r){const i=Ta(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let a=n.enter("label");const l=n.createTracker(r);let u=l.move("![");return u+=l.move(n.safe(e.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(a=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),a(),e.title&&(a=n.enter(`title${o}`),u+=l.move(" "+i),u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),a()),u+=l.move(")"),s(),u}function IC(){return"!"}qh.peek=OC;function qh(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let s=n.enter("label");const a=n.createTracker(r);let l=a.move("![");const u=n.safe(e.alt,{before:l,after:"]",...a.current()});l+=a.move(u+"]["),s();const f=n.stack;n.stack=[],s=n.enter("reference");const c=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return s(),n.stack=f,o(),i==="full"||!u||u!==c?l+=a.move(c+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function OC(){return"!"}Yh.peek=DC;function Yh(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const s=n.unsafe[o],a=n.compilePattern(s);let l;if(s.atBreak)for(;l=a.exec(r);){let u=l.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(l.index+1)}}return i+r+i}function DC(){return"`"}function Kh(e,t){const n=ea(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Gh.peek=MC;function Gh(e,t,n,r){const i=Ta(n),o=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let a,l;if(Kh(e,n)){const f=n.stack;n.stack=[],a=n.enter("autolink");let c=s.move("<");return c+=s.move(n.containerPhrasing(e,{before:c,after:">",...s.current()})),c+=s.move(">"),a(),n.stack=f,c}a=n.enter("link"),l=n.enter("label");let u=s.move("[");return u+=s.move(n.containerPhrasing(e,{before:u,after:"](",...s.current()})),u+=s.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=s.move("<"),u+=s.move(n.safe(e.url,{before:u,after:">",...s.current()})),u+=s.move(">")):(l=n.enter("destinationRaw"),u+=s.move(n.safe(e.url,{before:u,after:e.title?" ":")",...s.current()}))),l(),e.title&&(l=n.enter(`title${o}`),u+=s.move(" "+i),u+=s.move(n.safe(e.title,{before:u,after:i,...s.current()})),u+=s.move(i),l()),u+=s.move(")"),a(),u}function MC(e,t,n){return Kh(e,n)?"<":"["}Qh.peek=NC;function Qh(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let s=n.enter("label");const a=n.createTracker(r);let l=a.move("[");const u=n.containerPhrasing(e,{before:l,after:"]",...a.current()});l+=a.move(u+"]["),s();const f=n.stack;n.stack=[],s=n.enter("reference");const c=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return s(),n.stack=f,o(),i==="full"||!u||u!==c?l+=a.move(c+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function NC(){return"["}function Ia(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function LC(e){const t=Ia(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function _C(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Zh(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function PC(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let s=e.ordered?_C(n):Ia(n);const a=e.ordered?s==="."?")":".":LC(n);let l=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&f&&(!f.children||!f.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),Zh(n)===s&&f){let c=-1;for(;++c<e.children.length;){const h=e.children[c];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(s=a),n.bulletCurrent=s;const u=n.containerFlow(e,r);return n.bulletLastUsed=s,n.bulletCurrent=o,i(),u}function FC(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function RC(e,t,n,r){const i=FC(n);let o=n.bulletCurrent||Ia(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let s=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const a=n.createTracker(r);a.move(o+" ".repeat(s-o.length)),a.shift(s);const l=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,a.current()),f);return l(),u;function f(c,h,d){return h?(d?"":" ".repeat(s))+c:(d?o:o+" ".repeat(s-o.length))+c}}function BC(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),s=n.containerPhrasing(e,r);return o(),i(),s}const $C=Ki(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function zC(e,t,n,r){return(e.children.some(function(s){return $C(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function HC(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Jh.peek=UC;function Jh(e,t,n,r){const i=HC(n),o=n.enter("strong"),s=n.createTracker(r),a=s.move(i+i);let l=s.move(n.containerPhrasing(e,{after:i,before:a,...s.current()}));const u=l.charCodeAt(0),f=Ji(r.before.charCodeAt(r.before.length-1),u,i);f.inside&&(l=Yr(u)+l.slice(1));const c=l.charCodeAt(l.length-1),h=Ji(r.after.charCodeAt(0),c,i);h.inside&&(l=l.slice(0,-1)+Yr(c));const d=s.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:f.outside},a+l+d}function UC(e,t,n){return n.options.strong||"*"}function jC(e,t,n,r){return n.safe(e.value,r)}function VC(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function WC(e,t,n){const r=(Zh(n)+(n.options.ruleSpaces?" ":"")).repeat(VC(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Xh={blockquote:pC,break:Uh,code:wC,definition:kC,emphasis:jh,hardBreak:Uh,heading:AC,html:Vh,image:Wh,imageReference:qh,inlineCode:Yh,link:Gh,linkReference:Qh,list:PC,listItem:RC,paragraph:BC,root:zC,strong:Jh,text:jC,thematicBreak:WC};function qC(){return{enter:{table:YC,tableData:ep,tableHeader:ep,tableRow:GC},exit:{codeText:QC,table:KC,tableData:Oa,tableHeader:Oa,tableRow:Oa}}}function YC(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function KC(e){this.exit(e),this.data.inTable=void 0}function GC(e){this.enter({type:"tableRow",children:[]},e)}function Oa(e){this.exit(e)}function ep(e){this.enter({type:"tableCell",children:[]},e)}function QC(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,ZC));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function ZC(e,t){return t==="|"?t:e}function JC(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
53
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:s,tableCell:l,tableRow:a}};function s(d,m,p,g){return u(f(d,p,g),d.align)}function a(d,m,p,g){const v=c(d,p,g),y=u([v]);return y.slice(0,y.indexOf(`
54
- `))}function l(d,m,p,g){const v=p.enter("tableCell"),y=p.enter("phrasing"),w=p.containerPhrasing(d,{...g,before:o,after:o});return y(),v(),w}function u(d,m){return dC(d,{align:m,alignDelimiters:r,padding:n,stringLength:i})}function f(d,m,p){const g=d.children;let v=-1;const y=[],w=m.enter("table");for(;++v<g.length;)y[v]=c(g[v],m,p);return w(),y}function c(d,m,p){const g=d.children;let v=-1;const y=[],w=m.enter("tableRow");for(;++v<g.length;)y[v]=l(g[v],d,m,p);return w(),y}function h(d,m,p){let g=Xh.inlineCode(d,m,p);return p.stack.includes("tableCell")&&(g=g.replace(/\|/g,"\\$&")),g}}function XC(){return{exit:{taskListCheckValueChecked:tp,taskListCheckValueUnchecked:tp,paragraph:tA}}}function eA(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:nA}}}function tp(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function tA(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,s;for(;++o<i.length;){const a=i[o];if(a.type==="paragraph"){s=a;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function nA(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);o&&a.move(s);let l=Xh.listItem(e,t,n,{...r,...a.current()});return o&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),l;function u(f){return f+s}}function rA(){return[PE(),nC(),sC(),qC(),XC()]}function iA(e){return{extensions:[FE(),rC(e),aC(),JC(e),eA()]}}const oA={tokenize:fA,partial:!0},np={tokenize:dA,partial:!0},rp={tokenize:hA,partial:!0},ip={tokenize:pA,partial:!0},sA={tokenize:mA,partial:!0},op={name:"wwwAutolink",tokenize:uA,previous:ap},sp={name:"protocolAutolink",tokenize:cA,previous:lp},Gt={name:"emailAutolink",tokenize:lA,previous:up},zt={};function aA(){return{text:zt}}let On=48;for(;On<123;)zt[On]=Gt,On++,On===58?On=65:On===91&&(On=97);zt[43]=Gt,zt[45]=Gt,zt[46]=Gt,zt[95]=Gt,zt[72]=[Gt,sp],zt[104]=[Gt,sp],zt[87]=[Gt,op],zt[119]=[Gt,op];function lA(e,t,n){const r=this;let i,o;return s;function s(c){return!Da(c)||!up.call(r,r.previous)||Ma(r.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(c))}function a(c){return Da(c)?(e.consume(c),a):c===64?(e.consume(c),l):n(c)}function l(c){return c===46?e.check(sA,f,u)(c):c===45||c===95||nt(c)?(o=!0,e.consume(c),l):f(c)}function u(c){return e.consume(c),i=!0,l}function f(c){return o&&i&&st(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(c)):n(c)}}function uA(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!ap.call(r,r.previous)||Ma(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(oA,e.attempt(np,e.attempt(rp,o),n),n)(s))}function o(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function cA(e,t,n){const r=this;let i="",o=!1;return s;function s(c){return(c===72||c===104)&&lp.call(r,r.previous)&&!Ma(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(c),e.consume(c),a):n(c)}function a(c){if(st(c)&&i.length<5)return i+=String.fromCodePoint(c),e.consume(c),a;if(c===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(c),l}return n(c)}function l(c){return c===47?(e.consume(c),o?u:(o=!0,l)):n(c)}function u(c){return c===null||$i(c)||Me(c)||In(c)||zi(c)?n(c):e.attempt(np,e.attempt(rp,f),n)(c)}function f(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(c)}}function fA(e,t,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),o):n(s)}function o(s){return s===null?n(s):t(s)}}function dA(e,t,n){let r,i,o;return s;function s(u){return u===46||u===95?e.check(ip,l,a)(u):u===null||Me(u)||In(u)||u!==45&&zi(u)?l(u):(o=!0,e.consume(u),s)}function a(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),s}function l(u){return i||r||!o?n(u):t(u)}}function hA(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r<n?o(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(ip,t,o)(s):s===null||Me(s)||In(s)?t(s):(e.consume(s),i)}function o(s){return s===41&&r++,e.consume(s),i}}function pA(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),o):a===93?(e.consume(a),i):a===60||a===null||Me(a)||In(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||Me(a)||In(a)?t(a):r(a)}function o(a){return st(a)?s(a):n(a)}function s(a){return a===59?(e.consume(a),r):st(a)?(e.consume(a),s):n(a)}}function mA(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return nt(o)?n(o):t(o)}}function ap(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Me(e)}function lp(e){return!st(e)}function up(e){return!(e===47||Da(e))}function Da(e){return e===43||e===45||e===46||e===95||nt(e)}function Ma(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const gA={tokenize:EA,partial:!0};function yA(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:SA,continuation:{tokenize:kA},exit:xA}},text:{91:{name:"gfmFootnoteCall",tokenize:wA},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:vA,resolveTo:bA}}}}function vA(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){s=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!s||!s._balanced)return n(l);const u=Mt(r.sliceSerialize({start:s.end,end:r.now()}));return u.codePointAt(0)!==94||!o.includes(u.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function bA(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function wA(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,s;return a;function a(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),l}function l(c){return c!==94?n(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(c){if(o>999||c===93&&!s||c===null||c===91||Me(c))return n(c);if(c===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(Mt(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(c)}return Me(c)||(s=!0),o++,e.consume(c),c===92?f:u}function f(c){return c===91||c===92||c===93?(e.consume(c),o++,u):u(c)}}function SA(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,s=0,a;return l;function l(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):n(m)}function f(m){if(s>999||m===93&&!a||m===null||m===91||Me(m))return n(m);if(m===93){e.exit("chunkString");const p=e.exit("gfmFootnoteDefinitionLabelString");return o=Mt(r.sliceSerialize(p)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return Me(m)||(a=!0),s++,e.consume(m),m===92?c:f}function c(m){return m===91||m===92||m===93?(e.consume(m),s++,f):f(m)}function h(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),i.includes(o)||i.push(o),Ee(e,d,"gfmFootnoteDefinitionWhitespace")):n(m)}function d(m){return t(m)}}function kA(e,t,n){return e.check(Hr,t,e.attempt(gA,t,n))}function xA(e){e.exit("gfmFootnoteDefinition")}function EA(e,t,n){const r=this;return Ee(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):n(o)}}function CA(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,a){let l=-1;for(;++l<s.length;)if(s[l][0]==="enter"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._close){let u=l;for(;u--;)if(s[u][0]==="exit"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._open&&s[l][1].end.offset-s[l][1].start.offset===s[u][1].end.offset-s[u][1].start.offset){s[l][1].type="strikethroughSequence",s[u][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},s[u][1].start),end:Object.assign({},s[l][1].end)},c={type:"strikethroughText",start:Object.assign({},s[u][1].end),end:Object.assign({},s[l][1].start)},h=[["enter",f,a],["enter",s[u][1],a],["exit",s[u][1],a],["enter",c,a]],d=a.parser.constructs.insideSpan.null;d&&gt(h,h.length,0,Hi(d,s.slice(u+1,l),a)),gt(h,h.length,0,[["exit",c,a],["enter",s[l][1],a],["exit",s[l][1],a],["exit",f,a]]),gt(s,u-1,l-u+3,h),l=u+h.length-2;break}}for(l=-1;++l<s.length;)s[l][1].type==="strikethroughSequenceTemporary"&&(s[l][1].type="data");return s}function o(s,a,l){const u=this.previous,f=this.events;let c=0;return h;function h(m){return u===126&&f[f.length-1][1].type!=="characterEscape"?l(m):(s.enter("strikethroughSequenceTemporary"),d(m))}function d(m){const p=Kn(u);if(m===126)return c>1?l(m):(s.consume(m),c++,d);if(c<2&&!n)return l(m);const g=s.exit("strikethroughSequenceTemporary"),v=Kn(m);return g._open=!v||v===2&&!!p,g._close=!p||p===2&&!!v,a(m)}}}class AA{constructor(){this.map=[]}add(t,n,r){TA(this,t,n,r)}consume(t){if(this.map.sort(function(o,s){return o[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function TA(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function IA(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function OA(){return{flow:{null:{name:"table",tokenize:DA,resolveAll:MA}}}}function DA(e,t,n){const r=this;let i=0,o=0,s;return a;function a(T){let O=r.events.length-1;for(;O>-1;){const F=r.events[O][1].type;if(F==="lineEnding"||F==="linePrefix")O--;else break}const H=O>-1?r.events[O][1].type:null,P=H==="tableHead"||H==="tableRow"?E:l;return P===E&&r.parser.lazy[r.now().line]?n(T):P(T)}function l(T){return e.enter("tableHead"),e.enter("tableRow"),u(T)}function u(T){return T===124||(s=!0,o+=1),f(T)}function f(T){return T===null?n(T):ce(T)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),d):n(T):ve(T)?Ee(e,f,"whitespace")(T):(o+=1,s&&(s=!1,i+=1),T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),s=!0,f):(e.enter("data"),c(T)))}function c(T){return T===null||T===124||Me(T)?(e.exit("data"),f(T)):(e.consume(T),T===92?h:c)}function h(T){return T===92||T===124?(e.consume(T),c):c(T)}function d(T){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(T):(e.enter("tableDelimiterRow"),s=!1,ve(T)?Ee(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):m(T))}function m(T){return T===45||T===58?g(T):T===124?(s=!0,e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),p):k(T)}function p(T){return ve(T)?Ee(e,g,"whitespace")(T):g(T)}function g(T){return T===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),v):T===45?(o+=1,v(T)):T===null||ce(T)?A(T):k(T)}function v(T){return T===45?(e.enter("tableDelimiterFiller"),y(T)):k(T)}function y(T){return T===45?(e.consume(T),y):T===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),w):(e.exit("tableDelimiterFiller"),w(T))}function w(T){return ve(T)?Ee(e,A,"whitespace")(T):A(T)}function A(T){return T===124?m(T):T===null||ce(T)?!s||i!==o?k(T):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(T)):k(T)}function k(T){return n(T)}function E(T){return e.enter("tableRow"),I(T)}function I(T){return T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),I):T===null||ce(T)?(e.exit("tableRow"),t(T)):ve(T)?Ee(e,I,"whitespace")(T):(e.enter("data"),M(T))}function M(T){return T===null||T===124||Me(T)?(e.exit("data"),I(T)):(e.consume(T),T===92?L:M)}function L(T){return T===92||T===124?(e.consume(T),M):M(T)}}function MA(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],a=!1,l=0,u,f,c;const h=new AA;for(;++n<e.length;){const d=e[n],m=d[1];d[0]==="enter"?m.type==="tableHead"?(a=!1,l!==0&&(cp(h,t,l,u,f),f=void 0,l=0),u={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",u,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(r=!0,c=void 0,o=[0,0,0,0],s=[0,n+1,0,0],a&&(a=!1,f={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",f,t]])),i=m.type==="tableDelimiterRow"?2:f?3:1):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(o[1]!==0&&(s[0]=s[1],c=Xi(h,t,o,i,void 0,c),o=[0,0,0,0]),s[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(s[0]=s[1],c=Xi(h,t,o,i,void 0,c)),o=s,s=[o[1],n,0,0])):m.type==="tableHead"?(a=!0,l=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(l=n,o[1]!==0?(s[0]=s[1],c=Xi(h,t,o,i,n,c)):s[1]!==0&&(c=Xi(h,t,s,i,n,c)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(s[3]=n)}for(l!==0&&cp(h,t,l,u,f),h.consume(t.events),n=-1;++n<t.events.length;){const d=t.events[n];d[0]==="enter"&&d[1].type==="table"&&(d[1]._align=IA(t.events,n))}return e}function Xi(e,t,n,r,i,o){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(o.end=Object.assign({},Qn(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const l=Qn(t.events,n[1]);if(o={type:s,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const u=Qn(t.events,n[2]),f=Qn(t.events,n[3]),c={type:a,start:Object.assign({},u),end:Object.assign({},f)};if(e.add(n[2],0,[["enter",c,t]]),r!==2){const h=t.events[n[2]],d=t.events[n[3]];if(h[1].end=Object.assign({},d[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,p=n[3]-n[2]-1;e.add(m,p,[])}}e.add(n[3]+1,0,[["exit",c,t]])}return i!==void 0&&(o.end=Object.assign({},Qn(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function cp(e,t,n,r,i){const o=[],s=Qn(t.events,n);i&&(i.end=Object.assign({},s),o.push(["exit",i,t])),r.end=Object.assign({},s),o.push(["exit",r,t]),e.add(n+1,0,o)}function Qn(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const NA={name:"tasklistCheck",tokenize:_A};function LA(){return{text:{91:NA}}}function _A(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),o)}function o(l){return Me(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),s):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),s):n(l)}function s(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return ce(l)?t(l):ve(l)?e.check({tokenize:PA},t,n)(l):n(l)}}function PA(e,t,n){return Ee(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function FA(e){return Fd([aA(),yA(),CA(e),OA(),LA()])}const RA={};function BA(e){const t=this,n=e||RA,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(FA(n)),o.push(rA()),s.push(iA(n))}const ye={container:{className:"bpReset bpContainer bpFont",dropzone:{overlay:{className:"bpDropzoneOverlay"}}},loader:{className:"bpReset bpLoader"},modal:{overlay:{className:"bpModalOverlay"},dialog:{container:{className:"bpReset bpModalContainer"},title:{className:"bpModalTitle"},description:{className:"bpModalDescription"},content:{container:{className:"bpModalContentContainer"},textarea:{className:"bpModalContentTextArea"}},button:{container:{className:"bpModalButtonContainer"},confirm:{className:"bpModalButtonConfirm"},cancel:{className:"bpModalButtonCancel"}}}},messagePreview:{container:{className:"bpMessagePreviewContainer"},message:{className:"bpMessagePreviewMessage"},description:{className:"bpMessagePreviewDescription"},closeButton:{className:"bpMessagePreviewCloseButton"},avatar:{container:{className:"bpMessagePreviewAvatarContainer"},image:{className:"bpMessagePreviewAvatarImage"},fallback:{className:"bpMessagePreviewAvatarFallback"}}},fab:{container:{className:"bpReset bpFabContainer"},icon:{className:"bpFabIcon"},image:{className:"bpFabImage"}},notification:{container:{className:"bpReset bpNotificationContainer"},title:{className:"bpNotificationTitle"},description:{className:"bpNotificationDescription"},icon:{className:"bpNotificationIcon"},closeIcon:{className:"bpNotificationCloseIcon"}},header:{container:{className:"bpReset bpHeaderContainer bpFont"},content:{container:{className:"bpReset bpHeaderContentContainer"},conversationHistory:{className:"bpHeaderConversationHistoryButton"},title:{className:"bpHeaderContentTitle"},description:{className:"bpHeaderContentDescription"},avatar:{container:{className:"bpReset bpHeaderContentAvatarContainer"},image:{className:"bpHeaderContentAvatarImage"},fallback:{className:"bpHeaderContentAvatarFallback"}},toggleSound:{className:"bpHeaderSoundToggleButton"},actions:{container:{className:"bpReset bpHeaderContentActionsContainer"},icons:{className:"bpHeaderContentActionsIcons"}}},expandedContent:{container:{className:"bpReset bpHeaderExpandedContentContainer"},descriptionItems:{container:{className:"bpReset bpHeaderExpandedContentDescriptionItemsContainer"},icon:{className:"bpHeaderExpandedContentDescriptionItemsIcon"},text:{className:"bpHeaderExpandedContentDescriptionItemsText"},link:{className:"bpHeaderExpandedContentDescriptionItemsLink"}},group:{className:"bpHeaderExpandedContentGroup"}},newConversationIcon:{className:"bpHeaderNewConversationIcon"}},composer:{wrapper:{className:"bpReset bpComposerWrapper"},container:{className:"bpReset bpComposerContainer bpFont"},footer:{className:"bpComposerFooter"},inputContainer:{className:"bpComposerInputContainer"},input:{className:"bpComposerInput"},inputLoader:{className:"bpComposerInputLoader"},sendbutton:{className:"bpComposerSendButton"},uploadButton:{className:"bpComposerUploadButton"},voiceButton:{className:"bpComposerVoiceButton"},fileContainer:{className:"bpComposerFileContainer"},fileWidget:{container:{className:"bpComposerFileAttachement"},loader:{className:"bpComposerFileLoader"},fileIcon:{container:{className:"bpComposerFileIconWrapper"},icon:{className:"bpComposerFileIcon"}},metadata:{container:{className:"bpComposerFileMetadata"},name:{className:"bpComposerFileName"},type:{className:"bpComposerFileExtension"}},removeIcon:{className:"bpComposerFileRemoveIcon"},errorIcon:{className:"bpComposerFileErrorIcon"},previewImage:{className:"bpComposerFilePreviewImage"}}},messageList:{scrollDownButton:{className:"bpMessageListScrollDownButton"},container:{className:"bpReset bpMessageListContainer bpFont"},viewPort:{className:"bpMessageListViewport"},marquee:{container:{className:"bpReset bpMessageListMarqueeContainer"},content:{className:"bpMessageListMarqueeContent"},title:{className:"bpMessageListMarqueeTitle"},description:{className:"bpMessageListMarqueeDescription"},avatar:{container:{className:"bpReset bpMessageListMarqueeAvatarContainer"},image:{className:"bpMessageListMarqueeAvatarImage"},fallback:{className:"bpMessageListMarqueeAvatarFallback"}}},headerMessage:{className:"bpMessageListHeaderMessage"}},message:{container:{className:"bpReset bpMessageContainer"},avatar:{container:{className:"bpReset bpMessageAvatarContainer"},image:{className:"bpMessageAvatarImage"},fallback:{className:"bpMessageAvatarFallback"}},deliveryStatus:{className:"bpMessageDeliveryStatus"},deliveryStatusLabel:{className:"bpMessageDeliveryStatusLabel"},blocks:{text:{heading1:{className:"bpMessageBlocksTextHeading1"},heading2:{className:"bpMessageBlocksTextHeading2"},heading3:{className:"bpMessageBlocksTextHeading3"},heading4:{className:"bpMessageBlocksTextHeading4"},unorderedList:{className:"bpMessageBlocksTextUnorderedList"},orderedList:{className:"bpMessageBlocksTextOrderedList"},listItem:{className:"bpMessageBlocksTextListItem"},link:{className:"bpMessageBlocksTextLink"},italic:{className:"bpMessageBlocksTextItalic"},bold:{className:"bpMessageBlocksTextBold"},text:{className:"bpMessageBlocksTextText"},image:{className:"bpMessageBlocksTextImage"},imageError:{className:"bpMessageBlocksTextImageError"},horizontalRule:{className:"bpMessageBlocksTextHorizontalRule"},lineBreak:{className:"bpMessageBlocksTextLineBreak"},input:{className:"bpMessageBlocksTextInput"},codeBlockContainer:{className:"bpMessageBlocksTextCodeBlockContainer"},codeBlockTitle:{className:"bpMessageBlocksTextCodeBlockTitle"},codeBlockCopyIcon:{className:"bpMessageBlocksTextCodeBlockCopyIcon"},codeBlock:{className:"bpMessageBlocksTextCodeBlock"},code:{className:"bpMessageBlocksTextCode"},tableContainer:{className:"bpMessageBlocksTextTableContainer"},table:{className:"bpMessageBlocksTextTable"},tableHeader:{className:"bpMessageBlocksTextTableHeader"},tableData:{className:"bpMessageBlocksTextTableData"},tableRow:{className:"bpMessageBlocksTextTableRow"}},audio:{className:"bpMessageBlocksAudio"},image:{image:{className:"bpMessageBlocksImageImage"},placeholder:{className:"bpMessageBlocksImagePlaceholder"},skeleton:{className:"bpSkeleton"}},video:{className:"bpMessageBlocksVideo"},location:{container:{className:"bpMessageBlocksLocationContainer"},title:{className:"bpMessageBlocksLocationTitle"},icon:{className:"bpMessageBlocksLocationIcon"}},file:{container:{className:"bpMessageBlocksFileContainer"},title:{className:"bpMessageBlocksFileTitle"},icon:{className:"bpMessageBlocksFileIcon"}},row:{className:"bpMessageBlocksRow"},column:{className:"bpMessageBlocksColumn"},bubble:{container:{className:"bpMessageBlocksBubble"},feedbackContainer:{className:"bpMessageBlocksBubbleFeedbackContainer"},feedbackIcon:{className:"bpMessageBlocksBubbleFeedbackIcon"}},carousel:{container:{className:"bpMessageBlocksCarouselContainer"},slidesContainer:{className:"bpMessageBlocksCarouselSlidesContainer"},backButton:{className:"bpMessageBlocksCarouselBackButton"},nextButton:{className:"bpMessageBlocksCarouselNextButton"}},dropdown:{button:{container:{className:"bpMessageBlocksDropdownButtonContainer"},text:{className:"bpMessageBlocksDropdownButtonText"},icon:{className:"bpMessageBlocksDropdownButtonIcon"}},content:{container:{className:"bpMessageBlocksDropdownContentContainer"},item:{className:"bpMessageBlocksDropdownContentItem"}}},button:{className:"bpMessageBlocksButton"}}},error:{container:{className:"bpReset bpErrorContainer"},id:{className:"bpErrorId"},header:{container:{className:"bpErrorHeader"},actions:{className:"bpErrorHeaderActions"}},content:{className:"bpErrorContent"},errorTitle:{className:"bpErrorTitle"},errorMessage:{className:"bpErrorMessage"},icon:{className:"bpErrorIcon"}},typingIndicator:{container:{className:"bpTypingIndicatorContainer"},loader:{className:"bpTypingIndicatorLoader"}},proactiveBubble:{container:{className:"bpProactiveBubbleContainer"},content:{className:"bpProactiveBubbleContent"},layout:{className:"bpProactiveBubbleLayout"},icon:{className:"bpProactiveBubbleIcon"},message:{className:"bpProactiveBubbleMessage"},closeButton:{className:"bpProactiveBubbleCloseButton"},arrow:{className:"bpProactiveBubbleArrow"}},conversationHistory:{container:{className:"bpReset bpConversationHistoryContainer bpFont"},header:{className:"bpConversationHistoryHeader"},closeButton:{className:"bpConversationHistoryCloseButton"},scrollContainer:{className:"bpConversationHistoryScrollContainer"},loaderContainer:{className:"bpConversationHistoryLoaderContainer"},conversation:{container:{className:"bpConversationHistoryConversationContainer"},chevron:{className:"bpConversationHistoryConversationChevron"},userAvatar:{className:{className:"bpConversationHistoryConversationUserAvatarFallback"}},avatar:{container:{className:"bpReset bpConversationHistoryConversationAvatarContainer"},image:{className:"bpConversationHistoryConversationAvatarImage"},fallback:{className:"bpConversationHistoryConversationAvatarFallback"}},content:{className:"bpConversationHistoryConversationContent"},name:{className:"bpConversationHistoryConversationName"},timestamp:{className:"bpConversationHistoryConversationTimestamp"}},newConversation:{button:{className:"bpConversationHistoryNewConversationButton"},icon:{className:"bpConversationHistoryNewConversationButtonIcon"}}}};/**
53
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:s,tableCell:l,tableRow:a}};function s(d,m,p,g){return u(f(d,p,g),d.align)}function a(d,m,p,g){const y=c(d,p,g),v=u([y]);return v.slice(0,v.indexOf(`
54
+ `))}function l(d,m,p,g){const y=p.enter("tableCell"),v=p.enter("phrasing"),w=p.containerPhrasing(d,{...g,before:o,after:o});return v(),y(),w}function u(d,m){return dC(d,{align:m,alignDelimiters:r,padding:n,stringLength:i})}function f(d,m,p){const g=d.children;let y=-1;const v=[],w=m.enter("table");for(;++y<g.length;)v[y]=c(g[y],m,p);return w(),v}function c(d,m,p){const g=d.children;let y=-1;const v=[],w=m.enter("tableRow");for(;++y<g.length;)v[y]=l(g[y],d,m,p);return w(),v}function h(d,m,p){let g=Xh.inlineCode(d,m,p);return p.stack.includes("tableCell")&&(g=g.replace(/\|/g,"\\$&")),g}}function XC(){return{exit:{taskListCheckValueChecked:tp,taskListCheckValueUnchecked:tp,paragraph:tA}}}function eA(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:nA}}}function tp(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function tA(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,s;for(;++o<i.length;){const a=i[o];if(a.type==="paragraph"){s=a;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function nA(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);o&&a.move(s);let l=Xh.listItem(e,t,n,{...r,...a.current()});return o&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),l;function u(f){return f+s}}function rA(){return[PE(),nC(),sC(),qC(),XC()]}function iA(e){return{extensions:[FE(),rC(e),aC(),JC(e),eA()]}}const oA={tokenize:fA,partial:!0},np={tokenize:dA,partial:!0},rp={tokenize:hA,partial:!0},ip={tokenize:pA,partial:!0},sA={tokenize:mA,partial:!0},op={name:"wwwAutolink",tokenize:uA,previous:ap},sp={name:"protocolAutolink",tokenize:cA,previous:lp},Gt={name:"emailAutolink",tokenize:lA,previous:up},zt={};function aA(){return{text:zt}}let On=48;for(;On<123;)zt[On]=Gt,On++,On===58?On=65:On===91&&(On=97);zt[43]=Gt,zt[45]=Gt,zt[46]=Gt,zt[95]=Gt,zt[72]=[Gt,sp],zt[104]=[Gt,sp],zt[87]=[Gt,op],zt[119]=[Gt,op];function lA(e,t,n){const r=this;let i,o;return s;function s(c){return!Da(c)||!up.call(r,r.previous)||Ma(r.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(c))}function a(c){return Da(c)?(e.consume(c),a):c===64?(e.consume(c),l):n(c)}function l(c){return c===46?e.check(sA,f,u)(c):c===45||c===95||nt(c)?(o=!0,e.consume(c),l):f(c)}function u(c){return e.consume(c),i=!0,l}function f(c){return o&&i&&st(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(c)):n(c)}}function uA(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!ap.call(r,r.previous)||Ma(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(oA,e.attempt(np,e.attempt(rp,o),n),n)(s))}function o(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function cA(e,t,n){const r=this;let i="",o=!1;return s;function s(c){return(c===72||c===104)&&lp.call(r,r.previous)&&!Ma(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(c),e.consume(c),a):n(c)}function a(c){if(st(c)&&i.length<5)return i+=String.fromCodePoint(c),e.consume(c),a;if(c===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(c),l}return n(c)}function l(c){return c===47?(e.consume(c),o?u:(o=!0,l)):n(c)}function u(c){return c===null||$i(c)||Me(c)||In(c)||zi(c)?n(c):e.attempt(np,e.attempt(rp,f),n)(c)}function f(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(c)}}function fA(e,t,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),o):n(s)}function o(s){return s===null?n(s):t(s)}}function dA(e,t,n){let r,i,o;return s;function s(u){return u===46||u===95?e.check(ip,l,a)(u):u===null||Me(u)||In(u)||u!==45&&zi(u)?l(u):(o=!0,e.consume(u),s)}function a(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),s}function l(u){return i||r||!o?n(u):t(u)}}function hA(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r<n?o(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(ip,t,o)(s):s===null||Me(s)||In(s)?t(s):(e.consume(s),i)}function o(s){return s===41&&r++,e.consume(s),i}}function pA(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),o):a===93?(e.consume(a),i):a===60||a===null||Me(a)||In(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||Me(a)||In(a)?t(a):r(a)}function o(a){return st(a)?s(a):n(a)}function s(a){return a===59?(e.consume(a),r):st(a)?(e.consume(a),s):n(a)}}function mA(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return nt(o)?n(o):t(o)}}function ap(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Me(e)}function lp(e){return!st(e)}function up(e){return!(e===47||Da(e))}function Da(e){return e===43||e===45||e===46||e===95||nt(e)}function Ma(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const gA={tokenize:EA,partial:!0};function yA(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:SA,continuation:{tokenize:kA},exit:xA}},text:{91:{name:"gfmFootnoteCall",tokenize:wA},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:vA,resolveTo:bA}}}}function vA(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){s=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!s||!s._balanced)return n(l);const u=Mt(r.sliceSerialize({start:s.end,end:r.now()}));return u.codePointAt(0)!==94||!o.includes(u.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function bA(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function wA(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,s;return a;function a(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),l}function l(c){return c!==94?n(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(c){if(o>999||c===93&&!s||c===null||c===91||Me(c))return n(c);if(c===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(Mt(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(c)}return Me(c)||(s=!0),o++,e.consume(c),c===92?f:u}function f(c){return c===91||c===92||c===93?(e.consume(c),o++,u):u(c)}}function SA(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,s=0,a;return l;function l(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):n(m)}function f(m){if(s>999||m===93&&!a||m===null||m===91||Me(m))return n(m);if(m===93){e.exit("chunkString");const p=e.exit("gfmFootnoteDefinitionLabelString");return o=Mt(r.sliceSerialize(p)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return Me(m)||(a=!0),s++,e.consume(m),m===92?c:f}function c(m){return m===91||m===92||m===93?(e.consume(m),s++,f):f(m)}function h(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),i.includes(o)||i.push(o),xe(e,d,"gfmFootnoteDefinitionWhitespace")):n(m)}function d(m){return t(m)}}function kA(e,t,n){return e.check(Hr,t,e.attempt(gA,t,n))}function xA(e){e.exit("gfmFootnoteDefinition")}function EA(e,t,n){const r=this;return xe(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):n(o)}}function CA(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,a){let l=-1;for(;++l<s.length;)if(s[l][0]==="enter"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._close){let u=l;for(;u--;)if(s[u][0]==="exit"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._open&&s[l][1].end.offset-s[l][1].start.offset===s[u][1].end.offset-s[u][1].start.offset){s[l][1].type="strikethroughSequence",s[u][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},s[u][1].start),end:Object.assign({},s[l][1].end)},c={type:"strikethroughText",start:Object.assign({},s[u][1].end),end:Object.assign({},s[l][1].start)},h=[["enter",f,a],["enter",s[u][1],a],["exit",s[u][1],a],["enter",c,a]],d=a.parser.constructs.insideSpan.null;d&&gt(h,h.length,0,Hi(d,s.slice(u+1,l),a)),gt(h,h.length,0,[["exit",c,a],["enter",s[l][1],a],["exit",s[l][1],a],["exit",f,a]]),gt(s,u-1,l-u+3,h),l=u+h.length-2;break}}for(l=-1;++l<s.length;)s[l][1].type==="strikethroughSequenceTemporary"&&(s[l][1].type="data");return s}function o(s,a,l){const u=this.previous,f=this.events;let c=0;return h;function h(m){return u===126&&f[f.length-1][1].type!=="characterEscape"?l(m):(s.enter("strikethroughSequenceTemporary"),d(m))}function d(m){const p=Kn(u);if(m===126)return c>1?l(m):(s.consume(m),c++,d);if(c<2&&!n)return l(m);const g=s.exit("strikethroughSequenceTemporary"),y=Kn(m);return g._open=!y||y===2&&!!p,g._close=!p||p===2&&!!y,a(m)}}}class AA{constructor(){this.map=[]}add(t,n,r){TA(this,t,n,r)}consume(t){if(this.map.sort(function(o,s){return o[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function TA(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function IA(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function OA(){return{flow:{null:{name:"table",tokenize:DA,resolveAll:MA}}}}function DA(e,t,n){const r=this;let i=0,o=0,s;return a;function a(T){let O=r.events.length-1;for(;O>-1;){const L=r.events[O][1].type;if(L==="lineEnding"||L==="linePrefix")O--;else break}const j=O>-1?r.events[O][1].type:null,F=j==="tableHead"||j==="tableRow"?E:l;return F===E&&r.parser.lazy[r.now().line]?n(T):F(T)}function l(T){return e.enter("tableHead"),e.enter("tableRow"),u(T)}function u(T){return T===124||(s=!0,o+=1),f(T)}function f(T){return T===null?n(T):ce(T)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),d):n(T):ve(T)?xe(e,f,"whitespace")(T):(o+=1,s&&(s=!1,i+=1),T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),s=!0,f):(e.enter("data"),c(T)))}function c(T){return T===null||T===124||Me(T)?(e.exit("data"),f(T)):(e.consume(T),T===92?h:c)}function h(T){return T===92||T===124?(e.consume(T),c):c(T)}function d(T){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(T):(e.enter("tableDelimiterRow"),s=!1,ve(T)?xe(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):m(T))}function m(T){return T===45||T===58?g(T):T===124?(s=!0,e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),p):k(T)}function p(T){return ve(T)?xe(e,g,"whitespace")(T):g(T)}function g(T){return T===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),y):T===45?(o+=1,y(T)):T===null||ce(T)?A(T):k(T)}function y(T){return T===45?(e.enter("tableDelimiterFiller"),v(T)):k(T)}function v(T){return T===45?(e.consume(T),v):T===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),w):(e.exit("tableDelimiterFiller"),w(T))}function w(T){return ve(T)?xe(e,A,"whitespace")(T):A(T)}function A(T){return T===124?m(T):T===null||ce(T)?!s||i!==o?k(T):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(T)):k(T)}function k(T){return n(T)}function E(T){return e.enter("tableRow"),I(T)}function I(T){return T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),I):T===null||ce(T)?(e.exit("tableRow"),t(T)):ve(T)?xe(e,I,"whitespace")(T):(e.enter("data"),M(T))}function M(T){return T===null||T===124||Me(T)?(e.exit("data"),I(T)):(e.consume(T),T===92?P:M)}function P(T){return T===92||T===124?(e.consume(T),M):M(T)}}function MA(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],a=!1,l=0,u,f,c;const h=new AA;for(;++n<e.length;){const d=e[n],m=d[1];d[0]==="enter"?m.type==="tableHead"?(a=!1,l!==0&&(cp(h,t,l,u,f),f=void 0,l=0),u={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",u,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(r=!0,c=void 0,o=[0,0,0,0],s=[0,n+1,0,0],a&&(a=!1,f={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",f,t]])),i=m.type==="tableDelimiterRow"?2:f?3:1):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(o[1]!==0&&(s[0]=s[1],c=Xi(h,t,o,i,void 0,c),o=[0,0,0,0]),s[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(s[0]=s[1],c=Xi(h,t,o,i,void 0,c)),o=s,s=[o[1],n,0,0])):m.type==="tableHead"?(a=!0,l=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(l=n,o[1]!==0?(s[0]=s[1],c=Xi(h,t,o,i,n,c)):s[1]!==0&&(c=Xi(h,t,s,i,n,c)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(s[3]=n)}for(l!==0&&cp(h,t,l,u,f),h.consume(t.events),n=-1;++n<t.events.length;){const d=t.events[n];d[0]==="enter"&&d[1].type==="table"&&(d[1]._align=IA(t.events,n))}return e}function Xi(e,t,n,r,i,o){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(o.end=Object.assign({},Qn(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const l=Qn(t.events,n[1]);if(o={type:s,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const u=Qn(t.events,n[2]),f=Qn(t.events,n[3]),c={type:a,start:Object.assign({},u),end:Object.assign({},f)};if(e.add(n[2],0,[["enter",c,t]]),r!==2){const h=t.events[n[2]],d=t.events[n[3]];if(h[1].end=Object.assign({},d[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,p=n[3]-n[2]-1;e.add(m,p,[])}}e.add(n[3]+1,0,[["exit",c,t]])}return i!==void 0&&(o.end=Object.assign({},Qn(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function cp(e,t,n,r,i){const o=[],s=Qn(t.events,n);i&&(i.end=Object.assign({},s),o.push(["exit",i,t])),r.end=Object.assign({},s),o.push(["exit",r,t]),e.add(n+1,0,o)}function Qn(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const NA={name:"tasklistCheck",tokenize:_A};function LA(){return{text:{91:NA}}}function _A(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),o)}function o(l){return Me(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),s):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),s):n(l)}function s(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return ce(l)?t(l):ve(l)?e.check({tokenize:PA},t,n)(l):n(l)}}function PA(e,t,n){return xe(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function FA(e){return Fd([aA(),yA(),CA(e),OA(),LA()])}const RA={};function BA(e){const t=this,n=e||RA,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(FA(n)),o.push(rA()),s.push(iA(n))}const ye={container:{className:"bpReset bpContainer bpFont",dropzone:{overlay:{className:"bpDropzoneOverlay"}}},loader:{className:"bpReset bpLoader"},modal:{overlay:{className:"bpModalOverlay"},dialog:{container:{className:"bpReset bpModalContainer"},title:{className:"bpModalTitle"},description:{className:"bpModalDescription"},content:{container:{className:"bpModalContentContainer"},textarea:{className:"bpModalContentTextArea"}},button:{container:{className:"bpModalButtonContainer"},confirm:{className:"bpModalButtonConfirm"},cancel:{className:"bpModalButtonCancel"}}}},messagePreview:{container:{className:"bpMessagePreviewContainer"},message:{className:"bpMessagePreviewMessage"},description:{className:"bpMessagePreviewDescription"},closeButton:{className:"bpMessagePreviewCloseButton"},avatar:{container:{className:"bpMessagePreviewAvatarContainer"},image:{className:"bpMessagePreviewAvatarImage"},fallback:{className:"bpMessagePreviewAvatarFallback"}}},fab:{container:{className:"bpReset bpFabContainer"},icon:{className:"bpFabIcon"},image:{className:"bpFabImage"}},notification:{container:{className:"bpReset bpNotificationContainer"},title:{className:"bpNotificationTitle"},description:{className:"bpNotificationDescription"},icon:{className:"bpNotificationIcon"},closeIcon:{className:"bpNotificationCloseIcon"}},header:{container:{className:"bpReset bpHeaderContainer bpFont"},content:{container:{className:"bpReset bpHeaderContentContainer"},conversationHistory:{className:"bpHeaderConversationHistoryButton"},title:{className:"bpHeaderContentTitle"},description:{className:"bpHeaderContentDescription"},avatar:{container:{className:"bpReset bpHeaderContentAvatarContainer"},image:{className:"bpHeaderContentAvatarImage"},fallback:{className:"bpHeaderContentAvatarFallback"}},toggleSound:{className:"bpHeaderSoundToggleButton"},actions:{container:{className:"bpReset bpHeaderContentActionsContainer"},icons:{className:"bpHeaderContentActionsIcons"}}},expandedContent:{container:{className:"bpReset bpHeaderExpandedContentContainer"},descriptionItems:{container:{className:"bpReset bpHeaderExpandedContentDescriptionItemsContainer"},icon:{className:"bpHeaderExpandedContentDescriptionItemsIcon"},text:{className:"bpHeaderExpandedContentDescriptionItemsText"},link:{className:"bpHeaderExpandedContentDescriptionItemsLink"}},group:{className:"bpHeaderExpandedContentGroup"}},newConversationIcon:{className:"bpHeaderNewConversationIcon"}},composer:{wrapper:{className:"bpReset bpComposerWrapper"},container:{className:"bpReset bpComposerContainer bpFont"},footer:{className:"bpComposerFooter"},inputContainer:{className:"bpComposerInputContainer"},input:{className:"bpComposerInput"},inputLoader:{className:"bpComposerInputLoader"},sendbutton:{className:"bpComposerSendButton"},uploadButton:{className:"bpComposerUploadButton"},voiceButton:{className:"bpComposerVoiceButton"},fileContainer:{className:"bpComposerFileContainer"},fileWidget:{container:{className:"bpComposerFileAttachement"},loader:{className:"bpComposerFileLoader"},fileIcon:{container:{className:"bpComposerFileIconWrapper"},icon:{className:"bpComposerFileIcon"}},metadata:{container:{className:"bpComposerFileMetadata"},name:{className:"bpComposerFileName"},type:{className:"bpComposerFileExtension"}},removeIcon:{className:"bpComposerFileRemoveIcon"},errorIcon:{className:"bpComposerFileErrorIcon"},previewImage:{className:"bpComposerFilePreviewImage"}}},messageList:{scrollDownButton:{className:"bpMessageListScrollDownButton"},container:{className:"bpReset bpMessageListContainer bpFont"},viewPort:{className:"bpMessageListViewport"},marquee:{container:{className:"bpReset bpMessageListMarqueeContainer"},content:{className:"bpMessageListMarqueeContent"},title:{className:"bpMessageListMarqueeTitle"},description:{className:"bpMessageListMarqueeDescription"},avatar:{container:{className:"bpReset bpMessageListMarqueeAvatarContainer"},image:{className:"bpMessageListMarqueeAvatarImage"},fallback:{className:"bpMessageListMarqueeAvatarFallback"}}},headerMessage:{className:"bpMessageListHeaderMessage"}},message:{container:{className:"bpReset bpMessageContainer"},avatar:{container:{className:"bpReset bpMessageAvatarContainer"},image:{className:"bpMessageAvatarImage"},fallback:{className:"bpMessageAvatarFallback"}},deliveryStatus:{className:"bpMessageDeliveryStatus"},deliveryStatusLabel:{className:"bpMessageDeliveryStatusLabel"},blocks:{text:{heading1:{className:"bpMessageBlocksTextHeading1"},heading2:{className:"bpMessageBlocksTextHeading2"},heading3:{className:"bpMessageBlocksTextHeading3"},heading4:{className:"bpMessageBlocksTextHeading4"},unorderedList:{className:"bpMessageBlocksTextUnorderedList"},orderedList:{className:"bpMessageBlocksTextOrderedList"},listItem:{className:"bpMessageBlocksTextListItem"},link:{className:"bpMessageBlocksTextLink"},italic:{className:"bpMessageBlocksTextItalic"},bold:{className:"bpMessageBlocksTextBold"},text:{className:"bpMessageBlocksTextText"},image:{className:"bpMessageBlocksTextImage"},imageError:{className:"bpMessageBlocksTextImageError"},horizontalRule:{className:"bpMessageBlocksTextHorizontalRule"},lineBreak:{className:"bpMessageBlocksTextLineBreak"},input:{className:"bpMessageBlocksTextInput"},codeBlockContainer:{className:"bpMessageBlocksTextCodeBlockContainer"},codeBlockTitle:{className:"bpMessageBlocksTextCodeBlockTitle"},codeBlockCopyIcon:{className:"bpMessageBlocksTextCodeBlockCopyIcon"},codeBlock:{className:"bpMessageBlocksTextCodeBlock"},code:{className:"bpMessageBlocksTextCode"},tableContainer:{className:"bpMessageBlocksTextTableContainer"},table:{className:"bpMessageBlocksTextTable"},tableHeader:{className:"bpMessageBlocksTextTableHeader"},tableData:{className:"bpMessageBlocksTextTableData"},tableRow:{className:"bpMessageBlocksTextTableRow"}},audio:{className:"bpMessageBlocksAudio"},image:{image:{className:"bpMessageBlocksImageImage"},placeholder:{className:"bpMessageBlocksImagePlaceholder"},skeleton:{className:"bpSkeleton"}},video:{className:"bpMessageBlocksVideo"},location:{container:{className:"bpMessageBlocksLocationContainer"},title:{className:"bpMessageBlocksLocationTitle"},icon:{className:"bpMessageBlocksLocationIcon"}},file:{container:{className:"bpMessageBlocksFileContainer"},title:{className:"bpMessageBlocksFileTitle"},icon:{className:"bpMessageBlocksFileIcon"}},row:{className:"bpMessageBlocksRow"},column:{className:"bpMessageBlocksColumn"},bubble:{container:{className:"bpMessageBlocksBubble"},feedbackContainer:{className:"bpMessageBlocksBubbleFeedbackContainer"},feedbackIcon:{className:"bpMessageBlocksBubbleFeedbackIcon"}},carousel:{container:{className:"bpMessageBlocksCarouselContainer"},slidesContainer:{className:"bpMessageBlocksCarouselSlidesContainer"},backButton:{className:"bpMessageBlocksCarouselBackButton"},nextButton:{className:"bpMessageBlocksCarouselNextButton"}},dropdown:{button:{container:{className:"bpMessageBlocksDropdownButtonContainer"},text:{className:"bpMessageBlocksDropdownButtonText"},icon:{className:"bpMessageBlocksDropdownButtonIcon"}},content:{container:{className:"bpMessageBlocksDropdownContentContainer"},item:{className:"bpMessageBlocksDropdownContentItem"}}},button:{className:"bpMessageBlocksButton"}}},error:{container:{className:"bpReset bpErrorContainer"},id:{className:"bpErrorId"},header:{container:{className:"bpErrorHeader"},actions:{className:"bpErrorHeaderActions"}},content:{className:"bpErrorContent"},errorTitle:{className:"bpErrorTitle"},errorMessage:{className:"bpErrorMessage"},icon:{className:"bpErrorIcon"}},typingIndicator:{container:{className:"bpTypingIndicatorContainer"},loader:{className:"bpTypingIndicatorLoader"}},proactiveBubble:{container:{className:"bpProactiveBubbleContainer"},content:{className:"bpProactiveBubbleContent"},layout:{className:"bpProactiveBubbleLayout"},icon:{className:"bpProactiveBubbleIcon"},message:{className:"bpProactiveBubbleMessage"},closeButton:{className:"bpProactiveBubbleCloseButton"},arrow:{className:"bpProactiveBubbleArrow"}},conversationHistory:{container:{className:"bpReset bpConversationHistoryContainer bpFont"},header:{className:"bpConversationHistoryHeader"},closeButton:{className:"bpConversationHistoryCloseButton"},scrollContainer:{className:"bpConversationHistoryScrollContainer"},loaderContainer:{className:"bpConversationHistoryLoaderContainer"},conversation:{container:{className:"bpConversationHistoryConversationContainer"},chevron:{className:"bpConversationHistoryConversationChevron"},userAvatar:{className:{className:"bpConversationHistoryConversationUserAvatarFallback"}},avatar:{container:{className:"bpReset bpConversationHistoryConversationAvatarContainer"},image:{className:"bpConversationHistoryConversationAvatarImage"},fallback:{className:"bpConversationHistoryConversationAvatarFallback"}},content:{className:"bpConversationHistoryConversationContent"},name:{className:"bpConversationHistoryConversationName"},timestamp:{className:"bpConversationHistoryConversationTimestamp"}},newConversation:{button:{className:"bpConversationHistoryNewConversationButton"},icon:{className:"bpConversationHistoryNewConversationButtonIcon"}}}};/**
55
55
  * @license lucide-react v0.554.0 - ISC
56
56
  *
57
57
  * This source code is licensed under the ISC license.
@@ -71,182 +71,182 @@ Please start a new conversation.`,Bs={ResourceNotFound:{type:"configuration",mes
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 ke=(e,t)=>{const n=D.forwardRef(({className:r,...i},o)=>D.createElement(jA,{ref:o,iconNode:t,className:dp(`lucide-${$A(fp(e))}`,`lucide-${e}`,r),...i}));return n.displayName=fp(e),n};/**
74
+ */const Se=(e,t)=>{const n=D.forwardRef(({className:r,...i},o)=>D.createElement(jA,{ref:o,iconNode:t,className:dp(`lucide-${$A(fp(e))}`,`lucide-${e}`,r),...i}));return n.displayName=fp(e),n};/**
75
75
  * @license lucide-react v0.554.0 - ISC
76
76
  *
77
77
  * This source code is licensed under the ISC license.
78
78
  * See the LICENSE file in the root directory of this source tree.
79
- */const VA=ke("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
79
+ */const VA=Se("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
80
80
  * @license lucide-react v0.554.0 - ISC
81
81
  *
82
82
  * This source code is licensed under the ISC license.
83
83
  * See the LICENSE file in the root directory of this source tree.
84
- */const hp=ke("bot-off",[["path",{d:"M13.67 8H18a2 2 0 0 1 2 2v4.33",key:"7az073"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M22 22 2 2",key:"1r8tn9"}],["path",{d:"M8 8H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h12a2 2 0 0 0 1.414-.586",key:"s09a7a"}],["path",{d:"M9 13v2",key:"rq6x2g"}],["path",{d:"M9.67 4H12v2.33",key:"110xot"}]]);/**
84
+ */const hp=Se("bot-off",[["path",{d:"M13.67 8H18a2 2 0 0 1 2 2v4.33",key:"7az073"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M22 22 2 2",key:"1r8tn9"}],["path",{d:"M8 8H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h12a2 2 0 0 0 1.414-.586",key:"s09a7a"}],["path",{d:"M9 13v2",key:"rq6x2g"}],["path",{d:"M9.67 4H12v2.33",key:"110xot"}]]);/**
85
85
  * @license lucide-react v0.554.0 - ISC
86
86
  *
87
87
  * This source code is licensed under the ISC license.
88
88
  * See the LICENSE file in the root directory of this source tree.
89
- */const WA=ke("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
89
+ */const WA=Se("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
90
90
  * @license lucide-react v0.554.0 - ISC
91
91
  *
92
92
  * This source code is licensed under the ISC license.
93
93
  * See the LICENSE file in the root directory of this source tree.
94
- */const qA=ke("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
94
+ */const qA=Se("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
95
95
  * @license lucide-react v0.554.0 - ISC
96
96
  *
97
97
  * This source code is licensed under the ISC license.
98
98
  * See the LICENSE file in the root directory of this source tree.
99
- */const pp=ke("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
99
+ */const pp=Se("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
100
100
  * @license lucide-react v0.554.0 - ISC
101
101
  *
102
102
  * This source code is licensed under the ISC license.
103
103
  * See the LICENSE file in the root directory of this source tree.
104
- */const mp=ke("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
104
+ */const mp=Se("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
105
105
  * @license lucide-react v0.554.0 - ISC
106
106
  *
107
107
  * This source code is licensed under the ISC license.
108
108
  * See the LICENSE file in the root directory of this source tree.
109
- */const YA=ke("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
109
+ */const YA=Se("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
110
110
  * @license lucide-react v0.554.0 - ISC
111
111
  *
112
112
  * This source code is licensed under the ISC license.
113
113
  * See the LICENSE file in the root directory of this source tree.
114
- */const gp=ke("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
114
+ */const gp=Se("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
115
115
  * @license lucide-react v0.554.0 - ISC
116
116
  *
117
117
  * This source code is licensed under the ISC license.
118
118
  * See the LICENSE file in the root directory of this source tree.
119
- */const KA=ke("cloud-upload",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]]);/**
119
+ */const KA=Se("cloud-upload",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]]);/**
120
120
  * @license lucide-react v0.554.0 - ISC
121
121
  *
122
122
  * This source code is licensed under the ISC license.
123
123
  * See the LICENSE file in the root directory of this source tree.
124
- */const GA=ke("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
124
+ */const GA=Se("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
125
125
  * @license lucide-react v0.554.0 - ISC
126
126
  *
127
127
  * This source code is licensed under the ISC license.
128
128
  * See the LICENSE file in the root directory of this source tree.
129
- */const QA=ke("file-down",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);/**
129
+ */const QA=Se("file-down",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);/**
130
130
  * @license lucide-react v0.554.0 - ISC
131
131
  *
132
132
  * This source code is licensed under the ISC license.
133
133
  * See the LICENSE file in the root directory of this source tree.
134
- */const yp=ke("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
134
+ */const yp=Se("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
135
135
  * @license lucide-react v0.554.0 - ISC
136
136
  *
137
137
  * This source code is licensed under the ISC license.
138
138
  * See the LICENSE file in the root directory of this source tree.
139
- */const ZA=ke("files",[["path",{d:"M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8",key:"14sh0y"}],["path",{d:"M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z",key:"1970lx"}],["path",{d:"M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1",key:"l4dndm"}]]);/**
139
+ */const ZA=Se("files",[["path",{d:"M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8",key:"14sh0y"}],["path",{d:"M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z",key:"1970lx"}],["path",{d:"M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1",key:"l4dndm"}]]);/**
140
140
  * @license lucide-react v0.554.0 - ISC
141
141
  *
142
142
  * This source code is licensed under the ISC license.
143
143
  * See the LICENSE file in the root directory of this source tree.
144
- */const JA=ke("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
144
+ */const JA=Se("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
145
145
  * @license lucide-react v0.554.0 - ISC
146
146
  *
147
147
  * This source code is licensed under the ISC license.
148
148
  * See the LICENSE file in the root directory of this source tree.
149
- */const vp=ke("image-off",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]]);/**
149
+ */const vp=Se("image-off",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]]);/**
150
150
  * @license lucide-react v0.554.0 - ISC
151
151
  *
152
152
  * This source code is licensed under the ISC license.
153
153
  * See the LICENSE file in the root directory of this source tree.
154
- */const XA=ke("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
154
+ */const XA=Se("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
155
155
  * @license lucide-react v0.554.0 - ISC
156
156
  *
157
157
  * This source code is licensed under the ISC license.
158
158
  * See the LICENSE file in the root directory of this source tree.
159
- */const eT=ke("loader",[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]);/**
159
+ */const eT=Se("loader",[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]);/**
160
160
  * @license lucide-react v0.554.0 - ISC
161
161
  *
162
162
  * This source code is licensed under the ISC license.
163
163
  * See the LICENSE file in the root directory of this source tree.
164
- */const tT=ke("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
164
+ */const tT=Se("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
165
165
  * @license lucide-react v0.554.0 - ISC
166
166
  *
167
167
  * This source code is licensed under the ISC license.
168
168
  * See the LICENSE file in the root directory of this source tree.
169
- */const nT=ke("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]);/**
169
+ */const nT=Se("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]);/**
170
170
  * @license lucide-react v0.554.0 - ISC
171
171
  *
172
172
  * This source code is licensed under the ISC license.
173
173
  * See the LICENSE file in the root directory of this source tree.
174
- */const rT=ke("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/**
174
+ */const rT=Se("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/**
175
175
  * @license lucide-react v0.554.0 - ISC
176
176
  *
177
177
  * This source code is licensed under the ISC license.
178
178
  * See the LICENSE file in the root directory of this source tree.
179
- */const iT=ke("mic",[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]]);/**
179
+ */const iT=Se("mic",[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]]);/**
180
180
  * @license lucide-react v0.554.0 - ISC
181
181
  *
182
182
  * This source code is licensed under the ISC license.
183
183
  * See the LICENSE file in the root directory of this source tree.
184
- */const oT=ke("monitor-cog",[["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"m14.305 7.53.923-.382",key:"1mlnsw"}],["path",{d:"m15.228 4.852-.923-.383",key:"82mpwg"}],["path",{d:"m16.852 3.228-.383-.924",key:"ln4sir"}],["path",{d:"m16.852 8.772-.383.923",key:"1dejw0"}],["path",{d:"m19.148 3.228.383-.924",key:"192kgf"}],["path",{d:"m19.53 9.696-.382-.924",key:"fiavlr"}],["path",{d:"m20.772 4.852.924-.383",key:"1j8mgp"}],["path",{d:"m20.772 7.148.924.383",key:"zix9be"}],["path",{d:"M22 13v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7",key:"1tnzv8"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}]]);/**
184
+ */const oT=Se("monitor-cog",[["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"m14.305 7.53.923-.382",key:"1mlnsw"}],["path",{d:"m15.228 4.852-.923-.383",key:"82mpwg"}],["path",{d:"m16.852 3.228-.383-.924",key:"ln4sir"}],["path",{d:"m16.852 8.772-.383.923",key:"1dejw0"}],["path",{d:"m19.148 3.228.383-.924",key:"192kgf"}],["path",{d:"m19.53 9.696-.382-.924",key:"fiavlr"}],["path",{d:"m20.772 4.852.924-.383",key:"1j8mgp"}],["path",{d:"m20.772 7.148.924.383",key:"zix9be"}],["path",{d:"M22 13v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7",key:"1tnzv8"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}]]);/**
185
185
  * @license lucide-react v0.554.0 - ISC
186
186
  *
187
187
  * This source code is licensed under the ISC license.
188
188
  * See the LICENSE file in the root directory of this source tree.
189
- */const sT=ke("phone",[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]]);/**
189
+ */const sT=Se("phone",[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]]);/**
190
190
  * @license lucide-react v0.554.0 - ISC
191
191
  *
192
192
  * This source code is licensed under the ISC license.
193
193
  * See the LICENSE file in the root directory of this source tree.
194
- */const aT=ke("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
194
+ */const aT=Se("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
195
195
  * @license lucide-react v0.554.0 - ISC
196
196
  *
197
197
  * This source code is licensed under the ISC license.
198
198
  * See the LICENSE file in the root directory of this source tree.
199
- */const lT=ke("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
199
+ */const lT=Se("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
200
200
  * @license lucide-react v0.554.0 - ISC
201
201
  *
202
202
  * This source code is licensed under the ISC license.
203
203
  * See the LICENSE file in the root directory of this source tree.
204
- */const uT=ke("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
204
+ */const uT=Se("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
205
205
  * @license lucide-react v0.554.0 - ISC
206
206
  *
207
207
  * This source code is licensed under the ISC license.
208
208
  * See the LICENSE file in the root directory of this source tree.
209
- */const cT=ke("thumbs-down",[["path",{d:"M17 14V2",key:"8ymqnk"}],["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}]]);/**
209
+ */const cT=Se("thumbs-down",[["path",{d:"M17 14V2",key:"8ymqnk"}],["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}]]);/**
210
210
  * @license lucide-react v0.554.0 - ISC
211
211
  *
212
212
  * This source code is licensed under the ISC license.
213
213
  * See the LICENSE file in the root directory of this source tree.
214
- */const fT=ke("thumbs-up",[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]]);/**
214
+ */const fT=Se("thumbs-up",[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]]);/**
215
215
  * @license lucide-react v0.554.0 - ISC
216
216
  *
217
217
  * This source code is licensed under the ISC license.
218
218
  * See the LICENSE file in the root directory of this source tree.
219
- */const dT=ke("unplug",[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]]);/**
219
+ */const dT=Se("unplug",[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]]);/**
220
220
  * @license lucide-react v0.554.0 - ISC
221
221
  *
222
222
  * This source code is licensed under the ISC license.
223
223
  * See the LICENSE file in the root directory of this source tree.
224
- */const hT=ke("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
224
+ */const hT=Se("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
225
225
  * @license lucide-react v0.554.0 - ISC
226
226
  *
227
227
  * This source code is licensed under the ISC license.
228
228
  * See the LICENSE file in the root directory of this source tree.
229
- */const pT=ke("video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);/**
229
+ */const pT=Se("video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);/**
230
230
  * @license lucide-react v0.554.0 - ISC
231
231
  *
232
232
  * This source code is licensed under the ISC license.
233
233
  * See the LICENSE file in the root directory of this source tree.
234
- */const bp=ke("volume-2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/**
234
+ */const bp=Se("volume-2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/**
235
235
  * @license lucide-react v0.554.0 - ISC
236
236
  *
237
237
  * This source code is licensed under the ISC license.
238
238
  * See the LICENSE file in the root directory of this source tree.
239
- */const mT=ke("volume-x",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);/**
239
+ */const mT=Se("volume-x",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);/**
240
240
  * @license lucide-react v0.554.0 - ISC
241
241
  *
242
242
  * This source code is licensed under the ISC license.
243
243
  * See the LICENSE file in the root directory of this source tree.
244
- */const gT=ke("wifi-off",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
244
+ */const gT=Se("wifi-off",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
245
245
  * @license lucide-react v0.554.0 - ISC
246
246
  *
247
247
  * This source code is licensed under the ISC license.
248
248
  * See the LICENSE file in the root directory of this source tree.
249
- */const wp=ke("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function yT(){const e=this.data();e.micromarkExtensions??(e.micromarkExtensions=[]),e.micromarkExtensions.push({disable:{null:["codeIndented"]}})}const vT=({text:e})=>{const{message:{blocks:{text:t}}}=ye,[n,r]=D.useState(new Map);function i(s){if(n.has(s))return;const a=new Image;a.src=s,a.onerror=()=>{r(l=>new Map(l).set(s,!0))},a.onload=()=>{r(l=>new Map(l).set(s,!1))}}D.useEffect(()=>{const s=/!\[.*?\]\((.*?)\)/g,a=[];let l;for(;(l=s.exec(e))!==null;){const u=l[1];u&&!a.includes(u)&&a.push(u)}a.forEach(u=>{i(u)})},[e]);const o={h1:({node:s,...a})=>x.jsx("h1",{...a,...t.heading1}),h2:({node:s,...a})=>x.jsx("h2",{...a,...t.heading2}),h3:({node:s,...a})=>x.jsx("h3",{...a,...t.heading3}),h4:({node:s,...a})=>x.jsx("h4",{...a,...t.heading4}),h5:"h4",h6:"h4",em:({node:s,...a})=>x.jsx("em",{...a,...t.italic}),strong:({node:s,...a})=>x.jsx("strong",{...a,...t.bold}),p:({node:s,...a})=>x.jsx("p",{...a,...t.text}),hr:({node:s,...a})=>x.jsx("hr",{...a,...t.horizontalRule}),a:({node:s,href:a,children:l,...u})=>x.jsx("a",{...u,...t.link,onMouseUp:f=>{window.open(a,"_blank","noopener,noreferrer")},children:l}),img:({node:s,...a})=>{const l=a.src;return n.get(l)||!1?x.jsx("div",{"data-error":!0,...t.image,children:x.jsx(vp,{strokeWidth:"1"})}):x.jsx("img",{...a,...t.image})},ol:({node:s,...a})=>x.jsx("ol",{...a,...t.orderedList}),ul:({node:s,...a})=>x.jsx("ul",{...a,...t.unorderedList}),li:({node:s,...a})=>x.jsx("li",{...a,...t.listItem}),br:({node:s,...a})=>x.jsx("br",{...a,...t.lineBreak}),pre:({node:s,...a})=>{var m,p;const l=s==null?void 0:s.children[0],u=bT(((p=(m=l==null?void 0:l.properties)==null?void 0:m.className)==null?void 0:p[0])||""),[f,c]=D.useState(!1),h=D.useRef(null),d=()=>{if(!h.current)return;const g=h.current.textContent||"";navigator.clipboard.writeText(g).then(()=>{c(!0),setTimeout(()=>{c(!1)},1500)}).catch(v=>{console.error("Failed to copy code to clipboard:",v)})};return x.jsxs("div",{...t.codeBlockContainer,children:[x.jsxs("div",{...t.codeBlockTitle,children:[u?x.jsx("span",{children:u}):"Code",f?x.jsx(WA,{...t.codeBlockCopyIcon}):x.jsx(ZA,{...t.codeBlockCopyIcon,onClick:d})]}),x.jsx("pre",{ref:h,...a,...t.codeBlock})]})},input:({node:s,...a})=>x.jsx("input",{...a,...t.input,disabled:!1}),code:({node:s,...a})=>x.jsx("code",{...a,...t.code}),table:({node:s,...a})=>x.jsx("div",{...t.tableContainer,children:x.jsx("table",{...a,...t.table})}),th:({node:s,...a})=>x.jsx("th",{...a,...t.tableHeader}),tr:({node:s,...a})=>x.jsx("tr",{...a,...t.tableRow}),td:({node:s,...a})=>x.jsx("td",{...a,...t.tableData})};return x.jsx(Nh,{urlTransform:s=>s.startsWith("tel:")?s:Lh(s),components:o,remarkPlugins:[yT,BA,_E],children:e})},bT=e=>{if(!e)return"";const t=e.match(/language-(\w+)/);return t?t[1]:""},wT={},Sp=e=>{let t;const n=new Set,r=(l,u)=>{const f=typeof l=="function"?l(t):l;if(!Object.is(f,t)){const c=t;t=u??typeof f!="object"?f:Object.assign({},t,f),n.forEach(h=>h(t,c))}},i=()=>t,a={setState:r,getState:i,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{(wT?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(r,i,a),a},ST=e=>e?Sp(e):Sp;var Na={exports:{}},La={},eo={exports:{}},_a={};/**
249
+ */const wp=Se("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function yT(){const e=this.data();e.micromarkExtensions??(e.micromarkExtensions=[]),e.micromarkExtensions.push({disable:{null:["codeIndented"]}})}const vT=({text:e})=>{const{message:{blocks:{text:t}}}=ye,[n,r]=D.useState(new Map);function i(s){if(n.has(s))return;const a=new Image;a.src=s,a.onerror=()=>{r(l=>new Map(l).set(s,!0))},a.onload=()=>{r(l=>new Map(l).set(s,!1))}}D.useEffect(()=>{const s=/!\[.*?\]\((.*?)\)/g,a=[];let l;for(;(l=s.exec(e))!==null;){const u=l[1];u&&!a.includes(u)&&a.push(u)}a.forEach(u=>{i(u)})},[e]);const o={h1:({node:s,...a})=>x.jsx("h1",{...a,...t.heading1}),h2:({node:s,...a})=>x.jsx("h2",{...a,...t.heading2}),h3:({node:s,...a})=>x.jsx("h3",{...a,...t.heading3}),h4:({node:s,...a})=>x.jsx("h4",{...a,...t.heading4}),h5:"h4",h6:"h4",em:({node:s,...a})=>x.jsx("em",{...a,...t.italic}),strong:({node:s,...a})=>x.jsx("strong",{...a,...t.bold}),p:({node:s,...a})=>x.jsx("p",{...a,...t.text}),hr:({node:s,...a})=>x.jsx("hr",{...a,...t.horizontalRule}),a:({node:s,href:a,children:l,...u})=>x.jsx("a",{...u,...t.link,onMouseUp:f=>{window.open(a,"_blank","noopener,noreferrer")},children:l}),img:({node:s,...a})=>{const l=a.src;return n.get(l)||!1?x.jsx("div",{"data-error":!0,...t.image,children:x.jsx(vp,{strokeWidth:"1"})}):x.jsx("img",{...a,...t.image})},ol:({node:s,...a})=>x.jsx("ol",{...a,...t.orderedList}),ul:({node:s,...a})=>x.jsx("ul",{...a,...t.unorderedList}),li:({node:s,...a})=>x.jsx("li",{...a,...t.listItem}),br:({node:s,...a})=>x.jsx("br",{...a,...t.lineBreak}),pre:({node:s,...a})=>{var m,p;const l=s==null?void 0:s.children[0],u=bT(((p=(m=l==null?void 0:l.properties)==null?void 0:m.className)==null?void 0:p[0])||""),[f,c]=D.useState(!1),h=D.useRef(null),d=()=>{if(!h.current)return;const g=h.current.textContent||"";navigator.clipboard.writeText(g).then(()=>{c(!0),setTimeout(()=>{c(!1)},1500)}).catch(y=>{console.error("Failed to copy code to clipboard:",y)})};return x.jsxs("div",{...t.codeBlockContainer,children:[x.jsxs("div",{...t.codeBlockTitle,children:[u?x.jsx("span",{children:u}):"Code",f?x.jsx(WA,{...t.codeBlockCopyIcon}):x.jsx(ZA,{...t.codeBlockCopyIcon,onClick:d})]}),x.jsx("pre",{ref:h,...a,...t.codeBlock})]})},input:({node:s,...a})=>x.jsx("input",{...a,...t.input,disabled:!1}),code:({node:s,...a})=>x.jsx("code",{...a,...t.code}),table:({node:s,...a})=>x.jsx("div",{...t.tableContainer,children:x.jsx("table",{...a,...t.table})}),th:({node:s,...a})=>x.jsx("th",{...a,...t.tableHeader}),tr:({node:s,...a})=>x.jsx("tr",{...a,...t.tableRow}),td:({node:s,...a})=>x.jsx("td",{...a,...t.tableData})};return x.jsx(Nh,{urlTransform:s=>s.startsWith("tel:")?s:Lh(s),components:o,remarkPlugins:[yT,BA,_E],children:e})},bT=e=>{if(!e)return"";const t=e.match(/language-(\w+)/);return t?t[1]:""},wT={},Sp=e=>{let t;const n=new Set,r=(l,u)=>{const f=typeof l=="function"?l(t):l;if(!Object.is(f,t)){const c=t;t=u??typeof f!="object"?f:Object.assign({},t,f),n.forEach(h=>h(t,c))}},i=()=>t,a={setState:r,getState:i,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{(wT?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(r,i,a),a},ST=e=>e?Sp(e):Sp;var Na={exports:{}},La={},eo={exports:{}},_a={};/**
250
250
  * @license React
251
251
  * use-sync-external-store-shim.production.min.js
252
252
  *
@@ -262,7 +262,7 @@ Please start a new conversation.`,Bs={ResourceNotFound:{type:"configuration",mes
262
262
  *
263
263
  * This source code is licensed under the MIT license found in the
264
264
  * LICENSE file in the root directory of this source tree.
265
- */var xp;function xT(){return xp||(xp=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=D,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(w){{for(var A=arguments.length,k=new Array(A>1?A-1:0),E=1;E<A;E++)k[E-1]=arguments[E];r("error",w,k)}}function r(w,A,k){{var E=t.ReactDebugCurrentFrame,I=E.getStackAddendum();I!==""&&(A+="%s",k=k.concat([I]));var M=k.map(function(L){return String(L)});M.unshift("Warning: "+A),Function.prototype.apply.call(console[w],console,M)}}function i(w,A){return w===A&&(w!==0||1/w===1/A)||w!==w&&A!==A}var o=typeof Object.is=="function"?Object.is:i,s=e.useState,a=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue,f=!1,c=!1;function h(w,A,k){f||e.startTransition!==void 0&&(f=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var E=A();if(!c){var I=A();o(E,I)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}var M=s({inst:{value:E,getSnapshot:A}}),L=M[0].inst,T=M[1];return l(function(){L.value=E,L.getSnapshot=A,d(L)&&T({inst:L})},[w,E,A]),a(function(){d(L)&&T({inst:L});var O=function(){d(L)&&T({inst:L})};return w(O)},[w]),u(E),E}function d(w){var A=w.getSnapshot,k=w.value;try{var E=A();return!o(k,E)}catch{return!0}}function m(w,A,k){return A()}var p=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",g=!p,v=g?m:h,y=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v;Pa.useSyncExternalStore=y,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Pa}var Ep;function Cp(){return Ep||(Ep=1,process.env.NODE_ENV==="production"?eo.exports=kT():eo.exports=xT()),eo.exports}/**
265
+ */var xp;function xT(){return xp||(xp=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=D,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(w){{for(var A=arguments.length,k=new Array(A>1?A-1:0),E=1;E<A;E++)k[E-1]=arguments[E];r("error",w,k)}}function r(w,A,k){{var E=t.ReactDebugCurrentFrame,I=E.getStackAddendum();I!==""&&(A+="%s",k=k.concat([I]));var M=k.map(function(P){return String(P)});M.unshift("Warning: "+A),Function.prototype.apply.call(console[w],console,M)}}function i(w,A){return w===A&&(w!==0||1/w===1/A)||w!==w&&A!==A}var o=typeof Object.is=="function"?Object.is:i,s=e.useState,a=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue,f=!1,c=!1;function h(w,A,k){f||e.startTransition!==void 0&&(f=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var E=A();if(!c){var I=A();o(E,I)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}var M=s({inst:{value:E,getSnapshot:A}}),P=M[0].inst,T=M[1];return l(function(){P.value=E,P.getSnapshot=A,d(P)&&T({inst:P})},[w,E,A]),a(function(){d(P)&&T({inst:P});var O=function(){d(P)&&T({inst:P})};return w(O)},[w]),u(E),E}function d(w){var A=w.getSnapshot,k=w.value;try{var E=A();return!o(k,E)}catch{return!0}}function m(w,A,k){return A()}var p=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",g=!p,y=g?m:h,v=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:y;Pa.useSyncExternalStore=v,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Pa}var Ep;function Cp(){return Ep||(Ep=1,process.env.NODE_ENV==="production"?eo.exports=kT():eo.exports=xT()),eo.exports}/**
266
266
  * @license React
267
267
  * use-sync-external-store-shim/with-selector.production.min.js
268
268
  *
@@ -270,7 +270,7 @@ Please start a new conversation.`,Bs={ResourceNotFound:{type:"configuration",mes
270
270
  *
271
271
  * This source code is licensed under the MIT license found in the
272
272
  * LICENSE file in the root directory of this source tree.
273
- */var Ap;function ET(){if(Ap)return La;Ap=1;var e=D,t=Cp();function n(u,f){return u===f&&(u!==0||1/u===1/f)||u!==u&&f!==f}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return La.useSyncExternalStoreWithSelector=function(u,f,c,h,d){var m=o(null);if(m.current===null){var p={hasValue:!1,value:null};m.current=p}else p=m.current;m=a(function(){function v(E){if(!y){if(y=!0,w=E,E=h(E),d!==void 0&&p.hasValue){var I=p.value;if(d(I,E))return A=I}return A=E}if(I=A,r(w,E))return I;var M=h(E);return d!==void 0&&d(I,M)?I:(w=E,A=M)}var y=!1,w,A,k=c===void 0?null:c;return[function(){return v(f())},k===null?void 0:function(){return v(k())}]},[f,c,h,d]);var g=i(u,m[0],m[1]);return s(function(){p.hasValue=!0,p.value=g},[g]),l(g),g},La}var Fa={};/**
273
+ */var Ap;function ET(){if(Ap)return La;Ap=1;var e=D,t=Cp();function n(u,f){return u===f&&(u!==0||1/u===1/f)||u!==u&&f!==f}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return La.useSyncExternalStoreWithSelector=function(u,f,c,h,d){var m=o(null);if(m.current===null){var p={hasValue:!1,value:null};m.current=p}else p=m.current;m=a(function(){function y(E){if(!v){if(v=!0,w=E,E=h(E),d!==void 0&&p.hasValue){var I=p.value;if(d(I,E))return A=I}return A=E}if(I=A,r(w,E))return I;var M=h(E);return d!==void 0&&d(I,M)?I:(w=E,A=M)}var 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,h,d]);var g=i(u,m[0],m[1]);return s(function(){p.hasValue=!0,p.value=g},[g]),l(g),g},La}var Fa={};/**
274
274
  * @license React
275
275
  * use-sync-external-store-shim/with-selector.development.js
276
276
  *
@@ -278,50 +278,50 @@ Please start a new conversation.`,Bs={ResourceNotFound:{type:"configuration",mes
278
278
  *
279
279
  * This source code is licensed under the MIT license found in the
280
280
  * LICENSE file in the root directory of this source tree.
281
- */var Tp;function CT(){return Tp||(Tp=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=D,t=Cp();function n(f,c){return f===c&&(f!==0||1/f===1/c)||f!==f&&c!==c}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;function u(f,c,h,d,m){var p=o(null),g;p.current===null?(g={hasValue:!1,value:null},p.current=g):g=p.current;var v=a(function(){var k=!1,E,I,M=function(H){if(!k){k=!0,E=H;var P=d(H);if(m!==void 0&&g.hasValue){var F=g.value;if(m(F,P))return I=F,F}return I=P,P}var _=E,z=I;if(r(_,H))return z;var $=d(H);return m!==void 0&&m(z,$)?z:(E=H,I=$,$)},L=h===void 0?null:h,T=function(){return M(c())},O=L===null?void 0:function(){return M(L())};return[T,O]},[c,h,d,m]),y=v[0],w=v[1],A=i(f,y,w);return s(function(){g.hasValue=!0,g.value=A},[A]),l(A),A}Fa.useSyncExternalStoreWithSelector=u,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Fa}process.env.NODE_ENV==="production"?Na.exports=ET():Na.exports=CT();var AT=Na.exports;const TT=bn(AT),Ip={},{useSyncExternalStoreWithSelector:IT}=TT;let Op=!1;function OT(e,t=e.getState,n){(Ip?"production":void 0)!=="production"&&n&&!Op&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Op=!0);const r=IT(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return D.useDebugValue(r),r}const DT=e=>{(Ip?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?ST(e):e,n=(r,i)=>OT(t,r,i);return Object.assign(n,t),n},un=e=>DT,to={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},Ra=new Map,no=e=>{const t=Ra.get(e);return t?Object.fromEntries(Object.entries(t.stores).map(([n,r])=>[n,r.getState()])):{}},MT=(e,t,n)=>{if(e===void 0)return{type:"untracked",connection:t.connect(n)};const r=Ra.get(n.name);if(r)return{type:"tracked",store:e,...r};const i={connection:t.connect(n),stores:{}};return Ra.set(n.name,i),{type:"tracked",store:e,...i}},Zn=(e,t={})=>(n,r,i)=>{const{enabled:o,anonymousActionType:s,store:a,...l}=t;let u;try{u=(o??(to?"production":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!u)return(to?"production":void 0)!=="production"&&o&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),e(n,r,i);const{connection:f,...c}=MT(a,u,l);let h=!0;i.setState=(p,g,v)=>{const y=n(p,g);if(!h)return y;const w=v===void 0?{type:s||"anonymous"}:typeof v=="string"?{type:v}:v;return a===void 0?(f==null||f.send(w,r()),y):(f==null||f.send({...w,type:`${a}/${w.type}`},{...no(l.name),[a]:i.getState()}),y)};const d=(...p)=>{const g=h;h=!1,n(...p),h=g},m=e(i.setState,r,i);if(c.type==="untracked"?f==null||f.init(m):(c.stores[c.store]=i,f==null||f.init(Object.fromEntries(Object.entries(c.stores).map(([p,g])=>[p,p===c.store?m:g.getState()])))),i.dispatchFromDevtools&&typeof i.dispatch=="function"){let p=!1;const g=i.dispatch;i.dispatch=(...v)=>{(to?"production":void 0)!=="production"&&v[0].type==="__setState"&&!p&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),p=!0),g(...v)}}return f.subscribe(p=>{var g;switch(p.type){case"ACTION":if(typeof p.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return Ba(p.payload,v=>{if(v.type==="__setState"){if(a===void 0){d(v.state);return}Object.keys(v.state).length!==1&&console.error(`
281
+ */var Tp;function CT(){return Tp||(Tp=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=D,t=Cp();function n(f,c){return f===c&&(f!==0||1/f===1/c)||f!==f&&c!==c}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;function u(f,c,h,d,m){var p=o(null),g;p.current===null?(g={hasValue:!1,value:null},p.current=g):g=p.current;var y=a(function(){var k=!1,E,I,M=function(j){if(!k){k=!0,E=j;var F=d(j);if(m!==void 0&&g.hasValue){var L=g.value;if(m(L,F))return I=L,L}return I=F,F}var _=E,B=I;if(r(_,j))return B;var z=d(j);return m!==void 0&&m(B,z)?B:(E=j,I=z,z)},P=h===void 0?null:h,T=function(){return M(c())},O=P===null?void 0:function(){return M(P())};return[T,O]},[c,h,d,m]),v=y[0],w=y[1],A=i(f,v,w);return s(function(){g.hasValue=!0,g.value=A},[A]),l(A),A}Fa.useSyncExternalStoreWithSelector=u,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Fa}process.env.NODE_ENV==="production"?Na.exports=ET():Na.exports=CT();var AT=Na.exports;const TT=bn(AT),Ip={},{useSyncExternalStoreWithSelector:IT}=TT;let Op=!1;function OT(e,t=e.getState,n){(Ip?"production":void 0)!=="production"&&n&&!Op&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Op=!0);const r=IT(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return D.useDebugValue(r),r}const DT=e=>{(Ip?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?ST(e):e,n=(r,i)=>OT(t,r,i);return Object.assign(n,t),n},un=e=>DT,to={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},Ra=new Map,no=e=>{const t=Ra.get(e);return t?Object.fromEntries(Object.entries(t.stores).map(([n,r])=>[n,r.getState()])):{}},MT=(e,t,n)=>{if(e===void 0)return{type:"untracked",connection:t.connect(n)};const r=Ra.get(n.name);if(r)return{type:"tracked",store:e,...r};const i={connection:t.connect(n),stores:{}};return Ra.set(n.name,i),{type:"tracked",store:e,...i}},Zn=(e,t={})=>(n,r,i)=>{const{enabled:o,anonymousActionType:s,store:a,...l}=t;let u;try{u=(o??(to?"production":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!u)return(to?"production":void 0)!=="production"&&o&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),e(n,r,i);const{connection:f,...c}=MT(a,u,l);let h=!0;i.setState=(p,g,y)=>{const v=n(p,g);if(!h)return v;const w=y===void 0?{type:s||"anonymous"}:typeof y=="string"?{type:y}:y;return a===void 0?(f==null||f.send(w,r()),v):(f==null||f.send({...w,type:`${a}/${w.type}`},{...no(l.name),[a]:i.getState()}),v)};const d=(...p)=>{const g=h;h=!1,n(...p),h=g},m=e(i.setState,r,i);if(c.type==="untracked"?f==null||f.init(m):(c.stores[c.store]=i,f==null||f.init(Object.fromEntries(Object.entries(c.stores).map(([p,g])=>[p,p===c.store?m:g.getState()])))),i.dispatchFromDevtools&&typeof i.dispatch=="function"){let p=!1;const g=i.dispatch;i.dispatch=(...y)=>{(to?"production":void 0)!=="production"&&y[0].type==="__setState"&&!p&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),p=!0),g(...y)}}return f.subscribe(p=>{var g;switch(p.type){case"ACTION":if(typeof p.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return Ba(p.payload,y=>{if(y.type==="__setState"){if(a===void 0){d(y.state);return}Object.keys(y.state).length!==1&&console.error(`
282
282
  [zustand devtools middleware] Unsupported __setState action format.
283
283
  When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
284
284
  and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }
285
- `);const y=v.state[a];if(y==null)return;JSON.stringify(i.getState())!==JSON.stringify(y)&&d(y);return}i.dispatchFromDevtools&&typeof i.dispatch=="function"&&i.dispatch(v)});case"DISPATCH":switch(p.payload.type){case"RESET":return d(m),a===void 0?f==null?void 0:f.init(i.getState()):f==null?void 0:f.init(no(l.name));case"COMMIT":if(a===void 0){f==null||f.init(i.getState());return}return f==null?void 0:f.init(no(l.name));case"ROLLBACK":return Ba(p.state,v=>{if(a===void 0){d(v),f==null||f.init(i.getState());return}d(v[a]),f==null||f.init(no(l.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return Ba(p.state,v=>{if(a===void 0){d(v);return}JSON.stringify(i.getState())!==JSON.stringify(v[a])&&d(v[a])});case"IMPORT_STATE":{const{nextLiftedState:v}=p.payload,y=(g=v.computedStates.slice(-1)[0])==null?void 0:g.state;if(!y)return;d(a===void 0?y:y[a]),f==null||f.send(null,v);return}case"PAUSE_RECORDING":return h=!h}return}}),m},Ba=(e,t)=>{let n;try{n=JSON.parse(e)}catch(r){console.error("[zustand devtools middleware] Could not parse the received json",r)}n!==void 0&&t(n)};function ro(e,t){let n;try{n=e()}catch{return}return{getItem:i=>{var o;const s=l=>l===null?null:JSON.parse(l,void 0),a=(o=n.getItem(i))!=null?o:null;return a instanceof Promise?a.then(s):s(a)},setItem:(i,o)=>n.setItem(i,JSON.stringify(o,void 0)),removeItem:i=>n.removeItem(i)}}const Kr=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Kr(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Kr(r)(n)}}}},NT=(e,t)=>(n,r,i)=>{let o={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:g=>g,version:0,merge:(g,v)=>({...v,...g}),...t},s=!1;const a=new Set,l=new Set;let u;try{u=o.getStorage()}catch{}if(!u)return e((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...g)},r,i);const f=Kr(o.serialize),c=()=>{const g=o.partialize({...r()});let v;const y=f({state:g,version:o.version}).then(w=>u.setItem(o.name,w)).catch(w=>{v=w});if(v)throw v;return y},h=i.setState;i.setState=(g,v)=>{h(g,v),c()};const d=e((...g)=>{n(...g),c()},r,i);let m;const p=()=>{var g;if(!u)return;s=!1,a.forEach(y=>y(r()));const v=((g=o.onRehydrateStorage)==null?void 0:g.call(o,r()))||void 0;return Kr(u.getItem.bind(u))(o.name).then(y=>{if(y)return o.deserialize(y)}).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==o.version){if(o.migrate)return o.migrate(y.state,y.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return y.state}).then(y=>{var w;return m=o.merge(y,(w=r())!=null?w:d),n(m,!0),c()}).then(()=>{v==null||v(m,void 0),s=!0,l.forEach(y=>y(m))}).catch(y=>{v==null||v(void 0,y)})};return i.persist={setOptions:g=>{o={...o,...g},g.getStorage&&(u=g.getStorage())},clearStorage:()=>{u==null||u.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>p(),hasHydrated:()=>s,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(l.add(g),()=>{l.delete(g)})},p(),m||d},LT=(e,t)=>(n,r,i)=>{let o={storage:ro(()=>localStorage),partialize:p=>p,version:0,merge:(p,g)=>({...g,...p}),...t},s=!1;const a=new Set,l=new Set;let u=o.storage;if(!u)return e((...p)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...p)},r,i);const f=()=>{const p=o.partialize({...r()});return u.setItem(o.name,{state:p,version:o.version})},c=i.setState;i.setState=(p,g)=>{c(p,g),f()};const h=e((...p)=>{n(...p),f()},r,i);let d;const m=()=>{var p,g;if(!u)return;s=!1,a.forEach(y=>{var w;return y((w=r())!=null?w:h)});const v=((g=o.onRehydrateStorage)==null?void 0:g.call(o,(p=r())!=null?p:h))||void 0;return Kr(u.getItem.bind(u))(o.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==o.version){if(o.migrate)return o.migrate(y.state,y.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return y.state}).then(y=>{var w;return d=o.merge(y,(w=r())!=null?w:h),n(d,!0),f()}).then(()=>{v==null||v(d,void 0),d=r(),s=!0,l.forEach(y=>y(d))}).catch(y=>{v==null||v(void 0,y)})};return i.persist={setOptions:p=>{o={...o,...p},p.storage&&(u=p.storage)},clearStorage:()=>{u==null||u.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>m(),hasHydrated:()=>s,onHydrate:p=>(a.add(p),()=>{a.delete(p)}),onFinishHydration:p=>(l.add(p),()=>{l.delete(p)})},o.skipHydration||m(),d||h},io=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?((to?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),NT(e,t)):LT(e,t),_T=(e,t)=>un()(Zn(io(n=>({messageHistory:[],addMessageToHistory:r=>n(i=>({...i,messageHistory:[r,...(i.messageHistory??[]).slice(0,100).filter(String)]})),clearHistory:()=>n(()=>({messageHistory:[]}))}),{name:e,storage:ro(()=>t==="sessionStorage"?sessionStorage:localStorage)}))),$a={},Dp=(e,t,n)=>{const i=`${t||"bp-webchat"}-message-history-${e}`;return $a[i]||($a[i]=_T(i,n)),$a[i]},PT=e=>un()(Zn(t=>({messages:[],setMessages:n=>t({messages:n}),saveMessage:n=>t(({messages:r})=>({messages:Mp(r,n)})),saveMessages:n=>{n.length&&t(({messages:r})=>({messages:n.reduce(Mp,r)}))},updateMessage:(n,r)=>t(({messages:i})=>({messages:i.map(o=>o.id===n?{...o,...r}:o)})),removeMessage:n=>t(({messages:r})=>({messages:r.filter(i=>i.id!==n)})),clearMessages:()=>t({messages:[]})}),{name:e}));function Mp(e,t){var i;const n=(i=t.metadata)==null?void 0:i.clientMessageId;let r=-1;return n&&(r=e.findIndex(o=>{var s;return((s=o.metadata)==null?void 0:s.clientMessageId)===n})),r===-1&&(r=e.findIndex(o=>o.id===t.id)),r!==-1?[...e.slice(0,r),{...e[r],...t},...e.slice(r+1)]:[...e,t]}const za={},Ha=e=>{const t=`messages-${e}`;return za[t]||(za[t]=PT(t)),za[t]},FT=(e,t)=>un()(Zn(io(n=>({setUser:r=>n(i=>({...i,user:r})),setConversationId:r=>n(i=>({...i,conversationId:r})),clearAll:()=>{n(r=>({...r,user:void 0,conversationId:void 0}))}}),{name:e,storage:ro(()=>t==="sessionStorage"?sessionStorage:localStorage)}))),Ua={},Np=(e="bp-webchat",t)=>{const n=`${e}-client`;return Ua[n]||(Ua[n]=FT(n,t)),Ua[n]},Jn=un()(Zn(e=>({eventEmitter:hc(),messageContainerRef:D.createRef(),setMessageContainerRef:t=>e({messageContainerRef:t}),portalContainer:null,setPortalContainer:t=>e({portalContainer:t})}),{name:"webchatStore"})),RT=8,BT=e=>un()(io((t,n)=>({files:[],setFiles:r=>t({files:r}),upsertFile:r=>t(({files:i})=>({files:i.some(a=>a.name===r.name)?i.map(a=>a.name===r.name?{...a,...r}:a):[...i,{...r}]})),uploadFile:async(r,i)=>{if(n().files.length===RT)return;const o=r.name.lastIndexOf("."),s=o>0&&o<r.name.length-1,a=s?r.name.substring(0,o):r.name,l=s?r.name.substring(o):"",u=K0(a,n().files,h=>h.name),f=u+l,c=new File([r],f,{type:r.type});n().upsertFile({name:u,type:"file",instance:c,status:"loading"});try{const{fileUrl:h,type:d,fileId:m}=await i(c);n().upsertFile({fileId:m,name:u,type:d,url:h,instance:c,status:"uploaded"})}catch{n().upsertFile({name:u,type:"file",instance:c,status:"error"})}},deleteFile:r=>t(({files:i})=>({files:i.filter(o=>o.name!=r)}))}),{name:e,storage:ro(()=>sessionStorage)})),ja={},Lp=(e,t)=>{const r=`${t||"bp-webchat"}-composer-files-${e}`;return ja[r]||(ja[r]=BT(r)),ja[r]},$T=e=>un()(Zn(t=>({participants:[],setParticipants:n=>t({participants:n}),addParticipant:n=>t(r=>({participants:[...r.participants,n]})),removeParticipant:n=>t(r=>({participants:r.participants.filter(i=>i.id!==n)})),clearParticipants:()=>t({participants:[]})}),{name:e})),Va={},Wa=e=>{const t=`participants-${e}`;return Va[t]||(Va[t]=$T(t)),Va[t]},zT=e=>un()(Zn(io((t,n)=>({soundOn:!0,setSoundEnabled:r=>t({soundOn:r}),toggleSound:()=>t({soundOn:!n().soundOn})}),{name:e}))),qa={},_p=(e="bp-webchat")=>{const t=`${e}-sound`;return qa[t]||(qa[t]=zT(t)),qa[t]},HT=({text:e,buttonValue:t,variant:n,groupId:r,reusable:i,sendMessage:o,isReadOnly:s,...a})=>{const l=Jn(w=>w.eventEmitter),[u,f]=D.useState(!1),[c,h]=D.useState(!1),[d,m]=D.useState(!1),{message:{blocks:{button:p}}}=ye;D.useEffect(()=>{if(r)return l.on(`button-group-${r}-click`,()=>{h(!0),i||m(!0)})},[l,r,i]);const v={...a,onClick:w=>{if((d||s)&&n==="link"){w.preventDefault();return}f(!0),i||m(!0),r&&l.emit(`button-group-${r}-click`),n!=="link"&&o&&(o==null||o({type:"text",text:e,value:t}))},"data-activated":u?"":void 0,"data-group-activated":c?"":void 0,"data-type":n,...p},y=d||s;return n==="link"?x.jsx("a",{...v,style:s?{pointerEvents:"none"}:void 0,href:t,target:"_blank",rel:"noopener noreferrer",children:e}):x.jsx("button",{...v,style:s?{pointerEvents:"none"}:void 0,disabled:y,children:e})},Ya=D.createContext(null);function Pp(){const e=D.useContext(Ya);if(!e)throw new Error("useMessageContext must be used within a Message");return e}const Ka=D.createContext({showInputModal:void 0});function Ga(){return D.useContext(Ka)}const Fp=D.createContext(Rn),Rp=Fp.Provider;function Ye(){return D.useContext(Fp)}const Bp=D.forwardRef(({block:e,direction:t,sender:n,timestamp:r,messageId:i,feedback:o,metadata:s,isReadOnly:a,sendMessage:l,addMessageFeedback:u,...f},c)=>{const{showInputModal:h}=Ga(),d=Ye(),{message:{blocks:{bubble:{container:m,feedbackContainer:p,feedbackIcon:g}}}}=ye;return t=="incoming"?x.jsxs("div",{"data-direction":"incoming","data-feedback":!!o,...f,...m,ref:c,children:[x.jsx(Nn,{block:{...e,direction:t,timestamp:r,sender:n,messageId:i,isReadOnly:a,metadata:s,sendMessage:l}}),u&&h&&e.type==="text"&&x.jsxs("div",{...p,children:[x.jsx(fT,{...g,"data-selected":o==="positive",onClick:()=>u(i,{value:"positive"})}),x.jsx(cT,{...g,"data-selected":o==="negative",onClick:async()=>{const v=await h({title:d["feedback.title"],description:d["feedback.description"],confirmButtonText:d["feedback.confirm"],cancelButtonText:d["feedback.cancel"],Content:UT});u(i,{value:"negative",comment:v})}})]})]}):x.jsx("div",{"data-direction":"outgoing",...f,...m,ref:c,children:x.jsx(Nn,{block:{...e,direction:t,timestamp:r,sender:n,messageId:i,isReadOnly:a,metadata:s,sendMessage:l,addMessageFeedback:u}})})});Bp.displayName="Bubble";const UT=({setValue:e})=>{const{modal:{dialog:{content:t}}}=ye,n=Ye();return x.jsx("textarea",{...t.textarea,placeholder:n["feedback.placeholder"],onChange:r=>e(r.target.value)})},$p=({className:e,...t})=>x.jsx("div",{"data-slot":"skeleton",className:`bpSkeleton ${e||""}`,...t});$p.displayName="Skeleton";var xt=function(){return xt=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},xt.apply(this,arguments)};function zp(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Xn(e,t,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(f){try{u(r.next(f))}catch(c){s(c)}}function l(f){try{u(r.throw(f))}catch(c){s(c)}}function u(f){f.done?o(f.value):i(f.value).then(a,l)}u((r=r.apply(e,t||[])).next())})}function er(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(f){return l([u,f])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1],o=u;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(u);break}o[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(f){u=[6,f],i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Hp(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],s;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o}function Qa(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;function jT(){var e=D.useRef(!1),t=D.useCallback(function(){return e.current},[]);return D.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),t}function VT(e,t,n){t===void 0&&(t=[]),n===void 0&&(n={loading:!1});var r=D.useRef(0),i=jT(),o=D.useState(n),s=o[0],a=o[1],l=D.useCallback(function(){for(var u=[],f=0;f<arguments.length;f++)u[f]=arguments[f];var c=++r.current;return s.loading||a(function(h){return xt(xt({},h),{loading:!0})}),e.apply(void 0,u).then(function(h){return i()&&c===r.current&&a({value:h,loading:!1}),h},function(h){return i()&&c===r.current&&a({error:h,loading:!1}),h})},t);return[s,l]}function WT(e,t){t===void 0&&(t=[]);var n=VT(e,t,{loading:!0}),r=n[0],i=n[1];return D.useEffect(function(){i()},[i]),r}const Up=D.forwardRef(({url:e,type:t,orientation:n="auto",...r},i)=>{const o=D.useId(),{setIsLoading:s}=Pp(),[a,l]=D.useState(n==="auto"?"square":n),[u,f]=D.useState("initial"),{message:{blocks:{image:c}}}=ye;return D.useLayoutEffect(()=>(s(h=>[...h,o]),()=>{s(h=>h.filter(d=>d!==o))}),[o,s]),WT(async()=>{if(!e)return;const h=new Image;try{const{width:d,height:m}=await bb(e);n==="auto"&&l(qT(d,m)),h.onload=()=>{f("loaded"),s(p=>p.filter(g=>g!==o))},h.onerror=()=>{f("error"),l("square"),s(p=>p.filter(g=>g!==o))},h.src=e,h.complete&&(h.naturalWidth>0?(f("loaded"),s(p=>p.filter(g=>g!==o))):(f("error"),l("square"),s(p=>p.filter(g=>g!==o))))}catch(d){console.error(d),f("error"),s(m=>m.filter(p=>p!==o))}return()=>{h.onload=null,h.onerror=null}},[e,o,s,n]),e?u==="error"?x.jsx("div",{"data-error":"true","data-orientation":a,...r,...c.image,ref:i,children:x.jsx(vp,{size:"25%",strokeWidth:"5%"})}):u==="initial"?x.jsx($p,{"data-orientation":a,...c.placeholder}):x.jsx("img",{"data-orientation":a,"data-loaded":u==="loaded",...r,...c.image,src:e,alt:"",ref:i}):null});Up.displayName="Image";function qT(e,t){const n={square:1,portrait:.75,landscape:1.3333333333333333},r=e/t;return Object.keys(n).reduce((o,s)=>Math.abs(n[s]-r)<Math.abs(n[o]-r)?s:o)}const jp=D.forwardRef(({url:e,isReadOnly:t,...n},r)=>{const{message:{blocks:{video:i}}}=ye,o=t?s=>{s.stopPropagation(),s.preventDefault()}:void 0;return x.jsx("div",{children:x.jsx("video",{...n,"data-chromatic":"ignore",controls:!0,onClick:o,src:e,...i,ref:r})})});jp.displayName="Video";const Vp=D.forwardRef(({url:e,isReadOnly:t,...n},r)=>{const{message:{blocks:{audio:i}}}=ye,o=t?s=>{s.stopPropagation(),s.preventDefault()}:void 0;return x.jsx("div",{children:x.jsx("audio",{...n,controls:!0,onClick:o,src:e,...i,ref:r})})});Vp.displayName="Audio";const Wp=D.forwardRef(({latitude:e,longitude:t,title:n,isReadOnly:r,...i},o)=>{const s=`https://www.google.com/maps/search/?api=1&query=${e},${t}`,{message:{blocks:{location:a}}}=ye;return x.jsxs("a",{...i,...a.container,style:r?{pointerEvents:"none"}:void 0,href:s,type:"_blank",rel:"noopener",ref:o,children:[x.jsx("p",{...a.title,children:n}),x.jsx(rT,{...a.icon})]})});Wp.displayName="Location";const qp=D.forwardRef(({blocks:e,horizontalAlignment:t,verticalAlignment:n,direction:r,sender:i,timestamp:o,messageId:s,isReadOnly:a,sendMessage:l,...u},f)=>{const{message:{blocks:{column:c}}}=ye;return x.jsx("div",{"data-horizontal":t,"data-vertical":n,...u,...c,ref:f,children:e.map((h,d)=>x.jsx(Nn,{block:{...h,direction:r,timestamp:o,sender:i,messageId:s,isReadOnly:a,sendMessage:l}},d))})});qp.displayName="Column";const Yp=D.forwardRef(({blocks:e,horizontalAlignment:t,verticalAlignment:n,direction:r,sender:i,timestamp:o,metadata:s,messageId:a,isReadOnly:l,sendMessage:u,...f},c)=>{const{message:{blocks:{row:h}}}=ye;return x.jsx("div",{"data-horizontal":t,"data-vertical":n,...f,...h,ref:c,children:e.map((d,m)=>x.jsx(Nn,{block:{...d,direction:r,timestamp:o,sender:i,messageId:a,isReadOnly:l,sendMessage:u}},m))})});Yp.displayName="Row";function YT(e){return Object.prototype.toString.call(e)==="[object Object]"}function Kp(e){return YT(e)||Array.isArray(e)}function KT(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Za(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;const i=JSON.stringify(Object.keys(e.breakpoints||{})),o=JSON.stringify(Object.keys(t.breakpoints||{}));return i!==o?!1:n.every(s=>{const a=e[s],l=t[s];return typeof a=="function"?`${a}`==`${l}`:!Kp(a)||!Kp(l)?a===l:Za(a,l)})}function Gp(e){return e.concat().sort((t,n)=>t.name>n.name?1:-1).map(t=>t.options)}function GT(e,t){if(e.length!==t.length)return!1;const n=Gp(e),r=Gp(t);return n.every((i,o)=>{const s=r[o];return Za(i,s)})}function Ja(e){return typeof e=="number"}function Xa(e){return typeof e=="string"}function oo(e){return typeof e=="boolean"}function Qp(e){return Object.prototype.toString.call(e)==="[object Object]"}function Be(e){return Math.abs(e)}function el(e){return Math.sign(e)}function Gr(e,t){return Be(e-t)}function QT(e,t){if(e===0||t===0||Be(e)<=Be(t))return 0;const n=Gr(Be(e),Be(t));return Be(n/e)}function ZT(e){return Math.round(e*100)/100}function Qr(e){return Jr(e).map(Number)}function Nt(e){return e[Zr(e)]}function Zr(e){return Math.max(0,e.length-1)}function tl(e,t){return t===Zr(e)}function Zp(e,t=0){return Array.from(Array(e),(n,r)=>t+r)}function Jr(e){return Object.keys(e)}function Jp(e,t){return[e,t].reduce((n,r)=>(Jr(r).forEach(i=>{const o=n[i],s=r[i],a=Qp(o)&&Qp(s);n[i]=a?Jp(o,s):s}),n),{})}function nl(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function JT(e,t){const n={start:r,center:i,end:o};function r(){return 0}function i(l){return o(l)/2}function o(l){return t-l}function s(l,u){return Xa(e)?n[e](l):e(t,l,u)}return{measure:s}}function Xr(){let e=[];function t(i,o,s,a={passive:!0}){let l;if("addEventListener"in i)i.addEventListener(o,s,a),l=()=>i.removeEventListener(o,s,a);else{const u=i;u.addListener(s),l=()=>u.removeListener(s)}return e.push(l),r}function n(){e=e.filter(i=>i())}const r={add:t,clear:n};return r}function XT(e,t,n,r){const i=Xr(),o=1e3/60;let s=null,a=0,l=0;function u(){i.add(e,"visibilitychange",()=>{e.hidden&&m()})}function f(){d(),i.clear()}function c(g){if(!l)return;s||(s=g,n(),n());const v=g-s;for(s=g,a+=v;a>=o;)n(),a-=o;const y=a/o;r(y),l&&(l=t.requestAnimationFrame(c))}function h(){l||(l=t.requestAnimationFrame(c))}function d(){t.cancelAnimationFrame(l),s=null,a=0,l=0}function m(){s=null,a=0}return{init:u,destroy:f,start:h,stop:d,update:n,render:r}}function eI(e,t){const n=t==="rtl",r=e==="y",i=r?"y":"x",o=r?"x":"y",s=!r&&n?-1:1,a=f(),l=c();function u(m){const{height:p,width:g}=m;return r?p:g}function f(){return r?"top":n?"right":"left"}function c(){return r?"bottom":n?"left":"right"}function h(m){return m*s}return{scroll:i,cross:o,startEdge:a,endEdge:l,measureSize:u,direction:h}}function Dn(e=0,t=0){const n=Be(e-t);function r(u){return u<e}function i(u){return u>t}function o(u){return r(u)||i(u)}function s(u){return o(u)?r(u)?e:t:u}function a(u){return n?u-n*Math.ceil((u-t)/n):u}return{length:n,max:t,min:e,constrain:s,reachedAny:o,reachedMax:i,reachedMin:r,removeOffset:a}}function Xp(e,t,n){const{constrain:r}=Dn(0,e),i=e+1;let o=s(t);function s(h){return n?Be((i+h)%i):r(h)}function a(){return o}function l(h){return o=s(h),c}function u(h){return f().set(a()+h)}function f(){return Xp(e,a(),n)}const c={get:a,set:l,add:u,clone:f};return c}function tI(e,t,n,r,i,o,s,a,l,u,f,c,h,d,m,p,g,v,y){const{cross:w,direction:A}=e,k=["INPUT","SELECT","TEXTAREA"],E={passive:!1},I=Xr(),M=Xr(),L=Dn(50,225).constrain(d.measure(20)),T={mouse:300,touch:400},O={mouse:500,touch:600},H=m?43:25;let P=!1,F=0,_=0,z=!1,$=!1,U=!1,W=!1;function b(B){if(!y)return;function ne(we){(oo(y)||y(B,we))&&Y(we)}const me=t;I.add(me,"dragstart",we=>we.preventDefault(),E).add(me,"touchmove",()=>{},E).add(me,"touchend",()=>{}).add(me,"touchstart",ne).add(me,"mousedown",ne).add(me,"touchcancel",J).add(me,"contextmenu",J).add(me,"click",se,!0)}function N(){I.clear(),M.clear()}function R(){const B=W?n:t;M.add(B,"touchmove",G,E).add(B,"touchend",J).add(B,"mousemove",G,E).add(B,"mouseup",J)}function S(B){const ne=B.nodeName||"";return k.includes(ne)}function V(){return(m?O:T)[W?"mouse":"touch"]}function ee(B,ne){const me=c.add(el(B)*-1),we=f.byDistance(B,!m).distance;return m||Be(B)<L?we:g&&ne?we*.5:f.byIndex(me.get(),0).distance}function Y(B){const ne=nl(B,r);W=ne,U=m&&ne&&!B.buttons&&P,P=Gr(i.get(),s.get())>=2,!(ne&&B.button!==0)&&(S(B.target)||(z=!0,o.pointerDown(B),u.useFriction(0).useDuration(0),i.set(s),R(),F=o.readPoint(B),_=o.readPoint(B,w),h.emit("pointerDown")))}function G(B){if(!nl(B,r)&&B.touches.length>=2)return J(B);const me=o.readPoint(B),we=o.readPoint(B,w),Q=Gr(me,F),ue=Gr(we,_);if(!$&&!W&&(!B.cancelable||($=Q>ue,!$)))return J(B);const de=o.pointerMove(B);Q>p&&(U=!0),u.useFriction(.3).useDuration(.75),a.start(),i.add(A(de)),B.preventDefault()}function J(B){const me=f.byDistance(0,!1).index!==c.get(),we=o.pointerUp(B)*V(),Q=ee(A(we),me),ue=QT(we,Q),de=H-10*ue,fe=v+ue/50;$=!1,z=!1,M.clear(),u.useDuration(de).useFriction(fe),l.distance(Q,!m),W=!1,h.emit("pointerUp")}function se(B){U&&(B.stopPropagation(),B.preventDefault(),U=!1)}function K(){return z}return{init:b,destroy:N,pointerDown:K}}function nI(e,t){let r,i;function o(c){return c.timeStamp}function s(c,h){const m=`client${(h||e.scroll)==="x"?"X":"Y"}`;return(nl(c,t)?c:c.touches[0])[m]}function a(c){return r=c,i=c,s(c)}function l(c){const h=s(c)-s(i),d=o(c)-o(r)>170;return i=c,d&&(r=c),h}function u(c){if(!r||!i)return 0;const h=s(i)-s(r),d=o(c)-o(r),m=o(c)-o(i)>170,p=h/d;return d&&!m&&Be(p)>.1?p:0}return{pointerDown:a,pointerMove:l,pointerUp:u,readPoint:s}}function rI(){function e(n){const{offsetTop:r,offsetLeft:i,offsetWidth:o,offsetHeight:s}=n;return{top:r,right:i+o,bottom:r+s,left:i,width:o,height:s}}return{measure:e}}function iI(e){function t(r){return e*(r/100)}return{measure:t}}function oI(e,t,n,r,i,o,s){const a=[e].concat(r);let l,u,f=[],c=!1;function h(g){return i.measureSize(s.measure(g))}function d(g){if(!o)return;u=h(e),f=r.map(h);function v(y){for(const w of y){if(c)return;const A=w.target===e,k=r.indexOf(w.target),E=A?u:f[k],I=h(A?e:r[k]);if(Be(I-E)>=.5){g.reInit(),t.emit("resize");break}}}l=new ResizeObserver(y=>{(oo(o)||o(g,y))&&v(y)}),n.requestAnimationFrame(()=>{a.forEach(y=>l.observe(y))})}function m(){c=!0,l&&l.disconnect()}return{init:d,destroy:m}}function sI(e,t,n,r,i,o){let s=0,a=0,l=i,u=o,f=e.get(),c=0;function h(){const E=r.get()-e.get(),I=!l;let M=0;return I?(s=0,n.set(r),e.set(r),M=E):(n.set(e),s+=E/l,s*=u,f+=s,e.add(s),M=f-c),a=el(M),c=f,k}function d(){const E=r.get()-t.get();return Be(E)<.001}function m(){return l}function p(){return a}function g(){return s}function v(){return w(i)}function y(){return A(o)}function w(E){return l=E,k}function A(E){return u=E,k}const k={direction:p,duration:m,velocity:g,seek:h,settled:d,useBaseFriction:y,useBaseDuration:v,useFriction:A,useDuration:w};return k}function aI(e,t,n,r,i){const o=i.measure(10),s=i.measure(50),a=Dn(.1,.99);let l=!1;function u(){return!(l||!e.reachedAny(n.get())||!e.reachedAny(t.get()))}function f(d){if(!u())return;const m=e.reachedMin(t.get())?"min":"max",p=Be(e[m]-t.get()),g=n.get()-t.get(),v=a.constrain(p/s);n.subtract(g*v),!d&&Be(g)<o&&(n.set(e.constrain(n.get())),r.useDuration(25).useBaseFriction())}function c(d){l=!d}return{shouldConstrain:u,constrain:f,toggleActive:c}}function lI(e,t,n,r,i){const o=Dn(-t+e,0),s=c(),a=f(),l=h();function u(m,p){return Gr(m,p)<=1}function f(){const m=s[0],p=Nt(s),g=s.lastIndexOf(m),v=s.indexOf(p)+1;return Dn(g,v)}function c(){return n.map((m,p)=>{const{min:g,max:v}=o,y=o.constrain(m),w=!p,A=tl(n,p);return w?v:A||u(g,y)?g:u(v,y)?v:y}).map(m=>parseFloat(m.toFixed(3)))}function h(){if(t<=e+i)return[o.max];if(r==="keepSnaps")return s;const{min:m,max:p}=a;return s.slice(m,p)}return{snapsContained:l,scrollContainLimit:a}}function uI(e,t,n){const r=t[0],i=n?r-e:Nt(t);return{limit:Dn(i,r)}}function cI(e,t,n,r){const o=t.min+.1,s=t.max+.1,{reachedMin:a,reachedMax:l}=Dn(o,s);function u(h){return h===1?l(n.get()):h===-1?a(n.get()):!1}function f(h){if(!u(h))return;const d=e*(h*-1);r.forEach(m=>m.add(d))}return{loop:f}}function fI(e){const{max:t,length:n}=e;function r(o){const s=o-t;return n?s/-n:0}return{get:r}}function dI(e,t,n,r,i){const{startEdge:o,endEdge:s}=e,{groupSlides:a}=i,l=c().map(t.measure),u=h(),f=d();function c(){return a(r).map(p=>Nt(p)[s]-p[0][o]).map(Be)}function h(){return r.map(p=>n[o]-p[o]).map(p=>-Be(p))}function d(){return a(u).map(p=>p[0]).map((p,g)=>p+l[g])}return{snaps:u,snapsAligned:f}}function hI(e,t,n,r,i,o){const{groupSlides:s}=i,{min:a,max:l}=r,u=f();function f(){const h=s(o),d=!e||t==="keepSnaps";return n.length===1?[o]:d?h:h.slice(a,l).map((m,p,g)=>{const v=!p,y=tl(g,p);if(v){const w=Nt(g[0])+1;return Zp(w)}if(y){const w=Zr(o)-Nt(g)[0]+1;return Zp(w,Nt(g)[0])}return m})}return{slideRegistry:u}}function pI(e,t,n,r,i){const{reachedAny:o,removeOffset:s,constrain:a}=r;function l(m){return m.concat().sort((p,g)=>Be(p)-Be(g))[0]}function u(m){const p=e?s(m):a(m),g=t.map((y,w)=>({diff:f(y-p,0),index:w})).sort((y,w)=>Be(y.diff)-Be(w.diff)),{index:v}=g[0];return{index:v,distance:p}}function f(m,p){const g=[m,m+n,m-n];if(!e)return m;if(!p)return l(g);const v=g.filter(y=>el(y)===p);return v.length?l(v):Nt(g)-n}function c(m,p){const g=t[m]-i.get(),v=f(g,p);return{index:m,distance:v}}function h(m,p){const g=i.get()+m,{index:v,distance:y}=u(g),w=!e&&o(g);if(!p||w)return{index:v,distance:m};const A=t[v]-y,k=m+f(A,0);return{index:v,distance:k}}return{byDistance:h,byIndex:c,shortcut:f}}function mI(e,t,n,r,i,o,s){function a(c){const h=c.distance,d=c.index!==t.get();o.add(h),h&&(r.duration()?e.start():(e.update(),e.render(1),e.update())),d&&(n.set(t.get()),t.set(c.index),s.emit("select"))}function l(c,h){const d=i.byDistance(c,h);a(d)}function u(c,h){const d=t.clone().set(c),m=i.byIndex(d.get(),h);a(m)}return{distance:l,index:u}}function gI(e,t,n,r,i,o,s,a){const l={passive:!0,capture:!0};let u=0;function f(d){if(!a)return;function m(p){if(new Date().getTime()-u>10)return;s.emit("slideFocusStart"),e.scrollLeft=0;const y=n.findIndex(w=>w.includes(p));Ja(y)&&(i.useDuration(0),r.index(y,0),s.emit("slideFocus"))}o.add(document,"keydown",c,!1),t.forEach((p,g)=>{o.add(p,"focus",v=>{(oo(a)||a(d,v))&&m(g)},l)})}function c(d){d.code==="Tab"&&(u=new Date().getTime())}return{init:f}}function ei(e){let t=e;function n(){return t}function r(l){t=s(l)}function i(l){t+=s(l)}function o(l){t-=s(l)}function s(l){return Ja(l)?l:l.get()}return{get:n,set:r,add:i,subtract:o}}function em(e,t){const n=e.scroll==="x"?s:a,r=t.style;let i=null,o=!1;function s(h){return`translate3d(${h}px,0px,0px)`}function a(h){return`translate3d(0px,${h}px,0px)`}function l(h){if(o)return;const d=ZT(e.direction(h));d!==i&&(r.transform=n(d),i=d)}function u(h){o=!h}function f(){o||(r.transform="",t.getAttribute("style")||t.removeAttribute("style"))}return{clear:f,to:l,toggleActive:u}}function yI(e,t,n,r,i,o,s,a,l){const f=Qr(i),c=Qr(i).reverse(),h=v().concat(y());function d(I,M){return I.reduce((L,T)=>L-i[T],M)}function m(I,M){return I.reduce((L,T)=>d(L,M)>0?L.concat([T]):L,[])}function p(I){return o.map((M,L)=>({start:M-r[L]+.5+I,end:M+t-.5+I}))}function g(I,M,L){const T=p(M);return I.map(O=>{const H=L?0:-n,P=L?n:0,F=L?"end":"start",_=T[O][F];return{index:O,loopPoint:_,slideLocation:ei(-1),translate:em(e,l[O]),target:()=>a.get()>_?H:P}})}function v(){const I=s[0],M=m(c,I);return g(M,n,!1)}function y(){const I=t-s[0]-1,M=m(f,I);return g(M,-n,!0)}function w(){return h.every(({index:I})=>{const M=f.filter(L=>L!==I);return d(M,t)<=.1})}function A(){h.forEach(I=>{const{target:M,translate:L,slideLocation:T}=I,O=M();O!==T.get()&&(L.to(O),T.set(O))})}function k(){h.forEach(I=>I.translate.clear())}return{canLoop:w,clear:k,loop:A,loopPoints:h}}function vI(e,t,n){let r,i=!1;function o(l){if(!n)return;function u(f){for(const c of f)if(c.type==="childList"){l.reInit(),t.emit("slidesChanged");break}}r=new MutationObserver(f=>{i||(oo(n)||n(l,f))&&u(f)}),r.observe(e,{childList:!0})}function s(){r&&r.disconnect(),i=!0}return{init:o,destroy:s}}function bI(e,t,n,r){const i={};let o=null,s=null,a,l=!1;function u(){a=new IntersectionObserver(m=>{l||(m.forEach(p=>{const g=t.indexOf(p.target);i[g]=p}),o=null,s=null,n.emit("slidesInView"))},{root:e.parentElement,threshold:r}),t.forEach(m=>a.observe(m))}function f(){a&&a.disconnect(),l=!0}function c(m){return Jr(i).reduce((p,g)=>{const v=parseInt(g),{isIntersecting:y}=i[v];return(m&&y||!m&&!y)&&p.push(v),p},[])}function h(m=!0){if(m&&o)return o;if(!m&&s)return s;const p=c(m);return m&&(o=p),m||(s=p),p}return{init:u,destroy:f,get:h}}function wI(e,t,n,r,i,o){const{measureSize:s,startEdge:a,endEdge:l}=e,u=n[0]&&i,f=m(),c=p(),h=n.map(s),d=g();function m(){if(!u)return 0;const y=n[0];return Be(t[a]-y[a])}function p(){if(!u)return 0;const y=o.getComputedStyle(Nt(r));return parseFloat(y.getPropertyValue(`margin-${l}`))}function g(){return n.map((y,w,A)=>{const k=!w,E=tl(A,w);return k?h[w]+f:E?h[w]+c:A[w+1][a]-y[a]}).map(Be)}return{slideSizes:h,slideSizesWithGaps:d,startGap:f,endGap:c}}function SI(e,t,n,r,i,o,s,a,l){const{startEdge:u,endEdge:f,direction:c}=e,h=Ja(n);function d(v,y){return Qr(v).filter(w=>w%y===0).map(w=>v.slice(w,w+y))}function m(v){return v.length?Qr(v).reduce((y,w,A)=>{const k=Nt(y)||0,E=k===0,I=w===Zr(v),M=i[u]-o[k][u],L=i[u]-o[w][f],T=!r&&E?c(s):0,O=!r&&I?c(a):0,H=Be(L-O-(M+T));return A&&H>t+l&&y.push(w),I&&y.push(v.length),y},[]).map((y,w,A)=>{const k=Math.max(A[w-1]||0);return v.slice(k,y)}):[]}function p(v){return h?d(v,n):m(v)}return{groupSlides:p}}function kI(e,t,n,r,i,o,s){const{align:a,axis:l,direction:u,startIndex:f,loop:c,duration:h,dragFree:d,dragThreshold:m,inViewThreshold:p,slidesToScroll:g,skipSnaps:v,containScroll:y,watchResize:w,watchSlides:A,watchDrag:k,watchFocus:E}=o,I=2,M=rI(),L=M.measure(t),T=n.map(M.measure),O=eI(l,u),H=O.measureSize(L),P=iI(H),F=JT(a,H),_=!c&&!!y,z=c||!!y,{slideSizes:$,slideSizesWithGaps:U,startGap:W,endGap:b}=wI(O,L,T,n,z,i),N=SI(O,H,g,c,L,T,W,b,I),{snaps:R,snapsAligned:S}=dI(O,F,L,T,N),V=-Nt(R)+Nt(U),{snapsContained:ee,scrollContainLimit:Y}=lI(H,V,S,y,I),G=_?ee:S,{limit:J}=uI(V,G,c),se=Xp(Zr(G),f,c),K=se.clone(),re=Qr(n),B=({dragHandler:he,scrollBody:je,scrollBounds:Qe,options:{loop:Je}})=>{Je||Qe.constrain(he.pointerDown()),je.seek()},ne=({scrollBody:he,translate:je,location:Qe,offsetLocation:Je,previousLocation:Ct,scrollLooper:Bt,slideLooper:Ze,dragHandler:At,animation:lt,eventHandler:ts,scrollBounds:F2,options:{loop:Qv}},Zv)=>{const Jv=he.settled(),R2=!F2.shouldConstrain(),Xv=Qv?Jv:Jv&&R2,eb=Xv&&!At.pointerDown();eb&&lt.stop();const B2=Qe.get()*Zv+Ct.get()*(1-Zv);Je.set(B2),Qv&&(Bt.loop(he.direction()),Ze.loop()),je.to(Je.get()),eb&&ts.emit("settle"),Xv||ts.emit("scroll")},me=XT(r,i,()=>B(le),he=>ne(le,he)),we=.68,Q=G[se.get()],ue=ei(Q),de=ei(Q),fe=ei(Q),Te=ei(Q),Fe=sI(ue,fe,de,Te,h,we),De=pI(c,G,V,J,Te),Ue=mI(me,se,K,Fe,De,Te,s),te=fI(J),ae=Xr(),j=bI(t,n,s,p),{slideRegistry:q}=hI(_,y,G,Y,N,re),oe=gI(e,n,q,Ue,Fe,ae,s,E),le={ownerDocument:r,ownerWindow:i,eventHandler:s,containerRect:L,slideRects:T,animation:me,axis:O,dragHandler:tI(O,e,r,i,Te,nI(O,i),ue,me,Ue,Fe,De,se,s,P,d,m,v,we,k),eventStore:ae,percentOfView:P,index:se,indexPrevious:K,limit:J,location:ue,offsetLocation:fe,previousLocation:de,options:o,resizeHandler:oI(t,s,i,n,O,w,M),scrollBody:Fe,scrollBounds:aI(J,fe,Te,Fe,P),scrollLooper:cI(V,J,fe,[ue,fe,de,Te]),scrollProgress:te,scrollSnapList:G.map(te.get),scrollSnaps:G,scrollTarget:De,scrollTo:Ue,slideLooper:yI(O,H,V,$,U,R,G,fe,n),slideFocus:oe,slidesHandler:vI(t,s,A),slidesInView:j,slideIndexes:re,slideRegistry:q,slidesToScroll:N,target:Te,translate:em(O,t)};return le}function xI(){let e={},t;function n(u){t=u}function r(u){return e[u]||[]}function i(u){return r(u).forEach(f=>f(t,u)),l}function o(u,f){return e[u]=r(u).concat([f]),l}function s(u,f){return e[u]=r(u).filter(c=>c!==f),l}function a(){e={}}const l={init:n,emit:i,off:s,on:o,clear:a};return l}const EI={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function CI(e){function t(o,s){return Jp(o,s||{})}function n(o){const s=o.breakpoints||{},a=Jr(s).filter(l=>e.matchMedia(l).matches).map(l=>s[l]).reduce((l,u)=>t(l,u),{});return t(o,a)}function r(o){return o.map(s=>Jr(s.breakpoints||{})).reduce((s,a)=>s.concat(a),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:n,optionsMediaQueries:r}}function AI(e){let t=[];function n(o,s){return t=s.filter(({options:a})=>e.optionsAtMedia(a).active!==!1),t.forEach(a=>a.init(o,e)),s.reduce((a,l)=>Object.assign(a,{[l.name]:l}),{})}function r(){t=t.filter(o=>o.destroy())}return{init:n,destroy:r}}function so(e,t,n){const r=e.ownerDocument,i=r.defaultView,o=CI(i),s=AI(o),a=Xr(),l=xI(),{mergeOptions:u,optionsAtMedia:f,optionsMediaQueries:c}=o,{on:h,off:d,emit:m}=l,p=O;let g=!1,v,y=u(EI,so.globalOptions),w=u(y),A=[],k,E,I;function M(){const{container:re,slides:B}=w;E=(Xa(re)?e.querySelector(re):re)||e.children[0];const me=Xa(B)?E.querySelectorAll(B):B;I=[].slice.call(me||E.children)}function L(re){const B=kI(e,E,I,r,i,re,l);if(re.loop&&!B.slideLooper.canLoop()){const ne=Object.assign({},re,{loop:!1});return L(ne)}return B}function T(re,B){g||(y=u(y,re),w=f(y),A=B||A,M(),v=L(w),c([y,...A.map(({options:ne})=>ne)]).forEach(ne=>a.add(ne,"change",O)),w.active&&(v.translate.to(v.location.get()),v.animation.init(),v.slidesInView.init(),v.slideFocus.init(K),v.eventHandler.init(K),v.resizeHandler.init(K),v.slidesHandler.init(K),v.options.loop&&v.slideLooper.loop(),E.offsetParent&&I.length&&v.dragHandler.init(K),k=s.init(K,A)))}function O(re,B){const ne=N();H(),T(u({startIndex:ne},re),B),l.emit("reInit")}function H(){v.dragHandler.destroy(),v.eventStore.clear(),v.translate.clear(),v.slideLooper.clear(),v.resizeHandler.destroy(),v.slidesHandler.destroy(),v.slidesInView.destroy(),v.animation.destroy(),s.destroy(),a.clear()}function P(){g||(g=!0,a.clear(),H(),l.emit("destroy"),l.clear())}function F(re,B,ne){!w.active||g||(v.scrollBody.useBaseFriction().useDuration(B===!0?0:w.duration),v.scrollTo.index(re,ne||0))}function _(re){const B=v.index.add(1).get();F(B,re,-1)}function z(re){const B=v.index.add(-1).get();F(B,re,1)}function $(){return v.index.add(1).get()!==N()}function U(){return v.index.add(-1).get()!==N()}function W(){return v.scrollSnapList}function b(){return v.scrollProgress.get(v.offsetLocation.get())}function N(){return v.index.get()}function R(){return v.indexPrevious.get()}function S(){return v.slidesInView.get()}function V(){return v.slidesInView.get(!1)}function ee(){return k}function Y(){return v}function G(){return e}function J(){return E}function se(){return I}const K={canScrollNext:$,canScrollPrev:U,containerNode:J,internalEngine:Y,destroy:P,off:d,on:h,emit:m,plugins:ee,previousScrollSnap:R,reInit:p,rootNode:G,scrollNext:_,scrollPrev:z,scrollProgress:b,scrollSnapList:W,scrollTo:F,selectedScrollSnap:N,slideNodes:se,slidesInView:S,slidesNotInView:V};return T(t,n),setTimeout(()=>l.emit("init"),0),K}so.globalOptions=void 0;function rl(e={},t=[]){const n=D.useRef(e),r=D.useRef(t),[i,o]=D.useState(),[s,a]=D.useState(),l=D.useCallback(()=>{i&&i.reInit(n.current,r.current)},[i]);return D.useEffect(()=>{Za(n.current,e)||(n.current=e,l())},[e,l]),D.useEffect(()=>{GT(r.current,t)||(r.current=t,l())},[t,l]),D.useEffect(()=>{if(KT()&&s){so.globalOptions=rl.globalOptions;const u=so(s,n.current,r.current);return o(u),()=>u.destroy()}else o(void 0)},[s,o]),[a,i]}rl.globalOptions=void 0;const tm=D.forwardRef(({blocks:e,direction:t,sender:n,timestamp:r,messageId:i,isReadOnly:o,sendMessage:s},a)=>{const[l,u]=rl({skipSnaps:!0,loop:!0}),[f,c]=D.useState(!0),[h,d]=D.useState(!0),m=D.useCallback(()=>u==null?void 0:u.scrollPrev(),[u]),p=D.useCallback(()=>u==null?void 0:u.scrollNext(),[u]),{message:{blocks:{carousel:g}}}=ye,v=D.useCallback(y=>{c(!(y!=null&&y.canScrollPrev())),d(!(y!=null&&y.canScrollNext()))},[]);return D.useEffect(()=>{u&&(v(u),u.on("reInit",v),u.on("select",v))},[u,v]),x.jsxs("div",{...g==null?void 0:g.container,"data-container":"carousel",ref:l,children:[x.jsx("div",{ref:a,...g==null?void 0:g.slidesContainer,children:e.map((y,w)=>x.jsx(Nn,{block:{...y,direction:t,timestamp:r,sender:n,messageId:i,sendMessage:s,isReadOnly:o}},w))}),e.length>1&&x.jsxs(x.Fragment,{children:[x.jsx(pp,{...g==null?void 0:g.backButton,"data-disabled":f?"":void 0,onClick:m}),x.jsx(mp,{...g==null?void 0:g.nextButton,"data-disabled":h?"":void 0,onClick:p})]})]})});tm.displayName="Carousel";const nm=Math.floor;function rm(e){return im(e)?(e.nodeName||"").toLowerCase():"#document"}function ti(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function TI(e){var t;return(t=(im(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function im(e){return e instanceof Node||e instanceof ti(e).Node}function Et(e){return e instanceof Element||e instanceof ti(e).Element}function tr(e){return e instanceof HTMLElement||e instanceof ti(e).HTMLElement}function il(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ti(e).ShadowRoot}function II(e){return["html","body","#document"].includes(rm(e))}function OI(e){return ti(e).getComputedStyle(e)}function DI(e){if(rm(e)==="html")return e;const t=e.assignedSlot||e.parentNode||il(e)&&e.host||TI(e);return il(t)?t.host:t}function cn(e){let t=e.activeElement;for(;((n=t)==null||(r=n.shadowRoot)==null?void 0:r.activeElement)!=null;){var n,r;t=t.shadowRoot.activeElement}return t}function dt(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&il(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function om(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function MI(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function sm(e){if(e.mozInputSource===0&&e.isTrusted)return!0;const t=/Android/i;return(t.test(om())||t.test(MI()))&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function am(e){return e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType!=="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0}function lm(){return/apple/i.test(navigator.vendor)}function NI(){return om().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function um(e,t){return["mouse","pen"].includes(e)}function LI(e){return"nativeEvent"in e}function _I(e){return e.matches("html,body")}function Lt(e){return(e==null?void 0:e.ownerDocument)||document}function ol(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function cm(e){return"composedPath"in e?e.composedPath()[0]:e.target}const PI="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function fm(e){return tr(e)&&e.matches(PI)}function Xe(e){e.preventDefault(),e.stopPropagation()}const nr=Math.min,yt=Math.max,ao=Math.round,lo=Math.floor,Ht=e=>({x:e,y:e});function dm(e,t,n){return yt(e,nr(t,n))}function uo(e,t){return typeof e=="function"?e(t):e}function ni(e){return e.split("-")[0]}function sl(e){return e.split("-")[1]}function hm(e){return e==="x"?"y":"x"}function FI(e){return e==="y"?"height":"width"}const RI=new Set(["top","bottom"]);function ri(e){return RI.has(ni(e))?"y":"x"}function BI(e){return hm(ri(e))}function $I(e){return{top:0,right:0,bottom:0,left:0,...e}}function zI(e){return typeof e!="number"?$I(e):{top:e,right:e,bottom:e,left:e}}function co(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function pm(e,t,n){let{reference:r,floating:i}=e;const o=ri(t),s=BI(t),a=FI(s),l=ni(t),u=o==="y",f=r.x+r.width/2-i.width/2,c=r.y+r.height/2-i.height/2,h=r[a]/2-i[a]/2;let d;switch(l){case"top":d={x:f,y:r.y-i.height};break;case"bottom":d={x:f,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:c};break;case"left":d={x:r.x-i.width,y:c};break;default:d={x:r.x,y:r.y}}switch(sl(t)){case"start":d[s]-=h*(n&&u?-1:1);break;case"end":d[s]+=h*(n&&u?-1:1);break}return d}const HI=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:f,y:c}=pm(u,r,l),h=r,d={},m=0;for(let p=0;p<a.length;p++){const{name:g,fn:v}=a[p],{x:y,y:w,data:A,reset:k}=await v({x:f,y:c,initialPlacement:r,placement:h,strategy:i,middlewareData:d,rects:u,platform:s,elements:{reference:e,floating:t}});f=y??f,c=w??c,d={...d,[g]:{...d[g],...A}},k&&m<=50&&(m++,typeof k=="object"&&(k.placement&&(h=k.placement),k.rects&&(u=k.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):k.rects),{x:f,y:c}=pm(u,h,l)),p=-1)}return{x:f,y:c,placement:h,strategy:i,middlewareData:d}};async function mm(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:c="floating",altBoundary:h=!1,padding:d=0}=uo(t,e),m=zI(d),g=a[h?c==="floating"?"reference":"floating":c],v=co(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(g)))==null||n?g:g.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:u,rootBoundary:f,strategy:l})),y=c==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,w=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),A=await(o.isElement==null?void 0:o.isElement(w))?await(o.getScale==null?void 0:o.getScale(w))||{x:1,y:1}:{x:1,y:1},k=co(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:w,strategy:l}):y);return{top:(v.top-k.top+m.top)/A.y,bottom:(k.bottom-v.bottom+m.bottom)/A.y,left:(v.left-k.left+m.left)/A.x,right:(k.right-v.right+m.right)/A.x}}const UI=new Set(["left","top"]);async function jI(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=ni(n),a=sl(n),l=ri(n)==="y",u=UI.has(s)?-1:1,f=o&&l?-1:1,c=uo(t,e);let{mainAxis:h,crossAxis:d,alignmentAxis:m}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:c.mainAxis||0,crossAxis:c.crossAxis||0,alignmentAxis:c.alignmentAxis};return a&&typeof m=="number"&&(d=a==="end"?m*-1:m),l?{x:d*f,y:h*u}:{x:h*u,y:d*f}}const VI=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:s,middlewareData:a}=t,l=await jI(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:s}}}}},WI=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:g=>{let{x:v,y}=g;return{x:v,y}}},...l}=uo(e,t),u={x:n,y:r},f=await mm(t,l),c=ri(ni(i)),h=hm(c);let d=u[h],m=u[c];if(o){const g=h==="y"?"top":"left",v=h==="y"?"bottom":"right",y=d+f[g],w=d-f[v];d=dm(y,d,w)}if(s){const g=c==="y"?"top":"left",v=c==="y"?"bottom":"right",y=m+f[g],w=m-f[v];m=dm(y,m,w)}const p=a.fn({...t,[h]:d,[c]:m});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[h]:o,[c]:s}}}}}},qI=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:s,elements:a}=t,{apply:l=()=>{},...u}=uo(e,t),f=await mm(t,u),c=ni(i),h=sl(i),d=ri(i)==="y",{width:m,height:p}=o.floating;let g,v;c==="top"||c==="bottom"?(g=c,v=h===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(v=c,g=h==="end"?"top":"bottom");const y=p-f.top-f.bottom,w=m-f.left-f.right,A=nr(p-f[g],y),k=nr(m-f[v],w),E=!t.middlewareData.shift;let I=A,M=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(I=y),E&&!h){const T=yt(f.left,0),O=yt(f.right,0),H=yt(f.top,0),P=yt(f.bottom,0);d?M=m-2*(T!==0||O!==0?T+O:yt(f.left,f.right)):I=p-2*(H!==0||P!==0?H+P:yt(f.top,f.bottom))}await l({...t,availableWidth:M,availableHeight:I});const L=await s.getDimensions(a.floating);return m!==L.width||p!==L.height?{reset:{rects:!0}}:{}}}};function fo(){return typeof window<"u"}function rr(e){return gm(e)?(e.nodeName||"").toLowerCase():"#document"}function vt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ut(e){var t;return(t=(gm(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function gm(e){return fo()?e instanceof Node||e instanceof vt(e).Node:!1}function _t(e){return fo()?e instanceof Element||e instanceof vt(e).Element:!1}function jt(e){return fo()?e instanceof HTMLElement||e instanceof vt(e).HTMLElement:!1}function ym(e){return!fo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof vt(e).ShadowRoot}const YI=new Set(["inline","contents"]);function ii(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Pt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!YI.has(i)}const KI=new Set(["table","td","th"]);function GI(e){return KI.has(rr(e))}const QI=[":popover-open",":modal"];function ho(e){return QI.some(t=>{try{return e.matches(t)}catch{return!1}})}const ZI=["transform","translate","scale","rotate","perspective"],JI=["transform","translate","scale","rotate","perspective","filter"],XI=["paint","layout","strict","content"];function al(e){const t=ll(),n=_t(e)?Pt(e):e;return ZI.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||JI.some(r=>(n.willChange||"").includes(r))||XI.some(r=>(n.contain||"").includes(r))}function eO(e){let t=fn(e);for(;jt(t)&&!ir(t);){if(al(t))return t;if(ho(t))return null;t=fn(t)}return null}function ll(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const tO=new Set(["html","body","#document"]);function ir(e){return tO.has(rr(e))}function Pt(e){return vt(e).getComputedStyle(e)}function po(e){return _t(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function fn(e){if(rr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ym(e)&&e.host||Ut(e);return ym(t)?t.host:t}function vm(e){const t=fn(e);return ir(t)?e.ownerDocument?e.ownerDocument.body:e.body:jt(t)&&ii(t)?t:vm(t)}function dn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=vm(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=vt(i);if(o){const a=ul(s);return t.concat(s,s.visualViewport||[],ii(i)?i:[],a&&n?dn(a):[])}return t.concat(i,dn(i,[],n))}function ul(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function bm(e){const t=Pt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=jt(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=ao(n)!==o||ao(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function cl(e){return _t(e)?e:e.contextElement}function or(e){const t=cl(e);if(!jt(t))return Ht(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=bm(t);let s=(o?ao(n.width):n.width)/r,a=(o?ao(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const nO=Ht(0);function wm(e){const t=vt(e);return!ll()||!t.visualViewport?nO:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function rO(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==vt(e)?!1:t}function Mn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=cl(e);let s=Ht(1);t&&(r?_t(r)&&(s=or(r)):s=or(e));const a=rO(o,n,r)?wm(o):Ht(0);let l=(i.left+a.x)/s.x,u=(i.top+a.y)/s.y,f=i.width/s.x,c=i.height/s.y;if(o){const h=vt(o),d=r&&_t(r)?vt(r):r;let m=h,p=ul(m);for(;p&&r&&d!==m;){const g=or(p),v=p.getBoundingClientRect(),y=Pt(p),w=v.left+(p.clientLeft+parseFloat(y.paddingLeft))*g.x,A=v.top+(p.clientTop+parseFloat(y.paddingTop))*g.y;l*=g.x,u*=g.y,f*=g.x,c*=g.y,l+=w,u+=A,m=vt(p),p=ul(m)}}return co({width:f,height:c,x:l,y:u})}function mo(e,t){const n=po(e).scrollLeft;return t?t.left+n:Mn(Ut(e)).left+n}function Sm(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-mo(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function iO(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",s=Ut(r),a=t?ho(t.floating):!1;if(r===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},u=Ht(1);const f=Ht(0),c=jt(r);if((c||!c&&!o)&&((rr(r)!=="body"||ii(s))&&(l=po(r)),jt(r))){const d=Mn(r);u=or(r),f.x=d.x+r.clientLeft,f.y=d.y+r.clientTop}const h=s&&!c&&!o?Sm(s,l):Ht(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+f.x+h.x,y:n.y*u.y-l.scrollTop*u.y+f.y+h.y}}function oO(e){return Array.from(e.getClientRects())}function sO(e){const t=Ut(e),n=po(e),r=e.ownerDocument.body,i=yt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=yt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+mo(e);const a=-n.scrollTop;return Pt(r).direction==="rtl"&&(s+=yt(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}const km=25;function aO(e,t){const n=vt(e),r=Ut(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;const f=ll();(!f||f&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const u=mo(r);if(u<=0){const f=r.ownerDocument,c=f.body,h=getComputedStyle(c),d=f.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,m=Math.abs(r.clientWidth-c.clientWidth-d);m<=km&&(o-=m)}else u<=km&&(o+=u);return{width:o,height:s,x:a,y:l}}const lO=new Set(["absolute","fixed"]);function uO(e,t){const n=Mn(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=jt(e)?or(e):Ht(1),s=e.clientWidth*o.x,a=e.clientHeight*o.y,l=i*o.x,u=r*o.y;return{width:s,height:a,x:l,y:u}}function xm(e,t,n){let r;if(t==="viewport")r=aO(e,n);else if(t==="document")r=sO(Ut(e));else if(_t(t))r=uO(t,n);else{const i=wm(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return co(r)}function Em(e,t){const n=fn(e);return n===t||!_t(n)||ir(n)?!1:Pt(n).position==="fixed"||Em(n,t)}function cO(e,t){const n=t.get(e);if(n)return n;let r=dn(e,[],!1).filter(a=>_t(a)&&rr(a)!=="body"),i=null;const o=Pt(e).position==="fixed";let s=o?fn(e):e;for(;_t(s)&&!ir(s);){const a=Pt(s),l=al(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&lO.has(i.position)||ii(s)&&!l&&Em(e,s))?r=r.filter(f=>f!==s):i=a,s=fn(s)}return t.set(e,r),r}function fO(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?ho(t)?[]:cO(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((u,f)=>{const c=xm(t,f,i);return u.top=yt(c.top,u.top),u.right=nr(c.right,u.right),u.bottom=nr(c.bottom,u.bottom),u.left=yt(c.left,u.left),u},xm(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function dO(e){const{width:t,height:n}=bm(e);return{width:t,height:n}}function hO(e,t,n){const r=jt(t),i=Ut(t),o=n==="fixed",s=Mn(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=Ht(0);function u(){l.x=mo(i)}if(r||!r&&!o)if((rr(t)!=="body"||ii(i))&&(a=po(t)),r){const d=Mn(t,!0,o,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else i&&u();o&&!r&&i&&u();const f=i&&!r&&!o?Sm(i,a):Ht(0),c=s.left+a.scrollLeft-l.x-f.x,h=s.top+a.scrollTop-l.y-f.y;return{x:c,y:h,width:s.width,height:s.height}}function fl(e){return Pt(e).position==="static"}function Cm(e,t){if(!jt(e)||Pt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ut(e)===n&&(n=n.ownerDocument.body),n}function Am(e,t){const n=vt(e);if(ho(e))return n;if(!jt(e)){let i=fn(e);for(;i&&!ir(i);){if(_t(i)&&!fl(i))return i;i=fn(i)}return n}let r=Cm(e,t);for(;r&&GI(r)&&fl(r);)r=Cm(r,t);return r&&ir(r)&&fl(r)&&!al(r)?n:r||eO(e)||n}const pO=async function(e){const t=this.getOffsetParent||Am,n=this.getDimensions,r=await n(e.floating);return{reference:hO(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function mO(e){return Pt(e).direction==="rtl"}const gO={convertOffsetParentRelativeRectToViewportRelativeRect:iO,getDocumentElement:Ut,getClippingRect:fO,getOffsetParent:Am,getElementRects:pO,getClientRects:oO,getDimensions:dO,getScale:or,isElement:_t,isRTL:mO};function Tm(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function yO(e,t){let n=null,r;const i=Ut(e);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const u=e.getBoundingClientRect(),{left:f,top:c,width:h,height:d}=u;if(a||t(),!h||!d)return;const m=lo(c),p=lo(i.clientWidth-(f+h)),g=lo(i.clientHeight-(c+d)),v=lo(f),w={rootMargin:-m+"px "+-p+"px "+-g+"px "+-v+"px",threshold:yt(0,nr(1,l))||1};let A=!0;function k(E){const I=E[0].intersectionRatio;if(I!==l){if(!A)return s();I?s(!1,I):r=setTimeout(()=>{s(!1,1e-7)},1e3)}I===1&&!Tm(u,e.getBoundingClientRect())&&s(),A=!1}try{n=new IntersectionObserver(k,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(k,w)}n.observe(e)}return s(!0),o}function vO(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=cl(e),f=i||o?[...u?dn(u):[],...dn(t)]:[];f.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),o&&v.addEventListener("resize",n)});const c=u&&a?yO(u,n):null;let h=-1,d=null;s&&(d=new ResizeObserver(v=>{let[y]=v;y&&y.target===u&&d&&(d.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=d)==null||w.observe(t)})),n()}),u&&!l&&d.observe(u),d.observe(t));let m,p=l?Mn(e):null;l&&g();function g(){const v=Mn(e);p&&!Tm(p,v)&&n(),p=v,m=requestAnimationFrame(g)}return n(),()=>{var v;f.forEach(y=>{i&&y.removeEventListener("scroll",n),o&&y.removeEventListener("resize",n)}),c==null||c(),(v=d)==null||v.disconnect(),d=null,l&&cancelAnimationFrame(m)}}const bO=VI,wO=WI,SO=qI,kO=(e,t,n)=>{const r=new Map,i={platform:gO,...n},o={...i.platform,_c:r};return HI(e,t,{...i,platform:o})};var xO=typeof document<"u",EO=function(){},go=xO?D.useLayoutEffect:EO;function yo(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!yo(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!yo(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Im(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Om(e,t){const n=Im(e);return Math.round(t*n)/n}function dl(e){const t=C.useRef(e);return go(()=>{t.current=e}),t}function CO(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[f,c]=C.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,d]=C.useState(r);yo(h,r)||d(r);const[m,p]=C.useState(null),[g,v]=C.useState(null),y=C.useCallback(U=>{U!==E.current&&(E.current=U,p(U))},[]),w=C.useCallback(U=>{U!==I.current&&(I.current=U,v(U))},[]),A=o||m,k=s||g,E=C.useRef(null),I=C.useRef(null),M=C.useRef(f),L=l!=null,T=dl(l),O=dl(i),H=dl(u),P=C.useCallback(()=>{if(!E.current||!I.current)return;const U={placement:t,strategy:n,middleware:h};O.current&&(U.platform=O.current),kO(E.current,I.current,U).then(W=>{const b={...W,isPositioned:H.current!==!1};F.current&&!yo(M.current,b)&&(M.current=b,Hu.flushSync(()=>{c(b)}))})},[h,t,n,O,H]);go(()=>{u===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,c(U=>({...U,isPositioned:!1})))},[u]);const F=C.useRef(!1);go(()=>(F.current=!0,()=>{F.current=!1}),[]),go(()=>{if(A&&(E.current=A),k&&(I.current=k),A&&k){if(T.current)return T.current(A,k,P);P()}},[A,k,P,T,L]);const _=C.useMemo(()=>({reference:E,floating:I,setReference:y,setFloating:w}),[y,w]),z=C.useMemo(()=>({reference:A,floating:k}),[A,k]),$=C.useMemo(()=>{const U={position:n,left:0,top:0};if(!z.floating)return U;const W=Om(z.floating,f.x),b=Om(z.floating,f.y);return a?{...U,transform:"translate("+W+"px, "+b+"px)",...Im(z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:W,top:b}},[n,a,z.floating,f.x,f.y]);return C.useMemo(()=>({...f,update:P,refs:_,elements:z,floatingStyles:$}),[f,P,_,z,$])}const AO=(e,t)=>({...bO(e),options:[e,t]}),TO=(e,t)=>({...wO(e),options:[e,t]}),IO=(e,t)=>({...SO(e),options:[e,t]});/*!
285
+ `);const v=y.state[a];if(v==null)return;JSON.stringify(i.getState())!==JSON.stringify(v)&&d(v);return}i.dispatchFromDevtools&&typeof i.dispatch=="function"&&i.dispatch(y)});case"DISPATCH":switch(p.payload.type){case"RESET":return d(m),a===void 0?f==null?void 0:f.init(i.getState()):f==null?void 0:f.init(no(l.name));case"COMMIT":if(a===void 0){f==null||f.init(i.getState());return}return f==null?void 0:f.init(no(l.name));case"ROLLBACK":return Ba(p.state,y=>{if(a===void 0){d(y),f==null||f.init(i.getState());return}d(y[a]),f==null||f.init(no(l.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return Ba(p.state,y=>{if(a===void 0){d(y);return}JSON.stringify(i.getState())!==JSON.stringify(y[a])&&d(y[a])});case"IMPORT_STATE":{const{nextLiftedState:y}=p.payload,v=(g=y.computedStates.slice(-1)[0])==null?void 0:g.state;if(!v)return;d(a===void 0?v:v[a]),f==null||f.send(null,y);return}case"PAUSE_RECORDING":return h=!h}return}}),m},Ba=(e,t)=>{let n;try{n=JSON.parse(e)}catch(r){console.error("[zustand devtools middleware] Could not parse the received json",r)}n!==void 0&&t(n)};function ro(e,t){let n;try{n=e()}catch{return}return{getItem:i=>{var o;const s=l=>l===null?null:JSON.parse(l,void 0),a=(o=n.getItem(i))!=null?o:null;return a instanceof Promise?a.then(s):s(a)},setItem:(i,o)=>n.setItem(i,JSON.stringify(o,void 0)),removeItem:i=>n.removeItem(i)}}const Kr=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Kr(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Kr(r)(n)}}}},NT=(e,t)=>(n,r,i)=>{let o={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:g=>g,version:0,merge:(g,y)=>({...y,...g}),...t},s=!1;const a=new Set,l=new Set;let u;try{u=o.getStorage()}catch{}if(!u)return e((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...g)},r,i);const f=Kr(o.serialize),c=()=>{const g=o.partialize({...r()});let y;const v=f({state:g,version:o.version}).then(w=>u.setItem(o.name,w)).catch(w=>{y=w});if(y)throw y;return v},h=i.setState;i.setState=(g,y)=>{h(g,y),c()};const d=e((...g)=>{n(...g),c()},r,i);let m;const p=()=>{var g;if(!u)return;s=!1,a.forEach(v=>v(r()));const y=((g=o.onRehydrateStorage)==null?void 0:g.call(o,r()))||void 0;return Kr(u.getItem.bind(u))(o.name).then(v=>{if(v)return o.deserialize(v)}).then(v=>{if(v)if(typeof v.version=="number"&&v.version!==o.version){if(o.migrate)return o.migrate(v.state,v.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return v.state}).then(v=>{var w;return m=o.merge(v,(w=r())!=null?w:d),n(m,!0),c()}).then(()=>{y==null||y(m,void 0),s=!0,l.forEach(v=>v(m))}).catch(v=>{y==null||y(void 0,v)})};return i.persist={setOptions:g=>{o={...o,...g},g.getStorage&&(u=g.getStorage())},clearStorage:()=>{u==null||u.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>p(),hasHydrated:()=>s,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(l.add(g),()=>{l.delete(g)})},p(),m||d},LT=(e,t)=>(n,r,i)=>{let o={storage:ro(()=>localStorage),partialize:p=>p,version:0,merge:(p,g)=>({...g,...p}),...t},s=!1;const a=new Set,l=new Set;let u=o.storage;if(!u)return e((...p)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...p)},r,i);const f=()=>{const p=o.partialize({...r()});return u.setItem(o.name,{state:p,version:o.version})},c=i.setState;i.setState=(p,g)=>{c(p,g),f()};const h=e((...p)=>{n(...p),f()},r,i);let d;const m=()=>{var p,g;if(!u)return;s=!1,a.forEach(v=>{var w;return v((w=r())!=null?w:h)});const y=((g=o.onRehydrateStorage)==null?void 0:g.call(o,(p=r())!=null?p:h))||void 0;return Kr(u.getItem.bind(u))(o.name).then(v=>{if(v)if(typeof v.version=="number"&&v.version!==o.version){if(o.migrate)return o.migrate(v.state,v.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return v.state}).then(v=>{var w;return d=o.merge(v,(w=r())!=null?w:h),n(d,!0),f()}).then(()=>{y==null||y(d,void 0),d=r(),s=!0,l.forEach(v=>v(d))}).catch(v=>{y==null||y(void 0,v)})};return i.persist={setOptions:p=>{o={...o,...p},p.storage&&(u=p.storage)},clearStorage:()=>{u==null||u.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>m(),hasHydrated:()=>s,onHydrate:p=>(a.add(p),()=>{a.delete(p)}),onFinishHydration:p=>(l.add(p),()=>{l.delete(p)})},o.skipHydration||m(),d||h},io=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?((to?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),NT(e,t)):LT(e,t),_T=(e,t)=>un()(Zn(io(n=>({messageHistory:[],addMessageToHistory:r=>n(i=>({...i,messageHistory:[r,...(i.messageHistory??[]).slice(0,100).filter(String)]})),clearHistory:()=>n(()=>({messageHistory:[]}))}),{name:e,storage:ro(()=>t==="sessionStorage"?sessionStorage:localStorage)}))),$a={},Dp=(e,t,n)=>{const i=`${t||"bp-webchat"}-message-history-${e}`;return $a[i]||($a[i]=_T(i,n)),$a[i]},PT=e=>un()(Zn(t=>({messages:[],setMessages:n=>t({messages:n}),saveMessage:n=>t(({messages:r})=>({messages:Mp(r,n)})),saveMessages:n=>{n.length&&t(({messages:r})=>({messages:n.reduce(Mp,r)}))},updateMessage:(n,r)=>t(({messages:i})=>({messages:i.map(o=>o.id===n?{...o,...r}:o)})),removeMessage:n=>t(({messages:r})=>({messages:r.filter(i=>i.id!==n)})),clearMessages:()=>t({messages:[]})}),{name:e}));function Mp(e,t){var i;const n=(i=t.metadata)==null?void 0:i.clientMessageId;let r=-1;return n&&(r=e.findIndex(o=>{var s;return((s=o.metadata)==null?void 0:s.clientMessageId)===n})),r===-1&&(r=e.findIndex(o=>o.id===t.id)),r!==-1?[...e.slice(0,r),{...e[r],...t},...e.slice(r+1)]:[...e,t]}const za={},Ha=e=>{const t=`messages-${e}`;return za[t]||(za[t]=PT(t)),za[t]},FT=(e,t)=>un()(Zn(io(n=>({setUser:r=>n(i=>({...i,user:r})),setConversationId:r=>n(i=>({...i,conversationId:r})),clearAll:()=>{n(r=>({...r,user:void 0,conversationId:void 0}))}}),{name:e,storage:ro(()=>t==="sessionStorage"?sessionStorage:localStorage)}))),Ua={},Np=(e="bp-webchat",t)=>{const n=`${e}-client`;return Ua[n]||(Ua[n]=FT(n,t)),Ua[n]},Jn=un()(Zn(e=>({eventEmitter:hc(),messageContainerRef:D.createRef(),setMessageContainerRef:t=>e({messageContainerRef:t}),portalContainer:null,setPortalContainer:t=>e({portalContainer:t})}),{name:"webchatStore"})),RT=8,BT=e=>un()(io((t,n)=>({files:[],setFiles:r=>t({files:r}),upsertFile:r=>t(({files:i})=>({files:i.some(a=>a.name===r.name)?i.map(a=>a.name===r.name?{...a,...r}:a):[...i,{...r}]})),uploadFile:async(r,i)=>{if(n().files.length===RT)return;const o=r.name.lastIndexOf("."),s=o>0&&o<r.name.length-1,a=s?r.name.substring(0,o):r.name,l=s?r.name.substring(o):"",u=K0(a,n().files,h=>h.name),f=u+l,c=new File([r],f,{type:r.type});n().upsertFile({name:u,type:"file",instance:c,status:"loading"});try{const{fileUrl:h,type:d,fileId:m}=await i(c);n().upsertFile({fileId:m,name:u,type:d,url:h,instance:c,status:"uploaded"})}catch{n().upsertFile({name:u,type:"file",instance:c,status:"error"})}},deleteFile:r=>t(({files:i})=>({files:i.filter(o=>o.name!=r)}))}),{name:e,storage:ro(()=>sessionStorage)})),ja={},Lp=(e,t)=>{const r=`${t||"bp-webchat"}-composer-files-${e}`;return ja[r]||(ja[r]=BT(r)),ja[r]},$T=e=>un()(Zn(t=>({participants:[],setParticipants:n=>t({participants:n}),addParticipant:n=>t(r=>({participants:[...r.participants,n]})),removeParticipant:n=>t(r=>({participants:r.participants.filter(i=>i.id!==n)})),clearParticipants:()=>t({participants:[]})}),{name:e})),Va={},Wa=e=>{const t=`participants-${e}`;return Va[t]||(Va[t]=$T(t)),Va[t]},zT=e=>un()(Zn(io((t,n)=>({soundOn:!0,setSoundEnabled:r=>t({soundOn:r}),toggleSound:()=>t({soundOn:!n().soundOn})}),{name:e}))),qa={},_p=(e="bp-webchat")=>{const t=`${e}-sound`;return qa[t]||(qa[t]=zT(t)),qa[t]},HT=({text:e,buttonValue:t,variant:n,groupId:r,reusable:i,sendMessage:o,isReadOnly:s,...a})=>{const l=Jn(w=>w.eventEmitter),[u,f]=D.useState(!1),[c,h]=D.useState(!1),[d,m]=D.useState(!1),{message:{blocks:{button:p}}}=ye;D.useEffect(()=>{if(r)return l.on(`button-group-${r}-click`,()=>{h(!0),i||m(!0)})},[l,r,i]);const y={...a,onClick:w=>{if((d||s)&&n==="link"){w.preventDefault();return}f(!0),i||m(!0),r&&l.emit(`button-group-${r}-click`),n!=="link"&&o&&(o==null||o({type:"text",text:e,value:t}))},"data-activated":u?"":void 0,"data-group-activated":c?"":void 0,"data-type":n,...p},v=d||s;return n==="link"?x.jsx("a",{...y,style:s?{pointerEvents:"none"}:void 0,href:t,target:"_blank",rel:"noopener noreferrer",children:e}):x.jsx("button",{...y,style:s?{pointerEvents:"none"}:void 0,disabled:v,children:e})},Ya=D.createContext(null);function Pp(){const e=D.useContext(Ya);if(!e)throw new Error("useMessageContext must be used within a Message");return e}const Ka=D.createContext({showInputModal:void 0});function Ga(){return D.useContext(Ka)}const Fp=D.createContext(Rn),Rp=Fp.Provider;function Ye(){return D.useContext(Fp)}const Bp=D.forwardRef(({block:e,direction:t,sender:n,timestamp:r,messageId:i,feedback:o,metadata:s,isReadOnly:a,sendMessage:l,addMessageFeedback:u,...f},c)=>{const{showInputModal:h}=Ga(),d=Ye(),{message:{blocks:{bubble:{container:m,feedbackContainer:p,feedbackIcon:g}}}}=ye;return t=="incoming"?x.jsxs("div",{"data-direction":"incoming","data-feedback":!!o,...f,...m,ref:c,children:[x.jsx(Nn,{block:{...e,direction:t,timestamp:r,sender:n,messageId:i,isReadOnly:a,metadata:s,sendMessage:l}}),u&&h&&e.type==="text"&&x.jsxs("div",{...p,children:[x.jsx(fT,{...g,"data-selected":o==="positive",onClick:()=>u(i,{value:"positive"})}),x.jsx(cT,{...g,"data-selected":o==="negative",onClick:async()=>{const y=await h({title:d["feedback.title"],description:d["feedback.description"],confirmButtonText:d["feedback.confirm"],cancelButtonText:d["feedback.cancel"],Content:UT});u(i,{value:"negative",comment:y})}})]})]}):x.jsx("div",{"data-direction":"outgoing",...f,...m,ref:c,children:x.jsx(Nn,{block:{...e,direction:t,timestamp:r,sender:n,messageId:i,isReadOnly:a,metadata:s,sendMessage:l,addMessageFeedback:u}})})});Bp.displayName="Bubble";const UT=({setValue:e})=>{const{modal:{dialog:{content:t}}}=ye,n=Ye();return x.jsx("textarea",{...t.textarea,placeholder:n["feedback.placeholder"],onChange:r=>e(r.target.value)})},$p=({className:e,...t})=>x.jsx("div",{"data-slot":"skeleton",className:`bpSkeleton ${e||""}`,...t});$p.displayName="Skeleton";var xt=function(){return xt=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},xt.apply(this,arguments)};function zp(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Xn(e,t,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(f){try{u(r.next(f))}catch(c){s(c)}}function l(f){try{u(r.throw(f))}catch(c){s(c)}}function u(f){f.done?o(f.value):i(f.value).then(a,l)}u((r=r.apply(e,t||[])).next())})}function er(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(f){return l([u,f])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1],o=u;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(u);break}o[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(f){u=[6,f],i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Hp(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],s;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o}function Qa(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;function jT(){var e=D.useRef(!1),t=D.useCallback(function(){return e.current},[]);return D.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),t}function VT(e,t,n){t===void 0&&(t=[]),n===void 0&&(n={loading:!1});var r=D.useRef(0),i=jT(),o=D.useState(n),s=o[0],a=o[1],l=D.useCallback(function(){for(var u=[],f=0;f<arguments.length;f++)u[f]=arguments[f];var c=++r.current;return s.loading||a(function(h){return xt(xt({},h),{loading:!0})}),e.apply(void 0,u).then(function(h){return i()&&c===r.current&&a({value:h,loading:!1}),h},function(h){return i()&&c===r.current&&a({error:h,loading:!1}),h})},t);return[s,l]}function WT(e,t){t===void 0&&(t=[]);var n=VT(e,t,{loading:!0}),r=n[0],i=n[1];return D.useEffect(function(){i()},[i]),r}const Up=D.forwardRef(({url:e,type:t,orientation:n="auto",...r},i)=>{const o=D.useId(),{setIsLoading:s}=Pp(),[a,l]=D.useState(n==="auto"?"square":n),[u,f]=D.useState("initial"),{message:{blocks:{image:c}}}=ye;return D.useLayoutEffect(()=>(s(h=>[...h,o]),()=>{s(h=>h.filter(d=>d!==o))}),[o,s]),WT(async()=>{if(!e)return;const h=new Image;try{const{width:d,height:m}=await bb(e);n==="auto"&&l(qT(d,m)),h.onload=()=>{f("loaded"),s(p=>p.filter(g=>g!==o))},h.onerror=()=>{f("error"),l("square"),s(p=>p.filter(g=>g!==o))},h.src=e,h.complete&&(h.naturalWidth>0?(f("loaded"),s(p=>p.filter(g=>g!==o))):(f("error"),l("square"),s(p=>p.filter(g=>g!==o))))}catch(d){console.error(d),f("error"),s(m=>m.filter(p=>p!==o))}return()=>{h.onload=null,h.onerror=null}},[e,o,s,n]),e?u==="error"?x.jsx("div",{"data-error":"true","data-orientation":a,...r,...c.image,ref:i,children:x.jsx(vp,{size:"25%",strokeWidth:"5%"})}):u==="initial"?x.jsx($p,{"data-orientation":a,...c.placeholder}):x.jsx("img",{"data-orientation":a,"data-loaded":u==="loaded",...r,...c.image,src:e,alt:"",ref:i}):null});Up.displayName="Image";function qT(e,t){const n={square:1,portrait:.75,landscape:1.3333333333333333},r=e/t;return Object.keys(n).reduce((o,s)=>Math.abs(n[s]-r)<Math.abs(n[o]-r)?s:o)}const jp=D.forwardRef(({url:e,isReadOnly:t,...n},r)=>{const{message:{blocks:{video:i}}}=ye,o=t?s=>{s.stopPropagation(),s.preventDefault()}:void 0;return x.jsx("div",{children:x.jsx("video",{...n,"data-chromatic":"ignore",controls:!0,onClick:o,src:e,...i,ref:r})})});jp.displayName="Video";const Vp=D.forwardRef(({url:e,isReadOnly:t,...n},r)=>{const{message:{blocks:{audio:i}}}=ye,o=t?s=>{s.stopPropagation(),s.preventDefault()}:void 0;return x.jsx("div",{children:x.jsx("audio",{...n,controls:!0,onClick:o,src:e,...i,ref:r})})});Vp.displayName="Audio";const Wp=D.forwardRef(({latitude:e,longitude:t,title:n,isReadOnly:r,...i},o)=>{const s=`https://www.google.com/maps/search/?api=1&query=${e},${t}`,{message:{blocks:{location:a}}}=ye;return x.jsxs("a",{...i,...a.container,style:r?{pointerEvents:"none"}:void 0,href:s,type:"_blank",rel:"noopener",ref:o,children:[x.jsx("p",{...a.title,children:n}),x.jsx(rT,{...a.icon})]})});Wp.displayName="Location";const qp=D.forwardRef(({blocks:e,horizontalAlignment:t,verticalAlignment:n,direction:r,sender:i,timestamp:o,messageId:s,isReadOnly:a,sendMessage:l,...u},f)=>{const{message:{blocks:{column:c}}}=ye;return x.jsx("div",{"data-horizontal":t,"data-vertical":n,...u,...c,ref:f,children:e.map((h,d)=>x.jsx(Nn,{block:{...h,direction:r,timestamp:o,sender:i,messageId:s,isReadOnly:a,sendMessage:l}},d))})});qp.displayName="Column";const Yp=D.forwardRef(({blocks:e,horizontalAlignment:t,verticalAlignment:n,direction:r,sender:i,timestamp:o,metadata:s,messageId:a,isReadOnly:l,sendMessage:u,...f},c)=>{const{message:{blocks:{row:h}}}=ye;return x.jsx("div",{"data-horizontal":t,"data-vertical":n,...f,...h,ref:c,children:e.map((d,m)=>x.jsx(Nn,{block:{...d,direction:r,timestamp:o,sender:i,messageId:a,isReadOnly:l,sendMessage:u}},m))})});Yp.displayName="Row";function YT(e){return Object.prototype.toString.call(e)==="[object Object]"}function Kp(e){return YT(e)||Array.isArray(e)}function KT(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Za(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;const i=JSON.stringify(Object.keys(e.breakpoints||{})),o=JSON.stringify(Object.keys(t.breakpoints||{}));return i!==o?!1:n.every(s=>{const a=e[s],l=t[s];return typeof a=="function"?`${a}`==`${l}`:!Kp(a)||!Kp(l)?a===l:Za(a,l)})}function Gp(e){return e.concat().sort((t,n)=>t.name>n.name?1:-1).map(t=>t.options)}function GT(e,t){if(e.length!==t.length)return!1;const n=Gp(e),r=Gp(t);return n.every((i,o)=>{const s=r[o];return Za(i,s)})}function Ja(e){return typeof e=="number"}function Xa(e){return typeof e=="string"}function oo(e){return typeof e=="boolean"}function Qp(e){return Object.prototype.toString.call(e)==="[object Object]"}function Be(e){return Math.abs(e)}function el(e){return Math.sign(e)}function Gr(e,t){return Be(e-t)}function QT(e,t){if(e===0||t===0||Be(e)<=Be(t))return 0;const n=Gr(Be(e),Be(t));return Be(n/e)}function ZT(e){return Math.round(e*100)/100}function Qr(e){return Jr(e).map(Number)}function Nt(e){return e[Zr(e)]}function Zr(e){return Math.max(0,e.length-1)}function tl(e,t){return t===Zr(e)}function Zp(e,t=0){return Array.from(Array(e),(n,r)=>t+r)}function Jr(e){return Object.keys(e)}function Jp(e,t){return[e,t].reduce((n,r)=>(Jr(r).forEach(i=>{const o=n[i],s=r[i],a=Qp(o)&&Qp(s);n[i]=a?Jp(o,s):s}),n),{})}function nl(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function JT(e,t){const n={start:r,center:i,end:o};function r(){return 0}function i(l){return o(l)/2}function o(l){return t-l}function s(l,u){return Xa(e)?n[e](l):e(t,l,u)}return{measure:s}}function Xr(){let e=[];function t(i,o,s,a={passive:!0}){let l;if("addEventListener"in i)i.addEventListener(o,s,a),l=()=>i.removeEventListener(o,s,a);else{const u=i;u.addListener(s),l=()=>u.removeListener(s)}return e.push(l),r}function n(){e=e.filter(i=>i())}const r={add:t,clear:n};return r}function XT(e,t,n,r){const i=Xr(),o=1e3/60;let s=null,a=0,l=0;function u(){i.add(e,"visibilitychange",()=>{e.hidden&&m()})}function f(){d(),i.clear()}function c(g){if(!l)return;s||(s=g,n(),n());const y=g-s;for(s=g,a+=y;a>=o;)n(),a-=o;const v=a/o;r(v),l&&(l=t.requestAnimationFrame(c))}function h(){l||(l=t.requestAnimationFrame(c))}function d(){t.cancelAnimationFrame(l),s=null,a=0,l=0}function m(){s=null,a=0}return{init:u,destroy:f,start:h,stop:d,update:n,render:r}}function eI(e,t){const n=t==="rtl",r=e==="y",i=r?"y":"x",o=r?"x":"y",s=!r&&n?-1:1,a=f(),l=c();function u(m){const{height:p,width:g}=m;return r?p:g}function f(){return r?"top":n?"right":"left"}function c(){return r?"bottom":n?"left":"right"}function h(m){return m*s}return{scroll:i,cross:o,startEdge:a,endEdge:l,measureSize:u,direction:h}}function Dn(e=0,t=0){const n=Be(e-t);function r(u){return u<e}function i(u){return u>t}function o(u){return r(u)||i(u)}function s(u){return o(u)?r(u)?e:t:u}function a(u){return n?u-n*Math.ceil((u-t)/n):u}return{length:n,max:t,min:e,constrain:s,reachedAny:o,reachedMax:i,reachedMin:r,removeOffset:a}}function Xp(e,t,n){const{constrain:r}=Dn(0,e),i=e+1;let o=s(t);function s(h){return n?Be((i+h)%i):r(h)}function a(){return o}function l(h){return o=s(h),c}function u(h){return f().set(a()+h)}function f(){return Xp(e,a(),n)}const c={get:a,set:l,add:u,clone:f};return c}function tI(e,t,n,r,i,o,s,a,l,u,f,c,h,d,m,p,g,y,v){const{cross:w,direction:A}=e,k=["INPUT","SELECT","TEXTAREA"],E={passive:!1},I=Xr(),M=Xr(),P=Dn(50,225).constrain(d.measure(20)),T={mouse:300,touch:400},O={mouse:500,touch:600},j=m?43:25;let F=!1,L=0,_=0,B=!1,z=!1,H=!1,W=!1;function b($){if(!v)return;function ne(Ce){(oo(v)||v($,Ce))&&K(Ce)}const he=t;I.add(he,"dragstart",Ce=>Ce.preventDefault(),E).add(he,"touchmove",()=>{},E).add(he,"touchend",()=>{}).add(he,"touchstart",ne).add(he,"mousedown",ne).add(he,"touchcancel",X).add(he,"contextmenu",X).add(he,"click",se,!0)}function N(){I.clear(),M.clear()}function R(){const $=W?n:t;M.add($,"touchmove",Q,E).add($,"touchend",X).add($,"mousemove",Q,E).add($,"mouseup",X)}function S($){const ne=$.nodeName||"";return k.includes(ne)}function V(){return(m?O:T)[W?"mouse":"touch"]}function ee($,ne){const he=c.add(el($)*-1),Ce=f.byDistance($,!m).distance;return m||Be($)<P?Ce:g&&ne?Ce*.5:f.byIndex(he.get(),0).distance}function K($){const ne=nl($,r);W=ne,H=m&&ne&&!$.buttons&&F,F=Gr(i.get(),s.get())>=2,!(ne&&$.button!==0)&&(S($.target)||(B=!0,o.pointerDown($),u.useFriction(0).useDuration(0),i.set(s),R(),L=o.readPoint($),_=o.readPoint($,w),h.emit("pointerDown")))}function Q($){if(!nl($,r)&&$.touches.length>=2)return X($);const he=o.readPoint($),Ce=o.readPoint($,w),G=Gr(he,L),ue=Gr(Ce,_);if(!z&&!W&&(!$.cancelable||(z=G>ue,!z)))return X($);const de=o.pointerMove($);G>p&&(H=!0),u.useFriction(.3).useDuration(.75),a.start(),i.add(A(de)),$.preventDefault()}function X($){const he=f.byDistance(0,!1).index!==c.get(),Ce=o.pointerUp($)*V(),G=ee(A(Ce),he),ue=QT(Ce,G),de=j-10*ue,fe=y+ue/50;z=!1,B=!1,M.clear(),u.useDuration(de).useFriction(fe),l.distance(G,!m),W=!1,h.emit("pointerUp")}function se($){H&&($.stopPropagation(),$.preventDefault(),H=!1)}function Y(){return B}return{init:b,destroy:N,pointerDown:Y}}function nI(e,t){let r,i;function o(c){return c.timeStamp}function s(c,h){const m=`client${(h||e.scroll)==="x"?"X":"Y"}`;return(nl(c,t)?c:c.touches[0])[m]}function a(c){return r=c,i=c,s(c)}function l(c){const h=s(c)-s(i),d=o(c)-o(r)>170;return i=c,d&&(r=c),h}function u(c){if(!r||!i)return 0;const h=s(i)-s(r),d=o(c)-o(r),m=o(c)-o(i)>170,p=h/d;return d&&!m&&Be(p)>.1?p:0}return{pointerDown:a,pointerMove:l,pointerUp:u,readPoint:s}}function rI(){function e(n){const{offsetTop:r,offsetLeft:i,offsetWidth:o,offsetHeight:s}=n;return{top:r,right:i+o,bottom:r+s,left:i,width:o,height:s}}return{measure:e}}function iI(e){function t(r){return e*(r/100)}return{measure:t}}function oI(e,t,n,r,i,o,s){const a=[e].concat(r);let l,u,f=[],c=!1;function h(g){return i.measureSize(s.measure(g))}function d(g){if(!o)return;u=h(e),f=r.map(h);function y(v){for(const w of v){if(c)return;const A=w.target===e,k=r.indexOf(w.target),E=A?u:f[k],I=h(A?e:r[k]);if(Be(I-E)>=.5){g.reInit(),t.emit("resize");break}}}l=new ResizeObserver(v=>{(oo(o)||o(g,v))&&y(v)}),n.requestAnimationFrame(()=>{a.forEach(v=>l.observe(v))})}function m(){c=!0,l&&l.disconnect()}return{init:d,destroy:m}}function sI(e,t,n,r,i,o){let s=0,a=0,l=i,u=o,f=e.get(),c=0;function h(){const E=r.get()-e.get(),I=!l;let M=0;return I?(s=0,n.set(r),e.set(r),M=E):(n.set(e),s+=E/l,s*=u,f+=s,e.add(s),M=f-c),a=el(M),c=f,k}function d(){const E=r.get()-t.get();return Be(E)<.001}function m(){return l}function p(){return a}function g(){return s}function y(){return w(i)}function v(){return A(o)}function w(E){return l=E,k}function A(E){return u=E,k}const k={direction:p,duration:m,velocity:g,seek:h,settled:d,useBaseFriction:v,useBaseDuration:y,useFriction:A,useDuration:w};return k}function aI(e,t,n,r,i){const o=i.measure(10),s=i.measure(50),a=Dn(.1,.99);let l=!1;function u(){return!(l||!e.reachedAny(n.get())||!e.reachedAny(t.get()))}function f(d){if(!u())return;const m=e.reachedMin(t.get())?"min":"max",p=Be(e[m]-t.get()),g=n.get()-t.get(),y=a.constrain(p/s);n.subtract(g*y),!d&&Be(g)<o&&(n.set(e.constrain(n.get())),r.useDuration(25).useBaseFriction())}function c(d){l=!d}return{shouldConstrain:u,constrain:f,toggleActive:c}}function lI(e,t,n,r,i){const o=Dn(-t+e,0),s=c(),a=f(),l=h();function u(m,p){return Gr(m,p)<=1}function f(){const m=s[0],p=Nt(s),g=s.lastIndexOf(m),y=s.indexOf(p)+1;return Dn(g,y)}function c(){return n.map((m,p)=>{const{min:g,max:y}=o,v=o.constrain(m),w=!p,A=tl(n,p);return w?y:A||u(g,v)?g:u(y,v)?y:v}).map(m=>parseFloat(m.toFixed(3)))}function h(){if(t<=e+i)return[o.max];if(r==="keepSnaps")return s;const{min:m,max:p}=a;return s.slice(m,p)}return{snapsContained:l,scrollContainLimit:a}}function uI(e,t,n){const r=t[0],i=n?r-e:Nt(t);return{limit:Dn(i,r)}}function cI(e,t,n,r){const o=t.min+.1,s=t.max+.1,{reachedMin:a,reachedMax:l}=Dn(o,s);function u(h){return h===1?l(n.get()):h===-1?a(n.get()):!1}function f(h){if(!u(h))return;const d=e*(h*-1);r.forEach(m=>m.add(d))}return{loop:f}}function fI(e){const{max:t,length:n}=e;function r(o){const s=o-t;return n?s/-n:0}return{get:r}}function dI(e,t,n,r,i){const{startEdge:o,endEdge:s}=e,{groupSlides:a}=i,l=c().map(t.measure),u=h(),f=d();function c(){return a(r).map(p=>Nt(p)[s]-p[0][o]).map(Be)}function h(){return r.map(p=>n[o]-p[o]).map(p=>-Be(p))}function d(){return a(u).map(p=>p[0]).map((p,g)=>p+l[g])}return{snaps:u,snapsAligned:f}}function hI(e,t,n,r,i,o){const{groupSlides:s}=i,{min:a,max:l}=r,u=f();function f(){const h=s(o),d=!e||t==="keepSnaps";return n.length===1?[o]:d?h:h.slice(a,l).map((m,p,g)=>{const y=!p,v=tl(g,p);if(y){const w=Nt(g[0])+1;return Zp(w)}if(v){const w=Zr(o)-Nt(g)[0]+1;return Zp(w,Nt(g)[0])}return m})}return{slideRegistry:u}}function pI(e,t,n,r,i){const{reachedAny:o,removeOffset:s,constrain:a}=r;function l(m){return m.concat().sort((p,g)=>Be(p)-Be(g))[0]}function u(m){const p=e?s(m):a(m),g=t.map((v,w)=>({diff:f(v-p,0),index:w})).sort((v,w)=>Be(v.diff)-Be(w.diff)),{index:y}=g[0];return{index:y,distance:p}}function f(m,p){const g=[m,m+n,m-n];if(!e)return m;if(!p)return l(g);const y=g.filter(v=>el(v)===p);return y.length?l(y):Nt(g)-n}function c(m,p){const g=t[m]-i.get(),y=f(g,p);return{index:m,distance:y}}function h(m,p){const g=i.get()+m,{index:y,distance:v}=u(g),w=!e&&o(g);if(!p||w)return{index:y,distance:m};const A=t[y]-v,k=m+f(A,0);return{index:y,distance:k}}return{byDistance:h,byIndex:c,shortcut:f}}function mI(e,t,n,r,i,o,s){function a(c){const h=c.distance,d=c.index!==t.get();o.add(h),h&&(r.duration()?e.start():(e.update(),e.render(1),e.update())),d&&(n.set(t.get()),t.set(c.index),s.emit("select"))}function l(c,h){const d=i.byDistance(c,h);a(d)}function u(c,h){const d=t.clone().set(c),m=i.byIndex(d.get(),h);a(m)}return{distance:l,index:u}}function gI(e,t,n,r,i,o,s,a){const l={passive:!0,capture:!0};let u=0;function f(d){if(!a)return;function m(p){if(new Date().getTime()-u>10)return;s.emit("slideFocusStart"),e.scrollLeft=0;const v=n.findIndex(w=>w.includes(p));Ja(v)&&(i.useDuration(0),r.index(v,0),s.emit("slideFocus"))}o.add(document,"keydown",c,!1),t.forEach((p,g)=>{o.add(p,"focus",y=>{(oo(a)||a(d,y))&&m(g)},l)})}function c(d){d.code==="Tab"&&(u=new Date().getTime())}return{init:f}}function ei(e){let t=e;function n(){return t}function r(l){t=s(l)}function i(l){t+=s(l)}function o(l){t-=s(l)}function s(l){return Ja(l)?l:l.get()}return{get:n,set:r,add:i,subtract:o}}function em(e,t){const n=e.scroll==="x"?s:a,r=t.style;let i=null,o=!1;function s(h){return`translate3d(${h}px,0px,0px)`}function a(h){return`translate3d(0px,${h}px,0px)`}function l(h){if(o)return;const d=ZT(e.direction(h));d!==i&&(r.transform=n(d),i=d)}function u(h){o=!h}function f(){o||(r.transform="",t.getAttribute("style")||t.removeAttribute("style"))}return{clear:f,to:l,toggleActive:u}}function yI(e,t,n,r,i,o,s,a,l){const f=Qr(i),c=Qr(i).reverse(),h=y().concat(v());function d(I,M){return I.reduce((P,T)=>P-i[T],M)}function m(I,M){return I.reduce((P,T)=>d(P,M)>0?P.concat([T]):P,[])}function p(I){return o.map((M,P)=>({start:M-r[P]+.5+I,end:M+t-.5+I}))}function g(I,M,P){const T=p(M);return I.map(O=>{const j=P?0:-n,F=P?n:0,L=P?"end":"start",_=T[O][L];return{index:O,loopPoint:_,slideLocation:ei(-1),translate:em(e,l[O]),target:()=>a.get()>_?j:F}})}function y(){const I=s[0],M=m(c,I);return g(M,n,!1)}function v(){const I=t-s[0]-1,M=m(f,I);return g(M,-n,!0)}function w(){return h.every(({index:I})=>{const M=f.filter(P=>P!==I);return d(M,t)<=.1})}function A(){h.forEach(I=>{const{target:M,translate:P,slideLocation:T}=I,O=M();O!==T.get()&&(P.to(O),T.set(O))})}function k(){h.forEach(I=>I.translate.clear())}return{canLoop:w,clear:k,loop:A,loopPoints:h}}function vI(e,t,n){let r,i=!1;function o(l){if(!n)return;function u(f){for(const c of f)if(c.type==="childList"){l.reInit(),t.emit("slidesChanged");break}}r=new MutationObserver(f=>{i||(oo(n)||n(l,f))&&u(f)}),r.observe(e,{childList:!0})}function s(){r&&r.disconnect(),i=!0}return{init:o,destroy:s}}function bI(e,t,n,r){const i={};let o=null,s=null,a,l=!1;function u(){a=new IntersectionObserver(m=>{l||(m.forEach(p=>{const g=t.indexOf(p.target);i[g]=p}),o=null,s=null,n.emit("slidesInView"))},{root:e.parentElement,threshold:r}),t.forEach(m=>a.observe(m))}function f(){a&&a.disconnect(),l=!0}function c(m){return Jr(i).reduce((p,g)=>{const y=parseInt(g),{isIntersecting:v}=i[y];return(m&&v||!m&&!v)&&p.push(y),p},[])}function h(m=!0){if(m&&o)return o;if(!m&&s)return s;const p=c(m);return m&&(o=p),m||(s=p),p}return{init:u,destroy:f,get:h}}function wI(e,t,n,r,i,o){const{measureSize:s,startEdge:a,endEdge:l}=e,u=n[0]&&i,f=m(),c=p(),h=n.map(s),d=g();function m(){if(!u)return 0;const v=n[0];return Be(t[a]-v[a])}function p(){if(!u)return 0;const v=o.getComputedStyle(Nt(r));return parseFloat(v.getPropertyValue(`margin-${l}`))}function g(){return n.map((v,w,A)=>{const k=!w,E=tl(A,w);return k?h[w]+f:E?h[w]+c:A[w+1][a]-v[a]}).map(Be)}return{slideSizes:h,slideSizesWithGaps:d,startGap:f,endGap:c}}function SI(e,t,n,r,i,o,s,a,l){const{startEdge:u,endEdge:f,direction:c}=e,h=Ja(n);function d(y,v){return Qr(y).filter(w=>w%v===0).map(w=>y.slice(w,w+v))}function m(y){return y.length?Qr(y).reduce((v,w,A)=>{const k=Nt(v)||0,E=k===0,I=w===Zr(y),M=i[u]-o[k][u],P=i[u]-o[w][f],T=!r&&E?c(s):0,O=!r&&I?c(a):0,j=Be(P-O-(M+T));return A&&j>t+l&&v.push(w),I&&v.push(y.length),v},[]).map((v,w,A)=>{const k=Math.max(A[w-1]||0);return y.slice(k,v)}):[]}function p(y){return h?d(y,n):m(y)}return{groupSlides:p}}function kI(e,t,n,r,i,o,s){const{align:a,axis:l,direction:u,startIndex:f,loop:c,duration:h,dragFree:d,dragThreshold:m,inViewThreshold:p,slidesToScroll:g,skipSnaps:y,containScroll:v,watchResize:w,watchSlides:A,watchDrag:k,watchFocus:E}=o,I=2,M=rI(),P=M.measure(t),T=n.map(M.measure),O=eI(l,u),j=O.measureSize(P),F=iI(j),L=JT(a,j),_=!c&&!!v,B=c||!!v,{slideSizes:z,slideSizesWithGaps:H,startGap:W,endGap:b}=wI(O,P,T,n,B,i),N=SI(O,j,g,c,P,T,W,b,I),{snaps:R,snapsAligned:S}=dI(O,L,P,T,N),V=-Nt(R)+Nt(H),{snapsContained:ee,scrollContainLimit:K}=lI(j,V,S,v,I),Q=_?ee:S,{limit:X}=uI(V,Q,c),se=Xp(Zr(Q),f,c),Y=se.clone(),re=Qr(n),$=({dragHandler:pe,scrollBody:je,scrollBounds:Qe,options:{loop:Je}})=>{Je||Qe.constrain(pe.pointerDown()),je.seek()},ne=({scrollBody:pe,translate:je,location:Qe,offsetLocation:Je,previousLocation:Ct,scrollLooper:Bt,slideLooper:Ze,dragHandler:At,animation:lt,eventHandler:ts,scrollBounds:B2,options:{loop:Qv}},Zv)=>{const Jv=pe.settled(),$2=!B2.shouldConstrain(),Xv=Qv?Jv:Jv&&$2,eb=Xv&&!At.pointerDown();eb&&lt.stop();const z2=Qe.get()*Zv+Ct.get()*(1-Zv);Je.set(z2),Qv&&(Bt.loop(pe.direction()),Ze.loop()),je.to(Je.get()),eb&&ts.emit("settle"),Xv||ts.emit("scroll")},he=XT(r,i,()=>$(le),pe=>ne(le,pe)),Ce=.68,G=Q[se.get()],ue=ei(G),de=ei(G),fe=ei(G),Te=ei(G),Fe=sI(ue,fe,de,Te,h,Ce),De=pI(c,Q,V,X,Te),Ue=mI(he,se,Y,Fe,De,Te,s),te=fI(X),ae=Xr(),U=bI(t,n,s,p),{slideRegistry:q}=hI(_,v,Q,K,N,re),oe=gI(e,n,q,Ue,Fe,ae,s,E),le={ownerDocument:r,ownerWindow:i,eventHandler:s,containerRect:P,slideRects:T,animation:he,axis:O,dragHandler:tI(O,e,r,i,Te,nI(O,i),ue,he,Ue,Fe,De,se,s,F,d,m,y,Ce,k),eventStore:ae,percentOfView:F,index:se,indexPrevious:Y,limit:X,location:ue,offsetLocation:fe,previousLocation:de,options:o,resizeHandler:oI(t,s,i,n,O,w,M),scrollBody:Fe,scrollBounds:aI(X,fe,Te,Fe,F),scrollLooper:cI(V,X,fe,[ue,fe,de,Te]),scrollProgress:te,scrollSnapList:Q.map(te.get),scrollSnaps:Q,scrollTarget:De,scrollTo:Ue,slideLooper:yI(O,j,V,z,H,R,Q,fe,n),slideFocus:oe,slidesHandler:vI(t,s,A),slidesInView:U,slideIndexes:re,slideRegistry:q,slidesToScroll:N,target:Te,translate:em(O,t)};return le}function xI(){let e={},t;function n(u){t=u}function r(u){return e[u]||[]}function i(u){return r(u).forEach(f=>f(t,u)),l}function o(u,f){return e[u]=r(u).concat([f]),l}function s(u,f){return e[u]=r(u).filter(c=>c!==f),l}function a(){e={}}const l={init:n,emit:i,off:s,on:o,clear:a};return l}const EI={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function CI(e){function t(o,s){return Jp(o,s||{})}function n(o){const s=o.breakpoints||{},a=Jr(s).filter(l=>e.matchMedia(l).matches).map(l=>s[l]).reduce((l,u)=>t(l,u),{});return t(o,a)}function r(o){return o.map(s=>Jr(s.breakpoints||{})).reduce((s,a)=>s.concat(a),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:n,optionsMediaQueries:r}}function AI(e){let t=[];function n(o,s){return t=s.filter(({options:a})=>e.optionsAtMedia(a).active!==!1),t.forEach(a=>a.init(o,e)),s.reduce((a,l)=>Object.assign(a,{[l.name]:l}),{})}function r(){t=t.filter(o=>o.destroy())}return{init:n,destroy:r}}function so(e,t,n){const r=e.ownerDocument,i=r.defaultView,o=CI(i),s=AI(o),a=Xr(),l=xI(),{mergeOptions:u,optionsAtMedia:f,optionsMediaQueries:c}=o,{on:h,off:d,emit:m}=l,p=O;let g=!1,y,v=u(EI,so.globalOptions),w=u(v),A=[],k,E,I;function M(){const{container:re,slides:$}=w;E=(Xa(re)?e.querySelector(re):re)||e.children[0];const he=Xa($)?E.querySelectorAll($):$;I=[].slice.call(he||E.children)}function P(re){const $=kI(e,E,I,r,i,re,l);if(re.loop&&!$.slideLooper.canLoop()){const ne=Object.assign({},re,{loop:!1});return P(ne)}return $}function T(re,$){g||(v=u(v,re),w=f(v),A=$||A,M(),y=P(w),c([v,...A.map(({options:ne})=>ne)]).forEach(ne=>a.add(ne,"change",O)),w.active&&(y.translate.to(y.location.get()),y.animation.init(),y.slidesInView.init(),y.slideFocus.init(Y),y.eventHandler.init(Y),y.resizeHandler.init(Y),y.slidesHandler.init(Y),y.options.loop&&y.slideLooper.loop(),E.offsetParent&&I.length&&y.dragHandler.init(Y),k=s.init(Y,A)))}function O(re,$){const ne=N();j(),T(u({startIndex:ne},re),$),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(),s.destroy(),a.clear()}function F(){g||(g=!0,a.clear(),j(),l.emit("destroy"),l.clear())}function L(re,$,ne){!w.active||g||(y.scrollBody.useBaseFriction().useDuration($===!0?0:w.duration),y.scrollTo.index(re,ne||0))}function _(re){const $=y.index.add(1).get();L($,re,-1)}function B(re){const $=y.index.add(-1).get();L($,re,1)}function z(){return y.index.add(1).get()!==N()}function H(){return y.index.add(-1).get()!==N()}function W(){return y.scrollSnapList}function b(){return y.scrollProgress.get(y.offsetLocation.get())}function N(){return y.index.get()}function R(){return y.indexPrevious.get()}function S(){return y.slidesInView.get()}function V(){return y.slidesInView.get(!1)}function ee(){return k}function K(){return y}function Q(){return e}function X(){return E}function se(){return I}const Y={canScrollNext:z,canScrollPrev:H,containerNode:X,internalEngine:K,destroy:F,off:d,on:h,emit:m,plugins:ee,previousScrollSnap:R,reInit:p,rootNode:Q,scrollNext:_,scrollPrev:B,scrollProgress:b,scrollSnapList:W,scrollTo:L,selectedScrollSnap:N,slideNodes:se,slidesInView:S,slidesNotInView:V};return T(t,n),setTimeout(()=>l.emit("init"),0),Y}so.globalOptions=void 0;function rl(e={},t=[]){const n=D.useRef(e),r=D.useRef(t),[i,o]=D.useState(),[s,a]=D.useState(),l=D.useCallback(()=>{i&&i.reInit(n.current,r.current)},[i]);return D.useEffect(()=>{Za(n.current,e)||(n.current=e,l())},[e,l]),D.useEffect(()=>{GT(r.current,t)||(r.current=t,l())},[t,l]),D.useEffect(()=>{if(KT()&&s){so.globalOptions=rl.globalOptions;const u=so(s,n.current,r.current);return o(u),()=>u.destroy()}else o(void 0)},[s,o]),[a,i]}rl.globalOptions=void 0;const tm=D.forwardRef(({blocks:e,direction:t,sender:n,timestamp:r,messageId:i,isReadOnly:o,sendMessage:s},a)=>{const[l,u]=rl({skipSnaps:!0,loop:!0}),[f,c]=D.useState(!0),[h,d]=D.useState(!0),m=D.useCallback(()=>u==null?void 0:u.scrollPrev(),[u]),p=D.useCallback(()=>u==null?void 0:u.scrollNext(),[u]),{message:{blocks:{carousel:g}}}=ye,y=D.useCallback(v=>{c(!(v!=null&&v.canScrollPrev())),d(!(v!=null&&v.canScrollNext()))},[]);return D.useEffect(()=>{u&&(y(u),u.on("reInit",y),u.on("select",y))},[u,y]),x.jsxs("div",{...g==null?void 0:g.container,"data-container":"carousel",ref:l,children:[x.jsx("div",{ref:a,...g==null?void 0:g.slidesContainer,children:e.map((v,w)=>x.jsx(Nn,{block:{...v,direction:t,timestamp:r,sender:n,messageId:i,sendMessage:s,isReadOnly:o}},w))}),e.length>1&&x.jsxs(x.Fragment,{children:[x.jsx(pp,{...g==null?void 0:g.backButton,"data-disabled":f?"":void 0,onClick:m}),x.jsx(mp,{...g==null?void 0:g.nextButton,"data-disabled":h?"":void 0,onClick:p})]})]})});tm.displayName="Carousel";const nm=Math.floor;function rm(e){return im(e)?(e.nodeName||"").toLowerCase():"#document"}function ti(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function TI(e){var t;return(t=(im(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function im(e){return e instanceof Node||e instanceof ti(e).Node}function Et(e){return e instanceof Element||e instanceof ti(e).Element}function tr(e){return e instanceof HTMLElement||e instanceof ti(e).HTMLElement}function il(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ti(e).ShadowRoot}function II(e){return["html","body","#document"].includes(rm(e))}function OI(e){return ti(e).getComputedStyle(e)}function DI(e){if(rm(e)==="html")return e;const t=e.assignedSlot||e.parentNode||il(e)&&e.host||TI(e);return il(t)?t.host:t}function cn(e){let t=e.activeElement;for(;((n=t)==null||(r=n.shadowRoot)==null?void 0:r.activeElement)!=null;){var n,r;t=t.shadowRoot.activeElement}return t}function dt(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&il(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function om(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function MI(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function sm(e){if(e.mozInputSource===0&&e.isTrusted)return!0;const t=/Android/i;return(t.test(om())||t.test(MI()))&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function am(e){return e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType!=="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0}function lm(){return/apple/i.test(navigator.vendor)}function NI(){return om().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function um(e,t){return["mouse","pen"].includes(e)}function LI(e){return"nativeEvent"in e}function _I(e){return e.matches("html,body")}function Lt(e){return(e==null?void 0:e.ownerDocument)||document}function ol(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function cm(e){return"composedPath"in e?e.composedPath()[0]:e.target}const PI="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function fm(e){return tr(e)&&e.matches(PI)}function Xe(e){e.preventDefault(),e.stopPropagation()}const nr=Math.min,yt=Math.max,ao=Math.round,lo=Math.floor,Ht=e=>({x:e,y:e});function dm(e,t,n){return yt(e,nr(t,n))}function uo(e,t){return typeof e=="function"?e(t):e}function ni(e){return e.split("-")[0]}function sl(e){return e.split("-")[1]}function hm(e){return e==="x"?"y":"x"}function FI(e){return e==="y"?"height":"width"}const RI=new Set(["top","bottom"]);function ri(e){return RI.has(ni(e))?"y":"x"}function BI(e){return hm(ri(e))}function $I(e){return{top:0,right:0,bottom:0,left:0,...e}}function zI(e){return typeof e!="number"?$I(e):{top:e,right:e,bottom:e,left:e}}function co(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function pm(e,t,n){let{reference:r,floating:i}=e;const o=ri(t),s=BI(t),a=FI(s),l=ni(t),u=o==="y",f=r.x+r.width/2-i.width/2,c=r.y+r.height/2-i.height/2,h=r[a]/2-i[a]/2;let d;switch(l){case"top":d={x:f,y:r.y-i.height};break;case"bottom":d={x:f,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:c};break;case"left":d={x:r.x-i.width,y:c};break;default:d={x:r.x,y:r.y}}switch(sl(t)){case"start":d[s]-=h*(n&&u?-1:1);break;case"end":d[s]+=h*(n&&u?-1:1);break}return d}const HI=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:f,y:c}=pm(u,r,l),h=r,d={},m=0;for(let p=0;p<a.length;p++){const{name:g,fn:y}=a[p],{x:v,y:w,data:A,reset:k}=await y({x:f,y:c,initialPlacement:r,placement:h,strategy:i,middlewareData:d,rects:u,platform:s,elements:{reference:e,floating:t}});f=v??f,c=w??c,d={...d,[g]:{...d[g],...A}},k&&m<=50&&(m++,typeof k=="object"&&(k.placement&&(h=k.placement),k.rects&&(u=k.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):k.rects),{x:f,y:c}=pm(u,h,l)),p=-1)}return{x:f,y:c,placement:h,strategy:i,middlewareData:d}};async function mm(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:c="floating",altBoundary:h=!1,padding:d=0}=uo(t,e),m=zI(d),g=a[h?c==="floating"?"reference":"floating":c],y=co(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(g)))==null||n?g:g.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:u,rootBoundary:f,strategy:l})),v=c==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,w=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),A=await(o.isElement==null?void 0:o.isElement(w))?await(o.getScale==null?void 0:o.getScale(w))||{x:1,y:1}:{x:1,y:1},k=co(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect: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 UI=new Set(["left","top"]);async function jI(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=ni(n),a=sl(n),l=ri(n)==="y",u=UI.has(s)?-1:1,f=o&&l?-1:1,c=uo(t,e);let{mainAxis:h,crossAxis:d,alignmentAxis:m}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:c.mainAxis||0,crossAxis:c.crossAxis||0,alignmentAxis:c.alignmentAxis};return a&&typeof m=="number"&&(d=a==="end"?m*-1:m),l?{x:d*f,y:h*u}:{x:h*u,y:d*f}}const VI=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:s,middlewareData:a}=t,l=await jI(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:s}}}}},WI=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:g=>{let{x:y,y:v}=g;return{x:y,y:v}}},...l}=uo(e,t),u={x:n,y:r},f=await mm(t,l),c=ri(ni(i)),h=hm(c);let d=u[h],m=u[c];if(o){const g=h==="y"?"top":"left",y=h==="y"?"bottom":"right",v=d+f[g],w=d-f[y];d=dm(v,d,w)}if(s){const g=c==="y"?"top":"left",y=c==="y"?"bottom":"right",v=m+f[g],w=m-f[y];m=dm(v,m,w)}const p=a.fn({...t,[h]:d,[c]:m});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[h]:o,[c]:s}}}}}},qI=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:s,elements:a}=t,{apply:l=()=>{},...u}=uo(e,t),f=await mm(t,u),c=ni(i),h=sl(i),d=ri(i)==="y",{width:m,height:p}=o.floating;let g,y;c==="top"||c==="bottom"?(g=c,y=h===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(y=c,g=h==="end"?"top":"bottom");const v=p-f.top-f.bottom,w=m-f.left-f.right,A=nr(p-f[g],v),k=nr(m-f[y],w),E=!t.middlewareData.shift;let I=A,M=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(I=v),E&&!h){const T=yt(f.left,0),O=yt(f.right,0),j=yt(f.top,0),F=yt(f.bottom,0);d?M=m-2*(T!==0||O!==0?T+O:yt(f.left,f.right)):I=p-2*(j!==0||F!==0?j+F:yt(f.top,f.bottom))}await l({...t,availableWidth:M,availableHeight:I});const P=await s.getDimensions(a.floating);return m!==P.width||p!==P.height?{reset:{rects:!0}}:{}}}};function fo(){return typeof window<"u"}function rr(e){return gm(e)?(e.nodeName||"").toLowerCase():"#document"}function vt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ut(e){var t;return(t=(gm(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function gm(e){return fo()?e instanceof Node||e instanceof vt(e).Node:!1}function _t(e){return fo()?e instanceof Element||e instanceof vt(e).Element:!1}function jt(e){return fo()?e instanceof HTMLElement||e instanceof vt(e).HTMLElement:!1}function ym(e){return!fo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof vt(e).ShadowRoot}const YI=new Set(["inline","contents"]);function ii(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Pt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!YI.has(i)}const KI=new Set(["table","td","th"]);function GI(e){return KI.has(rr(e))}const QI=[":popover-open",":modal"];function ho(e){return QI.some(t=>{try{return e.matches(t)}catch{return!1}})}const ZI=["transform","translate","scale","rotate","perspective"],JI=["transform","translate","scale","rotate","perspective","filter"],XI=["paint","layout","strict","content"];function al(e){const t=ll(),n=_t(e)?Pt(e):e;return ZI.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||JI.some(r=>(n.willChange||"").includes(r))||XI.some(r=>(n.contain||"").includes(r))}function eO(e){let t=fn(e);for(;jt(t)&&!ir(t);){if(al(t))return t;if(ho(t))return null;t=fn(t)}return null}function ll(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const tO=new Set(["html","body","#document"]);function ir(e){return tO.has(rr(e))}function Pt(e){return vt(e).getComputedStyle(e)}function po(e){return _t(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function fn(e){if(rr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ym(e)&&e.host||Ut(e);return ym(t)?t.host:t}function vm(e){const t=fn(e);return ir(t)?e.ownerDocument?e.ownerDocument.body:e.body:jt(t)&&ii(t)?t:vm(t)}function dn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=vm(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=vt(i);if(o){const a=ul(s);return t.concat(s,s.visualViewport||[],ii(i)?i:[],a&&n?dn(a):[])}return t.concat(i,dn(i,[],n))}function ul(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function bm(e){const t=Pt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=jt(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=ao(n)!==o||ao(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function cl(e){return _t(e)?e:e.contextElement}function or(e){const t=cl(e);if(!jt(t))return Ht(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=bm(t);let s=(o?ao(n.width):n.width)/r,a=(o?ao(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const nO=Ht(0);function wm(e){const t=vt(e);return!ll()||!t.visualViewport?nO:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function rO(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==vt(e)?!1:t}function Mn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=cl(e);let s=Ht(1);t&&(r?_t(r)&&(s=or(r)):s=or(e));const a=rO(o,n,r)?wm(o):Ht(0);let l=(i.left+a.x)/s.x,u=(i.top+a.y)/s.y,f=i.width/s.x,c=i.height/s.y;if(o){const h=vt(o),d=r&&_t(r)?vt(r):r;let m=h,p=ul(m);for(;p&&r&&d!==m;){const g=or(p),y=p.getBoundingClientRect(),v=Pt(p),w=y.left+(p.clientLeft+parseFloat(v.paddingLeft))*g.x,A=y.top+(p.clientTop+parseFloat(v.paddingTop))*g.y;l*=g.x,u*=g.y,f*=g.x,c*=g.y,l+=w,u+=A,m=vt(p),p=ul(m)}}return co({width:f,height:c,x:l,y:u})}function mo(e,t){const n=po(e).scrollLeft;return t?t.left+n:Mn(Ut(e)).left+n}function Sm(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-mo(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function iO(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",s=Ut(r),a=t?ho(t.floating):!1;if(r===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},u=Ht(1);const f=Ht(0),c=jt(r);if((c||!c&&!o)&&((rr(r)!=="body"||ii(s))&&(l=po(r)),jt(r))){const d=Mn(r);u=or(r),f.x=d.x+r.clientLeft,f.y=d.y+r.clientTop}const h=s&&!c&&!o?Sm(s,l):Ht(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+f.x+h.x,y:n.y*u.y-l.scrollTop*u.y+f.y+h.y}}function oO(e){return Array.from(e.getClientRects())}function sO(e){const t=Ut(e),n=po(e),r=e.ownerDocument.body,i=yt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=yt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+mo(e);const a=-n.scrollTop;return Pt(r).direction==="rtl"&&(s+=yt(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}const km=25;function aO(e,t){const n=vt(e),r=Ut(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;const f=ll();(!f||f&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const u=mo(r);if(u<=0){const f=r.ownerDocument,c=f.body,h=getComputedStyle(c),d=f.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,m=Math.abs(r.clientWidth-c.clientWidth-d);m<=km&&(o-=m)}else u<=km&&(o+=u);return{width:o,height:s,x:a,y:l}}const lO=new Set(["absolute","fixed"]);function uO(e,t){const n=Mn(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=jt(e)?or(e):Ht(1),s=e.clientWidth*o.x,a=e.clientHeight*o.y,l=i*o.x,u=r*o.y;return{width:s,height:a,x:l,y:u}}function xm(e,t,n){let r;if(t==="viewport")r=aO(e,n);else if(t==="document")r=sO(Ut(e));else if(_t(t))r=uO(t,n);else{const i=wm(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return co(r)}function Em(e,t){const n=fn(e);return n===t||!_t(n)||ir(n)?!1:Pt(n).position==="fixed"||Em(n,t)}function cO(e,t){const n=t.get(e);if(n)return n;let r=dn(e,[],!1).filter(a=>_t(a)&&rr(a)!=="body"),i=null;const o=Pt(e).position==="fixed";let s=o?fn(e):e;for(;_t(s)&&!ir(s);){const a=Pt(s),l=al(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&lO.has(i.position)||ii(s)&&!l&&Em(e,s))?r=r.filter(f=>f!==s):i=a,s=fn(s)}return t.set(e,r),r}function fO(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?ho(t)?[]:cO(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((u,f)=>{const c=xm(t,f,i);return u.top=yt(c.top,u.top),u.right=nr(c.right,u.right),u.bottom=nr(c.bottom,u.bottom),u.left=yt(c.left,u.left),u},xm(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function dO(e){const{width:t,height:n}=bm(e);return{width:t,height:n}}function hO(e,t,n){const r=jt(t),i=Ut(t),o=n==="fixed",s=Mn(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=Ht(0);function u(){l.x=mo(i)}if(r||!r&&!o)if((rr(t)!=="body"||ii(i))&&(a=po(t)),r){const d=Mn(t,!0,o,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else i&&u();o&&!r&&i&&u();const f=i&&!r&&!o?Sm(i,a):Ht(0),c=s.left+a.scrollLeft-l.x-f.x,h=s.top+a.scrollTop-l.y-f.y;return{x:c,y:h,width:s.width,height:s.height}}function fl(e){return Pt(e).position==="static"}function Cm(e,t){if(!jt(e)||Pt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ut(e)===n&&(n=n.ownerDocument.body),n}function Am(e,t){const n=vt(e);if(ho(e))return n;if(!jt(e)){let i=fn(e);for(;i&&!ir(i);){if(_t(i)&&!fl(i))return i;i=fn(i)}return n}let r=Cm(e,t);for(;r&&GI(r)&&fl(r);)r=Cm(r,t);return r&&ir(r)&&fl(r)&&!al(r)?n:r||eO(e)||n}const pO=async function(e){const t=this.getOffsetParent||Am,n=this.getDimensions,r=await n(e.floating);return{reference:hO(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function mO(e){return Pt(e).direction==="rtl"}const gO={convertOffsetParentRelativeRectToViewportRelativeRect:iO,getDocumentElement:Ut,getClippingRect:fO,getOffsetParent:Am,getElementRects:pO,getClientRects:oO,getDimensions:dO,getScale:or,isElement:_t,isRTL:mO};function Tm(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function yO(e,t){let n=null,r;const i=Ut(e);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const u=e.getBoundingClientRect(),{left:f,top:c,width:h,height:d}=u;if(a||t(),!h||!d)return;const m=lo(c),p=lo(i.clientWidth-(f+h)),g=lo(i.clientHeight-(c+d)),y=lo(f),w={rootMargin:-m+"px "+-p+"px "+-g+"px "+-y+"px",threshold:yt(0,nr(1,l))||1};let A=!0;function k(E){const I=E[0].intersectionRatio;if(I!==l){if(!A)return s();I?s(!1,I):r=setTimeout(()=>{s(!1,1e-7)},1e3)}I===1&&!Tm(u,e.getBoundingClientRect())&&s(),A=!1}try{n=new IntersectionObserver(k,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(k,w)}n.observe(e)}return s(!0),o}function vO(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=cl(e),f=i||o?[...u?dn(u):[],...dn(t)]:[];f.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),o&&y.addEventListener("resize",n)});const c=u&&a?yO(u,n):null;let h=-1,d=null;s&&(d=new ResizeObserver(y=>{let[v]=y;v&&v.target===u&&d&&(d.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=d)==null||w.observe(t)})),n()}),u&&!l&&d.observe(u),d.observe(t));let m,p=l?Mn(e):null;l&&g();function g(){const y=Mn(e);p&&!Tm(p,y)&&n(),p=y,m=requestAnimationFrame(g)}return n(),()=>{var y;f.forEach(v=>{i&&v.removeEventListener("scroll",n),o&&v.removeEventListener("resize",n)}),c==null||c(),(y=d)==null||y.disconnect(),d=null,l&&cancelAnimationFrame(m)}}const bO=VI,wO=WI,SO=qI,kO=(e,t,n)=>{const r=new Map,i={platform:gO,...n},o={...i.platform,_c:r};return HI(e,t,{...i,platform:o})};var xO=typeof document<"u",EO=function(){},go=xO?D.useLayoutEffect:EO;function yo(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!yo(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!yo(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Im(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Om(e,t){const n=Im(e);return Math.round(t*n)/n}function dl(e){const t=C.useRef(e);return go(()=>{t.current=e}),t}function CO(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[f,c]=C.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,d]=C.useState(r);yo(h,r)||d(r);const[m,p]=C.useState(null),[g,y]=C.useState(null),v=C.useCallback(H=>{H!==E.current&&(E.current=H,p(H))},[]),w=C.useCallback(H=>{H!==I.current&&(I.current=H,y(H))},[]),A=o||m,k=s||g,E=C.useRef(null),I=C.useRef(null),M=C.useRef(f),P=l!=null,T=dl(l),O=dl(i),j=dl(u),F=C.useCallback(()=>{if(!E.current||!I.current)return;const H={placement:t,strategy:n,middleware:h};O.current&&(H.platform=O.current),kO(E.current,I.current,H).then(W=>{const b={...W,isPositioned:j.current!==!1};L.current&&!yo(M.current,b)&&(M.current=b,Hu.flushSync(()=>{c(b)}))})},[h,t,n,O,j]);go(()=>{u===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,c(H=>({...H,isPositioned:!1})))},[u]);const L=C.useRef(!1);go(()=>(L.current=!0,()=>{L.current=!1}),[]),go(()=>{if(A&&(E.current=A),k&&(I.current=k),A&&k){if(T.current)return T.current(A,k,F);F()}},[A,k,F,T,P]);const _=C.useMemo(()=>({reference:E,floating:I,setReference:v,setFloating:w}),[v,w]),B=C.useMemo(()=>({reference:A,floating:k}),[A,k]),z=C.useMemo(()=>{const H={position:n,left:0,top:0};if(!B.floating)return H;const W=Om(B.floating,f.x),b=Om(B.floating,f.y);return a?{...H,transform:"translate("+W+"px, "+b+"px)",...Im(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:W,top:b}},[n,a,B.floating,f.x,f.y]);return C.useMemo(()=>({...f,update:F,refs:_,elements:B,floatingStyles:z}),[f,F,_,B,z])}const AO=(e,t)=>({...bO(e),options:[e,t]}),TO=(e,t)=>({...wO(e),options:[e,t]}),IO=(e,t)=>({...SO(e),options:[e,t]});/*!
286
286
  * tabbable 6.3.0
287
287
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
288
- */var OO=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],hl=OO.join(","),Dm=typeof Element>"u",oi=Dm?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,vo=!Dm&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},si=function(t,n){var r;n===void 0&&(n=!0);var i=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),o=i===""||i==="true",s=o||n&&t&&si(t.parentNode);return s},DO=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},MO=function(t,n,r){if(si(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(hl));return n&&oi.call(t,hl)&&i.unshift(t),i=i.filter(r),i},pl=function(t,n,r){for(var i=[],o=Array.from(t);o.length;){var s=o.shift();if(!si(s,!1))if(s.tagName==="SLOT"){var a=s.assignedElements(),l=a.length?a:s.children,u=pl(l,!0,r);r.flatten?i.push.apply(i,u):i.push({scopeParent:s,candidates:u})}else{var f=oi.call(s,hl);f&&r.filter(s)&&(n||!t.includes(s))&&i.push(s);var c=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),h=!si(c,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(c&&h){var d=pl(c===!0?s.children:c.children,!0,r);r.flatten?i.push.apply(i,d):i.push({scopeParent:s,candidates:d})}else o.unshift.apply(o,s.children)}}return i},Mm=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Nm=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||DO(t))&&!Mm(t)?0:t.tabIndex},NO=function(t,n){var r=Nm(t);return r<0&&n&&!Mm(t)?0:r},LO=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Lm=function(t){return t.tagName==="INPUT"},_O=function(t){return Lm(t)&&t.type==="hidden"},PO=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},FO=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},RO=function(t){if(!t.name)return!0;var n=t.form||vo(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=r(window.CSS.escape(t.name));else try{i=r(t.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var o=FO(i,t.form);return!o||o===t},BO=function(t){return Lm(t)&&t.type==="radio"},$O=function(t){return BO(t)&&!RO(t)},zO=function(t){var n,r=t&&vo(t),i=(n=r)===null||n===void 0?void 0:n.host,o=!1;if(r&&r!==t){var s,a,l;for(o=!!((s=i)!==null&&s!==void 0&&(a=s.ownerDocument)!==null&&a!==void 0&&a.contains(i)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!o&&i;){var u,f,c;r=vo(i),i=(u=r)===null||u===void 0?void 0:u.host,o=!!((f=i)!==null&&f!==void 0&&(c=f.ownerDocument)!==null&&c!==void 0&&c.contains(i))}}return o},_m=function(t){var n=t.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},HO=function(t,n){var r=n.displayCheck,i=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var o=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!o}if(getComputedStyle(t).visibility==="hidden")return!0;var s=oi.call(t,"details>summary:first-of-type"),a=s?t.parentElement:t;if(oi.call(a,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof i=="function"){for(var l=t;t;){var u=t.parentElement,f=vo(t);if(u&&!u.shadowRoot&&i(u)===!0)return _m(t);t.assignedSlot?t=t.assignedSlot:!u&&f!==t.ownerDocument?t=f.host:t=u}t=l}if(zO(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return _m(t);return!1},UO=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var i=n.children.item(r);if(i.tagName==="LEGEND")return oi.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},jO=function(t,n){return!(n.disabled||si(n)||_O(n)||HO(n,t)||PO(n)||UO(n))},Pm=function(t,n){return!($O(n)||Nm(n)<0||!jO(t,n))},VO=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Fm=function(t){var n=[],r=[];return t.forEach(function(i,o){var s=!!i.scopeParent,a=s?i.scopeParent:i,l=NO(a,s),u=s?Fm(i.candidates):a;l===0?s?n.push.apply(n,u):n.push(a):r.push({documentOrder:o,tabIndex:l,item:i,isScope:s,content:u})}),r.sort(LO).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},ml=function(t,n){n=n||{};var r;return n.getShadowRoot?r=pl([t],n.includeContainer,{filter:Pm.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:VO}):r=MO(t,n.includeContainer,Pm.bind(null,n)),Fm(r)};const gl="ArrowUp",bo="ArrowDown",sr="ArrowLeft",ai="ArrowRight";function wo(e,t,n){return Math.floor(e/t)!==n}function li(e,t){return t<0||t>=e.current.length}function yl(e,t){return rt(e,{disabledIndices:t})}function Rm(e,t){return rt(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function rt(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:i,amount:o=1}=t===void 0?{}:t;const s=e.current;let a=n;do{var l,u;a=a+(r?-o:o)}while(a>=0&&a<=s.length-1&&(i?i.includes(a):s[a]==null||(l=s[a])!=null&&l.hasAttribute("disabled")||((u=s[a])==null?void 0:u.getAttribute("aria-disabled"))==="true"));return a}function WO(e,t){let{event:n,orientation:r,loop:i,cols:o,disabledIndices:s,minIndex:a,maxIndex:l,prevIndex:u,stopEvent:f=!1}=t,c=u;if(n.key===gl){if(f&&Xe(n),u===-1)c=l;else if(c=rt(e,{startingIndex:c,amount:o,decrement:!0,disabledIndices:s}),i&&(u-o<a||c<0)){const h=u%o,d=l%o,m=l-(d-h);d===h?c=l:c=d>h?m:m-o}li(e,c)&&(c=u)}if(n.key===bo&&(f&&Xe(n),u===-1?c=a:(c=rt(e,{startingIndex:u,amount:o,disabledIndices:s}),i&&u+o>l&&(c=rt(e,{startingIndex:u%o-o,amount:o,disabledIndices:s}))),li(e,c)&&(c=u)),r==="both"){const h=nm(u/o);n.key===ai&&(f&&Xe(n),u%o!==o-1?(c=rt(e,{startingIndex:u,disabledIndices:s}),i&&wo(c,o,h)&&(c=rt(e,{startingIndex:u-u%o-1,disabledIndices:s}))):i&&(c=rt(e,{startingIndex:u-u%o-1,disabledIndices:s})),wo(c,o,h)&&(c=u)),n.key===sr&&(f&&Xe(n),u%o!==0?(c=rt(e,{startingIndex:u,disabledIndices:s,decrement:!0}),i&&wo(c,o,h)&&(c=rt(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}))):i&&(c=rt(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s})),wo(c,o,h)&&(c=u));const d=nm(l/o)===h;li(e,c)&&(i&&d?c=n.key===sr?l:rt(e,{startingIndex:u-u%o-1,disabledIndices:s}):c=u)}return c}let Bm=0;function Qt(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(Bm);const o=()=>e==null?void 0:e.focus({preventScroll:n});i?o():Bm=requestAnimationFrame(o)}var Ke=typeof document<"u"?D.useLayoutEffect:D.useEffect;function So(){return So=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},So.apply(this,arguments)}let vl=!1,qO=0;const $m=()=>"floating-ui-"+qO++;function YO(){const[e,t]=C.useState(()=>vl?$m():void 0);return Ke(()=>{e==null&&t($m())},[]),C.useEffect(()=>{vl||(vl=!0)},[]),e}const bl=C.useId||YO;function KO(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(i=>i!==n))||[])}}}const GO=C.createContext(null),QO=C.createContext(null),zm=()=>{var e;return((e=C.useContext(GO))==null?void 0:e.id)||null},ko=()=>C.useContext(QO);function ui(e){return"data-floating-ui-"+e}function hn(e){const t=D.useRef(e);return Ke(()=>{t.current=e}),t}function ZO(e,t){var n;let r=[],i=(n=e.find(o=>o.id===t))==null?void 0:n.parentId;for(;i;){const o=e.find(s=>s.id===i);i=o==null?void 0:o.parentId,o&&(r=r.concat(o))}return r}function ar(e,t){let n=e.filter(i=>{var o;return i.parentId===t&&((o=i.context)==null?void 0:o.open)}),r=n;for(;r.length;)r=e.filter(i=>{var o;return(o=r)==null?void 0:o.some(s=>{var a;return i.parentId===s.id&&((a=i.context)==null?void 0:a.open)})}),n=n.concat(r);return n}function JO(e,t){let n,r=-1;function i(o,s){s>r&&(n=o,r=s),ar(e,o).forEach(l=>{i(l.id,s+1)})}return i(t,0),e.find(o=>o.id===n)}let lr=new WeakMap,xo=new WeakSet,Eo={},wl=0;const XO=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,Hm=e=>e&&(e.host||Hm(e.parentNode)),eD=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=Hm(n);return e.contains(r)?r:null}).filter(n=>n!=null);function tD(e,t,n,r){const i="data-floating-ui-inert",o=r?"inert":n?"aria-hidden":null,s=eD(t,e),a=new Set,l=new Set(s),u=[];Eo[i]||(Eo[i]=new WeakMap);const f=Eo[i];s.forEach(c),h(t),a.clear();function c(d){!d||a.has(d)||(a.add(d),d.parentNode&&c(d.parentNode))}function h(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,m=>{if(a.has(m))h(m);else{const p=o?m.getAttribute(o):null,g=p!==null&&p!=="false",v=(lr.get(m)||0)+1,y=(f.get(m)||0)+1;lr.set(m,v),f.set(m,y),u.push(m),v===1&&g&&xo.add(m),y===1&&m.setAttribute(i,""),!g&&o&&m.setAttribute(o,"true")}})}return wl++,()=>{u.forEach(d=>{const m=(lr.get(d)||0)-1,p=(f.get(d)||0)-1;lr.set(d,m),f.set(d,p),m||(!xo.has(d)&&o&&d.removeAttribute(o),xo.delete(d)),p||d.removeAttribute(i)}),wl--,wl||(lr=new WeakMap,lr=new WeakMap,xo=new WeakSet,Eo={})}}function Um(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=Lt(e[0]).body;return tD(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Sl=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function jm(e,t){const n=ml(e,Sl());t==="prev"&&n.reverse();const r=n.indexOf(cn(Lt(e)));return n.slice(r+1)[0]}function Vm(){return jm(document.body,"next")}function Wm(){return jm(document.body,"prev")}function ci(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!dt(n,r)}function nD(e){ml(e,Sl()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function rD(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const kl={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};let iD;function qm(e){e.key==="Tab"&&(e.target,clearTimeout(iD))}const Co=C.forwardRef(function(t,n){const[r,i]=C.useState();Ke(()=>(lm()&&i("button"),document.addEventListener("keydown",qm),()=>{document.removeEventListener("keydown",qm)}),[]);const o={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[ui("focus-guard")]:"",style:kl};return C.createElement("span",So({},t,o))}),Ym=C.createContext(null);function oD(e){let{id:t,root:n}=e===void 0?{}:e;const[r,i]=C.useState(null),o=bl(),s=Km(),a=C.useMemo(()=>({id:t,root:n,portalContext:s,uniqueId:o}),[t,n,s,o]),l=C.useRef();return Ke(()=>()=>{r==null||r.remove()},[r,a]),Ke(()=>{if(l.current===a)return;l.current=a;const{id:u,root:f,portalContext:c,uniqueId:h}=a,d=u?document.getElementById(u):null,m=ui("portal");if(d){const p=document.createElement("div");p.id=h,p.setAttribute(m,""),d.appendChild(p),i(p)}else{let p=f||(c==null?void 0:c.portalNode);p&&!Et(p)&&(p=p.current),p=p||document.body;let g=null;u&&(g=document.createElement("div"),g.id=u,p.appendChild(g));const v=document.createElement("div");v.id=h,v.setAttribute(m,""),p=g||p,p.appendChild(v),i(v)}},[a]),r}function sD(e){let{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e;const o=oD({id:n,root:r}),[s,a]=C.useState(null),l=C.useRef(null),u=C.useRef(null),f=C.useRef(null),c=C.useRef(null),h=!!s&&!s.modal&&s.open&&i&&!!(r||o);return C.useEffect(()=>{if(!o||!i||s!=null&&s.modal)return;function d(m){o&&ci(m)&&(m.type==="focusin"?rD:nD)(o)}return o.addEventListener("focusin",d,!0),o.addEventListener("focusout",d,!0),()=>{o.removeEventListener("focusin",d,!0),o.removeEventListener("focusout",d,!0)}},[o,i,s==null?void 0:s.modal]),C.createElement(Ym.Provider,{value:C.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:f,afterInsideRef:c,portalNode:o,setFocusManagerState:a}),[i,o])},h&&o&&C.createElement(Co,{"data-type":"outside",ref:l,onFocus:d=>{if(ci(d,o)){var m;(m=f.current)==null||m.focus()}else{const p=Wm()||(s==null?void 0:s.refs.domReference.current);p==null||p.focus()}}}),h&&o&&C.createElement("span",{"aria-owns":o.id,style:kl}),o&&$u.createPortal(t,o),h&&o&&C.createElement(Co,{"data-type":"outside",ref:u,onFocus:d=>{if(ci(d,o)){var m;(m=c.current)==null||m.focus()}else{const p=Vm()||(s==null?void 0:s.refs.domReference.current);p==null||p.focus(),s!=null&&s.closeOnFocusOut&&(s==null||s.onOpenChange(!1,d.nativeEvent))}}}))}const Km=()=>C.useContext(Ym),aD=C.forwardRef(function(t,n){return C.createElement("button",So({},t,{type:"button",ref:n,tabIndex:-1,style:kl}))});function lD(e){const{context:t,children:n,disabled:r=!1,order:i=["content"],guards:o=!0,initialFocus:s=0,returnFocus:a=!0,modal:l=!0,visuallyHiddenDismiss:u=!1,closeOnFocusOut:f=!0}=e,{open:c,refs:h,nodeId:d,onOpenChange:m,events:p,dataRef:g,elements:{domReference:v,floating:y}}=t,w=XO()?o:!0,A=hn(i),k=hn(s),E=hn(a),I=ko(),M=Km(),L=typeof s=="number"&&s<0,T=C.useRef(null),O=C.useRef(null),H=C.useRef(!1),P=C.useRef(null),F=C.useRef(!1),_=M!=null,z=v&&v.getAttribute("role")==="combobox"&&fm(v)&&L,$=C.useCallback(function(N){return N===void 0&&(N=y),N?ml(N,Sl()):[]},[y]),U=C.useCallback(N=>{const R=$(N);return A.current.map(S=>v&&S==="reference"?v:y&&S==="floating"?y:R).filter(Boolean).flat()},[v,y,A,$]);C.useEffect(()=>{if(r||!l)return;function N(S){if(S.key==="Tab"){dt(y,cn(Lt(y)))&&$().length===0&&!z&&Xe(S);const V=U(),ee=cm(S);A.current[0]==="reference"&&ee===v&&(Xe(S),S.shiftKey?Qt(V[V.length-1]):Qt(V[1])),A.current[1]==="floating"&&ee===y&&S.shiftKey&&(Xe(S),Qt(V[0]))}}const R=Lt(y);return R.addEventListener("keydown",N),()=>{R.removeEventListener("keydown",N)}},[r,v,y,l,A,h,z,$,U]),C.useEffect(()=>{if(r||!f)return;function N(){F.current=!0,setTimeout(()=>{F.current=!1})}function R(S){const V=S.relatedTarget;queueMicrotask(()=>{const ee=!(dt(v,V)||dt(y,V)||dt(V,y)||dt(M==null?void 0:M.portalNode,V)||V!=null&&V.hasAttribute(ui("focus-guard"))||I&&(ar(I.nodesRef.current,d).find(Y=>{var G,J;return dt((G=Y.context)==null?void 0:G.elements.floating,V)||dt((J=Y.context)==null?void 0:J.elements.domReference,V)})||ZO(I.nodesRef.current,d).find(Y=>{var G,J;return((G=Y.context)==null?void 0:G.elements.floating)===V||((J=Y.context)==null?void 0:J.elements.domReference)===V})));V&&ee&&!F.current&&V!==P.current&&(H.current=!0,m(!1,S))})}if(y&&tr(v))return v.addEventListener("focusout",R),v.addEventListener("pointerdown",N),!l&&y.addEventListener("focusout",R),()=>{v.removeEventListener("focusout",R),v.removeEventListener("pointerdown",N),!l&&y.removeEventListener("focusout",R)}},[r,v,y,l,d,I,M,m,f]),C.useEffect(()=>{var N;if(r)return;const R=Array.from((M==null||(N=M.portalNode)==null?void 0:N.querySelectorAll("["+ui("portal")+"]"))||[]);if(y){const S=[y,...R,T.current,O.current,A.current.includes("reference")||z?v:null].filter(ee=>ee!=null),V=l?Um(S,w,!w):Um(S);return()=>{V()}}},[r,v,y,l,A,M,z,w]),Ke(()=>{if(r||!y)return;const N=Lt(y),R=cn(N);queueMicrotask(()=>{const S=U(y),V=k.current,ee=(typeof V=="number"?S[V]:V.current)||y,Y=dt(y,R);!L&&!Y&&c&&Qt(ee,{preventScroll:ee===y})})},[r,c,y,L,U,k]),Ke(()=>{if(r||!y)return;let N=!1;const R=Lt(y),S=cn(R),V=g.current;P.current=S;function ee(Y){if(Y.type==="escapeKey"&&h.domReference.current&&(P.current=h.domReference.current),["referencePress","escapeKey"].includes(Y.type))return;const G=Y.data.returnFocus;typeof G=="object"?(H.current=!1,N=G.preventScroll):H.current=!G}return p.on("dismiss",ee),()=>{p.off("dismiss",ee);const Y=cn(R);(dt(y,Y)||I&&ar(I.nodesRef.current,d).some(J=>{var se;return dt((se=J.context)==null?void 0:se.elements.floating,Y)})||V.openEvent&&["click","mousedown"].includes(V.openEvent.type))&&h.domReference.current&&(P.current=h.domReference.current),E.current&&tr(P.current)&&!H.current&&Qt(P.current,{cancelPrevious:!1,preventScroll:N})}},[r,y,E,g,h,p,I,d]),Ke(()=>{if(!(r||!M))return M.setFocusManagerState({modal:l,closeOnFocusOut:f,open:c,onOpenChange:m,refs:h}),()=>{M.setFocusManagerState(null)}},[r,M,l,c,m,h,f]),Ke(()=>{if(!r&&y&&typeof MutationObserver=="function"&&!L){const N=()=>{const S=y.getAttribute("tabindex");A.current.includes("floating")||cn(Lt(y))!==h.domReference.current&&$().length===0?S!=="0"&&y.setAttribute("tabindex","0"):S!=="-1"&&y.setAttribute("tabindex","-1")};N();const R=new MutationObserver(N);return R.observe(y,{childList:!0,subtree:!0,attributes:!0}),()=>{R.disconnect()}}},[r,y,h,A,$,L]);function W(N){return r||!u||!l?null:C.createElement(aD,{ref:N==="start"?T:O,onClick:R=>m(!1,R.nativeEvent)},typeof u=="string"?u:"Dismiss")}const b=!r&&w&&!z&&(_||l);return C.createElement(C.Fragment,null,b&&C.createElement(Co,{"data-type":"inside",ref:M==null?void 0:M.beforeInsideRef,onFocus:N=>{if(l){const S=U();Qt(i[0]==="reference"?S[0]:S[S.length-1])}else if(M!=null&&M.preserveTabOrder&&M.portalNode)if(H.current=!1,ci(N,M.portalNode)){const S=Vm()||v;S==null||S.focus()}else{var R;(R=M.beforeOutsideRef.current)==null||R.focus()}}}),!z&&W("start"),n,W("end"),b&&C.createElement(Co,{"data-type":"inside",ref:M==null?void 0:M.afterInsideRef,onFocus:N=>{if(l)Qt(U()[0]);else if(M!=null&&M.preserveTabOrder&&M.portalNode)if(f&&(H.current=!0),ci(N,M.portalNode)){const S=Wm()||v;S==null||S.focus()}else{var R;(R=M.afterOutsideRef.current)==null||R.focus()}}}))}function Gm(e){return tr(e.target)&&e.target.tagName==="BUTTON"}function Qm(e){return fm(e)}function uD(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:i,elements:{domReference:o}}=e,{enabled:s=!0,event:a="click",toggle:l=!0,ignoreMouse:u=!1,keyboardHandlers:f=!0}=t,c=C.useRef(),h=C.useRef(!1);return C.useMemo(()=>s?{reference:{onPointerDown(d){c.current=d.pointerType},onMouseDown(d){d.button===0&&(um(c.current)&&u||a!=="click"&&(n&&l&&(!i.current.openEvent||i.current.openEvent.type==="mousedown")?r(!1,d.nativeEvent):(d.preventDefault(),r(!0,d.nativeEvent))))},onClick(d){if(a==="mousedown"&&c.current){c.current=void 0;return}um(c.current)&&u||(n&&l&&(!i.current.openEvent||i.current.openEvent.type==="click")?r(!1,d.nativeEvent):r(!0,d.nativeEvent))},onKeyDown(d){c.current=void 0,!(d.defaultPrevented||!f||Gm(d))&&(d.key===" "&&!Qm(o)&&(d.preventDefault(),h.current=!0),d.key==="Enter"&&r(!(n&&l),d.nativeEvent))},onKeyUp(d){d.defaultPrevented||!f||Gm(d)||Qm(o)||d.key===" "&&h.current&&(h.current=!1,r(!(n&&l),d.nativeEvent))}}}:{},[s,i,a,u,f,o,l,n,r])}const cD=C.useInsertionEffect||(e=>e());function pn(e){const t=C.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return cD(()=>{t.current=e}),C.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}const fD={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},dD={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},hD=e=>{var t,n;return{escapeKeyBubbles:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePressBubbles:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function pD(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:i,nodeId:o,elements:{reference:s,domReference:a,floating:l},dataRef:u}=e,{enabled:f=!0,escapeKey:c=!0,outsidePress:h=!0,outsidePressEvent:d="pointerdown",referencePress:m=!1,referencePressEvent:p="pointerdown",ancestorScroll:g=!1,bubbles:v}=t,y=ko(),w=zm()!=null,A=pn(typeof h=="function"?h:()=>!1),k=typeof h=="function"?A:h,E=C.useRef(!1),{escapeKeyBubbles:I,outsidePressBubbles:M}=hD(v),L=pn(O=>{if(!n||!f||!c||O.key!=="Escape")return;const H=y?ar(y.nodesRef.current,o):[];if(!I&&(O.stopPropagation(),H.length>0)){let P=!0;if(H.forEach(F=>{var _;if((_=F.context)!=null&&_.open&&!F.context.dataRef.current.__escapeKeyBubbles){P=!1;return}}),!P)return}i.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),r(!1,LI(O)?O.nativeEvent:O)}),T=pn(O=>{const H=E.current;if(E.current=!1,H||typeof k=="function"&&!k(O))return;const P=cm(O),F="["+ui("inert")+"]",_=Lt(l).querySelectorAll(F);let z=Et(P)?P:null;for(;z&&!II(z);){const W=DI(z);if(W===Lt(l).body||!Et(W))break;z=W}if(_.length&&Et(P)&&!_I(P)&&!dt(P,l)&&Array.from(_).every(W=>!dt(z,W)))return;if(tr(P)&&l){const W=P.clientWidth>0&&P.scrollWidth>P.clientWidth,b=P.clientHeight>0&&P.scrollHeight>P.clientHeight;let N=b&&O.offsetX>P.clientWidth;if(b&&OI(P).direction==="rtl"&&(N=O.offsetX<=P.offsetWidth-P.clientWidth),N||W&&O.offsetY>P.clientHeight)return}const $=y&&ar(y.nodesRef.current,o).some(W=>{var b;return ol(O,(b=W.context)==null?void 0:b.elements.floating)});if(ol(O,l)||ol(O,a)||$)return;const U=y?ar(y.nodesRef.current,o):[];if(U.length>0){let W=!0;if(U.forEach(b=>{var N;if((N=b.context)!=null&&N.open&&!b.context.dataRef.current.__outsidePressBubbles){W=!1;return}}),!W)return}i.emit("dismiss",{type:"outsidePress",data:{returnFocus:w?{preventScroll:!0}:sm(O)||am(O)}}),r(!1,O)});return C.useEffect(()=>{if(!n||!f)return;u.current.__escapeKeyBubbles=I,u.current.__outsidePressBubbles=M;function O(F){r(!1,F)}const H=Lt(l);c&&H.addEventListener("keydown",L),k&&H.addEventListener(d,T);let P=[];return g&&(Et(a)&&(P=dn(a)),Et(l)&&(P=P.concat(dn(l))),!Et(s)&&s&&s.contextElement&&(P=P.concat(dn(s.contextElement)))),P=P.filter(F=>{var _;return F!==((_=H.defaultView)==null?void 0:_.visualViewport)}),P.forEach(F=>{F.addEventListener("scroll",O,{passive:!0})}),()=>{c&&H.removeEventListener("keydown",L),k&&H.removeEventListener(d,T),P.forEach(F=>{F.removeEventListener("scroll",O)})}},[u,l,a,s,c,k,d,n,r,g,f,I,M,L,T]),C.useEffect(()=>{E.current=!1},[k,d]),C.useMemo(()=>f?{reference:{onKeyDown:L,[fD[p]]:O=>{m&&(i.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),r(!1,O.nativeEvent))}},floating:{onKeyDown:L,[dD[d]]:()=>{E.current=!0}}}:{},[f,i,m,d,p,r,L])}let xl;process.env.NODE_ENV!=="production"&&(xl=new Set);function mD(e){var t;e===void 0&&(e={});const{open:n=!1,onOpenChange:r,nodeId:i}=e;if(process.env.NODE_ENV!=="production"){var o;const I="Floating UI: Cannot pass a virtual element to the `elements.reference` option, as it must be a real DOM element. Use `refs.setPositionReference` instead.";if((o=e.elements)!=null&&o.reference&&!Et(e.elements.reference)){var s;if(!((s=xl)!=null&&s.has(I))){var a;(a=xl)==null||a.add(I),console.error(I)}}}const[l,u]=C.useState(null),f=((t=e.elements)==null?void 0:t.reference)||l,c=CO(e),h=ko(),d=pn((I,M)=>{I&&(p.current.openEvent=M),r==null||r(I,M)}),m=C.useRef(null),p=C.useRef({}),g=C.useState(()=>KO())[0],v=bl(),y=C.useCallback(I=>{const M=Et(I)?{getBoundingClientRect:()=>I.getBoundingClientRect(),contextElement:I}:I;c.refs.setReference(M)},[c.refs]),w=C.useCallback(I=>{(Et(I)||I===null)&&(m.current=I,u(I)),(Et(c.refs.reference.current)||c.refs.reference.current===null||I!==null&&!Et(I))&&c.refs.setReference(I)},[c.refs]),A=C.useMemo(()=>({...c.refs,setReference:w,setPositionReference:y,domReference:m}),[c.refs,w,y]),k=C.useMemo(()=>({...c.elements,domReference:f}),[c.elements,f]),E=C.useMemo(()=>({...c,refs:A,elements:k,dataRef:p,nodeId:i,floatingId:v,events:g,open:n,onOpenChange:d}),[c,i,v,g,n,d,A,k]);return Ke(()=>{const I=h==null?void 0:h.nodesRef.current.find(M=>M.id===i);I&&(I.context=E)}),C.useMemo(()=>({...c,context:E,refs:A,elements:k}),[c,A,k,E])}function El(e,t,n){const r=new Map;return{...n==="floating"&&{tabIndex:-1},...e,...t.map(i=>i?i[n]:null).concat(e).reduce((i,o)=>(o&&Object.entries(o).forEach(s=>{let[a,l]=s;if(a.indexOf("on")===0){if(r.has(a)||r.set(a,[]),typeof l=="function"){var u;(u=r.get(a))==null||u.push(l),i[a]=function(){for(var f,c=arguments.length,h=new Array(c),d=0;d<c;d++)h[d]=arguments[d];return(f=r.get(a))==null?void 0:f.map(m=>m(...h)).find(m=>m!==void 0)}}}else i[a]=l}),i),{})}}function gD(e){e===void 0&&(e=[]);const t=e,n=C.useCallback(o=>El(o,e,"reference"),t),r=C.useCallback(o=>El(o,e,"floating"),t),i=C.useCallback(o=>El(o,e,"item"),e.map(o=>o==null?void 0:o.item));return C.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:i}),[n,r,i])}let Zm=!1;function Ao(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Jm(e,t){return Ao(t,e===gl||e===bo,e===sr||e===ai)}function Cl(e,t,n){return Ao(t,e===bo,n?e===sr:e===ai)||e==="Enter"||e==" "||e===""}function yD(e,t,n){return Ao(t,n?e===sr:e===ai,e===bo)}function Xm(e,t,n){return Ao(t,n?e===ai:e===sr,e===gl)}function vD(e,t){const{open:n,onOpenChange:r,refs:i,elements:{domReference:o,floating:s}}=e,{listRef:a,activeIndex:l,onNavigate:u=()=>{},enabled:f=!0,selectedIndex:c=null,allowEscape:h=!1,loop:d=!1,nested:m=!1,rtl:p=!1,virtual:g=!1,focusItemOnOpen:v="auto",focusItemOnHover:y=!0,openOnArrowKeyDown:w=!0,disabledIndices:A=void 0,orientation:k="vertical",cols:E=1,scrollItemIntoView:I=!0,virtualItemRef:M}=t;process.env.NODE_ENV!=="production"&&(h&&(d||console.warn(["Floating UI: `useListNavigation` looping must be enabled to allow","escaping."].join(" ")),g||console.warn(["Floating UI: `useListNavigation` must be virtual to allow","escaping."].join(" "))),k==="vertical"&&E>1&&console.warn(["Floating UI: In grid list navigation mode (`cols` > 1), the",'`orientation` should be either "horizontal" or "both".'].join(" ")));const L=zm(),T=ko(),O=pn(u),H=C.useRef(v),P=C.useRef(c??-1),F=C.useRef(null),_=C.useRef(!0),z=C.useRef(O),$=C.useRef(!!s),U=C.useRef(!1),W=C.useRef(!1),b=hn(A),N=hn(n),R=hn(I),[S,V]=C.useState(),[ee,Y]=C.useState(),G=pn(function(K,re,B){B===void 0&&(B=!1);const ne=K.current[re.current];ne&&(g?(V(ne.id),T==null||T.events.emit("virtualfocus",ne),M&&(M.current=ne)):Qt(ne,{preventScroll:!0,sync:NI()&&lm()?Zm||U.current:!1}),requestAnimationFrame(()=>{const me=R.current;me&&ne&&(B||!_.current)&&(ne.scrollIntoView==null||ne.scrollIntoView(typeof me=="boolean"?{block:"nearest",inline:"nearest"}:me))}))});Ke(()=>{document.createElement("div").focus({get preventScroll(){return Zm=!0,!1}})},[]),Ke(()=>{f&&(n&&s?H.current&&c!=null&&(W.current=!0,O(c)):$.current&&(P.current=-1,z.current(null)))},[f,n,s,c,O]),Ke(()=>{if(f&&n&&s)if(l==null){if(U.current=!1,c!=null)return;if($.current&&(P.current=-1,G(a,P)),!$.current&&H.current&&(F.current!=null||H.current===!0&&F.current==null)){let K=0;const re=()=>{a.current[0]==null?(K<2&&(K?requestAnimationFrame:queueMicrotask)(re),K++):(P.current=F.current==null||Cl(F.current,k,p)||m?yl(a,b.current):Rm(a,b.current),F.current=null,O(P.current))};re()}}else li(a,l)||(P.current=l,G(a,P,W.current),W.current=!1)},[f,n,s,l,c,m,a,k,p,O,G,b]),Ke(()=>{var K,re;if(!f||s||!T||g||!$.current)return;const B=T.nodesRef.current,ne=(K=B.find(Q=>Q.id===L))==null||(re=K.context)==null?void 0:re.elements.floating,me=cn(Lt(s)),we=B.some(Q=>Q.context&&dt(Q.context.elements.floating,me));ne&&!we&&_.current&&ne.focus({preventScroll:!0})},[f,s,T,L,g]),Ke(()=>{if(!f||!T||!g||L)return;function K(re){Y(re.id),M&&(M.current=re)}return T.events.on("virtualfocus",K),()=>{T.events.off("virtualfocus",K)}},[f,T,g,L,M]),Ke(()=>{z.current=O,$.current=!!s}),Ke(()=>{n||(F.current=null)},[n]);const J=l!=null,se=C.useMemo(()=>{function K(B){if(!n)return;const ne=a.current.indexOf(B);ne!==-1&&O(ne)}return{onFocus(B){let{currentTarget:ne}=B;K(ne)},onClick:B=>{let{currentTarget:ne}=B;return ne.focus({preventScroll:!0})},...y&&{onMouseMove(B){let{currentTarget:ne}=B;K(ne)},onPointerLeave(B){let{pointerType:ne}=B;!_.current||ne==="touch"||(P.current=-1,G(a,P),O(null),g||Qt(i.floating.current,{preventScroll:!0}))}}}},[n,i,G,y,a,O,g]);return C.useMemo(()=>{if(!f)return{};const K=b.current;function re(Q){if(_.current=!1,U.current=!0,!N.current&&Q.currentTarget===i.floating.current)return;if(m&&Xm(Q.key,k,p)){Xe(Q),r(!1,Q.nativeEvent),tr(o)&&!g&&o.focus();return}const ue=P.current,de=yl(a,K),fe=Rm(a,K);if(Q.key==="Home"&&(Xe(Q),P.current=de,O(P.current)),Q.key==="End"&&(Xe(Q),P.current=fe,O(P.current)),!(E>1&&(P.current=WO(a,{event:Q,orientation:k,loop:d,cols:E,disabledIndices:K,minIndex:de,maxIndex:fe,prevIndex:P.current,stopEvent:!0}),O(P.current),k==="both"))&&Jm(Q.key,k)){if(Xe(Q),n&&!g&&cn(Q.currentTarget.ownerDocument)===Q.currentTarget){P.current=Cl(Q.key,k,p)?de:fe,O(P.current);return}Cl(Q.key,k,p)?d?P.current=ue>=fe?h&&ue!==a.current.length?-1:de:rt(a,{startingIndex:ue,disabledIndices:K}):P.current=Math.min(fe,rt(a,{startingIndex:ue,disabledIndices:K})):d?P.current=ue<=de?h&&ue!==-1?a.current.length:fe:rt(a,{startingIndex:ue,decrement:!0,disabledIndices:K}):P.current=Math.max(de,rt(a,{startingIndex:ue,decrement:!0,disabledIndices:K})),li(a,P.current)?O(null):O(P.current)}}function B(Q){v==="auto"&&sm(Q.nativeEvent)&&(H.current=!0)}function ne(Q){H.current=v,v==="auto"&&am(Q.nativeEvent)&&(H.current=!0)}const me=g&&n&&J&&{"aria-activedescendant":ee||S},we=a.current.find(Q=>(Q==null?void 0:Q.id)===S);return{reference:{...me,onKeyDown(Q){_.current=!1;const ue=Q.key.indexOf("Arrow")===0,de=yD(Q.key,k,p),fe=Xm(Q.key,k,p),Te=Jm(Q.key,k),Fe=(m?de:Te)||Q.key==="Enter"||Q.key.trim()==="";if(g&&n){const ae=T==null?void 0:T.nodesRef.current.find(q=>q.parentId==null),j=T&&ae?JO(T.nodesRef.current,ae.id):null;if(ue&&j&&M){const q=new KeyboardEvent("keydown",{key:Q.key,bubbles:!0});if(de||fe){var De,Ue;const oe=((De=j.context)==null?void 0:De.elements.domReference)===Q.currentTarget,le=fe&&!oe?(Ue=j.context)==null?void 0:Ue.elements.domReference:de?we:null;le&&(Xe(Q),le.dispatchEvent(q),Y(void 0))}if(Te&&j.context&&j.context.open&&j.parentId&&Q.currentTarget!==j.context.elements.domReference){var te;Xe(Q),(te=j.context.elements.domReference)==null||te.dispatchEvent(q);return}}return re(Q)}if(!(!n&&!w&&ue)){if(Fe&&(F.current=m&&Te?null:Q.key),m){de&&(Xe(Q),n?(P.current=yl(a,K),O(P.current)):r(!0,Q.nativeEvent));return}Te&&(c!=null&&(P.current=c),Xe(Q),!n&&w?r(!0,Q.nativeEvent):re(Q),n&&O(P.current))}},onFocus(){n&&O(null)},onPointerDown:ne,onMouseDown:B,onClick:B},floating:{"aria-orientation":k==="both"?void 0:k,...me,onKeyDown:re,onPointerMove(){_.current=!0}},item:se}},[o,i,S,ee,b,N,a,f,k,p,g,n,J,m,c,w,h,E,d,v,O,r,se,T,M])}function bD(e,t){t===void 0&&(t={});const{open:n,floatingId:r}=e,{enabled:i=!0,role:o="dialog"}=t,s=bl();return C.useMemo(()=>{const a={id:r,role:o};return i?o==="tooltip"?{reference:{"aria-describedby":n?r:void 0},floating:a}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":o==="alertdialog"?"dialog":o,"aria-controls":n?r:void 0,...o==="listbox"&&{role:"combobox"},...o==="menu"&&{id:s}},floating:{...a,...o==="menu"&&{"aria-labelledby":s}}}:{}},[i,o,n,r,s])}function wD(e,t){var n;const{open:r,dataRef:i}=e,{listRef:o,activeIndex:s,onMatch:a,onTypingChange:l,enabled:u=!0,findMatch:f=null,resetMs:c=750,ignoreKeys:h=[],selectedIndex:d=null}=t,m=C.useRef(),p=C.useRef(""),g=C.useRef((n=d??s)!=null?n:-1),v=C.useRef(null),y=pn(a),w=pn(l),A=hn(f),k=hn(h);return Ke(()=>{r&&(clearTimeout(m.current),v.current=null,p.current="")},[r]),Ke(()=>{if(r&&p.current===""){var E;g.current=(E=d??s)!=null?E:-1}},[r,d,s]),C.useMemo(()=>{if(!u)return{};function E(L){L?i.current.typing||(i.current.typing=L,w(L)):i.current.typing&&(i.current.typing=L,w(L))}function I(L,T,O){const H=A.current?A.current(T,O):T.find(P=>(P==null?void 0:P.toLocaleLowerCase().indexOf(O.toLocaleLowerCase()))===0);return H?L.indexOf(H):-1}function M(L){const T=o.current;if(p.current.length>0&&p.current[0]!==" "&&(I(T,T,p.current)===-1?E(!1):L.key===" "&&Xe(L)),T==null||k.current.includes(L.key)||L.key.length!==1||L.ctrlKey||L.metaKey||L.altKey)return;r&&L.key!==" "&&(Xe(L),E(!0)),T.every(F=>{var _,z;return F?((_=F[0])==null?void 0:_.toLocaleLowerCase())!==((z=F[1])==null?void 0:z.toLocaleLowerCase()):!0})&&p.current===L.key&&(p.current="",g.current=v.current),p.current+=L.key,clearTimeout(m.current),m.current=setTimeout(()=>{p.current="",g.current=v.current,E(!1)},c);const H=g.current,P=I(T,[...T.slice((H||0)+1),...T.slice(0,(H||0)+1)],p.current);P!==-1?(y(P),v.current=P):L.key!==" "&&(p.current="",E(!1))}return{reference:{onKeyDown:M},floating:{onKeyDown:M,onKeyUp(L){L.key===" "&&E(!1)}}}},[u,r,i,o,c,k,A,y,w])}const SD=({options:e,reusable:t,sendMessage:n,isReadOnly:r})=>{var z,$,U,W,b;const i=Ye(),o=Jn(N=>N.messageContainerRef),s=Jn(N=>N.portalContainer),[a,l]=C.useState(!1),[u,f]=C.useState(null),[c,h]=C.useState(null),{message:{blocks:{dropdown:d}}}=ye,m=e.reduce((N,R)=>(N[R.label]=R.value,N),{}),p=m?Object.keys(m):[],g=N=>{l(c!==null&&!t?!1:N)},{refs:v,floatingStyles:y,context:w}=mD({placement:"bottom-start",open:a,onOpenChange:g,whileElementsMounted:vO,middleware:[AO(5),TO({padding:10,boundary:(o==null?void 0:o.current)??void 0,crossAxis:!0}),IO({apply({rects:N,elements:R,availableHeight:S}){Object.assign(R.floating.style,{maxHeight:`${S}px`,minWidth:`${N.reference.width}px`})},padding:10})]}),A=C.useRef([]),k=C.useRef(p),E=C.useRef(!1),I=uD(w,{event:"mousedown"}),M=pD(w),L=bD(w,{role:"listbox"}),T=vD(w,{listRef:A,activeIndex:u,selectedIndex:c,onNavigate:f,loop:!0}),O=wD(w,{listRef:k,activeIndex:u,selectedIndex:c,onMatch:a?f:h,onTypingChange(N){E.current=N}}),{getReferenceProps:H,getFloatingProps:P,getItemProps:F}=gD([M,L,T,O,I]),_=N=>{h(N),p[N]!==void 0&&(n==null||n({type:"text",text:p[N]??"",value:m[p[N]]??""})),l(!1)};return x.jsxs(x.Fragment,{children:[x.jsxs("div",{tabIndex:0,ref:v.setReference,"aria-labelledby":"select-label","aria-autocomplete":"none","data-disabled":c!==null&&!t?"":void 0,style:r?{pointerEvents:"none"}:void 0,...(z=d.button)==null?void 0:z.container,...H(),children:[x.jsx("span",{...($=d.button)==null?void 0:$.text,children:c?p[c]:i["dropdown.placeholder"]}),x.jsx(qA,{...(U=d.button)==null?void 0:U.icon})]}),a&&x.jsx(sD,{root:s??void 0,children:x.jsx(lD,{context:w,modal:!1,children:x.jsx("div",{ref:v.setFloating,className:(b=(W=d.content)==null?void 0:W.container)==null?void 0:b.className,style:{...y,pointerEvents:"auto"},...P(),children:p.map((N,R)=>{var S;return x.jsx("div",{ref:V=>{A.current[R]=V},role:"option",tabIndex:R===u?0:-1,"aria-selected":R===c&&R===u,"data-active":R===u?"":void 0,...(S=d.content)==null?void 0:S.item,...F({onClick(){_(R)},onKeyDown(V){V.key==="Enter"&&(V.preventDefault(),_(R)),V.key===" "&&!E.current&&(V.preventDefault(),_(R))}}),children:N},N)})})})})]})},eg=D.forwardRef(({title:e,url:t,isReadOnly:n,...r},i)=>{const{message:{blocks:{file:o}}}=ye;return x.jsxs("a",{...r,...o.container,href:t,style:n?{pointerEvents:"none"}:void 0,download:!0,ref:i,target:"_blank",rel:"noreferrer",children:[x.jsx("p",{...o.title,children:e||t}),x.jsx(QA,{...o.icon})]})});eg.displayName="File";const kD=un()((e,t)=>({components:{},getCustomComponent:async n=>{const r=t().components[n];if(r)return r;const i=await fetch(n).then(u=>u.text()),o=new Blob([i],{type:"application/javascript"}),a=await import(URL.createObjectURL(o)),l=()=>a.default;return e(u=>({components:{...u.components,[n]:l}})),l}}));globalThis.React=D;const tg={audio:Vp,bubble:Bp,button:HT,carousel:tm,column:qp,dropdown:SD,file:eg,image:Up,location:Wp,row:Yp,text:vT,video:jp,custom:({url:e,name:t,data:n,...r})=>{const i=kD(u=>u.getCustomComponent),[o,s]=D.useState(null),[a,l]=D.useState(null);return D.useEffect(()=>{i(e).then(s).catch(u=>{l(u.message)})},[e]),a?x.jsx("div",{style:{color:"red"},children:a}):o?x.jsx(o,{...n,...r}):null}},Nn=({block:e,renderers:t,...n})=>{const r=(t==null?void 0:t[e.type])??tg[e.type],i={...n,...e};return x.jsx(r,{...i})};function ng(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=ng(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ur(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=ng(e))&&(r&&(r+=" "),r+=t);return r}const xD=({disabled:e,onFileSelected:t})=>{const n=D.useRef(null),{uploadButton:r}=ye.composer,i=Ye(),o=()=>{n.current&&n.current.click()},s=a=>{const l=a.target.files;l&&l.length>0&&Array.from(l).forEach(u=>{t(u)})};return x.jsxs(x.Fragment,{children:[x.jsx(aT,{...r,role:"button",tabIndex:0,"aria-label":i["composer.fileButton.ariaLabel"],"data-disabled":e,onClick:o}),x.jsx("input",{value:"",multiple:!0,type:"file",ref:n,style:{display:"none"},onChange:s})]})},ED=({name:e,type:t,instance:n,status:r,removeFile:i})=>{const{loader:o,fileIcon:s,removeIcon:a,errorIcon:l,previewImage:u}=ye.composer.fileWidget,f=Ye(),c=CD(n.name,f["fileAttachment.fallbackExtension"]),h=["PNG","JPEG","JPG"].includes(c);return r==="loading"?x.jsx(To,{name:e,status:r,removeButton:x.jsx("div",{...o}),extension:c,children:x.jsx("div",{...s.container,children:x.jsx(Al,{type:t,...s.icon})})}):r==="error"?x.jsx(To,{name:e,status:r,removeButton:x.jsx(rg,{removeFile:()=>i(e)}),extension:f["fileAttachment.uploadError"],children:x.jsxs("div",{...s.container,children:[x.jsx(YA,{...l}),x.jsx(Al,{type:t,...s.icon})]})}):r=="uploaded"&&h?x.jsx(To,{name:e,status:r,removeButton:x.jsx(rg,{removeFile:()=>i(e)}),extension:c,children:x.jsx("div",{...s.container,children:x.jsx("img",{src:URL.createObjectURL(n),alt:e,...u})})}):x.jsx(To,{name:e,status:r,removeButton:x.jsx(gp,{onClick:()=>i(e),...a}),extension:c,children:x.jsx("div",{...s.container,children:x.jsx(Al,{type:t,...s.icon})})})},To=({name:e,status:t,removeButton:n,children:r,extension:i})=>{const{container:o,metadata:s}=ye.composer.fileWidget;return x.jsxs("div",{"data-status":t,title:e,...o,children:[n,r,x.jsxs("div",{...s.container,children:[x.jsx("div",{...s.name,children:e}),x.jsx("div",{...s.type,children:i})]})]})},Al=({type:e,...t})=>e==="image"?x.jsx(XA,{...t}):e==="video"?x.jsx(pT,{...t}):e==="audio"?x.jsx(bp,{...t}):x.jsx(yp,{...t}),CD=(e,t)=>{if(!e)return t;const n=e.split(".").pop();return n?n.toUpperCase():t},rg=({removeFile:e})=>{const{composer:{fileWidget:{removeIcon:t}}}=ye,n=Ye();return x.jsx(gp,{role:"button",tabIndex:0,"aria-label":n["fileAttachment.removeButton.ariaLabel"],onClick:()=>e(),...t})};function Tl(){return Tl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Tl.apply(null,arguments)}function AD(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var TD=D.useLayoutEffect,ID=function(t){var n=D.useRef(t);return TD(function(){n.current=t}),n},ig=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},OD=function(t,n){var r=D.useRef();return D.useCallback(function(i){t.current=i,r.current&&ig(r.current,null),r.current=n,n&&ig(n,i)},[n])},og={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},DD=function(t){Object.keys(og).forEach(function(n){t.style.setProperty(n,og[n],"important")})},sg=DD,at=null,ag=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function MD(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),at||(at=document.createElement("textarea"),at.setAttribute("tabindex","-1"),at.setAttribute("aria-hidden","true"),sg(at)),at.parentNode===null&&document.body.appendChild(at);var i=e.paddingSize,o=e.borderSize,s=e.sizingStyle,a=s.boxSizing;Object.keys(s).forEach(function(h){var d=h;at.style[d]=s[d]}),sg(at),at.value=t;var l=ag(at,e);at.value=t,l=ag(at,e),at.value="x";var u=at.scrollHeight-i,f=u*n;a==="border-box"&&(f=f+i+o),l=Math.max(f,l);var c=u*r;return a==="border-box"&&(c=c+i+o),l=Math.min(c,l),[l,u]}var lg=function(){},ND=function(t,n){return t.reduce(function(r,i){return r[i]=n[i],r},{})},LD=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],_D=!!document.documentElement.currentStyle,PD=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=ND(LD,n),i=r.boxSizing;if(i==="")return null;_D&&i==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var o=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),s=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:o,borderSize:s}},FD=PD;function ug(e,t,n){var r=ID(n);C.useLayoutEffect(function(){var i=function(s){return r.current(s)};if(e)return e.addEventListener(t,i),function(){return e.removeEventListener(t,i)}},[])}var RD=function(t){ug(window,"resize",t)},BD=function(t){ug(document.fonts,"loadingdone",t)},$D=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],zD=function(t,n){var r=t.cacheMeasurements,i=t.maxRows,o=t.minRows,s=t.onChange,a=s===void 0?lg:s,l=t.onHeightChange,u=l===void 0?lg:l,f=AD(t,$D),c=f.value!==void 0,h=C.useRef(null),d=OD(h,n),m=C.useRef(0),p=C.useRef(),g=function(){var w=h.current,A=r&&p.current?p.current:FD(w);if(A){p.current=A;var k=MD(A,w.value||w.placeholder||"x",o,i),E=k[0],I=k[1];m.current!==E&&(m.current=E,w.style.setProperty("height",E+"px","important"),u(E,{rowHeight:I}))}},v=function(w){c||g(),a(w)};return C.useLayoutEffect(g),RD(g),BD(g),C.createElement("textarea",Tl({},f,{onChange:v,ref:d}))},HD=C.forwardRef(zD);const UD=({inputRef:e,composerPlaceholder:t,composerDisabled:n,textInput:r,historyIndex:i,setTextInput:o,setHistoryIndex:s,sendComposerMessage:a,allowFileUpload:l,onFilePasted:u,conversationId:f,storageKey:c})=>{const d=Dp(f||"default",c)(k=>k.messageHistory),[m,p]=D.useState(""),[g,v]=D.useState(!1),{input:y}=ye.composer,w=Ye(),A=k=>{if(!l||!u||!k.clipboardData)return;const E=Array.from(k.clipboardData.files);E.length>0&&(k.preventDefault(),E.forEach(I=>{u(I)}))};return x.jsx(HD,{...y,"aria-label":w["composer.messageInput.ariaLabel"],ref:e,placeholder:t??w["composer.placeholder"],disabled:n,value:r,"data-has-value":!!r,onChange:k=>{const E=k.target.value;o(E),d.includes(E)||s(-1)},onPaste:A,maxRows:5,onKeyDown:k=>{if(n)return;const E=k.nativeEvent;if(!(E.isComposing||E.keyCode===229)&&(r.length===0&&v(!1),k.key!=="ArrowUp"&&k.key!=="ArrowDown"&&k.key!=="ArrowLeft"&&k.key!=="ArrowRight"&&v(!0),k.key==="Enter"&&k.shiftKey?(k.preventDefault(),o(`${r}
289
- `)):k.key==="Enter"&&(k.preventDefault(),a()),!(r.length>0&&g))){if(k.key==="ArrowUp"){k.preventDefault(),i===-1&&r.trim()!==""&&p(r);const I=Math.min(i+1,d.length-1);s(I),o(d[I]??"")}if(k.key==="ArrowDown"){k.preventDefault();const I=Math.max(i-1,-1);o(i===-1?r.trim():I===-1?m:d[I]??""),s(I)}}}})},jD=({disabled:e,setTextInput:t})=>{const n=Ye(),[r,i]=D.useState(!1),o=D.useRef(null),{voiceButton:s}=ye.composer,a=window.SpeechRecognition||window.webkitSpeechRecognition,l=()=>{o.current||(o.current=new a);const u=o.current;u&&(u.continuous=!0,u.onresult=f=>{var h,d,m;const c=((m=(d=(h=f.results)==null?void 0:h[0])==null?void 0:d[0])==null?void 0:m.transcript)??"";t(c??""),u.stop(),i(!1)},r?(u.stop(),i(!1)):(u.start(),i(!0)))};if(a)return x.jsx(iT,{...s,tabIndex:0,"aria-label":n["composer.voiceButton.ariaLabel"],role:"button","data-show":!e,"data-listens":!!r,onClick:l})},cg=D.memo(D.forwardRef(({className:e,inputRef:t,disableComposer:n,isReadOnly:r,allowFileUpload:i,disableSendButton:o,connected:s,composerPlaceholder:a,footer:l,sendMessage:u,uploadFile:f,storageKey:c,conversationId:h,children:d,...m},p)=>{const{composer:g}=ye,v=Ye(),y=n||r||!s,[w,A]=D.useState(""),[k,E]=D.useState(-1),I=Lp(h||"default"),M=Dp(h||"default",c),L=I($=>$.files),T=I($=>$.setFiles),O=I($=>$.deleteFile),H=I($=>$.uploadFile),P=M($=>$.addMessageToHistory),F=L.filter($=>$.status==="uploaded"),_=!!w.trim()||F.length>0,z=()=>{if(o||!_)return;const $=F.map(W=>{const b=W.url,N=W.type,R=W.fileId;return{video:{type:"video",videoUrl:b,fileId:R},audio:{type:"audio",audioUrl:b,fileId:R},image:{type:"image",imageUrl:b,fileId:R}}[N]??{title:W.name,type:"file",fileUrl:b,fileId:R}})??[];w&&$.push({type:"text",text:w});let U;$.length==1?U=$[0]:U={type:"bloc",items:$.map(b=>{const{type:N,...R}=b;return{type:N,payload:R}})},A(""),u==null||u(U),T([]),P(w),E(-1)};return r?null:x.jsxs(x.Fragment,{children:[x.jsxs("div",{"data-disabled":y,"data-waiting":o,className:ur(g.container.className,e),ref:p,...m,children:[d,L.length>0&&x.jsx("div",{...g==null?void 0:g.fileContainer,children:L.map($=>x.jsx(ED,{...$,removeFile:O},$.name))}),x.jsxs("div",{...g.inputContainer,onClick:()=>{t&&"current"in t&&t.current&&t.current.focus()},children:[i&&x.jsx(xD,{disabled:y,onFileSelected:$=>{f&&H($,f)}}),x.jsx(UD,{inputRef:t,composerPlaceholder:a,composerDisabled:y,textInput:w,historyIndex:k,setTextInput:A,setHistoryIndex:E,sendComposerMessage:z,allowFileUpload:i,onFilePasted:$=>{f&&H($,f)},conversationId:h,storageKey:c}),o&&x.jsx(eT,{...g.inputLoader,role:"status","data-show":o}),!y&&!o&&x.jsxs(x.Fragment,{children:[x.jsx(VA,{...g.sendbutton,role:"button",tabIndex:0,"aria-label":v["composer.sendButton.ariaLabel"],"data-show":_,onClick:()=>z()}),x.jsx(jD,{disabled:_,setTextInput:A})]})]})]}),x.jsx(Nh,{components:{a:({node:$,...U})=>x.jsx("a",{...U,target:"_blank",rel:"noreferrer noopener"})},allowedElements:["a","strong","code","em","p","span"],...g.footer,children:l})]})}));var Il={exports:{}},Io={exports:{}},Ie={};/** @license React v16.13.1
288
+ */var OO=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],hl=OO.join(","),Dm=typeof Element>"u",oi=Dm?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,vo=!Dm&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},si=function(t,n){var r;n===void 0&&(n=!0);var i=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),o=i===""||i==="true",s=o||n&&t&&si(t.parentNode);return s},DO=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},MO=function(t,n,r){if(si(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(hl));return n&&oi.call(t,hl)&&i.unshift(t),i=i.filter(r),i},pl=function(t,n,r){for(var i=[],o=Array.from(t);o.length;){var s=o.shift();if(!si(s,!1))if(s.tagName==="SLOT"){var a=s.assignedElements(),l=a.length?a:s.children,u=pl(l,!0,r);r.flatten?i.push.apply(i,u):i.push({scopeParent:s,candidates:u})}else{var f=oi.call(s,hl);f&&r.filter(s)&&(n||!t.includes(s))&&i.push(s);var c=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),h=!si(c,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(c&&h){var d=pl(c===!0?s.children:c.children,!0,r);r.flatten?i.push.apply(i,d):i.push({scopeParent:s,candidates:d})}else o.unshift.apply(o,s.children)}}return i},Mm=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Nm=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||DO(t))&&!Mm(t)?0:t.tabIndex},NO=function(t,n){var r=Nm(t);return r<0&&n&&!Mm(t)?0:r},LO=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Lm=function(t){return t.tagName==="INPUT"},_O=function(t){return Lm(t)&&t.type==="hidden"},PO=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},FO=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},RO=function(t){if(!t.name)return!0;var n=t.form||vo(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=r(window.CSS.escape(t.name));else try{i=r(t.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var o=FO(i,t.form);return!o||o===t},BO=function(t){return Lm(t)&&t.type==="radio"},$O=function(t){return BO(t)&&!RO(t)},zO=function(t){var n,r=t&&vo(t),i=(n=r)===null||n===void 0?void 0:n.host,o=!1;if(r&&r!==t){var s,a,l;for(o=!!((s=i)!==null&&s!==void 0&&(a=s.ownerDocument)!==null&&a!==void 0&&a.contains(i)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!o&&i;){var u,f,c;r=vo(i),i=(u=r)===null||u===void 0?void 0:u.host,o=!!((f=i)!==null&&f!==void 0&&(c=f.ownerDocument)!==null&&c!==void 0&&c.contains(i))}}return o},_m=function(t){var n=t.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},HO=function(t,n){var r=n.displayCheck,i=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var o=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!o}if(getComputedStyle(t).visibility==="hidden")return!0;var s=oi.call(t,"details>summary:first-of-type"),a=s?t.parentElement:t;if(oi.call(a,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof i=="function"){for(var l=t;t;){var u=t.parentElement,f=vo(t);if(u&&!u.shadowRoot&&i(u)===!0)return _m(t);t.assignedSlot?t=t.assignedSlot:!u&&f!==t.ownerDocument?t=f.host:t=u}t=l}if(zO(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return _m(t);return!1},UO=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var i=n.children.item(r);if(i.tagName==="LEGEND")return oi.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},jO=function(t,n){return!(n.disabled||si(n)||_O(n)||HO(n,t)||PO(n)||UO(n))},Pm=function(t,n){return!($O(n)||Nm(n)<0||!jO(t,n))},VO=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Fm=function(t){var n=[],r=[];return t.forEach(function(i,o){var s=!!i.scopeParent,a=s?i.scopeParent:i,l=NO(a,s),u=s?Fm(i.candidates):a;l===0?s?n.push.apply(n,u):n.push(a):r.push({documentOrder:o,tabIndex:l,item:i,isScope:s,content:u})}),r.sort(LO).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},ml=function(t,n){n=n||{};var r;return n.getShadowRoot?r=pl([t],n.includeContainer,{filter:Pm.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:VO}):r=MO(t,n.includeContainer,Pm.bind(null,n)),Fm(r)};const gl="ArrowUp",bo="ArrowDown",sr="ArrowLeft",ai="ArrowRight";function wo(e,t,n){return Math.floor(e/t)!==n}function li(e,t){return t<0||t>=e.current.length}function yl(e,t){return rt(e,{disabledIndices:t})}function Rm(e,t){return rt(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function rt(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:i,amount:o=1}=t===void 0?{}:t;const s=e.current;let a=n;do{var l,u;a=a+(r?-o:o)}while(a>=0&&a<=s.length-1&&(i?i.includes(a):s[a]==null||(l=s[a])!=null&&l.hasAttribute("disabled")||((u=s[a])==null?void 0:u.getAttribute("aria-disabled"))==="true"));return a}function WO(e,t){let{event:n,orientation:r,loop:i,cols:o,disabledIndices:s,minIndex:a,maxIndex:l,prevIndex:u,stopEvent:f=!1}=t,c=u;if(n.key===gl){if(f&&Xe(n),u===-1)c=l;else if(c=rt(e,{startingIndex:c,amount:o,decrement:!0,disabledIndices:s}),i&&(u-o<a||c<0)){const h=u%o,d=l%o,m=l-(d-h);d===h?c=l:c=d>h?m:m-o}li(e,c)&&(c=u)}if(n.key===bo&&(f&&Xe(n),u===-1?c=a:(c=rt(e,{startingIndex:u,amount:o,disabledIndices:s}),i&&u+o>l&&(c=rt(e,{startingIndex:u%o-o,amount:o,disabledIndices:s}))),li(e,c)&&(c=u)),r==="both"){const h=nm(u/o);n.key===ai&&(f&&Xe(n),u%o!==o-1?(c=rt(e,{startingIndex:u,disabledIndices:s}),i&&wo(c,o,h)&&(c=rt(e,{startingIndex:u-u%o-1,disabledIndices:s}))):i&&(c=rt(e,{startingIndex:u-u%o-1,disabledIndices:s})),wo(c,o,h)&&(c=u)),n.key===sr&&(f&&Xe(n),u%o!==0?(c=rt(e,{startingIndex:u,disabledIndices:s,decrement:!0}),i&&wo(c,o,h)&&(c=rt(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}))):i&&(c=rt(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s})),wo(c,o,h)&&(c=u));const d=nm(l/o)===h;li(e,c)&&(i&&d?c=n.key===sr?l:rt(e,{startingIndex:u-u%o-1,disabledIndices:s}):c=u)}return c}let Bm=0;function Qt(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(Bm);const o=()=>e==null?void 0:e.focus({preventScroll:n});i?o():Bm=requestAnimationFrame(o)}var Ke=typeof document<"u"?D.useLayoutEffect:D.useEffect;function So(){return So=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},So.apply(this,arguments)}let vl=!1,qO=0;const $m=()=>"floating-ui-"+qO++;function YO(){const[e,t]=C.useState(()=>vl?$m():void 0);return Ke(()=>{e==null&&t($m())},[]),C.useEffect(()=>{vl||(vl=!0)},[]),e}const bl=C.useId||YO;function KO(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(i=>i!==n))||[])}}}const GO=C.createContext(null),QO=C.createContext(null),zm=()=>{var e;return((e=C.useContext(GO))==null?void 0:e.id)||null},ko=()=>C.useContext(QO);function ui(e){return"data-floating-ui-"+e}function hn(e){const t=D.useRef(e);return Ke(()=>{t.current=e}),t}function ZO(e,t){var n;let r=[],i=(n=e.find(o=>o.id===t))==null?void 0:n.parentId;for(;i;){const o=e.find(s=>s.id===i);i=o==null?void 0:o.parentId,o&&(r=r.concat(o))}return r}function ar(e,t){let n=e.filter(i=>{var o;return i.parentId===t&&((o=i.context)==null?void 0:o.open)}),r=n;for(;r.length;)r=e.filter(i=>{var o;return(o=r)==null?void 0:o.some(s=>{var a;return i.parentId===s.id&&((a=i.context)==null?void 0:a.open)})}),n=n.concat(r);return n}function JO(e,t){let n,r=-1;function i(o,s){s>r&&(n=o,r=s),ar(e,o).forEach(l=>{i(l.id,s+1)})}return i(t,0),e.find(o=>o.id===n)}let lr=new WeakMap,xo=new WeakSet,Eo={},wl=0;const XO=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,Hm=e=>e&&(e.host||Hm(e.parentNode)),eD=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=Hm(n);return e.contains(r)?r:null}).filter(n=>n!=null);function tD(e,t,n,r){const i="data-floating-ui-inert",o=r?"inert":n?"aria-hidden":null,s=eD(t,e),a=new Set,l=new Set(s),u=[];Eo[i]||(Eo[i]=new WeakMap);const f=Eo[i];s.forEach(c),h(t),a.clear();function c(d){!d||a.has(d)||(a.add(d),d.parentNode&&c(d.parentNode))}function h(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,m=>{if(a.has(m))h(m);else{const p=o?m.getAttribute(o):null,g=p!==null&&p!=="false",y=(lr.get(m)||0)+1,v=(f.get(m)||0)+1;lr.set(m,y),f.set(m,v),u.push(m),y===1&&g&&xo.add(m),v===1&&m.setAttribute(i,""),!g&&o&&m.setAttribute(o,"true")}})}return wl++,()=>{u.forEach(d=>{const m=(lr.get(d)||0)-1,p=(f.get(d)||0)-1;lr.set(d,m),f.set(d,p),m||(!xo.has(d)&&o&&d.removeAttribute(o),xo.delete(d)),p||d.removeAttribute(i)}),wl--,wl||(lr=new WeakMap,lr=new WeakMap,xo=new WeakSet,Eo={})}}function Um(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=Lt(e[0]).body;return tD(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Sl=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function jm(e,t){const n=ml(e,Sl());t==="prev"&&n.reverse();const r=n.indexOf(cn(Lt(e)));return n.slice(r+1)[0]}function Vm(){return jm(document.body,"next")}function Wm(){return jm(document.body,"prev")}function ci(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!dt(n,r)}function nD(e){ml(e,Sl()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function rD(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const kl={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};let iD;function qm(e){e.key==="Tab"&&(e.target,clearTimeout(iD))}const Co=C.forwardRef(function(t,n){const[r,i]=C.useState();Ke(()=>(lm()&&i("button"),document.addEventListener("keydown",qm),()=>{document.removeEventListener("keydown",qm)}),[]);const o={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[ui("focus-guard")]:"",style:kl};return C.createElement("span",So({},t,o))}),Ym=C.createContext(null);function oD(e){let{id:t,root:n}=e===void 0?{}:e;const[r,i]=C.useState(null),o=bl(),s=Km(),a=C.useMemo(()=>({id:t,root:n,portalContext:s,uniqueId:o}),[t,n,s,o]),l=C.useRef();return Ke(()=>()=>{r==null||r.remove()},[r,a]),Ke(()=>{if(l.current===a)return;l.current=a;const{id:u,root:f,portalContext:c,uniqueId:h}=a,d=u?document.getElementById(u):null,m=ui("portal");if(d){const p=document.createElement("div");p.id=h,p.setAttribute(m,""),d.appendChild(p),i(p)}else{let p=f||(c==null?void 0:c.portalNode);p&&!Et(p)&&(p=p.current),p=p||document.body;let g=null;u&&(g=document.createElement("div"),g.id=u,p.appendChild(g));const y=document.createElement("div");y.id=h,y.setAttribute(m,""),p=g||p,p.appendChild(y),i(y)}},[a]),r}function sD(e){let{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e;const o=oD({id:n,root:r}),[s,a]=C.useState(null),l=C.useRef(null),u=C.useRef(null),f=C.useRef(null),c=C.useRef(null),h=!!s&&!s.modal&&s.open&&i&&!!(r||o);return C.useEffect(()=>{if(!o||!i||s!=null&&s.modal)return;function d(m){o&&ci(m)&&(m.type==="focusin"?rD:nD)(o)}return o.addEventListener("focusin",d,!0),o.addEventListener("focusout",d,!0),()=>{o.removeEventListener("focusin",d,!0),o.removeEventListener("focusout",d,!0)}},[o,i,s==null?void 0:s.modal]),C.createElement(Ym.Provider,{value:C.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:f,afterInsideRef:c,portalNode:o,setFocusManagerState:a}),[i,o])},h&&o&&C.createElement(Co,{"data-type":"outside",ref:l,onFocus:d=>{if(ci(d,o)){var m;(m=f.current)==null||m.focus()}else{const p=Wm()||(s==null?void 0:s.refs.domReference.current);p==null||p.focus()}}}),h&&o&&C.createElement("span",{"aria-owns":o.id,style:kl}),o&&$u.createPortal(t,o),h&&o&&C.createElement(Co,{"data-type":"outside",ref:u,onFocus:d=>{if(ci(d,o)){var m;(m=c.current)==null||m.focus()}else{const p=Vm()||(s==null?void 0:s.refs.domReference.current);p==null||p.focus(),s!=null&&s.closeOnFocusOut&&(s==null||s.onOpenChange(!1,d.nativeEvent))}}}))}const Km=()=>C.useContext(Ym),aD=C.forwardRef(function(t,n){return C.createElement("button",So({},t,{type:"button",ref:n,tabIndex:-1,style:kl}))});function lD(e){const{context:t,children:n,disabled:r=!1,order:i=["content"],guards:o=!0,initialFocus:s=0,returnFocus:a=!0,modal:l=!0,visuallyHiddenDismiss:u=!1,closeOnFocusOut:f=!0}=e,{open:c,refs:h,nodeId:d,onOpenChange:m,events:p,dataRef:g,elements:{domReference:y,floating:v}}=t,w=XO()?o:!0,A=hn(i),k=hn(s),E=hn(a),I=ko(),M=Km(),P=typeof s=="number"&&s<0,T=C.useRef(null),O=C.useRef(null),j=C.useRef(!1),F=C.useRef(null),L=C.useRef(!1),_=M!=null,B=y&&y.getAttribute("role")==="combobox"&&fm(y)&&P,z=C.useCallback(function(N){return N===void 0&&(N=v),N?ml(N,Sl()):[]},[v]),H=C.useCallback(N=>{const R=z(N);return A.current.map(S=>y&&S==="reference"?y:v&&S==="floating"?v:R).filter(Boolean).flat()},[y,v,A,z]);C.useEffect(()=>{if(r||!l)return;function N(S){if(S.key==="Tab"){dt(v,cn(Lt(v)))&&z().length===0&&!B&&Xe(S);const V=H(),ee=cm(S);A.current[0]==="reference"&&ee===y&&(Xe(S),S.shiftKey?Qt(V[V.length-1]):Qt(V[1])),A.current[1]==="floating"&&ee===v&&S.shiftKey&&(Xe(S),Qt(V[0]))}}const R=Lt(v);return R.addEventListener("keydown",N),()=>{R.removeEventListener("keydown",N)}},[r,y,v,l,A,h,B,z,H]),C.useEffect(()=>{if(r||!f)return;function N(){L.current=!0,setTimeout(()=>{L.current=!1})}function R(S){const V=S.relatedTarget;queueMicrotask(()=>{const ee=!(dt(y,V)||dt(v,V)||dt(V,v)||dt(M==null?void 0:M.portalNode,V)||V!=null&&V.hasAttribute(ui("focus-guard"))||I&&(ar(I.nodesRef.current,d).find(K=>{var Q,X;return dt((Q=K.context)==null?void 0:Q.elements.floating,V)||dt((X=K.context)==null?void 0:X.elements.domReference,V)})||ZO(I.nodesRef.current,d).find(K=>{var Q,X;return((Q=K.context)==null?void 0:Q.elements.floating)===V||((X=K.context)==null?void 0:X.elements.domReference)===V})));V&&ee&&!L.current&&V!==F.current&&(j.current=!0,m(!1,S))})}if(v&&tr(y))return y.addEventListener("focusout",R),y.addEventListener("pointerdown",N),!l&&v.addEventListener("focusout",R),()=>{y.removeEventListener("focusout",R),y.removeEventListener("pointerdown",N),!l&&v.removeEventListener("focusout",R)}},[r,y,v,l,d,I,M,m,f]),C.useEffect(()=>{var N;if(r)return;const R=Array.from((M==null||(N=M.portalNode)==null?void 0:N.querySelectorAll("["+ui("portal")+"]"))||[]);if(v){const S=[v,...R,T.current,O.current,A.current.includes("reference")||B?y:null].filter(ee=>ee!=null),V=l?Um(S,w,!w):Um(S);return()=>{V()}}},[r,y,v,l,A,M,B,w]),Ke(()=>{if(r||!v)return;const N=Lt(v),R=cn(N);queueMicrotask(()=>{const S=H(v),V=k.current,ee=(typeof V=="number"?S[V]:V.current)||v,K=dt(v,R);!P&&!K&&c&&Qt(ee,{preventScroll:ee===v})})},[r,c,v,P,H,k]),Ke(()=>{if(r||!v)return;let N=!1;const R=Lt(v),S=cn(R),V=g.current;F.current=S;function ee(K){if(K.type==="escapeKey"&&h.domReference.current&&(F.current=h.domReference.current),["referencePress","escapeKey"].includes(K.type))return;const Q=K.data.returnFocus;typeof Q=="object"?(j.current=!1,N=Q.preventScroll):j.current=!Q}return p.on("dismiss",ee),()=>{p.off("dismiss",ee);const K=cn(R);(dt(v,K)||I&&ar(I.nodesRef.current,d).some(X=>{var se;return dt((se=X.context)==null?void 0:se.elements.floating,K)})||V.openEvent&&["click","mousedown"].includes(V.openEvent.type))&&h.domReference.current&&(F.current=h.domReference.current),E.current&&tr(F.current)&&!j.current&&Qt(F.current,{cancelPrevious:!1,preventScroll:N})}},[r,v,E,g,h,p,I,d]),Ke(()=>{if(!(r||!M))return M.setFocusManagerState({modal:l,closeOnFocusOut:f,open:c,onOpenChange:m,refs:h}),()=>{M.setFocusManagerState(null)}},[r,M,l,c,m,h,f]),Ke(()=>{if(!r&&v&&typeof MutationObserver=="function"&&!P){const N=()=>{const S=v.getAttribute("tabindex");A.current.includes("floating")||cn(Lt(v))!==h.domReference.current&&z().length===0?S!=="0"&&v.setAttribute("tabindex","0"):S!=="-1"&&v.setAttribute("tabindex","-1")};N();const R=new MutationObserver(N);return R.observe(v,{childList:!0,subtree:!0,attributes:!0}),()=>{R.disconnect()}}},[r,v,h,A,z,P]);function W(N){return r||!u||!l?null:C.createElement(aD,{ref:N==="start"?T:O,onClick:R=>m(!1,R.nativeEvent)},typeof u=="string"?u:"Dismiss")}const b=!r&&w&&!B&&(_||l);return C.createElement(C.Fragment,null,b&&C.createElement(Co,{"data-type":"inside",ref:M==null?void 0:M.beforeInsideRef,onFocus:N=>{if(l){const S=H();Qt(i[0]==="reference"?S[0]:S[S.length-1])}else if(M!=null&&M.preserveTabOrder&&M.portalNode)if(j.current=!1,ci(N,M.portalNode)){const S=Vm()||y;S==null||S.focus()}else{var R;(R=M.beforeOutsideRef.current)==null||R.focus()}}}),!B&&W("start"),n,W("end"),b&&C.createElement(Co,{"data-type":"inside",ref:M==null?void 0:M.afterInsideRef,onFocus:N=>{if(l)Qt(H()[0]);else if(M!=null&&M.preserveTabOrder&&M.portalNode)if(f&&(j.current=!0),ci(N,M.portalNode)){const S=Wm()||y;S==null||S.focus()}else{var R;(R=M.afterOutsideRef.current)==null||R.focus()}}}))}function Gm(e){return tr(e.target)&&e.target.tagName==="BUTTON"}function Qm(e){return fm(e)}function uD(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:i,elements:{domReference:o}}=e,{enabled:s=!0,event:a="click",toggle:l=!0,ignoreMouse:u=!1,keyboardHandlers:f=!0}=t,c=C.useRef(),h=C.useRef(!1);return C.useMemo(()=>s?{reference:{onPointerDown(d){c.current=d.pointerType},onMouseDown(d){d.button===0&&(um(c.current)&&u||a!=="click"&&(n&&l&&(!i.current.openEvent||i.current.openEvent.type==="mousedown")?r(!1,d.nativeEvent):(d.preventDefault(),r(!0,d.nativeEvent))))},onClick(d){if(a==="mousedown"&&c.current){c.current=void 0;return}um(c.current)&&u||(n&&l&&(!i.current.openEvent||i.current.openEvent.type==="click")?r(!1,d.nativeEvent):r(!0,d.nativeEvent))},onKeyDown(d){c.current=void 0,!(d.defaultPrevented||!f||Gm(d))&&(d.key===" "&&!Qm(o)&&(d.preventDefault(),h.current=!0),d.key==="Enter"&&r(!(n&&l),d.nativeEvent))},onKeyUp(d){d.defaultPrevented||!f||Gm(d)||Qm(o)||d.key===" "&&h.current&&(h.current=!1,r(!(n&&l),d.nativeEvent))}}}:{},[s,i,a,u,f,o,l,n,r])}const cD=C.useInsertionEffect||(e=>e());function pn(e){const t=C.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return cD(()=>{t.current=e}),C.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}const fD={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},dD={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},hD=e=>{var t,n;return{escapeKeyBubbles:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePressBubbles:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function pD(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:i,nodeId:o,elements:{reference:s,domReference:a,floating:l},dataRef:u}=e,{enabled:f=!0,escapeKey:c=!0,outsidePress:h=!0,outsidePressEvent:d="pointerdown",referencePress:m=!1,referencePressEvent:p="pointerdown",ancestorScroll:g=!1,bubbles:y}=t,v=ko(),w=zm()!=null,A=pn(typeof h=="function"?h:()=>!1),k=typeof h=="function"?A:h,E=C.useRef(!1),{escapeKeyBubbles:I,outsidePressBubbles:M}=hD(y),P=pn(O=>{if(!n||!f||!c||O.key!=="Escape")return;const j=v?ar(v.nodesRef.current,o):[];if(!I&&(O.stopPropagation(),j.length>0)){let F=!0;if(j.forEach(L=>{var _;if((_=L.context)!=null&&_.open&&!L.context.dataRef.current.__escapeKeyBubbles){F=!1;return}}),!F)return}i.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),r(!1,LI(O)?O.nativeEvent:O)}),T=pn(O=>{const j=E.current;if(E.current=!1,j||typeof k=="function"&&!k(O))return;const F=cm(O),L="["+ui("inert")+"]",_=Lt(l).querySelectorAll(L);let B=Et(F)?F:null;for(;B&&!II(B);){const W=DI(B);if(W===Lt(l).body||!Et(W))break;B=W}if(_.length&&Et(F)&&!_I(F)&&!dt(F,l)&&Array.from(_).every(W=>!dt(B,W)))return;if(tr(F)&&l){const W=F.clientWidth>0&&F.scrollWidth>F.clientWidth,b=F.clientHeight>0&&F.scrollHeight>F.clientHeight;let N=b&&O.offsetX>F.clientWidth;if(b&&OI(F).direction==="rtl"&&(N=O.offsetX<=F.offsetWidth-F.clientWidth),N||W&&O.offsetY>F.clientHeight)return}const z=v&&ar(v.nodesRef.current,o).some(W=>{var b;return ol(O,(b=W.context)==null?void 0:b.elements.floating)});if(ol(O,l)||ol(O,a)||z)return;const H=v?ar(v.nodesRef.current,o):[];if(H.length>0){let W=!0;if(H.forEach(b=>{var N;if((N=b.context)!=null&&N.open&&!b.context.dataRef.current.__outsidePressBubbles){W=!1;return}}),!W)return}i.emit("dismiss",{type:"outsidePress",data:{returnFocus:w?{preventScroll:!0}:sm(O)||am(O)}}),r(!1,O)});return C.useEffect(()=>{if(!n||!f)return;u.current.__escapeKeyBubbles=I,u.current.__outsidePressBubbles=M;function O(L){r(!1,L)}const j=Lt(l);c&&j.addEventListener("keydown",P),k&&j.addEventListener(d,T);let F=[];return g&&(Et(a)&&(F=dn(a)),Et(l)&&(F=F.concat(dn(l))),!Et(s)&&s&&s.contextElement&&(F=F.concat(dn(s.contextElement)))),F=F.filter(L=>{var _;return L!==((_=j.defaultView)==null?void 0:_.visualViewport)}),F.forEach(L=>{L.addEventListener("scroll",O,{passive:!0})}),()=>{c&&j.removeEventListener("keydown",P),k&&j.removeEventListener(d,T),F.forEach(L=>{L.removeEventListener("scroll",O)})}},[u,l,a,s,c,k,d,n,r,g,f,I,M,P,T]),C.useEffect(()=>{E.current=!1},[k,d]),C.useMemo(()=>f?{reference:{onKeyDown:P,[fD[p]]:O=>{m&&(i.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),r(!1,O.nativeEvent))}},floating:{onKeyDown:P,[dD[d]]:()=>{E.current=!0}}}:{},[f,i,m,d,p,r,P])}let xl;process.env.NODE_ENV!=="production"&&(xl=new Set);function mD(e){var t;e===void 0&&(e={});const{open:n=!1,onOpenChange:r,nodeId:i}=e;if(process.env.NODE_ENV!=="production"){var o;const I="Floating UI: Cannot pass a virtual element to the `elements.reference` option, as it must be a real DOM element. Use `refs.setPositionReference` instead.";if((o=e.elements)!=null&&o.reference&&!Et(e.elements.reference)){var s;if(!((s=xl)!=null&&s.has(I))){var a;(a=xl)==null||a.add(I),console.error(I)}}}const[l,u]=C.useState(null),f=((t=e.elements)==null?void 0:t.reference)||l,c=CO(e),h=ko(),d=pn((I,M)=>{I&&(p.current.openEvent=M),r==null||r(I,M)}),m=C.useRef(null),p=C.useRef({}),g=C.useState(()=>KO())[0],y=bl(),v=C.useCallback(I=>{const M=Et(I)?{getBoundingClientRect:()=>I.getBoundingClientRect(),contextElement:I}:I;c.refs.setReference(M)},[c.refs]),w=C.useCallback(I=>{(Et(I)||I===null)&&(m.current=I,u(I)),(Et(c.refs.reference.current)||c.refs.reference.current===null||I!==null&&!Et(I))&&c.refs.setReference(I)},[c.refs]),A=C.useMemo(()=>({...c.refs,setReference:w,setPositionReference:v,domReference:m}),[c.refs,w,v]),k=C.useMemo(()=>({...c.elements,domReference:f}),[c.elements,f]),E=C.useMemo(()=>({...c,refs:A,elements:k,dataRef:p,nodeId:i,floatingId:y,events:g,open:n,onOpenChange:d}),[c,i,y,g,n,d,A,k]);return Ke(()=>{const I=h==null?void 0:h.nodesRef.current.find(M=>M.id===i);I&&(I.context=E)}),C.useMemo(()=>({...c,context:E,refs:A,elements:k}),[c,A,k,E])}function El(e,t,n){const r=new Map;return{...n==="floating"&&{tabIndex:-1},...e,...t.map(i=>i?i[n]:null).concat(e).reduce((i,o)=>(o&&Object.entries(o).forEach(s=>{let[a,l]=s;if(a.indexOf("on")===0){if(r.has(a)||r.set(a,[]),typeof l=="function"){var u;(u=r.get(a))==null||u.push(l),i[a]=function(){for(var f,c=arguments.length,h=new Array(c),d=0;d<c;d++)h[d]=arguments[d];return(f=r.get(a))==null?void 0:f.map(m=>m(...h)).find(m=>m!==void 0)}}}else i[a]=l}),i),{})}}function gD(e){e===void 0&&(e=[]);const t=e,n=C.useCallback(o=>El(o,e,"reference"),t),r=C.useCallback(o=>El(o,e,"floating"),t),i=C.useCallback(o=>El(o,e,"item"),e.map(o=>o==null?void 0:o.item));return C.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:i}),[n,r,i])}let Zm=!1;function Ao(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Jm(e,t){return Ao(t,e===gl||e===bo,e===sr||e===ai)}function Cl(e,t,n){return Ao(t,e===bo,n?e===sr:e===ai)||e==="Enter"||e==" "||e===""}function yD(e,t,n){return Ao(t,n?e===sr:e===ai,e===bo)}function Xm(e,t,n){return Ao(t,n?e===ai:e===sr,e===gl)}function vD(e,t){const{open:n,onOpenChange:r,refs:i,elements:{domReference:o,floating:s}}=e,{listRef:a,activeIndex:l,onNavigate:u=()=>{},enabled:f=!0,selectedIndex:c=null,allowEscape:h=!1,loop:d=!1,nested:m=!1,rtl:p=!1,virtual:g=!1,focusItemOnOpen:y="auto",focusItemOnHover:v=!0,openOnArrowKeyDown:w=!0,disabledIndices:A=void 0,orientation:k="vertical",cols:E=1,scrollItemIntoView:I=!0,virtualItemRef:M}=t;process.env.NODE_ENV!=="production"&&(h&&(d||console.warn(["Floating UI: `useListNavigation` looping must be enabled to allow","escaping."].join(" ")),g||console.warn(["Floating UI: `useListNavigation` must be virtual to allow","escaping."].join(" "))),k==="vertical"&&E>1&&console.warn(["Floating UI: In grid list navigation mode (`cols` > 1), the",'`orientation` should be either "horizontal" or "both".'].join(" ")));const P=zm(),T=ko(),O=pn(u),j=C.useRef(y),F=C.useRef(c??-1),L=C.useRef(null),_=C.useRef(!0),B=C.useRef(O),z=C.useRef(!!s),H=C.useRef(!1),W=C.useRef(!1),b=hn(A),N=hn(n),R=hn(I),[S,V]=C.useState(),[ee,K]=C.useState(),Q=pn(function(Y,re,$){$===void 0&&($=!1);const ne=Y.current[re.current];ne&&(g?(V(ne.id),T==null||T.events.emit("virtualfocus",ne),M&&(M.current=ne)):Qt(ne,{preventScroll:!0,sync:NI()&&lm()?Zm||H.current:!1}),requestAnimationFrame(()=>{const he=R.current;he&&ne&&($||!_.current)&&(ne.scrollIntoView==null||ne.scrollIntoView(typeof he=="boolean"?{block:"nearest",inline:"nearest"}:he))}))});Ke(()=>{document.createElement("div").focus({get preventScroll(){return Zm=!0,!1}})},[]),Ke(()=>{f&&(n&&s?j.current&&c!=null&&(W.current=!0,O(c)):z.current&&(F.current=-1,B.current(null)))},[f,n,s,c,O]),Ke(()=>{if(f&&n&&s)if(l==null){if(H.current=!1,c!=null)return;if(z.current&&(F.current=-1,Q(a,F)),!z.current&&j.current&&(L.current!=null||j.current===!0&&L.current==null)){let Y=0;const re=()=>{a.current[0]==null?(Y<2&&(Y?requestAnimationFrame:queueMicrotask)(re),Y++):(F.current=L.current==null||Cl(L.current,k,p)||m?yl(a,b.current):Rm(a,b.current),L.current=null,O(F.current))};re()}}else li(a,l)||(F.current=l,Q(a,F,W.current),W.current=!1)},[f,n,s,l,c,m,a,k,p,O,Q,b]),Ke(()=>{var Y,re;if(!f||s||!T||g||!z.current)return;const $=T.nodesRef.current,ne=(Y=$.find(G=>G.id===P))==null||(re=Y.context)==null?void 0:re.elements.floating,he=cn(Lt(s)),Ce=$.some(G=>G.context&&dt(G.context.elements.floating,he));ne&&!Ce&&_.current&&ne.focus({preventScroll:!0})},[f,s,T,P,g]),Ke(()=>{if(!f||!T||!g||P)return;function Y(re){K(re.id),M&&(M.current=re)}return T.events.on("virtualfocus",Y),()=>{T.events.off("virtualfocus",Y)}},[f,T,g,P,M]),Ke(()=>{B.current=O,z.current=!!s}),Ke(()=>{n||(L.current=null)},[n]);const X=l!=null,se=C.useMemo(()=>{function Y($){if(!n)return;const ne=a.current.indexOf($);ne!==-1&&O(ne)}return{onFocus($){let{currentTarget:ne}=$;Y(ne)},onClick:$=>{let{currentTarget:ne}=$;return ne.focus({preventScroll:!0})},...v&&{onMouseMove($){let{currentTarget:ne}=$;Y(ne)},onPointerLeave($){let{pointerType:ne}=$;!_.current||ne==="touch"||(F.current=-1,Q(a,F),O(null),g||Qt(i.floating.current,{preventScroll:!0}))}}}},[n,i,Q,v,a,O,g]);return C.useMemo(()=>{if(!f)return{};const Y=b.current;function re(G){if(_.current=!1,H.current=!0,!N.current&&G.currentTarget===i.floating.current)return;if(m&&Xm(G.key,k,p)){Xe(G),r(!1,G.nativeEvent),tr(o)&&!g&&o.focus();return}const ue=F.current,de=yl(a,Y),fe=Rm(a,Y);if(G.key==="Home"&&(Xe(G),F.current=de,O(F.current)),G.key==="End"&&(Xe(G),F.current=fe,O(F.current)),!(E>1&&(F.current=WO(a,{event:G,orientation:k,loop:d,cols:E,disabledIndices:Y,minIndex:de,maxIndex:fe,prevIndex:F.current,stopEvent:!0}),O(F.current),k==="both"))&&Jm(G.key,k)){if(Xe(G),n&&!g&&cn(G.currentTarget.ownerDocument)===G.currentTarget){F.current=Cl(G.key,k,p)?de:fe,O(F.current);return}Cl(G.key,k,p)?d?F.current=ue>=fe?h&&ue!==a.current.length?-1:de:rt(a,{startingIndex:ue,disabledIndices:Y}):F.current=Math.min(fe,rt(a,{startingIndex:ue,disabledIndices:Y})):d?F.current=ue<=de?h&&ue!==-1?a.current.length:fe:rt(a,{startingIndex:ue,decrement:!0,disabledIndices:Y}):F.current=Math.max(de,rt(a,{startingIndex:ue,decrement:!0,disabledIndices:Y})),li(a,F.current)?O(null):O(F.current)}}function $(G){y==="auto"&&sm(G.nativeEvent)&&(j.current=!0)}function ne(G){j.current=y,y==="auto"&&am(G.nativeEvent)&&(j.current=!0)}const he=g&&n&&X&&{"aria-activedescendant":ee||S},Ce=a.current.find(G=>(G==null?void 0:G.id)===S);return{reference:{...he,onKeyDown(G){_.current=!1;const ue=G.key.indexOf("Arrow")===0,de=yD(G.key,k,p),fe=Xm(G.key,k,p),Te=Jm(G.key,k),Fe=(m?de:Te)||G.key==="Enter"||G.key.trim()==="";if(g&&n){const ae=T==null?void 0:T.nodesRef.current.find(q=>q.parentId==null),U=T&&ae?JO(T.nodesRef.current,ae.id):null;if(ue&&U&&M){const q=new KeyboardEvent("keydown",{key:G.key,bubbles:!0});if(de||fe){var De,Ue;const oe=((De=U.context)==null?void 0:De.elements.domReference)===G.currentTarget,le=fe&&!oe?(Ue=U.context)==null?void 0:Ue.elements.domReference:de?Ce:null;le&&(Xe(G),le.dispatchEvent(q),K(void 0))}if(Te&&U.context&&U.context.open&&U.parentId&&G.currentTarget!==U.context.elements.domReference){var te;Xe(G),(te=U.context.elements.domReference)==null||te.dispatchEvent(q);return}}return re(G)}if(!(!n&&!w&&ue)){if(Fe&&(L.current=m&&Te?null:G.key),m){de&&(Xe(G),n?(F.current=yl(a,Y),O(F.current)):r(!0,G.nativeEvent));return}Te&&(c!=null&&(F.current=c),Xe(G),!n&&w?r(!0,G.nativeEvent):re(G),n&&O(F.current))}},onFocus(){n&&O(null)},onPointerDown:ne,onMouseDown:$,onClick:$},floating:{"aria-orientation":k==="both"?void 0:k,...he,onKeyDown:re,onPointerMove(){_.current=!0}},item:se}},[o,i,S,ee,b,N,a,f,k,p,g,n,X,m,c,w,h,E,d,y,O,r,se,T,M])}function bD(e,t){t===void 0&&(t={});const{open:n,floatingId:r}=e,{enabled:i=!0,role:o="dialog"}=t,s=bl();return C.useMemo(()=>{const a={id:r,role:o};return i?o==="tooltip"?{reference:{"aria-describedby":n?r:void 0},floating:a}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":o==="alertdialog"?"dialog":o,"aria-controls":n?r:void 0,...o==="listbox"&&{role:"combobox"},...o==="menu"&&{id:s}},floating:{...a,...o==="menu"&&{"aria-labelledby":s}}}:{}},[i,o,n,r,s])}function wD(e,t){var n;const{open:r,dataRef:i}=e,{listRef:o,activeIndex:s,onMatch:a,onTypingChange:l,enabled:u=!0,findMatch:f=null,resetMs:c=750,ignoreKeys:h=[],selectedIndex:d=null}=t,m=C.useRef(),p=C.useRef(""),g=C.useRef((n=d??s)!=null?n:-1),y=C.useRef(null),v=pn(a),w=pn(l),A=hn(f),k=hn(h);return Ke(()=>{r&&(clearTimeout(m.current),y.current=null,p.current="")},[r]),Ke(()=>{if(r&&p.current===""){var E;g.current=(E=d??s)!=null?E:-1}},[r,d,s]),C.useMemo(()=>{if(!u)return{};function E(P){P?i.current.typing||(i.current.typing=P,w(P)):i.current.typing&&(i.current.typing=P,w(P))}function I(P,T,O){const j=A.current?A.current(T,O):T.find(F=>(F==null?void 0:F.toLocaleLowerCase().indexOf(O.toLocaleLowerCase()))===0);return j?P.indexOf(j):-1}function M(P){const T=o.current;if(p.current.length>0&&p.current[0]!==" "&&(I(T,T,p.current)===-1?E(!1):P.key===" "&&Xe(P)),T==null||k.current.includes(P.key)||P.key.length!==1||P.ctrlKey||P.metaKey||P.altKey)return;r&&P.key!==" "&&(Xe(P),E(!0)),T.every(L=>{var _,B;return L?((_=L[0])==null?void 0:_.toLocaleLowerCase())!==((B=L[1])==null?void 0:B.toLocaleLowerCase()):!0})&&p.current===P.key&&(p.current="",g.current=y.current),p.current+=P.key,clearTimeout(m.current),m.current=setTimeout(()=>{p.current="",g.current=y.current,E(!1)},c);const j=g.current,F=I(T,[...T.slice((j||0)+1),...T.slice(0,(j||0)+1)],p.current);F!==-1?(v(F),y.current=F):P.key!==" "&&(p.current="",E(!1))}return{reference:{onKeyDown:M},floating:{onKeyDown:M,onKeyUp(P){P.key===" "&&E(!1)}}}},[u,r,i,o,c,k,A,v,w])}const SD=({options:e,reusable:t,sendMessage:n,isReadOnly:r})=>{var B,z,H,W,b;const i=Ye(),o=Jn(N=>N.messageContainerRef),s=Jn(N=>N.portalContainer),[a,l]=C.useState(!1),[u,f]=C.useState(null),[c,h]=C.useState(null),{message:{blocks:{dropdown:d}}}=ye,m=e.reduce((N,R)=>(N[R.label]=R.value,N),{}),p=m?Object.keys(m):[],g=N=>{l(c!==null&&!t?!1:N)},{refs:y,floatingStyles:v,context:w}=mD({placement:"bottom-start",open:a,onOpenChange:g,whileElementsMounted:vO,middleware:[AO(5),TO({padding:10,boundary:(o==null?void 0:o.current)??void 0,crossAxis:!0}),IO({apply({rects:N,elements:R,availableHeight:S}){Object.assign(R.floating.style,{maxHeight:`${S}px`,minWidth:`${N.reference.width}px`})},padding:10})]}),A=C.useRef([]),k=C.useRef(p),E=C.useRef(!1),I=uD(w,{event:"mousedown"}),M=pD(w),P=bD(w,{role:"listbox"}),T=vD(w,{listRef:A,activeIndex:u,selectedIndex:c,onNavigate:f,loop:!0}),O=wD(w,{listRef:k,activeIndex:u,selectedIndex:c,onMatch:a?f:h,onTypingChange(N){E.current=N}}),{getReferenceProps:j,getFloatingProps:F,getItemProps:L}=gD([M,P,T,O,I]),_=N=>{h(N),p[N]!==void 0&&(n==null||n({type:"text",text:p[N]??"",value:m[p[N]]??""})),l(!1)};return x.jsxs(x.Fragment,{children:[x.jsxs("div",{tabIndex:0,ref:y.setReference,"aria-labelledby":"select-label","aria-autocomplete":"none","data-disabled":c!==null&&!t?"":void 0,style:r?{pointerEvents:"none"}:void 0,...(B=d.button)==null?void 0:B.container,...j(),children:[x.jsx("span",{...(z=d.button)==null?void 0:z.text,children:c?p[c]:i["dropdown.placeholder"]}),x.jsx(qA,{...(H=d.button)==null?void 0:H.icon})]}),a&&x.jsx(sD,{root:s??void 0,children:x.jsx(lD,{context:w,modal:!1,children:x.jsx("div",{ref:y.setFloating,className:(b=(W=d.content)==null?void 0:W.container)==null?void 0:b.className,style:{...v,pointerEvents:"auto"},...F(),children:p.map((N,R)=>{var S;return x.jsx("div",{ref:V=>{A.current[R]=V},role:"option",tabIndex:R===u?0:-1,"aria-selected":R===c&&R===u,"data-active":R===u?"":void 0,...(S=d.content)==null?void 0:S.item,...L({onClick(){_(R)},onKeyDown(V){V.key==="Enter"&&(V.preventDefault(),_(R)),V.key===" "&&!E.current&&(V.preventDefault(),_(R))}}),children:N},N)})})})})]})},eg=D.forwardRef(({title:e,url:t,isReadOnly:n,...r},i)=>{const{message:{blocks:{file:o}}}=ye;return x.jsxs("a",{...r,...o.container,href:t,style:n?{pointerEvents:"none"}:void 0,download:!0,ref:i,target:"_blank",rel:"noreferrer",children:[x.jsx("p",{...o.title,children:e||t}),x.jsx(QA,{...o.icon})]})});eg.displayName="File";const kD=un()((e,t)=>({components:{},getCustomComponent:async n=>{const r=t().components[n];if(r)return r;const i=await fetch(n).then(u=>u.text()),o=new Blob([i],{type:"application/javascript"}),a=await import(URL.createObjectURL(o)),l=()=>a.default;return e(u=>({components:{...u.components,[n]:l}})),l}}));globalThis.React=D;const tg={audio:Vp,bubble:Bp,button:HT,carousel:tm,column:qp,dropdown:SD,file:eg,image:Up,location:Wp,row:Yp,text:vT,video:jp,custom:({url:e,name:t,data:n,...r})=>{const i=kD(u=>u.getCustomComponent),[o,s]=D.useState(null),[a,l]=D.useState(null);return D.useEffect(()=>{i(e).then(s).catch(u=>{l(u.message)})},[e]),a?x.jsx("div",{style:{color:"red"},children:a}):o?x.jsx(o,{...n,...r}):null}},Nn=({block:e,renderers:t,...n})=>{const r=(t==null?void 0:t[e.type])??tg[e.type],i={...n,...e};return x.jsx(r,{...i})};function ng(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=ng(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ur(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=ng(e))&&(r&&(r+=" "),r+=t);return r}const xD=({disabled:e,onFileSelected:t})=>{const n=D.useRef(null),{uploadButton:r}=ye.composer,i=Ye(),o=()=>{n.current&&n.current.click()},s=a=>{const l=a.target.files;l&&l.length>0&&Array.from(l).forEach(u=>{t(u)})};return x.jsxs(x.Fragment,{children:[x.jsx(aT,{...r,role:"button",tabIndex:0,"aria-label":i["composer.fileButton.ariaLabel"],"data-disabled":e,onClick:o}),x.jsx("input",{value:"",multiple:!0,type:"file",ref:n,style:{display:"none"},onChange:s})]})},ED=({name:e,type:t,instance:n,status:r,removeFile:i})=>{const{loader:o,fileIcon:s,removeIcon:a,errorIcon:l,previewImage:u}=ye.composer.fileWidget,f=Ye(),c=CD(n.name,f["fileAttachment.fallbackExtension"]),h=["PNG","JPEG","JPG"].includes(c);return r==="loading"?x.jsx(To,{name:e,status:r,removeButton:x.jsx("div",{...o}),extension:c,children:x.jsx("div",{...s.container,children:x.jsx(Al,{type:t,...s.icon})})}):r==="error"?x.jsx(To,{name:e,status:r,removeButton:x.jsx(rg,{removeFile:()=>i(e)}),extension:f["fileAttachment.uploadError"],children:x.jsxs("div",{...s.container,children:[x.jsx(YA,{...l}),x.jsx(Al,{type:t,...s.icon})]})}):r=="uploaded"&&h?x.jsx(To,{name:e,status:r,removeButton:x.jsx(rg,{removeFile:()=>i(e)}),extension:c,children:x.jsx("div",{...s.container,children:x.jsx("img",{src:URL.createObjectURL(n),alt:e,...u})})}):x.jsx(To,{name:e,status:r,removeButton:x.jsx(gp,{onClick:()=>i(e),...a}),extension:c,children:x.jsx("div",{...s.container,children:x.jsx(Al,{type:t,...s.icon})})})},To=({name:e,status:t,removeButton:n,children:r,extension:i})=>{const{container:o,metadata:s}=ye.composer.fileWidget;return x.jsxs("div",{"data-status":t,title:e,...o,children:[n,r,x.jsxs("div",{...s.container,children:[x.jsx("div",{...s.name,children:e}),x.jsx("div",{...s.type,children:i})]})]})},Al=({type:e,...t})=>e==="image"?x.jsx(XA,{...t}):e==="video"?x.jsx(pT,{...t}):e==="audio"?x.jsx(bp,{...t}):x.jsx(yp,{...t}),CD=(e,t)=>{if(!e)return t;const n=e.split(".").pop();return n?n.toUpperCase():t},rg=({removeFile:e})=>{const{composer:{fileWidget:{removeIcon:t}}}=ye,n=Ye();return x.jsx(gp,{role:"button",tabIndex:0,"aria-label":n["fileAttachment.removeButton.ariaLabel"],onClick:()=>e(),...t})};function Tl(){return Tl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Tl.apply(null,arguments)}function AD(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var TD=D.useLayoutEffect,ID=function(t){var n=D.useRef(t);return TD(function(){n.current=t}),n},ig=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},OD=function(t,n){var r=D.useRef();return D.useCallback(function(i){t.current=i,r.current&&ig(r.current,null),r.current=n,n&&ig(n,i)},[n])},og={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},DD=function(t){Object.keys(og).forEach(function(n){t.style.setProperty(n,og[n],"important")})},sg=DD,at=null,ag=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function MD(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),at||(at=document.createElement("textarea"),at.setAttribute("tabindex","-1"),at.setAttribute("aria-hidden","true"),sg(at)),at.parentNode===null&&document.body.appendChild(at);var i=e.paddingSize,o=e.borderSize,s=e.sizingStyle,a=s.boxSizing;Object.keys(s).forEach(function(h){var d=h;at.style[d]=s[d]}),sg(at),at.value=t;var l=ag(at,e);at.value=t,l=ag(at,e),at.value="x";var u=at.scrollHeight-i,f=u*n;a==="border-box"&&(f=f+i+o),l=Math.max(f,l);var c=u*r;return a==="border-box"&&(c=c+i+o),l=Math.min(c,l),[l,u]}var lg=function(){},ND=function(t,n){return t.reduce(function(r,i){return r[i]=n[i],r},{})},LD=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],_D=!!document.documentElement.currentStyle,PD=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=ND(LD,n),i=r.boxSizing;if(i==="")return null;_D&&i==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var o=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),s=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:o,borderSize:s}},FD=PD;function ug(e,t,n){var r=ID(n);C.useLayoutEffect(function(){var i=function(s){return r.current(s)};if(e)return e.addEventListener(t,i),function(){return e.removeEventListener(t,i)}},[])}var RD=function(t){ug(window,"resize",t)},BD=function(t){ug(document.fonts,"loadingdone",t)},$D=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],zD=function(t,n){var r=t.cacheMeasurements,i=t.maxRows,o=t.minRows,s=t.onChange,a=s===void 0?lg:s,l=t.onHeightChange,u=l===void 0?lg:l,f=AD(t,$D),c=f.value!==void 0,h=C.useRef(null),d=OD(h,n),m=C.useRef(0),p=C.useRef(),g=function(){var w=h.current,A=r&&p.current?p.current:FD(w);if(A){p.current=A;var k=MD(A,w.value||w.placeholder||"x",o,i),E=k[0],I=k[1];m.current!==E&&(m.current=E,w.style.setProperty("height",E+"px","important"),u(E,{rowHeight:I}))}},y=function(w){c||g(),a(w)};return C.useLayoutEffect(g),RD(g),BD(g),C.createElement("textarea",Tl({},f,{onChange:y,ref:d}))},HD=C.forwardRef(zD);const UD=({inputRef:e,composerPlaceholder:t,composerDisabled:n,textInput:r,historyIndex:i,setTextInput:o,setHistoryIndex:s,sendComposerMessage:a,allowFileUpload:l,onFilePasted:u,conversationId:f,storageKey:c})=>{const d=Dp(f||"default",c)(k=>k.messageHistory),[m,p]=D.useState(""),[g,y]=D.useState(!1),{input:v}=ye.composer,w=Ye(),A=k=>{if(!l||!u||!k.clipboardData)return;const E=Array.from(k.clipboardData.files);E.length>0&&(k.preventDefault(),E.forEach(I=>{u(I)}))};return x.jsx(HD,{...v,"aria-label":w["composer.messageInput.ariaLabel"],ref:e,placeholder:t??w["composer.placeholder"],disabled:n,value:r,"data-has-value":!!r,onChange:k=>{const E=k.target.value;o(E),d.includes(E)||s(-1)},onPaste:A,maxRows:5,onKeyDown:k=>{if(n)return;const E=k.nativeEvent;if(!(E.isComposing||E.keyCode===229)&&(r.length===0&&y(!1),k.key!=="ArrowUp"&&k.key!=="ArrowDown"&&k.key!=="ArrowLeft"&&k.key!=="ArrowRight"&&y(!0),k.key==="Enter"&&k.shiftKey?(k.preventDefault(),o(`${r}
289
+ `)):k.key==="Enter"&&(k.preventDefault(),a()),!(r.length>0&&g))){if(k.key==="ArrowUp"){k.preventDefault(),i===-1&&r.trim()!==""&&p(r);const I=Math.min(i+1,d.length-1);s(I),o(d[I]??"")}if(k.key==="ArrowDown"){k.preventDefault();const I=Math.max(i-1,-1);o(i===-1?r.trim():I===-1?m:d[I]??""),s(I)}}}})},jD=({disabled:e,setTextInput:t})=>{const n=Ye(),[r,i]=D.useState(!1),o=D.useRef(null),{voiceButton:s}=ye.composer,a=window.SpeechRecognition||window.webkitSpeechRecognition,l=()=>{o.current||(o.current=new a);const u=o.current;u&&(u.continuous=!0,u.onresult=f=>{var h,d,m;const c=((m=(d=(h=f.results)==null?void 0:h[0])==null?void 0:d[0])==null?void 0:m.transcript)??"";t(c??""),u.stop(),i(!1)},r?(u.stop(),i(!1)):(u.start(),i(!0)))};if(a)return x.jsx(iT,{...s,tabIndex:0,"aria-label":n["composer.voiceButton.ariaLabel"],role:"button","data-show":!e,"data-listens":!!r,onClick:l})},cg=D.memo(D.forwardRef(({className:e,inputRef:t,disableComposer:n,isReadOnly:r,allowFileUpload:i,disableSendButton:o,connected:s,composerPlaceholder:a,footer:l,sendMessage:u,uploadFile:f,storageKey:c,conversationId:h,children:d,...m},p)=>{const{composer:g}=ye,y=Ye(),v=n||r||!s,[w,A]=D.useState(""),[k,E]=D.useState(-1),I=Lp(h||"default"),M=Dp(h||"default",c),P=I(z=>z.files),T=I(z=>z.setFiles),O=I(z=>z.deleteFile),j=I(z=>z.uploadFile),F=M(z=>z.addMessageToHistory),L=P.filter(z=>z.status==="uploaded"),_=!!w.trim()||L.length>0,B=()=>{if(o||!_)return;const z=L.map(W=>{const b=W.url,N=W.type,R=W.fileId;return{video:{type:"video",videoUrl:b,fileId:R},audio:{type:"audio",audioUrl:b,fileId:R},image:{type:"image",imageUrl:b,fileId:R}}[N]??{title:W.name,type:"file",fileUrl:b,fileId:R}})??[];w&&z.push({type:"text",text:w});let H;z.length==1?H=z[0]:H={type:"bloc",items:z.map(b=>{const{type:N,...R}=b;return{type:N,payload:R}})},A(""),u==null||u(H),T([]),F(w),E(-1)};return r?null:x.jsxs(x.Fragment,{children:[x.jsxs("div",{"data-disabled":v,"data-waiting":o,className:ur(g.container.className,e),ref:p,...m,children:[d,P.length>0&&x.jsx("div",{...g==null?void 0:g.fileContainer,children:P.map(z=>x.jsx(ED,{...z,removeFile:O},z.name))}),x.jsxs("div",{...g.inputContainer,onClick:()=>{t&&"current"in t&&t.current&&t.current.focus()},children:[i&&x.jsx(xD,{disabled:v,onFileSelected:z=>{f&&j(z,f)}}),x.jsx(UD,{inputRef:t,composerPlaceholder:a,composerDisabled:v,textInput:w,historyIndex:k,setTextInput:A,setHistoryIndex:E,sendComposerMessage:B,allowFileUpload:i,onFilePasted:z=>{f&&j(z,f)},conversationId:h,storageKey:c}),o&&x.jsx(eT,{...g.inputLoader,role:"status","data-show":o}),!v&&!o&&x.jsxs(x.Fragment,{children:[x.jsx(VA,{...g.sendbutton,role:"button",tabIndex:0,"aria-label":y["composer.sendButton.ariaLabel"],"data-show":_,onClick:()=>B()}),x.jsx(jD,{disabled:_,setTextInput:A})]})]})]}),x.jsx(Nh,{components:{a:({node:z,...H})=>x.jsx("a",{...H,target:"_blank",rel:"noreferrer noopener"})},allowedElements:["a","strong","code","em","p","span"],...g.footer,children:l})]})}));var Il={exports:{}},Io={exports:{}},Ie={};/** @license React v16.13.1
290
290
  * react-is.production.min.js
291
291
  *
292
292
  * Copyright (c) Facebook, Inc. and its affiliates.
293
293
  *
294
294
  * This source code is licensed under the MIT license found in the
295
295
  * LICENSE file in the root directory of this source tree.
296
- */var fg;function VD(){if(fg)return Ie;fg=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,f=e?Symbol.for("react.forward_ref"):60112,c=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,d=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,y=e?Symbol.for("react.scope"):60119;function w(k){if(typeof k=="object"&&k!==null){var E=k.$$typeof;switch(E){case t:switch(k=k.type,k){case l:case u:case r:case o:case i:case c:return k;default:switch(k=k&&k.$$typeof,k){case a:case f:case m:case d:case s:return k;default:return E}}case n:return E}}}function A(k){return w(k)===u}return Ie.AsyncMode=l,Ie.ConcurrentMode=u,Ie.ContextConsumer=a,Ie.ContextProvider=s,Ie.Element=t,Ie.ForwardRef=f,Ie.Fragment=r,Ie.Lazy=m,Ie.Memo=d,Ie.Portal=n,Ie.Profiler=o,Ie.StrictMode=i,Ie.Suspense=c,Ie.isAsyncMode=function(k){return A(k)||w(k)===l},Ie.isConcurrentMode=A,Ie.isContextConsumer=function(k){return w(k)===a},Ie.isContextProvider=function(k){return w(k)===s},Ie.isElement=function(k){return typeof k=="object"&&k!==null&&k.$$typeof===t},Ie.isForwardRef=function(k){return w(k)===f},Ie.isFragment=function(k){return w(k)===r},Ie.isLazy=function(k){return w(k)===m},Ie.isMemo=function(k){return w(k)===d},Ie.isPortal=function(k){return w(k)===n},Ie.isProfiler=function(k){return w(k)===o},Ie.isStrictMode=function(k){return w(k)===i},Ie.isSuspense=function(k){return w(k)===c},Ie.isValidElementType=function(k){return typeof k=="string"||typeof k=="function"||k===r||k===u||k===o||k===i||k===c||k===h||typeof k=="object"&&k!==null&&(k.$$typeof===m||k.$$typeof===d||k.$$typeof===s||k.$$typeof===a||k.$$typeof===f||k.$$typeof===g||k.$$typeof===v||k.$$typeof===y||k.$$typeof===p)},Ie.typeOf=w,Ie}var Oe={};/** @license React v16.13.1
296
+ */var fg;function VD(){if(fg)return Ie;fg=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,f=e?Symbol.for("react.forward_ref"):60112,c=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,d=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,v=e?Symbol.for("react.scope"):60119;function w(k){if(typeof k=="object"&&k!==null){var E=k.$$typeof;switch(E){case t:switch(k=k.type,k){case l:case u:case r:case o:case i:case c:return k;default:switch(k=k&&k.$$typeof,k){case a:case f:case m:case d:case s:return k;default:return E}}case n:return E}}}function A(k){return w(k)===u}return Ie.AsyncMode=l,Ie.ConcurrentMode=u,Ie.ContextConsumer=a,Ie.ContextProvider=s,Ie.Element=t,Ie.ForwardRef=f,Ie.Fragment=r,Ie.Lazy=m,Ie.Memo=d,Ie.Portal=n,Ie.Profiler=o,Ie.StrictMode=i,Ie.Suspense=c,Ie.isAsyncMode=function(k){return A(k)||w(k)===l},Ie.isConcurrentMode=A,Ie.isContextConsumer=function(k){return w(k)===a},Ie.isContextProvider=function(k){return w(k)===s},Ie.isElement=function(k){return typeof k=="object"&&k!==null&&k.$$typeof===t},Ie.isForwardRef=function(k){return w(k)===f},Ie.isFragment=function(k){return w(k)===r},Ie.isLazy=function(k){return w(k)===m},Ie.isMemo=function(k){return w(k)===d},Ie.isPortal=function(k){return w(k)===n},Ie.isProfiler=function(k){return w(k)===o},Ie.isStrictMode=function(k){return w(k)===i},Ie.isSuspense=function(k){return w(k)===c},Ie.isValidElementType=function(k){return typeof k=="string"||typeof k=="function"||k===r||k===u||k===o||k===i||k===c||k===h||typeof k=="object"&&k!==null&&(k.$$typeof===m||k.$$typeof===d||k.$$typeof===s||k.$$typeof===a||k.$$typeof===f||k.$$typeof===g||k.$$typeof===y||k.$$typeof===v||k.$$typeof===p)},Ie.typeOf=w,Ie}var Oe={};/** @license React v16.13.1
297
297
  * react-is.development.js
298
298
  *
299
299
  * Copyright (c) Facebook, Inc. and its affiliates.
300
300
  *
301
301
  * This source code is licensed under the MIT license found in the
302
302
  * LICENSE file in the root directory of this source tree.
303
- */var dg;function WD(){return dg||(dg=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,f=e?Symbol.for("react.forward_ref"):60112,c=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,d=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,y=e?Symbol.for("react.scope"):60119;function w(B){return typeof B=="string"||typeof B=="function"||B===r||B===u||B===o||B===i||B===c||B===h||typeof B=="object"&&B!==null&&(B.$$typeof===m||B.$$typeof===d||B.$$typeof===s||B.$$typeof===a||B.$$typeof===f||B.$$typeof===g||B.$$typeof===v||B.$$typeof===y||B.$$typeof===p)}function A(B){if(typeof B=="object"&&B!==null){var ne=B.$$typeof;switch(ne){case t:var me=B.type;switch(me){case l:case u:case r:case o:case i:case c:return me;default:var we=me&&me.$$typeof;switch(we){case a:case f:case m:case d:case s:return we;default:return ne}}case n:return ne}}}var k=l,E=u,I=a,M=s,L=t,T=f,O=r,H=m,P=d,F=n,_=o,z=i,$=c,U=!1;function W(B){return U||(U=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),b(B)||A(B)===l}function b(B){return A(B)===u}function N(B){return A(B)===a}function R(B){return A(B)===s}function S(B){return typeof B=="object"&&B!==null&&B.$$typeof===t}function V(B){return A(B)===f}function ee(B){return A(B)===r}function Y(B){return A(B)===m}function G(B){return A(B)===d}function J(B){return A(B)===n}function se(B){return A(B)===o}function K(B){return A(B)===i}function re(B){return A(B)===c}Oe.AsyncMode=k,Oe.ConcurrentMode=E,Oe.ContextConsumer=I,Oe.ContextProvider=M,Oe.Element=L,Oe.ForwardRef=T,Oe.Fragment=O,Oe.Lazy=H,Oe.Memo=P,Oe.Portal=F,Oe.Profiler=_,Oe.StrictMode=z,Oe.Suspense=$,Oe.isAsyncMode=W,Oe.isConcurrentMode=b,Oe.isContextConsumer=N,Oe.isContextProvider=R,Oe.isElement=S,Oe.isForwardRef=V,Oe.isFragment=ee,Oe.isLazy=Y,Oe.isMemo=G,Oe.isPortal=J,Oe.isProfiler=se,Oe.isStrictMode=K,Oe.isSuspense=re,Oe.isValidElementType=w,Oe.typeOf=A}()),Oe}var hg;function pg(){return hg||(hg=1,process.env.NODE_ENV==="production"?Io.exports=VD():Io.exports=WD()),Io.exports}/*
303
+ */var dg;function WD(){return dg||(dg=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,f=e?Symbol.for("react.forward_ref"):60112,c=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,d=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,v=e?Symbol.for("react.scope"):60119;function w($){return typeof $=="string"||typeof $=="function"||$===r||$===u||$===o||$===i||$===c||$===h||typeof $=="object"&&$!==null&&($.$$typeof===m||$.$$typeof===d||$.$$typeof===s||$.$$typeof===a||$.$$typeof===f||$.$$typeof===g||$.$$typeof===y||$.$$typeof===v||$.$$typeof===p)}function A($){if(typeof $=="object"&&$!==null){var ne=$.$$typeof;switch(ne){case t:var he=$.type;switch(he){case l:case u:case r:case o:case i:case c:return he;default:var Ce=he&&he.$$typeof;switch(Ce){case a:case f:case m:case d:case s:return Ce;default:return ne}}case n:return ne}}}var k=l,E=u,I=a,M=s,P=t,T=f,O=r,j=m,F=d,L=n,_=o,B=i,z=c,H=!1;function W($){return H||(H=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),b($)||A($)===l}function b($){return A($)===u}function N($){return A($)===a}function R($){return A($)===s}function S($){return typeof $=="object"&&$!==null&&$.$$typeof===t}function V($){return A($)===f}function ee($){return A($)===r}function K($){return A($)===m}function Q($){return A($)===d}function X($){return A($)===n}function se($){return A($)===o}function Y($){return A($)===i}function re($){return A($)===c}Oe.AsyncMode=k,Oe.ConcurrentMode=E,Oe.ContextConsumer=I,Oe.ContextProvider=M,Oe.Element=P,Oe.ForwardRef=T,Oe.Fragment=O,Oe.Lazy=j,Oe.Memo=F,Oe.Portal=L,Oe.Profiler=_,Oe.StrictMode=B,Oe.Suspense=z,Oe.isAsyncMode=W,Oe.isConcurrentMode=b,Oe.isContextConsumer=N,Oe.isContextProvider=R,Oe.isElement=S,Oe.isForwardRef=V,Oe.isFragment=ee,Oe.isLazy=K,Oe.isMemo=Q,Oe.isPortal=X,Oe.isProfiler=se,Oe.isStrictMode=Y,Oe.isSuspense=re,Oe.isValidElementType=w,Oe.typeOf=A}()),Oe}var hg;function pg(){return hg||(hg=1,process.env.NODE_ENV==="production"?Io.exports=VD():Io.exports=WD()),Io.exports}/*
304
304
  object-assign
305
305
  (c) Sindre Sorhus
306
306
  @license MIT
307
- */var Ol,mg;function qD(){if(mg)return Ol;mg=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function i(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var s={},a=0;a<10;a++)s["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(s).map(function(f){return s[f]});if(l.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(f){u[f]=f}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Ol=i()?Object.assign:function(o,s){for(var a,l=r(o),u,f=1;f<arguments.length;f++){a=Object(arguments[f]);for(var c in a)t.call(a,c)&&(l[c]=a[c]);if(e){u=e(a);for(var h=0;h<u.length;h++)n.call(a,u[h])&&(l[u[h]]=a[u[h]])}}return l},Ol}var Dl,gg;function Ml(){if(gg)return Dl;gg=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Dl=e,Dl}var Nl,yg;function vg(){return yg||(yg=1,Nl=Function.call.bind(Object.prototype.hasOwnProperty)),Nl}var Ll,bg;function YD(){if(bg)return Ll;bg=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Ml(),n={},r=vg();e=function(o){var s="Warning: "+o;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}}function i(o,s,a,l,u){if(process.env.NODE_ENV!=="production"){for(var f in o)if(r(o,f)){var c;try{if(typeof o[f]!="function"){var h=Error((l||"React class")+": "+a+" type `"+f+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[f]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}c=o[f](s,f,l,a,null,t)}catch(m){c=m}if(c&&!(c instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+f+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof c+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),c instanceof Error&&!(c.message in n)){n[c.message]=!0;var d=u?u():"";e("Failed "+a+" type: "+c.message+(d??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Ll=i,Ll}var _l,wg;function KD(){if(wg)return _l;wg=1;var e=pg(),t=qD(),n=Ml(),r=vg(),i=YD(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function s(){return null}return _l=function(a,l){var u=typeof Symbol=="function"&&Symbol.iterator,f="@@iterator";function c(b){var N=b&&(u&&b[u]||b[f]);if(typeof N=="function")return N}var h="<<anonymous>>",d={array:v("array"),bigint:v("bigint"),bool:v("boolean"),func:v("function"),number:v("number"),object:v("object"),string:v("string"),symbol:v("symbol"),any:y(),arrayOf:w,element:A(),elementType:k(),instanceOf:E,node:T(),objectOf:M,oneOf:I,oneOfType:L,shape:H,exact:P};function m(b,N){return b===N?b!==0||1/b===1/N:b!==b&&N!==N}function p(b,N){this.message=b,this.data=N&&typeof N=="object"?N:{},this.stack=""}p.prototype=Error.prototype;function g(b){if(process.env.NODE_ENV!=="production")var N={},R=0;function S(ee,Y,G,J,se,K,re){if(J=J||h,K=K||G,re!==n){if(l){var B=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw B.name="Invariant Violation",B}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ne=J+":"+G;!N[ne]&&R<3&&(o("You are manually calling a React.PropTypes validation function for the `"+K+"` prop on `"+J+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),N[ne]=!0,R++)}}return Y[G]==null?ee?Y[G]===null?new p("The "+se+" `"+K+"` is marked as required "+("in `"+J+"`, but its value is `null`.")):new p("The "+se+" `"+K+"` is marked as required in "+("`"+J+"`, but its value is `undefined`.")):null:b(Y,G,J,se,K)}var V=S.bind(null,!1);return V.isRequired=S.bind(null,!0),V}function v(b){function N(R,S,V,ee,Y,G){var J=R[S],se=z(J);if(se!==b){var K=$(J);return new p("Invalid "+ee+" `"+Y+"` of type "+("`"+K+"` supplied to `"+V+"`, expected ")+("`"+b+"`."),{expectedType:b})}return null}return g(N)}function y(){return g(s)}function w(b){function N(R,S,V,ee,Y){if(typeof b!="function")return new p("Property `"+Y+"` of component `"+V+"` has invalid PropType notation inside arrayOf.");var G=R[S];if(!Array.isArray(G)){var J=z(G);return new p("Invalid "+ee+" `"+Y+"` of type "+("`"+J+"` supplied to `"+V+"`, expected an array."))}for(var se=0;se<G.length;se++){var K=b(G,se,V,ee,Y+"["+se+"]",n);if(K instanceof Error)return K}return null}return g(N)}function A(){function b(N,R,S,V,ee){var Y=N[R];if(!a(Y)){var G=z(Y);return new p("Invalid "+V+" `"+ee+"` of type "+("`"+G+"` supplied to `"+S+"`, expected a single ReactElement."))}return null}return g(b)}function k(){function b(N,R,S,V,ee){var Y=N[R];if(!e.isValidElementType(Y)){var G=z(Y);return new p("Invalid "+V+" `"+ee+"` of type "+("`"+G+"` supplied to `"+S+"`, expected a single ReactElement type."))}return null}return g(b)}function E(b){function N(R,S,V,ee,Y){if(!(R[S]instanceof b)){var G=b.name||h,J=W(R[S]);return new p("Invalid "+ee+" `"+Y+"` of type "+("`"+J+"` supplied to `"+V+"`, expected ")+("instance of `"+G+"`."))}return null}return g(N)}function I(b){if(!Array.isArray(b))return process.env.NODE_ENV!=="production"&&(arguments.length>1?o("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):o("Invalid argument supplied to oneOf, expected an array.")),s;function N(R,S,V,ee,Y){for(var G=R[S],J=0;J<b.length;J++)if(m(G,b[J]))return null;var se=JSON.stringify(b,function(re,B){var ne=$(B);return ne==="symbol"?String(B):B});return new p("Invalid "+ee+" `"+Y+"` of value `"+String(G)+"` "+("supplied to `"+V+"`, expected one of "+se+"."))}return g(N)}function M(b){function N(R,S,V,ee,Y){if(typeof b!="function")return new p("Property `"+Y+"` of component `"+V+"` has invalid PropType notation inside objectOf.");var G=R[S],J=z(G);if(J!=="object")return new p("Invalid "+ee+" `"+Y+"` of type "+("`"+J+"` supplied to `"+V+"`, expected an object."));for(var se in G)if(r(G,se)){var K=b(G,se,V,ee,Y+"."+se,n);if(K instanceof Error)return K}return null}return g(N)}function L(b){if(!Array.isArray(b))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var N=0;N<b.length;N++){var R=b[N];if(typeof R!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+U(R)+" at index "+N+"."),s}function S(V,ee,Y,G,J){for(var se=[],K=0;K<b.length;K++){var re=b[K],B=re(V,ee,Y,G,J,n);if(B==null)return null;B.data&&r(B.data,"expectedType")&&se.push(B.data.expectedType)}var ne=se.length>0?", expected one of type ["+se.join(", ")+"]":"";return new p("Invalid "+G+" `"+J+"` supplied to "+("`"+Y+"`"+ne+"."))}return g(S)}function T(){function b(N,R,S,V,ee){return F(N[R])?null:new p("Invalid "+V+" `"+ee+"` supplied to "+("`"+S+"`, expected a ReactNode."))}return g(b)}function O(b,N,R,S,V){return new p((b||"React class")+": "+N+" type `"+R+"."+S+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+V+"`.")}function H(b){function N(R,S,V,ee,Y){var G=R[S],J=z(G);if(J!=="object")return new p("Invalid "+ee+" `"+Y+"` of type `"+J+"` "+("supplied to `"+V+"`, expected `object`."));for(var se in b){var K=b[se];if(typeof K!="function")return O(V,ee,Y,se,$(K));var re=K(G,se,V,ee,Y+"."+se,n);if(re)return re}return null}return g(N)}function P(b){function N(R,S,V,ee,Y){var G=R[S],J=z(G);if(J!=="object")return new p("Invalid "+ee+" `"+Y+"` of type `"+J+"` "+("supplied to `"+V+"`, expected `object`."));var se=t({},R[S],b);for(var K in se){var re=b[K];if(r(b,K)&&typeof re!="function")return O(V,ee,Y,K,$(re));if(!re)return new p("Invalid "+ee+" `"+Y+"` key `"+K+"` supplied to `"+V+"`.\nBad object: "+JSON.stringify(R[S],null," ")+`
308
- Valid keys: `+JSON.stringify(Object.keys(b),null," "));var B=re(G,K,V,ee,Y+"."+K,n);if(B)return B}return null}return g(N)}function F(b){switch(typeof b){case"number":case"string":case"undefined":return!0;case"boolean":return!b;case"object":if(Array.isArray(b))return b.every(F);if(b===null||a(b))return!0;var N=c(b);if(N){var R=N.call(b),S;if(N!==b.entries){for(;!(S=R.next()).done;)if(!F(S.value))return!1}else for(;!(S=R.next()).done;){var V=S.value;if(V&&!F(V[1]))return!1}}else return!1;return!0;default:return!1}}function _(b,N){return b==="symbol"?!0:N?N["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&N instanceof Symbol:!1}function z(b){var N=typeof b;return Array.isArray(b)?"array":b instanceof RegExp?"object":_(N,b)?"symbol":N}function $(b){if(typeof b>"u"||b===null)return""+b;var N=z(b);if(N==="object"){if(b instanceof Date)return"date";if(b instanceof RegExp)return"regexp"}return N}function U(b){var N=$(b);switch(N){case"array":case"object":return"an "+N;case"boolean":case"date":case"regexp":return"a "+N;default:return N}}function W(b){return!b.constructor||!b.constructor.name?h:b.constructor.name}return d.checkPropTypes=i,d.resetWarningCache=i.resetWarningCache,d.PropTypes=d,d},_l}var Pl,Sg;function GD(){if(Sg)return Pl;Sg=1;var e=Ml();function t(){}function n(){}return n.resetWarningCache=t,Pl=function(){function r(s,a,l,u,f,c){if(c!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Pl}if(process.env.NODE_ENV!=="production"){var QD=pg(),ZD=!0;Il.exports=KD()(QD.isElement,ZD)}else Il.exports=GD()();var JD=Il.exports;const Ne=bn(JD);var XD=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function fi(e,t){var n=eM(e);if(typeof n.path!="string"){var r=e.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof t=="string"?t:typeof r=="string"&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function eM(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),i=XD.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var tM=[".DS_Store","Thumbs.db"];function nM(e){return Xn(this,void 0,void 0,function(){return er(this,function(t){return Oo(e)&&rM(e.dataTransfer)?[2,aM(e.dataTransfer,e.type)]:iM(e)?[2,oM(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,sM(e)]:[2,[]]})})}function rM(e){return Oo(e)}function iM(e){return Oo(e)&&Oo(e.target)}function Oo(e){return typeof e=="object"&&e!==null}function oM(e){return Fl(e.target.files).map(function(t){return fi(t)})}function sM(e){return Xn(this,void 0,void 0,function(){var t;return er(this,function(n){switch(n.label){case 0:return[4,Promise.all(e.map(function(r){return r.getFile()}))];case 1:return t=n.sent(),[2,t.map(function(r){return fi(r)})]}})})}function aM(e,t){return Xn(this,void 0,void 0,function(){var n,r;return er(this,function(i){switch(i.label){case 0:return e.items?(n=Fl(e.items).filter(function(o){return o.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(lM))]):[3,2];case 1:return r=i.sent(),[2,kg(xg(r))];case 2:return[2,kg(Fl(e.files).map(function(o){return fi(o)}))]}})})}function kg(e){return e.filter(function(t){return tM.indexOf(t.name)===-1})}function Fl(e){if(e===null)return[];for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r)}return t}function lM(e){if(typeof e.webkitGetAsEntry!="function")return Eg(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?Cg(t):Eg(e)}function xg(e){return e.reduce(function(t,n){return Qa(Qa([],Hp(t),!1),Hp(Array.isArray(n)?xg(n):[n]),!1)},[])}function Eg(e){var t=e.getAsFile();if(!t)return Promise.reject("".concat(e," is not a File"));var n=fi(t);return Promise.resolve(n)}function uM(e){return Xn(this,void 0,void 0,function(){return er(this,function(t){return[2,e.isDirectory?Cg(e):cM(e)]})})}function Cg(e){var t=e.createReader();return new Promise(function(n,r){var i=[];function o(){var s=this;t.readEntries(function(a){return Xn(s,void 0,void 0,function(){var l,u,f;return er(this,function(c){switch(c.label){case 0:if(a.length)return[3,5];c.label=1;case 1:return c.trys.push([1,3,,4]),[4,Promise.all(i)];case 2:return l=c.sent(),n(l),[3,4];case 3:return u=c.sent(),r(u),[3,4];case 4:return[3,6];case 5:f=Promise.all(a.map(uM)),i.push(f),o(),c.label=6;case 6:return[2]}})})},function(a){r(a)})}o()})}function cM(e){return Xn(this,void 0,void 0,function(){return er(this,function(t){return[2,new Promise(function(n,r){e.file(function(i){var o=fi(i,e.fullPath);n(o)},function(i){r(i)})})]})})}var fM=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var r=e.name||"",i=(e.type||"").toLowerCase(),o=i.replace(/\/.*$/,"");return n.some(function(s){var a=s.trim().toLowerCase();return a.charAt(0)==="."?r.toLowerCase().endsWith(a):a.endsWith("/*")?o===a.replace(/\/.*$/,""):i===a})}return!0};function Ag(e){return pM(e)||hM(e)||Dg(e)||dM()}function dM(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
307
+ */var Ol,mg;function qD(){if(mg)return Ol;mg=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function i(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var s={},a=0;a<10;a++)s["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(s).map(function(f){return s[f]});if(l.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(f){u[f]=f}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Ol=i()?Object.assign:function(o,s){for(var a,l=r(o),u,f=1;f<arguments.length;f++){a=Object(arguments[f]);for(var c in a)t.call(a,c)&&(l[c]=a[c]);if(e){u=e(a);for(var h=0;h<u.length;h++)n.call(a,u[h])&&(l[u[h]]=a[u[h]])}}return l},Ol}var Dl,gg;function Ml(){if(gg)return Dl;gg=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Dl=e,Dl}var Nl,yg;function vg(){return yg||(yg=1,Nl=Function.call.bind(Object.prototype.hasOwnProperty)),Nl}var Ll,bg;function YD(){if(bg)return Ll;bg=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Ml(),n={},r=vg();e=function(o){var s="Warning: "+o;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}}function i(o,s,a,l,u){if(process.env.NODE_ENV!=="production"){for(var f in o)if(r(o,f)){var c;try{if(typeof o[f]!="function"){var h=Error((l||"React class")+": "+a+" type `"+f+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[f]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}c=o[f](s,f,l,a,null,t)}catch(m){c=m}if(c&&!(c instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+f+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof c+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),c instanceof Error&&!(c.message in n)){n[c.message]=!0;var d=u?u():"";e("Failed "+a+" type: "+c.message+(d??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Ll=i,Ll}var _l,wg;function KD(){if(wg)return _l;wg=1;var e=pg(),t=qD(),n=Ml(),r=vg(),i=YD(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function s(){return null}return _l=function(a,l){var u=typeof Symbol=="function"&&Symbol.iterator,f="@@iterator";function c(b){var N=b&&(u&&b[u]||b[f]);if(typeof N=="function")return N}var h="<<anonymous>>",d={array: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:E,node:T(),objectOf:M,oneOf:I,oneOfType:P,shape:j,exact:F};function m(b,N){return b===N?b!==0||1/b===1/N:b!==b&&N!==N}function p(b,N){this.message=b,this.data=N&&typeof N=="object"?N:{},this.stack=""}p.prototype=Error.prototype;function g(b){if(process.env.NODE_ENV!=="production")var N={},R=0;function S(ee,K,Q,X,se,Y,re){if(X=X||h,Y=Y||Q,re!==n){if(l){var $=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw $.name="Invariant Violation",$}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ne=X+":"+Q;!N[ne]&&R<3&&(o("You are manually calling a React.PropTypes validation function for the `"+Y+"` 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,R++)}}return K[Q]==null?ee?K[Q]===null?new p("The "+se+" `"+Y+"` is marked as required "+("in `"+X+"`, but its value is `null`.")):new p("The "+se+" `"+Y+"` is marked as required in "+("`"+X+"`, but its value is `undefined`.")):null:b(K,Q,X,se,Y)}var V=S.bind(null,!1);return V.isRequired=S.bind(null,!0),V}function y(b){function N(R,S,V,ee,K,Q){var X=R[S],se=B(X);if(se!==b){var Y=z(X);return new p("Invalid "+ee+" `"+K+"` of type "+("`"+Y+"` supplied to `"+V+"`, expected ")+("`"+b+"`."),{expectedType:b})}return null}return g(N)}function v(){return g(s)}function w(b){function N(R,S,V,ee,K){if(typeof b!="function")return new p("Property `"+K+"` of component `"+V+"` has invalid PropType notation inside arrayOf.");var Q=R[S];if(!Array.isArray(Q)){var X=B(Q);return new p("Invalid "+ee+" `"+K+"` of type "+("`"+X+"` supplied to `"+V+"`, expected an array."))}for(var se=0;se<Q.length;se++){var Y=b(Q,se,V,ee,K+"["+se+"]",n);if(Y instanceof Error)return Y}return null}return g(N)}function A(){function b(N,R,S,V,ee){var K=N[R];if(!a(K)){var Q=B(K);return new p("Invalid "+V+" `"+ee+"` of type "+("`"+Q+"` supplied to `"+S+"`, expected a single ReactElement."))}return null}return g(b)}function k(){function b(N,R,S,V,ee){var K=N[R];if(!e.isValidElementType(K)){var Q=B(K);return new p("Invalid "+V+" `"+ee+"` of type "+("`"+Q+"` supplied to `"+S+"`, expected a single ReactElement type."))}return null}return g(b)}function E(b){function N(R,S,V,ee,K){if(!(R[S]instanceof b)){var Q=b.name||h,X=W(R[S]);return new p("Invalid "+ee+" `"+K+"` of type "+("`"+X+"` supplied to `"+V+"`, expected ")+("instance of `"+Q+"`."))}return null}return g(N)}function I(b){if(!Array.isArray(b))return process.env.NODE_ENV!=="production"&&(arguments.length>1?o("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):o("Invalid argument supplied to oneOf, expected an array.")),s;function N(R,S,V,ee,K){for(var Q=R[S],X=0;X<b.length;X++)if(m(Q,b[X]))return null;var se=JSON.stringify(b,function(re,$){var ne=z($);return ne==="symbol"?String($):$});return new p("Invalid "+ee+" `"+K+"` of value `"+String(Q)+"` "+("supplied to `"+V+"`, expected one of "+se+"."))}return g(N)}function M(b){function N(R,S,V,ee,K){if(typeof b!="function")return new p("Property `"+K+"` of component `"+V+"` has invalid PropType notation inside objectOf.");var Q=R[S],X=B(Q);if(X!=="object")return new p("Invalid "+ee+" `"+K+"` of type "+("`"+X+"` supplied to `"+V+"`, expected an object."));for(var se in Q)if(r(Q,se)){var Y=b(Q,se,V,ee,K+"."+se,n);if(Y instanceof Error)return Y}return null}return g(N)}function P(b){if(!Array.isArray(b))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var N=0;N<b.length;N++){var R=b[N];if(typeof R!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+H(R)+" at index "+N+"."),s}function S(V,ee,K,Q,X){for(var se=[],Y=0;Y<b.length;Y++){var re=b[Y],$=re(V,ee,K,Q,X,n);if($==null)return null;$.data&&r($.data,"expectedType")&&se.push($.data.expectedType)}var ne=se.length>0?", expected one of type ["+se.join(", ")+"]":"";return new p("Invalid "+Q+" `"+X+"` supplied to "+("`"+K+"`"+ne+"."))}return g(S)}function T(){function b(N,R,S,V,ee){return L(N[R])?null:new p("Invalid "+V+" `"+ee+"` supplied to "+("`"+S+"`, expected a ReactNode."))}return g(b)}function O(b,N,R,S,V){return new p((b||"React class")+": "+N+" type `"+R+"."+S+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+V+"`.")}function j(b){function N(R,S,V,ee,K){var Q=R[S],X=B(Q);if(X!=="object")return new p("Invalid "+ee+" `"+K+"` of type `"+X+"` "+("supplied to `"+V+"`, expected `object`."));for(var se in b){var Y=b[se];if(typeof Y!="function")return O(V,ee,K,se,z(Y));var re=Y(Q,se,V,ee,K+"."+se,n);if(re)return re}return null}return g(N)}function F(b){function N(R,S,V,ee,K){var Q=R[S],X=B(Q);if(X!=="object")return new p("Invalid "+ee+" `"+K+"` of type `"+X+"` "+("supplied to `"+V+"`, expected `object`."));var se=t({},R[S],b);for(var Y in se){var re=b[Y];if(r(b,Y)&&typeof re!="function")return O(V,ee,K,Y,z(re));if(!re)return new p("Invalid "+ee+" `"+K+"` key `"+Y+"` supplied to `"+V+"`.\nBad object: "+JSON.stringify(R[S],null," ")+`
308
+ Valid keys: `+JSON.stringify(Object.keys(b),null," "));var $=re(Q,Y,V,ee,K+"."+Y,n);if($)return $}return null}return g(N)}function L(b){switch(typeof b){case"number":case"string":case"undefined":return!0;case"boolean":return!b;case"object":if(Array.isArray(b))return b.every(L);if(b===null||a(b))return!0;var N=c(b);if(N){var R=N.call(b),S;if(N!==b.entries){for(;!(S=R.next()).done;)if(!L(S.value))return!1}else for(;!(S=R.next()).done;){var V=S.value;if(V&&!L(V[1]))return!1}}else return!1;return!0;default:return!1}}function _(b,N){return b==="symbol"?!0:N?N["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&N instanceof Symbol:!1}function B(b){var N=typeof b;return Array.isArray(b)?"array":b instanceof RegExp?"object":_(N,b)?"symbol":N}function z(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 H(b){var N=z(b);switch(N){case"array":case"object":return"an "+N;case"boolean":case"date":case"regexp":return"a "+N;default:return N}}function W(b){return!b.constructor||!b.constructor.name?h:b.constructor.name}return d.checkPropTypes=i,d.resetWarningCache=i.resetWarningCache,d.PropTypes=d,d},_l}var Pl,Sg;function GD(){if(Sg)return Pl;Sg=1;var e=Ml();function t(){}function n(){}return n.resetWarningCache=t,Pl=function(){function r(s,a,l,u,f,c){if(c!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Pl}if(process.env.NODE_ENV!=="production"){var QD=pg(),ZD=!0;Il.exports=KD()(QD.isElement,ZD)}else Il.exports=GD()();var JD=Il.exports;const Ne=bn(JD);var XD=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function fi(e,t){var n=eM(e);if(typeof n.path!="string"){var r=e.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof t=="string"?t:typeof r=="string"&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function eM(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),i=XD.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var tM=[".DS_Store","Thumbs.db"];function nM(e){return Xn(this,void 0,void 0,function(){return er(this,function(t){return Oo(e)&&rM(e.dataTransfer)?[2,aM(e.dataTransfer,e.type)]:iM(e)?[2,oM(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,sM(e)]:[2,[]]})})}function rM(e){return Oo(e)}function iM(e){return Oo(e)&&Oo(e.target)}function Oo(e){return typeof e=="object"&&e!==null}function oM(e){return Fl(e.target.files).map(function(t){return fi(t)})}function sM(e){return Xn(this,void 0,void 0,function(){var t;return er(this,function(n){switch(n.label){case 0:return[4,Promise.all(e.map(function(r){return r.getFile()}))];case 1:return t=n.sent(),[2,t.map(function(r){return fi(r)})]}})})}function aM(e,t){return Xn(this,void 0,void 0,function(){var n,r;return er(this,function(i){switch(i.label){case 0:return e.items?(n=Fl(e.items).filter(function(o){return o.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(lM))]):[3,2];case 1:return r=i.sent(),[2,kg(xg(r))];case 2:return[2,kg(Fl(e.files).map(function(o){return fi(o)}))]}})})}function kg(e){return e.filter(function(t){return tM.indexOf(t.name)===-1})}function Fl(e){if(e===null)return[];for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r)}return t}function lM(e){if(typeof e.webkitGetAsEntry!="function")return Eg(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?Cg(t):Eg(e)}function xg(e){return e.reduce(function(t,n){return Qa(Qa([],Hp(t),!1),Hp(Array.isArray(n)?xg(n):[n]),!1)},[])}function Eg(e){var t=e.getAsFile();if(!t)return Promise.reject("".concat(e," is not a File"));var n=fi(t);return Promise.resolve(n)}function uM(e){return Xn(this,void 0,void 0,function(){return er(this,function(t){return[2,e.isDirectory?Cg(e):cM(e)]})})}function Cg(e){var t=e.createReader();return new Promise(function(n,r){var i=[];function o(){var s=this;t.readEntries(function(a){return Xn(s,void 0,void 0,function(){var l,u,f;return er(this,function(c){switch(c.label){case 0:if(a.length)return[3,5];c.label=1;case 1:return c.trys.push([1,3,,4]),[4,Promise.all(i)];case 2:return l=c.sent(),n(l),[3,4];case 3:return u=c.sent(),r(u),[3,4];case 4:return[3,6];case 5:f=Promise.all(a.map(uM)),i.push(f),o(),c.label=6;case 6:return[2]}})})},function(a){r(a)})}o()})}function cM(e){return Xn(this,void 0,void 0,function(){return er(this,function(t){return[2,new Promise(function(n,r){e.file(function(i){var o=fi(i,e.fullPath);n(o)},function(i){r(i)})})]})})}var fM=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var r=e.name||"",i=(e.type||"").toLowerCase(),o=i.replace(/\/.*$/,"");return n.some(function(s){var a=s.trim().toLowerCase();return a.charAt(0)==="."?r.toLowerCase().endsWith(a):a.endsWith("/*")?o===a.replace(/\/.*$/,""):i===a})}return!0};function Ag(e){return pM(e)||hM(e)||Dg(e)||dM()}function dM(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
309
309
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hM(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function pM(e){if(Array.isArray(e))return Rl(e)}function Tg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ig(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Tg(Object(n),!0).forEach(function(r){Og(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tg(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Og(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function di(e,t){return yM(e)||gM(e,t)||Dg(e,t)||mM()}function mM(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
310
310
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Dg(e,t){if(e){if(typeof e=="string")return Rl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Rl(e,t)}}function Rl(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function gM(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,s,a;try{for(n=n.call(e);!(i=(s=n.next()).done)&&(r.push(s.value),!(t&&r.length===t));i=!0);}catch(l){o=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw a}}return r}}function yM(e){if(Array.isArray(e))return e}var vM="file-invalid-type",bM="file-too-large",wM="file-too-small",SM="too-many-files",kM=function(t){t=Array.isArray(t)&&t.length===1?t[0]:t;var n=Array.isArray(t)?"one of ".concat(t.join(", ")):t;return{code:vM,message:"File type must be ".concat(n)}},Mg=function(t){return{code:bM,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},Ng=function(t){return{code:wM,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},xM={code:SM,message:"Too many files"};function Lg(e,t){var n=e.type==="application/x-moz-file"||fM(e,t);return[n,n?null:kM(t)]}function _g(e,t,n){if(Ln(e.size))if(Ln(t)&&Ln(n)){if(e.size>n)return[!1,Mg(n)];if(e.size<t)return[!1,Ng(t)]}else{if(Ln(t)&&e.size<t)return[!1,Ng(t)];if(Ln(n)&&e.size>n)return[!1,Mg(n)]}return[!0,null]}function Ln(e){return e!=null}function EM(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,o=e.multiple,s=e.maxFiles,a=e.validator;return!o&&t.length>1||o&&s>=1&&t.length>s?!1:t.every(function(l){var u=Lg(l,n),f=di(u,1),c=f[0],h=_g(l,r,i),d=di(h,1),m=d[0],p=a?a(l):null;return c&&m&&!p})}function Do(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Mo(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function Pg(e){e.preventDefault()}function CM(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function AM(e){return e.indexOf("Edge/")!==-1}function TM(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return CM(e)||AM(e)}function Vt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];return t.some(function(a){return!Do(r)&&a&&a.apply(void 0,[r].concat(o)),Do(r)})}}function IM(){return"showOpenFilePicker"in window}function OM(e){if(Ln(e)){var t=Object.entries(e).filter(function(n){var r=di(n,2),i=r[0],o=r[1],s=!0;return Fg(i)||(console.warn('Skipped "'.concat(i,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),s=!1),(!Array.isArray(o)||!o.every(Rg))&&(console.warn('Skipped "'.concat(i,'" because an invalid file extension was provided.')),s=!1),s}).reduce(function(n,r){var i=di(r,2),o=i[0],s=i[1];return Ig(Ig({},n),{},Og({},o,s))},{});return[{description:"Files",accept:t}]}return e}function DM(e){if(Ln(e))return Object.entries(e).reduce(function(t,n){var r=di(n,2),i=r[0],o=r[1];return[].concat(Ag(t),[i],Ag(o))},[]).filter(function(t){return Fg(t)||Rg(t)}).join(",")}function MM(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function NM(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function Fg(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function Rg(e){return/^.*\.[\w]+$/.test(e)}var LM=["children"],_M=["open"],PM=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],FM=["refKey","onChange","onClick"];function RM(e){return zM(e)||$M(e)||Bg(e)||BM()}function BM(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
311
311
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $M(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function zM(e){if(Array.isArray(e))return $l(e)}function Bl(e,t){return jM(e)||UM(e,t)||Bg(e,t)||HM()}function HM(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
312
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Bg(e,t){if(e){if(typeof e=="string")return $l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $l(e,t)}}function $l(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function UM(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,s,a;try{for(n=n.call(e);!(i=(s=n.next()).done)&&(r.push(s.value),!(t&&r.length===t));i=!0);}catch(l){o=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw a}}return r}}function jM(e){if(Array.isArray(e))return e}function $g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$g(Object(n),!0).forEach(function(r){zl(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$g(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function No(e,t){if(e==null)return{};var n=VM(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function VM(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var Hl=D.forwardRef(function(e,t){var n=e.children,r=No(e,LM),i=Hg(r),o=i.open,s=No(i,_M);return D.useImperativeHandle(t,function(){return{open:o}},[o]),D.createElement(D.Fragment,null,n($e($e({},s),{},{open:o})))});Hl.displayName="Dropzone";var zg={disabled:!1,getFilesFromEvent:nM,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};Hl.defaultProps=zg,Hl.propTypes={children:Ne.func,accept:Ne.objectOf(Ne.arrayOf(Ne.string)),multiple:Ne.bool,preventDropOnDocument:Ne.bool,noClick:Ne.bool,noKeyboard:Ne.bool,noDrag:Ne.bool,noDragEventsBubbling:Ne.bool,minSize:Ne.number,maxSize:Ne.number,maxFiles:Ne.number,disabled:Ne.bool,getFilesFromEvent:Ne.func,onFileDialogCancel:Ne.func,onFileDialogOpen:Ne.func,useFsAccessApi:Ne.bool,autoFocus:Ne.bool,onDragEnter:Ne.func,onDragLeave:Ne.func,onDragOver:Ne.func,onDrop:Ne.func,onDropAccepted:Ne.func,onDropRejected:Ne.func,onError:Ne.func,validator:Ne.func};var Ul={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function Hg(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=$e($e({},zg),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,o=t.maxSize,s=t.minSize,a=t.multiple,l=t.maxFiles,u=t.onDragEnter,f=t.onDragLeave,c=t.onDragOver,h=t.onDrop,d=t.onDropAccepted,m=t.onDropRejected,p=t.onFileDialogCancel,g=t.onFileDialogOpen,v=t.useFsAccessApi,y=t.autoFocus,w=t.preventDropOnDocument,A=t.noClick,k=t.noKeyboard,E=t.noDrag,I=t.noDragEventsBubbling,M=t.onError,L=t.validator,T=D.useMemo(function(){return DM(n)},[n]),O=D.useMemo(function(){return OM(n)},[n]),H=D.useMemo(function(){return typeof g=="function"?g:Ug},[g]),P=D.useMemo(function(){return typeof p=="function"?p:Ug},[p]),F=D.useRef(null),_=D.useRef(null),z=D.useReducer(WM,Ul),$=Bl(z,2),U=$[0],W=$[1],b=U.isFocused,N=U.isFileDialogActive,R=D.useRef(typeof window<"u"&&window.isSecureContext&&v&&IM()),S=function(){!R.current&&N&&setTimeout(function(){if(_.current){var ae=_.current.files;ae.length||(W({type:"closeDialog"}),P())}},300)};D.useEffect(function(){return window.addEventListener("focus",S,!1),function(){window.removeEventListener("focus",S,!1)}},[_,N,P,R]);var V=D.useRef([]),ee=function(ae){F.current&&F.current.contains(ae.target)||(ae.preventDefault(),V.current=[])};D.useEffect(function(){return w&&(document.addEventListener("dragover",Pg,!1),document.addEventListener("drop",ee,!1)),function(){w&&(document.removeEventListener("dragover",Pg),document.removeEventListener("drop",ee))}},[F,w]),D.useEffect(function(){return!r&&y&&F.current&&F.current.focus(),function(){}},[F,y,r]);var Y=D.useCallback(function(te){M?M(te):console.error(te)},[M]),G=D.useCallback(function(te){te.preventDefault(),te.persist(),Te(te),V.current=[].concat(RM(V.current),[te.target]),Mo(te)&&Promise.resolve(i(te)).then(function(ae){if(!(Do(te)&&!I)){var j=ae.length,q=j>0&&EM({files:ae,accept:T,minSize:s,maxSize:o,multiple:a,maxFiles:l,validator:L}),oe=j>0&&!q;W({isDragAccept:q,isDragReject:oe,isDragActive:!0,type:"setDraggedFiles"}),u&&u(te)}}).catch(function(ae){return Y(ae)})},[i,u,Y,I,T,s,o,a,l,L]),J=D.useCallback(function(te){te.preventDefault(),te.persist(),Te(te);var ae=Mo(te);if(ae&&te.dataTransfer)try{te.dataTransfer.dropEffect="copy"}catch{}return ae&&c&&c(te),!1},[c,I]),se=D.useCallback(function(te){te.preventDefault(),te.persist(),Te(te);var ae=V.current.filter(function(q){return F.current&&F.current.contains(q)}),j=ae.indexOf(te.target);j!==-1&&ae.splice(j,1),V.current=ae,!(ae.length>0)&&(W({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Mo(te)&&f&&f(te))},[F,f,I]),K=D.useCallback(function(te,ae){var j=[],q=[];te.forEach(function(oe){var le=Lg(oe,T),he=Bl(le,2),je=he[0],Qe=he[1],Je=_g(oe,s,o),Ct=Bl(Je,2),Bt=Ct[0],Ze=Ct[1],At=L?L(oe):null;if(je&&Bt&&!At)j.push(oe);else{var lt=[Qe,Ze];At&&(lt=lt.concat(At)),q.push({file:oe,errors:lt.filter(function(ts){return ts})})}}),(!a&&j.length>1||a&&l>=1&&j.length>l)&&(j.forEach(function(oe){q.push({file:oe,errors:[xM]})}),j.splice(0)),W({acceptedFiles:j,fileRejections:q,type:"setFiles"}),h&&h(j,q,ae),q.length>0&&m&&m(q,ae),j.length>0&&d&&d(j,ae)},[W,a,T,s,o,l,h,d,m,L]),re=D.useCallback(function(te){te.preventDefault(),te.persist(),Te(te),V.current=[],Mo(te)&&Promise.resolve(i(te)).then(function(ae){Do(te)&&!I||K(ae,te)}).catch(function(ae){return Y(ae)}),W({type:"reset"})},[i,K,Y,I]),B=D.useCallback(function(){if(R.current){W({type:"openDialog"}),H();var te={multiple:a,types:O};window.showOpenFilePicker(te).then(function(ae){return i(ae)}).then(function(ae){K(ae,null),W({type:"closeDialog"})}).catch(function(ae){MM(ae)?(P(ae),W({type:"closeDialog"})):NM(ae)?(R.current=!1,_.current?(_.current.value=null,_.current.click()):Y(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):Y(ae)});return}_.current&&(W({type:"openDialog"}),H(),_.current.value=null,_.current.click())},[W,H,P,v,K,Y,O,a]),ne=D.useCallback(function(te){!F.current||!F.current.isEqualNode(te.target)||(te.key===" "||te.key==="Enter"||te.keyCode===32||te.keyCode===13)&&(te.preventDefault(),B())},[F,B]),me=D.useCallback(function(){W({type:"focus"})},[]),we=D.useCallback(function(){W({type:"blur"})},[]),Q=D.useCallback(function(){A||(TM()?setTimeout(B,0):B())},[A,B]),ue=function(ae){return r?null:ae},de=function(ae){return k?null:ue(ae)},fe=function(ae){return E?null:ue(ae)},Te=function(ae){I&&ae.stopPropagation()},Fe=D.useMemo(function(){return function(){var te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ae=te.refKey,j=ae===void 0?"ref":ae,q=te.role,oe=te.onKeyDown,le=te.onFocus,he=te.onBlur,je=te.onClick,Qe=te.onDragEnter,Je=te.onDragOver,Ct=te.onDragLeave,Bt=te.onDrop,Ze=No(te,PM);return $e($e(zl({onKeyDown:de(Vt(oe,ne)),onFocus:de(Vt(le,me)),onBlur:de(Vt(he,we)),onClick:ue(Vt(je,Q)),onDragEnter:fe(Vt(Qe,G)),onDragOver:fe(Vt(Je,J)),onDragLeave:fe(Vt(Ct,se)),onDrop:fe(Vt(Bt,re)),role:typeof q=="string"&&q!==""?q:"presentation"},j,F),!r&&!k?{tabIndex:0}:{}),Ze)}},[F,ne,me,we,Q,G,J,se,re,k,E,r]),De=D.useCallback(function(te){te.stopPropagation()},[]),Ue=D.useMemo(function(){return function(){var te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ae=te.refKey,j=ae===void 0?"ref":ae,q=te.onChange,oe=te.onClick,le=No(te,FM),he=zl({accept:T,multiple:a,type:"file",style:{display:"none"},onChange:ue(Vt(q,re)),onClick:ue(Vt(oe,De)),tabIndex:-1},j,_);return $e($e({},he),le)}},[_,n,a,re,r]);return $e($e({},U),{},{isFocused:b&&!r,getRootProps:Fe,getInputProps:Ue,rootRef:F,inputRef:_,open:ue(B)})}function WM(e,t){switch(t.type){case"focus":return $e($e({},e),{},{isFocused:!0});case"blur":return $e($e({},e),{},{isFocused:!1});case"openDialog":return $e($e({},Ul),{},{isFileDialogActive:!0});case"closeDialog":return $e($e({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return $e($e({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return $e($e({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return $e({},Ul);default:return e}}function Ug(){}const jg=({children:e})=>{const t=D.useRef(null),[n,r]=D.useState({open:!1}),i=({title:s,description:a,confirmButtonText:l,cancelButtonText:u,onConfirm:f,onCancel:c,initialValue:h,Content:d})=>new Promise((m,p)=>{t.current=h,r({open:!0,title:s,description:a,confirmButtonText:l,cancelButtonText:u,content:d?x.jsx(d,{value:h,setValue:g=>{t.current=g}}):null,onConfirm:()=>{f==null||f(),m(t.current),o()},onCancel:()=>{c==null||c(),p(),o()}})}),o=()=>{r(s=>({...s,open:!1}))};return x.jsxs(Ka.Provider,{value:{showInputModal:i},children:[x.jsx(Sr,{open:n.open,onOpenChange:s=>r(a=>({...a,open:s})),children:x.jsx(Sr.Content,{title:n.title,description:n.description,confirmButtonText:n.confirmButtonText,cancelButtonText:n.cancelButtonText,onConfirm:n.onConfirm,onCancel:n.onCancel,children:n.content})}),e]})},qM=(e,t)=>{const n=e.replace(/\s+/g,"+");if(!e.replace(/[^a-zA-Z0-9\s\-_]/g,"").trim())return;const i=t.filter(l=>/^\d+$/.test(l)).join(";"),o=`https://fonts.googleapis.com/css2?family=${n}:wght@${i}&display=swap`;if(document.querySelector(`link[href="${o}"]`))return;const a=document.createElement("link");a.rel="stylesheet",a.href=o,document.head.appendChild(a)},Vg=({color:e,fontFamily:t,radius:n,themeMode:r,variant:i,headerVariant:o,additionalStylesheet:s,additionalStylesheetUrl:a})=>{D.useMemo(()=>{t&&qM(t,["100","200","300","400","500","600","700","800"])},[t]);const l=D.useMemo(()=>jf({color:e,fontFamily:t,radius:n,themeMode:r,variant:i,headerVariant:o}),[e,t,n,r,i,o]);return x.jsxs(x.Fragment,{children:[a&&x.jsx("link",{rel:"stylesheet",href:a}),x.jsxs("style",{children:[l,`
312
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Bg(e,t){if(e){if(typeof e=="string")return $l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $l(e,t)}}function $l(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function UM(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,s,a;try{for(n=n.call(e);!(i=(s=n.next()).done)&&(r.push(s.value),!(t&&r.length===t));i=!0);}catch(l){o=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw a}}return r}}function jM(e){if(Array.isArray(e))return e}function $g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$g(Object(n),!0).forEach(function(r){zl(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$g(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function No(e,t){if(e==null)return{};var n=VM(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function VM(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var Hl=D.forwardRef(function(e,t){var n=e.children,r=No(e,LM),i=Hg(r),o=i.open,s=No(i,_M);return D.useImperativeHandle(t,function(){return{open:o}},[o]),D.createElement(D.Fragment,null,n($e($e({},s),{},{open:o})))});Hl.displayName="Dropzone";var zg={disabled:!1,getFilesFromEvent:nM,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};Hl.defaultProps=zg,Hl.propTypes={children:Ne.func,accept:Ne.objectOf(Ne.arrayOf(Ne.string)),multiple:Ne.bool,preventDropOnDocument:Ne.bool,noClick:Ne.bool,noKeyboard:Ne.bool,noDrag:Ne.bool,noDragEventsBubbling:Ne.bool,minSize:Ne.number,maxSize:Ne.number,maxFiles:Ne.number,disabled:Ne.bool,getFilesFromEvent:Ne.func,onFileDialogCancel:Ne.func,onFileDialogOpen:Ne.func,useFsAccessApi:Ne.bool,autoFocus:Ne.bool,onDragEnter:Ne.func,onDragLeave:Ne.func,onDragOver:Ne.func,onDrop:Ne.func,onDropAccepted:Ne.func,onDropRejected:Ne.func,onError:Ne.func,validator:Ne.func};var Ul={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function Hg(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=$e($e({},zg),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,o=t.maxSize,s=t.minSize,a=t.multiple,l=t.maxFiles,u=t.onDragEnter,f=t.onDragLeave,c=t.onDragOver,h=t.onDrop,d=t.onDropAccepted,m=t.onDropRejected,p=t.onFileDialogCancel,g=t.onFileDialogOpen,y=t.useFsAccessApi,v=t.autoFocus,w=t.preventDropOnDocument,A=t.noClick,k=t.noKeyboard,E=t.noDrag,I=t.noDragEventsBubbling,M=t.onError,P=t.validator,T=D.useMemo(function(){return DM(n)},[n]),O=D.useMemo(function(){return OM(n)},[n]),j=D.useMemo(function(){return typeof g=="function"?g:Ug},[g]),F=D.useMemo(function(){return typeof p=="function"?p:Ug},[p]),L=D.useRef(null),_=D.useRef(null),B=D.useReducer(WM,Ul),z=Bl(B,2),H=z[0],W=z[1],b=H.isFocused,N=H.isFileDialogActive,R=D.useRef(typeof window<"u"&&window.isSecureContext&&y&&IM()),S=function(){!R.current&&N&&setTimeout(function(){if(_.current){var ae=_.current.files;ae.length||(W({type:"closeDialog"}),F())}},300)};D.useEffect(function(){return window.addEventListener("focus",S,!1),function(){window.removeEventListener("focus",S,!1)}},[_,N,F,R]);var V=D.useRef([]),ee=function(ae){L.current&&L.current.contains(ae.target)||(ae.preventDefault(),V.current=[])};D.useEffect(function(){return w&&(document.addEventListener("dragover",Pg,!1),document.addEventListener("drop",ee,!1)),function(){w&&(document.removeEventListener("dragover",Pg),document.removeEventListener("drop",ee))}},[L,w]),D.useEffect(function(){return!r&&v&&L.current&&L.current.focus(),function(){}},[L,v,r]);var K=D.useCallback(function(te){M?M(te):console.error(te)},[M]),Q=D.useCallback(function(te){te.preventDefault(),te.persist(),Te(te),V.current=[].concat(RM(V.current),[te.target]),Mo(te)&&Promise.resolve(i(te)).then(function(ae){if(!(Do(te)&&!I)){var U=ae.length,q=U>0&&EM({files:ae,accept:T,minSize:s,maxSize:o,multiple:a,maxFiles:l,validator:P}),oe=U>0&&!q;W({isDragAccept:q,isDragReject:oe,isDragActive:!0,type:"setDraggedFiles"}),u&&u(te)}}).catch(function(ae){return K(ae)})},[i,u,K,I,T,s,o,a,l,P]),X=D.useCallback(function(te){te.preventDefault(),te.persist(),Te(te);var ae=Mo(te);if(ae&&te.dataTransfer)try{te.dataTransfer.dropEffect="copy"}catch{}return ae&&c&&c(te),!1},[c,I]),se=D.useCallback(function(te){te.preventDefault(),te.persist(),Te(te);var ae=V.current.filter(function(q){return L.current&&L.current.contains(q)}),U=ae.indexOf(te.target);U!==-1&&ae.splice(U,1),V.current=ae,!(ae.length>0)&&(W({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Mo(te)&&f&&f(te))},[L,f,I]),Y=D.useCallback(function(te,ae){var U=[],q=[];te.forEach(function(oe){var le=Lg(oe,T),pe=Bl(le,2),je=pe[0],Qe=pe[1],Je=_g(oe,s,o),Ct=Bl(Je,2),Bt=Ct[0],Ze=Ct[1],At=P?P(oe):null;if(je&&Bt&&!At)U.push(oe);else{var lt=[Qe,Ze];At&&(lt=lt.concat(At)),q.push({file:oe,errors:lt.filter(function(ts){return ts})})}}),(!a&&U.length>1||a&&l>=1&&U.length>l)&&(U.forEach(function(oe){q.push({file:oe,errors:[xM]})}),U.splice(0)),W({acceptedFiles:U,fileRejections:q,type:"setFiles"}),h&&h(U,q,ae),q.length>0&&m&&m(q,ae),U.length>0&&d&&d(U,ae)},[W,a,T,s,o,l,h,d,m,P]),re=D.useCallback(function(te){te.preventDefault(),te.persist(),Te(te),V.current=[],Mo(te)&&Promise.resolve(i(te)).then(function(ae){Do(te)&&!I||Y(ae,te)}).catch(function(ae){return K(ae)}),W({type:"reset"})},[i,Y,K,I]),$=D.useCallback(function(){if(R.current){W({type:"openDialog"}),j();var te={multiple:a,types:O};window.showOpenFilePicker(te).then(function(ae){return i(ae)}).then(function(ae){Y(ae,null),W({type:"closeDialog"})}).catch(function(ae){MM(ae)?(F(ae),W({type:"closeDialog"})):NM(ae)?(R.current=!1,_.current?(_.current.value=null,_.current.click()):K(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."))):K(ae)});return}_.current&&(W({type:"openDialog"}),j(),_.current.value=null,_.current.click())},[W,j,F,y,Y,K,O,a]),ne=D.useCallback(function(te){!L.current||!L.current.isEqualNode(te.target)||(te.key===" "||te.key==="Enter"||te.keyCode===32||te.keyCode===13)&&(te.preventDefault(),$())},[L,$]),he=D.useCallback(function(){W({type:"focus"})},[]),Ce=D.useCallback(function(){W({type:"blur"})},[]),G=D.useCallback(function(){A||(TM()?setTimeout($,0):$())},[A,$]),ue=function(ae){return r?null:ae},de=function(ae){return k?null:ue(ae)},fe=function(ae){return E?null:ue(ae)},Te=function(ae){I&&ae.stopPropagation()},Fe=D.useMemo(function(){return function(){var te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ae=te.refKey,U=ae===void 0?"ref":ae,q=te.role,oe=te.onKeyDown,le=te.onFocus,pe=te.onBlur,je=te.onClick,Qe=te.onDragEnter,Je=te.onDragOver,Ct=te.onDragLeave,Bt=te.onDrop,Ze=No(te,PM);return $e($e(zl({onKeyDown:de(Vt(oe,ne)),onFocus:de(Vt(le,he)),onBlur:de(Vt(pe,Ce)),onClick:ue(Vt(je,G)),onDragEnter:fe(Vt(Qe,Q)),onDragOver:fe(Vt(Je,X)),onDragLeave:fe(Vt(Ct,se)),onDrop:fe(Vt(Bt,re)),role:typeof q=="string"&&q!==""?q:"presentation"},U,L),!r&&!k?{tabIndex:0}:{}),Ze)}},[L,ne,he,Ce,G,Q,X,se,re,k,E,r]),De=D.useCallback(function(te){te.stopPropagation()},[]),Ue=D.useMemo(function(){return function(){var te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ae=te.refKey,U=ae===void 0?"ref":ae,q=te.onChange,oe=te.onClick,le=No(te,FM),pe=zl({accept:T,multiple:a,type:"file",style:{display:"none"},onChange:ue(Vt(q,re)),onClick:ue(Vt(oe,De)),tabIndex:-1},U,_);return $e($e({},pe),le)}},[_,n,a,re,r]);return $e($e({},H),{},{isFocused:b&&!r,getRootProps:Fe,getInputProps:Ue,rootRef:L,inputRef:_,open:ue($)})}function WM(e,t){switch(t.type){case"focus":return $e($e({},e),{},{isFocused:!0});case"blur":return $e($e({},e),{},{isFocused:!1});case"openDialog":return $e($e({},Ul),{},{isFileDialogActive:!0});case"closeDialog":return $e($e({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return $e($e({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return $e($e({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return $e({},Ul);default:return e}}function Ug(){}const jg=({children:e})=>{const t=D.useRef(null),[n,r]=D.useState({open:!1}),i=({title:s,description:a,confirmButtonText:l,cancelButtonText:u,onConfirm:f,onCancel:c,initialValue:h,Content:d})=>new Promise((m,p)=>{t.current=h,r({open:!0,title:s,description:a,confirmButtonText:l,cancelButtonText:u,content:d?x.jsx(d,{value:h,setValue:g=>{t.current=g}}):null,onConfirm:()=>{f==null||f(),m(t.current),o()},onCancel:()=>{c==null||c(),p(),o()}})}),o=()=>{r(s=>({...s,open:!1}))};return x.jsxs(Ka.Provider,{value:{showInputModal:i},children:[x.jsx(Sr,{open:n.open,onOpenChange:s=>r(a=>({...a,open:s})),children:x.jsx(Sr.Content,{title:n.title,description:n.description,confirmButtonText:n.confirmButtonText,cancelButtonText:n.cancelButtonText,onConfirm:n.onConfirm,onCancel:n.onCancel,children:n.content})}),e]})},qM=(e,t)=>{const n=e.replace(/\s+/g,"+");if(!e.replace(/[^a-zA-Z0-9\s\-_]/g,"").trim())return;const i=t.filter(l=>/^\d+$/.test(l)).join(";"),o=`https://fonts.googleapis.com/css2?family=${n}:wght@${i}&display=swap`;if(document.querySelector(`link[href="${o}"]`))return;const a=document.createElement("link");a.rel="stylesheet",a.href=o,document.head.appendChild(a)},Vg=({color:e,fontFamily:t,radius:n,themeMode:r,variant:i,headerVariant:o,additionalStylesheet:s,additionalStylesheetUrl:a})=>{D.useMemo(()=>{t&&qM(t,["100","200","300","400","500","600","700","800"])},[t]);const l=D.useMemo(()=>jf({color:e,fontFamily:t,radius:n,themeMode:r,variant:i,headerVariant:o}),[e,t,n,r,i,o]);return x.jsxs(x.Fragment,{children:[a&&x.jsx("link",{rel:"stylesheet",href:a}),x.jsxs("style",{children:[l,`
313
313
  .bpWebchat {
314
314
  border-radius: ${.375*(n??1)}rem;
315
315
  }
316
316
  .bpMessagePreview {
317
317
  border-radius: ${.125*(n??1)}rem;
318
318
  }
319
- `]}),s&&x.jsx("style",{children:s})]})};let Lo;const YM=new Uint8Array(16);function KM(){if(!Lo&&(Lo=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Lo))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Lo(YM)}const et=[];for(let e=0;e<256;++e)et.push((e+256).toString(16).slice(1));function GM(e,t=0){return et[e[t+0]]+et[e[t+1]]+et[e[t+2]]+et[e[t+3]]+"-"+et[e[t+4]]+et[e[t+5]]+"-"+et[e[t+6]]+et[e[t+7]]+"-"+et[e[t+8]]+et[e[t+9]]+"-"+et[e[t+10]]+et[e[t+11]]+et[e[t+12]]+et[e[t+13]]+et[e[t+14]]+et[e[t+15]]}const Wg={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function QM(e,t,n){if(Wg.randomUUID&&!e)return Wg.randomUUID();e=e||{};const r=e.random||(e.rng||KM)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,GM(r)}function cr(e){var s;const{metadata:t,conversationId:n,userId:r}=e,{payload:i,disableInput:o}=qg(e.payload);return{id:e.id,conversationId:n,authorId:r,timestamp:new Date(e.createdAt),block:i,feedback:(s=e.feedback)==null?void 0:s.value,disableInput:o,metadata:t}}const qg=e=>{switch(e.type){case"audio":return Yg(e);case"card":return ZM(e);case"carousel":return JM(e);case"choice":return XM(e);case"dropdown":return eN(e);case"file":return Kg(e);case"image":return Gg(e);case"location":return Qg(e);case"markdown":return Zg(e);case"text":return Jg(e);case"video":return Xg(e);case"bloc":return tN(e);case"custom":return{payload:e};default:{const t=e;throw new Error(`Unsuported message type ${t}`)}}},hi=e=>({block:e,type:"bubble"}),Yg=e=>({payload:{type:"audio",url:e.audioUrl}}),ZM=e=>({payload:hi(ey(e))}),JM=e=>({payload:{type:"carousel",blocks:e.items.map(t=>ey({...t}))}}),XM=e=>{const t=e.options.map(o=>({title:o.label,value:o.value})),n=e.text,r=QM(),i=hi({type:"text",text:n});return t.length===0?{disableInput:e.disableFreeText,payload:i}:{disableInput:e.disableFreeText,payload:{type:"column",blocks:[i,{type:"row",blocks:t.map(({title:o,value:s})=>({type:"button",variant:"action",text:o,buttonValue:s,groupId:r}))}]}}},eN=e=>{const t=e.options.map(i=>({label:i.label,value:i.value})),n=e.text,r=[{type:"dropdown",label:n??"Select an option",options:t}];return n&&r.unshift({type:"text",text:n}),{disableInput:!0,payload:hi({type:"column",blocks:r})}},Kg=e=>({payload:{type:"file",url:e.fileUrl,title:e.title}}),Gg=e=>({payload:{type:"image",url:e.imageUrl}}),Qg=e=>({payload:{type:"location",latitude:e.latitude,longitude:e.longitude,title:e.title??e.address??"View on map"}}),Zg=e=>({payload:hi({type:"text",text:e.markdown})}),Jg=e=>({payload:hi({type:"text",text:e.text,value:e.value})}),Xg=e=>({payload:{type:"video",url:e.videoUrl}}),tN=e=>({payload:{type:"column",blocks:e.items.map(n=>{switch(n.type){case"audio":return Yg({...n.payload,type:n.type}).payload;case"file":return Kg({...n.payload,type:n.type}).payload;case"image":return Gg({...n.payload,type:n.type}).payload;case"location":return Qg({...n.payload,type:n.type}).payload;case"markdown":return Zg({...n.payload,type:n.type}).payload;case"text":return Jg({...n.payload,type:n.type}).payload;case"video":return Xg({...n.payload,type:n.type}).payload;default:throw new Error("Unsuported message type")}})}}),ey=e=>{const t=e.title,n=e.subtitle,r=e.imageUrl,i=e.actions.map(s=>{switch(s.action){case"postback":return{type:"button",variant:"action",text:s.label,buttonValue:s.value,reusable:!0};case"url":return{type:"button",variant:"link",text:s.label,buttonValue:s.value,reusable:!0};case"say":return{type:"button",variant:"action",text:s.label,buttonValue:s.value,reusable:!0};default:throw new Error(`Unknown action type ${s.action}`)}}),o=[];return r&&o.push({type:"image",url:r}),t&&o.push({type:"text",text:`#### ${t}`}),n&&o.push({type:"text",text:n}),i.length>0&&o.push({type:"row",blocks:i}),{type:"column",horizontalAlignment:"center",blocks:[...o]}};var nN=Object.defineProperty,rN=(e,t,n)=>t in e?nN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,iN=(e,t,n)=>rN(e,t+"",n),oN=async(e,t)=>{let n=typeof t=="function"?await t(e):t;if(n)return e.scheme==="bearer"?`Bearer ${n}`:e.scheme==="basic"?`Basic ${btoa(n)}`:n},sN={bodySerializer:e=>JSON.stringify(e,(t,n)=>typeof n=="bigint"?n.toString():n)},aN=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},lN=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},uN=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},ty=({allowReserved:e,explode:t,name:n,style:r,value:i})=>{if(!t){let a=(e?i:i.map(l=>encodeURIComponent(l))).join(lN(r));switch(r){case"label":return`.${a}`;case"matrix":return`;${n}=${a}`;case"simple":return a;default:return`${n}=${a}`}}let o=aN(r),s=i.map(a=>r==="label"||r==="simple"?e?a:encodeURIComponent(a):_o({allowReserved:e,name:n,value:a})).join(o);return r==="label"||r==="matrix"?o+s:s},_o=({allowReserved:e,name:t,value:n})=>{if(n==null)return"";if(typeof n=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${t}=${e?n:encodeURIComponent(n)}`},ny=({allowReserved:e,explode:t,name:n,style:r,value:i})=>{if(i instanceof Date)return`${n}=${i.toISOString()}`;if(r!=="deepObject"&&!t){let a=[];Object.entries(i).forEach(([u,f])=>{a=[...a,u,e?f:encodeURIComponent(f)]});let l=a.join(",");switch(r){case"form":return`${n}=${l}`;case"label":return`.${l}`;case"matrix":return`;${n}=${l}`;default:return l}}let o=uN(r),s=Object.entries(i).map(([a,l])=>_o({allowReserved:e,name:r==="deepObject"?`${n}[${a}]`:a,value:l})).join(o);return r==="label"||r==="matrix"?o+s:s},cN=/\{[^{}]+\}/g,fN=({path:e,url:t})=>{let n=t,r=t.match(cN);if(r)for(let i of r){let o=!1,s=i.substring(1,i.length-1),a="simple";s.endsWith("*")&&(o=!0,s=s.substring(0,s.length-1)),s.startsWith(".")?(s=s.substring(1),a="label"):s.startsWith(";")&&(s=s.substring(1),a="matrix");let l=e[s];if(l==null)continue;if(Array.isArray(l)){n=n.replace(i,ty({explode:o,name:s,style:a,value:l}));continue}if(typeof l=="object"){n=n.replace(i,ny({explode:o,name:s,style:a,value:l}));continue}if(a==="matrix"){n=n.replace(i,`;${_o({name:s,value:l})}`);continue}let u=encodeURIComponent(a==="label"?`.${l}`:l);n=n.replace(i,u)}return n},ry=({allowReserved:e,array:t,object:n}={})=>r=>{let i=[];if(r&&typeof r=="object")for(let o in r){let s=r[o];if(s!=null){if(Array.isArray(s)){i=[...i,ty({allowReserved:e,explode:!0,name:o,style:"form",value:s,...t})];continue}if(typeof s=="object"){i=[...i,ny({allowReserved:e,explode:!0,name:o,style:"deepObject",value:s,...n})];continue}i=[...i,_o({allowReserved:e,name:o,value:s})]}}return i.join("&")},dN=e=>{var t;if(!e)return"stream";let n=(t=e.split(";")[0])==null?void 0:t.trim();if(n){if(n.startsWith("application/json")||n.endsWith("+json"))return"json";if(n==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(r=>n.startsWith(r)))return"blob";if(n.startsWith("text/"))return"text"}},hN=async({security:e,...t})=>{for(let n of e){let r=await oN(n,t.auth);if(!r)continue;let i=n.name??"Authorization";switch(n.in){case"query":t.query||(t.query={}),t.query[i]=r;break;case"cookie":t.headers.append("Cookie",`${i}=${r}`);break;case"header":default:t.headers.set(i,r);break}return}},iy=e=>pN({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:ry(e.querySerializer),url:e.url}),pN=({baseUrl:e,path:t,query:n,querySerializer:r,url:i})=>{let o=i.startsWith("/")?i:`/${i}`,s=(e??"")+o;t&&(s=fN({path:t,url:s}));let a=n?r(n):"";return a.startsWith("?")&&(a=a.substring(1)),a&&(s+=`?${a}`),s},oy=(e,t)=>{var n;let r={...e,...t};return(n=r.baseUrl)!=null&&n.endsWith("/")&&(r.baseUrl=r.baseUrl.substring(0,r.baseUrl.length-1)),r.headers=sy(e.headers,t.headers),r},sy=(...e)=>{let t=new Headers;for(let n of e){if(!n||typeof n!="object")continue;let r=n instanceof Headers?n.entries():Object.entries(n);for(let[i,o]of r)if(o===null)t.delete(i);else if(Array.isArray(o))for(let s of o)t.append(i,s);else o!==void 0&&t.set(i,typeof o=="object"?JSON.stringify(o):o)}return t},jl=class{constructor(){iN(this,"_fns"),this._fns=[]}clear(){this._fns=[]}exists(t){return this._fns.indexOf(t)!==-1}eject(t){let n=this._fns.indexOf(t);n!==-1&&(this._fns=[...this._fns.slice(0,n),...this._fns.slice(n+1)])}use(t){this._fns=[...this._fns,t]}},mN=()=>({error:new jl,request:new jl,response:new jl}),gN=ry({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),yN={"Content-Type":"application/json"},ay=(e={})=>({...sN,headers:yN,parseAs:"auto",querySerializer:gN,...e}),vN=(e={})=>{let t=oy(ay(),e),n=()=>({...t}),r=s=>(t=oy(t,s),n()),i=mN(),o=async s=>{let a={...t,...s,fetch:s.fetch??t.fetch??globalThis.fetch,headers:sy(t.headers,s.headers)};a.security&&await hN({...a,security:a.security}),a.body&&a.bodySerializer&&(a.body=a.bodySerializer(a.body)),(a.body===void 0||a.body==="")&&a.headers.delete("Content-Type");let l=iy(a),u={redirect:"follow",...a},f=new Request(l,u);for(let g of i.request._fns)f=await g(f,a);let c=a.fetch,h=await c(f);for(let g of i.response._fns)h=await g(h,f,a);let d={request:f,response:h};if(h.ok){if(h.status===204||h.headers.get("Content-Length")==="0")return{data:{},...d};let g=(a.parseAs==="auto"?dN(h.headers.get("Content-Type")):a.parseAs)??"json";if(g==="stream")return{data:h.body,...d};let v=await h[g]();return g==="json"&&(a.responseValidator&&await a.responseValidator(v),a.responseTransformer&&(v=await a.responseTransformer(v))),{data:v,...d}}let m=await h.text();try{m=JSON.parse(m)}catch{}let p=m;for(let g of i.error._fns)p=await g(m,h,f,a);if(p=p||{},a.throwOnError)throw p;return{error:p,...d}};return{buildUrl:iy,connect:s=>o({...s,method:"CONNECT"}),delete:s=>o({...s,method:"DELETE"}),get:s=>o({...s,method:"GET"}),getConfig:n,head:s=>o({...s,method:"HEAD"}),interceptors:i,options:s=>o({...s,method:"OPTIONS"}),patch:s=>o({...s,method:"PATCH"}),post:s=>o({...s,method:"POST"}),put:s=>o({...s,method:"PUT"}),request:o,setConfig:r,trace:s=>o({...s,method:"TRACE"})}},bN=vN,wN=ay;const _e=bN((e=>({...e,withCredentials:!0,timeout:6e4,maxBodyLength:104857600,maxContentLength:104857600,throwOnError:!0,parseAs:"json"}))(wN({baseUrl:"https://webchat.botpress.cloud/"}))),SN=e=>(e.client??_e).delete({url:"/conversations/{id}",...e}),kN=e=>(e.client??_e).get({url:"/conversations/{id}",...e}),xN=e=>(e.client??_e).get({url:"/conversations",...e}),EN=e=>(e.client??_e).post({url:"/conversations",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),CN=e=>(e.client??_e).get({url:"/conversations/{id}/messages",...e}),AN=e=>(e.client??_e).get({url:"/conversations/{id}/participants",...e}),TN=e=>(e.client??_e).post({url:"/conversations/{id}/participants",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),IN=e=>(e.client??_e).delete({url:"/conversations/{id}/participants/{userId}",...e}),ON=e=>(e.client??_e).get({url:"/conversations/{id}/participants/{userId}",...e}),DN=e=>(e.client??_e).delete({url:"/messages/{id}",...e}),MN=e=>(e.client??_e).get({url:"/messages/{id}",...e}),NN=e=>(e.client??_e).put({url:"/messages/{id}",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),LN=e=>(e.client??_e).post({url:"/messages",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),_N=e=>(e.client??_e).delete({url:"/messages/{id}/feedback",...e}),PN=e=>(e.client??_e).put({url:"/messages/{id}/feedback",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),FN=e=>(e.client??_e).delete({url:"/users/me",...e}),RN=e=>(e.client??_e).get({url:"/users/me",...e}),BN=e=>(e.client??_e).put({url:"/users/me",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),$N=e=>((e==null?void 0:e.client)??_e).post({url:"/users/key",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),zN=e=>(e.client??_e).get({url:"/events/{id}",...e}),HN=e=>(e.client??_e).post({url:"/events",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),UN=e=>(e.client??_e).post({url:"/files",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}});let ly=class extends Error{constructor(t,n){super(t),this.name="ParseError",this.type=n.type,this.field=n.field,this.value=n.value,this.line=n.line}};function Vl(e){}function jN(e){if(typeof e=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:t=Vl,onError:n=Vl,onRetry:r=Vl,onComment:i}=e;let o="",s=!0,a,l="",u="";function f(p){const g=s?p.replace(/^\xEF\xBB\xBF/,""):p,[v,y]=VN(`${o}${g}`);for(const w of v)c(w);o=y,s=!1}function c(p){if(p===""){d();return}if(p.startsWith(":")){i&&i(p.slice(p.startsWith(": ")?2:1));return}const g=p.indexOf(":");if(g!==-1){const v=p.slice(0,g),y=p[g+1]===" "?2:1,w=p.slice(g+y);h(v,w,p);return}h(p,"",p)}function h(p,g,v){switch(p){case"event":u=g;break;case"data":l=`${l}${g}
320
- `;break;case"id":a=g.includes("\0")?void 0:g;break;case"retry":/^\d+$/.test(g)?r(parseInt(g,10)):n(new ly(`Invalid \`retry\` value: "${g}"`,{type:"invalid-retry",value:g,line:v}));break;default:n(new ly(`Unknown field "${p.length>20?`${p.slice(0,20)}…`:p}"`,{type:"unknown-field",field:p,value:g,line:v}));break}}function d(){l.length>0&&t({id:a,event:u||void 0,data:l.endsWith(`
319
+ `]}),s&&x.jsx("style",{children:s})]})};let Lo;const YM=new Uint8Array(16);function KM(){if(!Lo&&(Lo=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Lo))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Lo(YM)}const et=[];for(let e=0;e<256;++e)et.push((e+256).toString(16).slice(1));function GM(e,t=0){return et[e[t+0]]+et[e[t+1]]+et[e[t+2]]+et[e[t+3]]+"-"+et[e[t+4]]+et[e[t+5]]+"-"+et[e[t+6]]+et[e[t+7]]+"-"+et[e[t+8]]+et[e[t+9]]+"-"+et[e[t+10]]+et[e[t+11]]+et[e[t+12]]+et[e[t+13]]+et[e[t+14]]+et[e[t+15]]}const Wg={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function QM(e,t,n){if(Wg.randomUUID&&!e)return Wg.randomUUID();e=e||{};const r=e.random||(e.rng||KM)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,GM(r)}function cr(e){var s;const{metadata:t,conversationId:n,userId:r}=e,{payload:i,disableInput:o}=qg(e.payload);return{id:e.id,conversationId:n,authorId:r,timestamp:new Date(e.createdAt),block:i,feedback:(s=e.feedback)==null?void 0:s.value,disableInput:o,metadata:t}}const qg=e=>{switch(e.type){case"audio":return Yg(e);case"card":return ZM(e);case"carousel":return JM(e);case"choice":return XM(e);case"dropdown":return eN(e);case"file":return Kg(e);case"image":return Gg(e);case"location":return Qg(e);case"markdown":return Zg(e);case"text":return Jg(e);case"video":return Xg(e);case"bloc":return tN(e);case"custom":return{payload:e};default:{const t=e;throw new Error(`Unsuported message type ${t}`)}}},hi=e=>({block:e,type:"bubble"}),Yg=e=>({payload:{type:"audio",url:e.audioUrl}}),ZM=e=>({payload:hi(ey(e))}),JM=e=>({payload:{type:"carousel",blocks:e.items.map(t=>ey({...t}))}}),XM=e=>{const t=e.options.map(o=>({title:o.label,value:o.value})),n=e.text,r=QM(),i=hi({type:"text",text:n});return t.length===0?{disableInput:e.disableFreeText,payload:i}:{disableInput:e.disableFreeText,payload:{type:"column",blocks:[i,{type:"row",blocks:t.map(({title:o,value:s})=>({type:"button",variant:"action",text:o,buttonValue:s,groupId:r}))}]}}},eN=e=>{const t=e.options.map(i=>({label:i.label,value:i.value})),n=e.text,r=[{type:"dropdown",label:n??"Select an option",options:t}];return n&&r.unshift({type:"text",text:n}),{disableInput:!0,payload:hi({type:"column",blocks:r})}},Kg=e=>({payload:{type:"file",url:e.fileUrl,title:e.title}}),Gg=e=>({payload:{type:"image",url:e.imageUrl}}),Qg=e=>({payload:{type:"location",latitude:e.latitude,longitude:e.longitude,title:e.title??e.address??"View on map"}}),Zg=e=>({payload:hi({type:"text",text:e.markdown})}),Jg=e=>({payload:hi({type:"text",text:e.text,value:e.value})}),Xg=e=>({payload:{type:"video",url:e.videoUrl}}),tN=e=>({payload:{type:"column",blocks:e.items.map(n=>{switch(n.type){case"audio":return Yg({...n.payload,type:n.type}).payload;case"file":return Kg({...n.payload,type:n.type}).payload;case"image":return Gg({...n.payload,type:n.type}).payload;case"location":return Qg({...n.payload,type:n.type}).payload;case"markdown":return Zg({...n.payload,type:n.type}).payload;case"text":return Jg({...n.payload,type:n.type}).payload;case"video":return Xg({...n.payload,type:n.type}).payload;default:throw new Error("Unsuported message type")}})}}),ey=e=>{const t=e.title,n=e.subtitle,r=e.imageUrl,i=e.actions.map(s=>{switch(s.action){case"postback":return{type:"button",variant:"action",text:s.label,buttonValue:s.value,reusable:!0};case"url":return{type:"button",variant:"link",text:s.label,buttonValue:s.value,reusable:!0};case"say":return{type:"button",variant:"action",text:s.label,buttonValue:s.value,reusable:!0};default:throw new Error(`Unknown action type ${s.action}`)}}),o=[];return r&&o.push({type:"image",url:r}),t&&o.push({type:"text",text:`#### ${t}`}),n&&o.push({type:"text",text:n}),i.length>0&&o.push({type:"row",blocks:i}),{type:"column",horizontalAlignment:"center",blocks:[...o]}};var nN=Object.defineProperty,rN=(e,t,n)=>t in e?nN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,iN=(e,t,n)=>rN(e,t+"",n),oN=async(e,t)=>{let n=typeof t=="function"?await t(e):t;if(n)return e.scheme==="bearer"?`Bearer ${n}`:e.scheme==="basic"?`Basic ${btoa(n)}`:n},sN={bodySerializer:e=>JSON.stringify(e,(t,n)=>typeof n=="bigint"?n.toString():n)},aN=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},lN=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},uN=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},ty=({allowReserved:e,explode:t,name:n,style:r,value:i})=>{if(!t){let a=(e?i:i.map(l=>encodeURIComponent(l))).join(lN(r));switch(r){case"label":return`.${a}`;case"matrix":return`;${n}=${a}`;case"simple":return a;default:return`${n}=${a}`}}let o=aN(r),s=i.map(a=>r==="label"||r==="simple"?e?a:encodeURIComponent(a):_o({allowReserved:e,name:n,value:a})).join(o);return r==="label"||r==="matrix"?o+s:s},_o=({allowReserved:e,name:t,value:n})=>{if(n==null)return"";if(typeof n=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${t}=${e?n:encodeURIComponent(n)}`},ny=({allowReserved:e,explode:t,name:n,style:r,value:i})=>{if(i instanceof Date)return`${n}=${i.toISOString()}`;if(r!=="deepObject"&&!t){let a=[];Object.entries(i).forEach(([u,f])=>{a=[...a,u,e?f:encodeURIComponent(f)]});let l=a.join(",");switch(r){case"form":return`${n}=${l}`;case"label":return`.${l}`;case"matrix":return`;${n}=${l}`;default:return l}}let o=uN(r),s=Object.entries(i).map(([a,l])=>_o({allowReserved:e,name:r==="deepObject"?`${n}[${a}]`:a,value:l})).join(o);return r==="label"||r==="matrix"?o+s:s},cN=/\{[^{}]+\}/g,fN=({path:e,url:t})=>{let n=t,r=t.match(cN);if(r)for(let i of r){let o=!1,s=i.substring(1,i.length-1),a="simple";s.endsWith("*")&&(o=!0,s=s.substring(0,s.length-1)),s.startsWith(".")?(s=s.substring(1),a="label"):s.startsWith(";")&&(s=s.substring(1),a="matrix");let l=e[s];if(l==null)continue;if(Array.isArray(l)){n=n.replace(i,ty({explode:o,name:s,style:a,value:l}));continue}if(typeof l=="object"){n=n.replace(i,ny({explode:o,name:s,style:a,value:l}));continue}if(a==="matrix"){n=n.replace(i,`;${_o({name:s,value:l})}`);continue}let u=encodeURIComponent(a==="label"?`.${l}`:l);n=n.replace(i,u)}return n},ry=({allowReserved:e,array:t,object:n}={})=>r=>{let i=[];if(r&&typeof r=="object")for(let o in r){let s=r[o];if(s!=null){if(Array.isArray(s)){i=[...i,ty({allowReserved:e,explode:!0,name:o,style:"form",value:s,...t})];continue}if(typeof s=="object"){i=[...i,ny({allowReserved:e,explode:!0,name:o,style:"deepObject",value:s,...n})];continue}i=[...i,_o({allowReserved:e,name:o,value:s})]}}return i.join("&")},dN=e=>{var t;if(!e)return"stream";let n=(t=e.split(";")[0])==null?void 0:t.trim();if(n){if(n.startsWith("application/json")||n.endsWith("+json"))return"json";if(n==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(r=>n.startsWith(r)))return"blob";if(n.startsWith("text/"))return"text"}},hN=async({security:e,...t})=>{for(let n of e){let r=await oN(n,t.auth);if(!r)continue;let i=n.name??"Authorization";switch(n.in){case"query":t.query||(t.query={}),t.query[i]=r;break;case"cookie":t.headers.append("Cookie",`${i}=${r}`);break;case"header":default:t.headers.set(i,r);break}return}},iy=e=>pN({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:ry(e.querySerializer),url:e.url}),pN=({baseUrl:e,path:t,query:n,querySerializer:r,url:i})=>{let o=i.startsWith("/")?i:`/${i}`,s=(e??"")+o;t&&(s=fN({path:t,url:s}));let a=n?r(n):"";return a.startsWith("?")&&(a=a.substring(1)),a&&(s+=`?${a}`),s},oy=(e,t)=>{var n;let r={...e,...t};return(n=r.baseUrl)!=null&&n.endsWith("/")&&(r.baseUrl=r.baseUrl.substring(0,r.baseUrl.length-1)),r.headers=sy(e.headers,t.headers),r},sy=(...e)=>{let t=new Headers;for(let n of e){if(!n||typeof n!="object")continue;let r=n instanceof Headers?n.entries():Object.entries(n);for(let[i,o]of r)if(o===null)t.delete(i);else if(Array.isArray(o))for(let s of o)t.append(i,s);else o!==void 0&&t.set(i,typeof o=="object"?JSON.stringify(o):o)}return t},jl=class{constructor(){iN(this,"_fns"),this._fns=[]}clear(){this._fns=[]}exists(t){return this._fns.indexOf(t)!==-1}eject(t){let n=this._fns.indexOf(t);n!==-1&&(this._fns=[...this._fns.slice(0,n),...this._fns.slice(n+1)])}use(t){this._fns=[...this._fns,t]}},mN=()=>({error:new jl,request:new jl,response:new jl}),gN=ry({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),yN={"Content-Type":"application/json"},ay=(e={})=>({...sN,headers:yN,parseAs:"auto",querySerializer:gN,...e}),vN=(e={})=>{let t=oy(ay(),e),n=()=>({...t}),r=s=>(t=oy(t,s),n()),i=mN(),o=async s=>{let a={...t,...s,fetch:s.fetch??t.fetch??globalThis.fetch,headers:sy(t.headers,s.headers)};a.security&&await hN({...a,security:a.security}),a.body&&a.bodySerializer&&(a.body=a.bodySerializer(a.body)),(a.body===void 0||a.body==="")&&a.headers.delete("Content-Type");let l=iy(a),u={redirect:"follow",...a},f=new Request(l,u);for(let g of i.request._fns)f=await g(f,a);let c=a.fetch,h=await c(f);for(let g of i.response._fns)h=await g(h,f,a);let d={request:f,response:h};if(h.ok){if(h.status===204||h.headers.get("Content-Length")==="0")return{data:{},...d};let g=(a.parseAs==="auto"?dN(h.headers.get("Content-Type")):a.parseAs)??"json";if(g==="stream")return{data:h.body,...d};let y=await h[g]();return g==="json"&&(a.responseValidator&&await a.responseValidator(y),a.responseTransformer&&(y=await a.responseTransformer(y))),{data:y,...d}}let m=await h.text();try{m=JSON.parse(m)}catch{}let p=m;for(let g of i.error._fns)p=await g(m,h,f,a);if(p=p||{},a.throwOnError)throw p;return{error:p,...d}};return{buildUrl:iy,connect:s=>o({...s,method:"CONNECT"}),delete:s=>o({...s,method:"DELETE"}),get:s=>o({...s,method:"GET"}),getConfig:n,head:s=>o({...s,method:"HEAD"}),interceptors:i,options:s=>o({...s,method:"OPTIONS"}),patch:s=>o({...s,method:"PATCH"}),post:s=>o({...s,method:"POST"}),put:s=>o({...s,method:"PUT"}),request:o,setConfig:r,trace:s=>o({...s,method:"TRACE"})}},bN=vN,wN=ay;const _e=bN((e=>({...e,withCredentials:!0,timeout:6e4,maxBodyLength:104857600,maxContentLength:104857600,throwOnError:!0,parseAs:"json"}))(wN({baseUrl:"https://webchat.botpress.cloud/"}))),SN=e=>(e.client??_e).delete({url:"/conversations/{id}",...e}),kN=e=>(e.client??_e).get({url:"/conversations/{id}",...e}),xN=e=>(e.client??_e).get({url:"/conversations",...e}),EN=e=>(e.client??_e).post({url:"/conversations",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),CN=e=>(e.client??_e).get({url:"/conversations/{id}/messages",...e}),AN=e=>(e.client??_e).get({url:"/conversations/{id}/participants",...e}),TN=e=>(e.client??_e).post({url:"/conversations/{id}/participants",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),IN=e=>(e.client??_e).delete({url:"/conversations/{id}/participants/{userId}",...e}),ON=e=>(e.client??_e).get({url:"/conversations/{id}/participants/{userId}",...e}),DN=e=>(e.client??_e).delete({url:"/messages/{id}",...e}),MN=e=>(e.client??_e).get({url:"/messages/{id}",...e}),NN=e=>(e.client??_e).put({url:"/messages/{id}",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),LN=e=>(e.client??_e).post({url:"/messages",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),_N=e=>(e.client??_e).delete({url:"/messages/{id}/feedback",...e}),PN=e=>(e.client??_e).put({url:"/messages/{id}/feedback",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),FN=e=>(e.client??_e).delete({url:"/users/me",...e}),RN=e=>(e.client??_e).get({url:"/users/me",...e}),BN=e=>(e.client??_e).put({url:"/users/me",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),$N=e=>((e==null?void 0:e.client)??_e).post({url:"/users/key",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),zN=e=>(e.client??_e).get({url:"/events/{id}",...e}),HN=e=>(e.client??_e).post({url:"/events",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),UN=e=>(e.client??_e).post({url:"/files",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}});let ly=class extends Error{constructor(t,n){super(t),this.name="ParseError",this.type=n.type,this.field=n.field,this.value=n.value,this.line=n.line}};function Vl(e){}function jN(e){if(typeof e=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:t=Vl,onError:n=Vl,onRetry:r=Vl,onComment:i}=e;let o="",s=!0,a,l="",u="";function f(p){const g=s?p.replace(/^\xEF\xBB\xBF/,""):p,[y,v]=VN(`${o}${g}`);for(const w of y)c(w);o=v,s=!1}function c(p){if(p===""){d();return}if(p.startsWith(":")){i&&i(p.slice(p.startsWith(": ")?2:1));return}const g=p.indexOf(":");if(g!==-1){const y=p.slice(0,g),v=p[g+1]===" "?2:1,w=p.slice(g+v);h(y,w,p);return}h(p,"",p)}function h(p,g,y){switch(p){case"event":u=g;break;case"data":l=`${l}${g}
320
+ `;break;case"id":a=g.includes("\0")?void 0:g;break;case"retry":/^\d+$/.test(g)?r(parseInt(g,10)):n(new ly(`Invalid \`retry\` value: "${g}"`,{type:"invalid-retry",value:g,line:y}));break;default:n(new ly(`Unknown field "${p.length>20?`${p.slice(0,20)}…`:p}"`,{type:"unknown-field",field:p,value:g,line:y}));break}}function d(){l.length>0&&t({id:a,event:u||void 0,data:l.endsWith(`
321
321
  `)?l.slice(0,-1):l}),a=void 0,l="",u=""}function m(p={}){o&&p.consume&&c(o),s=!0,a=void 0,l="",u="",o=""}return{feed:f,reset:m}}function VN(e){const t=[];let n="",r=0;for(;r<e.length;){const i=e.indexOf("\r",r),o=e.indexOf(`
322
322
  `,r);let s=-1;if(i!==-1&&o!==-1?s=Math.min(i,o):i!==-1?i===e.length-1?s=-1:s=i:o!==-1&&(s=o),s===-1){n=e.slice(r);break}else{const a=e.slice(r,s);t.push(a),r=s+1,e[r-1]==="\r"&&e[r]===`
323
- `&&r++}}return[t,n]}class uy extends Event{constructor(t,n){var r,i;super(t),this.code=(r=n==null?void 0:n.code)!=null?r:void 0,this.message=(i=n==null?void 0:n.message)!=null?i:void 0}[Symbol.for("nodejs.util.inspect.custom")](t,n,r){return r(cy(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(cy(this),n)}}function WN(e){const t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function Wl(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(Wl).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${Wl(e.cause)}`:e.message:`${e}`}function cy(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var fy=e=>{throw TypeError(e)},ql=(e,t,n)=>t.has(e)||fy("Cannot "+n),be=(e,t,n)=>(ql(e,t,"read from private field"),n?n.call(e):t.get(e)),Ge=(e,t,n)=>t.has(e)?fy("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Pe=(e,t,n,r)=>(ql(e,t,"write to private field"),t.set(e,n),n),Zt=(e,t,n)=>(ql(e,t,"access private method"),n),ht,_n,fr,Po,Fo,pi,dr,mi,mn,hr,pr,mr,gi,Ft,Yl,Kl,Gl,dy,Ql,Zl,yi,Jl,Xl;let Ro=class extends EventTarget{constructor(t,n){var r,i;super(),Ge(this,Ft),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,Ge(this,ht),Ge(this,_n),Ge(this,fr),Ge(this,Po),Ge(this,Fo),Ge(this,pi),Ge(this,dr),Ge(this,mi,null),Ge(this,mn),Ge(this,hr),Ge(this,pr,null),Ge(this,mr,null),Ge(this,gi,null),Ge(this,Kl,async o=>{var s;be(this,hr).reset();const{body:a,redirected:l,status:u,headers:f}=o;if(u===204){Zt(this,Ft,yi).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(l?Pe(this,fr,new URL(o.url)):Pe(this,fr,void 0),u!==200){Zt(this,Ft,yi).call(this,`Non-200 status code (${u})`,u);return}if(!(f.get("content-type")||"").startsWith("text/event-stream")){Zt(this,Ft,yi).call(this,'Invalid content type, expected "text/event-stream"',u);return}if(be(this,ht)===this.CLOSED)return;Pe(this,ht,this.OPEN);const c=new Event("open");if((s=be(this,gi))==null||s.call(this,c),this.dispatchEvent(c),typeof a!="object"||!a||!("getReader"in a)){Zt(this,Ft,yi).call(this,"Invalid response body, expected a web ReadableStream",u),this.close();return}const h=new TextDecoder,d=a.getReader();let m=!0;do{const{done:p,value:g}=await d.read();g&&be(this,hr).feed(h.decode(g,{stream:!p})),p&&(m=!1,be(this,hr).reset(),Zt(this,Ft,Jl).call(this))}while(m)}),Ge(this,Gl,o=>{Pe(this,mn,void 0),!(o.name==="AbortError"||o.type==="aborted")&&Zt(this,Ft,Jl).call(this,Wl(o))}),Ge(this,Ql,o=>{typeof o.id=="string"&&Pe(this,mi,o.id);const s=new MessageEvent(o.event||"message",{data:o.data,origin:be(this,fr)?be(this,fr).origin:be(this,_n).origin,lastEventId:o.id||""});be(this,mr)&&(!o.event||o.event==="message")&&be(this,mr).call(this,s),this.dispatchEvent(s)}),Ge(this,Zl,o=>{Pe(this,pi,o)}),Ge(this,Xl,()=>{Pe(this,dr,void 0),be(this,ht)===this.CONNECTING&&Zt(this,Ft,Yl).call(this)});try{if(t instanceof URL)Pe(this,_n,t);else if(typeof t=="string")Pe(this,_n,new URL(t,qN()));else throw new Error("Invalid URL")}catch{throw WN("An invalid or illegal string was specified")}Pe(this,hr,jN({onEvent:be(this,Ql),onRetry:be(this,Zl)})),Pe(this,ht,this.CONNECTING),Pe(this,pi,3e3),Pe(this,Fo,(r=n==null?void 0:n.fetch)!=null?r:globalThis.fetch),Pe(this,Po,(i=n==null?void 0:n.withCredentials)!=null?i:!1),Zt(this,Ft,Yl).call(this)}get readyState(){return be(this,ht)}get url(){return be(this,_n).href}get withCredentials(){return be(this,Po)}get onerror(){return be(this,pr)}set onerror(t){Pe(this,pr,t)}get onmessage(){return be(this,mr)}set onmessage(t){Pe(this,mr,t)}get onopen(){return be(this,gi)}set onopen(t){Pe(this,gi,t)}addEventListener(t,n,r){const i=n;super.addEventListener(t,i,r)}removeEventListener(t,n,r){const i=n;super.removeEventListener(t,i,r)}close(){be(this,dr)&&clearTimeout(be(this,dr)),be(this,ht)!==this.CLOSED&&(be(this,mn)&&be(this,mn).abort(),Pe(this,ht,this.CLOSED),Pe(this,mn,void 0))}};ht=new WeakMap,_n=new WeakMap,fr=new WeakMap,Po=new WeakMap,Fo=new WeakMap,pi=new WeakMap,dr=new WeakMap,mi=new WeakMap,mn=new WeakMap,hr=new WeakMap,pr=new WeakMap,mr=new WeakMap,gi=new WeakMap,Ft=new WeakSet,Yl=function(){Pe(this,ht,this.CONNECTING),Pe(this,mn,new AbortController),be(this,Fo)(be(this,_n),Zt(this,Ft,dy).call(this)).then(be(this,Kl)).catch(be(this,Gl))},Kl=new WeakMap,Gl=new WeakMap,dy=function(){var e;const t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...be(this,mi)?{"Last-Event-ID":be(this,mi)}:void 0},cache:"no-store",signal:(e=be(this,mn))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},Ql=new WeakMap,Zl=new WeakMap,yi=function(e,t){var n;be(this,ht)!==this.CLOSED&&Pe(this,ht,this.CLOSED);const r=new uy("error",{code:t,message:e});(n=be(this,pr))==null||n.call(this,r),this.dispatchEvent(r)},Jl=function(e,t){var n;if(be(this,ht)===this.CLOSED)return;Pe(this,ht,this.CONNECTING);const r=new uy("error",{code:t,message:e});(n=be(this,pr))==null||n.call(this,r),this.dispatchEvent(r),Pe(this,dr,setTimeout(be(this,Xl),be(this,pi)))},Xl=new WeakMap,Ro.CONNECTING=0,Ro.OPEN=1,Ro.CLOSED=2;function qN(){const e="document"in globalThis?globalThis.document:void 0;return e&&typeof e=="object"&&"baseURI"in e&&typeof e.baseURI=="string"?e.baseURI:void 0}async function YN(e){var t;const n=await e.clone().json();if((t=n==null?void 0:n.id)!=null&&t.startsWith("err_")){const r=new Error(n.message);throw r.id=n.id,r.code=n.code,r.type=n.type,r}return e}const hy=()=>{const e={};return{on:(t,n)=>{var r;return e[t]||(e[t]=new Set),(r=e[t])==null||r.add(n),()=>{var i;return(i=e[t])==null?void 0:i.delete(n)}},emit:(t,n)=>{var r,i;(r=e[t])==null||r.forEach(o=>o(n)),(i=e["*"])==null||i.forEach(o=>o({type:t,payload:n}))},cleanup:()=>{for(const t in e)delete e[t]}}},He=e=>e.data,py=10,my=3e3,KN="60000",gy=(e,t)=>{const n=(...r)=>e.on(...r);return new Proxy(n,{get:(r,i)=>i==="on"?e.on:i==="disconnect"?t:i==="cleanup"?e.cleanup:Reflect.get(r,i)})},GN={throwOnError:!0},QN=({conversationId:e,userToken:t,clientId:n,apiUrl:r,adminSecret:i})=>{let o=0,s=null,a=null;const l=hy();let u=e,f=t;const c=()=>{s&&(clearTimeout(s),s=null),a&&(a.close(),a=null)},h=()=>{a&&a.close();const d=`${`${r||_e.getConfig().baseUrl}/${n}`}/initialize${u?`?conversationId=${u}`:""}`,m={...i?{"x-admin-secret":i}:{},...f?{"x-user-key":f}:{}};a=vy(d,m),a.addEventListener("open",()=>l.emit("open")),a.addEventListener("error",p=>{o<py?(o++,s=setTimeout(()=>h(),my)):l.emit("error",p)}),a.addEventListener("message",p=>{const g=yy(p.data);g.type==="init"&&(u=g.data.conversation.id??u,f=g.data.user.userKey??f),l.emit(g.type,g.data)})};return h(),gy(l,c)},ZN=({userKey:e,clientId:t,apiUrl:n,customHeaders:r,advancedOptions:i})=>{const o={"x-user-key":e,...r},s=`${n||_e.getConfig().baseUrl}/${t}`,a={...GN,baseUrl:s};return _e.interceptors.response._fns.length===0&&_e.interceptors.response.use(YN),{createConversation:()=>EN({...a,headers:o,body:{}}).then(He),getConversation:({conversationId:l})=>kN({...a,headers:o,path:{id:l}}).then(He),deleteConversation:({conversationId:l})=>SN({...a,headers:o,path:{id:l}}).then(He),listConversations:({nextToken:l})=>xN({...a,headers:o,query:{nextToken:l}}).then(He),listConversationMessages:({conversationId:l,nextToken:u})=>CN({...a,headers:o,path:{id:l},query:{nextToken:u}}).then(He),addParticipant:({conversationId:l,userId:u})=>TN({...a,headers:o,path:{id:l},body:{userId:u}}).then(He),removeParticipant:({conversationId:l,userId:u})=>IN({...a,headers:o,path:{id:l,userId:u}}).then(He),getParticipant:({conversationId:l,userId:u})=>ON({...a,headers:o,path:{id:l,userId:u}}).then(He),listParticipants:({conversationId:l,nextToken:u})=>AN({...a,headers:o,path:{id:l},query:{nextToken:u}}).then(He),createMessage:l=>LN({...a,headers:o,body:l}).then(He),updateMessage:({messageId:l,...u})=>NN({...a,headers:o,path:{id:l},body:u}).then(He),getMessage:({messageId:l})=>MN({...a,headers:o,path:{id:l}}).then(He),deleteMessage:({messageId:l})=>DN({...a,headers:o,path:{id:l}}).then(He),createFile:l=>UN({...a,headers:o,body:l}).then(He),getUser:()=>RN({...a,headers:o}).then(He),updateUser:l=>BN({...a,headers:o,body:l}).then(He),deleteUser:()=>FN({...a,headers:o}).then(He),createEvent:l=>HN({...a,headers:o,body:l}).then(He),getEvent:({eventId:l})=>zN({...a,headers:o,path:{id:l}}).then(He),addMessageFeedback:({messageId:l,...u})=>PN({...a,headers:o,path:{id:l},body:u}).then(He),removeMessageFeedback:({messageId:l})=>_N({...a,headers:o,path:{id:l}}).then(He),generateUserKey:({adminSecret:l,...u})=>$N({...a,headers:{"x-admin-secret":l},body:u}).then(He),listenConversation:({conversationId:l})=>{let u=0,f=null,c=null;const h=hy(),d=()=>{f&&(clearTimeout(f),f=null),c&&(c.close(),c=null)},m=()=>{c&&c.close();const p=`${s}/conversations/${l}/listen`,g=i==null?void 0:i.eventSource;c=g?g({url:p,headers:o}):vy(p,o),c.addEventListener("open",()=>h.emit("open")),c.addEventListener("error",v=>{u<py?(u++,f=setTimeout(()=>m(),my)):h.emit("error",v)}),c.addEventListener("message",v=>{const y=yy(v.data);h.emit(y.type,y.data)})};return m(),gy(h,d)}}},yy=e=>{try{return JSON.parse(e)}catch{return e}},vy=(e,t)=>new Ro(e,{fetch:(n,r)=>fetch(n,{...r,headers:{...r==null?void 0:r.headers,...t,timeout:KN}})}),JN=async({apiUrl:e,clientId:t,adminSecret:n,clientHeaders:r,emitter:i,conversationId:o,userToken:s})=>new Promise(a=>{const l=QN({apiUrl:e,clientId:t,userToken:s,conversationId:o,adminSecret:n}),u=l("init",({conversation:f,messages:c,participants:h,user:d})=>{const m=Ha(f.id),p=c.reverse().map(cr).filter(Boolean);m.getState().setMessages(p),Wa(f.id).getState().setParticipants(h);const v=ZN({clientId:t,apiUrl:e,userKey:d.userKey,customHeaders:r});v.createEvent({conversationId:f.id,payload:{type:"conversation_started",data:{}}}).then(({event:y})=>{var w,A;(A=(w=y.payload.data)==null?void 0:w.status)!=null&&A.isInitial&&i.emit("conversation",f.id)}),a({on:l,conversation:f,messages:c,participants:h,user:d,client:v,onCleanup:()=>{u(),l.disconnect(),l.cleanup()}})})}),XN={webchat:"#9C27B0",client:"#2196F3",store:"#4CAF50",events:"#00BCD4"},eL={debug:"#9E9E9E",info:"#2196F3",warn:"#FF9800",error:"#F44336"};let by=!1,eu=null,wy=Date.now();const tL=e=>{by=e,wy=Date.now()},nL=e=>{eu=e},rL=()=>{const e=Date.now()-wy,t=Math.floor(e/1e3),n=e%1e3;return`+${t}.${n.toString().padStart(3,"0")}s`},iL=e=>e===void 0?"undefined":e===null?"null":e instanceof Error?{error:e.message,stack:e.stack}:e,Bo=e=>{const t=XN[e]||"#666",n=(r,...i)=>{if(!by&&r!=="warn"&&r!=="error")return;const o=rL(),s=`%c[bp:${e}]%c ${o} %c${r.toUpperCase()}%c`,a=[`color: ${t}; font-weight: bold;`,"color: #999; font-size: 10px;",`color: ${eL[r]}; font-weight: bold;`,"color: inherit;"],l=i.map(iL);if(console[r](s,...a,...l),eu){const[u,f]=i;eu(`debug:${e}:${r}`,{message:typeof u=="string"?u:void 0,...typeof f=="object"&&f!==null?f:{}})}};return{debug:(...r)=>n("debug",...r),info:(...r)=>n("info",...r),warn:(...r)=>n("warn",...r),error:(...r)=>n("error",...r)}},Sy={webchat:Bo("webchat"),client:Bo("client"),store:Bo("store"),events:Bo("events")};function ky(){const[e,t]=D.useState(!1),n=D.useRef(null);return{state:e,setState:(r,i)=>{if(t(r),!r)return()=>{};if(n.current=new Date,!i)return()=>{};const o=setTimeout(()=>{const s=n.current;s&&new Date().getTime()-s.getTime()>i&&t(!1)},i+100);return()=>clearTimeout(o)}}}const vi=Sy.webchat;function xy({apiUrl:e="https://webchat.botpress.cloud",clientId:t,storageKey:n,storageLocation:r,adminSecret:i,clientHeaders:o,playNotificationSound:s,...a}){const l=Np(n,r),u=l(O=>O.conversationId),f=l(O=>O.user),c=l(O=>O.setConversationId),h=l(O=>O.setUser),{state:d,setState:m}=ky(),{state:p,setState:g}=ky(),v=D.useMemo(()=>hc(),[]),[y,w]=D.useState("connecting"),[A,k]=D.useState(void 0),[E,I]=D.useState(void 0),M=D.useRef(null),L=o1(a.conversationId,a.userToken,u,f==null?void 0:f.userToken);D.useEffect(()=>{let O=!1;vi.info("starting initialization",{clientId:t,apiUrl:e,storageKey:n});const H=async()=>{var F;await T(L),O&&(vi.debug("initialization completed but effect was cleaned up, tearing down"),(F=M.current)==null||F.call(M),M.current=null)},P=r1(t,e);if(P){vi.error("configuration error",P),I(P),w("error");return}return H(),()=>{O=!0,M.current&&(M.current(),M.current=null)}},[a.conversationId,a.userToken,t,e]);const T=async({conversationId:O,userToken:H})=>{var N;(N=M.current)==null||N.call(M),I(void 0),m(!1),g(!1),w("connecting");const{on:P,conversation:F,user:_,client:z,onCleanup:$}=await JN({apiUrl:e,clientId:t,clientHeaders:o,emitter:v,adminSecret:i,conversationId:O,userToken:H});k(z),c(F.id),h({userId:_.id,userToken:_.userKey});const U=Ha(F.id),W=Wa(F.id),b=[$,P("open",()=>{I(void 0),w("connected")}),P("error",R=>{vi.error("connection error",{error:R,conversationId:F.id}),I(S=>S||Rr(R)),w("error"),v.emit("error",new Error(`Connection to conversation lost: ${R==null?void 0:R.message}`))}),P("message_created",R=>{const S=cr(R);U.getState().saveMessage(S),_.id!==S.authorId&&(s==null||s(),m(!1),g(!1),v.emit("isTyping",{isTyping:!1,timeout:0})),v.emit("message",S)}),P("message_updated",R=>{const S=cr(R);U.getState().saveMessage(S)}),P("message_status_changed",R=>{var S;R.newStatus==="processing"&&U.getState().updateMessage((S=R.message.metadata)==null?void 0:S.clientMessageId,{status:R.newStatus})}),P("typing_stopped",()=>{m(!1),g(!1)}),P("typing_started",()=>{m(!0,5e3),g(!0,5e3),v.emit("isTyping",{isTyping:!0,timeout:5e3})}),P("participant_added",R=>{W.getState().addParticipant(R.participant),v.emit("participantAdded",R.participant)}),P("participant_removed",R=>{W.getState().removeParticipant(R.participantId),v.emit("participantRemoved",R.participantId)}),P("webchat_visibility",R=>v.emit("webchatVisibility",R.visibility)),P("webchat_config",R=>v.emit("webchatConfig",R.config)),P("custom",R=>v.emit("customEvent",R.event))];w("connected"),vi.info("client fully connected with event handlers ready",{conversationId:F.id}),M.current=()=>{b.forEach(R=>R())}};return{clientState:y,httpClient:A,error:E,activeConversationId:u,userCredentials:f,isTyping:d,isAwaitingResponse:p,openConversation:T,setAwaitingResponse:g,emitter:v,setError:I,setClientState:w}}const Ey=D.createContext(null);function $o(){const e=D.useContext(Ey);if(!e)throw new Error("useWebchatContext must be used inside <WebchatProvider>");return e}function Cy({clientId:e,apiUrl:t,storageKey:n,storageLocation:r,adminSecret:i,clientHeaders:o,children:s,...a}){var k;const{clientState:l,httpClient:u,error:f,activeConversationId:c,userCredentials:h,isTyping:d,isAwaitingResponse:m,openConversation:p,setClientState:g,setError:v,setAwaitingResponse:y,emitter:w}=xy({apiUrl:t,clientId:e,storageKey:n,storageLocation:r,adminSecret:i,clientHeaders:o,conversationId:a.conversationId,userToken:(k=a.userCredentials)==null?void 0:k.userToken}),A={client:u,clientState:l,setClientState:g,conversationId:c,userCredentials:h,error:f,setError:v,isTyping:d,isAwaitingResponse:m,openConversation:p,setAwaitingResponse:y,emitter:w};return x.jsx(Ey.Provider,{value:A,children:s})}const tu=({children:e,className:t,uploadFile:n,allowFileUpload:r,storageKey:i,conversationId:o,...s})=>{const{container:a}=ye,l=Jn(g=>g.setMessageContainerRef),f=Lp(o||"default",i)(g=>g.uploadFile),[c,h]=D.useState(0),d=D.useRef(null);D.useEffect(()=>{l(d)},[d,l]);const m=D.useCallback(g=>{n&&(g.forEach(v=>f(v,n)),h(0))},[f,n]),{getRootProps:p}=Hg({noClick:!0,noKeyboard:!0,onDrop:m,disabled:!(r&&n),onDragEnter:()=>h(g=>g+1),onDragLeave:()=>h(g=>g-1)});return x.jsxs("div",{...s,className:ur(a.className,t),...p(),ref:d,children:[x.jsxs("div",{"data-hover":c>0,...a.dropzone.overlay,children:["Drop files to upload",x.jsx(KA,{style:{width:"50px"}})]}),x.jsx(jg,{children:e})]})};tu.displayName="Container";const Ay=D.forwardRef(({onClick:e,imgUrl:t,...n},r)=>{const{fab:i}=ye,{container:o,icon:s,image:a}=i??{};return t?x.jsx("img",{src:t,role:"button",tabIndex:0,...a,draggable:"false",onClick:e}):x.jsx("div",{...n,...o,ref:r,onClick:e,children:x.jsx("div",{...s})})});Ay.displayName="Fab";function Jt(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function oL(e,t){const n=C.createContext(t),r=o=>{const{children:s,...a}=o,l=C.useMemo(()=>a,Object.values(a));return x.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function i(o){const s=C.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function Ty(e,t=[]){let n=[];function r(o,s){const a=C.createContext(s),l=n.length;n=[...n,s];const u=c=>{var v;const{scope:h,children:d,...m}=c,p=((v=h==null?void 0:h[e])==null?void 0:v[l])||a,g=C.useMemo(()=>m,Object.values(m));return x.jsx(p.Provider,{value:g,children:d})};u.displayName=o+"Provider";function f(c,h){var p;const d=((p=h==null?void 0:h[e])==null?void 0:p[l])||a,m=C.useContext(d);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${c}\` must be used within \`${o}\``)}return[u,f]}const i=()=>{const o=n.map(s=>C.createContext(s));return function(a){const l=(a==null?void 0:a[e])||o;return C.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,sL(i,...t)]}function sL(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const c=l(o)[`__scope${u}`];return{...a,...c}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var aL=C[" useInsertionEffect ".trim().toString()]||tn;function Iy({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,s]=lL({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:i;{const f=C.useRef(e!==void 0);C.useEffect(()=>{const c=f.current;c!==a&&console.warn(`${r} is changing from ${c?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=a},[a,r])}const u=C.useCallback(f=>{var c;if(a){const h=uL(f)?f(e):f;h!==e&&((c=s.current)==null||c.call(s,h))}else o(f)},[a,e,o,s]);return[l,u]}function lL({defaultProp:e,onChange:t}){const[n,r]=C.useState(e),i=C.useRef(n),o=C.useRef(t);return aL(()=>{o.current=t},[t]),C.useEffect(()=>{var s;i.current!==n&&((s=o.current)==null||s.call(o,n),i.current=n)},[n,i]),[n,r,o]}function uL(e){return typeof e=="function"}function Oy(e){const t=cL(e),n=C.forwardRef((r,i)=>{const{children:o,...s}=r,a=C.Children.toArray(o),l=a.find(dL);if(l){const u=l.props.children,f=a.map(c=>c===l?C.Children.count(u)>1?C.Children.only(null):C.isValidElement(u)?u.props.children:null:c);return x.jsx(t,{...s,ref:i,children:C.isValidElement(u)?C.cloneElement(u,void 0,f):null})}return x.jsx(t,{...s,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function cL(e){const t=C.forwardRef((n,r)=>{const{children:i,...o}=n;if(C.isValidElement(i)){const s=pL(i),a=hL(o,i.props);return i.type!==C.Fragment&&(a.ref=r?rs(r,s):s),C.cloneElement(i,a)}return C.Children.count(i)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var fL=Symbol("radix.slottable");function dL(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===fL}function hL(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{const l=o(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function pL(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var mL=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Rt=mL.reduce((e,t)=>{const n=Oy(`Primitive.${t}`),r=C.forwardRef((i,o)=>{const{asChild:s,...a}=i,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(l,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function gL(e,t){e&&Hu.flushSync(()=>e.dispatchEvent(t))}function yL(e,t){return C.useReducer((n,r)=>t[n][r]??n,e)}var zo=e=>{const{present:t,children:n}=e,r=vL(t),i=typeof n=="function"?n({present:r.isPresent}):C.Children.only(n),o=nn(r.ref,bL(i));return typeof n=="function"||r.isPresent?C.cloneElement(i,{ref:o}):null};zo.displayName="Presence";function vL(e){const[t,n]=C.useState(),r=C.useRef(null),i=C.useRef(e),o=C.useRef("none"),s=e?"mounted":"unmounted",[a,l]=yL(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{const u=Ho(r.current);o.current=a==="mounted"?u:"none"},[a]),tn(()=>{const u=r.current,f=i.current;if(f!==e){const h=o.current,d=Ho(u);e?l("MOUNT"):d==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(f&&h!==d?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),tn(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,c=d=>{const p=Ho(r.current).includes(CSS.escape(d.animationName));if(d.target===t&&p&&(l("ANIMATION_END"),!i.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},h=d=>{d.target===t&&(o.current=Ho(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:C.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Ho(e){return(e==null?void 0:e.animationName)||"none"}function bL(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var wL=C[" useId ".trim().toString()]||(()=>{}),SL=0;function Uo(e){const[t,n]=C.useState(wL());return tn(()=>{n(r=>r??String(SL++))},[e]),e||(t?`radix-${t}`:"")}var jo="Collapsible",[kL]=Ty(jo),[xL,nu]=kL(jo),Dy=C.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:s,...a}=e,[l,u]=Iy({prop:r,defaultProp:i??!1,onChange:s,caller:jo});return x.jsx(xL,{scope:n,disabled:o,contentId:Uo(),open:l,onOpenToggle:C.useCallback(()=>u(f=>!f),[u]),children:x.jsx(Rt.div,{"data-state":iu(l),"data-disabled":o?"":void 0,...a,ref:t})})});Dy.displayName=jo;var My="CollapsibleTrigger",Ny=C.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=nu(My,n);return x.jsx(Rt.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":iu(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:Jt(e.onClick,i.onOpenToggle)})});Ny.displayName=My;var ru="CollapsibleContent",Ly=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=nu(ru,e.__scopeCollapsible);return x.jsx(zo,{present:n||i.open,children:({present:o})=>x.jsx(EL,{...r,ref:t,present:o})})});Ly.displayName=ru;var EL=C.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=e,s=nu(ru,n),[a,l]=C.useState(r),u=C.useRef(null),f=nn(t,u),c=C.useRef(0),h=c.current,d=C.useRef(0),m=d.current,p=s.open||a,g=C.useRef(p),v=C.useRef(void 0);return C.useEffect(()=>{const y=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(y)},[]),tn(()=>{const y=u.current;if(y){v.current=v.current||{transitionDuration:y.style.transitionDuration,animationName:y.style.animationName},y.style.transitionDuration="0s",y.style.animationName="none";const w=y.getBoundingClientRect();c.current=w.height,d.current=w.width,g.current||(y.style.transitionDuration=v.current.transitionDuration,y.style.animationName=v.current.animationName),l(r)}},[s.open,r]),x.jsx(Rt.div,{"data-state":iu(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!p,...o,ref:f,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:p&&i})});function iu(e){return e?"open":"closed"}var CL=Dy,AL=Ly;const ou=({restartConversation:e,...t})=>{var s,a;const{header:n}=ye,{showInputModal:r}=Ga(),i=Ye(),o=async l=>{l.stopPropagation(),r?r({title:i["restartConversation.title"],description:i["restartConversation.description"],confirmButtonText:i["restartConversation.confirm"],cancelButtonText:i["restartConversation.cancel"]}).then(()=>e()):e()};return x.jsx(lT,{...t,...(a=(s=n==null?void 0:n.content)==null?void 0:s.actions)==null?void 0:a.icons,"aria-label":i["restartConversation.button.ariaLabel"],tabIndex:0,role:"button",onClick:o})},su=({onClick:e,...t})=>{const{header:n}=ye,r=Ye(),i=o=>{o.stopPropagation(),e==null||e()};return x.jsx(wp,{...t,...n.content.actions.icons,role:"button",tabIndex:0,"aria-label":r["closeButton.ariaLabel"],onClick:i,onKeyDown:o=>{o.key==="Enter"&&i(o)}})},TL=({onClick:e,...t})=>{const{header:n}=ye,r=Ye(),i=o=>{o.stopPropagation(),e==null||e()};return x.jsx(pp,{...t,...n.content.actions.icons,role:"button",tabIndex:0,"aria-label":r["conversationHistory.showButton.ariaLabel"],onClick:i,onKeyDown:o=>{o.key==="Enter"&&i(o)}})},bi=({icon:e,title:t,link:n,...r})=>{var s,a,l,u,f,c,h,d,m,p,g,v;const{header:i}=ye,o=e??GA;return t?n?x.jsxs("a",{...r,...(a=(s=i.expandedContent)==null?void 0:s.descriptionItems)==null?void 0:a.container,href:n,target:"_blank",rel:"noreferrer noopener",children:[x.jsx(o,{...(u=(l=i.expandedContent)==null?void 0:l.descriptionItems)==null?void 0:u.icon}),x.jsx("p",{...(c=(f=i.expandedContent)==null?void 0:f.descriptionItems)==null?void 0:c.link,children:t})]}):x.jsxs("div",{...r,...(d=(h=i.expandedContent)==null?void 0:h.descriptionItems)==null?void 0:d.container,children:[x.jsx(o,{...(p=(m=i.expandedContent)==null?void 0:m.descriptionItems)==null?void 0:p.icon}),x.jsx("p",{...(v=(g=i.expandedContent)==null?void 0:g.descriptionItems)==null?void 0:v.text,children:t})]}):null},IL=({soundOn:e,toggleSound:t})=>{const n=Ye(),r=s=>{s.stopPropagation(),t==null||t()},{header:i}=ye,o=e?bp:mT;return x.jsx("div",{role:"button",tabIndex:0,onClick:r,onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),r(s))},title:e?n["header.sound.disable"]:n["header.sound.enable"],...i.content.actions.icons,children:x.jsx(o,{size:16})})},_y=({defaultOpen:e,closeWindow:t,configuration:n,restartConversation:r,showConversationHistory:i,disabled:o,soundOn:s,toggleSound:a,clientId:l,...u})=>{var g,v,y,w,A,k,E,I,M,L,T,O,H,P,F,_,z,$,U,W,b,N,R,S;const{header:f}=ye,c=Ye(),[h,d]=D.useState(e),m=!!((g=n.email)!=null&&g.title)||!!((v=n.phone)!=null&&v.title)||!!((y=n.website)!=null&&y.title)||!!((w=n.termsOfService)!=null&&w.link)||!!((A=n.privacyPolicy)!=null&&A.link),p=m&&!o;return x.jsxs(CL,{open:p?h:!1,onOpenChange:p?d:void 0,"data-disabled":p?void 0:"",...f.container,...u,children:[x.jsxs(Ny,{"aria-label":c["header.expandButton.ariaLabel"],...f.content.container,children:[x.jsx("div",{...f.content.conversationHistory,children:i&&!h&&x.jsx(TL,{onClick:i})}),x.jsx(Cn,{userId:l,src:n.botAvatar,...f.content.avatar,children:n.botName||c["header.defaultBotName"]}),x.jsx("h2",{...f.content.title,children:n.botName||c["header.defaultBotName"]}),n.botDescription&&x.jsx("p",{...f.content.description,children:n.botDescription}),x.jsxs("div",{...f.content.actions.container,children:[n.soundEnabled&&s!==void 0&&a&&x.jsx(IL,{soundOn:s,toggleSound:a}),r&&x.jsx(ou,{restartConversation:r}),t&&x.jsx(su,{onClick:t})]})]}),m&&x.jsxs(AL,{...f.expandedContent.container,children:[x.jsxs("div",{"data-links":"",...f.expandedContent.group,children:[x.jsx(bi,{"data-email":"",icon:nT,title:(k=n.email)==null?void 0:k.title,link:(I=(E=n.email)==null?void 0:E.link)!=null&&I.startsWith("mailto:")?(M=n.email)==null?void 0:M.link:`mailto:${(L=n.email)==null?void 0:L.link}`}),x.jsx(bi,{"data-phone":"",icon:sT,title:(T=n.phone)==null?void 0:T.title,link:(H=(O=n.phone)==null?void 0:O.link)!=null&&H.startsWith("tel:")?(P=n.phone)==null?void 0:P.link:`tel:${(F=n.phone)==null?void 0:F.link}`}),x.jsx(bi,{"data-website":"",link:(_=n.website)==null?void 0:_.link,icon:JA,title:(z=n.website)==null?void 0:z.title})]}),x.jsxs("div",{"data-legal":"",...($=f.expandedContent)==null?void 0:$.group,children:[((U=n.termsOfService)==null?void 0:U.link)&&x.jsx(bi,{"data-terms":"",link:(W=n.termsOfService)==null?void 0:W.link,icon:yp,title:(b=n.termsOfService)==null?void 0:b.title}),((N=n.privacyPolicy)==null?void 0:N.link)&&x.jsx(bi,{"data-privacy":"",link:(R=n.privacyPolicy)==null?void 0:R.link,icon:tT,title:(S=n.privacyPolicy)==null?void 0:S.title})]})]})]})},au=D.memo(({...e})=>{const{typingIndicator:t}=ye;return x.jsx("div",{...e,...t==null?void 0:t.container,children:x.jsx("div",{...t==null?void 0:t.loader})})});au.displayName="TypingIndicator";const lu=D.memo(D.forwardRef(({direction:e,block:t,disableInput:n,children:r,sender:i,id:o,authorId:s,status:a,renderers:l,isReadOnly:u,isLastDeliveredMessage:f,feedback:c,timestamp:h,metadata:d,sendMessage:m,addMessageFeedback:p,showAvatar:g},v)=>{const[y,w]=D.useState([]),{message:{container:A,deliveryStatus:k,deliveryStatusLabel:E}}=ye,I=Ye();return g=g??e==="incoming",x.jsx(Ya.Provider,{value:{isLoading:y,setIsLoading:w},children:x.jsxs("div",{...A,className:ur(A==null?void 0:A.className,f&&(k==null?void 0:k.className)),"data-loaded":y.length===0,"data-disable-input":!!n,"data-direction":e,dir:"auto",ref:v,children:[e==="incoming"&&g&&x.jsx(Py,{authorId:s,sender:i}),t&&x.jsx(Nn,{block:{...t,isReadOnly:u,direction:e,timestamp:h,sender:i,feedback:c,messageId:o,status:a,metadata:d,sendMessage:m,addMessageFeedback:p},renderers:l}),e==="outgoing"&&g&&x.jsx(Py,{authorId:s,sender:i}),r,e==="outgoing"&&x.jsx("span",{...E,"aria-hidden":!f,children:I["message.status.delivered"]})]})})})),Py=({authorId:e,sender:t})=>{const{message:{avatar:n}}=ye,[r,i]=D.useState("idle"),o=Zu(e??"",15);return x.jsxs(cs,{"data-color":o,"data-loading-status":r,...n==null?void 0:n.container,children:[x.jsx(fs,{...n==null?void 0:n.image,onLoadingStatusChange:i,src:t==null?void 0:t.avatar}),x.jsxs(ds,{...n==null?void 0:n.fallback,children:[t==null?void 0:t.name[0]," "]})]})};function OL({botAvatar:e,botDescription:t,botName:n}){const{messageList:{marquee:r}}=ye;return x.jsxs("li",{...r.container,children:[x.jsx(Cn,{src:e,...r.avatar,children:(n||"Bot").slice(0,1)}),x.jsxs("div",{...r.content,children:[x.jsx("h1",{...r.title,children:n||"Bot"}),x.jsx("p",{...r.description,children:t})]})]})}let uu=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");const DL=70,ML=300;function NL(e,t={}){const n=t.nearBottomThreshold??DL,[r,i]=D.useState(!0),o=D.useRef(null),s=D.useRef(0),a=D.useRef(!0),l=D.useRef(!1),u=D.useRef(!1),f=D.useRef(0),c=D.useCallback(y=>y.scrollHeight-y.clientHeight-y.scrollTop<n,[n]),h=D.useCallback((y,w=ML)=>{cancelAnimationFrame(f.current);const A=y.scrollTop,k=performance.now(),E=()=>{const I=performance.now()-k,M=Math.min(I/w,1),L=1-Math.pow(1-M,3),T=y.scrollHeight-y.clientHeight;y.scrollTop=A+(T-A)*L,s.current=y.scrollTop,M<1&&u.current?f.current=requestAnimationFrame(E):(y.scrollTop=y.scrollHeight-y.clientHeight,s.current=y.scrollTop,u.current=!1,a.current=!0,i(!0))};u.current=!0,f.current=requestAnimationFrame(E)},[]),d=D.useCallback(()=>{const y=o.current;y&&(a.current=!0,i(!0),h(y))},[h]),m=D.useCallback(()=>{const y=o.current;if(!y)return;if(l.current){l.current=!1,s.current=y.scrollTop,a.current=c(y);return}if(u.current){s.current=y.scrollTop,c(y)&&(u.current=!1,l.current=!0,y.scrollTop=y.scrollHeight-y.clientHeight,s.current=y.scrollTop,a.current=!0,i(!0));return}s.current=y.scrollTop;const w=c(y);a.current=w,i(w)},[c]),p=D.useCallback(y=>{y.deltaY<0&&(cancelAnimationFrame(f.current),u.current=!1,a.current=!1,i(!1))},[]),g=D.useCallback(()=>{u.current&&(cancelAnimationFrame(f.current),u.current=!1)},[]),v=D.useCallback(y=>{const w=o.current;w&&(w.removeEventListener("scroll",m),w.removeEventListener("wheel",p),w.removeEventListener("touchstart",g)),o.current=y,y&&(y.addEventListener("scroll",m,{passive:!0}),y.addEventListener("wheel",p,{passive:!0}),y.addEventListener("touchstart",g,{passive:!0}),s.current=y.scrollTop)},[m,p,g]);return D.useLayoutEffect(()=>{const y=o.current;if(y)if(a.current){const w=y.scrollHeight-y.clientHeight,A=w-y.scrollTop;A>0&&A<=y.clientHeight&&y.clientHeight>0?(u.current=!0,y.scrollTo({top:w,behavior:"smooth"}),cancelAnimationFrame(f.current),f.current=requestAnimationFrame(()=>{u.current&&o.current&&c(o.current)&&(u.current=!1,a.current=!0,i(!0))})):(cancelAnimationFrame(f.current),u.current=!1,y.scrollTop=w),s.current=w,a.current=!0}else l.current=!0,y.scrollTop=s.current},[e,c]),D.useEffect(()=>{const y=o.current;if(!y)return;const w=y.firstElementChild;if(!w)return;const A=new ResizeObserver(()=>{o.current&&(u.current||(a.current?(l.current=!0,o.current.scrollTop=o.current.scrollHeight-o.current.clientHeight,s.current=o.current.scrollTop):o.current.scrollTop=s.current))});return A.observe(w),()=>A.disconnect()},[]),D.useEffect(()=>{const y=window.visualViewport;if(!y)return;const w=()=>{const A=o.current;A&&(u.current||a.current&&(l.current=!0,A.scrollTop=A.scrollHeight-A.clientHeight,s.current=A.scrollTop))};return y.addEventListener("resize",w),()=>y.removeEventListener("resize",w)},[]),D.useEffect(()=>{const y=o.current;if(!y)return;let w=!1;const A=new IntersectionObserver(k=>{var E,I;(E=k[0])!=null&&E.isIntersecting&&w&&a.current&&(y.scrollTop=y.scrollHeight-y.clientHeight,s.current=y.scrollTop),w=!((I=k[0])!=null&&I.isIntersecting)});return A.observe(y),()=>A.disconnect()},[]),D.useEffect(()=>()=>cancelAnimationFrame(f.current),[]),{scrollRef:v,isAtBottom:r,scrollToBottom:d}}const LL={height:"100%",width:"100%",overflowY:"auto",scrollbarWidth:"none",overscrollBehaviorY:"contain"},cu=D.memo(({className:e,messages:t=[],isTyping:n,headerMessage:r,renderers:i,botAvatar:o,botDescription:s,botName:a,sendMessage:l,addMessageFeedback:u,showMarquee:f=!0,showDateSystemMessage:c=!0,showMessageStatus:h=!0,showIncomingMessageAvatar:d=!0,showOutgoingMessageAvatar:m=!1,...p})=>{var O;const{messageList:g}=ye,v=Ye(),y=D.useMemo(()=>c?Ab(t,v):t,[t,v]),w=D.useMemo(()=>{var P;const H=y.filter(F=>F.direction==="outgoing"&&F.status!=="pending");return(P=H[H.length-1])==null?void 0:P.id},[y]),A=y[y.length-1],k=(A==null?void 0:A.id)??"",E=`${y.length}:${k}:${n}`,{scrollRef:I,isAtBottom:M,scrollToBottom:L}=NL(E);D.useEffect(()=>{(A==null?void 0:A.direction)==="outgoing"&&L()},[k]);const T=H=>{if(H.direction==="incoming")return d;if(H.direction==="outgoing")return m};return x.jsxs("div",{...p,className:ur(g.container.className,e),children:[x.jsx("div",{ref:I,style:LL,children:x.jsxs("div",{className:g.viewPort.className,children:[r&&x.jsx("span",{...g.headerMessage,children:r}),f&&x.jsx(OL,{botAvatar:o,botDescription:s,botName:a}),y.map(H=>{var P;return x.jsx(lu,{renderers:i,sendMessage:l,addMessageFeedback:u,isLastDeliveredMessage:h&&H.id===w,showAvatar:T(H),...H},((P=H.metadata)==null?void 0:P.clientMessageId)||H.id)}),n&&x.jsx(lu,{id:uu(),renderers:i,sendMessage:l,direction:"incoming",timestamp:new Date,showAvatar:d,block:void 0,sender:((O=t.filter(H=>H.direction==="incoming").at(-1))==null?void 0:O.sender)??{name:a||"Bot",avatar:o},children:x.jsx(au,{})})]})}),!M&&x.jsx("button",{className:g.scrollDownButton.className,onClick:()=>L()})]})});cu.displayName="MessageList";const Fy=({className:e,...t})=>{const{className:n}=ye.loader;return x.jsx("div",{...t,className:ur(e,n)})};function Ry({error:e,restartConversation:t,closeWindow:n}){const r=Ye();let i,o;const{error:s}=ye;return e.type==="configuration"?(i=r["error.configuration"],o=x.jsx(oT,{...s.icon})):e.type==="bot"?(i=r["error.bot"],o=x.jsx(hp,{...s.icon})):e.type==="network"?(i=r["error.network"],o=x.jsx(gT,{...s.icon})):e.type==="disconnected"?(i=r["error.disconnected"],o=x.jsx(dT,{...s.icon})):(i=r["error.unexpected"],o=x.jsx(hp,{...s.icon})),x.jsx(_L,{error:e,title:i,icon:o,restartConversation:t,closeWindow:n})}function _L({error:e,title:t,icon:n,restartConversation:r,closeWindow:i}){const{error:o}=ye;return x.jsxs("div",{...o.container,children:[x.jsxs("div",{...o.header.container,children:[t,x.jsxs("div",{...o.header.actions,children:[r&&x.jsx(ou,{restartConversation:r,style:{color:"white",backgroundColor:"transparent"}}),i&&x.jsx(su,{onClick:i,style:{color:"white",backgroundColor:"transparent"}})]})]}),x.jsxs("div",{...o.content,children:[n,x.jsx("div",{...o.errorTitle,children:t}),x.jsx("div",{...o.errorMessage,children:e.message}),e.id&&x.jsx("div",{...o.id,children:e.id})]})]})}const wi=Sy.webchat;async function PL(e,t){const{userId:n,conversationId:r,userToken:i,openConversation:o,setClientState:s,setError:a,emitter:l}=t;wi.warn("handleWebchatError",{userId:n,conversationId:r,type:e.type,message:e.message});const f=[{name:"startNewConversation",predicate:c=>c.message===Rs||c.type==="ResourceNotFound",recover:async()=>o({userToken:i})},{name:"reopenConversation",predicate:c=>c.type==="network",recover:async()=>o({userToken:i,conversationId:r})}].find(c=>c.predicate(e));if(!f){wi.error("no recovery strategy found, setting error state",{userId:n,conversationId:r}),s("error"),a(e);return}wi.info("attempting recovery",{userId:n,conversationId:r,strategy:f.name});try{await od(f.recover,3,5e3),wi.info("recovery successful",{userId:n,conversationId:r}),a(void 0),s("connected")}catch(c){wi.error("recovery failed",{error:c,userId:n,conversationId:r}),a(Rr(c)),s("error"),l.emit("error",c)}}function FL(e,t){return async(...n)=>{try{return await e(...n)}catch(r){await PL(Rr(r),t)}}}function By(e,t){const n={};for(const[r,i]of Object.entries(e))n[r]=FL(i,t);return n}function $y({client:e,conversationId:t}){return{sendEvent:async(r,i)=>{if(!e||!t)throw new Error("Cannot send event: client or conversationId not available");await e.createEvent({conversationId:t,payload:{type:"custom",data:r},bindConversation:(i==null?void 0:i.bindConversation)??!0,bindUser:(i==null?void 0:i.bindUser)??!0})}}}function zy({client:e,conversationId:t,user:n}){return{uploadFile:async i=>{if(!e)throw new Error("Client not initialized");if(!t)throw new Error("No active conversation");if(!n)throw new Error("User not authenticated");const{size:o,name:s}=i,a=await i1(i),l=new Date;l.setDate(l.getDate()+30);const{file:{uploadUrl:u,contentType:f,url:c,id:h}}=await e.createFile({size:o,key:`${uu(6)}-${i.name}`,accessPolicies:["public_content"],index:!1,tags:{source:"integration",integrationName:"webchat",conversation:t,user:n.userId},expiresAt:l.toISOString()});await fetch(u,{method:"PUT",headers:{"x-amz-tagging":"public=true","content-type":f},body:a});const d=f.split("/").shift()??"",m=qf(d)?d:"file";return{fileUrl:c,name:s,type:m,fileId:h}}}}function Hy({client:e,conversationId:t,userId:n,setAwaitingResponse:r}){const i=Ha(t||"default"),o=i(d=>d.messages),s=i(d=>d.saveMessage),a=i(d=>d.updateMessage),l=i(d=>d.setMessages),u=i(d=>d.clearMessages);return{messages:o,sendMessage:async d=>{if(!e||!t||!n)throw console.log("Cannot send message: client, conversationId, or userId not available",e,t,n),new Error("Cannot send message: client, conversationId, or userId not available");r==null||r(!0,1e3);const m=uu(),p={id:m,createdAt:new Date().toISOString(),userId:n,conversationId:t,payload:d,metadata:{clientMessageId:m,delivered:!1}},g=cr(p);g.status="pending",s(g),await e.createMessage({conversationId:t,payload:d,metadata:{clientMessageId:m}})},setMessages:d=>{const m=d.map(p=>cr(p)).filter(Boolean);l(m)},clearMessages:u,saveMessageFeedback:async(d,m)=>{if(!e)throw new Error("Cannot update feedback: client not available");a(d,{feedback:m.value}),await e.addMessageFeedback({messageId:d,...m})}}}function Uy({client:e,conversationId:t}){const n=Wa(t||"default"),r=n(u=>u.participants),i=n(u=>u.setParticipants),o=n(u=>u.addParticipant),s=n(u=>u.removeParticipant),a=n(u=>u.clearParticipants);return{participants:r,setParticipants:i,fetchParticipants:async()=>{if(!e||!t)return;const{participants:u}=await e.listParticipants({conversationId:t});i(u)},clearParticipants:a,addParticipant:o,removeParticipant:s}}const jy={chatMessageNotification:new URL("data:audio/ogg;base64,T2dnUwACAAAAAAAAAAAVJAEzAAAAAOU+A6UBHgF2b3JiaXMAAAAAASJWAAD/////AH0AAP////+pAU9nZ1MAAAAAAAAAAAAAFSQBMwEAAAD3T/UfDpz////////////////FA3ZvcmJpcwwAAABMYXZmNjEuNy4xMDAEAAAAHwAAAGVuY29kZXI9TGF2YzYxLjE5LjEwMSBsaWJ2b3JiaXMrAAAAZW5jb2RlZF9ieT1BZG9iZSBQcmVtaWVyZSBQcm8gMjAyNS4wIChNYWNpbhcAAAB0aW1lX3JlZmVyZW5jZT0xMjExMDQwMA8AAABkYXRlPTIwMjUtMDgtMDUBBXZvcmJpcyJCQ1YBAEAAABhCECoFrWOOOsgVIYwZoqBCyinHHULQIaMkQ4g6xjXHGGNHuWSKQsmB0JBVAABAAACkHFdQckkt55xzoxhXzHHoIOecc+UgZ8xxCSXnnHOOOeeSco4x55xzoxhXDnIpLeecc4EUR4pxpxjnnHOkHEeKcagY55xzbTG3knLOOeecc+Ygh1JyrjXnnHOkGGcOcgsl55xzxiBnzHHrIOecc4w1t9RyzjnnnHPOOeecc84555xzjDHnnHPOOeecc24x5xZzrjnnnHPOOeccc84555xzIDRkFQCQAACgoSiK4igOEBqyCgDIAAAQQHEUR5EUS7Ecy9EkDQgNWQUAAAEACAAAoEiGpEiKpViOZmmeJnqiKJqiKquyacqyLMuy67ouEBqyCgBIAABQURTFcBQHCA1ZBQBkAAAIYCiKoziO5FiSpVmeB4SGrAIAgAAABAAAUAxHsRRN8STP8jzP8zzP8zzP8zzP8zzP8zzP8zwNCA1ZBQAgAAAAgihkGANCQ1YBAEAAAAghGhlDnVISXAoWQhwRQx1CzkOppYPgKYUlY9JTrEEIIXzvPffee++B0JBVAAAQAABhFDiIgcckCCGEYhQnRHGmIAghhOUkWMp56CQI3YMQQrice8u59957IDRkFQAACADAIIQQQgghhBBCCCmklFJIKaaYYoopxxxzzDHHIIMMMuigk046yaSSTjrKJKOOUmsptRRTTLHlFmOttdacc69BKWOMMcYYY4wxxhhjjDHGGCMIDVkFAIAAABAGGWSQQQghhBRSSCmmmHLMMcccA0JDVgEAgAAAAgAAABxFUiRHciRHkiTJkixJkzzLszzLszxN1ERNFVXVVW3X9m1f9m3f1WXf9mXb1WVdlmXdtW1d1l1d13Vd13Vd13Vd13Vd13Vd14HQkFUAgAQAgI7kOI7kOI7kSI6kSAoQGrIKAJABABAAgKM4iuNIjuRYjiVZkiZplmd5lqd5mqiJHhAasgoAAAQAEAAAAAAAgKIoiqM4jiRZlqZpnqd6oiiaqqqKpqmqqmqapmmapmmapmmapmmapmmapmmapmmapmmapmmapmmapmkCoSGrAAAJAAAdx3EcR3Ecx3EkR5IkIDRkFQAgAwAgAABDURxFcizHkjRLszzL00TP9FxRNnVTV20gNGQVAAAIACAAAAAAAADHczzHczzJkzzLczzHkzxJ0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRNA0JDVgIAZAAAEJOQSk6xV0YpxiS0XiqkFJPUe6iYYkw67alCBikHuYdKIaWg094ypZBSDHunmELIGOqhg5AxhbDX2nPPvfceCA1ZEQBEAQAAxiDGEGPIMSYlgxIxxyRkUiLnnJROSialpFZazKSEmEqLkXNOSiclk1JaC6llkkprJaYCAAACHAAAAiyEQkNWBABRAACIMUgppBRSSjGnmENKKceUY0gp5ZxyTjnHmHQQKucYdA5KpJRyjjmnnHMSMgeVcw5CJp0AAIAABwCAAAuh0JAVAUCcAACAkHOKMQgRYxBCCSmFUFKqnJPSQUmpg5JSSanFklKMlXNSOgkpdRJSKinFWFKKLaRUY2kt19JSjS3GnFuMvYaUYi2p1Vpaq7nFWHOLNffIOUqdlNY6Ka2l1mpNrdXaSWktpNZiaS3G1mLNKcacMymthZZiK6nF2GLLNbWYc2kt1xRjzynGnmusucecgzCt1ZxayznFmHvMseeYcw+Sc5Q6Ka11UlpLrdWaWqs1k9Jaaa3GkFqLLcacW4sxZ1JaLKnFWFqKMcWYc4st19BarinGnFOLOcdag5Kx9l5aqznFmHuKreeYczA2x547SrmW1nourfVecy5C1tyLaC3n1GoPKsaec87B2NyDEK3lnGrsPcXYe+45GNtz8K3W4FvNRcicg9C5+KZ7MEbV2oPMtQiZcxA66CJ08Ml4lGoureVcWus91hp8zTkI0VruKcbeU4u9156bsL0HIVrLPcXYg4ox+JpzMDrnYlStwcecg5C1FqF7L0rnIJSqtQeZa1Ay1yJ08MXooIsvAABgwAEAIMCEMlBoyIoAIE4AgEHIOaUYhEopCKGElEIoKVWMSciYg5IxJ6WUUloIJbWKMQiZY1Iyx6SEEloqJbQSSmmplNJaKKW1llqMKbUWQymphVJaK6W0llqqMbVWY8SYlMw5KZljUkoprZVSWqsck5IxKKmDkEopKcVSUouVc1Iy6Kh0EEoqqcRUUmmtpNJSKaXFklJsKcVUW4u1hlJaLKnEVlJqMbVUW4sx14gxKRlzUjLnpJRSUiultJY5J6WDjkrmoKSSUmulpBQz5qR0DkrKIKNSUootpRJTKKW1klJspaTWWoy1ptRaLSW1VlJqsZQSW4sx1xZLTZ2U1koqMYZSWmsx5ppaizGUElspKcaSSmytxZpbbDmGUlosqcRWSmqx1ZZja7Hm1FKNKbWaW2y5xpRTj7X2nFqrNbVUY2ux5lhbb7XWnDsprYVSWislxZhai7HFWHMoJbaSUmylpBhbbLm2FmMPobRYSmqxpBJjazHmGFuOqbVaW2y5ptRirbX2HFtuPaUWa4ux5tJSjTXX3mNNORUAADDgAAAQYEIZKDRkJQAQBQAAGMMYYxAapZxzTkqDlHPOScmcgxBCSplzEEJIKXNOQkotZc5BSKm1UEpKrcUWSkmptRYLAAAocAAACLBBU2JxgEJDVgIAUQAAiDFKMQahMUYp5yA0xijFGIRKKcack1ApxZhzUDLHnINQSuaccxBKCSGUUkpKIYRSSkmpAACAAgcAgAAbNCUWByg0ZEUAEAUAABhjnDPOIQqdpc5SJKmj1lFrKKUaS4ydxlZ767nTGnttuTeUSo2p1o5ry7nV3mlNPbccCwAAO3AAADuwEAoNWQkA5AEAEMYoxZhzzhmFGHPOOecMUow555xzijHnnIMQQsWYc85BCCFzzjkIoYSSOecchBBK6JyDUEoppXTOQQihlFI65yCEUkopnXMQSimllAIAgAocAAACbBTZnGAkqNCQlQBAHgAAYAxCzklprWHMOQgt1dgwxhyUlGKLnIOQUou5RsxBSCnGoDsoKbUYbPCdhJRaizkHk1KLNefeg0iptZqDzj3VVnPPvfecYqw1595zLwAAd8EBAOzARpHNCUaCCg1ZCQDkAQAQCCnFmHPOGaUYc8w554xSjDHmnHOKMcacc85BxRhjzjkHIWPMOecghJAx5pxzEELonHMOQgghdM45ByGEEDrnoIMQQgidcxBCCCGEAgCAChwAAAJsFNmcYCSo0JCVAEA4AAAAIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEELonHPOOeecc84555xzzjnnnHPOOScAyLfCAcD/wcYZVpLOCkeDCw1ZCQCEAwAACkEopWIQSiklkk46KZ2TUEopkYNSSumklFJKCaWUUkoIpZRSSggdlFJCKaWUUkoppZRSSimllFI6KaWUUkoppZTKOSmlk1JKKaVEzkkpIZRSSimlhFJKKaWUUkoppZRSSimllFJKKaWEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQCALgbHAAgEmycYSXprHA0uNCQlQBASAAAoBRzjkoIKZSQUqiYoo5CKSmkUkoKEWPOSeochVBSKKmDyjkIpaSUQiohdc5BByWFkFIJIZWOOugolFBSKiWU0jkopYQUSkoplZBCSKl0lFIoJZWUQiohlVJKSCWVEEoKnaRUSgqppFRSCJ10kEInJaSSSgqpk5RSKiWllEpKJXRSQioppRBCSqmUEEpIKaVOUkmppBRCKCGFlFJKJaWSSkohlVRCCaWklFIooaRUUkoppZJSKQAA4MABACDACDrJqLIIG0248AAUGrISACADAECUdNZpp0kiCDFFmScNKcYgtaQswxBTkonxFGOMOShGQw4x5JQYF0oIoYNiPCaVQ8pQUbm31DkFxRZjfO+xFwEAAAgCAASEBAAYICiYAQAGBwgjBwIdAQQObQCAgQiZCQwKocFBJgA8QERIBQCJCYrShS4IIYJ0EWTxwIUTN5644YQObRAAAAAAABAA8AEAkFAAERHRzFVYXGBkaGxwdHh8gIQEAAAAAAAIAHwAACQiQERENHMVFhcYGRobHB0eHyAhAQAAAAAAAAAAQEBAAAAAAAAgAAAAQEBPZ2dTAASuMwAAAAAAABUkATMCAAAACYS6sR4BAUQxGR89NxobGiEkKCknJiYmJSUhISEaFgwBAQEAAnyfvULHAlAEJgh2vpgQBMHIyMjIyNhIQOjz+ePz58+fL89xAwYBAFaH//3//7/xNw0MBoNB6qlPfWrUKQng+/0FABAAhLEjKuHFBwA4AHC9Fx4Oh7EwDEOgvnJ3RtV+Op0+nU6n5cyzEwAoltTpwed5dgVKMPoru90zNHGA7F0CP98BAAAAAHl9ePviAgCW+3rugPIDwC6BbWoTAFEAAADh5GpCCACgc+0zxlAAVKddkjDsA14GDoJtf7R+NkE4W23hI5mF3d74iVGvzg9PpA4cCQs66joePTmOfhgl7vNZzYzQADDyz30FAGSvVUZ6wJ4MAKbCGeb4+v5NLIdK3YvrLkCu98uV//FpXQNyKAKAV7r186fTktcJJgjAlVp1fUmaGgtrdAAuDXYJSPs/AAAAAHDnAeHxciEUAB76CvfarGjDzIjALoEd+/0EAAAAQNYeMrkBAF6ZKm8xuw94NtgloHDUCAAAAIAMJ5Qz2iUAvjhKL8lkfmA6wi6BWfNHgiAAAABq4eeqGgCg8+LAAXQAfhgqz2RKHzAVYJeAynEAIQEAALwq6tFbIQAEEIIO8iULngMAXhgajrw3D5iFWhe7BLZNrwCVKAAA0t2TfT8mADx0aMfS4CULeACvA14YWnasNht80ZpdAhv8BEiiAADgcbm4jo0JANAVCTRV6JqQS0OTADoAXhg6zWy+AZ3GsiDRAYJzgiQAAICnb9FLAQAUNQFd44AioMNJICUAfhi67ZRjA2IMSHTAJK0KkgAAAG7W0uLlEgC6KnQdDkgBlAAdJAB+GHpL40hATAASHSC5CZIAAAAGZ3J60ioBoKsBTQKE5KFJIJFAAp4Y+jp7cg4qINEBi+MASQAAAM8rmdZcAKApwFhNPHQkQEBRQwIAnhj6OZ8KIBwDiQ4Q9ApIFAAAQHRFd6FEALA0NaApQAegnPrDA54Y+nN+AYAIJDoAfgIkCgAAcLRlPVsLALqmKqFpHIwUwQEJCwCeKPpzEQA8kOgAyTlBAgAAgPnK3q8jAWAuJFBYOsbAAgCeKPolEQA8rMFCohQAAMxD2BdSAJYFdNThKcCkBQCOgwKeGPpzEQA8rEEhCQAAoCz4MRGA41gaQMBRjACexHugAACeGPqFCAAeugQAAHryFgBdRYGFhGeow8x7AJ4Y+iURADyIigIAliFAAcYWCQC11gGeGPolEQA8UAAAABoODg4=",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:ns&&ns.tagName.toUpperCase()==="SCRIPT"&&ns.src||new URL("index.umd.cjs",document.baseURI).href).href};function Vy({storageKey:e,soundEnabled:t}){const n=_p(e||"bp-webchat"),r=n(u=>u.soundOn),i=n(u=>u.toggleSound),o=D.useRef(null),s=D.useRef(t??!1),a=D.useRef(r);D.useEffect(()=>{try{o.current=new Audio,o.current.preload="auto",o.current.src=jy.chatMessageNotification,o.current.volume=.9}catch(u){console.error("Error loading sound effect:",u),o.current=null}},[]),D.useEffect(()=>{s.current=t??!1},[t]),D.useEffect(()=>{a.current=r},[r]);const l=D.useCallback(()=>{s.current&&a.current&&o.current&&o.current.play().catch(()=>{})},[]);return{soundOn:r,toggleSound:i,playNotificationSound:l}}function RL({apiUrl:e="https://webchat.botpress.cloud",clientId:t,storageKey:n,storageLocation:r,adminSecret:i,soundEnabled:o,clientHeaders:s,...a}){var z;const{soundOn:l,toggleSound:u,playNotificationSound:f}=Vy({storageKey:n,soundEnabled:o}),{clientState:c,httpClient:h,error:d,activeConversationId:m,userCredentials:p,isTyping:g,isAwaitingResponse:v,openConversation:y,setAwaitingResponse:w,emitter:A,setError:k,setClientState:E}=xy({apiUrl:e,clientId:t,storageKey:n,storageLocation:r,adminSecret:i,clientHeaders:s,conversationId:a.conversationId,userToken:(z=a.user)==null?void 0:z.userToken,playNotificationSound:f}),{messages:I,sendMessage:M,saveMessageFeedback:L}=Hy({client:h,conversationId:m,userId:p==null?void 0:p.userId,setAwaitingResponse:w}),{participants:T}=Uy({client:h,conversationId:m}),{uploadFile:O}=zy({client:h,conversationId:m,user:p}),{sendEvent:H}=$y({client:h,conversationId:m});if(c!=="connected"||!p||!m||!h)return{clientState:c,on:A.on,client:void 0,messages:[],conversationId:void 0,newConversation:$=>{y({conversationId:$,userToken:p==null?void 0:p.userToken}).catch(U=>{A.emit("error",U)})},user:void 0,isTyping:void 0,participants:[],toggleSound:u,soundOn:l,error:d,disableSendButton:v};const P={userId:p==null?void 0:p.userId,conversationId:m,userToken:p==null?void 0:p.userToken,openConversation:y,setClientState:E,setError:k,emitter:A},_={...By({sendMessage:async $=>M($),sendEvent:H,uploadFile:O,addMessageFeedback:L},P),getUser:async()=>{const{user:$}=await h.getUser();return $},updateUser:async $=>{const{user:U}=await h.updateUser({name:$.name,pictureUrl:$.pictureUrl,userData:$.data});return U},listConversations:async()=>h.listConversations({})};return{clientState:"connected",on:A.on,client:_,messages:I,conversationId:m,newConversation:$=>{y({conversationId:$,userToken:p.userToken}).catch(U=>{A.emit("error",U)})},user:p,isTyping:g,participants:T,error:d,soundOn:l,toggleSound:u,disableSendButton:v}}const Wy=()=>{const{client:e,userCredentials:t}=$o();return e?{userCredentials:t,getUser:async()=>(await e.getUser()).user,updateUser:async i=>(await e.updateUser(i)).user}:{userCredentials:t,getUser:void 0,updateUser:void 0}};function qy(){const{client:e,conversationId:t,userCredentials:n,setAwaitingResponse:r,emitter:i,clientState:o,setClientState:s,setError:a,openConversation:l,error:u,isAwaitingResponse:f,isTyping:c}=$o(),{messages:h,sendMessage:d,saveMessageFeedback:m}=Hy({client:e,conversationId:t,userId:n==null?void 0:n.userId,setAwaitingResponse:r}),{participants:p}=Uy({client:e,conversationId:t}),{sendEvent:g}=$y({client:e,conversationId:t}),{uploadFile:v}=zy({client:e,conversationId:t,user:n}),y={userId:n==null?void 0:n.userId,userToken:n==null?void 0:n.userToken,conversationId:t,openConversation:l,setClientState:s,setError:a,emitter:i},w=By({sendMessage:d,saveMessageFeedback:m,sendEvent:g,uploadFile:v},y);return{conversationId:t,messages:h,participants:p,sendMessage:w.sendMessage,saveMessageFeedback:w.saveMessageFeedback,sendEvent:w.sendEvent,uploadFile:w.uploadFile,on:i.on,status:o,error:u,isAwaitingResponse:f,isTyping:c}}function Yy(){const{client:e,openConversation:t,userCredentials:n}=$o();return e?{listConversations:async()=>e.listConversations({}),openConversation:i=>t({conversationId:i,userToken:n==null?void 0:n.userToken})}:{listConversations:void 0,openConversation:i=>t({conversationId:i,userToken:n==null?void 0:n.userToken})}}const Ky=0,Gy=1,Qy=2,Zy=3;var Jy=Object.prototype.hasOwnProperty;function fu(e,t){var n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&fu(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(Jy.call(e,n)&&++r&&!Jy.call(t,n)||!(n in t)||!fu(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const Xt=new WeakMap,en=()=>{},it=en(),du=Object,Se=e=>e===it,Wt=e=>typeof e=="function",gn=(e,t)=>({...e,...t}),Xy=e=>Wt(e.then),hu={},Vo={},pu="undefined",Si=typeof window!=pu,mu=typeof document!=pu,BL=Si&&"Deno"in window,$L=()=>Si&&typeof window.requestAnimationFrame!=pu,ev=(e,t)=>{const n=Xt.get(e);return[()=>!Se(t)&&e.get(t)||hu,r=>{if(!Se(t)){const i=e.get(t);t in Vo||(Vo[t]=i),n[5](t,gn(i,r),i||hu)}},n[6],()=>!Se(t)&&t in Vo?Vo[t]:!Se(t)&&e.get(t)||hu]};let gu=!0;const zL=()=>gu,[yu,vu]=Si&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[en,en],HL=()=>{const e=mu&&document.visibilityState;return Se(e)||e!=="hidden"},UL=e=>(mu&&document.addEventListener("visibilitychange",e),yu("focus",e),()=>{mu&&document.removeEventListener("visibilitychange",e),vu("focus",e)}),jL=e=>{const t=()=>{gu=!0,e()},n=()=>{gu=!1};return yu("online",t),yu("offline",n),()=>{vu("online",t),vu("offline",n)}},VL={isOnline:zL,isVisible:HL},WL={initFocus:UL,initReconnect:jL},tv=!D.useId,gr=!Si||BL,qL=e=>$L()?window.requestAnimationFrame(e):setTimeout(e,1),bu=gr?D.useEffect:D.useLayoutEffect,wu=typeof navigator<"u"&&navigator.connection,nv=!gr&&wu&&(["slow-2g","2g"].includes(wu.effectiveType)||wu.saveData),Wo=new WeakMap,YL=e=>du.prototype.toString.call(e),Su=(e,t)=>e===`[object ${t}]`;let KL=0;const ku=e=>{const t=typeof e,n=YL(e),r=Su(n,"Date"),i=Su(n,"RegExp"),o=Su(n,"Object");let s,a;if(du(e)===e&&!r&&!i){if(s=Wo.get(e),s)return s;if(s=++KL+"~",Wo.set(e,s),Array.isArray(e)){for(s="@",a=0;a<e.length;a++)s+=ku(e[a])+",";Wo.set(e,s)}if(o){s="#";const l=du.keys(e).sort();for(;!Se(a=l.pop());)Se(e[a])||(s+=a+":"+ku(e[a])+",");Wo.set(e,s)}}else s=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return s},xu=e=>{if(Wt(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?ku(e):"",[e,t]};let GL=0;const Eu=()=>++GL;async function rv(...e){const[t,n,r,i]=e,o=gn({populateCache:!0,throwOnError:!0},typeof i=="boolean"?{revalidate:i}:i||{});let s=o.populateCache;const a=o.rollbackOnError;let l=o.optimisticData;const u=h=>typeof a=="function"?a(h):a!==!1,f=o.throwOnError;if(Wt(n)){const h=n,d=[],m=t.keys();for(const p of m)!/^\$(inf|sub)\$/.test(p)&&h(t.get(p)._k)&&d.push(p);return Promise.all(d.map(c))}return c(n);async function c(h){const[d]=xu(h);if(!d)return;const[m,p]=ev(t,d),[g,v,y,w]=Xt.get(t),A=()=>{const F=g[d];return(Wt(o.revalidate)?o.revalidate(m().data,h):o.revalidate!==!1)&&(delete y[d],delete w[d],F&&F[0])?F[0](Qy).then(()=>m().data):m().data};if(e.length<3)return A();let k=r,E,I=!1;const M=Eu();v[d]=[M,0];const L=!Se(l),T=m(),O=T.data,H=T._c,P=Se(H)?O:H;if(L&&(l=Wt(l)?l(P,O):l,p({data:l,_c:P})),Wt(k))try{k=k(P)}catch(F){E=F,I=!0}if(k&&Xy(k))if(k=await k.catch(F=>{E=F,I=!0}),M!==v[d][0]){if(I)throw E;return k}else I&&L&&u(E)&&(s=!0,p({data:P,_c:it}));if(s&&!I)if(Wt(s)){const F=s(k,P);p({data:F,error:it,_c:it})}else p({data:k,error:it,_c:it});if(v[d][1]=Eu(),Promise.resolve(A()).then(()=>{p({_c:it})}),I){if(f)throw E;return}return k}}const iv=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},QL=(e,t)=>{if(!Xt.has(e)){const n=gn(WL,t),r=Object.create(null),i=rv.bind(it,e);let o=en;const s=Object.create(null),a=(f,c)=>{const h=s[f]||[];return s[f]=h,h.push(c),()=>h.splice(h.indexOf(c),1)},l=(f,c,h)=>{e.set(f,c);const d=s[f];if(d)for(const m of d)m(c,h)},u=()=>{if(!Xt.has(e)&&(Xt.set(e,[r,Object.create(null),Object.create(null),Object.create(null),i,l,a]),!gr)){const f=n.initFocus(setTimeout.bind(it,iv.bind(it,r,Ky))),c=n.initReconnect(setTimeout.bind(it,iv.bind(it,r,Gy)));o=()=>{f&&f(),c&&c(),Xt.delete(e)}}};return u(),[e,i,u,o]}return[e,Xt.get(e)[4]]},ZL=(e,t,n,r,i)=>{const o=n.errorRetryCount,s=i.retryCount,a=~~((Math.random()+.5)*(1<<(s<8?s:8)))*n.errorRetryInterval;!Se(o)&&s>o||setTimeout(r,a,i)},JL=fu,[ov,XL]=QL(new Map),e_=gn({onLoadingSlow:en,onSuccess:en,onError:en,onErrorRetry:ZL,onDiscarded:en,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:nv?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:nv?5e3:3e3,compare:JL,isPaused:()=>!1,cache:ov,mutate:XL,fallback:{}},VL),t_=(e,t)=>{const n=gn(e,t);if(t){const{use:r,fallback:i}=e,{use:o,fallback:s}=t;r&&o&&(n.use=r.concat(o)),i&&s&&(n.fallback=gn(i,s))}return n},n_=D.createContext({}),r_="$inf$",sv=Si&&window.__SWR_DEVTOOLS_USE__,i_=sv?window.__SWR_DEVTOOLS_USE__:[],o_=()=>{sv&&(window.__SWR_DEVTOOLS_REACT__=D)},s_=e=>Wt(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],a_=()=>{const e=D.useContext(n_);return D.useMemo(()=>gn(e_,e),[e])},l_=e=>(t,n,r)=>e(t,n&&((...o)=>{const[s]=xu(t),[,,,a]=Xt.get(ov);if(s.startsWith(r_))return n(...o);const l=a[s];return Se(l)?n(...o):(delete a[s],l)}),r),u_=i_.concat(l_),c_=e=>function(...n){const r=a_(),[i,o,s]=s_(n),a=t_(r,s);let l=e;const{use:u}=a,f=(u||[]).concat(u_);for(let c=f.length;c--;)l=f[c](l);return l(i,o||a.fetcher||null,a)},f_=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const i=r.indexOf(n);i>=0&&(r[i]=r[r.length-1],r.pop())}};o_();const Cu=D.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),Au={dedupe:!0},av=Promise.resolve(it),d_=()=>en,h_=c_((e,t,n)=>{const{cache:r,compare:i,suspense:o,fallbackData:s,revalidateOnMount:a,revalidateIfStale:l,refreshInterval:u,refreshWhenHidden:f,refreshWhenOffline:c,keepPreviousData:h,strictServerPrefetchWarning:d}=n,[m,p,g,v]=Xt.get(r),[y,w]=xu(e),A=D.useRef(!1),k=D.useRef(!1),E=D.useRef(y),I=D.useRef(t),M=D.useRef(n),L=()=>M.current,T=()=>L().isVisible()&&L().isOnline(),[O,H,P,F]=ev(r,y),_=D.useRef({}).current,z=Se(s)?Se(n.fallback)?it:n.fallback[y]:s,$=(Q,ue)=>{for(const de in _){const fe=de;if(fe==="data"){if(!i(Q[fe],ue[fe])&&(!Se(Q[fe])||!i(Y,ue[fe])))return!1}else if(ue[fe]!==Q[fe])return!1}return!0},U=!A.current,W=D.useMemo(()=>{const Q=O(),ue=F(),de=De=>{const Ue=gn(De);return delete Ue._k,(()=>{if(!y||!t||L().isPaused())return!1;if(U&&!Se(a))return a;const ae=Se(z)?Ue.data:z;return Se(ae)||l})()?{isValidating:!0,isLoading:!0,...Ue}:Ue},fe=de(Q),Te=Q===ue?fe:de(ue);let Fe=fe;return[()=>{const De=de(O());return $(De,Fe)?(Fe.data=De.data,Fe.isLoading=De.isLoading,Fe.isValidating=De.isValidating,Fe.error=De.error,Fe):(Fe=De,De)},()=>Te]},[r,y]),b=ls.useSyncExternalStore(D.useCallback(Q=>P(y,(ue,de)=>{$(de,ue)||Q()}),[r,y]),W[0],W[1]),N=m[y]&&m[y].length>0,R=b.data,S=Se(R)?z&&Xy(z)?Cu(z):z:R,V=b.error,ee=D.useRef(S),Y=h?Se(R)?Se(ee.current)?S:ee.current:R:S,G=y&&Se(S),J=D.useRef(null);!gr&&ls.useSyncExternalStore(d_,()=>(J.current=!1,J),()=>(J.current=!0,J));const se=J.current;d&&se&&!o&&G&&console.warn(`Missing pre-initiated data for serialized key "${y}" during server-side rendering. Data fetching should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);const K=!y||!t||L().isPaused()||N&&!Se(V)?!1:U&&!Se(a)?a:o?Se(S)?!1:l:Se(S)||l,re=Se(b.isValidating)?K:b.isValidating,B=Se(b.isLoading)?K:b.isLoading,ne=D.useCallback(async Q=>{const ue=I.current;if(!y||!ue||k.current||L().isPaused())return!1;let de,fe,Te=!0;const Fe=Q||{},De=!g[y]||!Fe.dedupe,Ue=()=>tv?!k.current&&y===E.current&&A.current:y===E.current,te={isValidating:!1,isLoading:!1},ae=()=>{H(te)},j=()=>{const oe=g[y];oe&&oe[1]===fe&&delete g[y]},q={isValidating:!0};Se(O().data)&&(q.isLoading=!0);try{if(De&&(H(q),n.loadingTimeout&&Se(O().data)&&setTimeout(()=>{Te&&Ue()&&L().onLoadingSlow(y,n)},n.loadingTimeout),g[y]=[ue(w),Eu()]),[de,fe]=g[y],de=await de,De&&setTimeout(j,n.dedupingInterval),!g[y]||g[y][1]!==fe)return De&&Ue()&&L().onDiscarded(y),!1;te.error=it;const oe=p[y];if(!Se(oe)&&(fe<=oe[0]||fe<=oe[1]||oe[1]===0))return ae(),De&&Ue()&&L().onDiscarded(y),!1;const le=O().data;te.data=i(le,de)?le:de,De&&Ue()&&L().onSuccess(de,y,n)}catch(oe){j();const le=L(),{shouldRetryOnError:he}=le;le.isPaused()||(te.error=oe,De&&Ue()&&(le.onError(oe,y,le),(he===!0||Wt(he)&&he(oe))&&(!L().revalidateOnFocus||!L().revalidateOnReconnect||T())&&le.onErrorRetry(oe,y,le,je=>{const Qe=m[y];Qe&&Qe[0]&&Qe[0](Zy,je)},{retryCount:(Fe.retryCount||0)+1,dedupe:!0})))}return Te=!1,ae(),!0},[y,r]),me=D.useCallback((...Q)=>rv(r,E.current,...Q),[]);if(bu(()=>{I.current=t,M.current=n,Se(R)||(ee.current=R)}),bu(()=>{if(!y)return;const Q=ne.bind(it,Au);let ue=0;L().revalidateOnFocus&&(ue=Date.now()+L().focusThrottleInterval);const fe=f_(y,m,(Te,Fe={})=>{if(Te==Ky){const De=Date.now();L().revalidateOnFocus&&De>ue&&T()&&(ue=De+L().focusThrottleInterval,Q())}else if(Te==Gy)L().revalidateOnReconnect&&T()&&Q();else{if(Te==Qy)return ne();if(Te==Zy)return ne(Fe)}});return k.current=!1,E.current=y,A.current=!0,H({_k:w}),K&&(g[y]||(Se(S)||gr?Q():qL(Q))),()=>{k.current=!0,fe()}},[y]),bu(()=>{let Q;function ue(){const fe=Wt(u)?u(O().data):u;fe&&Q!==-1&&(Q=setTimeout(de,fe))}function de(){!O().error&&(f||L().isVisible())&&(c||L().isOnline())?ne(Au).then(ue):ue()}return ue(),()=>{Q&&(clearTimeout(Q),Q=-1)}},[u,f,c,y]),D.useDebugValue(Y),o){if(!tv&&gr&&G)throw new Error("Fallback data is required when using Suspense in SSR.");G&&(I.current=t,M.current=n,k.current=!1);const Q=v[y],ue=!Se(Q)&&G?me(Q):av;if(Cu(ue),!Se(V)&&G)throw V;const de=G?ne(Au):av;!Se(Y)&&G&&(de.status="fulfilled",de.value=!0),Cu(de)}return{mutate:me,get data(){return _.data=!0,Y},get error(){return _.error=!0,V},get isValidating(){return _.isValidating=!0,re},get isLoading(){return _.isLoading=!0,B}}});function lv({userCredentials:e,listConversations:t,clientId:n}){const r=!!e&&n&&t,{data:i,error:o,isValidating:s,mutate:a}=h_(r?[n,"conversations",e==null?void 0:e.userId]:null,async()=>(await t({})).conversations.filter(p_).sort((u,f)=>new Date(f.updatedAt).getTime()-new Date(u.updatedAt).getTime()).map(u=>({...u,lastMessage:{...u.lastMessage,author:{type:u.lastMessage.userId===(e==null?void 0:e.userId)?"user":"bot"}}})),{revalidateOnFocus:!1,revalidateOnReconnect:!0,dedupingInterval:2e3});return{conversations:i??[],isLoading:s,error:o&&Rr(o),refresh:async()=>await a()}}const p_=e=>!!e.lastMessage,m_=e=>e==null||e.length===0?"":e.charAt(0).toUpperCase()+e.slice(1),Tu=({className:e,onConversationClick:t,onNewConversation:n,onClose:r,currentConversationId:i,isLoading:o,conversations:s,botAvatar:a,botName:l,...u})=>{const{conversationHistory:f}=ye,c=Ye();return x.jsxs("div",{...u,...f.container,className:ur(f.container.className,e),children:[x.jsxs("div",{...f.header,children:[c["conversationHistory.title"],r&&x.jsx("div",{...f.closeButton,children:x.jsx(su,{onClick:r})})]}),o?x.jsx("div",{...f.loaderContainer,children:x.jsx(Fy,{})}):x.jsx("div",{...f.scrollContainer,children:s.length===0?x.jsx("div",{...f.loaderContainer,children:c["conversationHistory.empty"]}):s.map(({id:h,lastMessage:d})=>{let m="";if(d.payload.type==="text")m=d.payload.text;else if(d.payload.type==="bloc"&&d.payload.items.some(p=>p.type==="text")){const p=d.payload.items.find(g=>g.type==="text");m=(p==null?void 0:p.payload.text)??""}else m=c["conversationHistory.sentAttachment"];return x.jsxs("button",{...f.conversation.container,onClick:()=>t==null?void 0:t(h),"data-active":i===h?"":void 0,children:[d.author.type==="bot"?x.jsx(Cn,{userId:d.userId,src:a,...f.conversation.avatar,children:l??c["header.defaultBotName"]}):x.jsx(Cn,{userId:d.userId,...f.conversation.avatar,fallback:f.conversation.userAvatar.className,children:x.jsx(hT,{strokeWidth:1.5})}),x.jsxs("div",{...f.conversation.content,children:[x.jsx("span",{...f.conversation.name,children:m}),x.jsx("span",{...f.conversation.timestamp,children:m_(M0(d.createdAt))})]}),x.jsx(mp,{strokeWidth:1.5,...f.conversation.chevron})]},h)})}),x.jsxs("button",{...f.newConversation.button,onClick:n,children:[x.jsx(uT,{...f.newConversation.icon}),c["conversationHistory.newConversation"]]})]})};Tu.displayName="ConversationHistory";const uv=({connected:e,configuration:t,isTyping:n,messages:r,user:i,isLoading:o,renderers:s,isReadOnly:a,disableComposer:l,error:u,participants:f,closeWindow:c,sendMessage:h,uploadFile:d,addMessageFeedback:m,listConversations:p,restartConversation:g,clientId:v,storageKey:y,soundOn:w,toggleSound:A,disableSendButton:k,conversationId:E,locale:I,...M})=>{const{color:L,fontFamily:T,radius:O,themeMode:H,variant:P,headerVariant:F,botAvatar:_,botDescription:z,botName:$,composerPlaceholder:U,footer:W,feedbackEnabled:b,additionalStylesheet:N,additionalStylesheetUrl:R,allowFileUpload:S,conversationHistory:V}=t,ee={color:L,fontFamily:T,radius:O,themeMode:H,variant:P,headerVariant:F,additionalStylesheet:N,additionalStylesheetUrl:R},[Y,G]=D.useState("chat"),J=lv({clientId:v,listConversations:p,userCredentials:i});D.useEffect(()=>{Y==="conversations"&&J.refresh()},[Y]),b||(m=void 0);const se=D.useMemo(()=>i?cc(r,f,i.userId,$,_):[],[_,$,r,i,f]),K=D.useMemo(()=>{var we,Q;return((Q=(we=r.at(-1))==null?void 0:we.metadata)==null?void 0:Q.conversationStatus)==="closed"},[r]),re=D.useRef(null),B=Jn(we=>we.setPortalContainer);D.useEffect(()=>(B(re.current),()=>{B(null)}),[B]);const ne=I?JSON.stringify(I):void 0,me=D.useMemo(()=>ne?{...Rn,...JSON.parse(ne)}:uc(),[ne]);return x.jsxs(Rp,{value:me,children:[x.jsx(Vg,{...ee}),x.jsx("div",{ref:re,style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none",zIndex:10}}),x.jsx(tu,{connected:e,allowFileUpload:S,uploadFile:d,storageKey:y,conversationId:E,...M,children:u||J.error?x.jsx(Ry,{error:u||J.error,restartConversation:g,closeWindow:c}):Y==="conversations"?x.jsx(Tu,{onClose:c,conversations:J.conversations,isLoading:J.isLoading,onNewConversation:()=>{g==null||g(),G("chat")},onConversationClick:we=>{g==null||g(we),G("chat")},botAvatar:_,botName:$}):x.jsxs(x.Fragment,{children:[x.jsx(_y,{showConversationHistory:V?()=>G("conversations"):void 0,closeWindow:c,configuration:t,restartConversation:g,clientId:v,soundOn:w,toggleSound:A}),o?x.jsx(Fy,{}):x.jsx(cu,{botAvatar:_,botDescription:z,botName:$,renderers:s,isTyping:n,sendMessage:h,addMessageFeedback:m,messages:se},E),!K&&x.jsx(cg,{sendMessage:h,uploadFile:d,connected:e,isReadOnly:a,disableComposer:l,footer:W,composerPlaceholder:U,allowFileUpload:S,storageKey:y,disableSendButton:k,conversationId:E})]})})]})};function g_({configuration:e,storageKey:t,clientId:n,...r}){const i=t||`bp-webchat-${n}`,{messages:o,participants:s,sendMessage:a,uploadFile:l,saveMessageFeedback:u,conversationId:f,status:c,error:h,isTyping:d,isAwaitingResponse:m}=qy(),{openConversation:p,listConversations:g}=Yy(),{userCredentials:v}=Wy(),{soundOn:y,toggleSound:w}=Vy({storageKey:i,soundEnabled:e==null?void 0:e.soundEnabled});return x.jsx(uv,{configuration:e??{},user:v,isLoading:c==="connecting",isTyping:d,connected:c==="connected"?!0:c==="disconnected"?!1:void 0,messages:o,sendMessage:a,uploadFile:l,addMessageFeedback:u,listConversations:g,restartConversation:p,participants:s,error:h,clientId:n,soundOn:y,toggleSound:w,disableSendButton:m,conversationId:f,storageKey:i,...r})}const y_=({clientId:e,storageKey:t,configuration:n,apiUrl:r,user:i,conversationId:o,...s})=>{const a=t||`bp-webchat-${e}`;return x.jsx(Cy,{clientId:e,apiUrl:r,userCredentials:i,conversationId:o,storageKey:a,storageLocation:n==null?void 0:n.storageLocation,adminSecret:n==null?void 0:n.adminSecret,children:x.jsx(g_,{configuration:n,storageKey:t,clientId:e,...s})})};function v_(e,t=globalThis==null?void 0:globalThis.document){const n=Fn(e);C.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var b_="DismissableLayer",Iu="dismissableLayer.update",w_="dismissableLayer.pointerDownOutside",S_="dismissableLayer.focusOutside",cv,fv=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),dv=C.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,onDismiss:a,...l}=e,u=C.useContext(fv),[f,c]=C.useState(null),h=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,d]=C.useState({}),m=nn(t,I=>c(I)),p=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=p.indexOf(g),y=f?p.indexOf(f):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,A=y>=v,k=E_(I=>{const M=I.target,L=[...u.branches].some(T=>T.contains(M));!A||L||(i==null||i(I),s==null||s(I),I.defaultPrevented||a==null||a())},h),E=C_(I=>{const M=I.target;[...u.branches].some(T=>T.contains(M))||(o==null||o(I),s==null||s(I),I.defaultPrevented||a==null||a())},h);return v_(I=>{y===u.layers.size-1&&(r==null||r(I),!I.defaultPrevented&&a&&(I.preventDefault(),a()))},h),C.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(cv=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),hv(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=cv)}},[f,h,n,u]),C.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),hv())},[f,u]),C.useEffect(()=>{const I=()=>d({});return document.addEventListener(Iu,I),()=>document.removeEventListener(Iu,I)},[]),x.jsx(Rt.div,{...l,ref:m,style:{pointerEvents:w?A?"auto":"none":void 0,...e.style},onFocusCapture:Jt(e.onFocusCapture,E.onFocusCapture),onBlurCapture:Jt(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Jt(e.onPointerDownCapture,k.onPointerDownCapture)})});dv.displayName=b_;var k_="DismissableLayerBranch",x_=C.forwardRef((e,t)=>{const n=C.useContext(fv),r=C.useRef(null),i=nn(t,r);return C.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),x.jsx(Rt.div,{...e,ref:i})});x_.displayName=k_;function E_(e,t=globalThis==null?void 0:globalThis.document){const n=Fn(e),r=C.useRef(!1),i=C.useRef(()=>{});return C.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let l=function(){pv(w_,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=l,t.addEventListener("click",i.current,{once:!0})):l()}else t.removeEventListener("click",i.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function C_(e,t=globalThis==null?void 0:globalThis.document){const n=Fn(e),r=C.useRef(!1);return C.useEffect(()=>{const i=o=>{o.target&&!r.current&&pv(S_,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function hv(){const e=new CustomEvent(Iu);document.dispatchEvent(e)}function pv(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?gL(i,o):i.dispatchEvent(o)}var Ou="focusScope.autoFocusOnMount",Du="focusScope.autoFocusOnUnmount",mv={bubbles:!1,cancelable:!0},A_="FocusScope",gv=C.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[a,l]=C.useState(null),u=Fn(i),f=Fn(o),c=C.useRef(null),h=nn(t,p=>l(p)),d=C.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.useEffect(()=>{if(r){let p=function(w){if(d.paused||!a)return;const A=w.target;a.contains(A)?c.current=A:yn(c.current,{select:!0})},g=function(w){if(d.paused||!a)return;const A=w.relatedTarget;A!==null&&(a.contains(A)||yn(c.current,{select:!0}))},v=function(w){if(document.activeElement===document.body)for(const k of w)k.removedNodes.length>0&&yn(a)};document.addEventListener("focusin",p),document.addEventListener("focusout",g);const y=new MutationObserver(v);return a&&y.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",g),y.disconnect()}}},[r,a,d.paused]),C.useEffect(()=>{if(a){bv.add(d);const p=document.activeElement;if(!a.contains(p)){const v=new CustomEvent(Ou,mv);a.addEventListener(Ou,u),a.dispatchEvent(v),v.defaultPrevented||(T_(N_(yv(a)),{select:!0}),document.activeElement===p&&yn(a))}return()=>{a.removeEventListener(Ou,u),setTimeout(()=>{const v=new CustomEvent(Du,mv);a.addEventListener(Du,f),a.dispatchEvent(v),v.defaultPrevented||yn(p??document.body,{select:!0}),a.removeEventListener(Du,f),bv.remove(d)},0)}}},[a,u,f,d]);const m=C.useCallback(p=>{if(!n&&!r||d.paused)return;const g=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,v=document.activeElement;if(g&&v){const y=p.currentTarget,[w,A]=I_(y);w&&A?!p.shiftKey&&v===A?(p.preventDefault(),n&&yn(w,{select:!0})):p.shiftKey&&v===w&&(p.preventDefault(),n&&yn(A,{select:!0})):v===y&&p.preventDefault()}},[n,r,d.paused]);return x.jsx(Rt.div,{tabIndex:-1,...s,ref:h,onKeyDown:m})});gv.displayName=A_;function T_(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(yn(r,{select:t}),document.activeElement!==n)return}function I_(e){const t=yv(e),n=vv(t,e),r=vv(t.reverse(),e);return[n,r]}function yv(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function vv(e,t){for(const n of e)if(!O_(n,{upTo:t}))return n}function O_(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function D_(e){return e instanceof HTMLInputElement&&"select"in e}function yn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&D_(e)&&t&&e.select()}}var bv=M_();function M_(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=wv(e,t),e.unshift(t)},remove(t){var n;e=wv(e,t),(n=e[0])==null||n.resume()}}}function wv(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function N_(e){return e.filter(t=>t.tagName!=="A")}var Mu=0;function L_(){C.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Sv()),document.body.insertAdjacentElement("beforeend",e[1]??Sv()),Mu++,()=>{Mu===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Mu--}},[])}function Sv(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var qo="right-scroll-bar-position",Yo="width-before-scroll-bar",__="with-scroll-bars-hidden",P_="--removed-body-scroll-bar-size";function Nu(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function F_(e,t){var n=D.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var R_=typeof window<"u"?C.useLayoutEffect:C.useEffect,kv=new WeakMap;function B_(e,t){var n=F_(null,function(r){return e.forEach(function(i){return Nu(i,r)})});return R_(function(){var r=kv.get(n);if(r){var i=new Set(r),o=new Set(e),s=n.current;i.forEach(function(a){o.has(a)||Nu(a,null)}),o.forEach(function(a){i.has(a)||Nu(a,s)})}kv.set(n,e)},[e]),n}function $_(e){return e}function z_(e,t){t===void 0&&(t=$_);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var s=t(o,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(o){for(r=!0;n.length;){var s=n;n=[],s.forEach(o)}n={push:function(a){return o(a)},filter:function(){return n}}},assignMedium:function(o){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(o),s=n}var l=function(){var f=s;s=[],f.forEach(o)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(f){s.push(f),u()},filter:function(f){return s=s.filter(f),n}}}};return i}function H_(e){e===void 0&&(e={});var t=z_(null);return t.options=xt({async:!0,ssr:!1},e),t}var xv=function(e){var t=e.sideCar,n=zp(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return C.createElement(r,xt({},n))};xv.isSideCarExport=!0;function U_(e,t){return e.useMedium(t),xv}var Ev=H_(),Lu=function(){},Ko=C.forwardRef(function(e,t){var n=C.useRef(null),r=C.useState({onScrollCapture:Lu,onWheelCapture:Lu,onTouchMoveCapture:Lu}),i=r[0],o=r[1],s=e.forwardProps,a=e.children,l=e.className,u=e.removeScrollBar,f=e.enabled,c=e.shards,h=e.sideCar,d=e.noRelative,m=e.noIsolation,p=e.inert,g=e.allowPinchZoom,v=e.as,y=v===void 0?"div":v,w=e.gapMode,A=zp(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=h,E=B_([n,t]),I=xt(xt({},A),i);return C.createElement(C.Fragment,null,f&&C.createElement(k,{sideCar:Ev,removeScrollBar:u,shards:c,noRelative:d,noIsolation:m,inert:p,setCallbacks:o,allowPinchZoom:!!g,lockRef:n,gapMode:w}),s?C.cloneElement(C.Children.only(a),xt(xt({},I),{ref:E})):C.createElement(y,xt({},I,{className:l,ref:E}),a))});Ko.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Ko.classNames={fullWidth:Yo,zeroRight:qo};var j_=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function V_(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=j_();return t&&e.setAttribute("nonce",t),e}function W_(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function q_(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Y_=function(){var e=0,t=null;return{add:function(n){e==0&&(t=V_())&&(W_(t,n),q_(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},K_=function(){var e=Y_();return function(t,n){C.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Cv=function(){var e=K_(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},G_={left:0,top:0,right:0,gap:0},_u=function(e){return parseInt(e||"",10)||0},Q_=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[_u(n),_u(r),_u(i)]},Z_=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return G_;var t=Q_(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},J_=Cv(),yr="data-scroll-locked",X_=function(e,t,n,r){var i=e.left,o=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
324
- .`.concat(__,` {
323
+ `&&r++}}return[t,n]}class uy extends Event{constructor(t,n){var r,i;super(t),this.code=(r=n==null?void 0:n.code)!=null?r:void 0,this.message=(i=n==null?void 0:n.message)!=null?i:void 0}[Symbol.for("nodejs.util.inspect.custom")](t,n,r){return r(cy(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(cy(this),n)}}function WN(e){const t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function Wl(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(Wl).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${Wl(e.cause)}`:e.message:`${e}`}function cy(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var fy=e=>{throw TypeError(e)},ql=(e,t,n)=>t.has(e)||fy("Cannot "+n),be=(e,t,n)=>(ql(e,t,"read from private field"),n?n.call(e):t.get(e)),Ge=(e,t,n)=>t.has(e)?fy("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Pe=(e,t,n,r)=>(ql(e,t,"write to private field"),t.set(e,n),n),Zt=(e,t,n)=>(ql(e,t,"access private method"),n),ht,_n,fr,Po,Fo,pi,dr,mi,mn,hr,pr,mr,gi,Ft,Yl,Kl,Gl,dy,Ql,Zl,yi,Jl,Xl;let Ro=class extends EventTarget{constructor(t,n){var r,i;super(),Ge(this,Ft),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,Ge(this,ht),Ge(this,_n),Ge(this,fr),Ge(this,Po),Ge(this,Fo),Ge(this,pi),Ge(this,dr),Ge(this,mi,null),Ge(this,mn),Ge(this,hr),Ge(this,pr,null),Ge(this,mr,null),Ge(this,gi,null),Ge(this,Kl,async o=>{var s;be(this,hr).reset();const{body:a,redirected:l,status:u,headers:f}=o;if(u===204){Zt(this,Ft,yi).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(l?Pe(this,fr,new URL(o.url)):Pe(this,fr,void 0),u!==200){Zt(this,Ft,yi).call(this,`Non-200 status code (${u})`,u);return}if(!(f.get("content-type")||"").startsWith("text/event-stream")){Zt(this,Ft,yi).call(this,'Invalid content type, expected "text/event-stream"',u);return}if(be(this,ht)===this.CLOSED)return;Pe(this,ht,this.OPEN);const c=new Event("open");if((s=be(this,gi))==null||s.call(this,c),this.dispatchEvent(c),typeof a!="object"||!a||!("getReader"in a)){Zt(this,Ft,yi).call(this,"Invalid response body, expected a web ReadableStream",u),this.close();return}const h=new TextDecoder,d=a.getReader();let m=!0;do{const{done:p,value:g}=await d.read();g&&be(this,hr).feed(h.decode(g,{stream:!p})),p&&(m=!1,be(this,hr).reset(),Zt(this,Ft,Jl).call(this))}while(m)}),Ge(this,Gl,o=>{Pe(this,mn,void 0),!(o.name==="AbortError"||o.type==="aborted")&&Zt(this,Ft,Jl).call(this,Wl(o))}),Ge(this,Ql,o=>{typeof o.id=="string"&&Pe(this,mi,o.id);const s=new MessageEvent(o.event||"message",{data:o.data,origin:be(this,fr)?be(this,fr).origin:be(this,_n).origin,lastEventId:o.id||""});be(this,mr)&&(!o.event||o.event==="message")&&be(this,mr).call(this,s),this.dispatchEvent(s)}),Ge(this,Zl,o=>{Pe(this,pi,o)}),Ge(this,Xl,()=>{Pe(this,dr,void 0),be(this,ht)===this.CONNECTING&&Zt(this,Ft,Yl).call(this)});try{if(t instanceof URL)Pe(this,_n,t);else if(typeof t=="string")Pe(this,_n,new URL(t,qN()));else throw new Error("Invalid URL")}catch{throw WN("An invalid or illegal string was specified")}Pe(this,hr,jN({onEvent:be(this,Ql),onRetry:be(this,Zl)})),Pe(this,ht,this.CONNECTING),Pe(this,pi,3e3),Pe(this,Fo,(r=n==null?void 0:n.fetch)!=null?r:globalThis.fetch),Pe(this,Po,(i=n==null?void 0:n.withCredentials)!=null?i:!1),Zt(this,Ft,Yl).call(this)}get readyState(){return be(this,ht)}get url(){return be(this,_n).href}get withCredentials(){return be(this,Po)}get onerror(){return be(this,pr)}set onerror(t){Pe(this,pr,t)}get onmessage(){return be(this,mr)}set onmessage(t){Pe(this,mr,t)}get onopen(){return be(this,gi)}set onopen(t){Pe(this,gi,t)}addEventListener(t,n,r){const i=n;super.addEventListener(t,i,r)}removeEventListener(t,n,r){const i=n;super.removeEventListener(t,i,r)}close(){be(this,dr)&&clearTimeout(be(this,dr)),be(this,ht)!==this.CLOSED&&(be(this,mn)&&be(this,mn).abort(),Pe(this,ht,this.CLOSED),Pe(this,mn,void 0))}};ht=new WeakMap,_n=new WeakMap,fr=new WeakMap,Po=new WeakMap,Fo=new WeakMap,pi=new WeakMap,dr=new WeakMap,mi=new WeakMap,mn=new WeakMap,hr=new WeakMap,pr=new WeakMap,mr=new WeakMap,gi=new WeakMap,Ft=new WeakSet,Yl=function(){Pe(this,ht,this.CONNECTING),Pe(this,mn,new AbortController),be(this,Fo)(be(this,_n),Zt(this,Ft,dy).call(this)).then(be(this,Kl)).catch(be(this,Gl))},Kl=new WeakMap,Gl=new WeakMap,dy=function(){var e;const t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...be(this,mi)?{"Last-Event-ID":be(this,mi)}:void 0},cache:"no-store",signal:(e=be(this,mn))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},Ql=new WeakMap,Zl=new WeakMap,yi=function(e,t){var n;be(this,ht)!==this.CLOSED&&Pe(this,ht,this.CLOSED);const r=new uy("error",{code:t,message:e});(n=be(this,pr))==null||n.call(this,r),this.dispatchEvent(r)},Jl=function(e,t){var n;if(be(this,ht)===this.CLOSED)return;Pe(this,ht,this.CONNECTING);const r=new uy("error",{code:t,message:e});(n=be(this,pr))==null||n.call(this,r),this.dispatchEvent(r),Pe(this,dr,setTimeout(be(this,Xl),be(this,pi)))},Xl=new WeakMap,Ro.CONNECTING=0,Ro.OPEN=1,Ro.CLOSED=2;function qN(){const e="document"in globalThis?globalThis.document:void 0;return e&&typeof e=="object"&&"baseURI"in e&&typeof e.baseURI=="string"?e.baseURI:void 0}async function YN(e){var t;const n=await e.clone().json();if((t=n==null?void 0:n.id)!=null&&t.startsWith("err_")){const r=new Error(n.message);throw r.id=n.id,r.code=n.code,r.type=n.type,r}return e}const hy=()=>{const e={};return{on:(t,n)=>{var r;return e[t]||(e[t]=new Set),(r=e[t])==null||r.add(n),()=>{var i;return(i=e[t])==null?void 0:i.delete(n)}},emit:(t,n)=>{var r,i;(r=e[t])==null||r.forEach(o=>o(n)),(i=e["*"])==null||i.forEach(o=>o({type:t,payload:n}))},cleanup:()=>{for(const t in e)delete e[t]}}},He=e=>e.data,py=10,my=3e3,KN="60000",gy=(e,t)=>{const n=(...r)=>e.on(...r);return new Proxy(n,{get:(r,i)=>i==="on"?e.on:i==="disconnect"?t:i==="cleanup"?e.cleanup:Reflect.get(r,i)})},GN={throwOnError:!0},QN=({conversationId:e,userToken:t,clientId:n,apiUrl:r,adminSecret:i})=>{let o=0,s=null,a=null;const l=hy();let u=e,f=t;const c=()=>{s&&(clearTimeout(s),s=null),a&&(a.close(),a=null)},h=()=>{a&&a.close();const d=`${`${r||_e.getConfig().baseUrl}/${n}`}/initialize${u?`?conversationId=${u}`:""}`,m={...i?{"x-admin-secret":i}:{},...f?{"x-user-key":f}:{}};a=vy(d,m),a.addEventListener("open",()=>l.emit("open")),a.addEventListener("error",p=>{o<py?(o++,s=setTimeout(()=>h(),my)):l.emit("error",p)}),a.addEventListener("message",p=>{const g=yy(p.data);g.type==="init"&&(u=g.data.conversation.id??u,f=g.data.user.userKey??f),l.emit(g.type,g.data)})};return h(),gy(l,c)},ZN=({userKey:e,clientId:t,apiUrl:n,customHeaders:r,advancedOptions:i})=>{const o={"x-user-key":e,...r},s=`${n||_e.getConfig().baseUrl}/${t}`,a={...GN,baseUrl:s};return _e.interceptors.response._fns.length===0&&_e.interceptors.response.use(YN),{createConversation:()=>EN({...a,headers:o,body:{}}).then(He),getConversation:({conversationId:l})=>kN({...a,headers:o,path:{id:l}}).then(He),deleteConversation:({conversationId:l})=>SN({...a,headers:o,path:{id:l}}).then(He),listConversations:({nextToken:l})=>xN({...a,headers:o,query:{nextToken:l}}).then(He),listConversationMessages:({conversationId:l,nextToken:u})=>CN({...a,headers:o,path:{id:l},query:{nextToken:u}}).then(He),addParticipant:({conversationId:l,userId:u})=>TN({...a,headers:o,path:{id:l},body:{userId:u}}).then(He),removeParticipant:({conversationId:l,userId:u})=>IN({...a,headers:o,path:{id:l,userId:u}}).then(He),getParticipant:({conversationId:l,userId:u})=>ON({...a,headers:o,path:{id:l,userId:u}}).then(He),listParticipants:({conversationId:l,nextToken:u})=>AN({...a,headers:o,path:{id:l},query:{nextToken:u}}).then(He),createMessage:l=>LN({...a,headers:o,body:l}).then(He),updateMessage:({messageId:l,...u})=>NN({...a,headers:o,path:{id:l},body:u}).then(He),getMessage:({messageId:l})=>MN({...a,headers:o,path:{id:l}}).then(He),deleteMessage:({messageId:l})=>DN({...a,headers:o,path:{id:l}}).then(He),createFile:l=>UN({...a,headers:o,body:l}).then(He),getUser:()=>RN({...a,headers:o}).then(He),updateUser:l=>BN({...a,headers:o,body:l}).then(He),deleteUser:()=>FN({...a,headers:o}).then(He),createEvent:l=>HN({...a,headers:o,body:l}).then(He),getEvent:({eventId:l})=>zN({...a,headers:o,path:{id:l}}).then(He),addMessageFeedback:({messageId:l,...u})=>PN({...a,headers:o,path:{id:l},body:u}).then(He),removeMessageFeedback:({messageId:l})=>_N({...a,headers:o,path:{id:l}}).then(He),generateUserKey:({adminSecret:l,...u})=>$N({...a,headers:{"x-admin-secret":l},body:u}).then(He),listenConversation:({conversationId:l})=>{let u=0,f=null,c=null;const h=hy(),d=()=>{f&&(clearTimeout(f),f=null),c&&(c.close(),c=null)},m=()=>{c&&c.close();const p=`${s}/conversations/${l}/listen`,g=i==null?void 0:i.eventSource;c=g?g({url:p,headers:o}):vy(p,o),c.addEventListener("open",()=>h.emit("open")),c.addEventListener("error",y=>{u<py?(u++,f=setTimeout(()=>m(),my)):h.emit("error",y)}),c.addEventListener("message",y=>{const v=yy(y.data);h.emit(v.type,v.data)})};return m(),gy(h,d)}}},yy=e=>{try{return JSON.parse(e)}catch{return e}},vy=(e,t)=>new Ro(e,{fetch:(n,r)=>fetch(n,{...r,headers:{...r==null?void 0:r.headers,...t,timeout:KN}})}),JN=async({apiUrl:e,clientId:t,adminSecret:n,clientHeaders:r,emitter:i,conversationId:o,userToken:s})=>new Promise(a=>{const l=QN({apiUrl:e,clientId:t,userToken:s,conversationId:o,adminSecret:n}),u=l("init",({conversation:f,messages:c,participants:h,user:d})=>{const m=Ha(f.id),p=c.reverse().map(cr).filter(Boolean);m.getState().setMessages(p),Wa(f.id).getState().setParticipants(h);const y=ZN({clientId:t,apiUrl:e,userKey:d.userKey,customHeaders:r});y.createEvent({conversationId:f.id,payload:{type:"conversation_started",data:{}}}).then(({event:v})=>{var w,A;(A=(w=v.payload.data)==null?void 0:w.status)!=null&&A.isInitial&&i.emit("conversation",f.id)}),a({on:l,conversation:f,messages:c,participants:h,user:d,client:y,onCleanup:()=>{u(),l.disconnect(),l.cleanup()}})})}),XN={webchat:"#9C27B0",client:"#2196F3",store:"#4CAF50",events:"#00BCD4"},eL={debug:"#9E9E9E",info:"#2196F3",warn:"#FF9800",error:"#F44336"};let by=!1,eu=null,wy=Date.now();const tL=e=>{by=e,wy=Date.now()},nL=e=>{eu=e},rL=()=>{const e=Date.now()-wy,t=Math.floor(e/1e3),n=e%1e3;return`+${t}.${n.toString().padStart(3,"0")}s`},iL=e=>e===void 0?"undefined":e===null?"null":e instanceof Error?{error:e.message,stack:e.stack}:e,Bo=e=>{const t=XN[e]||"#666",n=(r,...i)=>{if(!by&&r!=="warn"&&r!=="error")return;const o=rL(),s=`%c[bp:${e}]%c ${o} %c${r.toUpperCase()}%c`,a=[`color: ${t}; font-weight: bold;`,"color: #999; font-size: 10px;",`color: ${eL[r]}; font-weight: bold;`,"color: inherit;"],l=i.map(iL);if(console[r](s,...a,...l),eu){const[u,f]=i;eu(`debug:${e}:${r}`,{message:typeof u=="string"?u:void 0,...typeof f=="object"&&f!==null?f:{}})}};return{debug:(...r)=>n("debug",...r),info:(...r)=>n("info",...r),warn:(...r)=>n("warn",...r),error:(...r)=>n("error",...r)}},Sy={webchat:Bo("webchat"),client:Bo("client"),store:Bo("store"),events:Bo("events")};function ky(){const[e,t]=D.useState(!1),n=D.useRef(null);return{state:e,setState:(r,i)=>{if(t(r),!r)return()=>{};if(n.current=new Date,!i)return()=>{};const o=setTimeout(()=>{const s=n.current;s&&new Date().getTime()-s.getTime()>i&&t(!1)},i+100);return()=>clearTimeout(o)}}}const vi=Sy.webchat;function xy({apiUrl:e="https://webchat.botpress.cloud",clientId:t,storageKey:n,storageLocation:r,adminSecret:i,clientHeaders:o,playNotificationSound:s,...a}){const l=Np(n,r),u=l(O=>O.conversationId),f=l(O=>O.user),c=l(O=>O.setConversationId),h=l(O=>O.setUser),{state:d,setState:m}=ky(),{state:p,setState:g}=ky(),y=D.useMemo(()=>hc(),[]),[v,w]=D.useState("connecting"),[A,k]=D.useState(void 0),[E,I]=D.useState(void 0),M=D.useRef(null),P=o1(a.conversationId,a.userToken,u,f==null?void 0:f.userToken);D.useEffect(()=>{let O=!1;vi.info("starting initialization",{clientId:t,apiUrl:e,storageKey:n});const j=async()=>{var L;await T(P),O&&(vi.debug("initialization completed but effect was cleaned up, tearing down"),(L=M.current)==null||L.call(M),M.current=null)},F=r1(t,e);if(F){vi.error("configuration error",F),I(F),w("error");return}return j(),()=>{O=!0,M.current&&(M.current(),M.current=null)}},[a.conversationId,a.userToken,t,e]);const T=async({conversationId:O,userToken:j})=>{var N;(N=M.current)==null||N.call(M),I(void 0),m(!1),g(!1),w("connecting");const{on:F,conversation:L,user:_,client:B,onCleanup:z}=await JN({apiUrl:e,clientId:t,clientHeaders:o,emitter:y,adminSecret:i,conversationId:O,userToken:j});k(B),c(L.id),h({userId:_.id,userToken:_.userKey});const H=Ha(L.id),W=Wa(L.id),b=[z,F("open",()=>{I(void 0),w("connected")}),F("error",R=>{vi.error("connection error",{error:R,conversationId:L.id}),I(S=>S||Rr(R)),w("error"),y.emit("error",new Error(`Connection to conversation lost: ${R==null?void 0:R.message}`))}),F("message_created",R=>{const S=cr(R);H.getState().saveMessage(S),_.id!==S.authorId&&(s==null||s(),m(!1),g(!1),y.emit("isTyping",{isTyping:!1,timeout:0})),y.emit("message",S)}),F("message_updated",R=>{const S=cr(R);H.getState().saveMessage(S)}),F("message_status_changed",R=>{var S;R.newStatus==="processing"&&H.getState().updateMessage((S=R.message.metadata)==null?void 0:S.clientMessageId,{status:R.newStatus})}),F("typing_stopped",()=>{m(!1),g(!1)}),F("typing_started",()=>{m(!0,5e3),g(!0,5e3),y.emit("isTyping",{isTyping:!0,timeout:5e3})}),F("participant_added",R=>{W.getState().addParticipant(R.participant),y.emit("participantAdded",R.participant)}),F("participant_removed",R=>{W.getState().removeParticipant(R.participantId),y.emit("participantRemoved",R.participantId)}),F("webchat_visibility",R=>y.emit("webchatVisibility",R.visibility)),F("webchat_config",R=>y.emit("webchatConfig",R.config)),F("custom",R=>y.emit("customEvent",R.event))];w("connected"),vi.info("client fully connected with event handlers ready",{conversationId:L.id}),M.current=()=>{b.forEach(R=>R())}};return{clientState:v,httpClient:A,error:E,activeConversationId:u,userCredentials:f,isTyping:d,isAwaitingResponse:p,openConversation:T,setAwaitingResponse:g,emitter:y,setError:I,setClientState:w}}const Ey=D.createContext(null);function $o(){const e=D.useContext(Ey);if(!e)throw new Error("useWebchatContext must be used inside <WebchatProvider>");return e}function Cy({clientId:e,apiUrl:t,storageKey:n,storageLocation:r,adminSecret:i,clientHeaders:o,children:s,...a}){var k;const{clientState:l,httpClient:u,error:f,activeConversationId:c,userCredentials:h,isTyping:d,isAwaitingResponse:m,openConversation:p,setClientState:g,setError:y,setAwaitingResponse:v,emitter:w}=xy({apiUrl:t,clientId:e,storageKey:n,storageLocation:r,adminSecret:i,clientHeaders:o,conversationId:a.conversationId,userToken:(k=a.userCredentials)==null?void 0:k.userToken}),A={client:u,clientState:l,setClientState:g,conversationId:c,userCredentials:h,error:f,setError:y,isTyping:d,isAwaitingResponse:m,openConversation:p,setAwaitingResponse:v,emitter:w};return x.jsx(Ey.Provider,{value:A,children:s})}const tu=({children:e,className:t,uploadFile:n,allowFileUpload:r,storageKey:i,conversationId:o,...s})=>{const{container:a}=ye,l=Jn(g=>g.setMessageContainerRef),f=Lp(o||"default",i)(g=>g.uploadFile),[c,h]=D.useState(0),d=D.useRef(null);D.useEffect(()=>{l(d)},[d,l]);const m=D.useCallback(g=>{n&&(g.forEach(y=>f(y,n)),h(0))},[f,n]),{getRootProps:p}=Hg({noClick:!0,noKeyboard:!0,onDrop:m,disabled:!(r&&n),onDragEnter:()=>h(g=>g+1),onDragLeave:()=>h(g=>g-1)});return x.jsxs("div",{...s,className:ur(a.className,t),...p(),ref:d,children:[x.jsxs("div",{"data-hover":c>0,...a.dropzone.overlay,children:["Drop files to upload",x.jsx(KA,{style:{width:"50px"}})]}),x.jsx(jg,{children:e})]})};tu.displayName="Container";const Ay=D.forwardRef(({onClick:e,imgUrl:t,...n},r)=>{const{fab:i}=ye,{container:o,icon:s,image:a}=i??{};return t?x.jsx("img",{src:t,role:"button",tabIndex:0,...a,draggable:"false",onClick:e}):x.jsx("div",{...n,...o,ref:r,onClick:e,children:x.jsx("div",{...s})})});Ay.displayName="Fab";function Jt(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function oL(e,t){const n=C.createContext(t),r=o=>{const{children:s,...a}=o,l=C.useMemo(()=>a,Object.values(a));return x.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function i(o){const s=C.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function Ty(e,t=[]){let n=[];function r(o,s){const a=C.createContext(s),l=n.length;n=[...n,s];const u=c=>{var y;const{scope:h,children:d,...m}=c,p=((y=h==null?void 0:h[e])==null?void 0:y[l])||a,g=C.useMemo(()=>m,Object.values(m));return x.jsx(p.Provider,{value:g,children:d})};u.displayName=o+"Provider";function f(c,h){var p;const d=((p=h==null?void 0:h[e])==null?void 0:p[l])||a,m=C.useContext(d);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${c}\` must be used within \`${o}\``)}return[u,f]}const i=()=>{const o=n.map(s=>C.createContext(s));return function(a){const l=(a==null?void 0:a[e])||o;return C.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,sL(i,...t)]}function sL(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const c=l(o)[`__scope${u}`];return{...a,...c}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var aL=C[" useInsertionEffect ".trim().toString()]||tn;function Iy({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,s]=lL({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:i;{const f=C.useRef(e!==void 0);C.useEffect(()=>{const c=f.current;c!==a&&console.warn(`${r} is changing from ${c?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=a},[a,r])}const u=C.useCallback(f=>{var c;if(a){const h=uL(f)?f(e):f;h!==e&&((c=s.current)==null||c.call(s,h))}else o(f)},[a,e,o,s]);return[l,u]}function lL({defaultProp:e,onChange:t}){const[n,r]=C.useState(e),i=C.useRef(n),o=C.useRef(t);return aL(()=>{o.current=t},[t]),C.useEffect(()=>{var s;i.current!==n&&((s=o.current)==null||s.call(o,n),i.current=n)},[n,i]),[n,r,o]}function uL(e){return typeof e=="function"}function Oy(e){const t=cL(e),n=C.forwardRef((r,i)=>{const{children:o,...s}=r,a=C.Children.toArray(o),l=a.find(dL);if(l){const u=l.props.children,f=a.map(c=>c===l?C.Children.count(u)>1?C.Children.only(null):C.isValidElement(u)?u.props.children:null:c);return x.jsx(t,{...s,ref:i,children:C.isValidElement(u)?C.cloneElement(u,void 0,f):null})}return x.jsx(t,{...s,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function cL(e){const t=C.forwardRef((n,r)=>{const{children:i,...o}=n;if(C.isValidElement(i)){const s=pL(i),a=hL(o,i.props);return i.type!==C.Fragment&&(a.ref=r?rs(r,s):s),C.cloneElement(i,a)}return C.Children.count(i)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var fL=Symbol("radix.slottable");function dL(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===fL}function hL(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{const l=o(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function pL(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var mL=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Rt=mL.reduce((e,t)=>{const n=Oy(`Primitive.${t}`),r=C.forwardRef((i,o)=>{const{asChild:s,...a}=i,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(l,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function gL(e,t){e&&Hu.flushSync(()=>e.dispatchEvent(t))}function yL(e,t){return C.useReducer((n,r)=>t[n][r]??n,e)}var zo=e=>{const{present:t,children:n}=e,r=vL(t),i=typeof n=="function"?n({present:r.isPresent}):C.Children.only(n),o=nn(r.ref,bL(i));return typeof n=="function"||r.isPresent?C.cloneElement(i,{ref:o}):null};zo.displayName="Presence";function vL(e){const[t,n]=C.useState(),r=C.useRef(null),i=C.useRef(e),o=C.useRef("none"),s=e?"mounted":"unmounted",[a,l]=yL(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{const u=Ho(r.current);o.current=a==="mounted"?u:"none"},[a]),tn(()=>{const u=r.current,f=i.current;if(f!==e){const h=o.current,d=Ho(u);e?l("MOUNT"):d==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(f&&h!==d?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),tn(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,c=d=>{const p=Ho(r.current).includes(CSS.escape(d.animationName));if(d.target===t&&p&&(l("ANIMATION_END"),!i.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},h=d=>{d.target===t&&(o.current=Ho(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:C.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Ho(e){return(e==null?void 0:e.animationName)||"none"}function bL(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var wL=C[" useId ".trim().toString()]||(()=>{}),SL=0;function Uo(e){const[t,n]=C.useState(wL());return tn(()=>{n(r=>r??String(SL++))},[e]),e||(t?`radix-${t}`:"")}var jo="Collapsible",[kL]=Ty(jo),[xL,nu]=kL(jo),Dy=C.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:s,...a}=e,[l,u]=Iy({prop:r,defaultProp:i??!1,onChange:s,caller:jo});return x.jsx(xL,{scope:n,disabled:o,contentId:Uo(),open:l,onOpenToggle:C.useCallback(()=>u(f=>!f),[u]),children:x.jsx(Rt.div,{"data-state":iu(l),"data-disabled":o?"":void 0,...a,ref:t})})});Dy.displayName=jo;var My="CollapsibleTrigger",Ny=C.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=nu(My,n);return x.jsx(Rt.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":iu(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:Jt(e.onClick,i.onOpenToggle)})});Ny.displayName=My;var ru="CollapsibleContent",Ly=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=nu(ru,e.__scopeCollapsible);return x.jsx(zo,{present:n||i.open,children:({present:o})=>x.jsx(EL,{...r,ref:t,present:o})})});Ly.displayName=ru;var EL=C.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=e,s=nu(ru,n),[a,l]=C.useState(r),u=C.useRef(null),f=nn(t,u),c=C.useRef(0),h=c.current,d=C.useRef(0),m=d.current,p=s.open||a,g=C.useRef(p),y=C.useRef(void 0);return C.useEffect(()=>{const v=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(v)},[]),tn(()=>{const v=u.current;if(v){y.current=y.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const w=v.getBoundingClientRect();c.current=w.height,d.current=w.width,g.current||(v.style.transitionDuration=y.current.transitionDuration,v.style.animationName=y.current.animationName),l(r)}},[s.open,r]),x.jsx(Rt.div,{"data-state":iu(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!p,...o,ref:f,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:p&&i})});function iu(e){return e?"open":"closed"}var CL=Dy,AL=Ly;const ou=({restartConversation:e,...t})=>{var s,a;const{header:n}=ye,{showInputModal:r}=Ga(),i=Ye(),o=async l=>{l.stopPropagation(),r?r({title:i["restartConversation.title"],description:i["restartConversation.description"],confirmButtonText:i["restartConversation.confirm"],cancelButtonText:i["restartConversation.cancel"]}).then(()=>e()):e()};return x.jsx(lT,{...t,...(a=(s=n==null?void 0:n.content)==null?void 0:s.actions)==null?void 0:a.icons,"aria-label":i["restartConversation.button.ariaLabel"],tabIndex:0,role:"button",onClick:o})},su=({onClick:e,...t})=>{const{header:n}=ye,r=Ye(),i=o=>{o.stopPropagation(),e==null||e()};return x.jsx(wp,{...t,...n.content.actions.icons,role:"button",tabIndex:0,"aria-label":r["closeButton.ariaLabel"],onClick:i,onKeyDown:o=>{o.key==="Enter"&&i(o)}})},TL=({onClick:e,...t})=>{const{header:n}=ye,r=Ye(),i=o=>{o.stopPropagation(),e==null||e()};return x.jsx(pp,{...t,...n.content.actions.icons,role:"button",tabIndex:0,"aria-label":r["conversationHistory.showButton.ariaLabel"],onClick:i,onKeyDown:o=>{o.key==="Enter"&&i(o)}})},bi=({icon:e,title:t,link:n,...r})=>{var s,a,l,u,f,c,h,d,m,p,g,y;const{header:i}=ye,o=e??GA;return t?n?x.jsxs("a",{...r,...(a=(s=i.expandedContent)==null?void 0:s.descriptionItems)==null?void 0:a.container,href:n,target:"_blank",rel:"noreferrer noopener",children:[x.jsx(o,{...(u=(l=i.expandedContent)==null?void 0:l.descriptionItems)==null?void 0:u.icon}),x.jsx("p",{...(c=(f=i.expandedContent)==null?void 0:f.descriptionItems)==null?void 0:c.link,children:t})]}):x.jsxs("div",{...r,...(d=(h=i.expandedContent)==null?void 0:h.descriptionItems)==null?void 0:d.container,children:[x.jsx(o,{...(p=(m=i.expandedContent)==null?void 0:m.descriptionItems)==null?void 0:p.icon}),x.jsx("p",{...(y=(g=i.expandedContent)==null?void 0:g.descriptionItems)==null?void 0:y.text,children:t})]}):null},IL=({soundOn:e,toggleSound:t})=>{const n=Ye(),r=s=>{s.stopPropagation(),t==null||t()},{header:i}=ye,o=e?bp:mT;return x.jsx("div",{role:"button",tabIndex:0,onClick:r,onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),r(s))},title:e?n["header.sound.disable"]:n["header.sound.enable"],...i.content.actions.icons,children:x.jsx(o,{size:16})})},_y=({defaultOpen:e,closeWindow:t,configuration:n,restartConversation:r,showConversationHistory:i,disabled:o,soundOn:s,toggleSound:a,clientId:l,...u})=>{var g,y,v,w,A,k,E,I,M,P,T,O,j,F,L,_,B,z,H,W,b,N,R,S;const{header:f}=ye,c=Ye(),[h,d]=D.useState(e),m=!!((g=n.email)!=null&&g.title)||!!((y=n.phone)!=null&&y.title)||!!((v=n.website)!=null&&v.title)||!!((w=n.termsOfService)!=null&&w.link)||!!((A=n.privacyPolicy)!=null&&A.link),p=m&&!o;return x.jsxs(CL,{open:p?h:!1,onOpenChange:p?d:void 0,"data-disabled":p?void 0:"",...f.container,...u,children:[x.jsxs(Ny,{"aria-label":c["header.expandButton.ariaLabel"],...f.content.container,children:[x.jsx("div",{...f.content.conversationHistory,children:i&&!h&&x.jsx(TL,{onClick:i})}),x.jsx(Cn,{userId:l,src:n.botAvatar,...f.content.avatar,children:n.botName||c["header.defaultBotName"]}),x.jsx("h2",{...f.content.title,children:n.botName||c["header.defaultBotName"]}),n.botDescription&&x.jsx("p",{...f.content.description,children:n.botDescription}),x.jsxs("div",{...f.content.actions.container,children:[n.soundEnabled&&s!==void 0&&a&&x.jsx(IL,{soundOn:s,toggleSound:a}),r&&x.jsx(ou,{restartConversation:r}),t&&x.jsx(su,{onClick:t})]})]}),m&&x.jsxs(AL,{...f.expandedContent.container,children:[x.jsxs("div",{"data-links":"",...f.expandedContent.group,children:[x.jsx(bi,{"data-email":"",icon:nT,title:(k=n.email)==null?void 0:k.title,link:(I=(E=n.email)==null?void 0:E.link)!=null&&I.startsWith("mailto:")?(M=n.email)==null?void 0:M.link:`mailto:${(P=n.email)==null?void 0:P.link}`}),x.jsx(bi,{"data-phone":"",icon:sT,title:(T=n.phone)==null?void 0:T.title,link:(j=(O=n.phone)==null?void 0:O.link)!=null&&j.startsWith("tel:")?(F=n.phone)==null?void 0:F.link:`tel:${(L=n.phone)==null?void 0:L.link}`}),x.jsx(bi,{"data-website":"",link:(_=n.website)==null?void 0:_.link,icon:JA,title:(B=n.website)==null?void 0:B.title})]}),x.jsxs("div",{"data-legal":"",...(z=f.expandedContent)==null?void 0:z.group,children:[((H=n.termsOfService)==null?void 0:H.link)&&x.jsx(bi,{"data-terms":"",link:(W=n.termsOfService)==null?void 0:W.link,icon:yp,title:(b=n.termsOfService)==null?void 0:b.title}),((N=n.privacyPolicy)==null?void 0:N.link)&&x.jsx(bi,{"data-privacy":"",link:(R=n.privacyPolicy)==null?void 0:R.link,icon:tT,title:(S=n.privacyPolicy)==null?void 0:S.title})]})]})]})},au=D.memo(({...e})=>{const{typingIndicator:t}=ye;return x.jsx("div",{...e,...t==null?void 0:t.container,children:x.jsx("div",{...t==null?void 0:t.loader})})});au.displayName="TypingIndicator";const lu=D.memo(D.forwardRef(({direction:e,block:t,disableInput:n,children:r,sender:i,id:o,authorId:s,status:a,renderers:l,isReadOnly:u,isLastDeliveredMessage:f,feedback:c,timestamp:h,metadata:d,sendMessage:m,addMessageFeedback:p,showAvatar:g},y)=>{const[v,w]=D.useState([]),{message:{container:A,deliveryStatus:k,deliveryStatusLabel:E}}=ye,I=Ye();return g=g??e==="incoming",x.jsx(Ya.Provider,{value:{isLoading:v,setIsLoading:w},children:x.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&&x.jsx(Py,{authorId:s,sender:i}),t&&x.jsx(Nn,{block:{...t,isReadOnly:u,direction:e,timestamp:h,sender:i,feedback:c,messageId:o,status:a,metadata:d,sendMessage:m,addMessageFeedback:p},renderers:l}),e==="outgoing"&&g&&x.jsx(Py,{authorId:s,sender:i}),r,e==="outgoing"&&x.jsx("span",{...E,"aria-hidden":!f,children:I["message.status.delivered"]})]})})})),Py=({authorId:e,sender:t})=>{const{message:{avatar:n}}=ye,[r,i]=D.useState("idle"),o=Zu(e??"",15);return x.jsxs(cs,{"data-color":o,"data-loading-status":r,...n==null?void 0:n.container,children:[x.jsx(fs,{...n==null?void 0:n.image,onLoadingStatusChange:i,src:t==null?void 0:t.avatar}),x.jsxs(ds,{...n==null?void 0:n.fallback,children:[t==null?void 0:t.name[0]," "]})]})};function OL({botAvatar:e,botDescription:t,botName:n}){const{messageList:{marquee:r}}=ye;return x.jsxs("li",{...r.container,children:[x.jsx(Cn,{src:e,...r.avatar,children:(n||"Bot").slice(0,1)}),x.jsxs("div",{...r.content,children:[x.jsx("h1",{...r.title,children:n||"Bot"}),x.jsx("p",{...r.description,children:t})]})]})}let uu=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");const DL=70,ML=300;function NL(e,t={}){const n=t.nearBottomThreshold??DL,[r,i]=D.useState(!0),o=D.useRef(null),s=D.useRef(0),a=D.useRef(!0),l=D.useRef(!1),u=D.useRef(!1),f=D.useRef(0),c=D.useCallback(v=>v.scrollHeight-v.clientHeight-v.scrollTop<n,[n]),h=D.useCallback((v,w=ML)=>{cancelAnimationFrame(f.current);const A=v.scrollTop,k=performance.now(),E=()=>{const I=performance.now()-k,M=Math.min(I/w,1),P=1-Math.pow(1-M,3),T=v.scrollHeight-v.clientHeight;v.scrollTop=A+(T-A)*P,s.current=v.scrollTop,M<1&&u.current?f.current=requestAnimationFrame(E):(v.scrollTop=v.scrollHeight-v.clientHeight,s.current=v.scrollTop,u.current=!1,a.current=!0,i(!0))};u.current=!0,f.current=requestAnimationFrame(E)},[]),d=D.useCallback(()=>{const v=o.current;v&&(a.current=!0,i(!0),h(v))},[h]),m=D.useCallback(()=>{const v=o.current;if(!v)return;if(l.current){l.current=!1,s.current=v.scrollTop,a.current=c(v);return}if(u.current){s.current=v.scrollTop,c(v)&&(u.current=!1,l.current=!0,v.scrollTop=v.scrollHeight-v.clientHeight,s.current=v.scrollTop,a.current=!0,i(!0));return}s.current=v.scrollTop;const w=c(v);a.current=w,i(w)},[c]),p=D.useCallback(v=>{v.deltaY<0&&(cancelAnimationFrame(f.current),u.current=!1,a.current=!1,i(!1))},[]),g=D.useCallback(()=>{u.current&&(cancelAnimationFrame(f.current),u.current=!1)},[]),y=D.useCallback(v=>{const w=o.current;w&&(w.removeEventListener("scroll",m),w.removeEventListener("wheel",p),w.removeEventListener("touchstart",g)),o.current=v,v&&(v.addEventListener("scroll",m,{passive:!0}),v.addEventListener("wheel",p,{passive:!0}),v.addEventListener("touchstart",g,{passive:!0}),s.current=v.scrollTop)},[m,p,g]);return D.useLayoutEffect(()=>{const v=o.current;if(v)if(a.current){const w=v.scrollHeight-v.clientHeight,A=w-v.scrollTop;A>0&&A<=v.clientHeight&&v.clientHeight>0?(u.current=!0,v.scrollTo({top:w,behavior:"smooth"}),cancelAnimationFrame(f.current),f.current=requestAnimationFrame(()=>{u.current&&o.current&&c(o.current)&&(u.current=!1,a.current=!0,i(!0))})):(cancelAnimationFrame(f.current),u.current=!1,v.scrollTop=w),s.current=w,a.current=!0}else l.current=!0,v.scrollTop=s.current},[e,c]),D.useEffect(()=>{const v=o.current;if(!v)return;const w=v.firstElementChild;if(!w)return;const A=new ResizeObserver(()=>{o.current&&(u.current||(a.current?(l.current=!0,o.current.scrollTop=o.current.scrollHeight-o.current.clientHeight,s.current=o.current.scrollTop):o.current.scrollTop=s.current))});return A.observe(w),()=>A.disconnect()},[]),D.useEffect(()=>{const v=window.visualViewport;if(!v)return;const w=()=>{const A=o.current;A&&(u.current||a.current&&(l.current=!0,A.scrollTop=A.scrollHeight-A.clientHeight,s.current=A.scrollTop))};return v.addEventListener("resize",w),()=>v.removeEventListener("resize",w)},[]),D.useEffect(()=>{const v=o.current;if(!v)return;let w=!1;const A=new IntersectionObserver(k=>{var E,I;(E=k[0])!=null&&E.isIntersecting&&w&&a.current&&(v.scrollTop=v.scrollHeight-v.clientHeight,s.current=v.scrollTop),w=!((I=k[0])!=null&&I.isIntersecting)});return A.observe(v),()=>A.disconnect()},[]),D.useEffect(()=>()=>cancelAnimationFrame(f.current),[]),{scrollRef:y,isAtBottom:r,scrollToBottom:d}}const LL=100,_L=40,PL={height:"100%",width:"100%",overflowY:"auto",scrollbarWidth:"none",overscrollBehaviorY:"contain"},cu=D.memo(({className:e,messages:t=[],isTyping:n,headerMessage:r,renderers:i,botAvatar:o,botDescription:s,botName:a,sendMessage:l,addMessageFeedback:u,showMarquee:f=!0,showDateSystemMessage:c=!0,showMessageStatus:h=!0,showIncomingMessageAvatar:d=!0,showOutgoingMessageAvatar:m=!1,isOpen:p,...g})=>{var F;const{messageList:y}=ye,v=Ye(),w=D.useMemo(()=>c?Ab(t,v):t,[t,v]),A=D.useMemo(()=>{var _;const L=w.filter(B=>B.direction==="outgoing"&&B.status!=="pending");return(_=L[L.length-1])==null?void 0:_.id},[w]),k=w[w.length-1],E=(k==null?void 0:k.id)??"",I=`${w.length}:${E}:${n}`,{scrollRef:M,isAtBottom:P,scrollToBottom:T}=NL(I),O=D.useRef(!!p);D.useEffect(()=>{(k==null?void 0:k.direction)==="outgoing"&&T()},[k==null?void 0:k.direction,E,T]),D.useEffect(()=>{const L=!!p&&!O.current;if(O.current=!!p,!L)return;T();const _=window.setTimeout(T,LL+_L);return()=>window.clearTimeout(_)},[p,T]);const j=L=>{if(L.direction==="incoming")return d;if(L.direction==="outgoing")return m};return x.jsxs("div",{...g,className:ur(y.container.className,e),children:[x.jsx("div",{ref:M,style:PL,children:x.jsxs("div",{className:y.viewPort.className,children:[r&&x.jsx("span",{...y.headerMessage,children:r}),f&&x.jsx(OL,{botAvatar:o,botDescription:s,botName:a}),w.map(L=>{var _;return x.jsx(lu,{renderers:i,sendMessage:l,addMessageFeedback:u,isLastDeliveredMessage:h&&L.id===A,showAvatar:j(L),...L},((_=L.metadata)==null?void 0:_.clientMessageId)||L.id)}),n&&x.jsx(lu,{id:uu(),renderers:i,sendMessage:l,direction:"incoming",timestamp:new Date,showAvatar:d,block:void 0,sender:((F=t.filter(L=>L.direction==="incoming").at(-1))==null?void 0:F.sender)??{name:a||"Bot",avatar:o},children:x.jsx(au,{})})]})}),!P&&x.jsx("button",{className:y.scrollDownButton.className,onClick:()=>T()})]})});cu.displayName="MessageList";const Fy=({className:e,...t})=>{const{className:n}=ye.loader;return x.jsx("div",{...t,className:ur(e,n)})};function Ry({error:e,restartConversation:t,closeWindow:n}){const r=Ye();let i,o;const{error:s}=ye;return e.type==="configuration"?(i=r["error.configuration"],o=x.jsx(oT,{...s.icon})):e.type==="bot"?(i=r["error.bot"],o=x.jsx(hp,{...s.icon})):e.type==="network"?(i=r["error.network"],o=x.jsx(gT,{...s.icon})):e.type==="disconnected"?(i=r["error.disconnected"],o=x.jsx(dT,{...s.icon})):(i=r["error.unexpected"],o=x.jsx(hp,{...s.icon})),x.jsx(FL,{error:e,title:i,icon:o,restartConversation:t,closeWindow:n})}function FL({error:e,title:t,icon:n,restartConversation:r,closeWindow:i}){const{error:o}=ye;return x.jsxs("div",{...o.container,children:[x.jsxs("div",{...o.header.container,children:[t,x.jsxs("div",{...o.header.actions,children:[r&&x.jsx(ou,{restartConversation:r,style:{color:"white",backgroundColor:"transparent"}}),i&&x.jsx(su,{onClick:i,style:{color:"white",backgroundColor:"transparent"}})]})]}),x.jsxs("div",{...o.content,children:[n,x.jsx("div",{...o.errorTitle,children:t}),x.jsx("div",{...o.errorMessage,children:e.message}),e.id&&x.jsx("div",{...o.id,children:e.id})]})]})}const wi=Sy.webchat;async function RL(e,t){const{userId:n,conversationId:r,userToken:i,openConversation:o,setClientState:s,setError:a,emitter:l}=t;wi.warn("handleWebchatError",{userId:n,conversationId:r,type:e.type,message:e.message});const f=[{name:"startNewConversation",predicate:c=>c.message===Rs||c.type==="ResourceNotFound",recover:async()=>o({userToken:i})},{name:"reopenConversation",predicate:c=>c.type==="network",recover:async()=>o({userToken:i,conversationId:r})}].find(c=>c.predicate(e));if(!f){wi.error("no recovery strategy found, setting error state",{userId:n,conversationId:r}),s("error"),a(e);return}wi.info("attempting recovery",{userId:n,conversationId:r,strategy:f.name});try{await od(f.recover,3,5e3),wi.info("recovery successful",{userId:n,conversationId:r}),a(void 0),s("connected")}catch(c){wi.error("recovery failed",{error:c,userId:n,conversationId:r}),a(Rr(c)),s("error"),l.emit("error",c)}}function BL(e,t){return async(...n)=>{try{return await e(...n)}catch(r){await RL(Rr(r),t)}}}function By(e,t){const n={};for(const[r,i]of Object.entries(e))n[r]=BL(i,t);return n}function $y({client:e,conversationId:t}){return{sendEvent:async(r,i)=>{if(!e||!t)throw new Error("Cannot send event: client or conversationId not available");await e.createEvent({conversationId:t,payload:{type:"custom",data:r},bindConversation:(i==null?void 0:i.bindConversation)??!0,bindUser:(i==null?void 0:i.bindUser)??!0})}}}function zy({client:e,conversationId:t,user:n}){return{uploadFile:async i=>{if(!e)throw new Error("Client not initialized");if(!t)throw new Error("No active conversation");if(!n)throw new Error("User not authenticated");const{size:o,name:s}=i,a=await i1(i),l=new Date;l.setDate(l.getDate()+30);const{file:{uploadUrl:u,contentType:f,url:c,id:h}}=await e.createFile({size:o,key:`${uu(6)}-${i.name}`,accessPolicies:["public_content"],index:!1,tags:{source:"integration",integrationName:"webchat",conversation:t,user:n.userId},expiresAt:l.toISOString()});await fetch(u,{method:"PUT",headers:{"x-amz-tagging":"public=true","content-type":f},body:a});const d=f.split("/").shift()??"",m=qf(d)?d:"file";return{fileUrl:c,name:s,type:m,fileId:h}}}}function Hy({client:e,conversationId:t,userId:n,setAwaitingResponse:r}){const i=Ha(t||"default"),o=i(d=>d.messages),s=i(d=>d.saveMessage),a=i(d=>d.updateMessage),l=i(d=>d.setMessages),u=i(d=>d.clearMessages);return{messages:o,sendMessage:async d=>{if(!e||!t||!n)throw console.log("Cannot send message: client, conversationId, or userId not available",e,t,n),new Error("Cannot send message: client, conversationId, or userId not available");r==null||r(!0,1e3);const m=uu(),p={id:m,createdAt:new Date().toISOString(),userId:n,conversationId:t,payload:d,metadata:{clientMessageId:m,delivered:!1}},g=cr(p);g.status="pending",s(g),await e.createMessage({conversationId:t,payload:d,metadata:{clientMessageId:m}})},setMessages:d=>{const m=d.map(p=>cr(p)).filter(Boolean);l(m)},clearMessages:u,saveMessageFeedback:async(d,m)=>{if(!e)throw new Error("Cannot update feedback: client not available");a(d,{feedback:m.value}),await e.addMessageFeedback({messageId:d,...m})}}}function Uy({client:e,conversationId:t}){const n=Wa(t||"default"),r=n(u=>u.participants),i=n(u=>u.setParticipants),o=n(u=>u.addParticipant),s=n(u=>u.removeParticipant),a=n(u=>u.clearParticipants);return{participants:r,setParticipants:i,fetchParticipants:async()=>{if(!e||!t)return;const{participants:u}=await e.listParticipants({conversationId:t});i(u)},clearParticipants:a,addParticipant:o,removeParticipant:s}}const jy={chatMessageNotification:new URL("data:audio/ogg;base64,T2dnUwACAAAAAAAAAAAVJAEzAAAAAOU+A6UBHgF2b3JiaXMAAAAAASJWAAD/////AH0AAP////+pAU9nZ1MAAAAAAAAAAAAAFSQBMwEAAAD3T/UfDpz////////////////FA3ZvcmJpcwwAAABMYXZmNjEuNy4xMDAEAAAAHwAAAGVuY29kZXI9TGF2YzYxLjE5LjEwMSBsaWJ2b3JiaXMrAAAAZW5jb2RlZF9ieT1BZG9iZSBQcmVtaWVyZSBQcm8gMjAyNS4wIChNYWNpbhcAAAB0aW1lX3JlZmVyZW5jZT0xMjExMDQwMA8AAABkYXRlPTIwMjUtMDgtMDUBBXZvcmJpcyJCQ1YBAEAAABhCECoFrWOOOsgVIYwZoqBCyinHHULQIaMkQ4g6xjXHGGNHuWSKQsmB0JBVAABAAACkHFdQckkt55xzoxhXzHHoIOecc+UgZ8xxCSXnnHOOOeeSco4x55xzoxhXDnIpLeecc4EUR4pxpxjnnHOkHEeKcagY55xzbTG3knLOOeecc+Ygh1JyrjXnnHOkGGcOcgsl55xzxiBnzHHrIOecc4w1t9RyzjnnnHPOOeecc84555xzjDHnnHPOOeecc24x5xZzrjnnnHPOOeccc84555xzIDRkFQCQAACgoSiK4igOEBqyCgDIAAAQQHEUR5EUS7Ecy9EkDQgNWQUAAAEACAAAoEiGpEiKpViOZmmeJnqiKJqiKquyacqyLMuy67ouEBqyCgBIAABQURTFcBQHCA1ZBQBkAAAIYCiKoziO5FiSpVmeB4SGrAIAgAAABAAAUAxHsRRN8STP8jzP8zzP8zzP8zzP8zzP8zzP8zwNCA1ZBQAgAAAAgihkGANCQ1YBAEAAAAghGhlDnVISXAoWQhwRQx1CzkOppYPgKYUlY9JTrEEIIXzvPffee++B0JBVAAAQAABhFDiIgcckCCGEYhQnRHGmIAghhOUkWMp56CQI3YMQQrice8u59957IDRkFQAACADAIIQQQgghhBBCCCmklFJIKaaYYoopxxxzzDHHIIMMMuigk046yaSSTjrKJKOOUmsptRRTTLHlFmOttdacc69BKWOMMcYYY4wxxhhjjDHGGCMIDVkFAIAAABAGGWSQQQghhBRSSCmmmHLMMcccA0JDVgEAgAAAAgAAABxFUiRHciRHkiTJkixJkzzLszzLszxN1ERNFVXVVW3X9m1f9m3f1WXf9mXb1WVdlmXdtW1d1l1d13Vd13Vd13Vd13Vd13Vd14HQkFUAgAQAgI7kOI7kOI7kSI6kSAoQGrIKAJABABAAgKM4iuNIjuRYjiVZkiZplmd5lqd5mqiJHhAasgoAAAQAEAAAAAAAgKIoiqM4jiRZlqZpnqd6oiiaqqqKpqmqqmqapmmapmmapmmapmmapmmapmmapmmapmmapmmapmmapmkCoSGrAAAJAAAdx3EcR3Ecx3EkR5IkIDRkFQAgAwAgAABDURxFcizHkjRLszzL00TP9FxRNnVTV20gNGQVAAAIACAAAAAAAADHczzHczzJkzzLczzHkzxJ0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRNA0JDVgIAZAAAEJOQSk6xV0YpxiS0XiqkFJPUe6iYYkw67alCBikHuYdKIaWg094ypZBSDHunmELIGOqhg5AxhbDX2nPPvfceCA1ZEQBEAQAAxiDGEGPIMSYlgxIxxyRkUiLnnJROSialpFZazKSEmEqLkXNOSiclk1JaC6llkkprJaYCAAACHAAAAiyEQkNWBABRAACIMUgppBRSSjGnmENKKceUY0gp5ZxyTjnHmHQQKucYdA5KpJRyjjmnnHMSMgeVcw5CJp0AAIAABwCAAAuh0JAVAUCcAACAkHOKMQgRYxBCCSmFUFKqnJPSQUmpg5JSSanFklKMlXNSOgkpdRJSKinFWFKKLaRUY2kt19JSjS3GnFuMvYaUYi2p1Vpaq7nFWHOLNffIOUqdlNY6Ka2l1mpNrdXaSWktpNZiaS3G1mLNKcacMymthZZiK6nF2GLLNbWYc2kt1xRjzynGnmusucecgzCt1ZxayznFmHvMseeYcw+Sc5Q6Ka11UlpLrdWaWqs1k9Jaaa3GkFqLLcacW4sxZ1JaLKnFWFqKMcWYc4st19BarinGnFOLOcdag5Kx9l5aqznFmHuKreeYczA2x547SrmW1nourfVecy5C1tyLaC3n1GoPKsaec87B2NyDEK3lnGrsPcXYe+45GNtz8K3W4FvNRcicg9C5+KZ7MEbV2oPMtQiZcxA66CJ08Ml4lGoureVcWus91hp8zTkI0VruKcbeU4u9156bsL0HIVrLPcXYg4ox+JpzMDrnYlStwcecg5C1FqF7L0rnIJSqtQeZa1Ay1yJ08MXooIsvAABgwAEAIMCEMlBoyIoAIE4AgEHIOaUYhEopCKGElEIoKVWMSciYg5IxJ6WUUloIJbWKMQiZY1Iyx6SEEloqJbQSSmmplNJaKKW1llqMKbUWQymphVJaK6W0llqqMbVWY8SYlMw5KZljUkoprZVSWqsck5IxKKmDkEopKcVSUouVc1Iy6Kh0EEoqqcRUUmmtpNJSKaXFklJsKcVUW4u1hlJaLKnEVlJqMbVUW4sx14gxKRlzUjLnpJRSUiultJY5J6WDjkrmoKSSUmulpBQz5qR0DkrKIKNSUootpRJTKKW1klJspaTWWoy1ptRaLSW1VlJqsZQSW4sx1xZLTZ2U1koqMYZSWmsx5ppaizGUElspKcaSSmytxZpbbDmGUlosqcRWSmqx1ZZja7Hm1FKNKbWaW2y5xpRTj7X2nFqrNbVUY2ux5lhbb7XWnDsprYVSWislxZhai7HFWHMoJbaSUmylpBhbbLm2FmMPobRYSmqxpBJjazHmGFuOqbVaW2y5ptRirbX2HFtuPaUWa4ux5tJSjTXX3mNNORUAADDgAAAQYEIZKDRkJQAQBQAAGMMYYxAapZxzTkqDlHPOScmcgxBCSplzEEJIKXNOQkotZc5BSKm1UEpKrcUWSkmptRYLAAAocAAACLBBU2JxgEJDVgIAUQAAiDFKMQahMUYp5yA0xijFGIRKKcack1ApxZhzUDLHnINQSuaccxBKCSGUUkpKIYRSSkmpAACAAgcAgAAbNCUWByg0ZEUAEAUAABhjnDPOIQqdpc5SJKmj1lFrKKUaS4ydxlZ767nTGnttuTeUSo2p1o5ry7nV3mlNPbccCwAAO3AAADuwEAoNWQkA5AEAEMYoxZhzzhmFGHPOOecMUow555xzijHnnIMQQsWYc85BCCFzzjkIoYSSOecchBBK6JyDUEoppXTOQQihlFI65yCEUkopnXMQSimllAIAgAocAAACbBTZnGAkqNCQlQBAHgAAYAxCzklprWHMOQgt1dgwxhyUlGKLnIOQUou5RsxBSCnGoDsoKbUYbPCdhJRaizkHk1KLNefeg0iptZqDzj3VVnPPvfecYqw1595zLwAAd8EBAOzARpHNCUaCCg1ZCQDkAQAQCCnFmHPOGaUYc8w554xSjDHmnHOKMcacc85BxRhjzjkHIWPMOecghJAx5pxzEELonHMOQgghdM45ByGEEDrnoIMQQgidcxBCCCGEAgCAChwAAAJsFNmcYCSo0JCVAEA4AAAAIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEELonHPOOeecc84555xzzjnnnHPOOScAyLfCAcD/wcYZVpLOCkeDCw1ZCQCEAwAACkEopWIQSiklkk46KZ2TUEopkYNSSumklFJKCaWUUkoIpZRSSggdlFJCKaWUUkoppZRSSimllFI6KaWUUkoppZTKOSmlk1JKKaVEzkkpIZRSSimlhFJKKaWUUkoppZRSSimllFJKKaWEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQCALgbHAAgEmycYSXprHA0uNCQlQBASAAAoBRzjkoIKZSQUqiYoo5CKSmkUkoKEWPOSeochVBSKKmDyjkIpaSUQiohdc5BByWFkFIJIZWOOugolFBSKiWU0jkopYQUSkoplZBCSKl0lFIoJZWUQiohlVJKSCWVEEoKnaRUSgqppFRSCJ10kEInJaSSSgqpk5RSKiWllEpKJXRSQioppRBCSqmUEEpIKaVOUkmppBRCKCGFlFJKJaWSSkohlVRCCaWklFIooaRUUkoppZJSKQAA4MABACDACDrJqLIIG0248AAUGrISACADAECUdNZpp0kiCDFFmScNKcYgtaQswxBTkonxFGOMOShGQw4x5JQYF0oIoYNiPCaVQ8pQUbm31DkFxRZjfO+xFwEAAAgCAASEBAAYICiYAQAGBwgjBwIdAQQObQCAgQiZCQwKocFBJgA8QERIBQCJCYrShS4IIYJ0EWTxwIUTN5644YQObRAAAAAAABAA8AEAkFAAERHRzFVYXGBkaGxwdHh8gIQEAAAAAAAIAHwAACQiQERENHMVFhcYGRobHB0eHyAhAQAAAAAAAAAAQEBAAAAAAAAgAAAAQEBPZ2dTAASuMwAAAAAAABUkATMCAAAACYS6sR4BAUQxGR89NxobGiEkKCknJiYmJSUhISEaFgwBAQEAAnyfvULHAlAEJgh2vpgQBMHIyMjIyNhIQOjz+ePz58+fL89xAwYBAFaH//3//7/xNw0MBoNB6qlPfWrUKQng+/0FABAAhLEjKuHFBwA4AHC9Fx4Oh7EwDEOgvnJ3RtV+Op0+nU6n5cyzEwAoltTpwed5dgVKMPoru90zNHGA7F0CP98BAAAAAHl9ePviAgCW+3rugPIDwC6BbWoTAFEAAADh5GpCCACgc+0zxlAAVKddkjDsA14GDoJtf7R+NkE4W23hI5mF3d74iVGvzg9PpA4cCQs66joePTmOfhgl7vNZzYzQADDyz30FAGSvVUZ6wJ4MAKbCGeb4+v5NLIdK3YvrLkCu98uV//FpXQNyKAKAV7r186fTktcJJgjAlVp1fUmaGgtrdAAuDXYJSPs/AAAAAHDnAeHxciEUAB76CvfarGjDzIjALoEd+/0EAAAAQNYeMrkBAF6ZKm8xuw94NtgloHDUCAAAAIAMJ5Qz2iUAvjhKL8lkfmA6wi6BWfNHgiAAAABq4eeqGgCg8+LAAXQAfhgqz2RKHzAVYJeAynEAIQEAALwq6tFbIQAEEIIO8iULngMAXhgajrw3D5iFWhe7BLZNrwCVKAAA0t2TfT8mADx0aMfS4CULeACvA14YWnasNht80ZpdAhv8BEiiAADgcbm4jo0JANAVCTRV6JqQS0OTADoAXhg6zWy+AZ3GsiDRAYJzgiQAAICnb9FLAQAUNQFd44AioMNJICUAfhi67ZRjA2IMSHTAJK0KkgAAAG7W0uLlEgC6KnQdDkgBlAAdJAB+GHpL40hATAASHSC5CZIAAAAGZ3J60ioBoKsBTQKE5KFJIJFAAp4Y+jp7cg4qINEBi+MASQAAAM8rmdZcAKApwFhNPHQkQEBRQwIAnhj6OZ8KIBwDiQ4Q9ApIFAAAQHRFd6FEALA0NaApQAegnPrDA54Y+nN+AYAIJDoAfgIkCgAAcLRlPVsLALqmKqFpHIwUwQEJCwCeKPpzEQA8kOgAyTlBAgAAgPnK3q8jAWAuJFBYOsbAAgCeKPolEQA8rMFCohQAAMxD2BdSAJYFdNThKcCkBQCOgwKeGPpzEQA8rEEhCQAAoCz4MRGA41gaQMBRjACexHugAACeGPqFCAAeugQAAHryFgBdRYGFhGeow8x7AJ4Y+iURADyIigIAliFAAcYWCQC11gGeGPolEQA8UAAAABoODg4=",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:ns&&ns.tagName.toUpperCase()==="SCRIPT"&&ns.src||new URL("index.umd.cjs",document.baseURI).href).href};function Vy({storageKey:e,soundEnabled:t}){const n=_p(e||"bp-webchat"),r=n(u=>u.soundOn),i=n(u=>u.toggleSound),o=D.useRef(null),s=D.useRef(t??!1),a=D.useRef(r);D.useEffect(()=>{try{o.current=new Audio,o.current.preload="auto",o.current.src=jy.chatMessageNotification,o.current.volume=.9}catch(u){console.error("Error loading sound effect:",u),o.current=null}},[]),D.useEffect(()=>{s.current=t??!1},[t]),D.useEffect(()=>{a.current=r},[r]);const l=D.useCallback(()=>{s.current&&a.current&&o.current&&o.current.play().catch(()=>{})},[]);return{soundOn:r,toggleSound:i,playNotificationSound:l}}function $L({apiUrl:e="https://webchat.botpress.cloud",clientId:t,storageKey:n,storageLocation:r,adminSecret:i,soundEnabled:o,clientHeaders:s,...a}){var B;const{soundOn:l,toggleSound:u,playNotificationSound:f}=Vy({storageKey:n,soundEnabled:o}),{clientState:c,httpClient:h,error:d,activeConversationId:m,userCredentials:p,isTyping:g,isAwaitingResponse:y,openConversation:v,setAwaitingResponse:w,emitter:A,setError:k,setClientState:E}=xy({apiUrl:e,clientId:t,storageKey:n,storageLocation:r,adminSecret:i,clientHeaders:s,conversationId:a.conversationId,userToken:(B=a.user)==null?void 0:B.userToken,playNotificationSound:f}),{messages:I,sendMessage:M,saveMessageFeedback:P}=Hy({client:h,conversationId:m,userId:p==null?void 0:p.userId,setAwaitingResponse:w}),{participants:T}=Uy({client:h,conversationId:m}),{uploadFile:O}=zy({client:h,conversationId:m,user:p}),{sendEvent:j}=$y({client:h,conversationId:m});if(c!=="connected"||!p||!m||!h)return{clientState:c,on:A.on,client:void 0,messages:[],conversationId:void 0,newConversation:z=>{v({conversationId:z,userToken:p==null?void 0:p.userToken}).catch(H=>{A.emit("error",H)})},user:void 0,isTyping:void 0,participants:[],toggleSound:u,soundOn:l,error:d,disableSendButton:y};const F={userId:p==null?void 0:p.userId,conversationId:m,userToken:p==null?void 0:p.userToken,openConversation:v,setClientState:E,setError:k,emitter:A},_={...By({sendMessage:async z=>M(z),sendEvent:j,uploadFile:O,addMessageFeedback:P},F),getUser:async()=>{const{user:z}=await h.getUser();return z},updateUser:async z=>{const{user:H}=await h.updateUser({name:z.name,pictureUrl:z.pictureUrl,userData:z.data});return H},listConversations:async()=>h.listConversations({})};return{clientState:"connected",on:A.on,client:_,messages:I,conversationId:m,newConversation:z=>{v({conversationId:z,userToken:p.userToken}).catch(H=>{A.emit("error",H)})},user:p,isTyping:g,participants:T,error:d,soundOn:l,toggleSound:u,disableSendButton:y}}const Wy=()=>{const{client:e,userCredentials:t}=$o();return e?{userCredentials:t,getUser:async()=>(await e.getUser()).user,updateUser:async i=>(await e.updateUser(i)).user}:{userCredentials:t,getUser:void 0,updateUser:void 0}};function qy(){const{client:e,conversationId:t,userCredentials:n,setAwaitingResponse:r,emitter:i,clientState:o,setClientState:s,setError:a,openConversation:l,error:u,isAwaitingResponse:f,isTyping:c}=$o(),{messages:h,sendMessage:d,saveMessageFeedback:m}=Hy({client:e,conversationId:t,userId:n==null?void 0:n.userId,setAwaitingResponse:r}),{participants:p}=Uy({client:e,conversationId:t}),{sendEvent:g}=$y({client:e,conversationId:t}),{uploadFile:y}=zy({client:e,conversationId:t,user:n}),v={userId:n==null?void 0:n.userId,userToken:n==null?void 0:n.userToken,conversationId:t,openConversation:l,setClientState:s,setError:a,emitter:i},w=By({sendMessage:d,saveMessageFeedback:m,sendEvent:g,uploadFile:y},v);return{conversationId:t,messages:h,participants:p,sendMessage:w.sendMessage,saveMessageFeedback:w.saveMessageFeedback,sendEvent:w.sendEvent,uploadFile:w.uploadFile,on:i.on,status:o,error:u,isAwaitingResponse:f,isTyping:c}}function Yy(){const{client:e,openConversation:t,userCredentials:n}=$o();return e?{listConversations:async()=>e.listConversations({}),openConversation:i=>t({conversationId:i,userToken:n==null?void 0:n.userToken})}:{listConversations:void 0,openConversation:i=>t({conversationId:i,userToken:n==null?void 0:n.userToken})}}const Ky=0,Gy=1,Qy=2,Zy=3;var Jy=Object.prototype.hasOwnProperty;function fu(e,t){var n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&fu(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(Jy.call(e,n)&&++r&&!Jy.call(t,n)||!(n in t)||!fu(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const Xt=new WeakMap,en=()=>{},it=en(),du=Object,we=e=>e===it,Wt=e=>typeof e=="function",gn=(e,t)=>({...e,...t}),Xy=e=>Wt(e.then),hu={},Vo={},pu="undefined",Si=typeof window!=pu,mu=typeof document!=pu,zL=Si&&"Deno"in window,HL=()=>Si&&typeof window.requestAnimationFrame!=pu,ev=(e,t)=>{const n=Xt.get(e);return[()=>!we(t)&&e.get(t)||hu,r=>{if(!we(t)){const i=e.get(t);t in Vo||(Vo[t]=i),n[5](t,gn(i,r),i||hu)}},n[6],()=>!we(t)&&t in Vo?Vo[t]:!we(t)&&e.get(t)||hu]};let gu=!0;const UL=()=>gu,[yu,vu]=Si&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[en,en],jL=()=>{const e=mu&&document.visibilityState;return we(e)||e!=="hidden"},VL=e=>(mu&&document.addEventListener("visibilitychange",e),yu("focus",e),()=>{mu&&document.removeEventListener("visibilitychange",e),vu("focus",e)}),WL=e=>{const t=()=>{gu=!0,e()},n=()=>{gu=!1};return yu("online",t),yu("offline",n),()=>{vu("online",t),vu("offline",n)}},qL={isOnline:UL,isVisible:jL},YL={initFocus:VL,initReconnect:WL},tv=!D.useId,gr=!Si||zL,KL=e=>HL()?window.requestAnimationFrame(e):setTimeout(e,1),bu=gr?D.useEffect:D.useLayoutEffect,wu=typeof navigator<"u"&&navigator.connection,nv=!gr&&wu&&(["slow-2g","2g"].includes(wu.effectiveType)||wu.saveData),Wo=new WeakMap,GL=e=>du.prototype.toString.call(e),Su=(e,t)=>e===`[object ${t}]`;let QL=0;const ku=e=>{const t=typeof e,n=GL(e),r=Su(n,"Date"),i=Su(n,"RegExp"),o=Su(n,"Object");let s,a;if(du(e)===e&&!r&&!i){if(s=Wo.get(e),s)return s;if(s=++QL+"~",Wo.set(e,s),Array.isArray(e)){for(s="@",a=0;a<e.length;a++)s+=ku(e[a])+",";Wo.set(e,s)}if(o){s="#";const l=du.keys(e).sort();for(;!we(a=l.pop());)we(e[a])||(s+=a+":"+ku(e[a])+",");Wo.set(e,s)}}else s=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return s},xu=e=>{if(Wt(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?ku(e):"",[e,t]};let ZL=0;const Eu=()=>++ZL;async function rv(...e){const[t,n,r,i]=e,o=gn({populateCache:!0,throwOnError:!0},typeof i=="boolean"?{revalidate:i}:i||{});let s=o.populateCache;const a=o.rollbackOnError;let l=o.optimisticData;const u=h=>typeof a=="function"?a(h):a!==!1,f=o.throwOnError;if(Wt(n)){const h=n,d=[],m=t.keys();for(const p of m)!/^\$(inf|sub)\$/.test(p)&&h(t.get(p)._k)&&d.push(p);return Promise.all(d.map(c))}return c(n);async function c(h){const[d]=xu(h);if(!d)return;const[m,p]=ev(t,d),[g,y,v,w]=Xt.get(t),A=()=>{const L=g[d];return(Wt(o.revalidate)?o.revalidate(m().data,h):o.revalidate!==!1)&&(delete v[d],delete w[d],L&&L[0])?L[0](Qy).then(()=>m().data):m().data};if(e.length<3)return A();let k=r,E,I=!1;const M=Eu();y[d]=[M,0];const P=!we(l),T=m(),O=T.data,j=T._c,F=we(j)?O:j;if(P&&(l=Wt(l)?l(F,O):l,p({data:l,_c:F})),Wt(k))try{k=k(F)}catch(L){E=L,I=!0}if(k&&Xy(k))if(k=await k.catch(L=>{E=L,I=!0}),M!==y[d][0]){if(I)throw E;return k}else I&&P&&u(E)&&(s=!0,p({data:F,_c:it}));if(s&&!I)if(Wt(s)){const L=s(k,F);p({data:L,error:it,_c:it})}else p({data:k,error:it,_c:it});if(y[d][1]=Eu(),Promise.resolve(A()).then(()=>{p({_c:it})}),I){if(f)throw E;return}return k}}const iv=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},JL=(e,t)=>{if(!Xt.has(e)){const n=gn(YL,t),r=Object.create(null),i=rv.bind(it,e);let o=en;const s=Object.create(null),a=(f,c)=>{const h=s[f]||[];return s[f]=h,h.push(c),()=>h.splice(h.indexOf(c),1)},l=(f,c,h)=>{e.set(f,c);const d=s[f];if(d)for(const m of d)m(c,h)},u=()=>{if(!Xt.has(e)&&(Xt.set(e,[r,Object.create(null),Object.create(null),Object.create(null),i,l,a]),!gr)){const f=n.initFocus(setTimeout.bind(it,iv.bind(it,r,Ky))),c=n.initReconnect(setTimeout.bind(it,iv.bind(it,r,Gy)));o=()=>{f&&f(),c&&c(),Xt.delete(e)}}};return u(),[e,i,u,o]}return[e,Xt.get(e)[4]]},XL=(e,t,n,r,i)=>{const o=n.errorRetryCount,s=i.retryCount,a=~~((Math.random()+.5)*(1<<(s<8?s:8)))*n.errorRetryInterval;!we(o)&&s>o||setTimeout(r,a,i)},e_=fu,[ov,t_]=JL(new Map),n_=gn({onLoadingSlow:en,onSuccess:en,onError:en,onErrorRetry:XL,onDiscarded:en,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:nv?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:nv?5e3:3e3,compare:e_,isPaused:()=>!1,cache:ov,mutate:t_,fallback:{}},qL),r_=(e,t)=>{const n=gn(e,t);if(t){const{use:r,fallback:i}=e,{use:o,fallback:s}=t;r&&o&&(n.use=r.concat(o)),i&&s&&(n.fallback=gn(i,s))}return n},i_=D.createContext({}),o_="$inf$",sv=Si&&window.__SWR_DEVTOOLS_USE__,s_=sv?window.__SWR_DEVTOOLS_USE__:[],a_=()=>{sv&&(window.__SWR_DEVTOOLS_REACT__=D)},l_=e=>Wt(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],u_=()=>{const e=D.useContext(i_);return D.useMemo(()=>gn(n_,e),[e])},c_=e=>(t,n,r)=>e(t,n&&((...o)=>{const[s]=xu(t),[,,,a]=Xt.get(ov);if(s.startsWith(o_))return n(...o);const l=a[s];return we(l)?n(...o):(delete a[s],l)}),r),f_=s_.concat(c_),d_=e=>function(...n){const r=u_(),[i,o,s]=l_(n),a=r_(r,s);let l=e;const{use:u}=a,f=(u||[]).concat(f_);for(let c=f.length;c--;)l=f[c](l);return l(i,o||a.fetcher||null,a)},h_=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const i=r.indexOf(n);i>=0&&(r[i]=r[r.length-1],r.pop())}};a_();const Cu=D.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),Au={dedupe:!0},av=Promise.resolve(it),p_=()=>en,m_=d_((e,t,n)=>{const{cache:r,compare:i,suspense:o,fallbackData:s,revalidateOnMount:a,revalidateIfStale:l,refreshInterval:u,refreshWhenHidden:f,refreshWhenOffline:c,keepPreviousData:h,strictServerPrefetchWarning:d}=n,[m,p,g,y]=Xt.get(r),[v,w]=xu(e),A=D.useRef(!1),k=D.useRef(!1),E=D.useRef(v),I=D.useRef(t),M=D.useRef(n),P=()=>M.current,T=()=>P().isVisible()&&P().isOnline(),[O,j,F,L]=ev(r,v),_=D.useRef({}).current,B=we(s)?we(n.fallback)?it:n.fallback[v]:s,z=(G,ue)=>{for(const de in _){const fe=de;if(fe==="data"){if(!i(G[fe],ue[fe])&&(!we(G[fe])||!i(K,ue[fe])))return!1}else if(ue[fe]!==G[fe])return!1}return!0},H=!A.current,W=D.useMemo(()=>{const G=O(),ue=L(),de=De=>{const Ue=gn(De);return delete Ue._k,(()=>{if(!v||!t||P().isPaused())return!1;if(H&&!we(a))return a;const ae=we(B)?Ue.data:B;return we(ae)||l})()?{isValidating:!0,isLoading:!0,...Ue}:Ue},fe=de(G),Te=G===ue?fe:de(ue);let Fe=fe;return[()=>{const De=de(O());return z(De,Fe)?(Fe.data=De.data,Fe.isLoading=De.isLoading,Fe.isValidating=De.isValidating,Fe.error=De.error,Fe):(Fe=De,De)},()=>Te]},[r,v]),b=ls.useSyncExternalStore(D.useCallback(G=>F(v,(ue,de)=>{z(de,ue)||G()}),[r,v]),W[0],W[1]),N=m[v]&&m[v].length>0,R=b.data,S=we(R)?B&&Xy(B)?Cu(B):B:R,V=b.error,ee=D.useRef(S),K=h?we(R)?we(ee.current)?S:ee.current:R:S,Q=v&&we(S),X=D.useRef(null);!gr&&ls.useSyncExternalStore(p_,()=>(X.current=!1,X),()=>(X.current=!0,X));const se=X.current;d&&se&&!o&&Q&&console.warn(`Missing pre-initiated data for serialized key "${v}" during server-side rendering. Data fetching should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);const Y=!v||!t||P().isPaused()||N&&!we(V)?!1:H&&!we(a)?a:o?we(S)?!1:l:we(S)||l,re=we(b.isValidating)?Y:b.isValidating,$=we(b.isLoading)?Y:b.isLoading,ne=D.useCallback(async G=>{const ue=I.current;if(!v||!ue||k.current||P().isPaused())return!1;let de,fe,Te=!0;const Fe=G||{},De=!g[v]||!Fe.dedupe,Ue=()=>tv?!k.current&&v===E.current&&A.current:v===E.current,te={isValidating:!1,isLoading:!1},ae=()=>{j(te)},U=()=>{const oe=g[v];oe&&oe[1]===fe&&delete g[v]},q={isValidating:!0};we(O().data)&&(q.isLoading=!0);try{if(De&&(j(q),n.loadingTimeout&&we(O().data)&&setTimeout(()=>{Te&&Ue()&&P().onLoadingSlow(v,n)},n.loadingTimeout),g[v]=[ue(w),Eu()]),[de,fe]=g[v],de=await de,De&&setTimeout(U,n.dedupingInterval),!g[v]||g[v][1]!==fe)return De&&Ue()&&P().onDiscarded(v),!1;te.error=it;const oe=p[v];if(!we(oe)&&(fe<=oe[0]||fe<=oe[1]||oe[1]===0))return ae(),De&&Ue()&&P().onDiscarded(v),!1;const le=O().data;te.data=i(le,de)?le:de,De&&Ue()&&P().onSuccess(de,v,n)}catch(oe){U();const le=P(),{shouldRetryOnError:pe}=le;le.isPaused()||(te.error=oe,De&&Ue()&&(le.onError(oe,v,le),(pe===!0||Wt(pe)&&pe(oe))&&(!P().revalidateOnFocus||!P().revalidateOnReconnect||T())&&le.onErrorRetry(oe,v,le,je=>{const Qe=m[v];Qe&&Qe[0]&&Qe[0](Zy,je)},{retryCount:(Fe.retryCount||0)+1,dedupe:!0})))}return Te=!1,ae(),!0},[v,r]),he=D.useCallback((...G)=>rv(r,E.current,...G),[]);if(bu(()=>{I.current=t,M.current=n,we(R)||(ee.current=R)}),bu(()=>{if(!v)return;const G=ne.bind(it,Au);let ue=0;P().revalidateOnFocus&&(ue=Date.now()+P().focusThrottleInterval);const fe=h_(v,m,(Te,Fe={})=>{if(Te==Ky){const De=Date.now();P().revalidateOnFocus&&De>ue&&T()&&(ue=De+P().focusThrottleInterval,G())}else if(Te==Gy)P().revalidateOnReconnect&&T()&&G();else{if(Te==Qy)return ne();if(Te==Zy)return ne(Fe)}});return k.current=!1,E.current=v,A.current=!0,j({_k:w}),Y&&(g[v]||(we(S)||gr?G():KL(G))),()=>{k.current=!0,fe()}},[v]),bu(()=>{let G;function ue(){const fe=Wt(u)?u(O().data):u;fe&&G!==-1&&(G=setTimeout(de,fe))}function de(){!O().error&&(f||P().isVisible())&&(c||P().isOnline())?ne(Au).then(ue):ue()}return ue(),()=>{G&&(clearTimeout(G),G=-1)}},[u,f,c,v]),D.useDebugValue(K),o){if(!tv&&gr&&Q)throw new Error("Fallback data is required when using Suspense in SSR.");Q&&(I.current=t,M.current=n,k.current=!1);const G=y[v],ue=!we(G)&&Q?he(G):av;if(Cu(ue),!we(V)&&Q)throw V;const de=Q?ne(Au):av;!we(K)&&Q&&(de.status="fulfilled",de.value=!0),Cu(de)}return{mutate:he,get data(){return _.data=!0,K},get error(){return _.error=!0,V},get isValidating(){return _.isValidating=!0,re},get isLoading(){return _.isLoading=!0,$}}});function lv({userCredentials:e,listConversations:t,clientId:n}){const r=!!e&&n&&t,{data:i,error:o,isValidating:s,mutate:a}=m_(r?[n,"conversations",e==null?void 0:e.userId]:null,async()=>(await t({})).conversations.filter(g_).sort((u,f)=>new Date(f.updatedAt).getTime()-new Date(u.updatedAt).getTime()).map(u=>({...u,lastMessage:{...u.lastMessage,author:{type:u.lastMessage.userId===(e==null?void 0:e.userId)?"user":"bot"}}})),{revalidateOnFocus:!1,revalidateOnReconnect:!0,dedupingInterval:2e3});return{conversations:i??[],isLoading:s,error:o&&Rr(o),refresh:async()=>await a()}}const g_=e=>!!e.lastMessage,y_=e=>e==null||e.length===0?"":e.charAt(0).toUpperCase()+e.slice(1),Tu=({className:e,onConversationClick:t,onNewConversation:n,onClose:r,currentConversationId:i,isLoading:o,conversations:s,botAvatar:a,botName:l,...u})=>{const{conversationHistory:f}=ye,c=Ye();return x.jsxs("div",{...u,...f.container,className:ur(f.container.className,e),children:[x.jsxs("div",{...f.header,children:[c["conversationHistory.title"],r&&x.jsx("div",{...f.closeButton,children:x.jsx(su,{onClick:r})})]}),o?x.jsx("div",{...f.loaderContainer,children:x.jsx(Fy,{})}):x.jsx("div",{...f.scrollContainer,children:s.length===0?x.jsx("div",{...f.loaderContainer,children:c["conversationHistory.empty"]}):s.map(({id:h,lastMessage:d})=>{let m="";if(d.payload.type==="text")m=d.payload.text;else if(d.payload.type==="bloc"&&d.payload.items.some(p=>p.type==="text")){const p=d.payload.items.find(g=>g.type==="text");m=(p==null?void 0:p.payload.text)??""}else m=c["conversationHistory.sentAttachment"];return x.jsxs("button",{...f.conversation.container,onClick:()=>t==null?void 0:t(h),"data-active":i===h?"":void 0,children:[d.author.type==="bot"?x.jsx(Cn,{userId:d.userId,src:a,...f.conversation.avatar,children:l??c["header.defaultBotName"]}):x.jsx(Cn,{userId:d.userId,...f.conversation.avatar,fallback:f.conversation.userAvatar.className,children:x.jsx(hT,{strokeWidth:1.5})}),x.jsxs("div",{...f.conversation.content,children:[x.jsx("span",{...f.conversation.name,children:m}),x.jsx("span",{...f.conversation.timestamp,children:y_(M0(d.createdAt))})]}),x.jsx(mp,{strokeWidth:1.5,...f.conversation.chevron})]},h)})}),x.jsxs("button",{...f.newConversation.button,onClick:n,children:[x.jsx(uT,{...f.newConversation.icon}),c["conversationHistory.newConversation"]]})]})};Tu.displayName="ConversationHistory";const uv=({connected:e,configuration:t,isTyping:n,messages:r,user:i,isLoading:o,renderers:s,isReadOnly:a,disableComposer:l,error:u,participants:f,closeWindow:c,sendMessage:h,uploadFile:d,addMessageFeedback:m,listConversations:p,restartConversation:g,clientId:y,storageKey:v,soundOn:w,toggleSound:A,disableSendButton:k,conversationId:E,locale:I,isOpen:M,...P})=>{const{color:T,fontFamily:O,radius:j,themeMode:F,variant:L,headerVariant:_,botAvatar:B,botDescription:z,botName:H,composerPlaceholder:W,footer:b,feedbackEnabled:N,additionalStylesheet:R,additionalStylesheetUrl:S,allowFileUpload:V,conversationHistory:ee}=t,K={color:T,fontFamily:O,radius:j,themeMode:F,variant:L,headerVariant:_,additionalStylesheet:R,additionalStylesheetUrl:S},[Q,X]=D.useState("chat"),se=lv({clientId:y,listConversations:p,userCredentials:i});D.useEffect(()=>{Q==="conversations"&&se.refresh()},[Q]),N||(m=void 0);const Y=D.useMemo(()=>i?cc(r,f,i.userId,H,B):[],[B,H,r,i,f]),re=D.useMemo(()=>{var G,ue;return((ue=(G=r.at(-1))==null?void 0:G.metadata)==null?void 0:ue.conversationStatus)==="closed"},[r]),$=D.useRef(null),ne=Jn(G=>G.setPortalContainer);D.useEffect(()=>(ne($.current),()=>{ne(null)}),[ne]);const he=I?JSON.stringify(I):void 0,Ce=D.useMemo(()=>he?{...Rn,...JSON.parse(he)}:uc(),[he]);return x.jsxs(Rp,{value:Ce,children:[x.jsx(Vg,{...K}),x.jsx("div",{ref:$,style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none",zIndex:10}}),x.jsx(tu,{connected:e,allowFileUpload:V,uploadFile:d,storageKey:v,conversationId:E,...P,children:u||se.error?x.jsx(Ry,{error:u||se.error,restartConversation:g,closeWindow:c}):Q==="conversations"?x.jsx(Tu,{onClose:c,conversations:se.conversations,isLoading:se.isLoading,onNewConversation:()=>{g==null||g(),X("chat")},onConversationClick:G=>{g==null||g(G),X("chat")},botAvatar:B,botName:H}):x.jsxs(x.Fragment,{children:[x.jsx(_y,{showConversationHistory:ee?()=>X("conversations"):void 0,closeWindow:c,configuration:t,restartConversation:g,clientId:y,soundOn:w,toggleSound:A}),o?x.jsx(Fy,{}):x.jsx(cu,{botAvatar:B,botDescription:z,botName:H,renderers:s,isTyping:n,sendMessage:h,addMessageFeedback:m,messages:Y,isOpen:M},E),!re&&x.jsx(cg,{sendMessage:h,uploadFile:d,connected:e,isReadOnly:a,disableComposer:l,footer:b,composerPlaceholder:W,allowFileUpload:V,storageKey:v,disableSendButton:k,conversationId:E})]})})]})};function v_({configuration:e,storageKey:t,clientId:n,...r}){const i=t||`bp-webchat-${n}`,{messages:o,participants:s,sendMessage:a,uploadFile:l,saveMessageFeedback:u,conversationId:f,status:c,error:h,isTyping:d,isAwaitingResponse:m}=qy(),{openConversation:p,listConversations:g}=Yy(),{userCredentials:y}=Wy(),{soundOn:v,toggleSound:w}=Vy({storageKey:i,soundEnabled:e==null?void 0:e.soundEnabled});return x.jsx(uv,{configuration:e??{},user:y,isLoading:c==="connecting",isTyping:d,connected:c==="connected"?!0:c==="disconnected"?!1:void 0,messages:o,sendMessage:a,uploadFile:l,addMessageFeedback:u,listConversations:g,restartConversation:p,participants:s,error:h,clientId:n,soundOn:v,toggleSound:w,disableSendButton:m,conversationId:f,storageKey:i,...r})}const b_=({clientId:e,storageKey:t,configuration:n,apiUrl:r,user:i,conversationId:o,...s})=>{const a=t||`bp-webchat-${e}`;return x.jsx(Cy,{clientId:e,apiUrl:r,userCredentials:i,conversationId:o,storageKey:a,storageLocation:n==null?void 0:n.storageLocation,adminSecret:n==null?void 0:n.adminSecret,children:x.jsx(v_,{configuration:n,storageKey:t,clientId:e,...s})})};function w_(e,t=globalThis==null?void 0:globalThis.document){const n=Fn(e);C.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var S_="DismissableLayer",Iu="dismissableLayer.update",k_="dismissableLayer.pointerDownOutside",x_="dismissableLayer.focusOutside",cv,fv=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),dv=C.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,onDismiss:a,...l}=e,u=C.useContext(fv),[f,c]=C.useState(null),h=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,d]=C.useState({}),m=nn(t,I=>c(I)),p=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=p.indexOf(g),v=f?p.indexOf(f):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,A=v>=y,k=A_(I=>{const M=I.target,P=[...u.branches].some(T=>T.contains(M));!A||P||(i==null||i(I),s==null||s(I),I.defaultPrevented||a==null||a())},h),E=T_(I=>{const M=I.target;[...u.branches].some(T=>T.contains(M))||(o==null||o(I),s==null||s(I),I.defaultPrevented||a==null||a())},h);return w_(I=>{v===u.layers.size-1&&(r==null||r(I),!I.defaultPrevented&&a&&(I.preventDefault(),a()))},h),C.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(cv=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),hv(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=cv)}},[f,h,n,u]),C.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),hv())},[f,u]),C.useEffect(()=>{const I=()=>d({});return document.addEventListener(Iu,I),()=>document.removeEventListener(Iu,I)},[]),x.jsx(Rt.div,{...l,ref:m,style:{pointerEvents:w?A?"auto":"none":void 0,...e.style},onFocusCapture:Jt(e.onFocusCapture,E.onFocusCapture),onBlurCapture:Jt(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Jt(e.onPointerDownCapture,k.onPointerDownCapture)})});dv.displayName=S_;var E_="DismissableLayerBranch",C_=C.forwardRef((e,t)=>{const n=C.useContext(fv),r=C.useRef(null),i=nn(t,r);return C.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),x.jsx(Rt.div,{...e,ref:i})});C_.displayName=E_;function A_(e,t=globalThis==null?void 0:globalThis.document){const n=Fn(e),r=C.useRef(!1),i=C.useRef(()=>{});return C.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let l=function(){pv(k_,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=l,t.addEventListener("click",i.current,{once:!0})):l()}else t.removeEventListener("click",i.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function T_(e,t=globalThis==null?void 0:globalThis.document){const n=Fn(e),r=C.useRef(!1);return C.useEffect(()=>{const i=o=>{o.target&&!r.current&&pv(x_,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function hv(){const e=new CustomEvent(Iu);document.dispatchEvent(e)}function pv(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?gL(i,o):i.dispatchEvent(o)}var Ou="focusScope.autoFocusOnMount",Du="focusScope.autoFocusOnUnmount",mv={bubbles:!1,cancelable:!0},I_="FocusScope",gv=C.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[a,l]=C.useState(null),u=Fn(i),f=Fn(o),c=C.useRef(null),h=nn(t,p=>l(p)),d=C.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.useEffect(()=>{if(r){let p=function(w){if(d.paused||!a)return;const A=w.target;a.contains(A)?c.current=A:yn(c.current,{select:!0})},g=function(w){if(d.paused||!a)return;const A=w.relatedTarget;A!==null&&(a.contains(A)||yn(c.current,{select:!0}))},y=function(w){if(document.activeElement===document.body)for(const k of w)k.removedNodes.length>0&&yn(a)};document.addEventListener("focusin",p),document.addEventListener("focusout",g);const v=new MutationObserver(y);return a&&v.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",g),v.disconnect()}}},[r,a,d.paused]),C.useEffect(()=>{if(a){bv.add(d);const p=document.activeElement;if(!a.contains(p)){const y=new CustomEvent(Ou,mv);a.addEventListener(Ou,u),a.dispatchEvent(y),y.defaultPrevented||(O_(__(yv(a)),{select:!0}),document.activeElement===p&&yn(a))}return()=>{a.removeEventListener(Ou,u),setTimeout(()=>{const y=new CustomEvent(Du,mv);a.addEventListener(Du,f),a.dispatchEvent(y),y.defaultPrevented||yn(p??document.body,{select:!0}),a.removeEventListener(Du,f),bv.remove(d)},0)}}},[a,u,f,d]);const m=C.useCallback(p=>{if(!n&&!r||d.paused)return;const g=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,y=document.activeElement;if(g&&y){const v=p.currentTarget,[w,A]=D_(v);w&&A?!p.shiftKey&&y===A?(p.preventDefault(),n&&yn(w,{select:!0})):p.shiftKey&&y===w&&(p.preventDefault(),n&&yn(A,{select:!0})):y===v&&p.preventDefault()}},[n,r,d.paused]);return x.jsx(Rt.div,{tabIndex:-1,...s,ref:h,onKeyDown:m})});gv.displayName=I_;function O_(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(yn(r,{select:t}),document.activeElement!==n)return}function D_(e){const t=yv(e),n=vv(t,e),r=vv(t.reverse(),e);return[n,r]}function yv(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function vv(e,t){for(const n of e)if(!M_(n,{upTo:t}))return n}function M_(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 N_(e){return e instanceof HTMLInputElement&&"select"in e}function yn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&N_(e)&&t&&e.select()}}var bv=L_();function L_(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=wv(e,t),e.unshift(t)},remove(t){var n;e=wv(e,t),(n=e[0])==null||n.resume()}}}function wv(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function __(e){return e.filter(t=>t.tagName!=="A")}var Mu=0;function P_(){C.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Sv()),document.body.insertAdjacentElement("beforeend",e[1]??Sv()),Mu++,()=>{Mu===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Mu--}},[])}function Sv(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var qo="right-scroll-bar-position",Yo="width-before-scroll-bar",F_="with-scroll-bars-hidden",R_="--removed-body-scroll-bar-size";function Nu(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function B_(e,t){var n=D.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var $_=typeof window<"u"?C.useLayoutEffect:C.useEffect,kv=new WeakMap;function z_(e,t){var n=B_(null,function(r){return e.forEach(function(i){return Nu(i,r)})});return $_(function(){var r=kv.get(n);if(r){var i=new Set(r),o=new Set(e),s=n.current;i.forEach(function(a){o.has(a)||Nu(a,null)}),o.forEach(function(a){i.has(a)||Nu(a,s)})}kv.set(n,e)},[e]),n}function H_(e){return e}function U_(e,t){t===void 0&&(t=H_);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var s=t(o,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(o){for(r=!0;n.length;){var s=n;n=[],s.forEach(o)}n={push:function(a){return o(a)},filter:function(){return n}}},assignMedium:function(o){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(o),s=n}var l=function(){var f=s;s=[],f.forEach(o)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(f){s.push(f),u()},filter:function(f){return s=s.filter(f),n}}}};return i}function j_(e){e===void 0&&(e={});var t=U_(null);return t.options=xt({async:!0,ssr:!1},e),t}var xv=function(e){var t=e.sideCar,n=zp(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return C.createElement(r,xt({},n))};xv.isSideCarExport=!0;function V_(e,t){return e.useMedium(t),xv}var Ev=j_(),Lu=function(){},Ko=C.forwardRef(function(e,t){var n=C.useRef(null),r=C.useState({onScrollCapture:Lu,onWheelCapture:Lu,onTouchMoveCapture:Lu}),i=r[0],o=r[1],s=e.forwardProps,a=e.children,l=e.className,u=e.removeScrollBar,f=e.enabled,c=e.shards,h=e.sideCar,d=e.noRelative,m=e.noIsolation,p=e.inert,g=e.allowPinchZoom,y=e.as,v=y===void 0?"div":y,w=e.gapMode,A=zp(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=h,E=z_([n,t]),I=xt(xt({},A),i);return C.createElement(C.Fragment,null,f&&C.createElement(k,{sideCar:Ev,removeScrollBar:u,shards:c,noRelative:d,noIsolation:m,inert:p,setCallbacks:o,allowPinchZoom:!!g,lockRef:n,gapMode:w}),s?C.cloneElement(C.Children.only(a),xt(xt({},I),{ref:E})):C.createElement(v,xt({},I,{className:l,ref:E}),a))});Ko.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Ko.classNames={fullWidth:Yo,zeroRight:qo};var W_=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function q_(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=W_();return t&&e.setAttribute("nonce",t),e}function Y_(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function K_(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var G_=function(){var e=0,t=null;return{add:function(n){e==0&&(t=q_())&&(Y_(t,n),K_(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Q_=function(){var e=G_();return function(t,n){C.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Cv=function(){var e=Q_(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},Z_={left:0,top:0,right:0,gap:0},_u=function(e){return parseInt(e||"",10)||0},J_=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[_u(n),_u(r),_u(i)]},X_=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Z_;var t=J_(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])}},e2=Cv(),yr="data-scroll-locked",t2=function(e,t,n,r){var i=e.left,o=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
324
+ .`.concat(F_,` {
325
325
  overflow: hidden `).concat(r,`;
326
326
  padding-right: `).concat(a,"px ").concat(r,`;
327
327
  }
@@ -355,13 +355,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
355
355
  }
356
356
 
357
357
  body[`).concat(yr,`] {
358
- `).concat(P_,": ").concat(a,`px;
358
+ `).concat(R_,": ").concat(a,`px;
359
359
  }
360
- `)},Av=function(){var e=parseInt(document.body.getAttribute(yr)||"0",10);return isFinite(e)?e:0},e2=function(){C.useEffect(function(){return document.body.setAttribute(yr,(Av()+1).toString()),function(){var e=Av()-1;e<=0?document.body.removeAttribute(yr):document.body.setAttribute(yr,e.toString())}},[])},t2=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;e2();var o=C.useMemo(function(){return Z_(i)},[i]);return C.createElement(J_,{styles:X_(o,!t,i,n?"":"!important")})},Pu=!1;if(typeof window<"u")try{var Go=Object.defineProperty({},"passive",{get:function(){return Pu=!0,!0}});window.addEventListener("test",Go,Go),window.removeEventListener("test",Go,Go)}catch{Pu=!1}var vr=Pu?{passive:!1}:!1,n2=function(e){return e.tagName==="TEXTAREA"},Tv=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!n2(e)&&n[t]==="visible")},r2=function(e){return Tv(e,"overflowY")},i2=function(e){return Tv(e,"overflowX")},Iv=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=Ov(e,r);if(i){var o=Dv(e,r),s=o[1],a=o[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},o2=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},s2=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Ov=function(e,t){return e==="v"?r2(t):i2(t)},Dv=function(e,t){return e==="v"?o2(t):s2(t)},a2=function(e,t){return e==="h"&&t==="rtl"?-1:1},l2=function(e,t,n,r,i){var o=a2(e,window.getComputedStyle(t).direction),s=o*r,a=n.target,l=t.contains(a),u=!1,f=s>0,c=0,h=0;do{if(!a)break;var d=Dv(e,a),m=d[0],p=d[1],g=d[2],v=p-g-o*m;(m||v)&&Ov(e,a)&&(c+=v,h+=m);var y=a.parentNode;a=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(f&&Math.abs(c)<1||!f&&Math.abs(h)<1)&&(u=!0),u},Qo=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Mv=function(e){return[e.deltaX,e.deltaY]},Nv=function(e){return e&&"current"in e?e.current:e},u2=function(e,t){return e[0]===t[0]&&e[1]===t[1]},c2=function(e){return`
360
+ `)},Av=function(){var e=parseInt(document.body.getAttribute(yr)||"0",10);return isFinite(e)?e:0},n2=function(){C.useEffect(function(){return document.body.setAttribute(yr,(Av()+1).toString()),function(){var e=Av()-1;e<=0?document.body.removeAttribute(yr):document.body.setAttribute(yr,e.toString())}},[])},r2=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;n2();var o=C.useMemo(function(){return X_(i)},[i]);return C.createElement(e2,{styles:t2(o,!t,i,n?"":"!important")})},Pu=!1;if(typeof window<"u")try{var Go=Object.defineProperty({},"passive",{get:function(){return Pu=!0,!0}});window.addEventListener("test",Go,Go),window.removeEventListener("test",Go,Go)}catch{Pu=!1}var vr=Pu?{passive:!1}:!1,i2=function(e){return e.tagName==="TEXTAREA"},Tv=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!i2(e)&&n[t]==="visible")},o2=function(e){return Tv(e,"overflowY")},s2=function(e){return Tv(e,"overflowX")},Iv=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=Ov(e,r);if(i){var o=Dv(e,r),s=o[1],a=o[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},a2=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},l2=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Ov=function(e,t){return e==="v"?o2(t):s2(t)},Dv=function(e,t){return e==="v"?a2(t):l2(t)},u2=function(e,t){return e==="h"&&t==="rtl"?-1:1},c2=function(e,t,n,r,i){var o=u2(e,window.getComputedStyle(t).direction),s=o*r,a=n.target,l=t.contains(a),u=!1,f=s>0,c=0,h=0;do{if(!a)break;var d=Dv(e,a),m=d[0],p=d[1],g=d[2],y=p-g-o*m;(m||y)&&Ov(e,a)&&(c+=y,h+=m);var v=a.parentNode;a=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(f&&Math.abs(c)<1||!f&&Math.abs(h)<1)&&(u=!0),u},Qo=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Mv=function(e){return[e.deltaX,e.deltaY]},Nv=function(e){return e&&"current"in e?e.current:e},f2=function(e,t){return e[0]===t[0]&&e[1]===t[1]},d2=function(e){return`
361
361
  .block-interactivity-`.concat(e,` {pointer-events: none;}
362
362
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
363
- `)},f2=0,br=[];function d2(e){var t=C.useRef([]),n=C.useRef([0,0]),r=C.useRef(),i=C.useState(f2++)[0],o=C.useState(Cv)[0],s=C.useRef(e);C.useEffect(function(){s.current=e},[e]),C.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var p=Qa([e.lockRef.current],(e.shards||[]).map(Nv),!0).filter(Boolean);return p.forEach(function(g){return g.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),p.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=C.useCallback(function(p,g){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!s.current.allowPinchZoom;var v=Qo(p),y=n.current,w="deltaX"in p?p.deltaX:y[0]-v[0],A="deltaY"in p?p.deltaY:y[1]-v[1],k,E=p.target,I=Math.abs(w)>Math.abs(A)?"h":"v";if("touches"in p&&I==="h"&&E.type==="range")return!1;var M=Iv(I,E);if(!M)return!0;if(M?k=I:(k=I==="v"?"h":"v",M=Iv(I,E)),!M)return!1;if(!r.current&&"changedTouches"in p&&(w||A)&&(r.current=k),!k)return!0;var L=r.current||k;return l2(L,g,p,L==="h"?w:A)},[]),l=C.useCallback(function(p){var g=p;if(!(!br.length||br[br.length-1]!==o)){var v="deltaY"in g?Mv(g):Qo(g),y=t.current.filter(function(k){return k.name===g.type&&(k.target===g.target||g.target===k.shadowParent)&&u2(k.delta,v)})[0];if(y&&y.should){g.cancelable&&g.preventDefault();return}if(!y){var w=(s.current.shards||[]).map(Nv).filter(Boolean).filter(function(k){return k.contains(g.target)}),A=w.length>0?a(g,w[0]):!s.current.noIsolation;A&&g.cancelable&&g.preventDefault()}}},[]),u=C.useCallback(function(p,g,v,y){var w={name:p,delta:g,target:v,should:y,shadowParent:h2(v)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(A){return A!==w})},1)},[]),f=C.useCallback(function(p){n.current=Qo(p),r.current=void 0},[]),c=C.useCallback(function(p){u(p.type,Mv(p),p.target,a(p,e.lockRef.current))},[]),h=C.useCallback(function(p){u(p.type,Qo(p),p.target,a(p,e.lockRef.current))},[]);C.useEffect(function(){return br.push(o),e.setCallbacks({onScrollCapture:c,onWheelCapture:c,onTouchMoveCapture:h}),document.addEventListener("wheel",l,vr),document.addEventListener("touchmove",l,vr),document.addEventListener("touchstart",f,vr),function(){br=br.filter(function(p){return p!==o}),document.removeEventListener("wheel",l,vr),document.removeEventListener("touchmove",l,vr),document.removeEventListener("touchstart",f,vr)}},[]);var d=e.removeScrollBar,m=e.inert;return C.createElement(C.Fragment,null,m?C.createElement(o,{styles:c2(i)}):null,d?C.createElement(t2,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function h2(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const p2=U_(Ev,d2);var Lv=C.forwardRef(function(e,t){return C.createElement(Ko,xt({},e,{ref:t,sideCar:p2}))});Lv.classNames=Ko.classNames;var m2=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},wr=new WeakMap,Zo=new WeakMap,Jo={},Fu=0,_v=function(e){return e&&(e.host||_v(e.parentNode))},g2=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=_v(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},y2=function(e,t,n,r){var i=g2(t,Array.isArray(e)?e:[e]);Jo[n]||(Jo[n]=new WeakMap);var o=Jo[n],s=[],a=new Set,l=new Set(i),u=function(c){!c||a.has(c)||(a.add(c),u(c.parentNode))};i.forEach(u);var f=function(c){!c||l.has(c)||Array.prototype.forEach.call(c.children,function(h){if(a.has(h))f(h);else try{var d=h.getAttribute(r),m=d!==null&&d!=="false",p=(wr.get(h)||0)+1,g=(o.get(h)||0)+1;wr.set(h,p),o.set(h,g),s.push(h),p===1&&m&&Zo.set(h,!0),g===1&&h.setAttribute(n,"true"),m||h.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",h,v)}})};return f(t),a.clear(),Fu++,function(){s.forEach(function(c){var h=wr.get(c)-1,d=o.get(c)-1;wr.set(c,h),o.set(c,d),h||(Zo.has(c)||c.removeAttribute(r),Zo.delete(c)),d||c.removeAttribute(n)}),Fu--,Fu||(wr=new WeakMap,wr=new WeakMap,Zo=new WeakMap,Jo={})}},v2=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=m2(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),y2(r,i,n,"aria-hidden")):function(){return null}},Xo="Dialog",[Pv]=Ty(Xo),[b2,qt]=Pv(Xo),Fv=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!0}=e,a=C.useRef(null),l=C.useRef(null),[u,f]=Iy({prop:r,defaultProp:i??!1,onChange:o,caller:Xo});return x.jsx(b2,{scope:t,triggerRef:a,contentRef:l,contentId:Uo(),titleId:Uo(),descriptionId:Uo(),open:u,onOpenChange:f,onOpenToggle:C.useCallback(()=>f(c=>!c),[f]),modal:s,children:n})};Fv.displayName=Xo;var Rv="DialogTrigger",Bv=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=qt(Rv,n),o=nn(t,i.triggerRef);return x.jsx(Rt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Bu(i.open),...r,ref:o,onClick:Jt(e.onClick,i.onOpenToggle)})});Bv.displayName=Rv;var w2="DialogPortal",[HP,$v]=Pv(w2,{forceMount:void 0}),es="DialogOverlay",S2=C.forwardRef((e,t)=>{const n=$v(es,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=qt(es,e.__scopeDialog);return o.modal?x.jsx(zo,{present:r||o.open,children:x.jsx(x2,{...i,ref:t})}):null});S2.displayName=es;var k2=Oy("DialogOverlay.RemoveScroll"),x2=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=qt(es,n);return x.jsx(Lv,{as:k2,allowPinchZoom:!0,shards:[i.contentRef],children:x.jsx(Rt.div,{"data-state":Bu(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Pn="DialogContent",zv=C.forwardRef((e,t)=>{const n=$v(Pn,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=qt(Pn,e.__scopeDialog);return x.jsx(zo,{present:r||o.open,children:o.modal?x.jsx(E2,{...i,ref:t}):x.jsx(C2,{...i,ref:t})})});zv.displayName=Pn;var E2=C.forwardRef((e,t)=>{const n=qt(Pn,e.__scopeDialog),r=C.useRef(null),i=nn(t,n.contentRef,r);return C.useEffect(()=>{const o=r.current;if(o)return v2(o)},[]),x.jsx(Hv,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Jt(e.onCloseAutoFocus,o=>{var s;o.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:Jt(e.onPointerDownOutside,o=>{const s=o.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&o.preventDefault()}),onFocusOutside:Jt(e.onFocusOutside,o=>o.preventDefault())})}),C2=C.forwardRef((e,t)=>{const n=qt(Pn,e.__scopeDialog),r=C.useRef(!1),i=C.useRef(!1);return x.jsx(Hv,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,o),o.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=o.target;((u=n.triggerRef.current)==null?void 0:u.contains(s))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),Hv=C.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...s}=e,a=qt(Pn,n),l=C.useRef(null),u=nn(t,l);return L_(),x.jsxs(x.Fragment,{children:[x.jsx(gv,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:x.jsx(dv,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Bu(a.open),...s,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),x.jsxs(x.Fragment,{children:[x.jsx(A2,{titleId:a.titleId}),x.jsx(I2,{contentRef:l,descriptionId:a.descriptionId})]})]})}),Ru="DialogTitle",Uv=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=qt(Ru,n);return x.jsx(Rt.h2,{id:i.titleId,...r,ref:t})});Uv.displayName=Ru;var jv="DialogDescription",Vv=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=qt(jv,n);return x.jsx(Rt.p,{id:i.descriptionId,...r,ref:t})});Vv.displayName=jv;var Wv="DialogClose",qv=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=qt(Wv,n);return x.jsx(Rt.button,{type:"button",...r,ref:t,onClick:Jt(e.onClick,()=>i.onOpenChange(!1))})});qv.displayName=Wv;function Bu(e){return e?"open":"closed"}var Yv="DialogTitleWarning",[UP,Kv]=oL(Yv,{contentName:Pn,titleName:Ru,docsSlug:"dialog"}),A2=({titleId:e})=>{const t=Kv(Yv),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
363
+ `)},h2=0,br=[];function p2(e){var t=C.useRef([]),n=C.useRef([0,0]),r=C.useRef(),i=C.useState(h2++)[0],o=C.useState(Cv)[0],s=C.useRef(e);C.useEffect(function(){s.current=e},[e]),C.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var p=Qa([e.lockRef.current],(e.shards||[]).map(Nv),!0).filter(Boolean);return p.forEach(function(g){return g.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),p.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=C.useCallback(function(p,g){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!s.current.allowPinchZoom;var y=Qo(p),v=n.current,w="deltaX"in p?p.deltaX:v[0]-y[0],A="deltaY"in p?p.deltaY:v[1]-y[1],k,E=p.target,I=Math.abs(w)>Math.abs(A)?"h":"v";if("touches"in p&&I==="h"&&E.type==="range")return!1;var M=Iv(I,E);if(!M)return!0;if(M?k=I:(k=I==="v"?"h":"v",M=Iv(I,E)),!M)return!1;if(!r.current&&"changedTouches"in p&&(w||A)&&(r.current=k),!k)return!0;var P=r.current||k;return c2(P,g,p,P==="h"?w:A)},[]),l=C.useCallback(function(p){var g=p;if(!(!br.length||br[br.length-1]!==o)){var y="deltaY"in g?Mv(g):Qo(g),v=t.current.filter(function(k){return k.name===g.type&&(k.target===g.target||g.target===k.shadowParent)&&f2(k.delta,y)})[0];if(v&&v.should){g.cancelable&&g.preventDefault();return}if(!v){var w=(s.current.shards||[]).map(Nv).filter(Boolean).filter(function(k){return k.contains(g.target)}),A=w.length>0?a(g,w[0]):!s.current.noIsolation;A&&g.cancelable&&g.preventDefault()}}},[]),u=C.useCallback(function(p,g,y,v){var w={name:p,delta:g,target:y,should:v,shadowParent:m2(y)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(A){return A!==w})},1)},[]),f=C.useCallback(function(p){n.current=Qo(p),r.current=void 0},[]),c=C.useCallback(function(p){u(p.type,Mv(p),p.target,a(p,e.lockRef.current))},[]),h=C.useCallback(function(p){u(p.type,Qo(p),p.target,a(p,e.lockRef.current))},[]);C.useEffect(function(){return br.push(o),e.setCallbacks({onScrollCapture:c,onWheelCapture:c,onTouchMoveCapture:h}),document.addEventListener("wheel",l,vr),document.addEventListener("touchmove",l,vr),document.addEventListener("touchstart",f,vr),function(){br=br.filter(function(p){return p!==o}),document.removeEventListener("wheel",l,vr),document.removeEventListener("touchmove",l,vr),document.removeEventListener("touchstart",f,vr)}},[]);var d=e.removeScrollBar,m=e.inert;return C.createElement(C.Fragment,null,m?C.createElement(o,{styles:d2(i)}):null,d?C.createElement(r2,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function m2(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const g2=V_(Ev,p2);var Lv=C.forwardRef(function(e,t){return C.createElement(Ko,xt({},e,{ref:t,sideCar:g2}))});Lv.classNames=Ko.classNames;var y2=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},wr=new WeakMap,Zo=new WeakMap,Jo={},Fu=0,_v=function(e){return e&&(e.host||_v(e.parentNode))},v2=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=_v(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},b2=function(e,t,n,r){var i=v2(t,Array.isArray(e)?e:[e]);Jo[n]||(Jo[n]=new WeakMap);var o=Jo[n],s=[],a=new Set,l=new Set(i),u=function(c){!c||a.has(c)||(a.add(c),u(c.parentNode))};i.forEach(u);var f=function(c){!c||l.has(c)||Array.prototype.forEach.call(c.children,function(h){if(a.has(h))f(h);else try{var d=h.getAttribute(r),m=d!==null&&d!=="false",p=(wr.get(h)||0)+1,g=(o.get(h)||0)+1;wr.set(h,p),o.set(h,g),s.push(h),p===1&&m&&Zo.set(h,!0),g===1&&h.setAttribute(n,"true"),m||h.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",h,y)}})};return f(t),a.clear(),Fu++,function(){s.forEach(function(c){var h=wr.get(c)-1,d=o.get(c)-1;wr.set(c,h),o.set(c,d),h||(Zo.has(c)||c.removeAttribute(r),Zo.delete(c)),d||c.removeAttribute(n)}),Fu--,Fu||(wr=new WeakMap,wr=new WeakMap,Zo=new WeakMap,Jo={})}},w2=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=y2(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),b2(r,i,n,"aria-hidden")):function(){return null}},Xo="Dialog",[Pv]=Ty(Xo),[S2,qt]=Pv(Xo),Fv=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!0}=e,a=C.useRef(null),l=C.useRef(null),[u,f]=Iy({prop:r,defaultProp:i??!1,onChange:o,caller:Xo});return x.jsx(S2,{scope:t,triggerRef:a,contentRef:l,contentId:Uo(),titleId:Uo(),descriptionId:Uo(),open:u,onOpenChange:f,onOpenToggle:C.useCallback(()=>f(c=>!c),[f]),modal:s,children:n})};Fv.displayName=Xo;var Rv="DialogTrigger",Bv=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=qt(Rv,n),o=nn(t,i.triggerRef);return x.jsx(Rt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Bu(i.open),...r,ref:o,onClick:Jt(e.onClick,i.onOpenToggle)})});Bv.displayName=Rv;var k2="DialogPortal",[jP,$v]=Pv(k2,{forceMount:void 0}),es="DialogOverlay",x2=C.forwardRef((e,t)=>{const n=$v(es,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=qt(es,e.__scopeDialog);return o.modal?x.jsx(zo,{present:r||o.open,children:x.jsx(C2,{...i,ref:t})}):null});x2.displayName=es;var E2=Oy("DialogOverlay.RemoveScroll"),C2=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=qt(es,n);return x.jsx(Lv,{as:E2,allowPinchZoom:!0,shards:[i.contentRef],children:x.jsx(Rt.div,{"data-state":Bu(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Pn="DialogContent",zv=C.forwardRef((e,t)=>{const n=$v(Pn,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=qt(Pn,e.__scopeDialog);return x.jsx(zo,{present:r||o.open,children:o.modal?x.jsx(A2,{...i,ref:t}):x.jsx(T2,{...i,ref:t})})});zv.displayName=Pn;var A2=C.forwardRef((e,t)=>{const n=qt(Pn,e.__scopeDialog),r=C.useRef(null),i=nn(t,n.contentRef,r);return C.useEffect(()=>{const o=r.current;if(o)return w2(o)},[]),x.jsx(Hv,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Jt(e.onCloseAutoFocus,o=>{var s;o.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:Jt(e.onPointerDownOutside,o=>{const s=o.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&o.preventDefault()}),onFocusOutside:Jt(e.onFocusOutside,o=>o.preventDefault())})}),T2=C.forwardRef((e,t)=>{const n=qt(Pn,e.__scopeDialog),r=C.useRef(!1),i=C.useRef(!1);return x.jsx(Hv,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,o),o.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=o.target;((u=n.triggerRef.current)==null?void 0:u.contains(s))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),Hv=C.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...s}=e,a=qt(Pn,n),l=C.useRef(null),u=nn(t,l);return P_(),x.jsxs(x.Fragment,{children:[x.jsx(gv,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:x.jsx(dv,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Bu(a.open),...s,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),x.jsxs(x.Fragment,{children:[x.jsx(I2,{titleId:a.titleId}),x.jsx(D2,{contentRef:l,descriptionId:a.descriptionId})]})]})}),Ru="DialogTitle",Uv=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=qt(Ru,n);return x.jsx(Rt.h2,{id:i.titleId,...r,ref:t})});Uv.displayName=Ru;var jv="DialogDescription",Vv=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=qt(jv,n);return x.jsx(Rt.p,{id:i.descriptionId,...r,ref:t})});Vv.displayName=jv;var Wv="DialogClose",qv=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=qt(Wv,n);return x.jsx(Rt.button,{type:"button",...r,ref:t,onClick:Jt(e.onClick,()=>i.onOpenChange(!1))})});qv.displayName=Wv;function Bu(e){return e?"open":"closed"}var Yv="DialogTitleWarning",[VP,Kv]=oL(Yv,{contentName:Pn,titleName:Ru,docsSlug:"dialog"}),I2=({titleId:e})=>{const t=Kv(Yv),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
364
364
 
365
365
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
366
366
 
367
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return C.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},T2="DialogDescriptionWarning",I2=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Kv(T2).contentName}}.`;return C.useEffect(()=>{var o;const i=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},O2=Fv,D2=Bv,M2=zv,N2=Uv,L2=Vv,_2=qv;function Sr({open:e,onOpenChange:t,children:n}){const{modal:r}=ye;return x.jsxs(O2,{open:e,modal:!1,onOpenChange:t,children:[e&&x.jsx("div",{...r==null?void 0:r.overlay}),n]})}function P2({title:e,description:t,onConfirm:n,onCancel:r,confirmButtonText:i,cancelButtonText:o,children:s}){const{modal:a}=ye;return x.jsx(x.Fragment,{children:x.jsxs(M2,{...a.dialog.container,children:[x.jsx(N2,{...a.dialog.title,children:e}),x.jsx(L2,{...a.dialog.description,children:t}),x.jsx("div",{...a.dialog.content.container,children:s}),x.jsxs("div",{...a.dialog.button.container,children:[i&&x.jsx("button",{...a.dialog.button.confirm,type:"button",onClick:n,children:i}),o&&x.jsx("button",{...a.dialog.button.cancel,type:"button",onClick:r,children:o})]})]})})}Sr.Button=D2,Sr.Close=_2,Sr.Content=P2;const Gv=D.forwardRef(({children:e,onClick:t,avatarUrl:n,botName:r,description:i,onClose:o,...s},a)=>{const{messagePreview:l}=ye,{container:u,closeButton:f,message:c,avatar:h,description:d}=l??{};return x.jsxs("div",{...s,...u,ref:a,onClick:t,children:[x.jsx(Cn,{src:n,...h,children:r||"Bot"}),x.jsx("p",{...c,children:e}),x.jsx("p",{...d,children:i}),x.jsx(wp,{...f,onClick:m=>{m.stopPropagation(),o==null||o()}})]})});Gv.displayName="MessagePreview",X.Avatar=Cn,X.BOT_IS_BLOCKED=Zf,X.Block=Nn,X.CONFIG_ACCESS_DENIED=t1,X.Chat=uv,X.Composer=cg,X.Container=tu,X.ConversationHistory=Tu,X.ErrorState=Ry,X.Fab=Ay,X.Header=_y,X.INVALID_API_URL=Kf,X.INVALID_BOTPRESS_URL=Qf,X.INVALID_CLIENT_ID=Gf,X.INVALID_CONFIGURATION=e1,X.INVALID_CONFIG_URL=X0,X.INVALID_MESSAGE_CONTENT_TYPE=ed,X.MISSING_API_URL=Q0,X.MISSING_BOT_ID=Z0,X.MISSING_CLIENT_ID=Yf,X.MISSING_CONFIG_URL=J0,X.Message=lu,X.MessageContext=Ya,X.MessageList=cu,X.MessagePreview=Gv,X.Modal=Sr,X.ModalContext=Ka,X.ModalProvider=jg,X.NETWORK_ERROR=Ri,X.NOT_A_PARTICIPANT=Rs,X.QUOTA_EXCEEDED=Jf,X.RestartConversationButton=ou,X.SOUND_EFFECTS=jy,X.SSE_DISCONNECTED_ERROR=Xf,X.StylesheetProvider=Vg,X.TranslationProvider=Rp,X.TypingIndicator=au,X.Webchat=y_,X.WebchatProvider=Cy,X._setDebugEnabled=tL,X._setTrackFn=nL,X.ar=lc,X.commonApiErrorMap=$s,X.de=ic,X.defaultTranslations=Rn,X.detectLocale=uc,X.enrichMessage=cc,X.es=nc,X.fileTypes=Wf,X.fr=tc,X.generateThemeOverride=Vf,X.generateThemeStylesheet=jf,X.getUseChatSoundStore=_p,X.getUseWebchatClientStore=Np,X.integrationMessagePayloadToBlockPayload=qg,X.integrationMessageToBlockMessage=cr,X.isCommonApiErrorType=nd,X.isEventError=id,X.isFileType=qf,X.isIntegrationError=rd,X.isWebhookHandlerErrorType=td,X.it=oc,X.ja=sc,X.ko=ac,X.mapToWebchatError=Rr,X.pt=rc,X.renderers=tg,X.retryWithBackoff=od,X.useActiveConversation=qy,X.useConversationList=lv,X.useConversations=Yy,X.useMessageContext=Pp,X.useModalContext=Ga,X.useTranslations=Ye,X.useUser=Wy,X.useWebchat=RL,X.useWebchatContext=$o,X.useWebchatStore=Jn,X.webchatClasses=ye,X.webhookHandlerErrorMap=Bs,Object.defineProperty(X,Symbol.toStringTag,{value:"Module"})});
367
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return C.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},O2="DialogDescriptionWarning",D2=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Kv(O2).contentName}}.`;return C.useEffect(()=>{var o;const i=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},M2=Fv,N2=Bv,L2=zv,_2=Uv,P2=Vv,F2=qv;function Sr({open:e,onOpenChange:t,children:n}){const{modal:r}=ye;return x.jsxs(M2,{open:e,modal:!1,onOpenChange:t,children:[e&&x.jsx("div",{...r==null?void 0:r.overlay}),n]})}function R2({title:e,description:t,onConfirm:n,onCancel:r,confirmButtonText:i,cancelButtonText:o,children:s}){const{modal:a}=ye;return x.jsx(x.Fragment,{children:x.jsxs(L2,{...a.dialog.container,children:[x.jsx(_2,{...a.dialog.title,children:e}),x.jsx(P2,{...a.dialog.description,children:t}),x.jsx("div",{...a.dialog.content.container,children:s}),x.jsxs("div",{...a.dialog.button.container,children:[i&&x.jsx("button",{...a.dialog.button.confirm,type:"button",onClick:n,children:i}),o&&x.jsx("button",{...a.dialog.button.cancel,type:"button",onClick:r,children:o})]})]})})}Sr.Button=N2,Sr.Close=F2,Sr.Content=R2;const Gv=D.forwardRef(({children:e,onClick:t,avatarUrl:n,botName:r,description:i,onClose:o,...s},a)=>{const{messagePreview:l}=ye,{container:u,closeButton:f,message:c,avatar:h,description:d}=l??{};return x.jsxs("div",{...s,...u,ref:a,onClick:t,children:[x.jsx(Cn,{src:n,...h,children:r||"Bot"}),x.jsx("p",{...c,children:e}),x.jsx("p",{...d,children:i}),x.jsx(wp,{...f,onClick:m=>{m.stopPropagation(),o==null||o()}})]})});Gv.displayName="MessagePreview",J.Avatar=Cn,J.BOT_IS_BLOCKED=Zf,J.Block=Nn,J.CONFIG_ACCESS_DENIED=t1,J.Chat=uv,J.Composer=cg,J.Container=tu,J.ConversationHistory=Tu,J.ErrorState=Ry,J.Fab=Ay,J.Header=_y,J.INVALID_API_URL=Kf,J.INVALID_BOTPRESS_URL=Qf,J.INVALID_CLIENT_ID=Gf,J.INVALID_CONFIGURATION=e1,J.INVALID_CONFIG_URL=X0,J.INVALID_MESSAGE_CONTENT_TYPE=ed,J.MISSING_API_URL=Q0,J.MISSING_BOT_ID=Z0,J.MISSING_CLIENT_ID=Yf,J.MISSING_CONFIG_URL=J0,J.Message=lu,J.MessageContext=Ya,J.MessageList=cu,J.MessagePreview=Gv,J.Modal=Sr,J.ModalContext=Ka,J.ModalProvider=jg,J.NETWORK_ERROR=Ri,J.NOT_A_PARTICIPANT=Rs,J.QUOTA_EXCEEDED=Jf,J.RestartConversationButton=ou,J.SOUND_EFFECTS=jy,J.SSE_DISCONNECTED_ERROR=Xf,J.StylesheetProvider=Vg,J.TranslationProvider=Rp,J.TypingIndicator=au,J.Webchat=b_,J.WebchatProvider=Cy,J._setDebugEnabled=tL,J._setTrackFn=nL,J.ar=lc,J.commonApiErrorMap=$s,J.de=ic,J.defaultTranslations=Rn,J.detectLocale=uc,J.enrichMessage=cc,J.es=nc,J.fileTypes=Wf,J.fr=tc,J.generateThemeOverride=Vf,J.generateThemeStylesheet=jf,J.getUseChatSoundStore=_p,J.getUseWebchatClientStore=Np,J.integrationMessagePayloadToBlockPayload=qg,J.integrationMessageToBlockMessage=cr,J.isCommonApiErrorType=nd,J.isEventError=id,J.isFileType=qf,J.isIntegrationError=rd,J.isWebhookHandlerErrorType=td,J.it=oc,J.ja=sc,J.ko=ac,J.mapToWebchatError=Rr,J.pt=rc,J.renderers=tg,J.retryWithBackoff=od,J.useActiveConversation=qy,J.useConversationList=lv,J.useConversations=Yy,J.useMessageContext=Pp,J.useModalContext=Ga,J.useTranslations=Ye,J.useUser=Wy,J.useWebchat=$L,J.useWebchatContext=$o,J.useWebchatStore=Jn,J.webchatClasses=ye,J.webhookHandlerErrorMap=Bs,Object.defineProperty(J,Symbol.toStringTag,{value:"Module"})});