@botpress/webchat 4.2.2 → 4.4.0
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.
- package/.storybook/main.ts +10 -27
- package/.storybook/preview.tsx +2 -2
- package/.turbo/turbo-build.log +8 -8
- package/ARCHITECTURE.md +737 -0
- package/dist/index.d.ts +333 -142
- package/dist/index.js +15376 -9451
- package/dist/index.umd.cjs +122 -113
- package/dist/style.css +1 -1
- package/package.json +14 -15
package/dist/index.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(re,
|
|
1
|
+
(function(re,k){typeof exports=="object"&&typeof module<"u"?k(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],k):(re=typeof globalThis<"u"?globalThis:re||self,k(re.Webchat={},re.ReactJsxRuntime,re.React,re.ReactDOM))})(this,function(re,k,D,zu){"use strict";var Vv,Wv,qv;var rs=typeof document<"u"?document.currentScript:null;function Uu(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const A=Uu(D),ju=Uu(zu);function Jv(e,t=[]){let n=[];function r(o,s){const a=A.createContext(s);a.displayName=o+"Context";const l=n.length;n=[...n,s];const u=c=>{var y;const{scope:h,children:d,...m}=c,p=((y=h==null?void 0:h[e])==null?void 0:y[l])||a,g=A.useMemo(()=>m,Object.values(m));return k.jsx(p.Provider,{value:g,children:d})};u.displayName=o+"Provider";function f(c,h){var p;const d=((p=h==null?void 0:h[e])==null?void 0:p[l])||a,m=A.useContext(d);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${c}\` must be used within \`${o}\``)}return[u,f]}const i=()=>{const o=n.map(s=>A.createContext(s));return function(a){const l=(a==null?void 0:a[e])||o;return A.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,Xv(i,...t)]}function Xv(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const c=l(o)[`__scope${u}`];return{...a,...c}},{});return A.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Ln(e){const t=A.useRef(e);return A.useEffect(()=>{t.current=e}),A.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var en=globalThis!=null&&globalThis.document?A.useLayoutEffect:()=>{};function Hu(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function is(...e){return t=>{let n=!1;const r=e.map(i=>{const o=Hu(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():Hu(e[i],null)}}}}function tn(...e){return A.useCallback(is(...e),e)}var eb=Symbol.for("react.lazy"),bi=A[" use ".trim().toString()];function tb(e){return typeof e=="object"&&e!==null&&"then"in e}function Vu(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===eb&&"_payload"in e&&tb(e._payload)}function nb(e){const t=rb(e),n=A.forwardRef((r,i)=>{let{children:o,...s}=r;Vu(o)&&typeof bi=="function"&&(o=bi(o._payload));const a=A.Children.toArray(o),l=a.find(ob);if(l){const u=l.props.children,f=a.map(c=>c===l?A.Children.count(u)>1?A.Children.only(null):A.isValidElement(u)?u.props.children:null:c);return k.jsx(t,{...s,ref:i,children:A.isValidElement(u)?A.cloneElement(u,void 0,f):null})}return k.jsx(t,{...s,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function rb(e){const t=A.forwardRef((n,r)=>{let{children:i,...o}=n;if(Vu(i)&&typeof bi=="function"&&(i=bi(i._payload)),A.isValidElement(i)){const s=ab(i),a=sb(o,i.props);return i.type!==A.Fragment&&(a.ref=r?is(r,s):s),A.cloneElement(i,a)}return A.Children.count(i)>1?A.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ib=Symbol("radix.slottable");function ob(e){return A.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ib}function sb(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{const l=o(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function ab(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var lb=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],os=lb.reduce((e,t)=>{const n=nb(`Primitive.${t}`),r=A.forwardRef((i,o)=>{const{asChild:s,...a}=i,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),k.jsx(l,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),yn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ss={exports:{}},as={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* use-sync-external-store-shim.production.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var Wu;function ub(){if(Wu)return as;Wu=1;var e=D;function t(c,h){return c===h&&(c!==0||1/c===1/h)||c!==c&&h!==h}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function a(c,h){var d=h(),m=r({inst:{value:d,getSnapshot:h}}),p=m[0].inst,g=m[1];return o(function(){p.value=d,p.getSnapshot=h,l(p)&&g({inst:p})},[c,d,h]),i(function(){return l(p)&&g({inst:p}),c(function(){l(p)&&g({inst:p})})},[c]),s(d),d}function l(c){var h=c.getSnapshot;c=c.value;try{var d=h();return!n(c,d)}catch{return!0}}function u(c,h){return h()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return as.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,as}var ls={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* use-sync-external-store-shim.development.js
|
|
12
12
|
*
|
|
@@ -14,229 +14,239 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var zs;function rm(){return zs||(zs=1,process.env.NODE_ENV!=="production"&&function(){function e(d,m){return d===m&&(d!==0||1/d===1/m)||d!==d&&m!==m}function t(d,m){f||i.startTransition===void 0||(f=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var h=m();if(!c){var g=m();o(h,g)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}g=a({inst:{value:h,getSnapshot:m}});var y=g[0].inst,v=g[1];return l(function(){y.value=h,y.getSnapshot=m,n(y)&&v({inst:y})},[d,h,m]),s(function(){return n(y)&&v({inst:y}),d(function(){n(y)&&v({inst:y})})},[d]),u(h),h}function n(d){var m=d.getSnapshot;d=d.value;try{var h=m();return!o(d,h)}catch{return!0}}function r(d,m){return m()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var i=_,o=typeof Object.is=="function"?Object.is:e,a=i.useState,s=i.useEffect,l=i.useLayoutEffect,u=i.useDebugValue,f=!1,c=!1,p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;Vi.useSyncExternalStore=i.useSyncExternalStore!==void 0?i.useSyncExternalStore:p,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Vi}process.env.NODE_ENV==="production"?Hi.exports=nm():Hi.exports=rm();var im=Hi.exports;function om(){return im.useSyncExternalStore(am,()=>!0,()=>!1)}function am(){return()=>{}}var qi="Avatar",[sm]=Vh(qi),[lm,$s]=sm(qi),Ki=E.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,o]=E.useState("idle");return S.jsx(lm,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:o,children:S.jsx(Ui.span,{...r,ref:t})})});Ki.displayName=qi;var js="AvatarImage",Yi=E.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...o}=e,a=$s(js,n),s=um(r,o),l=Zt(u=>{i(u),a.onImageLoadingStatusChange(u)});return Tt(()=>{s!=="idle"&&l(s)},[s,l]),s==="loaded"?S.jsx(Ui.img,{...o,ref:t,src:r}):null});Yi.displayName=js;var Us="AvatarFallback",Gi=E.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,o=$s(Us,n),[a,s]=E.useState(r===void 0);return E.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>s(!0),r);return()=>window.clearTimeout(l)}},[r]),a&&o.imageLoadingStatus!=="loaded"?S.jsx(Ui.span,{...i,ref:t}):null});Gi.displayName=Us;function Hs(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function um(e,{referrerPolicy:t,crossOrigin:n}){const r=om(),i=E.useRef(null),o=r?(i.current||(i.current=new window.Image),i.current):null,[a,s]=E.useState(()=>Hs(o,e));return Tt(()=>{s(Hs(o,e))},[o,e]),Tt(()=>{const l=c=>()=>{s(c)};if(!o)return;const u=l("loaded"),f=l("error");return o.addEventListener("load",u),o.addEventListener("error",f),t&&(o.referrerPolicy=t),typeof n=="string"&&(o.crossOrigin=n),()=>{o.removeEventListener("load",u),o.removeEventListener("error",f)}},[o,n,t]),a}function Ws(e,t){let n=`${e} {`;for(const[r,i]of Object.entries(t))n+=`${r}: ${i}; `;return n+="}",n}function Vs(e,t){let n=0;if(e.length==0)return n;for(let r=0;r<e.length;r++){const i=e.charCodeAt(r);n=(n<<5)-n+i,n=n&n}return Math.abs(n)%t}const cm=(e,t={})=>new Promise((n,r)=>{if(typeof window>"u")return r("Window is not defined");if(!e)return r("Url is not defined");let i=null;const o=new Image;o.addEventListener("load",()=>{i&&clearTimeout(i),n({width:o.naturalWidth,height:o.naturalHeight})}),o.addEventListener("error",a=>{i&&clearTimeout(i),r(`${a.type}: ${a.message}`)}),o.src=e,t.timeout&&(i=setTimeout(()=>r("Timeout"),t.timeout))});var qs={exports:{}};(function(e,t){(function(n,r){e.exports=r()})($t,function(){var n=1e3,r=6e4,i=36e5,o="millisecond",a="second",s="minute",l="hour",u="day",f="week",c="month",p="quarter",d="year",m="date",h="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(M){var D=["th","st","nd","rd"],B=M%100;return"["+M+(D[(B-20)%10]||D[B]||D[0])+"]"}},w=function(M,D,B){var U=String(M);return!U||U.length>=D?M:""+Array(D+1-U.length).join(B)+M},A={s:w,z:function(M){var D=-M.utcOffset(),B=Math.abs(D),U=Math.floor(B/60),$=B%60;return(D<=0?"+":"-")+w(U,2,"0")+":"+w($,2,"0")},m:function M(D,B){if(D.date()<B.date())return-M(B,D);var U=12*(B.year()-D.year())+(B.month()-D.month()),$=D.clone().add(U,c),V=B-$<0,b=D.clone().add(U+(V?-1:1),c);return+(-(U+(B-$)/(V?$-b:b-$))||0)},a:function(M){return M<0?Math.ceil(M)||0:Math.floor(M)},p:function(M){return{M:c,y:d,w:f,d:u,D:m,h:l,m:s,s:a,ms:o,Q:p}[M]||String(M||"").toLowerCase().replace(/s$/,"")},u:function(M){return M===void 0}},k="en",C={};C[k]=v;var T="$isDayjsObject",P=function(M){return M instanceof j||!(!M||!M[T])},F=function M(D,B,U){var $;if(!D)return k;if(typeof D=="string"){var V=D.toLowerCase();C[V]&&($=V),B&&(C[V]=B,$=V);var b=D.split("-");if(!$&&b.length>1)return M(b[0])}else{var N=D.name;C[N]=D,$=N}return!U&&$&&(k=$),$||!U&&k},I=function(M,D){if(P(M))return M.clone();var B=typeof D=="object"?D:{};return B.date=M,B.args=arguments,new j(B)},O=A;O.l=F,O.i=P,O.w=function(M,D){return I(M,{locale:D.$L,utc:D.$u,x:D.$x,$offset:D.$offset})};var j=function(){function M(B){this.$L=F(B.locale,null,!0),this.parse(B),this.$x=this.$x||B.x||{},this[T]=!0}var D=M.prototype;return D.parse=function(B){this.$d=function(U){var $=U.date,V=U.utc;if($===null)return new Date(NaN);if(O.u($))return new Date;if($ instanceof Date)return new Date($);if(typeof $=="string"&&!/Z$/i.test($)){var b=$.match(g);if(b){var N=b[2]-1||0,H=(b[7]||"0").substring(0,3);return V?new Date(Date.UTC(b[1],N,b[3]||1,b[4]||0,b[5]||0,b[6]||0,H)):new Date(b[1],N,b[3]||1,b[4]||0,b[5]||0,b[6]||0,H)}}return new Date($)}(B),this.init()},D.init=function(){var B=this.$d;this.$y=B.getFullYear(),this.$M=B.getMonth(),this.$D=B.getDate(),this.$W=B.getDay(),this.$H=B.getHours(),this.$m=B.getMinutes(),this.$s=B.getSeconds(),this.$ms=B.getMilliseconds()},D.$utils=function(){return O},D.isValid=function(){return this.$d.toString()!==h},D.isSame=function(B,U){var $=I(B);return this.startOf(U)<=$&&$<=this.endOf(U)},D.isAfter=function(B,U){return I(B)<this.startOf(U)},D.isBefore=function(B,U){return this.endOf(U)<I(B)},D.$g=function(B,U,$){return O.u(B)?this[U]:this.set($,B)},D.unix=function(){return Math.floor(this.valueOf()/1e3)},D.valueOf=function(){return this.$d.getTime()},D.startOf=function(B,U){var $=this,V=!!O.u(U)||U,b=O.p(B),N=function(ie,K){var te=O.w($.$u?Date.UTC($.$y,K,ie):new Date($.$y,K,ie),$);return V?te:te.endOf(u)},H=function(ie,K){return O.w($.toDate()[ie].apply($.toDate("s"),(V?[0,0,0,0]:[23,59,59,999]).slice(K)),$)},x=this.$W,W=this.$M,ee=this.$D,Y="set"+(this.$u?"UTC":"");switch(b){case d:return V?N(1,0):N(31,11);case c:return V?N(1,W):N(0,W+1);case f:var J=this.$locale().weekStart||0,X=(x<J?x+7:x)-J;return N(V?ee-X:ee+(6-X),W);case u:case m:return H(Y+"Hours",0);case l:return H(Y+"Minutes",1);case s:return H(Y+"Seconds",2);case a:return H(Y+"Milliseconds",3);default:return this.clone()}},D.endOf=function(B){return this.startOf(B,!1)},D.$set=function(B,U){var $,V=O.p(B),b="set"+(this.$u?"UTC":""),N=($={},$[u]=b+"Date",$[m]=b+"Date",$[c]=b+"Month",$[d]=b+"FullYear",$[l]=b+"Hours",$[s]=b+"Minutes",$[a]=b+"Seconds",$[o]=b+"Milliseconds",$)[V],H=V===u?this.$D+(U-this.$W):U;if(V===c||V===d){var x=this.clone().set(m,1);x.$d[N](H),x.init(),this.$d=x.set(m,Math.min(this.$D,x.daysInMonth())).$d}else N&&this.$d[N](H);return this.init(),this},D.set=function(B,U){return this.clone().$set(B,U)},D.get=function(B){return this[O.p(B)]()},D.add=function(B,U){var $,V=this;B=Number(B);var b=O.p(U),N=function(W){var ee=I(V);return O.w(ee.date(ee.date()+Math.round(W*B)),V)};if(b===c)return this.set(c,this.$M+B);if(b===d)return this.set(d,this.$y+B);if(b===u)return N(1);if(b===f)return N(7);var H=($={},$[s]=r,$[l]=i,$[a]=n,$)[b]||1,x=this.$d.getTime()+B*H;return O.w(x,this)},D.subtract=function(B,U){return this.add(-1*B,U)},D.format=function(B){var U=this,$=this.$locale();if(!this.isValid())return $.invalidDate||h;var V=B||"YYYY-MM-DDTHH:mm:ssZ",b=O.z(this),N=this.$H,H=this.$m,x=this.$M,W=$.weekdays,ee=$.months,Y=$.meridiem,J=function(K,te,L,ne){return K&&(K[te]||K(U,V))||L[te].slice(0,ne)},X=function(K){return O.s(N%12||12,K,"0")},ie=Y||function(K,te,L){var ne=K<12?"AM":"PM";return L?ne.toLowerCase():ne};return V.replace(y,function(K,te){return te||function(L){switch(L){case"YY":return String(U.$y).slice(-2);case"YYYY":return O.s(U.$y,4,"0");case"M":return x+1;case"MM":return O.s(x+1,2,"0");case"MMM":return J($.monthsShort,x,ee,3);case"MMMM":return J(ee,x);case"D":return U.$D;case"DD":return O.s(U.$D,2,"0");case"d":return String(U.$W);case"dd":return J($.weekdaysMin,U.$W,W,2);case"ddd":return J($.weekdaysShort,U.$W,W,3);case"dddd":return W[U.$W];case"H":return String(N);case"HH":return O.s(N,2,"0");case"h":return X(1);case"hh":return X(2);case"a":return ie(N,H,!0);case"A":return ie(N,H,!1);case"m":return String(H);case"mm":return O.s(H,2,"0");case"s":return String(U.$s);case"ss":return O.s(U.$s,2,"0");case"SSS":return O.s(U.$ms,3,"0");case"Z":return b}return null}(K)||b.replace(":","")})},D.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},D.diff=function(B,U,$){var V,b=this,N=O.p(U),H=I(B),x=(H.utcOffset()-this.utcOffset())*r,W=this-H,ee=function(){return O.m(b,H)};switch(N){case d:V=ee()/12;break;case c:V=ee();break;case p:V=ee()/3;break;case f:V=(W-x)/6048e5;break;case u:V=(W-x)/864e5;break;case l:V=W/i;break;case s:V=W/r;break;case a:V=W/n;break;default:V=W}return $?V:O.a(V)},D.daysInMonth=function(){return this.endOf(c).$D},D.$locale=function(){return C[this.$L]},D.locale=function(B,U){if(!B)return this.$L;var $=this.clone(),V=F(B,U,!0);return V&&($.$L=V),$},D.clone=function(){return O.w(this.$d,this)},D.toDate=function(){return new Date(this.valueOf())},D.toJSON=function(){return this.isValid()?this.toISOString():null},D.toISOString=function(){return this.$d.toISOString()},D.toString=function(){return this.$d.toUTCString()},M}(),z=j.prototype;return I.prototype=z,[["$ms",o],["$s",a],["$m",s],["$H",l],["$W",u],["$M",c],["$y",d],["$D",m]].forEach(function(M){z[M[1]]=function(D){return this.$g(D,M[0],M[1])}}),I.extend=function(M,D){return M.$i||(M(D,j,I),M.$i=!0),I},I.locale=F,I.isDayjs=P,I.unix=function(M){return I(1e3*M)},I.en=C[k],I.Ls=C,I.p={},I})})(qs);var fm=qs.exports;const xr=jt(fm);var Ks={exports:{}};(function(e,t){(function(n,r){e.exports=r()})($t,function(){return function(n,r,i){r.prototype.isToday=function(){var o="YYYY-MM-DD",a=i();return this.format(o)===a.format(o)}}})})(Ks);var dm=Ks.exports;const pm=jt(dm);var Ys={exports:{}};(function(e,t){(function(n,r){e.exports=r()})($t,function(){return function(n,r,i){r.prototype.isYesterday=function(){var o="YYYY-MM-DD",a=i().subtract(1,"day");return this.format(o)===a.format(o)}}})})(Ys);var hm=Ys.exports;const mm=jt(hm);xr.extend(pm),xr.extend(mm);function Gs(e,t,n,r,i){return e.map(o=>{const{authorId:a}=o,s=a===n?"outgoing":"incoming",l=t.find(f=>f.id===a);let u;return l&&l.id===n?u={name:l.name||"You",avatar:l.pictureUrl}:l?u={name:l.name||"Agent",avatar:l.pictureUrl}:u={name:r||"Bot",avatar:i},{...o,direction:s,sender:u}})}function gm(e,t="day"){var r,i,o;if(!e||e.length===0)return[];const n=[];(r=e[0])!=null&&r.timestamp&&n.push(Qs(e[0].timestamp));for(let a=0;a<e.length;a++)if(e[a]&&n.push(e[a]),a+1<e.length){const s=(i=e[a])==null?void 0:i.timestamp,l=(o=e[a+1])==null?void 0:o.timestamp;!xr(s).isSame(l,t)&&l&&n.push(Qs(l))}return n}function Qs(e){return{id:Js(e),direction:"system",sender:{name:"system"},timestamp:e,block:{type:"text",text:Js(e)}}}function Js(e,t=!1){const n=xr(e),r="h:mma";return n.isToday()?t?`Today • ${n.format(r)}`:"Today":n.isYesterday()?t?`Yesterday • ${n.format(r)}`:"Yesterday":t?n.format(`YYYY-MM-DD • ${r}`):n.format("YYYY-MM-DD")}function ym(e=""){if(typeof e!="string")throw new TypeError("Color should be string!");const t=/^#?([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i.exec(e);if(t)return t.splice(1).map(r=>Number.parseInt(r,16));const n=/^#?([\da-f])([\da-f])([\da-f])$/i.exec(e);if(n)return n.splice(1).map(r=>Number.parseInt(r+r,16));if(e.includes(","))return e.split(",").map(r=>Number.parseInt(r));throw new Error("Invalid color format! Use #ABC or #AABBCC or r,g,b")}function vm(e){return"#"+e.map(t=>`0${t.toString(16).toUpperCase()}`.slice(-2)).join("")}function bm(e,t){return e.map(n=>Math.round(n+(255-n)*t))}function wm(e,t){return e.map(n=>Math.round(n*t))}const Mn=e=>t=>bm(t,e),_n=e=>t=>wm(t,e),xm={50:Mn(.95),100:Mn(.9),200:Mn(.75),300:Mn(.6),400:Mn(.3),500:e=>e,600:_n(.9),700:_n(.6),800:_n(.45),900:_n(.3),950:_n(.2)};function Zs(e,t=xm){const n={},r=ym(e);for(const[i,o]of Object.entries(t))n[i]=vm(o(r));return n}const Xs=()=>{const e={};return{on:(i,o)=>{var a;return e[i]||(e[i]=new Set),(a=e[i])==null||a.add(o),()=>{var s;return(s=e[i])==null?void 0:s.delete(o)}},emit:(i,o)=>{var a,s;(a=e[i])==null||a.forEach(l=>l(o)),(s=e["*"])==null||s.forEach(l=>l({type:i,payload:o}))},removeAllListeners:i=>{var o;i?(o=e[i])==null||o.clear():Object.keys(e).forEach(a=>{var s;(s=e[a])==null||s.clear()})}}};function Qi(e){if(!/^#?([a-fA-F\d]{6}|[a-fA-F\d]{3})$/.test(e))return{r:0,g:0,b:0};const n=e.replace(/^#/,"");let r=n;n.length===3&&(r=n.split("").map(l=>l+l).join(""));const i=parseInt(r,16),o=i>>16&255,a=i>>8&255,s=i&255;return{r:o,g:a,b:s}}function km(e){return`#${((1<<24)+(e.r<<16)+(e.g<<8)+e.b).toString(16).slice(1)}`}const Sm=(e,t=30)=>{const n=Math.min(e.r,e.g,e.b),r=Math.max(e.r,e.g,e.b,n+1);return{r:Math.floor((e.r-n)/(r-n)*t*(1-.299)+120-t/2),g:Math.floor((e.g-n)/(r-n)*t*(1-.587)+120-t/2),b:Math.floor((e.b-n)/(r-n)*t*(1-.114)+120-t/2)}};function el(e){return Object.entries(e).reduce((t,[n,r])=>{const i=n.replace(/(\d+)/,o=>(1e3-parseInt(o)).toString());return{...t,[i]:r}},{})}const Em=2.4,Cm=.2126729,Am=.7151522,Im=.072175,Tm=.56,Om=.57,Dm=.62,Mm=.65,kr=.022,tl=1.414,_m=1.14,Pm=1.14,Nm=.035991,Lm=27.7847239587675,Fm=27.7847239587675,nl=.027,rl=.027,il=.001,Rm=5e-4;function ol(e){const{r:t,g:n,b:r}=e,i=o=>(o/255)**Em;return Cm*i(t)+Am*i(n)+Im*i(r)}function al(e,t){if(!e||!t)return 0;let n=ol(Qi(e)),r=ol(Qi(t)),i=0,o=0;return n=n>kr?n:n+(kr-n)**tl,r=r>kr?r:r+(kr-r)**tl,Math.abs(r-n)<Rm?0:(r>n?(i=(r**Tm-n**Om)*_m,o=i<il?0:i<Nm?i-i*Lm*nl:i-nl):(i=(r**Mm-n**Dm)*Pm,o=i>-il?0:i>-.035991?i-i*Fm*rl:i+rl),Math.abs(o*100))}const Bm=(e,t,n)=>{const r=e;let i=0;for(;t.some(o=>n(o)===e);)i+=1,e=`${r} (${i})`;return e};function sl(e){const{fontFamily:t,...n}=e,r=ll(n);return Ws(".bpReset",{...r,"font-family":`'${t}', sans-serif`})+Ws(":host, :root",{...r})}function ll(e){const{radius:t,themeMode:n,color:r,variant:i,headerVariant:o}=e;let a={},s={};if(r){const p=Zs(r),d=n==="dark"?el(p):p,m=Zs(km(Sm(Qi(r)))),h=n==="dark"?el(m):m,g=n==="dark"?"#101010":"#fdfdfd";s=Object.entries({...d,1:g}).reduce((v,[w,A])=>({...v,[`--bpPrimary-${w}`]:A}),{});const y=Object.entries({...h,1:g}).reduce((v,[w,A])=>({...v,[`--bpGray-${w}`]:A}),{});a={...s,...y}}t&&(a={...a,"--bpRadius-scale":t.toString()});const l=n==="dark"?{bg:"var(--transparent-dark)",bgHover:"var(--transparent-dark-hover)"}:{bg:"var(--transparent-light)",bgHover:"var(--transparent-light-hover)"},u=s?al(s["--bpPrimary-600"],s["--bpPrimary-50"])>40?"var(--bpPrimary-50)":"var(--bpPrimary-900)":"var(--bpPrimary-50)",f=i==="solid"?{"--message-bg":"var(--bpPrimary-600)","--message-bg-hover":"var(--bpPrimary-700)","--message-text":u,"--send-button-bg":"var(--bpPrimary-600)","--send-button-bg-hover":"var(--bpPrimary-700)","--send-button-text":"var(--bpPrimary-50)","--button-bg":"var(--bpPrimary-200)","--button-bg-hover":"var(--bpPrimary-300)","--button-text":"var(--bpPrimary-800)","--fab-bg":"var(--bpPrimary-600)","--fab-bg-hover":"var(--bpPrimary-700)","--fab-icon":u,"--modal-submit-bg":"var(--bpPrimary-600)","--modal-submit-bg-hover":"var(--bpPrimary-700)"}:{"--message-bg":"var(--bpPrimary-100)","--message-bg-hover":"var(--bpPrimary-200)","--message-text":"var(--bpPrimary-900)","--send-button-bg":"var(--bpPrimary-600)","--send-button-bg-hover":"var(--bpPrimary-700)","--send-button-text":"var(--bpPrimary-50)","--button-bg":"var(--bpPrimary-500)","--button-bg-hover":"var(--bpPrimary-600)","--button-text":s?al(s["--bpPrimary-500"],s["--bpPrimary-50"])>40?"var(--bpPrimary-50)":"var(--bpPrimary-900)":"var(--bpPrimary-50)","--fab-bg":"var(--bpPrimary-100)","--fab-bg-hover":"var(--bpPrimary-200)","--fab-icon":"var(--bpPrimary-700)","--scrollbar":"var(--bpGray-500)","--scrollbar-hover":"var(--bpGray-400)","--modal-submit-bg":"var(--bpPrimary-200)","--modal-submit-bg-hover":"var(--bpPrimary-300)"},c=o==="solid"?{"--header-bg":"var(--bpPrimary-600)","--header-bg-hover":"var(--bpPrimary-700)","--header-hover-dark":"var(--bpPrimary-800)","--header-title":u,"--header-description":u,"--header-description-icon":u,"--header-description-link":u,"--header-avatar-bg":"var(--bpPrimary-300)","--header-avatar-text":"var(--bpPrimary-700)"}:{"--header-bg":l.bg,"--header-bg-hover":l.bgHover,"--header-hover-dark":"var(--bpGray-200)","--header-title":"var(--bpGray-900)","--header-description":"var(--bpGray-600)","--header-description-icon":"var(--bpPrimary-700)","--header-description-link":"var(--bpPrimary-800)","--header-avatar-bg":"var(--bpPrimary-600)","--header-avatar-text":"var(--bpPrimary-50)"};return{...a,...f,...c}}const zm=e=>{if(typeof URL.canParse=="function")return URL.canParse(e);try{return new URL(e),!0}catch{return!1}},ul=["audio","file","image","video"],cl=e=>ul.includes(e),fl="The Client ID is required to initialize the webchat.",$m="The API url is required to initialize the webchat.",jm="The Bot ID is required to initialize the webchat.",Um="No config URL provided.",dl=`Invalid API URL.
|
|
18
|
-
Please use a valid API URL.`,
|
|
19
|
-
Please use a valid Botpress Client ID.`,
|
|
20
|
-
Please make sure your client ID and API URL are valid`,
|
|
21
|
-
Please make sure your config URL is valid`,
|
|
22
|
-
Please make sure your config file is valid`,
|
|
23
|
-
Please check back later.`,
|
|
24
|
-
Please check back later
|
|
25
|
-
Please refresh the page.`,
|
|
26
|
-
Please start a new conversation.`,Zi={ResourceNotFound:{type:"configuration",message:pl},Forbidden:{type:"bot",message:ml}},Xi={MethodNotFound:{type:"configuration",message:hl},QuotaExceeded:{type:"bot",message:gl},Forbidden:{type:"bot",message:Ji}};function bl(e){return e in Zi}function wl(e){return e in Xi}function xl(e){return e!==null&&typeof e=="object"&&"id"in e&&"code"in e&&"type"in e}function kl(e){return e!==null&&typeof e=="object"&&"type"in e&&e.type==="error"&&"message"in e&&typeof e.message=="string"}const Sl=async(e,t=3,n=1e3)=>{let r;for(let i=1;i<=t;i++)try{return await e()}catch(o){if(r=o,i===t)throw r;const a=n*Math.pow(2,i-1);await new Promise(s=>setTimeout(s,a))}throw new Error("Unreachable: retry loop should always return or throw")},qm=["networkerror","failedtofetch","errorininputstream"],Sr=e=>{var n;console.error("An error occurred:",e);let t={type:"unknown",message:"An unexpected error occurred"};if(xl(e))e.type==="network"?t={id:e.id,type:"network",message:Pn}:(n=e.message)!=null&&n.includes("[Webhook Handler]")&&bl(e.type)?t={id:e.id,...Zi[e.type]}:wl(e.type)?t={id:e.id,...Xi[e.type]}:t={id:e.id,type:e.type,message:e.message||"An error occurred"};else if(kl(e))El(e.message)?t={type:"disconnected",message:yl}:Cl(e.message).includes("invalidcontenttype")?t={type:"bot",message:vl}:t={type:"event",message:e.message};else if(e instanceof Error&&El(e.message))t={type:"network",message:Pn};else if(e&&typeof e=="object"&&"type"in e&&"message"in e){const r=e;r.type==="network"?t={type:"network",message:Pn}:t={type:r.type,message:r.message}}return t};function El(e){return qm.some(t=>Cl(e).includes(t))}function Cl(e){return e.replaceAll(" ","").toLowerCase()}const Nn=_.forwardRef(({userId:e,src:t,container:n,image:r,fallback:i,...o},a)=>{const s=Vs(e??"",15);return S.jsxs(Ki,{ref:a,"data-color":s,...n,...o,children:[S.jsx(Yi,{src:t,...r}),S.jsx(Gi,{...i,children:typeof o.children=="string"?o.children[0]:o.children})]})});Nn.displayName="Avatar";function BT(){}function zT(){}function Km(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Ym=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Gm=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Qm={};function Al(e,t){return(Qm.jsx?Gm:Ym).test(e)}const Jm=/[ \t\n\f\r]/g;function Zm(e){return typeof e=="object"?e.type==="text"?Il(e.value):!1:Il(e)}function Il(e){return e.replace(Jm,"")===""}class Ln{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Ln.prototype.normal={},Ln.prototype.property={},Ln.prototype.space=void 0;function Tl(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Ln(n,r,t)}function eo(e){return e.toLowerCase()}class Qe{constructor(t,n){this.attribute=n,this.property=t}}Qe.prototype.attribute="",Qe.prototype.booleanish=!1,Qe.prototype.boolean=!1,Qe.prototype.commaOrSpaceSeparated=!1,Qe.prototype.commaSeparated=!1,Qe.prototype.defined=!1,Qe.prototype.mustUseProperty=!1,Qe.prototype.number=!1,Qe.prototype.overloadedBoolean=!1,Qe.prototype.property="",Qe.prototype.spaceSeparated=!1,Qe.prototype.space=void 0;let Xm=0;const he=Ut(),Fe=Ut(),to=Ut(),Q=Ut(),De=Ut(),Xt=Ut(),et=Ut();function Ut(){return 2**++Xm}const no=Object.freeze(Object.defineProperty({__proto__:null,boolean:he,booleanish:Fe,commaOrSpaceSeparated:et,commaSeparated:Xt,number:Q,overloadedBoolean:to,spaceSeparated:De},Symbol.toStringTag,{value:"Module"})),ro=Object.keys(no);class io extends Qe{constructor(t,n,r,i){let o=-1;if(super(t,n),Ol(this,"space",i),typeof r=="number")for(;++o<ro.length;){const a=ro[o];Ol(this,ro[o],(r&no[a])===no[a])}}}io.prototype.defined=!0;function Ol(e,t,n){n&&(e[t]=n)}function en(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new io(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[eo(r)]=r,n[eo(o.attribute)]=r}return new Ln(t,n,e.space)}const Dl=en({properties:{ariaActiveDescendant:null,ariaAtomic:Fe,ariaAutoComplete:null,ariaBusy:Fe,ariaChecked:Fe,ariaColCount:Q,ariaColIndex:Q,ariaColSpan:Q,ariaControls:De,ariaCurrent:null,ariaDescribedBy:De,ariaDetails:null,ariaDisabled:Fe,ariaDropEffect:De,ariaErrorMessage:null,ariaExpanded:Fe,ariaFlowTo:De,ariaGrabbed:Fe,ariaHasPopup:null,ariaHidden:Fe,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:De,ariaLevel:Q,ariaLive:null,ariaModal:Fe,ariaMultiLine:Fe,ariaMultiSelectable:Fe,ariaOrientation:null,ariaOwns:De,ariaPlaceholder:null,ariaPosInSet:Q,ariaPressed:Fe,ariaReadOnly:Fe,ariaRelevant:null,ariaRequired:Fe,ariaRoleDescription:De,ariaRowCount:Q,ariaRowIndex:Q,ariaRowSpan:Q,ariaSelected:Fe,ariaSetSize:Q,ariaSort:null,ariaValueMax:Q,ariaValueMin:Q,ariaValueNow:Q,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Ml(e,t){return t in e?e[t]:t}function _l(e,t){return Ml(e,t.toLowerCase())}const eg=en({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Xt,acceptCharset:De,accessKey:De,action:null,allow:null,allowFullScreen:he,allowPaymentRequest:he,allowUserMedia:he,alt:null,as:null,async:he,autoCapitalize:null,autoComplete:De,autoFocus:he,autoPlay:he,blocking:De,capture:null,charSet:null,checked:he,cite:null,className:De,cols:Q,colSpan:null,content:null,contentEditable:Fe,controls:he,controlsList:De,coords:Q|Xt,crossOrigin:null,data:null,dateTime:null,decoding:null,default:he,defer:he,dir:null,dirName:null,disabled:he,download:to,draggable:Fe,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:he,formTarget:null,headers:De,height:Q,hidden:to,high:Q,href:null,hrefLang:null,htmlFor:De,httpEquiv:De,id:null,imageSizes:null,imageSrcSet:null,inert:he,inputMode:null,integrity:null,is:null,isMap:he,itemId:null,itemProp:De,itemRef:De,itemScope:he,itemType:De,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:he,low:Q,manifest:null,max:null,maxLength:Q,media:null,method:null,min:null,minLength:Q,multiple:he,muted:he,name:null,nonce:null,noModule:he,noValidate:he,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:he,optimum:Q,pattern:null,ping:De,placeholder:null,playsInline:he,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:he,referrerPolicy:null,rel:De,required:he,reversed:he,rows:Q,rowSpan:Q,sandbox:De,scope:null,scoped:he,seamless:he,selected:he,shadowRootClonable:he,shadowRootDelegatesFocus:he,shadowRootMode:null,shape:null,size:Q,sizes:null,slot:null,span:Q,spellCheck:Fe,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Q,step:null,style:null,tabIndex:Q,target:null,title:null,translate:null,type:null,typeMustMatch:he,useMap:null,value:Fe,width:Q,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:De,axis:null,background:null,bgColor:null,border:Q,borderColor:null,bottomMargin:Q,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:he,declare:he,event:null,face:null,frame:null,frameBorder:null,hSpace:Q,leftMargin:Q,link:null,longDesc:null,lowSrc:null,marginHeight:Q,marginWidth:Q,noResize:he,noHref:he,noShade:he,noWrap:he,object:null,profile:null,prompt:null,rev:null,rightMargin:Q,rules:null,scheme:null,scrolling:Fe,standby:null,summary:null,text:null,topMargin:Q,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Q,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:he,disableRemotePlayback:he,prefix:null,property:null,results:Q,security:null,unselectable:null},space:"html",transform:_l}),tg=en({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:et,accentHeight:Q,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Q,amplitude:Q,arabicForm:null,ascent:Q,attributeName:null,attributeType:null,azimuth:Q,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Q,by:null,calcMode:null,capHeight:Q,className:De,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Q,diffuseConstant:Q,direction:null,display:null,dur:null,divisor:Q,dominantBaseline:null,download:he,dx:null,dy:null,edgeMode:null,editable:null,elevation:Q,enableBackground:null,end:null,event:null,exponent:Q,externalResourcesRequired:null,fill:null,fillOpacity:Q,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Xt,g2:Xt,glyphName:Xt,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Q,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Q,horizOriginX:Q,horizOriginY:Q,id:null,ideographic:Q,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Q,k:Q,k1:Q,k2:Q,k3:Q,k4:Q,kernelMatrix:et,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Q,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Q,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Q,overlineThickness:Q,paintOrder:null,panose1:null,path:null,pathLength:Q,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:De,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Q,pointsAtY:Q,pointsAtZ:Q,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:et,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:et,rev:et,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:et,requiredFeatures:et,requiredFonts:et,requiredFormats:et,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Q,specularExponent:Q,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Q,strikethroughThickness:Q,string:null,stroke:null,strokeDashArray:et,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Q,strokeOpacity:Q,strokeWidth:null,style:null,surfaceScale:Q,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:et,tabIndex:Q,tableValues:null,target:null,targetX:Q,targetY:Q,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:et,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Q,underlineThickness:Q,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Q,values:null,vAlphabetic:Q,vMathematical:Q,vectorEffect:null,vHanging:Q,vIdeographic:Q,version:null,vertAdvY:Q,vertOriginX:Q,vertOriginY:Q,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Q,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Ml}),Pl=en({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Nl=en({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:_l}),Ll=en({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),ng={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},rg=/[A-Z]/g,Fl=/-[a-z]/g,ig=/^data[-\w.:]+$/i;function og(e,t){const n=eo(t);let r=t,i=Qe;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&ig.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Fl,sg);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Fl.test(o)){let a=o.replace(rg,ag);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=io}return new i(r,t)}function ag(e){return"-"+e.toLowerCase()}function sg(e){return e.charAt(1).toUpperCase()}const lg=Tl([Dl,eg,Pl,Nl,Ll],"html"),oo=Tl([Dl,tg,Pl,Nl,Ll],"svg");function ug(e){return e.join(" ").trim()}var ao={},Rl=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,cg=/\n/g,fg=/^\s*/,dg=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,pg=/^:\s*/,hg=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,mg=/^[;\s]*/,gg=/^\s+|\s+$/g,yg=`
|
|
27
|
-
`,Bl="/",zl="*",Ht="",vg="comment",bg="declaration";function wg(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(m){var h=m.match(cg);h&&(n+=h.length);var g=m.lastIndexOf(yg);r=~g?m.length-g:r+m.length}function o(){var m={line:n,column:r};return function(h){return h.position=new a(m),u(),h}}function a(m){this.start=m,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function s(m){var h=new Error(t.source+":"+n+":"+r+": "+m);if(h.reason=m,h.filename=t.source,h.line=n,h.column=r,h.source=e,!t.silent)throw h}function l(m){var h=m.exec(e);if(h){var g=h[0];return i(g),e=e.slice(g.length),h}}function u(){l(fg)}function f(m){var h;for(m=m||[];h=c();)h!==!1&&m.push(h);return m}function c(){var m=o();if(!(Bl!=e.charAt(0)||zl!=e.charAt(1))){for(var h=2;Ht!=e.charAt(h)&&(zl!=e.charAt(h)||Bl!=e.charAt(h+1));)++h;if(h+=2,Ht===e.charAt(h-1))return s("End of comment missing");var g=e.slice(2,h-2);return r+=2,i(g),e=e.slice(h),r+=2,m({type:vg,comment:g})}}function p(){var m=o(),h=l(dg);if(h){if(c(),!l(pg))return s("property missing ':'");var g=l(hg),y=m({type:bg,property:$l(h[0].replace(Rl,Ht)),value:g?$l(g[0].replace(Rl,Ht)):Ht});return l(mg),y}}function d(){var m=[];f(m);for(var h;h=p();)h!==!1&&(m.push(h),f(m));return m}return u(),d()}function $l(e){return e?e.replace(gg,Ht):Ht}var xg=wg,kg=$t&&$t.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ao,"__esModule",{value:!0}),ao.default=Eg;const Sg=kg(xg);function Eg(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,Sg.default)(e),i=typeof t=="function";return r.forEach(o=>{if(o.type!=="declaration")return;const{property:a,value:s}=o;i?t(a,s,o):s&&(n=n||{},n[a]=s)}),n}var Er={};Object.defineProperty(Er,"__esModule",{value:!0}),Er.camelCase=void 0;var Cg=/^--[a-zA-Z0-9_-]+$/,Ag=/-([a-z])/g,Ig=/^[^-]+$/,Tg=/^-(webkit|moz|ms|o|khtml)-/,Og=/^-(ms)-/,Dg=function(e){return!e||Ig.test(e)||Cg.test(e)},Mg=function(e,t){return t.toUpperCase()},jl=function(e,t){return"".concat(t,"-")},_g=function(e,t){return t===void 0&&(t={}),Dg(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(Og,jl):e=e.replace(Tg,jl),e.replace(Ag,Mg))};Er.camelCase=_g;var Pg=$t&&$t.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Ng=Pg(ao),Lg=Er;function so(e,t){var n={};return!e||typeof e!="string"||(0,Ng.default)(e,function(r,i){r&&i&&(n[(0,Lg.camelCase)(r,t)]=i)}),n}so.default=so;var Fg=so;const Rg=jt(Fg),Ul=Hl("end"),lo=Hl("start");function Hl(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Bg(e){const t=lo(e),n=Ul(e);if(t&&n)return{start:t,end:n}}function Fn(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Wl(e.position):"start"in e||"end"in e?Wl(e):"line"in e||"column"in e?uo(e):""}function uo(e){return Vl(e&&e.line)+":"+Vl(e&&e.column)}function Wl(e){return uo(e&&e.start)+"-"+uo(e&&e.end)}function Vl(e){return e&&typeof e=="number"?e:1}class He extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},a=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(a=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const s=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=Fn(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=a&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}He.prototype.file="",He.prototype.name="",He.prototype.reason="",He.prototype.message="",He.prototype.stack="",He.prototype.column=void 0,He.prototype.line=void 0,He.prototype.ancestors=void 0,He.prototype.cause=void 0,He.prototype.fatal=void 0,He.prototype.place=void 0,He.prototype.ruleId=void 0,He.prototype.source=void 0;const co={}.hasOwnProperty,zg=new Map,$g=/[A-Z]/g,jg=new Set(["table","tbody","thead","tfoot","tr"]),Ug=new Set(["td","th"]),ql="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Hg(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Jg(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Qg(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?oo:lg,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=Kl(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function Kl(e,t,n){if(t.type==="element")return Wg(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Vg(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Kg(e,t,n);if(t.type==="mdxjsEsm")return qg(e,t);if(t.type==="root")return Yg(e,t,n);if(t.type==="text")return Gg(e,t)}function Wg(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=oo,e.schema=i),e.ancestors.push(t);const o=Gl(e,t.tagName,!1),a=Zg(e,t);let s=po(e,t);return jg.has(t.tagName)&&(s=s.filter(function(l){return typeof l=="string"?!Zm(l):!0})),Yl(e,a,o,t),fo(a,s),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function Vg(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Rn(e,t.position)}function qg(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Rn(e,t.position)}function Kg(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=oo,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:Gl(e,t.name,!0),a=Xg(e,t),s=po(e,t);return Yl(e,a,o,t),fo(a,s),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function Yg(e,t,n){const r={};return fo(r,po(e,t)),e.create(t,e.Fragment,r,n)}function Gg(e,t){return t.value}function Yl(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function fo(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Qg(e,t,n){return r;function r(i,o,a,s){const u=Array.isArray(a.children)?n:t;return s?u(o,a,s):u(o,a)}}function Jg(e,t){return n;function n(r,i,o,a){const s=Array.isArray(o.children),l=lo(r);return t(i,o,a,s,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function Zg(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&co.call(t.properties,i)){const o=ey(e,i,t.properties[i]);if(o){const[a,s]=o;e.tableCellAlignToStyle&&a==="align"&&typeof s=="string"&&Ug.has(t.tagName)?r=s:n[a]=s}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Xg(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const a=o.expression;a.type;const s=a.properties[0];s.type,Object.assign(n,e.evaluater.evaluateExpression(s.argument))}else Rn(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const s=r.value.data.estree.body[0];s.type,o=e.evaluater.evaluateExpression(s.expression)}else Rn(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function po(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:zg;for(;++r<t.children.length;){const o=t.children[r];let a;if(e.passKeys){const l=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(l){const u=i.get(l)||0;a=l+"-"+u,i.set(l,u+1)}}const s=Kl(e,o,a);s!==void 0&&n.push(s)}return n}function ey(e,t,n){const r=og(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Km(n):ug(n)),r.property==="style"){let i=typeof n=="object"?n:ty(e,String(n));return e.stylePropertyNameCase==="css"&&(i=ny(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?ng[r.property]||r.property:r.attribute,n]}}function ty(e,t){try{return Rg(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new He("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=ql+"#cannot-parse-style-attribute",i}}function Gl(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,a;for(;++o<i.length;){const s=Al(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};a=a?{type:"MemberExpression",object:a,property:s,computed:!!(o&&s.type==="Literal"),optional:!1}:s}r=a}else r=Al(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return co.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Rn(e)}function Rn(e,t){const n=new He("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=ql+"#cannot-handle-mdx-estrees-without-createevaluater",n}function ny(e){const t={};let n;for(n in e)co.call(e,n)&&(t[ry(n)]=e[n]);return t}function ry(e){let t=e.replace($g,iy);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function iy(e){return"-"+e.toLowerCase()}const ho={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},oy={};function mo(e,t){const n=oy,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Ql(e,r,i)}function Ql(e,t,n){if(ay(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Jl(e.children,t,n)}return Array.isArray(e)?Jl(e,t,n):""}function Jl(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Ql(e[i],t,n);return r.join("")}function ay(e){return!!(e&&typeof e=="object")}const Zl=document.createElement("i");function go(e){const t="&"+e+";";Zl.innerHTML=t;const n=Zl.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function tt(e,t,n,r){const i=e.length;let o=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);o<r.length;)a=r.slice(o,o+1e4),a.unshift(t,0),e.splice(...a),o+=1e4,t+=1e4}function it(e,t){return e.length>0?(tt(e,e.length,0,t),e):t}const Xl={}.hasOwnProperty;function eu(e){const t={};let n=-1;for(;++n<e.length;)sy(t,e[n]);return t}function sy(e,t){let n;for(n in t){const i=(Xl.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let a;if(o)for(a in o){Xl.call(i,a)||(i[a]=[]);const s=o[a];ly(i[a],Array.isArray(s)?s:s?[s]:[])}}}function ly(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);tt(e,0,0,r)}function tu(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ut(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const qe=Dt(/[A-Za-z]/),We=Dt(/[\dA-Za-z]/),uy=Dt(/[#-'*+\--9=?A-Z^-~]/);function Cr(e){return e!==null&&(e<32||e===127)}const yo=Dt(/\d/),cy=Dt(/[\dA-Fa-f]/),fy=Dt(/[!-/:-@[-`{-~]/);function ce(e){return e!==null&&e<-2}function Ie(e){return e!==null&&(e<0||e===32)}function ye(e){return e===-2||e===-1||e===32}const Ar=Dt(new RegExp("\\p{P}|\\p{S}","u")),Wt=Dt(/\s/);function Dt(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function tn(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let a="";if(o===37&&We(e.charCodeAt(n+1))&&We(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(a=String.fromCharCode(o));else if(o>55295&&o<57344){const s=e.charCodeAt(n+1);o<56320&&s>56319&&s<57344?(a=String.fromCharCode(o,s),i=1):a="�"}else a=String.fromCharCode(o);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function be(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(l){return ye(l)?(e.enter(n),s(l)):t(l)}function s(l){return ye(l)&&o++<i?(e.consume(l),s):(e.exit(n),t(l))}}const dy={tokenize:py};function py(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),be(e,t,"linePrefix")}function i(s){return e.enter("paragraph"),o(s)}function o(s){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,a(s)}function a(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return ce(s)?(e.consume(s),e.exit("chunkText"),o):(e.consume(s),a)}}const hy={tokenize:my},nu={tokenize:gy};function my(e){const t=this,n=[];let r=0,i,o,a;return s;function s(w){if(r<n.length){const A=n[r];return t.containerState=A[1],e.attempt(A[0].continuation,l,u)(w)}return u(w)}function l(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();const A=t.events.length;let k=A,C;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){C=t.events[k][1].end;break}y(r);let T=A;for(;T<t.events.length;)t.events[T][1].end={...C},T++;return tt(t.events,k+1,0,t.events.slice(A)),t.events.length=T,u(w)}return s(w)}function u(w){if(r===n.length){if(!i)return p(w);if(i.currentConstruct&&i.currentConstruct.concrete)return m(w);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(nu,f,c)(w)}function f(w){return i&&v(),y(r),p(w)}function c(w){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,m(w)}function p(w){return t.containerState={},e.attempt(nu,d,m)(w)}function d(w){return r++,n.push([t.currentConstruct,t.containerState]),p(w)}function m(w){if(w===null){i&&v(),y(0),e.consume(w);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),h(w)}function h(w){if(w===null){g(e.exit("chunkFlow"),!0),y(0),e.consume(w);return}return ce(w)?(e.consume(w),g(e.exit("chunkFlow")),r=0,t.interrupt=void 0,s):(e.consume(w),h)}function g(w,A){const k=t.sliceStream(w);if(A&&k.push(null),w.previous=o,o&&(o.next=w),o=w,i.defineSkip(w.start),i.write(k),t.parser.lazy[w.start.line]){let C=i.events.length;for(;C--;)if(i.events[C][1].start.offset<a&&(!i.events[C][1].end||i.events[C][1].end.offset>a))return;const T=t.events.length;let P=T,F,I;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){if(F){I=t.events[P][1].end;break}F=!0}for(y(r),C=T;C<t.events.length;)t.events[C][1].end={...I},C++;tt(t.events,P+1,0,t.events.slice(T)),t.events.length=C}}function y(w){let A=n.length;for(;A-- >w;){const k=n[A];t.containerState=k[1],k[0].exit.call(t,e)}n.length=w}function v(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function gy(e,t,n){return be(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function nn(e){if(e===null||Ie(e)||Wt(e))return 1;if(Ar(e))return 2}function Ir(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const vo={name:"attention",resolveAll:yy,tokenize:vy};function yy(e,t){let n=-1,r,i,o,a,s,l,u,f;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const c={...e[r][1].end},p={...e[n][1].start};ru(c,-l),ru(p,l),a={type:l>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},s={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},o={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...a.start},end:{...s.end}},e[r][1].end={...a.start},e[n][1].start={...s.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=it(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=it(u,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",o,t]]),u=it(u,Ir(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=it(u,[["exit",o,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,u=it(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,tt(e,r-1,n-r+3,u),n=r+u.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function vy(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=nn(r);let o;return a;function a(l){return o=l,e.enter("attentionSequence"),s(l)}function s(l){if(l===o)return e.consume(l),s;const u=e.exit("attentionSequence"),f=nn(l),c=!f||f===2&&i||n.includes(l),p=!i||i===2&&f||n.includes(r);return u._open=!!(o===42?c:c&&(i||!p)),u._close=!!(o===42?p:p&&(f||!c)),t(l)}}function ru(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const by={name:"autolink",tokenize:wy};function wy(e,t,n){let r=0;return i;function i(d){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(d){return qe(d)?(e.consume(d),a):d===64?n(d):u(d)}function a(d){return d===43||d===45||d===46||We(d)?(r=1,s(d)):u(d)}function s(d){return d===58?(e.consume(d),r=0,l):(d===43||d===45||d===46||We(d))&&r++<32?(e.consume(d),s):(r=0,u(d))}function l(d){return d===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):d===null||d===32||d===60||Cr(d)?n(d):(e.consume(d),l)}function u(d){return d===64?(e.consume(d),f):uy(d)?(e.consume(d),u):n(d)}function f(d){return We(d)?c(d):n(d)}function c(d){return d===46?(e.consume(d),r=0,f):d===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):p(d)}function p(d){if((d===45||We(d))&&r++<63){const m=d===45?p:c;return e.consume(d),m}return n(d)}}const Bn={partial:!0,tokenize:xy};function xy(e,t,n){return r;function r(o){return ye(o)?be(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||ce(o)?t(o):n(o)}}const iu={continuation:{tokenize:Sy},exit:Ey,name:"blockQuote",tokenize:ky};function ky(e,t,n){const r=this;return i;function i(a){if(a===62){const s=r.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),o}return n(a)}function o(a){return ye(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function Sy(e,t,n){const r=this;return i;function i(a){return ye(a)?be(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):o(a)}function o(a){return e.attempt(iu,t,n)(a)}}function Ey(e){e.exit("blockQuote")}const ou={name:"characterEscape",tokenize:Cy};function Cy(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return fy(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const au={name:"characterReference",tokenize:Ay};function Ay(e,t,n){const r=this;let i=0,o,a;return s;function s(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),l}function l(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),o=31,a=We,f(c))}function u(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,a=cy,f):(e.enter("characterReferenceValue"),o=7,a=yo,f(c))}function f(c){if(c===59&&i){const p=e.exit("characterReferenceValue");return a===We&&!go(r.sliceSerialize(p))?n(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(c)&&i++<o?(e.consume(c),f):n(c)}}const su={partial:!0,tokenize:Ty},lu={concrete:!0,name:"codeFenced",tokenize:Iy};function Iy(e,t,n){const r=this,i={partial:!0,tokenize:k};let o=0,a=0,s;return l;function l(C){return u(C)}function u(C){const T=r.events[r.events.length-1];return o=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,s=C,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(C)}function f(C){return C===s?(a++,e.consume(C),f):a<3?n(C):(e.exit("codeFencedFenceSequence"),ye(C)?be(e,c,"whitespace")(C):c(C))}function c(C){return C===null||ce(C)?(e.exit("codeFencedFence"),r.interrupt?t(C):e.check(su,h,A)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(C))}function p(C){return C===null||ce(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(C)):ye(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),be(e,d,"whitespace")(C)):C===96&&C===s?n(C):(e.consume(C),p)}function d(C){return C===null||ce(C)?c(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(C))}function m(C){return C===null||ce(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(C)):C===96&&C===s?n(C):(e.consume(C),m)}function h(C){return e.attempt(i,A,g)(C)}function g(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),y}function y(C){return o>0&&ye(C)?be(e,v,"linePrefix",o+1)(C):v(C)}function v(C){return C===null||ce(C)?e.check(su,h,A)(C):(e.enter("codeFlowValue"),w(C))}function w(C){return C===null||ce(C)?(e.exit("codeFlowValue"),v(C)):(e.consume(C),w)}function A(C){return e.exit("codeFenced"),t(C)}function k(C,T,P){let F=0;return I;function I(D){return C.enter("lineEnding"),C.consume(D),C.exit("lineEnding"),O}function O(D){return C.enter("codeFencedFence"),ye(D)?be(C,j,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):j(D)}function j(D){return D===s?(C.enter("codeFencedFenceSequence"),z(D)):P(D)}function z(D){return D===s?(F++,C.consume(D),z):F>=a?(C.exit("codeFencedFenceSequence"),ye(D)?be(C,M,"whitespace")(D):M(D)):P(D)}function M(D){return D===null||ce(D)?(C.exit("codeFencedFence"),T(D)):P(D)}}}function Ty(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const bo={name:"codeIndented",tokenize:Dy},Oy={partial:!0,tokenize:My};function Dy(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),be(e,o,"linePrefix",5)(u)}function o(u){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?a(u):n(u)}function a(u){return u===null?l(u):ce(u)?e.attempt(Oy,a,l)(u):(e.enter("codeFlowValue"),s(u))}function s(u){return u===null||ce(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),s)}function l(u){return e.exit("codeIndented"),t(u)}}function My(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):ce(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):be(e,o,"linePrefix",5)(a)}function o(a){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):ce(a)?i(a):n(a)}}const _y={name:"codeText",previous:Ny,resolve:Py,tokenize:Ly};function Py(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Ny(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Ly(e,t,n){let r=0,i,o;return a;function a(c){return e.enter("codeText"),e.enter("codeTextSequence"),s(c)}function s(c){return c===96?(e.consume(c),r++,s):(e.exit("codeTextSequence"),l(c))}function l(c){return c===null?n(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),l):c===96?(o=e.enter("codeTextSequence"),i=0,f(c)):ce(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l):(e.enter("codeTextData"),u(c))}function u(c){return c===null||c===32||c===96||ce(c)?(e.exit("codeTextData"),l(c)):(e.consume(c),u)}function f(c){return c===96?(e.consume(c),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(c)):(o.type="codeTextData",u(c))}}class Fy{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&zn(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),zn(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),zn(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);zn(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);zn(this.left,n.reverse())}}}function zn(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function uu(e){const t={};let n=-1,r,i,o,a,s,l,u;const f=new Fy(e);for(;++n<f.length;){for(;n in t;)n=t[n];if(r=f.get(n),n&&r[1].type==="chunkFlow"&&f.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Ry(f,n)),n=t[n],u=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(a=f.get(o),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=o);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},s=f.slice(i,n),s.unshift(r),f.splice(i,n-i+1,s))}}return tt(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!u}function Ry(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const s=a.events,l=[],u={};let f,c,p=-1,d=n,m=0,h=0;const g=[h];for(;d;){for(;e.get(++i)[1]!==d;);o.push(i),d._tokenizer||(f=r.sliceStream(d),d.next||f.push(null),c&&a.defineSkip(d.start),d._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(f),d._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),c=d,d=d.next}for(d=n;++p<s.length;)s[p][0]==="exit"&&s[p-1][0]==="enter"&&s[p][1].type===s[p-1][1].type&&s[p][1].start.line!==s[p][1].end.line&&(h=p+1,g.push(h),d._tokenizer=void 0,d.previous=void 0,d=d.next);for(a.events=[],d?(d._tokenizer=void 0,d.previous=void 0):g.pop(),p=g.length;p--;){const y=s.slice(g[p],g[p+1]),v=o.pop();l.push([v,v+y.length-1]),e.splice(v,2,y)}for(l.reverse(),p=-1;++p<l.length;)u[m+l[p][0]]=m+l[p][1],m+=l[p][1]-l[p][0]-1;return u}const By={resolve:$y,tokenize:jy},zy={partial:!0,tokenize:Uy};function $y(e){return uu(e),e}function jy(e,t){let n;return r;function r(s){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(s)}function i(s){return s===null?o(s):ce(s)?e.check(zy,a,o)(s):(e.consume(s),i)}function o(s){return e.exit("chunkContent"),e.exit("content"),t(s)}function a(s){return e.consume(s),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function Uy(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),be(e,o,"linePrefix")}function o(a){if(a===null||ce(a))return n(a);const s=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function cu(e,t,n,r,i,o,a,s,l){const u=l||Number.POSITIVE_INFINITY;let f=0;return c;function c(y){return y===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(y),e.exit(o),p):y===null||y===32||y===41||Cr(y)?n(y):(e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),h(y))}function p(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),d(y))}function d(y){return y===62?(e.exit("chunkString"),e.exit(s),p(y)):y===null||y===60||ce(y)?n(y):(e.consume(y),y===92?m:d)}function m(y){return y===60||y===62||y===92?(e.consume(y),d):d(y)}function h(y){return!f&&(y===null||y===41||Ie(y))?(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(y)):f<u&&y===40?(e.consume(y),f++,h):y===41?(e.consume(y),f--,h):y===null||y===32||y===40||Cr(y)?n(y):(e.consume(y),y===92?g:h)}function g(y){return y===40||y===41||y===92?(e.consume(y),h):h(y)}}function fu(e,t,n,r,i,o){const a=this;let s=0,l;return u;function u(d){return e.enter(r),e.enter(i),e.consume(d),e.exit(i),e.enter(o),f}function f(d){return s>999||d===null||d===91||d===93&&!l||d===94&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs?n(d):d===93?(e.exit(o),e.enter(i),e.consume(d),e.exit(i),e.exit(r),t):ce(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),c(d))}function c(d){return d===null||d===91||d===93||ce(d)||s++>999?(e.exit("chunkString"),f(d)):(e.consume(d),l||(l=!ye(d)),d===92?p:c)}function p(d){return d===91||d===92||d===93?(e.consume(d),s++,c):c(d)}}function du(e,t,n,r,i,o){let a;return s;function s(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),a=p===40?41:p,l):n(p)}function l(p){return p===a?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(o),u(p))}function u(p){return p===a?(e.exit(o),l(a)):p===null?n(p):ce(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),be(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===a||p===null||ce(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?c:f)}function c(p){return p===a||p===92?(e.consume(p),f):f(p)}}function $n(e,t){let n;return r;function r(i){return ce(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ye(i)?be(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Hy={name:"definition",tokenize:Vy},Wy={partial:!0,tokenize:qy};function Vy(e,t,n){const r=this;let i;return o;function o(d){return e.enter("definition"),a(d)}function a(d){return fu.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function s(d){return i=ut(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),d===58?(e.enter("definitionMarker"),e.consume(d),e.exit("definitionMarker"),l):n(d)}function l(d){return Ie(d)?$n(e,u)(d):u(d)}function u(d){return cu(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function f(d){return e.attempt(Wy,c,c)(d)}function c(d){return ye(d)?be(e,p,"whitespace")(d):p(d)}function p(d){return d===null||ce(d)?(e.exit("definition"),r.parser.defined.push(i),t(d)):n(d)}}function qy(e,t,n){return r;function r(s){return Ie(s)?$n(e,i)(s):n(s)}function i(s){return du(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return ye(s)?be(e,a,"whitespace")(s):a(s)}function a(s){return s===null||ce(s)?t(s):n(s)}}const Ky={name:"hardBreakEscape",tokenize:Yy};function Yy(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return ce(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const Gy={name:"headingAtx",resolve:Qy,tokenize:Jy};function Qy(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},tt(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function Jy(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),a(f)}function a(f){return f===35&&r++<6?(e.consume(f),a):f===null||Ie(f)?(e.exit("atxHeadingSequence"),s(f)):n(f)}function s(f){return f===35?(e.enter("atxHeadingSequence"),l(f)):f===null||ce(f)?(e.exit("atxHeading"),t(f)):ye(f)?be(e,s,"whitespace")(f):(e.enter("atxHeadingText"),u(f))}function l(f){return f===35?(e.consume(f),l):(e.exit("atxHeadingSequence"),s(f))}function u(f){return f===null||f===35||Ie(f)?(e.exit("atxHeadingText"),s(f)):(e.consume(f),u)}}const Zy=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],pu=["pre","script","style","textarea"],Xy={concrete:!0,name:"htmlFlow",resolveTo:nv,tokenize:rv},ev={partial:!0,tokenize:ov},tv={partial:!0,tokenize:iv};function nv(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function rv(e,t,n){const r=this;let i,o,a,s,l;return u;function u(x){return f(x)}function f(x){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(x),c}function c(x){return x===33?(e.consume(x),p):x===47?(e.consume(x),o=!0,h):x===63?(e.consume(x),i=3,r.interrupt?t:b):qe(x)?(e.consume(x),a=String.fromCharCode(x),g):n(x)}function p(x){return x===45?(e.consume(x),i=2,d):x===91?(e.consume(x),i=5,s=0,m):qe(x)?(e.consume(x),i=4,r.interrupt?t:b):n(x)}function d(x){return x===45?(e.consume(x),r.interrupt?t:b):n(x)}function m(x){const W="CDATA[";return x===W.charCodeAt(s++)?(e.consume(x),s===W.length?r.interrupt?t:j:m):n(x)}function h(x){return qe(x)?(e.consume(x),a=String.fromCharCode(x),g):n(x)}function g(x){if(x===null||x===47||x===62||Ie(x)){const W=x===47,ee=a.toLowerCase();return!W&&!o&&pu.includes(ee)?(i=1,r.interrupt?t(x):j(x)):Zy.includes(a.toLowerCase())?(i=6,W?(e.consume(x),y):r.interrupt?t(x):j(x)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(x):o?v(x):w(x))}return x===45||We(x)?(e.consume(x),a+=String.fromCharCode(x),g):n(x)}function y(x){return x===62?(e.consume(x),r.interrupt?t:j):n(x)}function v(x){return ye(x)?(e.consume(x),v):I(x)}function w(x){return x===47?(e.consume(x),I):x===58||x===95||qe(x)?(e.consume(x),A):ye(x)?(e.consume(x),w):I(x)}function A(x){return x===45||x===46||x===58||x===95||We(x)?(e.consume(x),A):k(x)}function k(x){return x===61?(e.consume(x),C):ye(x)?(e.consume(x),k):w(x)}function C(x){return x===null||x===60||x===61||x===62||x===96?n(x):x===34||x===39?(e.consume(x),l=x,T):ye(x)?(e.consume(x),C):P(x)}function T(x){return x===l?(e.consume(x),l=null,F):x===null||ce(x)?n(x):(e.consume(x),T)}function P(x){return x===null||x===34||x===39||x===47||x===60||x===61||x===62||x===96||Ie(x)?k(x):(e.consume(x),P)}function F(x){return x===47||x===62||ye(x)?w(x):n(x)}function I(x){return x===62?(e.consume(x),O):n(x)}function O(x){return x===null||ce(x)?j(x):ye(x)?(e.consume(x),O):n(x)}function j(x){return x===45&&i===2?(e.consume(x),B):x===60&&i===1?(e.consume(x),U):x===62&&i===4?(e.consume(x),N):x===63&&i===3?(e.consume(x),b):x===93&&i===5?(e.consume(x),V):ce(x)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(ev,H,z)(x)):x===null||ce(x)?(e.exit("htmlFlowData"),z(x)):(e.consume(x),j)}function z(x){return e.check(tv,M,H)(x)}function M(x){return e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),D}function D(x){return x===null||ce(x)?z(x):(e.enter("htmlFlowData"),j(x))}function B(x){return x===45?(e.consume(x),b):j(x)}function U(x){return x===47?(e.consume(x),a="",$):j(x)}function $(x){if(x===62){const W=a.toLowerCase();return pu.includes(W)?(e.consume(x),N):j(x)}return qe(x)&&a.length<8?(e.consume(x),a+=String.fromCharCode(x),$):j(x)}function V(x){return x===93?(e.consume(x),b):j(x)}function b(x){return x===62?(e.consume(x),N):x===45&&i===2?(e.consume(x),b):j(x)}function N(x){return x===null||ce(x)?(e.exit("htmlFlowData"),H(x)):(e.consume(x),N)}function H(x){return e.exit("htmlFlow"),t(x)}}function iv(e,t,n){const r=this;return i;function i(a){return ce(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):n(a)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function ov(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Bn,t,n)}}const av={name:"htmlText",tokenize:sv};function sv(e,t,n){const r=this;let i,o,a;return s;function s(b){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(b),l}function l(b){return b===33?(e.consume(b),u):b===47?(e.consume(b),k):b===63?(e.consume(b),w):qe(b)?(e.consume(b),P):n(b)}function u(b){return b===45?(e.consume(b),f):b===91?(e.consume(b),o=0,m):qe(b)?(e.consume(b),v):n(b)}function f(b){return b===45?(e.consume(b),d):n(b)}function c(b){return b===null?n(b):b===45?(e.consume(b),p):ce(b)?(a=c,U(b)):(e.consume(b),c)}function p(b){return b===45?(e.consume(b),d):c(b)}function d(b){return b===62?B(b):b===45?p(b):c(b)}function m(b){const N="CDATA[";return b===N.charCodeAt(o++)?(e.consume(b),o===N.length?h:m):n(b)}function h(b){return b===null?n(b):b===93?(e.consume(b),g):ce(b)?(a=h,U(b)):(e.consume(b),h)}function g(b){return b===93?(e.consume(b),y):h(b)}function y(b){return b===62?B(b):b===93?(e.consume(b),y):h(b)}function v(b){return b===null||b===62?B(b):ce(b)?(a=v,U(b)):(e.consume(b),v)}function w(b){return b===null?n(b):b===63?(e.consume(b),A):ce(b)?(a=w,U(b)):(e.consume(b),w)}function A(b){return b===62?B(b):w(b)}function k(b){return qe(b)?(e.consume(b),C):n(b)}function C(b){return b===45||We(b)?(e.consume(b),C):T(b)}function T(b){return ce(b)?(a=T,U(b)):ye(b)?(e.consume(b),T):B(b)}function P(b){return b===45||We(b)?(e.consume(b),P):b===47||b===62||Ie(b)?F(b):n(b)}function F(b){return b===47?(e.consume(b),B):b===58||b===95||qe(b)?(e.consume(b),I):ce(b)?(a=F,U(b)):ye(b)?(e.consume(b),F):B(b)}function I(b){return b===45||b===46||b===58||b===95||We(b)?(e.consume(b),I):O(b)}function O(b){return b===61?(e.consume(b),j):ce(b)?(a=O,U(b)):ye(b)?(e.consume(b),O):F(b)}function j(b){return b===null||b===60||b===61||b===62||b===96?n(b):b===34||b===39?(e.consume(b),i=b,z):ce(b)?(a=j,U(b)):ye(b)?(e.consume(b),j):(e.consume(b),M)}function z(b){return b===i?(e.consume(b),i=void 0,D):b===null?n(b):ce(b)?(a=z,U(b)):(e.consume(b),z)}function M(b){return b===null||b===34||b===39||b===60||b===61||b===96?n(b):b===47||b===62||Ie(b)?F(b):(e.consume(b),M)}function D(b){return b===47||b===62||Ie(b)?F(b):n(b)}function B(b){return b===62?(e.consume(b),e.exit("htmlTextData"),e.exit("htmlText"),t):n(b)}function U(b){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),$}function $(b){return ye(b)?be(e,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):V(b)}function V(b){return e.enter("htmlTextData"),a(b)}}const wo={name:"labelEnd",resolveAll:fv,resolveTo:dv,tokenize:pv},lv={tokenize:hv},uv={tokenize:mv},cv={tokenize:gv};function fv(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&tt(e,0,e.length,n),e}function dv(e,t){let n=e.length,r=0,i,o,a,s;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const l={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[o][1].start},end:{...e[a][1].end}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[a-2][1].start}};return s=[["enter",l,t],["enter",u,t]],s=it(s,e.slice(o+1,o+r+3)),s=it(s,[["enter",f,t]]),s=it(s,Ir(t.parser.constructs.insideSpan.null,e.slice(o+r+4,a-3),t)),s=it(s,[["exit",f,t],e[a-2],e[a-1],["exit",u,t]]),s=it(s,e.slice(a+1)),s=it(s,[["exit",l,t]]),tt(e,o,e.length,s),e}function pv(e,t,n){const r=this;let i=r.events.length,o,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return s;function s(p){return o?o._inactive?c(p):(a=r.parser.defined.includes(ut(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),l):n(p)}function l(p){return p===40?e.attempt(lv,f,a?f:c)(p):p===91?e.attempt(uv,f,a?u:c)(p):a?f(p):c(p)}function u(p){return e.attempt(cv,f,c)(p)}function f(p){return t(p)}function c(p){return o._balanced=!0,n(p)}}function hv(e,t,n){return r;function r(c){return e.enter("resource"),e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),i}function i(c){return Ie(c)?$n(e,o)(c):o(c)}function o(c){return c===41?f(c):cu(e,a,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function a(c){return Ie(c)?$n(e,l)(c):f(c)}function s(c){return n(c)}function l(c){return c===34||c===39||c===40?du(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):f(c)}function u(c){return Ie(c)?$n(e,f)(c):f(c)}function f(c){return c===41?(e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),e.exit("resource"),t):n(c)}}function mv(e,t,n){const r=this;return i;function i(s){return fu.call(r,e,o,a,"reference","referenceMarker","referenceString")(s)}function o(s){return r.parser.defined.includes(ut(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(s):n(s)}function a(s){return n(s)}}function gv(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const yv={name:"labelStartImage",resolveAll:wo.resolveAll,tokenize:vv};function vv(e,t,n){const r=this;return i;function i(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),o}function o(s){return s===91?(e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),a):n(s)}function a(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const bv={name:"labelStartLink",resolveAll:wo.resolveAll,tokenize:wv};function wv(e,t,n){const r=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),o}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const xo={name:"lineEnding",tokenize:xv};function xv(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),be(e,t,"linePrefix")}}const Tr={name:"thematicBreak",tokenize:kv};function kv(e,t,n){let r=0,i;return o;function o(u){return e.enter("thematicBreak"),a(u)}function a(u){return i=u,s(u)}function s(u){return u===i?(e.enter("thematicBreakSequence"),l(u)):r>=3&&(u===null||ce(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===i?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),ye(u)?be(e,s,"whitespace")(u):s(u))}}const Je={continuation:{tokenize:Av},exit:Tv,name:"list",tokenize:Cv},Sv={partial:!0,tokenize:Ov},Ev={partial:!0,tokenize:Iv};function Cv(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return s;function s(d){const m=r.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||d===r.containerState.marker:yo(d)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),d===42||d===45?e.check(Tr,n,u)(d):u(d);if(!r.interrupt||d===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(d)}return n(d)}function l(d){return yo(d)&&++a<10?(e.consume(d),l):(!r.interrupt||a<2)&&(r.containerState.marker?d===r.containerState.marker:d===41||d===46)?(e.exit("listItemValue"),u(d)):n(d)}function u(d){return e.enter("listItemMarker"),e.consume(d),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||d,e.check(Bn,r.interrupt?n:f,e.attempt(Sv,p,c))}function f(d){return r.containerState.initialBlankLine=!0,o++,p(d)}function c(d){return ye(d)?(e.enter("listItemPrefixWhitespace"),e.consume(d),e.exit("listItemPrefixWhitespace"),p):n(d)}function p(d){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(d)}}function Av(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Bn,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,be(e,t,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!ye(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Ev,t,a)(s))}function a(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,be(e,e.attempt(Je,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function Iv(e,t,n){const r=this;return be(e,i,"listItemIndent",r.containerState.size+1);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(o):n(o)}}function Tv(e){e.exit(this.containerState.type)}function Ov(e,t,n){const r=this;return be(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const a=r.events[r.events.length-1];return!ye(o)&&a&&a[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const hu={name:"setextUnderline",resolveTo:Dv,tokenize:Mv};function Dv(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",a,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function Mv(e,t,n){const r=this;let i;return o;function o(u){let f=r.events.length,c;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){c=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=u,a(u)):n(u)}function a(u){return e.enter("setextHeadingLineSequence"),s(u)}function s(u){return u===i?(e.consume(u),s):(e.exit("setextHeadingLineSequence"),ye(u)?be(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||ce(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const _v={tokenize:Pv};function Pv(e){const t=this,n=e.attempt(Bn,r,e.attempt(this.parser.constructs.flowInitial,i,be(e,e.attempt(this.parser.constructs.flow,i,e.attempt(By,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Nv={resolveAll:gu()},Lv=mu("string"),Fv=mu("text");function mu(e){return{resolveAll:gu(e==="text"?Rv:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,a,s);return a;function a(f){return u(f)?o(f):s(f)}function s(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),l}function l(f){return u(f)?(n.exit("data"),o(f)):(n.consume(f),l)}function u(f){if(f===null)return!0;const c=i[f];let p=-1;if(c)for(;++p<c.length;){const d=c[p];if(!d.previous||d.previous.call(r,r.previous))return!0}return!1}}}function gu(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function Rv(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,a=-1,s=0,l;for(;o--;){const u=i[o];if(typeof u=="string"){for(a=u.length;u.charCodeAt(a-1)===32;)s++,a--;if(a)break;a=-1}else if(u===-2)l=!0,s++;else if(u!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){const u={type:n===e.length||l||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?a:r.start._bufferIndex+a,_index:r.start._index+o,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const Bv=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:Hy},disable:{null:[]},document:{42:Je,43:Je,45:Je,48:Je,49:Je,50:Je,51:Je,52:Je,53:Je,54:Je,55:Je,56:Je,57:Je,62:iu},flow:{35:Gy,42:Tr,45:[hu,Tr],60:Xy,61:hu,95:Tr,96:lu,126:lu},flowInitial:{[-2]:bo,[-1]:bo,32:bo},insideSpan:{null:[vo,Nv]},string:{38:au,92:ou},text:{[-5]:xo,[-4]:xo,[-3]:xo,33:yv,38:au,42:vo,60:[by,av],91:bv,92:[Ky,ou],93:wo,95:vo,96:_y}},Symbol.toStringTag,{value:"Module"}));function zv(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let a=[],s=[];const l={attempt:T(k),check:T(C),consume:v,enter:w,exit:A,interrupt:T(C,{interrupt:!0})},u={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:p,sliceStream:d,write:c};let f=t.tokenize.call(u,l);return t.resolveAll&&o.push(t),u;function c(O){return a=it(a,O),g(),a[a.length-1]!==null?[]:(P(t,0),u.events=Ir(o,u.events,u),u.events)}function p(O,j){return jv(d(O),j)}function d(O){return $v(a,O)}function m(){const{_bufferIndex:O,_index:j,line:z,column:M,offset:D}=r;return{_bufferIndex:O,_index:j,line:z,column:M,offset:D}}function h(O){i[O.line]=O.column,I()}function g(){let O;for(;r._index<a.length;){const j=a[r._index];if(typeof j=="string")for(O=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===O&&r._bufferIndex<j.length;)y(j.charCodeAt(r._bufferIndex));else y(j)}}function y(O){f=f(O)}function v(O){ce(O)?(r.line++,r.column=1,r.offset+=O===-3?2:1,I()):O!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=O}function w(O,j){const z=j||{};return z.type=O,z.start=m(),u.events.push(["enter",z,u]),s.push(z),z}function A(O){const j=s.pop();return j.end=m(),u.events.push(["exit",j,u]),j}function k(O,j){P(O,j.from)}function C(O,j){j.restore()}function T(O,j){return z;function z(M,D,B){let U,$,V,b;return Array.isArray(M)?H(M):"tokenize"in M?H([M]):N(M);function N(Y){return J;function J(X){const ie=X!==null&&Y[X],K=X!==null&&Y.null,te=[...Array.isArray(ie)?ie:ie?[ie]:[],...Array.isArray(K)?K:K?[K]:[]];return H(te)(X)}}function H(Y){return U=Y,$=0,Y.length===0?B:x(Y[$])}function x(Y){return J;function J(X){return b=F(),V=Y,Y.partial||(u.currentConstruct=Y),Y.name&&u.parser.constructs.disable.null.includes(Y.name)?ee():Y.tokenize.call(j?Object.assign(Object.create(u),j):u,l,W,ee)(X)}}function W(Y){return O(V,b),D}function ee(Y){return b.restore(),++$<U.length?x(U[$]):B}}}function P(O,j){O.resolveAll&&!o.includes(O)&&o.push(O),O.resolve&&tt(u.events,j,u.events.length-j,O.resolve(u.events.slice(j),u)),O.resolveTo&&(u.events=O.resolveTo(u.events,u))}function F(){const O=m(),j=u.previous,z=u.currentConstruct,M=u.events.length,D=Array.from(s);return{from:M,restore:B};function B(){r=O,u.previous=j,u.currentConstruct=z,u.events.length=M,s=D,I()}}function I(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function $v(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,o)];else{if(a=e.slice(n,i),r>-1){const s=a[0];typeof s=="string"?a[0]=s.slice(r):a.shift()}o>0&&a.push(e[i].slice(0,o))}return a}function jv(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let a;if(typeof o=="string")a=o;else switch(o){case-5:{a="\r";break}case-4:{a=`
|
|
28
|
-
`;break}case-3:{
|
|
29
|
-
`;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(o)}i=o===-2,r.push(a)}return r.join("")}function Uv(e){const r={constructs:eu([Bv,...(e||{}).extensions||[]]),content:i(dy),defined:[],document:i(hy),flow:i(_v),lazy:{},string:i(Lv),text:i(Fv)};return r;function i(o){return a;function a(s){return zv(r,o,s)}}}function Hv(e){for(;!uu(e););return e}const yu=/[\0\t\n\r]/g;function Wv(){let e=1,t="",n=!0,r;return i;function i(o,a,s){const l=[];let u,f,c,p,d;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(a||void 0).decode(o)),c=0,t="",n&&(o.charCodeAt(0)===65279&&c++,n=void 0);c<o.length;){if(yu.lastIndex=c,u=yu.exec(o),p=u&&u.index!==void 0?u.index:o.length,d=o.charCodeAt(p),!u){t=o.slice(c);break}if(d===10&&c===p&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),c<p&&(l.push(o.slice(c,p)),e+=p-c),d){case 0:{l.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,l.push(-2);e++<f;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}c=p+1}return s&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const Vv=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function qv(e){return e.replace(Vv,Kv)}function Kv(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return tu(n.slice(o?2:1),o?16:10)}return go(n)||e}const vu={}.hasOwnProperty;function Yv(e,t,n){return typeof t!="string"&&(n=t,t=void 0),Gv(n)(Hv(Uv(n).document().write(Wv()(e,t,!0))))}function Gv(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(de),autolinkProtocol:F,autolinkEmail:F,atxHeading:o(ke),blockQuote:o(K),characterEscape:F,characterReference:F,codeFenced:o(te),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:o(te,a),codeText:o(L,a),codeTextData:F,data:F,codeFlowValue:F,definition:o(ne),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:o(me),hardBreakEscape:o(oe),hardBreakTrailing:o(oe),htmlFlow:o(G,a),htmlFlowData:F,htmlText:o(G,a),htmlTextData:F,image:o(ue),label:a,link:o(de),listItem:o(Se),listItemValue:p,listOrdered:o(we,c),listUnordered:o(we),paragraph:o(Ue),reference:x,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:o(ke),strong:o(Ye),thematicBreak:o(se)},exit:{atxHeading:l(),atxHeadingSequence:k,autolink:l(),autolinkEmail:ie,autolinkProtocol:X,blockQuote:l(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:ee,characterReferenceMarkerNumeric:ee,characterReferenceValue:Y,characterReference:J,codeFenced:l(g),codeFencedFence:h,codeFencedFenceInfo:d,codeFencedFenceMeta:m,codeFlowValue:I,codeIndented:l(y),codeText:l(D),codeTextData:I,data:I,definition:l(),definitionDestinationString:A,definitionLabelString:v,definitionTitleString:w,emphasis:l(),hardBreakEscape:l(j),hardBreakTrailing:l(j),htmlFlow:l(z),htmlFlowData:I,htmlText:l(M),htmlTextData:I,image:l(U),label:V,labelText:$,lineEnding:O,link:l(B),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:W,resourceDestinationString:b,resourceTitleString:N,resource:H,setextHeading:l(P),setextHeadingLineSequence:T,setextHeadingText:C,strong:l(),thematicBreak:l()}};bu(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(R){let q={type:"root",children:[]};const ae={stack:[q],tokenStack:[],config:t,enter:s,exit:u,buffer:a,resume:f,data:n},le=[];let pe=-1;for(;++pe<R.length;)if(R[pe][1].type==="listOrdered"||R[pe][1].type==="listUnordered")if(R[pe][0]==="enter")le.push(pe);else{const fe=le.pop();pe=i(R,fe,pe)}for(pe=-1;++pe<R.length;){const fe=t[R[pe][0]];vu.call(fe,R[pe][1].type)&&fe[R[pe][1].type].call(Object.assign({sliceSerialize:R[pe][2].sliceSerialize},ae),R[pe][1])}if(ae.tokenStack.length>0){const fe=ae.tokenStack[ae.tokenStack.length-1];(fe[1]||wu).call(ae,void 0,fe[0])}for(q.position={start:Mt(R.length>0?R[0][1].start:{line:1,column:1,offset:0}),end:Mt(R.length>0?R[R.length-2][1].end:{line:1,column:1,offset:0})},pe=-1;++pe<t.transforms.length;)q=t.transforms[pe](q)||q;return q}function i(R,q,ae){let le=q-1,pe=-1,fe=!1,Ee,Oe,st,gt;for(;++le<=ae;){const ze=R[le];switch(ze[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ze[0]==="enter"?pe++:pe--,gt=void 0;break}case"lineEndingBlank":{ze[0]==="enter"&&(Ee&&!gt&&!pe&&!st&&(st=le),gt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:gt=void 0}if(!pe&&ze[0]==="enter"&&ze[1].type==="listItemPrefix"||pe===-1&&ze[0]==="exit"&&(ze[1].type==="listUnordered"||ze[1].type==="listOrdered")){if(Ee){let lt=le;for(Oe=void 0;lt--;){const Ge=R[lt];if(Ge[1].type==="lineEnding"||Ge[1].type==="lineEndingBlank"){if(Ge[0]==="exit")continue;Oe&&(R[Oe][1].type="lineEndingBlank",fe=!0),Ge[1].type="lineEnding",Oe=lt}else if(!(Ge[1].type==="linePrefix"||Ge[1].type==="blockQuotePrefix"||Ge[1].type==="blockQuotePrefixWhitespace"||Ge[1].type==="blockQuoteMarker"||Ge[1].type==="listItemIndent"))break}st&&(!Oe||st<Oe)&&(Ee._spread=!0),Ee.end=Object.assign({},Oe?R[Oe][1].start:ze[1].end),R.splice(Oe||le,0,["exit",Ee,ze[2]]),le++,ae++}if(ze[1].type==="listItemPrefix"){const lt={type:"listItem",_spread:!1,start:Object.assign({},ze[1].start),end:void 0};Ee=lt,R.splice(le,0,["enter",lt,ze[2]]),le++,ae++,st=void 0,gt=!0}}}return R[q][1]._spread=fe,ae}function o(R,q){return ae;function ae(le){s.call(this,R(le),le),q&&q.call(this,le)}}function a(){this.stack.push({type:"fragment",children:[]})}function s(R,q,ae){this.stack[this.stack.length-1].children.push(R),this.stack.push(R),this.tokenStack.push([q,ae||void 0]),R.position={start:Mt(q.start),end:void 0}}function l(R){return q;function q(ae){R&&R.call(this,ae),u.call(this,ae)}}function u(R,q){const ae=this.stack.pop(),le=this.tokenStack.pop();if(le)le[0].type!==R.type&&(q?q.call(this,R,le[0]):(le[1]||wu).call(this,R,le[0]));else throw new Error("Cannot close `"+R.type+"` ("+Fn({start:R.start,end:R.end})+"): it’s not open");ae.position.end=Mt(R.end)}function f(){return mo(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function p(R){if(this.data.expectingFirstListItemValue){const q=this.stack[this.stack.length-2];q.start=Number.parseInt(this.sliceSerialize(R),10),this.data.expectingFirstListItemValue=void 0}}function d(){const R=this.resume(),q=this.stack[this.stack.length-1];q.lang=R}function m(){const R=this.resume(),q=this.stack[this.stack.length-1];q.meta=R}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){const R=this.resume(),q=this.stack[this.stack.length-1];q.value=R.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const R=this.resume(),q=this.stack[this.stack.length-1];q.value=R.replace(/(\r?\n|\r)$/g,"")}function v(R){const q=this.resume(),ae=this.stack[this.stack.length-1];ae.label=q,ae.identifier=ut(this.sliceSerialize(R)).toLowerCase()}function w(){const R=this.resume(),q=this.stack[this.stack.length-1];q.title=R}function A(){const R=this.resume(),q=this.stack[this.stack.length-1];q.url=R}function k(R){const q=this.stack[this.stack.length-1];if(!q.depth){const ae=this.sliceSerialize(R).length;q.depth=ae}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function T(R){const q=this.stack[this.stack.length-1];q.depth=this.sliceSerialize(R).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function F(R){const ae=this.stack[this.stack.length-1].children;let le=ae[ae.length-1];(!le||le.type!=="text")&&(le=Z(),le.position={start:Mt(R.start),end:void 0},ae.push(le)),this.stack.push(le)}function I(R){const q=this.stack.pop();q.value+=this.sliceSerialize(R),q.position.end=Mt(R.end)}function O(R){const q=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ae=q.children[q.children.length-1];ae.position.end=Mt(R.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(q.type)&&(F.call(this,R),I.call(this,R))}function j(){this.data.atHardBreak=!0}function z(){const R=this.resume(),q=this.stack[this.stack.length-1];q.value=R}function M(){const R=this.resume(),q=this.stack[this.stack.length-1];q.value=R}function D(){const R=this.resume(),q=this.stack[this.stack.length-1];q.value=R}function B(){const R=this.stack[this.stack.length-1];if(this.data.inReference){const q=this.data.referenceType||"shortcut";R.type+="Reference",R.referenceType=q,delete R.url,delete R.title}else delete R.identifier,delete R.label;this.data.referenceType=void 0}function U(){const R=this.stack[this.stack.length-1];if(this.data.inReference){const q=this.data.referenceType||"shortcut";R.type+="Reference",R.referenceType=q,delete R.url,delete R.title}else delete R.identifier,delete R.label;this.data.referenceType=void 0}function $(R){const q=this.sliceSerialize(R),ae=this.stack[this.stack.length-2];ae.label=qv(q),ae.identifier=ut(q).toLowerCase()}function V(){const R=this.stack[this.stack.length-1],q=this.resume(),ae=this.stack[this.stack.length-1];if(this.data.inReference=!0,ae.type==="link"){const le=R.children;ae.children=le}else ae.alt=q}function b(){const R=this.resume(),q=this.stack[this.stack.length-1];q.url=R}function N(){const R=this.resume(),q=this.stack[this.stack.length-1];q.title=R}function H(){this.data.inReference=void 0}function x(){this.data.referenceType="collapsed"}function W(R){const q=this.resume(),ae=this.stack[this.stack.length-1];ae.label=q,ae.identifier=ut(this.sliceSerialize(R)).toLowerCase(),this.data.referenceType="full"}function ee(R){this.data.characterReferenceType=R.type}function Y(R){const q=this.sliceSerialize(R),ae=this.data.characterReferenceType;let le;ae?(le=tu(q,ae==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):le=go(q);const pe=this.stack[this.stack.length-1];pe.value+=le}function J(R){const q=this.stack.pop();q.position.end=Mt(R.end)}function X(R){I.call(this,R);const q=this.stack[this.stack.length-1];q.url=this.sliceSerialize(R)}function ie(R){I.call(this,R);const q=this.stack[this.stack.length-1];q.url="mailto:"+this.sliceSerialize(R)}function K(){return{type:"blockquote",children:[]}}function te(){return{type:"code",lang:null,meta:null,value:""}}function L(){return{type:"inlineCode",value:""}}function ne(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function me(){return{type:"emphasis",children:[]}}function ke(){return{type:"heading",depth:0,children:[]}}function oe(){return{type:"break"}}function G(){return{type:"html",value:""}}function ue(){return{type:"image",title:null,url:"",alt:null}}function de(){return{type:"link",title:null,url:"",children:[]}}function we(R){return{type:"list",ordered:R.type==="listOrdered",start:null,spread:R._spread,children:[]}}function Se(R){return{type:"listItem",spread:R._spread,checked:null,children:[]}}function Ue(){return{type:"paragraph",children:[]}}function Ye(){return{type:"strong",children:[]}}function Z(){return{type:"text",value:""}}function se(){return{type:"thematicBreak"}}}function Mt(e){return{line:e.line,column:e.column,offset:e.offset}}function bu(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?bu(e,r):Qv(e,r)}}function Qv(e,t){let n;for(n in t)if(vu.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function wu(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Fn({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Fn({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Fn({start:t.start,end:t.end})+") is still open")}function Jv(e){const t=this;t.parser=n;function n(r){return Yv(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Zv(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Xv(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
30
|
-
`}]}function
|
|
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
|
|
32
|
-
`}),f.type==="element"&&f.tagName==="p"&&!i?
|
|
33
|
-
`});const u={type:"element",tagName:"li",properties:o,children:
|
|
34
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(
|
|
35
|
-
`}]}}const
|
|
17
|
+
*/var qu;function cb(){return qu||(qu=1,process.env.NODE_ENV!=="production"&&function(){function e(d,m){return d===m&&(d!==0||1/d===1/m)||d!==d&&m!==m}function t(d,m){f||i.startTransition===void 0||(f=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var p=m();if(!c){var g=m();o(p,g)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}g=s({inst:{value:p,getSnapshot:m}});var y=g[0].inst,v=g[1];return l(function(){y.value=p,y.getSnapshot=m,n(y)&&v({inst:y})},[d,p,m]),a(function(){return n(y)&&v({inst:y}),d(function(){n(y)&&v({inst:y})})},[d]),u(p),p}function n(d){var m=d.getSnapshot;d=d.value;try{var p=m();return!o(d,p)}catch{return!0}}function r(d,m){return m()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var i=D,o=typeof Object.is=="function"?Object.is:e,s=i.useState,a=i.useEffect,l=i.useLayoutEffect,u=i.useDebugValue,f=!1,c=!1,h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;ls.useSyncExternalStore=i.useSyncExternalStore!==void 0?i.useSyncExternalStore:h,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),ls}process.env.NODE_ENV==="production"?ss.exports=ub():ss.exports=cb();var us=ss.exports;function fb(){return us.useSyncExternalStore(db,()=>!0,()=>!1)}function db(){return()=>{}}var cs="Avatar",[hb]=Jv(cs),[pb,Yu]=hb(cs),fs=A.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,o]=A.useState("idle");return k.jsx(pb,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:o,children:k.jsx(os.span,{...r,ref:t})})});fs.displayName=cs;var Ku="AvatarImage",ds=A.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...o}=e,s=Yu(Ku,n),a=mb(r,o),l=Ln(u=>{i(u),s.onImageLoadingStatusChange(u)});return en(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?k.jsx(os.img,{...o,ref:t,src:r}):null});ds.displayName=Ku;var Gu="AvatarFallback",hs=A.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,o=Yu(Gu,n),[s,a]=A.useState(r===void 0);return A.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(l)}},[r]),s&&o.imageLoadingStatus!=="loaded"?k.jsx(os.span,{...i,ref:t}):null});hs.displayName=Gu;function Qu(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function mb(e,{referrerPolicy:t,crossOrigin:n}){const r=fb(),i=A.useRef(null),o=r?(i.current||(i.current=new window.Image),i.current):null,[s,a]=A.useState(()=>Qu(o,e));return en(()=>{a(Qu(o,e))},[o,e]),en(()=>{const l=c=>()=>{a(c)};if(!o)return;const u=l("loaded"),f=l("error");return o.addEventListener("load",u),o.addEventListener("error",f),t&&(o.referrerPolicy=t),typeof n=="string"&&(o.crossOrigin=n),()=>{o.removeEventListener("load",u),o.removeEventListener("error",f)}},[o,n,t]),s}function Zu(e,t){let n=`${e} {`;for(const[r,i]of Object.entries(t))n+=`${r}: ${i}; `;return n+="}",n}function Ju(e,t){let n=0;if(e.length==0)return n;for(let r=0;r<e.length;r++){const i=e.charCodeAt(r);n=(n<<5)-n+i,n=n&n}return Math.abs(n)%t}const gb=(e,t={})=>new Promise((n,r)=>{if(typeof window>"u")return r("Window is not defined");if(!e)return r("Url is not defined");let i=null;const o=new Image;o.addEventListener("load",()=>{i&&clearTimeout(i),n({width:o.naturalWidth,height:o.naturalHeight})}),o.addEventListener("error",s=>{i&&clearTimeout(i),r(`${s.type}: ${s.message}`)}),o.src=e,t.timeout&&(i=setTimeout(()=>r("Timeout"),t.timeout))});var Xu={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(yn,function(){var n=1e3,r=6e4,i=36e5,o="millisecond",s="second",a="minute",l="hour",u="day",f="week",c="month",h="quarter",d="year",m="date",p="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(L){var R=["th","st","nd","rd"],N=L%100;return"["+L+(R[(N-20)%10]||R[N]||R[0])+"]"}},w=function(L,R,N){var j=String(L);return!j||j.length>=R?L:""+Array(R+1-j.length).join(N)+L},E={s:w,z:function(L){var R=-L.utcOffset(),N=Math.abs(R),j=Math.floor(N/60),B=N%60;return(R<=0?"+":"-")+w(j,2,"0")+":"+w(B,2,"0")},m:function L(R,N){if(R.date()<N.date())return-L(N,R);var j=12*(N.year()-R.year())+(N.month()-R.month()),B=R.clone().add(j,c),W=N-B<0,b=R.clone().add(j+(W?-1:1),c);return+(-(j+(N-B)/(W?B-b:b-B))||0)},a:function(L){return L<0?Math.ceil(L)||0:Math.floor(L)},p:function(L){return{M:c,y:d,w:f,d:u,D:m,h:l,m:a,s,ms:o,Q:h}[L]||String(L||"").toLowerCase().replace(/s$/,"")},u:function(L){return L===void 0}},S="en",C={};C[S]=v;var I="$isDayjsObject",M=function(L){return L instanceof U||!(!L||!L[I])},P=function L(R,N,j){var B;if(!R)return S;if(typeof R=="string"){var W=R.toLowerCase();C[W]&&(B=W),N&&(C[W]=N,B=W);var b=R.split("-");if(!B&&b.length>1)return L(b[0])}else{var _=R.name;C[_]=R,B=_}return!j&&B&&(S=B),B||!j&&S},T=function(L,R){if(M(L))return L.clone();var N=typeof R=="object"?R:{};return N.date=L,N.args=arguments,new U(N)},O=E;O.l=P,O.i=M,O.w=function(L,R){return T(L,{locale:R.$L,utc:R.$u,x:R.$x,$offset:R.$offset})};var U=function(){function L(N){this.$L=P(N.locale,null,!0),this.parse(N),this.$x=this.$x||N.x||{},this[I]=!0}var R=L.prototype;return R.parse=function(N){this.$d=function(j){var B=j.date,W=j.utc;if(B===null)return new Date(NaN);if(O.u(B))return new Date;if(B instanceof Date)return new Date(B);if(typeof B=="string"&&!/Z$/i.test(B)){var b=B.match(g);if(b){var _=b[2]-1||0,H=(b[7]||"0").substring(0,3);return W?new Date(Date.UTC(b[1],_,b[3]||1,b[4]||0,b[5]||0,b[6]||0,H)):new Date(b[1],_,b[3]||1,b[4]||0,b[5]||0,b[6]||0,H)}}return new Date(B)}(N),this.init()},R.init=function(){var N=this.$d;this.$y=N.getFullYear(),this.$M=N.getMonth(),this.$D=N.getDate(),this.$W=N.getDay(),this.$H=N.getHours(),this.$m=N.getMinutes(),this.$s=N.getSeconds(),this.$ms=N.getMilliseconds()},R.$utils=function(){return O},R.isValid=function(){return this.$d.toString()!==p},R.isSame=function(N,j){var B=T(N);return this.startOf(j)<=B&&B<=this.endOf(j)},R.isAfter=function(N,j){return T(N)<this.startOf(j)},R.isBefore=function(N,j){return this.endOf(j)<T(N)},R.$g=function(N,j,B){return O.u(N)?this[j]:this.set(B,N)},R.unix=function(){return Math.floor(this.valueOf()/1e3)},R.valueOf=function(){return this.$d.getTime()},R.startOf=function(N,j){var B=this,W=!!O.u(j)||j,b=O.p(N),_=function(se,G){var te=O.w(B.$u?Date.UTC(B.$y,G,se):new Date(B.$y,G,se),B);return W?te:te.endOf(u)},H=function(se,G){return O.w(B.toDate()[se].apply(B.toDate("s"),(W?[0,0,0,0]:[23,59,59,999]).slice(G)),B)},x=this.$W,V=this.$M,Y=this.$D,q="set"+(this.$u?"UTC":"");switch(b){case d:return W?_(1,0):_(31,11);case c:return W?_(1,V):_(0,V+1);case f:var Q=this.$locale().weekStart||0,X=(x<Q?x+7:x)-Q;return _(W?Y-X:Y+(6-X),V);case u:case m:return H(q+"Hours",0);case l:return H(q+"Minutes",1);case a:return H(q+"Seconds",2);case s:return H(q+"Milliseconds",3);default:return this.clone()}},R.endOf=function(N){return this.startOf(N,!1)},R.$set=function(N,j){var B,W=O.p(N),b="set"+(this.$u?"UTC":""),_=(B={},B[u]=b+"Date",B[m]=b+"Date",B[c]=b+"Month",B[d]=b+"FullYear",B[l]=b+"Hours",B[a]=b+"Minutes",B[s]=b+"Seconds",B[o]=b+"Milliseconds",B)[W],H=W===u?this.$D+(j-this.$W):j;if(W===c||W===d){var x=this.clone().set(m,1);x.$d[_](H),x.init(),this.$d=x.set(m,Math.min(this.$D,x.daysInMonth())).$d}else _&&this.$d[_](H);return this.init(),this},R.set=function(N,j){return this.clone().$set(N,j)},R.get=function(N){return this[O.p(N)]()},R.add=function(N,j){var B,W=this;N=Number(N);var b=O.p(j),_=function(V){var Y=T(W);return O.w(Y.date(Y.date()+Math.round(V*N)),W)};if(b===c)return this.set(c,this.$M+N);if(b===d)return this.set(d,this.$y+N);if(b===u)return _(1);if(b===f)return _(7);var H=(B={},B[a]=r,B[l]=i,B[s]=n,B)[b]||1,x=this.$d.getTime()+N*H;return O.w(x,this)},R.subtract=function(N,j){return this.add(-1*N,j)},R.format=function(N){var j=this,B=this.$locale();if(!this.isValid())return B.invalidDate||p;var W=N||"YYYY-MM-DDTHH:mm:ssZ",b=O.z(this),_=this.$H,H=this.$m,x=this.$M,V=B.weekdays,Y=B.months,q=B.meridiem,Q=function(G,te,$,ne){return G&&(G[te]||G(j,W))||$[te].slice(0,ne)},X=function(G){return O.s(_%12||12,G,"0")},se=q||function(G,te,$){var ne=G<12?"AM":"PM";return $?ne.toLowerCase():ne};return W.replace(y,function(G,te){return te||function($){switch($){case"YY":return String(j.$y).slice(-2);case"YYYY":return O.s(j.$y,4,"0");case"M":return x+1;case"MM":return O.s(x+1,2,"0");case"MMM":return Q(B.monthsShort,x,Y,3);case"MMMM":return Q(Y,x);case"D":return j.$D;case"DD":return O.s(j.$D,2,"0");case"d":return String(j.$W);case"dd":return Q(B.weekdaysMin,j.$W,V,2);case"ddd":return Q(B.weekdaysShort,j.$W,V,3);case"dddd":return V[j.$W];case"H":return String(_);case"HH":return O.s(_,2,"0");case"h":return X(1);case"hh":return X(2);case"a":return se(_,H,!0);case"A":return se(_,H,!1);case"m":return String(H);case"mm":return O.s(H,2,"0");case"s":return String(j.$s);case"ss":return O.s(j.$s,2,"0");case"SSS":return O.s(j.$ms,3,"0");case"Z":return b}return null}(G)||b.replace(":","")})},R.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},R.diff=function(N,j,B){var W,b=this,_=O.p(j),H=T(N),x=(H.utcOffset()-this.utcOffset())*r,V=this-H,Y=function(){return O.m(b,H)};switch(_){case d:W=Y()/12;break;case c:W=Y();break;case h:W=Y()/3;break;case f:W=(V-x)/6048e5;break;case u:W=(V-x)/864e5;break;case l:W=V/i;break;case a:W=V/r;break;case s:W=V/n;break;default:W=V}return B?W:O.a(W)},R.daysInMonth=function(){return this.endOf(c).$D},R.$locale=function(){return C[this.$L]},R.locale=function(N,j){if(!N)return this.$L;var B=this.clone(),W=P(N,j,!0);return W&&(B.$L=W),B},R.clone=function(){return O.w(this.$d,this)},R.toDate=function(){return new Date(this.valueOf())},R.toJSON=function(){return this.isValid()?this.toISOString():null},R.toISOString=function(){return this.$d.toISOString()},R.toString=function(){return this.$d.toUTCString()},L}(),F=U.prototype;return T.prototype=F,[["$ms",o],["$s",s],["$m",a],["$H",l],["$W",u],["$M",c],["$y",d],["$D",m]].forEach(function(L){F[L[1]]=function(R){return this.$g(R,L[0],L[1])}}),T.extend=function(L,R){return L.$i||(L(R,U,T),L.$i=!0),T},T.locale=P,T.isDayjs=M,T.unix=function(L){return T(1e3*L)},T.en=C[S],T.Ls=C,T.p={},T})})(Xu);var yb=Xu.exports;const wi=vn(yb);var ec={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(yn,function(){return function(n,r,i){r.prototype.isToday=function(){var o="YYYY-MM-DD",s=i();return this.format(o)===s.format(o)}}})})(ec);var vb=ec.exports;const bb=vn(vb);var tc={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(yn,function(){return function(n,r,i){r.prototype.isYesterday=function(){var o="YYYY-MM-DD",s=i().subtract(1,"day");return this.format(o)===s.format(o)}}})})(tc);var wb=tc.exports;const Sb=vn(wb);wi.extend(bb),wi.extend(Sb);function nc(e,t,n,r,i){return e.map(o=>{const{authorId:s}=o,a=s===n?"outgoing":"incoming",l=t.find(f=>f.id===s);let u;return l&&l.id===n?u={name:l.name||"You",avatar:l.pictureUrl}:l?u={name:l.name||"Agent",avatar:l.pictureUrl}:u={name:r||"Bot",avatar:i},{...o,direction:a,sender:u}})}function xb(e,t="day"){var r,i,o;if(!e||e.length===0)return[];const n=[];(r=e[0])!=null&&r.timestamp&&n.push(rc(e[0].timestamp));for(let s=0;s<e.length;s++)if(e[s]&&n.push(e[s]),s+1<e.length){const a=(i=e[s])==null?void 0:i.timestamp,l=(o=e[s+1])==null?void 0:o.timestamp;!wi(a).isSame(l,t)&&l&&n.push(rc(l))}return n}function rc(e){return{id:ic(e),direction:"system",sender:{name:"system"},timestamp:e,block:{type:"text",text:ic(e)}}}function ic(e,t=!1){const n=wi(e),r="h:mma";return n.isToday()?t?`Today • ${n.format(r)}`:"Today":n.isYesterday()?t?`Yesterday • ${n.format(r)}`:"Yesterday":t?n.format(`YYYY-MM-DD • ${r}`):n.format("YYYY-MM-DD")}function kb(e=""){if(typeof e!="string")throw new TypeError("Color should be string!");const t=/^#?([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i.exec(e);if(t)return t.splice(1).map(r=>Number.parseInt(r,16));const n=/^#?([\da-f])([\da-f])([\da-f])$/i.exec(e);if(n)return n.splice(1).map(r=>Number.parseInt(r+r,16));if(e.includes(","))return e.split(",").map(r=>Number.parseInt(r));throw new Error("Invalid color format! Use #ABC or #AABBCC or r,g,b")}function Eb(e){return"#"+e.map(t=>`0${t.toString(16).toUpperCase()}`.slice(-2)).join("")}function Cb(e,t){return e.map(n=>Math.round(n+(255-n)*t))}function Ab(e,t){return e.map(n=>Math.round(n*t))}const br=e=>t=>Cb(t,e),wr=e=>t=>Ab(t,e),Tb={50:br(.95),100:br(.9),200:br(.75),300:br(.6),400:br(.3),500:e=>e,600:wr(.9),700:wr(.6),800:wr(.45),900:wr(.3),950:wr(.2)};function oc(e,t=Tb){const n={},r=kb(e);for(const[i,o]of Object.entries(t))n[i]=Eb(o(r));return n}const sc=()=>{const e={};return{on:(i,o)=>{var s;return e[i]||(e[i]=new Set),(s=e[i])==null||s.add(o),()=>{var a;return(a=e[i])==null?void 0:a.delete(o)}},emit:(i,o)=>{var s,a;(s=e[i])==null||s.forEach(l=>l(o)),(a=e["*"])==null||a.forEach(l=>l({type:i,payload:o}))},removeAllListeners:i=>{var o;i?(o=e[i])==null||o.clear():Object.keys(e).forEach(s=>{var a;(a=e[s])==null||a.clear()})}}};class bn extends Error{}class Ib extends bn{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class Ob extends bn{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class Mb extends bn{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class Sr extends bn{}class ac extends bn{constructor(t){super(`Invalid unit ${t}`)}}class vt extends bn{}class nn extends bn{constructor(){super("Zone is an abstract class")}}const ie="numeric",At="short",ht="long",ps={year:ie,month:ie,day:ie},lc={year:ie,month:At,day:ie},Db={year:ie,month:At,day:ie,weekday:At},uc={year:ie,month:ht,day:ie},cc={year:ie,month:ht,day:ie,weekday:ht},fc={hour:ie,minute:ie},dc={hour:ie,minute:ie,second:ie},hc={hour:ie,minute:ie,second:ie,timeZoneName:At},pc={hour:ie,minute:ie,second:ie,timeZoneName:ht},mc={hour:ie,minute:ie,hourCycle:"h23"},gc={hour:ie,minute:ie,second:ie,hourCycle:"h23"},yc={hour:ie,minute:ie,second:ie,hourCycle:"h23",timeZoneName:At},vc={hour:ie,minute:ie,second:ie,hourCycle:"h23",timeZoneName:ht},bc={year:ie,month:ie,day:ie,hour:ie,minute:ie},wc={year:ie,month:ie,day:ie,hour:ie,minute:ie,second:ie},Sc={year:ie,month:At,day:ie,hour:ie,minute:ie},xc={year:ie,month:At,day:ie,hour:ie,minute:ie,second:ie},Nb={year:ie,month:At,day:ie,weekday:At,hour:ie,minute:ie},kc={year:ie,month:ht,day:ie,hour:ie,minute:ie,timeZoneName:At},Ec={year:ie,month:ht,day:ie,hour:ie,minute:ie,second:ie,timeZoneName:At},Cc={year:ie,month:ht,day:ie,weekday:ht,hour:ie,minute:ie,timeZoneName:ht},Ac={year:ie,month:ht,day:ie,weekday:ht,hour:ie,minute:ie,second:ie,timeZoneName:ht};function xe(e){return typeof e>"u"}function wn(e){return typeof e=="number"}function Si(e){return typeof e=="number"&&e%1===0}function _b(e){return typeof e=="string"}function Pb(e){return Object.prototype.toString.call(e)==="[object Date]"}function Tc(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Lb(e){return Array.isArray(e)?e:[e]}function Ic(e,t,n){if(e.length!==0)return e.reduce((r,i)=>{const o=[t(i),i];return r&&n(r[0],o[0])===r[0]?r:o},null)[1]}function Fb(e,t){return t.reduce((n,r)=>(n[r]=e[r],n),{})}function Fn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function qt(e,t,n){return Si(e)&&e>=t&&e<=n}function Rb(e,t){return e-t*Math.floor(e/t)}function Ve(e,t=2){const n=e<0;let r;return n?r="-"+(""+-e).padStart(t,"0"):r=(""+e).padStart(t,"0"),r}function rn(e){if(!(xe(e)||e===null||e===""))return parseInt(e,10)}function Sn(e){if(!(xe(e)||e===null||e===""))return parseFloat(e)}function ms(e){if(!(xe(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function gs(e,t,n=!1){const r=10**t;return(n?Math.trunc:Math.round)(e*r)/r}function xr(e){return e%4===0&&(e%100!==0||e%400===0)}function kr(e){return xr(e)?366:365}function xi(e,t){const n=Rb(t-1,12)+1,r=e+(t-n)/12;return n===2?xr(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function ys(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(t.getUTCFullYear()-1900)),+t}function ki(e){const t=(e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))%7,n=e-1,r=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7;return t===4||r===3?53:52}function vs(e){return e>99?e:e>60?1900+e:2e3+e}function Oc(e,t,n,r=null){const i=new Date(e),o={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(o.timeZone=r);const s={timeZoneName:t,...o},a=new Intl.DateTimeFormat(n,s).formatToParts(i).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function Ei(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0,i=n<0||Object.is(n,-0)?-r:r;return n*60+i}function Mc(e){const t=Number(e);if(typeof e=="boolean"||e===""||Number.isNaN(t))throw new vt(`Invalid unit value ${e}`);return t}function Ci(e,t){const n={};for(const r in e)if(Fn(e,r)){const i=e[r];if(i==null)continue;n[t(r)]=Mc(i)}return n}function Er(e,t){const n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),i=e>=0?"+":"-";switch(t){case"short":return`${i}${Ve(n,2)}:${Ve(r,2)}`;case"narrow":return`${i}${n}${r>0?`:${r}`:""}`;case"techie":return`${i}${Ve(n,2)}${Ve(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function Ai(e){return Fb(e,["hour","minute","second","millisecond"])}const Dc=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,$b=["January","February","March","April","May","June","July","August","September","October","November","December"],Nc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Bb=["J","F","M","A","M","J","J","A","S","O","N","D"];function _c(e){switch(e){case"narrow":return[...Bb];case"short":return[...Nc];case"long":return[...$b];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const Pc=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Lc=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],zb=["M","T","W","T","F","S","S"];function Fc(e){switch(e){case"narrow":return[...zb];case"short":return[...Lc];case"long":return[...Pc];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Rc=["AM","PM"],Ub=["Before Christ","Anno Domini"],jb=["BC","AD"],Hb=["B","A"];function $c(e){switch(e){case"narrow":return[...Hb];case"short":return[...jb];case"long":return[...Ub];default:return null}}function Vb(e){return Rc[e.hour<12?0:1]}function Wb(e,t){return Fc(t)[e.weekday-1]}function qb(e,t){return _c(t)[e.month-1]}function Yb(e,t){return $c(t)[e.year<0?0:1]}function Kb(e,t,n="always",r=!1){const i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},o=["hours","minutes","seconds"].indexOf(e)===-1;if(n==="auto"&&o){const c=e==="days";switch(t){case 1:return c?"tomorrow":`next ${i[e][0]}`;case-1:return c?"yesterday":`last ${i[e][0]}`;case 0:return c?"today":`this ${i[e][0]}`}}const s=Object.is(t,-0)||t<0,a=Math.abs(t),l=a===1,u=i[e],f=r?l?u[1]:u[2]||u[1]:l?i[e][0]:e;return s?`${a} ${f} ago`:`in ${a} ${f}`}function Bc(e,t){let n="";for(const r of e)r.literal?n+=r.val:n+=t(r.val);return n}const Gb={D:ps,DD:lc,DDD:uc,DDDD:cc,t:fc,tt:dc,ttt:hc,tttt:pc,T:mc,TT:gc,TTT:yc,TTTT:vc,f:bc,ff:Sc,fff:kc,ffff:Cc,F:wc,FF:xc,FFF:Ec,FFFF:Ac};class lt{static create(t,n={}){return new lt(t,n)}static parseFormat(t){let n=null,r="",i=!1;const o=[];for(let s=0;s<t.length;s++){const a=t.charAt(s);a==="'"?(r.length>0&&o.push({literal:i,val:r}),n=null,r="",i=!i):i||a===n?r+=a:(r.length>0&&o.push({literal:!1,val:r}),r=a,n=a)}return r.length>0&&o.push({literal:i,val:r}),o}static macroTokenToFormatOpts(t){return Gb[t]}constructor(t,n){this.opts=n,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...n}).format()}formatDateTime(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n}).format()}formatDateTimeParts(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n}).formatToParts()}resolvedOptions(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n}).resolvedOptions()}num(t,n=0){if(this.opts.forceSimple)return Ve(t,n);const r={...this.opts};return n>0&&(r.padTo=n),this.loc.numberFormatter(r).format(t)}formatDateTimeFromString(t,n){const r=this.loc.listingMode()==="en",i=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",o=(d,m)=>this.loc.extract(t,d,m),s=d=>t.isOffsetFixed&&t.offset===0&&d.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,d.format):"",a=()=>r?Vb(t):o({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(d,m)=>r?qb(t,d):o(m?{month:d}:{month:d,day:"numeric"},"month"),u=(d,m)=>r?Wb(t,d):o(m?{weekday:d}:{weekday:d,month:"long",day:"numeric"},"weekday"),f=d=>{const m=lt.macroTokenToFormatOpts(d);return m?this.formatWithSystemDefault(t,m):d},c=d=>r?Yb(t,d):o({era:d},"era"),h=d=>{switch(d){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return s({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return s({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return s({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return a();case"d":return i?o({day:"numeric"},"day"):this.num(t.day);case"dd":return i?o({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return i?o({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return i?o({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return l("short",!0);case"LLLL":return l("long",!0);case"LLLLL":return l("narrow",!0);case"M":return i?o({month:"numeric"},"month"):this.num(t.month);case"MM":return i?o({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return l("short",!1);case"MMMM":return l("long",!1);case"MMMMM":return l("narrow",!1);case"y":return i?o({year:"numeric"},"year"):this.num(t.year);case"yy":return i?o({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return i?o({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return i?o({year:"numeric"},"year"):this.num(t.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return f(d)}};return Bc(lt.parseFormat(n),h)}formatDurationFromString(t,n){const r=l=>{switch(l[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},i=l=>u=>{const f=r(u);return f?this.num(l.get(f),u.length):u},o=lt.parseFormat(n),s=o.reduce((l,{literal:u,val:f})=>u?l:l.concat(f),[]),a=t.shiftTo(...s.map(r).filter(l=>l));return Bc(o,i(a))}}class Tt{constructor(t,n){this.reason=t,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class Cr{get type(){throw new nn}get name(){throw new nn}get ianaName(){return this.name}get isUniversal(){throw new nn}offsetName(t,n){throw new nn}formatOffset(t,n){throw new nn}offset(t){throw new nn}equals(t){throw new nn}get isValid(){throw new nn}}let bs=null;class ws extends Cr{static get instance(){return bs===null&&(bs=new ws),bs}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return Oc(t,n,r)}formatOffset(t,n){return Er(this.offset(t),n)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}let Ti={};function Qb(e){return Ti[e]||(Ti[e]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),Ti[e]}const Zb={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Jb(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,i,o,s,a,l,u,f]=r;return[s,i,o,a,l,u,f]}function Xb(e,t){const n=e.formatToParts(t),r=[];for(let i=0;i<n.length;i++){const{type:o,value:s}=n[i],a=Zb[o];o==="era"?r[a]=s:xe(a)||(r[a]=parseInt(s,10))}return r}let Ii={};class Yt extends Cr{static create(t){return Ii[t]||(Ii[t]=new Yt(t)),Ii[t]}static resetCache(){Ii={},Ti={}}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=Yt.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return Oc(t,n,r,this.name)}formatOffset(t,n){return Er(this.offset(t),n)}offset(t){const n=new Date(t);if(isNaN(n))return NaN;const r=Qb(this.name);let[i,o,s,a,l,u,f]=r.formatToParts?Xb(r,n):Jb(r,n);a==="BC"&&(i=-Math.abs(i)+1);const h=ys({year:i,month:o,day:s,hour:l===24?0:l,minute:u,second:f,millisecond:0});let d=+n;const m=d%1e3;return d-=m>=0?m:1e3+m,(h-d)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let Ss=null;class it extends Cr{static get utcInstance(){return Ss===null&&(Ss=new it(0)),Ss}static instance(t){return t===0?it.utcInstance:new it(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new it(Ei(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Er(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Er(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return Er(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}class e0 extends Cr{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function on(e,t){if(xe(e)||e===null)return t;if(e instanceof Cr)return e;if(_b(e)){const n=e.toLowerCase();return n==="local"||n==="system"?t:n==="utc"||n==="gmt"?it.utcInstance:it.parseSpecifier(n)||Yt.create(e)}else return wn(e)?it.instance(e):typeof e=="object"&&e.offset&&typeof e.offset=="number"?e:new e0(e)}let zc=()=>Date.now(),Uc="system",jc=null,Hc=null,Vc=null,Wc;class qe{static get now(){return zc}static set now(t){zc=t}static set defaultZone(t){Uc=t}static get defaultZone(){return on(Uc,ws.instance)}static get defaultLocale(){return jc}static set defaultLocale(t){jc=t}static get defaultNumberingSystem(){return Hc}static set defaultNumberingSystem(t){Hc=t}static get defaultOutputCalendar(){return Vc}static set defaultOutputCalendar(t){Vc=t}static get throwOnInvalid(){return Wc}static set throwOnInvalid(t){Wc=t}static resetCaches(){Re.resetCache(),Yt.resetCache()}}let qc={};function t0(e,t={}){const n=JSON.stringify([e,t]);let r=qc[n];return r||(r=new Intl.ListFormat(e,t),qc[n]=r),r}let xs={};function ks(e,t={}){const n=JSON.stringify([e,t]);let r=xs[n];return r||(r=new Intl.DateTimeFormat(e,t),xs[n]=r),r}let Es={};function n0(e,t={}){const n=JSON.stringify([e,t]);let r=Es[n];return r||(r=new Intl.NumberFormat(e,t),Es[n]=r),r}let Cs={};function r0(e,t={}){const{base:n,...r}=t,i=JSON.stringify([e,r]);let o=Cs[i];return o||(o=new Intl.RelativeTimeFormat(e,t),Cs[i]=o),o}let Ar=null;function i0(){return Ar||(Ar=new Intl.DateTimeFormat().resolvedOptions().locale,Ar)}function o0(e){const t=e.indexOf("-u-");if(t===-1)return[e];{let n;const r=e.substring(0,t);try{n=ks(e).resolvedOptions()}catch{n=ks(r).resolvedOptions()}const{numberingSystem:i,calendar:o}=n;return[r,i,o]}}function s0(e,t,n){return(n||t)&&(e+="-u",n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`)),e}function a0(e){const t=[];for(let n=1;n<=12;n++){const r=pe.utc(2016,n,1);t.push(e(r))}return t}function l0(e){const t=[];for(let n=1;n<=7;n++){const r=pe.utc(2016,11,13+n);t.push(e(r))}return t}function Oi(e,t,n,r,i){const o=e.listingMode(n);return o==="error"?null:o==="en"?r(t):i(t)}function u0(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem==="latn"}class c0{constructor(t,n,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:i,floor:o,...s}=r;if(!n||Object.keys(s).length>0){const a={useGrouping:!1,...r};r.padTo>0&&(a.minimumIntegerDigits=r.padTo),this.inf=n0(t,a)}}format(t){if(this.inf){const n=this.floor?Math.floor(t):t;return this.inf.format(n)}else{const n=this.floor?Math.floor(t):gs(t,3);return Ve(n,this.padTo)}}}class f0{constructor(t,n,r){this.opts=r;let i;if(t.zone.isUniversal){const s=-1*(t.offset/60),a=s>=0?`Etc/GMT+${s}`:`Etc/GMT${s}`;t.offset!==0&&Yt.create(a).valid?(i=a,this.dt=t):(i="UTC",r.timeZoneName?this.dt=t:this.dt=t.offset===0?t:pe.fromMillis(t.ts+t.offset*60*1e3))}else t.zone.type==="system"?this.dt=t:(this.dt=t,i=t.zone.name);const o={...this.opts};i&&(o.timeZone=i),this.dtf=ks(n,o)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class d0{constructor(t,n,r){this.opts={style:"long",...r},!n&&Tc()&&(this.rtf=r0(t,r))}format(t,n){return this.rtf?this.rtf.format(t,n):Kb(n,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,n){return this.rtf?this.rtf.formatToParts(t,n):[]}}class Re{static fromOpts(t){return Re.create(t.locale,t.numberingSystem,t.outputCalendar,t.defaultToEN)}static create(t,n,r,i=!1){const o=t||qe.defaultLocale,s=o||(i?"en-US":i0()),a=n||qe.defaultNumberingSystem,l=r||qe.defaultOutputCalendar;return new Re(s,a,l,o)}static resetCache(){Ar=null,xs={},Es={},Cs={}}static fromObject({locale:t,numberingSystem:n,outputCalendar:r}={}){return Re.create(t,n,r)}constructor(t,n,r,i){const[o,s,a]=o0(t);this.locale=o,this.numberingSystem=n||s||null,this.outputCalendar=r||a||null,this.intl=s0(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=u0(this)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&n?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:Re.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,n=!1,r=!0){return Oi(this,t,r,_c,()=>{const i=n?{month:t,day:"numeric"}:{month:t},o=n?"format":"standalone";return this.monthsCache[o][t]||(this.monthsCache[o][t]=a0(s=>this.extract(s,i,"month"))),this.monthsCache[o][t]})}weekdays(t,n=!1,r=!0){return Oi(this,t,r,Fc,()=>{const i=n?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},o=n?"format":"standalone";return this.weekdaysCache[o][t]||(this.weekdaysCache[o][t]=l0(s=>this.extract(s,i,"weekday"))),this.weekdaysCache[o][t]})}meridiems(t=!0){return Oi(this,void 0,t,()=>Rc,()=>{if(!this.meridiemCache){const n={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[pe.utc(2016,11,13,9),pe.utc(2016,11,13,19)].map(r=>this.extract(r,n,"dayperiod"))}return this.meridiemCache})}eras(t,n=!0){return Oi(this,t,n,$c,()=>{const r={era:t};return this.eraCache[t]||(this.eraCache[t]=[pe.utc(-40,1,1),pe.utc(2017,1,1)].map(i=>this.extract(i,r,"era"))),this.eraCache[t]})}extract(t,n,r){const i=this.dtFormatter(t,n),o=i.formatToParts(),s=o.find(a=>a.type.toLowerCase()===r);return s?s.value:null}numberFormatter(t={}){return new c0(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,n={}){return new f0(t,this.intl,n)}relFormatter(t={}){return new d0(this.intl,this.isEnglish(),t)}listFormatter(t={}){return t0(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}}function Rn(...e){const t=e.reduce((n,r)=>n+r.source,"");return RegExp(`^${t}$`)}function $n(...e){return t=>e.reduce(([n,r,i],o)=>{const[s,a,l]=o(t,i);return[{...n,...s},a||r,l]},[{},null,1]).slice(0,2)}function Bn(e,...t){if(e==null)return[null,null];for(const[n,r]of t){const i=n.exec(e);if(i)return r(i)}return[null,null]}function Yc(...e){return(t,n)=>{const r={};let i;for(i=0;i<e.length;i++)r[e[i]]=rn(t[n+i]);return[r,null,n+i]}}const Kc=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,h0=`(?:${Kc.source}?(?:\\[(${Dc.source})\\])?)?`,As=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Gc=RegExp(`${As.source}${h0}`),Ts=RegExp(`(?:T${Gc.source})?`),p0=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,m0=/(\d{4})-?W(\d\d)(?:-?(\d))?/,g0=/(\d{4})-?(\d{3})/,y0=Yc("weekYear","weekNumber","weekDay"),v0=Yc("year","ordinal"),b0=/(\d{4})-(\d\d)-(\d\d)/,Qc=RegExp(`${As.source} ?(?:${Kc.source}|(${Dc.source}))?`),w0=RegExp(`(?: ${Qc.source})?`);function zn(e,t,n){const r=e[t];return xe(r)?n:rn(r)}function S0(e,t){return[{year:zn(e,t),month:zn(e,t+1,1),day:zn(e,t+2,1)},null,t+3]}function Un(e,t){return[{hours:zn(e,t,0),minutes:zn(e,t+1,0),seconds:zn(e,t+2,0),milliseconds:ms(e[t+3])},null,t+4]}function Tr(e,t){const n=!e[t]&&!e[t+1],r=Ei(e[t+1],e[t+2]),i=n?null:it.instance(r);return[{},i,t+3]}function Ir(e,t){const n=e[t]?Yt.create(e[t]):null;return[{},n,t+1]}const x0=RegExp(`^T?${As.source}$`),k0=/^-?P(?:(?:(-?\d{1,9}(?:\.\d{1,9})?)Y)?(?:(-?\d{1,9}(?:\.\d{1,9})?)M)?(?:(-?\d{1,9}(?:\.\d{1,9})?)W)?(?:(-?\d{1,9}(?:\.\d{1,9})?)D)?(?:T(?:(-?\d{1,9}(?:\.\d{1,9})?)H)?(?:(-?\d{1,9}(?:\.\d{1,9})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,9}))?S)?)?)$/;function E0(e){const[t,n,r,i,o,s,a,l,u]=e,f=t[0]==="-",c=l&&l[0]==="-",h=(d,m=!1)=>d!==void 0&&(m||d&&f)?-d:d;return[{years:h(Sn(n)),months:h(Sn(r)),weeks:h(Sn(i)),days:h(Sn(o)),hours:h(Sn(s)),minutes:h(Sn(a)),seconds:h(Sn(l),l==="-0"),milliseconds:h(ms(u),c)}]}const C0={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Is(e,t,n,r,i,o,s){const a={year:t.length===2?vs(rn(t)):rn(t),month:Nc.indexOf(n)+1,day:rn(r),hour:rn(i),minute:rn(o)};return s&&(a.second=rn(s)),e&&(a.weekday=e.length>3?Pc.indexOf(e)+1:Lc.indexOf(e)+1),a}const A0=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function T0(e){const[,t,n,r,i,o,s,a,l,u,f,c]=e,h=Is(t,i,r,n,o,s,a);let d;return l?d=C0[l]:u?d=0:d=Ei(f,c),[h,new it(d)]}function I0(e){return e.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const O0=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,M0=/^(Monday|Tuesday|Wedsday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,D0=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Zc(e){const[,t,n,r,i,o,s,a]=e;return[Is(t,i,r,n,o,s,a),it.utcInstance]}function N0(e){const[,t,n,r,i,o,s,a]=e;return[Is(t,a,n,r,i,o,s),it.utcInstance]}const _0=Rn(p0,Ts),P0=Rn(m0,Ts),L0=Rn(g0,Ts),F0=Rn(Gc),Jc=$n(S0,Un,Tr,Ir),R0=$n(y0,Un,Tr,Ir),$0=$n(v0,Un,Tr,Ir),B0=$n(Un,Tr,Ir);function z0(e){return Bn(e,[_0,Jc],[P0,R0],[L0,$0],[F0,B0])}function U0(e){return Bn(I0(e),[A0,T0])}function j0(e){return Bn(e,[O0,Zc],[M0,Zc],[D0,N0])}function H0(e){return Bn(e,[k0,E0])}const V0=$n(Un);function W0(e){return Bn(e,[x0,V0])}const q0=Rn(b0,w0),Y0=Rn(Qc),K0=$n(Un,Tr,Ir);function G0(e){return Bn(e,[q0,Jc],[Y0,K0])}const Q0="Invalid Duration",Xc={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Z0={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...Xc},bt=146097/400,jn=146097/4800,J0={years:{quarters:4,months:12,weeks:bt/7,days:bt,hours:bt*24,minutes:bt*24*60,seconds:bt*24*60*60,milliseconds:bt*24*60*60*1e3},quarters:{months:3,weeks:bt/28,days:bt/4,hours:bt*24/4,minutes:bt*24*60/4,seconds:bt*24*60*60/4,milliseconds:bt*24*60*60*1e3/4},months:{weeks:jn/7,days:jn,hours:jn*24,minutes:jn*24*60,seconds:jn*24*60*60,milliseconds:jn*24*60*60*1e3},...Xc},xn=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],X0=xn.slice(0).reverse();function kn(e,t,n=!1){const r={values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy};return new Ee(r)}function ew(e){return e<0?Math.floor(e):Math.ceil(e)}function ef(e,t,n,r,i){const o=e[i][n],s=t[n]/o,a=Math.sign(s)===Math.sign(r[i]),l=!a&&r[i]!==0&&Math.abs(s)<=1?ew(s):Math.trunc(s);r[i]+=l,t[n]-=l*o}function tw(e,t){X0.reduce((n,r)=>xe(t[r])?n:(n&&ef(e,t,n,t,r),r),null)}class Ee{constructor(t){const n=t.conversionAccuracy==="longterm"||!1;this.values=t.values,this.loc=t.loc||Re.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=n?J0:Z0,this.isLuxonDuration=!0}static fromMillis(t,n){return Ee.fromObject({milliseconds:t},n)}static fromObject(t,n={}){if(t==null||typeof t!="object")throw new vt(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new Ee({values:Ci(t,Ee.normalizeUnit),loc:Re.fromObject(n),conversionAccuracy:n.conversionAccuracy})}static fromDurationLike(t){if(wn(t))return Ee.fromMillis(t);if(Ee.isDuration(t))return t;if(typeof t=="object")return Ee.fromObject(t);throw new vt(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){const[r]=H0(t);return r?Ee.fromObject(r,n):Ee.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){const[r]=W0(t);return r?Ee.fromObject(r,n):Ee.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,n=null){if(!t)throw new vt("need to specify a reason the Duration is invalid");const r=t instanceof Tt?t:new Tt(t,n);if(qe.throwOnInvalid)throw new Mb(r);return new Ee({invalid:r})}static normalizeUnit(t){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!n)throw new ac(t);return n}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,n={}){const r={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?lt.create(this.loc,r).formatDurationFromString(this,t):Q0}toHuman(t={}){const n=xn.map(r=>{const i=this.values[r];return xe(i)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:r.slice(0,-1)}).format(i)}).filter(r=>r);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=gs(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const n=this.toMillis();if(n<0||n>=864e5)return null;t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t};const r=this.shiftTo("hours","minutes","seconds","milliseconds");let i=t.format==="basic"?"hhmm":"hh:mm";(!t.suppressSeconds||r.seconds!==0||r.milliseconds!==0)&&(i+=t.format==="basic"?"ss":":ss",(!t.suppressMilliseconds||r.milliseconds!==0)&&(i+=".SSS"));let o=r.toFormat(i);return t.includePrefix&&(o="T"+o),o}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const n=Ee.fromDurationLike(t),r={};for(const i of xn)(Fn(n.values,i)||Fn(this.values,i))&&(r[i]=n.get(i)+this.get(i));return kn(this,{values:r},!0)}minus(t){if(!this.isValid)return this;const n=Ee.fromDurationLike(t);return this.plus(n.negate())}mapUnits(t){if(!this.isValid)return this;const n={};for(const r of Object.keys(this.values))n[r]=Mc(t(this.values[r],r));return kn(this,{values:n},!0)}get(t){return this[Ee.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const n={...this.values,...Ci(t,Ee.normalizeUnit)};return kn(this,{values:n})}reconfigure({locale:t,numberingSystem:n,conversionAccuracy:r}={}){const i=this.loc.clone({locale:t,numberingSystem:n}),o={loc:i};return r&&(o.conversionAccuracy=r),kn(this,o)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return tw(this.matrix,t),kn(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(s=>Ee.normalizeUnit(s));const n={},r={},i=this.toObject();let o;for(const s of xn)if(t.indexOf(s)>=0){o=s;let a=0;for(const u in r)a+=this.matrix[u][s]*r[u],r[u]=0;wn(i[s])&&(a+=i[s]);const l=Math.trunc(a);n[s]=l,r[s]=(a*1e3-l*1e3)/1e3;for(const u in i)xn.indexOf(u)>xn.indexOf(s)&&ef(this.matrix,i,u,n,s)}else wn(i[s])&&(r[s]=i[s]);for(const s in r)r[s]!==0&&(n[o]+=s===o?r[s]:r[s]/this.matrix[o][s]);return kn(this,{values:n},!0).normalize()}negate(){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=this.values[n]===0?0:-this.values[n];return kn(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function n(r,i){return r===void 0||r===0?i===void 0||i===0:r===i}for(const r of xn)if(!n(this.values[r],t.values[r]))return!1;return!0}}const Or="Invalid Interval";function nw(e,t){return!e||!e.isValid?ze.invalid("missing or invalid start"):!t||!t.isValid?ze.invalid("missing or invalid end"):t<e?ze.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null}class ze{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,n=null){if(!t)throw new vt("need to specify a reason the Interval is invalid");const r=t instanceof Tt?t:new Tt(t,n);if(qe.throwOnInvalid)throw new Ob(r);return new ze({invalid:r})}static fromDateTimes(t,n){const r=Nr(t),i=Nr(n),o=nw(r,i);return o??new ze({start:r,end:i})}static after(t,n){const r=Ee.fromDurationLike(n),i=Nr(t);return ze.fromDateTimes(i,i.plus(r))}static before(t,n){const r=Ee.fromDurationLike(n),i=Nr(t);return ze.fromDateTimes(i.minus(r),i)}static fromISO(t,n){const[r,i]=(t||"").split("/",2);if(r&&i){let o,s;try{o=pe.fromISO(r,n),s=o.isValid}catch{s=!1}let a,l;try{a=pe.fromISO(i,n),l=a.isValid}catch{l=!1}if(s&&l)return ze.fromDateTimes(o,a);if(s){const u=Ee.fromISO(i,n);if(u.isValid)return ze.after(o,u)}else if(l){const u=Ee.fromISO(r,n);if(u.isValid)return ze.before(a,u)}}return ze.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds"){if(!this.isValid)return NaN;const n=this.start.startOf(t),r=this.end.startOf(t);return Math.floor(r.diff(n,t).get(t))+1}hasSame(t){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,t):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return this.isValid?this.s>t:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:n}={}){return this.isValid?ze.fromDateTimes(t||this.s,n||this.e):this}splitAt(...t){if(!this.isValid)return[];const n=t.map(Nr).filter(s=>this.contains(s)).sort(),r=[];let{s:i}=this,o=0;for(;i<this.e;){const s=n[o]||this.e,a=+s>+this.e?this.e:s;r.push(ze.fromDateTimes(i,a)),i=a,o+=1}return r}splitBy(t){const n=Ee.fromDurationLike(t);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,i=1,o;const s=[];for(;r<this.e;){const a=this.start.plus(n.mapUnits(l=>l*i));o=+a>+this.e?this.e:a,s.push(ze.fromDateTimes(r,o)),r=o,i+=1}return s}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return this.isValid?+this.e==+t.s:!1}abutsEnd(t){return this.isValid?+t.e==+this.s:!1}engulfs(t){return this.isValid?this.s<=t.s&&this.e>=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const n=this.s>t.s?this.s:t.s,r=this.e<t.e?this.e:t.e;return n>=r?null:ze.fromDateTimes(n,r)}union(t){if(!this.isValid)return this;const n=this.s<t.s?this.s:t.s,r=this.e>t.e?this.e:t.e;return ze.fromDateTimes(n,r)}static merge(t){const[n,r]=t.sort((i,o)=>i.s-o.s).reduce(([i,o],s)=>o?o.overlaps(s)||o.abutsStart(s)?[i,o.union(s)]:[i.concat([o]),s]:[i,s],[[],null]);return r&&n.push(r),n}static xor(t){let n=null,r=0;const i=[],o=t.map(l=>[{time:l.s,type:"s"},{time:l.e,type:"e"}]),s=Array.prototype.concat(...o),a=s.sort((l,u)=>l.time-u.time);for(const l of a)r+=l.type==="s"?1:-1,r===1?n=l.time:(n&&+n!=+l.time&&i.push(ze.fromDateTimes(n,l.time)),n=null);return ze.merge(i)}difference(...t){return ze.xor([this].concat(t)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Or}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:Or}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Or}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:Or}toFormat(t,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${n}${this.e.toFormat(t)}`:Or}toDuration(t,n){return this.isValid?this.e.diff(this.s,t,n):Ee.invalid(this.invalidReason)}mapEndpoints(t){return ze.fromDateTimes(t(this.s),t(this.e))}}let Mi=class{static hasDST(t=qe.defaultZone){const n=pe.now().setZone(t).set({month:12});return!t.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(t){return Yt.isValidZone(t)}static normalizeZone(t){return on(t,qe.defaultZone)}static months(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null,outputCalendar:o="gregory"}={}){return(i||Re.create(n,r,o)).months(t)}static monthsFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null,outputCalendar:o="gregory"}={}){return(i||Re.create(n,r,o)).months(t,!0)}static weekdays(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null}={}){return(i||Re.create(n,r,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null}={}){return(i||Re.create(n,r,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return Re.create(t).meridiems()}static eras(t="short",{locale:n=null}={}){return Re.create(n,null,"gregory").eras(t)}static features(){return{relative:Tc()}}};function tf(e,t){const n=i=>i.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(t)-n(e);return Math.floor(Ee.fromMillis(r).as("days"))}function rw(e,t,n){const r=[["years",(a,l)=>l.year-a.year],["quarters",(a,l)=>l.quarter-a.quarter],["months",(a,l)=>l.month-a.month+(l.year-a.year)*12],["weeks",(a,l)=>{const u=tf(a,l);return(u-u%7)/7}],["days",tf]],i={};let o,s;for(const[a,l]of r)if(n.indexOf(a)>=0){o=a;let u=l(e,t);s=e.plus({[a]:u}),s>t?(e=e.plus({[a]:u-1}),u-=1):e=s,i[a]=u}return[e,i,s,o]}function iw(e,t,n,r){let[i,o,s,a]=rw(e,t,n);const l=t-i,u=n.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);u.length===0&&(s<t&&(s=i.plus({[a]:1})),s!==i&&(o[a]=(o[a]||0)+l/(s-i)));const f=Ee.fromObject(o,r);return u.length>0?Ee.fromMillis(l,r).shiftTo(...u).plus(f):f}const Os={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},nf={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},ow=Os.hanidec.replace(/[\[|\]]/g,"").split("");function sw(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(e[n].search(Os.hanidec)!==-1)t+=ow.indexOf(e[n]);else for(const i in nf){const[o,s]=nf[i];r>=o&&r<=s&&(t+=r-o)}}return parseInt(t,10)}else return t}function It({numberingSystem:e},t=""){return new RegExp(`${Os[e||"latn"]}${t}`)}const aw="missing Intl.DateTimeFormat.formatToParts support";function Ce(e,t=n=>n){return{regex:e,deser:([n])=>t(sw(n))}}const rf="[ ]",of=new RegExp(rf,"g");function lw(e){return e.replace(/\./g,"\\.?").replace(of,rf)}function sf(e){return e.replace(/\./g,"").replace(of," ").toLowerCase()}function Ot(e,t){return e===null?null:{regex:RegExp(e.map(lw).join("|")),deser:([n])=>e.findIndex(r=>sf(n)===sf(r))+t}}function af(e,t){return{regex:e,deser:([,n,r])=>Ei(n,r),groups:t}}function Ms(e){return{regex:e,deser:([t])=>t}}function uw(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function cw(e,t){const n=It(t),r=It(t,"{2}"),i=It(t,"{3}"),o=It(t,"{4}"),s=It(t,"{6}"),a=It(t,"{1,2}"),l=It(t,"{1,3}"),u=It(t,"{1,6}"),f=It(t,"{1,9}"),c=It(t,"{2,4}"),h=It(t,"{4,6}"),d=g=>({regex:RegExp(uw(g.val)),deser:([y])=>y,literal:!0}),p=(g=>{if(e.literal)return d(g);switch(g.val){case"G":return Ot(t.eras("short",!1),0);case"GG":return Ot(t.eras("long",!1),0);case"y":return Ce(u);case"yy":return Ce(c,vs);case"yyyy":return Ce(o);case"yyyyy":return Ce(h);case"yyyyyy":return Ce(s);case"M":return Ce(a);case"MM":return Ce(r);case"MMM":return Ot(t.months("short",!0,!1),1);case"MMMM":return Ot(t.months("long",!0,!1),1);case"L":return Ce(a);case"LL":return Ce(r);case"LLL":return Ot(t.months("short",!1,!1),1);case"LLLL":return Ot(t.months("long",!1,!1),1);case"d":return Ce(a);case"dd":return Ce(r);case"o":return Ce(l);case"ooo":return Ce(i);case"HH":return Ce(r);case"H":return Ce(a);case"hh":return Ce(r);case"h":return Ce(a);case"mm":return Ce(r);case"m":return Ce(a);case"q":return Ce(a);case"qq":return Ce(r);case"s":return Ce(a);case"ss":return Ce(r);case"S":return Ce(l);case"SSS":return Ce(i);case"u":return Ms(f);case"uu":return Ms(a);case"uuu":return Ce(n);case"a":return Ot(t.meridiems(),0);case"kkkk":return Ce(o);case"kk":return Ce(c,vs);case"W":return Ce(a);case"WW":return Ce(r);case"E":case"c":return Ce(n);case"EEE":return Ot(t.weekdays("short",!1,!1),1);case"EEEE":return Ot(t.weekdays("long",!1,!1),1);case"ccc":return Ot(t.weekdays("short",!0,!1),1);case"cccc":return Ot(t.weekdays("long",!0,!1),1);case"Z":case"ZZ":return af(new RegExp(`([+-]${a.source})(?::(${r.source}))?`),2);case"ZZZ":return af(new RegExp(`([+-]${a.source})(${r.source})?`),2);case"z":return Ms(/[a-z_+-/]{1,256}?/i);default:return d(g)}})(e)||{invalidReason:aw};return p.token=e,p}const fw={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"}};function dw(e,t,n){const{type:r,value:i}=e;if(r==="literal")return{literal:!0,val:i};const o=n[r];let s=fw[r];if(typeof s=="object"&&(s=s[o]),s)return{literal:!1,val:s}}function hw(e){return[`^${e.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,e]}function pw(e,t,n){const r=e.match(t);if(r){const i={};let o=1;for(const s in n)if(Fn(n,s)){const a=n[s],l=a.groups?a.groups+1:1;!a.literal&&a.token&&(i[a.token.val[0]]=a.deser(r.slice(o,o+l))),o+=l}return[r,i]}else return[r,{}]}function mw(e){const t=o=>{switch(o){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,r;return xe(e.z)||(n=Yt.create(e.z)),xe(e.Z)||(n||(n=new it(e.Z)),r=e.Z),xe(e.q)||(e.M=(e.q-1)*3+1),xe(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),xe(e.u)||(e.S=ms(e.u)),[Object.keys(e).reduce((o,s)=>{const a=t(s);return a&&(o[a]=e[s]),o},{}),n,r]}let Ds=null;function gw(){return Ds||(Ds=pe.fromMillis(1555555555555)),Ds}function yw(e,t){if(e.literal)return e;const n=lt.macroTokenToFormatOpts(e.val);if(!n)return e;const o=lt.create(t,n).formatDateTimeParts(gw()).map(s=>dw(s,t,n));return o.includes(void 0)?e:o}function vw(e,t){return Array.prototype.concat(...e.map(n=>yw(n,t)))}function lf(e,t,n){const r=vw(lt.parseFormat(n),e),i=r.map(s=>cw(s,e)),o=i.find(s=>s.invalidReason);if(o)return{input:t,tokens:r,invalidReason:o.invalidReason};{const[s,a]=hw(i),l=RegExp(s,"i"),[u,f]=pw(t,l,a),[c,h,d]=f?mw(f):[null,null,void 0];if(Fn(f,"a")&&Fn(f,"H"))throw new Sr("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:r,regex:l,rawMatches:u,matches:f,result:c,zone:h,specificOffset:d}}}function bw(e,t,n){const{result:r,zone:i,specificOffset:o,invalidReason:s}=lf(e,t,n);return[r,i,o,s]}const uf=[0,31,59,90,120,151,181,212,243,273,304,334],cf=[0,31,60,91,121,152,182,213,244,274,305,335];function wt(e,t){return new Tt("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function ff(e,t,n){const r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const i=r.getUTCDay();return i===0?7:i}function df(e,t,n){return n+(xr(e)?cf:uf)[t-1]}function hf(e,t){const n=xr(e)?cf:uf,r=n.findIndex(o=>o<t),i=t-n[r];return{month:r+1,day:i}}function Ns(e){const{year:t,month:n,day:r}=e,i=df(t,n,r),o=ff(t,n,r);let s=Math.floor((i-o+10)/7),a;return s<1?(a=t-1,s=ki(a)):s>ki(t)?(a=t+1,s=1):a=t,{weekYear:a,weekNumber:s,weekday:o,...Ai(e)}}function pf(e){const{weekYear:t,weekNumber:n,weekday:r}=e,i=ff(t,1,4),o=kr(t);let s=n*7+r-i-3,a;s<1?(a=t-1,s+=kr(a)):s>o?(a=t+1,s-=kr(t)):a=t;const{month:l,day:u}=hf(a,s);return{year:a,month:l,day:u,...Ai(e)}}function _s(e){const{year:t,month:n,day:r}=e,i=df(t,n,r);return{year:t,ordinal:i,...Ai(e)}}function mf(e){const{year:t,ordinal:n}=e,{month:r,day:i}=hf(t,n);return{year:t,month:r,day:i,...Ai(e)}}function ww(e){const t=Si(e.weekYear),n=qt(e.weekNumber,1,ki(e.weekYear)),r=qt(e.weekday,1,7);return t?n?r?!1:wt("weekday",e.weekday):wt("week",e.week):wt("weekYear",e.weekYear)}function Sw(e){const t=Si(e.year),n=qt(e.ordinal,1,kr(e.year));return t?n?!1:wt("ordinal",e.ordinal):wt("year",e.year)}function gf(e){const t=Si(e.year),n=qt(e.month,1,12),r=qt(e.day,1,xi(e.year,e.month));return t?n?r?!1:wt("day",e.day):wt("month",e.month):wt("year",e.year)}function yf(e){const{hour:t,minute:n,second:r,millisecond:i}=e,o=qt(t,0,23)||t===24&&n===0&&r===0&&i===0,s=qt(n,0,59),a=qt(r,0,59),l=qt(i,0,999);return o?s?a?l?!1:wt("millisecond",i):wt("second",r):wt("minute",n):wt("hour",t)}const Ps="Invalid DateTime",vf=864e13;function Di(e){return new Tt("unsupported zone",`the zone "${e.name}" is not supported`)}function Ls(e){return e.weekData===null&&(e.weekData=Ns(e.c)),e.weekData}function Mr(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new pe({...n,...t,old:n})}function bf(e,t,n){let r=e-t*60*1e3;const i=n.offset(r);if(t===i)return[r,t];r-=(i-t)*60*1e3;const o=n.offset(r);return i===o?[r,i]:[e-Math.min(i,o)*60*1e3,Math.max(i,o)]}function wf(e,t){e+=t*60*1e3;const n=new Date(e);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function Ni(e,t,n){return bf(ys(e),t,n)}function Sf(e,t){const n=e.o,r=e.c.year+Math.trunc(t.years),i=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,o={...e.c,year:r,month:i,day:Math.min(e.c.day,xi(r,i))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},s=Ee.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),a=ys(o);let[l,u]=bf(a,n,e.zone);return s!==0&&(l+=s,u=e.zone.offset(l)),{ts:l,o:u}}function Dr(e,t,n,r,i,o){const{setZone:s,zone:a}=n;if(e&&Object.keys(e).length!==0){const l=t||a,u=pe.fromObject(e,{...n,zone:l,specificOffset:o});return s?u:u.setZone(a)}else return pe.invalid(new Tt("unparsable",`the input "${i}" can't be parsed as ${r}`))}function _i(e,t,n=!0){return e.isValid?lt.create(Re.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function Fs(e,t){const n=e.c.year>9999||e.c.year<0;let r="";return n&&e.c.year>=0&&(r+="+"),r+=Ve(e.c.year,n?6:4),t?(r+="-",r+=Ve(e.c.month),r+="-",r+=Ve(e.c.day)):(r+=Ve(e.c.month),r+=Ve(e.c.day)),r}function xf(e,t,n,r,i,o){let s=Ve(e.c.hour);return t?(s+=":",s+=Ve(e.c.minute),(e.c.second!==0||!n)&&(s+=":")):s+=Ve(e.c.minute),(e.c.second!==0||!n)&&(s+=Ve(e.c.second),(e.c.millisecond!==0||!r)&&(s+=".",s+=Ve(e.c.millisecond,3))),i&&(e.isOffsetFixed&&e.offset===0&&!o?s+="Z":e.o<0?(s+="-",s+=Ve(Math.trunc(-e.o/60)),s+=":",s+=Ve(Math.trunc(-e.o%60))):(s+="+",s+=Ve(Math.trunc(e.o/60)),s+=":",s+=Ve(Math.trunc(e.o%60)))),o&&(s+="["+e.zone.ianaName+"]"),s}const kf={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},xw={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},kw={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Ef=["year","month","day","hour","minute","second","millisecond"],Ew=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Cw=["year","ordinal","hour","minute","second","millisecond"];function Cf(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new ac(e);return t}function Af(e,t){const n=on(t.zone,qe.defaultZone),r=Re.fromObject(t),i=qe.now();let o,s;if(xe(e.year))o=i;else{for(const u of Ef)xe(e[u])&&(e[u]=kf[u]);const a=gf(e)||yf(e);if(a)return pe.invalid(a);const l=n.offset(i);[o,s]=Ni(e,l,n)}return new pe({ts:o,zone:n,loc:r,o:s})}function Tf(e,t,n){const r=xe(n.round)?!0:n.round,i=(s,a)=>(s=gs(s,r||n.calendary?0:2,!0),t.loc.clone(n).relFormatter(n).format(s,a)),o=s=>n.calendary?t.hasSame(e,s)?0:t.startOf(s).diff(e.startOf(s),s).get(s):t.diff(e,s).get(s);if(n.unit)return i(o(n.unit),n.unit);for(const s of n.units){const a=o(s);if(Math.abs(a)>=1)return i(a,s)}return i(e>t?-0:0,n.units[n.units.length-1])}function If(e){let t={},n;return e.length>0&&typeof e[e.length-1]=="object"?(t=e[e.length-1],n=Array.from(e).slice(0,e.length-1)):n=Array.from(e),[t,n]}class pe{constructor(t){const n=t.zone||qe.defaultZone;let r=t.invalid||(Number.isNaN(t.ts)?new Tt("invalid input"):null)||(n.isValid?null:Di(n));this.ts=xe(t.ts)?qe.now():t.ts;let i=null,o=null;if(!r)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(n))[i,o]=[t.old.c,t.old.o];else{const a=n.offset(this.ts);i=wf(this.ts,a),r=Number.isNaN(i.year)?new Tt("invalid input"):null,i=r?null:i,o=r?null:a}this._zone=n,this.loc=t.loc||Re.create(),this.invalid=r,this.weekData=null,this.c=i,this.o=o,this.isLuxonDateTime=!0}static now(){return new pe({})}static local(){const[t,n]=If(arguments),[r,i,o,s,a,l,u]=n;return Af({year:r,month:i,day:o,hour:s,minute:a,second:l,millisecond:u},t)}static utc(){const[t,n]=If(arguments),[r,i,o,s,a,l,u]=n;return t.zone=it.utcInstance,Af({year:r,month:i,day:o,hour:s,minute:a,second:l,millisecond:u},t)}static fromJSDate(t,n={}){const r=Pb(t)?t.valueOf():NaN;if(Number.isNaN(r))return pe.invalid("invalid input");const i=on(n.zone,qe.defaultZone);return i.isValid?new pe({ts:r,zone:i,loc:Re.fromObject(n)}):pe.invalid(Di(i))}static fromMillis(t,n={}){if(wn(t))return t<-vf||t>vf?pe.invalid("Timestamp out of range"):new pe({ts:t,zone:on(n.zone,qe.defaultZone),loc:Re.fromObject(n)});throw new vt(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,n={}){if(wn(t))return new pe({ts:t*1e3,zone:on(n.zone,qe.defaultZone),loc:Re.fromObject(n)});throw new vt("fromSeconds requires a numerical input")}static fromObject(t,n={}){t=t||{};const r=on(n.zone,qe.defaultZone);if(!r.isValid)return pe.invalid(Di(r));const i=qe.now(),o=xe(n.specificOffset)?r.offset(i):n.specificOffset,s=Ci(t,Cf),a=!xe(s.ordinal),l=!xe(s.year),u=!xe(s.month)||!xe(s.day),f=l||u,c=s.weekYear||s.weekNumber,h=Re.fromObject(n);if((f||a)&&c)throw new Sr("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&a)throw new Sr("Can't mix ordinal dates with month/day");const d=c||s.weekday&&!f;let m,p,g=wf(i,o);d?(m=Ew,p=xw,g=Ns(g)):a?(m=Cw,p=kw,g=_s(g)):(m=Ef,p=kf);let y=!1;for(const M of m){const P=s[M];xe(P)?y?s[M]=p[M]:s[M]=g[M]:y=!0}const v=d?ww(s):a?Sw(s):gf(s),w=v||yf(s);if(w)return pe.invalid(w);const E=d?pf(s):a?mf(s):s,[S,C]=Ni(E,o,r),I=new pe({ts:S,zone:r,o:C,loc:h});return s.weekday&&f&&t.weekday!==I.weekday?pe.invalid("mismatched weekday",`you can't specify both a weekday of ${s.weekday} and a date of ${I.toISO()}`):I}static fromISO(t,n={}){const[r,i]=z0(t);return Dr(r,i,n,"ISO 8601",t)}static fromRFC2822(t,n={}){const[r,i]=U0(t);return Dr(r,i,n,"RFC 2822",t)}static fromHTTP(t,n={}){const[r,i]=j0(t);return Dr(r,i,n,"HTTP",n)}static fromFormat(t,n,r={}){if(xe(t)||xe(n))throw new vt("fromFormat requires an input string and a format");const{locale:i=null,numberingSystem:o=null}=r,s=Re.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0}),[a,l,u,f]=bw(s,t,n);return f?pe.invalid(f):Dr(a,l,r,`format ${n}`,t,u)}static fromString(t,n,r={}){return pe.fromFormat(t,n,r)}static fromSQL(t,n={}){const[r,i]=G0(t);return Dr(r,i,n,"SQL",t)}static invalid(t,n=null){if(!t)throw new vt("need to specify a reason the DateTime is invalid");const r=t instanceof Tt?t:new Tt(t,n);if(qe.throwOnInvalid)throw new Ib(r);return new pe({invalid:r})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Ls(this).weekYear:NaN}get weekNumber(){return this.isValid?Ls(this).weekNumber:NaN}get weekday(){return this.isValid?Ls(this).weekday:NaN}get ordinal(){return this.isValid?_s(this.c).ordinal:NaN}get monthShort(){return this.isValid?Mi.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Mi.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Mi.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Mi.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}get isInLeapYear(){return xr(this.year)}get daysInMonth(){return xi(this.year,this.month)}get daysInYear(){return this.isValid?kr(this.year):NaN}get weeksInWeekYear(){return this.isValid?ki(this.weekYear):NaN}resolvedLocaleOptions(t={}){const{locale:n,numberingSystem:r,calendar:i}=lt.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:i}}toUTC(t=0,n={}){return this.setZone(it.instance(t),n)}toLocal(){return this.setZone(qe.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(t=on(t,qe.defaultZone),t.equals(this.zone))return this;if(t.isValid){let i=this.ts;if(n||r){const o=t.offset(this.ts),s=this.toObject();[i]=Ni(s,o,t)}return Mr(this,{ts:i,zone:t})}else return pe.invalid(Di(t))}reconfigure({locale:t,numberingSystem:n,outputCalendar:r}={}){const i=this.loc.clone({locale:t,numberingSystem:n,outputCalendar:r});return Mr(this,{loc:i})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const n=Ci(t,Cf),r=!xe(n.weekYear)||!xe(n.weekNumber)||!xe(n.weekday),i=!xe(n.ordinal),o=!xe(n.year),s=!xe(n.month)||!xe(n.day),a=o||s,l=n.weekYear||n.weekNumber;if((a||i)&&l)throw new Sr("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(s&&i)throw new Sr("Can't mix ordinal dates with month/day");let u;r?u=pf({...Ns(this.c),...n}):xe(n.ordinal)?(u={...this.toObject(),...n},xe(n.day)&&(u.day=Math.min(xi(u.year,u.month),u.day))):u=mf({..._s(this.c),...n});const[f,c]=Ni(u,this.o,this.zone);return Mr(this,{ts:f,o:c})}plus(t){if(!this.isValid)return this;const n=Ee.fromDurationLike(t);return Mr(this,Sf(this,n))}minus(t){if(!this.isValid)return this;const n=Ee.fromDurationLike(t).negate();return Mr(this,Sf(this,n))}startOf(t){if(!this.isValid)return this;const n={},r=Ee.normalizeUnit(t);switch(r){case"years":n.month=1;case"quarters":case"months":n.day=1;case"weeks":case"days":n.hour=0;case"hours":n.minute=0;case"minutes":n.second=0;case"seconds":n.millisecond=0;break}if(r==="weeks"&&(n.weekday=1),r==="quarters"){const i=Math.ceil(this.month/3);n.month=(i-1)*3+1}return this.set(n)}endOf(t){return this.isValid?this.plus({[t]:1}).startOf(t).minus(1):this}toFormat(t,n={}){return this.isValid?lt.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,t):Ps}toLocaleString(t=ps,n={}){return this.isValid?lt.create(this.loc.clone(n),t).formatDateTime(this):Ps}toLocaleParts(t={}){return this.isValid?lt.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:n=!1,suppressMilliseconds:r=!1,includeOffset:i=!0,extendedZone:o=!1}={}){if(!this.isValid)return null;const s=t==="extended";let a=Fs(this,s);return a+="T",a+=xf(this,s,n,r,i,o),a}toISODate({format:t="extended"}={}){return this.isValid?Fs(this,t==="extended"):null}toISOWeekDate(){return _i(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:n=!1,includeOffset:r=!0,includePrefix:i=!1,extendedZone:o=!1,format:s="extended"}={}){return this.isValid?(i?"T":"")+xf(this,s==="extended",n,t,r,o):null}toRFC2822(){return _i(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return _i(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?Fs(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:n=!1,includeOffsetSpace:r=!0}={}){let i="HH:mm:ss.SSS";return(n||t)&&(r&&(i+=" "),n?i+="z":t&&(i+="ZZ")),_i(this,i,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():Ps}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const n={...this.c};return t.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,n="milliseconds",r={}){if(!this.isValid||!t.isValid)return Ee.invalid("created by diffing an invalid DateTime");const i={locale:this.locale,numberingSystem:this.numberingSystem,...r},o=Lb(n).map(Ee.normalizeUnit),s=t.valueOf()>this.valueOf(),a=s?this:t,l=s?t:this,u=iw(a,l,o,i);return s?u.negate():u}diffNow(t="milliseconds",n={}){return this.diff(pe.now(),t,n)}until(t){return this.isValid?ze.fromDateTimes(this,t):this}hasSame(t,n){if(!this.isValid)return!1;const r=t.valueOf(),i=this.setZone(t.zone,{keepLocalTime:!0});return i.startOf(n)<=r&&r<=i.endOf(n)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const n=t.base||pe.fromObject({},{zone:this.zone}),r=t.padding?this<n?-t.padding:t.padding:0;let i=["years","months","days","hours","minutes","seconds"],o=t.unit;return Array.isArray(t.unit)&&(i=t.unit,o=void 0),Tf(n,this.plus(r),{...t,numeric:"always",units:i,unit:o})}toRelativeCalendar(t={}){return this.isValid?Tf(t.base||pe.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(pe.isDateTime))throw new vt("min requires all arguments be DateTimes");return Ic(t,n=>n.valueOf(),Math.min)}static max(...t){if(!t.every(pe.isDateTime))throw new vt("max requires all arguments be DateTimes");return Ic(t,n=>n.valueOf(),Math.max)}static fromFormatExplain(t,n,r={}){const{locale:i=null,numberingSystem:o=null}=r,s=Re.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0});return lf(s,t,n)}static fromStringExplain(t,n,r={}){return pe.fromFormatExplain(t,n,r)}static get DATE_SHORT(){return ps}static get DATE_MED(){return lc}static get DATE_MED_WITH_WEEKDAY(){return Db}static get DATE_FULL(){return uc}static get DATE_HUGE(){return cc}static get TIME_SIMPLE(){return fc}static get TIME_WITH_SECONDS(){return dc}static get TIME_WITH_SHORT_OFFSET(){return hc}static get TIME_WITH_LONG_OFFSET(){return pc}static get TIME_24_SIMPLE(){return mc}static get TIME_24_WITH_SECONDS(){return gc}static get TIME_24_WITH_SHORT_OFFSET(){return yc}static get TIME_24_WITH_LONG_OFFSET(){return vc}static get DATETIME_SHORT(){return bc}static get DATETIME_SHORT_WITH_SECONDS(){return wc}static get DATETIME_MED(){return Sc}static get DATETIME_MED_WITH_SECONDS(){return xc}static get DATETIME_MED_WITH_WEEKDAY(){return Nb}static get DATETIME_FULL(){return kc}static get DATETIME_FULL_WITH_SECONDS(){return Ec}static get DATETIME_HUGE(){return Cc}static get DATETIME_HUGE_WITH_SECONDS(){return Ac}}function Nr(e){if(pe.isDateTime(e))return e;if(e&&e.valueOf&&wn(e.valueOf()))return pe.fromJSDate(e);if(e&&typeof e=="object")return pe.fromObject(e);throw new vt(`Unknown datetime argument: ${e}, of type ${typeof e}`)}function Aw(e){const t=typeof e=="string"?pe.fromISO(e):pe.fromJSDate(e);if(!t.isValid)return"Invalid date";const r=pe.now().diff(t,["years","months","days","hours","minutes"]).toObject();return r.years&&r.years>=1?`${Math.floor(r.years)} year${Math.floor(r.years)>1?"s":""} ago`:r.months&&r.months>=1?`${Math.floor(r.months)} month${Math.floor(r.months)>1?"s":""} ago`:r.days&&r.days>=1?`${Math.floor(r.days)} day${Math.floor(r.days)>1?"s":""} ago`:r.hours&&r.hours>=1?`${Math.floor(r.hours)}h ago`:r.minutes&&r.minutes>=1?`${Math.floor(r.minutes)}m ago`:"just now"}function Rs(e){if(!/^#?([a-fA-F\d]{6}|[a-fA-F\d]{3})$/.test(e))return{r:0,g:0,b:0};const n=e.replace(/^#/,"");let r=n;n.length===3&&(r=n.split("").map(l=>l+l).join(""));const i=parseInt(r,16),o=i>>16&255,s=i>>8&255,a=i&255;return{r:o,g:s,b:a}}function Tw(e){return`#${((1<<24)+(e.r<<16)+(e.g<<8)+e.b).toString(16).slice(1)}`}const Iw=(e,t=30)=>{const n=Math.min(e.r,e.g,e.b),r=Math.max(e.r,e.g,e.b,n+1);return{r:Math.floor((e.r-n)/(r-n)*t*(1-.299)+120-t/2),g:Math.floor((e.g-n)/(r-n)*t*(1-.587)+120-t/2),b:Math.floor((e.b-n)/(r-n)*t*(1-.114)+120-t/2)}};function Of(e){return Object.entries(e).reduce((t,[n,r])=>{const i=n.replace(/(\d+)/,o=>(1e3-parseInt(o)).toString());return{...t,[i]:r}},{})}const Ow=2.4,Mw=.2126729,Dw=.7151522,Nw=.072175,_w=.56,Pw=.57,Lw=.62,Fw=.65,Pi=.022,Mf=1.414,Rw=1.14,$w=1.14,Bw=.035991,zw=27.7847239587675,Uw=27.7847239587675,Df=.027,Nf=.027,_f=.001,jw=5e-4;function Pf(e){const{r:t,g:n,b:r}=e,i=o=>(o/255)**Ow;return Mw*i(t)+Dw*i(n)+Nw*i(r)}function Lf(e,t){if(!e||!t)return 0;let n=Pf(Rs(e)),r=Pf(Rs(t)),i=0,o=0;return n=n>Pi?n:n+(Pi-n)**Mf,r=r>Pi?r:r+(Pi-r)**Mf,Math.abs(r-n)<jw?0:(r>n?(i=(r**_w-n**Pw)*Rw,o=i<_f?0:i<Bw?i-i*zw*Df:i-Df):(i=(r**Fw-n**Lw)*$w,o=i>-_f?0:i>-.035991?i-i*Uw*Nf:i+Nf),Math.abs(o*100))}const Hw=(e,t,n)=>{const r=e;let i=0;for(;t.some(o=>n(o)===e);)i+=1,e=`${r} (${i})`;return e};function Ff(e){const{fontFamily:t,...n}=e,r=Rf(n);return Zu(".bpReset",{...r,"font-family":`'${t}', sans-serif`})+Zu(":host, :root",{...r})}function Rf(e){const{radius:t,themeMode:n,color:r,variant:i,headerVariant:o}=e;let s={},a={};if(r){const h=oc(r),d=n==="dark"?Of(h):h,m=oc(Tw(Iw(Rs(r)))),p=n==="dark"?Of(m):m,g=n==="dark"?"#101010":"#fdfdfd";a=Object.entries({...d,1:g}).reduce((v,[w,E])=>({...v,[`--bpPrimary-${w}`]:E}),{});const y=Object.entries({...p,1:g}).reduce((v,[w,E])=>({...v,[`--bpGray-${w}`]:E}),{});s={...a,...y}}t&&(s={...s,"--bpRadius-scale":t.toString()});const l=n==="dark"?{bg:"var(--transparent-dark)",bgHover:"var(--transparent-dark-hover)"}:{bg:"var(--transparent-light)",bgHover:"var(--transparent-light-hover)"},u=a?Lf(a["--bpPrimary-600"],a["--bpPrimary-50"])>40?"var(--bpPrimary-50)":"var(--bpPrimary-900)":"var(--bpPrimary-50)",f=i==="solid"?{"--message-bg":"var(--bpPrimary-600)","--message-bg-hover":"var(--bpPrimary-700)","--message-text":u,"--send-button-bg":"var(--bpPrimary-600)","--send-button-bg-hover":"var(--bpPrimary-700)","--send-button-text":"var(--bpPrimary-50)","--button-bg":"var(--bpPrimary-200)","--button-bg-hover":"var(--bpPrimary-300)","--button-text":"var(--bpPrimary-800)","--fab-bg":"var(--bpPrimary-600)","--fab-bg-hover":"var(--bpPrimary-700)","--fab-icon":u,"--modal-submit-bg":"var(--bpPrimary-600)","--modal-submit-bg-hover":"var(--bpPrimary-700)"}:{"--message-bg":"var(--bpPrimary-100)","--message-bg-hover":"var(--bpPrimary-200)","--message-text":"var(--bpPrimary-900)","--send-button-bg":"var(--bpPrimary-600)","--send-button-bg-hover":"var(--bpPrimary-700)","--send-button-text":"var(--bpPrimary-50)","--button-bg":"var(--bpPrimary-500)","--button-bg-hover":"var(--bpPrimary-600)","--button-text":a?Lf(a["--bpPrimary-500"],a["--bpPrimary-50"])>40?"var(--bpPrimary-50)":"var(--bpPrimary-900)":"var(--bpPrimary-50)","--fab-bg":"var(--bpPrimary-100)","--fab-bg-hover":"var(--bpPrimary-200)","--fab-icon":"var(--bpPrimary-700)","--scrollbar":"var(--bpGray-500)","--scrollbar-hover":"var(--bpGray-400)","--modal-submit-bg":"var(--bpPrimary-200)","--modal-submit-bg-hover":"var(--bpPrimary-300)"},c=o==="solid"?{"--header-bg":"var(--bpPrimary-600)","--header-bg-hover":"var(--bpPrimary-700)","--header-hover-dark":"var(--bpPrimary-800)","--header-title":u,"--header-description":u,"--header-description-icon":u,"--header-description-link":u,"--header-avatar-bg":"var(--bpPrimary-300)","--header-avatar-text":"var(--bpPrimary-700)"}:{"--header-bg":l.bg,"--header-bg-hover":l.bgHover,"--header-hover-dark":"var(--bpGray-200)","--header-title":"var(--bpGray-900)","--header-description":"var(--bpGray-600)","--header-description-icon":"var(--bpPrimary-700)","--header-description-link":"var(--bpPrimary-800)","--header-avatar-bg":"var(--bpPrimary-600)","--header-avatar-text":"var(--bpPrimary-50)"};return{...s,...f,...c}}const Vw=e=>{if(typeof URL.canParse=="function")return URL.canParse(e);try{return new URL(e),!0}catch{return!1}},$f=["audio","file","image","video"],Bf=e=>$f.includes(e),zf="The Client ID is required to initialize the webchat.",Ww="The API url is required to initialize the webchat.",qw="The Bot ID is required to initialize the webchat.",Yw="No config URL provided.",Uf=`Invalid API URL.
|
|
18
|
+
Please use a valid API URL.`,jf=`Invalid Client ID.
|
|
19
|
+
Please use a valid Botpress Client ID.`,Hf=`Invalid URL.
|
|
20
|
+
Please make sure your client ID and API URL are valid`,Kw=`Invalid config URL.
|
|
21
|
+
Please make sure your config URL is valid`,Gw=`Invalid webchat configuration.
|
|
22
|
+
Please make sure your config file is valid`,Qw="Access denied to configuration file. Please check your credentials or your configuration URL and try again.",Vf=`This bot has temporarily paused.
|
|
23
|
+
Please check back later.`,Wf=`This bot has temporarily paused.
|
|
24
|
+
Please check back later.`,$s="Something went wrong. To fix it, please clear your browser's local and session storage and then refresh the page",Li="Please check your internet connection and refresh the page.",qf=`You've been disconnected from the conversation.
|
|
25
|
+
Please refresh the page.`,Yf=`Unable to process the message.
|
|
26
|
+
Please start a new conversation.`,Bs={ResourceNotFound:{type:"configuration",message:jf},Forbidden:{type:"bot",message:Vf}},zs={MethodNotFound:{type:"configuration",message:Hf},QuotaExceeded:{type:"bot",message:Wf},Forbidden:{type:"bot",message:$s}};function Kf(e){return e in Bs}function Gf(e){return e in zs}function Qf(e){return e!==null&&typeof e=="object"&&"id"in e&&"code"in e&&"type"in e}function Zf(e){return e!==null&&typeof e=="object"&&"type"in e&&e.type==="error"&&"message"in e&&typeof e.message=="string"}const Jf=async(e,t=3,n=1e3)=>{let r;for(let i=1;i<=t;i++)try{return await e()}catch(o){if(r=o,i===t)throw r;const s=n*Math.pow(2,i-1);await new Promise(a=>setTimeout(a,s))}throw new Error("Unreachable: retry loop should always return or throw")},Zw=["networkerror","failedtofetch","errorininputstream"],_r=e=>{var n;console.error("An error occurred:",e);let t={type:"unknown",message:"An unexpected error occurred"};if(Qf(e))e.type==="network"?t={id:e.id,type:"network",message:Li}:(n=e.message)!=null&&n.includes("[Webhook Handler]")&&Kf(e.type)?t={id:e.id,...Bs[e.type]}:Gf(e.type)?t={id:e.id,...zs[e.type]}:t={id:e.id,type:e.type,message:e.message||"An error occurred"};else if(Zf(e))Xf(e.message)?t={type:"disconnected",message:qf}:ed(e.message).includes("invalidcontenttype")?t={type:"bot",message:Yf}:t={type:"event",message:e.message};else if(e instanceof Error&&Xf(e.message))t={type:"network",message:Li};else if(e&&typeof e=="object"&&"type"in e&&"message"in e){const r=e;r.type==="network"?t={type:"network",message:Li}:t={type:r.type,message:r.message}}return t};function Xf(e){return Zw.some(t=>ed(e).includes(t))}function ed(e){return e.replaceAll(" ","").toLowerCase()}const Jw=(e,t)=>{if(!e)return{type:"configuration",message:zf};if(!Vw(t))return{type:"configuration",message:Uf}},Xw=e=>new Promise((t,n)=>{const r=new FileReader;r.onload=i=>{var o;return t((o=i.target)==null?void 0:o.result)},r.onerror=i=>{var o;return n((o=i.target)==null?void 0:o.error)},r.readAsArrayBuffer(e)});function e1(e,t,n,r){let i;return t&&e?i={conversationId:e,userToken:t}:t?i={conversationId:void 0,userToken:t}:i={conversationId:n,userToken:r},i}const En=D.forwardRef(({userId:e,src:t,container:n,image:r,fallback:i,...o},s)=>{const a=Ju(e??"",15);return k.jsxs(fs,{ref:s,"data-color":a,...n,...o,children:[k.jsx(ds,{src:t,...r}),k.jsx(hs,{...i,children:typeof o.children=="string"?o.children[0]:o.children})]})});En.displayName="Avatar";function FP(){}function RP(){}function t1(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const n1=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,r1=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,i1={};function td(e,t){return(i1.jsx?r1:n1).test(e)}const o1=/[ \t\n\f\r]/g;function s1(e){return typeof e=="object"?e.type==="text"?nd(e.value):!1:nd(e)}function nd(e){return e.replace(o1,"")===""}class Pr{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Pr.prototype.normal={},Pr.prototype.property={},Pr.prototype.space=void 0;function rd(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Pr(n,r,t)}function Us(e){return e.toLowerCase()}class ut{constructor(t,n){this.attribute=n,this.property=t}}ut.prototype.attribute="",ut.prototype.booleanish=!1,ut.prototype.boolean=!1,ut.prototype.commaOrSpaceSeparated=!1,ut.prototype.commaSeparated=!1,ut.prototype.defined=!1,ut.prototype.mustUseProperty=!1,ut.prototype.number=!1,ut.prototype.overloadedBoolean=!1,ut.prototype.property="",ut.prototype.spaceSeparated=!1,ut.prototype.space=void 0;let a1=0;const ye=Cn(),We=Cn(),js=Cn(),Z=Cn(),_e=Cn(),Hn=Cn(),pt=Cn();function Cn(){return 2**++a1}const Hs=Object.freeze(Object.defineProperty({__proto__:null,boolean:ye,booleanish:We,commaOrSpaceSeparated:pt,commaSeparated:Hn,number:Z,overloadedBoolean:js,spaceSeparated:_e},Symbol.toStringTag,{value:"Module"})),Vs=Object.keys(Hs);class Ws extends ut{constructor(t,n,r,i){let o=-1;if(super(t,n),id(this,"space",i),typeof r=="number")for(;++o<Vs.length;){const s=Vs[o];id(this,Vs[o],(r&Hs[s])===Hs[s])}}}Ws.prototype.defined=!0;function id(e,t,n){n&&(e[t]=n)}function Vn(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new Ws(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Us(r)]=r,n[Us(o.attribute)]=r}return new Pr(t,n,e.space)}const od=Vn({properties:{ariaActiveDescendant:null,ariaAtomic:We,ariaAutoComplete:null,ariaBusy:We,ariaChecked:We,ariaColCount:Z,ariaColIndex:Z,ariaColSpan:Z,ariaControls:_e,ariaCurrent:null,ariaDescribedBy:_e,ariaDetails:null,ariaDisabled:We,ariaDropEffect:_e,ariaErrorMessage:null,ariaExpanded:We,ariaFlowTo:_e,ariaGrabbed:We,ariaHasPopup:null,ariaHidden:We,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:_e,ariaLevel:Z,ariaLive:null,ariaModal:We,ariaMultiLine:We,ariaMultiSelectable:We,ariaOrientation:null,ariaOwns:_e,ariaPlaceholder:null,ariaPosInSet:Z,ariaPressed:We,ariaReadOnly:We,ariaRelevant:null,ariaRequired:We,ariaRoleDescription:_e,ariaRowCount:Z,ariaRowIndex:Z,ariaRowSpan:Z,ariaSelected:We,ariaSetSize:Z,ariaSort:null,ariaValueMax:Z,ariaValueMin:Z,ariaValueNow:Z,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function sd(e,t){return t in e?e[t]:t}function ad(e,t){return sd(e,t.toLowerCase())}const l1=Vn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Hn,acceptCharset:_e,accessKey:_e,action:null,allow:null,allowFullScreen:ye,allowPaymentRequest:ye,allowUserMedia:ye,alt:null,as:null,async:ye,autoCapitalize:null,autoComplete:_e,autoFocus:ye,autoPlay:ye,blocking:_e,capture:null,charSet:null,checked:ye,cite:null,className:_e,cols:Z,colSpan:null,content:null,contentEditable:We,controls:ye,controlsList:_e,coords:Z|Hn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ye,defer:ye,dir:null,dirName:null,disabled:ye,download:js,draggable:We,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ye,formTarget:null,headers:_e,height:Z,hidden:js,high:Z,href:null,hrefLang:null,htmlFor:_e,httpEquiv:_e,id:null,imageSizes:null,imageSrcSet:null,inert:ye,inputMode:null,integrity:null,is:null,isMap:ye,itemId:null,itemProp:_e,itemRef:_e,itemScope:ye,itemType:_e,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ye,low:Z,manifest:null,max:null,maxLength:Z,media:null,method:null,min:null,minLength:Z,multiple:ye,muted:ye,name:null,nonce:null,noModule:ye,noValidate:ye,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ye,optimum:Z,pattern:null,ping:_e,placeholder:null,playsInline:ye,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ye,referrerPolicy:null,rel:_e,required:ye,reversed:ye,rows:Z,rowSpan:Z,sandbox:_e,scope:null,scoped:ye,seamless:ye,selected:ye,shadowRootClonable:ye,shadowRootDelegatesFocus:ye,shadowRootMode:null,shape:null,size:Z,sizes:null,slot:null,span:Z,spellCheck:We,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Z,step:null,style:null,tabIndex:Z,target:null,title:null,translate:null,type:null,typeMustMatch:ye,useMap:null,value:We,width:Z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:_e,axis:null,background:null,bgColor:null,border:Z,borderColor:null,bottomMargin:Z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ye,declare:ye,event:null,face:null,frame:null,frameBorder:null,hSpace:Z,leftMargin:Z,link:null,longDesc:null,lowSrc:null,marginHeight:Z,marginWidth:Z,noResize:ye,noHref:ye,noShade:ye,noWrap:ye,object:null,profile:null,prompt:null,rev:null,rightMargin:Z,rules:null,scheme:null,scrolling:We,standby:null,summary:null,text:null,topMargin:Z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Z,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ye,disableRemotePlayback:ye,prefix:null,property:null,results:Z,security:null,unselectable:null},space:"html",transform:ad}),u1=Vn({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:pt,accentHeight:Z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Z,amplitude:Z,arabicForm:null,ascent:Z,attributeName:null,attributeType:null,azimuth:Z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Z,by:null,calcMode:null,capHeight:Z,className:_e,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Z,diffuseConstant:Z,direction:null,display:null,dur:null,divisor:Z,dominantBaseline:null,download:ye,dx:null,dy:null,edgeMode:null,editable:null,elevation:Z,enableBackground:null,end:null,event:null,exponent:Z,externalResourcesRequired:null,fill:null,fillOpacity:Z,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Hn,g2:Hn,glyphName:Hn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Z,horizOriginX:Z,horizOriginY:Z,id:null,ideographic:Z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Z,k:Z,k1:Z,k2:Z,k3:Z,k4:Z,kernelMatrix:pt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Z,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Z,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Z,overlineThickness:Z,paintOrder:null,panose1:null,path:null,pathLength:Z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:_e,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Z,pointsAtY:Z,pointsAtZ:Z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:pt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:pt,rev:pt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:pt,requiredFeatures:pt,requiredFonts:pt,requiredFormats:pt,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Z,specularExponent:Z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Z,strikethroughThickness:Z,string:null,stroke:null,strokeDashArray:pt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Z,strokeOpacity:Z,strokeWidth:null,style:null,surfaceScale:Z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:pt,tabIndex:Z,tableValues:null,target:null,targetX:Z,targetY:Z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:pt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Z,underlineThickness:Z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Z,values:null,vAlphabetic:Z,vMathematical:Z,vectorEffect:null,vHanging:Z,vIdeographic:Z,version:null,vertAdvY:Z,vertOriginX:Z,vertOriginY:Z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:sd}),ld=Vn({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),ud=Vn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ad}),cd=Vn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),c1={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},f1=/[A-Z]/g,fd=/-[a-z]/g,d1=/^data[-\w.:]+$/i;function h1(e,t){const n=Us(t);let r=t,i=ut;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&d1.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(fd,m1);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!fd.test(o)){let s=o.replace(f1,p1);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=Ws}return new i(r,t)}function p1(e){return"-"+e.toLowerCase()}function m1(e){return e.charAt(1).toUpperCase()}const g1=rd([od,l1,ld,ud,cd],"html"),qs=rd([od,u1,ld,ud,cd],"svg");function y1(e){return e.join(" ").trim()}var Ys={},dd=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,v1=/\n/g,b1=/^\s*/,w1=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,S1=/^:\s*/,x1=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,k1=/^[;\s]*/,E1=/^\s+|\s+$/g,C1=`
|
|
27
|
+
`,hd="/",pd="*",An="",A1="comment",T1="declaration";function I1(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(m){var p=m.match(v1);p&&(n+=p.length);var g=m.lastIndexOf(C1);r=~g?m.length-g:r+m.length}function o(){var m={line:n,column:r};return function(p){return p.position=new s(m),u(),p}}function s(m){this.start=m,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function a(m){var p=new Error(t.source+":"+n+":"+r+": "+m);if(p.reason=m,p.filename=t.source,p.line=n,p.column=r,p.source=e,!t.silent)throw p}function l(m){var p=m.exec(e);if(p){var g=p[0];return i(g),e=e.slice(g.length),p}}function u(){l(b1)}function f(m){var p;for(m=m||[];p=c();)p!==!1&&m.push(p);return m}function c(){var m=o();if(!(hd!=e.charAt(0)||pd!=e.charAt(1))){for(var p=2;An!=e.charAt(p)&&(pd!=e.charAt(p)||hd!=e.charAt(p+1));)++p;if(p+=2,An===e.charAt(p-1))return a("End of comment missing");var g=e.slice(2,p-2);return r+=2,i(g),e=e.slice(p),r+=2,m({type:A1,comment:g})}}function h(){var m=o(),p=l(w1);if(p){if(c(),!l(S1))return a("property missing ':'");var g=l(x1),y=m({type:T1,property:md(p[0].replace(dd,An)),value:g?md(g[0].replace(dd,An)):An});return l(k1),y}}function d(){var m=[];f(m);for(var p;p=h();)p!==!1&&(m.push(p),f(m));return m}return u(),d()}function md(e){return e?e.replace(E1,An):An}var O1=I1,M1=yn&&yn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ys,"__esModule",{value:!0}),Ys.default=N1;const D1=M1(O1);function N1(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,D1.default)(e),i=typeof t=="function";return r.forEach(o=>{if(o.type!=="declaration")return;const{property:s,value:a}=o;i?t(s,a,o):a&&(n=n||{},n[s]=a)}),n}var Fi={};Object.defineProperty(Fi,"__esModule",{value:!0}),Fi.camelCase=void 0;var _1=/^--[a-zA-Z0-9_-]+$/,P1=/-([a-z])/g,L1=/^[^-]+$/,F1=/^-(webkit|moz|ms|o|khtml)-/,R1=/^-(ms)-/,$1=function(e){return!e||L1.test(e)||_1.test(e)},B1=function(e,t){return t.toUpperCase()},gd=function(e,t){return"".concat(t,"-")},z1=function(e,t){return t===void 0&&(t={}),$1(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(R1,gd):e=e.replace(F1,gd),e.replace(P1,B1))};Fi.camelCase=z1;var U1=yn&&yn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},j1=U1(Ys),H1=Fi;function Ks(e,t){var n={};return!e||typeof e!="string"||(0,j1.default)(e,function(r,i){r&&i&&(n[(0,H1.camelCase)(r,t)]=i)}),n}Ks.default=Ks;var V1=Ks;const W1=vn(V1),yd=vd("end"),Gs=vd("start");function vd(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function q1(e){const t=Gs(e),n=yd(e);if(t&&n)return{start:t,end:n}}function Lr(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?bd(e.position):"start"in e||"end"in e?bd(e):"line"in e||"column"in e?Qs(e):""}function Qs(e){return wd(e&&e.line)+":"+wd(e&&e.column)}function bd(e){return Qs(e&&e.start)+"-"+Qs(e&&e.end)}function wd(e){return e&&typeof e=="number"?e:1}class et extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=Lr(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}et.prototype.file="",et.prototype.name="",et.prototype.reason="",et.prototype.message="",et.prototype.stack="",et.prototype.column=void 0,et.prototype.line=void 0,et.prototype.ancestors=void 0,et.prototype.cause=void 0,et.prototype.fatal=void 0,et.prototype.place=void 0,et.prototype.ruleId=void 0,et.prototype.source=void 0;const Zs={}.hasOwnProperty,Y1=new Map,K1=/[A-Z]/g,G1=new Set(["table","tbody","thead","tfoot","tr"]),Q1=new Set(["td","th"]),Sd="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Z1(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=oS(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=iS(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?qs:g1,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=xd(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function xd(e,t,n){if(t.type==="element")return J1(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return X1(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return tS(e,t,n);if(t.type==="mdxjsEsm")return eS(e,t);if(t.type==="root")return nS(e,t,n);if(t.type==="text")return rS(e,t)}function J1(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=qs,e.schema=i),e.ancestors.push(t);const o=Ed(e,t.tagName,!1),s=sS(e,t);let a=Xs(e,t);return G1.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!s1(l):!0})),kd(e,s,o,t),Js(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function X1(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Fr(e,t.position)}function eS(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Fr(e,t.position)}function tS(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=qs,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:Ed(e,t.name,!0),s=aS(e,t),a=Xs(e,t);return kd(e,s,o,t),Js(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function nS(e,t,n){const r={};return Js(r,Xs(e,t)),e.create(t,e.Fragment,r,n)}function rS(e,t){return t.value}function kd(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Js(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function iS(e,t,n){return r;function r(i,o,s,a){const u=Array.isArray(s.children)?n:t;return a?u(o,s,a):u(o,s)}}function oS(e,t){return n;function n(r,i,o,s){const a=Array.isArray(o.children),l=Gs(r);return t(i,o,s,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function sS(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Zs.call(t.properties,i)){const o=lS(e,i,t.properties[i]);if(o){const[s,a]=o;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&Q1.has(t.tagName)?r=a:n[s]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function aS(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Fr(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else Fr(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Xs(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Y1;for(;++r<t.children.length;){const o=t.children[r];let s;if(e.passKeys){const l=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(l){const u=i.get(l)||0;s=l+"-"+u,i.set(l,u+1)}}const a=xd(e,o,s);a!==void 0&&n.push(a)}return n}function lS(e,t,n){const r=h1(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?t1(n):y1(n)),r.property==="style"){let i=typeof n=="object"?n:uS(e,String(n));return e.stylePropertyNameCase==="css"&&(i=cS(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?c1[r.property]||r.property:r.attribute,n]}}function uS(e,t){try{return W1(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new et("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Sd+"#cannot-parse-style-attribute",i}}function Ed(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,s;for(;++o<i.length;){const a=td(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=s}else r=td(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Zs.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Fr(e)}function Fr(e,t){const n=new et("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Sd+"#cannot-handle-mdx-estrees-without-createevaluater",n}function cS(e){const t={};let n;for(n in e)Zs.call(e,n)&&(t[fS(n)]=e[n]);return t}function fS(e){let t=e.replace(K1,dS);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function dS(e){return"-"+e.toLowerCase()}const ea={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},hS={};function ta(e,t){const n=hS,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Cd(e,r,i)}function Cd(e,t,n){if(pS(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Ad(e.children,t,n)}return Array.isArray(e)?Ad(e,t,n):""}function Ad(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Cd(e[i],t,n);return r.join("")}function pS(e){return!!(e&&typeof e=="object")}const Td=document.createElement("i");function na(e){const t="&"+e+";";Td.innerHTML=t;const n=Td.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function mt(e,t,n,r){const i=e.length;let o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function St(e,t){return e.length>0?(mt(e,e.length,0,t),e):t}const Id={}.hasOwnProperty;function Od(e){const t={};let n=-1;for(;++n<e.length;)mS(t,e[n]);return t}function mS(e,t){let n;for(n in t){const i=(Id.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){Id.call(i,s)||(i[s]=[]);const a=o[s];gS(i[s],Array.isArray(a)?a:a?[a]:[])}}}function gS(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);mt(e,0,0,r)}function Md(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Mt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ot=sn(/[A-Za-z]/),tt=sn(/[\dA-Za-z]/),yS=sn(/[#-'*+\--9=?A-Z^-~]/);function Ri(e){return e!==null&&(e<32||e===127)}const ra=sn(/\d/),vS=sn(/[\dA-Fa-f]/),bS=sn(/[!-/:-@[-`{-~]/);function ce(e){return e!==null&&e<-2}function De(e){return e!==null&&(e<0||e===32)}function ve(e){return e===-2||e===-1||e===32}const $i=sn(new RegExp("\\p{P}|\\p{S}","u")),Tn=sn(/\s/);function sn(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Wn(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(o===37&&tt(e.charCodeAt(n+1))&&tt(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function ke(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(l){return ve(l)?(e.enter(n),a(l)):t(l)}function a(l){return ve(l)&&o++<i?(e.consume(l),a):(e.exit(n),t(l))}}const wS={tokenize:SS};function SS(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),ke(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return ce(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),s)}}const xS={tokenize:kS},Dd={tokenize:ES};function kS(e){const t=this,n=[];let r=0,i,o,s;return a;function a(w){if(r<n.length){const E=n[r];return t.containerState=E[1],e.attempt(E[0].continuation,l,u)(w)}return u(w)}function l(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();const E=t.events.length;let S=E,C;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){C=t.events[S][1].end;break}y(r);let I=E;for(;I<t.events.length;)t.events[I][1].end={...C},I++;return mt(t.events,S+1,0,t.events.slice(E)),t.events.length=I,u(w)}return a(w)}function u(w){if(r===n.length){if(!i)return h(w);if(i.currentConstruct&&i.currentConstruct.concrete)return m(w);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Dd,f,c)(w)}function f(w){return i&&v(),y(r),h(w)}function c(w){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,m(w)}function h(w){return t.containerState={},e.attempt(Dd,d,m)(w)}function d(w){return r++,n.push([t.currentConstruct,t.containerState]),h(w)}function m(w){if(w===null){i&&v(),y(0),e.consume(w);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),p(w)}function p(w){if(w===null){g(e.exit("chunkFlow"),!0),y(0),e.consume(w);return}return ce(w)?(e.consume(w),g(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(w),p)}function g(w,E){const S=t.sliceStream(w);if(E&&S.push(null),w.previous=o,o&&(o.next=w),o=w,i.defineSkip(w.start),i.write(S),t.parser.lazy[w.start.line]){let C=i.events.length;for(;C--;)if(i.events[C][1].start.offset<s&&(!i.events[C][1].end||i.events[C][1].end.offset>s))return;const I=t.events.length;let M=I,P,T;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){if(P){T=t.events[M][1].end;break}P=!0}for(y(r),C=I;C<t.events.length;)t.events[C][1].end={...T},C++;mt(t.events,M+1,0,t.events.slice(I)),t.events.length=C}}function y(w){let E=n.length;for(;E-- >w;){const S=n[E];t.containerState=S[1],S[0].exit.call(t,e)}n.length=w}function v(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function ES(e,t,n){return ke(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function qn(e){if(e===null||De(e)||Tn(e))return 1;if($i(e))return 2}function Bi(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const ia={name:"attention",resolveAll:CS,tokenize:AS};function CS(e,t){let n=-1,r,i,o,s,a,l,u,f;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const c={...e[r][1].end},h={...e[n][1].start};Nd(c,-l),Nd(h,l),s={type:l>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},o={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[r][1].end={...s.start},e[n][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=St(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=St(u,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),u=St(u,Bi(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=St(u,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,u=St(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,mt(e,r-1,n-r+3,u),n=r+u.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function AS(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=qn(r);let o;return s;function s(l){return o=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===o)return e.consume(l),a;const u=e.exit("attentionSequence"),f=qn(l),c=!f||f===2&&i||n.includes(l),h=!i||i===2&&f||n.includes(r);return u._open=!!(o===42?c:c&&(i||!h)),u._close=!!(o===42?h:h&&(f||!c)),t(l)}}function Nd(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const TS={name:"autolink",tokenize:IS};function IS(e,t,n){let r=0;return i;function i(d){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(d){return ot(d)?(e.consume(d),s):d===64?n(d):u(d)}function s(d){return d===43||d===45||d===46||tt(d)?(r=1,a(d)):u(d)}function a(d){return d===58?(e.consume(d),r=0,l):(d===43||d===45||d===46||tt(d))&&r++<32?(e.consume(d),a):(r=0,u(d))}function l(d){return d===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):d===null||d===32||d===60||Ri(d)?n(d):(e.consume(d),l)}function u(d){return d===64?(e.consume(d),f):yS(d)?(e.consume(d),u):n(d)}function f(d){return tt(d)?c(d):n(d)}function c(d){return d===46?(e.consume(d),r=0,f):d===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):h(d)}function h(d){if((d===45||tt(d))&&r++<63){const m=d===45?h:c;return e.consume(d),m}return n(d)}}const Rr={partial:!0,tokenize:OS};function OS(e,t,n){return r;function r(o){return ve(o)?ke(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||ce(o)?t(o):n(o)}}const _d={continuation:{tokenize:DS},exit:NS,name:"blockQuote",tokenize:MS};function MS(e,t,n){const r=this;return i;function i(s){if(s===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return ve(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function DS(e,t,n){const r=this;return i;function i(s){return ve(s)?ke(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(_d,t,n)(s)}}function NS(e){e.exit("blockQuote")}const Pd={name:"characterEscape",tokenize:_S};function _S(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return bS(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const Ld={name:"characterReference",tokenize:PS};function PS(e,t,n){const r=this;let i=0,o,s;return a;function a(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),l}function l(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),o=31,s=tt,f(c))}function u(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=vS,f):(e.enter("characterReferenceValue"),o=7,s=ra,f(c))}function f(c){if(c===59&&i){const h=e.exit("characterReferenceValue");return s===tt&&!na(r.sliceSerialize(h))?n(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(c)&&i++<o?(e.consume(c),f):n(c)}}const Fd={partial:!0,tokenize:FS},Rd={concrete:!0,name:"codeFenced",tokenize:LS};function LS(e,t,n){const r=this,i={partial:!0,tokenize:S};let o=0,s=0,a;return l;function l(C){return u(C)}function u(C){const I=r.events[r.events.length-1];return o=I&&I[1].type==="linePrefix"?I[2].sliceSerialize(I[1],!0).length:0,a=C,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(C)}function f(C){return C===a?(s++,e.consume(C),f):s<3?n(C):(e.exit("codeFencedFenceSequence"),ve(C)?ke(e,c,"whitespace")(C):c(C))}function c(C){return C===null||ce(C)?(e.exit("codeFencedFence"),r.interrupt?t(C):e.check(Fd,p,E)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(C))}function h(C){return C===null||ce(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(C)):ve(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ke(e,d,"whitespace")(C)):C===96&&C===a?n(C):(e.consume(C),h)}function d(C){return C===null||ce(C)?c(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(C))}function m(C){return C===null||ce(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(C)):C===96&&C===a?n(C):(e.consume(C),m)}function p(C){return e.attempt(i,E,g)(C)}function g(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),y}function y(C){return o>0&&ve(C)?ke(e,v,"linePrefix",o+1)(C):v(C)}function v(C){return C===null||ce(C)?e.check(Fd,p,E)(C):(e.enter("codeFlowValue"),w(C))}function w(C){return C===null||ce(C)?(e.exit("codeFlowValue"),v(C)):(e.consume(C),w)}function E(C){return e.exit("codeFenced"),t(C)}function S(C,I,M){let P=0;return T;function T(R){return C.enter("lineEnding"),C.consume(R),C.exit("lineEnding"),O}function O(R){return C.enter("codeFencedFence"),ve(R)?ke(C,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):U(R)}function U(R){return R===a?(C.enter("codeFencedFenceSequence"),F(R)):M(R)}function F(R){return R===a?(P++,C.consume(R),F):P>=s?(C.exit("codeFencedFenceSequence"),ve(R)?ke(C,L,"whitespace")(R):L(R)):M(R)}function L(R){return R===null||ce(R)?(C.exit("codeFencedFence"),I(R)):M(R)}}}function FS(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const oa={name:"codeIndented",tokenize:$S},RS={partial:!0,tokenize:BS};function $S(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),ke(e,o,"linePrefix",5)(u)}function o(u){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?s(u):n(u)}function s(u){return u===null?l(u):ce(u)?e.attempt(RS,s,l)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||ce(u)?(e.exit("codeFlowValue"),s(u)):(e.consume(u),a)}function l(u){return e.exit("codeIndented"),t(u)}}function BS(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):ce(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):ke(e,o,"linePrefix",5)(s)}function o(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):ce(s)?i(s):n(s)}}const zS={name:"codeText",previous:jS,resolve:US,tokenize:HS};function US(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function jS(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function HS(e,t,n){let r=0,i,o;return s;function s(c){return e.enter("codeText"),e.enter("codeTextSequence"),a(c)}function a(c){return c===96?(e.consume(c),r++,a):(e.exit("codeTextSequence"),l(c))}function l(c){return c===null?n(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),l):c===96?(o=e.enter("codeTextSequence"),i=0,f(c)):ce(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l):(e.enter("codeTextData"),u(c))}function u(c){return c===null||c===32||c===96||ce(c)?(e.exit("codeTextData"),l(c)):(e.consume(c),u)}function f(c){return c===96?(e.consume(c),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(c)):(o.type="codeTextData",u(c))}}class VS{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&$r(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),$r(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),$r(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);$r(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);$r(this.left,n.reverse())}}}function $r(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function $d(e){const t={};let n=-1,r,i,o,s,a,l,u;const f=new VS(e);for(;++n<f.length;){for(;n in t;)n=t[n];if(r=f.get(n),n&&r[1].type==="chunkFlow"&&f.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,WS(f,n)),n=t[n],u=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(s=f.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},a=f.slice(i,n),a.unshift(r),f.splice(i,n-i+1,a))}}return mt(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!u}function WS(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const a=s.events,l=[],u={};let f,c,h=-1,d=n,m=0,p=0;const g=[p];for(;d;){for(;e.get(++i)[1]!==d;);o.push(i),d._tokenizer||(f=r.sliceStream(d),d.next||f.push(null),c&&s.defineSkip(d.start),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(f),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),c=d,d=d.next}for(d=n;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(p=h+1,g.push(p),d._tokenizer=void 0,d.previous=void 0,d=d.next);for(s.events=[],d?(d._tokenizer=void 0,d.previous=void 0):g.pop(),h=g.length;h--;){const y=a.slice(g[h],g[h+1]),v=o.pop();l.push([v,v+y.length-1]),e.splice(v,2,y)}for(l.reverse(),h=-1;++h<l.length;)u[m+l[h][0]]=m+l[h][1],m+=l[h][1]-l[h][0]-1;return u}const qS={resolve:KS,tokenize:GS},YS={partial:!0,tokenize:QS};function KS(e){return $d(e),e}function GS(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):ce(a)?e.check(YS,s,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function QS(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),ke(e,o,"linePrefix")}function o(s){if(s===null||ce(s))return n(s);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function Bd(e,t,n,r,i,o,s,a,l){const u=l||Number.POSITIVE_INFINITY;let f=0;return c;function c(y){return y===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(y),e.exit(o),h):y===null||y===32||y===41||Ri(y)?n(y):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),p(y))}function h(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),d(y))}function d(y){return y===62?(e.exit("chunkString"),e.exit(a),h(y)):y===null||y===60||ce(y)?n(y):(e.consume(y),y===92?m:d)}function m(y){return y===60||y===62||y===92?(e.consume(y),d):d(y)}function p(y){return!f&&(y===null||y===41||De(y))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(y)):f<u&&y===40?(e.consume(y),f++,p):y===41?(e.consume(y),f--,p):y===null||y===32||y===40||Ri(y)?n(y):(e.consume(y),y===92?g:p)}function g(y){return y===40||y===41||y===92?(e.consume(y),p):p(y)}}function zd(e,t,n,r,i,o){const s=this;let a=0,l;return u;function u(d){return e.enter(r),e.enter(i),e.consume(d),e.exit(i),e.enter(o),f}function f(d){return a>999||d===null||d===91||d===93&&!l||d===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(d):d===93?(e.exit(o),e.enter(i),e.consume(d),e.exit(i),e.exit(r),t):ce(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),c(d))}function c(d){return d===null||d===91||d===93||ce(d)||a++>999?(e.exit("chunkString"),f(d)):(e.consume(d),l||(l=!ve(d)),d===92?h:c)}function h(d){return d===91||d===92||d===93?(e.consume(d),a++,c):c(d)}}function Ud(e,t,n,r,i,o){let s;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),s=h===40?41:h,l):n(h)}function l(h){return h===s?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(o),u(h))}function u(h){return h===s?(e.exit(o),l(s)):h===null?n(h):ce(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),ke(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===s||h===null||ce(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?c:f)}function c(h){return h===s||h===92?(e.consume(h),f):f(h)}}function Br(e,t){let n;return r;function r(i){return ce(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ve(i)?ke(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const ZS={name:"definition",tokenize:XS},JS={partial:!0,tokenize:ex};function XS(e,t,n){const r=this;let i;return o;function o(d){return e.enter("definition"),s(d)}function s(d){return zd.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function a(d){return i=Mt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),d===58?(e.enter("definitionMarker"),e.consume(d),e.exit("definitionMarker"),l):n(d)}function l(d){return De(d)?Br(e,u)(d):u(d)}function u(d){return Bd(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function f(d){return e.attempt(JS,c,c)(d)}function c(d){return ve(d)?ke(e,h,"whitespace")(d):h(d)}function h(d){return d===null||ce(d)?(e.exit("definition"),r.parser.defined.push(i),t(d)):n(d)}}function ex(e,t,n){return r;function r(a){return De(a)?Br(e,i)(a):n(a)}function i(a){return Ud(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return ve(a)?ke(e,s,"whitespace")(a):s(a)}function s(a){return a===null||ce(a)?t(a):n(a)}}const tx={name:"hardBreakEscape",tokenize:nx};function nx(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return ce(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const rx={name:"headingAtx",resolve:ix,tokenize:ox};function ix(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},mt(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function ox(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),s(f)}function s(f){return f===35&&r++<6?(e.consume(f),s):f===null||De(f)?(e.exit("atxHeadingSequence"),a(f)):n(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),l(f)):f===null||ce(f)?(e.exit("atxHeading"),t(f)):ve(f)?ke(e,a,"whitespace")(f):(e.enter("atxHeadingText"),u(f))}function l(f){return f===35?(e.consume(f),l):(e.exit("atxHeadingSequence"),a(f))}function u(f){return f===null||f===35||De(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),u)}}const sx=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],jd=["pre","script","style","textarea"],ax={concrete:!0,name:"htmlFlow",resolveTo:cx,tokenize:fx},lx={partial:!0,tokenize:hx},ux={partial:!0,tokenize:dx};function cx(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function fx(e,t,n){const r=this;let i,o,s,a,l;return u;function u(x){return f(x)}function f(x){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(x),c}function c(x){return x===33?(e.consume(x),h):x===47?(e.consume(x),o=!0,p):x===63?(e.consume(x),i=3,r.interrupt?t:b):ot(x)?(e.consume(x),s=String.fromCharCode(x),g):n(x)}function h(x){return x===45?(e.consume(x),i=2,d):x===91?(e.consume(x),i=5,a=0,m):ot(x)?(e.consume(x),i=4,r.interrupt?t:b):n(x)}function d(x){return x===45?(e.consume(x),r.interrupt?t:b):n(x)}function m(x){const V="CDATA[";return x===V.charCodeAt(a++)?(e.consume(x),a===V.length?r.interrupt?t:U:m):n(x)}function p(x){return ot(x)?(e.consume(x),s=String.fromCharCode(x),g):n(x)}function g(x){if(x===null||x===47||x===62||De(x)){const V=x===47,Y=s.toLowerCase();return!V&&!o&&jd.includes(Y)?(i=1,r.interrupt?t(x):U(x)):sx.includes(s.toLowerCase())?(i=6,V?(e.consume(x),y):r.interrupt?t(x):U(x)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(x):o?v(x):w(x))}return x===45||tt(x)?(e.consume(x),s+=String.fromCharCode(x),g):n(x)}function y(x){return x===62?(e.consume(x),r.interrupt?t:U):n(x)}function v(x){return ve(x)?(e.consume(x),v):T(x)}function w(x){return x===47?(e.consume(x),T):x===58||x===95||ot(x)?(e.consume(x),E):ve(x)?(e.consume(x),w):T(x)}function E(x){return x===45||x===46||x===58||x===95||tt(x)?(e.consume(x),E):S(x)}function S(x){return x===61?(e.consume(x),C):ve(x)?(e.consume(x),S):w(x)}function C(x){return x===null||x===60||x===61||x===62||x===96?n(x):x===34||x===39?(e.consume(x),l=x,I):ve(x)?(e.consume(x),C):M(x)}function I(x){return x===l?(e.consume(x),l=null,P):x===null||ce(x)?n(x):(e.consume(x),I)}function M(x){return x===null||x===34||x===39||x===47||x===60||x===61||x===62||x===96||De(x)?S(x):(e.consume(x),M)}function P(x){return x===47||x===62||ve(x)?w(x):n(x)}function T(x){return x===62?(e.consume(x),O):n(x)}function O(x){return x===null||ce(x)?U(x):ve(x)?(e.consume(x),O):n(x)}function U(x){return x===45&&i===2?(e.consume(x),N):x===60&&i===1?(e.consume(x),j):x===62&&i===4?(e.consume(x),_):x===63&&i===3?(e.consume(x),b):x===93&&i===5?(e.consume(x),W):ce(x)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(lx,H,F)(x)):x===null||ce(x)?(e.exit("htmlFlowData"),F(x)):(e.consume(x),U)}function F(x){return e.check(ux,L,H)(x)}function L(x){return e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),R}function R(x){return x===null||ce(x)?F(x):(e.enter("htmlFlowData"),U(x))}function N(x){return x===45?(e.consume(x),b):U(x)}function j(x){return x===47?(e.consume(x),s="",B):U(x)}function B(x){if(x===62){const V=s.toLowerCase();return jd.includes(V)?(e.consume(x),_):U(x)}return ot(x)&&s.length<8?(e.consume(x),s+=String.fromCharCode(x),B):U(x)}function W(x){return x===93?(e.consume(x),b):U(x)}function b(x){return x===62?(e.consume(x),_):x===45&&i===2?(e.consume(x),b):U(x)}function _(x){return x===null||ce(x)?(e.exit("htmlFlowData"),H(x)):(e.consume(x),_)}function H(x){return e.exit("htmlFlow"),t(x)}}function dx(e,t,n){const r=this;return i;function i(s){return ce(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function hx(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Rr,t,n)}}const px={name:"htmlText",tokenize:mx};function mx(e,t,n){const r=this;let i,o,s;return a;function a(b){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(b),l}function l(b){return b===33?(e.consume(b),u):b===47?(e.consume(b),S):b===63?(e.consume(b),w):ot(b)?(e.consume(b),M):n(b)}function u(b){return b===45?(e.consume(b),f):b===91?(e.consume(b),o=0,m):ot(b)?(e.consume(b),v):n(b)}function f(b){return b===45?(e.consume(b),d):n(b)}function c(b){return b===null?n(b):b===45?(e.consume(b),h):ce(b)?(s=c,j(b)):(e.consume(b),c)}function h(b){return b===45?(e.consume(b),d):c(b)}function d(b){return b===62?N(b):b===45?h(b):c(b)}function m(b){const _="CDATA[";return b===_.charCodeAt(o++)?(e.consume(b),o===_.length?p:m):n(b)}function p(b){return b===null?n(b):b===93?(e.consume(b),g):ce(b)?(s=p,j(b)):(e.consume(b),p)}function g(b){return b===93?(e.consume(b),y):p(b)}function y(b){return b===62?N(b):b===93?(e.consume(b),y):p(b)}function v(b){return b===null||b===62?N(b):ce(b)?(s=v,j(b)):(e.consume(b),v)}function w(b){return b===null?n(b):b===63?(e.consume(b),E):ce(b)?(s=w,j(b)):(e.consume(b),w)}function E(b){return b===62?N(b):w(b)}function S(b){return ot(b)?(e.consume(b),C):n(b)}function C(b){return b===45||tt(b)?(e.consume(b),C):I(b)}function I(b){return ce(b)?(s=I,j(b)):ve(b)?(e.consume(b),I):N(b)}function M(b){return b===45||tt(b)?(e.consume(b),M):b===47||b===62||De(b)?P(b):n(b)}function P(b){return b===47?(e.consume(b),N):b===58||b===95||ot(b)?(e.consume(b),T):ce(b)?(s=P,j(b)):ve(b)?(e.consume(b),P):N(b)}function T(b){return b===45||b===46||b===58||b===95||tt(b)?(e.consume(b),T):O(b)}function O(b){return b===61?(e.consume(b),U):ce(b)?(s=O,j(b)):ve(b)?(e.consume(b),O):P(b)}function U(b){return b===null||b===60||b===61||b===62||b===96?n(b):b===34||b===39?(e.consume(b),i=b,F):ce(b)?(s=U,j(b)):ve(b)?(e.consume(b),U):(e.consume(b),L)}function F(b){return b===i?(e.consume(b),i=void 0,R):b===null?n(b):ce(b)?(s=F,j(b)):(e.consume(b),F)}function L(b){return b===null||b===34||b===39||b===60||b===61||b===96?n(b):b===47||b===62||De(b)?P(b):(e.consume(b),L)}function R(b){return b===47||b===62||De(b)?P(b):n(b)}function N(b){return b===62?(e.consume(b),e.exit("htmlTextData"),e.exit("htmlText"),t):n(b)}function j(b){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),B}function B(b){return ve(b)?ke(e,W,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):W(b)}function W(b){return e.enter("htmlTextData"),s(b)}}const sa={name:"labelEnd",resolveAll:bx,resolveTo:wx,tokenize:Sx},gx={tokenize:xx},yx={tokenize:kx},vx={tokenize:Ex};function bx(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&mt(e,0,e.length,n),e}function wx(e,t){let n=e.length,r=0,i,o,s,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const l={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[o][1].start},end:{...e[s][1].end}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",l,t],["enter",u,t]],a=St(a,e.slice(o+1,o+r+3)),a=St(a,[["enter",f,t]]),a=St(a,Bi(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),a=St(a,[["exit",f,t],e[s-2],e[s-1],["exit",u,t]]),a=St(a,e.slice(s+1)),a=St(a,[["exit",l,t]]),mt(e,o,e.length,a),e}function Sx(e,t,n){const r=this;let i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(h){return o?o._inactive?c(h):(s=r.parser.defined.includes(Mt(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(gx,f,s?f:c)(h):h===91?e.attempt(yx,f,s?u:c)(h):s?f(h):c(h)}function u(h){return e.attempt(vx,f,c)(h)}function f(h){return t(h)}function c(h){return o._balanced=!0,n(h)}}function xx(e,t,n){return r;function r(c){return e.enter("resource"),e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),i}function i(c){return De(c)?Br(e,o)(c):o(c)}function o(c){return c===41?f(c):Bd(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function s(c){return De(c)?Br(e,l)(c):f(c)}function a(c){return n(c)}function l(c){return c===34||c===39||c===40?Ud(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):f(c)}function u(c){return De(c)?Br(e,f)(c):f(c)}function f(c){return c===41?(e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),e.exit("resource"),t):n(c)}}function kx(e,t,n){const r=this;return i;function i(a){return zd.call(r,e,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(Mt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function Ex(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const Cx={name:"labelStartImage",resolveAll:sa.resolveAll,tokenize:Ax};function Ax(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const Tx={name:"labelStartLink",resolveAll:sa.resolveAll,tokenize:Ix};function Ix(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const aa={name:"lineEnding",tokenize:Ox};function Ox(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ke(e,t,"linePrefix")}}const zi={name:"thematicBreak",tokenize:Mx};function Mx(e,t,n){let r=0,i;return o;function o(u){return e.enter("thematicBreak"),s(u)}function s(u){return i=u,a(u)}function a(u){return u===i?(e.enter("thematicBreakSequence"),l(u)):r>=3&&(u===null||ce(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===i?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),ve(u)?ke(e,a,"whitespace")(u):a(u))}}const ct={continuation:{tokenize:Px},exit:Fx,name:"list",tokenize:_x},Dx={partial:!0,tokenize:Rx},Nx={partial:!0,tokenize:Lx};function _x(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(d){const m=r.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||d===r.containerState.marker:ra(d)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),d===42||d===45?e.check(zi,n,u)(d):u(d);if(!r.interrupt||d===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(d)}return n(d)}function l(d){return ra(d)&&++s<10?(e.consume(d),l):(!r.interrupt||s<2)&&(r.containerState.marker?d===r.containerState.marker:d===41||d===46)?(e.exit("listItemValue"),u(d)):n(d)}function u(d){return e.enter("listItemMarker"),e.consume(d),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||d,e.check(Rr,r.interrupt?n:f,e.attempt(Dx,h,c))}function f(d){return r.containerState.initialBlankLine=!0,o++,h(d)}function c(d){return ve(d)?(e.enter("listItemPrefixWhitespace"),e.consume(d),e.exit("listItemPrefixWhitespace"),h):n(d)}function h(d){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(d)}}function Px(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Rr,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ke(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!ve(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Nx,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,ke(e,e.attempt(ct,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Lx(e,t,n){const r=this;return ke(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function Fx(e){e.exit(this.containerState.type)}function Rx(e,t,n){const r=this;return ke(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!ve(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Hd={name:"setextUnderline",resolveTo:$x,tokenize:Bx};function $x(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function Bx(e,t,n){const r=this;let i;return o;function o(u){let f=r.events.length,c;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){c=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=u,s(u)):n(u)}function s(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),ve(u)?ke(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||ce(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const zx={tokenize:Ux};function Ux(e){const t=this,n=e.attempt(Rr,r,e.attempt(this.parser.constructs.flowInitial,i,ke(e,e.attempt(this.parser.constructs.flow,i,e.attempt(qS,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const jx={resolveAll:Wd()},Hx=Vd("string"),Vx=Vd("text");function Vd(e){return{resolveAll:Wd(e==="text"?Wx:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,a);return s;function s(f){return u(f)?o(f):a(f)}function a(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),l}function l(f){return u(f)?(n.exit("data"),o(f)):(n.consume(f),l)}function u(f){if(f===null)return!0;const c=i[f];let h=-1;if(c)for(;++h<c.length;){const d=c[h];if(!d.previous||d.previous.call(r,r.previous))return!0}return!1}}}function Wd(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function Wx(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,s=-1,a=0,l;for(;o--;){const u=i[o];if(typeof u=="string"){for(s=u.length;u.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(u===-2)l=!0,a++;else if(u!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const u={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:r.start._bufferIndex+s,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const qx=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:ZS},disable:{null:[]},document:{42:ct,43:ct,45:ct,48:ct,49:ct,50:ct,51:ct,52:ct,53:ct,54:ct,55:ct,56:ct,57:ct,62:_d},flow:{35:rx,42:zi,45:[Hd,zi],60:ax,61:Hd,95:zi,96:Rd,126:Rd},flowInitial:{[-2]:oa,[-1]:oa,32:oa},insideSpan:{null:[ia,jx]},string:{38:Ld,92:Pd},text:{[-5]:aa,[-4]:aa,[-3]:aa,33:Cx,38:Ld,42:ia,60:[TS,px],91:Tx,92:[tx,Pd],93:sa,95:ia,96:zS}},Symbol.toStringTag,{value:"Module"}));function Yx(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let s=[],a=[];const l={attempt:I(S),check:I(C),consume:v,enter:w,exit:E,interrupt:I(C,{interrupt:!0})},u={code:null,containerState:{},defineSkip:p,events:[],now:m,parser:e,previous:null,sliceSerialize:h,sliceStream:d,write:c};let f=t.tokenize.call(u,l);return t.resolveAll&&o.push(t),u;function c(O){return s=St(s,O),g(),s[s.length-1]!==null?[]:(M(t,0),u.events=Bi(o,u.events,u),u.events)}function h(O,U){return Gx(d(O),U)}function d(O){return Kx(s,O)}function m(){const{_bufferIndex:O,_index:U,line:F,column:L,offset:R}=r;return{_bufferIndex:O,_index:U,line:F,column:L,offset:R}}function p(O){i[O.line]=O.column,T()}function g(){let O;for(;r._index<s.length;){const U=s[r._index];if(typeof U=="string")for(O=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===O&&r._bufferIndex<U.length;)y(U.charCodeAt(r._bufferIndex));else y(U)}}function y(O){f=f(O)}function v(O){ce(O)?(r.line++,r.column=1,r.offset+=O===-3?2:1,T()):O!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=O}function w(O,U){const F=U||{};return F.type=O,F.start=m(),u.events.push(["enter",F,u]),a.push(F),F}function E(O){const U=a.pop();return U.end=m(),u.events.push(["exit",U,u]),U}function S(O,U){M(O,U.from)}function C(O,U){U.restore()}function I(O,U){return F;function F(L,R,N){let j,B,W,b;return Array.isArray(L)?H(L):"tokenize"in L?H([L]):_(L);function _(q){return Q;function Q(X){const se=X!==null&&q[X],G=X!==null&&q.null,te=[...Array.isArray(se)?se:se?[se]:[],...Array.isArray(G)?G:G?[G]:[]];return H(te)(X)}}function H(q){return j=q,B=0,q.length===0?N:x(q[B])}function x(q){return Q;function Q(X){return b=P(),W=q,q.partial||(u.currentConstruct=q),q.name&&u.parser.constructs.disable.null.includes(q.name)?Y():q.tokenize.call(U?Object.assign(Object.create(u),U):u,l,V,Y)(X)}}function V(q){return O(W,b),R}function Y(q){return b.restore(),++B<j.length?x(j[B]):N}}}function M(O,U){O.resolveAll&&!o.includes(O)&&o.push(O),O.resolve&&mt(u.events,U,u.events.length-U,O.resolve(u.events.slice(U),u)),O.resolveTo&&(u.events=O.resolveTo(u.events,u))}function P(){const O=m(),U=u.previous,F=u.currentConstruct,L=u.events.length,R=Array.from(a);return{from:L,restore:N};function N(){r=O,u.previous=U,u.currentConstruct=F,u.events.length=L,a=R,T()}}function T(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Kx(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function Gx(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
|
|
28
|
+
`;break}case-3:{s=`\r
|
|
29
|
+
`;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}function Qx(e){const r={constructs:Od([qx,...(e||{}).extensions||[]]),content:i(wS),defined:[],document:i(xS),flow:i(zx),lazy:{},string:i(Hx),text:i(Vx)};return r;function i(o){return s;function s(a){return Yx(r,o,a)}}}function Zx(e){for(;!$d(e););return e}const qd=/[\0\t\n\r]/g;function Jx(){let e=1,t="",n=!0,r;return i;function i(o,s,a){const l=[];let u,f,c,h,d;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),c=0,t="",n&&(o.charCodeAt(0)===65279&&c++,n=void 0);c<o.length;){if(qd.lastIndex=c,u=qd.exec(o),h=u&&u.index!==void 0?u.index:o.length,d=o.charCodeAt(h),!u){t=o.slice(c);break}if(d===10&&c===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),c<h&&(l.push(o.slice(c,h)),e+=h-c),d){case 0:{l.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,l.push(-2);e++<f;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}c=h+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const Xx=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ek(e){return e.replace(Xx,tk)}function tk(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return Md(n.slice(o?2:1),o?16:10)}return na(n)||e}const Yd={}.hasOwnProperty;function nk(e,t,n){return typeof t!="string"&&(n=t,t=void 0),rk(n)(Zx(Qx(n).document().write(Jx()(e,t,!0))))}function rk(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(fe),autolinkProtocol:P,autolinkEmail:P,atxHeading:o(Oe),blockQuote:o(G),characterEscape:P,characterReference:P,codeFenced:o(te),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(te,s),codeText:o($,s),codeTextData:P,data:P,codeFlowValue:P,definition:o(ne),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(ge),hardBreakEscape:o(J),hardBreakTrailing:o(J),htmlFlow:o(ue,s),htmlFlowData:P,htmlText:o(ue,s),htmlTextData:P,image:o(de),label:s,link:o(fe),listItem:o(Fe),listItemValue:h,listOrdered:o(Ae,c),listUnordered:o(Ae),paragraph:o(Me),reference:x,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(Oe),strong:o(je),thematicBreak:o(ae)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:se,autolinkProtocol:X,blockQuote:l(),characterEscapeValue:T,characterReferenceMarkerHexadecimal:Y,characterReferenceMarkerNumeric:Y,characterReferenceValue:q,characterReference:Q,codeFenced:l(g),codeFencedFence:p,codeFencedFenceInfo:d,codeFencedFenceMeta:m,codeFlowValue:T,codeIndented:l(y),codeText:l(R),codeTextData:T,data:T,definition:l(),definitionDestinationString:E,definitionLabelString:v,definitionTitleString:w,emphasis:l(),hardBreakEscape:l(U),hardBreakTrailing:l(U),htmlFlow:l(F),htmlFlowData:T,htmlText:l(L),htmlTextData:T,image:l(j),label:W,labelText:B,lineEnding:O,link:l(N),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:V,resourceDestinationString:b,resourceTitleString:_,resource:H,setextHeading:l(M),setextHeadingLineSequence:I,setextHeadingText:C,strong:l(),thematicBreak:l()}};Kd(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(z){let K={type:"root",children:[]};const oe={stack:[K],tokenStack:[],config:t,enter:a,exit:u,buffer:s,resume:f,data:n},le=[];let he=-1;for(;++he<z.length;)if(z[he][1].type==="listOrdered"||z[he][1].type==="listUnordered")if(z[he][0]==="enter")le.push(he);else{const He=le.pop();he=i(z,He,he)}for(he=-1;++he<z.length;){const He=t[z[he][0]];Yd.call(He,z[he][1].type)&&He[z[he][1].type].call(Object.assign({sliceSerialize:z[he][2].sliceSerialize},oe),z[he][1])}if(oe.tokenStack.length>0){const He=oe.tokenStack[oe.tokenStack.length-1];(He[1]||Gd).call(oe,void 0,He[0])}for(K.position={start:an(z.length>0?z[0][1].start:{line:1,column:1,offset:0}),end:an(z.length>0?z[z.length-2][1].end:{line:1,column:1,offset:0})},he=-1;++he<t.transforms.length;)K=t.transforms[he](K)||K;return K}function i(z,K,oe){let le=K-1,he=-1,He=!1,Ge,Ze,Et,Rt;for(;++le<=oe;){const Qe=z[le];switch(Qe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Qe[0]==="enter"?he++:he--,Rt=void 0;break}case"lineEndingBlank":{Qe[0]==="enter"&&(Ge&&!Rt&&!he&&!Et&&(Et=le),Rt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Rt=void 0}if(!he&&Qe[0]==="enter"&&Qe[1].type==="listItemPrefix"||he===-1&&Qe[0]==="exit"&&(Qe[1].type==="listUnordered"||Qe[1].type==="listOrdered")){if(Ge){let Ct=le;for(Ze=void 0;Ct--;){const at=z[Ct];if(at[1].type==="lineEnding"||at[1].type==="lineEndingBlank"){if(at[0]==="exit")continue;Ze&&(z[Ze][1].type="lineEndingBlank",He=!0),at[1].type="lineEnding",Ze=Ct}else if(!(at[1].type==="linePrefix"||at[1].type==="blockQuotePrefix"||at[1].type==="blockQuotePrefixWhitespace"||at[1].type==="blockQuoteMarker"||at[1].type==="listItemIndent"))break}Et&&(!Ze||Et<Ze)&&(Ge._spread=!0),Ge.end=Object.assign({},Ze?z[Ze][1].start:Qe[1].end),z.splice(Ze||le,0,["exit",Ge,Qe[2]]),le++,oe++}if(Qe[1].type==="listItemPrefix"){const Ct={type:"listItem",_spread:!1,start:Object.assign({},Qe[1].start),end:void 0};Ge=Ct,z.splice(le,0,["enter",Ct,Qe[2]]),le++,oe++,Et=void 0,Rt=!0}}}return z[K][1]._spread=He,oe}function o(z,K){return oe;function oe(le){a.call(this,z(le),le),K&&K.call(this,le)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(z,K,oe){this.stack[this.stack.length-1].children.push(z),this.stack.push(z),this.tokenStack.push([K,oe||void 0]),z.position={start:an(K.start),end:void 0}}function l(z){return K;function K(oe){z&&z.call(this,oe),u.call(this,oe)}}function u(z,K){const oe=this.stack.pop(),le=this.tokenStack.pop();if(le)le[0].type!==z.type&&(K?K.call(this,z,le[0]):(le[1]||Gd).call(this,z,le[0]));else throw new Error("Cannot close `"+z.type+"` ("+Lr({start:z.start,end:z.end})+"): it’s not open");oe.position.end=an(z.end)}function f(){return ta(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function h(z){if(this.data.expectingFirstListItemValue){const K=this.stack[this.stack.length-2];K.start=Number.parseInt(this.sliceSerialize(z),10),this.data.expectingFirstListItemValue=void 0}}function d(){const z=this.resume(),K=this.stack[this.stack.length-1];K.lang=z}function m(){const z=this.resume(),K=this.stack[this.stack.length-1];K.meta=z}function p(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){const z=this.resume(),K=this.stack[this.stack.length-1];K.value=z.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const z=this.resume(),K=this.stack[this.stack.length-1];K.value=z.replace(/(\r?\n|\r)$/g,"")}function v(z){const K=this.resume(),oe=this.stack[this.stack.length-1];oe.label=K,oe.identifier=Mt(this.sliceSerialize(z)).toLowerCase()}function w(){const z=this.resume(),K=this.stack[this.stack.length-1];K.title=z}function E(){const z=this.resume(),K=this.stack[this.stack.length-1];K.url=z}function S(z){const K=this.stack[this.stack.length-1];if(!K.depth){const oe=this.sliceSerialize(z).length;K.depth=oe}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function I(z){const K=this.stack[this.stack.length-1];K.depth=this.sliceSerialize(z).codePointAt(0)===61?1:2}function M(){this.data.setextHeadingSlurpLineEnding=void 0}function P(z){const oe=this.stack[this.stack.length-1].children;let le=oe[oe.length-1];(!le||le.type!=="text")&&(le=ee(),le.position={start:an(z.start),end:void 0},oe.push(le)),this.stack.push(le)}function T(z){const K=this.stack.pop();K.value+=this.sliceSerialize(z),K.position.end=an(z.end)}function O(z){const K=this.stack[this.stack.length-1];if(this.data.atHardBreak){const oe=K.children[K.children.length-1];oe.position.end=an(z.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(K.type)&&(P.call(this,z),T.call(this,z))}function U(){this.data.atHardBreak=!0}function F(){const z=this.resume(),K=this.stack[this.stack.length-1];K.value=z}function L(){const z=this.resume(),K=this.stack[this.stack.length-1];K.value=z}function R(){const z=this.resume(),K=this.stack[this.stack.length-1];K.value=z}function N(){const z=this.stack[this.stack.length-1];if(this.data.inReference){const K=this.data.referenceType||"shortcut";z.type+="Reference",z.referenceType=K,delete z.url,delete z.title}else delete z.identifier,delete z.label;this.data.referenceType=void 0}function j(){const z=this.stack[this.stack.length-1];if(this.data.inReference){const K=this.data.referenceType||"shortcut";z.type+="Reference",z.referenceType=K,delete z.url,delete z.title}else delete z.identifier,delete z.label;this.data.referenceType=void 0}function B(z){const K=this.sliceSerialize(z),oe=this.stack[this.stack.length-2];oe.label=ek(K),oe.identifier=Mt(K).toLowerCase()}function W(){const z=this.stack[this.stack.length-1],K=this.resume(),oe=this.stack[this.stack.length-1];if(this.data.inReference=!0,oe.type==="link"){const le=z.children;oe.children=le}else oe.alt=K}function b(){const z=this.resume(),K=this.stack[this.stack.length-1];K.url=z}function _(){const z=this.resume(),K=this.stack[this.stack.length-1];K.title=z}function H(){this.data.inReference=void 0}function x(){this.data.referenceType="collapsed"}function V(z){const K=this.resume(),oe=this.stack[this.stack.length-1];oe.label=K,oe.identifier=Mt(this.sliceSerialize(z)).toLowerCase(),this.data.referenceType="full"}function Y(z){this.data.characterReferenceType=z.type}function q(z){const K=this.sliceSerialize(z),oe=this.data.characterReferenceType;let le;oe?(le=Md(K,oe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):le=na(K);const he=this.stack[this.stack.length-1];he.value+=le}function Q(z){const K=this.stack.pop();K.position.end=an(z.end)}function X(z){T.call(this,z);const K=this.stack[this.stack.length-1];K.url=this.sliceSerialize(z)}function se(z){T.call(this,z);const K=this.stack[this.stack.length-1];K.url="mailto:"+this.sliceSerialize(z)}function G(){return{type:"blockquote",children:[]}}function te(){return{type:"code",lang:null,meta:null,value:""}}function $(){return{type:"inlineCode",value:""}}function ne(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ge(){return{type:"emphasis",children:[]}}function Oe(){return{type:"heading",depth:0,children:[]}}function J(){return{type:"break"}}function ue(){return{type:"html",value:""}}function de(){return{type:"image",title:null,url:"",alt:null}}function fe(){return{type:"link",title:null,url:"",children:[]}}function Ae(z){return{type:"list",ordered:z.type==="listOrdered",start:null,spread:z._spread,children:[]}}function Fe(z){return{type:"listItem",spread:z._spread,checked:null,children:[]}}function Me(){return{type:"paragraph",children:[]}}function je(){return{type:"strong",children:[]}}function ee(){return{type:"text",value:""}}function ae(){return{type:"thematicBreak"}}}function an(e){return{line:e.line,column:e.column,offset:e.offset}}function Kd(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Kd(e,r):ik(e,r)}}function ik(e,t){let n;for(n in t)if(Yd.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Gd(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Lr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Lr({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Lr({start:t.start,end:t.end})+") is still open")}function ok(e){const t=this;t.parser=n;function n(r){return nk(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function sk(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function ak(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
30
|
+
`}]}function lk(e,t){const n=t.value?t.value+`
|
|
31
|
+
`:"",r={};t.lang&&(r.className=["language-"+t.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function uk(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ck(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function fk(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Wn(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let s,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=o+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)}function dk(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function hk(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Qd(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function pk(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Qd(e,t);const i={src:Wn(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function mk(e,t){const n={src:Wn(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function gk(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function yk(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Qd(e,t);const i={href:Wn(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function vk(e,t){const n={href:Wn(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function bk(e,t,n){const r=e.all(t),i=n?wk(n):Zd(t),o={},s=[];if(typeof t.checked=="boolean"){const f=r[0];let c;f&&f.type==="element"&&f.tagName==="p"?c=f:(c={type:"element",tagName:"p",properties:{},children:[]},r.unshift(c)),c.children.length>0&&c.children.unshift({type:"text",value:" "}),c.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const f=r[a];(i||a!==0||f.type!=="element"||f.tagName!=="p")&&s.push({type:"text",value:`
|
|
32
|
+
`}),f.type==="element"&&f.tagName==="p"&&!i?s.push(...f.children):s.push(f)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&s.push({type:"text",value:`
|
|
33
|
+
`});const u={type:"element",tagName:"li",properties:o,children:s};return e.patch(t,u),e.applyData(t,u)}function wk(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=Zd(n[r])}return t}function Zd(e){const t=e.spread;return t??e.children.length>1}function Sk(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function xk(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function kk(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Ek(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ck(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=Gs(t.children[1]),l=yd(t.children[t.children.length-1]);a&&l&&(s.position={start:a,end:l}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function Ak(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length;let l=-1;const u=[];for(;++l<a;){const c=t.children[l],h={},d=s?s[l]:void 0;d&&(h.align=d);let m={type:"element",tagName:o,properties:h,children:[]};c&&(m.children=e.all(c),e.patch(c,m),m=e.applyData(c,m)),u.push(m)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,f),e.applyData(t,f)}function Tk(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Jd=9,Xd=32;function Ik(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(eh(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(eh(t.slice(i),i>0,!1)),o.join("")}function eh(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===Jd||o===Xd;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===Jd||o===Xd;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Ok(e,t){const n={type:"text",value:Ik(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Mk(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Dk={blockquote:sk,break:ak,code:lk,delete:uk,emphasis:ck,footnoteReference:fk,heading:dk,html:hk,imageReference:pk,image:mk,inlineCode:gk,linkReference:yk,link:vk,listItem:bk,list:Sk,paragraph:xk,root:kk,strong:Ek,table:Ck,tableCell:Tk,tableRow:Ak,text:Ok,thematicBreak:Mk,toml:Ui,yaml:Ui,definition:Ui,footnoteDefinition:Ui};function Ui(){}const th=-1,ji=0,zr=1,Hi=2,la=3,ua=4,ca=5,fa=6,nh=7,rh=8,ih=typeof self=="object"?self:globalThis,Nk=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,s]=t[i];switch(o){case ji:case th:return n(s,i);case zr:{const a=n([],i);for(const l of s)a.push(r(l));return a}case Hi:{const a=n({},i);for(const[l,u]of s)a[r(l)]=r(u);return a}case la:return n(new Date(s),i);case ua:{const{source:a,flags:l}=s;return n(new RegExp(a,l),i)}case ca:{const a=n(new Map,i);for(const[l,u]of s)a.set(r(l),r(u));return a}case fa:{const a=n(new Set,i);for(const l of s)a.add(r(l));return a}case nh:{const{name:a,message:l}=s;return n(new ih[a](l),i)}case rh:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:a}=new Uint8Array(s);return n(new DataView(a),s)}}return n(new ih[o](s),i)};return r},oh=e=>Nk(new Map,e)(0),Yn="",{toString:_k}={},{keys:Pk}=Object,Ur=e=>{const t=typeof e;if(t!=="object"||!e)return[ji,t];const n=_k.call(e).slice(8,-1);switch(n){case"Array":return[zr,Yn];case"Object":return[Hi,Yn];case"Date":return[la,Yn];case"RegExp":return[ua,Yn];case"Map":return[ca,Yn];case"Set":return[fa,Yn];case"DataView":return[zr,n]}return n.includes("Array")?[zr,n]:n.includes("Error")?[nh,n]:[Hi,n]},Vi=([e,t])=>e===ji&&(t==="function"||t==="symbol"),Lk=(e,t,n,r)=>{const i=(s,a)=>{const l=r.push(s)-1;return n.set(a,l),l},o=s=>{if(n.has(s))return n.get(s);let[a,l]=Ur(s);switch(a){case ji:{let f=s;switch(l){case"bigint":a=rh,f=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);f=null;break;case"undefined":return i([th],s)}return i([a,f],s)}case zr:{if(l){let h=s;return l==="DataView"?h=new Uint8Array(s.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(s)),i([l,[...h]],s)}const f=[],c=i([a,f],s);for(const h of s)f.push(o(h));return c}case Hi:{if(l)switch(l){case"BigInt":return i([l,s.toString()],s);case"Boolean":case"Number":case"String":return i([l,s.valueOf()],s)}if(t&&"toJSON"in s)return o(s.toJSON());const f=[],c=i([a,f],s);for(const h of Pk(s))(e||!Vi(Ur(s[h])))&&f.push([o(h),o(s[h])]);return c}case la:return i([a,s.toISOString()],s);case ua:{const{source:f,flags:c}=s;return i([a,{source:f,flags:c}],s)}case ca:{const f=[],c=i([a,f],s);for(const[h,d]of s)(e||!(Vi(Ur(h))||Vi(Ur(d))))&&f.push([o(h),o(d)]);return c}case fa:{const f=[],c=i([a,f],s);for(const h of s)(e||!Vi(Ur(h)))&&f.push(o(h));return c}}const{message:u}=s;return i([a,{name:l,message:u}],s)};return o},sh=(e,{json:t,lossy:n}={})=>{const r=[];return Lk(!(t||n),!!t,new Map,r)(e),r},Wi=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?oh(sh(e,t)):structuredClone(e):(e,t)=>oh(sh(e,t));function Fk(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Rk(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function $k(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Fk,r=e.options.footnoteBackLabel||Rk,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[l]);if(!u)continue;const f=e.all(u),c=String(u.identifier).toUpperCase(),h=Wn(c.toLowerCase());let d=0;const m=[],p=e.footnoteCounts.get(c);for(;p!==void 0&&++d<=p;){m.length>0&&m.push({type:"text",value:" "});let v=typeof n=="string"?n:n(l,d);typeof v=="string"&&(v={type:"text",value:v}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(d>1?"-"+d:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,d),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const g=f[f.length-1];if(g&&g.type==="element"&&g.tagName==="p"){const v=g.children[g.children.length-1];v&&v.type==="text"?v.value+=" ":g.children.push({type:"text",value:" "}),g.children.push(...m)}else f.push(...m);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(f,!0)};e.patch(u,y),a.push(y)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Wi(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
34
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
|
|
35
|
+
`}]}}const qi=function(e){if(e==null)return jk;if(typeof e=="function")return Yi(e);if(typeof e=="object")return Array.isArray(e)?Bk(e):zk(e);if(typeof e=="string")return Uk(e);throw new Error("Expected function, string, or object as test")};function Bk(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=qi(e[n]);return Yi(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function zk(e){const t=e;return Yi(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function Uk(e){return Yi(t);function t(n){return n&&n.type===e}}function Yi(e){return t;function t(n,r,i){return!!(Hk(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function jk(){return!0}function Hk(e){return e!==null&&typeof e=="object"&&"type"in e}function YP(e){return e}const ah=[],Vk=!0,da=!1,Wk="skip";function lh(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=qi(i),s=r?-1:1;a(e,void 0,[])();function a(l,u,f){const c=l&&typeof l=="object"?l:{};if(typeof c.type=="string"){const d=typeof c.tagName=="string"?c.tagName:typeof c.name=="string"?c.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(d?"<"+d+">":""))+")"})}return h;function h(){let d=ah,m,p,g;if((!t||o(l,u,f[f.length-1]||void 0))&&(d=qk(n(l,f)),d[0]===da))return d;if("children"in l&&l.children){const y=l;if(y.children&&d[0]!==Wk)for(p=(r?y.children.length:-1)+s,g=f.concat(y);p>-1&&p<y.children.length;){const v=y.children[p];if(m=a(v,p,g)(),m[0]===da)return m;p=typeof m[1]=="number"?m[1]:p+s}}return d}}}function qk(e){return Array.isArray(e)?e:typeof e=="number"?[Vk,e]:e==null?ah:[e]}function ha(e,t,n,r){let i,o,s;typeof t=="function"&&typeof n!="function"?(o=void 0,s=t,i=n):(o=t,s=n,i=r),lh(e,o,a,i);function a(l,u){const f=u[u.length-1],c=f?f.children.indexOf(l):void 0;return s(l,c,f)}}const pa={}.hasOwnProperty,Yk={};function Kk(e,t){const n=t||Yk,r=new Map,i=new Map,o=new Map,s={...Dk,...n.handlers},a={all:u,applyData:Qk,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:s,one:l,options:n,patch:Gk,wrap:Jk};return ha(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const c=f.type==="definition"?r:i,h=String(f.identifier).toUpperCase();c.has(h)||c.set(h,f)}}),a;function l(f,c){const h=f.type,d=a.handlers[h];if(pa.call(a.handlers,h)&&d)return d(a,f,c);if(a.options.passThrough&&a.options.passThrough.includes(h)){if("children"in f){const{children:p,...g}=f,y=Wi(g);return y.children=a.all(f),y}return Wi(f)}return(a.options.unknownHandler||Zk)(a,f,c)}function u(f){const c=[];if("children"in f){const h=f.children;let d=-1;for(;++d<h.length;){const m=a.one(h[d],f);if(m){if(d&&h[d-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=uh(m.value)),!Array.isArray(m)&&m.type==="element")){const p=m.children[0];p&&p.type==="text"&&(p.value=uh(p.value))}Array.isArray(m)?c.push(...m):c.push(m)}}}return c}}function Gk(e,t){e.position&&(t.position=q1(e))}function Qk(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&o&&Object.assign(n.properties,Wi(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Zk(e,t){const n=t.data||{},r="value"in t&&!(pa.call(n,"hProperties")||pa.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Jk(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
36
36
|
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
37
37
|
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
38
|
-
`}),n}function
|
|
39
|
-
`},i),o}function Vb(e,t){return e&&"run"in e?async function(n,r){const i=Lu(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Lu(n,{file:r,...e||t})}}function Fu(e){if(e)throw e}var Fr=Object.prototype.hasOwnProperty,Ru=Object.prototype.toString,Bu=Object.defineProperty,zu=Object.getOwnPropertyDescriptor,$u=function(t){return typeof Array.isArray=="function"?Array.isArray(t):Ru.call(t)==="[object Array]"},ju=function(t){if(!t||Ru.call(t)!=="[object Object]")return!1;var n=Fr.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Fr.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Fr.call(t,i)},Uu=function(t,n){Bu&&n.name==="__proto__"?Bu(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Hu=function(t,n){if(n==="__proto__")if(Fr.call(t,n)){if(zu)return zu(t,n).value}else return;return t[n]},qb=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,u=arguments.length,f=!1;for(typeof s=="boolean"&&(f=s,s=arguments[1]||{},l=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});l<u;++l)if(t=arguments[l],t!=null)for(n in t)r=Hu(s,n),i=Hu(t,n),s!==i&&(f&&i&&(ju(i)||(o=$u(i)))?(o?(o=!1,a=r&&$u(r)?r:[]):a=r&&ju(r)?r:{},Uu(s,{name:n,newValue:e(f,a,i)})):typeof i<"u"&&Uu(s,{name:n,newValue:i}));return s};const Oo=jt(qb);function Do(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Kb(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);s(null,...i);function s(l,...u){const f=e[++o];let c=-1;if(l){a(l);return}for(;++c<i.length;)(u[c]===null||u[c]===void 0)&&(u[c]=i[c]);i=u,f?Yb(f,s)(...u):a(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function Yb(e,t){let n;return r;function r(...a){const s=e.length>a.length;let l;s&&a.push(i);try{l=e.apply(this,a)}catch(u){const f=u;if(s&&n)throw f;return i(f)}s||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(a,...s){n||(n=!0,t(a,...s))}function o(a){i(null,a)}}const yt={basename:Gb,dirname:Qb,extname:Jb,join:Zb,sep:"/"};function Gb(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Hn(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else a<0&&(o=!0,a=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function Qb(e){if(Hn(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Jb(e){Hn(e);let t=e.length,n=-1,r=0,i=-1,o=0,a;for(;t--;){const s=e.codePointAt(t);if(s===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),s===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Zb(...e){let t=-1,n;for(;++t<e.length;)Hn(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Xb(n)}function Xb(e){Hn(e);const t=e.codePointAt(0)===47;let n=ew(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function ew(e,t){let n="",r=0,i=-1,o=0,a=-1,s,l;for(;++a<=e.length;){if(a<e.length)s=e.codePointAt(a);else{if(s===47)break;s=47}if(s===47){if(!(i===a-1||o===1))if(i!==a-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=a,o=0;continue}}else if(n.length>0){n="",r=0,i=a,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,o=0}else s===46&&o>-1?o++:o=-1}return n}function Hn(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const tw={cwd:nw};function nw(){return"/"}function Mo(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function rw(e){if(typeof e=="string")e=new URL(e);else if(!Mo(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return iw(e)}function iw(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const _o=["history","path","basename","stem","extname","dirname"];class Wu{constructor(t){let n;t?Mo(t)?n={path:t}:typeof t=="string"||ow(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":tw.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<_o.length;){const o=_o[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)_o.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?yt.basename(this.path):void 0}set basename(t){No(t,"basename"),Po(t,"basename"),this.path=yt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?yt.dirname(this.path):void 0}set dirname(t){Vu(this.basename,"dirname"),this.path=yt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?yt.extname(this.path):void 0}set extname(t){if(Po(t,"extname"),Vu(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=yt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Mo(t)&&(t=rw(t)),No(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?yt.basename(this.path,this.extname):void 0}set stem(t){No(t,"stem"),Po(t,"stem"),this.path=yt.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new He(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Po(e,t){if(e&&e.includes(yt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+yt.sep+"`")}function No(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Vu(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function ow(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const aw=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},sw={}.hasOwnProperty;class Lo extends aw{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Kb()}copy(){const t=new Lo;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Oo(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Bo("data",this.frozen),this.namespace[t]=n,this):sw.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Bo("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Rr(t),r=this.parser||this.Parser;return Fo("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Fo("process",this.parser||this.Parser),Ro("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,a){const s=Rr(t),l=r.parse(s);r.run(l,s,function(f,c,p){if(f||!c||!p)return u(f);const d=c,m=r.stringify(d,p);cw(m)?p.value=m:p.result=m,u(f,p)});function u(f,c){f||!c?a(f):o?o(c):n(void 0,c)}}}processSync(t){let n=!1,r;return this.freeze(),Fo("processSync",this.parser||this.Parser),Ro("processSync",this.compiler||this.Compiler),this.process(t,i),Ku("processSync","process",n),r;function i(o,a){n=!0,Fu(o),r=a}}run(t,n,r){qu(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(a,s){const l=Rr(n);i.run(t,l,u);function u(f,c,p){const d=c||t;f?s(f):a?a(d):r(void 0,d,p)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),Ku("runSync","run",r),i;function o(a,s){Fu(a),i=s,r=!0}}stringify(t,n){this.freeze();const r=Rr(n),i=this.compiler||this.Compiler;return Ro("stringify",i),qu(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Bo("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?s(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[f,...c]=u;l(f,c)}else a(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function a(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");s(u.plugins),u.settings&&(i.settings=Oo(!0,i.settings,u.settings))}function s(u){let f=-1;if(u!=null)if(Array.isArray(u))for(;++f<u.length;){const c=u[f];o(c)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,f){let c=-1,p=-1;for(;++c<r.length;)if(r[c][0]===u){p=c;break}if(p===-1)r.push([u,...f]);else if(f.length>0){let[d,...m]=f;const h=r[p][1];Do(h)&&Do(d)&&(d=Oo(!0,h,d)),r[p]=[u,d,...m]}}}}const lw=new Lo().freeze();function Fo(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ro(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Bo(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function qu(e){if(!Do(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Ku(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Rr(e){return uw(e)?e:new Wu(e)}function uw(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function cw(e){return typeof e=="string"||fw(e)}function fw(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const dw="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Yu=[],Gu={allowDangerousHtml:!0},pw=/^(https?|ircs?|mailto|xmpp)$/i,hw=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Qu(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,o=e.components,a=e.disallowedElements,s=e.rehypePlugins||Yu,l=e.remarkPlugins||Yu,u=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Gu}:Gu,f=e.skipHtml,c=e.unwrapDisallowed,p=e.urlTransform||Ju,d=lw().use(Jv).use(l).use(Vb,u).use(s),m=new Wu;typeof r=="string"&&(m.value=r);for(const v of hw)Object.hasOwn(e,v.from)&&(""+v.from+(v.to?"use `"+v.to+"` instead":"remove it")+dw+v.id,void 0);const h=d.parse(m);let g=d.runSync(h,m);return i&&(g={type:"element",tagName:"div",properties:{className:i},children:g.type==="root"?g.children:[g]}),Io(g,y),Hg(g,{Fragment:S.Fragment,components:o,ignoreInvalidStyle:!0,jsx:S.jsx,jsxs:S.jsxs,passKeys:!0,passNode:!0});function y(v,w,A){if(v.type==="raw"&&A&&typeof w=="number")return f?A.children.splice(w,1):A.children[w]={type:"text",value:v.value},w;if(v.type==="element"){let k;for(k in ho)if(Object.hasOwn(ho,k)&&Object.hasOwn(v.properties,k)){const C=v.properties[k],T=ho[k];(T===null||T.includes(v.tagName))&&(v.properties[k]=p(String(C||""),k,v))}}if(v.type==="element"){let k=t?!t.includes(v.tagName):a?a.includes(v.tagName):!1;if(!k&&n&&typeof w=="number"&&(k=!n(v,w,A)),k&&A&&typeof w=="number")return c&&v.children?A.children.splice(w,1,...v.children):A.children.splice(w,1),w}}}function Ju(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t<0||i>-1&&t>i||n>-1&&t>n||r>-1&&t>r||pw.test(e.slice(0,t))?e:""}function mw(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Zu(e,t,n){const i=Nr((n||{}).ignore||[]),o=gw(t);let a=-1;for(;++a<o.length;)Pu(e,"text",s);function s(u,f){let c=-1,p;for(;++c<f.length;){const d=f[c],m=p?p.children:void 0;if(i(d,m?m.indexOf(d):void 0,p))return;p=d}if(p)return l(u,f)}function l(u,f){const c=f[f.length-1],p=o[a][0],d=o[a][1];let m=0;const g=c.children.indexOf(u);let y=!1,v=[];p.lastIndex=0;let w=p.exec(u.value);for(;w;){const A=w.index,k={index:w.index,input:w.input,stack:[...f,u]};let C=d(...w,k);if(typeof C=="string"&&(C=C.length>0?{type:"text",value:C}:void 0),C===!1?p.lastIndex=A+1:(m!==A&&v.push({type:"text",value:u.value.slice(m,A)}),Array.isArray(C)?v.push(...C):C&&v.push(C),m=A+w[0].length,y=!0),!p.global)break;w=p.exec(u.value)}return y?(m<u.value.length&&v.push({type:"text",value:u.value.slice(m)}),c.children.splice(g,1,...v)):v=[u],g+v.length}}function gw(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([yw(i[0]),vw(i[1])])}return t}function yw(e){return typeof e=="string"?new RegExp(mw(e),"g"):e}function vw(e){return typeof e=="function"?e:function(){return e}}function bw(e){Zu(e,[/\r?\n|\r/g,ww])}function ww(){return{type:"break"}}function xw(){return function(e){bw(e)}}function Xu(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const zo="phrasing",$o=["autolink","link","image","label"];function kw(){return{transforms:[Ow],enter:{literalAutolink:Ew,literalAutolinkEmail:jo,literalAutolinkHttp:jo,literalAutolinkWww:jo},exit:{literalAutolink:Tw,literalAutolinkEmail:Iw,literalAutolinkHttp:Cw,literalAutolinkWww:Aw}}}function Sw(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:zo,notInConstruct:$o},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:zo,notInConstruct:$o},{character:":",before:"[ps]",after:"\\/",inConstruct:zo,notInConstruct:$o}]}}function Ew(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function jo(e){this.config.enter.autolinkProtocol.call(this,e)}function Cw(e){this.config.exit.autolinkProtocol.call(this,e)}function Aw(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function Iw(e){this.config.exit.autolinkEmail.call(this,e)}function Tw(e){this.exit(e)}function Ow(e){Zu(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Dw],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Mw]],{ignore:["link","linkReference"]})}function Dw(e,t,n,r,i){let o="";if(!ec(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!_w(n)))return!1;const a=Pw(n+r);if(!a[0])return!1;const s={type:"link",title:null,url:o+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[s,{type:"text",value:a[1]}]:s}function Mw(e,t,n,r){return!ec(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function _w(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function Pw(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=Xu(e,"(");let o=Xu(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function ec(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Wt(n)||Ar(n))&&(!t||n!==47)}tc.peek=Uw;function Nw(){this.buffer()}function Lw(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Fw(){this.buffer()}function Rw(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Bw(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ut(this.sliceSerialize(e)).toLowerCase(),n.label=t}function zw(e){this.exit(e)}function $w(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ut(this.sliceSerialize(e)).toLowerCase(),n.label=t}function jw(e){this.exit(e)}function Uw(){return"["}function tc(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const a=n.enter("footnoteReference"),s=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),s(),a(),o+=i.move("]"),o}function Hw(){return{enter:{gfmFootnoteCallString:Nw,gfmFootnoteCall:Lw,gfmFootnoteDefinitionLabelString:Fw,gfmFootnoteDefinition:Rw},exit:{gfmFootnoteCallString:Bw,gfmFootnoteCall:zw,gfmFootnoteDefinitionLabelString:$w,gfmFootnoteDefinition:jw}}}function Ww(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:tc},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,a){const s=o.createTracker(a);let l=s.move("[^");const u=o.enter("footnoteDefinition"),f=o.enter("label");return l+=s.move(o.safe(o.associationId(r),{before:l,after:"]"})),f(),l+=s.move("]:"),r.children&&r.children.length>0&&(s.shift(4),l+=s.move((t?`
|
|
40
|
-
`:" ")+o.indentLines(o.containerFlow(r,
|
|
41
|
-
`)}function
|
|
42
|
-
`&&
|
|
43
|
-
`}function
|
|
44
|
-
`,encode:["`"],...
|
|
45
|
-
`),o&&(f+=
|
|
46
|
-
`)),f+=
|
|
47
|
-
`,...l.current()}))),
|
|
38
|
+
`}),n}function uh(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function ch(e,t){const n=Kk(e,t),r=n.one(e,void 0),i=$k(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
|
|
39
|
+
`},i),o}function Xk(e,t){return e&&"run"in e?async function(n,r){const i=ch(n,{file:r,...t});await e.run(i,r)}:function(n,r){return ch(n,{file:r,...e||t})}}function fh(e){if(e)throw e}var Ki=Object.prototype.hasOwnProperty,dh=Object.prototype.toString,hh=Object.defineProperty,ph=Object.getOwnPropertyDescriptor,mh=function(t){return typeof Array.isArray=="function"?Array.isArray(t):dh.call(t)==="[object Array]"},gh=function(t){if(!t||dh.call(t)!=="[object Object]")return!1;var n=Ki.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Ki.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Ki.call(t,i)},yh=function(t,n){hh&&n.name==="__proto__"?hh(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},vh=function(t,n){if(n==="__proto__")if(Ki.call(t,n)){if(ph)return ph(t,n).value}else return;return t[n]},eE=function e(){var t,n,r,i,o,s,a=arguments[0],l=1,u=arguments.length,f=!1;for(typeof a=="boolean"&&(f=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<u;++l)if(t=arguments[l],t!=null)for(n in t)r=vh(a,n),i=vh(t,n),a!==i&&(f&&i&&(gh(i)||(o=mh(i)))?(o?(o=!1,s=r&&mh(r)?r:[]):s=r&&gh(r)?r:{},yh(a,{name:n,newValue:e(f,s,i)})):typeof i<"u"&&yh(a,{name:n,newValue:i}));return a};const ma=vn(eE);function ga(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function tE(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...i);function a(l,...u){const f=e[++o];let c=-1;if(l){s(l);return}for(;++c<i.length;)(u[c]===null||u[c]===void 0)&&(u[c]=i[c]);i=u,f?nE(f,a)(...u):s(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function nE(e,t){let n;return r;function r(...s){const a=e.length>s.length;let l;a&&s.push(i);try{l=e.apply(this,s)}catch(u){const f=u;if(a&&n)throw f;return i(f)}a||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(s,...a){n||(n=!0,t(s,...a))}function o(s){i(null,s)}}const $t={basename:rE,dirname:iE,extname:oE,join:sE,sep:"/"};function rE(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');jr(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function iE(e){if(jr(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function oE(e){jr(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function sE(...e){let t=-1,n;for(;++t<e.length;)jr(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":aE(n)}function aE(e){jr(e);const t=e.codePointAt(0)===47;let n=lE(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function lE(e,t){let n="",r=0,i=-1,o=0,s=-1,a,l;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(i===s-1||o===1))if(i!==s-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function jr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const uE={cwd:cE};function cE(){return"/"}function ya(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function fE(e){if(typeof e=="string")e=new URL(e);else if(!ya(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return dE(e)}function dE(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const va=["history","path","basename","stem","extname","dirname"];class bh{constructor(t){let n;t?ya(t)?n={path:t}:typeof t=="string"||hE(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":uE.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<va.length;){const o=va[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)va.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?$t.basename(this.path):void 0}set basename(t){wa(t,"basename"),ba(t,"basename"),this.path=$t.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?$t.dirname(this.path):void 0}set dirname(t){wh(this.basename,"dirname"),this.path=$t.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?$t.extname(this.path):void 0}set extname(t){if(ba(t,"extname"),wh(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=$t.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){ya(t)&&(t=fE(t)),wa(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?$t.basename(this.path,this.extname):void 0}set stem(t){wa(t,"stem"),ba(t,"stem"),this.path=$t.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new et(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function ba(e,t){if(e&&e.includes($t.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+$t.sep+"`")}function wa(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function wh(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function hE(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const pE=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},mE={}.hasOwnProperty;class Sa extends pE{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=tE()}copy(){const t=new Sa;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(ma(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Ea("data",this.frozen),this.namespace[t]=n,this):mE.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Ea("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Gi(t),r=this.parser||this.Parser;return xa("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),xa("process",this.parser||this.Parser),ka("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,s){const a=Gi(t),l=r.parse(a);r.run(l,a,function(f,c,h){if(f||!c||!h)return u(f);const d=c,m=r.stringify(d,h);vE(m)?h.value=m:h.result=m,u(f,h)});function u(f,c){f||!c?s(f):o?o(c):n(void 0,c)}}}processSync(t){let n=!1,r;return this.freeze(),xa("processSync",this.parser||this.Parser),ka("processSync",this.compiler||this.Compiler),this.process(t,i),xh("processSync","process",n),r;function i(o,s){n=!0,fh(o),r=s}}run(t,n,r){Sh(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(s,a){const l=Gi(n);i.run(t,l,u);function u(f,c,h){const d=c||t;f?a(f):s?s(d):r(void 0,d,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),xh("runSync","run",r),i;function o(s,a){fh(s),i=a,r=!0}}stringify(t,n){this.freeze();const r=Gi(n),i=this.compiler||this.Compiler;return ka("stringify",i),Sh(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Ea("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[f,...c]=u;l(f,c)}else s(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function s(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(u.plugins),u.settings&&(i.settings=ma(!0,i.settings,u.settings))}function a(u){let f=-1;if(u!=null)if(Array.isArray(u))for(;++f<u.length;){const c=u[f];o(c)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,f){let c=-1,h=-1;for(;++c<r.length;)if(r[c][0]===u){h=c;break}if(h===-1)r.push([u,...f]);else if(f.length>0){let[d,...m]=f;const p=r[h][1];ga(p)&&ga(d)&&(d=ma(!0,p,d)),r[h]=[u,d,...m]}}}}const gE=new Sa().freeze();function xa(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function ka(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Ea(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Sh(e){if(!ga(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function xh(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Gi(e){return yE(e)?e:new bh(e)}function yE(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function vE(e){return typeof e=="string"||bE(e)}function bE(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const wE="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",kh=[],Eh={allowDangerousHtml:!0},SE=/^(https?|ircs?|mailto|xmpp)$/i,xE=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Ch(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,o=e.components,s=e.disallowedElements,a=e.rehypePlugins||kh,l=e.remarkPlugins||kh,u=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Eh}:Eh,f=e.skipHtml,c=e.unwrapDisallowed,h=e.urlTransform||Ah,d=gE().use(ok).use(l).use(Xk,u).use(a),m=new bh;typeof r=="string"&&(m.value=r);for(const v of xE)Object.hasOwn(e,v.from)&&(""+v.from+(v.to?"use `"+v.to+"` instead":"remove it")+wE+v.id,void 0);const p=d.parse(m);let g=d.runSync(p,m);return i&&(g={type:"element",tagName:"div",properties:{className:i},children:g.type==="root"?g.children:[g]}),ha(g,y),Z1(g,{Fragment:k.Fragment,components:o,ignoreInvalidStyle:!0,jsx:k.jsx,jsxs:k.jsxs,passKeys:!0,passNode:!0});function y(v,w,E){if(v.type==="raw"&&E&&typeof w=="number")return f?E.children.splice(w,1):E.children[w]={type:"text",value:v.value},w;if(v.type==="element"){let S;for(S in ea)if(Object.hasOwn(ea,S)&&Object.hasOwn(v.properties,S)){const C=v.properties[S],I=ea[S];(I===null||I.includes(v.tagName))&&(v.properties[S]=h(String(C||""),S,v))}}if(v.type==="element"){let S=t?!t.includes(v.tagName):s?s.includes(v.tagName):!1;if(!S&&n&&typeof w=="number"&&(S=!n(v,w,E)),S&&E&&typeof w=="number")return c&&v.children?E.children.splice(w,1,...v.children):E.children.splice(w,1),w}}}function Ah(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t<0||i>-1&&t>i||n>-1&&t>n||r>-1&&t>r||SE.test(e.slice(0,t))?e:""}function kE(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Th(e,t,n){const i=qi((n||{}).ignore||[]),o=EE(t);let s=-1;for(;++s<o.length;)lh(e,"text",a);function a(u,f){let c=-1,h;for(;++c<f.length;){const d=f[c],m=h?h.children:void 0;if(i(d,m?m.indexOf(d):void 0,h))return;h=d}if(h)return l(u,f)}function l(u,f){const c=f[f.length-1],h=o[s][0],d=o[s][1];let m=0;const g=c.children.indexOf(u);let y=!1,v=[];h.lastIndex=0;let w=h.exec(u.value);for(;w;){const E=w.index,S={index:w.index,input:w.input,stack:[...f,u]};let C=d(...w,S);if(typeof C=="string"&&(C=C.length>0?{type:"text",value:C}:void 0),C===!1?h.lastIndex=E+1:(m!==E&&v.push({type:"text",value:u.value.slice(m,E)}),Array.isArray(C)?v.push(...C):C&&v.push(C),m=E+w[0].length,y=!0),!h.global)break;w=h.exec(u.value)}return y?(m<u.value.length&&v.push({type:"text",value:u.value.slice(m)}),c.children.splice(g,1,...v)):v=[u],g+v.length}}function EE(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([CE(i[0]),AE(i[1])])}return t}function CE(e){return typeof e=="string"?new RegExp(kE(e),"g"):e}function AE(e){return typeof e=="function"?e:function(){return e}}function TE(e){Th(e,[/\r?\n|\r/g,IE])}function IE(){return{type:"break"}}function OE(){return function(e){TE(e)}}function Ih(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const Ca="phrasing",Aa=["autolink","link","image","label"];function ME(){return{transforms:[RE],enter:{literalAutolink:NE,literalAutolinkEmail:Ta,literalAutolinkHttp:Ta,literalAutolinkWww:Ta},exit:{literalAutolink:FE,literalAutolinkEmail:LE,literalAutolinkHttp:_E,literalAutolinkWww:PE}}}function DE(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Ca,notInConstruct:Aa},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Ca,notInConstruct:Aa},{character:":",before:"[ps]",after:"\\/",inConstruct:Ca,notInConstruct:Aa}]}}function NE(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Ta(e){this.config.enter.autolinkProtocol.call(this,e)}function _E(e){this.config.exit.autolinkProtocol.call(this,e)}function PE(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function LE(e){this.config.exit.autolinkEmail.call(this,e)}function FE(e){this.exit(e)}function RE(e){Th(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,$E],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),BE]],{ignore:["link","linkReference"]})}function $E(e,t,n,r,i){let o="";if(!Oh(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!zE(n)))return!1;const s=UE(n+r);if(!s[0])return!1;const a={type:"link",title:null,url:o+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function BE(e,t,n,r){return!Oh(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function zE(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function UE(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=Ih(e,"(");let o=Ih(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function Oh(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Tn(n)||$i(n))&&(!t||n!==47)}Mh.peek=QE;function jE(){this.buffer()}function HE(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function VE(){this.buffer()}function WE(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function qE(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Mt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function YE(e){this.exit(e)}function KE(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Mt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function GE(e){this.exit(e)}function QE(){return"["}function Mh(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const s=n.enter("footnoteReference"),a=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),a(),s(),o+=i.move("]"),o}function ZE(){return{enter:{gfmFootnoteCallString:jE,gfmFootnoteCall:HE,gfmFootnoteDefinitionLabelString:VE,gfmFootnoteDefinition:WE},exit:{gfmFootnoteCallString:qE,gfmFootnoteCall:YE,gfmFootnoteDefinitionLabelString:KE,gfmFootnoteDefinition:GE}}}function JE(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Mh},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,s){const a=o.createTracker(s);let l=a.move("[^");const u=o.enter("footnoteDefinition"),f=o.enter("label");return l+=a.move(o.safe(o.associationId(r),{before:l,after:"]"})),f(),l+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),l+=a.move((t?`
|
|
40
|
+
`:" ")+o.indentLines(o.containerFlow(r,a.current()),t?Dh:XE))),u(),l}}function XE(e,t,n){return t===0?e:Dh(e,t,n)}function Dh(e,t,n){return(n?"":" ")+e}const eC=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Nh.peek=oC;function tC(){return{canContainEols:["delete"],enter:{strikethrough:rC},exit:{strikethrough:iC}}}function nC(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:eC}],handlers:{delete:Nh}}}function rC(e){this.enter({type:"delete",children:[]},e)}function iC(e){this.exit(e)}function Nh(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function oC(){return"~"}function sC(e){return e.length}function aC(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||sC,o=[],s=[],a=[],l=[];let u=0,f=-1;for(;++f<e.length;){const p=[],g=[];let y=-1;for(e[f].length>u&&(u=e[f].length);++y<e[f].length;){const v=lC(e[f][y]);if(n.alignDelimiters!==!1){const w=i(v);g[y]=w,(l[y]===void 0||w>l[y])&&(l[y]=w)}p.push(v)}s[f]=p,a[f]=g}let c=-1;if(typeof r=="object"&&"length"in r)for(;++c<u;)o[c]=_h(r[c]);else{const p=_h(r);for(;++c<u;)o[c]=p}c=-1;const h=[],d=[];for(;++c<u;){const p=o[c];let g="",y="";p===99?(g=":",y=":"):p===108?g=":":p===114&&(y=":");let v=n.alignDelimiters===!1?1:Math.max(1,l[c]-g.length-y.length);const w=g+"-".repeat(v)+y;n.alignDelimiters!==!1&&(v=g.length+v+y.length,v>l[c]&&(l[c]=v),d[c]=v),h[c]=w}s.splice(1,0,h),a.splice(1,0,d),f=-1;const m=[];for(;++f<s.length;){const p=s[f],g=a[f];c=-1;const y=[];for(;++c<u;){const v=p[c]||"";let w="",E="";if(n.alignDelimiters!==!1){const S=l[c]-(g[c]||0),C=o[c];C===114?w=" ".repeat(S):C===99?S%2?(w=" ".repeat(S/2+.5),E=" ".repeat(S/2-.5)):(w=" ".repeat(S/2),E=w):E=" ".repeat(S)}n.delimiterStart!==!1&&!c&&y.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&v==="")&&(n.delimiterStart!==!1||c)&&y.push(" "),n.alignDelimiters!==!1&&y.push(w),y.push(v),n.alignDelimiters!==!1&&y.push(E),n.padding!==!1&&y.push(" "),(n.delimiterEnd!==!1||c!==u-1)&&y.push("|")}m.push(n.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return m.join(`
|
|
41
|
+
`)}function lC(e){return e==null?"":String(e)}function _h(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function uC(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const s=n.indentLines(n.containerFlow(e,o.current()),cC);return i(),s}function cC(e,t,n){return">"+(n?"":" ")+e}function fC(e,t){return Ph(e,t.inConstruct,!0)&&!Ph(e,t.notInConstruct,!1)}function Ph(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Lh(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
42
|
+
`&&fC(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
43
|
+
`}function dC(e,t){const n=String(e);let r=n.indexOf(t),i=r,o=0,s=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>s&&(s=o):o=1,i=r+t.length,r=n.indexOf(t,i);return s}function hC(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function pC(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function mC(e,t,n,r){const i=pC(n),o=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(hC(e,n)){const c=n.enter("codeIndented"),h=n.indentLines(o,gC);return c(),h}const a=n.createTracker(r),l=i.repeat(Math.max(dC(o,i)+1,3)),u=n.enter("codeFenced");let f=a.move(l);if(e.lang){const c=n.enter(`codeFencedLang${s}`);f+=a.move(n.safe(e.lang,{before:f,after:" ",encode:["`"],...a.current()})),c()}if(e.lang&&e.meta){const c=n.enter(`codeFencedMeta${s}`);f+=a.move(" "),f+=a.move(n.safe(e.meta,{before:f,after:`
|
|
44
|
+
`,encode:["`"],...a.current()})),c()}return f+=a.move(`
|
|
45
|
+
`),o&&(f+=a.move(o+`
|
|
46
|
+
`)),f+=a.move(l),u(),f}function gC(e,t,n){return(n?"":" ")+e}function Ia(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function yC(e,t,n,r){const i=Ia(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("definition");let a=n.enter("label");const l=n.createTracker(r);let u=l.move("[");return u+=l.move(n.safe(n.associationId(e),{before:u,after:"]",...l.current()})),u+=l.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(a=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":`
|
|
47
|
+
`,...l.current()}))),a(),e.title&&(a=n.enter(`title${o}`),u+=l.move(" "+i),u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),a()),s(),u}function vC(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Hr(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Qi(e,t,n){const r=qn(e),i=qn(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Fh.peek=bC;function Fh(e,t,n,r){const i=vC(n),o=n.enter("emphasis"),s=n.createTracker(r),a=s.move(i);let l=s.move(n.containerPhrasing(e,{after:i,before:a,...s.current()}));const u=l.charCodeAt(0),f=Qi(r.before.charCodeAt(r.before.length-1),u,i);f.inside&&(l=Hr(u)+l.slice(1));const c=l.charCodeAt(l.length-1),h=Qi(r.after.charCodeAt(0),c,i);h.inside&&(l=l.slice(0,-1)+Hr(c));const d=s.move(i);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:f.outside},a+l+d}function bC(e,t,n){return n.options.emphasis||"*"}function wC(e,t){let n=!1;return ha(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,da}),!!((!e.depth||e.depth<3)&&ta(e)&&(t.options.setext||n))}function SC(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(wC(e,n)){const f=n.enter("headingSetext"),c=n.enter("phrasing"),h=n.containerPhrasing(e,{...o.current(),before:`
|
|
48
48
|
`,after:`
|
|
49
|
-
`});return c(),f(),
|
|
50
|
-
`+(i===1?"=":"-").repeat(
|
|
51
|
-
`))+1))}const
|
|
52
|
-
`,...o.current()});return/^[\t ]/.test(u)&&(u=
|
|
53
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:
|
|
54
|
-
`))}function l(d,m,h,g){const y=h.enter("tableCell"),v=h.enter("phrasing"),w=h.containerPhrasing(d,{...g,before:o,after:o});return v(),y(),w}function u(d,m){return Xw(d,{align:m,alignDelimiters:r,padding:n,stringLength:i})}function f(d,m,h){const g=d.children;let y=-1;const v=[],w=m.enter("table");for(;++y<g.length;)v[y]=c(g[y],m,h);return w(),v}function c(d,m,h){const g=d.children;let y=-1;const v=[],w=m.enter("tableRow");for(;++y<g.length;)v[y]=l(g[y],d,m,h);return w(),v}function p(d,m,h){let g=yc.inlineCode(d,m,h);return h.stack.includes("tableCell")&&(g=g.replace(/\|/g,"\\$&")),g}}function $x(){return{exit:{taskListCheckValueChecked:bc,taskListCheckValueUnchecked:bc,paragraph:Ux}}}function jx(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Hx}}}function bc(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Ux(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,a;for(;++o<i.length;){const s=i[o];if(s.type==="paragraph"){a=s;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function Hx(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",s=n.createTracker(r);o&&s.move(a);let l=yc.listItem(e,t,n,{...r,...s.current()});return o&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),l;function u(f){return f+a}}function Wx(){return[kw(),Hw(),Kw(),Px(),$x()]}function Vx(e){return{extensions:[Sw(),Ww(e),Yw(),zx(e),jx()]}}const qx={tokenize:Zx,partial:!0},wc={tokenize:Xx,partial:!0},xc={tokenize:e0,partial:!0},kc={tokenize:t0,partial:!0},Kx={tokenize:n0,partial:!0},Sc={name:"wwwAutolink",tokenize:Qx,previous:Cc},Ec={name:"protocolAutolink",tokenize:Jx,previous:Ac},Et={name:"emailAutolink",tokenize:Gx,previous:Ic},vt={};function Yx(){return{text:vt}}let Vt=48;for(;Vt<123;)vt[Vt]=Et,Vt++,Vt===58?Vt=65:Vt===91&&(Vt=97);vt[43]=Et,vt[45]=Et,vt[46]=Et,vt[95]=Et,vt[72]=[Et,Ec],vt[104]=[Et,Ec],vt[87]=[Et,Sc],vt[119]=[Et,Sc];function Gx(e,t,n){const r=this;let i,o;return a;function a(c){return!Vo(c)||!Ic.call(r,r.previous)||qo(r.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(c))}function s(c){return Vo(c)?(e.consume(c),s):c===64?(e.consume(c),l):n(c)}function l(c){return c===46?e.check(Kx,f,u)(c):c===45||c===95||We(c)?(o=!0,e.consume(c),l):f(c)}function u(c){return e.consume(c),i=!0,l}function f(c){return o&&i&&qe(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(c)):n(c)}}function Qx(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!Cc.call(r,r.previous)||qo(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(qx,e.attempt(wc,e.attempt(xc,o),n),n)(a))}function o(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function Jx(e,t,n){const r=this;let i="",o=!1;return a;function a(c){return(c===72||c===104)&&Ac.call(r,r.previous)&&!qo(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(c),e.consume(c),s):n(c)}function s(c){if(qe(c)&&i.length<5)return i+=String.fromCodePoint(c),e.consume(c),s;if(c===58){const p=i.toLowerCase();if(p==="http"||p==="https")return e.consume(c),l}return n(c)}function l(c){return c===47?(e.consume(c),o?u:(o=!0,l)):n(c)}function u(c){return c===null||Cr(c)||Ie(c)||Wt(c)||Ar(c)?n(c):e.attempt(wc,e.attempt(xc,f),n)(c)}function f(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(c)}}function Zx(e,t,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),i):a===46&&r===3?(e.consume(a),o):n(a)}function o(a){return a===null?n(a):t(a)}}function Xx(e,t,n){let r,i,o;return a;function a(u){return u===46||u===95?e.check(kc,l,s)(u):u===null||Ie(u)||Wt(u)||u!==45&&Ar(u)?l(u):(o=!0,e.consume(u),a)}function s(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),a}function l(u){return i||r||!o?n(u):t(u)}}function e0(e,t){let n=0,r=0;return i;function i(a){return a===40?(n++,e.consume(a),i):a===41&&r<n?o(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(kc,t,o)(a):a===null||Ie(a)||Wt(a)?t(a):(e.consume(a),i)}function o(a){return a===41&&r++,e.consume(a),i}}function t0(e,t,n){return r;function r(s){return s===33||s===34||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===63||s===95||s===126?(e.consume(s),r):s===38?(e.consume(s),o):s===93?(e.consume(s),i):s===60||s===null||Ie(s)||Wt(s)?t(s):n(s)}function i(s){return s===null||s===40||s===91||Ie(s)||Wt(s)?t(s):r(s)}function o(s){return qe(s)?a(s):n(s)}function a(s){return s===59?(e.consume(s),r):qe(s)?(e.consume(s),a):n(s)}}function n0(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return We(o)?n(o):t(o)}}function Cc(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ie(e)}function Ac(e){return!qe(e)}function Ic(e){return!(e===47||Vo(e))}function Vo(e){return e===43||e===45||e===46||e===95||We(e)}function qo(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const r0={tokenize:f0,partial:!0};function i0(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:l0,continuation:{tokenize:u0},exit:c0}},text:{91:{name:"gfmFootnoteCall",tokenize:s0},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:o0,resolveTo:a0}}}}function o0(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return s;function s(l){if(!a||!a._balanced)return n(l);const u=ut(r.sliceSerialize({start:a.end,end:r.now()}));return u.codePointAt(0)!==94||!o.includes(u.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function a0(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},s=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",a,t],["exit",a,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...s),e}function s0(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,a;return s;function s(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),l}function l(c){return c!==94?n(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(c){if(o>999||c===93&&!a||c===null||c===91||Ie(c))return n(c);if(c===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return i.includes(ut(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(c)}return Ie(c)||(a=!0),o++,e.consume(c),c===92?f:u}function f(c){return c===91||c===92||c===93?(e.consume(c),o++,u):u(c)}}function l0(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,a=0,s;return l;function l(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):n(m)}function f(m){if(a>999||m===93&&!s||m===null||m===91||Ie(m))return n(m);if(m===93){e.exit("chunkString");const h=e.exit("gfmFootnoteDefinitionLabelString");return o=ut(r.sliceSerialize(h)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return Ie(m)||(s=!0),a++,e.consume(m),m===92?c:f}function c(m){return m===91||m===92||m===93?(e.consume(m),a++,f):f(m)}function p(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),i.includes(o)||i.push(o),be(e,d,"gfmFootnoteDefinitionWhitespace")):n(m)}function d(m){return t(m)}}function u0(e,t,n){return e.check(Bn,t,e.attempt(r0,t,n))}function c0(e){e.exit("gfmFootnoteDefinition")}function f0(e,t,n){const r=this;return be(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(o):n(o)}}function d0(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,s){let l=-1;for(;++l<a.length;)if(a[l][0]==="enter"&&a[l][1].type==="strikethroughSequenceTemporary"&&a[l][1]._close){let u=l;for(;u--;)if(a[u][0]==="exit"&&a[u][1].type==="strikethroughSequenceTemporary"&&a[u][1]._open&&a[l][1].end.offset-a[l][1].start.offset===a[u][1].end.offset-a[u][1].start.offset){a[l][1].type="strikethroughSequence",a[u][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},a[u][1].start),end:Object.assign({},a[l][1].end)},c={type:"strikethroughText",start:Object.assign({},a[u][1].end),end:Object.assign({},a[l][1].start)},p=[["enter",f,s],["enter",a[u][1],s],["exit",a[u][1],s],["enter",c,s]],d=s.parser.constructs.insideSpan.null;d&&tt(p,p.length,0,Ir(d,a.slice(u+1,l),s)),tt(p,p.length,0,[["exit",c,s],["enter",a[l][1],s],["exit",a[l][1],s],["exit",f,s]]),tt(a,u-1,l-u+3,p),l=u+p.length-2;break}}for(l=-1;++l<a.length;)a[l][1].type==="strikethroughSequenceTemporary"&&(a[l][1].type="data");return a}function o(a,s,l){const u=this.previous,f=this.events;let c=0;return p;function p(m){return u===126&&f[f.length-1][1].type!=="characterEscape"?l(m):(a.enter("strikethroughSequenceTemporary"),d(m))}function d(m){const h=nn(u);if(m===126)return c>1?l(m):(a.consume(m),c++,d);if(c<2&&!n)return l(m);const g=a.exit("strikethroughSequenceTemporary"),y=nn(m);return g._open=!y||y===2&&!!h,g._close=!h||h===2&&!!y,s(m)}}}class p0{constructor(){this.map=[]}add(t,n,r){h0(this,t,n,r)}consume(t){if(this.map.sort(function(o,a){return o[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function h0(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function m0(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function g0(){return{flow:{null:{name:"table",tokenize:y0,resolveAll:v0}}}}function y0(e,t,n){const r=this;let i=0,o=0,a;return s;function s(I){let O=r.events.length-1;for(;O>-1;){const M=r.events[O][1].type;if(M==="lineEnding"||M==="linePrefix")O--;else break}const j=O>-1?r.events[O][1].type:null,z=j==="tableHead"||j==="tableRow"?C:l;return z===C&&r.parser.lazy[r.now().line]?n(I):z(I)}function l(I){return e.enter("tableHead"),e.enter("tableRow"),u(I)}function u(I){return I===124||(a=!0,o+=1),f(I)}function f(I){return I===null?n(I):ce(I)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),d):n(I):ye(I)?be(e,f,"whitespace")(I):(o+=1,a&&(a=!1,i+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),a=!0,f):(e.enter("data"),c(I)))}function c(I){return I===null||I===124||Ie(I)?(e.exit("data"),f(I)):(e.consume(I),I===92?p:c)}function p(I){return I===92||I===124?(e.consume(I),c):c(I)}function d(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(I):(e.enter("tableDelimiterRow"),a=!1,ye(I)?be(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):m(I))}function m(I){return I===45||I===58?g(I):I===124?(a=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),h):k(I)}function h(I){return ye(I)?be(e,g,"whitespace")(I):g(I)}function g(I){return I===58?(o+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),y):I===45?(o+=1,y(I)):I===null||ce(I)?A(I):k(I)}function y(I){return I===45?(e.enter("tableDelimiterFiller"),v(I)):k(I)}function v(I){return I===45?(e.consume(I),v):I===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),w):(e.exit("tableDelimiterFiller"),w(I))}function w(I){return ye(I)?be(e,A,"whitespace")(I):A(I)}function A(I){return I===124?m(I):I===null||ce(I)?!a||i!==o?k(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):k(I)}function k(I){return n(I)}function C(I){return e.enter("tableRow"),T(I)}function T(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),T):I===null||ce(I)?(e.exit("tableRow"),t(I)):ye(I)?be(e,T,"whitespace")(I):(e.enter("data"),P(I))}function P(I){return I===null||I===124||Ie(I)?(e.exit("data"),T(I)):(e.consume(I),I===92?F:P)}function F(I){return I===92||I===124?(e.consume(I),P):P(I)}}function v0(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],a=[0,0,0,0],s=!1,l=0,u,f,c;const p=new p0;for(;++n<e.length;){const d=e[n],m=d[1];d[0]==="enter"?m.type==="tableHead"?(s=!1,l!==0&&(Tc(p,t,l,u,f),f=void 0,l=0),u={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},p.add(n,0,[["enter",u,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(r=!0,c=void 0,o=[0,0,0,0],a=[0,n+1,0,0],s&&(s=!1,f={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},p.add(n,0,[["enter",f,t]])),i=m.type==="tableDelimiterRow"?2:f?3:1):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(o[1]!==0&&(a[0]=a[1],c=zr(p,t,o,i,void 0,c),o=[0,0,0,0]),a[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(a[0]=a[1],c=zr(p,t,o,i,void 0,c)),o=a,a=[o[1],n,0,0])):m.type==="tableHead"?(s=!0,l=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(l=n,o[1]!==0?(a[0]=a[1],c=zr(p,t,o,i,n,c)):a[1]!==0&&(c=zr(p,t,a,i,n,c)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(a[3]=n)}for(l!==0&&Tc(p,t,l,u,f),p.consume(t.events),n=-1;++n<t.events.length;){const d=t.events[n];d[0]==="enter"&&d[1].type==="table"&&(d[1]._align=m0(t.events,n))}return e}function zr(e,t,n,r,i,o){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",s="tableContent";n[0]!==0&&(o.end=Object.assign({},on(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const l=on(t.events,n[1]);if(o={type:a,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const u=on(t.events,n[2]),f=on(t.events,n[3]),c={type:s,start:Object.assign({},u),end:Object.assign({},f)};if(e.add(n[2],0,[["enter",c,t]]),r!==2){const p=t.events[n[2]],d=t.events[n[3]];if(p[1].end=Object.assign({},d[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,h=n[3]-n[2]-1;e.add(m,h,[])}}e.add(n[3]+1,0,[["exit",c,t]])}return i!==void 0&&(o.end=Object.assign({},on(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function Tc(e,t,n,r,i){const o=[],a=on(t.events,n);i&&(i.end=Object.assign({},a),o.push(["exit",i,t])),r.end=Object.assign({},a),o.push(["exit",r,t]),e.add(n+1,0,o)}function on(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const b0={name:"tasklistCheck",tokenize:x0};function w0(){return{text:{91:b0}}}function x0(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),o)}function o(l){return Ie(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),a):n(l)}function a(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):n(l)}function s(l){return ce(l)?t(l):ye(l)?e.check({tokenize:k0},t,n)(l):n(l)}}function k0(e,t,n){return be(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function S0(e){return eu([Yx(),i0(),d0(e),g0(),w0()])}const E0={};function C0(e){const t=this,n=e||E0,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(S0(n)),o.push(Wx()),a.push(Vx(n))}const ge={container:{className:"bpReset bpContainer bpFont",dropzone:{overlay:{className:"bpDropzoneOverlay"}}},loader:{className:"bpReset bpLoader"},modal:{overlay:{className:"bpModalOverlay"},dialog:{container:{className:"bpReset bpModalContainer"},title:{className:"bpModalTitle"},description:{className:"bpModalDescription"},content:{container:{className:"bpModalContentContainer"},textarea:{className:"bpModalContentTextArea"}},button:{container:{className:"bpModalButtonContainer"},confirm:{className:"bpModalButtonConfirm"},cancel:{className:"bpModalButtonCancel"}}}},messagePreview:{container:{className:"bpMessagePreviewContainer"},message:{className:"bpMessagePreviewMessage"},description:{className:"bpMessagePreviewDescription"},closeButton:{className:"bpMessagePreviewCloseButton"},avatar:{container:{className:"bpMessagePreviewAvatarContainer"},image:{className:"bpMessagePreviewAvatarImage"},fallback:{className:"bpMessagePreviewAvatarFallback"}}},fab:{container:{className:"bpReset bpFabContainer"},icon:{className:"bpFabIcon"},image:{className:"bpFabImage"}},notification:{container:{className:"bpReset bpNotificationContainer"},title:{className:"bpNotificationTitle"},description:{className:"bpNotificationDescription"},icon:{className:"bpNotificationIcon"},closeIcon:{className:"bpNotificationCloseIcon"}},header:{container:{className:"bpReset bpHeaderContainer bpFont"},content:{container:{className:"bpReset bpHeaderContentContainer"},title:{className:"bpHeaderContentTitle"},description:{className:"bpHeaderContentDescription"},avatar:{container:{className:"bpReset bpHeaderContentAvatarContainer"},image:{className:"bpHeaderContentAvatarImage"},fallback:{className:"bpHeaderContentAvatarFallback"}},toggleSound:{className:"bpHeaderSoundToggleButton"},actions:{container:{className:"bpReset bpHeaderContentActionsContainer"},icons:{className:"bpHeaderContentActionsIcons"}}},expandedContent:{container:{className:"bpReset bpHeaderExpandedContentContainer"},descriptionItems:{container:{className:"bpReset bpHeaderExpandedContentDescriptionItemsContainer"},icon:{className:"bpHeaderExpandedContentDescriptionItemsIcon"},text:{className:"bpHeaderExpandedContentDescriptionItemsText"},link:{className:"bpHeaderExpandedContentDescriptionItemsLink"}},group:{className:"bpHeaderExpandedContentGroup"}},newConversationIcon:{className:"bpHeaderNewConversationIcon"}},composer:{wrapper:{className:"bpReset bpComposerWrapper"},container:{className:"bpReset bpComposerContainer bpFont"},footer:{className:"bpComposerFooter"},inputContainer:{className:"bpComposerInputContainer"},input:{className:"bpComposerInput"},inputLoader:{className:"bpComposerInputLoader"},sendbutton:{className:"bpComposerSendButton"},uploadButton:{className:"bpComposerUploadButton"},voiceButton:{className:"bpComposerVoiceButton"},fileContainer:{className:"bpComposerFileContainer"},fileWidget:{container:{className:"bpComposerFileAttachement"},loader:{className:"bpComposerFileLoader"},fileIcon:{container:{className:"bpComposerFileIconWrapper"},icon:{className:"bpComposerFileIcon"}},metadata:{container:{className:"bpComposerFileMetadata"},name:{className:"bpComposerFileName"},type:{className:"bpComposerFileExtension"}},removeIcon:{className:"bpComposerFileRemoveIcon"},errorIcon:{className:"bpComposerFileErrorIcon"},previewImage:{className:"bpComposerFilePreviewImage"}}},messageList:{scrollDownButton:{className:"bpMessageListScrollDownButton"},container:{className:"bpReset bpMessageListContainer bpFont"},viewPort:{className:"bpMessageListViewport"},marquee:{container:{className:"bpReset bpMessageListMarqueeContainer"},content:{className:"bpMessageListMarqueeContent"},title:{className:"bpMessageListMarqueeTitle"},description:{className:"bpMessageListMarqueeDescription"},avatar:{container:{className:"bpReset bpMessageListMarqueeAvatarContainer"},image:{className:"bpMessageListMarqueeAvatarImage"},fallback:{className:"bpMessageListMarqueeAvatarFallback"}}},headerMessage:{className:"bpMessageListHeaderMessage"}},message:{container:{className:"bpReset bpMessageContainer"},avatar:{container:{className:"bpReset bpMessageAvatarContainer"},image:{className:"bpMessageAvatarImage"},fallback:{className:"bpMessageAvatarFallback"}},deliveryStatus:{className:"bpMessageDeliveryStatus"},blocks:{text:{heading1:{className:"bpMessageBlocksTextHeading1"},heading2:{className:"bpMessageBlocksTextHeading2"},heading3:{className:"bpMessageBlocksTextHeading3"},heading4:{className:"bpMessageBlocksTextHeading4"},unorderedList:{className:"bpMessageBlocksTextUnorderedList"},orderedList:{className:"bpMessageBlocksTextOrderedList"},listItem:{className:"bpMessageBlocksTextListItem"},link:{className:"bpMessageBlocksTextLink"},italic:{className:"bpMessageBlocksTextItalic"},bold:{className:"bpMessageBlocksTextBold"},text:{className:"bpMessageBlocksTextText"},image:{className:"bpMessageBlocksTextImage"},imageError:{className:"bpMessageBlocksTextImageError"},horizontalRule:{className:"bpMessageBlocksTextHorizontalRule"},lineBreak:{className:"bpMessageBlocksTextLineBreak"},input:{className:"bpMessageBlocksTextInput"},codeBlockContainer:{className:"bpMessageBlocksTextCodeBlockContainer"},codeBlockTitle:{className:"bpMessageBlocksTextCodeBlockTitle"},codeBlockCopyIcon:{className:"bpMessageBlocksTextCodeBlockCopyIcon"},codeBlock:{className:"bpMessageBlocksTextCodeBlock"},code:{className:"bpMessageBlocksTextCode"},tableContainer:{className:"bpMessageBlocksTextTableContainer"},table:{className:"bpMessageBlocksTextTable"},tableHeader:{className:"bpMessageBlocksTextTableHeader"},tableData:{className:"bpMessageBlocksTextTableData"},tableRow:{className:"bpMessageBlocksTextTableRow"}},audio:{className:"bpMessageBlocksAudio"},image:{image:{className:"bpMessageBlocksImageImage"},placeholder:{className:"bpMessageBlocksImagePlaceholder"},skeleton:{className:"bpSkeleton"}},video:{className:"bpMessageBlocksVideo"},location:{container:{className:"bpMessageBlocksLocationContainer"},title:{className:"bpMessageBlocksLocationTitle"},icon:{className:"bpMessageBlocksLocationIcon"}},file:{container:{className:"bpMessageBlocksFileContainer"},title:{className:"bpMessageBlocksFileTitle"},icon:{className:"bpMessageBlocksFileIcon"}},row:{className:"bpMessageBlocksRow"},column:{className:"bpMessageBlocksColumn"},bubble:{container:{className:"bpMessageBlocksBubble"},feedbackContainer:{className:"bpMessageBlocksBubbleFeedbackContainer"},feedbackIcon:{className:"bpMessageBlocksBubbleFeedbackIcon"}},carousel:{container:{className:"bpMessageBlocksCarouselContainer"},slidesContainer:{className:"bpMessageBlocksCarouselSlidesContainer"},backButton:{className:"bpMessageBlocksCarouselBackButton"},nextButton:{className:"bpMessageBlocksCarouselNextButton"}},dropdown:{button:{container:{className:"bpMessageBlocksDropdownButtonContainer"},text:{className:"bpMessageBlocksDropdownButtonText"},icon:{className:"bpMessageBlocksDropdownButtonIcon"}},content:{container:{className:"bpMessageBlocksDropdownContentContainer"},item:{className:"bpMessageBlocksDropdownContentItem"}}},button:{className:"bpMessageBlocksButton"}}},error:{container:{className:"bpReset bpErrorContainer"},id:{className:"bpErrorId"},header:{container:{className:"bpErrorHeader"},actions:{className:"bpErrorHeaderActions"}},content:{className:"bpErrorContent"},errorTitle:{className:"bpErrorTitle"},errorMessage:{className:"bpErrorMessage"},icon:{className:"bpErrorIcon"}},typingIndicator:{container:{className:"bpTypingIndicatorContainer"},loader:{className:"bpTypingIndicatorLoader"}},proactiveBubble:{container:{className:"bpProactiveBubbleContainer"},content:{className:"bpProactiveBubbleContent"},layout:{className:"bpProactiveBubbleLayout"},icon:{className:"bpProactiveBubbleIcon"},message:{className:"bpProactiveBubbleMessage"},closeButton:{className:"bpProactiveBubbleCloseButton"},arrow:{className:"bpProactiveBubbleArrow"}}};/**
|
|
49
|
+
`});return c(),f(),h+`
|
|
50
|
+
`+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
|
|
51
|
+
`))+1))}const s="#".repeat(i),a=n.enter("headingAtx"),l=n.enter("phrasing");o.move(s+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
|
|
52
|
+
`,...o.current()});return/^[\t ]/.test(u)&&(u=Hr(u.charCodeAt(0))+u.slice(1)),u=u?s+" "+u:s,n.options.closeAtx&&(u+=" "+s),l(),a(),u}Rh.peek=xC;function Rh(e){return e.value||""}function xC(){return"<"}$h.peek=kC;function $h(e,t,n,r){const i=Ia(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let a=n.enter("label");const l=n.createTracker(r);let u=l.move("![");return u+=l.move(n.safe(e.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(a=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),a(),e.title&&(a=n.enter(`title${o}`),u+=l.move(" "+i),u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),a()),u+=l.move(")"),s(),u}function kC(){return"!"}Bh.peek=EC;function Bh(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let s=n.enter("label");const a=n.createTracker(r);let l=a.move("![");const u=n.safe(e.alt,{before:l,after:"]",...a.current()});l+=a.move(u+"]["),s();const f=n.stack;n.stack=[],s=n.enter("reference");const c=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return s(),n.stack=f,o(),i==="full"||!u||u!==c?l+=a.move(c+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function EC(){return"!"}zh.peek=CC;function zh(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const s=n.unsafe[o],a=n.compilePattern(s);let l;if(s.atBreak)for(;l=a.exec(r);){let u=l.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(l.index+1)}}return i+r+i}function CC(){return"`"}function Uh(e,t){const n=ta(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}jh.peek=AC;function jh(e,t,n,r){const i=Ia(n),o=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let a,l;if(Uh(e,n)){const f=n.stack;n.stack=[],a=n.enter("autolink");let c=s.move("<");return c+=s.move(n.containerPhrasing(e,{before:c,after:">",...s.current()})),c+=s.move(">"),a(),n.stack=f,c}a=n.enter("link"),l=n.enter("label");let u=s.move("[");return u+=s.move(n.containerPhrasing(e,{before:u,after:"](",...s.current()})),u+=s.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=s.move("<"),u+=s.move(n.safe(e.url,{before:u,after:">",...s.current()})),u+=s.move(">")):(l=n.enter("destinationRaw"),u+=s.move(n.safe(e.url,{before:u,after:e.title?" ":")",...s.current()}))),l(),e.title&&(l=n.enter(`title${o}`),u+=s.move(" "+i),u+=s.move(n.safe(e.title,{before:u,after:i,...s.current()})),u+=s.move(i),l()),u+=s.move(")"),a(),u}function AC(e,t,n){return Uh(e,n)?"<":"["}Hh.peek=TC;function Hh(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let s=n.enter("label");const a=n.createTracker(r);let l=a.move("[");const u=n.containerPhrasing(e,{before:l,after:"]",...a.current()});l+=a.move(u+"]["),s();const f=n.stack;n.stack=[],s=n.enter("reference");const c=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return s(),n.stack=f,o(),i==="full"||!u||u!==c?l+=a.move(c+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function TC(){return"["}function Oa(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function IC(e){const t=Oa(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function OC(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Vh(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function MC(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let s=e.ordered?OC(n):Oa(n);const a=e.ordered?s==="."?")":".":IC(n);let l=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&f&&(!f.children||!f.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),Vh(n)===s&&f){let c=-1;for(;++c<e.children.length;){const h=e.children[c];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(s=a),n.bulletCurrent=s;const u=n.containerFlow(e,r);return n.bulletLastUsed=s,n.bulletCurrent=o,i(),u}function DC(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function NC(e,t,n,r){const i=DC(n);let o=n.bulletCurrent||Oa(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let s=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const a=n.createTracker(r);a.move(o+" ".repeat(s-o.length)),a.shift(s);const l=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,a.current()),f);return l(),u;function f(c,h,d){return h?(d?"":" ".repeat(s))+c:(d?o:o+" ".repeat(s-o.length))+c}}function _C(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),s=n.containerPhrasing(e,r);return o(),i(),s}const PC=qi(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function LC(e,t,n,r){return(e.children.some(function(s){return PC(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function FC(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Wh.peek=RC;function Wh(e,t,n,r){const i=FC(n),o=n.enter("strong"),s=n.createTracker(r),a=s.move(i+i);let l=s.move(n.containerPhrasing(e,{after:i,before:a,...s.current()}));const u=l.charCodeAt(0),f=Qi(r.before.charCodeAt(r.before.length-1),u,i);f.inside&&(l=Hr(u)+l.slice(1));const c=l.charCodeAt(l.length-1),h=Qi(r.after.charCodeAt(0),c,i);h.inside&&(l=l.slice(0,-1)+Hr(c));const d=s.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:f.outside},a+l+d}function RC(e,t,n){return n.options.strong||"*"}function $C(e,t,n,r){return n.safe(e.value,r)}function BC(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function zC(e,t,n){const r=(Vh(n)+(n.options.ruleSpaces?" ":"")).repeat(BC(n));return n.options.ruleSpaces?r.slice(0,-1):r}const qh={blockquote:uC,break:Lh,code:mC,definition:yC,emphasis:Fh,hardBreak:Lh,heading:SC,html:Rh,image:$h,imageReference:Bh,inlineCode:zh,link:jh,linkReference:Hh,list:MC,listItem:NC,paragraph:_C,root:LC,strong:Wh,text:$C,thematicBreak:zC};function UC(){return{enter:{table:jC,tableData:Yh,tableHeader:Yh,tableRow:VC},exit:{codeText:WC,table:HC,tableData:Ma,tableHeader:Ma,tableRow:Ma}}}function jC(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function HC(e){this.exit(e),this.data.inTable=void 0}function VC(e){this.enter({type:"tableRow",children:[]},e)}function Ma(e){this.exit(e)}function Yh(e){this.enter({type:"tableCell",children:[]},e)}function WC(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,qC));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function qC(e,t){return t==="|"?t:e}function YC(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
53
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:s,tableCell:l,tableRow:a}};function s(d,m,p,g){return u(f(d,p,g),d.align)}function a(d,m,p,g){const y=c(d,p,g),v=u([y]);return v.slice(0,v.indexOf(`
|
|
54
|
+
`))}function l(d,m,p,g){const y=p.enter("tableCell"),v=p.enter("phrasing"),w=p.containerPhrasing(d,{...g,before:o,after:o});return v(),y(),w}function u(d,m){return aC(d,{align:m,alignDelimiters:r,padding:n,stringLength:i})}function f(d,m,p){const g=d.children;let y=-1;const v=[],w=m.enter("table");for(;++y<g.length;)v[y]=c(g[y],m,p);return w(),v}function c(d,m,p){const g=d.children;let y=-1;const v=[],w=m.enter("tableRow");for(;++y<g.length;)v[y]=l(g[y],d,m,p);return w(),v}function h(d,m,p){let g=qh.inlineCode(d,m,p);return p.stack.includes("tableCell")&&(g=g.replace(/\|/g,"\\$&")),g}}function KC(){return{exit:{taskListCheckValueChecked:Kh,taskListCheckValueUnchecked:Kh,paragraph:QC}}}function GC(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:ZC}}}function Kh(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function QC(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,s;for(;++o<i.length;){const a=i[o];if(a.type==="paragraph"){s=a;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function ZC(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);o&&a.move(s);let l=qh.listItem(e,t,n,{...r,...a.current()});return o&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),l;function u(f){return f+s}}function JC(){return[ME(),ZE(),tC(),UC(),KC()]}function XC(e){return{extensions:[DE(),JE(e),nC(),YC(e),GC()]}}const eA={tokenize:sA,partial:!0},Gh={tokenize:aA,partial:!0},Qh={tokenize:lA,partial:!0},Zh={tokenize:uA,partial:!0},tA={tokenize:cA,partial:!0},Jh={name:"wwwAutolink",tokenize:iA,previous:ep},Xh={name:"protocolAutolink",tokenize:oA,previous:tp},Kt={name:"emailAutolink",tokenize:rA,previous:np},Bt={};function nA(){return{text:Bt}}let In=48;for(;In<123;)Bt[In]=Kt,In++,In===58?In=65:In===91&&(In=97);Bt[43]=Kt,Bt[45]=Kt,Bt[46]=Kt,Bt[95]=Kt,Bt[72]=[Kt,Xh],Bt[104]=[Kt,Xh],Bt[87]=[Kt,Jh],Bt[119]=[Kt,Jh];function rA(e,t,n){const r=this;let i,o;return s;function s(c){return!Da(c)||!np.call(r,r.previous)||Na(r.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(c))}function a(c){return Da(c)?(e.consume(c),a):c===64?(e.consume(c),l):n(c)}function l(c){return c===46?e.check(tA,f,u)(c):c===45||c===95||tt(c)?(o=!0,e.consume(c),l):f(c)}function u(c){return e.consume(c),i=!0,l}function f(c){return o&&i&&ot(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(c)):n(c)}}function iA(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!ep.call(r,r.previous)||Na(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(eA,e.attempt(Gh,e.attempt(Qh,o),n),n)(s))}function o(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function oA(e,t,n){const r=this;let i="",o=!1;return s;function s(c){return(c===72||c===104)&&tp.call(r,r.previous)&&!Na(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(c),e.consume(c),a):n(c)}function a(c){if(ot(c)&&i.length<5)return i+=String.fromCodePoint(c),e.consume(c),a;if(c===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(c),l}return n(c)}function l(c){return c===47?(e.consume(c),o?u:(o=!0,l)):n(c)}function u(c){return c===null||Ri(c)||De(c)||Tn(c)||$i(c)?n(c):e.attempt(Gh,e.attempt(Qh,f),n)(c)}function f(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(c)}}function sA(e,t,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),o):n(s)}function o(s){return s===null?n(s):t(s)}}function aA(e,t,n){let r,i,o;return s;function s(u){return u===46||u===95?e.check(Zh,l,a)(u):u===null||De(u)||Tn(u)||u!==45&&$i(u)?l(u):(o=!0,e.consume(u),s)}function a(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),s}function l(u){return i||r||!o?n(u):t(u)}}function lA(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r<n?o(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(Zh,t,o)(s):s===null||De(s)||Tn(s)?t(s):(e.consume(s),i)}function o(s){return s===41&&r++,e.consume(s),i}}function uA(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),o):a===93?(e.consume(a),i):a===60||a===null||De(a)||Tn(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||De(a)||Tn(a)?t(a):r(a)}function o(a){return ot(a)?s(a):n(a)}function s(a){return a===59?(e.consume(a),r):ot(a)?(e.consume(a),s):n(a)}}function cA(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return tt(o)?n(o):t(o)}}function ep(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||De(e)}function tp(e){return!ot(e)}function np(e){return!(e===47||Da(e))}function Da(e){return e===43||e===45||e===46||e===95||tt(e)}function Na(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const fA={tokenize:bA,partial:!0};function dA(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:gA,continuation:{tokenize:yA},exit:vA}},text:{91:{name:"gfmFootnoteCall",tokenize:mA},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:hA,resolveTo:pA}}}}function hA(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){s=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!s||!s._balanced)return n(l);const u=Mt(r.sliceSerialize({start:s.end,end:r.now()}));return u.codePointAt(0)!==94||!o.includes(u.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function pA(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function mA(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,s;return a;function a(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),l}function l(c){return c!==94?n(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(c){if(o>999||c===93&&!s||c===null||c===91||De(c))return n(c);if(c===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(Mt(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(c)}return De(c)||(s=!0),o++,e.consume(c),c===92?f:u}function f(c){return c===91||c===92||c===93?(e.consume(c),o++,u):u(c)}}function gA(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,s=0,a;return l;function l(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):n(m)}function f(m){if(s>999||m===93&&!a||m===null||m===91||De(m))return n(m);if(m===93){e.exit("chunkString");const p=e.exit("gfmFootnoteDefinitionLabelString");return o=Mt(r.sliceSerialize(p)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return De(m)||(a=!0),s++,e.consume(m),m===92?c:f}function c(m){return m===91||m===92||m===93?(e.consume(m),s++,f):f(m)}function h(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),i.includes(o)||i.push(o),ke(e,d,"gfmFootnoteDefinitionWhitespace")):n(m)}function d(m){return t(m)}}function yA(e,t,n){return e.check(Rr,t,e.attempt(fA,t,n))}function vA(e){e.exit("gfmFootnoteDefinition")}function bA(e,t,n){const r=this;return ke(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):n(o)}}function wA(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,a){let l=-1;for(;++l<s.length;)if(s[l][0]==="enter"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._close){let u=l;for(;u--;)if(s[u][0]==="exit"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._open&&s[l][1].end.offset-s[l][1].start.offset===s[u][1].end.offset-s[u][1].start.offset){s[l][1].type="strikethroughSequence",s[u][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},s[u][1].start),end:Object.assign({},s[l][1].end)},c={type:"strikethroughText",start:Object.assign({},s[u][1].end),end:Object.assign({},s[l][1].start)},h=[["enter",f,a],["enter",s[u][1],a],["exit",s[u][1],a],["enter",c,a]],d=a.parser.constructs.insideSpan.null;d&&mt(h,h.length,0,Bi(d,s.slice(u+1,l),a)),mt(h,h.length,0,[["exit",c,a],["enter",s[l][1],a],["exit",s[l][1],a],["exit",f,a]]),mt(s,u-1,l-u+3,h),l=u+h.length-2;break}}for(l=-1;++l<s.length;)s[l][1].type==="strikethroughSequenceTemporary"&&(s[l][1].type="data");return s}function o(s,a,l){const u=this.previous,f=this.events;let c=0;return h;function h(m){return u===126&&f[f.length-1][1].type!=="characterEscape"?l(m):(s.enter("strikethroughSequenceTemporary"),d(m))}function d(m){const p=qn(u);if(m===126)return c>1?l(m):(s.consume(m),c++,d);if(c<2&&!n)return l(m);const g=s.exit("strikethroughSequenceTemporary"),y=qn(m);return g._open=!y||y===2&&!!p,g._close=!p||p===2&&!!y,a(m)}}}class SA{constructor(){this.map=[]}add(t,n,r){xA(this,t,n,r)}consume(t){if(this.map.sort(function(o,s){return o[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function xA(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function kA(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function EA(){return{flow:{null:{name:"table",tokenize:CA,resolveAll:AA}}}}function CA(e,t,n){const r=this;let i=0,o=0,s;return a;function a(T){let O=r.events.length-1;for(;O>-1;){const L=r.events[O][1].type;if(L==="lineEnding"||L==="linePrefix")O--;else break}const U=O>-1?r.events[O][1].type:null,F=U==="tableHead"||U==="tableRow"?C:l;return F===C&&r.parser.lazy[r.now().line]?n(T):F(T)}function l(T){return e.enter("tableHead"),e.enter("tableRow"),u(T)}function u(T){return T===124||(s=!0,o+=1),f(T)}function f(T){return T===null?n(T):ce(T)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),d):n(T):ve(T)?ke(e,f,"whitespace")(T):(o+=1,s&&(s=!1,i+=1),T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),s=!0,f):(e.enter("data"),c(T)))}function c(T){return T===null||T===124||De(T)?(e.exit("data"),f(T)):(e.consume(T),T===92?h:c)}function h(T){return T===92||T===124?(e.consume(T),c):c(T)}function d(T){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(T):(e.enter("tableDelimiterRow"),s=!1,ve(T)?ke(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):m(T))}function m(T){return T===45||T===58?g(T):T===124?(s=!0,e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),p):S(T)}function p(T){return ve(T)?ke(e,g,"whitespace")(T):g(T)}function g(T){return T===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),y):T===45?(o+=1,y(T)):T===null||ce(T)?E(T):S(T)}function y(T){return T===45?(e.enter("tableDelimiterFiller"),v(T)):S(T)}function v(T){return T===45?(e.consume(T),v):T===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),w):(e.exit("tableDelimiterFiller"),w(T))}function w(T){return ve(T)?ke(e,E,"whitespace")(T):E(T)}function E(T){return T===124?m(T):T===null||ce(T)?!s||i!==o?S(T):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(T)):S(T)}function S(T){return n(T)}function C(T){return e.enter("tableRow"),I(T)}function I(T){return T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),I):T===null||ce(T)?(e.exit("tableRow"),t(T)):ve(T)?ke(e,I,"whitespace")(T):(e.enter("data"),M(T))}function M(T){return T===null||T===124||De(T)?(e.exit("data"),I(T)):(e.consume(T),T===92?P:M)}function P(T){return T===92||T===124?(e.consume(T),M):M(T)}}function AA(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],a=!1,l=0,u,f,c;const h=new SA;for(;++n<e.length;){const d=e[n],m=d[1];d[0]==="enter"?m.type==="tableHead"?(a=!1,l!==0&&(rp(h,t,l,u,f),f=void 0,l=0),u={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",u,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(r=!0,c=void 0,o=[0,0,0,0],s=[0,n+1,0,0],a&&(a=!1,f={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",f,t]])),i=m.type==="tableDelimiterRow"?2:f?3:1):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(o[1]!==0&&(s[0]=s[1],c=Zi(h,t,o,i,void 0,c),o=[0,0,0,0]),s[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(s[0]=s[1],c=Zi(h,t,o,i,void 0,c)),o=s,s=[o[1],n,0,0])):m.type==="tableHead"?(a=!0,l=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(l=n,o[1]!==0?(s[0]=s[1],c=Zi(h,t,o,i,n,c)):s[1]!==0&&(c=Zi(h,t,s,i,n,c)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(s[3]=n)}for(l!==0&&rp(h,t,l,u,f),h.consume(t.events),n=-1;++n<t.events.length;){const d=t.events[n];d[0]==="enter"&&d[1].type==="table"&&(d[1]._align=kA(t.events,n))}return e}function Zi(e,t,n,r,i,o){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(o.end=Object.assign({},Kn(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const l=Kn(t.events,n[1]);if(o={type:s,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const u=Kn(t.events,n[2]),f=Kn(t.events,n[3]),c={type:a,start:Object.assign({},u),end:Object.assign({},f)};if(e.add(n[2],0,[["enter",c,t]]),r!==2){const h=t.events[n[2]],d=t.events[n[3]];if(h[1].end=Object.assign({},d[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,p=n[3]-n[2]-1;e.add(m,p,[])}}e.add(n[3]+1,0,[["exit",c,t]])}return i!==void 0&&(o.end=Object.assign({},Kn(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function rp(e,t,n,r,i){const o=[],s=Kn(t.events,n);i&&(i.end=Object.assign({},s),o.push(["exit",i,t])),r.end=Object.assign({},s),o.push(["exit",r,t]),e.add(n+1,0,o)}function Kn(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const TA={name:"tasklistCheck",tokenize:OA};function IA(){return{text:{91:TA}}}function OA(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),o)}function o(l){return De(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),s):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),s):n(l)}function s(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return ce(l)?t(l):ve(l)?e.check({tokenize:MA},t,n)(l):n(l)}}function MA(e,t,n){return ke(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function DA(e){return Od([nA(),dA(),wA(e),EA(),IA()])}const NA={};function _A(e){const t=this,n=e||NA,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(DA(n)),o.push(JC()),s.push(XC(n))}const me={container:{className:"bpReset bpContainer bpFont",dropzone:{overlay:{className:"bpDropzoneOverlay"}}},loader:{className:"bpReset bpLoader"},modal:{overlay:{className:"bpModalOverlay"},dialog:{container:{className:"bpReset bpModalContainer"},title:{className:"bpModalTitle"},description:{className:"bpModalDescription"},content:{container:{className:"bpModalContentContainer"},textarea:{className:"bpModalContentTextArea"}},button:{container:{className:"bpModalButtonContainer"},confirm:{className:"bpModalButtonConfirm"},cancel:{className:"bpModalButtonCancel"}}}},messagePreview:{container:{className:"bpMessagePreviewContainer"},message:{className:"bpMessagePreviewMessage"},description:{className:"bpMessagePreviewDescription"},closeButton:{className:"bpMessagePreviewCloseButton"},avatar:{container:{className:"bpMessagePreviewAvatarContainer"},image:{className:"bpMessagePreviewAvatarImage"},fallback:{className:"bpMessagePreviewAvatarFallback"}}},fab:{container:{className:"bpReset bpFabContainer"},icon:{className:"bpFabIcon"},image:{className:"bpFabImage"}},notification:{container:{className:"bpReset bpNotificationContainer"},title:{className:"bpNotificationTitle"},description:{className:"bpNotificationDescription"},icon:{className:"bpNotificationIcon"},closeIcon:{className:"bpNotificationCloseIcon"}},header:{container:{className:"bpReset bpHeaderContainer bpFont"},content:{container:{className:"bpReset bpHeaderContentContainer"},conversationHistory:{className:"bpHeaderConversationHistoryButton"},title:{className:"bpHeaderContentTitle"},description:{className:"bpHeaderContentDescription"},avatar:{container:{className:"bpReset bpHeaderContentAvatarContainer"},image:{className:"bpHeaderContentAvatarImage"},fallback:{className:"bpHeaderContentAvatarFallback"}},toggleSound:{className:"bpHeaderSoundToggleButton"},actions:{container:{className:"bpReset bpHeaderContentActionsContainer"},icons:{className:"bpHeaderContentActionsIcons"}}},expandedContent:{container:{className:"bpReset bpHeaderExpandedContentContainer"},descriptionItems:{container:{className:"bpReset bpHeaderExpandedContentDescriptionItemsContainer"},icon:{className:"bpHeaderExpandedContentDescriptionItemsIcon"},text:{className:"bpHeaderExpandedContentDescriptionItemsText"},link:{className:"bpHeaderExpandedContentDescriptionItemsLink"}},group:{className:"bpHeaderExpandedContentGroup"}},newConversationIcon:{className:"bpHeaderNewConversationIcon"}},composer:{wrapper:{className:"bpReset bpComposerWrapper"},container:{className:"bpReset bpComposerContainer bpFont"},footer:{className:"bpComposerFooter"},inputContainer:{className:"bpComposerInputContainer"},input:{className:"bpComposerInput"},inputLoader:{className:"bpComposerInputLoader"},sendbutton:{className:"bpComposerSendButton"},uploadButton:{className:"bpComposerUploadButton"},voiceButton:{className:"bpComposerVoiceButton"},fileContainer:{className:"bpComposerFileContainer"},fileWidget:{container:{className:"bpComposerFileAttachement"},loader:{className:"bpComposerFileLoader"},fileIcon:{container:{className:"bpComposerFileIconWrapper"},icon:{className:"bpComposerFileIcon"}},metadata:{container:{className:"bpComposerFileMetadata"},name:{className:"bpComposerFileName"},type:{className:"bpComposerFileExtension"}},removeIcon:{className:"bpComposerFileRemoveIcon"},errorIcon:{className:"bpComposerFileErrorIcon"},previewImage:{className:"bpComposerFilePreviewImage"}}},messageList:{scrollDownButton:{className:"bpMessageListScrollDownButton"},container:{className:"bpReset bpMessageListContainer bpFont"},viewPort:{className:"bpMessageListViewport"},marquee:{container:{className:"bpReset bpMessageListMarqueeContainer"},content:{className:"bpMessageListMarqueeContent"},title:{className:"bpMessageListMarqueeTitle"},description:{className:"bpMessageListMarqueeDescription"},avatar:{container:{className:"bpReset bpMessageListMarqueeAvatarContainer"},image:{className:"bpMessageListMarqueeAvatarImage"},fallback:{className:"bpMessageListMarqueeAvatarFallback"}}},headerMessage:{className:"bpMessageListHeaderMessage"}},message:{container:{className:"bpReset bpMessageContainer"},avatar:{container:{className:"bpReset bpMessageAvatarContainer"},image:{className:"bpMessageAvatarImage"},fallback:{className:"bpMessageAvatarFallback"}},deliveryStatus:{className:"bpMessageDeliveryStatus"},blocks:{text:{heading1:{className:"bpMessageBlocksTextHeading1"},heading2:{className:"bpMessageBlocksTextHeading2"},heading3:{className:"bpMessageBlocksTextHeading3"},heading4:{className:"bpMessageBlocksTextHeading4"},unorderedList:{className:"bpMessageBlocksTextUnorderedList"},orderedList:{className:"bpMessageBlocksTextOrderedList"},listItem:{className:"bpMessageBlocksTextListItem"},link:{className:"bpMessageBlocksTextLink"},italic:{className:"bpMessageBlocksTextItalic"},bold:{className:"bpMessageBlocksTextBold"},text:{className:"bpMessageBlocksTextText"},image:{className:"bpMessageBlocksTextImage"},imageError:{className:"bpMessageBlocksTextImageError"},horizontalRule:{className:"bpMessageBlocksTextHorizontalRule"},lineBreak:{className:"bpMessageBlocksTextLineBreak"},input:{className:"bpMessageBlocksTextInput"},codeBlockContainer:{className:"bpMessageBlocksTextCodeBlockContainer"},codeBlockTitle:{className:"bpMessageBlocksTextCodeBlockTitle"},codeBlockCopyIcon:{className:"bpMessageBlocksTextCodeBlockCopyIcon"},codeBlock:{className:"bpMessageBlocksTextCodeBlock"},code:{className:"bpMessageBlocksTextCode"},tableContainer:{className:"bpMessageBlocksTextTableContainer"},table:{className:"bpMessageBlocksTextTable"},tableHeader:{className:"bpMessageBlocksTextTableHeader"},tableData:{className:"bpMessageBlocksTextTableData"},tableRow:{className:"bpMessageBlocksTextTableRow"}},audio:{className:"bpMessageBlocksAudio"},image:{image:{className:"bpMessageBlocksImageImage"},placeholder:{className:"bpMessageBlocksImagePlaceholder"},skeleton:{className:"bpSkeleton"}},video:{className:"bpMessageBlocksVideo"},location:{container:{className:"bpMessageBlocksLocationContainer"},title:{className:"bpMessageBlocksLocationTitle"},icon:{className:"bpMessageBlocksLocationIcon"}},file:{container:{className:"bpMessageBlocksFileContainer"},title:{className:"bpMessageBlocksFileTitle"},icon:{className:"bpMessageBlocksFileIcon"}},row:{className:"bpMessageBlocksRow"},column:{className:"bpMessageBlocksColumn"},bubble:{container:{className:"bpMessageBlocksBubble"},feedbackContainer:{className:"bpMessageBlocksBubbleFeedbackContainer"},feedbackIcon:{className:"bpMessageBlocksBubbleFeedbackIcon"}},carousel:{container:{className:"bpMessageBlocksCarouselContainer"},slidesContainer:{className:"bpMessageBlocksCarouselSlidesContainer"},backButton:{className:"bpMessageBlocksCarouselBackButton"},nextButton:{className:"bpMessageBlocksCarouselNextButton"}},dropdown:{button:{container:{className:"bpMessageBlocksDropdownButtonContainer"},text:{className:"bpMessageBlocksDropdownButtonText"},icon:{className:"bpMessageBlocksDropdownButtonIcon"}},content:{container:{className:"bpMessageBlocksDropdownContentContainer"},item:{className:"bpMessageBlocksDropdownContentItem"}}},button:{className:"bpMessageBlocksButton"}}},error:{container:{className:"bpReset bpErrorContainer"},id:{className:"bpErrorId"},header:{container:{className:"bpErrorHeader"},actions:{className:"bpErrorHeaderActions"}},content:{className:"bpErrorContent"},errorTitle:{className:"bpErrorTitle"},errorMessage:{className:"bpErrorMessage"},icon:{className:"bpErrorIcon"}},typingIndicator:{container:{className:"bpTypingIndicatorContainer"},loader:{className:"bpTypingIndicatorLoader"}},proactiveBubble:{container:{className:"bpProactiveBubbleContainer"},content:{className:"bpProactiveBubbleContent"},layout:{className:"bpProactiveBubbleLayout"},icon:{className:"bpProactiveBubbleIcon"},message:{className:"bpProactiveBubbleMessage"},closeButton:{className:"bpProactiveBubbleCloseButton"},arrow:{className:"bpProactiveBubbleArrow"}},conversationHistory:{container:{className:"bpReset bpConversationHistoryContainer bpFont"},header:{className:"bpConversationHistoryHeader"},closeButton:{className:"bpConversationHistoryCloseButton"},scrollContainer:{className:"bpConversationHistoryScrollContainer"},loaderContainer:{className:"bpConversationHistoryLoaderContainer"},conversation:{container:{className:"bpConversationHistoryConversationContainer"},chevron:{className:"bpConversationHistoryConversationChevron"},userAvatar:{className:{className:"bpConversationHistoryConversationUserAvatarFallback"}},avatar:{container:{className:"bpReset bpConversationHistoryConversationAvatarContainer"},image:{className:"bpConversationHistoryConversationAvatarImage"},fallback:{className:"bpConversationHistoryConversationAvatarFallback"}},content:{className:"bpConversationHistoryConversationContent"},name:{className:"bpConversationHistoryConversationName"},timestamp:{className:"bpConversationHistoryConversationTimestamp"}},newConversation:{button:{className:"bpConversationHistoryNewConversationButton"},icon:{className:"bpConversationHistoryNewConversationButtonIcon"}}}};/**
|
|
55
55
|
* @license lucide-react v0.554.0 - ISC
|
|
56
56
|
*
|
|
57
57
|
* This source code is licensed under the ISC license.
|
|
58
58
|
* See the LICENSE file in the root directory of this source tree.
|
|
59
|
-
*/const
|
|
59
|
+
*/const PA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),LA=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),ip=e=>{const t=LA(e);return t.charAt(0).toUpperCase()+t.slice(1)},op=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),FA=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
|
|
60
60
|
* @license lucide-react v0.554.0 - ISC
|
|
61
61
|
*
|
|
62
62
|
* This source code is licensed under the ISC license.
|
|
63
63
|
* See the LICENSE file in the root directory of this source tree.
|
|
64
|
-
*/var
|
|
64
|
+
*/var RA={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
65
65
|
* @license lucide-react v0.554.0 - ISC
|
|
66
66
|
*
|
|
67
67
|
* This source code is licensed under the ISC license.
|
|
68
68
|
* See the LICENSE file in the root directory of this source tree.
|
|
69
|
-
*/const
|
|
69
|
+
*/const $A=D.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:s,...a},l)=>D.createElement("svg",{ref:l,...RA,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:op("lucide",i),...!o&&!FA(a)&&{"aria-hidden":"true"},...a},[...s.map(([u,f])=>D.createElement(u,f)),...Array.isArray(o)?o:[o]]));/**
|
|
70
70
|
* @license lucide-react v0.554.0 - ISC
|
|
71
71
|
*
|
|
72
72
|
* This source code is licensed under the ISC license.
|
|
73
73
|
* See the LICENSE file in the root directory of this source tree.
|
|
74
|
-
*/const
|
|
74
|
+
*/const Se=(e,t)=>{const n=D.forwardRef(({className:r,...i},o)=>D.createElement($A,{ref:o,iconNode:t,className:op(`lucide-${PA(ip(e))}`,`lucide-${e}`,r),...i}));return n.displayName=ip(e),n};/**
|
|
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
|
|
79
|
+
*/const BA=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
|
|
84
|
+
*/const sp=Se("bot-off",[["path",{d:"M13.67 8H18a2 2 0 0 1 2 2v4.33",key:"7az073"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M22 22 2 2",key:"1r8tn9"}],["path",{d:"M8 8H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h12a2 2 0 0 0 1.414-.586",key:"s09a7a"}],["path",{d:"M9 13v2",key:"rq6x2g"}],["path",{d:"M9.67 4H12v2.33",key:"110xot"}]]);/**
|
|
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
|
|
89
|
+
*/const zA=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
|
|
94
|
+
*/const UA=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
|
|
99
|
+
*/const ap=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
|
|
104
|
+
*/const lp=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
|
|
109
|
+
*/const jA=Se("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
|
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
|
|
114
|
+
*/const up=Se("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
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
|
|
119
|
+
*/const HA=Se("cloud-upload",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]]);/**
|
|
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
|
|
124
|
+
*/const VA=Se("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
|
|
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
|
|
129
|
+
*/const WA=Se("file-down",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);/**
|
|
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
|
|
134
|
+
*/const cp=Se("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
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
|
|
139
|
+
*/const qA=Se("files",[["path",{d:"M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8",key:"14sh0y"}],["path",{d:"M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z",key:"1970lx"}],["path",{d:"M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1",key:"l4dndm"}]]);/**
|
|
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
|
|
144
|
+
*/const YA=Se("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
|
|
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
|
|
149
|
+
*/const fp=Se("image-off",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]]);/**
|
|
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
|
|
154
|
+
*/const KA=Se("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
|
|
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
|
|
159
|
+
*/const GA=Se("loader",[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]);/**
|
|
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
|
|
164
|
+
*/const QA=Se("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
|
|
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
|
|
169
|
+
*/const ZA=Se("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]);/**
|
|
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
|
|
174
|
+
*/const JA=Se("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/**
|
|
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
|
|
179
|
+
*/const XA=Se("mic",[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]]);/**
|
|
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
|
|
184
|
+
*/const eT=Se("monitor-cog",[["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"m14.305 7.53.923-.382",key:"1mlnsw"}],["path",{d:"m15.228 4.852-.923-.383",key:"82mpwg"}],["path",{d:"m16.852 3.228-.383-.924",key:"ln4sir"}],["path",{d:"m16.852 8.772-.383.923",key:"1dejw0"}],["path",{d:"m19.148 3.228.383-.924",key:"192kgf"}],["path",{d:"m19.53 9.696-.382-.924",key:"fiavlr"}],["path",{d:"m20.772 4.852.924-.383",key:"1j8mgp"}],["path",{d:"m20.772 7.148.924.383",key:"zix9be"}],["path",{d:"M22 13v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7",key:"1tnzv8"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}]]);/**
|
|
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
|
|
189
|
+
*/const tT=Se("phone",[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]]);/**
|
|
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
|
|
194
|
+
*/const nT=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
|
|
199
|
+
*/const rT=Se("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
|
|
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
|
|
204
|
+
*/const iT=Se("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
|
|
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
|
|
209
|
+
*/const oT=Se("thumbs-down",[["path",{d:"M17 14V2",key:"8ymqnk"}],["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}]]);/**
|
|
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
|
|
214
|
+
*/const sT=Se("thumbs-up",[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]]);/**
|
|
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
|
|
219
|
+
*/const aT=Se("unplug",[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]]);/**
|
|
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
|
|
224
|
+
*/const lT=Se("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
|
|
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
|
|
229
|
+
*/const uT=Se("video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);/**
|
|
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
|
|
234
|
+
*/const dp=Se("volume-2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/**
|
|
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
|
|
239
|
+
*/const cT=Se("volume-x",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);/**
|
|
240
|
+
* @license lucide-react v0.554.0 - ISC
|
|
241
|
+
*
|
|
242
|
+
* This source code is licensed under the ISC license.
|
|
243
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
244
|
+
*/const fT=Se("wifi-off",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
|
|
245
|
+
* @license lucide-react v0.554.0 - ISC
|
|
246
|
+
*
|
|
247
|
+
* This source code is licensed under the ISC license.
|
|
248
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
249
|
+
*/const hp=Se("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),dT=({text:e})=>{const{message:{blocks:{text:t}}}=me,[n,r]=D.useState(new Map);function i(s){if(n.has(s))return;const a=new Image;a.src=s,a.onerror=()=>{r(l=>new Map(l).set(s,!0))},a.onload=()=>{r(l=>new Map(l).set(s,!1))}}D.useEffect(()=>{const s=/!\[.*?\]\((.*?)\)/g,a=[];let l;for(;(l=s.exec(e))!==null;){const u=l[1];u&&!a.includes(u)&&a.push(u)}a.forEach(u=>{i(u)})},[e]);const o={h1:({node:s,...a})=>k.jsx("h1",{...a,...t.heading1}),h2:({node:s,...a})=>k.jsx("h2",{...a,...t.heading2}),h3:({node:s,...a})=>k.jsx("h3",{...a,...t.heading3}),h4:({node:s,...a})=>k.jsx("h4",{...a,...t.heading4}),h5:"h4",h6:"h4",em:({node:s,...a})=>k.jsx("em",{...a,...t.italic}),strong:({node:s,...a})=>k.jsx("strong",{...a,...t.bold}),p:({node:s,...a})=>k.jsx("p",{...a,...t.text}),hr:({node:s,...a})=>k.jsx("hr",{...a,...t.horizontalRule}),a:({node:s,href:a,children:l,...u})=>k.jsx("a",{...u,...t.link,onMouseUp:f=>{window.open(a,"_blank","noopener,noreferrer")},children:l}),img:({node:s,...a})=>{const l=a.src;return n.get(l)||!1?k.jsx("div",{"data-error":!0,...t.image,children:k.jsx(fp,{strokeWidth:"1"})}):k.jsx("img",{...a,...t.image})},ol:({node:s,...a})=>k.jsx("ol",{...a,...t.orderedList}),ul:({node:s,...a})=>k.jsx("ul",{...a,...t.unorderedList}),li:({node:s,...a})=>k.jsx("li",{...a,...t.listItem}),br:({node:s,...a})=>k.jsx("br",{...a,...t.lineBreak}),pre:({node:s,...a})=>{var m,p;const l=s==null?void 0:s.children[0],u=hT(((p=(m=l==null?void 0:l.properties)==null?void 0:m.className)==null?void 0:p[0])||""),[f,c]=D.useState(!1),h=D.useRef(null),d=()=>{if(!h.current)return;const g=h.current.textContent||"";navigator.clipboard.writeText(g).then(()=>{c(!0),setTimeout(()=>{c(!1)},1500)}).catch(y=>{console.error("Failed to copy code to clipboard:",y)})};return k.jsxs("div",{...t.codeBlockContainer,children:[k.jsxs("div",{...t.codeBlockTitle,children:[u?k.jsx("span",{children:u}):"Code",f?k.jsx(zA,{...t.codeBlockCopyIcon}):k.jsx(qA,{...t.codeBlockCopyIcon,onClick:d})]}),k.jsx("pre",{ref:h,...a,...t.codeBlock})]})},input:({node:s,...a})=>k.jsx("input",{...a,...t.input,disabled:!1}),code:({node:s,...a})=>k.jsx("code",{...a,...t.code}),table:({node:s,...a})=>k.jsx("div",{...t.tableContainer,children:k.jsx("table",{...a,...t.table})}),th:({node:s,...a})=>k.jsx("th",{...a,...t.tableHeader}),tr:({node:s,...a})=>k.jsx("tr",{...a,...t.tableRow}),td:({node:s,...a})=>k.jsx("td",{...a,...t.tableData})};return k.jsx(Ch,{urlTransform:s=>s.startsWith("tel:")?s:Ah(s),components:o,remarkPlugins:[_A,OE],children:e})},hT=e=>{if(!e)return"";const t=e.match(/language-(\w+)/);return t?t[1]:""},pT={},pp=e=>{let t;const n=new Set,r=(l,u)=>{const f=typeof l=="function"?l(t):l;if(!Object.is(f,t)){const c=t;t=u??typeof f!="object"?f:Object.assign({},t,f),n.forEach(h=>h(t,c))}},i=()=>t,a={setState:r,getState:i,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{(pT?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(r,i,a),a},mT=e=>e?pp(e):pp;var _a={exports:{}},Pa={},Ji={exports:{}},La={};/**
|
|
240
250
|
* @license React
|
|
241
251
|
* use-sync-external-store-shim.production.min.js
|
|
242
252
|
*
|
|
@@ -244,7 +254,7 @@ Please start a new conversation.`,Zi={ResourceNotFound:{type:"configuration",mes
|
|
|
244
254
|
*
|
|
245
255
|
* This source code is licensed under the MIT license found in the
|
|
246
256
|
* LICENSE file in the root directory of this source tree.
|
|
247
|
-
*/var
|
|
257
|
+
*/var mp;function gT(){if(mp)return La;mp=1;var e=D;function t(c,h){return c===h&&(c!==0||1/c===1/h)||c!==c&&h!==h}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function a(c,h){var d=h(),m=r({inst:{value:d,getSnapshot:h}}),p=m[0].inst,g=m[1];return o(function(){p.value=d,p.getSnapshot=h,l(p)&&g({inst:p})},[c,d,h]),i(function(){return l(p)&&g({inst:p}),c(function(){l(p)&&g({inst:p})})},[c]),s(d),d}function l(c){var h=c.getSnapshot;c=c.value;try{var d=h();return!n(c,d)}catch{return!0}}function u(c,h){return h()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return La.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,La}var Fa={};/**
|
|
248
258
|
* @license React
|
|
249
259
|
* use-sync-external-store-shim.development.js
|
|
250
260
|
*
|
|
@@ -252,7 +262,7 @@ Please start a new conversation.`,Zi={ResourceNotFound:{type:"configuration",mes
|
|
|
252
262
|
*
|
|
253
263
|
* This source code is licensed under the MIT license found in the
|
|
254
264
|
* LICENSE file in the root directory of this source tree.
|
|
255
|
-
*/var
|
|
265
|
+
*/var gp;function yT(){return gp||(gp=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=D,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(w){{for(var E=arguments.length,S=new Array(E>1?E-1:0),C=1;C<E;C++)S[C-1]=arguments[C];r("error",w,S)}}function r(w,E,S){{var C=t.ReactDebugCurrentFrame,I=C.getStackAddendum();I!==""&&(E+="%s",S=S.concat([I]));var M=S.map(function(P){return String(P)});M.unshift("Warning: "+E),Function.prototype.apply.call(console[w],console,M)}}function i(w,E){return w===E&&(w!==0||1/w===1/E)||w!==w&&E!==E}var o=typeof Object.is=="function"?Object.is:i,s=e.useState,a=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue,f=!1,c=!1;function h(w,E,S){f||e.startTransition!==void 0&&(f=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var C=E();if(!c){var I=E();o(C,I)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}var M=s({inst:{value:C,getSnapshot:E}}),P=M[0].inst,T=M[1];return l(function(){P.value=C,P.getSnapshot=E,d(P)&&T({inst:P})},[w,C,E]),a(function(){d(P)&&T({inst:P});var O=function(){d(P)&&T({inst:P})};return w(O)},[w]),u(C),C}function d(w){var E=w.getSnapshot,S=w.value;try{var C=E();return!o(S,C)}catch{return!0}}function m(w,E,S){return E()}var p=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",g=!p,y=g?m:h,v=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:y;Fa.useSyncExternalStore=v,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Fa}var yp;function vp(){return yp||(yp=1,process.env.NODE_ENV==="production"?Ji.exports=gT():Ji.exports=yT()),Ji.exports}/**
|
|
256
266
|
* @license React
|
|
257
267
|
* use-sync-external-store-shim/with-selector.production.min.js
|
|
258
268
|
*
|
|
@@ -260,7 +270,7 @@ Please start a new conversation.`,Zi={ResourceNotFound:{type:"configuration",mes
|
|
|
260
270
|
*
|
|
261
271
|
* This source code is licensed under the MIT license found in the
|
|
262
272
|
* LICENSE file in the root directory of this source tree.
|
|
263
|
-
*/var
|
|
273
|
+
*/var bp;function vT(){if(bp)return Pa;bp=1;var e=D,t=vp();function n(u,f){return u===f&&(u!==0||1/u===1/f)||u!==u&&f!==f}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return Pa.useSyncExternalStoreWithSelector=function(u,f,c,h,d){var m=o(null);if(m.current===null){var p={hasValue:!1,value:null};m.current=p}else p=m.current;m=a(function(){function y(C){if(!v){if(v=!0,w=C,C=h(C),d!==void 0&&p.hasValue){var I=p.value;if(d(I,C))return E=I}return E=C}if(I=E,r(w,C))return I;var M=h(C);return d!==void 0&&d(I,M)?I:(w=C,E=M)}var v=!1,w,E,S=c===void 0?null:c;return[function(){return y(f())},S===null?void 0:function(){return y(S())}]},[f,c,h,d]);var g=i(u,m[0],m[1]);return s(function(){p.hasValue=!0,p.value=g},[g]),l(g),g},Pa}var Ra={};/**
|
|
264
274
|
* @license React
|
|
265
275
|
* use-sync-external-store-shim/with-selector.development.js
|
|
266
276
|
*
|
|
@@ -268,94 +278,93 @@ Please start a new conversation.`,Zi={ResourceNotFound:{type:"configuration",mes
|
|
|
268
278
|
*
|
|
269
279
|
* This source code is licensed under the MIT license found in the
|
|
270
280
|
* LICENSE file in the root directory of this source tree.
|
|
271
|
-
*/var
|
|
281
|
+
*/var wp;function bT(){return wp||(wp=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=D,t=vp();function n(f,c){return f===c&&(f!==0||1/f===1/c)||f!==f&&c!==c}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;function u(f,c,h,d,m){var p=o(null),g;p.current===null?(g={hasValue:!1,value:null},p.current=g):g=p.current;var y=a(function(){var S=!1,C,I,M=function(U){if(!S){S=!0,C=U;var F=d(U);if(m!==void 0&&g.hasValue){var L=g.value;if(m(L,F))return I=L,L}return I=F,F}var R=C,N=I;if(r(R,U))return N;var j=d(U);return m!==void 0&&m(N,j)?N:(C=U,I=j,j)},P=h===void 0?null:h,T=function(){return M(c())},O=P===null?void 0:function(){return M(P())};return[T,O]},[c,h,d,m]),v=y[0],w=y[1],E=i(f,v,w);return s(function(){g.hasValue=!0,g.value=E},[E]),l(E),E}Ra.useSyncExternalStoreWithSelector=u,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Ra}process.env.NODE_ENV==="production"?_a.exports=vT():_a.exports=bT();var wT=_a.exports;const ST=vn(wT),Sp={},{useSyncExternalStoreWithSelector:xT}=ST;let xp=!1;function kT(e,t=e.getState,n){(Sp?"production":void 0)!=="production"&&n&&!xp&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),xp=!0);const r=xT(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return D.useDebugValue(r),r}const ET=e=>{(Sp?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?mT(e):e,n=(r,i)=>kT(t,r,i);return Object.assign(n,t),n},ln=e=>ET,Xi={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},$a=new Map,eo=e=>{const t=$a.get(e);return t?Object.fromEntries(Object.entries(t.stores).map(([n,r])=>[n,r.getState()])):{}},CT=(e,t,n)=>{if(e===void 0)return{type:"untracked",connection:t.connect(n)};const r=$a.get(n.name);if(r)return{type:"tracked",store:e,...r};const i={connection:t.connect(n),stores:{}};return $a.set(n.name,i),{type:"tracked",store:e,...i}},Gn=(e,t={})=>(n,r,i)=>{const{enabled:o,anonymousActionType:s,store:a,...l}=t;let u;try{u=(o??(Xi?"production":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!u)return(Xi?"production":void 0)!=="production"&&o&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),e(n,r,i);const{connection:f,...c}=CT(a,u,l);let h=!0;i.setState=(p,g,y)=>{const v=n(p,g);if(!h)return v;const w=y===void 0?{type:s||"anonymous"}:typeof y=="string"?{type:y}:y;return a===void 0?(f==null||f.send(w,r()),v):(f==null||f.send({...w,type:`${a}/${w.type}`},{...eo(l.name),[a]:i.getState()}),v)};const d=(...p)=>{const g=h;h=!1,n(...p),h=g},m=e(i.setState,r,i);if(c.type==="untracked"?f==null||f.init(m):(c.stores[c.store]=i,f==null||f.init(Object.fromEntries(Object.entries(c.stores).map(([p,g])=>[p,p===c.store?m:g.getState()])))),i.dispatchFromDevtools&&typeof i.dispatch=="function"){let p=!1;const g=i.dispatch;i.dispatch=(...y)=>{(Xi?"production":void 0)!=="production"&&y[0].type==="__setState"&&!p&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),p=!0),g(...y)}}return f.subscribe(p=>{var g;switch(p.type){case"ACTION":if(typeof p.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return Ba(p.payload,y=>{if(y.type==="__setState"){if(a===void 0){d(y.state);return}Object.keys(y.state).length!==1&&console.error(`
|
|
272
282
|
[zustand devtools middleware] Unsupported __setState action format.
|
|
273
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(),
|
|
274
284
|
and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }
|
|
275
|
-
`);const v=y.state[s];if(v==null)return;JSON.stringify(i.getState())!==JSON.stringify(v)&&d(v);return}i.dispatchFromDevtools&&typeof i.dispatch=="function"&&i.dispatch(y)});case"DISPATCH":switch(h.payload.type){case"RESET":return d(m),s===void 0?f==null?void 0:f.init(i.getState()):f==null?void 0:f.init(Ur(l.name));case"COMMIT":if(s===void 0){f==null||f.init(i.getState());return}return f==null?void 0:f.init(Ur(l.name));case"ROLLBACK":return Xo(h.state,y=>{if(s===void 0){d(y),f==null||f.init(i.getState());return}d(y[s]),f==null||f.init(Ur(l.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return Xo(h.state,y=>{if(s===void 0){d(y);return}JSON.stringify(i.getState())!==JSON.stringify(y[s])&&d(y[s])});case"IMPORT_STATE":{const{nextLiftedState:y}=h.payload,v=(g=y.computedStates.slice(-1)[0])==null?void 0:g.state;if(!v)return;d(s===void 0?v:v[s]),f==null||f.send(null,y);return}case"PAUSE_RECORDING":return p=!p}return}}),m},Xo=(e,t)=>{let n;try{n=JSON.parse(e)}catch(r){console.error("[zustand devtools middleware] Could not parse the received json",r)}n!==void 0&&t(n)};function ea(e,t){let n;try{n=e()}catch{return}return{getItem:i=>{var o;const a=l=>l===null?null:JSON.parse(l,void 0),s=(o=n.getItem(i))!=null?o:null;return s instanceof Promise?s.then(a):a(s)},setItem:(i,o)=>n.setItem(i,JSON.stringify(o,void 0)),removeItem:i=>n.removeItem(i)}}const qn=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return qn(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return qn(r)(n)}}}},v1=(e,t)=>(n,r,i)=>{let o={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:g=>g,version:0,merge:(g,y)=>({...y,...g}),...t},a=!1;const s=new Set,l=new Set;let u;try{u=o.getStorage()}catch{}if(!u)return e((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...g)},r,i);const f=qn(o.serialize),c=()=>{const g=o.partialize({...r()});let y;const v=f({state:g,version:o.version}).then(w=>u.setItem(o.name,w)).catch(w=>{y=w});if(y)throw y;return v},p=i.setState;i.setState=(g,y)=>{p(g,y),c()};const d=e((...g)=>{n(...g),c()},r,i);let m;const h=()=>{var g;if(!u)return;a=!1,s.forEach(v=>v(r()));const y=((g=o.onRehydrateStorage)==null?void 0:g.call(o,r()))||void 0;return qn(u.getItem.bind(u))(o.name).then(v=>{if(v)return o.deserialize(v)}).then(v=>{if(v)if(typeof v.version=="number"&&v.version!==o.version){if(o.migrate)return o.migrate(v.state,v.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return v.state}).then(v=>{var w;return m=o.merge(v,(w=r())!=null?w:d),n(m,!0),c()}).then(()=>{y==null||y(m,void 0),a=!0,l.forEach(v=>v(m))}).catch(v=>{y==null||y(void 0,v)})};return i.persist={setOptions:g=>{o={...o,...g},g.getStorage&&(u=g.getStorage())},clearStorage:()=>{u==null||u.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>h(),hasHydrated:()=>a,onHydrate:g=>(s.add(g),()=>{s.delete(g)}),onFinishHydration:g=>(l.add(g),()=>{l.delete(g)})},h(),m||d},b1=(e,t)=>(n,r,i)=>{let o={storage:ea(()=>localStorage),partialize:h=>h,version:0,merge:(h,g)=>({...g,...h}),...t},a=!1;const s=new Set,l=new Set;let u=o.storage;if(!u)return e((...h)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...h)},r,i);const f=()=>{const h=o.partialize({...r()});return u.setItem(o.name,{state:h,version:o.version})},c=i.setState;i.setState=(h,g)=>{c(h,g),f()};const p=e((...h)=>{n(...h),f()},r,i);let d;const m=()=>{var h,g;if(!u)return;a=!1,s.forEach(v=>{var w;return v((w=r())!=null?w:p)});const y=((g=o.onRehydrateStorage)==null?void 0:g.call(o,(h=r())!=null?h:p))||void 0;return qn(u.getItem.bind(u))(o.name).then(v=>{if(v)if(typeof v.version=="number"&&v.version!==o.version){if(o.migrate)return o.migrate(v.state,v.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return v.state}).then(v=>{var w;return d=o.merge(v,(w=r())!=null?w:p),n(d,!0),f()}).then(()=>{y==null||y(d,void 0),d=r(),a=!0,l.forEach(v=>v(d))}).catch(v=>{y==null||y(void 0,v)})};return i.persist={setOptions:h=>{o={...o,...h},h.storage&&(u=h.storage)},clearStorage:()=>{u==null||u.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>m(),hasHydrated:()=>a,onHydrate:h=>(s.add(h),()=>{s.delete(h)}),onFinishHydration:h=>(l.add(h),()=>{l.delete(h)})},o.skipHydration||m(),d||p},Hr=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?((jr?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),v1(e,t)):b1(e,t),qc=_t()(Vn(Hr(e=>({messageHistory:[],addMessageToHistory:t=>e(n=>({...n,messageHistory:[t,...(n.messageHistory??[]).slice(0,100).filter(String)]}))}),{name:"botpress-message-history"})));let Wr;const w1=new Uint8Array(16);function x1(){if(!Wr&&(Wr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Wr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Wr(w1)}const $e=[];for(let e=0;e<256;++e)$e.push((e+256).toString(16).slice(1));function k1(e,t=0){return $e[e[t+0]]+$e[e[t+1]]+$e[e[t+2]]+$e[e[t+3]]+"-"+$e[e[t+4]]+$e[e[t+5]]+"-"+$e[e[t+6]]+$e[e[t+7]]+"-"+$e[e[t+8]]+$e[e[t+9]]+"-"+$e[e[t+10]]+$e[e[t+11]]+$e[e[t+12]]+$e[e[t+13]]+$e[e[t+14]]+$e[e[t+15]]}const Kc={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function S1(e,t,n){if(Kc.randomUUID&&!e)return Kc.randomUUID();e=e||{};const r=e.random||(e.rng||x1)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,k1(r)}function Kn(e){var a;const{metadata:t,conversationId:n,userId:r}=e,{payload:i,disableInput:o}=Yc(e.payload);return{id:e.id,conversationId:n,authorId:r,timestamp:new Date(e.createdAt),block:i,feedback:(a=e.feedback)==null?void 0:a.value,disableInput:o,metadata:t}}const Yc=e=>{switch(e.type){case"audio":return Gc(e);case"card":return E1(e);case"carousel":return C1(e);case"choice":return A1(e);case"dropdown":return I1(e);case"file":return Qc(e);case"image":return Jc(e);case"location":return Zc(e);case"markdown":return Xc(e);case"text":return ef(e);case"video":return tf(e);case"bloc":return T1(e);case"custom":return{payload:e};default:{const t=e;throw new Error(`Unsuported message type ${t}`)}}},Yn=e=>({block:e,type:"bubble"}),Gc=e=>({payload:{type:"audio",url:e.audioUrl}}),E1=e=>({payload:Yn(nf(e))}),C1=e=>({payload:{type:"carousel",blocks:e.items.map(t=>nf({...t}))}}),A1=e=>{const t=e.options.map(o=>({title:o.label,value:o.value})),n=e.text,r=S1(),i=Yn({type:"text",text:n});return t.length===0?{disableInput:e.disableFreeText,payload:i}:{disableInput:e.disableFreeText,payload:{type:"column",blocks:[i,{type:"row",blocks:t.map(({title:o,value:a})=>({type:"button",variant:"action",text:o,buttonValue:a,groupId:r}))}]}}},I1=e=>{const t=e.options.map(i=>({label:i.label,value:i.value})),n=e.text,r=[{type:"dropdown",label:n??"Select an option",options:t}];return n&&r.unshift({type:"text",text:n}),{disableInput:!0,payload:Yn({type:"column",blocks:r})}},Qc=e=>({payload:{type:"file",url:e.fileUrl,title:e.title}}),Jc=e=>({payload:{type:"image",url:e.imageUrl}}),Zc=e=>({payload:{type:"location",latitude:e.latitude,longitude:e.longitude,title:e.title??e.address??"View on map"}}),Xc=e=>({payload:Yn({type:"text",text:e.markdown})}),ef=e=>({payload:Yn({type:"text",text:e.text,value:e.value})}),tf=e=>({payload:{type:"video",url:e.videoUrl}}),T1=e=>({payload:{type:"column",blocks:e.items.map(n=>{switch(n.type){case"audio":return Gc({...n.payload,type:n.type}).payload;case"file":return Qc({...n.payload,type:n.type}).payload;case"image":return Jc({...n.payload,type:n.type}).payload;case"location":return Zc({...n.payload,type:n.type}).payload;case"markdown":return Xc({...n.payload,type:n.type}).payload;case"text":return ef({...n.payload,type:n.type}).payload;case"video":return tf({...n.payload,type:n.type}).payload;default:throw new Error("Unsuported message type")}})}}),nf=e=>{const t=e.title,n=e.subtitle,r=e.imageUrl,i=e.actions.map(a=>{switch(a.action){case"postback":return{type:"button",variant:"action",text:a.label,buttonValue:a.value,reusable:!0};case"url":return{type:"button",variant:"link",text:a.label,buttonValue:a.value,reusable:!0};case"say":return{type:"button",variant:"action",text:a.label,buttonValue:a.value,reusable:!0};default:throw new Error(`Unknown action type ${a.action}`)}}),o=[];return r&&o.push({type:"image",url:r}),t&&o.push({type:"text",text:`#### ${t}`}),n&&o.push({type:"text",text:n}),i.length>0&&o.push({type:"row",blocks:i}),{type:"column",horizontalAlignment:"center",blocks:[...o]}},an=_t()(Vn(e=>({messages:[],isFetching:!1,setMessages:t=>e({messages:t}),saveMessage:t=>e(({messages:n})=>{var i;const r=(i=t.metadata)==null?void 0:i.clientMessageId;if(r){const o=n.findIndex(s=>{var l;return((l=s.metadata)==null?void 0:l.clientMessageId)===r}),a=n[o];if(o!==-1)return{messages:[...n.slice(0,o),{...a,...t},...n.slice(o+1)]}}return{messages:[...n.filter(o=>o.id!==t.id),t]}}),updateMessage:(t,n)=>e(({messages:r})=>({messages:r.map(i=>i.id===t?{...i,...n}:i)})),clearMessages:()=>e({messages:[]}),fetchMessages:async({client:t,conversationId:n})=>{const r=[];e({isFetching:!0});try{let i;do{const{messages:o,meta:a}=await t.listConversationMessages({conversationId:n,nextToken:i});r.push(...o),i=a.nextToken}while(i);return r.reverse().map(o=>Kn(o)).filter(Boolean)}finally{e({isFetching:!1})}}}),{name:"messagesStore"})),O1=(e,t)=>_t()(Vn(Hr(n=>({setUser:r=>n(i=>({...i,user:r})),setConversationId:r=>n(i=>({...i,conversationId:r})),clearConversationId:()=>n(r=>({...r,conversationId:void 0})),clearAll:()=>{n(r=>({...r,user:void 0,conversationId:void 0}))}}),{name:e,storage:ea(()=>t==="sessionStorage"?sessionStorage:localStorage)}))),Tn=class Tn{constructor(){}static getInstance(t="bp-webchat",n){return Tn._instances[t]||(Tn._instances[t]=O1(t,n)),Tn._instances[t]}};zi(Tn,"_instances",{});let ta=Tn;const rf=ta.getInstance,sn=_t()(Vn(e=>({eventEmitter:Xs(),messageContainerRef:_.createRef(),setMessageContainerRef:t=>e({messageContainerRef:t}),portalContainer:null,setPortalContainer:t=>e({portalContainer:t})}),{name:"webchatStore"})),D1=8,M1=e=>_t()(Hr((t,n)=>({files:[],setFiles:r=>t({files:r}),upsertFile:r=>t(({files:i})=>({files:i.some(s=>s.name===r.name)?i.map(s=>s.name===r.name?{...s,...r}:s):[...i,{...r}]})),uploadFile:async(r,i)=>{if(n().files.length===D1)return;const o=r.name.lastIndexOf("."),a=o>0&&o<r.name.length-1,s=a?r.name.substring(0,o):r.name,l=a?r.name.substring(o):"",u=Bm(s,n().files,p=>p.name),f=u+l,c=new File([r],f,{type:r.type});n().upsertFile({name:u,type:"file",instance:c,status:"loading"});try{const{fileUrl:p,type:d}=await i(c);n().upsertFile({name:u,type:d,url:p,instance:c,status:"uploaded"})}catch{n().upsertFile({name:u,type:"file",instance:c,status:"error"})}},deleteFile:r=>t(({files:i})=>({files:i.filter(o=>o.name!=r)}))}),{name:e,storage:ea(()=>sessionStorage)})),On=class On{constructor(){}static getInstance(t="bp-composer-file-store"){return On._instances[t]||(On._instances[t]=M1(t)),On._instances[t]}};zi(On,"_instances",{});let na=On;const of=na.getInstance,Gn=_t()(e=>({participants:[],setParticipants:t=>e({participants:t}),addParticipant:t=>e(n=>({participants:[...n.participants,t]})),removeParticipant:t=>e(n=>({participants:n.participants.filter(r=>r.id!==t)})),clearParticipants:()=>e({participants:[]})})),_1=e=>_t()(Vn(Hr((t,n)=>({soundOn:!0,setSoundEnabled:r=>t({soundOn:r}),toggleSound:()=>t({soundOn:!n().soundOn})}),{name:e}))),Dn=class Dn{constructor(){}static getInstance(t="webchat:soundEnabled"){return Dn._instances[t]||(Dn._instances[t]=_1(t)),Dn._instances[t]}};zi(Dn,"_instances",{});let ra=Dn;const af=ra.getInstance,P1=({text:e,buttonValue:t,variant:n,groupId:r,reusable:i,sendMessage:o,isReadOnly:a,...s})=>{const l=sn(w=>w.eventEmitter),[u,f]=_.useState(!1),[c,p]=_.useState(!1),[d,m]=_.useState(!1),{message:{blocks:{button:h}}}=ge;_.useEffect(()=>{if(r)return l.on(`button-group-${r}-click`,()=>{p(!0),i||m(!0)})},[l,r,i]);const y={...s,onClick:w=>{if((d||a)&&n==="link"){w.preventDefault();return}f(!0),i||m(!0),r&&l.emit(`button-group-${r}-click`),n!=="link"&&o&&(o==null||o({type:"text",text:e,value:t}))},"data-activated":u?"":void 0,"data-group-activated":c?"":void 0,"data-type":n,...h},v=d||a;return n==="link"?S.jsx("a",{...y,style:a?{pointerEvents:"none"}:void 0,href:t,target:"_blank",rel:"noopener noreferrer",children:e}):S.jsx("button",{...y,style:a?{pointerEvents:"none"}:void 0,disabled:v,children:e})},ia=_.createContext(null);function sf(){const e=_.useContext(ia);if(!e)throw new Error("useMessageContext must be used within a Message");return e}const oa=_.createContext({showInputModal:void 0});function aa(){return _.useContext(oa)}const lf=_.forwardRef(({block:e,direction:t,sender:n,timestamp:r,messageId:i,feedback:o,metadata:a,isReadOnly:s,sendMessage:l,addMessageFeedback:u,...f},c)=>{const{showInputModal:p}=aa(),{message:{blocks:{bubble:{container:d,feedbackContainer:m,feedbackIcon:h}}}}=ge;return t=="incoming"?S.jsxs("div",{"data-direction":"incoming","data-feedback":!!o,...f,...d,ref:c,children:[S.jsx(Yt,{block:{...e,direction:t,timestamp:r,sender:n,messageId:i,isReadOnly:s,metadata:a,sendMessage:l}}),u&&p&&e.type==="text"&&S.jsxs("div",{...m,children:[S.jsx(X0,{...h,"data-selected":o==="positive",onClick:()=>u(i,{value:"positive"})}),S.jsx(Z0,{...h,"data-selected":o==="negative",onClick:async()=>{const g=await p({title:"Help us improve",description:"Please provide feedback to help us improve.",confirmButtonText:"Send feedback",cancelButtonText:"Cancel",Content:N1});u(i,{value:"negative",comment:g})}})]})]}):S.jsx("div",{"data-direction":"outgoing",...f,...d,ref:c,children:S.jsx(Yt,{block:{...e,direction:t,timestamp:r,sender:n,messageId:i,isReadOnly:s,metadata:a,sendMessage:l,addMessageFeedback:u}})})});lf.displayName="Bubble";const N1=({setValue:e})=>{const{modal:{dialog:{content:t}}}=ge;return S.jsx("textarea",{...t.textarea,placeholder:"Let us know what went wrong...",onChange:n=>e(n.target.value)})},uf=({className:e,...t})=>S.jsx("div",{"data-slot":"skeleton",className:`bpSkeleton ${e||""}`,...t});uf.displayName="Skeleton";var ot=function(){return ot=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},ot.apply(this,arguments)};function cf(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function ln(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(f){try{u(r.next(f))}catch(c){a(c)}}function l(f){try{u(r.throw(f))}catch(c){a(c)}}function u(f){f.done?o(f.value):i(f.value).then(s,l)}u((r=r.apply(e,t||[])).next())})}function un(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(f){return l([u,f])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1],o=u;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(u);break}o[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(f){u=[6,f],i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function ff(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function sa(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;function L1(){var e=_.useRef(!1),t=_.useCallback(function(){return e.current},[]);return _.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),t}function F1(e,t,n){t===void 0&&(t=[]),n===void 0&&(n={loading:!1});var r=_.useRef(0),i=L1(),o=_.useState(n),a=o[0],s=o[1],l=_.useCallback(function(){for(var u=[],f=0;f<arguments.length;f++)u[f]=arguments[f];var c=++r.current;return a.loading||s(function(p){return ot(ot({},p),{loading:!0})}),e.apply(void 0,u).then(function(p){return i()&&c===r.current&&s({value:p,loading:!1}),p},function(p){return i()&&c===r.current&&s({error:p,loading:!1}),p})},t);return[a,l]}function R1(e,t){t===void 0&&(t=[]);var n=F1(e,t,{loading:!0}),r=n[0],i=n[1];return _.useEffect(function(){i()},[i]),r}const df=_.forwardRef(({url:e,type:t,orientation:n="auto",...r},i)=>{const o=_.useId(),{setIsLoading:a}=sf(),[s,l]=_.useState(n==="auto"?"square":n),[u,f]=_.useState("initial"),{message:{blocks:{image:c}}}=ge;return _.useLayoutEffect(()=>(a(p=>[...p,o]),()=>{a(p=>p.filter(d=>d!==o))}),[o,a]),R1(async()=>{if(!e)return;const p=new Image;try{const{width:d,height:m}=await cm(e);n==="auto"&&l(B1(d,m)),p.onload=()=>{f("loaded"),a(h=>h.filter(g=>g!==o))},p.onerror=()=>{f("error"),l("square"),a(h=>h.filter(g=>g!==o))},p.src=e,p.complete&&(p.naturalWidth>0?(f("loaded"),a(h=>h.filter(g=>g!==o))):(f("error"),l("square"),a(h=>h.filter(g=>g!==o))))}catch(d){console.error(d),f("error"),a(m=>m.filter(h=>h!==o))}return()=>{p.onload=null,p.onerror=null}},[e,o,a,n]),e?u==="error"?S.jsx("div",{"data-error":"true","data-orientation":s,...r,...c.image,ref:i,children:S.jsx(Nc,{size:"25%",strokeWidth:"5%"})}):u==="initial"?S.jsx(uf,{"data-orientation":s,...c.placeholder}):S.jsx("img",{"data-orientation":s,"data-loaded":u==="loaded",...r,...c.image,src:e,alt:"",ref:i}):null});df.displayName="Image";function B1(e,t){const n={square:1,portrait:.75,landscape:1.3333333333333333},r=e/t;return Object.keys(n).reduce((o,a)=>Math.abs(n[a]-r)<Math.abs(n[o]-r)?a:o)}const pf=_.forwardRef(({url:e,isReadOnly:t,...n},r)=>{const{message:{blocks:{video:i}}}=ge;return S.jsx("div",{children:S.jsx("video",{...n,"data-chromatic":"ignore",style:t?{pointerEvents:"none"}:void 0,controls:!0,src:e,...i,ref:r})})});pf.displayName="Video";const hf=_.forwardRef(({url:e,isReadOnly:t,...n},r)=>{const{message:{blocks:{audio:i}}}=ge;return S.jsx("div",{children:S.jsx("audio",{...n,controls:!0,style:t?{pointerEvents:"none"}:void 0,src:e,...i,ref:r})})});hf.displayName="Audio";const mf=_.forwardRef(({latitude:e,longitude:t,title:n,isReadOnly:r,...i},o)=>{const a=`https://www.google.com/maps/search/?api=1&query=${e},${t}`,{message:{blocks:{location:s}}}=ge;return S.jsxs("a",{...i,...s.container,style:r?{pointerEvents:"none"}:void 0,href:a,type:"_blank",rel:"noopener",ref:o,children:[S.jsx("p",{...s.title,children:n}),S.jsx(q0,{...s.icon})]})});mf.displayName="Location";const gf=_.forwardRef(({blocks:e,horizontalAlignment:t,verticalAlignment:n,direction:r,sender:i,timestamp:o,messageId:a,isReadOnly:s,sendMessage:l,...u},f)=>{const{message:{blocks:{column:c}}}=ge;return S.jsx("div",{"data-horizontal":t,"data-vertical":n,...u,...c,ref:f,children:e.map((p,d)=>S.jsx(Yt,{block:{...p,direction:r,timestamp:o,sender:i,messageId:a,isReadOnly:s,sendMessage:l}},d))})});gf.displayName="Column";const yf=_.forwardRef(({blocks:e,horizontalAlignment:t,verticalAlignment:n,direction:r,sender:i,timestamp:o,metadata:a,messageId:s,isReadOnly:l,sendMessage:u,...f},c)=>{const{message:{blocks:{row:p}}}=ge;return S.jsx("div",{"data-horizontal":t,"data-vertical":n,...f,...p,ref:c,children:e.map((d,m)=>S.jsx(Yt,{block:{...d,direction:r,timestamp:o,sender:i,messageId:s,isReadOnly:l,sendMessage:u}},m))})});yf.displayName="Row";function z1(e){return Object.prototype.toString.call(e)==="[object Object]"}function vf(e){return z1(e)||Array.isArray(e)}function $1(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function la(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;const i=JSON.stringify(Object.keys(e.breakpoints||{})),o=JSON.stringify(Object.keys(t.breakpoints||{}));return i!==o?!1:n.every(a=>{const s=e[a],l=t[a];return typeof s=="function"?`${s}`==`${l}`:!vf(s)||!vf(l)?s===l:la(s,l)})}function bf(e){return e.concat().sort((t,n)=>t.name>n.name?1:-1).map(t=>t.options)}function j1(e,t){if(e.length!==t.length)return!1;const n=bf(e),r=bf(t);return n.every((i,o)=>{const a=r[o];return la(i,a)})}function ua(e){return typeof e=="number"}function ca(e){return typeof e=="string"}function Vr(e){return typeof e=="boolean"}function wf(e){return Object.prototype.toString.call(e)==="[object Object]"}function Pe(e){return Math.abs(e)}function fa(e){return Math.sign(e)}function Qn(e,t){return Pe(e-t)}function U1(e,t){if(e===0||t===0||Pe(e)<=Pe(t))return 0;const n=Qn(Pe(e),Pe(t));return Pe(n/e)}function H1(e){return Math.round(e*100)/100}function Jn(e){return Xn(e).map(Number)}function ct(e){return e[Zn(e)]}function Zn(e){return Math.max(0,e.length-1)}function da(e,t){return t===Zn(e)}function xf(e,t=0){return Array.from(Array(e),(n,r)=>t+r)}function Xn(e){return Object.keys(e)}function kf(e,t){return[e,t].reduce((n,r)=>(Xn(r).forEach(i=>{const o=n[i],a=r[i],s=wf(o)&&wf(a);n[i]=s?kf(o,a):a}),n),{})}function pa(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function W1(e,t){const n={start:r,center:i,end:o};function r(){return 0}function i(l){return o(l)/2}function o(l){return t-l}function a(l,u){return ca(e)?n[e](l):e(t,l,u)}return{measure:a}}function er(){let e=[];function t(i,o,a,s={passive:!0}){let l;if("addEventListener"in i)i.addEventListener(o,a,s),l=()=>i.removeEventListener(o,a,s);else{const u=i;u.addListener(a),l=()=>u.removeListener(a)}return e.push(l),r}function n(){e=e.filter(i=>i())}const r={add:t,clear:n};return r}function V1(e,t,n,r){const i=er(),o=1e3/60;let a=null,s=0,l=0;function u(){i.add(e,"visibilitychange",()=>{e.hidden&&m()})}function f(){d(),i.clear()}function c(g){if(!l)return;a||(a=g,n(),n());const y=g-a;for(a=g,s+=y;s>=o;)n(),s-=o;const v=s/o;r(v),l&&(l=t.requestAnimationFrame(c))}function p(){l||(l=t.requestAnimationFrame(c))}function d(){t.cancelAnimationFrame(l),a=null,s=0,l=0}function m(){a=null,s=0}return{init:u,destroy:f,start:p,stop:d,update:n,render:r}}function q1(e,t){const n=t==="rtl",r=e==="y",i=r?"y":"x",o=r?"x":"y",a=!r&&n?-1:1,s=f(),l=c();function u(m){const{height:h,width:g}=m;return r?h:g}function f(){return r?"top":n?"right":"left"}function c(){return r?"bottom":n?"left":"right"}function p(m){return m*a}return{scroll:i,cross:o,startEdge:s,endEdge:l,measureSize:u,direction:p}}function qt(e=0,t=0){const n=Pe(e-t);function r(u){return u<e}function i(u){return u>t}function o(u){return r(u)||i(u)}function a(u){return o(u)?r(u)?e:t:u}function s(u){return n?u-n*Math.ceil((u-t)/n):u}return{length:n,max:t,min:e,constrain:a,reachedAny:o,reachedMax:i,reachedMin:r,removeOffset:s}}function Sf(e,t,n){const{constrain:r}=qt(0,e),i=e+1;let o=a(t);function a(p){return n?Pe((i+p)%i):r(p)}function s(){return o}function l(p){return o=a(p),c}function u(p){return f().set(s()+p)}function f(){return Sf(e,s(),n)}const c={get:s,set:l,add:u,clone:f};return c}function K1(e,t,n,r,i,o,a,s,l,u,f,c,p,d,m,h,g,y,v){const{cross:w,direction:A}=e,k=["INPUT","SELECT","TEXTAREA"],C={passive:!1},T=er(),P=er(),F=qt(50,225).constrain(d.measure(20)),I={mouse:300,touch:400},O={mouse:500,touch:600},j=m?43:25;let z=!1,M=0,D=0,B=!1,U=!1,$=!1,V=!1;function b(L){if(!v)return;function ne(ke){(Vr(v)||v(L,ke))&&Y(ke)}const me=t;T.add(me,"dragstart",ke=>ke.preventDefault(),C).add(me,"touchmove",()=>{},C).add(me,"touchend",()=>{}).add(me,"touchstart",ne).add(me,"mousedown",ne).add(me,"touchcancel",X).add(me,"contextmenu",X).add(me,"click",ie,!0)}function N(){T.clear(),P.clear()}function H(){const L=V?n:t;P.add(L,"touchmove",J,C).add(L,"touchend",X).add(L,"mousemove",J,C).add(L,"mouseup",X)}function x(L){const ne=L.nodeName||"";return k.includes(ne)}function W(){return(m?O:I)[V?"mouse":"touch"]}function ee(L,ne){const me=c.add(fa(L)*-1),ke=f.byDistance(L,!m).distance;return m||Pe(L)<F?ke:g&&ne?ke*.5:f.byIndex(me.get(),0).distance}function Y(L){const ne=pa(L,r);V=ne,$=m&&ne&&!L.buttons&&z,z=Qn(i.get(),a.get())>=2,!(ne&&L.button!==0)&&(x(L.target)||(B=!0,o.pointerDown(L),u.useFriction(0).useDuration(0),i.set(a),H(),M=o.readPoint(L),D=o.readPoint(L,w),p.emit("pointerDown")))}function J(L){if(!pa(L,r)&&L.touches.length>=2)return X(L);const me=o.readPoint(L),ke=o.readPoint(L,w),oe=Qn(me,M),G=Qn(ke,D);if(!U&&!V&&(!L.cancelable||(U=oe>G,!U)))return X(L);const ue=o.pointerMove(L);oe>h&&($=!0),u.useFriction(.3).useDuration(.75),s.start(),i.add(A(ue)),L.preventDefault()}function X(L){const me=f.byDistance(0,!1).index!==c.get(),ke=o.pointerUp(L)*W(),oe=ee(A(ke),me),G=U1(ke,oe),ue=j-10*G,de=y+G/50;U=!1,B=!1,P.clear(),u.useDuration(ue).useFriction(de),l.distance(oe,!m),V=!1,p.emit("pointerUp")}function ie(L){$&&(L.stopPropagation(),L.preventDefault(),$=!1)}function K(){return B}return{init:b,destroy:N,pointerDown:K}}function Y1(e,t){let r,i;function o(c){return c.timeStamp}function a(c,p){const m=`client${(p||e.scroll)==="x"?"X":"Y"}`;return(pa(c,t)?c:c.touches[0])[m]}function s(c){return r=c,i=c,a(c)}function l(c){const p=a(c)-a(i),d=o(c)-o(r)>170;return i=c,d&&(r=c),p}function u(c){if(!r||!i)return 0;const p=a(i)-a(r),d=o(c)-o(r),m=o(c)-o(i)>170,h=p/d;return d&&!m&&Pe(h)>.1?h:0}return{pointerDown:s,pointerMove:l,pointerUp:u,readPoint:a}}function G1(){function e(n){const{offsetTop:r,offsetLeft:i,offsetWidth:o,offsetHeight:a}=n;return{top:r,right:i+o,bottom:r+a,left:i,width:o,height:a}}return{measure:e}}function Q1(e){function t(r){return e*(r/100)}return{measure:t}}function J1(e,t,n,r,i,o,a){const s=[e].concat(r);let l,u,f=[],c=!1;function p(g){return i.measureSize(a.measure(g))}function d(g){if(!o)return;u=p(e),f=r.map(p);function y(v){for(const w of v){if(c)return;const A=w.target===e,k=r.indexOf(w.target),C=A?u:f[k],T=p(A?e:r[k]);if(Pe(T-C)>=.5){g.reInit(),t.emit("resize");break}}}l=new ResizeObserver(v=>{(Vr(o)||o(g,v))&&y(v)}),n.requestAnimationFrame(()=>{s.forEach(v=>l.observe(v))})}function m(){c=!0,l&&l.disconnect()}return{init:d,destroy:m}}function Z1(e,t,n,r,i,o){let a=0,s=0,l=i,u=o,f=e.get(),c=0;function p(){const C=r.get()-e.get(),T=!l;let P=0;return T?(a=0,n.set(r),e.set(r),P=C):(n.set(e),a+=C/l,a*=u,f+=a,e.add(a),P=f-c),s=fa(P),c=f,k}function d(){const C=r.get()-t.get();return Pe(C)<.001}function m(){return l}function h(){return s}function g(){return a}function y(){return w(i)}function v(){return A(o)}function w(C){return l=C,k}function A(C){return u=C,k}const k={direction:h,duration:m,velocity:g,seek:p,settled:d,useBaseFriction:v,useBaseDuration:y,useFriction:A,useDuration:w};return k}function X1(e,t,n,r,i){const o=i.measure(10),a=i.measure(50),s=qt(.1,.99);let l=!1;function u(){return!(l||!e.reachedAny(n.get())||!e.reachedAny(t.get()))}function f(d){if(!u())return;const m=e.reachedMin(t.get())?"min":"max",h=Pe(e[m]-t.get()),g=n.get()-t.get(),y=s.constrain(h/a);n.subtract(g*y),!d&&Pe(g)<o&&(n.set(e.constrain(n.get())),r.useDuration(25).useBaseFriction())}function c(d){l=!d}return{shouldConstrain:u,constrain:f,toggleActive:c}}function ek(e,t,n,r,i){const o=qt(-t+e,0),a=c(),s=f(),l=p();function u(m,h){return Qn(m,h)<=1}function f(){const m=a[0],h=ct(a),g=a.lastIndexOf(m),y=a.indexOf(h)+1;return qt(g,y)}function c(){return n.map((m,h)=>{const{min:g,max:y}=o,v=o.constrain(m),w=!h,A=da(n,h);return w?y:A||u(g,v)?g:u(y,v)?y:v}).map(m=>parseFloat(m.toFixed(3)))}function p(){if(t<=e+i)return[o.max];if(r==="keepSnaps")return a;const{min:m,max:h}=s;return a.slice(m,h)}return{snapsContained:l,scrollContainLimit:s}}function tk(e,t,n){const r=t[0],i=n?r-e:ct(t);return{limit:qt(i,r)}}function nk(e,t,n,r){const o=t.min+.1,a=t.max+.1,{reachedMin:s,reachedMax:l}=qt(o,a);function u(p){return p===1?l(n.get()):p===-1?s(n.get()):!1}function f(p){if(!u(p))return;const d=e*(p*-1);r.forEach(m=>m.add(d))}return{loop:f}}function rk(e){const{max:t,length:n}=e;function r(o){const a=o-t;return n?a/-n:0}return{get:r}}function ik(e,t,n,r,i){const{startEdge:o,endEdge:a}=e,{groupSlides:s}=i,l=c().map(t.measure),u=p(),f=d();function c(){return s(r).map(h=>ct(h)[a]-h[0][o]).map(Pe)}function p(){return r.map(h=>n[o]-h[o]).map(h=>-Pe(h))}function d(){return s(u).map(h=>h[0]).map((h,g)=>h+l[g])}return{snaps:u,snapsAligned:f}}function ok(e,t,n,r,i,o){const{groupSlides:a}=i,{min:s,max:l}=r,u=f();function f(){const p=a(o),d=!e||t==="keepSnaps";return n.length===1?[o]:d?p:p.slice(s,l).map((m,h,g)=>{const y=!h,v=da(g,h);if(y){const w=ct(g[0])+1;return xf(w)}if(v){const w=Zn(o)-ct(g)[0]+1;return xf(w,ct(g)[0])}return m})}return{slideRegistry:u}}function ak(e,t,n,r,i){const{reachedAny:o,removeOffset:a,constrain:s}=r;function l(m){return m.concat().sort((h,g)=>Pe(h)-Pe(g))[0]}function u(m){const h=e?a(m):s(m),g=t.map((v,w)=>({diff:f(v-h,0),index:w})).sort((v,w)=>Pe(v.diff)-Pe(w.diff)),{index:y}=g[0];return{index:y,distance:h}}function f(m,h){const g=[m,m+n,m-n];if(!e)return m;if(!h)return l(g);const y=g.filter(v=>fa(v)===h);return y.length?l(y):ct(g)-n}function c(m,h){const g=t[m]-i.get(),y=f(g,h);return{index:m,distance:y}}function p(m,h){const g=i.get()+m,{index:y,distance:v}=u(g),w=!e&&o(g);if(!h||w)return{index:y,distance:m};const A=t[y]-v,k=m+f(A,0);return{index:y,distance:k}}return{byDistance:p,byIndex:c,shortcut:f}}function sk(e,t,n,r,i,o,a){function s(c){const p=c.distance,d=c.index!==t.get();o.add(p),p&&(r.duration()?e.start():(e.update(),e.render(1),e.update())),d&&(n.set(t.get()),t.set(c.index),a.emit("select"))}function l(c,p){const d=i.byDistance(c,p);s(d)}function u(c,p){const d=t.clone().set(c),m=i.byIndex(d.get(),p);s(m)}return{distance:l,index:u}}function lk(e,t,n,r,i,o,a,s){const l={passive:!0,capture:!0};let u=0;function f(d){if(!s)return;function m(h){if(new Date().getTime()-u>10)return;a.emit("slideFocusStart"),e.scrollLeft=0;const v=n.findIndex(w=>w.includes(h));ua(v)&&(i.useDuration(0),r.index(v,0),a.emit("slideFocus"))}o.add(document,"keydown",c,!1),t.forEach((h,g)=>{o.add(h,"focus",y=>{(Vr(s)||s(d,y))&&m(g)},l)})}function c(d){d.code==="Tab"&&(u=new Date().getTime())}return{init:f}}function tr(e){let t=e;function n(){return t}function r(l){t=a(l)}function i(l){t+=a(l)}function o(l){t-=a(l)}function a(l){return ua(l)?l:l.get()}return{get:n,set:r,add:i,subtract:o}}function Ef(e,t){const n=e.scroll==="x"?a:s,r=t.style;let i=null,o=!1;function a(p){return`translate3d(${p}px,0px,0px)`}function s(p){return`translate3d(0px,${p}px,0px)`}function l(p){if(o)return;const d=H1(e.direction(p));d!==i&&(r.transform=n(d),i=d)}function u(p){o=!p}function f(){o||(r.transform="",t.getAttribute("style")||t.removeAttribute("style"))}return{clear:f,to:l,toggleActive:u}}function uk(e,t,n,r,i,o,a,s,l){const f=Jn(i),c=Jn(i).reverse(),p=y().concat(v());function d(T,P){return T.reduce((F,I)=>F-i[I],P)}function m(T,P){return T.reduce((F,I)=>d(F,P)>0?F.concat([I]):F,[])}function h(T){return o.map((P,F)=>({start:P-r[F]+.5+T,end:P+t-.5+T}))}function g(T,P,F){const I=h(P);return T.map(O=>{const j=F?0:-n,z=F?n:0,M=F?"end":"start",D=I[O][M];return{index:O,loopPoint:D,slideLocation:tr(-1),translate:Ef(e,l[O]),target:()=>s.get()>D?j:z}})}function y(){const T=a[0],P=m(c,T);return g(P,n,!1)}function v(){const T=t-a[0]-1,P=m(f,T);return g(P,-n,!0)}function w(){return p.every(({index:T})=>{const P=f.filter(F=>F!==T);return d(P,t)<=.1})}function A(){p.forEach(T=>{const{target:P,translate:F,slideLocation:I}=T,O=P();O!==I.get()&&(F.to(O),I.set(O))})}function k(){p.forEach(T=>T.translate.clear())}return{canLoop:w,clear:k,loop:A,loopPoints:p}}function ck(e,t,n){let r,i=!1;function o(l){if(!n)return;function u(f){for(const c of f)if(c.type==="childList"){l.reInit(),t.emit("slidesChanged");break}}r=new MutationObserver(f=>{i||(Vr(n)||n(l,f))&&u(f)}),r.observe(e,{childList:!0})}function a(){r&&r.disconnect(),i=!0}return{init:o,destroy:a}}function fk(e,t,n,r){const i={};let o=null,a=null,s,l=!1;function u(){s=new IntersectionObserver(m=>{l||(m.forEach(h=>{const g=t.indexOf(h.target);i[g]=h}),o=null,a=null,n.emit("slidesInView"))},{root:e.parentElement,threshold:r}),t.forEach(m=>s.observe(m))}function f(){s&&s.disconnect(),l=!0}function c(m){return Xn(i).reduce((h,g)=>{const y=parseInt(g),{isIntersecting:v}=i[y];return(m&&v||!m&&!v)&&h.push(y),h},[])}function p(m=!0){if(m&&o)return o;if(!m&&a)return a;const h=c(m);return m&&(o=h),m||(a=h),h}return{init:u,destroy:f,get:p}}function dk(e,t,n,r,i,o){const{measureSize:a,startEdge:s,endEdge:l}=e,u=n[0]&&i,f=m(),c=h(),p=n.map(a),d=g();function m(){if(!u)return 0;const v=n[0];return Pe(t[s]-v[s])}function h(){if(!u)return 0;const v=o.getComputedStyle(ct(r));return parseFloat(v.getPropertyValue(`margin-${l}`))}function g(){return n.map((v,w,A)=>{const k=!w,C=da(A,w);return k?p[w]+f:C?p[w]+c:A[w+1][s]-v[s]}).map(Pe)}return{slideSizes:p,slideSizesWithGaps:d,startGap:f,endGap:c}}function pk(e,t,n,r,i,o,a,s,l){const{startEdge:u,endEdge:f,direction:c}=e,p=ua(n);function d(y,v){return Jn(y).filter(w=>w%v===0).map(w=>y.slice(w,w+v))}function m(y){return y.length?Jn(y).reduce((v,w,A)=>{const k=ct(v)||0,C=k===0,T=w===Zn(y),P=i[u]-o[k][u],F=i[u]-o[w][f],I=!r&&C?c(a):0,O=!r&&T?c(s):0,j=Pe(F-O-(P+I));return A&&j>t+l&&v.push(w),T&&v.push(y.length),v},[]).map((v,w,A)=>{const k=Math.max(A[w-1]||0);return y.slice(k,v)}):[]}function h(y){return p?d(y,n):m(y)}return{groupSlides:h}}function hk(e,t,n,r,i,o,a){const{align:s,axis:l,direction:u,startIndex:f,loop:c,duration:p,dragFree:d,dragThreshold:m,inViewThreshold:h,slidesToScroll:g,skipSnaps:y,containScroll:v,watchResize:w,watchSlides:A,watchDrag:k,watchFocus:C}=o,T=2,P=G1(),F=P.measure(t),I=n.map(P.measure),O=q1(l,u),j=O.measureSize(F),z=Q1(j),M=W1(s,j),D=!c&&!!v,B=c||!!v,{slideSizes:U,slideSizesWithGaps:$,startGap:V,endGap:b}=dk(O,F,I,n,B,i),N=pk(O,j,g,c,F,I,V,b,T),{snaps:H,snapsAligned:x}=ik(O,M,F,I,N),W=-ct(H)+ct($),{snapsContained:ee,scrollContainLimit:Y}=ek(j,W,x,v,T),J=D?ee:x,{limit:X}=tk(W,J,c),ie=Sf(Zn(J),f,c),K=ie.clone(),te=Jn(n),L=({dragHandler:pe,scrollBody:fe,scrollBounds:Ee,options:{loop:Oe}})=>{Oe||Ee.constrain(pe.pointerDown()),fe.seek()},ne=({scrollBody:pe,translate:fe,location:Ee,offsetLocation:Oe,previousLocation:st,scrollLooper:gt,slideLooper:ze,dragHandler:lt,animation:Ge,eventHandler:Bi,scrollBounds:PT,options:{loop:$h}},jh)=>{const Uh=pe.settled(),NT=!PT.shouldConstrain(),Hh=$h?Uh:Uh&&NT,Wh=Hh&&!lt.pointerDown();Wh&&Ge.stop();const LT=Ee.get()*jh+st.get()*(1-jh);Oe.set(LT),$h&&(gt.loop(pe.direction()),ze.loop()),fe.to(Oe.get()),Wh&&Bi.emit("settle"),Hh||Bi.emit("scroll")},me=V1(r,i,()=>L(le),pe=>ne(le,pe)),ke=.68,oe=J[ie.get()],G=tr(oe),ue=tr(oe),de=tr(oe),we=tr(oe),Se=Z1(G,de,ue,we,p,ke),Ue=ak(c,J,W,X,we),Ye=sk(me,ie,K,Se,Ue,we,a),Z=rk(X),se=er(),R=fk(t,n,a,h),{slideRegistry:q}=ok(D,v,J,Y,N,te),ae=lk(e,n,q,Ye,Se,se,a,C),le={ownerDocument:r,ownerWindow:i,eventHandler:a,containerRect:F,slideRects:I,animation:me,axis:O,dragHandler:K1(O,e,r,i,we,Y1(O,i),G,me,Ye,Se,Ue,ie,a,z,d,m,y,ke,k),eventStore:se,percentOfView:z,index:ie,indexPrevious:K,limit:X,location:G,offsetLocation:de,previousLocation:ue,options:o,resizeHandler:J1(t,a,i,n,O,w,P),scrollBody:Se,scrollBounds:X1(X,de,we,Se,z),scrollLooper:nk(W,X,de,[G,de,ue,we]),scrollProgress:Z,scrollSnapList:J.map(Z.get),scrollSnaps:J,scrollTarget:Ue,scrollTo:Ye,slideLooper:uk(O,j,W,U,$,H,J,de,n),slideFocus:ae,slidesHandler:ck(t,a,A),slidesInView:R,slideIndexes:te,slideRegistry:q,slidesToScroll:N,target:we,translate:Ef(O,t)};return le}function mk(){let e={},t;function n(u){t=u}function r(u){return e[u]||[]}function i(u){return r(u).forEach(f=>f(t,u)),l}function o(u,f){return e[u]=r(u).concat([f]),l}function a(u,f){return e[u]=r(u).filter(c=>c!==f),l}function s(){e={}}const l={init:n,emit:i,off:a,on:o,clear:s};return l}const gk={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function yk(e){function t(o,a){return kf(o,a||{})}function n(o){const a=o.breakpoints||{},s=Xn(a).filter(l=>e.matchMedia(l).matches).map(l=>a[l]).reduce((l,u)=>t(l,u),{});return t(o,s)}function r(o){return o.map(a=>Xn(a.breakpoints||{})).reduce((a,s)=>a.concat(s),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:n,optionsMediaQueries:r}}function vk(e){let t=[];function n(o,a){return t=a.filter(({options:s})=>e.optionsAtMedia(s).active!==!1),t.forEach(s=>s.init(o,e)),a.reduce((s,l)=>Object.assign(s,{[l.name]:l}),{})}function r(){t=t.filter(o=>o.destroy())}return{init:n,destroy:r}}function qr(e,t,n){const r=e.ownerDocument,i=r.defaultView,o=yk(i),a=vk(o),s=er(),l=mk(),{mergeOptions:u,optionsAtMedia:f,optionsMediaQueries:c}=o,{on:p,off:d,emit:m}=l,h=O;let g=!1,y,v=u(gk,qr.globalOptions),w=u(v),A=[],k,C,T;function P(){const{container:te,slides:L}=w;C=(ca(te)?e.querySelector(te):te)||e.children[0];const me=ca(L)?C.querySelectorAll(L):L;T=[].slice.call(me||C.children)}function F(te){const L=hk(e,C,T,r,i,te,l);if(te.loop&&!L.slideLooper.canLoop()){const ne=Object.assign({},te,{loop:!1});return F(ne)}return L}function I(te,L){g||(v=u(v,te),w=f(v),A=L||A,P(),y=F(w),c([v,...A.map(({options:ne})=>ne)]).forEach(ne=>s.add(ne,"change",O)),w.active&&(y.translate.to(y.location.get()),y.animation.init(),y.slidesInView.init(),y.slideFocus.init(K),y.eventHandler.init(K),y.resizeHandler.init(K),y.slidesHandler.init(K),y.options.loop&&y.slideLooper.loop(),C.offsetParent&&T.length&&y.dragHandler.init(K),k=a.init(K,A)))}function O(te,L){const ne=N();j(),I(u({startIndex:ne},te),L),l.emit("reInit")}function j(){y.dragHandler.destroy(),y.eventStore.clear(),y.translate.clear(),y.slideLooper.clear(),y.resizeHandler.destroy(),y.slidesHandler.destroy(),y.slidesInView.destroy(),y.animation.destroy(),a.destroy(),s.clear()}function z(){g||(g=!0,s.clear(),j(),l.emit("destroy"),l.clear())}function M(te,L,ne){!w.active||g||(y.scrollBody.useBaseFriction().useDuration(L===!0?0:w.duration),y.scrollTo.index(te,ne||0))}function D(te){const L=y.index.add(1).get();M(L,te,-1)}function B(te){const L=y.index.add(-1).get();M(L,te,1)}function U(){return y.index.add(1).get()!==N()}function $(){return y.index.add(-1).get()!==N()}function V(){return y.scrollSnapList}function b(){return y.scrollProgress.get(y.offsetLocation.get())}function N(){return y.index.get()}function H(){return y.indexPrevious.get()}function x(){return y.slidesInView.get()}function W(){return y.slidesInView.get(!1)}function ee(){return k}function Y(){return y}function J(){return e}function X(){return C}function ie(){return T}const K={canScrollNext:U,canScrollPrev:$,containerNode:X,internalEngine:Y,destroy:z,off:d,on:p,emit:m,plugins:ee,previousScrollSnap:H,reInit:h,rootNode:J,scrollNext:D,scrollPrev:B,scrollProgress:b,scrollSnapList:V,scrollTo:M,selectedScrollSnap:N,slideNodes:ie,slidesInView:x,slidesNotInView:W};return I(t,n),setTimeout(()=>l.emit("init"),0),K}qr.globalOptions=void 0;function ha(e={},t=[]){const n=_.useRef(e),r=_.useRef(t),[i,o]=_.useState(),[a,s]=_.useState(),l=_.useCallback(()=>{i&&i.reInit(n.current,r.current)},[i]);return _.useEffect(()=>{la(n.current,e)||(n.current=e,l())},[e,l]),_.useEffect(()=>{j1(r.current,t)||(r.current=t,l())},[t,l]),_.useEffect(()=>{if($1()&&a){qr.globalOptions=ha.globalOptions;const u=qr(a,n.current,r.current);return o(u),()=>u.destroy()}else o(void 0)},[a,o]),[s,i]}ha.globalOptions=void 0;const Cf=_.forwardRef(({blocks:e,direction:t,sender:n,timestamp:r,messageId:i,isReadOnly:o,sendMessage:a},s)=>{const[l,u]=ha({skipSnaps:!0,loop:!0}),[f,c]=_.useState(!0),[p,d]=_.useState(!0),m=_.useCallback(()=>u==null?void 0:u.scrollPrev(),[u]),h=_.useCallback(()=>u==null?void 0:u.scrollNext(),[u]),{message:{blocks:{carousel:g}}}=ge,y=_.useCallback(v=>{c(!(v!=null&&v.canScrollPrev())),d(!(v!=null&&v.canScrollNext()))},[]);return _.useEffect(()=>{u&&(y(u),u.on("reInit",y),u.on("select",y))},[u,y]),S.jsxs("div",{...g==null?void 0:g.container,"data-container":"carousel",ref:l,children:[S.jsx("div",{ref:s,...g==null?void 0:g.slidesContainer,children:e.map((v,w)=>S.jsx(Yt,{block:{...v,direction:t,timestamp:r,sender:n,messageId:i,sendMessage:a,isReadOnly:o}},w))}),e.length>1&&S.jsxs(S.Fragment,{children:[S.jsx(N0,{...g==null?void 0:g.backButton,"data-disabled":f?"":void 0,onClick:m}),S.jsx(L0,{...g==null?void 0:g.nextButton,"data-disabled":p?"":void 0,onClick:h})]})]})});Cf.displayName="Carousel";const Af=Math.floor;function If(e){return Tf(e)?(e.nodeName||"").toLowerCase():"#document"}function nr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function bk(e){var t;return(t=(Tf(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Tf(e){return e instanceof Node||e instanceof nr(e).Node}function at(e){return e instanceof Element||e instanceof nr(e).Element}function cn(e){return e instanceof HTMLElement||e instanceof nr(e).HTMLElement}function ma(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof nr(e).ShadowRoot}function wk(e){return["html","body","#document"].includes(If(e))}function xk(e){return nr(e).getComputedStyle(e)}function kk(e){if(If(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ma(e)&&e.host||bk(e);return ma(t)?t.host:t}function Pt(e){let t=e.activeElement;for(;((n=t)==null||(r=n.shadowRoot)==null?void 0:r.activeElement)!=null;){var n,r;t=t.shadowRoot.activeElement}return t}function Ze(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&ma(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Of(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Sk(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function Df(e){if(e.mozInputSource===0&&e.isTrusted)return!0;const t=/Android/i;return(t.test(Of())||t.test(Sk()))&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Mf(e){return e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType!=="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0}function _f(){return/apple/i.test(navigator.vendor)}function Ek(){return Of().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Pf(e,t){return["mouse","pen"].includes(e)}function Ck(e){return"nativeEvent"in e}function Ak(e){return e.matches("html,body")}function ft(e){return(e==null?void 0:e.ownerDocument)||document}function ga(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Nf(e){return"composedPath"in e?e.composedPath()[0]:e.target}const Ik="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Lf(e){return cn(e)&&e.matches(Ik)}function je(e){e.preventDefault(),e.stopPropagation()}const fn=Math.min,nt=Math.max,Kr=Math.round,Yr=Math.floor,bt=e=>({x:e,y:e});function Ff(e,t,n){return nt(e,fn(t,n))}function Gr(e,t){return typeof e=="function"?e(t):e}function rr(e){return e.split("-")[0]}function ya(e){return e.split("-")[1]}function Rf(e){return e==="x"?"y":"x"}function Tk(e){return e==="y"?"height":"width"}const Ok=new Set(["top","bottom"]);function ir(e){return Ok.has(rr(e))?"y":"x"}function Dk(e){return Rf(ir(e))}function Mk(e){return{top:0,right:0,bottom:0,left:0,...e}}function _k(e){return typeof e!="number"?Mk(e):{top:e,right:e,bottom:e,left:e}}function Qr(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Bf(e,t,n){let{reference:r,floating:i}=e;const o=ir(t),a=Dk(t),s=Tk(a),l=rr(t),u=o==="y",f=r.x+r.width/2-i.width/2,c=r.y+r.height/2-i.height/2,p=r[s]/2-i[s]/2;let d;switch(l){case"top":d={x:f,y:r.y-i.height};break;case"bottom":d={x:f,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:c};break;case"left":d={x:r.x-i.width,y:c};break;default:d={x:r.x,y:r.y}}switch(ya(t)){case"start":d[a]-=p*(n&&u?-1:1);break;case"end":d[a]+=p*(n&&u?-1:1);break}return d}const Pk=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=o.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:f,y:c}=Bf(u,r,l),p=r,d={},m=0;for(let h=0;h<s.length;h++){const{name:g,fn:y}=s[h],{x:v,y:w,data:A,reset:k}=await y({x:f,y:c,initialPlacement:r,placement:p,strategy:i,middlewareData:d,rects:u,platform:a,elements:{reference:e,floating:t}});f=v??f,c=w??c,d={...d,[g]:{...d[g],...A}},k&&m<=50&&(m++,typeof k=="object"&&(k.placement&&(p=k.placement),k.rects&&(u=k.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):k.rects),{x:f,y:c}=Bf(u,p,l)),h=-1)}return{x:f,y:c,placement:p,strategy:i,middlewareData:d}};async function zf(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:s,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:c="floating",altBoundary:p=!1,padding:d=0}=Gr(t,e),m=_k(d),g=s[p?c==="floating"?"reference":"floating":c],y=Qr(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(g)))==null||n?g:g.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(s.floating)),boundary:u,rootBoundary:f,strategy:l})),v=c==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,w=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),A=await(o.isElement==null?void 0:o.isElement(w))?await(o.getScale==null?void 0:o.getScale(w))||{x:1,y:1}:{x:1,y:1},k=Qr(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:w,strategy:l}):v);return{top:(y.top-k.top+m.top)/A.y,bottom:(k.bottom-y.bottom+m.bottom)/A.y,left:(y.left-k.left+m.left)/A.x,right:(k.right-y.right+m.right)/A.x}}const Nk=new Set(["left","top"]);async function Lk(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=rr(n),s=ya(n),l=ir(n)==="y",u=Nk.has(a)?-1:1,f=o&&l?-1:1,c=Gr(t,e);let{mainAxis:p,crossAxis:d,alignmentAxis:m}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:c.mainAxis||0,crossAxis:c.crossAxis||0,alignmentAxis:c.alignmentAxis};return s&&typeof m=="number"&&(d=s==="end"?m*-1:m),l?{x:d*f,y:p*u}:{x:p*u,y:d*f}}const Fk=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:a,middlewareData:s}=t,l=await Lk(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:a}}}}},Rk=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:g=>{let{x:y,y:v}=g;return{x:y,y:v}}},...l}=Gr(e,t),u={x:n,y:r},f=await zf(t,l),c=ir(rr(i)),p=Rf(c);let d=u[p],m=u[c];if(o){const g=p==="y"?"top":"left",y=p==="y"?"bottom":"right",v=d+f[g],w=d-f[y];d=Ff(v,d,w)}if(a){const g=c==="y"?"top":"left",y=c==="y"?"bottom":"right",v=m+f[g],w=m-f[y];m=Ff(v,m,w)}const h=s.fn({...t,[p]:d,[c]:m});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[p]:o,[c]:a}}}}}},Bk=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:a,elements:s}=t,{apply:l=()=>{},...u}=Gr(e,t),f=await zf(t,u),c=rr(i),p=ya(i),d=ir(i)==="y",{width:m,height:h}=o.floating;let g,y;c==="top"||c==="bottom"?(g=c,y=p===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(y=c,g=p==="end"?"top":"bottom");const v=h-f.top-f.bottom,w=m-f.left-f.right,A=fn(h-f[g],v),k=fn(m-f[y],w),C=!t.middlewareData.shift;let T=A,P=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=v),C&&!p){const I=nt(f.left,0),O=nt(f.right,0),j=nt(f.top,0),z=nt(f.bottom,0);d?P=m-2*(I!==0||O!==0?I+O:nt(f.left,f.right)):T=h-2*(j!==0||z!==0?j+z:nt(f.top,f.bottom))}await l({...t,availableWidth:P,availableHeight:T});const F=await a.getDimensions(s.floating);return m!==F.width||h!==F.height?{reset:{rects:!0}}:{}}}};function Jr(){return typeof window<"u"}function dn(e){return $f(e)?(e.nodeName||"").toLowerCase():"#document"}function rt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function wt(e){var t;return(t=($f(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function $f(e){return Jr()?e instanceof Node||e instanceof rt(e).Node:!1}function dt(e){return Jr()?e instanceof Element||e instanceof rt(e).Element:!1}function xt(e){return Jr()?e instanceof HTMLElement||e instanceof rt(e).HTMLElement:!1}function jf(e){return!Jr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof rt(e).ShadowRoot}const zk=new Set(["inline","contents"]);function or(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=pt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!zk.has(i)}const $k=new Set(["table","td","th"]);function jk(e){return $k.has(dn(e))}const Uk=[":popover-open",":modal"];function Zr(e){return Uk.some(t=>{try{return e.matches(t)}catch{return!1}})}const Hk=["transform","translate","scale","rotate","perspective"],Wk=["transform","translate","scale","rotate","perspective","filter"],Vk=["paint","layout","strict","content"];function va(e){const t=ba(),n=dt(e)?pt(e):e;return Hk.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Wk.some(r=>(n.willChange||"").includes(r))||Vk.some(r=>(n.contain||"").includes(r))}function qk(e){let t=Nt(e);for(;xt(t)&&!pn(t);){if(va(t))return t;if(Zr(t))return null;t=Nt(t)}return null}function ba(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Kk=new Set(["html","body","#document"]);function pn(e){return Kk.has(dn(e))}function pt(e){return rt(e).getComputedStyle(e)}function Xr(e){return dt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Nt(e){if(dn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||jf(e)&&e.host||wt(e);return jf(t)?t.host:t}function Uf(e){const t=Nt(e);return pn(t)?e.ownerDocument?e.ownerDocument.body:e.body:xt(t)&&or(t)?t:Uf(t)}function Lt(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Uf(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=rt(i);if(o){const s=wa(a);return t.concat(a,a.visualViewport||[],or(i)?i:[],s&&n?Lt(s):[])}return t.concat(i,Lt(i,[],n))}function wa(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Hf(e){const t=pt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=xt(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,s=Kr(n)!==o||Kr(r)!==a;return s&&(n=o,r=a),{width:n,height:r,$:s}}function xa(e){return dt(e)?e:e.contextElement}function hn(e){const t=xa(e);if(!xt(t))return bt(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=Hf(t);let a=(o?Kr(n.width):n.width)/r,s=(o?Kr(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const Yk=bt(0);function Wf(e){const t=rt(e);return!ba()||!t.visualViewport?Yk:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Gk(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==rt(e)?!1:t}function Kt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=xa(e);let a=bt(1);t&&(r?dt(r)&&(a=hn(r)):a=hn(e));const s=Gk(o,n,r)?Wf(o):bt(0);let l=(i.left+s.x)/a.x,u=(i.top+s.y)/a.y,f=i.width/a.x,c=i.height/a.y;if(o){const p=rt(o),d=r&&dt(r)?rt(r):r;let m=p,h=wa(m);for(;h&&r&&d!==m;){const g=hn(h),y=h.getBoundingClientRect(),v=pt(h),w=y.left+(h.clientLeft+parseFloat(v.paddingLeft))*g.x,A=y.top+(h.clientTop+parseFloat(v.paddingTop))*g.y;l*=g.x,u*=g.y,f*=g.x,c*=g.y,l+=w,u+=A,m=rt(h),h=wa(m)}}return Qr({width:f,height:c,x:l,y:u})}function ei(e,t){const n=Xr(e).scrollLeft;return t?t.left+n:Kt(wt(e)).left+n}function Vf(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-ei(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function Qk(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",a=wt(r),s=t?Zr(t.floating):!1;if(r===a||s&&o)return n;let l={scrollLeft:0,scrollTop:0},u=bt(1);const f=bt(0),c=xt(r);if((c||!c&&!o)&&((dn(r)!=="body"||or(a))&&(l=Xr(r)),xt(r))){const d=Kt(r);u=hn(r),f.x=d.x+r.clientLeft,f.y=d.y+r.clientTop}const p=a&&!c&&!o?Vf(a,l):bt(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+f.x+p.x,y:n.y*u.y-l.scrollTop*u.y+f.y+p.y}}function Jk(e){return Array.from(e.getClientRects())}function Zk(e){const t=wt(e),n=Xr(e),r=e.ownerDocument.body,i=nt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=nt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+ei(e);const s=-n.scrollTop;return pt(r).direction==="rtl"&&(a+=nt(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:s}}const qf=25;function Xk(e,t){const n=rt(e),r=wt(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;const f=ba();(!f||f&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}const u=ei(r);if(u<=0){const f=r.ownerDocument,c=f.body,p=getComputedStyle(c),d=f.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,m=Math.abs(r.clientWidth-c.clientWidth-d);m<=qf&&(o-=m)}else u<=qf&&(o+=u);return{width:o,height:a,x:s,y:l}}const eS=new Set(["absolute","fixed"]);function tS(e,t){const n=Kt(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=xt(e)?hn(e):bt(1),a=e.clientWidth*o.x,s=e.clientHeight*o.y,l=i*o.x,u=r*o.y;return{width:a,height:s,x:l,y:u}}function Kf(e,t,n){let r;if(t==="viewport")r=Xk(e,n);else if(t==="document")r=Zk(wt(e));else if(dt(t))r=tS(t,n);else{const i=Wf(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Qr(r)}function Yf(e,t){const n=Nt(e);return n===t||!dt(n)||pn(n)?!1:pt(n).position==="fixed"||Yf(n,t)}function nS(e,t){const n=t.get(e);if(n)return n;let r=Lt(e,[],!1).filter(s=>dt(s)&&dn(s)!=="body"),i=null;const o=pt(e).position==="fixed";let a=o?Nt(e):e;for(;dt(a)&&!pn(a);){const s=pt(a),l=va(a);!l&&s.position==="fixed"&&(i=null),(o?!l&&!i:!l&&s.position==="static"&&!!i&&eS.has(i.position)||or(a)&&!l&&Yf(e,a))?r=r.filter(f=>f!==a):i=s,a=Nt(a)}return t.set(e,r),r}function rS(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?Zr(t)?[]:nS(t,this._c):[].concat(n),r],s=a[0],l=a.reduce((u,f)=>{const c=Kf(t,f,i);return u.top=nt(c.top,u.top),u.right=fn(c.right,u.right),u.bottom=fn(c.bottom,u.bottom),u.left=nt(c.left,u.left),u},Kf(t,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function iS(e){const{width:t,height:n}=Hf(e);return{width:t,height:n}}function oS(e,t,n){const r=xt(t),i=wt(t),o=n==="fixed",a=Kt(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const l=bt(0);function u(){l.x=ei(i)}if(r||!r&&!o)if((dn(t)!=="body"||or(i))&&(s=Xr(t)),r){const d=Kt(t,!0,o,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else i&&u();o&&!r&&i&&u();const f=i&&!r&&!o?Vf(i,s):bt(0),c=a.left+s.scrollLeft-l.x-f.x,p=a.top+s.scrollTop-l.y-f.y;return{x:c,y:p,width:a.width,height:a.height}}function ka(e){return pt(e).position==="static"}function Gf(e,t){if(!xt(e)||pt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return wt(e)===n&&(n=n.ownerDocument.body),n}function Qf(e,t){const n=rt(e);if(Zr(e))return n;if(!xt(e)){let i=Nt(e);for(;i&&!pn(i);){if(dt(i)&&!ka(i))return i;i=Nt(i)}return n}let r=Gf(e,t);for(;r&&jk(r)&&ka(r);)r=Gf(r,t);return r&&pn(r)&&ka(r)&&!va(r)?n:r||qk(e)||n}const aS=async function(e){const t=this.getOffsetParent||Qf,n=this.getDimensions,r=await n(e.floating);return{reference:oS(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function sS(e){return pt(e).direction==="rtl"}const lS={convertOffsetParentRelativeRectToViewportRelativeRect:Qk,getDocumentElement:wt,getClippingRect:rS,getOffsetParent:Qf,getElementRects:aS,getClientRects:Jk,getDimensions:iS,getScale:hn,isElement:dt,isRTL:sS};function Jf(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function uS(e,t){let n=null,r;const i=wt(e);function o(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),o();const u=e.getBoundingClientRect(),{left:f,top:c,width:p,height:d}=u;if(s||t(),!p||!d)return;const m=Yr(c),h=Yr(i.clientWidth-(f+p)),g=Yr(i.clientHeight-(c+d)),y=Yr(f),w={rootMargin:-m+"px "+-h+"px "+-g+"px "+-y+"px",threshold:nt(0,fn(1,l))||1};let A=!0;function k(C){const T=C[0].intersectionRatio;if(T!==l){if(!A)return a();T?a(!1,T):r=setTimeout(()=>{a(!1,1e-7)},1e3)}T===1&&!Jf(u,e.getBoundingClientRect())&&a(),A=!1}try{n=new IntersectionObserver(k,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(k,w)}n.observe(e)}return a(!0),o}function cS(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=xa(e),f=i||o?[...u?Lt(u):[],...Lt(t)]:[];f.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),o&&y.addEventListener("resize",n)});const c=u&&s?uS(u,n):null;let p=-1,d=null;a&&(d=new ResizeObserver(y=>{let[v]=y;v&&v.target===u&&d&&(d.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var w;(w=d)==null||w.observe(t)})),n()}),u&&!l&&d.observe(u),d.observe(t));let m,h=l?Kt(e):null;l&&g();function g(){const y=Kt(e);h&&!Jf(h,y)&&n(),h=y,m=requestAnimationFrame(g)}return n(),()=>{var y;f.forEach(v=>{i&&v.removeEventListener("scroll",n),o&&v.removeEventListener("resize",n)}),c==null||c(),(y=d)==null||y.disconnect(),d=null,l&&cancelAnimationFrame(m)}}const fS=Fk,dS=Rk,pS=Bk,hS=(e,t,n)=>{const r=new Map,i={platform:lS,...n},o={...i.platform,_c:r};return Pk(e,t,{...i,platform:o})};var mS=typeof document<"u",gS=function(){},ti=mS?_.useLayoutEffect:gS;function ni(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ni(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!ni(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Zf(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Xf(e,t){const n=Zf(e);return Math.round(t*n)/n}function Sa(e){const t=E.useRef(e);return ti(()=>{t.current=e}),t}function yS(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:a}={},transform:s=!0,whileElementsMounted:l,open:u}=e,[f,c]=E.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,d]=E.useState(r);ni(p,r)||d(r);const[m,h]=E.useState(null),[g,y]=E.useState(null),v=E.useCallback($=>{$!==C.current&&(C.current=$,h($))},[]),w=E.useCallback($=>{$!==T.current&&(T.current=$,y($))},[]),A=o||m,k=a||g,C=E.useRef(null),T=E.useRef(null),P=E.useRef(f),F=l!=null,I=Sa(l),O=Sa(i),j=Sa(u),z=E.useCallback(()=>{if(!C.current||!T.current)return;const $={placement:t,strategy:n,middleware:p};O.current&&($.platform=O.current),hS(C.current,T.current,$).then(V=>{const b={...V,isPositioned:j.current!==!1};M.current&&!ni(P.current,b)&&(P.current=b,Ls.flushSync(()=>{c(b)}))})},[p,t,n,O,j]);ti(()=>{u===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,c($=>({...$,isPositioned:!1})))},[u]);const M=E.useRef(!1);ti(()=>(M.current=!0,()=>{M.current=!1}),[]),ti(()=>{if(A&&(C.current=A),k&&(T.current=k),A&&k){if(I.current)return I.current(A,k,z);z()}},[A,k,z,I,F]);const D=E.useMemo(()=>({reference:C,floating:T,setReference:v,setFloating:w}),[v,w]),B=E.useMemo(()=>({reference:A,floating:k}),[A,k]),U=E.useMemo(()=>{const $={position:n,left:0,top:0};if(!B.floating)return $;const V=Xf(B.floating,f.x),b=Xf(B.floating,f.y);return s?{...$,transform:"translate("+V+"px, "+b+"px)",...Zf(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:b}},[n,s,B.floating,f.x,f.y]);return E.useMemo(()=>({...f,update:z,refs:D,elements:B,floatingStyles:U}),[f,z,D,B,U])}const vS=(e,t)=>({...fS(e),options:[e,t]}),bS=(e,t)=>({...dS(e),options:[e,t]}),wS=(e,t)=>({...pS(e),options:[e,t]});/*!
|
|
285
|
+
`);const v=y.state[a];if(v==null)return;JSON.stringify(i.getState())!==JSON.stringify(v)&&d(v);return}i.dispatchFromDevtools&&typeof i.dispatch=="function"&&i.dispatch(y)});case"DISPATCH":switch(p.payload.type){case"RESET":return d(m),a===void 0?f==null?void 0:f.init(i.getState()):f==null?void 0:f.init(eo(l.name));case"COMMIT":if(a===void 0){f==null||f.init(i.getState());return}return f==null?void 0:f.init(eo(l.name));case"ROLLBACK":return Ba(p.state,y=>{if(a===void 0){d(y),f==null||f.init(i.getState());return}d(y[a]),f==null||f.init(eo(l.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return Ba(p.state,y=>{if(a===void 0){d(y);return}JSON.stringify(i.getState())!==JSON.stringify(y[a])&&d(y[a])});case"IMPORT_STATE":{const{nextLiftedState:y}=p.payload,v=(g=y.computedStates.slice(-1)[0])==null?void 0:g.state;if(!v)return;d(a===void 0?v:v[a]),f==null||f.send(null,y);return}case"PAUSE_RECORDING":return h=!h}return}}),m},Ba=(e,t)=>{let n;try{n=JSON.parse(e)}catch(r){console.error("[zustand devtools middleware] Could not parse the received json",r)}n!==void 0&&t(n)};function to(e,t){let n;try{n=e()}catch{return}return{getItem:i=>{var o;const s=l=>l===null?null:JSON.parse(l,void 0),a=(o=n.getItem(i))!=null?o:null;return a instanceof Promise?a.then(s):s(a)},setItem:(i,o)=>n.setItem(i,JSON.stringify(o,void 0)),removeItem:i=>n.removeItem(i)}}const Vr=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Vr(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Vr(r)(n)}}}},AT=(e,t)=>(n,r,i)=>{let o={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:g=>g,version:0,merge:(g,y)=>({...y,...g}),...t},s=!1;const a=new Set,l=new Set;let u;try{u=o.getStorage()}catch{}if(!u)return e((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...g)},r,i);const f=Vr(o.serialize),c=()=>{const g=o.partialize({...r()});let y;const v=f({state:g,version:o.version}).then(w=>u.setItem(o.name,w)).catch(w=>{y=w});if(y)throw y;return v},h=i.setState;i.setState=(g,y)=>{h(g,y),c()};const d=e((...g)=>{n(...g),c()},r,i);let m;const p=()=>{var g;if(!u)return;s=!1,a.forEach(v=>v(r()));const y=((g=o.onRehydrateStorage)==null?void 0:g.call(o,r()))||void 0;return Vr(u.getItem.bind(u))(o.name).then(v=>{if(v)return o.deserialize(v)}).then(v=>{if(v)if(typeof v.version=="number"&&v.version!==o.version){if(o.migrate)return o.migrate(v.state,v.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return v.state}).then(v=>{var w;return m=o.merge(v,(w=r())!=null?w:d),n(m,!0),c()}).then(()=>{y==null||y(m,void 0),s=!0,l.forEach(v=>v(m))}).catch(v=>{y==null||y(void 0,v)})};return i.persist={setOptions:g=>{o={...o,...g},g.getStorage&&(u=g.getStorage())},clearStorage:()=>{u==null||u.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>p(),hasHydrated:()=>s,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(l.add(g),()=>{l.delete(g)})},p(),m||d},TT=(e,t)=>(n,r,i)=>{let o={storage:to(()=>localStorage),partialize:p=>p,version:0,merge:(p,g)=>({...g,...p}),...t},s=!1;const a=new Set,l=new Set;let u=o.storage;if(!u)return e((...p)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...p)},r,i);const f=()=>{const p=o.partialize({...r()});return u.setItem(o.name,{state:p,version:o.version})},c=i.setState;i.setState=(p,g)=>{c(p,g),f()};const h=e((...p)=>{n(...p),f()},r,i);let d;const m=()=>{var p,g;if(!u)return;s=!1,a.forEach(v=>{var w;return v((w=r())!=null?w:h)});const y=((g=o.onRehydrateStorage)==null?void 0:g.call(o,(p=r())!=null?p:h))||void 0;return Vr(u.getItem.bind(u))(o.name).then(v=>{if(v)if(typeof v.version=="number"&&v.version!==o.version){if(o.migrate)return o.migrate(v.state,v.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return v.state}).then(v=>{var w;return d=o.merge(v,(w=r())!=null?w:h),n(d,!0),f()}).then(()=>{y==null||y(d,void 0),d=r(),s=!0,l.forEach(v=>v(d))}).catch(v=>{y==null||y(void 0,v)})};return i.persist={setOptions:p=>{o={...o,...p},p.storage&&(u=p.storage)},clearStorage:()=>{u==null||u.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>m(),hasHydrated:()=>s,onHydrate:p=>(a.add(p),()=>{a.delete(p)}),onFinishHydration:p=>(l.add(p),()=>{l.delete(p)})},o.skipHydration||m(),d||h},no=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?((Xi?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),AT(e,t)):TT(e,t),IT=(e,t)=>ln()(Gn(no(n=>({messageHistory:[],addMessageToHistory:r=>n(i=>({...i,messageHistory:[r,...(i.messageHistory??[]).slice(0,100).filter(String)]})),clearHistory:()=>n(()=>({messageHistory:[]}))}),{name:e,storage:to(()=>t==="sessionStorage"?sessionStorage:localStorage)}))),za={},kp=(e,t,n)=>{const i=`${t||"bp-webchat"}-message-history-${e}`;return za[i]||(za[i]=IT(i,n)),za[i]},OT=e=>ln()(Gn(t=>({messages:[],setMessages:n=>t({messages:n}),saveMessage:n=>t(({messages:r})=>{var s;const i=(s=n.metadata)==null?void 0:s.clientMessageId;let o=-1;return i&&(o=r.findIndex(a=>{var l;return((l=a.metadata)==null?void 0:l.clientMessageId)===i})),o===-1&&(o=r.findIndex(a=>a.id===n.id)),o!==-1?{messages:[...r.slice(0,o),{...r[o],...n},...r.slice(o+1)]}:{messages:[...r,n]}}),updateMessage:(n,r)=>t(({messages:i})=>({messages:i.map(o=>o.id===n?{...o,...r}:o)})),removeMessage:n=>t(({messages:r})=>({messages:r.filter(i=>i.id!==n)})),clearMessages:()=>t({messages:[]})}),{name:e})),Ua={},Ep=e=>{const t=`messages-${e}`;return Ua[t]||(Ua[t]=OT(t)),Ua[t]},MT=(e,t)=>ln()(Gn(no(n=>({setUser:r=>n(i=>({...i,user:r})),setConversationId:r=>n(i=>({...i,conversationId:r})),clearAll:()=>{n(r=>({...r,user:void 0,conversationId:void 0}))}}),{name:e,storage:to(()=>t==="sessionStorage"?sessionStorage:localStorage)}))),ja={},Cp=(e="bp-webchat",t)=>{const n=`${e}-client`;return ja[n]||(ja[n]=MT(n,t)),ja[n]},Qn=ln()(Gn(e=>({eventEmitter:sc(),messageContainerRef:D.createRef(),setMessageContainerRef:t=>e({messageContainerRef:t}),portalContainer:null,setPortalContainer:t=>e({portalContainer:t})}),{name:"webchatStore"})),DT=8,NT=e=>ln()(no((t,n)=>({files:[],setFiles:r=>t({files:r}),upsertFile:r=>t(({files:i})=>({files:i.some(a=>a.name===r.name)?i.map(a=>a.name===r.name?{...a,...r}:a):[...i,{...r}]})),uploadFile:async(r,i)=>{if(n().files.length===DT)return;const o=r.name.lastIndexOf("."),s=o>0&&o<r.name.length-1,a=s?r.name.substring(0,o):r.name,l=s?r.name.substring(o):"",u=Hw(a,n().files,h=>h.name),f=u+l,c=new File([r],f,{type:r.type});n().upsertFile({name:u,type:"file",instance:c,status:"loading"});try{const{fileUrl:h,type:d,fileId:m}=await i(c);n().upsertFile({fileId:m,name:u,type:d,url:h,instance:c,status:"uploaded"})}catch{n().upsertFile({name:u,type:"file",instance:c,status:"error"})}},deleteFile:r=>t(({files:i})=>({files:i.filter(o=>o.name!=r)}))}),{name:e,storage:to(()=>sessionStorage)})),Ha={},Ap=(e,t)=>{const r=`${t||"bp-webchat"}-composer-files-${e}`;return Ha[r]||(Ha[r]=NT(r)),Ha[r]},_T=e=>ln()(Gn(t=>({participants:[],setParticipants:n=>t({participants:n}),addParticipant:n=>t(r=>({participants:[...r.participants,n]})),removeParticipant:n=>t(r=>({participants:r.participants.filter(i=>i.id!==n)})),clearParticipants:()=>t({participants:[]})}),{name:e})),Va={},Tp=e=>{const t=`participants-${e}`;return Va[t]||(Va[t]=_T(t)),Va[t]},PT=e=>ln()(Gn(no((t,n)=>({soundOn:!0,setSoundEnabled:r=>t({soundOn:r}),toggleSound:()=>t({soundOn:!n().soundOn})}),{name:e}))),Wa={},Ip=(e="bp-webchat")=>{const t=`${e}-sound`;return Wa[t]||(Wa[t]=PT(t)),Wa[t]},LT=({text:e,buttonValue:t,variant:n,groupId:r,reusable:i,sendMessage:o,isReadOnly:s,...a})=>{const l=Qn(w=>w.eventEmitter),[u,f]=D.useState(!1),[c,h]=D.useState(!1),[d,m]=D.useState(!1),{message:{blocks:{button:p}}}=me;D.useEffect(()=>{if(r)return l.on(`button-group-${r}-click`,()=>{h(!0),i||m(!0)})},[l,r,i]);const y={...a,onClick:w=>{if((d||s)&&n==="link"){w.preventDefault();return}f(!0),i||m(!0),r&&l.emit(`button-group-${r}-click`),n!=="link"&&o&&(o==null||o({type:"text",text:e,value:t}))},"data-activated":u?"":void 0,"data-group-activated":c?"":void 0,"data-type":n,...p},v=d||s;return n==="link"?k.jsx("a",{...y,style:s?{pointerEvents:"none"}:void 0,href:t,target:"_blank",rel:"noopener noreferrer",children:e}):k.jsx("button",{...y,style:s?{pointerEvents:"none"}:void 0,disabled:v,children:e})},qa=D.createContext(null);function Op(){const e=D.useContext(qa);if(!e)throw new Error("useMessageContext must be used within a Message");return e}const Ya=D.createContext({showInputModal:void 0});function Ka(){return D.useContext(Ya)}const Mp=D.forwardRef(({block:e,direction:t,sender:n,timestamp:r,messageId:i,feedback:o,metadata:s,isReadOnly:a,sendMessage:l,addMessageFeedback:u,...f},c)=>{const{showInputModal:h}=Ka(),{message:{blocks:{bubble:{container:d,feedbackContainer:m,feedbackIcon:p}}}}=me;return t=="incoming"?k.jsxs("div",{"data-direction":"incoming","data-feedback":!!o,...f,...d,ref:c,children:[k.jsx(Dn,{block:{...e,direction:t,timestamp:r,sender:n,messageId:i,isReadOnly:a,metadata:s,sendMessage:l}}),u&&h&&e.type==="text"&&k.jsxs("div",{...m,children:[k.jsx(sT,{...p,"data-selected":o==="positive",onClick:()=>u(i,{value:"positive"})}),k.jsx(oT,{...p,"data-selected":o==="negative",onClick:async()=>{const g=await h({title:"Help us improve",description:"Please provide feedback to help us improve.",confirmButtonText:"Send feedback",cancelButtonText:"Cancel",Content:FT});u(i,{value:"negative",comment:g})}})]})]}):k.jsx("div",{"data-direction":"outgoing",...f,...d,ref:c,children:k.jsx(Dn,{block:{...e,direction:t,timestamp:r,sender:n,messageId:i,isReadOnly:a,metadata:s,sendMessage:l,addMessageFeedback:u}})})});Mp.displayName="Bubble";const FT=({setValue:e})=>{const{modal:{dialog:{content:t}}}=me;return k.jsx("textarea",{...t.textarea,placeholder:"Let us know what went wrong...",onChange:n=>e(n.target.value)})},Dp=({className:e,...t})=>k.jsx("div",{"data-slot":"skeleton",className:`bpSkeleton ${e||""}`,...t});Dp.displayName="Skeleton";var xt=function(){return xt=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},xt.apply(this,arguments)};function Np(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Zn(e,t,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(f){try{u(r.next(f))}catch(c){s(c)}}function l(f){try{u(r.throw(f))}catch(c){s(c)}}function u(f){f.done?o(f.value):i(f.value).then(a,l)}u((r=r.apply(e,t||[])).next())})}function Jn(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(f){return l([u,f])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1],o=u;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(u);break}o[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(f){u=[6,f],i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function _p(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],s;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o}function Ga(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;function RT(){var e=D.useRef(!1),t=D.useCallback(function(){return e.current},[]);return D.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),t}function $T(e,t,n){t===void 0&&(t=[]),n===void 0&&(n={loading:!1});var r=D.useRef(0),i=RT(),o=D.useState(n),s=o[0],a=o[1],l=D.useCallback(function(){for(var u=[],f=0;f<arguments.length;f++)u[f]=arguments[f];var c=++r.current;return s.loading||a(function(h){return xt(xt({},h),{loading:!0})}),e.apply(void 0,u).then(function(h){return i()&&c===r.current&&a({value:h,loading:!1}),h},function(h){return i()&&c===r.current&&a({error:h,loading:!1}),h})},t);return[s,l]}function BT(e,t){t===void 0&&(t=[]);var n=$T(e,t,{loading:!0}),r=n[0],i=n[1];return D.useEffect(function(){i()},[i]),r}const Pp=D.forwardRef(({url:e,type:t,orientation:n="auto",...r},i)=>{const o=D.useId(),{setIsLoading:s}=Op(),[a,l]=D.useState(n==="auto"?"square":n),[u,f]=D.useState("initial"),{message:{blocks:{image:c}}}=me;return D.useLayoutEffect(()=>(s(h=>[...h,o]),()=>{s(h=>h.filter(d=>d!==o))}),[o,s]),BT(async()=>{if(!e)return;const h=new Image;try{const{width:d,height:m}=await gb(e);n==="auto"&&l(zT(d,m)),h.onload=()=>{f("loaded"),s(p=>p.filter(g=>g!==o))},h.onerror=()=>{f("error"),l("square"),s(p=>p.filter(g=>g!==o))},h.src=e,h.complete&&(h.naturalWidth>0?(f("loaded"),s(p=>p.filter(g=>g!==o))):(f("error"),l("square"),s(p=>p.filter(g=>g!==o))))}catch(d){console.error(d),f("error"),s(m=>m.filter(p=>p!==o))}return()=>{h.onload=null,h.onerror=null}},[e,o,s,n]),e?u==="error"?k.jsx("div",{"data-error":"true","data-orientation":a,...r,...c.image,ref:i,children:k.jsx(fp,{size:"25%",strokeWidth:"5%"})}):u==="initial"?k.jsx(Dp,{"data-orientation":a,...c.placeholder}):k.jsx("img",{"data-orientation":a,"data-loaded":u==="loaded",...r,...c.image,src:e,alt:"",ref:i}):null});Pp.displayName="Image";function zT(e,t){const n={square:1,portrait:.75,landscape:1.3333333333333333},r=e/t;return Object.keys(n).reduce((o,s)=>Math.abs(n[s]-r)<Math.abs(n[o]-r)?s:o)}const Lp=D.forwardRef(({url:e,isReadOnly:t,...n},r)=>{const{message:{blocks:{video:i}}}=me;return k.jsx("div",{children:k.jsx("video",{...n,"data-chromatic":"ignore",style:t?{pointerEvents:"none"}:void 0,controls:!0,src:e,...i,ref:r})})});Lp.displayName="Video";const Fp=D.forwardRef(({url:e,isReadOnly:t,...n},r)=>{const{message:{blocks:{audio:i}}}=me;return k.jsx("div",{children:k.jsx("audio",{...n,controls:!0,style:t?{pointerEvents:"none"}:void 0,src:e,...i,ref:r})})});Fp.displayName="Audio";const Rp=D.forwardRef(({latitude:e,longitude:t,title:n,isReadOnly:r,...i},o)=>{const s=`https://www.google.com/maps/search/?api=1&query=${e},${t}`,{message:{blocks:{location:a}}}=me;return k.jsxs("a",{...i,...a.container,style:r?{pointerEvents:"none"}:void 0,href:s,type:"_blank",rel:"noopener",ref:o,children:[k.jsx("p",{...a.title,children:n}),k.jsx(JA,{...a.icon})]})});Rp.displayName="Location";const $p=D.forwardRef(({blocks:e,horizontalAlignment:t,verticalAlignment:n,direction:r,sender:i,timestamp:o,messageId:s,isReadOnly:a,sendMessage:l,...u},f)=>{const{message:{blocks:{column:c}}}=me;return k.jsx("div",{"data-horizontal":t,"data-vertical":n,...u,...c,ref:f,children:e.map((h,d)=>k.jsx(Dn,{block:{...h,direction:r,timestamp:o,sender:i,messageId:s,isReadOnly:a,sendMessage:l}},d))})});$p.displayName="Column";const Bp=D.forwardRef(({blocks:e,horizontalAlignment:t,verticalAlignment:n,direction:r,sender:i,timestamp:o,metadata:s,messageId:a,isReadOnly:l,sendMessage:u,...f},c)=>{const{message:{blocks:{row:h}}}=me;return k.jsx("div",{"data-horizontal":t,"data-vertical":n,...f,...h,ref:c,children:e.map((d,m)=>k.jsx(Dn,{block:{...d,direction:r,timestamp:o,sender:i,messageId:a,isReadOnly:l,sendMessage:u}},m))})});Bp.displayName="Row";function UT(e){return Object.prototype.toString.call(e)==="[object Object]"}function zp(e){return UT(e)||Array.isArray(e)}function jT(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Qa(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;const i=JSON.stringify(Object.keys(e.breakpoints||{})),o=JSON.stringify(Object.keys(t.breakpoints||{}));return i!==o?!1:n.every(s=>{const a=e[s],l=t[s];return typeof a=="function"?`${a}`==`${l}`:!zp(a)||!zp(l)?a===l:Qa(a,l)})}function Up(e){return e.concat().sort((t,n)=>t.name>n.name?1:-1).map(t=>t.options)}function HT(e,t){if(e.length!==t.length)return!1;const n=Up(e),r=Up(t);return n.every((i,o)=>{const s=r[o];return Qa(i,s)})}function Za(e){return typeof e=="number"}function Ja(e){return typeof e=="string"}function ro(e){return typeof e=="boolean"}function jp(e){return Object.prototype.toString.call(e)==="[object Object]"}function $e(e){return Math.abs(e)}function Xa(e){return Math.sign(e)}function Wr(e,t){return $e(e-t)}function VT(e,t){if(e===0||t===0||$e(e)<=$e(t))return 0;const n=Wr($e(e),$e(t));return $e(n/e)}function WT(e){return Math.round(e*100)/100}function qr(e){return Kr(e).map(Number)}function Dt(e){return e[Yr(e)]}function Yr(e){return Math.max(0,e.length-1)}function el(e,t){return t===Yr(e)}function Hp(e,t=0){return Array.from(Array(e),(n,r)=>t+r)}function Kr(e){return Object.keys(e)}function Vp(e,t){return[e,t].reduce((n,r)=>(Kr(r).forEach(i=>{const o=n[i],s=r[i],a=jp(o)&&jp(s);n[i]=a?Vp(o,s):s}),n),{})}function tl(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function qT(e,t){const n={start:r,center:i,end:o};function r(){return 0}function i(l){return o(l)/2}function o(l){return t-l}function s(l,u){return Ja(e)?n[e](l):e(t,l,u)}return{measure:s}}function Gr(){let e=[];function t(i,o,s,a={passive:!0}){let l;if("addEventListener"in i)i.addEventListener(o,s,a),l=()=>i.removeEventListener(o,s,a);else{const u=i;u.addListener(s),l=()=>u.removeListener(s)}return e.push(l),r}function n(){e=e.filter(i=>i())}const r={add:t,clear:n};return r}function YT(e,t,n,r){const i=Gr(),o=1e3/60;let s=null,a=0,l=0;function u(){i.add(e,"visibilitychange",()=>{e.hidden&&m()})}function f(){d(),i.clear()}function c(g){if(!l)return;s||(s=g,n(),n());const y=g-s;for(s=g,a+=y;a>=o;)n(),a-=o;const v=a/o;r(v),l&&(l=t.requestAnimationFrame(c))}function h(){l||(l=t.requestAnimationFrame(c))}function d(){t.cancelAnimationFrame(l),s=null,a=0,l=0}function m(){s=null,a=0}return{init:u,destroy:f,start:h,stop:d,update:n,render:r}}function KT(e,t){const n=t==="rtl",r=e==="y",i=r?"y":"x",o=r?"x":"y",s=!r&&n?-1:1,a=f(),l=c();function u(m){const{height:p,width:g}=m;return r?p:g}function f(){return r?"top":n?"right":"left"}function c(){return r?"bottom":n?"left":"right"}function h(m){return m*s}return{scroll:i,cross:o,startEdge:a,endEdge:l,measureSize:u,direction:h}}function On(e=0,t=0){const n=$e(e-t);function r(u){return u<e}function i(u){return u>t}function o(u){return r(u)||i(u)}function s(u){return o(u)?r(u)?e:t:u}function a(u){return n?u-n*Math.ceil((u-t)/n):u}return{length:n,max:t,min:e,constrain:s,reachedAny:o,reachedMax:i,reachedMin:r,removeOffset:a}}function Wp(e,t,n){const{constrain:r}=On(0,e),i=e+1;let o=s(t);function s(h){return n?$e((i+h)%i):r(h)}function a(){return o}function l(h){return o=s(h),c}function u(h){return f().set(a()+h)}function f(){return Wp(e,a(),n)}const c={get:a,set:l,add:u,clone:f};return c}function GT(e,t,n,r,i,o,s,a,l,u,f,c,h,d,m,p,g,y,v){const{cross:w,direction:E}=e,S=["INPUT","SELECT","TEXTAREA"],C={passive:!1},I=Gr(),M=Gr(),P=On(50,225).constrain(d.measure(20)),T={mouse:300,touch:400},O={mouse:500,touch:600},U=m?43:25;let F=!1,L=0,R=0,N=!1,j=!1,B=!1,W=!1;function b($){if(!v)return;function ne(Oe){(ro(v)||v($,Oe))&&q(Oe)}const ge=t;I.add(ge,"dragstart",Oe=>Oe.preventDefault(),C).add(ge,"touchmove",()=>{},C).add(ge,"touchend",()=>{}).add(ge,"touchstart",ne).add(ge,"mousedown",ne).add(ge,"touchcancel",X).add(ge,"contextmenu",X).add(ge,"click",se,!0)}function _(){I.clear(),M.clear()}function H(){const $=W?n:t;M.add($,"touchmove",Q,C).add($,"touchend",X).add($,"mousemove",Q,C).add($,"mouseup",X)}function x($){const ne=$.nodeName||"";return S.includes(ne)}function V(){return(m?O:T)[W?"mouse":"touch"]}function Y($,ne){const ge=c.add(Xa($)*-1),Oe=f.byDistance($,!m).distance;return m||$e($)<P?Oe:g&&ne?Oe*.5:f.byIndex(ge.get(),0).distance}function q($){const ne=tl($,r);W=ne,B=m&&ne&&!$.buttons&&F,F=Wr(i.get(),s.get())>=2,!(ne&&$.button!==0)&&(x($.target)||(N=!0,o.pointerDown($),u.useFriction(0).useDuration(0),i.set(s),H(),L=o.readPoint($),R=o.readPoint($,w),h.emit("pointerDown")))}function Q($){if(!tl($,r)&&$.touches.length>=2)return X($);const ge=o.readPoint($),Oe=o.readPoint($,w),J=Wr(ge,L),ue=Wr(Oe,R);if(!j&&!W&&(!$.cancelable||(j=J>ue,!j)))return X($);const de=o.pointerMove($);J>p&&(B=!0),u.useFriction(.3).useDuration(.75),a.start(),i.add(E(de)),$.preventDefault()}function X($){const ge=f.byDistance(0,!1).index!==c.get(),Oe=o.pointerUp($)*V(),J=Y(E(Oe),ge),ue=VT(Oe,J),de=U-10*ue,fe=y+ue/50;j=!1,N=!1,M.clear(),u.useDuration(de).useFriction(fe),l.distance(J,!m),W=!1,h.emit("pointerUp")}function se($){B&&($.stopPropagation(),$.preventDefault(),B=!1)}function G(){return N}return{init:b,destroy:_,pointerDown:G}}function QT(e,t){let r,i;function o(c){return c.timeStamp}function s(c,h){const m=`client${(h||e.scroll)==="x"?"X":"Y"}`;return(tl(c,t)?c:c.touches[0])[m]}function a(c){return r=c,i=c,s(c)}function l(c){const h=s(c)-s(i),d=o(c)-o(r)>170;return i=c,d&&(r=c),h}function u(c){if(!r||!i)return 0;const h=s(i)-s(r),d=o(c)-o(r),m=o(c)-o(i)>170,p=h/d;return d&&!m&&$e(p)>.1?p:0}return{pointerDown:a,pointerMove:l,pointerUp:u,readPoint:s}}function ZT(){function e(n){const{offsetTop:r,offsetLeft:i,offsetWidth:o,offsetHeight:s}=n;return{top:r,right:i+o,bottom:r+s,left:i,width:o,height:s}}return{measure:e}}function JT(e){function t(r){return e*(r/100)}return{measure:t}}function XT(e,t,n,r,i,o,s){const a=[e].concat(r);let l,u,f=[],c=!1;function h(g){return i.measureSize(s.measure(g))}function d(g){if(!o)return;u=h(e),f=r.map(h);function y(v){for(const w of v){if(c)return;const E=w.target===e,S=r.indexOf(w.target),C=E?u:f[S],I=h(E?e:r[S]);if($e(I-C)>=.5){g.reInit(),t.emit("resize");break}}}l=new ResizeObserver(v=>{(ro(o)||o(g,v))&&y(v)}),n.requestAnimationFrame(()=>{a.forEach(v=>l.observe(v))})}function m(){c=!0,l&&l.disconnect()}return{init:d,destroy:m}}function eI(e,t,n,r,i,o){let s=0,a=0,l=i,u=o,f=e.get(),c=0;function h(){const C=r.get()-e.get(),I=!l;let M=0;return I?(s=0,n.set(r),e.set(r),M=C):(n.set(e),s+=C/l,s*=u,f+=s,e.add(s),M=f-c),a=Xa(M),c=f,S}function d(){const C=r.get()-t.get();return $e(C)<.001}function m(){return l}function p(){return a}function g(){return s}function y(){return w(i)}function v(){return E(o)}function w(C){return l=C,S}function E(C){return u=C,S}const S={direction:p,duration:m,velocity:g,seek:h,settled:d,useBaseFriction:v,useBaseDuration:y,useFriction:E,useDuration:w};return S}function tI(e,t,n,r,i){const o=i.measure(10),s=i.measure(50),a=On(.1,.99);let l=!1;function u(){return!(l||!e.reachedAny(n.get())||!e.reachedAny(t.get()))}function f(d){if(!u())return;const m=e.reachedMin(t.get())?"min":"max",p=$e(e[m]-t.get()),g=n.get()-t.get(),y=a.constrain(p/s);n.subtract(g*y),!d&&$e(g)<o&&(n.set(e.constrain(n.get())),r.useDuration(25).useBaseFriction())}function c(d){l=!d}return{shouldConstrain:u,constrain:f,toggleActive:c}}function nI(e,t,n,r,i){const o=On(-t+e,0),s=c(),a=f(),l=h();function u(m,p){return Wr(m,p)<=1}function f(){const m=s[0],p=Dt(s),g=s.lastIndexOf(m),y=s.indexOf(p)+1;return On(g,y)}function c(){return n.map((m,p)=>{const{min:g,max:y}=o,v=o.constrain(m),w=!p,E=el(n,p);return w?y:E||u(g,v)?g:u(y,v)?y:v}).map(m=>parseFloat(m.toFixed(3)))}function h(){if(t<=e+i)return[o.max];if(r==="keepSnaps")return s;const{min:m,max:p}=a;return s.slice(m,p)}return{snapsContained:l,scrollContainLimit:a}}function rI(e,t,n){const r=t[0],i=n?r-e:Dt(t);return{limit:On(i,r)}}function iI(e,t,n,r){const o=t.min+.1,s=t.max+.1,{reachedMin:a,reachedMax:l}=On(o,s);function u(h){return h===1?l(n.get()):h===-1?a(n.get()):!1}function f(h){if(!u(h))return;const d=e*(h*-1);r.forEach(m=>m.add(d))}return{loop:f}}function oI(e){const{max:t,length:n}=e;function r(o){const s=o-t;return n?s/-n:0}return{get:r}}function sI(e,t,n,r,i){const{startEdge:o,endEdge:s}=e,{groupSlides:a}=i,l=c().map(t.measure),u=h(),f=d();function c(){return a(r).map(p=>Dt(p)[s]-p[0][o]).map($e)}function h(){return r.map(p=>n[o]-p[o]).map(p=>-$e(p))}function d(){return a(u).map(p=>p[0]).map((p,g)=>p+l[g])}return{snaps:u,snapsAligned:f}}function aI(e,t,n,r,i,o){const{groupSlides:s}=i,{min:a,max:l}=r,u=f();function f(){const h=s(o),d=!e||t==="keepSnaps";return n.length===1?[o]:d?h:h.slice(a,l).map((m,p,g)=>{const y=!p,v=el(g,p);if(y){const w=Dt(g[0])+1;return Hp(w)}if(v){const w=Yr(o)-Dt(g)[0]+1;return Hp(w,Dt(g)[0])}return m})}return{slideRegistry:u}}function lI(e,t,n,r,i){const{reachedAny:o,removeOffset:s,constrain:a}=r;function l(m){return m.concat().sort((p,g)=>$e(p)-$e(g))[0]}function u(m){const p=e?s(m):a(m),g=t.map((v,w)=>({diff:f(v-p,0),index:w})).sort((v,w)=>$e(v.diff)-$e(w.diff)),{index:y}=g[0];return{index:y,distance:p}}function f(m,p){const g=[m,m+n,m-n];if(!e)return m;if(!p)return l(g);const y=g.filter(v=>Xa(v)===p);return y.length?l(y):Dt(g)-n}function c(m,p){const g=t[m]-i.get(),y=f(g,p);return{index:m,distance:y}}function h(m,p){const g=i.get()+m,{index:y,distance:v}=u(g),w=!e&&o(g);if(!p||w)return{index:y,distance:m};const E=t[y]-v,S=m+f(E,0);return{index:y,distance:S}}return{byDistance:h,byIndex:c,shortcut:f}}function uI(e,t,n,r,i,o,s){function a(c){const h=c.distance,d=c.index!==t.get();o.add(h),h&&(r.duration()?e.start():(e.update(),e.render(1),e.update())),d&&(n.set(t.get()),t.set(c.index),s.emit("select"))}function l(c,h){const d=i.byDistance(c,h);a(d)}function u(c,h){const d=t.clone().set(c),m=i.byIndex(d.get(),h);a(m)}return{distance:l,index:u}}function cI(e,t,n,r,i,o,s,a){const l={passive:!0,capture:!0};let u=0;function f(d){if(!a)return;function m(p){if(new Date().getTime()-u>10)return;s.emit("slideFocusStart"),e.scrollLeft=0;const v=n.findIndex(w=>w.includes(p));Za(v)&&(i.useDuration(0),r.index(v,0),s.emit("slideFocus"))}o.add(document,"keydown",c,!1),t.forEach((p,g)=>{o.add(p,"focus",y=>{(ro(a)||a(d,y))&&m(g)},l)})}function c(d){d.code==="Tab"&&(u=new Date().getTime())}return{init:f}}function Qr(e){let t=e;function n(){return t}function r(l){t=s(l)}function i(l){t+=s(l)}function o(l){t-=s(l)}function s(l){return Za(l)?l:l.get()}return{get:n,set:r,add:i,subtract:o}}function qp(e,t){const n=e.scroll==="x"?s:a,r=t.style;let i=null,o=!1;function s(h){return`translate3d(${h}px,0px,0px)`}function a(h){return`translate3d(0px,${h}px,0px)`}function l(h){if(o)return;const d=WT(e.direction(h));d!==i&&(r.transform=n(d),i=d)}function u(h){o=!h}function f(){o||(r.transform="",t.getAttribute("style")||t.removeAttribute("style"))}return{clear:f,to:l,toggleActive:u}}function fI(e,t,n,r,i,o,s,a,l){const f=qr(i),c=qr(i).reverse(),h=y().concat(v());function d(I,M){return I.reduce((P,T)=>P-i[T],M)}function m(I,M){return I.reduce((P,T)=>d(P,M)>0?P.concat([T]):P,[])}function p(I){return o.map((M,P)=>({start:M-r[P]+.5+I,end:M+t-.5+I}))}function g(I,M,P){const T=p(M);return I.map(O=>{const U=P?0:-n,F=P?n:0,L=P?"end":"start",R=T[O][L];return{index:O,loopPoint:R,slideLocation:Qr(-1),translate:qp(e,l[O]),target:()=>a.get()>R?U:F}})}function y(){const I=s[0],M=m(c,I);return g(M,n,!1)}function v(){const I=t-s[0]-1,M=m(f,I);return g(M,-n,!0)}function w(){return h.every(({index:I})=>{const M=f.filter(P=>P!==I);return d(M,t)<=.1})}function E(){h.forEach(I=>{const{target:M,translate:P,slideLocation:T}=I,O=M();O!==T.get()&&(P.to(O),T.set(O))})}function S(){h.forEach(I=>I.translate.clear())}return{canLoop:w,clear:S,loop:E,loopPoints:h}}function dI(e,t,n){let r,i=!1;function o(l){if(!n)return;function u(f){for(const c of f)if(c.type==="childList"){l.reInit(),t.emit("slidesChanged");break}}r=new MutationObserver(f=>{i||(ro(n)||n(l,f))&&u(f)}),r.observe(e,{childList:!0})}function s(){r&&r.disconnect(),i=!0}return{init:o,destroy:s}}function hI(e,t,n,r){const i={};let o=null,s=null,a,l=!1;function u(){a=new IntersectionObserver(m=>{l||(m.forEach(p=>{const g=t.indexOf(p.target);i[g]=p}),o=null,s=null,n.emit("slidesInView"))},{root:e.parentElement,threshold:r}),t.forEach(m=>a.observe(m))}function f(){a&&a.disconnect(),l=!0}function c(m){return Kr(i).reduce((p,g)=>{const y=parseInt(g),{isIntersecting:v}=i[y];return(m&&v||!m&&!v)&&p.push(y),p},[])}function h(m=!0){if(m&&o)return o;if(!m&&s)return s;const p=c(m);return m&&(o=p),m||(s=p),p}return{init:u,destroy:f,get:h}}function pI(e,t,n,r,i,o){const{measureSize:s,startEdge:a,endEdge:l}=e,u=n[0]&&i,f=m(),c=p(),h=n.map(s),d=g();function m(){if(!u)return 0;const v=n[0];return $e(t[a]-v[a])}function p(){if(!u)return 0;const v=o.getComputedStyle(Dt(r));return parseFloat(v.getPropertyValue(`margin-${l}`))}function g(){return n.map((v,w,E)=>{const S=!w,C=el(E,w);return S?h[w]+f:C?h[w]+c:E[w+1][a]-v[a]}).map($e)}return{slideSizes:h,slideSizesWithGaps:d,startGap:f,endGap:c}}function mI(e,t,n,r,i,o,s,a,l){const{startEdge:u,endEdge:f,direction:c}=e,h=Za(n);function d(y,v){return qr(y).filter(w=>w%v===0).map(w=>y.slice(w,w+v))}function m(y){return y.length?qr(y).reduce((v,w,E)=>{const S=Dt(v)||0,C=S===0,I=w===Yr(y),M=i[u]-o[S][u],P=i[u]-o[w][f],T=!r&&C?c(s):0,O=!r&&I?c(a):0,U=$e(P-O-(M+T));return E&&U>t+l&&v.push(w),I&&v.push(y.length),v},[]).map((v,w,E)=>{const S=Math.max(E[w-1]||0);return y.slice(S,v)}):[]}function p(y){return h?d(y,n):m(y)}return{groupSlides:p}}function gI(e,t,n,r,i,o,s){const{align:a,axis:l,direction:u,startIndex:f,loop:c,duration:h,dragFree:d,dragThreshold:m,inViewThreshold:p,slidesToScroll:g,skipSnaps:y,containScroll:v,watchResize:w,watchSlides:E,watchDrag:S,watchFocus:C}=o,I=2,M=ZT(),P=M.measure(t),T=n.map(M.measure),O=KT(l,u),U=O.measureSize(P),F=JT(U),L=qT(a,U),R=!c&&!!v,N=c||!!v,{slideSizes:j,slideSizesWithGaps:B,startGap:W,endGap:b}=pI(O,P,T,n,N,i),_=mI(O,U,g,c,P,T,W,b,I),{snaps:H,snapsAligned:x}=sI(O,L,P,T,_),V=-Dt(H)+Dt(B),{snapsContained:Y,scrollContainLimit:q}=nI(U,V,x,v,I),Q=R?Y:x,{limit:X}=rI(V,Q,c),se=Wp(Yr(Q),f,c),G=se.clone(),te=qr(n),$=({dragHandler:he,scrollBody:He,scrollBounds:Ge,options:{loop:Ze}})=>{Ze||Ge.constrain(he.pointerDown()),He.seek()},ne=({scrollBody:he,translate:He,location:Ge,offsetLocation:Ze,previousLocation:Et,scrollLooper:Rt,slideLooper:Qe,dragHandler:Ct,animation:at,eventHandler:ns,scrollBounds:NP,options:{loop:Yv}},Kv)=>{const Gv=he.settled(),_P=!NP.shouldConstrain(),Qv=Yv?Gv:Gv&&_P,Zv=Qv&&!Ct.pointerDown();Zv&&at.stop();const PP=Ge.get()*Kv+Et.get()*(1-Kv);Ze.set(PP),Yv&&(Rt.loop(he.direction()),Qe.loop()),He.to(Ze.get()),Zv&&ns.emit("settle"),Qv||ns.emit("scroll")},ge=YT(r,i,()=>$(le),he=>ne(le,he)),Oe=.68,J=Q[se.get()],ue=Qr(J),de=Qr(J),fe=Qr(J),Ae=Qr(J),Fe=eI(ue,fe,de,Ae,h,Oe),Me=lI(c,Q,V,X,Ae),je=uI(ge,se,G,Fe,Me,Ae,s),ee=oI(X),ae=Gr(),z=hI(t,n,s,p),{slideRegistry:K}=aI(R,v,Q,q,_,te),oe=cI(e,n,K,je,Fe,ae,s,C),le={ownerDocument:r,ownerWindow:i,eventHandler:s,containerRect:P,slideRects:T,animation:ge,axis:O,dragHandler:GT(O,e,r,i,Ae,QT(O,i),ue,ge,je,Fe,Me,se,s,F,d,m,y,Oe,S),eventStore:ae,percentOfView:F,index:se,indexPrevious:G,limit:X,location:ue,offsetLocation:fe,previousLocation:de,options:o,resizeHandler:XT(t,s,i,n,O,w,M),scrollBody:Fe,scrollBounds:tI(X,fe,Ae,Fe,F),scrollLooper:iI(V,X,fe,[ue,fe,de,Ae]),scrollProgress:ee,scrollSnapList:Q.map(ee.get),scrollSnaps:Q,scrollTarget:Me,scrollTo:je,slideLooper:fI(O,U,V,j,B,H,Q,fe,n),slideFocus:oe,slidesHandler:dI(t,s,E),slidesInView:z,slideIndexes:te,slideRegistry:K,slidesToScroll:_,target:Ae,translate:qp(O,t)};return le}function yI(){let e={},t;function n(u){t=u}function r(u){return e[u]||[]}function i(u){return r(u).forEach(f=>f(t,u)),l}function o(u,f){return e[u]=r(u).concat([f]),l}function s(u,f){return e[u]=r(u).filter(c=>c!==f),l}function a(){e={}}const l={init:n,emit:i,off:s,on:o,clear:a};return l}const vI={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function bI(e){function t(o,s){return Vp(o,s||{})}function n(o){const s=o.breakpoints||{},a=Kr(s).filter(l=>e.matchMedia(l).matches).map(l=>s[l]).reduce((l,u)=>t(l,u),{});return t(o,a)}function r(o){return o.map(s=>Kr(s.breakpoints||{})).reduce((s,a)=>s.concat(a),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:n,optionsMediaQueries:r}}function wI(e){let t=[];function n(o,s){return t=s.filter(({options:a})=>e.optionsAtMedia(a).active!==!1),t.forEach(a=>a.init(o,e)),s.reduce((a,l)=>Object.assign(a,{[l.name]:l}),{})}function r(){t=t.filter(o=>o.destroy())}return{init:n,destroy:r}}function io(e,t,n){const r=e.ownerDocument,i=r.defaultView,o=bI(i),s=wI(o),a=Gr(),l=yI(),{mergeOptions:u,optionsAtMedia:f,optionsMediaQueries:c}=o,{on:h,off:d,emit:m}=l,p=O;let g=!1,y,v=u(vI,io.globalOptions),w=u(v),E=[],S,C,I;function M(){const{container:te,slides:$}=w;C=(Ja(te)?e.querySelector(te):te)||e.children[0];const ge=Ja($)?C.querySelectorAll($):$;I=[].slice.call(ge||C.children)}function P(te){const $=gI(e,C,I,r,i,te,l);if(te.loop&&!$.slideLooper.canLoop()){const ne=Object.assign({},te,{loop:!1});return P(ne)}return $}function T(te,$){g||(v=u(v,te),w=f(v),E=$||E,M(),y=P(w),c([v,...E.map(({options:ne})=>ne)]).forEach(ne=>a.add(ne,"change",O)),w.active&&(y.translate.to(y.location.get()),y.animation.init(),y.slidesInView.init(),y.slideFocus.init(G),y.eventHandler.init(G),y.resizeHandler.init(G),y.slidesHandler.init(G),y.options.loop&&y.slideLooper.loop(),C.offsetParent&&I.length&&y.dragHandler.init(G),S=s.init(G,E)))}function O(te,$){const ne=_();U(),T(u({startIndex:ne},te),$),l.emit("reInit")}function U(){y.dragHandler.destroy(),y.eventStore.clear(),y.translate.clear(),y.slideLooper.clear(),y.resizeHandler.destroy(),y.slidesHandler.destroy(),y.slidesInView.destroy(),y.animation.destroy(),s.destroy(),a.clear()}function F(){g||(g=!0,a.clear(),U(),l.emit("destroy"),l.clear())}function L(te,$,ne){!w.active||g||(y.scrollBody.useBaseFriction().useDuration($===!0?0:w.duration),y.scrollTo.index(te,ne||0))}function R(te){const $=y.index.add(1).get();L($,te,-1)}function N(te){const $=y.index.add(-1).get();L($,te,1)}function j(){return y.index.add(1).get()!==_()}function B(){return y.index.add(-1).get()!==_()}function W(){return y.scrollSnapList}function b(){return y.scrollProgress.get(y.offsetLocation.get())}function _(){return y.index.get()}function H(){return y.indexPrevious.get()}function x(){return y.slidesInView.get()}function V(){return y.slidesInView.get(!1)}function Y(){return S}function q(){return y}function Q(){return e}function X(){return C}function se(){return I}const G={canScrollNext:j,canScrollPrev:B,containerNode:X,internalEngine:q,destroy:F,off:d,on:h,emit:m,plugins:Y,previousScrollSnap:H,reInit:p,rootNode:Q,scrollNext:R,scrollPrev:N,scrollProgress:b,scrollSnapList:W,scrollTo:L,selectedScrollSnap:_,slideNodes:se,slidesInView:x,slidesNotInView:V};return T(t,n),setTimeout(()=>l.emit("init"),0),G}io.globalOptions=void 0;function nl(e={},t=[]){const n=D.useRef(e),r=D.useRef(t),[i,o]=D.useState(),[s,a]=D.useState(),l=D.useCallback(()=>{i&&i.reInit(n.current,r.current)},[i]);return D.useEffect(()=>{Qa(n.current,e)||(n.current=e,l())},[e,l]),D.useEffect(()=>{HT(r.current,t)||(r.current=t,l())},[t,l]),D.useEffect(()=>{if(jT()&&s){io.globalOptions=nl.globalOptions;const u=io(s,n.current,r.current);return o(u),()=>u.destroy()}else o(void 0)},[s,o]),[a,i]}nl.globalOptions=void 0;const Yp=D.forwardRef(({blocks:e,direction:t,sender:n,timestamp:r,messageId:i,isReadOnly:o,sendMessage:s},a)=>{const[l,u]=nl({skipSnaps:!0,loop:!0}),[f,c]=D.useState(!0),[h,d]=D.useState(!0),m=D.useCallback(()=>u==null?void 0:u.scrollPrev(),[u]),p=D.useCallback(()=>u==null?void 0:u.scrollNext(),[u]),{message:{blocks:{carousel:g}}}=me,y=D.useCallback(v=>{c(!(v!=null&&v.canScrollPrev())),d(!(v!=null&&v.canScrollNext()))},[]);return D.useEffect(()=>{u&&(y(u),u.on("reInit",y),u.on("select",y))},[u,y]),k.jsxs("div",{...g==null?void 0:g.container,"data-container":"carousel",ref:l,children:[k.jsx("div",{ref:a,...g==null?void 0:g.slidesContainer,children:e.map((v,w)=>k.jsx(Dn,{block:{...v,direction:t,timestamp:r,sender:n,messageId:i,sendMessage:s,isReadOnly:o}},w))}),e.length>1&&k.jsxs(k.Fragment,{children:[k.jsx(ap,{...g==null?void 0:g.backButton,"data-disabled":f?"":void 0,onClick:m}),k.jsx(lp,{...g==null?void 0:g.nextButton,"data-disabled":h?"":void 0,onClick:p})]})]})});Yp.displayName="Carousel";const Kp=Math.floor;function Gp(e){return Qp(e)?(e.nodeName||"").toLowerCase():"#document"}function Zr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function SI(e){var t;return(t=(Qp(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Qp(e){return e instanceof Node||e instanceof Zr(e).Node}function kt(e){return e instanceof Element||e instanceof Zr(e).Element}function Xn(e){return e instanceof HTMLElement||e instanceof Zr(e).HTMLElement}function rl(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Zr(e).ShadowRoot}function xI(e){return["html","body","#document"].includes(Gp(e))}function kI(e){return Zr(e).getComputedStyle(e)}function EI(e){if(Gp(e)==="html")return e;const t=e.assignedSlot||e.parentNode||rl(e)&&e.host||SI(e);return rl(t)?t.host:t}function un(e){let t=e.activeElement;for(;((n=t)==null||(r=n.shadowRoot)==null?void 0:r.activeElement)!=null;){var n,r;t=t.shadowRoot.activeElement}return t}function ft(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&rl(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Zp(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function CI(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function Jp(e){if(e.mozInputSource===0&&e.isTrusted)return!0;const t=/Android/i;return(t.test(Zp())||t.test(CI()))&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Xp(e){return e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType!=="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0}function em(){return/apple/i.test(navigator.vendor)}function AI(){return Zp().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function tm(e,t){return["mouse","pen"].includes(e)}function TI(e){return"nativeEvent"in e}function II(e){return e.matches("html,body")}function Nt(e){return(e==null?void 0:e.ownerDocument)||document}function il(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function nm(e){return"composedPath"in e?e.composedPath()[0]:e.target}const OI="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function rm(e){return Xn(e)&&e.matches(OI)}function Je(e){e.preventDefault(),e.stopPropagation()}const er=Math.min,gt=Math.max,oo=Math.round,so=Math.floor,zt=e=>({x:e,y:e});function im(e,t,n){return gt(e,er(t,n))}function ao(e,t){return typeof e=="function"?e(t):e}function Jr(e){return e.split("-")[0]}function ol(e){return e.split("-")[1]}function om(e){return e==="x"?"y":"x"}function MI(e){return e==="y"?"height":"width"}const DI=new Set(["top","bottom"]);function Xr(e){return DI.has(Jr(e))?"y":"x"}function NI(e){return om(Xr(e))}function _I(e){return{top:0,right:0,bottom:0,left:0,...e}}function PI(e){return typeof e!="number"?_I(e):{top:e,right:e,bottom:e,left:e}}function lo(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function sm(e,t,n){let{reference:r,floating:i}=e;const o=Xr(t),s=NI(t),a=MI(s),l=Jr(t),u=o==="y",f=r.x+r.width/2-i.width/2,c=r.y+r.height/2-i.height/2,h=r[a]/2-i[a]/2;let d;switch(l){case"top":d={x:f,y:r.y-i.height};break;case"bottom":d={x:f,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:c};break;case"left":d={x:r.x-i.width,y:c};break;default:d={x:r.x,y:r.y}}switch(ol(t)){case"start":d[s]-=h*(n&&u?-1:1);break;case"end":d[s]+=h*(n&&u?-1:1);break}return d}const LI=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:f,y:c}=sm(u,r,l),h=r,d={},m=0;for(let p=0;p<a.length;p++){const{name:g,fn:y}=a[p],{x:v,y:w,data:E,reset:S}=await y({x:f,y:c,initialPlacement:r,placement:h,strategy:i,middlewareData:d,rects:u,platform:s,elements:{reference:e,floating:t}});f=v??f,c=w??c,d={...d,[g]:{...d[g],...E}},S&&m<=50&&(m++,typeof S=="object"&&(S.placement&&(h=S.placement),S.rects&&(u=S.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):S.rects),{x:f,y:c}=sm(u,h,l)),p=-1)}return{x:f,y:c,placement:h,strategy:i,middlewareData:d}};async function am(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:c="floating",altBoundary:h=!1,padding:d=0}=ao(t,e),m=PI(d),g=a[h?c==="floating"?"reference":"floating":c],y=lo(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(g)))==null||n?g:g.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:u,rootBoundary:f,strategy:l})),v=c==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,w=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),E=await(o.isElement==null?void 0:o.isElement(w))?await(o.getScale==null?void 0:o.getScale(w))||{x:1,y:1}:{x:1,y:1},S=lo(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:w,strategy:l}):v);return{top:(y.top-S.top+m.top)/E.y,bottom:(S.bottom-y.bottom+m.bottom)/E.y,left:(y.left-S.left+m.left)/E.x,right:(S.right-y.right+m.right)/E.x}}const FI=new Set(["left","top"]);async function RI(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=Jr(n),a=ol(n),l=Xr(n)==="y",u=FI.has(s)?-1:1,f=o&&l?-1:1,c=ao(t,e);let{mainAxis:h,crossAxis:d,alignmentAxis:m}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:c.mainAxis||0,crossAxis:c.crossAxis||0,alignmentAxis:c.alignmentAxis};return a&&typeof m=="number"&&(d=a==="end"?m*-1:m),l?{x:d*f,y:h*u}:{x:h*u,y:d*f}}const $I=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:s,middlewareData:a}=t,l=await RI(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:s}}}}},BI=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:g=>{let{x:y,y:v}=g;return{x:y,y:v}}},...l}=ao(e,t),u={x:n,y:r},f=await am(t,l),c=Xr(Jr(i)),h=om(c);let d=u[h],m=u[c];if(o){const g=h==="y"?"top":"left",y=h==="y"?"bottom":"right",v=d+f[g],w=d-f[y];d=im(v,d,w)}if(s){const g=c==="y"?"top":"left",y=c==="y"?"bottom":"right",v=m+f[g],w=m-f[y];m=im(v,m,w)}const p=a.fn({...t,[h]:d,[c]:m});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[h]:o,[c]:s}}}}}},zI=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:s,elements:a}=t,{apply:l=()=>{},...u}=ao(e,t),f=await am(t,u),c=Jr(i),h=ol(i),d=Xr(i)==="y",{width:m,height:p}=o.floating;let g,y;c==="top"||c==="bottom"?(g=c,y=h===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(y=c,g=h==="end"?"top":"bottom");const v=p-f.top-f.bottom,w=m-f.left-f.right,E=er(p-f[g],v),S=er(m-f[y],w),C=!t.middlewareData.shift;let I=E,M=S;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(I=v),C&&!h){const T=gt(f.left,0),O=gt(f.right,0),U=gt(f.top,0),F=gt(f.bottom,0);d?M=m-2*(T!==0||O!==0?T+O:gt(f.left,f.right)):I=p-2*(U!==0||F!==0?U+F:gt(f.top,f.bottom))}await l({...t,availableWidth:M,availableHeight:I});const P=await s.getDimensions(a.floating);return m!==P.width||p!==P.height?{reset:{rects:!0}}:{}}}};function uo(){return typeof window<"u"}function tr(e){return lm(e)?(e.nodeName||"").toLowerCase():"#document"}function yt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ut(e){var t;return(t=(lm(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function lm(e){return uo()?e instanceof Node||e instanceof yt(e).Node:!1}function _t(e){return uo()?e instanceof Element||e instanceof yt(e).Element:!1}function jt(e){return uo()?e instanceof HTMLElement||e instanceof yt(e).HTMLElement:!1}function um(e){return!uo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof yt(e).ShadowRoot}const UI=new Set(["inline","contents"]);function ei(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Pt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!UI.has(i)}const jI=new Set(["table","td","th"]);function HI(e){return jI.has(tr(e))}const VI=[":popover-open",":modal"];function co(e){return VI.some(t=>{try{return e.matches(t)}catch{return!1}})}const WI=["transform","translate","scale","rotate","perspective"],qI=["transform","translate","scale","rotate","perspective","filter"],YI=["paint","layout","strict","content"];function sl(e){const t=al(),n=_t(e)?Pt(e):e;return WI.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||qI.some(r=>(n.willChange||"").includes(r))||YI.some(r=>(n.contain||"").includes(r))}function KI(e){let t=cn(e);for(;jt(t)&&!nr(t);){if(sl(t))return t;if(co(t))return null;t=cn(t)}return null}function al(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const GI=new Set(["html","body","#document"]);function nr(e){return GI.has(tr(e))}function Pt(e){return yt(e).getComputedStyle(e)}function fo(e){return _t(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function cn(e){if(tr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||um(e)&&e.host||Ut(e);return um(t)?t.host:t}function cm(e){const t=cn(e);return nr(t)?e.ownerDocument?e.ownerDocument.body:e.body:jt(t)&&ei(t)?t:cm(t)}function fn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=cm(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=yt(i);if(o){const a=ll(s);return t.concat(s,s.visualViewport||[],ei(i)?i:[],a&&n?fn(a):[])}return t.concat(i,fn(i,[],n))}function ll(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function fm(e){const t=Pt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=jt(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=oo(n)!==o||oo(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function ul(e){return _t(e)?e:e.contextElement}function rr(e){const t=ul(e);if(!jt(t))return zt(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=fm(t);let s=(o?oo(n.width):n.width)/r,a=(o?oo(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const QI=zt(0);function dm(e){const t=yt(e);return!al()||!t.visualViewport?QI:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ZI(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==yt(e)?!1:t}function Mn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=ul(e);let s=zt(1);t&&(r?_t(r)&&(s=rr(r)):s=rr(e));const a=ZI(o,n,r)?dm(o):zt(0);let l=(i.left+a.x)/s.x,u=(i.top+a.y)/s.y,f=i.width/s.x,c=i.height/s.y;if(o){const h=yt(o),d=r&&_t(r)?yt(r):r;let m=h,p=ll(m);for(;p&&r&&d!==m;){const g=rr(p),y=p.getBoundingClientRect(),v=Pt(p),w=y.left+(p.clientLeft+parseFloat(v.paddingLeft))*g.x,E=y.top+(p.clientTop+parseFloat(v.paddingTop))*g.y;l*=g.x,u*=g.y,f*=g.x,c*=g.y,l+=w,u+=E,m=yt(p),p=ll(m)}}return lo({width:f,height:c,x:l,y:u})}function ho(e,t){const n=fo(e).scrollLeft;return t?t.left+n:Mn(Ut(e)).left+n}function hm(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-ho(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function JI(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",s=Ut(r),a=t?co(t.floating):!1;if(r===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},u=zt(1);const f=zt(0),c=jt(r);if((c||!c&&!o)&&((tr(r)!=="body"||ei(s))&&(l=fo(r)),jt(r))){const d=Mn(r);u=rr(r),f.x=d.x+r.clientLeft,f.y=d.y+r.clientTop}const h=s&&!c&&!o?hm(s,l):zt(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+f.x+h.x,y:n.y*u.y-l.scrollTop*u.y+f.y+h.y}}function XI(e){return Array.from(e.getClientRects())}function eO(e){const t=Ut(e),n=fo(e),r=e.ownerDocument.body,i=gt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=gt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+ho(e);const a=-n.scrollTop;return Pt(r).direction==="rtl"&&(s+=gt(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}const pm=25;function tO(e,t){const n=yt(e),r=Ut(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;const f=al();(!f||f&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const u=ho(r);if(u<=0){const f=r.ownerDocument,c=f.body,h=getComputedStyle(c),d=f.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,m=Math.abs(r.clientWidth-c.clientWidth-d);m<=pm&&(o-=m)}else u<=pm&&(o+=u);return{width:o,height:s,x:a,y:l}}const nO=new Set(["absolute","fixed"]);function rO(e,t){const n=Mn(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=jt(e)?rr(e):zt(1),s=e.clientWidth*o.x,a=e.clientHeight*o.y,l=i*o.x,u=r*o.y;return{width:s,height:a,x:l,y:u}}function mm(e,t,n){let r;if(t==="viewport")r=tO(e,n);else if(t==="document")r=eO(Ut(e));else if(_t(t))r=rO(t,n);else{const i=dm(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return lo(r)}function gm(e,t){const n=cn(e);return n===t||!_t(n)||nr(n)?!1:Pt(n).position==="fixed"||gm(n,t)}function iO(e,t){const n=t.get(e);if(n)return n;let r=fn(e,[],!1).filter(a=>_t(a)&&tr(a)!=="body"),i=null;const o=Pt(e).position==="fixed";let s=o?cn(e):e;for(;_t(s)&&!nr(s);){const a=Pt(s),l=sl(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&nO.has(i.position)||ei(s)&&!l&&gm(e,s))?r=r.filter(f=>f!==s):i=a,s=cn(s)}return t.set(e,r),r}function oO(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?co(t)?[]:iO(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((u,f)=>{const c=mm(t,f,i);return u.top=gt(c.top,u.top),u.right=er(c.right,u.right),u.bottom=er(c.bottom,u.bottom),u.left=gt(c.left,u.left),u},mm(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function sO(e){const{width:t,height:n}=fm(e);return{width:t,height:n}}function aO(e,t,n){const r=jt(t),i=Ut(t),o=n==="fixed",s=Mn(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=zt(0);function u(){l.x=ho(i)}if(r||!r&&!o)if((tr(t)!=="body"||ei(i))&&(a=fo(t)),r){const d=Mn(t,!0,o,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else i&&u();o&&!r&&i&&u();const f=i&&!r&&!o?hm(i,a):zt(0),c=s.left+a.scrollLeft-l.x-f.x,h=s.top+a.scrollTop-l.y-f.y;return{x:c,y:h,width:s.width,height:s.height}}function cl(e){return Pt(e).position==="static"}function ym(e,t){if(!jt(e)||Pt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ut(e)===n&&(n=n.ownerDocument.body),n}function vm(e,t){const n=yt(e);if(co(e))return n;if(!jt(e)){let i=cn(e);for(;i&&!nr(i);){if(_t(i)&&!cl(i))return i;i=cn(i)}return n}let r=ym(e,t);for(;r&&HI(r)&&cl(r);)r=ym(r,t);return r&&nr(r)&&cl(r)&&!sl(r)?n:r||KI(e)||n}const lO=async function(e){const t=this.getOffsetParent||vm,n=this.getDimensions,r=await n(e.floating);return{reference:aO(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function uO(e){return Pt(e).direction==="rtl"}const cO={convertOffsetParentRelativeRectToViewportRelativeRect:JI,getDocumentElement:Ut,getClippingRect:oO,getOffsetParent:vm,getElementRects:lO,getClientRects:XI,getDimensions:sO,getScale:rr,isElement:_t,isRTL:uO};function bm(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function fO(e,t){let n=null,r;const i=Ut(e);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const u=e.getBoundingClientRect(),{left:f,top:c,width:h,height:d}=u;if(a||t(),!h||!d)return;const m=so(c),p=so(i.clientWidth-(f+h)),g=so(i.clientHeight-(c+d)),y=so(f),w={rootMargin:-m+"px "+-p+"px "+-g+"px "+-y+"px",threshold:gt(0,er(1,l))||1};let E=!0;function S(C){const I=C[0].intersectionRatio;if(I!==l){if(!E)return s();I?s(!1,I):r=setTimeout(()=>{s(!1,1e-7)},1e3)}I===1&&!bm(u,e.getBoundingClientRect())&&s(),E=!1}try{n=new IntersectionObserver(S,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(S,w)}n.observe(e)}return s(!0),o}function dO(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=ul(e),f=i||o?[...u?fn(u):[],...fn(t)]:[];f.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),o&&y.addEventListener("resize",n)});const c=u&&a?fO(u,n):null;let h=-1,d=null;s&&(d=new ResizeObserver(y=>{let[v]=y;v&&v.target===u&&d&&(d.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=d)==null||w.observe(t)})),n()}),u&&!l&&d.observe(u),d.observe(t));let m,p=l?Mn(e):null;l&&g();function g(){const y=Mn(e);p&&!bm(p,y)&&n(),p=y,m=requestAnimationFrame(g)}return n(),()=>{var y;f.forEach(v=>{i&&v.removeEventListener("scroll",n),o&&v.removeEventListener("resize",n)}),c==null||c(),(y=d)==null||y.disconnect(),d=null,l&&cancelAnimationFrame(m)}}const hO=$I,pO=BI,mO=zI,gO=(e,t,n)=>{const r=new Map,i={platform:cO,...n},o={...i.platform,_c:r};return LI(e,t,{...i,platform:o})};var yO=typeof document<"u",vO=function(){},po=yO?D.useLayoutEffect:vO;function mo(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!mo(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!mo(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function wm(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Sm(e,t){const n=wm(e);return Math.round(t*n)/n}function fl(e){const t=A.useRef(e);return po(()=>{t.current=e}),t}function bO(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[f,c]=A.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,d]=A.useState(r);mo(h,r)||d(r);const[m,p]=A.useState(null),[g,y]=A.useState(null),v=A.useCallback(B=>{B!==C.current&&(C.current=B,p(B))},[]),w=A.useCallback(B=>{B!==I.current&&(I.current=B,y(B))},[]),E=o||m,S=s||g,C=A.useRef(null),I=A.useRef(null),M=A.useRef(f),P=l!=null,T=fl(l),O=fl(i),U=fl(u),F=A.useCallback(()=>{if(!C.current||!I.current)return;const B={placement:t,strategy:n,middleware:h};O.current&&(B.platform=O.current),gO(C.current,I.current,B).then(W=>{const b={...W,isPositioned:U.current!==!1};L.current&&!mo(M.current,b)&&(M.current=b,ju.flushSync(()=>{c(b)}))})},[h,t,n,O,U]);po(()=>{u===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,c(B=>({...B,isPositioned:!1})))},[u]);const L=A.useRef(!1);po(()=>(L.current=!0,()=>{L.current=!1}),[]),po(()=>{if(E&&(C.current=E),S&&(I.current=S),E&&S){if(T.current)return T.current(E,S,F);F()}},[E,S,F,T,P]);const R=A.useMemo(()=>({reference:C,floating:I,setReference:v,setFloating:w}),[v,w]),N=A.useMemo(()=>({reference:E,floating:S}),[E,S]),j=A.useMemo(()=>{const B={position:n,left:0,top:0};if(!N.floating)return B;const W=Sm(N.floating,f.x),b=Sm(N.floating,f.y);return a?{...B,transform:"translate("+W+"px, "+b+"px)",...wm(N.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:W,top:b}},[n,a,N.floating,f.x,f.y]);return A.useMemo(()=>({...f,update:F,refs:R,elements:N,floatingStyles:j}),[f,F,R,N,j])}const wO=(e,t)=>({...hO(e),options:[e,t]}),SO=(e,t)=>({...pO(e),options:[e,t]}),xO=(e,t)=>({...mO(e),options:[e,t]});/*!
|
|
276
286
|
* tabbable 6.3.0
|
|
277
287
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
278
|
-
*/var xS=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Ea=xS.join(","),ed=typeof Element>"u",ar=ed?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ri=!ed&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},sr=function(t,n){var r;n===void 0&&(n=!0);var i=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),o=i===""||i==="true",a=o||n&&t&&sr(t.parentNode);return a},kS=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},SS=function(t,n,r){if(sr(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(Ea));return n&&ar.call(t,Ea)&&i.unshift(t),i=i.filter(r),i},Ca=function(t,n,r){for(var i=[],o=Array.from(t);o.length;){var a=o.shift();if(!sr(a,!1))if(a.tagName==="SLOT"){var s=a.assignedElements(),l=s.length?s:a.children,u=Ca(l,!0,r);r.flatten?i.push.apply(i,u):i.push({scopeParent:a,candidates:u})}else{var f=ar.call(a,Ea);f&&r.filter(a)&&(n||!t.includes(a))&&i.push(a);var c=a.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(a),p=!sr(c,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(c&&p){var d=Ca(c===!0?a.children:c.children,!0,r);r.flatten?i.push.apply(i,d):i.push({scopeParent:a,candidates:d})}else o.unshift.apply(o,a.children)}}return i},td=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},nd=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||kS(t))&&!td(t)?0:t.tabIndex},ES=function(t,n){var r=nd(t);return r<0&&n&&!td(t)?0:r},CS=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},rd=function(t){return t.tagName==="INPUT"},AS=function(t){return rd(t)&&t.type==="hidden"},IS=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},TS=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},OS=function(t){if(!t.name)return!0;var n=t.form||ri(t),r=function(s){return n.querySelectorAll('input[type="radio"][name="'+s+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=r(window.CSS.escape(t.name));else try{i=r(t.name)}catch(a){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",a.message),!1}var o=TS(i,t.form);return!o||o===t},DS=function(t){return rd(t)&&t.type==="radio"},MS=function(t){return DS(t)&&!OS(t)},_S=function(t){var n,r=t&&ri(t),i=(n=r)===null||n===void 0?void 0:n.host,o=!1;if(r&&r!==t){var a,s,l;for(o=!!((a=i)!==null&&a!==void 0&&(s=a.ownerDocument)!==null&&s!==void 0&&s.contains(i)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!o&&i;){var u,f,c;r=ri(i),i=(u=r)===null||u===void 0?void 0:u.host,o=!!((f=i)!==null&&f!==void 0&&(c=f.ownerDocument)!==null&&c!==void 0&&c.contains(i))}}return o},id=function(t){var n=t.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},PS=function(t,n){var r=n.displayCheck,i=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var o=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!o}if(getComputedStyle(t).visibility==="hidden")return!0;var a=ar.call(t,"details>summary:first-of-type"),s=a?t.parentElement:t;if(ar.call(s,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof i=="function"){for(var l=t;t;){var u=t.parentElement,f=ri(t);if(u&&!u.shadowRoot&&i(u)===!0)return id(t);t.assignedSlot?t=t.assignedSlot:!u&&f!==t.ownerDocument?t=f.host:t=u}t=l}if(_S(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return id(t);return!1},NS=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var i=n.children.item(r);if(i.tagName==="LEGEND")return ar.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},LS=function(t,n){return!(n.disabled||sr(n)||AS(n)||PS(n,t)||IS(n)||NS(n))},od=function(t,n){return!(MS(n)||nd(n)<0||!LS(t,n))},FS=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},ad=function(t){var n=[],r=[];return t.forEach(function(i,o){var a=!!i.scopeParent,s=a?i.scopeParent:i,l=ES(s,a),u=a?ad(i.candidates):s;l===0?a?n.push.apply(n,u):n.push(s):r.push({documentOrder:o,tabIndex:l,item:i,isScope:a,content:u})}),r.sort(CS).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},Aa=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Ca([t],n.includeContainer,{filter:od.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:FS}):r=SS(t,n.includeContainer,od.bind(null,n)),ad(r)};const Ia="ArrowUp",ii="ArrowDown",mn="ArrowLeft",lr="ArrowRight";function oi(e,t,n){return Math.floor(e/t)!==n}function ur(e,t){return t<0||t>=e.current.length}function Ta(e,t){return Ve(e,{disabledIndices:t})}function sd(e,t){return Ve(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Ve(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:i,amount:o=1}=t===void 0?{}:t;const a=e.current;let s=n;do{var l,u;s=s+(r?-o:o)}while(s>=0&&s<=a.length-1&&(i?i.includes(s):a[s]==null||(l=a[s])!=null&&l.hasAttribute("disabled")||((u=a[s])==null?void 0:u.getAttribute("aria-disabled"))==="true"));return s}function RS(e,t){let{event:n,orientation:r,loop:i,cols:o,disabledIndices:a,minIndex:s,maxIndex:l,prevIndex:u,stopEvent:f=!1}=t,c=u;if(n.key===Ia){if(f&&je(n),u===-1)c=l;else if(c=Ve(e,{startingIndex:c,amount:o,decrement:!0,disabledIndices:a}),i&&(u-o<s||c<0)){const p=u%o,d=l%o,m=l-(d-p);d===p?c=l:c=d>p?m:m-o}ur(e,c)&&(c=u)}if(n.key===ii&&(f&&je(n),u===-1?c=s:(c=Ve(e,{startingIndex:u,amount:o,disabledIndices:a}),i&&u+o>l&&(c=Ve(e,{startingIndex:u%o-o,amount:o,disabledIndices:a}))),ur(e,c)&&(c=u)),r==="both"){const p=Af(u/o);n.key===lr&&(f&&je(n),u%o!==o-1?(c=Ve(e,{startingIndex:u,disabledIndices:a}),i&&oi(c,o,p)&&(c=Ve(e,{startingIndex:u-u%o-1,disabledIndices:a}))):i&&(c=Ve(e,{startingIndex:u-u%o-1,disabledIndices:a})),oi(c,o,p)&&(c=u)),n.key===mn&&(f&&je(n),u%o!==0?(c=Ve(e,{startingIndex:u,disabledIndices:a,decrement:!0}),i&&oi(c,o,p)&&(c=Ve(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:a}))):i&&(c=Ve(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:a})),oi(c,o,p)&&(c=u));const d=Af(l/o)===p;ur(e,c)&&(i&&d?c=n.key===mn?l:Ve(e,{startingIndex:u-u%o-1,disabledIndices:a}):c=u)}return c}let ld=0;function Ct(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(ld);const o=()=>e==null?void 0:e.focus({preventScroll:n});i?o():ld=requestAnimationFrame(o)}var Re=typeof document<"u"?_.useLayoutEffect:_.useEffect;function ai(){return ai=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ai.apply(this,arguments)}let Oa=!1,BS=0;const ud=()=>"floating-ui-"+BS++;function zS(){const[e,t]=E.useState(()=>Oa?ud():void 0);return Re(()=>{e==null&&t(ud())},[]),E.useEffect(()=>{Oa||(Oa=!0)},[]),e}const Da=E.useId||zS;function $S(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(i=>i!==n))||[])}}}const jS=E.createContext(null),US=E.createContext(null),cd=()=>{var e;return((e=E.useContext(jS))==null?void 0:e.id)||null},si=()=>E.useContext(US);function cr(e){return"data-floating-ui-"+e}function Ft(e){const t=_.useRef(e);return Re(()=>{t.current=e}),t}function HS(e,t){var n;let r=[],i=(n=e.find(o=>o.id===t))==null?void 0:n.parentId;for(;i;){const o=e.find(a=>a.id===i);i=o==null?void 0:o.parentId,o&&(r=r.concat(o))}return r}function gn(e,t){let n=e.filter(i=>{var o;return i.parentId===t&&((o=i.context)==null?void 0:o.open)}),r=n;for(;r.length;)r=e.filter(i=>{var o;return(o=r)==null?void 0:o.some(a=>{var s;return i.parentId===a.id&&((s=i.context)==null?void 0:s.open)})}),n=n.concat(r);return n}function WS(e,t){let n,r=-1;function i(o,a){a>r&&(n=o,r=a),gn(e,o).forEach(l=>{i(l.id,a+1)})}return i(t,0),e.find(o=>o.id===n)}let yn=new WeakMap,li=new WeakSet,ui={},Ma=0;const VS=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,fd=e=>e&&(e.host||fd(e.parentNode)),qS=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=fd(n);return e.contains(r)?r:null}).filter(n=>n!=null);function KS(e,t,n,r){const i="data-floating-ui-inert",o=r?"inert":n?"aria-hidden":null,a=qS(t,e),s=new Set,l=new Set(a),u=[];ui[i]||(ui[i]=new WeakMap);const f=ui[i];a.forEach(c),p(t),s.clear();function c(d){!d||s.has(d)||(s.add(d),d.parentNode&&c(d.parentNode))}function p(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,m=>{if(s.has(m))p(m);else{const h=o?m.getAttribute(o):null,g=h!==null&&h!=="false",y=(yn.get(m)||0)+1,v=(f.get(m)||0)+1;yn.set(m,y),f.set(m,v),u.push(m),y===1&&g&&li.add(m),v===1&&m.setAttribute(i,""),!g&&o&&m.setAttribute(o,"true")}})}return Ma++,()=>{u.forEach(d=>{const m=(yn.get(d)||0)-1,h=(f.get(d)||0)-1;yn.set(d,m),f.set(d,h),m||(!li.has(d)&&o&&d.removeAttribute(o),li.delete(d)),h||d.removeAttribute(i)}),Ma--,Ma||(yn=new WeakMap,yn=new WeakMap,li=new WeakSet,ui={})}}function dd(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=ft(e[0]).body;return KS(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const _a=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function pd(e,t){const n=Aa(e,_a());t==="prev"&&n.reverse();const r=n.indexOf(Pt(ft(e)));return n.slice(r+1)[0]}function hd(){return pd(document.body,"next")}function md(){return pd(document.body,"prev")}function fr(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Ze(n,r)}function YS(e){Aa(e,_a()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function GS(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const Pa={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};let QS;function gd(e){e.key==="Tab"&&(e.target,clearTimeout(QS))}const ci=E.forwardRef(function(t,n){const[r,i]=E.useState();Re(()=>(_f()&&i("button"),document.addEventListener("keydown",gd),()=>{document.removeEventListener("keydown",gd)}),[]);const o={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[cr("focus-guard")]:"",style:Pa};return E.createElement("span",ai({},t,o))}),yd=E.createContext(null);function JS(e){let{id:t,root:n}=e===void 0?{}:e;const[r,i]=E.useState(null),o=Da(),a=vd(),s=E.useMemo(()=>({id:t,root:n,portalContext:a,uniqueId:o}),[t,n,a,o]),l=E.useRef();return Re(()=>()=>{r==null||r.remove()},[r,s]),Re(()=>{if(l.current===s)return;l.current=s;const{id:u,root:f,portalContext:c,uniqueId:p}=s,d=u?document.getElementById(u):null,m=cr("portal");if(d){const h=document.createElement("div");h.id=p,h.setAttribute(m,""),d.appendChild(h),i(h)}else{let h=f||(c==null?void 0:c.portalNode);h&&!at(h)&&(h=h.current),h=h||document.body;let g=null;u&&(g=document.createElement("div"),g.id=u,h.appendChild(g));const y=document.createElement("div");y.id=p,y.setAttribute(m,""),h=g||h,h.appendChild(y),i(y)}},[s]),r}function ZS(e){let{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e;const o=JS({id:n,root:r}),[a,s]=E.useState(null),l=E.useRef(null),u=E.useRef(null),f=E.useRef(null),c=E.useRef(null),p=!!a&&!a.modal&&a.open&&i&&!!(r||o);return E.useEffect(()=>{if(!o||!i||a!=null&&a.modal)return;function d(m){o&&fr(m)&&(m.type==="focusin"?GS:YS)(o)}return o.addEventListener("focusin",d,!0),o.addEventListener("focusout",d,!0),()=>{o.removeEventListener("focusin",d,!0),o.removeEventListener("focusout",d,!0)}},[o,i,a==null?void 0:a.modal]),E.createElement(yd.Provider,{value:E.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:f,afterInsideRef:c,portalNode:o,setFocusManagerState:s}),[i,o])},p&&o&&E.createElement(ci,{"data-type":"outside",ref:l,onFocus:d=>{if(fr(d,o)){var m;(m=f.current)==null||m.focus()}else{const h=md()||(a==null?void 0:a.refs.domReference.current);h==null||h.focus()}}}),p&&o&&E.createElement("span",{"aria-owns":o.id,style:Pa}),o&&Ps.createPortal(t,o),p&&o&&E.createElement(ci,{"data-type":"outside",ref:u,onFocus:d=>{if(fr(d,o)){var m;(m=c.current)==null||m.focus()}else{const h=hd()||(a==null?void 0:a.refs.domReference.current);h==null||h.focus(),a!=null&&a.closeOnFocusOut&&(a==null||a.onOpenChange(!1,d.nativeEvent))}}}))}const vd=()=>E.useContext(yd),XS=E.forwardRef(function(t,n){return E.createElement("button",ai({},t,{type:"button",ref:n,tabIndex:-1,style:Pa}))});function eE(e){const{context:t,children:n,disabled:r=!1,order:i=["content"],guards:o=!0,initialFocus:a=0,returnFocus:s=!0,modal:l=!0,visuallyHiddenDismiss:u=!1,closeOnFocusOut:f=!0}=e,{open:c,refs:p,nodeId:d,onOpenChange:m,events:h,dataRef:g,elements:{domReference:y,floating:v}}=t,w=VS()?o:!0,A=Ft(i),k=Ft(a),C=Ft(s),T=si(),P=vd(),F=typeof a=="number"&&a<0,I=E.useRef(null),O=E.useRef(null),j=E.useRef(!1),z=E.useRef(null),M=E.useRef(!1),D=P!=null,B=y&&y.getAttribute("role")==="combobox"&&Lf(y)&&F,U=E.useCallback(function(N){return N===void 0&&(N=v),N?Aa(N,_a()):[]},[v]),$=E.useCallback(N=>{const H=U(N);return A.current.map(x=>y&&x==="reference"?y:v&&x==="floating"?v:H).filter(Boolean).flat()},[y,v,A,U]);E.useEffect(()=>{if(r||!l)return;function N(x){if(x.key==="Tab"){Ze(v,Pt(ft(v)))&&U().length===0&&!B&&je(x);const W=$(),ee=Nf(x);A.current[0]==="reference"&&ee===y&&(je(x),x.shiftKey?Ct(W[W.length-1]):Ct(W[1])),A.current[1]==="floating"&&ee===v&&x.shiftKey&&(je(x),Ct(W[0]))}}const H=ft(v);return H.addEventListener("keydown",N),()=>{H.removeEventListener("keydown",N)}},[r,y,v,l,A,p,B,U,$]),E.useEffect(()=>{if(r||!f)return;function N(){M.current=!0,setTimeout(()=>{M.current=!1})}function H(x){const W=x.relatedTarget;queueMicrotask(()=>{const ee=!(Ze(y,W)||Ze(v,W)||Ze(W,v)||Ze(P==null?void 0:P.portalNode,W)||W!=null&&W.hasAttribute(cr("focus-guard"))||T&&(gn(T.nodesRef.current,d).find(Y=>{var J,X;return Ze((J=Y.context)==null?void 0:J.elements.floating,W)||Ze((X=Y.context)==null?void 0:X.elements.domReference,W)})||HS(T.nodesRef.current,d).find(Y=>{var J,X;return((J=Y.context)==null?void 0:J.elements.floating)===W||((X=Y.context)==null?void 0:X.elements.domReference)===W})));W&&ee&&!M.current&&W!==z.current&&(j.current=!0,m(!1,x))})}if(v&&cn(y))return y.addEventListener("focusout",H),y.addEventListener("pointerdown",N),!l&&v.addEventListener("focusout",H),()=>{y.removeEventListener("focusout",H),y.removeEventListener("pointerdown",N),!l&&v.removeEventListener("focusout",H)}},[r,y,v,l,d,T,P,m,f]),E.useEffect(()=>{var N;if(r)return;const H=Array.from((P==null||(N=P.portalNode)==null?void 0:N.querySelectorAll("["+cr("portal")+"]"))||[]);if(v){const x=[v,...H,I.current,O.current,A.current.includes("reference")||B?y:null].filter(ee=>ee!=null),W=l?dd(x,w,!w):dd(x);return()=>{W()}}},[r,y,v,l,A,P,B,w]),Re(()=>{if(r||!v)return;const N=ft(v),H=Pt(N);queueMicrotask(()=>{const x=$(v),W=k.current,ee=(typeof W=="number"?x[W]:W.current)||v,Y=Ze(v,H);!F&&!Y&&c&&Ct(ee,{preventScroll:ee===v})})},[r,c,v,F,$,k]),Re(()=>{if(r||!v)return;let N=!1;const H=ft(v),x=Pt(H),W=g.current;z.current=x;function ee(Y){if(Y.type==="escapeKey"&&p.domReference.current&&(z.current=p.domReference.current),["referencePress","escapeKey"].includes(Y.type))return;const J=Y.data.returnFocus;typeof J=="object"?(j.current=!1,N=J.preventScroll):j.current=!J}return h.on("dismiss",ee),()=>{h.off("dismiss",ee);const Y=Pt(H);(Ze(v,Y)||T&&gn(T.nodesRef.current,d).some(X=>{var ie;return Ze((ie=X.context)==null?void 0:ie.elements.floating,Y)})||W.openEvent&&["click","mousedown"].includes(W.openEvent.type))&&p.domReference.current&&(z.current=p.domReference.current),C.current&&cn(z.current)&&!j.current&&Ct(z.current,{cancelPrevious:!1,preventScroll:N})}},[r,v,C,g,p,h,T,d]),Re(()=>{if(!(r||!P))return P.setFocusManagerState({modal:l,closeOnFocusOut:f,open:c,onOpenChange:m,refs:p}),()=>{P.setFocusManagerState(null)}},[r,P,l,c,m,p,f]),Re(()=>{if(!r&&v&&typeof MutationObserver=="function"&&!F){const N=()=>{const x=v.getAttribute("tabindex");A.current.includes("floating")||Pt(ft(v))!==p.domReference.current&&U().length===0?x!=="0"&&v.setAttribute("tabindex","0"):x!=="-1"&&v.setAttribute("tabindex","-1")};N();const H=new MutationObserver(N);return H.observe(v,{childList:!0,subtree:!0,attributes:!0}),()=>{H.disconnect()}}},[r,v,p,A,U,F]);function V(N){return r||!u||!l?null:E.createElement(XS,{ref:N==="start"?I:O,onClick:H=>m(!1,H.nativeEvent)},typeof u=="string"?u:"Dismiss")}const b=!r&&w&&!B&&(D||l);return E.createElement(E.Fragment,null,b&&E.createElement(ci,{"data-type":"inside",ref:P==null?void 0:P.beforeInsideRef,onFocus:N=>{if(l){const x=$();Ct(i[0]==="reference"?x[0]:x[x.length-1])}else if(P!=null&&P.preserveTabOrder&&P.portalNode)if(j.current=!1,fr(N,P.portalNode)){const x=hd()||y;x==null||x.focus()}else{var H;(H=P.beforeOutsideRef.current)==null||H.focus()}}}),!B&&V("start"),n,V("end"),b&&E.createElement(ci,{"data-type":"inside",ref:P==null?void 0:P.afterInsideRef,onFocus:N=>{if(l)Ct($()[0]);else if(P!=null&&P.preserveTabOrder&&P.portalNode)if(f&&(j.current=!0),fr(N,P.portalNode)){const x=md()||y;x==null||x.focus()}else{var H;(H=P.afterOutsideRef.current)==null||H.focus()}}}))}function bd(e){return cn(e.target)&&e.target.tagName==="BUTTON"}function wd(e){return Lf(e)}function tE(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:i,elements:{domReference:o}}=e,{enabled:a=!0,event:s="click",toggle:l=!0,ignoreMouse:u=!1,keyboardHandlers:f=!0}=t,c=E.useRef(),p=E.useRef(!1);return E.useMemo(()=>a?{reference:{onPointerDown(d){c.current=d.pointerType},onMouseDown(d){d.button===0&&(Pf(c.current)&&u||s!=="click"&&(n&&l&&(!i.current.openEvent||i.current.openEvent.type==="mousedown")?r(!1,d.nativeEvent):(d.preventDefault(),r(!0,d.nativeEvent))))},onClick(d){if(s==="mousedown"&&c.current){c.current=void 0;return}Pf(c.current)&&u||(n&&l&&(!i.current.openEvent||i.current.openEvent.type==="click")?r(!1,d.nativeEvent):r(!0,d.nativeEvent))},onKeyDown(d){c.current=void 0,!(d.defaultPrevented||!f||bd(d))&&(d.key===" "&&!wd(o)&&(d.preventDefault(),p.current=!0),d.key==="Enter"&&r(!(n&&l),d.nativeEvent))},onKeyUp(d){d.defaultPrevented||!f||bd(d)||wd(o)||d.key===" "&&p.current&&(p.current=!1,r(!(n&&l),d.nativeEvent))}}}:{},[a,i,s,u,f,o,l,n,r])}const nE=E.useInsertionEffect||(e=>e());function Rt(e){const t=E.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return nE(()=>{t.current=e}),E.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}const rE={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},iE={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},oE=e=>{var t,n;return{escapeKeyBubbles:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePressBubbles:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function aE(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:i,nodeId:o,elements:{reference:a,domReference:s,floating:l},dataRef:u}=e,{enabled:f=!0,escapeKey:c=!0,outsidePress:p=!0,outsidePressEvent:d="pointerdown",referencePress:m=!1,referencePressEvent:h="pointerdown",ancestorScroll:g=!1,bubbles:y}=t,v=si(),w=cd()!=null,A=Rt(typeof p=="function"?p:()=>!1),k=typeof p=="function"?A:p,C=E.useRef(!1),{escapeKeyBubbles:T,outsidePressBubbles:P}=oE(y),F=Rt(O=>{if(!n||!f||!c||O.key!=="Escape")return;const j=v?gn(v.nodesRef.current,o):[];if(!T&&(O.stopPropagation(),j.length>0)){let z=!0;if(j.forEach(M=>{var D;if((D=M.context)!=null&&D.open&&!M.context.dataRef.current.__escapeKeyBubbles){z=!1;return}}),!z)return}i.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),r(!1,Ck(O)?O.nativeEvent:O)}),I=Rt(O=>{const j=C.current;if(C.current=!1,j||typeof k=="function"&&!k(O))return;const z=Nf(O),M="["+cr("inert")+"]",D=ft(l).querySelectorAll(M);let B=at(z)?z:null;for(;B&&!wk(B);){const V=kk(B);if(V===ft(l).body||!at(V))break;B=V}if(D.length&&at(z)&&!Ak(z)&&!Ze(z,l)&&Array.from(D).every(V=>!Ze(B,V)))return;if(cn(z)&&l){const V=z.clientWidth>0&&z.scrollWidth>z.clientWidth,b=z.clientHeight>0&&z.scrollHeight>z.clientHeight;let N=b&&O.offsetX>z.clientWidth;if(b&&xk(z).direction==="rtl"&&(N=O.offsetX<=z.offsetWidth-z.clientWidth),N||V&&O.offsetY>z.clientHeight)return}const U=v&&gn(v.nodesRef.current,o).some(V=>{var b;return ga(O,(b=V.context)==null?void 0:b.elements.floating)});if(ga(O,l)||ga(O,s)||U)return;const $=v?gn(v.nodesRef.current,o):[];if($.length>0){let V=!0;if($.forEach(b=>{var N;if((N=b.context)!=null&&N.open&&!b.context.dataRef.current.__outsidePressBubbles){V=!1;return}}),!V)return}i.emit("dismiss",{type:"outsidePress",data:{returnFocus:w?{preventScroll:!0}:Df(O)||Mf(O)}}),r(!1,O)});return E.useEffect(()=>{if(!n||!f)return;u.current.__escapeKeyBubbles=T,u.current.__outsidePressBubbles=P;function O(M){r(!1,M)}const j=ft(l);c&&j.addEventListener("keydown",F),k&&j.addEventListener(d,I);let z=[];return g&&(at(s)&&(z=Lt(s)),at(l)&&(z=z.concat(Lt(l))),!at(a)&&a&&a.contextElement&&(z=z.concat(Lt(a.contextElement)))),z=z.filter(M=>{var D;return M!==((D=j.defaultView)==null?void 0:D.visualViewport)}),z.forEach(M=>{M.addEventListener("scroll",O,{passive:!0})}),()=>{c&&j.removeEventListener("keydown",F),k&&j.removeEventListener(d,I),z.forEach(M=>{M.removeEventListener("scroll",O)})}},[u,l,s,a,c,k,d,n,r,g,f,T,P,F,I]),E.useEffect(()=>{C.current=!1},[k,d]),E.useMemo(()=>f?{reference:{onKeyDown:F,[rE[h]]:O=>{m&&(i.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),r(!1,O.nativeEvent))}},floating:{onKeyDown:F,[iE[d]]:()=>{C.current=!0}}}:{},[f,i,m,d,h,r,F])}let Na;process.env.NODE_ENV!=="production"&&(Na=new Set);function sE(e){var t;e===void 0&&(e={});const{open:n=!1,onOpenChange:r,nodeId:i}=e;if(process.env.NODE_ENV!=="production"){var o;const T="Floating UI: Cannot pass a virtual element to the `elements.reference` option, as it must be a real DOM element. Use `refs.setPositionReference` instead.";if((o=e.elements)!=null&&o.reference&&!at(e.elements.reference)){var a;if(!((a=Na)!=null&&a.has(T))){var s;(s=Na)==null||s.add(T),console.error(T)}}}const[l,u]=E.useState(null),f=((t=e.elements)==null?void 0:t.reference)||l,c=yS(e),p=si(),d=Rt((T,P)=>{T&&(h.current.openEvent=P),r==null||r(T,P)}),m=E.useRef(null),h=E.useRef({}),g=E.useState(()=>$S())[0],y=Da(),v=E.useCallback(T=>{const P=at(T)?{getBoundingClientRect:()=>T.getBoundingClientRect(),contextElement:T}:T;c.refs.setReference(P)},[c.refs]),w=E.useCallback(T=>{(at(T)||T===null)&&(m.current=T,u(T)),(at(c.refs.reference.current)||c.refs.reference.current===null||T!==null&&!at(T))&&c.refs.setReference(T)},[c.refs]),A=E.useMemo(()=>({...c.refs,setReference:w,setPositionReference:v,domReference:m}),[c.refs,w,v]),k=E.useMemo(()=>({...c.elements,domReference:f}),[c.elements,f]),C=E.useMemo(()=>({...c,refs:A,elements:k,dataRef:h,nodeId:i,floatingId:y,events:g,open:n,onOpenChange:d}),[c,i,y,g,n,d,A,k]);return Re(()=>{const T=p==null?void 0:p.nodesRef.current.find(P=>P.id===i);T&&(T.context=C)}),E.useMemo(()=>({...c,context:C,refs:A,elements:k}),[c,A,k,C])}function La(e,t,n){const r=new Map;return{...n==="floating"&&{tabIndex:-1},...e,...t.map(i=>i?i[n]:null).concat(e).reduce((i,o)=>(o&&Object.entries(o).forEach(a=>{let[s,l]=a;if(s.indexOf("on")===0){if(r.has(s)||r.set(s,[]),typeof l=="function"){var u;(u=r.get(s))==null||u.push(l),i[s]=function(){for(var f,c=arguments.length,p=new Array(c),d=0;d<c;d++)p[d]=arguments[d];return(f=r.get(s))==null?void 0:f.map(m=>m(...p)).find(m=>m!==void 0)}}}else i[s]=l}),i),{})}}function lE(e){e===void 0&&(e=[]);const t=e,n=E.useCallback(o=>La(o,e,"reference"),t),r=E.useCallback(o=>La(o,e,"floating"),t),i=E.useCallback(o=>La(o,e,"item"),e.map(o=>o==null?void 0:o.item));return E.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:i}),[n,r,i])}let xd=!1;function fi(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function kd(e,t){return fi(t,e===Ia||e===ii,e===mn||e===lr)}function Fa(e,t,n){return fi(t,e===ii,n?e===mn:e===lr)||e==="Enter"||e==" "||e===""}function uE(e,t,n){return fi(t,n?e===mn:e===lr,e===ii)}function Sd(e,t,n){return fi(t,n?e===lr:e===mn,e===Ia)}function cE(e,t){const{open:n,onOpenChange:r,refs:i,elements:{domReference:o,floating:a}}=e,{listRef:s,activeIndex:l,onNavigate:u=()=>{},enabled:f=!0,selectedIndex:c=null,allowEscape:p=!1,loop:d=!1,nested:m=!1,rtl:h=!1,virtual:g=!1,focusItemOnOpen:y="auto",focusItemOnHover:v=!0,openOnArrowKeyDown:w=!0,disabledIndices:A=void 0,orientation:k="vertical",cols:C=1,scrollItemIntoView:T=!0,virtualItemRef:P}=t;process.env.NODE_ENV!=="production"&&(p&&(d||console.warn(["Floating UI: `useListNavigation` looping must be enabled to allow","escaping."].join(" ")),g||console.warn(["Floating UI: `useListNavigation` must be virtual to allow","escaping."].join(" "))),k==="vertical"&&C>1&&console.warn(["Floating UI: In grid list navigation mode (`cols` > 1), the",'`orientation` should be either "horizontal" or "both".'].join(" ")));const F=cd(),I=si(),O=Rt(u),j=E.useRef(y),z=E.useRef(c??-1),M=E.useRef(null),D=E.useRef(!0),B=E.useRef(O),U=E.useRef(!!a),$=E.useRef(!1),V=E.useRef(!1),b=Ft(A),N=Ft(n),H=Ft(T),[x,W]=E.useState(),[ee,Y]=E.useState(),J=Rt(function(K,te,L){L===void 0&&(L=!1);const ne=K.current[te.current];ne&&(g?(W(ne.id),I==null||I.events.emit("virtualfocus",ne),P&&(P.current=ne)):Ct(ne,{preventScroll:!0,sync:Ek()&&_f()?xd||$.current:!1}),requestAnimationFrame(()=>{const me=H.current;me&&ne&&(L||!D.current)&&(ne.scrollIntoView==null||ne.scrollIntoView(typeof me=="boolean"?{block:"nearest",inline:"nearest"}:me))}))});Re(()=>{document.createElement("div").focus({get preventScroll(){return xd=!0,!1}})},[]),Re(()=>{f&&(n&&a?j.current&&c!=null&&(V.current=!0,O(c)):U.current&&(z.current=-1,B.current(null)))},[f,n,a,c,O]),Re(()=>{if(f&&n&&a)if(l==null){if($.current=!1,c!=null)return;if(U.current&&(z.current=-1,J(s,z)),!U.current&&j.current&&(M.current!=null||j.current===!0&&M.current==null)){let K=0;const te=()=>{s.current[0]==null?(K<2&&(K?requestAnimationFrame:queueMicrotask)(te),K++):(z.current=M.current==null||Fa(M.current,k,h)||m?Ta(s,b.current):sd(s,b.current),M.current=null,O(z.current))};te()}}else ur(s,l)||(z.current=l,J(s,z,V.current),V.current=!1)},[f,n,a,l,c,m,s,k,h,O,J,b]),Re(()=>{var K,te;if(!f||a||!I||g||!U.current)return;const L=I.nodesRef.current,ne=(K=L.find(oe=>oe.id===F))==null||(te=K.context)==null?void 0:te.elements.floating,me=Pt(ft(a)),ke=L.some(oe=>oe.context&&Ze(oe.context.elements.floating,me));ne&&!ke&&D.current&&ne.focus({preventScroll:!0})},[f,a,I,F,g]),Re(()=>{if(!f||!I||!g||F)return;function K(te){Y(te.id),P&&(P.current=te)}return I.events.on("virtualfocus",K),()=>{I.events.off("virtualfocus",K)}},[f,I,g,F,P]),Re(()=>{B.current=O,U.current=!!a}),Re(()=>{n||(M.current=null)},[n]);const X=l!=null,ie=E.useMemo(()=>{function K(L){if(!n)return;const ne=s.current.indexOf(L);ne!==-1&&O(ne)}return{onFocus(L){let{currentTarget:ne}=L;K(ne)},onClick:L=>{let{currentTarget:ne}=L;return ne.focus({preventScroll:!0})},...v&&{onMouseMove(L){let{currentTarget:ne}=L;K(ne)},onPointerLeave(L){let{pointerType:ne}=L;!D.current||ne==="touch"||(z.current=-1,J(s,z),O(null),g||Ct(i.floating.current,{preventScroll:!0}))}}}},[n,i,J,v,s,O,g]);return E.useMemo(()=>{if(!f)return{};const K=b.current;function te(oe){if(D.current=!1,$.current=!0,!N.current&&oe.currentTarget===i.floating.current)return;if(m&&Sd(oe.key,k,h)){je(oe),r(!1,oe.nativeEvent),cn(o)&&!g&&o.focus();return}const G=z.current,ue=Ta(s,K),de=sd(s,K);if(oe.key==="Home"&&(je(oe),z.current=ue,O(z.current)),oe.key==="End"&&(je(oe),z.current=de,O(z.current)),!(C>1&&(z.current=RS(s,{event:oe,orientation:k,loop:d,cols:C,disabledIndices:K,minIndex:ue,maxIndex:de,prevIndex:z.current,stopEvent:!0}),O(z.current),k==="both"))&&kd(oe.key,k)){if(je(oe),n&&!g&&Pt(oe.currentTarget.ownerDocument)===oe.currentTarget){z.current=Fa(oe.key,k,h)?ue:de,O(z.current);return}Fa(oe.key,k,h)?d?z.current=G>=de?p&&G!==s.current.length?-1:ue:Ve(s,{startingIndex:G,disabledIndices:K}):z.current=Math.min(de,Ve(s,{startingIndex:G,disabledIndices:K})):d?z.current=G<=ue?p&&G!==-1?s.current.length:de:Ve(s,{startingIndex:G,decrement:!0,disabledIndices:K}):z.current=Math.max(ue,Ve(s,{startingIndex:G,decrement:!0,disabledIndices:K})),ur(s,z.current)?O(null):O(z.current)}}function L(oe){y==="auto"&&Df(oe.nativeEvent)&&(j.current=!0)}function ne(oe){j.current=y,y==="auto"&&Mf(oe.nativeEvent)&&(j.current=!0)}const me=g&&n&&X&&{"aria-activedescendant":ee||x},ke=s.current.find(oe=>(oe==null?void 0:oe.id)===x);return{reference:{...me,onKeyDown(oe){D.current=!1;const G=oe.key.indexOf("Arrow")===0,ue=uE(oe.key,k,h),de=Sd(oe.key,k,h),we=kd(oe.key,k),Se=(m?ue:we)||oe.key==="Enter"||oe.key.trim()==="";if(g&&n){const se=I==null?void 0:I.nodesRef.current.find(q=>q.parentId==null),R=I&&se?WS(I.nodesRef.current,se.id):null;if(G&&R&&P){const q=new KeyboardEvent("keydown",{key:oe.key,bubbles:!0});if(ue||de){var Ue,Ye;const ae=((Ue=R.context)==null?void 0:Ue.elements.domReference)===oe.currentTarget,le=de&&!ae?(Ye=R.context)==null?void 0:Ye.elements.domReference:ue?ke:null;le&&(je(oe),le.dispatchEvent(q),Y(void 0))}if(we&&R.context&&R.context.open&&R.parentId&&oe.currentTarget!==R.context.elements.domReference){var Z;je(oe),(Z=R.context.elements.domReference)==null||Z.dispatchEvent(q);return}}return te(oe)}if(!(!n&&!w&&G)){if(Se&&(M.current=m&&we?null:oe.key),m){ue&&(je(oe),n?(z.current=Ta(s,K),O(z.current)):r(!0,oe.nativeEvent));return}we&&(c!=null&&(z.current=c),je(oe),!n&&w?r(!0,oe.nativeEvent):te(oe),n&&O(z.current))}},onFocus(){n&&O(null)},onPointerDown:ne,onMouseDown:L,onClick:L},floating:{"aria-orientation":k==="both"?void 0:k,...me,onKeyDown:te,onPointerMove(){D.current=!0}},item:ie}},[o,i,x,ee,b,N,s,f,k,h,g,n,X,m,c,w,p,C,d,y,O,r,ie,I,P])}function fE(e,t){t===void 0&&(t={});const{open:n,floatingId:r}=e,{enabled:i=!0,role:o="dialog"}=t,a=Da();return E.useMemo(()=>{const s={id:r,role:o};return i?o==="tooltip"?{reference:{"aria-describedby":n?r:void 0},floating:s}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":o==="alertdialog"?"dialog":o,"aria-controls":n?r:void 0,...o==="listbox"&&{role:"combobox"},...o==="menu"&&{id:a}},floating:{...s,...o==="menu"&&{"aria-labelledby":a}}}:{}},[i,o,n,r,a])}function dE(e,t){var n;const{open:r,dataRef:i}=e,{listRef:o,activeIndex:a,onMatch:s,onTypingChange:l,enabled:u=!0,findMatch:f=null,resetMs:c=750,ignoreKeys:p=[],selectedIndex:d=null}=t,m=E.useRef(),h=E.useRef(""),g=E.useRef((n=d??a)!=null?n:-1),y=E.useRef(null),v=Rt(s),w=Rt(l),A=Ft(f),k=Ft(p);return Re(()=>{r&&(clearTimeout(m.current),y.current=null,h.current="")},[r]),Re(()=>{if(r&&h.current===""){var C;g.current=(C=d??a)!=null?C:-1}},[r,d,a]),E.useMemo(()=>{if(!u)return{};function C(F){F?i.current.typing||(i.current.typing=F,w(F)):i.current.typing&&(i.current.typing=F,w(F))}function T(F,I,O){const j=A.current?A.current(I,O):I.find(z=>(z==null?void 0:z.toLocaleLowerCase().indexOf(O.toLocaleLowerCase()))===0);return j?F.indexOf(j):-1}function P(F){const I=o.current;if(h.current.length>0&&h.current[0]!==" "&&(T(I,I,h.current)===-1?C(!1):F.key===" "&&je(F)),I==null||k.current.includes(F.key)||F.key.length!==1||F.ctrlKey||F.metaKey||F.altKey)return;r&&F.key!==" "&&(je(F),C(!0)),I.every(M=>{var D,B;return M?((D=M[0])==null?void 0:D.toLocaleLowerCase())!==((B=M[1])==null?void 0:B.toLocaleLowerCase()):!0})&&h.current===F.key&&(h.current="",g.current=y.current),h.current+=F.key,clearTimeout(m.current),m.current=setTimeout(()=>{h.current="",g.current=y.current,C(!1)},c);const j=g.current,z=T(I,[...I.slice((j||0)+1),...I.slice(0,(j||0)+1)],h.current);z!==-1?(v(z),y.current=z):F.key!==" "&&(h.current="",C(!1))}return{reference:{onKeyDown:P},floating:{onKeyDown:P,onKeyUp(F){F.key===" "&&C(!1)}}}},[u,r,i,o,c,k,A,v,w])}const pE=({options:e,reusable:t,sendMessage:n,isReadOnly:r})=>{var D,B,U,$,V;const i=sn(b=>b.messageContainerRef),o=sn(b=>b.portalContainer),[a,s]=E.useState(!1),[l,u]=E.useState(null),[f,c]=E.useState(null),{message:{blocks:{dropdown:p}}}=ge,d=e.reduce((b,N)=>(b[N.label]=N.value,b),{}),m=d?Object.keys(d):[],h=b=>{s(f!==null&&!t?!1:b)},{refs:g,floatingStyles:y,context:v}=sE({placement:"bottom-start",open:a,onOpenChange:h,whileElementsMounted:cS,middleware:[vS(5),bS({padding:10,boundary:(i==null?void 0:i.current)??void 0,crossAxis:!0}),wS({apply({rects:b,elements:N,availableHeight:H}){Object.assign(N.floating.style,{maxHeight:`${H}px`,minWidth:`${b.reference.width}px`})},padding:10})]}),w=E.useRef([]),A=E.useRef(m),k=E.useRef(!1),C=tE(v,{event:"mousedown"}),T=aE(v),P=fE(v,{role:"listbox"}),F=cE(v,{listRef:w,activeIndex:l,selectedIndex:f,onNavigate:u,loop:!0}),I=dE(v,{listRef:A,activeIndex:l,selectedIndex:f,onMatch:a?u:c,onTypingChange(b){k.current=b}}),{getReferenceProps:O,getFloatingProps:j,getItemProps:z}=lE([T,P,F,I,C]),M=b=>{c(b),m[b]!==void 0&&(n==null||n({type:"text",text:m[b]??"",value:d[m[b]]??""})),s(!1)};return S.jsxs(S.Fragment,{children:[S.jsxs("div",{tabIndex:0,ref:g.setReference,"aria-labelledby":"select-label","aria-autocomplete":"none","data-disabled":f!==null&&!t?"":void 0,style:r?{pointerEvents:"none"}:void 0,...(D=p.button)==null?void 0:D.container,...O(),children:[S.jsx("span",{...(B=p.button)==null?void 0:B.text,children:f?m[f]:"Select..."}),S.jsx(P0,{...(U=p.button)==null?void 0:U.icon})]}),a&&S.jsx(ZS,{root:o??void 0,children:S.jsx(eE,{context:v,modal:!1,children:S.jsx("div",{ref:g.setFloating,className:(V=($=p.content)==null?void 0:$.container)==null?void 0:V.className,style:{...y,pointerEvents:"auto"},...j(),children:m.map((b,N)=>{var H;return S.jsx("div",{ref:x=>{w.current[N]=x},role:"option",tabIndex:N===l?0:-1,"aria-selected":N===f&&N===l,"data-active":N===l?"":void 0,...(H=p.content)==null?void 0:H.item,...z({onClick(){M(N)},onKeyDown(x){x.key==="Enter"&&(x.preventDefault(),M(N)),x.key===" "&&!k.current&&(x.preventDefault(),M(N))}}),children:b},b)})})})})]})},Ed=_.forwardRef(({title:e,url:t,isReadOnly:n,...r},i)=>{const{message:{blocks:{file:o}}}=ge;return S.jsxs("a",{...r,...o.container,href:t,style:n?{pointerEvents:"none"}:void 0,download:!0,ref:i,target:"_blank",rel:"noreferrer",children:[S.jsx("p",{...o.title,children:e||t}),S.jsx(z0,{...o.icon})]})});Ed.displayName="File";const hE=_t()((e,t)=>({components:{},getCustomComponent:async n=>{const r=t().components[n];if(r)return r;const i=await fetch(n).then(u=>u.text()),o=new Blob([i],{type:"application/javascript"}),s=await import(URL.createObjectURL(o)),l=()=>s.default;return e(u=>({components:{...u.components,[n]:l}})),l}}));globalThis.React=_;const Cd={audio:hf,bubble:lf,button:P1,carousel:Cf,column:gf,dropdown:pE,file:Ed,image:df,location:mf,row:yf,text:i1,video:pf,custom:({url:e,name:t,data:n,...r})=>{const i=hE(u=>u.getCustomComponent),[o,a]=_.useState(null),[s,l]=_.useState(null);return _.useEffect(()=>{i(e).then(a).catch(u=>{l(u.message)})},[e]),s?S.jsx("div",{style:{color:"red"},children:s}):o?S.jsx(o,{...n,...r}):null}},Yt=({block:e,renderers:t,...n})=>{const r=(t==null?void 0:t[e.type])??Cd[e.type],i={...n,...e};return S.jsx(r,{...i})};function Ad(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Ad(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function dr(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Ad(e))&&(r&&(r+=" "),r+=t);return r}const mE=({disabled:e,onFileSelected:t})=>{const n=_.useRef(null),{uploadButton:r}=ge.composer,i=()=>{n.current&&n.current.click()},o=a=>{const s=a.target.files;s&&s.length>0&&Array.from(s).forEach(l=>{t(l)})};return S.jsxs(S.Fragment,{children:[S.jsx(Q0,{...r,role:"button",tabIndex:0,"aria-label":"Upload File Button","data-disabled":e,onClick:i}),S.jsx("input",{value:"",multiple:!0,type:"file",ref:n,style:{display:"none"},onChange:o})]})},gE=({name:e,type:t,instance:n,status:r,removeFile:i})=>{const{loader:o,fileIcon:a,removeIcon:s,errorIcon:l,previewImage:u}=ge.composer.fileWidget,f=["PNG","JPEG","JPG"].includes(pi(n.name));return r==="loading"?S.jsx(di,{name:e,status:r,removeButton:S.jsx("div",{...o}),extension:pi(n.name),children:S.jsx("div",{...a.container,children:S.jsx(Ra,{type:t,...a.icon})})}):r==="error"?S.jsx(di,{name:e,status:r,removeButton:S.jsx(Id,{removeFile:()=>i(e)}),extension:"Upload Error",children:S.jsxs("div",{...a.container,children:[S.jsx(F0,{...l}),S.jsx(Ra,{type:t,...a.icon})]})}):r=="uploaded"&&f?S.jsx(di,{name:e,status:r,removeButton:S.jsx(Id,{removeFile:()=>i(e)}),extension:pi(n.name),children:S.jsx("div",{...a.container,children:S.jsx("img",{src:URL.createObjectURL(n),alt:e,...u})})}):S.jsx(di,{name:e,status:r,removeButton:S.jsx(_c,{onClick:()=>i(e),...s}),extension:pi(n.name),children:S.jsx("div",{...a.container,children:S.jsx(Ra,{type:t,...a.icon})})})},di=({name:e,status:t,removeButton:n,children:r,extension:i})=>{const{container:o,metadata:a}=ge.composer.fileWidget;return S.jsxs("div",{"data-status":t,title:e,...o,children:[n,r,S.jsxs("div",{...a.container,children:[S.jsx("div",{...a.name,children:e}),S.jsx("div",{...a.type,children:i})]})]})},Ra=({type:e,...t})=>e==="image"?S.jsx(U0,{...t}):e==="video"?S.jsx(t1,{...t}):e==="audio"?S.jsx(Lc,{...t}):S.jsx(Pc,{...t}),pi=e=>{if(!e)return"File";const t=e.split(".").pop();return t?t.toUpperCase():"File"},Id=({removeFile:e})=>{const{composer:{fileWidget:{removeIcon:t}}}=ge;return S.jsx(_c,{role:"button",tabIndex:0,"aria-label":"Remove File Button",onClick:()=>e(),...t})};function Ba(){return Ba=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ba.apply(null,arguments)}function yE(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var vE=_.useLayoutEffect,bE=function(t){var n=_.useRef(t);return vE(function(){n.current=t}),n},Td=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},wE=function(t,n){var r=_.useRef();return _.useCallback(function(i){t.current=i,r.current&&Td(r.current,null),r.current=n,n&&Td(n,i)},[n])},Od={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},xE=function(t){Object.keys(Od).forEach(function(n){t.style.setProperty(n,Od[n],"important")})},Dd=xE,Ke=null,Md=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function kE(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),Ke||(Ke=document.createElement("textarea"),Ke.setAttribute("tabindex","-1"),Ke.setAttribute("aria-hidden","true"),Dd(Ke)),Ke.parentNode===null&&document.body.appendChild(Ke);var i=e.paddingSize,o=e.borderSize,a=e.sizingStyle,s=a.boxSizing;Object.keys(a).forEach(function(p){var d=p;Ke.style[d]=a[d]}),Dd(Ke),Ke.value=t;var l=Md(Ke,e);Ke.value=t,l=Md(Ke,e),Ke.value="x";var u=Ke.scrollHeight-i,f=u*n;s==="border-box"&&(f=f+i+o),l=Math.max(f,l);var c=u*r;return s==="border-box"&&(c=c+i+o),l=Math.min(c,l),[l,u]}var _d=function(){},SE=function(t,n){return t.reduce(function(r,i){return r[i]=n[i],r},{})},EE=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],CE=!!document.documentElement.currentStyle,AE=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=SE(EE,n),i=r.boxSizing;if(i==="")return null;CE&&i==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var o=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),a=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:o,borderSize:a}},IE=AE;function Pd(e,t,n){var r=bE(n);E.useLayoutEffect(function(){var i=function(a){return r.current(a)};if(e)return e.addEventListener(t,i),function(){return e.removeEventListener(t,i)}},[])}var TE=function(t){Pd(window,"resize",t)},OE=function(t){Pd(document.fonts,"loadingdone",t)},DE=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],ME=function(t,n){var r=t.cacheMeasurements,i=t.maxRows,o=t.minRows,a=t.onChange,s=a===void 0?_d:a,l=t.onHeightChange,u=l===void 0?_d:l,f=yE(t,DE),c=f.value!==void 0,p=E.useRef(null),d=wE(p,n),m=E.useRef(0),h=E.useRef(),g=function(){var w=p.current,A=r&&h.current?h.current:IE(w);if(A){h.current=A;var k=kE(A,w.value||w.placeholder||"x",o,i),C=k[0],T=k[1];m.current!==C&&(m.current=C,w.style.setProperty("height",C+"px","important"),u(C,{rowHeight:T}))}},y=function(w){c||g(),s(w)};return E.useLayoutEffect(g),TE(g),OE(g),E.createElement("textarea",Ba({},f,{onChange:y,ref:d}))},_E=E.forwardRef(ME);const PE=({inputRef:e,composerPlaceholder:t,composerDisabled:n,textInput:r,historyIndex:i,setTextInput:o,setHistoryIndex:a,sendComposerMessage:s,allowFileUpload:l,onFilePasted:u})=>{const f=qc(h=>h.messageHistory),[c,p]=_.useState(""),{input:d}=ge.composer,m=h=>{if(!l||!u||!h.clipboardData)return;const g=Array.from(h.clipboardData.files);g.length>0&&(h.preventDefault(),g.forEach(y=>{u(y)}))};return S.jsx(_E,{...d,"aria-label":"Message Input",ref:e,placeholder:t??"Type your message...",disabled:n,value:r,"data-has-value":!!r,onChange:h=>{const g=h.target.value;o(g),f.includes(g)||a(-1)},onPaste:m,maxRows:5,onKeyDown:h=>{if(n)return;const g=h.nativeEvent;if(!(g.isComposing||g.keyCode===229)&&(h.key==="Enter"&&h.shiftKey?(h.preventDefault(),o(`${r}
|
|
279
|
-
`)):
|
|
280
|
-
`)||r.trim().includes("\r")))){if(h.key==="ArrowUp"){h.preventDefault(),i===-1&&r.trim()!==""&&p(r);const y=Math.min(i+1,f.length-1);a(y),o(f[y]??"")}if(h.key==="ArrowDown"){h.preventDefault();const y=Math.max(i-1,-1);o(i===-1?r.trim():y===-1?c:f[y]??""),a(y)}}}})},NE=({disabled:e,setTextInput:t})=>{const[n,r]=_.useState(!1),i=_.useRef(null),{voiceButton:o}=ge.composer,a=window.SpeechRecognition||window.webkitSpeechRecognition,s=()=>{i.current||(i.current=new a);const l=i.current;l&&(l.continuous=!0,l.onresult=u=>{var c,p,d;const f=((d=(p=(c=u.results)==null?void 0:c[0])==null?void 0:p[0])==null?void 0:d.transcript)??"";t(f??""),l.stop(),r(!1)},n?(l.stop(),r(!1)):(l.start(),r(!0)))};if(a)return S.jsx(K0,{...o,tabIndex:0,"aria-label":"Voice Input Button",role:"button","data-show":!e,"data-listens":!!n,onClick:s})},Nd=_.memo(_.forwardRef(({className:e,inputRef:t,disableComposer:n,isReadOnly:r,allowFileUpload:i,disableSendButton:o,connected:a,composerPlaceholder:s,footer:l,sendMessage:u,uploadFile:f,storageKey:c,children:p,...d},m)=>{const{composer:h}=ge,g=n||r||!a,[y,v]=_.useState(""),[w,A]=_.useState(-1),k=of(c),C=k(M=>M.files),T=k(M=>M.setFiles),P=k(M=>M.deleteFile),F=k(M=>M.uploadFile),I=qc(M=>M.addMessageToHistory),O=C.filter(M=>M.status==="uploaded"),j=!!y.trim()||O.length>0,z=()=>{if(o||!j)return;const M=(O==null?void 0:O.map(B=>{const U=B.url,$=B.type;return{video:{type:"video",videoUrl:U},audio:{type:"audio",audioUrl:U},image:{type:"image",imageUrl:U}}[$]??{title:B.name,type:"file",fileUrl:U}}))??[];y&&M.push({type:"text",text:y});let D;M.length==1?D=M[0]:D={type:"bloc",items:M.map(U=>{const{type:$,...V}=U;return{type:$,payload:V}})},v(""),u==null||u(D),T([]),I(y),A(-1)};return r?null:S.jsxs(S.Fragment,{children:[S.jsxs("div",{"data-disabled":g,"data-waiting":o,className:dr(h.container.className,e),ref:m,...d,children:[p,C.length>0&&S.jsx("div",{...h==null?void 0:h.fileContainer,children:C.map(M=>S.jsx(gE,{...M,removeFile:P},M.name))}),S.jsxs("div",{...h.inputContainer,onClick:()=>{t&&"current"in t&&t.current&&t.current.focus()},children:[i&&S.jsx(mE,{disabled:g,onFileSelected:M=>{f&&F(M,f)}}),S.jsx(PE,{inputRef:t,composerPlaceholder:s,composerDisabled:g,textInput:y,historyIndex:w,setTextInput:v,setHistoryIndex:A,sendComposerMessage:z,allowFileUpload:i,onFilePasted:M=>{f&&F(M,f)}}),o&&S.jsx(H0,{...h.inputLoader,role:"status","data-show":o}),!g&&!o&&S.jsxs(S.Fragment,{children:[S.jsx(M0,{...h.sendbutton,role:"button",tabIndex:0,"aria-label":"Send Message Button","data-show":j,onClick:()=>z()}),S.jsx(NE,{disabled:j,setTextInput:v})]})]})]}),S.jsx(Qu,{components:{a:({node:M,...D})=>S.jsx("a",{...D,target:"_blank",rel:"noreferrer noopener"})},allowedElements:["a","strong","code","em","p","span"],...h.footer,children:l})]})}));var za={exports:{}},hi={exports:{}},Ce={};/** @license React v16.13.1
|
|
288
|
+
*/var kO=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],dl=kO.join(","),xm=typeof Element>"u",ti=xm?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,go=!xm&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},ni=function(t,n){var r;n===void 0&&(n=!0);var i=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),o=i===""||i==="true",s=o||n&&t&&ni(t.parentNode);return s},EO=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},CO=function(t,n,r){if(ni(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(dl));return n&&ti.call(t,dl)&&i.unshift(t),i=i.filter(r),i},hl=function(t,n,r){for(var i=[],o=Array.from(t);o.length;){var s=o.shift();if(!ni(s,!1))if(s.tagName==="SLOT"){var a=s.assignedElements(),l=a.length?a:s.children,u=hl(l,!0,r);r.flatten?i.push.apply(i,u):i.push({scopeParent:s,candidates:u})}else{var f=ti.call(s,dl);f&&r.filter(s)&&(n||!t.includes(s))&&i.push(s);var c=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),h=!ni(c,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(c&&h){var d=hl(c===!0?s.children:c.children,!0,r);r.flatten?i.push.apply(i,d):i.push({scopeParent:s,candidates:d})}else o.unshift.apply(o,s.children)}}return i},km=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Em=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||EO(t))&&!km(t)?0:t.tabIndex},AO=function(t,n){var r=Em(t);return r<0&&n&&!km(t)?0:r},TO=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Cm=function(t){return t.tagName==="INPUT"},IO=function(t){return Cm(t)&&t.type==="hidden"},OO=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},MO=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},DO=function(t){if(!t.name)return!0;var n=t.form||go(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=r(window.CSS.escape(t.name));else try{i=r(t.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var o=MO(i,t.form);return!o||o===t},NO=function(t){return Cm(t)&&t.type==="radio"},_O=function(t){return NO(t)&&!DO(t)},PO=function(t){var n,r=t&&go(t),i=(n=r)===null||n===void 0?void 0:n.host,o=!1;if(r&&r!==t){var s,a,l;for(o=!!((s=i)!==null&&s!==void 0&&(a=s.ownerDocument)!==null&&a!==void 0&&a.contains(i)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!o&&i;){var u,f,c;r=go(i),i=(u=r)===null||u===void 0?void 0:u.host,o=!!((f=i)!==null&&f!==void 0&&(c=f.ownerDocument)!==null&&c!==void 0&&c.contains(i))}}return o},Am=function(t){var n=t.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},LO=function(t,n){var r=n.displayCheck,i=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var o=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!o}if(getComputedStyle(t).visibility==="hidden")return!0;var s=ti.call(t,"details>summary:first-of-type"),a=s?t.parentElement:t;if(ti.call(a,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof i=="function"){for(var l=t;t;){var u=t.parentElement,f=go(t);if(u&&!u.shadowRoot&&i(u)===!0)return Am(t);t.assignedSlot?t=t.assignedSlot:!u&&f!==t.ownerDocument?t=f.host:t=u}t=l}if(PO(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Am(t);return!1},FO=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var i=n.children.item(r);if(i.tagName==="LEGEND")return ti.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},RO=function(t,n){return!(n.disabled||ni(n)||IO(n)||LO(n,t)||OO(n)||FO(n))},Tm=function(t,n){return!(_O(n)||Em(n)<0||!RO(t,n))},$O=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Im=function(t){var n=[],r=[];return t.forEach(function(i,o){var s=!!i.scopeParent,a=s?i.scopeParent:i,l=AO(a,s),u=s?Im(i.candidates):a;l===0?s?n.push.apply(n,u):n.push(a):r.push({documentOrder:o,tabIndex:l,item:i,isScope:s,content:u})}),r.sort(TO).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},pl=function(t,n){n=n||{};var r;return n.getShadowRoot?r=hl([t],n.includeContainer,{filter:Tm.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:$O}):r=CO(t,n.includeContainer,Tm.bind(null,n)),Im(r)};const ml="ArrowUp",yo="ArrowDown",ir="ArrowLeft",ri="ArrowRight";function vo(e,t,n){return Math.floor(e/t)!==n}function ii(e,t){return t<0||t>=e.current.length}function gl(e,t){return nt(e,{disabledIndices:t})}function Om(e,t){return nt(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function nt(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:i,amount:o=1}=t===void 0?{}:t;const s=e.current;let a=n;do{var l,u;a=a+(r?-o:o)}while(a>=0&&a<=s.length-1&&(i?i.includes(a):s[a]==null||(l=s[a])!=null&&l.hasAttribute("disabled")||((u=s[a])==null?void 0:u.getAttribute("aria-disabled"))==="true"));return a}function BO(e,t){let{event:n,orientation:r,loop:i,cols:o,disabledIndices:s,minIndex:a,maxIndex:l,prevIndex:u,stopEvent:f=!1}=t,c=u;if(n.key===ml){if(f&&Je(n),u===-1)c=l;else if(c=nt(e,{startingIndex:c,amount:o,decrement:!0,disabledIndices:s}),i&&(u-o<a||c<0)){const h=u%o,d=l%o,m=l-(d-h);d===h?c=l:c=d>h?m:m-o}ii(e,c)&&(c=u)}if(n.key===yo&&(f&&Je(n),u===-1?c=a:(c=nt(e,{startingIndex:u,amount:o,disabledIndices:s}),i&&u+o>l&&(c=nt(e,{startingIndex:u%o-o,amount:o,disabledIndices:s}))),ii(e,c)&&(c=u)),r==="both"){const h=Kp(u/o);n.key===ri&&(f&&Je(n),u%o!==o-1?(c=nt(e,{startingIndex:u,disabledIndices:s}),i&&vo(c,o,h)&&(c=nt(e,{startingIndex:u-u%o-1,disabledIndices:s}))):i&&(c=nt(e,{startingIndex:u-u%o-1,disabledIndices:s})),vo(c,o,h)&&(c=u)),n.key===ir&&(f&&Je(n),u%o!==0?(c=nt(e,{startingIndex:u,disabledIndices:s,decrement:!0}),i&&vo(c,o,h)&&(c=nt(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}))):i&&(c=nt(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s})),vo(c,o,h)&&(c=u));const d=Kp(l/o)===h;ii(e,c)&&(i&&d?c=n.key===ir?l:nt(e,{startingIndex:u-u%o-1,disabledIndices:s}):c=u)}return c}let Mm=0;function Gt(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(Mm);const o=()=>e==null?void 0:e.focus({preventScroll:n});i?o():Mm=requestAnimationFrame(o)}var Ye=typeof document<"u"?D.useLayoutEffect:D.useEffect;function bo(){return bo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bo.apply(this,arguments)}let yl=!1,zO=0;const Dm=()=>"floating-ui-"+zO++;function UO(){const[e,t]=A.useState(()=>yl?Dm():void 0);return Ye(()=>{e==null&&t(Dm())},[]),A.useEffect(()=>{yl||(yl=!0)},[]),e}const vl=A.useId||UO;function jO(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(i=>i!==n))||[])}}}const HO=A.createContext(null),VO=A.createContext(null),Nm=()=>{var e;return((e=A.useContext(HO))==null?void 0:e.id)||null},wo=()=>A.useContext(VO);function oi(e){return"data-floating-ui-"+e}function dn(e){const t=D.useRef(e);return Ye(()=>{t.current=e}),t}function WO(e,t){var n;let r=[],i=(n=e.find(o=>o.id===t))==null?void 0:n.parentId;for(;i;){const o=e.find(s=>s.id===i);i=o==null?void 0:o.parentId,o&&(r=r.concat(o))}return r}function or(e,t){let n=e.filter(i=>{var o;return i.parentId===t&&((o=i.context)==null?void 0:o.open)}),r=n;for(;r.length;)r=e.filter(i=>{var o;return(o=r)==null?void 0:o.some(s=>{var a;return i.parentId===s.id&&((a=i.context)==null?void 0:a.open)})}),n=n.concat(r);return n}function qO(e,t){let n,r=-1;function i(o,s){s>r&&(n=o,r=s),or(e,o).forEach(l=>{i(l.id,s+1)})}return i(t,0),e.find(o=>o.id===n)}let sr=new WeakMap,So=new WeakSet,xo={},bl=0;const YO=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,_m=e=>e&&(e.host||_m(e.parentNode)),KO=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=_m(n);return e.contains(r)?r:null}).filter(n=>n!=null);function GO(e,t,n,r){const i="data-floating-ui-inert",o=r?"inert":n?"aria-hidden":null,s=KO(t,e),a=new Set,l=new Set(s),u=[];xo[i]||(xo[i]=new WeakMap);const f=xo[i];s.forEach(c),h(t),a.clear();function c(d){!d||a.has(d)||(a.add(d),d.parentNode&&c(d.parentNode))}function h(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,m=>{if(a.has(m))h(m);else{const p=o?m.getAttribute(o):null,g=p!==null&&p!=="false",y=(sr.get(m)||0)+1,v=(f.get(m)||0)+1;sr.set(m,y),f.set(m,v),u.push(m),y===1&&g&&So.add(m),v===1&&m.setAttribute(i,""),!g&&o&&m.setAttribute(o,"true")}})}return bl++,()=>{u.forEach(d=>{const m=(sr.get(d)||0)-1,p=(f.get(d)||0)-1;sr.set(d,m),f.set(d,p),m||(!So.has(d)&&o&&d.removeAttribute(o),So.delete(d)),p||d.removeAttribute(i)}),bl--,bl||(sr=new WeakMap,sr=new WeakMap,So=new WeakSet,xo={})}}function Pm(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=Nt(e[0]).body;return GO(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const wl=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Lm(e,t){const n=pl(e,wl());t==="prev"&&n.reverse();const r=n.indexOf(un(Nt(e)));return n.slice(r+1)[0]}function Fm(){return Lm(document.body,"next")}function Rm(){return Lm(document.body,"prev")}function si(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!ft(n,r)}function QO(e){pl(e,wl()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function ZO(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const Sl={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};let JO;function $m(e){e.key==="Tab"&&(e.target,clearTimeout(JO))}const ko=A.forwardRef(function(t,n){const[r,i]=A.useState();Ye(()=>(em()&&i("button"),document.addEventListener("keydown",$m),()=>{document.removeEventListener("keydown",$m)}),[]);const o={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[oi("focus-guard")]:"",style:Sl};return A.createElement("span",bo({},t,o))}),Bm=A.createContext(null);function XO(e){let{id:t,root:n}=e===void 0?{}:e;const[r,i]=A.useState(null),o=vl(),s=zm(),a=A.useMemo(()=>({id:t,root:n,portalContext:s,uniqueId:o}),[t,n,s,o]),l=A.useRef();return Ye(()=>()=>{r==null||r.remove()},[r,a]),Ye(()=>{if(l.current===a)return;l.current=a;const{id:u,root:f,portalContext:c,uniqueId:h}=a,d=u?document.getElementById(u):null,m=oi("portal");if(d){const p=document.createElement("div");p.id=h,p.setAttribute(m,""),d.appendChild(p),i(p)}else{let p=f||(c==null?void 0:c.portalNode);p&&!kt(p)&&(p=p.current),p=p||document.body;let g=null;u&&(g=document.createElement("div"),g.id=u,p.appendChild(g));const y=document.createElement("div");y.id=h,y.setAttribute(m,""),p=g||p,p.appendChild(y),i(y)}},[a]),r}function eM(e){let{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e;const o=XO({id:n,root:r}),[s,a]=A.useState(null),l=A.useRef(null),u=A.useRef(null),f=A.useRef(null),c=A.useRef(null),h=!!s&&!s.modal&&s.open&&i&&!!(r||o);return A.useEffect(()=>{if(!o||!i||s!=null&&s.modal)return;function d(m){o&&si(m)&&(m.type==="focusin"?ZO:QO)(o)}return o.addEventListener("focusin",d,!0),o.addEventListener("focusout",d,!0),()=>{o.removeEventListener("focusin",d,!0),o.removeEventListener("focusout",d,!0)}},[o,i,s==null?void 0:s.modal]),A.createElement(Bm.Provider,{value:A.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:f,afterInsideRef:c,portalNode:o,setFocusManagerState:a}),[i,o])},h&&o&&A.createElement(ko,{"data-type":"outside",ref:l,onFocus:d=>{if(si(d,o)){var m;(m=f.current)==null||m.focus()}else{const p=Rm()||(s==null?void 0:s.refs.domReference.current);p==null||p.focus()}}}),h&&o&&A.createElement("span",{"aria-owns":o.id,style:Sl}),o&&zu.createPortal(t,o),h&&o&&A.createElement(ko,{"data-type":"outside",ref:u,onFocus:d=>{if(si(d,o)){var m;(m=c.current)==null||m.focus()}else{const p=Fm()||(s==null?void 0:s.refs.domReference.current);p==null||p.focus(),s!=null&&s.closeOnFocusOut&&(s==null||s.onOpenChange(!1,d.nativeEvent))}}}))}const zm=()=>A.useContext(Bm),tM=A.forwardRef(function(t,n){return A.createElement("button",bo({},t,{type:"button",ref:n,tabIndex:-1,style:Sl}))});function nM(e){const{context:t,children:n,disabled:r=!1,order:i=["content"],guards:o=!0,initialFocus:s=0,returnFocus:a=!0,modal:l=!0,visuallyHiddenDismiss:u=!1,closeOnFocusOut:f=!0}=e,{open:c,refs:h,nodeId:d,onOpenChange:m,events:p,dataRef:g,elements:{domReference:y,floating:v}}=t,w=YO()?o:!0,E=dn(i),S=dn(s),C=dn(a),I=wo(),M=zm(),P=typeof s=="number"&&s<0,T=A.useRef(null),O=A.useRef(null),U=A.useRef(!1),F=A.useRef(null),L=A.useRef(!1),R=M!=null,N=y&&y.getAttribute("role")==="combobox"&&rm(y)&&P,j=A.useCallback(function(_){return _===void 0&&(_=v),_?pl(_,wl()):[]},[v]),B=A.useCallback(_=>{const H=j(_);return E.current.map(x=>y&&x==="reference"?y:v&&x==="floating"?v:H).filter(Boolean).flat()},[y,v,E,j]);A.useEffect(()=>{if(r||!l)return;function _(x){if(x.key==="Tab"){ft(v,un(Nt(v)))&&j().length===0&&!N&&Je(x);const V=B(),Y=nm(x);E.current[0]==="reference"&&Y===y&&(Je(x),x.shiftKey?Gt(V[V.length-1]):Gt(V[1])),E.current[1]==="floating"&&Y===v&&x.shiftKey&&(Je(x),Gt(V[0]))}}const H=Nt(v);return H.addEventListener("keydown",_),()=>{H.removeEventListener("keydown",_)}},[r,y,v,l,E,h,N,j,B]),A.useEffect(()=>{if(r||!f)return;function _(){L.current=!0,setTimeout(()=>{L.current=!1})}function H(x){const V=x.relatedTarget;queueMicrotask(()=>{const Y=!(ft(y,V)||ft(v,V)||ft(V,v)||ft(M==null?void 0:M.portalNode,V)||V!=null&&V.hasAttribute(oi("focus-guard"))||I&&(or(I.nodesRef.current,d).find(q=>{var Q,X;return ft((Q=q.context)==null?void 0:Q.elements.floating,V)||ft((X=q.context)==null?void 0:X.elements.domReference,V)})||WO(I.nodesRef.current,d).find(q=>{var Q,X;return((Q=q.context)==null?void 0:Q.elements.floating)===V||((X=q.context)==null?void 0:X.elements.domReference)===V})));V&&Y&&!L.current&&V!==F.current&&(U.current=!0,m(!1,x))})}if(v&&Xn(y))return y.addEventListener("focusout",H),y.addEventListener("pointerdown",_),!l&&v.addEventListener("focusout",H),()=>{y.removeEventListener("focusout",H),y.removeEventListener("pointerdown",_),!l&&v.removeEventListener("focusout",H)}},[r,y,v,l,d,I,M,m,f]),A.useEffect(()=>{var _;if(r)return;const H=Array.from((M==null||(_=M.portalNode)==null?void 0:_.querySelectorAll("["+oi("portal")+"]"))||[]);if(v){const x=[v,...H,T.current,O.current,E.current.includes("reference")||N?y:null].filter(Y=>Y!=null),V=l?Pm(x,w,!w):Pm(x);return()=>{V()}}},[r,y,v,l,E,M,N,w]),Ye(()=>{if(r||!v)return;const _=Nt(v),H=un(_);queueMicrotask(()=>{const x=B(v),V=S.current,Y=(typeof V=="number"?x[V]:V.current)||v,q=ft(v,H);!P&&!q&&c&&Gt(Y,{preventScroll:Y===v})})},[r,c,v,P,B,S]),Ye(()=>{if(r||!v)return;let _=!1;const H=Nt(v),x=un(H),V=g.current;F.current=x;function Y(q){if(q.type==="escapeKey"&&h.domReference.current&&(F.current=h.domReference.current),["referencePress","escapeKey"].includes(q.type))return;const Q=q.data.returnFocus;typeof Q=="object"?(U.current=!1,_=Q.preventScroll):U.current=!Q}return p.on("dismiss",Y),()=>{p.off("dismiss",Y);const q=un(H);(ft(v,q)||I&&or(I.nodesRef.current,d).some(X=>{var se;return ft((se=X.context)==null?void 0:se.elements.floating,q)})||V.openEvent&&["click","mousedown"].includes(V.openEvent.type))&&h.domReference.current&&(F.current=h.domReference.current),C.current&&Xn(F.current)&&!U.current&&Gt(F.current,{cancelPrevious:!1,preventScroll:_})}},[r,v,C,g,h,p,I,d]),Ye(()=>{if(!(r||!M))return M.setFocusManagerState({modal:l,closeOnFocusOut:f,open:c,onOpenChange:m,refs:h}),()=>{M.setFocusManagerState(null)}},[r,M,l,c,m,h,f]),Ye(()=>{if(!r&&v&&typeof MutationObserver=="function"&&!P){const _=()=>{const x=v.getAttribute("tabindex");E.current.includes("floating")||un(Nt(v))!==h.domReference.current&&j().length===0?x!=="0"&&v.setAttribute("tabindex","0"):x!=="-1"&&v.setAttribute("tabindex","-1")};_();const H=new MutationObserver(_);return H.observe(v,{childList:!0,subtree:!0,attributes:!0}),()=>{H.disconnect()}}},[r,v,h,E,j,P]);function W(_){return r||!u||!l?null:A.createElement(tM,{ref:_==="start"?T:O,onClick:H=>m(!1,H.nativeEvent)},typeof u=="string"?u:"Dismiss")}const b=!r&&w&&!N&&(R||l);return A.createElement(A.Fragment,null,b&&A.createElement(ko,{"data-type":"inside",ref:M==null?void 0:M.beforeInsideRef,onFocus:_=>{if(l){const x=B();Gt(i[0]==="reference"?x[0]:x[x.length-1])}else if(M!=null&&M.preserveTabOrder&&M.portalNode)if(U.current=!1,si(_,M.portalNode)){const x=Fm()||y;x==null||x.focus()}else{var H;(H=M.beforeOutsideRef.current)==null||H.focus()}}}),!N&&W("start"),n,W("end"),b&&A.createElement(ko,{"data-type":"inside",ref:M==null?void 0:M.afterInsideRef,onFocus:_=>{if(l)Gt(B()[0]);else if(M!=null&&M.preserveTabOrder&&M.portalNode)if(f&&(U.current=!0),si(_,M.portalNode)){const x=Rm()||y;x==null||x.focus()}else{var H;(H=M.afterOutsideRef.current)==null||H.focus()}}}))}function Um(e){return Xn(e.target)&&e.target.tagName==="BUTTON"}function jm(e){return rm(e)}function rM(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:i,elements:{domReference:o}}=e,{enabled:s=!0,event:a="click",toggle:l=!0,ignoreMouse:u=!1,keyboardHandlers:f=!0}=t,c=A.useRef(),h=A.useRef(!1);return A.useMemo(()=>s?{reference:{onPointerDown(d){c.current=d.pointerType},onMouseDown(d){d.button===0&&(tm(c.current)&&u||a!=="click"&&(n&&l&&(!i.current.openEvent||i.current.openEvent.type==="mousedown")?r(!1,d.nativeEvent):(d.preventDefault(),r(!0,d.nativeEvent))))},onClick(d){if(a==="mousedown"&&c.current){c.current=void 0;return}tm(c.current)&&u||(n&&l&&(!i.current.openEvent||i.current.openEvent.type==="click")?r(!1,d.nativeEvent):r(!0,d.nativeEvent))},onKeyDown(d){c.current=void 0,!(d.defaultPrevented||!f||Um(d))&&(d.key===" "&&!jm(o)&&(d.preventDefault(),h.current=!0),d.key==="Enter"&&r(!(n&&l),d.nativeEvent))},onKeyUp(d){d.defaultPrevented||!f||Um(d)||jm(o)||d.key===" "&&h.current&&(h.current=!1,r(!(n&&l),d.nativeEvent))}}}:{},[s,i,a,u,f,o,l,n,r])}const iM=A.useInsertionEffect||(e=>e());function hn(e){const t=A.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return iM(()=>{t.current=e}),A.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}const oM={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},sM={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},aM=e=>{var t,n;return{escapeKeyBubbles:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePressBubbles:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function lM(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:i,nodeId:o,elements:{reference:s,domReference:a,floating:l},dataRef:u}=e,{enabled:f=!0,escapeKey:c=!0,outsidePress:h=!0,outsidePressEvent:d="pointerdown",referencePress:m=!1,referencePressEvent:p="pointerdown",ancestorScroll:g=!1,bubbles:y}=t,v=wo(),w=Nm()!=null,E=hn(typeof h=="function"?h:()=>!1),S=typeof h=="function"?E:h,C=A.useRef(!1),{escapeKeyBubbles:I,outsidePressBubbles:M}=aM(y),P=hn(O=>{if(!n||!f||!c||O.key!=="Escape")return;const U=v?or(v.nodesRef.current,o):[];if(!I&&(O.stopPropagation(),U.length>0)){let F=!0;if(U.forEach(L=>{var R;if((R=L.context)!=null&&R.open&&!L.context.dataRef.current.__escapeKeyBubbles){F=!1;return}}),!F)return}i.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),r(!1,TI(O)?O.nativeEvent:O)}),T=hn(O=>{const U=C.current;if(C.current=!1,U||typeof S=="function"&&!S(O))return;const F=nm(O),L="["+oi("inert")+"]",R=Nt(l).querySelectorAll(L);let N=kt(F)?F:null;for(;N&&!xI(N);){const W=EI(N);if(W===Nt(l).body||!kt(W))break;N=W}if(R.length&&kt(F)&&!II(F)&&!ft(F,l)&&Array.from(R).every(W=>!ft(N,W)))return;if(Xn(F)&&l){const W=F.clientWidth>0&&F.scrollWidth>F.clientWidth,b=F.clientHeight>0&&F.scrollHeight>F.clientHeight;let _=b&&O.offsetX>F.clientWidth;if(b&&kI(F).direction==="rtl"&&(_=O.offsetX<=F.offsetWidth-F.clientWidth),_||W&&O.offsetY>F.clientHeight)return}const j=v&&or(v.nodesRef.current,o).some(W=>{var b;return il(O,(b=W.context)==null?void 0:b.elements.floating)});if(il(O,l)||il(O,a)||j)return;const B=v?or(v.nodesRef.current,o):[];if(B.length>0){let W=!0;if(B.forEach(b=>{var _;if((_=b.context)!=null&&_.open&&!b.context.dataRef.current.__outsidePressBubbles){W=!1;return}}),!W)return}i.emit("dismiss",{type:"outsidePress",data:{returnFocus:w?{preventScroll:!0}:Jp(O)||Xp(O)}}),r(!1,O)});return A.useEffect(()=>{if(!n||!f)return;u.current.__escapeKeyBubbles=I,u.current.__outsidePressBubbles=M;function O(L){r(!1,L)}const U=Nt(l);c&&U.addEventListener("keydown",P),S&&U.addEventListener(d,T);let F=[];return g&&(kt(a)&&(F=fn(a)),kt(l)&&(F=F.concat(fn(l))),!kt(s)&&s&&s.contextElement&&(F=F.concat(fn(s.contextElement)))),F=F.filter(L=>{var R;return L!==((R=U.defaultView)==null?void 0:R.visualViewport)}),F.forEach(L=>{L.addEventListener("scroll",O,{passive:!0})}),()=>{c&&U.removeEventListener("keydown",P),S&&U.removeEventListener(d,T),F.forEach(L=>{L.removeEventListener("scroll",O)})}},[u,l,a,s,c,S,d,n,r,g,f,I,M,P,T]),A.useEffect(()=>{C.current=!1},[S,d]),A.useMemo(()=>f?{reference:{onKeyDown:P,[oM[p]]:O=>{m&&(i.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),r(!1,O.nativeEvent))}},floating:{onKeyDown:P,[sM[d]]:()=>{C.current=!0}}}:{},[f,i,m,d,p,r,P])}let xl;process.env.NODE_ENV!=="production"&&(xl=new Set);function uM(e){var t;e===void 0&&(e={});const{open:n=!1,onOpenChange:r,nodeId:i}=e;if(process.env.NODE_ENV!=="production"){var o;const I="Floating UI: Cannot pass a virtual element to the `elements.reference` option, as it must be a real DOM element. Use `refs.setPositionReference` instead.";if((o=e.elements)!=null&&o.reference&&!kt(e.elements.reference)){var s;if(!((s=xl)!=null&&s.has(I))){var a;(a=xl)==null||a.add(I),console.error(I)}}}const[l,u]=A.useState(null),f=((t=e.elements)==null?void 0:t.reference)||l,c=bO(e),h=wo(),d=hn((I,M)=>{I&&(p.current.openEvent=M),r==null||r(I,M)}),m=A.useRef(null),p=A.useRef({}),g=A.useState(()=>jO())[0],y=vl(),v=A.useCallback(I=>{const M=kt(I)?{getBoundingClientRect:()=>I.getBoundingClientRect(),contextElement:I}:I;c.refs.setReference(M)},[c.refs]),w=A.useCallback(I=>{(kt(I)||I===null)&&(m.current=I,u(I)),(kt(c.refs.reference.current)||c.refs.reference.current===null||I!==null&&!kt(I))&&c.refs.setReference(I)},[c.refs]),E=A.useMemo(()=>({...c.refs,setReference:w,setPositionReference:v,domReference:m}),[c.refs,w,v]),S=A.useMemo(()=>({...c.elements,domReference:f}),[c.elements,f]),C=A.useMemo(()=>({...c,refs:E,elements:S,dataRef:p,nodeId:i,floatingId:y,events:g,open:n,onOpenChange:d}),[c,i,y,g,n,d,E,S]);return Ye(()=>{const I=h==null?void 0:h.nodesRef.current.find(M=>M.id===i);I&&(I.context=C)}),A.useMemo(()=>({...c,context:C,refs:E,elements:S}),[c,E,S,C])}function kl(e,t,n){const r=new Map;return{...n==="floating"&&{tabIndex:-1},...e,...t.map(i=>i?i[n]:null).concat(e).reduce((i,o)=>(o&&Object.entries(o).forEach(s=>{let[a,l]=s;if(a.indexOf("on")===0){if(r.has(a)||r.set(a,[]),typeof l=="function"){var u;(u=r.get(a))==null||u.push(l),i[a]=function(){for(var f,c=arguments.length,h=new Array(c),d=0;d<c;d++)h[d]=arguments[d];return(f=r.get(a))==null?void 0:f.map(m=>m(...h)).find(m=>m!==void 0)}}}else i[a]=l}),i),{})}}function cM(e){e===void 0&&(e=[]);const t=e,n=A.useCallback(o=>kl(o,e,"reference"),t),r=A.useCallback(o=>kl(o,e,"floating"),t),i=A.useCallback(o=>kl(o,e,"item"),e.map(o=>o==null?void 0:o.item));return A.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:i}),[n,r,i])}let Hm=!1;function Eo(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Vm(e,t){return Eo(t,e===ml||e===yo,e===ir||e===ri)}function El(e,t,n){return Eo(t,e===yo,n?e===ir:e===ri)||e==="Enter"||e==" "||e===""}function fM(e,t,n){return Eo(t,n?e===ir:e===ri,e===yo)}function Wm(e,t,n){return Eo(t,n?e===ri:e===ir,e===ml)}function dM(e,t){const{open:n,onOpenChange:r,refs:i,elements:{domReference:o,floating:s}}=e,{listRef:a,activeIndex:l,onNavigate:u=()=>{},enabled:f=!0,selectedIndex:c=null,allowEscape:h=!1,loop:d=!1,nested:m=!1,rtl:p=!1,virtual:g=!1,focusItemOnOpen:y="auto",focusItemOnHover:v=!0,openOnArrowKeyDown:w=!0,disabledIndices:E=void 0,orientation:S="vertical",cols:C=1,scrollItemIntoView:I=!0,virtualItemRef:M}=t;process.env.NODE_ENV!=="production"&&(h&&(d||console.warn(["Floating UI: `useListNavigation` looping must be enabled to allow","escaping."].join(" ")),g||console.warn(["Floating UI: `useListNavigation` must be virtual to allow","escaping."].join(" "))),S==="vertical"&&C>1&&console.warn(["Floating UI: In grid list navigation mode (`cols` > 1), the",'`orientation` should be either "horizontal" or "both".'].join(" ")));const P=Nm(),T=wo(),O=hn(u),U=A.useRef(y),F=A.useRef(c??-1),L=A.useRef(null),R=A.useRef(!0),N=A.useRef(O),j=A.useRef(!!s),B=A.useRef(!1),W=A.useRef(!1),b=dn(E),_=dn(n),H=dn(I),[x,V]=A.useState(),[Y,q]=A.useState(),Q=hn(function(G,te,$){$===void 0&&($=!1);const ne=G.current[te.current];ne&&(g?(V(ne.id),T==null||T.events.emit("virtualfocus",ne),M&&(M.current=ne)):Gt(ne,{preventScroll:!0,sync:AI()&&em()?Hm||B.current:!1}),requestAnimationFrame(()=>{const ge=H.current;ge&&ne&&($||!R.current)&&(ne.scrollIntoView==null||ne.scrollIntoView(typeof ge=="boolean"?{block:"nearest",inline:"nearest"}:ge))}))});Ye(()=>{document.createElement("div").focus({get preventScroll(){return Hm=!0,!1}})},[]),Ye(()=>{f&&(n&&s?U.current&&c!=null&&(W.current=!0,O(c)):j.current&&(F.current=-1,N.current(null)))},[f,n,s,c,O]),Ye(()=>{if(f&&n&&s)if(l==null){if(B.current=!1,c!=null)return;if(j.current&&(F.current=-1,Q(a,F)),!j.current&&U.current&&(L.current!=null||U.current===!0&&L.current==null)){let G=0;const te=()=>{a.current[0]==null?(G<2&&(G?requestAnimationFrame:queueMicrotask)(te),G++):(F.current=L.current==null||El(L.current,S,p)||m?gl(a,b.current):Om(a,b.current),L.current=null,O(F.current))};te()}}else ii(a,l)||(F.current=l,Q(a,F,W.current),W.current=!1)},[f,n,s,l,c,m,a,S,p,O,Q,b]),Ye(()=>{var G,te;if(!f||s||!T||g||!j.current)return;const $=T.nodesRef.current,ne=(G=$.find(J=>J.id===P))==null||(te=G.context)==null?void 0:te.elements.floating,ge=un(Nt(s)),Oe=$.some(J=>J.context&&ft(J.context.elements.floating,ge));ne&&!Oe&&R.current&&ne.focus({preventScroll:!0})},[f,s,T,P,g]),Ye(()=>{if(!f||!T||!g||P)return;function G(te){q(te.id),M&&(M.current=te)}return T.events.on("virtualfocus",G),()=>{T.events.off("virtualfocus",G)}},[f,T,g,P,M]),Ye(()=>{N.current=O,j.current=!!s}),Ye(()=>{n||(L.current=null)},[n]);const X=l!=null,se=A.useMemo(()=>{function G($){if(!n)return;const ne=a.current.indexOf($);ne!==-1&&O(ne)}return{onFocus($){let{currentTarget:ne}=$;G(ne)},onClick:$=>{let{currentTarget:ne}=$;return ne.focus({preventScroll:!0})},...v&&{onMouseMove($){let{currentTarget:ne}=$;G(ne)},onPointerLeave($){let{pointerType:ne}=$;!R.current||ne==="touch"||(F.current=-1,Q(a,F),O(null),g||Gt(i.floating.current,{preventScroll:!0}))}}}},[n,i,Q,v,a,O,g]);return A.useMemo(()=>{if(!f)return{};const G=b.current;function te(J){if(R.current=!1,B.current=!0,!_.current&&J.currentTarget===i.floating.current)return;if(m&&Wm(J.key,S,p)){Je(J),r(!1,J.nativeEvent),Xn(o)&&!g&&o.focus();return}const ue=F.current,de=gl(a,G),fe=Om(a,G);if(J.key==="Home"&&(Je(J),F.current=de,O(F.current)),J.key==="End"&&(Je(J),F.current=fe,O(F.current)),!(C>1&&(F.current=BO(a,{event:J,orientation:S,loop:d,cols:C,disabledIndices:G,minIndex:de,maxIndex:fe,prevIndex:F.current,stopEvent:!0}),O(F.current),S==="both"))&&Vm(J.key,S)){if(Je(J),n&&!g&&un(J.currentTarget.ownerDocument)===J.currentTarget){F.current=El(J.key,S,p)?de:fe,O(F.current);return}El(J.key,S,p)?d?F.current=ue>=fe?h&&ue!==a.current.length?-1:de:nt(a,{startingIndex:ue,disabledIndices:G}):F.current=Math.min(fe,nt(a,{startingIndex:ue,disabledIndices:G})):d?F.current=ue<=de?h&&ue!==-1?a.current.length:fe:nt(a,{startingIndex:ue,decrement:!0,disabledIndices:G}):F.current=Math.max(de,nt(a,{startingIndex:ue,decrement:!0,disabledIndices:G})),ii(a,F.current)?O(null):O(F.current)}}function $(J){y==="auto"&&Jp(J.nativeEvent)&&(U.current=!0)}function ne(J){U.current=y,y==="auto"&&Xp(J.nativeEvent)&&(U.current=!0)}const ge=g&&n&&X&&{"aria-activedescendant":Y||x},Oe=a.current.find(J=>(J==null?void 0:J.id)===x);return{reference:{...ge,onKeyDown(J){R.current=!1;const ue=J.key.indexOf("Arrow")===0,de=fM(J.key,S,p),fe=Wm(J.key,S,p),Ae=Vm(J.key,S),Fe=(m?de:Ae)||J.key==="Enter"||J.key.trim()==="";if(g&&n){const ae=T==null?void 0:T.nodesRef.current.find(K=>K.parentId==null),z=T&&ae?qO(T.nodesRef.current,ae.id):null;if(ue&&z&&M){const K=new KeyboardEvent("keydown",{key:J.key,bubbles:!0});if(de||fe){var Me,je;const oe=((Me=z.context)==null?void 0:Me.elements.domReference)===J.currentTarget,le=fe&&!oe?(je=z.context)==null?void 0:je.elements.domReference:de?Oe:null;le&&(Je(J),le.dispatchEvent(K),q(void 0))}if(Ae&&z.context&&z.context.open&&z.parentId&&J.currentTarget!==z.context.elements.domReference){var ee;Je(J),(ee=z.context.elements.domReference)==null||ee.dispatchEvent(K);return}}return te(J)}if(!(!n&&!w&&ue)){if(Fe&&(L.current=m&&Ae?null:J.key),m){de&&(Je(J),n?(F.current=gl(a,G),O(F.current)):r(!0,J.nativeEvent));return}Ae&&(c!=null&&(F.current=c),Je(J),!n&&w?r(!0,J.nativeEvent):te(J),n&&O(F.current))}},onFocus(){n&&O(null)},onPointerDown:ne,onMouseDown:$,onClick:$},floating:{"aria-orientation":S==="both"?void 0:S,...ge,onKeyDown:te,onPointerMove(){R.current=!0}},item:se}},[o,i,x,Y,b,_,a,f,S,p,g,n,X,m,c,w,h,C,d,y,O,r,se,T,M])}function hM(e,t){t===void 0&&(t={});const{open:n,floatingId:r}=e,{enabled:i=!0,role:o="dialog"}=t,s=vl();return A.useMemo(()=>{const a={id:r,role:o};return i?o==="tooltip"?{reference:{"aria-describedby":n?r:void 0},floating:a}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":o==="alertdialog"?"dialog":o,"aria-controls":n?r:void 0,...o==="listbox"&&{role:"combobox"},...o==="menu"&&{id:s}},floating:{...a,...o==="menu"&&{"aria-labelledby":s}}}:{}},[i,o,n,r,s])}function pM(e,t){var n;const{open:r,dataRef:i}=e,{listRef:o,activeIndex:s,onMatch:a,onTypingChange:l,enabled:u=!0,findMatch:f=null,resetMs:c=750,ignoreKeys:h=[],selectedIndex:d=null}=t,m=A.useRef(),p=A.useRef(""),g=A.useRef((n=d??s)!=null?n:-1),y=A.useRef(null),v=hn(a),w=hn(l),E=dn(f),S=dn(h);return Ye(()=>{r&&(clearTimeout(m.current),y.current=null,p.current="")},[r]),Ye(()=>{if(r&&p.current===""){var C;g.current=(C=d??s)!=null?C:-1}},[r,d,s]),A.useMemo(()=>{if(!u)return{};function C(P){P?i.current.typing||(i.current.typing=P,w(P)):i.current.typing&&(i.current.typing=P,w(P))}function I(P,T,O){const U=E.current?E.current(T,O):T.find(F=>(F==null?void 0:F.toLocaleLowerCase().indexOf(O.toLocaleLowerCase()))===0);return U?P.indexOf(U):-1}function M(P){const T=o.current;if(p.current.length>0&&p.current[0]!==" "&&(I(T,T,p.current)===-1?C(!1):P.key===" "&&Je(P)),T==null||S.current.includes(P.key)||P.key.length!==1||P.ctrlKey||P.metaKey||P.altKey)return;r&&P.key!==" "&&(Je(P),C(!0)),T.every(L=>{var R,N;return L?((R=L[0])==null?void 0:R.toLocaleLowerCase())!==((N=L[1])==null?void 0:N.toLocaleLowerCase()):!0})&&p.current===P.key&&(p.current="",g.current=y.current),p.current+=P.key,clearTimeout(m.current),m.current=setTimeout(()=>{p.current="",g.current=y.current,C(!1)},c);const U=g.current,F=I(T,[...T.slice((U||0)+1),...T.slice(0,(U||0)+1)],p.current);F!==-1?(v(F),y.current=F):P.key!==" "&&(p.current="",C(!1))}return{reference:{onKeyDown:M},floating:{onKeyDown:M,onKeyUp(P){P.key===" "&&C(!1)}}}},[u,r,i,o,c,S,E,v,w])}const mM=({options:e,reusable:t,sendMessage:n,isReadOnly:r})=>{var R,N,j,B,W;const i=Qn(b=>b.messageContainerRef),o=Qn(b=>b.portalContainer),[s,a]=A.useState(!1),[l,u]=A.useState(null),[f,c]=A.useState(null),{message:{blocks:{dropdown:h}}}=me,d=e.reduce((b,_)=>(b[_.label]=_.value,b),{}),m=d?Object.keys(d):[],p=b=>{a(f!==null&&!t?!1:b)},{refs:g,floatingStyles:y,context:v}=uM({placement:"bottom-start",open:s,onOpenChange:p,whileElementsMounted:dO,middleware:[wO(5),SO({padding:10,boundary:(i==null?void 0:i.current)??void 0,crossAxis:!0}),xO({apply({rects:b,elements:_,availableHeight:H}){Object.assign(_.floating.style,{maxHeight:`${H}px`,minWidth:`${b.reference.width}px`})},padding:10})]}),w=A.useRef([]),E=A.useRef(m),S=A.useRef(!1),C=rM(v,{event:"mousedown"}),I=lM(v),M=hM(v,{role:"listbox"}),P=dM(v,{listRef:w,activeIndex:l,selectedIndex:f,onNavigate:u,loop:!0}),T=pM(v,{listRef:E,activeIndex:l,selectedIndex:f,onMatch:s?u:c,onTypingChange(b){S.current=b}}),{getReferenceProps:O,getFloatingProps:U,getItemProps:F}=cM([I,M,P,T,C]),L=b=>{c(b),m[b]!==void 0&&(n==null||n({type:"text",text:m[b]??"",value:d[m[b]]??""})),a(!1)};return k.jsxs(k.Fragment,{children:[k.jsxs("div",{tabIndex:0,ref:g.setReference,"aria-labelledby":"select-label","aria-autocomplete":"none","data-disabled":f!==null&&!t?"":void 0,style:r?{pointerEvents:"none"}:void 0,...(R=h.button)==null?void 0:R.container,...O(),children:[k.jsx("span",{...(N=h.button)==null?void 0:N.text,children:f?m[f]:"Select..."}),k.jsx(UA,{...(j=h.button)==null?void 0:j.icon})]}),s&&k.jsx(eM,{root:o??void 0,children:k.jsx(nM,{context:v,modal:!1,children:k.jsx("div",{ref:g.setFloating,className:(W=(B=h.content)==null?void 0:B.container)==null?void 0:W.className,style:{...y,pointerEvents:"auto"},...U(),children:m.map((b,_)=>{var H;return k.jsx("div",{ref:x=>{w.current[_]=x},role:"option",tabIndex:_===l?0:-1,"aria-selected":_===f&&_===l,"data-active":_===l?"":void 0,...(H=h.content)==null?void 0:H.item,...F({onClick(){L(_)},onKeyDown(x){x.key==="Enter"&&(x.preventDefault(),L(_)),x.key===" "&&!S.current&&(x.preventDefault(),L(_))}}),children:b},b)})})})})]})},qm=D.forwardRef(({title:e,url:t,isReadOnly:n,...r},i)=>{const{message:{blocks:{file:o}}}=me;return k.jsxs("a",{...r,...o.container,href:t,style:n?{pointerEvents:"none"}:void 0,download:!0,ref:i,target:"_blank",rel:"noreferrer",children:[k.jsx("p",{...o.title,children:e||t}),k.jsx(WA,{...o.icon})]})});qm.displayName="File";const gM=ln()((e,t)=>({components:{},getCustomComponent:async n=>{const r=t().components[n];if(r)return r;const i=await fetch(n).then(u=>u.text()),o=new Blob([i],{type:"application/javascript"}),a=await import(URL.createObjectURL(o)),l=()=>a.default;return e(u=>({components:{...u.components,[n]:l}})),l}}));globalThis.React=D;const Ym={audio:Fp,bubble:Mp,button:LT,carousel:Yp,column:$p,dropdown:mM,file:qm,image:Pp,location:Rp,row:Bp,text:dT,video:Lp,custom:({url:e,name:t,data:n,...r})=>{const i=gM(u=>u.getCustomComponent),[o,s]=D.useState(null),[a,l]=D.useState(null);return D.useEffect(()=>{i(e).then(s).catch(u=>{l(u.message)})},[e]),a?k.jsx("div",{style:{color:"red"},children:a}):o?k.jsx(o,{...n,...r}):null}},Dn=({block:e,renderers:t,...n})=>{const r=(t==null?void 0:t[e.type])??Ym[e.type],i={...n,...e};return k.jsx(r,{...i})};function Km(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Km(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ar(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Km(e))&&(r&&(r+=" "),r+=t);return r}const yM=({disabled:e,onFileSelected:t})=>{const n=D.useRef(null),{uploadButton:r}=me.composer,i=()=>{n.current&&n.current.click()},o=s=>{const a=s.target.files;a&&a.length>0&&Array.from(a).forEach(l=>{t(l)})};return k.jsxs(k.Fragment,{children:[k.jsx(nT,{...r,role:"button",tabIndex:0,"aria-label":"Upload File Button","data-disabled":e,onClick:i}),k.jsx("input",{value:"",multiple:!0,type:"file",ref:n,style:{display:"none"},onChange:o})]})},vM=({name:e,type:t,instance:n,status:r,removeFile:i})=>{const{loader:o,fileIcon:s,removeIcon:a,errorIcon:l,previewImage:u}=me.composer.fileWidget,f=["PNG","JPEG","JPG"].includes(Ao(n.name));return r==="loading"?k.jsx(Co,{name:e,status:r,removeButton:k.jsx("div",{...o}),extension:Ao(n.name),children:k.jsx("div",{...s.container,children:k.jsx(Cl,{type:t,...s.icon})})}):r==="error"?k.jsx(Co,{name:e,status:r,removeButton:k.jsx(Gm,{removeFile:()=>i(e)}),extension:"Upload Error",children:k.jsxs("div",{...s.container,children:[k.jsx(jA,{...l}),k.jsx(Cl,{type:t,...s.icon})]})}):r=="uploaded"&&f?k.jsx(Co,{name:e,status:r,removeButton:k.jsx(Gm,{removeFile:()=>i(e)}),extension:Ao(n.name),children:k.jsx("div",{...s.container,children:k.jsx("img",{src:URL.createObjectURL(n),alt:e,...u})})}):k.jsx(Co,{name:e,status:r,removeButton:k.jsx(up,{onClick:()=>i(e),...a}),extension:Ao(n.name),children:k.jsx("div",{...s.container,children:k.jsx(Cl,{type:t,...s.icon})})})},Co=({name:e,status:t,removeButton:n,children:r,extension:i})=>{const{container:o,metadata:s}=me.composer.fileWidget;return k.jsxs("div",{"data-status":t,title:e,...o,children:[n,r,k.jsxs("div",{...s.container,children:[k.jsx("div",{...s.name,children:e}),k.jsx("div",{...s.type,children:i})]})]})},Cl=({type:e,...t})=>e==="image"?k.jsx(KA,{...t}):e==="video"?k.jsx(uT,{...t}):e==="audio"?k.jsx(dp,{...t}):k.jsx(cp,{...t}),Ao=e=>{if(!e)return"File";const t=e.split(".").pop();return t?t.toUpperCase():"File"},Gm=({removeFile:e})=>{const{composer:{fileWidget:{removeIcon:t}}}=me;return k.jsx(up,{role:"button",tabIndex:0,"aria-label":"Remove File Button",onClick:()=>e(),...t})};function Al(){return Al=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Al.apply(null,arguments)}function bM(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var wM=D.useLayoutEffect,SM=function(t){var n=D.useRef(t);return wM(function(){n.current=t}),n},Qm=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},xM=function(t,n){var r=D.useRef();return D.useCallback(function(i){t.current=i,r.current&&Qm(r.current,null),r.current=n,n&&Qm(n,i)},[n])},Zm={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},kM=function(t){Object.keys(Zm).forEach(function(n){t.style.setProperty(n,Zm[n],"important")})},Jm=kM,st=null,Xm=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function EM(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),st||(st=document.createElement("textarea"),st.setAttribute("tabindex","-1"),st.setAttribute("aria-hidden","true"),Jm(st)),st.parentNode===null&&document.body.appendChild(st);var i=e.paddingSize,o=e.borderSize,s=e.sizingStyle,a=s.boxSizing;Object.keys(s).forEach(function(h){var d=h;st.style[d]=s[d]}),Jm(st),st.value=t;var l=Xm(st,e);st.value=t,l=Xm(st,e),st.value="x";var u=st.scrollHeight-i,f=u*n;a==="border-box"&&(f=f+i+o),l=Math.max(f,l);var c=u*r;return a==="border-box"&&(c=c+i+o),l=Math.min(c,l),[l,u]}var eg=function(){},CM=function(t,n){return t.reduce(function(r,i){return r[i]=n[i],r},{})},AM=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],TM=!!document.documentElement.currentStyle,IM=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=CM(AM,n),i=r.boxSizing;if(i==="")return null;TM&&i==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var o=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),s=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:o,borderSize:s}},OM=IM;function tg(e,t,n){var r=SM(n);A.useLayoutEffect(function(){var i=function(s){return r.current(s)};if(e)return e.addEventListener(t,i),function(){return e.removeEventListener(t,i)}},[])}var MM=function(t){tg(window,"resize",t)},DM=function(t){tg(document.fonts,"loadingdone",t)},NM=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],_M=function(t,n){var r=t.cacheMeasurements,i=t.maxRows,o=t.minRows,s=t.onChange,a=s===void 0?eg:s,l=t.onHeightChange,u=l===void 0?eg:l,f=bM(t,NM),c=f.value!==void 0,h=A.useRef(null),d=xM(h,n),m=A.useRef(0),p=A.useRef(),g=function(){var w=h.current,E=r&&p.current?p.current:OM(w);if(E){p.current=E;var S=EM(E,w.value||w.placeholder||"x",o,i),C=S[0],I=S[1];m.current!==C&&(m.current=C,w.style.setProperty("height",C+"px","important"),u(C,{rowHeight:I}))}},y=function(w){c||g(),a(w)};return A.useLayoutEffect(g),MM(g),DM(g),A.createElement("textarea",Al({},f,{onChange:y,ref:d}))},PM=A.forwardRef(_M);const LM=({inputRef:e,composerPlaceholder:t,composerDisabled:n,textInput:r,historyIndex:i,setTextInput:o,setHistoryIndex:s,sendComposerMessage:a,allowFileUpload:l,onFilePasted:u,conversationId:f,storageKey:c})=>{const d=kp(f||"default",c)(E=>E.messageHistory),[m,p]=D.useState(""),[g,y]=D.useState(!1),{input:v}=me.composer,w=E=>{if(!l||!u||!E.clipboardData)return;const S=Array.from(E.clipboardData.files);S.length>0&&(E.preventDefault(),S.forEach(C=>{u(C)}))};return k.jsx(PM,{...v,"aria-label":"Message Input",ref:e,placeholder:t??"Type your message...",disabled:n,value:r,"data-has-value":!!r,onChange:E=>{const S=E.target.value;o(S),d.includes(S)||s(-1)},onPaste:w,maxRows:5,onKeyDown:E=>{if(n)return;const S=E.nativeEvent;if(!(S.isComposing||S.keyCode===229)&&(r.length===0&&y(!1),E.key!=="ArrowUp"&&E.key!=="ArrowDown"&&E.key!=="ArrowLeft"&&E.key!=="ArrowRight"&&y(!0),E.key==="Enter"&&E.shiftKey?(E.preventDefault(),o(`${r}
|
|
289
|
+
`)):E.key==="Enter"&&(E.preventDefault(),a()),!(r.length>0&&g))){if(E.key==="ArrowUp"){E.preventDefault(),i===-1&&r.trim()!==""&&p(r);const C=Math.min(i+1,d.length-1);s(C),o(d[C]??"")}if(E.key==="ArrowDown"){E.preventDefault();const C=Math.max(i-1,-1);o(i===-1?r.trim():C===-1?m:d[C]??""),s(C)}}}})},FM=({disabled:e,setTextInput:t})=>{const[n,r]=D.useState(!1),i=D.useRef(null),{voiceButton:o}=me.composer,s=window.SpeechRecognition||window.webkitSpeechRecognition,a=()=>{i.current||(i.current=new s);const l=i.current;l&&(l.continuous=!0,l.onresult=u=>{var c,h,d;const f=((d=(h=(c=u.results)==null?void 0:c[0])==null?void 0:h[0])==null?void 0:d.transcript)??"";t(f??""),l.stop(),r(!1)},n?(l.stop(),r(!1)):(l.start(),r(!0)))};if(s)return k.jsx(XA,{...o,tabIndex:0,"aria-label":"Voice Input Button",role:"button","data-show":!e,"data-listens":!!n,onClick:a})},ng=D.memo(D.forwardRef(({className:e,inputRef:t,disableComposer:n,isReadOnly:r,allowFileUpload:i,disableSendButton:o,connected:s,composerPlaceholder:a,footer:l,sendMessage:u,uploadFile:f,storageKey:c,conversationId:h,children:d,...m},p)=>{const{composer:g}=me,y=n||r||!s,[v,w]=D.useState(""),[E,S]=D.useState(-1),C=Ap(h||"default"),I=kp(h||"default",c),M=C(N=>N.files),P=C(N=>N.setFiles),T=C(N=>N.deleteFile),O=C(N=>N.uploadFile),U=I(N=>N.addMessageToHistory),F=M.filter(N=>N.status==="uploaded"),L=!!v.trim()||F.length>0,R=()=>{if(o||!L)return;const N=F.map(B=>{const W=B.url,b=B.type,_=B.fileId;return{video:{type:"video",videoUrl:W,fileId:_},audio:{type:"audio",audioUrl:W,fileId:_},image:{type:"image",imageUrl:W,fileId:_}}[b]??{title:B.name,type:"file",fileUrl:W,fileId:_}})??[];v&&N.push({type:"text",text:v});let j;N.length==1?j=N[0]:j={type:"bloc",items:N.map(W=>{const{type:b,..._}=W;return{type:b,payload:_}})},w(""),u==null||u(j),P([]),U(v),S(-1)};return r?null:k.jsxs(k.Fragment,{children:[k.jsxs("div",{"data-disabled":y,"data-waiting":o,className:ar(g.container.className,e),ref:p,...m,children:[d,M.length>0&&k.jsx("div",{...g==null?void 0:g.fileContainer,children:M.map(N=>k.jsx(vM,{...N,removeFile:T},N.name))}),k.jsxs("div",{...g.inputContainer,onClick:()=>{t&&"current"in t&&t.current&&t.current.focus()},children:[i&&k.jsx(yM,{disabled:y,onFileSelected:N=>{f&&O(N,f)}}),k.jsx(LM,{inputRef:t,composerPlaceholder:a,composerDisabled:y,textInput:v,historyIndex:E,setTextInput:w,setHistoryIndex:S,sendComposerMessage:R,allowFileUpload:i,onFilePasted:N=>{f&&O(N,f)},conversationId:h,storageKey:c}),o&&k.jsx(GA,{...g.inputLoader,role:"status","data-show":o}),!y&&!o&&k.jsxs(k.Fragment,{children:[k.jsx(BA,{...g.sendbutton,role:"button",tabIndex:0,"aria-label":"Send Message Button","data-show":L,onClick:()=>R()}),k.jsx(FM,{disabled:L,setTextInput:w})]})]})]}),k.jsx(Ch,{components:{a:({node:N,...j})=>k.jsx("a",{...j,target:"_blank",rel:"noreferrer noopener"})},allowedElements:["a","strong","code","em","p","span"],...g.footer,children:l})]})}));var Tl={exports:{}},To={exports:{}},Te={};/** @license React v16.13.1
|
|
281
290
|
* react-is.production.min.js
|
|
282
291
|
*
|
|
283
292
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
284
293
|
*
|
|
285
294
|
* This source code is licensed under the MIT license found in the
|
|
286
295
|
* LICENSE file in the root directory of this source tree.
|
|
287
|
-
*/var
|
|
296
|
+
*/var rg;function RM(){if(rg)return Te;rg=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,f=e?Symbol.for("react.forward_ref"):60112,c=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,d=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,v=e?Symbol.for("react.scope"):60119;function w(S){if(typeof S=="object"&&S!==null){var C=S.$$typeof;switch(C){case t:switch(S=S.type,S){case l:case u:case r:case o:case i:case c:return S;default:switch(S=S&&S.$$typeof,S){case a:case f:case m:case d:case s:return S;default:return C}}case n:return C}}}function E(S){return w(S)===u}return Te.AsyncMode=l,Te.ConcurrentMode=u,Te.ContextConsumer=a,Te.ContextProvider=s,Te.Element=t,Te.ForwardRef=f,Te.Fragment=r,Te.Lazy=m,Te.Memo=d,Te.Portal=n,Te.Profiler=o,Te.StrictMode=i,Te.Suspense=c,Te.isAsyncMode=function(S){return E(S)||w(S)===l},Te.isConcurrentMode=E,Te.isContextConsumer=function(S){return w(S)===a},Te.isContextProvider=function(S){return w(S)===s},Te.isElement=function(S){return typeof S=="object"&&S!==null&&S.$$typeof===t},Te.isForwardRef=function(S){return w(S)===f},Te.isFragment=function(S){return w(S)===r},Te.isLazy=function(S){return w(S)===m},Te.isMemo=function(S){return w(S)===d},Te.isPortal=function(S){return w(S)===n},Te.isProfiler=function(S){return w(S)===o},Te.isStrictMode=function(S){return w(S)===i},Te.isSuspense=function(S){return w(S)===c},Te.isValidElementType=function(S){return typeof S=="string"||typeof S=="function"||S===r||S===u||S===o||S===i||S===c||S===h||typeof S=="object"&&S!==null&&(S.$$typeof===m||S.$$typeof===d||S.$$typeof===s||S.$$typeof===a||S.$$typeof===f||S.$$typeof===g||S.$$typeof===y||S.$$typeof===v||S.$$typeof===p)},Te.typeOf=w,Te}var Ie={};/** @license React v16.13.1
|
|
288
297
|
* react-is.development.js
|
|
289
298
|
*
|
|
290
299
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
291
300
|
*
|
|
292
301
|
* This source code is licensed under the MIT license found in the
|
|
293
302
|
* LICENSE file in the root directory of this source tree.
|
|
294
|
-
*/var
|
|
303
|
+
*/var ig;function $M(){return ig||(ig=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,f=e?Symbol.for("react.forward_ref"):60112,c=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,d=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,v=e?Symbol.for("react.scope"):60119;function w($){return typeof $=="string"||typeof $=="function"||$===r||$===u||$===o||$===i||$===c||$===h||typeof $=="object"&&$!==null&&($.$$typeof===m||$.$$typeof===d||$.$$typeof===s||$.$$typeof===a||$.$$typeof===f||$.$$typeof===g||$.$$typeof===y||$.$$typeof===v||$.$$typeof===p)}function E($){if(typeof $=="object"&&$!==null){var ne=$.$$typeof;switch(ne){case t:var ge=$.type;switch(ge){case l:case u:case r:case o:case i:case c:return ge;default:var Oe=ge&&ge.$$typeof;switch(Oe){case a:case f:case m:case d:case s:return Oe;default:return ne}}case n:return ne}}}var S=l,C=u,I=a,M=s,P=t,T=f,O=r,U=m,F=d,L=n,R=o,N=i,j=c,B=!1;function W($){return B||(B=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),b($)||E($)===l}function b($){return E($)===u}function _($){return E($)===a}function H($){return E($)===s}function x($){return typeof $=="object"&&$!==null&&$.$$typeof===t}function V($){return E($)===f}function Y($){return E($)===r}function q($){return E($)===m}function Q($){return E($)===d}function X($){return E($)===n}function se($){return E($)===o}function G($){return E($)===i}function te($){return E($)===c}Ie.AsyncMode=S,Ie.ConcurrentMode=C,Ie.ContextConsumer=I,Ie.ContextProvider=M,Ie.Element=P,Ie.ForwardRef=T,Ie.Fragment=O,Ie.Lazy=U,Ie.Memo=F,Ie.Portal=L,Ie.Profiler=R,Ie.StrictMode=N,Ie.Suspense=j,Ie.isAsyncMode=W,Ie.isConcurrentMode=b,Ie.isContextConsumer=_,Ie.isContextProvider=H,Ie.isElement=x,Ie.isForwardRef=V,Ie.isFragment=Y,Ie.isLazy=q,Ie.isMemo=Q,Ie.isPortal=X,Ie.isProfiler=se,Ie.isStrictMode=G,Ie.isSuspense=te,Ie.isValidElementType=w,Ie.typeOf=E}()),Ie}var og;function sg(){return og||(og=1,process.env.NODE_ENV==="production"?To.exports=RM():To.exports=$M()),To.exports}/*
|
|
295
304
|
object-assign
|
|
296
305
|
(c) Sindre Sorhus
|
|
297
306
|
@license MIT
|
|
298
|
-
*/var
|
|
299
|
-
Valid keys: `+JSON.stringify(Object.keys(b),null," "));var
|
|
300
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
301
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
302
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
303
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lp(e,t){if(e){if(typeof e=="string")return Qa(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Qa(e,t)}}function Qa(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function PC(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,a,s;try{for(n=n.call(e);!(i=(a=n.next()).done)&&(r.push(a.value),!(t&&r.length===t));i=!0);}catch(l){o=!0,s=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw s}}return r}}function NC(e){if(Array.isArray(e))return e}function up(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ne(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?up(Object(n),!0).forEach(function(r){Ja(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):up(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ja(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vi(e,t){if(e==null)return{};var n=LC(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function LC(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var Za=_.forwardRef(function(e,t){var n=e.children,r=vi(e,EC),i=fp(r),o=i.open,a=vi(i,CC);return _.useImperativeHandle(t,function(){return{open:o}},[o]),_.createElement(_.Fragment,null,n(Ne(Ne({},a),{},{open:o})))});Za.displayName="Dropzone";var cp={disabled:!1,getFilesFromEvent:KE,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};Za.defaultProps=cp,Za.propTypes={children:Te.func,accept:Te.objectOf(Te.arrayOf(Te.string)),multiple:Te.bool,preventDropOnDocument:Te.bool,noClick:Te.bool,noKeyboard:Te.bool,noDrag:Te.bool,noDragEventsBubbling:Te.bool,minSize:Te.number,maxSize:Te.number,maxFiles:Te.number,disabled:Te.bool,getFilesFromEvent:Te.func,onFileDialogCancel:Te.func,onFileDialogOpen:Te.func,useFsAccessApi:Te.bool,autoFocus:Te.bool,onDragEnter:Te.func,onDragLeave:Te.func,onDragOver:Te.func,onDrop:Te.func,onDropAccepted:Te.func,onDropRejected:Te.func,onError:Te.func,validator:Te.func};var Xa={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function fp(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Ne(Ne({},cp),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,o=t.maxSize,a=t.minSize,s=t.multiple,l=t.maxFiles,u=t.onDragEnter,f=t.onDragLeave,c=t.onDragOver,p=t.onDrop,d=t.onDropAccepted,m=t.onDropRejected,h=t.onFileDialogCancel,g=t.onFileDialogOpen,y=t.useFsAccessApi,v=t.autoFocus,w=t.preventDropOnDocument,A=t.noClick,k=t.noKeyboard,C=t.noDrag,T=t.noDragEventsBubbling,P=t.onError,F=t.validator,I=_.useMemo(function(){return xC(n)},[n]),O=_.useMemo(function(){return wC(n)},[n]),j=_.useMemo(function(){return typeof g=="function"?g:dp},[g]),z=_.useMemo(function(){return typeof h=="function"?h:dp},[h]),M=_.useRef(null),D=_.useRef(null),B=_.useReducer(FC,Xa),U=Ga(B,2),$=U[0],V=U[1],b=$.isFocused,N=$.isFileDialogActive,H=_.useRef(typeof window<"u"&&window.isSecureContext&&y&&bC()),x=function(){!H.current&&N&&setTimeout(function(){if(D.current){var se=D.current.files;se.length||(V({type:"closeDialog"}),z())}},300)};_.useEffect(function(){return window.addEventListener("focus",x,!1),function(){window.removeEventListener("focus",x,!1)}},[D,N,z,H]);var W=_.useRef([]),ee=function(se){M.current&&M.current.contains(se.target)||(se.preventDefault(),W.current=[])};_.useEffect(function(){return w&&(document.addEventListener("dragover",op,!1),document.addEventListener("drop",ee,!1)),function(){w&&(document.removeEventListener("dragover",op),document.removeEventListener("drop",ee))}},[M,w]),_.useEffect(function(){return!r&&v&&M.current&&M.current.focus(),function(){}},[M,v,r]);var Y=_.useCallback(function(Z){P?P(Z):console.error(Z)},[P]),J=_.useCallback(function(Z){Z.preventDefault(),Z.persist(),we(Z),W.current=[].concat(TC(W.current),[Z.target]),yi(Z)&&Promise.resolve(i(Z)).then(function(se){if(!(gi(Z)&&!T)){var R=se.length,q=R>0&&mC({files:se,accept:I,minSize:a,maxSize:o,multiple:s,maxFiles:l,validator:F}),ae=R>0&&!q;V({isDragAccept:q,isDragReject:ae,isDragActive:!0,type:"setDraggedFiles"}),u&&u(Z)}}).catch(function(se){return Y(se)})},[i,u,Y,T,I,a,o,s,l,F]),X=_.useCallback(function(Z){Z.preventDefault(),Z.persist(),we(Z);var se=yi(Z);if(se&&Z.dataTransfer)try{Z.dataTransfer.dropEffect="copy"}catch{}return se&&c&&c(Z),!1},[c,T]),ie=_.useCallback(function(Z){Z.preventDefault(),Z.persist(),we(Z);var se=W.current.filter(function(q){return M.current&&M.current.contains(q)}),R=se.indexOf(Z.target);R!==-1&&se.splice(R,1),W.current=se,!(se.length>0)&&(V({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),yi(Z)&&f&&f(Z))},[M,f,T]),K=_.useCallback(function(Z,se){var R=[],q=[];Z.forEach(function(ae){var le=rp(ae,I),pe=Ga(le,2),fe=pe[0],Ee=pe[1],Oe=ip(ae,a,o),st=Ga(Oe,2),gt=st[0],ze=st[1],lt=F?F(ae):null;if(fe&>&&!lt)R.push(ae);else{var Ge=[Ee,ze];lt&&(Ge=Ge.concat(lt)),q.push({file:ae,errors:Ge.filter(function(Bi){return Bi})})}}),(!s&&R.length>1||s&&l>=1&&R.length>l)&&(R.forEach(function(ae){q.push({file:ae,errors:[hC]})}),R.splice(0)),V({acceptedFiles:R,fileRejections:q,type:"setFiles"}),p&&p(R,q,se),q.length>0&&m&&m(q,se),R.length>0&&d&&d(R,se)},[V,s,I,a,o,l,p,d,m,F]),te=_.useCallback(function(Z){Z.preventDefault(),Z.persist(),we(Z),W.current=[],yi(Z)&&Promise.resolve(i(Z)).then(function(se){gi(Z)&&!T||K(se,Z)}).catch(function(se){return Y(se)}),V({type:"reset"})},[i,K,Y,T]),L=_.useCallback(function(){if(H.current){V({type:"openDialog"}),j();var Z={multiple:s,types:O};window.showOpenFilePicker(Z).then(function(se){return i(se)}).then(function(se){K(se,null),V({type:"closeDialog"})}).catch(function(se){kC(se)?(z(se),V({type:"closeDialog"})):SC(se)?(H.current=!1,D.current?(D.current.value=null,D.current.click()):Y(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):Y(se)});return}D.current&&(V({type:"openDialog"}),j(),D.current.value=null,D.current.click())},[V,j,z,y,K,Y,O,s]),ne=_.useCallback(function(Z){!M.current||!M.current.isEqualNode(Z.target)||(Z.key===" "||Z.key==="Enter"||Z.keyCode===32||Z.keyCode===13)&&(Z.preventDefault(),L())},[M,L]),me=_.useCallback(function(){V({type:"focus"})},[]),ke=_.useCallback(function(){V({type:"blur"})},[]),oe=_.useCallback(function(){A||(vC()?setTimeout(L,0):L())},[A,L]),G=function(se){return r?null:se},ue=function(se){return k?null:G(se)},de=function(se){return C?null:G(se)},we=function(se){T&&se.stopPropagation()},Se=_.useMemo(function(){return function(){var Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},se=Z.refKey,R=se===void 0?"ref":se,q=Z.role,ae=Z.onKeyDown,le=Z.onFocus,pe=Z.onBlur,fe=Z.onClick,Ee=Z.onDragEnter,Oe=Z.onDragOver,st=Z.onDragLeave,gt=Z.onDrop,ze=vi(Z,AC);return Ne(Ne(Ja({onKeyDown:ue(kt(ae,ne)),onFocus:ue(kt(le,me)),onBlur:ue(kt(pe,ke)),onClick:G(kt(fe,oe)),onDragEnter:de(kt(Ee,J)),onDragOver:de(kt(Oe,X)),onDragLeave:de(kt(st,ie)),onDrop:de(kt(gt,te)),role:typeof q=="string"&&q!==""?q:"presentation"},R,M),!r&&!k?{tabIndex:0}:{}),ze)}},[M,ne,me,ke,oe,J,X,ie,te,k,C,r]),Ue=_.useCallback(function(Z){Z.stopPropagation()},[]),Ye=_.useMemo(function(){return function(){var Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},se=Z.refKey,R=se===void 0?"ref":se,q=Z.onChange,ae=Z.onClick,le=vi(Z,IC),pe=Ja({accept:I,multiple:s,type:"file",style:{display:"none"},onChange:G(kt(q,te)),onClick:G(kt(ae,Ue)),tabIndex:-1},R,D);return Ne(Ne({},pe),le)}},[D,n,s,te,r]);return Ne(Ne({},$),{},{isFocused:b&&!r,getRootProps:Se,getInputProps:Ye,rootRef:M,inputRef:D,open:G(L)})}function FC(e,t){switch(t.type){case"focus":return Ne(Ne({},e),{},{isFocused:!0});case"blur":return Ne(Ne({},e),{},{isFocused:!1});case"openDialog":return Ne(Ne({},Xa),{},{isFileDialogActive:!0});case"closeDialog":return Ne(Ne({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Ne(Ne({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Ne(Ne({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return Ne({},Xa);default:return e}}function dp(){}const pp=({children:e})=>{const t=_.useRef(null),[n,r]=_.useState({open:!1}),i=({title:a,description:s,confirmButtonText:l,cancelButtonText:u,onConfirm:f,onCancel:c,initialValue:p,Content:d})=>new Promise((m,h)=>{t.current=p,r({open:!0,title:a,description:s,confirmButtonText:l,cancelButtonText:u,content:d?S.jsx(d,{value:p,setValue:g=>{t.current=g}}):null,onConfirm:()=>{f==null||f(),m(t.current),o()},onCancel:()=>{c==null||c(),h(),o()}})}),o=()=>{r(a=>({...a,open:!1}))};return S.jsxs(oa.Provider,{value:{showInputModal:i},children:[S.jsx(In,{open:n.open,onOpenChange:a=>r(s=>({...s,open:a})),children:S.jsx(In.Content,{title:n.title,description:n.description,confirmButtonText:n.confirmButtonText,cancelButtonText:n.cancelButtonText,onConfirm:n.onConfirm,onCancel:n.onCancel,children:n.content})}),e]})},RC=(e,t)=>{const n=e.replace(/\s+/g,"+");if(!e.replace(/[^a-zA-Z0-9\s\-_]/g,"").trim())return;const i=t.filter(l=>/^\d+$/.test(l)).join(";"),o=`https://fonts.googleapis.com/css2?family=${n}:wght@${i}&display=swap`;if(document.querySelector(`link[href="${o}"]`))return;const s=document.createElement("link");s.rel="stylesheet",s.href=o,document.head.appendChild(s)},hp=({color:e,fontFamily:t,radius:n,themeMode:r,variant:i,headerVariant:o,additionalStylesheetUrl:a})=>{_.useMemo(()=>{t&&RC(t,["100","200","300","400","500","600","700","800"])},[t]);const s=_.useMemo(()=>sl({color:e,fontFamily:t,radius:n,themeMode:r,variant:i,headerVariant:o}),[e,t,n,r,i,o]);return S.jsxs(S.Fragment,{children:[a&&S.jsx("link",{rel:"stylesheet",href:a}),S.jsxs("style",{children:[s,`
|
|
307
|
+
*/var Il,ag;function BM(){if(ag)return Il;ag=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function i(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var s={},a=0;a<10;a++)s["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(s).map(function(f){return s[f]});if(l.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(f){u[f]=f}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Il=i()?Object.assign:function(o,s){for(var a,l=r(o),u,f=1;f<arguments.length;f++){a=Object(arguments[f]);for(var c in a)t.call(a,c)&&(l[c]=a[c]);if(e){u=e(a);for(var h=0;h<u.length;h++)n.call(a,u[h])&&(l[u[h]]=a[u[h]])}}return l},Il}var Ol,lg;function Ml(){if(lg)return Ol;lg=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Ol=e,Ol}var Dl,ug;function cg(){return ug||(ug=1,Dl=Function.call.bind(Object.prototype.hasOwnProperty)),Dl}var Nl,fg;function zM(){if(fg)return Nl;fg=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Ml(),n={},r=cg();e=function(o){var s="Warning: "+o;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}}function i(o,s,a,l,u){if(process.env.NODE_ENV!=="production"){for(var f in o)if(r(o,f)){var c;try{if(typeof o[f]!="function"){var h=Error((l||"React class")+": "+a+" type `"+f+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[f]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}c=o[f](s,f,l,a,null,t)}catch(m){c=m}if(c&&!(c instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+f+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof c+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),c instanceof Error&&!(c.message in n)){n[c.message]=!0;var d=u?u():"";e("Failed "+a+" type: "+c.message+(d??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Nl=i,Nl}var _l,dg;function UM(){if(dg)return _l;dg=1;var e=sg(),t=BM(),n=Ml(),r=cg(),i=zM(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function s(){return null}return _l=function(a,l){var u=typeof Symbol=="function"&&Symbol.iterator,f="@@iterator";function c(b){var _=b&&(u&&b[u]||b[f]);if(typeof _=="function")return _}var h="<<anonymous>>",d={array:y("array"),bigint:y("bigint"),bool:y("boolean"),func:y("function"),number:y("number"),object:y("object"),string:y("string"),symbol:y("symbol"),any:v(),arrayOf:w,element:E(),elementType:S(),instanceOf:C,node:T(),objectOf:M,oneOf:I,oneOfType:P,shape:U,exact:F};function m(b,_){return b===_?b!==0||1/b===1/_:b!==b&&_!==_}function p(b,_){this.message=b,this.data=_&&typeof _=="object"?_:{},this.stack=""}p.prototype=Error.prototype;function g(b){if(process.env.NODE_ENV!=="production")var _={},H=0;function x(Y,q,Q,X,se,G,te){if(X=X||h,G=G||Q,te!==n){if(l){var $=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw $.name="Invariant Violation",$}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ne=X+":"+Q;!_[ne]&&H<3&&(o("You are manually calling a React.PropTypes validation function for the `"+G+"` prop on `"+X+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),_[ne]=!0,H++)}}return q[Q]==null?Y?q[Q]===null?new p("The "+se+" `"+G+"` is marked as required "+("in `"+X+"`, but its value is `null`.")):new p("The "+se+" `"+G+"` is marked as required in "+("`"+X+"`, but its value is `undefined`.")):null:b(q,Q,X,se,G)}var V=x.bind(null,!1);return V.isRequired=x.bind(null,!0),V}function y(b){function _(H,x,V,Y,q,Q){var X=H[x],se=N(X);if(se!==b){var G=j(X);return new p("Invalid "+Y+" `"+q+"` of type "+("`"+G+"` supplied to `"+V+"`, expected ")+("`"+b+"`."),{expectedType:b})}return null}return g(_)}function v(){return g(s)}function w(b){function _(H,x,V,Y,q){if(typeof b!="function")return new p("Property `"+q+"` of component `"+V+"` has invalid PropType notation inside arrayOf.");var Q=H[x];if(!Array.isArray(Q)){var X=N(Q);return new p("Invalid "+Y+" `"+q+"` of type "+("`"+X+"` supplied to `"+V+"`, expected an array."))}for(var se=0;se<Q.length;se++){var G=b(Q,se,V,Y,q+"["+se+"]",n);if(G instanceof Error)return G}return null}return g(_)}function E(){function b(_,H,x,V,Y){var q=_[H];if(!a(q)){var Q=N(q);return new p("Invalid "+V+" `"+Y+"` of type "+("`"+Q+"` supplied to `"+x+"`, expected a single ReactElement."))}return null}return g(b)}function S(){function b(_,H,x,V,Y){var q=_[H];if(!e.isValidElementType(q)){var Q=N(q);return new p("Invalid "+V+" `"+Y+"` of type "+("`"+Q+"` supplied to `"+x+"`, expected a single ReactElement type."))}return null}return g(b)}function C(b){function _(H,x,V,Y,q){if(!(H[x]instanceof b)){var Q=b.name||h,X=W(H[x]);return new p("Invalid "+Y+" `"+q+"` of type "+("`"+X+"` supplied to `"+V+"`, expected ")+("instance of `"+Q+"`."))}return null}return g(_)}function I(b){if(!Array.isArray(b))return process.env.NODE_ENV!=="production"&&(arguments.length>1?o("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):o("Invalid argument supplied to oneOf, expected an array.")),s;function _(H,x,V,Y,q){for(var Q=H[x],X=0;X<b.length;X++)if(m(Q,b[X]))return null;var se=JSON.stringify(b,function(te,$){var ne=j($);return ne==="symbol"?String($):$});return new p("Invalid "+Y+" `"+q+"` of value `"+String(Q)+"` "+("supplied to `"+V+"`, expected one of "+se+"."))}return g(_)}function M(b){function _(H,x,V,Y,q){if(typeof b!="function")return new p("Property `"+q+"` of component `"+V+"` has invalid PropType notation inside objectOf.");var Q=H[x],X=N(Q);if(X!=="object")return new p("Invalid "+Y+" `"+q+"` of type "+("`"+X+"` supplied to `"+V+"`, expected an object."));for(var se in Q)if(r(Q,se)){var G=b(Q,se,V,Y,q+"."+se,n);if(G instanceof Error)return G}return null}return g(_)}function P(b){if(!Array.isArray(b))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var _=0;_<b.length;_++){var H=b[_];if(typeof H!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+B(H)+" at index "+_+"."),s}function x(V,Y,q,Q,X){for(var se=[],G=0;G<b.length;G++){var te=b[G],$=te(V,Y,q,Q,X,n);if($==null)return null;$.data&&r($.data,"expectedType")&&se.push($.data.expectedType)}var ne=se.length>0?", expected one of type ["+se.join(", ")+"]":"";return new p("Invalid "+Q+" `"+X+"` supplied to "+("`"+q+"`"+ne+"."))}return g(x)}function T(){function b(_,H,x,V,Y){return L(_[H])?null:new p("Invalid "+V+" `"+Y+"` supplied to "+("`"+x+"`, expected a ReactNode."))}return g(b)}function O(b,_,H,x,V){return new p((b||"React class")+": "+_+" type `"+H+"."+x+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+V+"`.")}function U(b){function _(H,x,V,Y,q){var Q=H[x],X=N(Q);if(X!=="object")return new p("Invalid "+Y+" `"+q+"` of type `"+X+"` "+("supplied to `"+V+"`, expected `object`."));for(var se in b){var G=b[se];if(typeof G!="function")return O(V,Y,q,se,j(G));var te=G(Q,se,V,Y,q+"."+se,n);if(te)return te}return null}return g(_)}function F(b){function _(H,x,V,Y,q){var Q=H[x],X=N(Q);if(X!=="object")return new p("Invalid "+Y+" `"+q+"` of type `"+X+"` "+("supplied to `"+V+"`, expected `object`."));var se=t({},H[x],b);for(var G in se){var te=b[G];if(r(b,G)&&typeof te!="function")return O(V,Y,q,G,j(te));if(!te)return new p("Invalid "+Y+" `"+q+"` key `"+G+"` supplied to `"+V+"`.\nBad object: "+JSON.stringify(H[x],null," ")+`
|
|
308
|
+
Valid keys: `+JSON.stringify(Object.keys(b),null," "));var $=te(Q,G,V,Y,q+"."+G,n);if($)return $}return null}return g(_)}function L(b){switch(typeof b){case"number":case"string":case"undefined":return!0;case"boolean":return!b;case"object":if(Array.isArray(b))return b.every(L);if(b===null||a(b))return!0;var _=c(b);if(_){var H=_.call(b),x;if(_!==b.entries){for(;!(x=H.next()).done;)if(!L(x.value))return!1}else for(;!(x=H.next()).done;){var V=x.value;if(V&&!L(V[1]))return!1}}else return!1;return!0;default:return!1}}function R(b,_){return b==="symbol"?!0:_?_["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&_ instanceof Symbol:!1}function N(b){var _=typeof b;return Array.isArray(b)?"array":b instanceof RegExp?"object":R(_,b)?"symbol":_}function j(b){if(typeof b>"u"||b===null)return""+b;var _=N(b);if(_==="object"){if(b instanceof Date)return"date";if(b instanceof RegExp)return"regexp"}return _}function B(b){var _=j(b);switch(_){case"array":case"object":return"an "+_;case"boolean":case"date":case"regexp":return"a "+_;default:return _}}function W(b){return!b.constructor||!b.constructor.name?h:b.constructor.name}return d.checkPropTypes=i,d.resetWarningCache=i.resetWarningCache,d.PropTypes=d,d},_l}var Pl,hg;function jM(){if(hg)return Pl;hg=1;var e=Ml();function t(){}function n(){}return n.resetWarningCache=t,Pl=function(){function r(s,a,l,u,f,c){if(c!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Pl}if(process.env.NODE_ENV!=="production"){var HM=sg(),VM=!0;Tl.exports=UM()(HM.isElement,VM)}else Tl.exports=jM()();var WM=Tl.exports;const Ne=vn(WM);var qM=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function ai(e,t){var n=YM(e);if(typeof n.path!="string"){var r=e.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof t=="string"?t:typeof r=="string"&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function YM(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),i=qM.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var KM=[".DS_Store","Thumbs.db"];function GM(e){return Zn(this,void 0,void 0,function(){return Jn(this,function(t){return Io(e)&&QM(e.dataTransfer)?[2,eD(e.dataTransfer,e.type)]:ZM(e)?[2,JM(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,XM(e)]:[2,[]]})})}function QM(e){return Io(e)}function ZM(e){return Io(e)&&Io(e.target)}function Io(e){return typeof e=="object"&&e!==null}function JM(e){return Ll(e.target.files).map(function(t){return ai(t)})}function XM(e){return Zn(this,void 0,void 0,function(){var t;return Jn(this,function(n){switch(n.label){case 0:return[4,Promise.all(e.map(function(r){return r.getFile()}))];case 1:return t=n.sent(),[2,t.map(function(r){return ai(r)})]}})})}function eD(e,t){return Zn(this,void 0,void 0,function(){var n,r;return Jn(this,function(i){switch(i.label){case 0:return e.items?(n=Ll(e.items).filter(function(o){return o.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(tD))]):[3,2];case 1:return r=i.sent(),[2,pg(mg(r))];case 2:return[2,pg(Ll(e.files).map(function(o){return ai(o)}))]}})})}function pg(e){return e.filter(function(t){return KM.indexOf(t.name)===-1})}function Ll(e){if(e===null)return[];for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r)}return t}function tD(e){if(typeof e.webkitGetAsEntry!="function")return gg(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?yg(t):gg(e)}function mg(e){return e.reduce(function(t,n){return Ga(Ga([],_p(t),!1),_p(Array.isArray(n)?mg(n):[n]),!1)},[])}function gg(e){var t=e.getAsFile();if(!t)return Promise.reject("".concat(e," is not a File"));var n=ai(t);return Promise.resolve(n)}function nD(e){return Zn(this,void 0,void 0,function(){return Jn(this,function(t){return[2,e.isDirectory?yg(e):rD(e)]})})}function yg(e){var t=e.createReader();return new Promise(function(n,r){var i=[];function o(){var s=this;t.readEntries(function(a){return Zn(s,void 0,void 0,function(){var l,u,f;return Jn(this,function(c){switch(c.label){case 0:if(a.length)return[3,5];c.label=1;case 1:return c.trys.push([1,3,,4]),[4,Promise.all(i)];case 2:return l=c.sent(),n(l),[3,4];case 3:return u=c.sent(),r(u),[3,4];case 4:return[3,6];case 5:f=Promise.all(a.map(nD)),i.push(f),o(),c.label=6;case 6:return[2]}})})},function(a){r(a)})}o()})}function rD(e){return Zn(this,void 0,void 0,function(){return Jn(this,function(t){return[2,new Promise(function(n,r){e.file(function(i){var o=ai(i,e.fullPath);n(o)},function(i){r(i)})})]})})}var iD=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var r=e.name||"",i=(e.type||"").toLowerCase(),o=i.replace(/\/.*$/,"");return n.some(function(s){var a=s.trim().toLowerCase();return a.charAt(0)==="."?r.toLowerCase().endsWith(a):a.endsWith("/*")?o===a.replace(/\/.*$/,""):i===a})}return!0};function vg(e){return aD(e)||sD(e)||xg(e)||oD()}function oD(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
309
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sD(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function aD(e){if(Array.isArray(e))return Fl(e)}function bg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function wg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bg(Object(n),!0).forEach(function(r){Sg(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bg(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Sg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function li(e,t){return cD(e)||uD(e,t)||xg(e,t)||lD()}function lD(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
310
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xg(e,t){if(e){if(typeof e=="string")return Fl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Fl(e,t)}}function Fl(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function uD(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,s,a;try{for(n=n.call(e);!(i=(s=n.next()).done)&&(r.push(s.value),!(t&&r.length===t));i=!0);}catch(l){o=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw a}}return r}}function cD(e){if(Array.isArray(e))return e}var fD="file-invalid-type",dD="file-too-large",hD="file-too-small",pD="too-many-files",mD=function(t){t=Array.isArray(t)&&t.length===1?t[0]:t;var n=Array.isArray(t)?"one of ".concat(t.join(", ")):t;return{code:fD,message:"File type must be ".concat(n)}},kg=function(t){return{code:dD,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},Eg=function(t){return{code:hD,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},gD={code:pD,message:"Too many files"};function Cg(e,t){var n=e.type==="application/x-moz-file"||iD(e,t);return[n,n?null:mD(t)]}function Ag(e,t,n){if(Nn(e.size))if(Nn(t)&&Nn(n)){if(e.size>n)return[!1,kg(n)];if(e.size<t)return[!1,Eg(t)]}else{if(Nn(t)&&e.size<t)return[!1,Eg(t)];if(Nn(n)&&e.size>n)return[!1,kg(n)]}return[!0,null]}function Nn(e){return e!=null}function yD(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,o=e.multiple,s=e.maxFiles,a=e.validator;return!o&&t.length>1||o&&s>=1&&t.length>s?!1:t.every(function(l){var u=Cg(l,n),f=li(u,1),c=f[0],h=Ag(l,r,i),d=li(h,1),m=d[0],p=a?a(l):null;return c&&m&&!p})}function Oo(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Mo(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function Tg(e){e.preventDefault()}function vD(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function bD(e){return e.indexOf("Edge/")!==-1}function wD(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return vD(e)||bD(e)}function Ht(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];return t.some(function(a){return!Oo(r)&&a&&a.apply(void 0,[r].concat(o)),Oo(r)})}}function SD(){return"showOpenFilePicker"in window}function xD(e){if(Nn(e)){var t=Object.entries(e).filter(function(n){var r=li(n,2),i=r[0],o=r[1],s=!0;return Ig(i)||(console.warn('Skipped "'.concat(i,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),s=!1),(!Array.isArray(o)||!o.every(Og))&&(console.warn('Skipped "'.concat(i,'" because an invalid file extension was provided.')),s=!1),s}).reduce(function(n,r){var i=li(r,2),o=i[0],s=i[1];return wg(wg({},n),{},Sg({},o,s))},{});return[{description:"Files",accept:t}]}return e}function kD(e){if(Nn(e))return Object.entries(e).reduce(function(t,n){var r=li(n,2),i=r[0],o=r[1];return[].concat(vg(t),[i],vg(o))},[]).filter(function(t){return Ig(t)||Og(t)}).join(",")}function ED(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function CD(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function Ig(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function Og(e){return/^.*\.[\w]+$/.test(e)}var AD=["children"],TD=["open"],ID=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],OD=["refKey","onChange","onClick"];function MD(e){return _D(e)||ND(e)||Mg(e)||DD()}function DD(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
311
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ND(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function _D(e){if(Array.isArray(e))return $l(e)}function Rl(e,t){return FD(e)||LD(e,t)||Mg(e,t)||PD()}function PD(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
312
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Mg(e,t){if(e){if(typeof e=="string")return $l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $l(e,t)}}function $l(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function LD(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,s,a;try{for(n=n.call(e);!(i=(s=n.next()).done)&&(r.push(s.value),!(t&&r.length===t));i=!0);}catch(l){o=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw a}}return r}}function FD(e){if(Array.isArray(e))return e}function Dg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Be(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Dg(Object(n),!0).forEach(function(r){Bl(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dg(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Bl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Do(e,t){if(e==null)return{};var n=RD(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function RD(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var zl=D.forwardRef(function(e,t){var n=e.children,r=Do(e,AD),i=_g(r),o=i.open,s=Do(i,TD);return D.useImperativeHandle(t,function(){return{open:o}},[o]),D.createElement(D.Fragment,null,n(Be(Be({},s),{},{open:o})))});zl.displayName="Dropzone";var Ng={disabled:!1,getFilesFromEvent:GM,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};zl.defaultProps=Ng,zl.propTypes={children:Ne.func,accept:Ne.objectOf(Ne.arrayOf(Ne.string)),multiple:Ne.bool,preventDropOnDocument:Ne.bool,noClick:Ne.bool,noKeyboard:Ne.bool,noDrag:Ne.bool,noDragEventsBubbling:Ne.bool,minSize:Ne.number,maxSize:Ne.number,maxFiles:Ne.number,disabled:Ne.bool,getFilesFromEvent:Ne.func,onFileDialogCancel:Ne.func,onFileDialogOpen:Ne.func,useFsAccessApi:Ne.bool,autoFocus:Ne.bool,onDragEnter:Ne.func,onDragLeave:Ne.func,onDragOver:Ne.func,onDrop:Ne.func,onDropAccepted:Ne.func,onDropRejected:Ne.func,onError:Ne.func,validator:Ne.func};var Ul={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function _g(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Be(Be({},Ng),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,o=t.maxSize,s=t.minSize,a=t.multiple,l=t.maxFiles,u=t.onDragEnter,f=t.onDragLeave,c=t.onDragOver,h=t.onDrop,d=t.onDropAccepted,m=t.onDropRejected,p=t.onFileDialogCancel,g=t.onFileDialogOpen,y=t.useFsAccessApi,v=t.autoFocus,w=t.preventDropOnDocument,E=t.noClick,S=t.noKeyboard,C=t.noDrag,I=t.noDragEventsBubbling,M=t.onError,P=t.validator,T=D.useMemo(function(){return kD(n)},[n]),O=D.useMemo(function(){return xD(n)},[n]),U=D.useMemo(function(){return typeof g=="function"?g:Pg},[g]),F=D.useMemo(function(){return typeof p=="function"?p:Pg},[p]),L=D.useRef(null),R=D.useRef(null),N=D.useReducer($D,Ul),j=Rl(N,2),B=j[0],W=j[1],b=B.isFocused,_=B.isFileDialogActive,H=D.useRef(typeof window<"u"&&window.isSecureContext&&y&&SD()),x=function(){!H.current&&_&&setTimeout(function(){if(R.current){var ae=R.current.files;ae.length||(W({type:"closeDialog"}),F())}},300)};D.useEffect(function(){return window.addEventListener("focus",x,!1),function(){window.removeEventListener("focus",x,!1)}},[R,_,F,H]);var V=D.useRef([]),Y=function(ae){L.current&&L.current.contains(ae.target)||(ae.preventDefault(),V.current=[])};D.useEffect(function(){return w&&(document.addEventListener("dragover",Tg,!1),document.addEventListener("drop",Y,!1)),function(){w&&(document.removeEventListener("dragover",Tg),document.removeEventListener("drop",Y))}},[L,w]),D.useEffect(function(){return!r&&v&&L.current&&L.current.focus(),function(){}},[L,v,r]);var q=D.useCallback(function(ee){M?M(ee):console.error(ee)},[M]),Q=D.useCallback(function(ee){ee.preventDefault(),ee.persist(),Ae(ee),V.current=[].concat(MD(V.current),[ee.target]),Mo(ee)&&Promise.resolve(i(ee)).then(function(ae){if(!(Oo(ee)&&!I)){var z=ae.length,K=z>0&&yD({files:ae,accept:T,minSize:s,maxSize:o,multiple:a,maxFiles:l,validator:P}),oe=z>0&&!K;W({isDragAccept:K,isDragReject:oe,isDragActive:!0,type:"setDraggedFiles"}),u&&u(ee)}}).catch(function(ae){return q(ae)})},[i,u,q,I,T,s,o,a,l,P]),X=D.useCallback(function(ee){ee.preventDefault(),ee.persist(),Ae(ee);var ae=Mo(ee);if(ae&&ee.dataTransfer)try{ee.dataTransfer.dropEffect="copy"}catch{}return ae&&c&&c(ee),!1},[c,I]),se=D.useCallback(function(ee){ee.preventDefault(),ee.persist(),Ae(ee);var ae=V.current.filter(function(K){return L.current&&L.current.contains(K)}),z=ae.indexOf(ee.target);z!==-1&&ae.splice(z,1),V.current=ae,!(ae.length>0)&&(W({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Mo(ee)&&f&&f(ee))},[L,f,I]),G=D.useCallback(function(ee,ae){var z=[],K=[];ee.forEach(function(oe){var le=Cg(oe,T),he=Rl(le,2),He=he[0],Ge=he[1],Ze=Ag(oe,s,o),Et=Rl(Ze,2),Rt=Et[0],Qe=Et[1],Ct=P?P(oe):null;if(He&&Rt&&!Ct)z.push(oe);else{var at=[Ge,Qe];Ct&&(at=at.concat(Ct)),K.push({file:oe,errors:at.filter(function(ns){return ns})})}}),(!a&&z.length>1||a&&l>=1&&z.length>l)&&(z.forEach(function(oe){K.push({file:oe,errors:[gD]})}),z.splice(0)),W({acceptedFiles:z,fileRejections:K,type:"setFiles"}),h&&h(z,K,ae),K.length>0&&m&&m(K,ae),z.length>0&&d&&d(z,ae)},[W,a,T,s,o,l,h,d,m,P]),te=D.useCallback(function(ee){ee.preventDefault(),ee.persist(),Ae(ee),V.current=[],Mo(ee)&&Promise.resolve(i(ee)).then(function(ae){Oo(ee)&&!I||G(ae,ee)}).catch(function(ae){return q(ae)}),W({type:"reset"})},[i,G,q,I]),$=D.useCallback(function(){if(H.current){W({type:"openDialog"}),U();var ee={multiple:a,types:O};window.showOpenFilePicker(ee).then(function(ae){return i(ae)}).then(function(ae){G(ae,null),W({type:"closeDialog"})}).catch(function(ae){ED(ae)?(F(ae),W({type:"closeDialog"})):CD(ae)?(H.current=!1,R.current?(R.current.value=null,R.current.click()):q(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):q(ae)});return}R.current&&(W({type:"openDialog"}),U(),R.current.value=null,R.current.click())},[W,U,F,y,G,q,O,a]),ne=D.useCallback(function(ee){!L.current||!L.current.isEqualNode(ee.target)||(ee.key===" "||ee.key==="Enter"||ee.keyCode===32||ee.keyCode===13)&&(ee.preventDefault(),$())},[L,$]),ge=D.useCallback(function(){W({type:"focus"})},[]),Oe=D.useCallback(function(){W({type:"blur"})},[]),J=D.useCallback(function(){E||(wD()?setTimeout($,0):$())},[E,$]),ue=function(ae){return r?null:ae},de=function(ae){return S?null:ue(ae)},fe=function(ae){return C?null:ue(ae)},Ae=function(ae){I&&ae.stopPropagation()},Fe=D.useMemo(function(){return function(){var ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ae=ee.refKey,z=ae===void 0?"ref":ae,K=ee.role,oe=ee.onKeyDown,le=ee.onFocus,he=ee.onBlur,He=ee.onClick,Ge=ee.onDragEnter,Ze=ee.onDragOver,Et=ee.onDragLeave,Rt=ee.onDrop,Qe=Do(ee,ID);return Be(Be(Bl({onKeyDown:de(Ht(oe,ne)),onFocus:de(Ht(le,ge)),onBlur:de(Ht(he,Oe)),onClick:ue(Ht(He,J)),onDragEnter:fe(Ht(Ge,Q)),onDragOver:fe(Ht(Ze,X)),onDragLeave:fe(Ht(Et,se)),onDrop:fe(Ht(Rt,te)),role:typeof K=="string"&&K!==""?K:"presentation"},z,L),!r&&!S?{tabIndex:0}:{}),Qe)}},[L,ne,ge,Oe,J,Q,X,se,te,S,C,r]),Me=D.useCallback(function(ee){ee.stopPropagation()},[]),je=D.useMemo(function(){return function(){var ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ae=ee.refKey,z=ae===void 0?"ref":ae,K=ee.onChange,oe=ee.onClick,le=Do(ee,OD),he=Bl({accept:T,multiple:a,type:"file",style:{display:"none"},onChange:ue(Ht(K,te)),onClick:ue(Ht(oe,Me)),tabIndex:-1},z,R);return Be(Be({},he),le)}},[R,n,a,te,r]);return Be(Be({},B),{},{isFocused:b&&!r,getRootProps:Fe,getInputProps:je,rootRef:L,inputRef:R,open:ue($)})}function $D(e,t){switch(t.type){case"focus":return Be(Be({},e),{},{isFocused:!0});case"blur":return Be(Be({},e),{},{isFocused:!1});case"openDialog":return Be(Be({},Ul),{},{isFileDialogActive:!0});case"closeDialog":return Be(Be({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Be(Be({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Be(Be({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return Be({},Ul);default:return e}}function Pg(){}const Lg=({children:e})=>{const t=D.useRef(null),[n,r]=D.useState({open:!1}),i=({title:s,description:a,confirmButtonText:l,cancelButtonText:u,onConfirm:f,onCancel:c,initialValue:h,Content:d})=>new Promise((m,p)=>{t.current=h,r({open:!0,title:s,description:a,confirmButtonText:l,cancelButtonText:u,content:d?k.jsx(d,{value:h,setValue:g=>{t.current=g}}):null,onConfirm:()=>{f==null||f(),m(t.current),o()},onCancel:()=>{c==null||c(),p(),o()}})}),o=()=>{r(s=>({...s,open:!1}))};return k.jsxs(Ya.Provider,{value:{showInputModal:i},children:[k.jsx(vr,{open:n.open,onOpenChange:s=>r(a=>({...a,open:s})),children:k.jsx(vr.Content,{title:n.title,description:n.description,confirmButtonText:n.confirmButtonText,cancelButtonText:n.cancelButtonText,onConfirm:n.onConfirm,onCancel:n.onCancel,children:n.content})}),e]})},BD=(e,t)=>{const n=e.replace(/\s+/g,"+");if(!e.replace(/[^a-zA-Z0-9\s\-_]/g,"").trim())return;const i=t.filter(l=>/^\d+$/.test(l)).join(";"),o=`https://fonts.googleapis.com/css2?family=${n}:wght@${i}&display=swap`;if(document.querySelector(`link[href="${o}"]`))return;const a=document.createElement("link");a.rel="stylesheet",a.href=o,document.head.appendChild(a)},Fg=({color:e,fontFamily:t,radius:n,themeMode:r,variant:i,headerVariant:o,additionalStylesheetUrl:s})=>{D.useMemo(()=>{t&&BD(t,["100","200","300","400","500","600","700","800"])},[t]);const a=D.useMemo(()=>Ff({color:e,fontFamily:t,radius:n,themeMode:r,variant:i,headerVariant:o}),[e,t,n,r,i,o]);return k.jsxs(k.Fragment,{children:[s&&k.jsx("link",{rel:"stylesheet",href:s}),k.jsxs("style",{children:[a,`
|
|
304
313
|
.bpWebchat {
|
|
305
314
|
border-radius: ${.375*(n??1)}rem;
|
|
306
315
|
}
|
|
307
316
|
.bpMessagePreview {
|
|
308
317
|
border-radius: ${.125*(n??1)}rem;
|
|
309
318
|
}
|
|
310
|
-
`]})]})},es=({children:e,className:t,uploadFile:n,allowFileUpload:r,storageKey:i,connected:o,...a})=>{const{container:s}=ge,l=sn(g=>g.setMessageContainerRef),f=of(i)(g=>g.uploadFile),[c,p]=_.useState(0),d=_.useRef(null);_.useEffect(()=>{l(d)},[d,l]);const m=_.useCallback(g=>{n&&(g.forEach(y=>f(y,n)),p(0))},[f,n]),{getRootProps:h}=fp({noClick:!0,noKeyboard:!0,onDrop:m,disabled:!(r&&n),onDragEnter:()=>p(g=>g+1),onDragLeave:()=>p(g=>g-1)});return S.jsxs("div",{...a,className:dr(s.className,t),...h(),ref:d,children:[S.jsxs("div",{"data-hover":c>0,...s.dropzone.overlay,children:["Drop files to upload",S.jsx(R0,{style:{width:"50px"}})]}),S.jsx(pp,{children:e})]})};es.displayName="Container";const mp=_.forwardRef(({onClick:e,imgUrl:t,...n},r)=>{const{fab:i}=ge,{container:o,icon:a,image:s}=i??{};return t?S.jsx("img",{src:t,role:"button",tabIndex:0,...s,draggable:"false",onClick:e}):S.jsx("div",{...n,...o,ref:r,onClick:e,children:S.jsx("div",{...a})})});mp.displayName="Fab";function At(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function BC(e,t){const n=E.createContext(t),r=o=>{const{children:a,...s}=o,l=E.useMemo(()=>s,Object.values(s));return S.jsx(n.Provider,{value:l,children:a})};r.displayName=e+"Provider";function i(o){const a=E.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function gp(e,t=[]){let n=[];function r(o,a){const s=E.createContext(a),l=n.length;n=[...n,a];const u=c=>{var y;const{scope:p,children:d,...m}=c,h=((y=p==null?void 0:p[e])==null?void 0:y[l])||s,g=E.useMemo(()=>m,Object.values(m));return S.jsx(h.Provider,{value:g,children:d})};u.displayName=o+"Provider";function f(c,p){var h;const d=((h=p==null?void 0:p[e])==null?void 0:h[l])||s,m=E.useContext(d);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${c}\` must be used within \`${o}\``)}return[u,f]}const i=()=>{const o=n.map(a=>E.createContext(a));return function(s){const l=(s==null?void 0:s[e])||o;return E.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[r,zC(i,...t)]}function zC(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((s,{useScope:l,scopeName:u})=>{const c=l(o)[`__scope${u}`];return{...s,...c}},{});return E.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var $C=E[" useInsertionEffect ".trim().toString()]||Tt;function yp({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,a]=jC({defaultProp:t,onChange:n}),s=e!==void 0,l=s?e:i;{const f=E.useRef(e!==void 0);E.useEffect(()=>{const c=f.current;c!==s&&console.warn(`${r} is changing from ${c?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=s},[s,r])}const u=E.useCallback(f=>{var c;if(s){const p=UC(f)?f(e):f;p!==e&&((c=a.current)==null||c.call(a,p))}else o(f)},[s,e,o,a]);return[l,u]}function jC({defaultProp:e,onChange:t}){const[n,r]=E.useState(e),i=E.useRef(n),o=E.useRef(t);return $C(()=>{o.current=t},[t]),E.useEffect(()=>{var a;i.current!==n&&((a=o.current)==null||a.call(o,n),i.current=n)},[n,i]),[n,r,o]}function UC(e){return typeof e=="function"}function vp(e){const t=HC(e),n=E.forwardRef((r,i)=>{const{children:o,...a}=r,s=E.Children.toArray(o),l=s.find(VC);if(l){const u=l.props.children,f=s.map(c=>c===l?E.Children.count(u)>1?E.Children.only(null):E.isValidElement(u)?u.props.children:null:c);return S.jsx(t,{...a,ref:i,children:E.isValidElement(u)?E.cloneElement(u,void 0,f):null})}return S.jsx(t,{...a,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function HC(e){const t=E.forwardRef((n,r)=>{const{children:i,...o}=n;if(E.isValidElement(i)){const a=KC(i),s=qC(o,i.props);return i.type!==E.Fragment&&(s.ref=r?ji(r,a):a),E.cloneElement(i,s)}return E.Children.count(i)>1?E.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var WC=Symbol("radix.slottable");function VC(e){return E.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===WC}function qC(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{const l=o(...s);return i(...s),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function KC(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var YC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ht=YC.reduce((e,t)=>{const n=vp(`Primitive.${t}`),r=E.forwardRef((i,o)=>{const{asChild:a,...s}=i,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(l,{...s,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function GC(e,t){e&&Ls.flushSync(()=>e.dispatchEvent(t))}function QC(e,t){return E.useReducer((n,r)=>t[n][r]??n,e)}var bi=e=>{const{present:t,children:n}=e,r=JC(t),i=typeof n=="function"?n({present:r.isPresent}):E.Children.only(n),o=Ot(r.ref,ZC(i));return typeof n=="function"||r.isPresent?E.cloneElement(i,{ref:o}):null};bi.displayName="Presence";function JC(e){const[t,n]=E.useState(),r=E.useRef(null),i=E.useRef(e),o=E.useRef("none"),a=e?"mounted":"unmounted",[s,l]=QC(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return E.useEffect(()=>{const u=wi(r.current);o.current=s==="mounted"?u:"none"},[s]),Tt(()=>{const u=r.current,f=i.current;if(f!==e){const p=o.current,d=wi(u);e?l("MOUNT"):d==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(f&&p!==d?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),Tt(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,c=d=>{const h=wi(r.current).includes(CSS.escape(d.animationName));if(d.target===t&&h&&(l("ANIMATION_END"),!i.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},p=d=>{d.target===t&&(o.current=wi(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:E.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function wi(e){return(e==null?void 0:e.animationName)||"none"}function ZC(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var XC=E[" useId ".trim().toString()]||(()=>{}),eA=0;function xi(e){const[t,n]=E.useState(XC());return Tt(()=>{n(r=>r??String(eA++))},[e]),e||(t?`radix-${t}`:"")}var ki="Collapsible",[tA]=gp(ki),[nA,ts]=tA(ki),bp=E.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:a,...s}=e,[l,u]=yp({prop:r,defaultProp:i??!1,onChange:a,caller:ki});return S.jsx(nA,{scope:n,disabled:o,contentId:xi(),open:l,onOpenToggle:E.useCallback(()=>u(f=>!f),[u]),children:S.jsx(ht.div,{"data-state":rs(l),"data-disabled":o?"":void 0,...s,ref:t})})});bp.displayName=ki;var wp="CollapsibleTrigger",xp=E.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=ts(wp,n);return S.jsx(ht.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":rs(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:At(e.onClick,i.onOpenToggle)})});xp.displayName=wp;var ns="CollapsibleContent",kp=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=ts(ns,e.__scopeCollapsible);return S.jsx(bi,{present:n||i.open,children:({present:o})=>S.jsx(rA,{...r,ref:t,present:o})})});kp.displayName=ns;var rA=E.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=e,a=ts(ns,n),[s,l]=E.useState(r),u=E.useRef(null),f=Ot(t,u),c=E.useRef(0),p=c.current,d=E.useRef(0),m=d.current,h=a.open||s,g=E.useRef(h),y=E.useRef(void 0);return E.useEffect(()=>{const v=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(v)},[]),Tt(()=>{const v=u.current;if(v){y.current=y.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const w=v.getBoundingClientRect();c.current=w.height,d.current=w.width,g.current||(v.style.transitionDuration=y.current.transitionDuration,v.style.animationName=y.current.animationName),l(r)}},[a.open,r]),S.jsx(ht.div,{"data-state":rs(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!h,...o,ref:f,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:h&&i})});function rs(e){return e?"open":"closed"}var iA=bp,oA=kp;const is=({restartConversation:e,...t})=>{var o,a;const{header:n}=ge,{showInputModal:r}=aa(),i=async s=>{s.stopPropagation(),r?r({title:"Create New Conversation",description:"This will clear the current conversation and start a new one.",confirmButtonText:"New conversation",cancelButtonText:"Cancel"}).then(()=>e()):e()};return S.jsx(J0,{...t,...(a=(o=n==null?void 0:n.content)==null?void 0:o.actions)==null?void 0:a.icons,"aria-label":"Restart Conversation Button",tabIndex:0,role:"button",onClick:i})},Sp=({onClick:e,...t})=>{const{header:n}=ge,r=i=>{i.stopPropagation(),e==null||e()};return S.jsx(Fc,{...t,...n.content.actions.icons,role:"button",tabIndex:0,"aria-label":"Close Chatbot Button",onClick:r,onKeyDown:i=>{i.key==="Enter"&&r(i)}})},mr=({icon:e,title:t,link:n,...r})=>{var a,s,l,u,f,c,p,d,m,h,g,y;const{header:i}=ge,o=e??B0;return t?n?S.jsxs("a",{...r,...(s=(a=i.expandedContent)==null?void 0:a.descriptionItems)==null?void 0:s.container,href:n,target:"_blank",rel:"noreferrer noopener",children:[S.jsx(o,{...(u=(l=i.expandedContent)==null?void 0:l.descriptionItems)==null?void 0:u.icon}),S.jsx("p",{...(c=(f=i.expandedContent)==null?void 0:f.descriptionItems)==null?void 0:c.link,children:t})]}):S.jsxs("div",{...r,...(d=(p=i.expandedContent)==null?void 0:p.descriptionItems)==null?void 0:d.container,children:[S.jsx(o,{...(h=(m=i.expandedContent)==null?void 0:m.descriptionItems)==null?void 0:h.icon}),S.jsx("p",{...(y=(g=i.expandedContent)==null?void 0:g.descriptionItems)==null?void 0:y.text,children:t})]}):null},aA=({soundOn:e,toggleSound:t})=>{const n=o=>{o.stopPropagation(),t==null||t()},{header:r}=ge,i=e?Lc:n1;return S.jsx("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),n(o))},title:e?"Disable chat sounds":"Enable chat sounds",...r.content.actions.icons,children:S.jsx(i,{size:16})})},Ep=({defaultOpen:e,closeWindow:t,configuration:n,restartConversation:r,disabled:i,soundOn:o,toggleSound:a,clientId:s,...l})=>{var m,h,g,y,v,w,A,k,C,T,P,F,I,O,j,z,M,D,B,U,$,V,b,N;const{header:u}=ge,[f,c]=_.useState(e),p=!!((m=n.email)!=null&&m.title)||!!((h=n.phone)!=null&&h.title)||!!((g=n.website)!=null&&g.title)||!!((y=n.termsOfService)!=null&&y.link)||!!((v=n.privacyPolicy)!=null&&v.link),d=p&&!i;return S.jsxs(iA,{open:d?f:!1,onOpenChange:c,"data-disabled":d?void 0:"",...u.container,...l,children:[S.jsxs(xp,{"aria-label":"Expand Header Button",...u.content.container,children:[S.jsx(Nn,{userId:s,src:n.botAvatar,...u.content.avatar,children:n.botName||"Bot"}),S.jsx("h2",{...u.content.title,children:n.botName||"Bot"}),n.botDescription&&S.jsx("p",{...u.content.description,children:n.botDescription}),S.jsxs("div",{...u.content.actions.container,children:[n.soundEnabled&&o!==void 0&&a&&S.jsx(aA,{soundOn:o,toggleSound:a})," ",r&&S.jsx(is,{restartConversation:r}),t&&S.jsx(Sp,{onClick:t})]})]}),p&&S.jsxs(oA,{...u.expandedContent.container,children:[S.jsxs("div",{"data-links":"",...u.expandedContent.group,children:[S.jsx(mr,{"data-email":"",icon:V0,title:(w=n.email)==null?void 0:w.title,link:(k=(A=n.email)==null?void 0:A.link)!=null&&k.startsWith("mailto:")?(C=n.email)==null?void 0:C.link:`mailto:${(T=n.email)==null?void 0:T.link}`}),S.jsx(mr,{"data-phone":"",icon:G0,title:(P=n.phone)==null?void 0:P.title,link:(I=(F=n.phone)==null?void 0:F.link)!=null&&I.startsWith("tel:")?(O=n.phone)==null?void 0:O.link:`tel:${(j=n.phone)==null?void 0:j.link}`}),S.jsx(mr,{"data-website":"",link:(z=n.website)==null?void 0:z.link,icon:j0,title:(M=n.website)==null?void 0:M.title})]}),S.jsxs("div",{"data-legal":"",...(D=u.expandedContent)==null?void 0:D.group,children:[((B=n.termsOfService)==null?void 0:B.link)&&S.jsx(mr,{"data-terms":"",link:(U=n.termsOfService)==null?void 0:U.link,icon:Pc,title:($=n.termsOfService)==null?void 0:$.title}),((V=n.privacyPolicy)==null?void 0:V.link)&&S.jsx(mr,{"data-privacy":"",link:(b=n.privacyPolicy)==null?void 0:b.link,icon:W0,title:(N=n.privacyPolicy)==null?void 0:N.title})]})]})]})},os=_.memo(({...e})=>{const{typingIndicator:t}=ge;return S.jsx("div",{...e,...t==null?void 0:t.container,children:S.jsx("div",{...t==null?void 0:t.loader})})});os.displayName="TypingIndicator";const as=_.memo(_.forwardRef(({direction:e,block:t,disableInput:n,children:r,sender:i,id:o,authorId:a,status:s,renderers:l,isReadOnly:u,isLastDeliveredMessage:f,feedback:c,timestamp:p,metadata:d,sendMessage:m,addMessageFeedback:h,showAvatar:g},y)=>{const[v,w]=_.useState([]),{message:{container:A,deliveryStatus:k}}=ge;return g=g??e==="incoming",S.jsx(ia.Provider,{value:{isLoading:v,setIsLoading:w},children:S.jsxs("div",{...A,className:dr(A==null?void 0:A.className,f&&(k==null?void 0:k.className)),"data-loaded":v.length===0,"data-disable-input":!!n,"data-direction":e,dir:"auto",ref:y,children:[e==="incoming"&&g&&S.jsx(Cp,{authorId:a,sender:i}),t&&S.jsx(Yt,{block:{...t,isReadOnly:u,direction:e,timestamp:p,sender:i,feedback:c,messageId:o,status:s,metadata:d,sendMessage:m,addMessageFeedback:h},renderers:l}),e==="outgoing"&&g&&S.jsx(Cp,{authorId:a,sender:i}),r]})})})),Cp=({authorId:e,sender:t})=>{const{message:{avatar:n}}=ge,[r,i]=_.useState("idle"),o=Vs(e??"",15);return S.jsxs(Ki,{"data-color":o,"data-loading-status":r,...n==null?void 0:n.container,children:[S.jsx(Yi,{...n==null?void 0:n.image,onLoadingStatusChange:i,src:t==null?void 0:t.avatar}),S.jsxs(Gi,{...n==null?void 0:n.fallback,children:[t==null?void 0:t.name[0]," "]})]})};function sA({botAvatar:e,botDescription:t,botName:n}){const{messageList:{marquee:r}}=ge;return S.jsxs("li",{...r.container,children:[S.jsx(Nn,{src:e,...r.avatar,children:(n||"Bot").slice(0,1)}),S.jsxs("div",{...r.content,children:[S.jsx("h1",{...r.title,children:n||"Bot"}),S.jsx("p",{...r.description,children:t})]})]})}let ss=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");/*!---------------------------------------------------------------------------------------------
|
|
319
|
+
`]})]})};let No;const zD=new Uint8Array(16);function UD(){if(!No&&(No=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!No))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return No(zD)}const Xe=[];for(let e=0;e<256;++e)Xe.push((e+256).toString(16).slice(1));function jD(e,t=0){return Xe[e[t+0]]+Xe[e[t+1]]+Xe[e[t+2]]+Xe[e[t+3]]+"-"+Xe[e[t+4]]+Xe[e[t+5]]+"-"+Xe[e[t+6]]+Xe[e[t+7]]+"-"+Xe[e[t+8]]+Xe[e[t+9]]+"-"+Xe[e[t+10]]+Xe[e[t+11]]+Xe[e[t+12]]+Xe[e[t+13]]+Xe[e[t+14]]+Xe[e[t+15]]}const Rg={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function HD(e,t,n){if(Rg.randomUUID&&!e)return Rg.randomUUID();e=e||{};const r=e.random||(e.rng||UD)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,jD(r)}function ui(e){var s;const{metadata:t,conversationId:n,userId:r}=e,{payload:i,disableInput:o}=$g(e.payload);return{id:e.id,conversationId:n,authorId:r,timestamp:new Date(e.createdAt),block:i,feedback:(s=e.feedback)==null?void 0:s.value,disableInput:o,metadata:t}}const $g=e=>{switch(e.type){case"audio":return Bg(e);case"card":return VD(e);case"carousel":return WD(e);case"choice":return qD(e);case"dropdown":return YD(e);case"file":return zg(e);case"image":return Ug(e);case"location":return jg(e);case"markdown":return Hg(e);case"text":return Vg(e);case"video":return Wg(e);case"bloc":return KD(e);case"custom":return{payload:e};default:{const t=e;throw new Error(`Unsuported message type ${t}`)}}},ci=e=>({block:e,type:"bubble"}),Bg=e=>({payload:{type:"audio",url:e.audioUrl}}),VD=e=>({payload:ci(qg(e))}),WD=e=>({payload:{type:"carousel",blocks:e.items.map(t=>qg({...t}))}}),qD=e=>{const t=e.options.map(o=>({title:o.label,value:o.value})),n=e.text,r=HD(),i=ci({type:"text",text:n});return t.length===0?{disableInput:e.disableFreeText,payload:i}:{disableInput:e.disableFreeText,payload:{type:"column",blocks:[i,{type:"row",blocks:t.map(({title:o,value:s})=>({type:"button",variant:"action",text:o,buttonValue:s,groupId:r}))}]}}},YD=e=>{const t=e.options.map(i=>({label:i.label,value:i.value})),n=e.text,r=[{type:"dropdown",label:n??"Select an option",options:t}];return n&&r.unshift({type:"text",text:n}),{disableInput:!0,payload:ci({type:"column",blocks:r})}},zg=e=>({payload:{type:"file",url:e.fileUrl,title:e.title}}),Ug=e=>({payload:{type:"image",url:e.imageUrl}}),jg=e=>({payload:{type:"location",latitude:e.latitude,longitude:e.longitude,title:e.title??e.address??"View on map"}}),Hg=e=>({payload:ci({type:"text",text:e.markdown})}),Vg=e=>({payload:ci({type:"text",text:e.text,value:e.value})}),Wg=e=>({payload:{type:"video",url:e.videoUrl}}),KD=e=>({payload:{type:"column",blocks:e.items.map(n=>{switch(n.type){case"audio":return Bg({...n.payload,type:n.type}).payload;case"file":return zg({...n.payload,type:n.type}).payload;case"image":return Ug({...n.payload,type:n.type}).payload;case"location":return jg({...n.payload,type:n.type}).payload;case"markdown":return Hg({...n.payload,type:n.type}).payload;case"text":return Vg({...n.payload,type:n.type}).payload;case"video":return Wg({...n.payload,type:n.type}).payload;default:throw new Error("Unsuported message type")}})}}),qg=e=>{const t=e.title,n=e.subtitle,r=e.imageUrl,i=e.actions.map(s=>{switch(s.action){case"postback":return{type:"button",variant:"action",text:s.label,buttonValue:s.value,reusable:!0};case"url":return{type:"button",variant:"link",text:s.label,buttonValue:s.value,reusable:!0};case"say":return{type:"button",variant:"action",text:s.label,buttonValue:s.value,reusable:!0};default:throw new Error(`Unknown action type ${s.action}`)}}),o=[];return r&&o.push({type:"image",url:r}),t&&o.push({type:"text",text:`#### ${t}`}),n&&o.push({type:"text",text:n}),i.length>0&&o.push({type:"row",blocks:i}),{type:"column",horizontalAlignment:"center",blocks:[...o]}};var GD=Object.defineProperty,QD=(e,t,n)=>t in e?GD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ZD=(e,t,n)=>QD(e,t+"",n),JD=async(e,t)=>{let n=typeof t=="function"?await t(e):t;if(n)return e.scheme==="bearer"?`Bearer ${n}`:e.scheme==="basic"?`Basic ${btoa(n)}`:n},XD={bodySerializer:e=>JSON.stringify(e,(t,n)=>typeof n=="bigint"?n.toString():n)},eN=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},tN=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},nN=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},Yg=({allowReserved:e,explode:t,name:n,style:r,value:i})=>{if(!t){let a=(e?i:i.map(l=>encodeURIComponent(l))).join(tN(r));switch(r){case"label":return`.${a}`;case"matrix":return`;${n}=${a}`;case"simple":return a;default:return`${n}=${a}`}}let o=eN(r),s=i.map(a=>r==="label"||r==="simple"?e?a:encodeURIComponent(a):_o({allowReserved:e,name:n,value:a})).join(o);return r==="label"||r==="matrix"?o+s:s},_o=({allowReserved:e,name:t,value:n})=>{if(n==null)return"";if(typeof n=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${t}=${e?n:encodeURIComponent(n)}`},Kg=({allowReserved:e,explode:t,name:n,style:r,value:i})=>{if(i instanceof Date)return`${n}=${i.toISOString()}`;if(r!=="deepObject"&&!t){let a=[];Object.entries(i).forEach(([u,f])=>{a=[...a,u,e?f:encodeURIComponent(f)]});let l=a.join(",");switch(r){case"form":return`${n}=${l}`;case"label":return`.${l}`;case"matrix":return`;${n}=${l}`;default:return l}}let o=nN(r),s=Object.entries(i).map(([a,l])=>_o({allowReserved:e,name:r==="deepObject"?`${n}[${a}]`:a,value:l})).join(o);return r==="label"||r==="matrix"?o+s:s},rN=/\{[^{}]+\}/g,iN=({path:e,url:t})=>{let n=t,r=t.match(rN);if(r)for(let i of r){let o=!1,s=i.substring(1,i.length-1),a="simple";s.endsWith("*")&&(o=!0,s=s.substring(0,s.length-1)),s.startsWith(".")?(s=s.substring(1),a="label"):s.startsWith(";")&&(s=s.substring(1),a="matrix");let l=e[s];if(l==null)continue;if(Array.isArray(l)){n=n.replace(i,Yg({explode:o,name:s,style:a,value:l}));continue}if(typeof l=="object"){n=n.replace(i,Kg({explode:o,name:s,style:a,value:l}));continue}if(a==="matrix"){n=n.replace(i,`;${_o({name:s,value:l})}`);continue}let u=encodeURIComponent(a==="label"?`.${l}`:l);n=n.replace(i,u)}return n},Gg=({allowReserved:e,array:t,object:n}={})=>r=>{let i=[];if(r&&typeof r=="object")for(let o in r){let s=r[o];if(s!=null){if(Array.isArray(s)){i=[...i,Yg({allowReserved:e,explode:!0,name:o,style:"form",value:s,...t})];continue}if(typeof s=="object"){i=[...i,Kg({allowReserved:e,explode:!0,name:o,style:"deepObject",value:s,...n})];continue}i=[...i,_o({allowReserved:e,name:o,value:s})]}}return i.join("&")},oN=e=>{var t;if(!e)return"stream";let n=(t=e.split(";")[0])==null?void 0:t.trim();if(n){if(n.startsWith("application/json")||n.endsWith("+json"))return"json";if(n==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(r=>n.startsWith(r)))return"blob";if(n.startsWith("text/"))return"text"}},sN=async({security:e,...t})=>{for(let n of e){let r=await JD(n,t.auth);if(!r)continue;let i=n.name??"Authorization";switch(n.in){case"query":t.query||(t.query={}),t.query[i]=r;break;case"cookie":t.headers.append("Cookie",`${i}=${r}`);break;case"header":default:t.headers.set(i,r);break}return}},Qg=e=>aN({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:Gg(e.querySerializer),url:e.url}),aN=({baseUrl:e,path:t,query:n,querySerializer:r,url:i})=>{let o=i.startsWith("/")?i:`/${i}`,s=(e??"")+o;t&&(s=iN({path:t,url:s}));let a=n?r(n):"";return a.startsWith("?")&&(a=a.substring(1)),a&&(s+=`?${a}`),s},Zg=(e,t)=>{var n;let r={...e,...t};return(n=r.baseUrl)!=null&&n.endsWith("/")&&(r.baseUrl=r.baseUrl.substring(0,r.baseUrl.length-1)),r.headers=Jg(e.headers,t.headers),r},Jg=(...e)=>{let t=new Headers;for(let n of e){if(!n||typeof n!="object")continue;let r=n instanceof Headers?n.entries():Object.entries(n);for(let[i,o]of r)if(o===null)t.delete(i);else if(Array.isArray(o))for(let s of o)t.append(i,s);else o!==void 0&&t.set(i,typeof o=="object"?JSON.stringify(o):o)}return t},jl=class{constructor(){ZD(this,"_fns"),this._fns=[]}clear(){this._fns=[]}exists(t){return this._fns.indexOf(t)!==-1}eject(t){let n=this._fns.indexOf(t);n!==-1&&(this._fns=[...this._fns.slice(0,n),...this._fns.slice(n+1)])}use(t){this._fns=[...this._fns,t]}},lN=()=>({error:new jl,request:new jl,response:new jl}),uN=Gg({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),cN={"Content-Type":"application/json"},Xg=(e={})=>({...XD,headers:cN,parseAs:"auto",querySerializer:uN,...e}),fN=(e={})=>{let t=Zg(Xg(),e),n=()=>({...t}),r=s=>(t=Zg(t,s),n()),i=lN(),o=async s=>{let a={...t,...s,fetch:s.fetch??t.fetch??globalThis.fetch,headers:Jg(t.headers,s.headers)};a.security&&await sN({...a,security:a.security}),a.body&&a.bodySerializer&&(a.body=a.bodySerializer(a.body)),(a.body===void 0||a.body==="")&&a.headers.delete("Content-Type");let l=Qg(a),u={redirect:"follow",...a},f=new Request(l,u);for(let g of i.request._fns)f=await g(f,a);let c=a.fetch,h=await c(f);for(let g of i.response._fns)h=await g(h,f,a);let d={request:f,response:h};if(h.ok){if(h.status===204||h.headers.get("Content-Length")==="0")return{data:{},...d};let g=(a.parseAs==="auto"?oN(h.headers.get("Content-Type")):a.parseAs)??"json";if(g==="stream")return{data:h.body,...d};let y=await h[g]();return g==="json"&&(a.responseValidator&&await a.responseValidator(y),a.responseTransformer&&(y=await a.responseTransformer(y))),{data:y,...d}}let m=await h.text();try{m=JSON.parse(m)}catch{}let p=m;for(let g of i.error._fns)p=await g(m,h,f,a);if(p=p||{},a.throwOnError)throw p;return{error:p,...d}};return{buildUrl:Qg,connect:s=>o({...s,method:"CONNECT"}),delete:s=>o({...s,method:"DELETE"}),get:s=>o({...s,method:"GET"}),getConfig:n,head:s=>o({...s,method:"HEAD"}),interceptors:i,options:s=>o({...s,method:"OPTIONS"}),patch:s=>o({...s,method:"PATCH"}),post:s=>o({...s,method:"POST"}),put:s=>o({...s,method:"PUT"}),request:o,setConfig:r,trace:s=>o({...s,method:"TRACE"})}},dN=fN,hN=Xg;const Pe=dN((e=>({...e,withCredentials:!0,timeout:6e4,maxBodyLength:104857600,maxContentLength:104857600,throwOnError:!0,parseAs:"json"}))(hN({baseUrl:"https://webchat.botpress.cloud/"}))),pN=e=>(e.client??Pe).delete({url:"/conversations/{id}",...e}),mN=e=>(e.client??Pe).get({url:"/conversations/{id}",...e}),gN=e=>(e.client??Pe).get({url:"/conversations",...e}),yN=e=>(e.client??Pe).post({url:"/conversations",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),vN=e=>(e.client??Pe).get({url:"/conversations/{id}/messages",...e}),bN=e=>(e.client??Pe).get({url:"/conversations/{id}/participants",...e}),wN=e=>(e.client??Pe).post({url:"/conversations/{id}/participants",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),SN=e=>(e.client??Pe).delete({url:"/conversations/{id}/participants/{userId}",...e}),xN=e=>(e.client??Pe).get({url:"/conversations/{id}/participants/{userId}",...e}),kN=e=>(e.client??Pe).delete({url:"/messages/{id}",...e}),EN=e=>(e.client??Pe).get({url:"/messages/{id}",...e}),CN=e=>(e.client??Pe).put({url:"/messages/{id}",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),AN=e=>(e.client??Pe).post({url:"/messages",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),TN=e=>(e.client??Pe).delete({url:"/messages/{id}/feedback",...e}),IN=e=>(e.client??Pe).put({url:"/messages/{id}/feedback",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),ON=e=>(e.client??Pe).delete({url:"/users/me",...e}),MN=e=>(e.client??Pe).get({url:"/users/me",...e}),DN=e=>(e.client??Pe).put({url:"/users/me",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),NN=e=>((e==null?void 0:e.client)??Pe).post({url:"/users/key",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),_N=e=>(e.client??Pe).get({url:"/events/{id}",...e}),PN=e=>(e.client??Pe).post({url:"/events",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),LN=e=>(e.client??Pe).post({url:"/files",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}});let ey=class extends Error{constructor(t,n){super(t),this.name="ParseError",this.type=n.type,this.field=n.field,this.value=n.value,this.line=n.line}};function Hl(e){}function FN(e){if(typeof e=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:t=Hl,onError:n=Hl,onRetry:r=Hl,onComment:i}=e;let o="",s=!0,a,l="",u="";function f(p){const g=s?p.replace(/^\xEF\xBB\xBF/,""):p,[y,v]=RN(`${o}${g}`);for(const w of y)c(w);o=v,s=!1}function c(p){if(p===""){d();return}if(p.startsWith(":")){i&&i(p.slice(p.startsWith(": ")?2:1));return}const g=p.indexOf(":");if(g!==-1){const y=p.slice(0,g),v=p[g+1]===" "?2:1,w=p.slice(g+v);h(y,w,p);return}h(p,"",p)}function h(p,g,y){switch(p){case"event":u=g;break;case"data":l=`${l}${g}
|
|
320
|
+
`;break;case"id":a=g.includes("\0")?void 0:g;break;case"retry":/^\d+$/.test(g)?r(parseInt(g,10)):n(new ey(`Invalid \`retry\` value: "${g}"`,{type:"invalid-retry",value:g,line:y}));break;default:n(new ey(`Unknown field "${p.length>20?`${p.slice(0,20)}…`:p}"`,{type:"unknown-field",field:p,value:g,line:y}));break}}function d(){l.length>0&&t({id:a,event:u||void 0,data:l.endsWith(`
|
|
321
|
+
`)?l.slice(0,-1):l}),a=void 0,l="",u=""}function m(p={}){o&&p.consume&&c(o),s=!0,a=void 0,l="",u="",o=""}return{feed:f,reset:m}}function RN(e){const t=[];let n="",r=0;for(;r<e.length;){const i=e.indexOf("\r",r),o=e.indexOf(`
|
|
322
|
+
`,r);let s=-1;if(i!==-1&&o!==-1?s=Math.min(i,o):i!==-1?i===e.length-1?s=-1:s=i:o!==-1&&(s=o),s===-1){n=e.slice(r);break}else{const a=e.slice(r,s);t.push(a),r=s+1,e[r-1]==="\r"&&e[r]===`
|
|
323
|
+
`&&r++}}return[t,n]}class ty extends Event{constructor(t,n){var r,i;super(t),this.code=(r=n==null?void 0:n.code)!=null?r:void 0,this.message=(i=n==null?void 0:n.message)!=null?i:void 0}[Symbol.for("nodejs.util.inspect.custom")](t,n,r){return r(ny(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(ny(this),n)}}function $N(e){const t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function Vl(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(Vl).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${Vl(e.cause)}`:e.message:`${e}`}function ny(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var ry=e=>{throw TypeError(e)},Wl=(e,t,n)=>t.has(e)||ry("Cannot "+n),be=(e,t,n)=>(Wl(e,t,"read from private field"),n?n.call(e):t.get(e)),Ke=(e,t,n)=>t.has(e)?ry("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Le=(e,t,n,r)=>(Wl(e,t,"write to private field"),t.set(e,n),n),Qt=(e,t,n)=>(Wl(e,t,"access private method"),n),dt,_n,lr,Po,Lo,fi,ur,di,pn,cr,fr,dr,hi,Lt,ql,Yl,Kl,iy,Gl,Ql,pi,Zl,Jl;class Fo extends EventTarget{constructor(t,n){var r,i;super(),Ke(this,Lt),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,Ke(this,dt),Ke(this,_n),Ke(this,lr),Ke(this,Po),Ke(this,Lo),Ke(this,fi),Ke(this,ur),Ke(this,di,null),Ke(this,pn),Ke(this,cr),Ke(this,fr,null),Ke(this,dr,null),Ke(this,hi,null),Ke(this,Yl,async o=>{var s;be(this,cr).reset();const{body:a,redirected:l,status:u,headers:f}=o;if(u===204){Qt(this,Lt,pi).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(l?Le(this,lr,new URL(o.url)):Le(this,lr,void 0),u!==200){Qt(this,Lt,pi).call(this,`Non-200 status code (${u})`,u);return}if(!(f.get("content-type")||"").startsWith("text/event-stream")){Qt(this,Lt,pi).call(this,'Invalid content type, expected "text/event-stream"',u);return}if(be(this,dt)===this.CLOSED)return;Le(this,dt,this.OPEN);const c=new Event("open");if((s=be(this,hi))==null||s.call(this,c),this.dispatchEvent(c),typeof a!="object"||!a||!("getReader"in a)){Qt(this,Lt,pi).call(this,"Invalid response body, expected a web ReadableStream",u),this.close();return}const h=new TextDecoder,d=a.getReader();let m=!0;do{const{done:p,value:g}=await d.read();g&&be(this,cr).feed(h.decode(g,{stream:!p})),p&&(m=!1,be(this,cr).reset(),Qt(this,Lt,Zl).call(this))}while(m)}),Ke(this,Kl,o=>{Le(this,pn,void 0),!(o.name==="AbortError"||o.type==="aborted")&&Qt(this,Lt,Zl).call(this,Vl(o))}),Ke(this,Gl,o=>{typeof o.id=="string"&&Le(this,di,o.id);const s=new MessageEvent(o.event||"message",{data:o.data,origin:be(this,lr)?be(this,lr).origin:be(this,_n).origin,lastEventId:o.id||""});be(this,dr)&&(!o.event||o.event==="message")&&be(this,dr).call(this,s),this.dispatchEvent(s)}),Ke(this,Ql,o=>{Le(this,fi,o)}),Ke(this,Jl,()=>{Le(this,ur,void 0),be(this,dt)===this.CONNECTING&&Qt(this,Lt,ql).call(this)});try{if(t instanceof URL)Le(this,_n,t);else if(typeof t=="string")Le(this,_n,new URL(t,BN()));else throw new Error("Invalid URL")}catch{throw $N("An invalid or illegal string was specified")}Le(this,cr,FN({onEvent:be(this,Gl),onRetry:be(this,Ql)})),Le(this,dt,this.CONNECTING),Le(this,fi,3e3),Le(this,Lo,(r=n==null?void 0:n.fetch)!=null?r:globalThis.fetch),Le(this,Po,(i=n==null?void 0:n.withCredentials)!=null?i:!1),Qt(this,Lt,ql).call(this)}get readyState(){return be(this,dt)}get url(){return be(this,_n).href}get withCredentials(){return be(this,Po)}get onerror(){return be(this,fr)}set onerror(t){Le(this,fr,t)}get onmessage(){return be(this,dr)}set onmessage(t){Le(this,dr,t)}get onopen(){return be(this,hi)}set onopen(t){Le(this,hi,t)}addEventListener(t,n,r){const i=n;super.addEventListener(t,i,r)}removeEventListener(t,n,r){const i=n;super.removeEventListener(t,i,r)}close(){be(this,ur)&&clearTimeout(be(this,ur)),be(this,dt)!==this.CLOSED&&(be(this,pn)&&be(this,pn).abort(),Le(this,dt,this.CLOSED),Le(this,pn,void 0))}}dt=new WeakMap,_n=new WeakMap,lr=new WeakMap,Po=new WeakMap,Lo=new WeakMap,fi=new WeakMap,ur=new WeakMap,di=new WeakMap,pn=new WeakMap,cr=new WeakMap,fr=new WeakMap,dr=new WeakMap,hi=new WeakMap,Lt=new WeakSet,ql=function(){Le(this,dt,this.CONNECTING),Le(this,pn,new AbortController),be(this,Lo)(be(this,_n),Qt(this,Lt,iy).call(this)).then(be(this,Yl)).catch(be(this,Kl))},Yl=new WeakMap,Kl=new WeakMap,iy=function(){var e;const t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...be(this,di)?{"Last-Event-ID":be(this,di)}:void 0},cache:"no-store",signal:(e=be(this,pn))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},Gl=new WeakMap,Ql=new WeakMap,pi=function(e,t){var n;be(this,dt)!==this.CLOSED&&Le(this,dt,this.CLOSED);const r=new ty("error",{code:t,message:e});(n=be(this,fr))==null||n.call(this,r),this.dispatchEvent(r)},Zl=function(e,t){var n;if(be(this,dt)===this.CLOSED)return;Le(this,dt,this.CONNECTING);const r=new ty("error",{code:t,message:e});(n=be(this,fr))==null||n.call(this,r),this.dispatchEvent(r),Le(this,ur,setTimeout(be(this,Jl),be(this,fi)))},Jl=new WeakMap,Fo.CONNECTING=0,Fo.OPEN=1,Fo.CLOSED=2;function BN(){const e="document"in globalThis?globalThis.document:void 0;return e&&typeof e=="object"&&"baseURI"in e&&typeof e.baseURI=="string"?e.baseURI:void 0}async function zN(e){var t;const n=await e.clone().json();if((t=n==null?void 0:n.id)!=null&&t.startsWith("err_")){const r=new Error(n.message);throw r.id=n.id,r.code=n.code,r.type=n.type,r}return e}const oy=()=>{const e={};return{on:(t,n)=>{var r;return e[t]||(e[t]=new Set),(r=e[t])==null||r.add(n),()=>{var i;return(i=e[t])==null?void 0:i.delete(n)}},emit:(t,n)=>{var r,i;(r=e[t])==null||r.forEach(o=>o(n)),(i=e["*"])==null||i.forEach(o=>o({type:t,payload:n}))}}},Ue=e=>e.data,sy=10,ay=3e3,UN="60000",jN={throwOnError:!0},HN=({conversationId:e,userToken:t,clientId:n,apiUrl:r,adminSecret:i})=>{let o=0,s=null;const a=oy(),l=()=>{s&&s.close();const u=`${`${r||Pe.getConfig().baseUrl}/${n}`}/initialize${e?`?conversationId=${e}`:""}`,f={...i?{"x-admin-secret":i}:{},...t?{"x-user-key":t}:{}};s=uy(u,f),s.addEventListener("open",()=>a.emit("open")),s.addEventListener("error",c=>{o<sy?(o++,setTimeout(()=>l(),ay)):a.emit("error",c)}),s.addEventListener("message",c=>{const h=ly(c.data);a.emit(h.type,h.data)})};return l(),a.on},VN=({userKey:e,clientId:t,apiUrl:n,customHeaders:r,advancedOptions:i})=>{const o={"x-user-key":e,...r},s=`${n||Pe.getConfig().baseUrl}/${t}`,a={...jN,baseUrl:s};return Pe.interceptors.response._fns.length===0&&Pe.interceptors.response.use(zN),{createConversation:()=>yN({...a,headers:o,body:{}}).then(Ue),getConversation:({conversationId:l})=>mN({...a,headers:o,path:{id:l}}).then(Ue),deleteConversation:({conversationId:l})=>pN({...a,headers:o,path:{id:l}}).then(Ue),listConversations:({nextToken:l})=>gN({...a,headers:o,query:{nextToken:l}}).then(Ue),listConversationMessages:({conversationId:l,nextToken:u})=>vN({...a,headers:o,path:{id:l},query:{nextToken:u}}).then(Ue),addParticipant:({conversationId:l,userId:u})=>wN({...a,headers:o,path:{id:l},body:{userId:u}}).then(Ue),removeParticipant:({conversationId:l,userId:u})=>SN({...a,headers:o,path:{id:l,userId:u}}).then(Ue),getParticipant:({conversationId:l,userId:u})=>xN({...a,headers:o,path:{id:l,userId:u}}).then(Ue),listParticipants:({conversationId:l,nextToken:u})=>bN({...a,headers:o,path:{id:l},query:{nextToken:u}}).then(Ue),createMessage:l=>AN({...a,headers:o,body:l}).then(Ue),updateMessage:({messageId:l,...u})=>CN({...a,headers:o,path:{id:l},body:u}).then(Ue),getMessage:({messageId:l})=>EN({...a,headers:o,path:{id:l}}).then(Ue),deleteMessage:({messageId:l})=>kN({...a,headers:o,path:{id:l}}).then(Ue),createFile:l=>LN({...a,headers:o,body:l}).then(Ue),getUser:()=>MN({...a,headers:o}).then(Ue),updateUser:l=>DN({...a,headers:o,body:l}).then(Ue),deleteUser:()=>ON({...a,headers:o}).then(Ue),createEvent:l=>PN({...a,headers:o,body:l}).then(Ue),getEvent:({eventId:l})=>_N({...a,headers:o,path:{id:l}}).then(Ue),addMessageFeedback:({messageId:l,...u})=>IN({...a,headers:o,path:{id:l},body:u}).then(Ue),removeMessageFeedback:({messageId:l})=>TN({...a,headers:o,path:{id:l}}).then(Ue),generateUserKey:({adminSecret:l,...u})=>NN({...a,headers:{"x-admin-secret":l},body:u}).then(Ue),listenConversation:({conversationId:l})=>{let u=0,f=null;const c=oy(),h=()=>{f&&f.close();const d=`${s}/conversations/${l}/listen`,m=i==null?void 0:i.eventSource;f=m?m({url:d,headers:o}):uy(d,o),f.addEventListener("open",()=>c.emit("open")),f.addEventListener("error",p=>{u<sy?(u++,setTimeout(()=>h(),ay)):c.emit("error",p)}),f.addEventListener("message",p=>{const g=ly(p.data);c.emit(g.type,g.data)})};return h(),c.on}}},ly=e=>{try{return JSON.parse(e)}catch{return e}},uy=(e,t)=>new Fo(e,{fetch:(n,r)=>fetch(n,{...r,headers:{...r==null?void 0:r.headers,...t,timeout:UN}})}),WN=async({apiUrl:e,clientId:t,adminSecret:n,clientHeaders:r,emitter:i,conversationId:o,userToken:s})=>new Promise(a=>{const l=HN({apiUrl:e,clientId:t,userToken:s,conversationId:o,adminSecret:n}),u=l("init",({conversation:f,messages:c,participants:h,user:d})=>{const m=VN({clientId:t,apiUrl:e,userKey:d.userKey,customHeaders:r});m.createEvent({conversationId:f.id,payload:{type:"conversation_started",data:{}}}).then(({event:p})=>{var g,y;(y=(g=p.payload.data)==null?void 0:g.status)!=null&&y.isInitial&&i.emit("conversation",f.id)}),a({on:l,conversation:f,messages:c,participants:h,user:d,client:m,onCleanup:()=>{u()}})})}),qN={webchat:"#9C27B0",client:"#2196F3",store:"#4CAF50",events:"#00BCD4"},YN={debug:"#9E9E9E",info:"#2196F3",warn:"#FF9800",error:"#F44336"};let cy=!1,Xl=null,fy=Date.now();const KN=e=>{cy=e,fy=Date.now()},GN=e=>{Xl=e},QN=()=>{const e=Date.now()-fy,t=Math.floor(e/1e3),n=e%1e3;return`+${t}.${n.toString().padStart(3,"0")}s`},ZN=e=>e===void 0?"undefined":e===null?"null":e instanceof Error?{error:e.message,stack:e.stack}:e,Ro=e=>{const t=qN[e]||"#666",n=(r,...i)=>{if(!cy&&r!=="warn"&&r!=="error")return;const o=QN(),s=`%c[bp:${e}]%c ${o} %c${r.toUpperCase()}%c`,a=[`color: ${t}; font-weight: bold;`,"color: #999; font-size: 10px;",`color: ${YN[r]}; font-weight: bold;`,"color: inherit;"],l=i.map(ZN);if(console[r](s,...a,...l),Xl){const[u,f]=i;Xl(`debug:${e}:${r}`,{message:typeof u=="string"?u:void 0,...typeof f=="object"&&f!==null?f:{}})}};return{debug:(...r)=>n("debug",...r),info:(...r)=>n("info",...r),warn:(...r)=>n("warn",...r),error:(...r)=>n("error",...r)}},dy={webchat:Ro("webchat"),client:Ro("client"),store:Ro("store"),events:Ro("events")};function hy(){const[e,t]=D.useState(!1),n=D.useRef(null);return{state:e,setState:(r,i)=>{if(t(r),!r)return()=>{};if(n.current=new Date,!i)return()=>{};const o=setTimeout(()=>{const s=n.current;s&&new Date().getTime()-s.getTime()>i&&t(!1)},i+100);return()=>clearTimeout(o)}}}const mi=dy.webchat;function py({apiUrl:e="https://webchat.botpress.cloud",clientId:t,storageKey:n,storageLocation:r,adminSecret:i,clientHeaders:o,playNotificationSound:s,...a}){const l=Cp(n,r),u=l(O=>O.conversationId),f=l(O=>O.user),c=l(O=>O.setConversationId),h=l(O=>O.setUser),{state:d,setState:m}=hy(),{state:p,setState:g}=hy(),y=D.useMemo(()=>sc(),[]),[v,w]=D.useState("connecting"),[E,S]=D.useState(void 0),[C,I]=D.useState(void 0),M=D.useRef(null),P=e1(a.conversationId,a.userToken,u,f==null?void 0:f.userToken);D.useEffect(()=>{let O=!1;mi.info("starting initialization",{clientId:t,apiUrl:e,storageKey:n});const U=async()=>{var L;await T(P),O&&(mi.debug("initialization completed but effect was cleaned up, tearing down"),(L=M.current)==null||L.call(M),M.current=null)},F=Jw(t,e);if(F){mi.error("configuration error",F),I(F),w("error");return}return U(),()=>{O=!0,M.current&&(M.current(),M.current=null)}},[a.conversationId,a.userToken,t,e]);const T=async({conversationId:O,userToken:U})=>{var V;(V=M.current)==null||V.call(M),I(void 0),m(!1),w("connecting");const{on:F,conversation:L,messages:R,participants:N,user:j,client:B,onCleanup:W}=await WN({apiUrl:e,clientId:t,clientHeaders:o,emitter:y,adminSecret:i,conversationId:O,userToken:U});S(B),c(L.id),h({userId:j.id,userToken:j.userKey});const b=Ep(L.id),_=R.reverse().map(ui).filter(Boolean);b.getState().setMessages(_);const H=Tp(L.id);H.getState().setParticipants(N);const x=[W,F("error",Y=>{mi.error("connection error",{error:Y,conversationId:L.id}),I(q=>q||_r(Y)),w("error"),y.emit("error",new Error(`Connection to conversation lost: ${Y==null?void 0:Y.message}`))}),F("message_created",Y=>{const q=ui(Y);b.getState().saveMessage(q),j.id!==q.authorId&&(s==null||s(),m(!1),g(!1),y.emit("isTyping",{isTyping:!1,timeout:0})),y.emit("message",q)}),F("message_status_changed",Y=>{var q;Y.newStatus==="processing"&&b.getState().updateMessage((q=Y.message.metadata)==null?void 0:q.clientMessageId,{status:Y.newStatus})}),F("typing_stopped",()=>{m(!1),g(!1)}),F("typing_started",()=>{m(!0,5e3),g(!0,5e3),y.emit("isTyping",{isTyping:!0,timeout:5e3})}),F("participant_added",Y=>{H.getState().addParticipant(Y.participant),y.emit("participantAdded",Y.participant)}),F("participant_removed",Y=>{H.getState().removeParticipant(Y.participantId),y.emit("participantRemoved",Y.participantId)}),F("webchat_visibility",Y=>y.emit("webchatVisibility",Y.visibility)),F("webchat_config",Y=>y.emit("webchatConfig",Y.config)),F("custom",Y=>y.emit("customEvent",Y.event))];w("connected"),mi.info("client fully connected with event handlers ready",{conversationId:L.id}),M.current=()=>{x.forEach(Y=>Y())}};return{clientState:v,httpClient:E,error:C,activeConversationId:u,userCredentials:f,isTyping:d,isAwaitingResponse:p,openConversation:T,setAwaitingResponse:g,emitter:y,setError:I,setClientState:w}}const my=D.createContext(null);function $o(){const e=D.useContext(my);if(!e)throw new Error("useWebchatContext must be used inside <WebchatProvider>");return e}function gy({clientId:e,apiUrl:t,storageKey:n,storageLocation:r,adminSecret:i,clientHeaders:o,children:s,...a}){var S;const{clientState:l,httpClient:u,error:f,activeConversationId:c,userCredentials:h,isTyping:d,isAwaitingResponse:m,openConversation:p,setClientState:g,setError:y,setAwaitingResponse:v,emitter:w}=py({apiUrl:t,clientId:e,storageKey:n,storageLocation:r,adminSecret:i,clientHeaders:o,conversationId:a.conversationId,userToken:(S=a.userCredentials)==null?void 0:S.userToken}),E={client:u,clientState:l,setClientState:g,conversationId:c,userCredentials:h,error:f,setError:y,isTyping:d,isAwaitingResponse:m,openConversation:p,setAwaitingResponse:v,emitter:w};return k.jsx(my.Provider,{value:E,children:s})}const eu=({children:e,className:t,uploadFile:n,allowFileUpload:r,storageKey:i,conversationId:o,...s})=>{const{container:a}=me,l=Qn(g=>g.setMessageContainerRef),f=Ap(o||"default",i)(g=>g.uploadFile),[c,h]=D.useState(0),d=D.useRef(null);D.useEffect(()=>{l(d)},[d,l]);const m=D.useCallback(g=>{n&&(g.forEach(y=>f(y,n)),h(0))},[f,n]),{getRootProps:p}=_g({noClick:!0,noKeyboard:!0,onDrop:m,disabled:!(r&&n),onDragEnter:()=>h(g=>g+1),onDragLeave:()=>h(g=>g-1)});return k.jsxs("div",{...s,className:ar(a.className,t),...p(),ref:d,children:[k.jsxs("div",{"data-hover":c>0,...a.dropzone.overlay,children:["Drop files to upload",k.jsx(HA,{style:{width:"50px"}})]}),k.jsx(Lg,{children:e})]})};eu.displayName="Container";const yy=D.forwardRef(({onClick:e,imgUrl:t,...n},r)=>{const{fab:i}=me,{container:o,icon:s,image:a}=i??{};return t?k.jsx("img",{src:t,role:"button",tabIndex:0,...a,draggable:"false",onClick:e}):k.jsx("div",{...n,...o,ref:r,onClick:e,children:k.jsx("div",{...s})})});yy.displayName="Fab";function Zt(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function JN(e,t){const n=A.createContext(t),r=o=>{const{children:s,...a}=o,l=A.useMemo(()=>a,Object.values(a));return k.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function i(o){const s=A.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function vy(e,t=[]){let n=[];function r(o,s){const a=A.createContext(s),l=n.length;n=[...n,s];const u=c=>{var y;const{scope:h,children:d,...m}=c,p=((y=h==null?void 0:h[e])==null?void 0:y[l])||a,g=A.useMemo(()=>m,Object.values(m));return k.jsx(p.Provider,{value:g,children:d})};u.displayName=o+"Provider";function f(c,h){var p;const d=((p=h==null?void 0:h[e])==null?void 0:p[l])||a,m=A.useContext(d);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${c}\` must be used within \`${o}\``)}return[u,f]}const i=()=>{const o=n.map(s=>A.createContext(s));return function(a){const l=(a==null?void 0:a[e])||o;return A.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,XN(i,...t)]}function XN(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const c=l(o)[`__scope${u}`];return{...a,...c}},{});return A.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var e2=A[" useInsertionEffect ".trim().toString()]||en;function by({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,s]=t2({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:i;{const f=A.useRef(e!==void 0);A.useEffect(()=>{const c=f.current;c!==a&&console.warn(`${r} is changing from ${c?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=a},[a,r])}const u=A.useCallback(f=>{var c;if(a){const h=n2(f)?f(e):f;h!==e&&((c=s.current)==null||c.call(s,h))}else o(f)},[a,e,o,s]);return[l,u]}function t2({defaultProp:e,onChange:t}){const[n,r]=A.useState(e),i=A.useRef(n),o=A.useRef(t);return e2(()=>{o.current=t},[t]),A.useEffect(()=>{var s;i.current!==n&&((s=o.current)==null||s.call(o,n),i.current=n)},[n,i]),[n,r,o]}function n2(e){return typeof e=="function"}function wy(e){const t=r2(e),n=A.forwardRef((r,i)=>{const{children:o,...s}=r,a=A.Children.toArray(o),l=a.find(o2);if(l){const u=l.props.children,f=a.map(c=>c===l?A.Children.count(u)>1?A.Children.only(null):A.isValidElement(u)?u.props.children:null:c);return k.jsx(t,{...s,ref:i,children:A.isValidElement(u)?A.cloneElement(u,void 0,f):null})}return k.jsx(t,{...s,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function r2(e){const t=A.forwardRef((n,r)=>{const{children:i,...o}=n;if(A.isValidElement(i)){const s=a2(i),a=s2(o,i.props);return i.type!==A.Fragment&&(a.ref=r?is(r,s):s),A.cloneElement(i,a)}return A.Children.count(i)>1?A.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var i2=Symbol("radix.slottable");function o2(e){return A.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===i2}function s2(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{const l=o(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function a2(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var l2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ft=l2.reduce((e,t)=>{const n=wy(`Primitive.${t}`),r=A.forwardRef((i,o)=>{const{asChild:s,...a}=i,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),k.jsx(l,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function u2(e,t){e&&ju.flushSync(()=>e.dispatchEvent(t))}function c2(e,t){return A.useReducer((n,r)=>t[n][r]??n,e)}var Bo=e=>{const{present:t,children:n}=e,r=f2(t),i=typeof n=="function"?n({present:r.isPresent}):A.Children.only(n),o=tn(r.ref,d2(i));return typeof n=="function"||r.isPresent?A.cloneElement(i,{ref:o}):null};Bo.displayName="Presence";function f2(e){const[t,n]=A.useState(),r=A.useRef(null),i=A.useRef(e),o=A.useRef("none"),s=e?"mounted":"unmounted",[a,l]=c2(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return A.useEffect(()=>{const u=zo(r.current);o.current=a==="mounted"?u:"none"},[a]),en(()=>{const u=r.current,f=i.current;if(f!==e){const h=o.current,d=zo(u);e?l("MOUNT"):d==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(f&&h!==d?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),en(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,c=d=>{const p=zo(r.current).includes(CSS.escape(d.animationName));if(d.target===t&&p&&(l("ANIMATION_END"),!i.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},h=d=>{d.target===t&&(o.current=zo(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:A.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function zo(e){return(e==null?void 0:e.animationName)||"none"}function d2(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var h2=A[" useId ".trim().toString()]||(()=>{}),p2=0;function Uo(e){const[t,n]=A.useState(h2());return en(()=>{n(r=>r??String(p2++))},[e]),e||(t?`radix-${t}`:"")}var jo="Collapsible",[m2]=vy(jo),[g2,tu]=m2(jo),Sy=A.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:s,...a}=e,[l,u]=by({prop:r,defaultProp:i??!1,onChange:s,caller:jo});return k.jsx(g2,{scope:n,disabled:o,contentId:Uo(),open:l,onOpenToggle:A.useCallback(()=>u(f=>!f),[u]),children:k.jsx(Ft.div,{"data-state":ru(l),"data-disabled":o?"":void 0,...a,ref:t})})});Sy.displayName=jo;var xy="CollapsibleTrigger",ky=A.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=tu(xy,n);return k.jsx(Ft.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":ru(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:Zt(e.onClick,i.onOpenToggle)})});ky.displayName=xy;var nu="CollapsibleContent",Ey=A.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=tu(nu,e.__scopeCollapsible);return k.jsx(Bo,{present:n||i.open,children:({present:o})=>k.jsx(y2,{...r,ref:t,present:o})})});Ey.displayName=nu;var y2=A.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=e,s=tu(nu,n),[a,l]=A.useState(r),u=A.useRef(null),f=tn(t,u),c=A.useRef(0),h=c.current,d=A.useRef(0),m=d.current,p=s.open||a,g=A.useRef(p),y=A.useRef(void 0);return A.useEffect(()=>{const v=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(v)},[]),en(()=>{const v=u.current;if(v){y.current=y.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const w=v.getBoundingClientRect();c.current=w.height,d.current=w.width,g.current||(v.style.transitionDuration=y.current.transitionDuration,v.style.animationName=y.current.animationName),l(r)}},[s.open,r]),k.jsx(Ft.div,{"data-state":ru(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!p,...o,ref:f,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:p&&i})});function ru(e){return e?"open":"closed"}var v2=Sy,b2=Ey;const iu=({restartConversation:e,...t})=>{var o,s;const{header:n}=me,{showInputModal:r}=Ka(),i=async a=>{a.stopPropagation(),r?r({title:"Create New Conversation",description:"This will clear the current conversation and start a new one.",confirmButtonText:"New conversation",cancelButtonText:"Cancel"}).then(()=>e()):e()};return k.jsx(rT,{...t,...(s=(o=n==null?void 0:n.content)==null?void 0:o.actions)==null?void 0:s.icons,"aria-label":"Restart Conversation Button",tabIndex:0,role:"button",onClick:i})},ou=({onClick:e,...t})=>{const{header:n}=me,r=i=>{i.stopPropagation(),e==null||e()};return k.jsx(hp,{...t,...n.content.actions.icons,role:"button",tabIndex:0,"aria-label":"Close Chatbot Button",onClick:r,onKeyDown:i=>{i.key==="Enter"&&r(i)}})},w2=({onClick:e,...t})=>{const{header:n}=me,r=i=>{i.stopPropagation(),e==null||e()};return k.jsx(ap,{...t,...n.content.actions.icons,role:"button",tabIndex:0,"aria-label":"Show Recent Conversations Button",onClick:r,onKeyDown:i=>{i.key==="Enter"&&r(i)}})},gi=({icon:e,title:t,link:n,...r})=>{var s,a,l,u,f,c,h,d,m,p,g,y;const{header:i}=me,o=e??VA;return t?n?k.jsxs("a",{...r,...(a=(s=i.expandedContent)==null?void 0:s.descriptionItems)==null?void 0:a.container,href:n,target:"_blank",rel:"noreferrer noopener",children:[k.jsx(o,{...(u=(l=i.expandedContent)==null?void 0:l.descriptionItems)==null?void 0:u.icon}),k.jsx("p",{...(c=(f=i.expandedContent)==null?void 0:f.descriptionItems)==null?void 0:c.link,children:t})]}):k.jsxs("div",{...r,...(d=(h=i.expandedContent)==null?void 0:h.descriptionItems)==null?void 0:d.container,children:[k.jsx(o,{...(p=(m=i.expandedContent)==null?void 0:m.descriptionItems)==null?void 0:p.icon}),k.jsx("p",{...(y=(g=i.expandedContent)==null?void 0:g.descriptionItems)==null?void 0:y.text,children:t})]}):null},S2=({soundOn:e,toggleSound:t})=>{const n=o=>{o.stopPropagation(),t==null||t()},{header:r}=me,i=e?dp:cT;return k.jsx("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),n(o))},title:e?"Disable chat sounds":"Enable chat sounds",...r.content.actions.icons,children:k.jsx(i,{size:16})})},Cy=({defaultOpen:e,closeWindow:t,configuration:n,restartConversation:r,showConversationHistory:i,disabled:o,soundOn:s,toggleSound:a,clientId:l,...u})=>{var p,g,y,v,w,E,S,C,I,M,P,T,O,U,F,L,R,N,j,B,W,b,_,H;const{header:f}=me,[c,h]=D.useState(e),d=!!((p=n.email)!=null&&p.title)||!!((g=n.phone)!=null&&g.title)||!!((y=n.website)!=null&&y.title)||!!((v=n.termsOfService)!=null&&v.link)||!!((w=n.privacyPolicy)!=null&&w.link),m=d&&!o;return k.jsxs(v2,{open:m?c:!1,onOpenChange:m?h:void 0,"data-disabled":m?void 0:"",...f.container,...u,children:[k.jsxs(ky,{"aria-label":"Expand Header Button",...f.content.container,children:[k.jsx("div",{...f.content.conversationHistory,children:i&&!c&&k.jsx(w2,{onClick:i})}),k.jsx(En,{userId:l,src:n.botAvatar,...f.content.avatar,children:n.botName||"Bot"}),k.jsx("h2",{...f.content.title,children:n.botName||"Bot"}),n.botDescription&&k.jsx("p",{...f.content.description,children:n.botDescription}),k.jsxs("div",{...f.content.actions.container,children:[n.soundEnabled&&s!==void 0&&a&&k.jsx(S2,{soundOn:s,toggleSound:a}),r&&k.jsx(iu,{restartConversation:r}),t&&k.jsx(ou,{onClick:t})]})]}),d&&k.jsxs(b2,{...f.expandedContent.container,children:[k.jsxs("div",{"data-links":"",...f.expandedContent.group,children:[k.jsx(gi,{"data-email":"",icon:ZA,title:(E=n.email)==null?void 0:E.title,link:(C=(S=n.email)==null?void 0:S.link)!=null&&C.startsWith("mailto:")?(I=n.email)==null?void 0:I.link:`mailto:${(M=n.email)==null?void 0:M.link}`}),k.jsx(gi,{"data-phone":"",icon:tT,title:(P=n.phone)==null?void 0:P.title,link:(O=(T=n.phone)==null?void 0:T.link)!=null&&O.startsWith("tel:")?(U=n.phone)==null?void 0:U.link:`tel:${(F=n.phone)==null?void 0:F.link}`}),k.jsx(gi,{"data-website":"",link:(L=n.website)==null?void 0:L.link,icon:YA,title:(R=n.website)==null?void 0:R.title})]}),k.jsxs("div",{"data-legal":"",...(N=f.expandedContent)==null?void 0:N.group,children:[((j=n.termsOfService)==null?void 0:j.link)&&k.jsx(gi,{"data-terms":"",link:(B=n.termsOfService)==null?void 0:B.link,icon:cp,title:(W=n.termsOfService)==null?void 0:W.title}),((b=n.privacyPolicy)==null?void 0:b.link)&&k.jsx(gi,{"data-privacy":"",link:(_=n.privacyPolicy)==null?void 0:_.link,icon:QA,title:(H=n.privacyPolicy)==null?void 0:H.title})]})]})]})},su=D.memo(({...e})=>{const{typingIndicator:t}=me;return k.jsx("div",{...e,...t==null?void 0:t.container,children:k.jsx("div",{...t==null?void 0:t.loader})})});su.displayName="TypingIndicator";const au=D.memo(D.forwardRef(({direction:e,block:t,disableInput:n,children:r,sender:i,id:o,authorId:s,status:a,renderers:l,isReadOnly:u,isLastDeliveredMessage:f,feedback:c,timestamp:h,metadata:d,sendMessage:m,addMessageFeedback:p,showAvatar:g},y)=>{const[v,w]=D.useState([]),{message:{container:E,deliveryStatus:S}}=me;return g=g??e==="incoming",k.jsx(qa.Provider,{value:{isLoading:v,setIsLoading:w},children:k.jsxs("div",{...E,className:ar(E==null?void 0:E.className,f&&(S==null?void 0:S.className)),"data-loaded":v.length===0,"data-disable-input":!!n,"data-direction":e,dir:"auto",ref:y,children:[e==="incoming"&&g&&k.jsx(Ay,{authorId:s,sender:i}),t&&k.jsx(Dn,{block:{...t,isReadOnly:u,direction:e,timestamp:h,sender:i,feedback:c,messageId:o,status:a,metadata:d,sendMessage:m,addMessageFeedback:p},renderers:l}),e==="outgoing"&&g&&k.jsx(Ay,{authorId:s,sender:i}),r]})})})),Ay=({authorId:e,sender:t})=>{const{message:{avatar:n}}=me,[r,i]=D.useState("idle"),o=Ju(e??"",15);return k.jsxs(fs,{"data-color":o,"data-loading-status":r,...n==null?void 0:n.container,children:[k.jsx(ds,{...n==null?void 0:n.image,onLoadingStatusChange:i,src:t==null?void 0:t.avatar}),k.jsxs(hs,{...n==null?void 0:n.fallback,children:[t==null?void 0:t.name[0]," "]})]})};function x2({botAvatar:e,botDescription:t,botName:n}){const{messageList:{marquee:r}}=me;return k.jsxs("li",{...r.container,children:[k.jsx(En,{src:e,...r.avatar,children:(n||"Bot").slice(0,1)}),k.jsxs("div",{...r.content,children:[k.jsx("h1",{...r.title,children:n||"Bot"}),k.jsx("p",{...r.description,children:t})]})]})}let lu=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");/*!---------------------------------------------------------------------------------------------
|
|
311
324
|
* Copyright (c) StackBlitz. All rights reserved.
|
|
312
325
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
313
|
-
*--------------------------------------------------------------------------------------------*/const lA={damping:.7,stiffness:.05,mass:1.25},uA=70,cA=1e3/60,fA=350;let Si=!1;(Rh=globalThis.document)==null||Rh.addEventListener("mousedown",()=>{Si=!0}),(Bh=globalThis.document)==null||Bh.addEventListener("mouseup",()=>{Si=!1}),(zh=globalThis.document)==null||zh.addEventListener("click",()=>{Si=!1});const dA=(e={})=>{const[t,n]=_.useState(!1),[r,i]=_.useState(e.initial!==!1),[o,a]=_.useState(!1),s=_.useRef(null);s.current=e;const l=_.useCallback(()=>{var A;if(!Si)return!1;const v=window.getSelection();if(!v||!v.rangeCount)return!1;const w=v.getRangeAt(0);return w.commonAncestorContainer.contains(g.current)||((A=g.current)==null?void 0:A.contains(w.commonAncestorContainer))},[]),u=_.useCallback(v=>{c.isAtBottom=v,i(v)},[]),f=_.useCallback(v=>{c.escapedFromLock=v,n(v)},[]),c=_.useMemo(()=>{let v;return{escapedFromLock:t,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){var w;return((w=g.current)==null?void 0:w.scrollTop)??0},set scrollTop(w){g.current&&(g.current.scrollTop=w,c.ignoreScrollToTop=g.current.scrollTop)},get targetScrollTop(){return!g.current||!y.current?0:g.current.scrollHeight-1-g.current.clientHeight},get calculatedTargetScrollTop(){if(!g.current||!y.current)return 0;const{targetScrollTop:w}=this;if(!e.targetScrollTop)return w;if((v==null?void 0:v.targetScrollTop)===w)return v.calculatedScrollTop;const A=Math.max(Math.min(e.targetScrollTop(w,{scrollElement:g.current,contentElement:y.current}),w),0);return v={targetScrollTop:w,calculatedScrollTop:A},requestAnimationFrame(()=>{v=void 0}),A},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=uA}}},[]),p=_.useCallback((v={})=>{var F;typeof v=="string"&&(v={animation:v}),v.preserveScrollPosition||u(!0);const w=Date.now()+(Number(v.wait)||0),A=us(s.current,v.animation),{ignoreEscapes:k=!1}=v;let C,T=c.calculatedTargetScrollTop;v.duration instanceof Promise?v.duration.finally(()=>{C=Date.now()}):C=w+(v.duration??0);const P=async()=>{const I=new Promise(requestAnimationFrame).then(()=>{var M;if(!c.isAtBottom)return c.animation=void 0,!1;const{scrollTop:O}=c,j=performance.now(),z=(j-(c.lastTick??j))/cA;if(c.animation||(c.animation={behavior:A,promise:I,ignoreEscapes:k}),c.animation.behavior===A&&(c.lastTick=j),l()||w>Date.now())return P();if(O<Math.min(T,c.calculatedTargetScrollTop)){if(((M=c.animation)==null?void 0:M.behavior)===A){if(A==="instant")return c.scrollTop=c.calculatedTargetScrollTop,P();c.velocity=(A.damping*c.velocity+A.stiffness*c.scrollDifference)/A.mass,c.accumulated+=c.velocity*z,c.scrollTop+=c.accumulated,c.scrollTop!==O&&(c.accumulated=0)}return P()}return C>Date.now()?(T=c.calculatedTargetScrollTop,P()):(c.animation=void 0,c.scrollTop<c.calculatedTargetScrollTop?p({animation:us(s.current,s.current.resize),ignoreEscapes:k,duration:Math.max(0,C-Date.now())||void 0}):c.isAtBottom)});return I.then(O=>(requestAnimationFrame(()=>{c.animation||(c.lastTick=void 0,c.velocity=0)}),O))};return v.wait!==!0&&(c.animation=void 0),((F=c.animation)==null?void 0:F.behavior)===A?c.animation.promise:P()},[u,l,c]),d=_.useCallback(()=>{f(!0),u(!1)},[f,u]),m=_.useCallback(({target:v})=>{if(v!==g.current)return;const{scrollTop:w,ignoreScrollToTop:A}=c;let{lastScrollTop:k=w}=c;c.lastScrollTop=w,c.ignoreScrollToTop=void 0,A&&A>w&&(k=A),a(c.isNearBottom),setTimeout(()=>{var P;if(c.resizeDifference||w===A)return;if(l()){f(!0),u(!1);return}const C=w>k,T=w<k;if((P=c.animation)!=null&&P.ignoreEscapes){c.scrollTop=k;return}T&&(f(!0),u(!1)),C&&f(!1),!c.escapedFromLock&&c.isNearBottom&&u(!0)},1)},[f,u,l,c]),h=_.useCallback(({target:v,deltaY:w})=>{var k;let A=v;for(;!["scroll","auto"].includes(getComputedStyle(A).overflow);){if(!A.parentElement)return;A=A.parentElement}A===g.current&&w<0&&g.current.scrollHeight>g.current.clientHeight&&!((k=c.animation)!=null&&k.ignoreEscapes)&&(f(!0),u(!1))},[f,u,c]),g=Ap(v=>{var w,A;(w=g.current)==null||w.removeEventListener("scroll",m),(A=g.current)==null||A.removeEventListener("wheel",h),v==null||v.addEventListener("scroll",m,{passive:!0}),v==null||v.addEventListener("wheel",h,{passive:!0})},[]),y=Ap(v=>{var A,k;if((A=c.resizeObserver)==null||A.disconnect(),!v)return;let w;c.resizeObserver=new ResizeObserver(([C])=>{const{height:T}=C.contentRect,P=T-(w??T);if(c.resizeDifference=P,c.scrollTop>c.targetScrollTop&&(c.scrollTop=c.targetScrollTop),a(c.isNearBottom),P>=0){const F=us(s.current,w?s.current.resize:s.current.initial);p({animation:F,wait:!0,preserveScrollPosition:!0,duration:F==="instant"?void 0:fA})}else c.isNearBottom&&(f(!1),u(!0));w=T,requestAnimationFrame(()=>{setTimeout(()=>{c.resizeDifference===P&&(c.resizeDifference=0)},1)})}),(k=c.resizeObserver)==null||k.observe(v)},[]);return{contentRef:y,scrollRef:g,scrollToBottom:p,stopScroll:d,isAtBottom:r||o,isNearBottom:o,escapedFromLock:t,state:c}};function Ap(e,t){const n=_.useCallback(r=>(n.current=r,e(r)),t);return n}const ls=new Map;function us(...e){const t={...lA};let n=!1;for(const i of e){if(i==="instant"){n=!0;continue}typeof i=="object"&&(n=!1,t.damping=i.damping??t.damping,t.stiffness=i.stiffness??t.stiffness,t.mass=i.mass??t.mass)}const r=JSON.stringify(t);return ls.has(r)||ls.set(r,Object.freeze(t)),n?"instant":ls.get(r)}const Ip=_.createContext(null),pA=typeof window<"u"?_.useLayoutEffect:_.useEffect;function Ei({instance:e,children:t,resize:n,initial:r,mass:i,damping:o,stiffness:a,targetScrollTop:s,contextRef:l,...u}){const f=_.useRef(null),c=E.useCallback((k,C)=>{const T=(A==null?void 0:A.targetScrollTop)??s;return(T==null?void 0:T(k,C))??k},[s]),p=dA({mass:i,damping:o,stiffness:a,resize:n,initial:r,targetScrollTop:c}),{scrollRef:d,contentRef:m,scrollToBottom:h,stopScroll:g,isAtBottom:y,escapedFromLock:v,state:w}=e??p,A=_.useMemo(()=>({scrollToBottom:h,stopScroll:g,scrollRef:d,isAtBottom:y,escapedFromLock:v,contentRef:m,state:w,get targetScrollTop(){return f.current},set targetScrollTop(k){f.current=k}}),[h,y,m,d,g,v,w]);return _.useImperativeHandle(l,()=>A,[A]),pA(()=>{d.current&&getComputedStyle(d.current).overflow==="visible"&&(d.current.style.overflow="auto")},[]),S.jsx(Ip.Provider,{value:A,children:S.jsx("div",{...u,children:typeof t=="function"?t(A):t})})}(function(e){function t({children:n,...r}){const i=Tp();return S.jsx("div",{ref:i.scrollRef,style:{height:"100%",width:"100%"},children:S.jsx("div",{...r,ref:i.contentRef,children:typeof n=="function"?n(i):n})})}e.Content=t})(Ei||(Ei={}));function Tp(){const e=_.useContext(Ip);if(!e)throw new Error("use-stick-to-bottom component context must be used within a StickToBottom component");return e}const cs=_.memo(({className:e,messages:t=[],isTyping:n,headerMessage:r,renderers:i,botAvatar:o,botDescription:a,botName:s,sendMessage:l,addMessageFeedback:u,showMarquee:f=!0,showDateSystemMessage:c=!0,showMessageStatus:p=!0,showIncomingMessageAvatar:d=!0,showOutgoingMessageAvatar:m=!1,...h})=>{var A;const{messageList:g}=ge,y=_.useMemo(()=>c?gm(t):t,[t]),v=_.useMemo(()=>{var C;const k=y.filter(T=>T.direction==="outgoing"&&T.status!=="pending");return(C=k[k.length-1])==null?void 0:C.id},[y]),w=k=>{if(k.direction==="incoming")return d;if(k.direction==="outgoing")return m};return S.jsxs(Ei,{...h,resize:"smooth",initial:"instant",className:dr(g.container.className,e),children:[S.jsxs(Ei.Content,{className:g.viewPort.className,children:[r&&S.jsx("span",{...g.headerMessage,children:r}),f&&S.jsx(sA,{botAvatar:o,botDescription:a,botName:s}),y.map(k=>{var C;return S.jsx(as,{renderers:i,sendMessage:l,addMessageFeedback:u,isLastDeliveredMessage:p&&k.id===v,showAvatar:w(k),...k},((C=k.metadata)==null?void 0:C.clientMessageId)||k.id)}),n&&S.jsx(as,{id:ss(),renderers:i,sendMessage:l,direction:"incoming",timestamp:new Date,showAvatar:d,block:void 0,sender:((A=t.filter(k=>k.direction==="incoming").at(-1))==null?void 0:A.sender)??{name:s||"Bot",avatar:o},children:S.jsx(os,{})})]}),S.jsx(hA,{})]})}),hA=()=>{const{isAtBottom:e,scrollToBottom:t}=Tp(),{messageList:n}=ge;return e?null:S.jsx("button",{className:n.scrollDownButton.className,onClick:()=>t()})};cs.displayName="MessageList";function Op({error:e,restartConversation:t,closeWindow:n}){let r,i;const{error:o}=ge;return e.type==="configuration"?(r="Configuration error",i=S.jsx(Y0,{...o.icon})):e.type==="bot"?(r="Bot error",i=S.jsx(Mc,{...o.icon})):e.type==="network"?(r="Network error",i=S.jsx(r1,{...o.icon})):e.type==="disconnected"?(r="Disconnected",i=S.jsx(e1,{...o.icon})):(r="Unexpected error",i=S.jsx(Mc,{...o.icon})),S.jsx(mA,{error:e,title:r,icon:i,restartConversation:t,closeWindow:n})}function mA({error:e,title:t,icon:n,restartConversation:r,closeWindow:i}){const{error:o}=ge;return S.jsxs("div",{...o.container,children:[S.jsxs("div",{...o.header.container,children:[`Webchat ${e.type} error`,S.jsxs("div",{...o.header.actions,children:[r&&S.jsx(is,{restartConversation:r,style:{color:"white",backgroundColor:"transparent"}}),i&&S.jsx(Sp,{onClick:i,style:{color:"white",backgroundColor:"transparent"}})]})]}),S.jsxs("div",{...o.content,children:[n,S.jsx("div",{...o.errorTitle,children:t}),S.jsx("div",{...o.errorMessage,children:e.message}),e.id&&S.jsx("div",{...o.id,children:e.id})]})]})}const gA=({className:e,...t})=>{const{className:n}=ge.loader;return S.jsx("div",{...t,className:dr(e,n)})},Dp=({connected:e,configuration:t,isTyping:n,messages:r,user:i,isLoading:o,renderers:a,isReadOnly:s,disableComposer:l,allowFileUpload:u,error:f,participants:c,closeWindow:p,sendMessage:d,uploadFile:m,addMessageFeedback:h,restartConversation:g,clientId:y,storageKey:v,soundOn:w,toggleSound:A,disableSendButton:k,...C})=>{const{color:T,fontFamily:P,radius:F,themeMode:I,variant:O,headerVariant:j,botAvatar:z,botDescription:M,botName:D,composerPlaceholder:B,footer:U,feedbackEnabled:$,additionalStylesheetUrl:V}=t,b={color:T,fontFamily:P,radius:F,themeMode:I,variant:O,headerVariant:j,additionalStylesheetUrl:V};$||(h=void 0);const N=_.useMemo(()=>i?Gs(r,c,i.id,D,z):[],[z,D,r,i,c]),H=_.useRef(null),x=sn(W=>W.setPortalContainer);return _.useEffect(()=>(x(H.current),()=>{x(null)}),[x]),S.jsxs(S.Fragment,{children:[S.jsx(hp,{...b}),S.jsx("div",{ref:H,style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none",zIndex:10}}),S.jsx(es,{connected:e,allowFileUpload:u,uploadFile:m,storageKey:v,...C,children:f?S.jsx(Op,{error:f,restartConversation:g,closeWindow:p}):S.jsxs(S.Fragment,{children:[S.jsx(Ep,{closeWindow:p,configuration:t,restartConversation:g,clientId:y,soundOn:w,toggleSound:A}),o?S.jsx(gA,{}):S.jsx(cs,{botAvatar:z,botDescription:M,botName:D,renderers:a,isTyping:n,sendMessage:d,addMessageFeedback:h,messages:N}),S.jsx(Nd,{sendMessage:d,uploadFile:m,connected:e,isReadOnly:s,disableComposer:l,footer:U,composerPlaceholder:B,allowFileUpload:u,disableSendButton:k,storageKey:v})]})})]})};function Mp(){const[e,t]=_.useState(!1),n=_.useRef(null);return{state:e,setState:(r,i)=>{if(t(r),!r)return()=>{};if(n.current=new Date,!i)return()=>{};const o=setTimeout(()=>{const a=n.current;a&&new Date().getTime()-a.getTime()>i&&t(!1)},i+100);return()=>clearTimeout(o)}}}var yA=Object.defineProperty,vA=(e,t,n)=>t in e?yA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,bA=(e,t,n)=>vA(e,t+"",n),wA=async(e,t)=>{let n=typeof t=="function"?await t(e):t;if(n)return e.scheme==="bearer"?`Bearer ${n}`:e.scheme==="basic"?`Basic ${btoa(n)}`:n},xA={bodySerializer:e=>JSON.stringify(e,(t,n)=>typeof n=="bigint"?n.toString():n)},kA=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},SA=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},EA=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},_p=({allowReserved:e,explode:t,name:n,style:r,value:i})=>{if(!t){let s=(e?i:i.map(l=>encodeURIComponent(l))).join(SA(r));switch(r){case"label":return`.${s}`;case"matrix":return`;${n}=${s}`;case"simple":return s;default:return`${n}=${s}`}}let o=kA(r),a=i.map(s=>r==="label"||r==="simple"?e?s:encodeURIComponent(s):Ci({allowReserved:e,name:n,value:s})).join(o);return r==="label"||r==="matrix"?o+a:a},Ci=({allowReserved:e,name:t,value:n})=>{if(n==null)return"";if(typeof n=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${t}=${e?n:encodeURIComponent(n)}`},Pp=({allowReserved:e,explode:t,name:n,style:r,value:i})=>{if(i instanceof Date)return`${n}=${i.toISOString()}`;if(r!=="deepObject"&&!t){let s=[];Object.entries(i).forEach(([u,f])=>{s=[...s,u,e?f:encodeURIComponent(f)]});let l=s.join(",");switch(r){case"form":return`${n}=${l}`;case"label":return`.${l}`;case"matrix":return`;${n}=${l}`;default:return l}}let o=EA(r),a=Object.entries(i).map(([s,l])=>Ci({allowReserved:e,name:r==="deepObject"?`${n}[${s}]`:s,value:l})).join(o);return r==="label"||r==="matrix"?o+a:a},CA=/\{[^{}]+\}/g,AA=({path:e,url:t})=>{let n=t,r=t.match(CA);if(r)for(let i of r){let o=!1,a=i.substring(1,i.length-1),s="simple";a.endsWith("*")&&(o=!0,a=a.substring(0,a.length-1)),a.startsWith(".")?(a=a.substring(1),s="label"):a.startsWith(";")&&(a=a.substring(1),s="matrix");let l=e[a];if(l==null)continue;if(Array.isArray(l)){n=n.replace(i,_p({explode:o,name:a,style:s,value:l}));continue}if(typeof l=="object"){n=n.replace(i,Pp({explode:o,name:a,style:s,value:l}));continue}if(s==="matrix"){n=n.replace(i,`;${Ci({name:a,value:l})}`);continue}let u=encodeURIComponent(s==="label"?`.${l}`:l);n=n.replace(i,u)}return n},Np=({allowReserved:e,array:t,object:n}={})=>r=>{let i=[];if(r&&typeof r=="object")for(let o in r){let a=r[o];if(a!=null){if(Array.isArray(a)){i=[...i,_p({allowReserved:e,explode:!0,name:o,style:"form",value:a,...t})];continue}if(typeof a=="object"){i=[...i,Pp({allowReserved:e,explode:!0,name:o,style:"deepObject",value:a,...n})];continue}i=[...i,Ci({allowReserved:e,name:o,value:a})]}}return i.join("&")},IA=e=>{var t;if(!e)return"stream";let n=(t=e.split(";")[0])==null?void 0:t.trim();if(n){if(n.startsWith("application/json")||n.endsWith("+json"))return"json";if(n==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(r=>n.startsWith(r)))return"blob";if(n.startsWith("text/"))return"text"}},TA=async({security:e,...t})=>{for(let n of e){let r=await wA(n,t.auth);if(!r)continue;let i=n.name??"Authorization";switch(n.in){case"query":t.query||(t.query={}),t.query[i]=r;break;case"cookie":t.headers.append("Cookie",`${i}=${r}`);break;case"header":default:t.headers.set(i,r);break}return}},Lp=e=>OA({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:Np(e.querySerializer),url:e.url}),OA=({baseUrl:e,path:t,query:n,querySerializer:r,url:i})=>{let o=i.startsWith("/")?i:`/${i}`,a=(e??"")+o;t&&(a=AA({path:t,url:a}));let s=n?r(n):"";return s.startsWith("?")&&(s=s.substring(1)),s&&(a+=`?${s}`),a},Fp=(e,t)=>{var n;let r={...e,...t};return(n=r.baseUrl)!=null&&n.endsWith("/")&&(r.baseUrl=r.baseUrl.substring(0,r.baseUrl.length-1)),r.headers=Rp(e.headers,t.headers),r},Rp=(...e)=>{let t=new Headers;for(let n of e){if(!n||typeof n!="object")continue;let r=n instanceof Headers?n.entries():Object.entries(n);for(let[i,o]of r)if(o===null)t.delete(i);else if(Array.isArray(o))for(let a of o)t.append(i,a);else o!==void 0&&t.set(i,typeof o=="object"?JSON.stringify(o):o)}return t},fs=class{constructor(){bA(this,"_fns"),this._fns=[]}clear(){this._fns=[]}exists(t){return this._fns.indexOf(t)!==-1}eject(t){let n=this._fns.indexOf(t);n!==-1&&(this._fns=[...this._fns.slice(0,n),...this._fns.slice(n+1)])}use(t){this._fns=[...this._fns,t]}},DA=()=>({error:new fs,request:new fs,response:new fs}),MA=Np({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),_A={"Content-Type":"application/json"},Bp=(e={})=>({...xA,headers:_A,parseAs:"auto",querySerializer:MA,...e}),PA=(e={})=>{let t=Fp(Bp(),e),n=()=>({...t}),r=a=>(t=Fp(t,a),n()),i=DA(),o=async a=>{let s={...t,...a,fetch:a.fetch??t.fetch??globalThis.fetch,headers:Rp(t.headers,a.headers)};s.security&&await TA({...s,security:s.security}),s.body&&s.bodySerializer&&(s.body=s.bodySerializer(s.body)),(s.body===void 0||s.body==="")&&s.headers.delete("Content-Type");let l=Lp(s),u={redirect:"follow",...s},f=new Request(l,u);for(let g of i.request._fns)f=await g(f,s);let c=s.fetch,p=await c(f);for(let g of i.response._fns)p=await g(p,f,s);let d={request:f,response:p};if(p.ok){if(p.status===204||p.headers.get("Content-Length")==="0")return{data:{},...d};let g=(s.parseAs==="auto"?IA(p.headers.get("Content-Type")):s.parseAs)??"json";if(g==="stream")return{data:p.body,...d};let y=await p[g]();return g==="json"&&(s.responseValidator&&await s.responseValidator(y),s.responseTransformer&&(y=await s.responseTransformer(y))),{data:y,...d}}let m=await p.text();try{m=JSON.parse(m)}catch{}let h=m;for(let g of i.error._fns)h=await g(m,p,f,s);if(h=h||{},s.throwOnError)throw h;return{error:h,...d}};return{buildUrl:Lp,connect:a=>o({...a,method:"CONNECT"}),delete:a=>o({...a,method:"DELETE"}),get:a=>o({...a,method:"GET"}),getConfig:n,head:a=>o({...a,method:"HEAD"}),interceptors:i,options:a=>o({...a,method:"OPTIONS"}),patch:a=>o({...a,method:"PATCH"}),post:a=>o({...a,method:"POST"}),put:a=>o({...a,method:"PUT"}),request:o,setConfig:r,trace:a=>o({...a,method:"TRACE"})}},NA=PA,LA=Bp;const Me=NA((e=>({...e,withCredentials:!0,timeout:6e4,maxBodyLength:104857600,maxContentLength:104857600,throwOnError:!0}))(LA({baseUrl:"https://webchat.botpress.cloud/"}))),FA=e=>(e.client??Me).delete({url:"/conversations/{id}",...e}),RA=e=>(e.client??Me).get({url:"/conversations/{id}",...e}),BA=e=>(e.client??Me).get({url:"/conversations",...e}),zA=e=>(e.client??Me).post({url:"/conversations",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),$A=e=>(e.client??Me).get({url:"/conversations/{id}/messages",...e}),jA=e=>(e.client??Me).get({url:"/conversations/{id}/participants",...e}),UA=e=>(e.client??Me).post({url:"/conversations/{id}/participants",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),HA=e=>(e.client??Me).delete({url:"/conversations/{id}/participants/{userId}",...e}),WA=e=>(e.client??Me).get({url:"/conversations/{id}/participants/{userId}",...e}),VA=e=>(e.client??Me).delete({url:"/messages/{id}",...e}),qA=e=>(e.client??Me).get({url:"/messages/{id}",...e}),KA=e=>(e.client??Me).put({url:"/messages/{id}",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),YA=e=>(e.client??Me).post({url:"/messages",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),GA=e=>(e.client??Me).delete({url:"/messages/{id}/feedback",...e}),QA=e=>(e.client??Me).put({url:"/messages/{id}/feedback",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),JA=e=>(e.client??Me).delete({url:"/users/me",...e}),ZA=e=>(e.client??Me).get({url:"/users/me",...e}),XA=e=>(e.client??Me).put({url:"/users/me",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),eI=e=>((e==null?void 0:e.client)??Me).post({url:"/users/key",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),tI=e=>(e.client??Me).get({url:"/events/{id}",...e}),nI=e=>(e.client??Me).post({url:"/events",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),rI=e=>(e.client??Me).post({url:"/files",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}});let zp=class extends Error{constructor(t,n){super(t),this.name="ParseError",this.type=n.type,this.field=n.field,this.value=n.value,this.line=n.line}};function ds(e){}function iI(e){if(typeof e=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:t=ds,onError:n=ds,onRetry:r=ds,onComment:i}=e;let o="",a=!0,s,l="",u="";function f(h){const g=a?h.replace(/^\xEF\xBB\xBF/,""):h,[y,v]=oI(`${o}${g}`);for(const w of y)c(w);o=v,a=!1}function c(h){if(h===""){d();return}if(h.startsWith(":")){i&&i(h.slice(h.startsWith(": ")?2:1));return}const g=h.indexOf(":");if(g!==-1){const y=h.slice(0,g),v=h[g+1]===" "?2:1,w=h.slice(g+v);p(y,w,h);return}p(h,"",h)}function p(h,g,y){switch(h){case"event":u=g;break;case"data":l=`${l}${g}
|
|
314
|
-
|
|
315
|
-
`)?l.slice(0,-1):l}),s=void 0,l="",u=""}function m(h={}){o&&h.consume&&c(o),a=!0,s=void 0,l="",u="",o=""}return{feed:f,reset:m}}function oI(e){const t=[];let n="",r=0;for(;r<e.length;){const i=e.indexOf("\r",r),o=e.indexOf(`
|
|
316
|
-
`,r);let a=-1;if(i!==-1&&o!==-1?a=Math.min(i,o):i!==-1?i===e.length-1?a=-1:a=i:o!==-1&&(a=o),a===-1){n=e.slice(r);break}else{const s=e.slice(r,a);t.push(s),r=a+1,e[r-1]==="\r"&&e[r]===`
|
|
317
|
-
`&&r++}}return[t,n]}class $p extends Event{constructor(t,n){var r,i;super(t),this.code=(r=n==null?void 0:n.code)!=null?r:void 0,this.message=(i=n==null?void 0:n.message)!=null?i:void 0}[Symbol.for("nodejs.util.inspect.custom")](t,n,r){return r(jp(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(jp(this),n)}}function aI(e){const t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function ps(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(ps).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${ps(e.cause)}`:e.message:`${e}`}function jp(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var Up=e=>{throw TypeError(e)},hs=(e,t,n)=>t.has(e)||Up("Cannot "+n),ve=(e,t,n)=>(hs(e,t,"read from private field"),n?n.call(e):t.get(e)),Be=(e,t,n)=>t.has(e)?Up("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),_e=(e,t,n,r)=>(hs(e,t,"write to private field"),t.set(e,n),n),It=(e,t,n)=>(hs(e,t,"access private method"),n),Xe,Qt,vn,Ai,Ii,gr,bn,yr,Bt,wn,xn,kn,vr,mt,ms,gs,ys,Hp,vs,bs,br,ws,xs;class Ti extends EventTarget{constructor(t,n){var r,i;super(),Be(this,mt),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,Be(this,Xe),Be(this,Qt),Be(this,vn),Be(this,Ai),Be(this,Ii),Be(this,gr),Be(this,bn),Be(this,yr,null),Be(this,Bt),Be(this,wn),Be(this,xn,null),Be(this,kn,null),Be(this,vr,null),Be(this,gs,async o=>{var a;ve(this,wn).reset();const{body:s,redirected:l,status:u,headers:f}=o;if(u===204){It(this,mt,br).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(l?_e(this,vn,new URL(o.url)):_e(this,vn,void 0),u!==200){It(this,mt,br).call(this,`Non-200 status code (${u})`,u);return}if(!(f.get("content-type")||"").startsWith("text/event-stream")){It(this,mt,br).call(this,'Invalid content type, expected "text/event-stream"',u);return}if(ve(this,Xe)===this.CLOSED)return;_e(this,Xe,this.OPEN);const c=new Event("open");if((a=ve(this,vr))==null||a.call(this,c),this.dispatchEvent(c),typeof s!="object"||!s||!("getReader"in s)){It(this,mt,br).call(this,"Invalid response body, expected a web ReadableStream",u),this.close();return}const p=new TextDecoder,d=s.getReader();let m=!0;do{const{done:h,value:g}=await d.read();g&&ve(this,wn).feed(p.decode(g,{stream:!h})),h&&(m=!1,ve(this,wn).reset(),It(this,mt,ws).call(this))}while(m)}),Be(this,ys,o=>{_e(this,Bt,void 0),!(o.name==="AbortError"||o.type==="aborted")&&It(this,mt,ws).call(this,ps(o))}),Be(this,vs,o=>{typeof o.id=="string"&&_e(this,yr,o.id);const a=new MessageEvent(o.event||"message",{data:o.data,origin:ve(this,vn)?ve(this,vn).origin:ve(this,Qt).origin,lastEventId:o.id||""});ve(this,kn)&&(!o.event||o.event==="message")&&ve(this,kn).call(this,a),this.dispatchEvent(a)}),Be(this,bs,o=>{_e(this,gr,o)}),Be(this,xs,()=>{_e(this,bn,void 0),ve(this,Xe)===this.CONNECTING&&It(this,mt,ms).call(this)});try{if(t instanceof URL)_e(this,Qt,t);else if(typeof t=="string")_e(this,Qt,new URL(t,sI()));else throw new Error("Invalid URL")}catch{throw aI("An invalid or illegal string was specified")}_e(this,wn,iI({onEvent:ve(this,vs),onRetry:ve(this,bs)})),_e(this,Xe,this.CONNECTING),_e(this,gr,3e3),_e(this,Ii,(r=n==null?void 0:n.fetch)!=null?r:globalThis.fetch),_e(this,Ai,(i=n==null?void 0:n.withCredentials)!=null?i:!1),It(this,mt,ms).call(this)}get readyState(){return ve(this,Xe)}get url(){return ve(this,Qt).href}get withCredentials(){return ve(this,Ai)}get onerror(){return ve(this,xn)}set onerror(t){_e(this,xn,t)}get onmessage(){return ve(this,kn)}set onmessage(t){_e(this,kn,t)}get onopen(){return ve(this,vr)}set onopen(t){_e(this,vr,t)}addEventListener(t,n,r){const i=n;super.addEventListener(t,i,r)}removeEventListener(t,n,r){const i=n;super.removeEventListener(t,i,r)}close(){ve(this,bn)&&clearTimeout(ve(this,bn)),ve(this,Xe)!==this.CLOSED&&(ve(this,Bt)&&ve(this,Bt).abort(),_e(this,Xe,this.CLOSED),_e(this,Bt,void 0))}}Xe=new WeakMap,Qt=new WeakMap,vn=new WeakMap,Ai=new WeakMap,Ii=new WeakMap,gr=new WeakMap,bn=new WeakMap,yr=new WeakMap,Bt=new WeakMap,wn=new WeakMap,xn=new WeakMap,kn=new WeakMap,vr=new WeakMap,mt=new WeakSet,ms=function(){_e(this,Xe,this.CONNECTING),_e(this,Bt,new AbortController),ve(this,Ii)(ve(this,Qt),It(this,mt,Hp).call(this)).then(ve(this,gs)).catch(ve(this,ys))},gs=new WeakMap,ys=new WeakMap,Hp=function(){var e;const t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...ve(this,yr)?{"Last-Event-ID":ve(this,yr)}:void 0},cache:"no-store",signal:(e=ve(this,Bt))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},vs=new WeakMap,bs=new WeakMap,br=function(e,t){var n;ve(this,Xe)!==this.CLOSED&&_e(this,Xe,this.CLOSED);const r=new $p("error",{code:t,message:e});(n=ve(this,xn))==null||n.call(this,r),this.dispatchEvent(r)},ws=function(e,t){var n;if(ve(this,Xe)===this.CLOSED)return;_e(this,Xe,this.CONNECTING);const r=new $p("error",{code:t,message:e});(n=ve(this,xn))==null||n.call(this,r),this.dispatchEvent(r),_e(this,bn,setTimeout(ve(this,xs),ve(this,gr)))},xs=new WeakMap,Ti.CONNECTING=0,Ti.OPEN=1,Ti.CLOSED=2;function sI(){const e="document"in globalThis?globalThis.document:void 0;return e&&typeof e=="object"&&"baseURI"in e&&typeof e.baseURI=="string"?e.baseURI:void 0}async function lI(e){var t;const n=await e.clone().json();if((t=n==null?void 0:n.id)!=null&&t.startsWith("err_")){const r=new Error(n.message);throw r.id=n.id,r.code=n.code,r.type=n.type,r}return e}const Wp=()=>{const e={};return{on:(t,n)=>{var r;return e[t]||(e[t]=new Set),(r=e[t])==null||r.add(n),()=>{var i;return(i=e[t])==null?void 0:i.delete(n)}},emit:(t,n)=>{var r,i;(r=e[t])==null||r.forEach(o=>o(n)),(i=e["*"])==null||i.forEach(o=>o({type:t,payload:n}))}}},Le=e=>e.data,Vp=10,qp=3e3,uI="60000",cI={throwOnError:!0},fI=({conversationId:e,userToken:t,clientId:n,apiUrl:r,adminSecret:i})=>{let o=0,a=null;const s=Wp(),l=()=>{a&&a.close();const u=`${`${r||Me.getConfig().baseUrl}/${n}`}/initialize${e?`?conversationId=${e}`:""}`,f={...i?{"x-admin-secret":i}:{},...t?{"x-user-key":t}:{}};a=Yp(u,f),a.onopen=()=>s.emit("open"),a.onerror=c=>{o<Vp?(o++,setTimeout(()=>l(),qp)):s.emit("error",c)},a.onmessage=c=>{const p=Kp(c.data);s.emit(p.type,p.data)}};return l(),s.on},dI=({userKey:e,clientId:t,apiUrl:n,customHeaders:r})=>{const i={"x-user-key":e,...r},o=`${n||Me.getConfig().baseUrl}/${t}`,a={...cI,baseUrl:o};return Me.interceptors.response._fns.length===0&&Me.interceptors.response.use(lI),{createConversation:()=>zA({...a,headers:i,body:{}}).then(Le),getConversation:({conversationId:s})=>RA({...a,headers:i,path:{id:s}}).then(Le),deleteConversation:({conversationId:s})=>FA({...a,headers:i,path:{id:s}}).then(Le),listConversations:({nextToken:s})=>BA({...a,headers:i,query:{nextToken:s}}).then(Le),listConversationMessages:({conversationId:s,nextToken:l})=>$A({...a,headers:i,path:{id:s},query:{nextToken:l}}).then(Le),addParticipant:({conversationId:s,userId:l})=>UA({...a,headers:i,path:{id:s},body:{userId:l}}).then(Le),removeParticipant:({conversationId:s,userId:l})=>HA({...a,headers:i,path:{id:s,userId:l}}).then(Le),getParticipant:({conversationId:s,userId:l})=>WA({...a,headers:i,path:{id:s,userId:l}}).then(Le),listParticipants:({conversationId:s,nextToken:l})=>jA({...a,headers:i,path:{id:s},query:{nextToken:l}}).then(Le),createMessage:s=>YA({...a,headers:i,body:s}).then(Le),updateMessage:({messageId:s,...l})=>KA({...a,headers:i,path:{id:s},body:l}).then(Le),getMessage:({messageId:s})=>qA({...a,headers:i,path:{id:s}}).then(Le),deleteMessage:({messageId:s})=>VA({...a,headers:i,path:{id:s}}).then(Le),createFile:s=>rI({...a,headers:i,body:s}).then(Le),getUser:()=>ZA({...a,headers:i}).then(Le),updateUser:s=>XA({...a,headers:i,body:s}).then(Le),deleteUser:()=>JA({...a,headers:i}).then(Le),createEvent:s=>nI({...a,headers:i,body:s}).then(Le),getEvent:({eventId:s})=>tI({...a,headers:i,path:{id:s}}).then(Le),addMessageFeedback:({messageId:s,...l})=>QA({...a,headers:i,path:{id:s},body:l}).then(Le),removeMessageFeedback:({messageId:s})=>GA({...a,headers:i,path:{id:s}}).then(Le),generateUserKey:({adminSecret:s,...l})=>eI({...a,headers:{"x-admin-secret":s},body:l}).then(Le),listenConversation:({conversationId:s})=>{let l=0,u=null;const f=Wp(),c=()=>{u&&u.close();const p=`${o}/conversations/${s}/listen`;u=Yp(p,i),u.onopen=()=>f.emit("open"),u.onerror=d=>{l<Vp?(l++,setTimeout(()=>c(),qp)):f.emit("error",d)},u.onmessage=d=>{const m=Kp(d.data);f.emit(m.type,m.data)}};return c(),f.on}}},Kp=e=>{try{return JSON.parse(e)}catch{return e}},Yp=(e,t)=>new Ti(e,{fetch:(n,r)=>fetch(n,{...r,headers:{...r==null?void 0:r.headers,...t,timeout:uI}})}),Gp={chatMessageNotification:new URL("data:audio/ogg;base64,T2dnUwACAAAAAAAAAAAVJAEzAAAAAOU+A6UBHgF2b3JiaXMAAAAAASJWAAD/////AH0AAP////+pAU9nZ1MAAAAAAAAAAAAAFSQBMwEAAAD3T/UfDpz////////////////FA3ZvcmJpcwwAAABMYXZmNjEuNy4xMDAEAAAAHwAAAGVuY29kZXI9TGF2YzYxLjE5LjEwMSBsaWJ2b3JiaXMrAAAAZW5jb2RlZF9ieT1BZG9iZSBQcmVtaWVyZSBQcm8gMjAyNS4wIChNYWNpbhcAAAB0aW1lX3JlZmVyZW5jZT0xMjExMDQwMA8AAABkYXRlPTIwMjUtMDgtMDUBBXZvcmJpcyJCQ1YBAEAAABhCECoFrWOOOsgVIYwZoqBCyinHHULQIaMkQ4g6xjXHGGNHuWSKQsmB0JBVAABAAACkHFdQckkt55xzoxhXzHHoIOecc+UgZ8xxCSXnnHOOOeeSco4x55xzoxhXDnIpLeecc4EUR4pxpxjnnHOkHEeKcagY55xzbTG3knLOOeecc+Ygh1JyrjXnnHOkGGcOcgsl55xzxiBnzHHrIOecc4w1t9RyzjnnnHPOOeecc84555xzjDHnnHPOOeecc24x5xZzrjnnnHPOOeccc84555xzIDRkFQCQAACgoSiK4igOEBqyCgDIAAAQQHEUR5EUS7Ecy9EkDQgNWQUAAAEACAAAoEiGpEiKpViOZmmeJnqiKJqiKquyacqyLMuy67ouEBqyCgBIAABQURTFcBQHCA1ZBQBkAAAIYCiKoziO5FiSpVmeB4SGrAIAgAAABAAAUAxHsRRN8STP8jzP8zzP8zzP8zzP8zzP8zzP8zwNCA1ZBQAgAAAAgihkGANCQ1YBAEAAAAghGhlDnVISXAoWQhwRQx1CzkOppYPgKYUlY9JTrEEIIXzvPffee++B0JBVAAAQAABhFDiIgcckCCGEYhQnRHGmIAghhOUkWMp56CQI3YMQQrice8u59957IDRkFQAACADAIIQQQgghhBBCCCmklFJIKaaYYoopxxxzzDHHIIMMMuigk046yaSSTjrKJKOOUmsptRRTTLHlFmOttdacc69BKWOMMcYYY4wxxhhjjDHGGCMIDVkFAIAAABAGGWSQQQghhBRSSCmmmHLMMcccA0JDVgEAgAAAAgAAABxFUiRHciRHkiTJkixJkzzLszzLszxN1ERNFVXVVW3X9m1f9m3f1WXf9mXb1WVdlmXdtW1d1l1d13Vd13Vd13Vd13Vd13Vd14HQkFUAgAQAgI7kOI7kOI7kSI6kSAoQGrIKAJABABAAgKM4iuNIjuRYjiVZkiZplmd5lqd5mqiJHhAasgoAAAQAEAAAAAAAgKIoiqM4jiRZlqZpnqd6oiiaqqqKpqmqqmqapmmapmmapmmapmmapmmapmmapmmapmmapmmapmmapmkCoSGrAAAJAAAdx3EcR3Ecx3EkR5IkIDRkFQAgAwAgAABDURxFcizHkjRLszzL00TP9FxRNnVTV20gNGQVAAAIACAAAAAAAADHczzHczzJkzzLczzHkzxJ0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRNA0JDVgIAZAAAEJOQSk6xV0YpxiS0XiqkFJPUe6iYYkw67alCBikHuYdKIaWg094ypZBSDHunmELIGOqhg5AxhbDX2nPPvfceCA1ZEQBEAQAAxiDGEGPIMSYlgxIxxyRkUiLnnJROSialpFZazKSEmEqLkXNOSiclk1JaC6llkkprJaYCAAACHAAAAiyEQkNWBABRAACIMUgppBRSSjGnmENKKceUY0gp5ZxyTjnHmHQQKucYdA5KpJRyjjmnnHMSMgeVcw5CJp0AAIAABwCAAAuh0JAVAUCcAACAkHOKMQgRYxBCCSmFUFKqnJPSQUmpg5JSSanFklKMlXNSOgkpdRJSKinFWFKKLaRUY2kt19JSjS3GnFuMvYaUYi2p1Vpaq7nFWHOLNffIOUqdlNY6Ka2l1mpNrdXaSWktpNZiaS3G1mLNKcacMymthZZiK6nF2GLLNbWYc2kt1xRjzynGnmusucecgzCt1ZxayznFmHvMseeYcw+Sc5Q6Ka11UlpLrdWaWqs1k9Jaaa3GkFqLLcacW4sxZ1JaLKnFWFqKMcWYc4st19BarinGnFOLOcdag5Kx9l5aqznFmHuKreeYczA2x547SrmW1nourfVecy5C1tyLaC3n1GoPKsaec87B2NyDEK3lnGrsPcXYe+45GNtz8K3W4FvNRcicg9C5+KZ7MEbV2oPMtQiZcxA66CJ08Ml4lGoureVcWus91hp8zTkI0VruKcbeU4u9156bsL0HIVrLPcXYg4ox+JpzMDrnYlStwcecg5C1FqF7L0rnIJSqtQeZa1Ay1yJ08MXooIsvAABgwAEAIMCEMlBoyIoAIE4AgEHIOaUYhEopCKGElEIoKVWMSciYg5IxJ6WUUloIJbWKMQiZY1Iyx6SEEloqJbQSSmmplNJaKKW1llqMKbUWQymphVJaK6W0llqqMbVWY8SYlMw5KZljUkoprZVSWqsck5IxKKmDkEopKcVSUouVc1Iy6Kh0EEoqqcRUUmmtpNJSKaXFklJsKcVUW4u1hlJaLKnEVlJqMbVUW4sx14gxKRlzUjLnpJRSUiultJY5J6WDjkrmoKSSUmulpBQz5qR0DkrKIKNSUootpRJTKKW1klJspaTWWoy1ptRaLSW1VlJqsZQSW4sx1xZLTZ2U1koqMYZSWmsx5ppaizGUElspKcaSSmytxZpbbDmGUlosqcRWSmqx1ZZja7Hm1FKNKbWaW2y5xpRTj7X2nFqrNbVUY2ux5lhbb7XWnDsprYVSWislxZhai7HFWHMoJbaSUmylpBhbbLm2FmMPobRYSmqxpBJjazHmGFuOqbVaW2y5ptRirbX2HFtuPaUWa4ux5tJSjTXX3mNNORUAADDgAAAQYEIZKDRkJQAQBQAAGMMYYxAapZxzTkqDlHPOScmcgxBCSplzEEJIKXNOQkotZc5BSKm1UEpKrcUWSkmptRYLAAAocAAACLBBU2JxgEJDVgIAUQAAiDFKMQahMUYp5yA0xijFGIRKKcack1ApxZhzUDLHnINQSuaccxBKCSGUUkpKIYRSSkmpAACAAgcAgAAbNCUWByg0ZEUAEAUAABhjnDPOIQqdpc5SJKmj1lFrKKUaS4ydxlZ767nTGnttuTeUSo2p1o5ry7nV3mlNPbccCwAAO3AAADuwEAoNWQkA5AEAEMYoxZhzzhmFGHPOOecMUow555xzijHnnIMQQsWYc85BCCFzzjkIoYSSOecchBBK6JyDUEoppXTOQQihlFI65yCEUkopnXMQSimllAIAgAocAAACbBTZnGAkqNCQlQBAHgAAYAxCzklprWHMOQgt1dgwxhyUlGKLnIOQUou5RsxBSCnGoDsoKbUYbPCdhJRaizkHk1KLNefeg0iptZqDzj3VVnPPvfecYqw1595zLwAAd8EBAOzARpHNCUaCCg1ZCQDkAQAQCCnFmHPOGaUYc8w554xSjDHmnHOKMcacc85BxRhjzjkHIWPMOecghJAx5pxzEELonHMOQgghdM45ByGEEDrnoIMQQgidcxBCCCGEAgCAChwAAAJsFNmcYCSo0JCVAEA4AAAAIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEELonHPOOeecc84555xzzjnnnHPOOScAyLfCAcD/wcYZVpLOCkeDCw1ZCQCEAwAACkEopWIQSiklkk46KZ2TUEopkYNSSumklFJKCaWUUkoIpZRSSggdlFJCKaWUUkoppZRSSimllFI6KaWUUkoppZTKOSmlk1JKKaVEzkkpIZRSSimlhFJKKaWUUkoppZRSSimllFJKKaWEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQCALgbHAAgEmycYSXprHA0uNCQlQBASAAAoBRzjkoIKZSQUqiYoo5CKSmkUkoKEWPOSeochVBSKKmDyjkIpaSUQiohdc5BByWFkFIJIZWOOugolFBSKiWU0jkopYQUSkoplZBCSKl0lFIoJZWUQiohlVJKSCWVEEoKnaRUSgqppFRSCJ10kEInJaSSSgqpk5RSKiWllEpKJXRSQioppRBCSqmUEEpIKaVOUkmppBRCKCGFlFJKJaWSSkohlVRCCaWklFIooaRUUkoppZJSKQAA4MABACDACDrJqLIIG0248AAUGrISACADAECUdNZpp0kiCDFFmScNKcYgtaQswxBTkonxFGOMOShGQw4x5JQYF0oIoYNiPCaVQ8pQUbm31DkFxRZjfO+xFwEAAAgCAASEBAAYICiYAQAGBwgjBwIdAQQObQCAgQiZCQwKocFBJgA8QERIBQCJCYrShS4IIYJ0EWTxwIUTN5644YQObRAAAAAAABAA8AEAkFAAERHRzFVYXGBkaGxwdHh8gIQEAAAAAAAIAHwAACQiQERENHMVFhcYGRobHB0eHyAhAQAAAAAAAAAAQEBAAAAAAAAgAAAAQEBPZ2dTAASuMwAAAAAAABUkATMCAAAACYS6sR4BAUQxGR89NxobGiEkKCknJiYmJSUhISEaFgwBAQEAAnyfvULHAlAEJgh2vpgQBMHIyMjIyNhIQOjz+ePz58+fL89xAwYBAFaH//3//7/xNw0MBoNB6qlPfWrUKQng+/0FABAAhLEjKuHFBwA4AHC9Fx4Oh7EwDEOgvnJ3RtV+Op0+nU6n5cyzEwAoltTpwed5dgVKMPoru90zNHGA7F0CP98BAAAAAHl9ePviAgCW+3rugPIDwC6BbWoTAFEAAADh5GpCCACgc+0zxlAAVKddkjDsA14GDoJtf7R+NkE4W23hI5mF3d74iVGvzg9PpA4cCQs66joePTmOfhgl7vNZzYzQADDyz30FAGSvVUZ6wJ4MAKbCGeb4+v5NLIdK3YvrLkCu98uV//FpXQNyKAKAV7r186fTktcJJgjAlVp1fUmaGgtrdAAuDXYJSPs/AAAAAHDnAeHxciEUAB76CvfarGjDzIjALoEd+/0EAAAAQNYeMrkBAF6ZKm8xuw94NtgloHDUCAAAAIAMJ5Qz2iUAvjhKL8lkfmA6wi6BWfNHgiAAAABq4eeqGgCg8+LAAXQAfhgqz2RKHzAVYJeAynEAIQEAALwq6tFbIQAEEIIO8iULngMAXhgajrw3D5iFWhe7BLZNrwCVKAAA0t2TfT8mADx0aMfS4CULeACvA14YWnasNht80ZpdAhv8BEiiAADgcbm4jo0JANAVCTRV6JqQS0OTADoAXhg6zWy+AZ3GsiDRAYJzgiQAAICnb9FLAQAUNQFd44AioMNJICUAfhi67ZRjA2IMSHTAJK0KkgAAAG7W0uLlEgC6KnQdDkgBlAAdJAB+GHpL40hATAASHSC5CZIAAAAGZ3J60ioBoKsBTQKE5KFJIJFAAp4Y+jp7cg4qINEBi+MASQAAAM8rmdZcAKApwFhNPHQkQEBRQwIAnhj6OZ8KIBwDiQ4Q9ApIFAAAQHRFd6FEALA0NaApQAegnPrDA54Y+nN+AYAIJDoAfgIkCgAAcLRlPVsLALqmKqFpHIwUwQEJCwCeKPpzEQA8kOgAyTlBAgAAgPnK3q8jAWAuJFBYOsbAAgCeKPolEQA8rMFCohQAAMxD2BdSAJYFdNThKcCkBQCOgwKeGPpzEQA8rEEhCQAAoCz4MRGA41gaQMBRjACexHugAACeGPqFCAAeugQAAHryFgBdRYGFhGeow8x7AJ4Y+iURADyIigIAliFAAcYWCQC11gGeGPolEQA8UAAAABoODg4=",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:$i&&$i.tagName.toUpperCase()==="SCRIPT"&&$i.src||new URL("index.umd.cjs",document.baseURI).href).href};function Qp({apiUrl:e="https://webchat.botpress.cloud",clientId:t,storageKey:n,storageLocation:r,adminSecret:i,soundEnabled:o,...a}){var oe;const s=rf(n,r),l=s(G=>G.conversationId),u=s(G=>G.user),f=s(G=>G.setConversationId),c=s(G=>G.setUser),p=s(G=>G.clearConversationId),d=an(G=>G.messages),m=an(G=>G.saveMessage),h=an(G=>G.updateMessage),g=an(G=>G.fetchMessages),y=an(G=>G.setMessages),v=an(G=>G.clearMessages),w=Gn(G=>G.participants),A=Gn(G=>G.setParticipants),k=Gn(G=>G.addParticipant),C=Gn(G=>G.removeParticipant),T=Gn(G=>G.clearParticipants),P=af(`webchat-sound-${t}`),F=P(G=>G.soundOn),I=P(G=>G.toggleSound),{state:O,setState:j}=Mp(),{state:z,setState:M}=Mp(),D=_.useMemo(()=>Xs(),[]),[B,U]=_.useState("connecting"),[$,V]=_.useState(a.conversationId),[b,N]=_.useState(a.user),[H,x]=_.useState(void 0),[W,ee]=_.useState(!1),[Y,J]=_.useState(void 0),X=_.useRef(!1),ie=_.useRef(null),K=_.useRef(o??!1);_.useEffect(()=>{K.current=o??!1},[o]);const te=_.useRef(F);_.useEffect(()=>{te.current=F},[F]),_.useEffect(()=>{var Ue,Ye,Z,se;const G=pI(t,e);if(G){J(G),U("error");return}if(X.current)return;X.current=!0,j(!1),U("connecting");try{ie.current=new Audio,ie.current.preload="auto",ie.current.src=Gp.chatMessageNotification,ie.current.volume=.9}catch(R){console.error("Error loading sound effect:",R),ie.current=null}let ue;(Ue=a.user)!=null&&Ue.userToken&&a.conversationId?ue={conversationId:a.conversationId,userToken:(Ye=a.user)==null?void 0:Ye.userToken}:(Z=a.user)!=null&&Z.userToken?ue={conversationId:void 0,userToken:(se=a.user)==null?void 0:se.userToken}:ue={conversationId:l,userToken:u==null?void 0:u.userToken};const de=fI({apiUrl:e,clientId:t,userToken:ue.userToken,conversationId:ue.conversationId,adminSecret:i});let we=[];const Se=de("init",({conversation:R,messages:q,participants:ae,user:le})=>{const pe=dI({clientId:t,apiUrl:e,userKey:le.userKey});pe.createEvent({conversationId:R.id,payload:{type:"conversation_started",data:{}}}).then(({event:fe})=>{var Ee,Oe;(Oe=(Ee=fe.payload.data)==null?void 0:Ee.status)!=null&&Oe.isInitial&&D.emit("conversation",R.id)}),we=[...we,de("error",fe=>{J(Ee=>Ee||Sr(fe)),U("error"),D.emit("error",new Error(`Connection to conversation lost: ${fe==null?void 0:fe.message}`))}),de("message_created",fe=>{const Ee=Kn(fe);le.id!==Ee.authorId&&(K.current&&te.current&&ie.current&&ie.current.play().catch(()=>{}),j(!1),M(!1),D.emit("isTyping",{isTyping:!1,timeout:0})),m(Ee),D.emit("message",Ee)}),de("message_status_changed",fe=>{var Ee;fe.newStatus==="processing"&&h((Ee=fe.message.metadata)==null?void 0:Ee.clientMessageId,{status:fe.newStatus})}),de("typing_stopped",()=>{j(!1),M(!1)}),de("typing_started",()=>{j(!0,5e3),M(!0,5e3),D.emit("isTyping",{isTyping:!0,timeout:5e3})}),de("participant_added",fe=>{k(fe.participant),D.emit("participantAdded",fe.participant)}),de("participant_removed",fe=>{C(fe.participantId),D.emit("participantRemoved",fe.participantId)}),de("webchat_visibility",fe=>D.emit("webchatVisibility",fe.visibility)),de("webchat_config",fe=>D.emit("webchatConfig",fe.config)),de("custom",fe=>D.emit("customEvent",fe.event))],V(R.id),f(R.id),N({userId:le.id,userToken:le.userKey}),c({userId:le.id,userToken:le.userKey}),A(ae),y(q.reverse().map(fe=>Kn(fe)).filter(Boolean)),J(void 0),U("connected"),x(pe)});return we.push(Se),()=>{X.current=!1,we.forEach(R=>R())}},[a.conversationId,(oe=a.user)==null?void 0:oe.userToken,W]);const L=async(G,ue)=>{const de=ue||$;if(!G||!de)return;const we=await g({client:G,conversationId:de});y(we);const{participants:Se}=await G.listParticipants({conversationId:de});A(Se)},ne=async G=>{if(!G)throw new Error("Cannot start new conversation: client is not initialized");p(),v(),T(),V(void 0),ee(ue=>!ue)};async function me(G,ue){const we=[{predicate:Se=>Se.message===Ji||Se.type==="ResourceNotFound",recover:()=>ne(ue)},{predicate:Se=>Se.type==="network"||Se.type==="disconnected"||Se.message===Pn,recover:()=>L(ue,$)}].find(Se=>Se.predicate(G));if(!we){U("error"),J(G);return}try{await Sl(we.recover,3,5e3),J(void 0),U("connected")}catch(Se){J(Sr(Se)),U("error")}}if(B!=="connected"||!b||!$||!H)return{clientState:B,on:D.on,client:void 0,messages:[],conversationId:void 0,newConversation:async()=>{await ne(H)},user:void 0,isTyping:void 0,participants:[],toggleSound:I,soundOn:F,error:Y,disableSendButton:z};const ke={sendMessage:async G=>{const ue=ss(),de={id:ue,createdAt:new Date().toISOString(),userId:b.userId,conversationId:$,payload:G,metadata:{clientMessageId:ue,delivered:!1}},we=Kn(de);we.status="pending",m(we),M(!0,5e3);try{await H.createMessage({conversationId:$,payload:G,metadata:{clientMessageId:ue}})}catch(Se){await me(Sr(Se),H),D.emit("error",Se)}},sendEvent:async(G,ue)=>{await H.createEvent({conversationId:$,payload:{type:"custom",data:G},bindConversation:(ue==null?void 0:ue.bindConversation)??!0,bindUser:(ue==null?void 0:ue.bindUser)??!0})},uploadFile:async G=>{const{size:ue,name:de}=G,Se=await(ae=>new Promise((le,pe)=>{const fe=new FileReader;fe.onload=Ee=>{var Oe;return le((Oe=Ee.target)==null?void 0:Oe.result)},fe.onerror=Ee=>{var Oe;return pe((Oe=Ee.target)==null?void 0:Oe.error)},fe.readAsArrayBuffer(ae)}))(G),Ue=new Date;Ue.setDate(Ue.getDate()+30);const{file:{uploadUrl:Ye,contentType:Z,url:se}}=await H.createFile({size:ue,key:`${ss(6)}-${G.name}`,accessPolicies:["public_content"],index:!1,tags:{source:"integration",integrationName:"webchat",conversation:$,user:b.userId},expiresAt:Ue.toISOString()});await fetch(Ye,{method:"PUT",headers:{"x-amz-tagging":"public=true","content-type":Z},body:Se});const R=Z.split("/").shift()??"",q=cl(R)?R:"file";return{fileUrl:se,name:de,type:q}},addMessageFeedback:async(G,ue)=>{h(G,{feedback:ue.value}),await H.addMessageFeedback({messageId:G,...ue})},getUser:async()=>{const{user:G}=await H.getUser();return G},updateUser:async G=>{const{user:ue}=await H.updateUser({name:G.name,pictureUrl:G.pictureUrl,userData:G.data});return ue}};return{clientState:"connected",on:D.on,client:ke,messages:d,conversationId:$,newConversation:async()=>{await ne(H)},user:b,isTyping:O,participants:w,error:Y,soundOn:F,toggleSound:I,disableSendButton:z}}const pI=(e,t)=>{if(!e)return{type:"configuration",message:fl};if(!zm(t))return{type:"configuration",message:dl}},hI=({clientId:e,storageKey:t,configuration:n,allowFileUpload:r,apiUrl:i,user:o,conversationId:a,...s})=>{const l=t||`bp-webchat-${e}`,{clientState:u,client:f,isTyping:c,newConversation:p,messages:d,participants:m,user:h,error:g,soundOn:y,toggleSound:v,disableSendButton:w}=Qp({clientId:e,apiUrl:i,conversationId:a,user:o,storageKey:l,storageLocation:n==null?void 0:n.storageLocation,adminSecret:n==null?void 0:n.adminSecret,soundEnabled:n==null?void 0:n.soundEnabled}),{sendMessage:A,uploadFile:k,addMessageFeedback:C}=f??{};return S.jsx(Dp,{configuration:n??{},user:h!=null&&h.userId?{id:h==null?void 0:h.userId}:void 0,isLoading:u==="connecting",isTyping:c,connected:u==="connected"?!0:u==="disconnected"?!1:void 0,messages:d,sendMessage:A,uploadFile:k,addMessageFeedback:C,allowFileUpload:r,restartConversation:p,...s,participants:m,error:g,clientId:e,soundOn:y,toggleSound:v,disableSendButton:w})};function mI(e,t=globalThis==null?void 0:globalThis.document){const n=Zt(e);E.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var gI="DismissableLayer",ks="dismissableLayer.update",yI="dismissableLayer.pointerDownOutside",vI="dismissableLayer.focusOutside",Jp,Zp=E.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Xp=E.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:a,onDismiss:s,...l}=e,u=E.useContext(Zp),[f,c]=E.useState(null),p=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,d]=E.useState({}),m=Ot(t,T=>c(T)),h=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=h.indexOf(g),v=f?h.indexOf(f):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,A=v>=y,k=xI(T=>{const P=T.target,F=[...u.branches].some(I=>I.contains(P));!A||F||(i==null||i(T),a==null||a(T),T.defaultPrevented||s==null||s())},p),C=kI(T=>{const P=T.target;[...u.branches].some(I=>I.contains(P))||(o==null||o(T),a==null||a(T),T.defaultPrevented||s==null||s())},p);return mI(T=>{v===u.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&s&&(T.preventDefault(),s()))},p),E.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Jp=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),eh(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Jp)}},[f,p,n,u]),E.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),eh())},[f,u]),E.useEffect(()=>{const T=()=>d({});return document.addEventListener(ks,T),()=>document.removeEventListener(ks,T)},[]),S.jsx(ht.div,{...l,ref:m,style:{pointerEvents:w?A?"auto":"none":void 0,...e.style},onFocusCapture:At(e.onFocusCapture,C.onFocusCapture),onBlurCapture:At(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:At(e.onPointerDownCapture,k.onPointerDownCapture)})});Xp.displayName=gI;var bI="DismissableLayerBranch",wI=E.forwardRef((e,t)=>{const n=E.useContext(Zp),r=E.useRef(null),i=Ot(t,r);return E.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),S.jsx(ht.div,{...e,ref:i})});wI.displayName=bI;function xI(e,t=globalThis==null?void 0:globalThis.document){const n=Zt(e),r=E.useRef(!1),i=E.useRef(()=>{});return E.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let l=function(){th(yI,n,u,{discrete:!0})};const u={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=l,t.addEventListener("click",i.current,{once:!0})):l()}else t.removeEventListener("click",i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function kI(e,t=globalThis==null?void 0:globalThis.document){const n=Zt(e),r=E.useRef(!1);return E.useEffect(()=>{const i=o=>{o.target&&!r.current&&th(vI,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function eh(){const e=new CustomEvent(ks);document.dispatchEvent(e)}function th(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?GC(i,o):i.dispatchEvent(o)}var Ss="focusScope.autoFocusOnMount",Es="focusScope.autoFocusOnUnmount",nh={bubbles:!1,cancelable:!0},SI="FocusScope",rh=E.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[s,l]=E.useState(null),u=Zt(i),f=Zt(o),c=E.useRef(null),p=Ot(t,h=>l(h)),d=E.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;E.useEffect(()=>{if(r){let h=function(w){if(d.paused||!s)return;const A=w.target;s.contains(A)?c.current=A:zt(c.current,{select:!0})},g=function(w){if(d.paused||!s)return;const A=w.relatedTarget;A!==null&&(s.contains(A)||zt(c.current,{select:!0}))},y=function(w){if(document.activeElement===document.body)for(const k of w)k.removedNodes.length>0&&zt(s)};document.addEventListener("focusin",h),document.addEventListener("focusout",g);const v=new MutationObserver(y);return s&&v.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",g),v.disconnect()}}},[r,s,d.paused]),E.useEffect(()=>{if(s){ah.add(d);const h=document.activeElement;if(!s.contains(h)){const y=new CustomEvent(Ss,nh);s.addEventListener(Ss,u),s.dispatchEvent(y),y.defaultPrevented||(EI(OI(ih(s)),{select:!0}),document.activeElement===h&&zt(s))}return()=>{s.removeEventListener(Ss,u),setTimeout(()=>{const y=new CustomEvent(Es,nh);s.addEventListener(Es,f),s.dispatchEvent(y),y.defaultPrevented||zt(h??document.body,{select:!0}),s.removeEventListener(Es,f),ah.remove(d)},0)}}},[s,u,f,d]);const m=E.useCallback(h=>{if(!n&&!r||d.paused)return;const g=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,y=document.activeElement;if(g&&y){const v=h.currentTarget,[w,A]=CI(v);w&&A?!h.shiftKey&&y===A?(h.preventDefault(),n&&zt(w,{select:!0})):h.shiftKey&&y===w&&(h.preventDefault(),n&&zt(A,{select:!0})):y===v&&h.preventDefault()}},[n,r,d.paused]);return S.jsx(ht.div,{tabIndex:-1,...a,ref:p,onKeyDown:m})});rh.displayName=SI;function EI(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(zt(r,{select:t}),document.activeElement!==n)return}function CI(e){const t=ih(e),n=oh(t,e),r=oh(t.reverse(),e);return[n,r]}function ih(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function oh(e,t){for(const n of e)if(!AI(n,{upTo:t}))return n}function AI(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function II(e){return e instanceof HTMLInputElement&&"select"in e}function zt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&II(e)&&t&&e.select()}}var ah=TI();function TI(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=sh(e,t),e.unshift(t)},remove(t){var n;e=sh(e,t),(n=e[0])==null||n.resume()}}}function sh(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function OI(e){return e.filter(t=>t.tagName!=="A")}var Cs=0;function DI(){E.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??lh()),document.body.insertAdjacentElement("beforeend",e[1]??lh()),Cs++,()=>{Cs===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Cs--}},[])}function lh(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Oi="right-scroll-bar-position",Di="width-before-scroll-bar",MI="with-scroll-bars-hidden",_I="--removed-body-scroll-bar-size";function As(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function PI(e,t){var n=_.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var NI=typeof window<"u"?E.useLayoutEffect:E.useEffect,uh=new WeakMap;function LI(e,t){var n=PI(null,function(r){return e.forEach(function(i){return As(i,r)})});return NI(function(){var r=uh.get(n);if(r){var i=new Set(r),o=new Set(e),a=n.current;i.forEach(function(s){o.has(s)||As(s,null)}),o.forEach(function(s){i.has(s)||As(s,a)})}uh.set(n,e)},[e]),n}function FI(e){return e}function RI(e,t){t===void 0&&(t=FI);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var a=t(o,r);return n.push(a),function(){n=n.filter(function(s){return s!==a})}},assignSyncMedium:function(o){for(r=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(s){return o(s)},filter:function(){return n}}},assignMedium:function(o){r=!0;var a=[];if(n.length){var s=n;n=[],s.forEach(o),a=n}var l=function(){var f=a;a=[],f.forEach(o)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(f){a.push(f),u()},filter:function(f){return a=a.filter(f),n}}}};return i}function BI(e){e===void 0&&(e={});var t=RI(null);return t.options=ot({async:!0,ssr:!1},e),t}var ch=function(e){var t=e.sideCar,n=cf(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return E.createElement(r,ot({},n))};ch.isSideCarExport=!0;function zI(e,t){return e.useMedium(t),ch}var fh=BI(),Is=function(){},Mi=E.forwardRef(function(e,t){var n=E.useRef(null),r=E.useState({onScrollCapture:Is,onWheelCapture:Is,onTouchMoveCapture:Is}),i=r[0],o=r[1],a=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,f=e.enabled,c=e.shards,p=e.sideCar,d=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,y=e.as,v=y===void 0?"div":y,w=e.gapMode,A=cf(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=p,C=LI([n,t]),T=ot(ot({},A),i);return E.createElement(E.Fragment,null,f&&E.createElement(k,{sideCar:fh,removeScrollBar:u,shards:c,noRelative:d,noIsolation:m,inert:h,setCallbacks:o,allowPinchZoom:!!g,lockRef:n,gapMode:w}),a?E.cloneElement(E.Children.only(s),ot(ot({},T),{ref:C})):E.createElement(v,ot({},T,{className:l,ref:C}),s))});Mi.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Mi.classNames={fullWidth:Di,zeroRight:Oi};var $I=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function jI(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=$I();return t&&e.setAttribute("nonce",t),e}function UI(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function HI(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var WI=function(){var e=0,t=null;return{add:function(n){e==0&&(t=jI())&&(UI(t,n),HI(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},VI=function(){var e=WI();return function(t,n){E.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},dh=function(){var e=VI(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},qI={left:0,top:0,right:0,gap:0},Ts=function(e){return parseInt(e||"",10)||0},KI=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Ts(n),Ts(r),Ts(i)]},YI=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return qI;var t=KI(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},GI=dh(),Sn="data-scroll-locked",QI=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),`
|
|
318
|
-
.`.concat(MI,` {
|
|
326
|
+
*--------------------------------------------------------------------------------------------*/const k2={damping:.7,stiffness:.05,mass:1.25},E2=70,C2=1e3/60,A2=350;let Ho=!1;(Vv=globalThis.document)==null||Vv.addEventListener("mousedown",()=>{Ho=!0}),(Wv=globalThis.document)==null||Wv.addEventListener("mouseup",()=>{Ho=!1}),(qv=globalThis.document)==null||qv.addEventListener("click",()=>{Ho=!1});const T2=(e={})=>{const[t,n]=D.useState(!1),[r,i]=D.useState(e.initial!==!1),[o,s]=D.useState(!1),a=D.useRef(null);a.current=e;const l=D.useCallback(()=>{var E;if(!Ho)return!1;const v=window.getSelection();if(!v||!v.rangeCount)return!1;const w=v.getRangeAt(0);return w.commonAncestorContainer.contains(g.current)||((E=g.current)==null?void 0:E.contains(w.commonAncestorContainer))},[]),u=D.useCallback(v=>{c.isAtBottom=v,i(v)},[]),f=D.useCallback(v=>{c.escapedFromLock=v,n(v)},[]),c=D.useMemo(()=>{let v;return{escapedFromLock:t,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){var w;return((w=g.current)==null?void 0:w.scrollTop)??0},set scrollTop(w){g.current&&(g.current.scrollTop=w,c.ignoreScrollToTop=g.current.scrollTop)},get targetScrollTop(){return!g.current||!y.current?0:g.current.scrollHeight-1-g.current.clientHeight},get calculatedTargetScrollTop(){if(!g.current||!y.current)return 0;const{targetScrollTop:w}=this;if(!e.targetScrollTop)return w;if((v==null?void 0:v.targetScrollTop)===w)return v.calculatedScrollTop;const E=Math.max(Math.min(e.targetScrollTop(w,{scrollElement:g.current,contentElement:y.current}),w),0);return v={targetScrollTop:w,calculatedScrollTop:E},requestAnimationFrame(()=>{v=void 0}),E},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=E2}}},[]),h=D.useCallback((v={})=>{var P;typeof v=="string"&&(v={animation:v}),v.preserveScrollPosition||u(!0);const w=Date.now()+(Number(v.wait)||0),E=cu(a.current,v.animation),{ignoreEscapes:S=!1}=v;let C,I=c.calculatedTargetScrollTop;v.duration instanceof Promise?v.duration.finally(()=>{C=Date.now()}):C=w+(v.duration??0);const M=async()=>{const T=new Promise(requestAnimationFrame).then(()=>{var L;if(!c.isAtBottom)return c.animation=void 0,!1;const{scrollTop:O}=c,U=performance.now(),F=(U-(c.lastTick??U))/C2;if(c.animation||(c.animation={behavior:E,promise:T,ignoreEscapes:S}),c.animation.behavior===E&&(c.lastTick=U),l()||w>Date.now())return M();if(O<Math.min(I,c.calculatedTargetScrollTop)){if(((L=c.animation)==null?void 0:L.behavior)===E){if(E==="instant")return c.scrollTop=c.calculatedTargetScrollTop,M();c.velocity=(E.damping*c.velocity+E.stiffness*c.scrollDifference)/E.mass,c.accumulated+=c.velocity*F,c.scrollTop+=c.accumulated,c.scrollTop!==O&&(c.accumulated=0)}return M()}return C>Date.now()?(I=c.calculatedTargetScrollTop,M()):(c.animation=void 0,c.scrollTop<c.calculatedTargetScrollTop?h({animation:cu(a.current,a.current.resize),ignoreEscapes:S,duration:Math.max(0,C-Date.now())||void 0}):c.isAtBottom)});return T.then(O=>(requestAnimationFrame(()=>{c.animation||(c.lastTick=void 0,c.velocity=0)}),O))};return v.wait!==!0&&(c.animation=void 0),((P=c.animation)==null?void 0:P.behavior)===E?c.animation.promise:M()},[u,l,c]),d=D.useCallback(()=>{f(!0),u(!1)},[f,u]),m=D.useCallback(({target:v})=>{if(v!==g.current)return;const{scrollTop:w,ignoreScrollToTop:E}=c;let{lastScrollTop:S=w}=c;c.lastScrollTop=w,c.ignoreScrollToTop=void 0,E&&E>w&&(S=E),s(c.isNearBottom),setTimeout(()=>{var M;if(c.resizeDifference||w===E)return;if(l()){f(!0),u(!1);return}const C=w>S,I=w<S;if((M=c.animation)!=null&&M.ignoreEscapes){c.scrollTop=S;return}I&&(f(!0),u(!1)),C&&f(!1),!c.escapedFromLock&&c.isNearBottom&&u(!0)},1)},[f,u,l,c]),p=D.useCallback(({target:v,deltaY:w})=>{var S;let E=v;for(;!["scroll","auto"].includes(getComputedStyle(E).overflow);){if(!E.parentElement)return;E=E.parentElement}E===g.current&&w<0&&g.current.scrollHeight>g.current.clientHeight&&!((S=c.animation)!=null&&S.ignoreEscapes)&&(f(!0),u(!1))},[f,u,c]),g=Ty(v=>{var w,E;(w=g.current)==null||w.removeEventListener("scroll",m),(E=g.current)==null||E.removeEventListener("wheel",p),v==null||v.addEventListener("scroll",m,{passive:!0}),v==null||v.addEventListener("wheel",p,{passive:!0})},[]),y=Ty(v=>{var E,S;if((E=c.resizeObserver)==null||E.disconnect(),!v)return;let w;c.resizeObserver=new ResizeObserver(([C])=>{const{height:I}=C.contentRect,M=I-(w??I);if(c.resizeDifference=M,c.scrollTop>c.targetScrollTop&&(c.scrollTop=c.targetScrollTop),s(c.isNearBottom),M>=0){const P=cu(a.current,w?a.current.resize:a.current.initial);h({animation:P,wait:!0,preserveScrollPosition:!0,duration:P==="instant"?void 0:A2})}else c.isNearBottom&&(f(!1),u(!0));w=I,requestAnimationFrame(()=>{setTimeout(()=>{c.resizeDifference===M&&(c.resizeDifference=0)},1)})}),(S=c.resizeObserver)==null||S.observe(v)},[]);return{contentRef:y,scrollRef:g,scrollToBottom:h,stopScroll:d,isAtBottom:r||o,isNearBottom:o,escapedFromLock:t,state:c}};function Ty(e,t){const n=D.useCallback(r=>(n.current=r,e(r)),t);return n}const uu=new Map;function cu(...e){const t={...k2};let n=!1;for(const i of e){if(i==="instant"){n=!0;continue}typeof i=="object"&&(n=!1,t.damping=i.damping??t.damping,t.stiffness=i.stiffness??t.stiffness,t.mass=i.mass??t.mass)}const r=JSON.stringify(t);return uu.has(r)||uu.set(r,Object.freeze(t)),n?"instant":uu.get(r)}const Iy=D.createContext(null),I2=typeof window<"u"?D.useLayoutEffect:D.useEffect;function Vo({instance:e,children:t,resize:n,initial:r,mass:i,damping:o,stiffness:s,targetScrollTop:a,contextRef:l,...u}){const f=D.useRef(null),c=A.useCallback((S,C)=>{const I=(E==null?void 0:E.targetScrollTop)??a;return(I==null?void 0:I(S,C))??S},[a]),h=T2({mass:i,damping:o,stiffness:s,resize:n,initial:r,targetScrollTop:c}),{scrollRef:d,contentRef:m,scrollToBottom:p,stopScroll:g,isAtBottom:y,escapedFromLock:v,state:w}=e??h,E=D.useMemo(()=>({scrollToBottom:p,stopScroll:g,scrollRef:d,isAtBottom:y,escapedFromLock:v,contentRef:m,state:w,get targetScrollTop(){return f.current},set targetScrollTop(S){f.current=S}}),[p,y,m,d,g,v,w]);return D.useImperativeHandle(l,()=>E,[E]),I2(()=>{d.current&&getComputedStyle(d.current).overflow==="visible"&&(d.current.style.overflow="auto")},[]),k.jsx(Iy.Provider,{value:E,children:k.jsx("div",{...u,children:typeof t=="function"?t(E):t})})}(function(e){function t({children:n,...r}){const i=Oy();return k.jsx("div",{ref:i.scrollRef,style:{height:"100%",width:"100%"},children:k.jsx("div",{...r,ref:i.contentRef,children:typeof n=="function"?n(i):n})})}e.Content=t})(Vo||(Vo={}));function Oy(){const e=D.useContext(Iy);if(!e)throw new Error("use-stick-to-bottom component context must be used within a StickToBottom component");return e}const fu=D.memo(({className:e,messages:t=[],isTyping:n,headerMessage:r,renderers:i,botAvatar:o,botDescription:s,botName:a,sendMessage:l,addMessageFeedback:u,showMarquee:f=!0,showDateSystemMessage:c=!0,showMessageStatus:h=!0,showIncomingMessageAvatar:d=!0,showOutgoingMessageAvatar:m=!1,...p})=>{var E;const{messageList:g}=me,y=D.useMemo(()=>c?xb(t):t,[t]),v=D.useMemo(()=>{var C;const S=y.filter(I=>I.direction==="outgoing"&&I.status!=="pending");return(C=S[S.length-1])==null?void 0:C.id},[y]),w=S=>{if(S.direction==="incoming")return d;if(S.direction==="outgoing")return m};return k.jsxs(Vo,{...p,resize:"smooth",initial:"instant",className:ar(g.container.className,e),children:[k.jsxs(Vo.Content,{className:g.viewPort.className,children:[r&&k.jsx("span",{...g.headerMessage,children:r}),f&&k.jsx(x2,{botAvatar:o,botDescription:s,botName:a}),y.map(S=>{var C;return k.jsx(au,{renderers:i,sendMessage:l,addMessageFeedback:u,isLastDeliveredMessage:h&&S.id===v,showAvatar:w(S),...S},((C=S.metadata)==null?void 0:C.clientMessageId)||S.id)}),n&&k.jsx(au,{id:lu(),renderers:i,sendMessage:l,direction:"incoming",timestamp:new Date,showAvatar:d,block:void 0,sender:((E=t.filter(S=>S.direction==="incoming").at(-1))==null?void 0:E.sender)??{name:a||"Bot",avatar:o},children:k.jsx(su,{})})]}),k.jsx(O2,{})]})}),O2=()=>{const{isAtBottom:e,scrollToBottom:t}=Oy(),{messageList:n}=me;return e?null:k.jsx("button",{className:n.scrollDownButton.className,onClick:()=>t()})};fu.displayName="MessageList";const My=({className:e,...t})=>{const{className:n}=me.loader;return k.jsx("div",{...t,className:ar(e,n)})};function Dy({error:e,restartConversation:t,closeWindow:n}){let r,i;const{error:o}=me;return e.type==="configuration"?(r="Configuration error",i=k.jsx(eT,{...o.icon})):e.type==="bot"?(r="Bot error",i=k.jsx(sp,{...o.icon})):e.type==="network"?(r="Network error",i=k.jsx(fT,{...o.icon})):e.type==="disconnected"?(r="Disconnected",i=k.jsx(aT,{...o.icon})):(r="Unexpected error",i=k.jsx(sp,{...o.icon})),k.jsx(M2,{error:e,title:r,icon:i,restartConversation:t,closeWindow:n})}function M2({error:e,title:t,icon:n,restartConversation:r,closeWindow:i}){const{error:o}=me;return k.jsxs("div",{...o.container,children:[k.jsxs("div",{...o.header.container,children:[`Webchat ${e.type} error`,k.jsxs("div",{...o.header.actions,children:[r&&k.jsx(iu,{restartConversation:r,style:{color:"white",backgroundColor:"transparent"}}),i&&k.jsx(ou,{onClick:i,style:{color:"white",backgroundColor:"transparent"}})]})]}),k.jsxs("div",{...o.content,children:[n,k.jsx("div",{...o.errorTitle,children:t}),k.jsx("div",{...o.errorMessage,children:e.message}),e.id&&k.jsx("div",{...o.id,children:e.id})]})]})}const yi=dy.webchat;async function D2(e,t){const{userId:n,conversationId:r,userToken:i,openConversation:o,setClientState:s,setError:a,emitter:l}=t;yi.warn("handleWebchatError",{userId:n,conversationId:r,type:e.type,message:e.message});const f=[{name:"startNewConversation",predicate:c=>c.message===$s||c.type==="ResourceNotFound",recover:async()=>o({userToken:i})},{name:"reopenConversation",predicate:c=>c.type==="network",recover:async()=>o({userToken:i,conversationId:r})}].find(c=>c.predicate(e));if(!f){yi.error("no recovery strategy found, setting error state",{userId:n,conversationId:r}),s("error"),a(e);return}yi.info("attempting recovery",{userId:n,conversationId:r,strategy:f.name});try{await Jf(f.recover,3,5e3),yi.info("recovery successful",{userId:n,conversationId:r}),a(void 0),s("connected")}catch(c){yi.error("recovery failed",{error:c,userId:n,conversationId:r}),a(_r(c)),s("error"),l.emit("error",c)}}function N2(e,t){return async(...n)=>{try{return await e(...n)}catch(r){await D2(_r(r),t)}}}function Ny(e,t){const n={};for(const[r,i]of Object.entries(e))n[r]=N2(i,t);return n}function _y({client:e,conversationId:t}){return{sendEvent:async(r,i)=>{if(!e||!t)throw new Error("Cannot send event: client or conversationId not available");await e.createEvent({conversationId:t,payload:{type:"custom",data:r},bindConversation:(i==null?void 0:i.bindConversation)??!0,bindUser:(i==null?void 0:i.bindUser)??!0})}}}function Py({client:e,conversationId:t,user:n}){return{uploadFile:async i=>{if(!e)throw new Error("Client not initialized");if(!t)throw new Error("No active conversation");if(!n)throw new Error("User not authenticated");const{size:o,name:s}=i,a=await Xw(i),l=new Date;l.setDate(l.getDate()+30);const{file:{uploadUrl:u,contentType:f,url:c,id:h}}=await e.createFile({size:o,key:`${lu(6)}-${i.name}`,accessPolicies:["public_content"],index:!1,tags:{source:"integration",integrationName:"webchat",conversation:t,user:n.userId},expiresAt:l.toISOString()});await fetch(u,{method:"PUT",headers:{"x-amz-tagging":"public=true","content-type":f},body:a});const d=f.split("/").shift()??"",m=Bf(d)?d:"file";return{fileUrl:c,name:s,type:m,fileId:h}}}}function Ly({client:e,conversationId:t,userId:n,setAwaitingResponse:r}){const i=Ep(t||"default"),o=i(d=>d.messages),s=i(d=>d.saveMessage),a=i(d=>d.updateMessage),l=i(d=>d.setMessages),u=i(d=>d.clearMessages);return{messages:o,sendMessage:async d=>{if(!e||!t||!n)throw console.log("Cannot send message: client, conversationId, or userId not available",e,t,n),new Error("Cannot send message: client, conversationId, or userId not available");r==null||r(!0);const m=lu(),p={id:m,createdAt:new Date().toISOString(),userId:n,conversationId:t,payload:d,metadata:{clientMessageId:m,delivered:!1}},g=ui(p);g.status="pending",s(g),await e.createMessage({conversationId:t,payload:d,metadata:{clientMessageId:m}})},setMessages:d=>{const m=d.map(p=>ui(p)).filter(Boolean);l(m)},clearMessages:u,saveMessageFeedback:async(d,m)=>{if(!e)throw new Error("Cannot update feedback: client not available");a(d,{feedback:m.value}),await e.addMessageFeedback({messageId:d,...m})}}}function Fy({client:e,conversationId:t}){const n=Tp(t||"default"),r=n(u=>u.participants),i=n(u=>u.setParticipants),o=n(u=>u.addParticipant),s=n(u=>u.removeParticipant),a=n(u=>u.clearParticipants);return{participants:r,setParticipants:i,fetchParticipants:async()=>{if(!e||!t)return;const{participants:u}=await e.listParticipants({conversationId:t});i(u)},clearParticipants:a,addParticipant:o,removeParticipant:s}}const Ry={chatMessageNotification:new URL("data:audio/ogg;base64,T2dnUwACAAAAAAAAAAAVJAEzAAAAAOU+A6UBHgF2b3JiaXMAAAAAASJWAAD/////AH0AAP////+pAU9nZ1MAAAAAAAAAAAAAFSQBMwEAAAD3T/UfDpz////////////////FA3ZvcmJpcwwAAABMYXZmNjEuNy4xMDAEAAAAHwAAAGVuY29kZXI9TGF2YzYxLjE5LjEwMSBsaWJ2b3JiaXMrAAAAZW5jb2RlZF9ieT1BZG9iZSBQcmVtaWVyZSBQcm8gMjAyNS4wIChNYWNpbhcAAAB0aW1lX3JlZmVyZW5jZT0xMjExMDQwMA8AAABkYXRlPTIwMjUtMDgtMDUBBXZvcmJpcyJCQ1YBAEAAABhCECoFrWOOOsgVIYwZoqBCyinHHULQIaMkQ4g6xjXHGGNHuWSKQsmB0JBVAABAAACkHFdQckkt55xzoxhXzHHoIOecc+UgZ8xxCSXnnHOOOeeSco4x55xzoxhXDnIpLeecc4EUR4pxpxjnnHOkHEeKcagY55xzbTG3knLOOeecc+Ygh1JyrjXnnHOkGGcOcgsl55xzxiBnzHHrIOecc4w1t9RyzjnnnHPOOeecc84555xzjDHnnHPOOeecc24x5xZzrjnnnHPOOeccc84555xzIDRkFQCQAACgoSiK4igOEBqyCgDIAAAQQHEUR5EUS7Ecy9EkDQgNWQUAAAEACAAAoEiGpEiKpViOZmmeJnqiKJqiKquyacqyLMuy67ouEBqyCgBIAABQURTFcBQHCA1ZBQBkAAAIYCiKoziO5FiSpVmeB4SGrAIAgAAABAAAUAxHsRRN8STP8jzP8zzP8zzP8zzP8zzP8zzP8zwNCA1ZBQAgAAAAgihkGANCQ1YBAEAAAAghGhlDnVISXAoWQhwRQx1CzkOppYPgKYUlY9JTrEEIIXzvPffee++B0JBVAAAQAABhFDiIgcckCCGEYhQnRHGmIAghhOUkWMp56CQI3YMQQrice8u59957IDRkFQAACADAIIQQQgghhBBCCCmklFJIKaaYYoopxxxzzDHHIIMMMuigk046yaSSTjrKJKOOUmsptRRTTLHlFmOttdacc69BKWOMMcYYY4wxxhhjjDHGGCMIDVkFAIAAABAGGWSQQQghhBRSSCmmmHLMMcccA0JDVgEAgAAAAgAAABxFUiRHciRHkiTJkixJkzzLszzLszxN1ERNFVXVVW3X9m1f9m3f1WXf9mXb1WVdlmXdtW1d1l1d13Vd13Vd13Vd13Vd13Vd14HQkFUAgAQAgI7kOI7kOI7kSI6kSAoQGrIKAJABABAAgKM4iuNIjuRYjiVZkiZplmd5lqd5mqiJHhAasgoAAAQAEAAAAAAAgKIoiqM4jiRZlqZpnqd6oiiaqqqKpqmqqmqapmmapmmapmmapmmapmmapmmapmmapmmapmmapmmapmkCoSGrAAAJAAAdx3EcR3Ecx3EkR5IkIDRkFQAgAwAgAABDURxFcizHkjRLszzL00TP9FxRNnVTV20gNGQVAAAIACAAAAAAAADHczzHczzJkzzLczzHkzxJ0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRNA0JDVgIAZAAAEJOQSk6xV0YpxiS0XiqkFJPUe6iYYkw67alCBikHuYdKIaWg094ypZBSDHunmELIGOqhg5AxhbDX2nPPvfceCA1ZEQBEAQAAxiDGEGPIMSYlgxIxxyRkUiLnnJROSialpFZazKSEmEqLkXNOSiclk1JaC6llkkprJaYCAAACHAAAAiyEQkNWBABRAACIMUgppBRSSjGnmENKKceUY0gp5ZxyTjnHmHQQKucYdA5KpJRyjjmnnHMSMgeVcw5CJp0AAIAABwCAAAuh0JAVAUCcAACAkHOKMQgRYxBCCSmFUFKqnJPSQUmpg5JSSanFklKMlXNSOgkpdRJSKinFWFKKLaRUY2kt19JSjS3GnFuMvYaUYi2p1Vpaq7nFWHOLNffIOUqdlNY6Ka2l1mpNrdXaSWktpNZiaS3G1mLNKcacMymthZZiK6nF2GLLNbWYc2kt1xRjzynGnmusucecgzCt1ZxayznFmHvMseeYcw+Sc5Q6Ka11UlpLrdWaWqs1k9Jaaa3GkFqLLcacW4sxZ1JaLKnFWFqKMcWYc4st19BarinGnFOLOcdag5Kx9l5aqznFmHuKreeYczA2x547SrmW1nourfVecy5C1tyLaC3n1GoPKsaec87B2NyDEK3lnGrsPcXYe+45GNtz8K3W4FvNRcicg9C5+KZ7MEbV2oPMtQiZcxA66CJ08Ml4lGoureVcWus91hp8zTkI0VruKcbeU4u9156bsL0HIVrLPcXYg4ox+JpzMDrnYlStwcecg5C1FqF7L0rnIJSqtQeZa1Ay1yJ08MXooIsvAABgwAEAIMCEMlBoyIoAIE4AgEHIOaUYhEopCKGElEIoKVWMSciYg5IxJ6WUUloIJbWKMQiZY1Iyx6SEEloqJbQSSmmplNJaKKW1llqMKbUWQymphVJaK6W0llqqMbVWY8SYlMw5KZljUkoprZVSWqsck5IxKKmDkEopKcVSUouVc1Iy6Kh0EEoqqcRUUmmtpNJSKaXFklJsKcVUW4u1hlJaLKnEVlJqMbVUW4sx14gxKRlzUjLnpJRSUiultJY5J6WDjkrmoKSSUmulpBQz5qR0DkrKIKNSUootpRJTKKW1klJspaTWWoy1ptRaLSW1VlJqsZQSW4sx1xZLTZ2U1koqMYZSWmsx5ppaizGUElspKcaSSmytxZpbbDmGUlosqcRWSmqx1ZZja7Hm1FKNKbWaW2y5xpRTj7X2nFqrNbVUY2ux5lhbb7XWnDsprYVSWislxZhai7HFWHMoJbaSUmylpBhbbLm2FmMPobRYSmqxpBJjazHmGFuOqbVaW2y5ptRirbX2HFtuPaUWa4ux5tJSjTXX3mNNORUAADDgAAAQYEIZKDRkJQAQBQAAGMMYYxAapZxzTkqDlHPOScmcgxBCSplzEEJIKXNOQkotZc5BSKm1UEpKrcUWSkmptRYLAAAocAAACLBBU2JxgEJDVgIAUQAAiDFKMQahMUYp5yA0xijFGIRKKcack1ApxZhzUDLHnINQSuaccxBKCSGUUkpKIYRSSkmpAACAAgcAgAAbNCUWByg0ZEUAEAUAABhjnDPOIQqdpc5SJKmj1lFrKKUaS4ydxlZ767nTGnttuTeUSo2p1o5ry7nV3mlNPbccCwAAO3AAADuwEAoNWQkA5AEAEMYoxZhzzhmFGHPOOecMUow555xzijHnnIMQQsWYc85BCCFzzjkIoYSSOecchBBK6JyDUEoppXTOQQihlFI65yCEUkopnXMQSimllAIAgAocAAACbBTZnGAkqNCQlQBAHgAAYAxCzklprWHMOQgt1dgwxhyUlGKLnIOQUou5RsxBSCnGoDsoKbUYbPCdhJRaizkHk1KLNefeg0iptZqDzj3VVnPPvfecYqw1595zLwAAd8EBAOzARpHNCUaCCg1ZCQDkAQAQCCnFmHPOGaUYc8w554xSjDHmnHOKMcacc85BxRhjzjkHIWPMOecghJAx5pxzEELonHMOQgghdM45ByGEEDrnoIMQQgidcxBCCCGEAgCAChwAAAJsFNmcYCSo0JCVAEA4AAAAIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEELonHPOOeecc84555xzzjnnnHPOOScAyLfCAcD/wcYZVpLOCkeDCw1ZCQCEAwAACkEopWIQSiklkk46KZ2TUEopkYNSSumklFJKCaWUUkoIpZRSSggdlFJCKaWUUkoppZRSSimllFI6KaWUUkoppZTKOSmlk1JKKaVEzkkpIZRSSimlhFJKKaWUUkoppZRSSimllFJKKaWEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQCALgbHAAgEmycYSXprHA0uNCQlQBASAAAoBRzjkoIKZSQUqiYoo5CKSmkUkoKEWPOSeochVBSKKmDyjkIpaSUQiohdc5BByWFkFIJIZWOOugolFBSKiWU0jkopYQUSkoplZBCSKl0lFIoJZWUQiohlVJKSCWVEEoKnaRUSgqppFRSCJ10kEInJaSSSgqpk5RSKiWllEpKJXRSQioppRBCSqmUEEpIKaVOUkmppBRCKCGFlFJKJaWSSkohlVRCCaWklFIooaRUUkoppZJSKQAA4MABACDACDrJqLIIG0248AAUGrISACADAECUdNZpp0kiCDFFmScNKcYgtaQswxBTkonxFGOMOShGQw4x5JQYF0oIoYNiPCaVQ8pQUbm31DkFxRZjfO+xFwEAAAgCAASEBAAYICiYAQAGBwgjBwIdAQQObQCAgQiZCQwKocFBJgA8QERIBQCJCYrShS4IIYJ0EWTxwIUTN5644YQObRAAAAAAABAA8AEAkFAAERHRzFVYXGBkaGxwdHh8gIQEAAAAAAAIAHwAACQiQERENHMVFhcYGRobHB0eHyAhAQAAAAAAAAAAQEBAAAAAAAAgAAAAQEBPZ2dTAASuMwAAAAAAABUkATMCAAAACYS6sR4BAUQxGR89NxobGiEkKCknJiYmJSUhISEaFgwBAQEAAnyfvULHAlAEJgh2vpgQBMHIyMjIyNhIQOjz+ePz58+fL89xAwYBAFaH//3//7/xNw0MBoNB6qlPfWrUKQng+/0FABAAhLEjKuHFBwA4AHC9Fx4Oh7EwDEOgvnJ3RtV+Op0+nU6n5cyzEwAoltTpwed5dgVKMPoru90zNHGA7F0CP98BAAAAAHl9ePviAgCW+3rugPIDwC6BbWoTAFEAAADh5GpCCACgc+0zxlAAVKddkjDsA14GDoJtf7R+NkE4W23hI5mF3d74iVGvzg9PpA4cCQs66joePTmOfhgl7vNZzYzQADDyz30FAGSvVUZ6wJ4MAKbCGeb4+v5NLIdK3YvrLkCu98uV//FpXQNyKAKAV7r186fTktcJJgjAlVp1fUmaGgtrdAAuDXYJSPs/AAAAAHDnAeHxciEUAB76CvfarGjDzIjALoEd+/0EAAAAQNYeMrkBAF6ZKm8xuw94NtgloHDUCAAAAIAMJ5Qz2iUAvjhKL8lkfmA6wi6BWfNHgiAAAABq4eeqGgCg8+LAAXQAfhgqz2RKHzAVYJeAynEAIQEAALwq6tFbIQAEEIIO8iULngMAXhgajrw3D5iFWhe7BLZNrwCVKAAA0t2TfT8mADx0aMfS4CULeACvA14YWnasNht80ZpdAhv8BEiiAADgcbm4jo0JANAVCTRV6JqQS0OTADoAXhg6zWy+AZ3GsiDRAYJzgiQAAICnb9FLAQAUNQFd44AioMNJICUAfhi67ZRjA2IMSHTAJK0KkgAAAG7W0uLlEgC6KnQdDkgBlAAdJAB+GHpL40hATAASHSC5CZIAAAAGZ3J60ioBoKsBTQKE5KFJIJFAAp4Y+jp7cg4qINEBi+MASQAAAM8rmdZcAKApwFhNPHQkQEBRQwIAnhj6OZ8KIBwDiQ4Q9ApIFAAAQHRFd6FEALA0NaApQAegnPrDA54Y+nN+AYAIJDoAfgIkCgAAcLRlPVsLALqmKqFpHIwUwQEJCwCeKPpzEQA8kOgAyTlBAgAAgPnK3q8jAWAuJFBYOsbAAgCeKPolEQA8rMFCohQAAMxD2BdSAJYFdNThKcCkBQCOgwKeGPpzEQA8rEEhCQAAoCz4MRGA41gaQMBRjACexHugAACeGPqFCAAeugQAAHryFgBdRYGFhGeow8x7AJ4Y+iURADyIigIAliFAAcYWCQC11gGeGPolEQA8UAAAABoODg4=",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:rs&&rs.tagName.toUpperCase()==="SCRIPT"&&rs.src||new URL("index.umd.cjs",document.baseURI).href).href};function $y({storageKey:e,soundEnabled:t}){const n=Ip(e||"bp-webchat"),r=n(u=>u.soundOn),i=n(u=>u.toggleSound),o=D.useRef(null),s=D.useRef(t??!1),a=D.useRef(r);D.useEffect(()=>{try{o.current=new Audio,o.current.preload="auto",o.current.src=Ry.chatMessageNotification,o.current.volume=.9}catch(u){console.error("Error loading sound effect:",u),o.current=null}},[]),D.useEffect(()=>{s.current=t??!1},[t]),D.useEffect(()=>{a.current=r},[r]);const l=D.useCallback(()=>{s.current&&a.current&&o.current&&o.current.play().catch(()=>{})},[]);return{soundOn:r,toggleSound:i,playNotificationSound:l}}function _2({apiUrl:e="https://webchat.botpress.cloud",clientId:t,storageKey:n,storageLocation:r,adminSecret:i,soundEnabled:o,clientHeaders:s,...a}){var N;const{soundOn:l,toggleSound:u,playNotificationSound:f}=$y({storageKey:n,soundEnabled:o}),{clientState:c,httpClient:h,error:d,activeConversationId:m,userCredentials:p,isTyping:g,isAwaitingResponse:y,openConversation:v,setAwaitingResponse:w,emitter:E,setError:S,setClientState:C}=py({apiUrl:e,clientId:t,storageKey:n,storageLocation:r,adminSecret:i,clientHeaders:s,conversationId:a.conversationId,userToken:(N=a.user)==null?void 0:N.userToken,playNotificationSound:f}),{messages:I,sendMessage:M,saveMessageFeedback:P}=Ly({client:h,conversationId:m,userId:p==null?void 0:p.userId,setAwaitingResponse:w}),{participants:T}=Fy({client:h,conversationId:m}),{uploadFile:O}=Py({client:h,conversationId:m,user:p}),{sendEvent:U}=_y({client:h,conversationId:m});if(c!=="connected"||!p||!m||!h)return{clientState:c,on:E.on,client:void 0,messages:[],conversationId:void 0,newConversation:j=>{v({conversationId:j,userToken:p==null?void 0:p.userToken}).catch(B=>{E.emit("error",B)})},user:void 0,isTyping:void 0,participants:[],toggleSound:u,soundOn:l,error:d,disableSendButton:y};const F={userId:p==null?void 0:p.userId,conversationId:m,userToken:p==null?void 0:p.userToken,openConversation:v,setClientState:C,setError:S,emitter:E},R={...Ny({sendMessage:async j=>M(j),sendEvent:U,uploadFile:O,addMessageFeedback:P},F),getUser:async()=>{const{user:j}=await h.getUser();return j},updateUser:async j=>{const{user:B}=await h.updateUser({name:j.name,pictureUrl:j.pictureUrl,userData:j.data});return B},listConversations:async()=>h.listConversations({})};return{clientState:"connected",on:E.on,client:R,messages:I,conversationId:m,newConversation:j=>{v({conversationId:j,userToken:p.userToken}).catch(B=>{E.emit("error",B)})},user:p,isTyping:g,participants:T,error:d,soundOn:l,toggleSound:u,disableSendButton:y}}const By=()=>{const{client:e,userCredentials:t}=$o();return e?{userCredentials:t,getUser:async()=>(await e.getUser()).user,updateUser:async i=>(await e.updateUser(i)).user}:{userCredentials:t,getUser:void 0,updateUser:void 0}};function zy(){const{client:e,conversationId:t,userCredentials:n,setAwaitingResponse:r,emitter:i,clientState:o,setClientState:s,setError:a,openConversation:l,error:u,isAwaitingResponse:f,isTyping:c}=$o(),{messages:h,sendMessage:d,saveMessageFeedback:m}=Ly({client:e,conversationId:t,userId:n==null?void 0:n.userId,setAwaitingResponse:r}),{participants:p}=Fy({client:e,conversationId:t}),{sendEvent:g}=_y({client:e,conversationId:t}),{uploadFile:y}=Py({client:e,conversationId:t,user:n}),v={userId:n==null?void 0:n.userId,userToken:n==null?void 0:n.userToken,conversationId:t,openConversation:l,setClientState:s,setError:a,emitter:i},w=Ny({sendMessage:d,saveMessageFeedback:m,sendEvent:g,uploadFile:y},v);return{conversationId:t,messages:h,participants:p,sendMessage:w.sendMessage,saveMessageFeedback:w.saveMessageFeedback,sendEvent:w.sendEvent,uploadFile:w.uploadFile,on:i.on,status:o,error:u,isAwaitingResponse:f,isTyping:c}}function Uy(){const{client:e,openConversation:t,userCredentials:n}=$o();return e?{listConversations:async()=>e.listConversations({}),openConversation:i=>t({conversationId:i,userToken:n==null?void 0:n.userToken})}:{listConversations:void 0,openConversation:i=>t({conversationId:i,userToken:n==null?void 0:n.userToken})}}const jy=0,Hy=1,Vy=2,Wy=3;var qy=Object.prototype.hasOwnProperty;function du(e,t){var n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&du(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(qy.call(e,n)&&++r&&!qy.call(t,n)||!(n in t)||!du(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const Jt=new WeakMap,Xt=()=>{},rt=Xt(),hu=Object,we=e=>e===rt,Vt=e=>typeof e=="function",mn=(e,t)=>({...e,...t}),Yy=e=>Vt(e.then),pu={},Wo={},mu="undefined",vi=typeof window!=mu,gu=typeof document!=mu,P2=vi&&"Deno"in window,L2=()=>vi&&typeof window.requestAnimationFrame!=mu,Ky=(e,t)=>{const n=Jt.get(e);return[()=>!we(t)&&e.get(t)||pu,r=>{if(!we(t)){const i=e.get(t);t in Wo||(Wo[t]=i),n[5](t,mn(i,r),i||pu)}},n[6],()=>!we(t)&&t in Wo?Wo[t]:!we(t)&&e.get(t)||pu]};let yu=!0;const F2=()=>yu,[vu,bu]=vi&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Xt,Xt],R2=()=>{const e=gu&&document.visibilityState;return we(e)||e!=="hidden"},$2=e=>(gu&&document.addEventListener("visibilitychange",e),vu("focus",e),()=>{gu&&document.removeEventListener("visibilitychange",e),bu("focus",e)}),B2=e=>{const t=()=>{yu=!0,e()},n=()=>{yu=!1};return vu("online",t),vu("offline",n),()=>{bu("online",t),bu("offline",n)}},z2={isOnline:F2,isVisible:R2},U2={initFocus:$2,initReconnect:B2},Gy=!D.useId,hr=!vi||P2,j2=e=>L2()?window.requestAnimationFrame(e):setTimeout(e,1),wu=hr?D.useEffect:D.useLayoutEffect,Su=typeof navigator<"u"&&navigator.connection,Qy=!hr&&Su&&(["slow-2g","2g"].includes(Su.effectiveType)||Su.saveData),qo=new WeakMap,H2=e=>hu.prototype.toString.call(e),xu=(e,t)=>e===`[object ${t}]`;let V2=0;const ku=e=>{const t=typeof e,n=H2(e),r=xu(n,"Date"),i=xu(n,"RegExp"),o=xu(n,"Object");let s,a;if(hu(e)===e&&!r&&!i){if(s=qo.get(e),s)return s;if(s=++V2+"~",qo.set(e,s),Array.isArray(e)){for(s="@",a=0;a<e.length;a++)s+=ku(e[a])+",";qo.set(e,s)}if(o){s="#";const l=hu.keys(e).sort();for(;!we(a=l.pop());)we(e[a])||(s+=a+":"+ku(e[a])+",");qo.set(e,s)}}else s=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return s},Eu=e=>{if(Vt(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?ku(e):"",[e,t]};let W2=0;const Cu=()=>++W2;async function Zy(...e){const[t,n,r,i]=e,o=mn({populateCache:!0,throwOnError:!0},typeof i=="boolean"?{revalidate:i}:i||{});let s=o.populateCache;const a=o.rollbackOnError;let l=o.optimisticData;const u=h=>typeof a=="function"?a(h):a!==!1,f=o.throwOnError;if(Vt(n)){const h=n,d=[],m=t.keys();for(const p of m)!/^\$(inf|sub)\$/.test(p)&&h(t.get(p)._k)&&d.push(p);return Promise.all(d.map(c))}return c(n);async function c(h){const[d]=Eu(h);if(!d)return;const[m,p]=Ky(t,d),[g,y,v,w]=Jt.get(t),E=()=>{const L=g[d];return(Vt(o.revalidate)?o.revalidate(m().data,h):o.revalidate!==!1)&&(delete v[d],delete w[d],L&&L[0])?L[0](Vy).then(()=>m().data):m().data};if(e.length<3)return E();let S=r,C,I=!1;const M=Cu();y[d]=[M,0];const P=!we(l),T=m(),O=T.data,U=T._c,F=we(U)?O:U;if(P&&(l=Vt(l)?l(F,O):l,p({data:l,_c:F})),Vt(S))try{S=S(F)}catch(L){C=L,I=!0}if(S&&Yy(S))if(S=await S.catch(L=>{C=L,I=!0}),M!==y[d][0]){if(I)throw C;return S}else I&&P&&u(C)&&(s=!0,p({data:F,_c:rt}));if(s&&!I)if(Vt(s)){const L=s(S,F);p({data:L,error:rt,_c:rt})}else p({data:S,error:rt,_c:rt});if(y[d][1]=Cu(),Promise.resolve(E()).then(()=>{p({_c:rt})}),I){if(f)throw C;return}return S}}const Jy=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},q2=(e,t)=>{if(!Jt.has(e)){const n=mn(U2,t),r=Object.create(null),i=Zy.bind(rt,e);let o=Xt;const s=Object.create(null),a=(f,c)=>{const h=s[f]||[];return s[f]=h,h.push(c),()=>h.splice(h.indexOf(c),1)},l=(f,c,h)=>{e.set(f,c);const d=s[f];if(d)for(const m of d)m(c,h)},u=()=>{if(!Jt.has(e)&&(Jt.set(e,[r,Object.create(null),Object.create(null),Object.create(null),i,l,a]),!hr)){const f=n.initFocus(setTimeout.bind(rt,Jy.bind(rt,r,jy))),c=n.initReconnect(setTimeout.bind(rt,Jy.bind(rt,r,Hy)));o=()=>{f&&f(),c&&c(),Jt.delete(e)}}};return u(),[e,i,u,o]}return[e,Jt.get(e)[4]]},Y2=(e,t,n,r,i)=>{const o=n.errorRetryCount,s=i.retryCount,a=~~((Math.random()+.5)*(1<<(s<8?s:8)))*n.errorRetryInterval;!we(o)&&s>o||setTimeout(r,a,i)},K2=du,[Xy,G2]=q2(new Map),Q2=mn({onLoadingSlow:Xt,onSuccess:Xt,onError:Xt,onErrorRetry:Y2,onDiscarded:Xt,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:Qy?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:Qy?5e3:3e3,compare:K2,isPaused:()=>!1,cache:Xy,mutate:G2,fallback:{}},z2),Z2=(e,t)=>{const n=mn(e,t);if(t){const{use:r,fallback:i}=e,{use:o,fallback:s}=t;r&&o&&(n.use=r.concat(o)),i&&s&&(n.fallback=mn(i,s))}return n},J2=D.createContext({}),X2="$inf$",ev=vi&&window.__SWR_DEVTOOLS_USE__,e_=ev?window.__SWR_DEVTOOLS_USE__:[],t_=()=>{ev&&(window.__SWR_DEVTOOLS_REACT__=D)},n_=e=>Vt(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],r_=()=>{const e=D.useContext(J2);return D.useMemo(()=>mn(Q2,e),[e])},i_=e=>(t,n,r)=>e(t,n&&((...o)=>{const[s]=Eu(t),[,,,a]=Jt.get(Xy);if(s.startsWith(X2))return n(...o);const l=a[s];return we(l)?n(...o):(delete a[s],l)}),r),o_=e_.concat(i_),s_=e=>function(...n){const r=r_(),[i,o,s]=n_(n),a=Z2(r,s);let l=e;const{use:u}=a,f=(u||[]).concat(o_);for(let c=f.length;c--;)l=f[c](l);return l(i,o||a.fetcher||null,a)},a_=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const i=r.indexOf(n);i>=0&&(r[i]=r[r.length-1],r.pop())}};t_();const Au=D.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),Tu={dedupe:!0},tv=Promise.resolve(rt),l_=()=>Xt,u_=s_((e,t,n)=>{const{cache:r,compare:i,suspense:o,fallbackData:s,revalidateOnMount:a,revalidateIfStale:l,refreshInterval:u,refreshWhenHidden:f,refreshWhenOffline:c,keepPreviousData:h,strictServerPrefetchWarning:d}=n,[m,p,g,y]=Jt.get(r),[v,w]=Eu(e),E=D.useRef(!1),S=D.useRef(!1),C=D.useRef(v),I=D.useRef(t),M=D.useRef(n),P=()=>M.current,T=()=>P().isVisible()&&P().isOnline(),[O,U,F,L]=Ky(r,v),R=D.useRef({}).current,N=we(s)?we(n.fallback)?rt:n.fallback[v]:s,j=(J,ue)=>{for(const de in R){const fe=de;if(fe==="data"){if(!i(J[fe],ue[fe])&&(!we(J[fe])||!i(q,ue[fe])))return!1}else if(ue[fe]!==J[fe])return!1}return!0},B=!E.current,W=D.useMemo(()=>{const J=O(),ue=L(),de=Me=>{const je=mn(Me);return delete je._k,(()=>{if(!v||!t||P().isPaused())return!1;if(B&&!we(a))return a;const ae=we(N)?je.data:N;return we(ae)||l})()?{isValidating:!0,isLoading:!0,...je}:je},fe=de(J),Ae=J===ue?fe:de(ue);let Fe=fe;return[()=>{const Me=de(O());return j(Me,Fe)?(Fe.data=Me.data,Fe.isLoading=Me.isLoading,Fe.isValidating=Me.isValidating,Fe.error=Me.error,Fe):(Fe=Me,Me)},()=>Ae]},[r,v]),b=us.useSyncExternalStore(D.useCallback(J=>F(v,(ue,de)=>{j(de,ue)||J()}),[r,v]),W[0],W[1]),_=m[v]&&m[v].length>0,H=b.data,x=we(H)?N&&Yy(N)?Au(N):N:H,V=b.error,Y=D.useRef(x),q=h?we(H)?we(Y.current)?x:Y.current:H:x,Q=v&&we(x),X=D.useRef(null);!hr&&us.useSyncExternalStore(l_,()=>(X.current=!1,X),()=>(X.current=!0,X));const se=X.current;d&&se&&!o&&Q&&console.warn(`Missing pre-initiated data for serialized key "${v}" during server-side rendering. Data fetching should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);const G=!v||!t||P().isPaused()||_&&!we(V)?!1:B&&!we(a)?a:o?we(x)?!1:l:we(x)||l,te=we(b.isValidating)?G:b.isValidating,$=we(b.isLoading)?G:b.isLoading,ne=D.useCallback(async J=>{const ue=I.current;if(!v||!ue||S.current||P().isPaused())return!1;let de,fe,Ae=!0;const Fe=J||{},Me=!g[v]||!Fe.dedupe,je=()=>Gy?!S.current&&v===C.current&&E.current:v===C.current,ee={isValidating:!1,isLoading:!1},ae=()=>{U(ee)},z=()=>{const oe=g[v];oe&&oe[1]===fe&&delete g[v]},K={isValidating:!0};we(O().data)&&(K.isLoading=!0);try{if(Me&&(U(K),n.loadingTimeout&&we(O().data)&&setTimeout(()=>{Ae&&je()&&P().onLoadingSlow(v,n)},n.loadingTimeout),g[v]=[ue(w),Cu()]),[de,fe]=g[v],de=await de,Me&&setTimeout(z,n.dedupingInterval),!g[v]||g[v][1]!==fe)return Me&&je()&&P().onDiscarded(v),!1;ee.error=rt;const oe=p[v];if(!we(oe)&&(fe<=oe[0]||fe<=oe[1]||oe[1]===0))return ae(),Me&&je()&&P().onDiscarded(v),!1;const le=O().data;ee.data=i(le,de)?le:de,Me&&je()&&P().onSuccess(de,v,n)}catch(oe){z();const le=P(),{shouldRetryOnError:he}=le;le.isPaused()||(ee.error=oe,Me&&je()&&(le.onError(oe,v,le),(he===!0||Vt(he)&&he(oe))&&(!P().revalidateOnFocus||!P().revalidateOnReconnect||T())&&le.onErrorRetry(oe,v,le,He=>{const Ge=m[v];Ge&&Ge[0]&&Ge[0](Wy,He)},{retryCount:(Fe.retryCount||0)+1,dedupe:!0})))}return Ae=!1,ae(),!0},[v,r]),ge=D.useCallback((...J)=>Zy(r,C.current,...J),[]);if(wu(()=>{I.current=t,M.current=n,we(H)||(Y.current=H)}),wu(()=>{if(!v)return;const J=ne.bind(rt,Tu);let ue=0;P().revalidateOnFocus&&(ue=Date.now()+P().focusThrottleInterval);const fe=a_(v,m,(Ae,Fe={})=>{if(Ae==jy){const Me=Date.now();P().revalidateOnFocus&&Me>ue&&T()&&(ue=Me+P().focusThrottleInterval,J())}else if(Ae==Hy)P().revalidateOnReconnect&&T()&&J();else{if(Ae==Vy)return ne();if(Ae==Wy)return ne(Fe)}});return S.current=!1,C.current=v,E.current=!0,U({_k:w}),G&&(g[v]||(we(x)||hr?J():j2(J))),()=>{S.current=!0,fe()}},[v]),wu(()=>{let J;function ue(){const fe=Vt(u)?u(O().data):u;fe&&J!==-1&&(J=setTimeout(de,fe))}function de(){!O().error&&(f||P().isVisible())&&(c||P().isOnline())?ne(Tu).then(ue):ue()}return ue(),()=>{J&&(clearTimeout(J),J=-1)}},[u,f,c,v]),D.useDebugValue(q),o){if(!Gy&&hr&&Q)throw new Error("Fallback data is required when using Suspense in SSR.");Q&&(I.current=t,M.current=n,S.current=!1);const J=y[v],ue=!we(J)&&Q?ge(J):tv;if(Au(ue),!we(V)&&Q)throw V;const de=Q?ne(Tu):tv;!we(q)&&Q&&(de.status="fulfilled",de.value=!0),Au(de)}return{mutate:ge,get data(){return R.data=!0,q},get error(){return R.error=!0,V},get isValidating(){return R.isValidating=!0,te},get isLoading(){return R.isLoading=!0,$}}});function nv({userCredentials:e,listConversations:t,clientId:n}){const r=!!e&&n&&t,{data:i,error:o,isValidating:s,mutate:a}=u_(r?[n,"conversations",e==null?void 0:e.userId]:null,async()=>(await t({})).conversations.filter(c_).sort((u,f)=>new Date(f.updatedAt).getTime()-new Date(u.updatedAt).getTime()).map(u=>({...u,lastMessage:{...u.lastMessage,author:{type:u.lastMessage.userId===(e==null?void 0:e.userId)?"user":"bot"}}})),{revalidateOnFocus:!1,revalidateOnReconnect:!0,dedupingInterval:2e3});return{conversations:i??[],isLoading:s,error:o&&_r(o),refresh:async()=>await a()}}const c_=e=>!!e.lastMessage,f_=e=>e==null||e.length===0?"":e.charAt(0).toUpperCase()+e.slice(1),Iu=({className:e,onConversationClick:t,onNewConversation:n,onClose:r,currentConversationId:i,isLoading:o,conversations:s,botAvatar:a,botName:l,...u})=>{const{conversationHistory:f}=me;return k.jsxs("div",{...u,...f.container,className:ar(f.container.className,e),children:[k.jsxs("div",{...f.header,children:["Conversations",r&&k.jsx("div",{...f.closeButton,children:k.jsx(ou,{onClick:r})})]}),o?k.jsx("div",{...f.loaderContainer,children:k.jsx(My,{})}):k.jsx("div",{...f.scrollContainer,children:s.length===0?k.jsx("div",{...f.loaderContainer,children:"No conversation started yet"}):s.map(({id:c,lastMessage:h})=>{let d="";if(h.payload.type==="text")d=h.payload.text;else if(h.payload.type==="bloc"&&h.payload.items.some(m=>m.type==="text")){const m=h.payload.items.find(p=>p.type==="text");d=(m==null?void 0:m.payload.text)??""}else d="Sent an attachment";return k.jsxs("button",{...f.conversation.container,onClick:()=>t==null?void 0:t(c),"data-active":i===c?"":void 0,children:[h.author.type==="bot"?k.jsx(En,{userId:h.userId,src:a,...f.conversation.avatar,children:l??"Bot"}):k.jsx(En,{userId:h.userId,...f.conversation.avatar,fallback:f.conversation.userAvatar.className,children:k.jsx(lT,{strokeWidth:1.5})}),k.jsxs("div",{...f.conversation.content,children:[k.jsx("span",{...f.conversation.name,children:d}),k.jsx("span",{...f.conversation.timestamp,children:f_(Aw(h.createdAt))})]}),k.jsx(lp,{strokeWidth:1.5,...f.conversation.chevron})]},c)})}),k.jsxs("button",{...f.newConversation.button,onClick:n,children:[k.jsx(iT,{...f.newConversation.icon}),"New conversation"]})]})};Iu.displayName="ConversationHistory";const rv=({connected:e,configuration:t,isTyping:n,messages:r,user:i,isLoading:o,renderers:s,isReadOnly:a,disableComposer:l,error:u,participants:f,closeWindow:c,sendMessage:h,uploadFile:d,addMessageFeedback:m,listConversations:p,restartConversation:g,clientId:y,storageKey:v,soundOn:w,toggleSound:E,disableSendButton:S,conversationId:C,...I})=>{const{color:M,fontFamily:P,radius:T,themeMode:O,variant:U,headerVariant:F,botAvatar:L,botDescription:R,botName:N,composerPlaceholder:j,footer:B,feedbackEnabled:W,additionalStylesheetUrl:b,allowFileUpload:_,conversationHistory:H}=t,x={color:M,fontFamily:P,radius:T,themeMode:O,variant:U,headerVariant:F,additionalStylesheetUrl:b},[V,Y]=D.useState("chat"),q=nv({clientId:y,listConversations:p,userCredentials:i});D.useEffect(()=>{V==="conversations"&&q.refresh()},[V]),W||(m=void 0);const Q=D.useMemo(()=>i?nc(r,f,i.userId,N,L):[],[L,N,r,i,f]),X=D.useMemo(()=>{var te,$;return(($=(te=r.at(-1))==null?void 0:te.metadata)==null?void 0:$.conversationStatus)==="closed"},[r]),se=D.useRef(null),G=Qn(te=>te.setPortalContainer);return D.useEffect(()=>(G(se.current),()=>{G(null)}),[G]),k.jsxs(k.Fragment,{children:[k.jsx(Fg,{...x}),k.jsx("div",{ref:se,style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none",zIndex:10}}),k.jsx(eu,{connected:e,allowFileUpload:_,uploadFile:d,storageKey:v,conversationId:C,...I,children:u||q.error?k.jsx(Dy,{error:u||q.error,restartConversation:g,closeWindow:c}):V==="conversations"?k.jsx(Iu,{onClose:c,conversations:q.conversations,isLoading:q.isLoading,onNewConversation:()=>{g==null||g(),Y("chat")},onConversationClick:te=>{g==null||g(te),Y("chat")},botAvatar:L,botName:N}):k.jsxs(k.Fragment,{children:[k.jsx(Cy,{showConversationHistory:H?()=>Y("conversations"):void 0,closeWindow:c,configuration:t,restartConversation:g,clientId:y,soundOn:w,toggleSound:E}),o?k.jsx(My,{}):k.jsx(fu,{botAvatar:L,botDescription:R,botName:N,renderers:s,isTyping:n,sendMessage:h,addMessageFeedback:m,messages:Q}),!X&&k.jsx(ng,{sendMessage:h,uploadFile:d,connected:e,isReadOnly:a,disableComposer:l,footer:B,composerPlaceholder:j,allowFileUpload:_,storageKey:v,disableSendButton:S,conversationId:C})]})})]})};function d_({configuration:e,storageKey:t,clientId:n,...r}){const i=t||`bp-webchat-${n}`,{messages:o,participants:s,sendMessage:a,uploadFile:l,saveMessageFeedback:u,conversationId:f,status:c,error:h,isTyping:d,isAwaitingResponse:m}=zy(),{openConversation:p,listConversations:g}=Uy(),{userCredentials:y}=By(),{soundOn:v,toggleSound:w}=$y({storageKey:i,soundEnabled:e==null?void 0:e.soundEnabled});return k.jsx(rv,{configuration:e??{},user:y,isLoading:c==="connecting",isTyping:d,connected:c==="connected"?!0:c==="disconnected"?!1:void 0,messages:o,sendMessage:a,uploadFile:l,addMessageFeedback:u,listConversations:g,restartConversation:p,participants:s,error:h,clientId:n,soundOn:v,toggleSound:w,disableSendButton:m,conversationId:f,storageKey:i,...r})}const h_=({clientId:e,storageKey:t,configuration:n,apiUrl:r,user:i,conversationId:o,...s})=>{const a=t||`bp-webchat-${e}`;return k.jsx(gy,{clientId:e,apiUrl:r,userCredentials:i,conversationId:o,storageKey:a,storageLocation:n==null?void 0:n.storageLocation,adminSecret:n==null?void 0:n.adminSecret,children:k.jsx(d_,{configuration:n,storageKey:t,clientId:e,...s})})};function p_(e,t=globalThis==null?void 0:globalThis.document){const n=Ln(e);A.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var m_="DismissableLayer",Ou="dismissableLayer.update",g_="dismissableLayer.pointerDownOutside",y_="dismissableLayer.focusOutside",iv,ov=A.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),sv=A.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,onDismiss:a,...l}=e,u=A.useContext(ov),[f,c]=A.useState(null),h=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,d]=A.useState({}),m=tn(t,I=>c(I)),p=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=p.indexOf(g),v=f?p.indexOf(f):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,E=v>=y,S=w_(I=>{const M=I.target,P=[...u.branches].some(T=>T.contains(M));!E||P||(i==null||i(I),s==null||s(I),I.defaultPrevented||a==null||a())},h),C=S_(I=>{const M=I.target;[...u.branches].some(T=>T.contains(M))||(o==null||o(I),s==null||s(I),I.defaultPrevented||a==null||a())},h);return p_(I=>{v===u.layers.size-1&&(r==null||r(I),!I.defaultPrevented&&a&&(I.preventDefault(),a()))},h),A.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(iv=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),av(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=iv)}},[f,h,n,u]),A.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),av())},[f,u]),A.useEffect(()=>{const I=()=>d({});return document.addEventListener(Ou,I),()=>document.removeEventListener(Ou,I)},[]),k.jsx(Ft.div,{...l,ref:m,style:{pointerEvents:w?E?"auto":"none":void 0,...e.style},onFocusCapture:Zt(e.onFocusCapture,C.onFocusCapture),onBlurCapture:Zt(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:Zt(e.onPointerDownCapture,S.onPointerDownCapture)})});sv.displayName=m_;var v_="DismissableLayerBranch",b_=A.forwardRef((e,t)=>{const n=A.useContext(ov),r=A.useRef(null),i=tn(t,r);return A.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),k.jsx(Ft.div,{...e,ref:i})});b_.displayName=v_;function w_(e,t=globalThis==null?void 0:globalThis.document){const n=Ln(e),r=A.useRef(!1),i=A.useRef(()=>{});return A.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let l=function(){lv(g_,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=l,t.addEventListener("click",i.current,{once:!0})):l()}else t.removeEventListener("click",i.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function S_(e,t=globalThis==null?void 0:globalThis.document){const n=Ln(e),r=A.useRef(!1);return A.useEffect(()=>{const i=o=>{o.target&&!r.current&&lv(y_,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function av(){const e=new CustomEvent(Ou);document.dispatchEvent(e)}function lv(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?u2(i,o):i.dispatchEvent(o)}var Mu="focusScope.autoFocusOnMount",Du="focusScope.autoFocusOnUnmount",uv={bubbles:!1,cancelable:!0},x_="FocusScope",cv=A.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[a,l]=A.useState(null),u=Ln(i),f=Ln(o),c=A.useRef(null),h=tn(t,p=>l(p)),d=A.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;A.useEffect(()=>{if(r){let p=function(w){if(d.paused||!a)return;const E=w.target;a.contains(E)?c.current=E:gn(c.current,{select:!0})},g=function(w){if(d.paused||!a)return;const E=w.relatedTarget;E!==null&&(a.contains(E)||gn(c.current,{select:!0}))},y=function(w){if(document.activeElement===document.body)for(const S of w)S.removedNodes.length>0&&gn(a)};document.addEventListener("focusin",p),document.addEventListener("focusout",g);const v=new MutationObserver(y);return a&&v.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",g),v.disconnect()}}},[r,a,d.paused]),A.useEffect(()=>{if(a){hv.add(d);const p=document.activeElement;if(!a.contains(p)){const y=new CustomEvent(Mu,uv);a.addEventListener(Mu,u),a.dispatchEvent(y),y.defaultPrevented||(k_(I_(fv(a)),{select:!0}),document.activeElement===p&&gn(a))}return()=>{a.removeEventListener(Mu,u),setTimeout(()=>{const y=new CustomEvent(Du,uv);a.addEventListener(Du,f),a.dispatchEvent(y),y.defaultPrevented||gn(p??document.body,{select:!0}),a.removeEventListener(Du,f),hv.remove(d)},0)}}},[a,u,f,d]);const m=A.useCallback(p=>{if(!n&&!r||d.paused)return;const g=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,y=document.activeElement;if(g&&y){const v=p.currentTarget,[w,E]=E_(v);w&&E?!p.shiftKey&&y===E?(p.preventDefault(),n&&gn(w,{select:!0})):p.shiftKey&&y===w&&(p.preventDefault(),n&&gn(E,{select:!0})):y===v&&p.preventDefault()}},[n,r,d.paused]);return k.jsx(Ft.div,{tabIndex:-1,...s,ref:h,onKeyDown:m})});cv.displayName=x_;function k_(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(gn(r,{select:t}),document.activeElement!==n)return}function E_(e){const t=fv(e),n=dv(t,e),r=dv(t.reverse(),e);return[n,r]}function fv(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function dv(e,t){for(const n of e)if(!C_(n,{upTo:t}))return n}function C_(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function A_(e){return e instanceof HTMLInputElement&&"select"in e}function gn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&A_(e)&&t&&e.select()}}var hv=T_();function T_(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=pv(e,t),e.unshift(t)},remove(t){var n;e=pv(e,t),(n=e[0])==null||n.resume()}}}function pv(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function I_(e){return e.filter(t=>t.tagName!=="A")}var Nu=0;function O_(){A.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??mv()),document.body.insertAdjacentElement("beforeend",e[1]??mv()),Nu++,()=>{Nu===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Nu--}},[])}function mv(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Yo="right-scroll-bar-position",Ko="width-before-scroll-bar",M_="with-scroll-bars-hidden",D_="--removed-body-scroll-bar-size";function _u(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function N_(e,t){var n=D.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var __=typeof window<"u"?A.useLayoutEffect:A.useEffect,gv=new WeakMap;function P_(e,t){var n=N_(null,function(r){return e.forEach(function(i){return _u(i,r)})});return __(function(){var r=gv.get(n);if(r){var i=new Set(r),o=new Set(e),s=n.current;i.forEach(function(a){o.has(a)||_u(a,null)}),o.forEach(function(a){i.has(a)||_u(a,s)})}gv.set(n,e)},[e]),n}function L_(e){return e}function F_(e,t){t===void 0&&(t=L_);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var s=t(o,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(o){for(r=!0;n.length;){var s=n;n=[],s.forEach(o)}n={push:function(a){return o(a)},filter:function(){return n}}},assignMedium:function(o){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(o),s=n}var l=function(){var f=s;s=[],f.forEach(o)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(f){s.push(f),u()},filter:function(f){return s=s.filter(f),n}}}};return i}function R_(e){e===void 0&&(e={});var t=F_(null);return t.options=xt({async:!0,ssr:!1},e),t}var yv=function(e){var t=e.sideCar,n=Np(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return A.createElement(r,xt({},n))};yv.isSideCarExport=!0;function $_(e,t){return e.useMedium(t),yv}var vv=R_(),Pu=function(){},Go=A.forwardRef(function(e,t){var n=A.useRef(null),r=A.useState({onScrollCapture:Pu,onWheelCapture:Pu,onTouchMoveCapture:Pu}),i=r[0],o=r[1],s=e.forwardProps,a=e.children,l=e.className,u=e.removeScrollBar,f=e.enabled,c=e.shards,h=e.sideCar,d=e.noRelative,m=e.noIsolation,p=e.inert,g=e.allowPinchZoom,y=e.as,v=y===void 0?"div":y,w=e.gapMode,E=Np(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=h,C=P_([n,t]),I=xt(xt({},E),i);return A.createElement(A.Fragment,null,f&&A.createElement(S,{sideCar:vv,removeScrollBar:u,shards:c,noRelative:d,noIsolation:m,inert:p,setCallbacks:o,allowPinchZoom:!!g,lockRef:n,gapMode:w}),s?A.cloneElement(A.Children.only(a),xt(xt({},I),{ref:C})):A.createElement(v,xt({},I,{className:l,ref:C}),a))});Go.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Go.classNames={fullWidth:Ko,zeroRight:Yo};var B_=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function z_(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=B_();return t&&e.setAttribute("nonce",t),e}function U_(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function j_(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var H_=function(){var e=0,t=null;return{add:function(n){e==0&&(t=z_())&&(U_(t,n),j_(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},V_=function(){var e=H_();return function(t,n){A.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},bv=function(){var e=V_(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},W_={left:0,top:0,right:0,gap:0},Lu=function(e){return parseInt(e||"",10)||0},q_=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Lu(n),Lu(r),Lu(i)]},Y_=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return W_;var t=q_(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},K_=bv(),pr="data-scroll-locked",G_=function(e,t,n,r){var i=e.left,o=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
327
|
+
.`.concat(M_,` {
|
|
319
328
|
overflow: hidden `).concat(r,`;
|
|
320
|
-
padding-right: `).concat(
|
|
329
|
+
padding-right: `).concat(a,"px ").concat(r,`;
|
|
321
330
|
}
|
|
322
|
-
body[`).concat(
|
|
331
|
+
body[`).concat(pr,`] {
|
|
323
332
|
overflow: hidden `).concat(r,`;
|
|
324
333
|
overscroll-behavior: contain;
|
|
325
334
|
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
326
335
|
padding-left: `.concat(i,`px;
|
|
327
336
|
padding-top: `).concat(o,`px;
|
|
328
|
-
padding-right: `).concat(
|
|
337
|
+
padding-right: `).concat(s,`px;
|
|
329
338
|
margin-left:0;
|
|
330
339
|
margin-top:0;
|
|
331
|
-
margin-right: `).concat(
|
|
332
|
-
`),n==="padding"&&"padding-right: ".concat(
|
|
340
|
+
margin-right: `).concat(a,"px ").concat(r,`;
|
|
341
|
+
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
333
342
|
}
|
|
334
343
|
|
|
335
|
-
.`).concat(
|
|
336
|
-
right: `).concat(
|
|
344
|
+
.`).concat(Yo,` {
|
|
345
|
+
right: `).concat(a,"px ").concat(r,`;
|
|
337
346
|
}
|
|
338
347
|
|
|
339
|
-
.`).concat(
|
|
340
|
-
margin-right: `).concat(
|
|
348
|
+
.`).concat(Ko,` {
|
|
349
|
+
margin-right: `).concat(a,"px ").concat(r,`;
|
|
341
350
|
}
|
|
342
351
|
|
|
343
|
-
.`).concat(
|
|
352
|
+
.`).concat(Yo," .").concat(Yo,` {
|
|
344
353
|
right: 0 `).concat(r,`;
|
|
345
354
|
}
|
|
346
355
|
|
|
347
|
-
.`).concat(
|
|
356
|
+
.`).concat(Ko," .").concat(Ko,` {
|
|
348
357
|
margin-right: 0 `).concat(r,`;
|
|
349
358
|
}
|
|
350
359
|
|
|
351
|
-
body[`).concat(
|
|
352
|
-
`).concat(
|
|
360
|
+
body[`).concat(pr,`] {
|
|
361
|
+
`).concat(D_,": ").concat(a,`px;
|
|
353
362
|
}
|
|
354
|
-
`)},
|
|
363
|
+
`)},wv=function(){var e=parseInt(document.body.getAttribute(pr)||"0",10);return isFinite(e)?e:0},Q_=function(){A.useEffect(function(){return document.body.setAttribute(pr,(wv()+1).toString()),function(){var e=wv()-1;e<=0?document.body.removeAttribute(pr):document.body.setAttribute(pr,e.toString())}},[])},Z_=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;Q_();var o=A.useMemo(function(){return Y_(i)},[i]);return A.createElement(K_,{styles:G_(o,!t,i,n?"":"!important")})},Fu=!1;if(typeof window<"u")try{var Qo=Object.defineProperty({},"passive",{get:function(){return Fu=!0,!0}});window.addEventListener("test",Qo,Qo),window.removeEventListener("test",Qo,Qo)}catch{Fu=!1}var mr=Fu?{passive:!1}:!1,J_=function(e){return e.tagName==="TEXTAREA"},Sv=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!J_(e)&&n[t]==="visible")},X_=function(e){return Sv(e,"overflowY")},eP=function(e){return Sv(e,"overflowX")},xv=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=kv(e,r);if(i){var o=Ev(e,r),s=o[1],a=o[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},tP=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},nP=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},kv=function(e,t){return e==="v"?X_(t):eP(t)},Ev=function(e,t){return e==="v"?tP(t):nP(t)},rP=function(e,t){return e==="h"&&t==="rtl"?-1:1},iP=function(e,t,n,r,i){var o=rP(e,window.getComputedStyle(t).direction),s=o*r,a=n.target,l=t.contains(a),u=!1,f=s>0,c=0,h=0;do{if(!a)break;var d=Ev(e,a),m=d[0],p=d[1],g=d[2],y=p-g-o*m;(m||y)&&kv(e,a)&&(c+=y,h+=m);var v=a.parentNode;a=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(f&&Math.abs(c)<1||!f&&Math.abs(h)<1)&&(u=!0),u},Zo=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Cv=function(e){return[e.deltaX,e.deltaY]},Av=function(e){return e&&"current"in e?e.current:e},oP=function(e,t){return e[0]===t[0]&&e[1]===t[1]},sP=function(e){return`
|
|
355
364
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
356
365
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
357
|
-
`)},
|
|
366
|
+
`)},aP=0,gr=[];function lP(e){var t=A.useRef([]),n=A.useRef([0,0]),r=A.useRef(),i=A.useState(aP++)[0],o=A.useState(bv)[0],s=A.useRef(e);A.useEffect(function(){s.current=e},[e]),A.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var p=Ga([e.lockRef.current],(e.shards||[]).map(Av),!0).filter(Boolean);return p.forEach(function(g){return g.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),p.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=A.useCallback(function(p,g){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!s.current.allowPinchZoom;var y=Zo(p),v=n.current,w="deltaX"in p?p.deltaX:v[0]-y[0],E="deltaY"in p?p.deltaY:v[1]-y[1],S,C=p.target,I=Math.abs(w)>Math.abs(E)?"h":"v";if("touches"in p&&I==="h"&&C.type==="range")return!1;var M=xv(I,C);if(!M)return!0;if(M?S=I:(S=I==="v"?"h":"v",M=xv(I,C)),!M)return!1;if(!r.current&&"changedTouches"in p&&(w||E)&&(r.current=S),!S)return!0;var P=r.current||S;return iP(P,g,p,P==="h"?w:E)},[]),l=A.useCallback(function(p){var g=p;if(!(!gr.length||gr[gr.length-1]!==o)){var y="deltaY"in g?Cv(g):Zo(g),v=t.current.filter(function(S){return S.name===g.type&&(S.target===g.target||g.target===S.shadowParent)&&oP(S.delta,y)})[0];if(v&&v.should){g.cancelable&&g.preventDefault();return}if(!v){var w=(s.current.shards||[]).map(Av).filter(Boolean).filter(function(S){return S.contains(g.target)}),E=w.length>0?a(g,w[0]):!s.current.noIsolation;E&&g.cancelable&&g.preventDefault()}}},[]),u=A.useCallback(function(p,g,y,v){var w={name:p,delta:g,target:y,should:v,shadowParent:uP(y)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(E){return E!==w})},1)},[]),f=A.useCallback(function(p){n.current=Zo(p),r.current=void 0},[]),c=A.useCallback(function(p){u(p.type,Cv(p),p.target,a(p,e.lockRef.current))},[]),h=A.useCallback(function(p){u(p.type,Zo(p),p.target,a(p,e.lockRef.current))},[]);A.useEffect(function(){return gr.push(o),e.setCallbacks({onScrollCapture:c,onWheelCapture:c,onTouchMoveCapture:h}),document.addEventListener("wheel",l,mr),document.addEventListener("touchmove",l,mr),document.addEventListener("touchstart",f,mr),function(){gr=gr.filter(function(p){return p!==o}),document.removeEventListener("wheel",l,mr),document.removeEventListener("touchmove",l,mr),document.removeEventListener("touchstart",f,mr)}},[]);var d=e.removeScrollBar,m=e.inert;return A.createElement(A.Fragment,null,m?A.createElement(o,{styles:sP(i)}):null,d?A.createElement(Z_,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function uP(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const cP=$_(vv,lP);var Tv=A.forwardRef(function(e,t){return A.createElement(Go,xt({},e,{ref:t,sideCar:cP}))});Tv.classNames=Go.classNames;var fP=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},yr=new WeakMap,Jo=new WeakMap,Xo={},Ru=0,Iv=function(e){return e&&(e.host||Iv(e.parentNode))},dP=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Iv(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},hP=function(e,t,n,r){var i=dP(t,Array.isArray(e)?e:[e]);Xo[n]||(Xo[n]=new WeakMap);var o=Xo[n],s=[],a=new Set,l=new Set(i),u=function(c){!c||a.has(c)||(a.add(c),u(c.parentNode))};i.forEach(u);var f=function(c){!c||l.has(c)||Array.prototype.forEach.call(c.children,function(h){if(a.has(h))f(h);else try{var d=h.getAttribute(r),m=d!==null&&d!=="false",p=(yr.get(h)||0)+1,g=(o.get(h)||0)+1;yr.set(h,p),o.set(h,g),s.push(h),p===1&&m&&Jo.set(h,!0),g===1&&h.setAttribute(n,"true"),m||h.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",h,y)}})};return f(t),a.clear(),Ru++,function(){s.forEach(function(c){var h=yr.get(c)-1,d=o.get(c)-1;yr.set(c,h),o.set(c,d),h||(Jo.has(c)||c.removeAttribute(r),Jo.delete(c)),d||c.removeAttribute(n)}),Ru--,Ru||(yr=new WeakMap,yr=new WeakMap,Jo=new WeakMap,Xo={})}},pP=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=fP(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),hP(r,i,n,"aria-hidden")):function(){return null}},es="Dialog",[Ov]=vy(es),[mP,Wt]=Ov(es),Mv=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!0}=e,a=A.useRef(null),l=A.useRef(null),[u,f]=by({prop:r,defaultProp:i??!1,onChange:o,caller:es});return k.jsx(mP,{scope:t,triggerRef:a,contentRef:l,contentId:Uo(),titleId:Uo(),descriptionId:Uo(),open:u,onOpenChange:f,onOpenToggle:A.useCallback(()=>f(c=>!c),[f]),modal:s,children:n})};Mv.displayName=es;var Dv="DialogTrigger",Nv=A.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt(Dv,n),o=tn(t,i.triggerRef);return k.jsx(Ft.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Bu(i.open),...r,ref:o,onClick:Zt(e.onClick,i.onOpenToggle)})});Nv.displayName=Dv;var gP="DialogPortal",[RL,_v]=Ov(gP,{forceMount:void 0}),ts="DialogOverlay",yP=A.forwardRef((e,t)=>{const n=_v(ts,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Wt(ts,e.__scopeDialog);return o.modal?k.jsx(Bo,{present:r||o.open,children:k.jsx(bP,{...i,ref:t})}):null});yP.displayName=ts;var vP=wy("DialogOverlay.RemoveScroll"),bP=A.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt(ts,n);return k.jsx(Tv,{as:vP,allowPinchZoom:!0,shards:[i.contentRef],children:k.jsx(Ft.div,{"data-state":Bu(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Pn="DialogContent",Pv=A.forwardRef((e,t)=>{const n=_v(Pn,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Wt(Pn,e.__scopeDialog);return k.jsx(Bo,{present:r||o.open,children:o.modal?k.jsx(wP,{...i,ref:t}):k.jsx(SP,{...i,ref:t})})});Pv.displayName=Pn;var wP=A.forwardRef((e,t)=>{const n=Wt(Pn,e.__scopeDialog),r=A.useRef(null),i=tn(t,n.contentRef,r);return A.useEffect(()=>{const o=r.current;if(o)return pP(o)},[]),k.jsx(Lv,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Zt(e.onCloseAutoFocus,o=>{var s;o.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:Zt(e.onPointerDownOutside,o=>{const s=o.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&o.preventDefault()}),onFocusOutside:Zt(e.onFocusOutside,o=>o.preventDefault())})}),SP=A.forwardRef((e,t)=>{const n=Wt(Pn,e.__scopeDialog),r=A.useRef(!1),i=A.useRef(!1);return k.jsx(Lv,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,o),o.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=o.target;((u=n.triggerRef.current)==null?void 0:u.contains(s))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),Lv=A.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...s}=e,a=Wt(Pn,n),l=A.useRef(null),u=tn(t,l);return O_(),k.jsxs(k.Fragment,{children:[k.jsx(cv,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:k.jsx(sv,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Bu(a.open),...s,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),k.jsxs(k.Fragment,{children:[k.jsx(xP,{titleId:a.titleId}),k.jsx(EP,{contentRef:l,descriptionId:a.descriptionId})]})]})}),$u="DialogTitle",Fv=A.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt($u,n);return k.jsx(Ft.h2,{id:i.titleId,...r,ref:t})});Fv.displayName=$u;var Rv="DialogDescription",$v=A.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt(Rv,n);return k.jsx(Ft.p,{id:i.descriptionId,...r,ref:t})});$v.displayName=Rv;var Bv="DialogClose",zv=A.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt(Bv,n);return k.jsx(Ft.button,{type:"button",...r,ref:t,onClick:Zt(e.onClick,()=>i.onOpenChange(!1))})});zv.displayName=Bv;function Bu(e){return e?"open":"closed"}var Uv="DialogTitleWarning",[$L,jv]=JN(Uv,{contentName:Pn,titleName:$u,docsSlug:"dialog"}),xP=({titleId:e})=>{const t=jv(Uv),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
358
367
|
|
|
359
368
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
360
369
|
|
|
361
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return
|
|
370
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return A.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},kP="DialogDescriptionWarning",EP=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${jv(kP).contentName}}.`;return A.useEffect(()=>{var o;const i=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},CP=Mv,AP=Nv,TP=Pv,IP=Fv,OP=$v,MP=zv;function vr({open:e,onOpenChange:t,children:n}){const{modal:r}=me;return k.jsxs(CP,{open:e,modal:!1,onOpenChange:t,children:[e&&k.jsx("div",{...r==null?void 0:r.overlay}),n]})}function DP({title:e,description:t,onConfirm:n,onCancel:r,confirmButtonText:i,cancelButtonText:o,children:s}){const{modal:a}=me;return k.jsx(k.Fragment,{children:k.jsxs(TP,{...a.dialog.container,children:[k.jsx(IP,{...a.dialog.title,children:e}),k.jsx(OP,{...a.dialog.description,children:t}),k.jsx("div",{...a.dialog.content.container,children:s}),k.jsxs("div",{...a.dialog.button.container,children:[i&&k.jsx("button",{...a.dialog.button.confirm,type:"button",onClick:n,children:i}),o&&k.jsx("button",{...a.dialog.button.cancel,type:"button",onClick:r,children:o})]})]})})}vr.Button=AP,vr.Close=MP,vr.Content=DP;const Hv=D.forwardRef(({children:e,onClick:t,avatarUrl:n,botName:r,description:i,onClose:o,...s},a)=>{const{messagePreview:l}=me,{container:u,closeButton:f,message:c,avatar:h,description:d}=l??{};return k.jsxs("div",{...s,...u,ref:a,onClick:t,children:[k.jsx(En,{src:n,...h,children:r||"Bot"}),k.jsx("p",{...c,children:e}),k.jsx("p",{...d,children:i}),k.jsx(hp,{...f,onClick:m=>{m.stopPropagation(),o==null||o()}})]})});Hv.displayName="MessagePreview",re.Avatar=En,re.BOT_IS_BLOCKED=Vf,re.Block=Dn,re.CONFIG_ACCESS_DENIED=Qw,re.Chat=rv,re.Composer=ng,re.Container=eu,re.ConversationHistory=Iu,re.ErrorState=Dy,re.Fab=yy,re.Header=Cy,re.INVALID_API_URL=Uf,re.INVALID_BOTPRESS_URL=Hf,re.INVALID_CLIENT_ID=jf,re.INVALID_CONFIGURATION=Gw,re.INVALID_CONFIG_URL=Kw,re.INVALID_MESSAGE_CONTENT_TYPE=Yf,re.MISSING_API_URL=Ww,re.MISSING_BOT_ID=qw,re.MISSING_CLIENT_ID=zf,re.MISSING_CONFIG_URL=Yw,re.Message=au,re.MessageContext=qa,re.MessageList=fu,re.MessagePreview=Hv,re.Modal=vr,re.ModalContext=Ya,re.ModalProvider=Lg,re.NETWORK_ERROR=Li,re.NOT_A_PARTICIPANT=$s,re.QUOTA_EXCEEDED=Wf,re.RestartConversationButton=iu,re.SOUND_EFFECTS=Ry,re.SSE_DISCONNECTED_ERROR=qf,re.StylesheetProvider=Fg,re.TypingIndicator=su,re.Webchat=h_,re.WebchatProvider=gy,re._setDebugEnabled=KN,re._setTrackFn=GN,re.commonApiErrorMap=zs,re.enrichMessage=nc,re.fileTypes=$f,re.generateThemeOverride=Rf,re.generateThemeStylesheet=Ff,re.getUseChatSoundStore=Ip,re.getUseWebchatClientStore=Cp,re.integrationMessagePayloadToBlockPayload=$g,re.integrationMessageToBlockMessage=ui,re.isCommonApiErrorType=Gf,re.isEventError=Zf,re.isFileType=Bf,re.isIntegrationError=Qf,re.isWebhookHandlerErrorType=Kf,re.mapToWebchatError=_r,re.renderers=Ym,re.retryWithBackoff=Jf,re.useActiveConversation=zy,re.useConversationList=nv,re.useConversations=Uy,re.useMessageContext=Op,re.useModalContext=Ka,re.useUser=By,re.useWebchat=_2,re.useWebchatContext=$o,re.useWebchatStore=Qn,re.webchatClasses=me,re.webhookHandlerErrorMap=Bs,Object.defineProperty(re,Symbol.toStringTag,{value:"Module"})});
|