chainlit 1.0.501__py3-none-any.whl → 1.0.503__py3-none-any.whl
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.
Potentially problematic release.
This version of chainlit might be problematic. Click here for more details.
- chainlit/cli/__init__.py +1 -1
- chainlit/copilot/dist/index.js +1 -1
- chainlit/data/__init__.py +16 -4
- chainlit/data/sql_alchemy.py +494 -0
- chainlit/data/storage_clients.py +58 -0
- chainlit/emitter.py +4 -0
- chainlit/frontend/dist/assets/{index-e306c2e5.js → index-a8e1b559.js} +2 -2
- chainlit/frontend/dist/assets/{react-plotly-cc656f1c.js → react-plotly-b225b63c.js} +1 -1
- chainlit/frontend/dist/index.html +1 -1
- chainlit/socket.py +3 -0
- chainlit/types.py +53 -1
- {chainlit-1.0.501.dist-info → chainlit-1.0.503.dist-info}/METADATA +2 -2
- {chainlit-1.0.501.dist-info → chainlit-1.0.503.dist-info}/RECORD +15 -13
- {chainlit-1.0.501.dist-info → chainlit-1.0.503.dist-info}/WHEEL +0 -0
- {chainlit-1.0.501.dist-info → chainlit-1.0.503.dist-info}/entry_points.txt +0 -0
|
@@ -73,7 +73,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
73
73
|
*
|
|
74
74
|
* This source code is licensed under the MIT license found in the
|
|
75
75
|
* LICENSE file in the root directory of this source tree.
|
|
76
|
-
*/var Oh=A;function BNe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var UNe=typeof Object.is=="function"?Object.is:BNe,$Ne=Oh.useState,zNe=Oh.useEffect,HNe=Oh.useLayoutEffect,GNe=Oh.useDebugValue;function VNe(e,t){var n=t(),r=$Ne({inst:{value:n,getSnapshot:t}}),i=r[0].inst,a=r[1];return HNe(function(){i.value=n,i.getSnapshot=t,jO(i)&&a({inst:i})},[e,n,t]),zNe(function(){return jO(i)&&a({inst:i}),e(function(){jO(i)&&a({inst:i})})},[e]),GNe(n),n}function jO(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!UNe(e,n)}catch{return!0}}function YNe(e,t){return t()}var qNe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?YNe:VNe;Pre.useSyncExternalStore=Oh.useSyncExternalStore!==void 0?Oh.useSyncExternalStore:qNe;kre.exports=Pre;var WNe=kre.exports;const bd=()=>{},ao=bd(),QO=Object,Xn=e=>e===ao,cc=e=>typeof e=="function",Hd=(e,t)=>({...e,...t}),KNe=e=>cc(e.then),$b=new WeakMap;let jNe=0;const xE=e=>{const t=typeof e,n=e&&e.constructor,r=n==Date;let i,a;if(QO(e)===e&&!r&&n!=RegExp){if(i=$b.get(e),i)return i;if(i=++jNe+"~",$b.set(e,i),n==Array){for(i="@",a=0;a<e.length;a++)i+=xE(e[a])+",";$b.set(e,i)}if(n==QO){i="#";const o=QO.keys(e).sort();for(;!Xn(a=o.pop());)Xn(e[a])||(i+=a+":"+xE(e[a])+",");$b.set(e,i)}}else i=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return i},ic=new WeakMap,XO={},zb={},bk="undefined",Y2=typeof window!=bk,W5=typeof document!=bk,QNe=()=>Y2&&typeof window.requestAnimationFrame!=bk,Fre=(e,t)=>{const n=ic.get(e);return[()=>!Xn(t)&&e.get(t)||XO,r=>{if(!Xn(t)){const i=e.get(t);t in zb||(zb[t]=i),n[5](t,Hd(i,r),i||XO)}},n[6],()=>!Xn(t)&&t in zb?zb[t]:!Xn(t)&&e.get(t)||XO]};let K5=!0;const XNe=()=>K5,[j5,Q5]=Y2&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[bd,bd],ZNe=()=>{const e=W5&&document.visibilityState;return Xn(e)||e!=="hidden"},JNe=e=>(W5&&document.addEventListener("visibilitychange",e),j5("focus",e),()=>{W5&&document.removeEventListener("visibilitychange",e),Q5("focus",e)}),eIe=e=>{const t=()=>{K5=!0,e()},n=()=>{K5=!1};return j5("online",t),j5("offline",n),()=>{Q5("online",t),Q5("offline",n)}},tIe={isOnline:XNe,isVisible:ZNe},nIe={initFocus:JNe,initReconnect:eIe},F$=!Ye.useId,OE=!Y2||"Deno"in window,rIe=e=>QNe()?window.requestAnimationFrame(e):setTimeout(e,1),ZO=OE?A.useEffect:A.useLayoutEffect,JO=typeof navigator<"u"&&navigator.connection,B$=!OE&&JO&&(["slow-2g","2g"].includes(JO.effectiveType)||JO.saveData),yk=e=>{if(cc(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?xE(e):"",[e,t]};let iIe=0;const X5=()=>++iIe,Bre=0,Ure=1,$re=2,aIe=3;var D_={__proto__:null,ERROR_REVALIDATE_EVENT:aIe,FOCUS_EVENT:Bre,MUTATE_EVENT:$re,RECONNECT_EVENT:Ure};async function zre(...e){const[t,n,r,i]=e,a=Hd({populateCache:!0,throwOnError:!0},typeof i=="boolean"?{revalidate:i}:i||{});let o=a.populateCache;const s=a.rollbackOnError;let l=a.optimisticData;const u=a.revalidate!==!1,c=m=>typeof s=="function"?s(m):s!==!1,d=a.throwOnError;if(cc(n)){const m=n,h=[],_=t.keys();for(const b of _)!/^\$(inf|sub)\$/.test(b)&&m(t.get(b)._k)&&h.push(b);return Promise.all(h.map(f))}return f(n);async function f(m){const[h]=yk(m);if(!h)return;const[_,b]=Fre(t,h),[S,y,T,C]=ic.get(t),O=()=>{const Y=S[h];return u&&(delete T[h],delete C[h],Y&&Y[0])?Y[0]($re).then(()=>_().data):_().data};if(e.length<3)return O();let N=r,w;const B=X5();y[h]=[B,0];const z=!Xn(l),M=_(),$=M.data,U=M._c,H=Xn(U)?$:U;if(z&&(l=cc(l)?l(H,$):l,b({data:l,_c:H})),cc(N))try{N=N(H)}catch(Y){w=Y}if(N&&KNe(N))if(N=await N.catch(Y=>{w=Y}),B!==y[h][0]){if(w)throw w;return N}else w&&z&&c(w)&&(o=!0,b({data:H,_c:ao}));if(o&&!w)if(cc(o)){const Y=o(N,H);b({data:Y,error:ao,_c:ao})}else b({data:N,error:ao,_c:ao});if(y[h][1]=X5(),Promise.resolve(O()).then(()=>{b({_c:ao})}),w){if(d)throw w;return}return N}}const U$=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},oIe=(e,t)=>{if(!ic.has(e)){const n=Hd(nIe,t),r={},i=zre.bind(ao,e);let a=bd;const o={},s=(c,d)=>{const f=o[c]||[];return o[c]=f,f.push(d),()=>f.splice(f.indexOf(d),1)},l=(c,d,f)=>{e.set(c,d);const m=o[c];if(m)for(const h of m)h(d,f)},u=()=>{if(!ic.has(e)&&(ic.set(e,[r,{},{},{},i,l,s]),!OE)){const c=n.initFocus(setTimeout.bind(ao,U$.bind(ao,r,Bre))),d=n.initReconnect(setTimeout.bind(ao,U$.bind(ao,r,Ure)));a=()=>{c&&c(),d&&d(),ic.delete(e)}}};return u(),[e,i,u,a]}return[e,ic.get(e)[4]]},sIe=(e,t,n,r,i)=>{const a=n.errorRetryCount,o=i.retryCount,s=~~((Math.random()+.5)*(1<<(o<8?o:8)))*n.errorRetryInterval;!Xn(a)&&o>a||setTimeout(r,s,i)},lIe=(e,t)=>xE(e)==xE(t),[Hre,uIe]=oIe(new Map),cIe=Hd({onLoadingSlow:bd,onSuccess:bd,onError:bd,onErrorRetry:sIe,onDiscarded:bd,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:B$?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:B$?5e3:3e3,compare:lIe,isPaused:()=>!1,cache:Hre,mutate:uIe,fallback:{}},tIe),dIe=(e,t)=>{const n=Hd(e,t);if(t){const{use:r,fallback:i}=e,{use:a,fallback:o}=t;r&&a&&(n.use=r.concat(a)),i&&o&&(n.fallback=Hd(i,o))}return n},fIe=A.createContext({}),pIe="$inf$",Gre=Y2&&window.__SWR_DEVTOOLS_USE__,mIe=Gre?window.__SWR_DEVTOOLS_USE__:[],hIe=()=>{Gre&&(window.__SWR_DEVTOOLS_REACT__=Ye)},gIe=e=>cc(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],_Ie=()=>Hd(cIe,A.useContext(fIe)),EIe=e=>(t,n,r)=>e(t,n&&((...a)=>{const[o]=yk(t),[,,,s]=ic.get(Hre);if(o.startsWith(pIe))return n(...a);const l=s[o];return Xn(l)?n(...a):(delete s[o],l)}),r),vIe=mIe.concat(EIe),SIe=e=>function(...n){const r=_Ie(),[i,a,o]=gIe(n),s=dIe(r,o);let l=e;const{use:u}=s,c=(u||[]).concat(vIe);for(let d=c.length;d--;)l=c[d](l);return l(i,a||s.fetcher||null,s)},bIe=(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())}};hIe();const $$=Ye.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e)}),eN={dedupe:!0},yIe=(e,t,n)=>{const{cache:r,compare:i,suspense:a,fallbackData:o,revalidateOnMount:s,revalidateIfStale:l,refreshInterval:u,refreshWhenHidden:c,refreshWhenOffline:d,keepPreviousData:f}=n,[m,h,_,b]=ic.get(r),[S,y]=yk(e),T=A.useRef(!1),C=A.useRef(!1),O=A.useRef(S),N=A.useRef(t),w=A.useRef(n),B=()=>w.current,z=()=>B().isVisible()&&B().isOnline(),[M,$,U,H]=Fre(r,S),Y=A.useRef({}).current,re=Xn(o)?n.fallback[S]:o,ce=(ze,Le)=>{for(const Ve in Y){const Ue=Ve;if(Ue==="data"){if(!i(ze[Ue],Le[Ue])&&(!Xn(ze[Ue])||!i(ye,Le[Ue])))return!1}else if(Le[Ue]!==ze[Ue])return!1}return!0},Z=A.useMemo(()=>{const ze=(()=>!S||!t?!1:Xn(s)?B().isPaused()||a?!1:Xn(l)?!0:l:s)(),Le=Xe=>{const ct=Hd(Xe);return delete ct._k,ze?{isValidating:!0,isLoading:!0,...ct}:ct},Ve=M(),Ue=H(),ft=Le(Ve),dt=Ve===Ue?ft:Le(Ue);let rt=ft;return[()=>{const Xe=Le(M());return ce(Xe,rt)?(rt.data=Xe.data,rt.isLoading=Xe.isLoading,rt.isValidating=Xe.isValidating,rt.error=Xe.error,rt):(rt=Xe,Xe)},()=>dt]},[r,S]),j=WNe.useSyncExternalStore(A.useCallback(ze=>U(S,(Le,Ve)=>{ce(Ve,Le)||ze()}),[r,S]),Z[0],Z[1]),W=!T.current,k=m[S]&&m[S].length>0,se=j.data,ne=Xn(se)?re:se,G=j.error,Ee=A.useRef(ne),ye=f?Xn(se)?Ee.current:se:ne,ge=(()=>k&&!Xn(G)?!1:W&&!Xn(s)?s:B().isPaused()?!1:a?Xn(ne)?!1:l:Xn(ne)||l)(),De=!!(S&&t&&W&&ge),we=Xn(j.isValidating)?De:j.isValidating,Be=Xn(j.isLoading)?De:j.isLoading,Qe=A.useCallback(async ze=>{const Le=N.current;if(!S||!Le||C.current||B().isPaused())return!1;let Ve,Ue,ft=!0;const dt=ze||{},rt=!_[S]||!dt.dedupe,Xe=()=>F$?!C.current&&S===O.current&&T.current:S===O.current,ct={isValidating:!1,isLoading:!1},lt=()=>{$(ct)},fe=()=>{const Se=_[S];Se&&Se[1]===Ue&&delete _[S]},Ke={isValidating:!0};Xn(M().data)&&(Ke.isLoading=!0);try{if(rt&&($(Ke),n.loadingTimeout&&Xn(M().data)&&setTimeout(()=>{ft&&Xe()&&B().onLoadingSlow(S,n)},n.loadingTimeout),_[S]=[Le(y),X5()]),[Ve,Ue]=_[S],Ve=await Ve,rt&&setTimeout(fe,n.dedupingInterval),!_[S]||_[S][1]!==Ue)return rt&&Xe()&&B().onDiscarded(S),!1;ct.error=ao;const Se=h[S];if(!Xn(Se)&&(Ue<=Se[0]||Ue<=Se[1]||Se[1]===0))return lt(),rt&&Xe()&&B().onDiscarded(S),!1;const Q=M().data;ct.data=i(Q,Ve)?Q:Ve,rt&&Xe()&&B().onSuccess(Ve,S,n)}catch(Se){fe();const Q=B(),{shouldRetryOnError:he}=Q;Q.isPaused()||(ct.error=Se,rt&&Xe()&&(Q.onError(Se,S,Q),(he===!0||cc(he)&&he(Se))&&z()&&Q.onErrorRetry(Se,S,Q,ae=>{const _e=m[S];_e&&_e[0]&&_e[0](D_.ERROR_REVALIDATE_EVENT,ae)},{retryCount:(dt.retryCount||0)+1,dedupe:!0})))}return ft=!1,lt(),!0},[S,r]),Ze=A.useCallback((...ze)=>zre(r,O.current,...ze),[]);if(ZO(()=>{N.current=t,w.current=n,Xn(se)||(Ee.current=se)}),ZO(()=>{if(!S)return;const ze=Qe.bind(ao,eN);let Le=0;const Ue=bIe(S,m,(ft,dt={})=>{if(ft==D_.FOCUS_EVENT){const rt=Date.now();B().revalidateOnFocus&&rt>Le&&z()&&(Le=rt+B().focusThrottleInterval,ze())}else if(ft==D_.RECONNECT_EVENT)B().revalidateOnReconnect&&z()&&ze();else{if(ft==D_.MUTATE_EVENT)return Qe();if(ft==D_.ERROR_REVALIDATE_EVENT)return Qe(dt)}});return C.current=!1,O.current=S,T.current=!0,$({_k:y}),ge&&(Xn(ne)||OE?ze():rIe(ze)),()=>{C.current=!0,Ue()}},[S]),ZO(()=>{let ze;function Le(){const Ue=cc(u)?u(M().data):u;Ue&&ze!==-1&&(ze=setTimeout(Ve,Ue))}function Ve(){!M().error&&(c||B().isVisible())&&(d||B().isOnline())?Qe(eN).then(Le):Le()}return Le(),()=>{ze&&(clearTimeout(ze),ze=-1)}},[u,c,d,S]),A.useDebugValue(ye),a&&Xn(ne)&&S){if(!F$&&OE)throw new Error("Fallback data is required when using suspense in SSR.");N.current=t,w.current=n,C.current=!1;const ze=b[S];if(!Xn(ze)){const Le=Ze(ze);$$(Le)}if(Xn(G)){const Le=Qe(eN);Xn(ye)||(Le.status="fulfilled",Le.value=!0),$$(Le)}else throw G}return{mutate:Ze,get data(){return Y.data=!0,ye},get error(){return Y.error=!0,G},get isValidating(){return Y.isValidating=!0,we},get isLoading(){return Y.isLoading=!0,Be}}},TIe=SIe(yIe);var CIe=e=>{let t={},n=new Date,r=new Date;r.setDate(n.getDate()-1);let i=new Date;i.setDate(n.getDate()-7);let a=new Date;return a.setDate(n.getDate()-30),e.forEach(o=>{let s=new Date(o.createdAt),l=s.toDateString()===n.toDateString(),u=s.toDateString()===r.toDateString(),c=s>=i,d=s>=a,f;l?f="Today":u?f="Yesterday":c?f="Previous 7 days":d?f="Previous 30 days":f=s.toLocaleString("default",{month:"long",year:"numeric"}).split(" ").slice(0,1).join(" "),t[f]||(t[f]=[]),t[f].push(o)}),t},Vre=jn({key:"ThreadIdToResume",default:void 0}),RIe=jn({key:"ChatProfile",default:void 0}),z$=jn({key:"SessionId",default:Sre()}),Z5=vre({key:"SessionIdSelector",get:({get:e})=>e(z$),set:({set:e},t)=>e(z$,t instanceof zOe?Sre():t)}),Tk=jn({key:"Session",dangerouslyAllowMutability:!0,default:void 0}),Ck=jn({key:"Actions",default:[]}),q2=jn({key:"Messages",dangerouslyAllowMutability:!0,default:[]}),Yre=jn({key:"TokenCount",default:0}),Rk=jn({key:"Loading",default:!1}),Ak=jn({key:"AskUser",default:void 0}),AIe=jn({key:"CallFn",default:void 0}),W2=jn({key:"ChatSettings",default:[]}),qre=vre({key:"ChatSettingsValue/Default",get:({get:e})=>e(W2).reduce((t,n)=>(t[n.id]=n.initial,t),{})}),xk=jn({key:"ChatSettingsValue",default:qre}),Ok=jn({key:"DisplayElements",default:[]}),Nk=jn({key:"AvatarElements",default:[]}),Ik=jn({key:"TasklistElements",default:[]}),K2=jn({key:"FirstUserInteraction",default:void 0}),lf=jn({key:"AccessToken",default:void 0}),xIe=jn({key:"User",default:null}),j2=jn({key:"ThreadHistory",default:{threads:void 0,currentThreadId:void 0,timeGroupedThreads:void 0,pageInfo:void 0},effects:[({setSelf:e,onSet:t})=>{t((n,r)=>{let i=n==null?void 0:n.timeGroupedThreads;n!=null&&n.threads&&!og.isEqual(n.threads,r==null?void 0:r.timeGroupedThreads)&&(i=CIe(n.threads)),e({...n,timeGroupedThreads:i})})}]}),Q2=jn({key:"SideView",default:void 0}),om=()=>{let e=Ht(Rk),t=Ht(Ok),n=Ht(Nk),r=Ht(Ik),i=Ht(Ck),a=Ht(Tk),o=Ht(Ak),s=Ht(W2),l=Ht(xk),u=Ht(qre),c=(a==null?void 0:a.socket.connected)&&!(a!=null&&a.error),d=!c||e||(o==null?void 0:o.spec.type)==="file"||(o==null?void 0:o.spec.type)==="action";return{actions:i,askUser:o,avatars:n,chatSettingsDefaultValue:u,chatSettingsInputs:s,chatSettingsValue:l,connected:c,disabled:d,elements:t,error:a==null?void 0:a.error,loading:e,tasklists:r}},OIe=e=>{let t=[];for(let n of e)t=Rp(t,n);return t},Rp=(e,t)=>Sv(e,t.id)?NE(e,t.id,t):"parentId"in t&&t.parentId?Kre(e,t.parentId,t):"indent"in t&&t.indent&&t.indent>0?Wre(e,t.indent,t):[...e,t],Wre=(e,t,n,r=0)=>{let i=[...e];if(i.length===0)return[...i,n];{let a=i.length-1,o=i[a];return o.steps=o.steps||[],r+1===t?(o.steps=[...o.steps,n],i[a]={...o},i):(o.steps=Wre(o.steps,t,n,r+1),i[a]={...o},i)}},Kre=(e,t,n)=>{let r=[...e];for(let i=0;i<r.length;i++){let a=r[i];og.isEqual(a.id,t)?(a.steps=a.steps?[...a.steps,n]:[n],r[i]={...a}):Sv(r,t)&&a.steps&&(a.steps=Kre(a.steps,t,n),r[i]={...a})}return r},Sv=(e,t)=>{for(let n of e)if(og.isEqual(n.id,t)||n.steps&&n.steps.length>0&&Sv(n.steps,t))return!0;return!1},NE=(e,t,n)=>{let r=[...e];for(let i=0;i<r.length;i++){let a=r[i];og.isEqual(a.id,t)?r[i]={steps:a.steps,...n}:Sv(r,t)&&a.steps&&(a.steps=NE(a.steps,t,n),r[i]={...a})}return r},jre=(e,t)=>{let n=[...e];for(let r=0;r<n.length;r++){let i=n[r];i.id===t?n=[...n.slice(0,r),...n.slice(r+1)]:Sv(n,t)&&i.steps&&(i.steps=jre(i.steps,t),n[r]={...i})}return n},Qre=(e,t,n,r)=>{let i=[...e];for(let a=0;a<i.length;a++){let o=i[a];og.isEqual(o.id,t)?("content"in o&&o.content!==void 0?r?o.content=n:o.content+=n:"output"in o&&o.output!==void 0&&(r?o.output=n:o.output+=n),i[a]={...o}):o.steps&&(o.steps=Qre(o.steps,t,n,r),i[a]={...o})}return i},hu=()=>{let e=Ht(lf),t=Ht(Tk),n=Ht(Ak),r=Ht(Z5),i=lT(W2),a=lT(Z5),o=lT(xk),s=Gn(K2),l=Gn(Rk),u=Gn(q2),c=Gn(Ok),d=Gn(Nk),f=Gn(Ik),m=Gn(Ck),h=Gn(Yre),_=Gn(Vre),b=Gn(Q2),S=A.useCallback(()=>{t==null||t.socket.emit("clear_session"),t==null||t.socket.disconnect(),_(void 0),a(),s(void 0),u([]),c([]),d([]),f([]),m([]),h(0),i(),o(),b(void 0)},[t]),y=A.useCallback((w,B)=>{u(z=>Rp(z,w)),t==null||t.socket.emit("ui_message",{message:w,fileReferences:B})},[t==null?void 0:t.socket]),T=A.useCallback(w=>{n&&(u(B=>Rp(B,w)),n.callback(w))},[n]),C=A.useCallback(w=>{t==null||t.socket.emit("chat_settings_change",w)},[t==null?void 0:t.socket]),O=A.useCallback(()=>{l(!1),t==null||t.socket.emit("stop")},[t==null?void 0:t.socket]),N=A.useCallback(w=>{let B=t==null?void 0:t.socket;if(!B)return;let z=new Promise((M,$)=>{B.once("action_response",U=>{U.status?M(U):$(U)})});return B.emit("action_call",w),z},[t==null?void 0:t.socket]);return{uploadFile:A.useCallback((w,B,z)=>w.uploadFile(B,z,r,e),[r,e]),callAction:N,clear:S,replyMessage:T,sendMessage:y,stopTask:O,setIdToResume:_,updateChatSettings:C}},Xre=()=>{let e=Ht(q2),t=Ht(K2);return{messages:e,firstInteraction:t}},lg=()=>{let e=Ht(Z5),[t,n]=mi(Tk),r=lT(xk),i=Gn(K2),a=Gn(Rk),o=Gn(q2),s=Gn(Ak),l=Gn(AIe),u=Gn(Ok),c=Gn(Nk),d=Gn(Ik),f=Gn(Ck),m=Gn(W2),h=Gn(Yre),[_,b]=mi(RIe),S=Ht(Vre),y=A.useCallback(({client:O,userEnv:N,accessToken:w})=>{let B=new URL(O.httpEndpoint).pathname,z=B.endsWith("/")?"ws/socket.io":"/ws/socket.io",M=fT(O.httpEndpoint,{path:`${B}${z}`,extraHeaders:{Authorization:w||"","X-Chainlit-Client-Type":O.type,"X-Chainlit-Session-Id":e,"X-Chainlit-Thread-Id":S||"","user-env":JSON.stringify(N),"X-Chainlit-Chat-Profile":_||""}});n($=>{var U,H;return(U=$==null?void 0:$.socket)==null||U.removeAllListeners(),(H=$==null?void 0:$.socket)==null||H.close(),{socket:M}}),M.on("connect",()=>{M.emit("connection_successful"),n($=>({...$,error:!1}))}),M.on("connect_error",$=>{n(U=>({...U,error:!0}))}),M.on("task_start",()=>{a(!0)}),M.on("task_end",()=>{a(!1)}),M.on("reload",()=>{M.emit("clear_session"),window.location.reload()}),M.on("resume_thread",$=>{var Y,re;let U=[];for(let ce of $.steps)U=Rp(U,ce);(Y=$.metadata)!=null&&Y.chat_profile&&b((re=$.metadata)==null?void 0:re.chat_profile),o(U);let H=$.elements||[];c(H.filter(ce=>ce.type==="avatar")),d(H.filter(ce=>ce.type==="tasklist")),u(H.filter(ce=>["avatar","tasklist"].indexOf(ce.type)===-1))}),M.on("new_message",$=>{o(U=>Rp(U,$))}),M.on("first_interaction",$=>{i($)}),M.on("update_message",$=>{o(U=>NE(U,$.id,$))}),M.on("delete_message",$=>{o(U=>jre(U,$.id))}),M.on("stream_start",$=>{o(U=>Rp(U,$))}),M.on("stream_token",({id:$,token:U,isSequence:H})=>{o(Y=>Qre(Y,$,U,H))}),M.on("ask",({msg:$,spec:U},H)=>{s({spec:U,callback:H}),o(Y=>Rp(Y,$)),a(!1)}),M.on("ask_timeout",()=>{s(void 0),a(!1)}),M.on("clear_ask",()=>{s(void 0)}),M.on("call_fn",({name:$,args:U},H)=>{let Y=new CustomEvent("chainlit-call-fn",{detail:{name:$,args:U,callback:H}});window.dispatchEvent(Y),l({name:$,args:U,callback:H})}),M.on("clear_call_fn",()=>{l(void 0)}),M.on("call_fn_timeout",()=>{l(void 0)}),M.on("chat_settings",$=>{m($),r()}),M.on("element",$=>{!$.url&&$.chainlitKey&&($.url=O.getElementUrl($.chainlitKey,e)),$.type==="avatar"?c(U=>{let H=U.findIndex(Y=>Y.id===$.id);return H===-1?[...U,$]:[...U.slice(0,H),$,...U.slice(H+1)]}):$.type==="tasklist"?d(U=>{let H=U.findIndex(Y=>Y.id===$.id);return H===-1?[...U,$]:[...U.slice(0,H),$,...U.slice(H+1)]}):u(U=>{let H=U.findIndex(Y=>Y.id===$.id);return H===-1?[...U,$]:[...U.slice(0,H),$,...U.slice(H+1)]})}),M.on("remove_element",$=>{u(U=>U.filter(H=>H.id!==$.id)),d(U=>U.filter(H=>H.id!==$.id)),c(U=>U.filter(H=>H.id!==$.id))}),M.on("action",$=>{f(U=>[...U,$])}),M.on("remove_action",$=>{f(U=>{let H=U.findIndex(Y=>Y.id===$.id);return H===-1?U:[...U.slice(0,H),...U.slice(H+1)]})}),M.on("token_usage",$=>{h(U=>U+$)})},[n,e,_]),T=A.useCallback(og.debounce(y,200),[y]),C=A.useCallback(()=>{t!=null&&t.socket&&(t.socket.removeAllListeners(),t.socket.close())},[t]);return{connect:T,disconnect:C,session:t,chatProfile:_,idToResume:S,setChatProfile:b}},wk="token";function H$(){try{return localStorage.getItem(wk)}catch{return}}function NIe(e){try{return localStorage.setItem(wk,e)}catch{return}}function Zre(){try{return localStorage.removeItem(wk)}catch{return}}var IIe=async(e,t,n)=>{var r;return(r=await e.get(t,n))==null?void 0:r.json()};function Gp(e,t,n){let r=Ht(lf);return TIe(t?[t,r]:null,([i,a])=>IIe(e,i,a),n)}var wIe=e=>{let{data:t,isLoading:n}=Gp(e,"/auth/config"),[r,i]=mi(lf),a=Gn(j2),[o,s]=mi(xIe),l=!!(!n&&t),u=async()=>{await e.logout(),s(null),Zre(),i(""),a(void 0)},c=f=>{if(!f){u();return}try{let{exp:m,...h}=FNe(f);NIe(f),i(`Bearer ${f}`),s(h)}catch(m){console.error("Invalid token, clearing token from local storage","error:",m),u()}};A.useEffect(()=>{if(!o&&H$()){c(H$());return}},[]);let d=!!r;return t&&!t.requireLogin?{data:t,user:null,isReady:l,isAuthenticated:!0,accessToken:"",logout:()=>{},setAccessToken:()=>{}}:{data:t,user:o,isAuthenticated:d,isReady:l,accessToken:r,logout:u,setAccessToken:c}},J5=class extends Error{constructor(e,t){super(e),this.detail=t}toString(){return this.detail?`${this.message}: ${this.detail}`:this.message}},DIe=class{constructor(e,t,n,r){this.httpEndpoint=e,this.type=t,this.on401=n,this.onError=r}buildEndpoint(e){return this.httpEndpoint.endsWith("/")?`${this.httpEndpoint.slice(0,-1)}${e}`:`${this.httpEndpoint}${e}`}checkToken(e){let t="Bearer ";return e.startsWith(t)?e:t+e}async fetch(e,t,n,r,i){try{let a={};n&&(a.Authorization=this.checkToken(n));let o;r instanceof FormData?o=r:(a["Content-Type"]="application/json",o=r?JSON.stringify(r):null);let s=await fetch(this.buildEndpoint(t),{method:e,headers:a,signal:i,body:o});if(!s.ok){let l=await s.json();throw s.status===401&&this.on401&&(Zre(),this.on401()),new J5(s.statusText,l.detail)}return s}catch(a){throw a instanceof J5&&this.onError&&this.onError(a),console.error(a),a}}async get(e,t){return await this.fetch("GET",e,t)}async post(e,t,n,r){return await this.fetch("POST",e,n,t,r)}async put(e,t,n){return await this.fetch("PUT",e,n,t)}async patch(e,t,n){return await this.fetch("PATCH",e,n,t)}async delete(e,t,n){return await this.fetch("DELETE",e,n,t)}},MIe=class extends DIe{async headerAuth(){return(await this.post("/auth/header",{})).json()}async passwordAuth(t){return(await this.post("/login",t)).json()}async logout(){return(await this.post("/logout",{})).json()}async getGeneration(t,n={},r,i,a){var l,u;let o={userEnv:n};t.type==="CHAT"?o.chatGeneration=t:o.completionGeneration=t;let s=(u=(l=await this.post("/generation",o,i,r.signal))==null?void 0:l.body)==null?void 0:u.getReader();return new ReadableStream({start(c){function d(){s.read().then(({done:f,value:m})=>{if(f){c.close(),a&&a(f,"");return}let h=new TextDecoder("utf-8").decode(m);a&&a(f,h),c.enqueue(m),d()}).catch(f=>{c.close(),a&&a(!0,""),console.error(f)})}d()}})}async setFeedback(t,n){return(await this.put("/feedback",{feedback:t},n)).json()}async deleteFeedback(t,n){return(await this.delete("/feedback",{feedbackId:t},n)).json()}async listThreads(t,n,r){return(await this.post("/project/threads",{pagination:t,filter:n},r)).json()}async deleteThread(t,n){return(await this.delete("/project/thread",{threadId:t},n)).json()}uploadFile(t,n,r,i){let a=new XMLHttpRequest,o=new Promise((s,l)=>{let u=new FormData;u.append("file",t),a.open("POST",this.buildEndpoint(`/project/file?session_id=${r}`),!0),i&&a.setRequestHeader("Authorization",this.checkToken(i)),a.upload.onprogress=function(c){if(c.lengthComputable){let d=c.loaded/c.total*100;n(d)}},a.onload=function(){if(a.status===200){let c=JSON.parse(a.responseText);s(c)}else l("Upload failed")},a.onerror=function(){l("Upload error")},a.send(u)});return{xhr:a,promise:o}}getElementUrl(t,n){let r=`?session_id=${n}`;return this.buildEndpoint(`/project/file/${t}${r}`)}getLogoEndpoint(t){return this.buildEndpoint(`/logo?theme=${t}`)}getOAuthEndpoint(t){return this.buildEndpoint(`/auth/oauth/${t}`)}};function LIe(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}LIe(`html[dir=ltr],[data-sonner-toaster][dir=ltr]{--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}html[dir=rtl],[data-sonner-toaster][dir=rtl]{--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999}[data-sonner-toaster][data-x-position=right]{right:max(var(--offset),env(safe-area-inset-right))}[data-sonner-toaster][data-x-position=left]{left:max(var(--offset),env(safe-area-inset-left))}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translate(-50%)}[data-sonner-toaster][data-y-position=top]{top:max(var(--offset),env(safe-area-inset-top))}[data-sonner-toaster][data-y-position=bottom]{bottom:max(var(--offset),env(safe-area-inset-bottom))}[data-sonner-toast]{--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;will-change:transform,opacity,height;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}[data-sonner-toast][data-y-position=top]{top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}[data-sonner-toast] [data-description]{font-weight:400;line-height:1.4;color:inherit}[data-sonner-toast] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast] [data-icon]>*{flex-shrink:0}[data-sonner-toast] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast] [data-button]:focus-visible{box-shadow:0 0 0 2px #0006}[data-sonner-toast] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toast][data-theme=dark] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;background:var(--gray1);color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;opacity:0;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]:focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}[data-sonner-toast] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast]:hover [data-close-button]{opacity:1}[data-sonner-toast]:focus [data-close-button]{opacity:1}[data-sonner-toast]:focus-within [data-close-button]{opacity:1}[data-sonner-toast]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]:before{content:"";position:absolute;left:0;right:0;height:100%}[data-sonner-toast][data-y-position=top][data-swiping=true]:before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]:before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]:before{content:"";position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast]:after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y: translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y: translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]:before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - 32px)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true] [data-sonner-toast][data-type=success],[data-rich-colors=true] [data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true] [data-sonner-toast][data-type=info],[data-rich-colors=true] [data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true] [data-sonner-toast][data-type=warning],[data-rich-colors=true] [data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true] [data-sonner-toast][data-type=error],[data-rich-colors=true] [data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
|
76
|
+
*/var Oh=A;function BNe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var UNe=typeof Object.is=="function"?Object.is:BNe,$Ne=Oh.useState,zNe=Oh.useEffect,HNe=Oh.useLayoutEffect,GNe=Oh.useDebugValue;function VNe(e,t){var n=t(),r=$Ne({inst:{value:n,getSnapshot:t}}),i=r[0].inst,a=r[1];return HNe(function(){i.value=n,i.getSnapshot=t,jO(i)&&a({inst:i})},[e,n,t]),zNe(function(){return jO(i)&&a({inst:i}),e(function(){jO(i)&&a({inst:i})})},[e]),GNe(n),n}function jO(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!UNe(e,n)}catch{return!0}}function YNe(e,t){return t()}var qNe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?YNe:VNe;Pre.useSyncExternalStore=Oh.useSyncExternalStore!==void 0?Oh.useSyncExternalStore:qNe;kre.exports=Pre;var WNe=kre.exports;const bd=()=>{},ao=bd(),QO=Object,Xn=e=>e===ao,cc=e=>typeof e=="function",Hd=(e,t)=>({...e,...t}),KNe=e=>cc(e.then),$b=new WeakMap;let jNe=0;const xE=e=>{const t=typeof e,n=e&&e.constructor,r=n==Date;let i,a;if(QO(e)===e&&!r&&n!=RegExp){if(i=$b.get(e),i)return i;if(i=++jNe+"~",$b.set(e,i),n==Array){for(i="@",a=0;a<e.length;a++)i+=xE(e[a])+",";$b.set(e,i)}if(n==QO){i="#";const o=QO.keys(e).sort();for(;!Xn(a=o.pop());)Xn(e[a])||(i+=a+":"+xE(e[a])+",");$b.set(e,i)}}else i=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return i},ic=new WeakMap,XO={},zb={},bk="undefined",Y2=typeof window!=bk,W5=typeof document!=bk,QNe=()=>Y2&&typeof window.requestAnimationFrame!=bk,Fre=(e,t)=>{const n=ic.get(e);return[()=>!Xn(t)&&e.get(t)||XO,r=>{if(!Xn(t)){const i=e.get(t);t in zb||(zb[t]=i),n[5](t,Hd(i,r),i||XO)}},n[6],()=>!Xn(t)&&t in zb?zb[t]:!Xn(t)&&e.get(t)||XO]};let K5=!0;const XNe=()=>K5,[j5,Q5]=Y2&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[bd,bd],ZNe=()=>{const e=W5&&document.visibilityState;return Xn(e)||e!=="hidden"},JNe=e=>(W5&&document.addEventListener("visibilitychange",e),j5("focus",e),()=>{W5&&document.removeEventListener("visibilitychange",e),Q5("focus",e)}),eIe=e=>{const t=()=>{K5=!0,e()},n=()=>{K5=!1};return j5("online",t),j5("offline",n),()=>{Q5("online",t),Q5("offline",n)}},tIe={isOnline:XNe,isVisible:ZNe},nIe={initFocus:JNe,initReconnect:eIe},F$=!Ye.useId,OE=!Y2||"Deno"in window,rIe=e=>QNe()?window.requestAnimationFrame(e):setTimeout(e,1),ZO=OE?A.useEffect:A.useLayoutEffect,JO=typeof navigator<"u"&&navigator.connection,B$=!OE&&JO&&(["slow-2g","2g"].includes(JO.effectiveType)||JO.saveData),yk=e=>{if(cc(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?xE(e):"",[e,t]};let iIe=0;const X5=()=>++iIe,Bre=0,Ure=1,$re=2,aIe=3;var D_={__proto__:null,ERROR_REVALIDATE_EVENT:aIe,FOCUS_EVENT:Bre,MUTATE_EVENT:$re,RECONNECT_EVENT:Ure};async function zre(...e){const[t,n,r,i]=e,a=Hd({populateCache:!0,throwOnError:!0},typeof i=="boolean"?{revalidate:i}:i||{});let o=a.populateCache;const s=a.rollbackOnError;let l=a.optimisticData;const u=a.revalidate!==!1,c=m=>typeof s=="function"?s(m):s!==!1,d=a.throwOnError;if(cc(n)){const m=n,h=[],_=t.keys();for(const b of _)!/^\$(inf|sub)\$/.test(b)&&m(t.get(b)._k)&&h.push(b);return Promise.all(h.map(f))}return f(n);async function f(m){const[h]=yk(m);if(!h)return;const[_,b]=Fre(t,h),[S,y,T,C]=ic.get(t),O=()=>{const Y=S[h];return u&&(delete T[h],delete C[h],Y&&Y[0])?Y[0]($re).then(()=>_().data):_().data};if(e.length<3)return O();let N=r,w;const B=X5();y[h]=[B,0];const z=!Xn(l),M=_(),$=M.data,U=M._c,H=Xn(U)?$:U;if(z&&(l=cc(l)?l(H,$):l,b({data:l,_c:H})),cc(N))try{N=N(H)}catch(Y){w=Y}if(N&&KNe(N))if(N=await N.catch(Y=>{w=Y}),B!==y[h][0]){if(w)throw w;return N}else w&&z&&c(w)&&(o=!0,b({data:H,_c:ao}));if(o&&!w)if(cc(o)){const Y=o(N,H);b({data:Y,error:ao,_c:ao})}else b({data:N,error:ao,_c:ao});if(y[h][1]=X5(),Promise.resolve(O()).then(()=>{b({_c:ao})}),w){if(d)throw w;return}return N}}const U$=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},oIe=(e,t)=>{if(!ic.has(e)){const n=Hd(nIe,t),r={},i=zre.bind(ao,e);let a=bd;const o={},s=(c,d)=>{const f=o[c]||[];return o[c]=f,f.push(d),()=>f.splice(f.indexOf(d),1)},l=(c,d,f)=>{e.set(c,d);const m=o[c];if(m)for(const h of m)h(d,f)},u=()=>{if(!ic.has(e)&&(ic.set(e,[r,{},{},{},i,l,s]),!OE)){const c=n.initFocus(setTimeout.bind(ao,U$.bind(ao,r,Bre))),d=n.initReconnect(setTimeout.bind(ao,U$.bind(ao,r,Ure)));a=()=>{c&&c(),d&&d(),ic.delete(e)}}};return u(),[e,i,u,a]}return[e,ic.get(e)[4]]},sIe=(e,t,n,r,i)=>{const a=n.errorRetryCount,o=i.retryCount,s=~~((Math.random()+.5)*(1<<(o<8?o:8)))*n.errorRetryInterval;!Xn(a)&&o>a||setTimeout(r,s,i)},lIe=(e,t)=>xE(e)==xE(t),[Hre,uIe]=oIe(new Map),cIe=Hd({onLoadingSlow:bd,onSuccess:bd,onError:bd,onErrorRetry:sIe,onDiscarded:bd,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:B$?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:B$?5e3:3e3,compare:lIe,isPaused:()=>!1,cache:Hre,mutate:uIe,fallback:{}},tIe),dIe=(e,t)=>{const n=Hd(e,t);if(t){const{use:r,fallback:i}=e,{use:a,fallback:o}=t;r&&a&&(n.use=r.concat(a)),i&&o&&(n.fallback=Hd(i,o))}return n},fIe=A.createContext({}),pIe="$inf$",Gre=Y2&&window.__SWR_DEVTOOLS_USE__,mIe=Gre?window.__SWR_DEVTOOLS_USE__:[],hIe=()=>{Gre&&(window.__SWR_DEVTOOLS_REACT__=Ye)},gIe=e=>cc(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],_Ie=()=>Hd(cIe,A.useContext(fIe)),EIe=e=>(t,n,r)=>e(t,n&&((...a)=>{const[o]=yk(t),[,,,s]=ic.get(Hre);if(o.startsWith(pIe))return n(...a);const l=s[o];return Xn(l)?n(...a):(delete s[o],l)}),r),vIe=mIe.concat(EIe),SIe=e=>function(...n){const r=_Ie(),[i,a,o]=gIe(n),s=dIe(r,o);let l=e;const{use:u}=s,c=(u||[]).concat(vIe);for(let d=c.length;d--;)l=c[d](l);return l(i,a||s.fetcher||null,s)},bIe=(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())}};hIe();const $$=Ye.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e)}),eN={dedupe:!0},yIe=(e,t,n)=>{const{cache:r,compare:i,suspense:a,fallbackData:o,revalidateOnMount:s,revalidateIfStale:l,refreshInterval:u,refreshWhenHidden:c,refreshWhenOffline:d,keepPreviousData:f}=n,[m,h,_,b]=ic.get(r),[S,y]=yk(e),T=A.useRef(!1),C=A.useRef(!1),O=A.useRef(S),N=A.useRef(t),w=A.useRef(n),B=()=>w.current,z=()=>B().isVisible()&&B().isOnline(),[M,$,U,H]=Fre(r,S),Y=A.useRef({}).current,re=Xn(o)?n.fallback[S]:o,ce=(ze,Le)=>{for(const Ve in Y){const Ue=Ve;if(Ue==="data"){if(!i(ze[Ue],Le[Ue])&&(!Xn(ze[Ue])||!i(ye,Le[Ue])))return!1}else if(Le[Ue]!==ze[Ue])return!1}return!0},Z=A.useMemo(()=>{const ze=(()=>!S||!t?!1:Xn(s)?B().isPaused()||a?!1:Xn(l)?!0:l:s)(),Le=Xe=>{const ct=Hd(Xe);return delete ct._k,ze?{isValidating:!0,isLoading:!0,...ct}:ct},Ve=M(),Ue=H(),ft=Le(Ve),dt=Ve===Ue?ft:Le(Ue);let rt=ft;return[()=>{const Xe=Le(M());return ce(Xe,rt)?(rt.data=Xe.data,rt.isLoading=Xe.isLoading,rt.isValidating=Xe.isValidating,rt.error=Xe.error,rt):(rt=Xe,Xe)},()=>dt]},[r,S]),j=WNe.useSyncExternalStore(A.useCallback(ze=>U(S,(Le,Ve)=>{ce(Ve,Le)||ze()}),[r,S]),Z[0],Z[1]),W=!T.current,k=m[S]&&m[S].length>0,se=j.data,ne=Xn(se)?re:se,G=j.error,Ee=A.useRef(ne),ye=f?Xn(se)?Ee.current:se:ne,ge=(()=>k&&!Xn(G)?!1:W&&!Xn(s)?s:B().isPaused()?!1:a?Xn(ne)?!1:l:Xn(ne)||l)(),De=!!(S&&t&&W&&ge),we=Xn(j.isValidating)?De:j.isValidating,Be=Xn(j.isLoading)?De:j.isLoading,Qe=A.useCallback(async ze=>{const Le=N.current;if(!S||!Le||C.current||B().isPaused())return!1;let Ve,Ue,ft=!0;const dt=ze||{},rt=!_[S]||!dt.dedupe,Xe=()=>F$?!C.current&&S===O.current&&T.current:S===O.current,ct={isValidating:!1,isLoading:!1},lt=()=>{$(ct)},fe=()=>{const Se=_[S];Se&&Se[1]===Ue&&delete _[S]},Ke={isValidating:!0};Xn(M().data)&&(Ke.isLoading=!0);try{if(rt&&($(Ke),n.loadingTimeout&&Xn(M().data)&&setTimeout(()=>{ft&&Xe()&&B().onLoadingSlow(S,n)},n.loadingTimeout),_[S]=[Le(y),X5()]),[Ve,Ue]=_[S],Ve=await Ve,rt&&setTimeout(fe,n.dedupingInterval),!_[S]||_[S][1]!==Ue)return rt&&Xe()&&B().onDiscarded(S),!1;ct.error=ao;const Se=h[S];if(!Xn(Se)&&(Ue<=Se[0]||Ue<=Se[1]||Se[1]===0))return lt(),rt&&Xe()&&B().onDiscarded(S),!1;const Q=M().data;ct.data=i(Q,Ve)?Q:Ve,rt&&Xe()&&B().onSuccess(Ve,S,n)}catch(Se){fe();const Q=B(),{shouldRetryOnError:he}=Q;Q.isPaused()||(ct.error=Se,rt&&Xe()&&(Q.onError(Se,S,Q),(he===!0||cc(he)&&he(Se))&&z()&&Q.onErrorRetry(Se,S,Q,ae=>{const _e=m[S];_e&&_e[0]&&_e[0](D_.ERROR_REVALIDATE_EVENT,ae)},{retryCount:(dt.retryCount||0)+1,dedupe:!0})))}return ft=!1,lt(),!0},[S,r]),Ze=A.useCallback((...ze)=>zre(r,O.current,...ze),[]);if(ZO(()=>{N.current=t,w.current=n,Xn(se)||(Ee.current=se)}),ZO(()=>{if(!S)return;const ze=Qe.bind(ao,eN);let Le=0;const Ue=bIe(S,m,(ft,dt={})=>{if(ft==D_.FOCUS_EVENT){const rt=Date.now();B().revalidateOnFocus&&rt>Le&&z()&&(Le=rt+B().focusThrottleInterval,ze())}else if(ft==D_.RECONNECT_EVENT)B().revalidateOnReconnect&&z()&&ze();else{if(ft==D_.MUTATE_EVENT)return Qe();if(ft==D_.ERROR_REVALIDATE_EVENT)return Qe(dt)}});return C.current=!1,O.current=S,T.current=!0,$({_k:y}),ge&&(Xn(ne)||OE?ze():rIe(ze)),()=>{C.current=!0,Ue()}},[S]),ZO(()=>{let ze;function Le(){const Ue=cc(u)?u(M().data):u;Ue&&ze!==-1&&(ze=setTimeout(Ve,Ue))}function Ve(){!M().error&&(c||B().isVisible())&&(d||B().isOnline())?Qe(eN).then(Le):Le()}return Le(),()=>{ze&&(clearTimeout(ze),ze=-1)}},[u,c,d,S]),A.useDebugValue(ye),a&&Xn(ne)&&S){if(!F$&&OE)throw new Error("Fallback data is required when using suspense in SSR.");N.current=t,w.current=n,C.current=!1;const ze=b[S];if(!Xn(ze)){const Le=Ze(ze);$$(Le)}if(Xn(G)){const Le=Qe(eN);Xn(ye)||(Le.status="fulfilled",Le.value=!0),$$(Le)}else throw G}return{mutate:Ze,get data(){return Y.data=!0,ye},get error(){return Y.error=!0,G},get isValidating(){return Y.isValidating=!0,we},get isLoading(){return Y.isLoading=!0,Be}}},TIe=SIe(yIe);var CIe=e=>{let t={},n=new Date,r=new Date;r.setDate(n.getDate()-1);let i=new Date;i.setDate(n.getDate()-7);let a=new Date;return a.setDate(n.getDate()-30),e.forEach(o=>{let s=new Date(o.createdAt),l=s.toDateString()===n.toDateString(),u=s.toDateString()===r.toDateString(),c=s>=i,d=s>=a,f;l?f="Today":u?f="Yesterday":c?f="Previous 7 days":d?f="Previous 30 days":f=s.toLocaleString("default",{month:"long",year:"numeric"}).split(" ").slice(0,1).join(" "),t[f]||(t[f]=[]),t[f].push(o)}),t},Vre=jn({key:"ThreadIdToResume",default:void 0}),RIe=jn({key:"ChatProfile",default:void 0}),z$=jn({key:"SessionId",default:Sre()}),Z5=vre({key:"SessionIdSelector",get:({get:e})=>e(z$),set:({set:e},t)=>e(z$,t instanceof zOe?Sre():t)}),Tk=jn({key:"Session",dangerouslyAllowMutability:!0,default:void 0}),Ck=jn({key:"Actions",default:[]}),q2=jn({key:"Messages",dangerouslyAllowMutability:!0,default:[]}),Yre=jn({key:"TokenCount",default:0}),Rk=jn({key:"Loading",default:!1}),Ak=jn({key:"AskUser",default:void 0}),AIe=jn({key:"CallFn",default:void 0}),W2=jn({key:"ChatSettings",default:[]}),qre=vre({key:"ChatSettingsValue/Default",get:({get:e})=>e(W2).reduce((t,n)=>(t[n.id]=n.initial,t),{})}),xk=jn({key:"ChatSettingsValue",default:qre}),Ok=jn({key:"DisplayElements",default:[]}),Nk=jn({key:"AvatarElements",default:[]}),Ik=jn({key:"TasklistElements",default:[]}),K2=jn({key:"FirstUserInteraction",default:void 0}),lf=jn({key:"AccessToken",default:void 0}),xIe=jn({key:"User",default:null}),j2=jn({key:"ThreadHistory",default:{threads:void 0,currentThreadId:void 0,timeGroupedThreads:void 0,pageInfo:void 0},effects:[({setSelf:e,onSet:t})=>{t((n,r)=>{let i=n==null?void 0:n.timeGroupedThreads;n!=null&&n.threads&&!og.isEqual(n.threads,r==null?void 0:r.timeGroupedThreads)&&(i=CIe(n.threads)),e({...n,timeGroupedThreads:i})})}]}),Q2=jn({key:"SideView",default:void 0}),om=()=>{let e=Ht(Rk),t=Ht(Ok),n=Ht(Nk),r=Ht(Ik),i=Ht(Ck),a=Ht(Tk),o=Ht(Ak),s=Ht(W2),l=Ht(xk),u=Ht(qre),c=(a==null?void 0:a.socket.connected)&&!(a!=null&&a.error),d=!c||e||(o==null?void 0:o.spec.type)==="file"||(o==null?void 0:o.spec.type)==="action";return{actions:i,askUser:o,avatars:n,chatSettingsDefaultValue:u,chatSettingsInputs:s,chatSettingsValue:l,connected:c,disabled:d,elements:t,error:a==null?void 0:a.error,loading:e,tasklists:r}},OIe=e=>{let t=[];for(let n of e)t=Rp(t,n);return t},Rp=(e,t)=>Sv(e,t.id)?NE(e,t.id,t):"parentId"in t&&t.parentId?Kre(e,t.parentId,t):"indent"in t&&t.indent&&t.indent>0?Wre(e,t.indent,t):[...e,t],Wre=(e,t,n,r=0)=>{let i=[...e];if(i.length===0)return[...i,n];{let a=i.length-1,o=i[a];return o.steps=o.steps||[],r+1===t?(o.steps=[...o.steps,n],i[a]={...o},i):(o.steps=Wre(o.steps,t,n,r+1),i[a]={...o},i)}},Kre=(e,t,n)=>{let r=[...e];for(let i=0;i<r.length;i++){let a=r[i];og.isEqual(a.id,t)?(a.steps=a.steps?[...a.steps,n]:[n],r[i]={...a}):Sv(r,t)&&a.steps&&(a.steps=Kre(a.steps,t,n),r[i]={...a})}return r},Sv=(e,t)=>{for(let n of e)if(og.isEqual(n.id,t)||n.steps&&n.steps.length>0&&Sv(n.steps,t))return!0;return!1},NE=(e,t,n)=>{let r=[...e];for(let i=0;i<r.length;i++){let a=r[i];og.isEqual(a.id,t)?r[i]={steps:a.steps,...n}:Sv(r,t)&&a.steps&&(a.steps=NE(a.steps,t,n),r[i]={...a})}return r},jre=(e,t)=>{let n=[...e];for(let r=0;r<n.length;r++){let i=n[r];i.id===t?n=[...n.slice(0,r),...n.slice(r+1)]:Sv(n,t)&&i.steps&&(i.steps=jre(i.steps,t),n[r]={...i})}return n},Qre=(e,t,n,r)=>{let i=[...e];for(let a=0;a<i.length;a++){let o=i[a];og.isEqual(o.id,t)?("content"in o&&o.content!==void 0?r?o.content=n:o.content+=n:"output"in o&&o.output!==void 0&&(r?o.output=n:o.output+=n),i[a]={...o}):o.steps&&(o.steps=Qre(o.steps,t,n,r),i[a]={...o})}return i},hu=()=>{let e=Ht(lf),t=Ht(Tk),n=Ht(Ak),r=Ht(Z5),i=lT(W2),a=lT(Z5),o=lT(xk),s=Gn(K2),l=Gn(Rk),u=Gn(q2),c=Gn(Ok),d=Gn(Nk),f=Gn(Ik),m=Gn(Ck),h=Gn(Yre),_=Gn(Vre),b=Gn(Q2),S=A.useCallback(()=>{t==null||t.socket.emit("clear_session"),t==null||t.socket.disconnect(),_(void 0),a(),s(void 0),u([]),c([]),d([]),f([]),m([]),h(0),i(),o(),b(void 0)},[t]),y=A.useCallback((w,B)=>{u(z=>Rp(z,w)),t==null||t.socket.emit("ui_message",{message:w,fileReferences:B})},[t==null?void 0:t.socket]),T=A.useCallback(w=>{n&&(u(B=>Rp(B,w)),n.callback(w))},[n]),C=A.useCallback(w=>{t==null||t.socket.emit("chat_settings_change",w)},[t==null?void 0:t.socket]),O=A.useCallback(()=>{l(!1),t==null||t.socket.emit("stop")},[t==null?void 0:t.socket]),N=A.useCallback(w=>{let B=t==null?void 0:t.socket;if(!B)return;let z=new Promise((M,$)=>{B.once("action_response",U=>{U.status?M(U):$(U)})});return B.emit("action_call",w),z},[t==null?void 0:t.socket]);return{uploadFile:A.useCallback((w,B,z)=>w.uploadFile(B,z,r,e),[r,e]),callAction:N,clear:S,replyMessage:T,sendMessage:y,stopTask:O,setIdToResume:_,updateChatSettings:C}},Xre=()=>{let e=Ht(q2),t=Ht(K2);return{messages:e,firstInteraction:t}},lg=()=>{let e=Ht(Z5),[t,n]=mi(Tk),r=lT(xk),i=Gn(K2),a=Gn(Rk),o=Gn(q2),s=Gn(Ak),l=Gn(AIe),u=Gn(Ok),c=Gn(Nk),d=Gn(Ik),f=Gn(Ck),m=Gn(W2),h=Gn(Yre),[_,b]=mi(RIe),S=Ht(Vre),y=A.useCallback(({client:O,userEnv:N,accessToken:w})=>{let B=new URL(O.httpEndpoint).pathname,z=B.endsWith("/")?"ws/socket.io":"/ws/socket.io",M=fT(O.httpEndpoint,{path:`${B}${z}`,extraHeaders:{Authorization:w||"","X-Chainlit-Client-Type":O.type,"X-Chainlit-Session-Id":e,"X-Chainlit-Thread-Id":S||"","user-env":JSON.stringify(N),"X-Chainlit-Chat-Profile":_||""}});n($=>{var U,H;return(U=$==null?void 0:$.socket)==null||U.removeAllListeners(),(H=$==null?void 0:$.socket)==null||H.close(),{socket:M}}),M.on("connect",()=>{M.emit("connection_successful"),n($=>({...$,error:!1}))}),M.on("connect_error",$=>{n(U=>({...U,error:!0}))}),M.on("task_start",()=>{a(!0)}),M.on("task_end",()=>{a(!1)}),M.on("reload",()=>{M.emit("clear_session"),window.location.reload()}),M.on("resume_thread",$=>{var Y,re;let U=[];for(let ce of $.steps)U=Rp(U,ce);(Y=$.metadata)!=null&&Y.chat_profile&&b((re=$.metadata)==null?void 0:re.chat_profile),o(U);let H=$.elements||[];c(H.filter(ce=>ce.type==="avatar")),d(H.filter(ce=>ce.type==="tasklist")),u(H.filter(ce=>["avatar","tasklist"].indexOf(ce.type)===-1))}),M.on("new_message",$=>{o(U=>Rp(U,$))}),M.on("first_interaction",$=>{i($)}),M.on("update_message",$=>{o(U=>NE(U,$.id,$))}),M.on("delete_message",$=>{o(U=>jre(U,$.id))}),M.on("stream_start",$=>{o(U=>Rp(U,$))}),M.on("stream_token",({id:$,token:U,isSequence:H})=>{o(Y=>Qre(Y,$,U,H))}),M.on("ask",({msg:$,spec:U},H)=>{s({spec:U,callback:H}),o(Y=>Rp(Y,$)),a(!1)}),M.on("ask_timeout",()=>{s(void 0),a(!1)}),M.on("clear_ask",()=>{s(void 0)}),M.on("call_fn",({name:$,args:U},H)=>{let Y=new CustomEvent("chainlit-call-fn",{detail:{name:$,args:U,callback:H}});window.dispatchEvent(Y),l({name:$,args:U,callback:H})}),M.on("clear_call_fn",()=>{l(void 0)}),M.on("call_fn_timeout",()=>{l(void 0)}),M.on("chat_settings",$=>{m($),r()}),M.on("element",$=>{!$.url&&$.chainlitKey&&($.url=O.getElementUrl($.chainlitKey,e)),$.type==="avatar"?c(U=>{let H=U.findIndex(Y=>Y.id===$.id);return H===-1?[...U,$]:[...U.slice(0,H),$,...U.slice(H+1)]}):$.type==="tasklist"?d(U=>{let H=U.findIndex(Y=>Y.id===$.id);return H===-1?[...U,$]:[...U.slice(0,H),$,...U.slice(H+1)]}):u(U=>{let H=U.findIndex(Y=>Y.id===$.id);return H===-1?[...U,$]:[...U.slice(0,H),$,...U.slice(H+1)]})}),M.on("remove_element",$=>{u(U=>U.filter(H=>H.id!==$.id)),d(U=>U.filter(H=>H.id!==$.id)),c(U=>U.filter(H=>H.id!==$.id))}),M.on("action",$=>{f(U=>[...U,$])}),M.on("remove_action",$=>{f(U=>{let H=U.findIndex(Y=>Y.id===$.id);return H===-1?U:[...U.slice(0,H),...U.slice(H+1)]})}),M.on("token_usage",$=>{h(U=>U+$)})},[n,e,_]),T=A.useCallback(og.debounce(y,200),[y]),C=A.useCallback(()=>{t!=null&&t.socket&&(t.socket.removeAllListeners(),t.socket.close())},[t]);return{connect:T,disconnect:C,session:t,sessionId:e,chatProfile:_,idToResume:S,setChatProfile:b}},wk="token";function H$(){try{return localStorage.getItem(wk)}catch{return}}function NIe(e){try{return localStorage.setItem(wk,e)}catch{return}}function Zre(){try{return localStorage.removeItem(wk)}catch{return}}var IIe=async(e,t,n)=>{var r;return(r=await e.get(t,n))==null?void 0:r.json()};function Gp(e,t,n){let r=Ht(lf);return TIe(t?[t,r]:null,([i,a])=>IIe(e,i,a),n)}var wIe=e=>{let{data:t,isLoading:n}=Gp(e,"/auth/config"),[r,i]=mi(lf),a=Gn(j2),[o,s]=mi(xIe),l=!!(!n&&t),u=async()=>{await e.logout(),s(null),Zre(),i(""),a(void 0)},c=f=>{if(!f){u();return}try{let{exp:m,...h}=FNe(f);NIe(f),i(`Bearer ${f}`),s(h)}catch(m){console.error("Invalid token, clearing token from local storage","error:",m),u()}};A.useEffect(()=>{if(!o&&H$()){c(H$());return}},[]);let d=!!r;return t&&!t.requireLogin?{data:t,user:null,isReady:l,isAuthenticated:!0,accessToken:"",logout:()=>{},setAccessToken:()=>{}}:{data:t,user:o,isAuthenticated:d,isReady:l,accessToken:r,logout:u,setAccessToken:c}},J5=class extends Error{constructor(e,t){super(e),this.detail=t}toString(){return this.detail?`${this.message}: ${this.detail}`:this.message}},DIe=class{constructor(e,t,n,r){this.httpEndpoint=e,this.type=t,this.on401=n,this.onError=r}buildEndpoint(e){return this.httpEndpoint.endsWith("/")?`${this.httpEndpoint.slice(0,-1)}${e}`:`${this.httpEndpoint}${e}`}checkToken(e){let t="Bearer ";return e.startsWith(t)?e:t+e}async fetch(e,t,n,r,i){try{let a={};n&&(a.Authorization=this.checkToken(n));let o;r instanceof FormData?o=r:(a["Content-Type"]="application/json",o=r?JSON.stringify(r):null);let s=await fetch(this.buildEndpoint(t),{method:e,headers:a,signal:i,body:o});if(!s.ok){let l=await s.json();throw s.status===401&&this.on401&&(Zre(),this.on401()),new J5(s.statusText,l.detail)}return s}catch(a){throw a instanceof J5&&this.onError&&this.onError(a),console.error(a),a}}async get(e,t){return await this.fetch("GET",e,t)}async post(e,t,n,r){return await this.fetch("POST",e,n,t,r)}async put(e,t,n){return await this.fetch("PUT",e,n,t)}async patch(e,t,n){return await this.fetch("PATCH",e,n,t)}async delete(e,t,n){return await this.fetch("DELETE",e,n,t)}},MIe=class extends DIe{async headerAuth(){return(await this.post("/auth/header",{})).json()}async passwordAuth(t){return(await this.post("/login",t)).json()}async logout(){return(await this.post("/logout",{})).json()}async getGeneration(t,n={},r,i,a){var l,u;let o={userEnv:n};t.type==="CHAT"?o.chatGeneration=t:o.completionGeneration=t;let s=(u=(l=await this.post("/generation",o,i,r.signal))==null?void 0:l.body)==null?void 0:u.getReader();return new ReadableStream({start(c){function d(){s.read().then(({done:f,value:m})=>{if(f){c.close(),a&&a(f,"");return}let h=new TextDecoder("utf-8").decode(m);a&&a(f,h),c.enqueue(m),d()}).catch(f=>{c.close(),a&&a(!0,""),console.error(f)})}d()}})}async setFeedback(t,n){return(await this.put("/feedback",{feedback:t},n)).json()}async deleteFeedback(t,n){return(await this.delete("/feedback",{feedbackId:t},n)).json()}async listThreads(t,n,r){return(await this.post("/project/threads",{pagination:t,filter:n},r)).json()}async deleteThread(t,n){return(await this.delete("/project/thread",{threadId:t},n)).json()}uploadFile(t,n,r,i){let a=new XMLHttpRequest,o=new Promise((s,l)=>{let u=new FormData;u.append("file",t),a.open("POST",this.buildEndpoint(`/project/file?session_id=${r}`),!0),i&&a.setRequestHeader("Authorization",this.checkToken(i)),a.upload.onprogress=function(c){if(c.lengthComputable){let d=c.loaded/c.total*100;n(d)}},a.onload=function(){if(a.status===200){let c=JSON.parse(a.responseText);s(c)}else l("Upload failed")},a.onerror=function(){l("Upload error")},a.send(u)});return{xhr:a,promise:o}}getElementUrl(t,n){let r=`?session_id=${n}`;return this.buildEndpoint(`/project/file/${t}${r}`)}getLogoEndpoint(t){return this.buildEndpoint(`/logo?theme=${t}`)}getOAuthEndpoint(t){return this.buildEndpoint(`/auth/oauth/${t}`)}};function LIe(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}LIe(`html[dir=ltr],[data-sonner-toaster][dir=ltr]{--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}html[dir=rtl],[data-sonner-toaster][dir=rtl]{--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999}[data-sonner-toaster][data-x-position=right]{right:max(var(--offset),env(safe-area-inset-right))}[data-sonner-toaster][data-x-position=left]{left:max(var(--offset),env(safe-area-inset-left))}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translate(-50%)}[data-sonner-toaster][data-y-position=top]{top:max(var(--offset),env(safe-area-inset-top))}[data-sonner-toaster][data-y-position=bottom]{bottom:max(var(--offset),env(safe-area-inset-bottom))}[data-sonner-toast]{--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;will-change:transform,opacity,height;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}[data-sonner-toast][data-y-position=top]{top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}[data-sonner-toast] [data-description]{font-weight:400;line-height:1.4;color:inherit}[data-sonner-toast] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast] [data-icon]>*{flex-shrink:0}[data-sonner-toast] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast] [data-button]:focus-visible{box-shadow:0 0 0 2px #0006}[data-sonner-toast] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toast][data-theme=dark] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;background:var(--gray1);color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;opacity:0;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]:focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}[data-sonner-toast] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast]:hover [data-close-button]{opacity:1}[data-sonner-toast]:focus [data-close-button]{opacity:1}[data-sonner-toast]:focus-within [data-close-button]{opacity:1}[data-sonner-toast]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]:before{content:"";position:absolute;left:0;right:0;height:100%}[data-sonner-toast][data-y-position=top][data-swiping=true]:before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]:before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]:before{content:"";position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast]:after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y: translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y: translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]:before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - 32px)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true] [data-sonner-toast][data-type=success],[data-rich-colors=true] [data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true] [data-sonner-toast][data-type=info],[data-rich-colors=true] [data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true] [data-sonner-toast][data-type=warning],[data-rich-colors=true] [data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true] [data-sonner-toast][data-type=error],[data-rich-colors=true] [data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
|
77
77
|
`);var kIe=e=>{switch(e){case"success":return BIe;case"info":return $Ie;case"warning":return UIe;case"error":return zIe;default:return null}},PIe=Array(12).fill(0),FIe=({visible:e})=>Ye.createElement("div",{className:"sonner-loading-wrapper","data-visible":e},Ye.createElement("div",{className:"sonner-spinner"},PIe.map((t,n)=>Ye.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),BIe=Ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ye.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),UIe=Ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Ye.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),$Ie=Ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ye.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),zIe=Ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ye.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),e6=1,HIe=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,i=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:e6++,a=this.toasts.find(s=>s.id===i),o=e.dismissible===void 0?!0:e.dismissible;return a?this.toasts=this.toasts.map(s=>s.id===i?(this.publish({...s,...e,id:i,title:n}),{...s,...e,id:i,dismissible:o,title:n}):s):this.addToast({title:n,...r,dismissible:o,id:i}),i},this.dismiss=e=>(e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading}));let r=e instanceof Promise?e:e(),i=n!==void 0;return r.then(a=>{if(a&&typeof a.ok=="boolean"&&!a.ok){i=!1;let o=typeof t.error=="function"?t.error(`HTTP error! status: ${a.status}`):t.error;this.create({id:n,type:"error",message:o})}else if(t.success!==void 0){i=!1;let o=typeof t.success=="function"?t.success(a):t.success;this.create({id:n,type:"success",message:o})}}).catch(a=>{if(t.error!==void 0){i=!1;let o=typeof t.error=="function"?t.error(a):t.error;this.create({id:n,type:"error",message:o})}}).finally(()=>{var a;i&&(this.dismiss(n),n=void 0),(a=t.finally)==null||a.call(t)}),n},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||e6++;return this.create({jsx:e(n),id:n,...t}),n},this.subscribers=[],this.toasts=[]}},sl=new HIe,GIe=(e,t)=>{let n=(t==null?void 0:t.id)||e6++;return sl.addToast({title:e,...t,id:n}),n},VIe=GIe,$i=Object.assign(VIe,{success:sl.success,info:sl.info,warning:sl.warning,error:sl.error,custom:sl.custom,message:sl.message,promise:sl.promise,dismiss:sl.dismiss,loading:sl.loading}),YIe=3,qIe="32px",WIe=4e3,KIe=356,Jre=14,jIe=20,QIe=200;function Jf(...e){return e.filter(Boolean).join(" ")}var XIe=e=>{var t,n,r,i,a,o,s;let{invert:l,toast:u,interacting:c,setHeights:d,visibleToasts:f,heights:m,index:h,toasts:_,expanded:b,removeToast:S,closeButton:y,style:T,cancelButtonStyle:C,actionButtonStyle:O,className:N="",descriptionClassName:w="",duration:B,position:z,gap:M=Jre,loadingIcon:$,expandByDefault:U,classNames:H}=e,[Y,re]=Ye.useState(!1),[ce,Z]=Ye.useState(!1),[j,W]=Ye.useState(!1),[k,se]=Ye.useState(!1),[ne,G]=Ye.useState(0),[Ee,ye]=Ye.useState(0),ge=Ye.useRef(null),De=Ye.useRef(null),we=h===0,Be=h+1<=f,Qe=u.type,Ze=u.dismissible!==!1,ze=u.className||"",Le=u.descriptionClassName||"",Ve=Ye.useMemo(()=>m.findIndex(ae=>ae.toastId===u.id)||0,[m,u.id]),Ue=Ye.useMemo(()=>u.duration||B||WIe,[u.duration,B]),ft=Ye.useRef(0),dt=Ye.useRef(0);Ye.useRef(Ue);let rt=Ye.useRef(0),Xe=Ye.useRef(null),[ct,lt]=z.split("-"),fe=Ye.useMemo(()=>m.reduce((ae,_e,Ie)=>Ie>=Ve?ae:ae+_e.height,0),[m,Ve]),Ke=u.invert||l,Se=Qe==="loading";dt.current=Ye.useMemo(()=>Ve*M+fe,[Ve,fe]),Ye.useEffect(()=>{re(!0)},[]),Ye.useLayoutEffect(()=>{if(!Y)return;let ae=De.current,_e=ae.style.height;ae.style.height="auto";let Ie=ae.getBoundingClientRect().height;ae.style.height=_e,ye(Ie),d(ot=>ot.find(it=>it.toastId===u.id)?ot.map(it=>it.toastId===u.id?{...it,height:Ie}:it):[{toastId:u.id,height:Ie},...ot])},[Y,u.title,u.description,d,u.id]);let Q=Ye.useCallback(()=>{Z(!0),G(dt.current),d(ae=>ae.filter(_e=>_e.toastId!==u.id)),setTimeout(()=>{S(u)},QIe)},[u,S,d,dt]);Ye.useEffect(()=>{if(u.promise&&Qe==="loading"||u.duration===1/0)return;let ae,_e=Ue;return b||c?(()=>{if(rt.current<ft.current){let Ie=new Date().getTime()-ft.current;_e=_e-Ie}rt.current=new Date().getTime()})():(ft.current=new Date().getTime(),ae=setTimeout(()=>{var Ie;(Ie=u.onAutoClose)==null||Ie.call(u,u),Q()},_e)),()=>clearTimeout(ae)},[b,c,U,u,Ue,Q,u.promise,Qe]),Ye.useEffect(()=>{let ae=De.current;if(ae){let _e=ae.getBoundingClientRect().height;return ye(_e),d(Ie=>[{toastId:u.id,height:_e},...Ie]),()=>d(Ie=>Ie.filter(ot=>ot.toastId!==u.id))}},[d,u.id]),Ye.useEffect(()=>{u.delete&&Q()},[Q,u.delete]);function he(){var ae;return $?Ye.createElement("div",{className:Jf("loader",H==null?void 0:H.toast,(ae=u==null?void 0:u.classNames)==null?void 0:ae.toast),"data-visible":Qe==="loading"},$):Ye.createElement(FIe,{visible:Qe==="loading"})}return Ye.createElement("li",{"aria-live":u.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:De,className:Jf(N,ze,H==null?void 0:H.toast,(t=u==null?void 0:u.classNames)==null?void 0:t.toast,H==null?void 0:H[Qe],(n=u==null?void 0:u.classNames)==null?void 0:n[Qe]),"data-sonner-toast":"","data-styled":!(u.jsx||u.unstyled),"data-mounted":Y,"data-promise":!!u.promise,"data-removed":ce,"data-visible":Be,"data-y-position":ct,"data-x-position":lt,"data-index":h,"data-front":we,"data-swiping":j,"data-dismissible":Ze,"data-type":Qe,"data-invert":Ke,"data-swipe-out":k,"data-expanded":!!(b||U&&Y),style:{"--index":h,"--toasts-before":h,"--z-index":_.length-h,"--offset":`${ce?ne:dt.current}px`,"--initial-height":U?"auto":`${Ee}px`,...T,...u.style},onPointerDown:ae=>{Se||!Ze||(ge.current=new Date,G(dt.current),ae.target.setPointerCapture(ae.pointerId),ae.target.tagName!=="BUTTON"&&(W(!0),Xe.current={x:ae.clientX,y:ae.clientY}))},onPointerUp:()=>{var ae,_e,Ie,ot;if(k||!Ze)return;Xe.current=null;let it=Number(((ae=De.current)==null?void 0:ae.style.getPropertyValue("--swipe-amount").replace("px",""))||0),$e=new Date().getTime()-((_e=ge.current)==null?void 0:_e.getTime()),Tt=Math.abs(it)/$e;if(Math.abs(it)>=jIe||Tt>.11){G(dt.current),(Ie=u.onDismiss)==null||Ie.call(u,u),Q(),se(!0);return}(ot=De.current)==null||ot.style.setProperty("--swipe-amount","0px"),W(!1)},onPointerMove:ae=>{var _e;if(!Xe.current||!Ze)return;let Ie=ae.clientY-Xe.current.y,ot=ae.clientX-Xe.current.x,it=(ct==="top"?Math.min:Math.max)(0,Ie),$e=ae.pointerType==="touch"?10:2;Math.abs(it)>$e?(_e=De.current)==null||_e.style.setProperty("--swipe-amount",`${Ie}px`):Math.abs(ot)>$e&&(Xe.current=null)}},y&&!u.jsx?Ye.createElement("button",{"aria-label":"Close toast","data-disabled":Se,"data-close-button":!0,onClick:Se||!Ze?()=>{}:()=>{var ae;Q(),(ae=u.onDismiss)==null||ae.call(u,u)},className:Jf(H==null?void 0:H.closeButton,(r=u==null?void 0:u.classNames)==null?void 0:r.closeButton)},Ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Ye.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Ye.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,u.jsx||Ye.isValidElement(u.title)?u.jsx||u.title:Ye.createElement(Ye.Fragment,null,Qe||u.icon||u.promise?Ye.createElement("div",{"data-icon":""},(u.promise||u.type==="loading")&&!u.icon?he():null,u.icon||kIe(Qe)):null,Ye.createElement("div",{"data-content":""},Ye.createElement("div",{"data-title":"",className:Jf(H==null?void 0:H.title,(i=u==null?void 0:u.classNames)==null?void 0:i.title)},u.title),u.description?Ye.createElement("div",{"data-description":"",className:Jf(w,Le,H==null?void 0:H.description,(a=u==null?void 0:u.classNames)==null?void 0:a.description)},u.description):null),u.cancel?Ye.createElement("button",{"data-button":!0,"data-cancel":!0,style:u.cancelButtonStyle||C,onClick:()=>{var ae;Ze&&(Q(),(ae=u.cancel)!=null&&ae.onClick&&u.cancel.onClick())},className:Jf(H==null?void 0:H.cancelButton,(o=u==null?void 0:u.classNames)==null?void 0:o.cancelButton)},u.cancel.label):null,u.action?Ye.createElement("button",{"data-button":"",style:u.actionButtonStyle||O,onClick:ae=>{var _e;(_e=u.action)==null||_e.onClick(ae),!ae.defaultPrevented&&Q()},className:Jf(H==null?void 0:H.actionButton,(s=u==null?void 0:u.classNames)==null?void 0:s.actionButton)},u.action.label):null))};function G$(){if(typeof window>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}var ZIe=e=>{let{invert:t,position:n="bottom-right",hotkey:r=["altKey","KeyT"],expand:i,closeButton:a,className:o,offset:s,theme:l="light",richColors:u,duration:c,style:d,visibleToasts:f=YIe,toastOptions:m,dir:h=G$(),gap:_,loadingIcon:b}=e,[S,y]=Ye.useState([]),T=Ye.useMemo(()=>Array.from(new Set([n].concat(S.filter(Z=>Z.position).map(Z=>Z.position)))),[S,n]),[C,O]=Ye.useState([]),[N,w]=Ye.useState(!1),[B,z]=Ye.useState(!1),[M,$]=Ye.useState(l!=="system"?l:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),U=Ye.useRef(null),H=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),Y=Ye.useRef(null),re=Ye.useRef(!1),ce=Ye.useCallback(Z=>y(j=>j.filter(({id:W})=>W!==Z.id)),[]);return Ye.useEffect(()=>sl.subscribe(Z=>{if(Z.dismiss){y(j=>j.map(W=>W.id===Z.id?{...W,delete:!0}:W));return}setTimeout(()=>{q0.flushSync(()=>{y(j=>{let W=j.findIndex(k=>k.id===Z.id);return W!==-1?[...j.slice(0,W),{...j[W],...Z},...j.slice(W+1)]:[Z,...j]})})})}),[]),Ye.useEffect(()=>{if(l!=="system"){$(l);return}l==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?$("dark"):$("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:Z})=>{$(Z?"dark":"light")})},[l]),Ye.useEffect(()=>{S.length<=1&&w(!1)},[S]),Ye.useEffect(()=>{let Z=j=>{var W,k;r.every(se=>j[se]||j.code===se)&&(w(!0),(W=U.current)==null||W.focus()),j.code==="Escape"&&(document.activeElement===U.current||(k=U.current)!=null&&k.contains(document.activeElement))&&w(!1)};return document.addEventListener("keydown",Z),()=>document.removeEventListener("keydown",Z)},[r]),Ye.useEffect(()=>{if(U.current)return()=>{Y.current&&(Y.current.focus({preventScroll:!0}),Y.current=null,re.current=!1)}},[U.current]),S.length?Ye.createElement("section",{"aria-label":`Notifications ${H}`,tabIndex:-1},T.map((Z,j)=>{var W;let[k,se]=Z.split("-");return Ye.createElement("ol",{key:Z,dir:h==="auto"?G$():h,tabIndex:-1,ref:U,className:o,"data-sonner-toaster":!0,"data-theme":M,"data-rich-colors":u,"data-y-position":k,"data-x-position":se,style:{"--front-toast-height":`${(W=C[0])==null?void 0:W.height}px`,"--offset":typeof s=="number"?`${s}px`:s||qIe,"--width":`${KIe}px`,"--gap":`${Jre}px`,...d},onBlur:ne=>{re.current&&!ne.currentTarget.contains(ne.relatedTarget)&&(re.current=!1,Y.current&&(Y.current.focus({preventScroll:!0}),Y.current=null))},onFocus:ne=>{ne.target instanceof HTMLElement&&ne.target.dataset.dismissible==="false"||re.current||(re.current=!0,Y.current=ne.relatedTarget)},onMouseEnter:()=>w(!0),onMouseMove:()=>w(!0),onMouseLeave:()=>{B||w(!1)},onPointerDown:ne=>{ne.target instanceof HTMLElement&&ne.target.dataset.dismissible==="false"||z(!0)},onPointerUp:()=>z(!1)},S.filter(ne=>!ne.position&&j===0||ne.position===Z).map((ne,G)=>{var Ee;return Ye.createElement(XIe,{key:ne.id,index:G,toast:ne,duration:(Ee=m==null?void 0:m.duration)!=null?Ee:c,className:m==null?void 0:m.className,descriptionClassName:m==null?void 0:m.descriptionClassName,invert:t,visibleToasts:f,closeButton:a,interacting:B,position:Z,style:m==null?void 0:m.style,classNames:m==null?void 0:m.classNames,cancelButtonStyle:m==null?void 0:m.cancelButtonStyle,actionButtonStyle:m==null?void 0:m.actionButtonStyle,removeToast:ce,toasts:S,heights:C,setHeights:O,expandByDefault:i,gap:_,loadingIcon:b,expanded:N})}))})):null};const JIe=window.origin,V$=new URL(JIe),ewe=`${V$.protocol}//${V$.host}`,twe=()=>{window.location.pathname!=="/login"&&(window.location.href="/login")},nwe=e=>{$i.error(e.toString())},rwe=new MIe(ewe,"app",twe,nwe),ya=jn({key:"ApiClient",default:rwe});function gu(){const e=Ht(ya);return wIe(e)}/**
|
|
78
78
|
* @remix-run/router v1.8.0
|
|
79
79
|
*
|
|
@@ -338,7 +338,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
338
338
|
*
|
|
339
339
|
* This source code is licensed under the MIT license found in the
|
|
340
340
|
* LICENSE file in the root directory of this source tree.
|
|
341
|
-
*/var $h=A;function Vtt(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ytt=typeof Object.is=="function"?Object.is:Vtt,qtt=$h.useState,Wtt=$h.useEffect,Ktt=$h.useLayoutEffect,jtt=$h.useDebugValue;function Qtt(e,t){var n=t(),r=qtt({inst:{value:n,getSnapshot:t}}),i=r[0].inst,a=r[1];return Ktt(function(){i.value=n,i.getSnapshot=t,AN(i)&&a({inst:i})},[e,n,t]),Wtt(function(){return AN(i)&&a({inst:i}),e(function(){AN(i)&&a({inst:i})})},[e]),jtt(n),n}function AN(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ytt(e,n)}catch{return!0}}function Xtt(e,t){return t()}var Ztt=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Xtt:Qtt;Fse.useSyncExternalStore=$h.useSyncExternalStore!==void 0?$h.useSyncExternalStore:Ztt;Pse.exports=Fse;var Jtt=Pse.exports;const Td=()=>{},oo=Td(),xN=Object,Zn=e=>e===oo,Zl=e=>typeof e=="function",Wd=(e,t)=>({...e,...t}),ent=e=>Zl(e.then),oy=new WeakMap;let tnt=0;const HE=e=>{const t=typeof e,n=e&&e.constructor,r=n==Date;let i,a;if(xN(e)===e&&!r&&n!=RegExp){if(i=oy.get(e),i)return i;if(i=++tnt+"~",oy.set(e,i),n==Array){for(i="@",a=0;a<e.length;a++)i+=HE(e[a])+",";oy.set(e,i)}if(n==xN){i="#";const o=xN.keys(e).sort();for(;!Zn(a=o.pop());)Zn(e[a])||(i+=a+":"+HE(e[a])+",");oy.set(e,i)}}else i=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return i},sc=new WeakMap,ON={},sy={},n7="undefined",uA=typeof window!=n7,B6=typeof document!=n7,nnt=()=>uA&&typeof window.requestAnimationFrame!=n7,Bse=(e,t)=>{const n=sc.get(e);return[()=>!Zn(t)&&e.get(t)||ON,r=>{if(!Zn(t)){const i=e.get(t);t in sy||(sy[t]=i),n[5](t,Wd(i,r),i||ON)}},n[6],()=>!Zn(t)&&t in sy?sy[t]:!Zn(t)&&e.get(t)||ON]};let U6=!0;const rnt=()=>U6,[$6,z6]=uA&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Td,Td],int=()=>{const e=B6&&document.visibilityState;return Zn(e)||e!=="hidden"},ant=e=>(B6&&document.addEventListener("visibilitychange",e),$6("focus",e),()=>{B6&&document.removeEventListener("visibilitychange",e),z6("focus",e)}),ont=e=>{const t=()=>{U6=!0,e()},n=()=>{U6=!1};return $6("online",t),$6("offline",n),()=>{z6("online",t),z6("offline",n)}},snt={isOnline:rnt,isVisible:int},lnt={initFocus:ant,initReconnect:ont},nV=!Ye.useId,GE=!uA||"Deno"in window,unt=e=>nnt()?window.requestAnimationFrame(e):setTimeout(e,1),NN=GE?A.useEffect:A.useLayoutEffect,IN=typeof navigator<"u"&&navigator.connection,rV=!GE&&IN&&(["slow-2g","2g"].includes(IN.effectiveType)||IN.saveData),r7=e=>{if(Zl(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?HE(e):"",[e,t]};let cnt=0;const H6=()=>++cnt,Use=0,$se=1,zse=2,dnt=3;var W_={__proto__:null,ERROR_REVALIDATE_EVENT:dnt,FOCUS_EVENT:Use,MUTATE_EVENT:zse,RECONNECT_EVENT:$se};async function Hse(...e){const[t,n,r,i]=e,a=Wd({populateCache:!0,throwOnError:!0},typeof i=="boolean"?{revalidate:i}:i||{});let o=a.populateCache;const s=a.rollbackOnError;let l=a.optimisticData;const u=f=>typeof s=="function"?s(f):s!==!1,c=a.throwOnError;if(Zl(n)){const f=n,m=[],h=t.keys();for(const _ of h)!/^\$(inf|sub)\$/.test(_)&&f(t.get(_)._k)&&m.push(_);return Promise.all(m.map(d))}return d(n);async function d(f){const[m]=r7(f);if(!m)return;const[h,_]=Bse(t,m),[b,S,y,T]=sc.get(t),C=()=>{const H=b[m];return(Zl(a.revalidate)?a.revalidate(h().data,f):a.revalidate!==!1)&&(delete y[m],delete T[m],H&&H[0])?H[0](zse).then(()=>h().data):h().data};if(e.length<3)return C();let O=r,N;const w=H6();S[m]=[w,0];const B=!Zn(l),z=h(),M=z.data,$=z._c,U=Zn($)?M:$;if(B&&(l=Zl(l)?l(U,M):l,_({data:l,_c:U})),Zl(O))try{O=O(U)}catch(H){N=H}if(O&&ent(O))if(O=await O.catch(H=>{N=H}),w!==S[m][0]){if(N)throw N;return O}else N&&B&&u(N)&&(o=!0,_({data:U,_c:oo}));if(o&&!N)if(Zl(o)){const H=o(O,U);_({data:H,error:oo,_c:oo})}else _({data:O,error:oo,_c:oo});if(S[m][1]=H6(),Promise.resolve(C()).then(()=>{_({_c:oo})}),N){if(c)throw N;return}return O}}const iV=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},fnt=(e,t)=>{if(!sc.has(e)){const n=Wd(lnt,t),r={},i=Hse.bind(oo,e);let a=Td;const o={},s=(c,d)=>{const f=o[c]||[];return o[c]=f,f.push(d),()=>f.splice(f.indexOf(d),1)},l=(c,d,f)=>{e.set(c,d);const m=o[c];if(m)for(const h of m)h(d,f)},u=()=>{if(!sc.has(e)&&(sc.set(e,[r,{},{},{},i,l,s]),!GE)){const c=n.initFocus(setTimeout.bind(oo,iV.bind(oo,r,Use))),d=n.initReconnect(setTimeout.bind(oo,iV.bind(oo,r,$se)));a=()=>{c&&c(),d&&d(),sc.delete(e)}}};return u(),[e,i,u,a]}return[e,sc.get(e)[4]]},pnt=(e,t,n,r,i)=>{const a=n.errorRetryCount,o=i.retryCount,s=~~((Math.random()+.5)*(1<<(o<8?o:8)))*n.errorRetryInterval;!Zn(a)&&o>a||setTimeout(r,s,i)},mnt=(e,t)=>HE(e)==HE(t),[Gse,hnt]=fnt(new Map),gnt=Wd({onLoadingSlow:Td,onSuccess:Td,onError:Td,onErrorRetry:pnt,onDiscarded:Td,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:rV?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:rV?5e3:3e3,compare:mnt,isPaused:()=>!1,cache:Gse,mutate:hnt,fallback:{}},snt),_nt=(e,t)=>{const n=Wd(e,t);if(t){const{use:r,fallback:i}=e,{use:a,fallback:o}=t;r&&a&&(n.use=r.concat(a)),i&&o&&(n.fallback=Wd(i,o))}return n},Ent=A.createContext({}),vnt="$inf$",Vse=uA&&window.__SWR_DEVTOOLS_USE__,Snt=Vse?window.__SWR_DEVTOOLS_USE__:[],bnt=()=>{Vse&&(window.__SWR_DEVTOOLS_REACT__=Ye)},ynt=e=>Zl(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],Tnt=()=>Wd(gnt,A.useContext(Ent)),Cnt=e=>(t,n,r)=>e(t,n&&((...a)=>{const[o]=r7(t),[,,,s]=sc.get(Gse);if(o.startsWith(vnt))return n(...a);const l=s[o];return Zn(l)?n(...a):(delete s[o],l)}),r),Rnt=Snt.concat(Cnt),Ant=e=>function(...n){const r=Tnt(),[i,a,o]=ynt(n),s=_nt(r,o);let l=e;const{use:u}=s,c=(u||[]).concat(Rnt);for(let d=c.length;d--;)l=c[d](l);return l(i,a||s.fetcher||null,s)},xnt=(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())}};bnt();const aV=Ye.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e)}),wN={dedupe:!0},Ont=(e,t,n)=>{const{cache:r,compare:i,suspense:a,fallbackData:o,revalidateOnMount:s,revalidateIfStale:l,refreshInterval:u,refreshWhenHidden:c,refreshWhenOffline:d,keepPreviousData:f}=n,[m,h,_,b]=sc.get(r),[S,y]=r7(e),T=A.useRef(!1),C=A.useRef(!1),O=A.useRef(S),N=A.useRef(t),w=A.useRef(n),B=()=>w.current,z=()=>B().isVisible()&&B().isOnline(),[M,$,U,H]=Bse(r,S),Y=A.useRef({}).current,re=Zn(o)?n.fallback[S]:o,ce=(ze,Le)=>{for(const Ve in Y){const Ue=Ve;if(Ue==="data"){if(!i(ze[Ue],Le[Ue])&&(!Zn(ze[Ue])||!i(ye,Le[Ue])))return!1}else if(Le[Ue]!==ze[Ue])return!1}return!0},Z=A.useMemo(()=>{const ze=(()=>!S||!t?!1:Zn(s)?B().isPaused()||a?!1:Zn(l)?!0:l:s)(),Le=Xe=>{const ct=Wd(Xe);return delete ct._k,ze?{isValidating:!0,isLoading:!0,...ct}:ct},Ve=M(),Ue=H(),ft=Le(Ve),dt=Ve===Ue?ft:Le(Ue);let rt=ft;return[()=>{const Xe=Le(M());return ce(Xe,rt)?(rt.data=Xe.data,rt.isLoading=Xe.isLoading,rt.isValidating=Xe.isValidating,rt.error=Xe.error,rt):(rt=Xe,Xe)},()=>dt]},[r,S]),j=Jtt.useSyncExternalStore(A.useCallback(ze=>U(S,(Le,Ve)=>{ce(Ve,Le)||ze()}),[r,S]),Z[0],Z[1]),W=!T.current,k=m[S]&&m[S].length>0,se=j.data,ne=Zn(se)?re:se,G=j.error,Ee=A.useRef(ne),ye=f?Zn(se)?Ee.current:se:ne,ge=(()=>k&&!Zn(G)?!1:W&&!Zn(s)?s:B().isPaused()?!1:a?Zn(ne)?!1:l:Zn(ne)||l)(),De=!!(S&&t&&W&&ge),we=Zn(j.isValidating)?De:j.isValidating,Be=Zn(j.isLoading)?De:j.isLoading,Qe=A.useCallback(async ze=>{const Le=N.current;if(!S||!Le||C.current||B().isPaused())return!1;let Ve,Ue,ft=!0;const dt=ze||{},rt=!_[S]||!dt.dedupe,Xe=()=>nV?!C.current&&S===O.current&&T.current:S===O.current,ct={isValidating:!1,isLoading:!1},lt=()=>{$(ct)},fe=()=>{const Se=_[S];Se&&Se[1]===Ue&&delete _[S]},Ke={isValidating:!0};Zn(M().data)&&(Ke.isLoading=!0);try{if(rt&&($(Ke),n.loadingTimeout&&Zn(M().data)&&setTimeout(()=>{ft&&Xe()&&B().onLoadingSlow(S,n)},n.loadingTimeout),_[S]=[Le(y),H6()]),[Ve,Ue]=_[S],Ve=await Ve,rt&&setTimeout(fe,n.dedupingInterval),!_[S]||_[S][1]!==Ue)return rt&&Xe()&&B().onDiscarded(S),!1;ct.error=oo;const Se=h[S];if(!Zn(Se)&&(Ue<=Se[0]||Ue<=Se[1]||Se[1]===0))return lt(),rt&&Xe()&&B().onDiscarded(S),!1;const Q=M().data;ct.data=i(Q,Ve)?Q:Ve,rt&&Xe()&&B().onSuccess(Ve,S,n)}catch(Se){fe();const Q=B(),{shouldRetryOnError:he}=Q;Q.isPaused()||(ct.error=Se,rt&&Xe()&&(Q.onError(Se,S,Q),(he===!0||Zl(he)&&he(Se))&&(!B().revalidateOnFocus||!B().revalidateOnReconnect||z())&&Q.onErrorRetry(Se,S,Q,ae=>{const _e=m[S];_e&&_e[0]&&_e[0](W_.ERROR_REVALIDATE_EVENT,ae)},{retryCount:(dt.retryCount||0)+1,dedupe:!0})))}return ft=!1,lt(),!0},[S,r]),Ze=A.useCallback((...ze)=>Hse(r,O.current,...ze),[]);if(NN(()=>{N.current=t,w.current=n,Zn(se)||(Ee.current=se)}),NN(()=>{if(!S)return;const ze=Qe.bind(oo,wN);let Le=0;const Ue=xnt(S,m,(ft,dt={})=>{if(ft==W_.FOCUS_EVENT){const rt=Date.now();B().revalidateOnFocus&&rt>Le&&z()&&(Le=rt+B().focusThrottleInterval,ze())}else if(ft==W_.RECONNECT_EVENT)B().revalidateOnReconnect&&z()&&ze();else{if(ft==W_.MUTATE_EVENT)return Qe();if(ft==W_.ERROR_REVALIDATE_EVENT)return Qe(dt)}});return C.current=!1,O.current=S,T.current=!0,$({_k:y}),ge&&(Zn(ne)||GE?ze():unt(ze)),()=>{C.current=!0,Ue()}},[S]),NN(()=>{let ze;function Le(){const Ue=Zl(u)?u(M().data):u;Ue&&ze!==-1&&(ze=setTimeout(Ve,Ue))}function Ve(){!M().error&&(c||B().isVisible())&&(d||B().isOnline())?Qe(wN).then(Le):Le()}return Le(),()=>{ze&&(clearTimeout(ze),ze=-1)}},[u,c,d,S]),A.useDebugValue(ye),a&&Zn(ne)&&S){if(!nV&&GE)throw new Error("Fallback data is required when using suspense in SSR.");N.current=t,w.current=n,C.current=!1;const ze=b[S];if(!Zn(ze)){const Le=Ze(ze);aV(Le)}if(Zn(G)){const Le=Qe(wN);Zn(ye)||(Le.status="fulfilled",Le.value=!0),aV(Le)}else throw G}return{mutate:Ze,get data(){return Y.data=!0,ye},get error(){return Y.error=!0,G},get isValidating(){return Y.isValidating=!0,we},get isLoading(){return Y.isLoading=!0,Be}}},Nnt=Ant(Ont),Int=async e=>{const t=await fetch(e);if(!t.ok)throw new Error("Network response was not ok");const n=t.headers.get("content-type");return n&&n.includes("application/json")?t.json():t.text()},Yse=e=>Nnt(e,Int),wnt=A.lazy(()=>Gtt(()=>import("./react-plotly-cc656f1c.js").then(e=>e.r),[])),Dnt=({element:e})=>{const{data:t,error:n,isLoading:r}=Yse(e.url||null);if(r)return v.jsx("div",{children:"Loading..."});if(n)return v.jsx("div",{children:"An error occured"});let i;if(t)i=t;else return null;return v.jsx(A.Suspense,{fallback:v.jsx("div",{children:"Loading..."}),children:v.jsx(wnt,{className:`${e.display}-plotly`,data:i.data,layout:i.layout,frames:i.frames,config:i.config,style:{width:"100%",height:"100%"},useResizeHandler:!0})})},qse=e=>v.jsx(t7,{prefix:"Failed to load chart.",children:v.jsx(Dnt,{...e})});function oV(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);const o=n.slice(i,r).trim();(o||!a)&&t.push(o),i=r+1,r=n.indexOf(",",i)}return t}function Wse(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Mnt=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Lnt=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,knt={};function sV(e,t){return((t||knt).jsx?Lnt:Mnt).test(e)}const Pnt=/[ \t\n\f\r]/g;function Fnt(e){return typeof e=="object"?e.type==="text"?lV(e.value):!1:lV(e)}function lV(e){return e.replace(Pnt,"")===""}let Fv=class{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}};Fv.prototype.property={};Fv.prototype.normal={};Fv.prototype.space=null;function Kse(e,t){const n={},r={};let i=-1;for(;++i<e.length;)Object.assign(n,e[i].property),Object.assign(r,e[i].normal);return new Fv(n,r,t)}function VE(e){return e.toLowerCase()}class Vs{constructor(t,n){this.property=t,this.attribute=n}}Vs.prototype.space=null;Vs.prototype.boolean=!1;Vs.prototype.booleanish=!1;Vs.prototype.overloadedBoolean=!1;Vs.prototype.number=!1;Vs.prototype.commaSeparated=!1;Vs.prototype.spaceSeparated=!1;Vs.prototype.commaOrSpaceSeparated=!1;Vs.prototype.mustUseProperty=!1;Vs.prototype.defined=!1;let Bnt=0;const yn=hm(),xi=hm(),jse=hm(),Nt=hm(),Or=hm(),fh=hm(),ko=hm();function hm(){return 2**++Bnt}const G6=Object.freeze(Object.defineProperty({__proto__:null,boolean:yn,booleanish:xi,commaOrSpaceSeparated:ko,commaSeparated:fh,number:Nt,overloadedBoolean:jse,spaceSeparated:Or},Symbol.toStringTag,{value:"Module"})),DN=Object.keys(G6);class i7 extends Vs{constructor(t,n,r,i){let a=-1;if(super(t,n),uV(this,"space",i),typeof r=="number")for(;++a<DN.length;){const o=DN[a];uV(this,DN[a],(r&G6[o])===G6[o])}}}i7.prototype.defined=!0;function uV(e,t,n){n&&(e[t]=n)}const Unt={}.hasOwnProperty;function xg(e){const t={},n={};let r;for(r in e.properties)if(Unt.call(e.properties,r)){const i=e.properties[r],a=new i7(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[VE(r)]=r,n[VE(a.attribute)]=r}return new Fv(t,n,e.space)}const Qse=xg({space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),Xse=xg({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function Zse(e,t){return t in e?e[t]:t}function Jse(e,t){return Zse(e,t.toLowerCase())}const ele=xg({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:Jse,properties:{xmlns:null,xmlnsXLink:null}}),tle=xg({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:xi,ariaAutoComplete:null,ariaBusy:xi,ariaChecked:xi,ariaColCount:Nt,ariaColIndex:Nt,ariaColSpan:Nt,ariaControls:Or,ariaCurrent:null,ariaDescribedBy:Or,ariaDetails:null,ariaDisabled:xi,ariaDropEffect:Or,ariaErrorMessage:null,ariaExpanded:xi,ariaFlowTo:Or,ariaGrabbed:xi,ariaHasPopup:null,ariaHidden:xi,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Or,ariaLevel:Nt,ariaLive:null,ariaModal:xi,ariaMultiLine:xi,ariaMultiSelectable:xi,ariaOrientation:null,ariaOwns:Or,ariaPlaceholder:null,ariaPosInSet:Nt,ariaPressed:xi,ariaReadOnly:xi,ariaRelevant:null,ariaRequired:xi,ariaRoleDescription:Or,ariaRowCount:Nt,ariaRowIndex:Nt,ariaRowSpan:Nt,ariaSelected:xi,ariaSetSize:Nt,ariaSort:null,ariaValueMax:Nt,ariaValueMin:Nt,ariaValueNow:Nt,ariaValueText:null,role:null}}),$nt=xg({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:Jse,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:fh,acceptCharset:Or,accessKey:Or,action:null,allow:null,allowFullScreen:yn,allowPaymentRequest:yn,allowUserMedia:yn,alt:null,as:null,async:yn,autoCapitalize:null,autoComplete:Or,autoFocus:yn,autoPlay:yn,blocking:Or,capture:null,charSet:null,checked:yn,cite:null,className:Or,cols:Nt,colSpan:null,content:null,contentEditable:xi,controls:yn,controlsList:Or,coords:Nt|fh,crossOrigin:null,data:null,dateTime:null,decoding:null,default:yn,defer:yn,dir:null,dirName:null,disabled:yn,download:jse,draggable:xi,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:yn,formTarget:null,headers:Or,height:Nt,hidden:yn,high:Nt,href:null,hrefLang:null,htmlFor:Or,httpEquiv:Or,id:null,imageSizes:null,imageSrcSet:null,inert:yn,inputMode:null,integrity:null,is:null,isMap:yn,itemId:null,itemProp:Or,itemRef:Or,itemScope:yn,itemType:Or,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:yn,low:Nt,manifest:null,max:null,maxLength:Nt,media:null,method:null,min:null,minLength:Nt,multiple:yn,muted:yn,name:null,nonce:null,noModule:yn,noValidate:yn,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:yn,optimum:Nt,pattern:null,ping:Or,placeholder:null,playsInline:yn,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:yn,referrerPolicy:null,rel:Or,required:yn,reversed:yn,rows:Nt,rowSpan:Nt,sandbox:Or,scope:null,scoped:yn,seamless:yn,selected:yn,shadowRootDelegatesFocus:yn,shadowRootMode:null,shape:null,size:Nt,sizes:null,slot:null,span:Nt,spellCheck:xi,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Nt,step:null,style:null,tabIndex:Nt,target:null,title:null,translate:null,type:null,typeMustMatch:yn,useMap:null,value:xi,width:Nt,wrap:null,align:null,aLink:null,archive:Or,axis:null,background:null,bgColor:null,border:Nt,borderColor:null,bottomMargin:Nt,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:yn,declare:yn,event:null,face:null,frame:null,frameBorder:null,hSpace:Nt,leftMargin:Nt,link:null,longDesc:null,lowSrc:null,marginHeight:Nt,marginWidth:Nt,noResize:yn,noHref:yn,noShade:yn,noWrap:yn,object:null,profile:null,prompt:null,rev:null,rightMargin:Nt,rules:null,scheme:null,scrolling:xi,standby:null,summary:null,text:null,topMargin:Nt,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Nt,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:yn,disableRemotePlayback:yn,prefix:null,property:null,results:Nt,security:null,unselectable:null}}),znt=xg({space:"svg",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"},transform:Zse,properties:{about:ko,accentHeight:Nt,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Nt,amplitude:Nt,arabicForm:null,ascent:Nt,attributeName:null,attributeType:null,azimuth:Nt,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Nt,by:null,calcMode:null,capHeight:Nt,className:Or,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:Nt,diffuseConstant:Nt,direction:null,display:null,dur:null,divisor:Nt,dominantBaseline:null,download:yn,dx:null,dy:null,edgeMode:null,editable:null,elevation:Nt,enableBackground:null,end:null,event:null,exponent:Nt,externalResourcesRequired:null,fill:null,fillOpacity:Nt,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:fh,g2:fh,glyphName:fh,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Nt,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Nt,horizOriginX:Nt,horizOriginY:Nt,id:null,ideographic:Nt,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Nt,k:Nt,k1:Nt,k2:Nt,k3:Nt,k4:Nt,kernelMatrix:ko,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Nt,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:Nt,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:Nt,overlineThickness:Nt,paintOrder:null,panose1:null,path:null,pathLength:Nt,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Or,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Nt,pointsAtY:Nt,pointsAtZ:Nt,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ko,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ko,rev:ko,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ko,requiredFeatures:ko,requiredFonts:ko,requiredFormats:ko,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:Nt,specularExponent:Nt,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Nt,strikethroughThickness:Nt,string:null,stroke:null,strokeDashArray:ko,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Nt,strokeOpacity:Nt,strokeWidth:null,style:null,surfaceScale:Nt,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ko,tabIndex:Nt,tableValues:null,target:null,targetX:Nt,targetY:Nt,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ko,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Nt,underlineThickness:Nt,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Nt,values:null,vAlphabetic:Nt,vMathematical:Nt,vectorEffect:null,vHanging:Nt,vIdeographic:Nt,version:null,vertAdvY:Nt,vertOriginX:Nt,vertOriginY:Nt,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Nt,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),Hnt=/^data[-\w.:]+$/i,cV=/-[a-z]/g,Gnt=/[A-Z]/g;function cA(e,t){const n=VE(t);let r=t,i=Vs;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Hnt.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(cV,Ynt);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!cV.test(a)){let o=a.replace(Gnt,Vnt);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=i7}return new i(r,t)}function Vnt(e){return"-"+e.toLowerCase()}function Ynt(e){return e.charAt(1).toUpperCase()}const qnt={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"},Bv=Kse([Xse,Qse,ele,tle,$nt],"html"),mf=Kse([Xse,Qse,ele,tle,znt],"svg");function dV(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function nle(e){return e.join(" ").trim()}var rle={},fV=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Wnt=/\n/g,Knt=/^\s*/,jnt=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Qnt=/^:\s*/,Xnt=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Znt=/^[;\s]*/,Jnt=/^\s+|\s+$/g,ert=`
|
|
341
|
+
*/var $h=A;function Vtt(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ytt=typeof Object.is=="function"?Object.is:Vtt,qtt=$h.useState,Wtt=$h.useEffect,Ktt=$h.useLayoutEffect,jtt=$h.useDebugValue;function Qtt(e,t){var n=t(),r=qtt({inst:{value:n,getSnapshot:t}}),i=r[0].inst,a=r[1];return Ktt(function(){i.value=n,i.getSnapshot=t,AN(i)&&a({inst:i})},[e,n,t]),Wtt(function(){return AN(i)&&a({inst:i}),e(function(){AN(i)&&a({inst:i})})},[e]),jtt(n),n}function AN(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ytt(e,n)}catch{return!0}}function Xtt(e,t){return t()}var Ztt=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Xtt:Qtt;Fse.useSyncExternalStore=$h.useSyncExternalStore!==void 0?$h.useSyncExternalStore:Ztt;Pse.exports=Fse;var Jtt=Pse.exports;const Td=()=>{},oo=Td(),xN=Object,Zn=e=>e===oo,Zl=e=>typeof e=="function",Wd=(e,t)=>({...e,...t}),ent=e=>Zl(e.then),oy=new WeakMap;let tnt=0;const HE=e=>{const t=typeof e,n=e&&e.constructor,r=n==Date;let i,a;if(xN(e)===e&&!r&&n!=RegExp){if(i=oy.get(e),i)return i;if(i=++tnt+"~",oy.set(e,i),n==Array){for(i="@",a=0;a<e.length;a++)i+=HE(e[a])+",";oy.set(e,i)}if(n==xN){i="#";const o=xN.keys(e).sort();for(;!Zn(a=o.pop());)Zn(e[a])||(i+=a+":"+HE(e[a])+",");oy.set(e,i)}}else i=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return i},sc=new WeakMap,ON={},sy={},n7="undefined",uA=typeof window!=n7,B6=typeof document!=n7,nnt=()=>uA&&typeof window.requestAnimationFrame!=n7,Bse=(e,t)=>{const n=sc.get(e);return[()=>!Zn(t)&&e.get(t)||ON,r=>{if(!Zn(t)){const i=e.get(t);t in sy||(sy[t]=i),n[5](t,Wd(i,r),i||ON)}},n[6],()=>!Zn(t)&&t in sy?sy[t]:!Zn(t)&&e.get(t)||ON]};let U6=!0;const rnt=()=>U6,[$6,z6]=uA&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Td,Td],int=()=>{const e=B6&&document.visibilityState;return Zn(e)||e!=="hidden"},ant=e=>(B6&&document.addEventListener("visibilitychange",e),$6("focus",e),()=>{B6&&document.removeEventListener("visibilitychange",e),z6("focus",e)}),ont=e=>{const t=()=>{U6=!0,e()},n=()=>{U6=!1};return $6("online",t),$6("offline",n),()=>{z6("online",t),z6("offline",n)}},snt={isOnline:rnt,isVisible:int},lnt={initFocus:ant,initReconnect:ont},nV=!Ye.useId,GE=!uA||"Deno"in window,unt=e=>nnt()?window.requestAnimationFrame(e):setTimeout(e,1),NN=GE?A.useEffect:A.useLayoutEffect,IN=typeof navigator<"u"&&navigator.connection,rV=!GE&&IN&&(["slow-2g","2g"].includes(IN.effectiveType)||IN.saveData),r7=e=>{if(Zl(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?HE(e):"",[e,t]};let cnt=0;const H6=()=>++cnt,Use=0,$se=1,zse=2,dnt=3;var W_={__proto__:null,ERROR_REVALIDATE_EVENT:dnt,FOCUS_EVENT:Use,MUTATE_EVENT:zse,RECONNECT_EVENT:$se};async function Hse(...e){const[t,n,r,i]=e,a=Wd({populateCache:!0,throwOnError:!0},typeof i=="boolean"?{revalidate:i}:i||{});let o=a.populateCache;const s=a.rollbackOnError;let l=a.optimisticData;const u=f=>typeof s=="function"?s(f):s!==!1,c=a.throwOnError;if(Zl(n)){const f=n,m=[],h=t.keys();for(const _ of h)!/^\$(inf|sub)\$/.test(_)&&f(t.get(_)._k)&&m.push(_);return Promise.all(m.map(d))}return d(n);async function d(f){const[m]=r7(f);if(!m)return;const[h,_]=Bse(t,m),[b,S,y,T]=sc.get(t),C=()=>{const H=b[m];return(Zl(a.revalidate)?a.revalidate(h().data,f):a.revalidate!==!1)&&(delete y[m],delete T[m],H&&H[0])?H[0](zse).then(()=>h().data):h().data};if(e.length<3)return C();let O=r,N;const w=H6();S[m]=[w,0];const B=!Zn(l),z=h(),M=z.data,$=z._c,U=Zn($)?M:$;if(B&&(l=Zl(l)?l(U,M):l,_({data:l,_c:U})),Zl(O))try{O=O(U)}catch(H){N=H}if(O&&ent(O))if(O=await O.catch(H=>{N=H}),w!==S[m][0]){if(N)throw N;return O}else N&&B&&u(N)&&(o=!0,_({data:U,_c:oo}));if(o&&!N)if(Zl(o)){const H=o(O,U);_({data:H,error:oo,_c:oo})}else _({data:O,error:oo,_c:oo});if(S[m][1]=H6(),Promise.resolve(C()).then(()=>{_({_c:oo})}),N){if(c)throw N;return}return O}}const iV=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},fnt=(e,t)=>{if(!sc.has(e)){const n=Wd(lnt,t),r={},i=Hse.bind(oo,e);let a=Td;const o={},s=(c,d)=>{const f=o[c]||[];return o[c]=f,f.push(d),()=>f.splice(f.indexOf(d),1)},l=(c,d,f)=>{e.set(c,d);const m=o[c];if(m)for(const h of m)h(d,f)},u=()=>{if(!sc.has(e)&&(sc.set(e,[r,{},{},{},i,l,s]),!GE)){const c=n.initFocus(setTimeout.bind(oo,iV.bind(oo,r,Use))),d=n.initReconnect(setTimeout.bind(oo,iV.bind(oo,r,$se)));a=()=>{c&&c(),d&&d(),sc.delete(e)}}};return u(),[e,i,u,a]}return[e,sc.get(e)[4]]},pnt=(e,t,n,r,i)=>{const a=n.errorRetryCount,o=i.retryCount,s=~~((Math.random()+.5)*(1<<(o<8?o:8)))*n.errorRetryInterval;!Zn(a)&&o>a||setTimeout(r,s,i)},mnt=(e,t)=>HE(e)==HE(t),[Gse,hnt]=fnt(new Map),gnt=Wd({onLoadingSlow:Td,onSuccess:Td,onError:Td,onErrorRetry:pnt,onDiscarded:Td,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:rV?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:rV?5e3:3e3,compare:mnt,isPaused:()=>!1,cache:Gse,mutate:hnt,fallback:{}},snt),_nt=(e,t)=>{const n=Wd(e,t);if(t){const{use:r,fallback:i}=e,{use:a,fallback:o}=t;r&&a&&(n.use=r.concat(a)),i&&o&&(n.fallback=Wd(i,o))}return n},Ent=A.createContext({}),vnt="$inf$",Vse=uA&&window.__SWR_DEVTOOLS_USE__,Snt=Vse?window.__SWR_DEVTOOLS_USE__:[],bnt=()=>{Vse&&(window.__SWR_DEVTOOLS_REACT__=Ye)},ynt=e=>Zl(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],Tnt=()=>Wd(gnt,A.useContext(Ent)),Cnt=e=>(t,n,r)=>e(t,n&&((...a)=>{const[o]=r7(t),[,,,s]=sc.get(Gse);if(o.startsWith(vnt))return n(...a);const l=s[o];return Zn(l)?n(...a):(delete s[o],l)}),r),Rnt=Snt.concat(Cnt),Ant=e=>function(...n){const r=Tnt(),[i,a,o]=ynt(n),s=_nt(r,o);let l=e;const{use:u}=s,c=(u||[]).concat(Rnt);for(let d=c.length;d--;)l=c[d](l);return l(i,a||s.fetcher||null,s)},xnt=(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())}};bnt();const aV=Ye.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e)}),wN={dedupe:!0},Ont=(e,t,n)=>{const{cache:r,compare:i,suspense:a,fallbackData:o,revalidateOnMount:s,revalidateIfStale:l,refreshInterval:u,refreshWhenHidden:c,refreshWhenOffline:d,keepPreviousData:f}=n,[m,h,_,b]=sc.get(r),[S,y]=r7(e),T=A.useRef(!1),C=A.useRef(!1),O=A.useRef(S),N=A.useRef(t),w=A.useRef(n),B=()=>w.current,z=()=>B().isVisible()&&B().isOnline(),[M,$,U,H]=Bse(r,S),Y=A.useRef({}).current,re=Zn(o)?n.fallback[S]:o,ce=(ze,Le)=>{for(const Ve in Y){const Ue=Ve;if(Ue==="data"){if(!i(ze[Ue],Le[Ue])&&(!Zn(ze[Ue])||!i(ye,Le[Ue])))return!1}else if(Le[Ue]!==ze[Ue])return!1}return!0},Z=A.useMemo(()=>{const ze=(()=>!S||!t?!1:Zn(s)?B().isPaused()||a?!1:Zn(l)?!0:l:s)(),Le=Xe=>{const ct=Wd(Xe);return delete ct._k,ze?{isValidating:!0,isLoading:!0,...ct}:ct},Ve=M(),Ue=H(),ft=Le(Ve),dt=Ve===Ue?ft:Le(Ue);let rt=ft;return[()=>{const Xe=Le(M());return ce(Xe,rt)?(rt.data=Xe.data,rt.isLoading=Xe.isLoading,rt.isValidating=Xe.isValidating,rt.error=Xe.error,rt):(rt=Xe,Xe)},()=>dt]},[r,S]),j=Jtt.useSyncExternalStore(A.useCallback(ze=>U(S,(Le,Ve)=>{ce(Ve,Le)||ze()}),[r,S]),Z[0],Z[1]),W=!T.current,k=m[S]&&m[S].length>0,se=j.data,ne=Zn(se)?re:se,G=j.error,Ee=A.useRef(ne),ye=f?Zn(se)?Ee.current:se:ne,ge=(()=>k&&!Zn(G)?!1:W&&!Zn(s)?s:B().isPaused()?!1:a?Zn(ne)?!1:l:Zn(ne)||l)(),De=!!(S&&t&&W&&ge),we=Zn(j.isValidating)?De:j.isValidating,Be=Zn(j.isLoading)?De:j.isLoading,Qe=A.useCallback(async ze=>{const Le=N.current;if(!S||!Le||C.current||B().isPaused())return!1;let Ve,Ue,ft=!0;const dt=ze||{},rt=!_[S]||!dt.dedupe,Xe=()=>nV?!C.current&&S===O.current&&T.current:S===O.current,ct={isValidating:!1,isLoading:!1},lt=()=>{$(ct)},fe=()=>{const Se=_[S];Se&&Se[1]===Ue&&delete _[S]},Ke={isValidating:!0};Zn(M().data)&&(Ke.isLoading=!0);try{if(rt&&($(Ke),n.loadingTimeout&&Zn(M().data)&&setTimeout(()=>{ft&&Xe()&&B().onLoadingSlow(S,n)},n.loadingTimeout),_[S]=[Le(y),H6()]),[Ve,Ue]=_[S],Ve=await Ve,rt&&setTimeout(fe,n.dedupingInterval),!_[S]||_[S][1]!==Ue)return rt&&Xe()&&B().onDiscarded(S),!1;ct.error=oo;const Se=h[S];if(!Zn(Se)&&(Ue<=Se[0]||Ue<=Se[1]||Se[1]===0))return lt(),rt&&Xe()&&B().onDiscarded(S),!1;const Q=M().data;ct.data=i(Q,Ve)?Q:Ve,rt&&Xe()&&B().onSuccess(Ve,S,n)}catch(Se){fe();const Q=B(),{shouldRetryOnError:he}=Q;Q.isPaused()||(ct.error=Se,rt&&Xe()&&(Q.onError(Se,S,Q),(he===!0||Zl(he)&&he(Se))&&(!B().revalidateOnFocus||!B().revalidateOnReconnect||z())&&Q.onErrorRetry(Se,S,Q,ae=>{const _e=m[S];_e&&_e[0]&&_e[0](W_.ERROR_REVALIDATE_EVENT,ae)},{retryCount:(dt.retryCount||0)+1,dedupe:!0})))}return ft=!1,lt(),!0},[S,r]),Ze=A.useCallback((...ze)=>Hse(r,O.current,...ze),[]);if(NN(()=>{N.current=t,w.current=n,Zn(se)||(Ee.current=se)}),NN(()=>{if(!S)return;const ze=Qe.bind(oo,wN);let Le=0;const Ue=xnt(S,m,(ft,dt={})=>{if(ft==W_.FOCUS_EVENT){const rt=Date.now();B().revalidateOnFocus&&rt>Le&&z()&&(Le=rt+B().focusThrottleInterval,ze())}else if(ft==W_.RECONNECT_EVENT)B().revalidateOnReconnect&&z()&&ze();else{if(ft==W_.MUTATE_EVENT)return Qe();if(ft==W_.ERROR_REVALIDATE_EVENT)return Qe(dt)}});return C.current=!1,O.current=S,T.current=!0,$({_k:y}),ge&&(Zn(ne)||GE?ze():unt(ze)),()=>{C.current=!0,Ue()}},[S]),NN(()=>{let ze;function Le(){const Ue=Zl(u)?u(M().data):u;Ue&&ze!==-1&&(ze=setTimeout(Ve,Ue))}function Ve(){!M().error&&(c||B().isVisible())&&(d||B().isOnline())?Qe(wN).then(Le):Le()}return Le(),()=>{ze&&(clearTimeout(ze),ze=-1)}},[u,c,d,S]),A.useDebugValue(ye),a&&Zn(ne)&&S){if(!nV&&GE)throw new Error("Fallback data is required when using suspense in SSR.");N.current=t,w.current=n,C.current=!1;const ze=b[S];if(!Zn(ze)){const Le=Ze(ze);aV(Le)}if(Zn(G)){const Le=Qe(wN);Zn(ye)||(Le.status="fulfilled",Le.value=!0),aV(Le)}else throw G}return{mutate:Ze,get data(){return Y.data=!0,ye},get error(){return Y.error=!0,G},get isValidating(){return Y.isValidating=!0,we},get isLoading(){return Y.isLoading=!0,Be}}},Nnt=Ant(Ont),Int=async e=>{const t=await fetch(e);if(!t.ok)throw new Error("Network response was not ok");const n=t.headers.get("content-type");return n&&n.includes("application/json")?t.json():t.text()},Yse=e=>Nnt(e,Int),wnt=A.lazy(()=>Gtt(()=>import("./react-plotly-b225b63c.js").then(e=>e.r),[])),Dnt=({element:e})=>{const{data:t,error:n,isLoading:r}=Yse(e.url||null);if(r)return v.jsx("div",{children:"Loading..."});if(n)return v.jsx("div",{children:"An error occured"});let i;if(t)i=t;else return null;return v.jsx(A.Suspense,{fallback:v.jsx("div",{children:"Loading..."}),children:v.jsx(wnt,{className:`${e.display}-plotly`,data:i.data,layout:i.layout,frames:i.frames,config:i.config,style:{width:"100%",height:"100%"},useResizeHandler:!0})})},qse=e=>v.jsx(t7,{prefix:"Failed to load chart.",children:v.jsx(Dnt,{...e})});function oV(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);const o=n.slice(i,r).trim();(o||!a)&&t.push(o),i=r+1,r=n.indexOf(",",i)}return t}function Wse(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Mnt=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Lnt=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,knt={};function sV(e,t){return((t||knt).jsx?Lnt:Mnt).test(e)}const Pnt=/[ \t\n\f\r]/g;function Fnt(e){return typeof e=="object"?e.type==="text"?lV(e.value):!1:lV(e)}function lV(e){return e.replace(Pnt,"")===""}let Fv=class{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}};Fv.prototype.property={};Fv.prototype.normal={};Fv.prototype.space=null;function Kse(e,t){const n={},r={};let i=-1;for(;++i<e.length;)Object.assign(n,e[i].property),Object.assign(r,e[i].normal);return new Fv(n,r,t)}function VE(e){return e.toLowerCase()}class Vs{constructor(t,n){this.property=t,this.attribute=n}}Vs.prototype.space=null;Vs.prototype.boolean=!1;Vs.prototype.booleanish=!1;Vs.prototype.overloadedBoolean=!1;Vs.prototype.number=!1;Vs.prototype.commaSeparated=!1;Vs.prototype.spaceSeparated=!1;Vs.prototype.commaOrSpaceSeparated=!1;Vs.prototype.mustUseProperty=!1;Vs.prototype.defined=!1;let Bnt=0;const yn=hm(),xi=hm(),jse=hm(),Nt=hm(),Or=hm(),fh=hm(),ko=hm();function hm(){return 2**++Bnt}const G6=Object.freeze(Object.defineProperty({__proto__:null,boolean:yn,booleanish:xi,commaOrSpaceSeparated:ko,commaSeparated:fh,number:Nt,overloadedBoolean:jse,spaceSeparated:Or},Symbol.toStringTag,{value:"Module"})),DN=Object.keys(G6);class i7 extends Vs{constructor(t,n,r,i){let a=-1;if(super(t,n),uV(this,"space",i),typeof r=="number")for(;++a<DN.length;){const o=DN[a];uV(this,DN[a],(r&G6[o])===G6[o])}}}i7.prototype.defined=!0;function uV(e,t,n){n&&(e[t]=n)}const Unt={}.hasOwnProperty;function xg(e){const t={},n={};let r;for(r in e.properties)if(Unt.call(e.properties,r)){const i=e.properties[r],a=new i7(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[VE(r)]=r,n[VE(a.attribute)]=r}return new Fv(t,n,e.space)}const Qse=xg({space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),Xse=xg({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function Zse(e,t){return t in e?e[t]:t}function Jse(e,t){return Zse(e,t.toLowerCase())}const ele=xg({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:Jse,properties:{xmlns:null,xmlnsXLink:null}}),tle=xg({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:xi,ariaAutoComplete:null,ariaBusy:xi,ariaChecked:xi,ariaColCount:Nt,ariaColIndex:Nt,ariaColSpan:Nt,ariaControls:Or,ariaCurrent:null,ariaDescribedBy:Or,ariaDetails:null,ariaDisabled:xi,ariaDropEffect:Or,ariaErrorMessage:null,ariaExpanded:xi,ariaFlowTo:Or,ariaGrabbed:xi,ariaHasPopup:null,ariaHidden:xi,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Or,ariaLevel:Nt,ariaLive:null,ariaModal:xi,ariaMultiLine:xi,ariaMultiSelectable:xi,ariaOrientation:null,ariaOwns:Or,ariaPlaceholder:null,ariaPosInSet:Nt,ariaPressed:xi,ariaReadOnly:xi,ariaRelevant:null,ariaRequired:xi,ariaRoleDescription:Or,ariaRowCount:Nt,ariaRowIndex:Nt,ariaRowSpan:Nt,ariaSelected:xi,ariaSetSize:Nt,ariaSort:null,ariaValueMax:Nt,ariaValueMin:Nt,ariaValueNow:Nt,ariaValueText:null,role:null}}),$nt=xg({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:Jse,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:fh,acceptCharset:Or,accessKey:Or,action:null,allow:null,allowFullScreen:yn,allowPaymentRequest:yn,allowUserMedia:yn,alt:null,as:null,async:yn,autoCapitalize:null,autoComplete:Or,autoFocus:yn,autoPlay:yn,blocking:Or,capture:null,charSet:null,checked:yn,cite:null,className:Or,cols:Nt,colSpan:null,content:null,contentEditable:xi,controls:yn,controlsList:Or,coords:Nt|fh,crossOrigin:null,data:null,dateTime:null,decoding:null,default:yn,defer:yn,dir:null,dirName:null,disabled:yn,download:jse,draggable:xi,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:yn,formTarget:null,headers:Or,height:Nt,hidden:yn,high:Nt,href:null,hrefLang:null,htmlFor:Or,httpEquiv:Or,id:null,imageSizes:null,imageSrcSet:null,inert:yn,inputMode:null,integrity:null,is:null,isMap:yn,itemId:null,itemProp:Or,itemRef:Or,itemScope:yn,itemType:Or,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:yn,low:Nt,manifest:null,max:null,maxLength:Nt,media:null,method:null,min:null,minLength:Nt,multiple:yn,muted:yn,name:null,nonce:null,noModule:yn,noValidate:yn,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:yn,optimum:Nt,pattern:null,ping:Or,placeholder:null,playsInline:yn,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:yn,referrerPolicy:null,rel:Or,required:yn,reversed:yn,rows:Nt,rowSpan:Nt,sandbox:Or,scope:null,scoped:yn,seamless:yn,selected:yn,shadowRootDelegatesFocus:yn,shadowRootMode:null,shape:null,size:Nt,sizes:null,slot:null,span:Nt,spellCheck:xi,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Nt,step:null,style:null,tabIndex:Nt,target:null,title:null,translate:null,type:null,typeMustMatch:yn,useMap:null,value:xi,width:Nt,wrap:null,align:null,aLink:null,archive:Or,axis:null,background:null,bgColor:null,border:Nt,borderColor:null,bottomMargin:Nt,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:yn,declare:yn,event:null,face:null,frame:null,frameBorder:null,hSpace:Nt,leftMargin:Nt,link:null,longDesc:null,lowSrc:null,marginHeight:Nt,marginWidth:Nt,noResize:yn,noHref:yn,noShade:yn,noWrap:yn,object:null,profile:null,prompt:null,rev:null,rightMargin:Nt,rules:null,scheme:null,scrolling:xi,standby:null,summary:null,text:null,topMargin:Nt,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Nt,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:yn,disableRemotePlayback:yn,prefix:null,property:null,results:Nt,security:null,unselectable:null}}),znt=xg({space:"svg",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"},transform:Zse,properties:{about:ko,accentHeight:Nt,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Nt,amplitude:Nt,arabicForm:null,ascent:Nt,attributeName:null,attributeType:null,azimuth:Nt,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Nt,by:null,calcMode:null,capHeight:Nt,className:Or,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:Nt,diffuseConstant:Nt,direction:null,display:null,dur:null,divisor:Nt,dominantBaseline:null,download:yn,dx:null,dy:null,edgeMode:null,editable:null,elevation:Nt,enableBackground:null,end:null,event:null,exponent:Nt,externalResourcesRequired:null,fill:null,fillOpacity:Nt,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:fh,g2:fh,glyphName:fh,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Nt,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Nt,horizOriginX:Nt,horizOriginY:Nt,id:null,ideographic:Nt,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Nt,k:Nt,k1:Nt,k2:Nt,k3:Nt,k4:Nt,kernelMatrix:ko,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Nt,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:Nt,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:Nt,overlineThickness:Nt,paintOrder:null,panose1:null,path:null,pathLength:Nt,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Or,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Nt,pointsAtY:Nt,pointsAtZ:Nt,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ko,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ko,rev:ko,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ko,requiredFeatures:ko,requiredFonts:ko,requiredFormats:ko,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:Nt,specularExponent:Nt,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Nt,strikethroughThickness:Nt,string:null,stroke:null,strokeDashArray:ko,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Nt,strokeOpacity:Nt,strokeWidth:null,style:null,surfaceScale:Nt,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ko,tabIndex:Nt,tableValues:null,target:null,targetX:Nt,targetY:Nt,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ko,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Nt,underlineThickness:Nt,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Nt,values:null,vAlphabetic:Nt,vMathematical:Nt,vectorEffect:null,vHanging:Nt,vIdeographic:Nt,version:null,vertAdvY:Nt,vertOriginX:Nt,vertOriginY:Nt,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Nt,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),Hnt=/^data[-\w.:]+$/i,cV=/-[a-z]/g,Gnt=/[A-Z]/g;function cA(e,t){const n=VE(t);let r=t,i=Vs;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Hnt.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(cV,Ynt);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!cV.test(a)){let o=a.replace(Gnt,Vnt);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=i7}return new i(r,t)}function Vnt(e){return"-"+e.toLowerCase()}function Ynt(e){return e.charAt(1).toUpperCase()}const qnt={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"},Bv=Kse([Xse,Qse,ele,tle,$nt],"html"),mf=Kse([Xse,Qse,ele,tle,znt],"svg");function dV(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function nle(e){return e.join(" ").trim()}var rle={},fV=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Wnt=/\n/g,Knt=/^\s*/,jnt=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Qnt=/^:\s*/,Xnt=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Znt=/^[;\s]*/,Jnt=/^\s+|\s+$/g,ert=`
|
|
342
342
|
`,pV="/",mV="*",Ep="",trt="comment",nrt="declaration",rrt=function(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(h){var _=h.match(Wnt);_&&(n+=_.length);var b=h.lastIndexOf(ert);r=~b?h.length-b:r+h.length}function a(){var h={line:n,column:r};return function(_){return _.position=new o(h),u(),_}}function o(h){this.start=h,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function s(h){var _=new Error(t.source+":"+n+":"+r+": "+h);if(_.reason=h,_.filename=t.source,_.line=n,_.column=r,_.source=e,!t.silent)throw _}function l(h){var _=h.exec(e);if(_){var b=_[0];return i(b),e=e.slice(b.length),_}}function u(){l(Knt)}function c(h){var _;for(h=h||[];_=d();)_!==!1&&h.push(_);return h}function d(){var h=a();if(!(pV!=e.charAt(0)||mV!=e.charAt(1))){for(var _=2;Ep!=e.charAt(_)&&(mV!=e.charAt(_)||pV!=e.charAt(_+1));)++_;if(_+=2,Ep===e.charAt(_-1))return s("End of comment missing");var b=e.slice(2,_-2);return r+=2,i(b),e=e.slice(_),r+=2,h({type:trt,comment:b})}}function f(){var h=a(),_=l(jnt);if(_){if(d(),!l(Qnt))return s("property missing ':'");var b=l(Xnt),S=h({type:nrt,property:hV(_[0].replace(fV,Ep)),value:b?hV(b[0].replace(fV,Ep)):Ep});return l(Znt),S}}function m(){var h=[];c(h);for(var _;_=f();)_!==!1&&(h.push(_),c(h));return h}return u(),m()};function hV(e){return e?e.replace(Jnt,Ep):Ep}var irt=ai&&ai.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(rle,"__esModule",{value:!0});var art=irt(rrt);function ort(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,art.default)(e),i=typeof t=="function";return r.forEach(function(a){if(a.type==="declaration"){var o=a.property,s=a.value;i?t(o,s,a):s&&(n=n||{},n[o]=s)}}),n}var gV=rle.default=ort;const srt=gV.default||gV,dA=ile("end"),bu=ile("start");function ile(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 lrt(e){const t=bu(e),n=dA(e);if(t&&n)return{start:t,end:n}}function K1(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?_V(e.position):"start"in e||"end"in e?_V(e):"line"in e||"column"in e?V6(e):""}function V6(e){return EV(e&&e.line)+":"+EV(e&&e.column)}function _V(e){return V6(e&&e.start)+"-"+V6(e&&e.end)}function EV(e){return e&&typeof e=="number"?e:1}class Ta extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},o=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?i=t:!a.cause&&t&&(o=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?a.ruleId=r:(a.source=r.slice(0,l),a.ruleId=r.slice(l+1))}if(!a.place&&a.ancestors&&a.ancestors){const l=a.ancestors[a.ancestors.length-1];l&&(a.place=l.position)}const s=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.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=K1(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=o&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual,this.expected,this.note,this.url}}Ta.prototype.file="";Ta.prototype.name="";Ta.prototype.reason="";Ta.prototype.message="";Ta.prototype.stack="";Ta.prototype.column=void 0;Ta.prototype.line=void 0;Ta.prototype.ancestors=void 0;Ta.prototype.cause=void 0;Ta.prototype.fatal=void 0;Ta.prototype.place=void 0;Ta.prototype.ruleId=void 0;Ta.prototype.source=void 0;const a7={}.hasOwnProperty,urt=new Map,crt=/[A-Z]/g,drt=/-([a-z])/g,frt=new Set(["table","tbody","thead","tfoot","tr"]),prt=new Set(["td","th"]),ale="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function mrt(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=yrt(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=brt(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"?mf:Bv,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=ole(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function ole(e,t,n){if(t.type==="element")return hrt(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return grt(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Ert(e,t,n);if(t.type==="mdxjsEsm")return _rt(e,t);if(t.type==="root")return vrt(e,t,n);if(t.type==="text")return Srt(e,t)}function hrt(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=mf,e.schema=i),e.ancestors.push(t);const a=lle(e,t.tagName,!1),o=Trt(e,t);let s=s7(e,t);return frt.has(t.tagName)&&(s=s.filter(function(l){return typeof l=="string"?!Fnt(l):!0})),sle(e,o,a,t),o7(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function grt(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)}YE(e,t.position)}function _rt(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);YE(e,t.position)}function Ert(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=mf,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:lle(e,t.name,!0),o=Crt(e,t),s=s7(e,t);return sle(e,o,a,t),o7(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function vrt(e,t,n){const r={};return o7(r,s7(e,t)),e.create(t,e.Fragment,r,n)}function Srt(e,t){return t.value}function sle(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function o7(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function brt(e,t,n){return r;function r(i,a,o,s){const u=Array.isArray(o.children)?n:t;return s?u(a,o,s):u(a,o)}}function yrt(e,t){return n;function n(r,i,a,o){const s=Array.isArray(a.children),l=bu(r);return t(i,a,o,s,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function Trt(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&a7.call(t.properties,i)){const a=Rrt(e,i,t.properties[i]);if(a){const[o,s]=a;e.tableCellAlignToStyle&&o==="align"&&typeof s=="string"&&prt.has(t.tagName)?r=s:n[o]=s}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Crt(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const o=a.expression;o.type;const s=o.properties[0];s.type,Object.assign(n,e.evaluater.evaluateExpression(s.argument))}else YE(e,t.position);else{const i=r.name;let a;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,a=e.evaluater.evaluateExpression(s.expression)}else YE(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function s7(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:urt;for(;++r<t.children.length;){const a=t.children[r];let o;if(e.passKeys){const l=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(l){const u=i.get(l)||0;o=l+"-"+u,i.set(l,u+1)}}const s=ole(e,a,o);s!==void 0&&n.push(s)}return n}function Rrt(e,t,n){const r=cA(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Wse(n):nle(n)),r.property==="style"){let i=typeof n=="object"?n:Art(e,String(n));return e.stylePropertyNameCase==="css"&&(i=xrt(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?qnt[r.property]||r.property:r.attribute,n]}}function Art(e,t){const n={};try{srt(t,r)}catch(i){if(!e.ignoreInvalidStyle){const a=i,o=new Ta("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=ale+"#cannot-parse-style-attribute",o}}return n;function r(i,a){let o=i;o.slice(0,2)!=="--"&&(o.slice(0,4)==="-ms-"&&(o="ms-"+o.slice(4)),o=o.replace(drt,Nrt)),n[o]=a}}function lle(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let a=-1,o;for(;++a<i.length;){const s=sV(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};o=o?{type:"MemberExpression",object:o,property:s,computed:!!(a&&s.type==="Literal"),optional:!1}:s}r=o}else r=sV(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return a7.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);YE(e)}function YE(e,t){const n=new Ta("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=ale+"#cannot-handle-mdx-estrees-without-createevaluater",n}function xrt(e){const t={};let n;for(n in e)a7.call(e,n)&&(t[Ort(n)]=e[n]);return t}function Ort(e){let t=e.replace(crt,Irt);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Nrt(e,t){return t.toUpperCase()}function Irt(e){return"-"+e.toLowerCase()}const MN={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"]},wrt={};function l7(e,t){const n=t||wrt,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return ule(e,r,i)}function ule(e,t,n){if(Drt(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 vV(e.children,t,n)}return Array.isArray(e)?vV(e,t,n):""}function vV(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=ule(e[i],t,n);return r.join("")}function Drt(e){return!!(e&&typeof e=="object")}const SV=document.createElement("i");function u7(e){const t="&"+e+";";SV.innerHTML=t;const n=SV.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function jo(e,t,n,r){const i=e.length;let a=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function Ts(e,t){return e.length>0?(jo(e,e.length,0,t),e):t}const bV={}.hasOwnProperty;function cle(e){const t={};let n=-1;for(;++n<e.length;)Mrt(t,e[n]);return t}function Mrt(e,t){let n;for(n in t){const i=(bV.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let o;if(a)for(o in a){bV.call(i,o)||(i[o]=[]);const s=a[o];Lrt(i[o],Array.isArray(s)?s:s?[s]:[])}}}function Lrt(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);jo(e,0,0,r)}function dle(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 Sl(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ka=hf(/[A-Za-z]/),Ea=hf(/[\dA-Za-z]/),krt=hf(/[#-'*+\--9=?A-Z^-~]/);function wC(e){return e!==null&&(e<32||e===127)}const Y6=hf(/\d/),Prt=hf(/[\dA-Fa-f]/),Frt=hf(/[!-/:-@[-`{-~]/);function Wt(e){return e!==null&&e<-2}function yr(e){return e!==null&&(e<0||e===32)}function kn(e){return e===-2||e===-1||e===32}const fA=hf(/\p{P}|\p{S}/u),Qp=hf(/\s/);function hf(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Og(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let o="";if(a===37&&Ea(e.charCodeAt(n+1))&&Ea(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){const s=e.charCodeAt(n+1);a<56320&&s>56319&&s<57344?(o=String.fromCharCode(a,s),i=1):o="�"}else o=String.fromCharCode(a);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Mn(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(l){return kn(l)?(e.enter(n),s(l)):t(l)}function s(l){return kn(l)&&a++<i?(e.consume(l),s):(e.exit(n),t(l))}}const Brt={tokenize:Urt};function Urt(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"),Mn(e,t,"linePrefix")}function i(s){return e.enter("paragraph"),a(s)}function a(s){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,o(s)}function o(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return Wt(s)?(e.consume(s),e.exit("chunkText"),a):(e.consume(s),o)}}const $rt={tokenize:zrt},yV={tokenize:Hrt};function zrt(e){const t=this,n=[];let r=0,i,a,o;return s;function s(T){if(r<n.length){const C=n[r];return t.containerState=C[1],e.attempt(C[0].continuation,l,u)(T)}return u(T)}function l(T){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&y();const C=t.events.length;let O=C,N;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){N=t.events[O][1].end;break}S(r);let w=C;for(;w<t.events.length;)t.events[w][1].end=Object.assign({},N),w++;return jo(t.events,O+1,0,t.events.slice(C)),t.events.length=w,u(T)}return s(T)}function u(T){if(r===n.length){if(!i)return f(T);if(i.currentConstruct&&i.currentConstruct.concrete)return h(T);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(yV,c,d)(T)}function c(T){return i&&y(),S(r),f(T)}function d(T){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,h(T)}function f(T){return t.containerState={},e.attempt(yV,m,h)(T)}function m(T){return r++,n.push([t.currentConstruct,t.containerState]),f(T)}function h(T){if(T===null){i&&y(),S(0),e.consume(T);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:a,_tokenizer:i}),_(T)}function _(T){if(T===null){b(e.exit("chunkFlow"),!0),S(0),e.consume(T);return}return Wt(T)?(e.consume(T),b(e.exit("chunkFlow")),r=0,t.interrupt=void 0,s):(e.consume(T),_)}function b(T,C){const O=t.sliceStream(T);if(C&&O.push(null),T.previous=a,a&&(a.next=T),a=T,i.defineSkip(T.start),i.write(O),t.parser.lazy[T.start.line]){let N=i.events.length;for(;N--;)if(i.events[N][1].start.offset<o&&(!i.events[N][1].end||i.events[N][1].end.offset>o))return;const w=t.events.length;let B=w,z,M;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){if(z){M=t.events[B][1].end;break}z=!0}for(S(r),N=w;N<t.events.length;)t.events[N][1].end=Object.assign({},M),N++;jo(t.events,B+1,0,t.events.slice(w)),t.events.length=N}}function S(T){let C=n.length;for(;C-- >T;){const O=n[C];t.containerState=O[1],O[0].exit.call(t,e)}n.length=T}function y(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Hrt(e,t,n){return Mn(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function DC(e){if(e===null||yr(e)||Qp(e))return 1;if(fA(e))return 2}function pA(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const q6={name:"attention",tokenize:Vrt,resolveAll:Grt};function Grt(e,t){let n=-1,r,i,a,o,s,l,u,c;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 d=Object.assign({},e[r][1].end),f=Object.assign({},e[n][1].start);TV(d,-l),TV(f,l),o={type:l>1?"strongSequence":"emphasisSequence",start:d,end:Object.assign({},e[r][1].end)},s={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:f},a={type:l>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},i={type:l>1?"strong":"emphasis",start:Object.assign({},o.start),end:Object.assign({},s.end)},e[r][1].end=Object.assign({},o.start),e[n][1].start=Object.assign({},s.end),u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Ts(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Ts(u,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",a,t]]),u=Ts(u,pA(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Ts(u,[["exit",a,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,u=Ts(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,jo(e,r-1,n-r+3,u),n=r+u.length-c-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Vrt(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=DC(r);let a;return o;function o(l){return a=l,e.enter("attentionSequence"),s(l)}function s(l){if(l===a)return e.consume(l),s;const u=e.exit("attentionSequence"),c=DC(l),d=!c||c===2&&i||n.includes(l),f=!i||i===2&&c||n.includes(r);return u._open=!!(a===42?d:d&&(i||!f)),u._close=!!(a===42?f:f&&(c||!d)),t(l)}}function TV(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Yrt={name:"autolink",tokenize:qrt};function qrt(e,t,n){let r=0;return i;function i(m){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(m){return ka(m)?(e.consume(m),o):u(m)}function o(m){return m===43||m===45||m===46||Ea(m)?(r=1,s(m)):u(m)}function s(m){return m===58?(e.consume(m),r=0,l):(m===43||m===45||m===46||Ea(m))&&r++<32?(e.consume(m),s):(r=0,u(m))}function l(m){return m===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):m===null||m===32||m===60||wC(m)?n(m):(e.consume(m),l)}function u(m){return m===64?(e.consume(m),c):krt(m)?(e.consume(m),u):n(m)}function c(m){return Ea(m)?d(m):n(m)}function d(m){return m===46?(e.consume(m),r=0,c):m===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):f(m)}function f(m){if((m===45||Ea(m))&&r++<63){const h=m===45?f:d;return e.consume(m),h}return n(m)}}const Uv={tokenize:Wrt,partial:!0};function Wrt(e,t,n){return r;function r(a){return kn(a)?Mn(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||Wt(a)?t(a):n(a)}}const fle={name:"blockQuote",tokenize:Krt,continuation:{tokenize:jrt},exit:Qrt};function Krt(e,t,n){const r=this;return i;function i(o){if(o===62){const s=r.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),a}return n(o)}function a(o){return kn(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function jrt(e,t,n){const r=this;return i;function i(o){return kn(o)?Mn(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):a(o)}function a(o){return e.attempt(fle,t,n)(o)}}function Qrt(e){e.exit("blockQuote")}const ple={name:"characterEscape",tokenize:Xrt};function Xrt(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),i}function i(a){return Frt(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const mle={name:"characterReference",tokenize:Zrt};function Zrt(e,t,n){const r=this;let i=0,a,o;return s;function s(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),l}function l(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),a=31,o=Ea,c(d))}function u(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,o=Prt,c):(e.enter("characterReferenceValue"),a=7,o=Y6,c(d))}function c(d){if(d===59&&i){const f=e.exit("characterReferenceValue");return o===Ea&&!u7(r.sliceSerialize(f))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(d)&&i++<a?(e.consume(d),c):n(d)}}const CV={tokenize:eit,partial:!0},RV={name:"codeFenced",tokenize:Jrt,concrete:!0};function Jrt(e,t,n){const r=this,i={tokenize:O,partial:!0};let a=0,o=0,s;return l;function l(N){return u(N)}function u(N){const w=r.events[r.events.length-1];return a=w&&w[1].type==="linePrefix"?w[2].sliceSerialize(w[1],!0).length:0,s=N,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(N)}function c(N){return N===s?(o++,e.consume(N),c):o<3?n(N):(e.exit("codeFencedFenceSequence"),kn(N)?Mn(e,d,"whitespace")(N):d(N))}function d(N){return N===null||Wt(N)?(e.exit("codeFencedFence"),r.interrupt?t(N):e.check(CV,_,C)(N)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(N))}function f(N){return N===null||Wt(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(N)):kn(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Mn(e,m,"whitespace")(N)):N===96&&N===s?n(N):(e.consume(N),f)}function m(N){return N===null||Wt(N)?d(N):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),h(N))}function h(N){return N===null||Wt(N)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(N)):N===96&&N===s?n(N):(e.consume(N),h)}function _(N){return e.attempt(i,C,b)(N)}function b(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),S}function S(N){return a>0&&kn(N)?Mn(e,y,"linePrefix",a+1)(N):y(N)}function y(N){return N===null||Wt(N)?e.check(CV,_,C)(N):(e.enter("codeFlowValue"),T(N))}function T(N){return N===null||Wt(N)?(e.exit("codeFlowValue"),y(N)):(e.consume(N),T)}function C(N){return e.exit("codeFenced"),t(N)}function O(N,w,B){let z=0;return M;function M(re){return N.enter("lineEnding"),N.consume(re),N.exit("lineEnding"),$}function $(re){return N.enter("codeFencedFence"),kn(re)?Mn(N,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(re):U(re)}function U(re){return re===s?(N.enter("codeFencedFenceSequence"),H(re)):B(re)}function H(re){return re===s?(z++,N.consume(re),H):z>=o?(N.exit("codeFencedFenceSequence"),kn(re)?Mn(N,Y,"whitespace")(re):Y(re)):B(re)}function Y(re){return re===null||Wt(re)?(N.exit("codeFencedFence"),w(re)):B(re)}}}function eit(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const LN={name:"codeIndented",tokenize:nit},tit={tokenize:rit,partial:!0};function nit(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),Mn(e,a,"linePrefix",4+1)(u)}function a(u){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?o(u):n(u)}function o(u){return u===null?l(u):Wt(u)?e.attempt(tit,o,l)(u):(e.enter("codeFlowValue"),s(u))}function s(u){return u===null||Wt(u)?(e.exit("codeFlowValue"),o(u)):(e.consume(u),s)}function l(u){return e.exit("codeIndented"),t(u)}}function rit(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):Wt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):Mn(e,a,"linePrefix",4+1)(o)}function a(o){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(o):Wt(o)?i(o):n(o)}}const iit={name:"codeText",tokenize:sit,resolve:ait,previous:oit};function ait(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 oit(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function sit(e,t,n){let r=0,i,a;return o;function o(d){return e.enter("codeText"),e.enter("codeTextSequence"),s(d)}function s(d){return d===96?(e.consume(d),r++,s):(e.exit("codeTextSequence"),l(d))}function l(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),l):d===96?(a=e.enter("codeTextSequence"),i=0,c(d)):Wt(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),l):(e.enter("codeTextData"),u(d))}function u(d){return d===null||d===32||d===96||Wt(d)?(e.exit("codeTextData"),l(d)):(e.consume(d),u)}function c(d){return d===96?(e.consume(d),i++,c):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(a.type="codeTextData",u(d))}}function hle(e){const t={};let n=-1,r,i,a,o,s,l,u;for(;++n<e.length;){for(;n in t;)n=t[n];if(r=e[n],n&&r[1].type==="chunkFlow"&&e[n-1][1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,a=0,a<l.length&&l[a][1].type==="lineEndingBlank"&&(a+=2),a<l.length&&l[a][1].type==="content"))for(;++a<l.length&&l[a][1].type!=="content";)l[a][1].type==="chunkText"&&(l[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,lit(e,n)),n=t[n],u=!0);else if(r[1]._container){for(a=n,i=void 0;a--&&(o=e[a],o[1].type==="lineEnding"||o[1].type==="lineEndingBlank");)o[0]==="enter"&&(i&&(e[i][1].type="lineEndingBlank"),o[1].type="lineEnding",i=a);i&&(r[1].end=Object.assign({},e[i][1].start),s=e.slice(i,n),s.unshift(r),jo(e,i,n-i+1,s))}}return!u}function lit(e,t){const n=e[t][1],r=e[t][2];let i=t-1;const a=[],o=n._tokenizer||r.parser[n.contentType](n.start),s=o.events,l=[],u={};let c,d,f=-1,m=n,h=0,_=0;const b=[_];for(;m;){for(;e[++i][1]!==m;);a.push(i),m._tokenizer||(c=r.sliceStream(m),m.next||c.push(null),d&&o.defineSkip(m.start),m._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(c),m._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=m,m=m.next}for(m=n;++f<s.length;)s[f][0]==="exit"&&s[f-1][0]==="enter"&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(_=f+1,b.push(_),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(o.events=[],m?(m._tokenizer=void 0,m.previous=void 0):b.pop(),f=b.length;f--;){const S=s.slice(b[f],b[f+1]),y=a.pop();l.unshift([y,y+S.length-1]),jo(e,y,2,S)}for(f=-1;++f<l.length;)u[h+l[f][0]]=h+l[f][1],h+=l[f][1]-l[f][0]-1;return u}const uit={tokenize:fit,resolve:dit},cit={tokenize:pit,partial:!0};function dit(e){return hle(e),e}function fit(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?a(s):Wt(s)?e.check(cit,o,a)(s):(e.consume(s),i)}function a(s){return e.exit("chunkContent"),e.exit("content"),t(s)}function o(s){return e.consume(s),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function pit(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Mn(e,a,"linePrefix")}function a(o){if(o===null||Wt(o))return n(o);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(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function gle(e,t,n,r,i,a,o,s,l){const u=l||Number.POSITIVE_INFINITY;let c=0;return d;function d(S){return S===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(S),e.exit(a),f):S===null||S===32||S===41||wC(S)?n(S):(e.enter(r),e.enter(o),e.enter(s),e.enter("chunkString",{contentType:"string"}),_(S))}function f(S){return S===62?(e.enter(a),e.consume(S),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),m(S))}function m(S){return S===62?(e.exit("chunkString"),e.exit(s),f(S)):S===null||S===60||Wt(S)?n(S):(e.consume(S),S===92?h:m)}function h(S){return S===60||S===62||S===92?(e.consume(S),m):m(S)}function _(S){return!c&&(S===null||S===41||yr(S))?(e.exit("chunkString"),e.exit(s),e.exit(o),e.exit(r),t(S)):c<u&&S===40?(e.consume(S),c++,_):S===41?(e.consume(S),c--,_):S===null||S===32||S===40||wC(S)?n(S):(e.consume(S),S===92?b:_)}function b(S){return S===40||S===41||S===92?(e.consume(S),_):_(S)}}function _le(e,t,n,r,i,a){const o=this;let s=0,l;return u;function u(m){return e.enter(r),e.enter(i),e.consume(m),e.exit(i),e.enter(a),c}function c(m){return s>999||m===null||m===91||m===93&&!l||m===94&&!s&&"_hiddenFootnoteSupport"in o.parser.constructs?n(m):m===93?(e.exit(a),e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):Wt(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===null||m===91||m===93||Wt(m)||s++>999?(e.exit("chunkString"),c(m)):(e.consume(m),l||(l=!kn(m)),m===92?f:d)}function f(m){return m===91||m===92||m===93?(e.consume(m),s++,d):d(m)}}function Ele(e,t,n,r,i,a){let o;return s;function s(f){return f===34||f===39||f===40?(e.enter(r),e.enter(i),e.consume(f),e.exit(i),o=f===40?41:f,l):n(f)}function l(f){return f===o?(e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):(e.enter(a),u(f))}function u(f){return f===o?(e.exit(a),l(o)):f===null?n(f):Wt(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Mn(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===o||f===null||Wt(f)?(e.exit("chunkString"),u(f)):(e.consume(f),f===92?d:c)}function d(f){return f===o||f===92?(e.consume(f),c):c(f)}}function j1(e,t){let n;return r;function r(i){return Wt(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):kn(i)?Mn(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const mit={name:"definition",tokenize:git},hit={tokenize:_it,partial:!0};function git(e,t,n){const r=this;let i;return a;function a(m){return e.enter("definition"),o(m)}function o(m){return _le.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function s(m){return i=Sl(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),l):n(m)}function l(m){return yr(m)?j1(e,u)(m):u(m)}function u(m){return gle(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function c(m){return e.attempt(hit,d,d)(m)}function d(m){return kn(m)?Mn(e,f,"whitespace")(m):f(m)}function f(m){return m===null||Wt(m)?(e.exit("definition"),r.parser.defined.push(i),t(m)):n(m)}}function _it(e,t,n){return r;function r(s){return yr(s)?j1(e,i)(s):n(s)}function i(s){return Ele(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function a(s){return kn(s)?Mn(e,o,"whitespace")(s):o(s)}function o(s){return s===null||Wt(s)?t(s):n(s)}}const Eit={name:"hardBreakEscape",tokenize:vit};function vit(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return Wt(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const Sit={name:"headingAtx",tokenize:yit,resolve:bit};function bit(e,t){let n=e.length-2,r=3,i,a;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},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},jo(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function yit(e,t,n){let r=0;return i;function i(c){return e.enter("atxHeading"),a(c)}function a(c){return e.enter("atxHeadingSequence"),o(c)}function o(c){return c===35&&r++<6?(e.consume(c),o):c===null||yr(c)?(e.exit("atxHeadingSequence"),s(c)):n(c)}function s(c){return c===35?(e.enter("atxHeadingSequence"),l(c)):c===null||Wt(c)?(e.exit("atxHeading"),t(c)):kn(c)?Mn(e,s,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function l(c){return c===35?(e.consume(c),l):(e.exit("atxHeadingSequence"),s(c))}function u(c){return c===null||c===35||yr(c)?(e.exit("atxHeadingText"),s(c)):(e.consume(c),u)}}const Tit=["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"],AV=["pre","script","style","textarea"],Cit={name:"htmlFlow",tokenize:Oit,resolveTo:xit,concrete:!0},Rit={tokenize:Iit,partial:!0},Ait={tokenize:Nit,partial:!0};function xit(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 Oit(e,t,n){const r=this;let i,a,o,s,l;return u;function u(G){return c(G)}function c(G){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(G),d}function d(G){return G===33?(e.consume(G),f):G===47?(e.consume(G),a=!0,_):G===63?(e.consume(G),i=3,r.interrupt?t:k):ka(G)?(e.consume(G),o=String.fromCharCode(G),b):n(G)}function f(G){return G===45?(e.consume(G),i=2,m):G===91?(e.consume(G),i=5,s=0,h):ka(G)?(e.consume(G),i=4,r.interrupt?t:k):n(G)}function m(G){return G===45?(e.consume(G),r.interrupt?t:k):n(G)}function h(G){const Ee="CDATA[";return G===Ee.charCodeAt(s++)?(e.consume(G),s===Ee.length?r.interrupt?t:U:h):n(G)}function _(G){return ka(G)?(e.consume(G),o=String.fromCharCode(G),b):n(G)}function b(G){if(G===null||G===47||G===62||yr(G)){const Ee=G===47,ye=o.toLowerCase();return!Ee&&!a&&AV.includes(ye)?(i=1,r.interrupt?t(G):U(G)):Tit.includes(o.toLowerCase())?(i=6,Ee?(e.consume(G),S):r.interrupt?t(G):U(G)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(G):a?y(G):T(G))}return G===45||Ea(G)?(e.consume(G),o+=String.fromCharCode(G),b):n(G)}function S(G){return G===62?(e.consume(G),r.interrupt?t:U):n(G)}function y(G){return kn(G)?(e.consume(G),y):M(G)}function T(G){return G===47?(e.consume(G),M):G===58||G===95||ka(G)?(e.consume(G),C):kn(G)?(e.consume(G),T):M(G)}function C(G){return G===45||G===46||G===58||G===95||Ea(G)?(e.consume(G),C):O(G)}function O(G){return G===61?(e.consume(G),N):kn(G)?(e.consume(G),O):T(G)}function N(G){return G===null||G===60||G===61||G===62||G===96?n(G):G===34||G===39?(e.consume(G),l=G,w):kn(G)?(e.consume(G),N):B(G)}function w(G){return G===l?(e.consume(G),l=null,z):G===null||Wt(G)?n(G):(e.consume(G),w)}function B(G){return G===null||G===34||G===39||G===47||G===60||G===61||G===62||G===96||yr(G)?O(G):(e.consume(G),B)}function z(G){return G===47||G===62||kn(G)?T(G):n(G)}function M(G){return G===62?(e.consume(G),$):n(G)}function $(G){return G===null||Wt(G)?U(G):kn(G)?(e.consume(G),$):n(G)}function U(G){return G===45&&i===2?(e.consume(G),ce):G===60&&i===1?(e.consume(G),Z):G===62&&i===4?(e.consume(G),se):G===63&&i===3?(e.consume(G),k):G===93&&i===5?(e.consume(G),W):Wt(G)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Rit,ne,H)(G)):G===null||Wt(G)?(e.exit("htmlFlowData"),H(G)):(e.consume(G),U)}function H(G){return e.check(Ait,Y,ne)(G)}function Y(G){return e.enter("lineEnding"),e.consume(G),e.exit("lineEnding"),re}function re(G){return G===null||Wt(G)?H(G):(e.enter("htmlFlowData"),U(G))}function ce(G){return G===45?(e.consume(G),k):U(G)}function Z(G){return G===47?(e.consume(G),o="",j):U(G)}function j(G){if(G===62){const Ee=o.toLowerCase();return AV.includes(Ee)?(e.consume(G),se):U(G)}return ka(G)&&o.length<8?(e.consume(G),o+=String.fromCharCode(G),j):U(G)}function W(G){return G===93?(e.consume(G),k):U(G)}function k(G){return G===62?(e.consume(G),se):G===45&&i===2?(e.consume(G),k):U(G)}function se(G){return G===null||Wt(G)?(e.exit("htmlFlowData"),ne(G)):(e.consume(G),se)}function ne(G){return e.exit("htmlFlow"),t(G)}}function Nit(e,t,n){const r=this;return i;function i(o){return Wt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):n(o)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function Iit(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Uv,t,n)}}const wit={name:"htmlText",tokenize:Dit};function Dit(e,t,n){const r=this;let i,a,o;return s;function s(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),l}function l(k){return k===33?(e.consume(k),u):k===47?(e.consume(k),O):k===63?(e.consume(k),T):ka(k)?(e.consume(k),B):n(k)}function u(k){return k===45?(e.consume(k),c):k===91?(e.consume(k),a=0,h):ka(k)?(e.consume(k),y):n(k)}function c(k){return k===45?(e.consume(k),m):n(k)}function d(k){return k===null?n(k):k===45?(e.consume(k),f):Wt(k)?(o=d,Z(k)):(e.consume(k),d)}function f(k){return k===45?(e.consume(k),m):d(k)}function m(k){return k===62?ce(k):k===45?f(k):d(k)}function h(k){const se="CDATA[";return k===se.charCodeAt(a++)?(e.consume(k),a===se.length?_:h):n(k)}function _(k){return k===null?n(k):k===93?(e.consume(k),b):Wt(k)?(o=_,Z(k)):(e.consume(k),_)}function b(k){return k===93?(e.consume(k),S):_(k)}function S(k){return k===62?ce(k):k===93?(e.consume(k),S):_(k)}function y(k){return k===null||k===62?ce(k):Wt(k)?(o=y,Z(k)):(e.consume(k),y)}function T(k){return k===null?n(k):k===63?(e.consume(k),C):Wt(k)?(o=T,Z(k)):(e.consume(k),T)}function C(k){return k===62?ce(k):T(k)}function O(k){return ka(k)?(e.consume(k),N):n(k)}function N(k){return k===45||Ea(k)?(e.consume(k),N):w(k)}function w(k){return Wt(k)?(o=w,Z(k)):kn(k)?(e.consume(k),w):ce(k)}function B(k){return k===45||Ea(k)?(e.consume(k),B):k===47||k===62||yr(k)?z(k):n(k)}function z(k){return k===47?(e.consume(k),ce):k===58||k===95||ka(k)?(e.consume(k),M):Wt(k)?(o=z,Z(k)):kn(k)?(e.consume(k),z):ce(k)}function M(k){return k===45||k===46||k===58||k===95||Ea(k)?(e.consume(k),M):$(k)}function $(k){return k===61?(e.consume(k),U):Wt(k)?(o=$,Z(k)):kn(k)?(e.consume(k),$):z(k)}function U(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),i=k,H):Wt(k)?(o=U,Z(k)):kn(k)?(e.consume(k),U):(e.consume(k),Y)}function H(k){return k===i?(e.consume(k),i=void 0,re):k===null?n(k):Wt(k)?(o=H,Z(k)):(e.consume(k),H)}function Y(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||yr(k)?z(k):(e.consume(k),Y)}function re(k){return k===47||k===62||yr(k)?z(k):n(k)}function ce(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):n(k)}function Z(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),j}function j(k){return kn(k)?Mn(e,W,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):W(k)}function W(k){return e.enter("htmlTextData"),o(k)}}const c7={name:"labelEnd",tokenize:Bit,resolveTo:Fit,resolveAll:Pit},Mit={tokenize:Uit},Lit={tokenize:$it},kit={tokenize:zit};function Pit(e){let t=-1;for(;++t<e.length;){const n=e[t][1];(n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd")&&(e.splice(t+1,n.type==="labelImage"?4:2),n.type="data",t++)}return e}function Fit(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(a=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const l={type:e[a][1].type==="labelLink"?"link":"image",start:Object.assign({},e[a][1].start),end:Object.assign({},e[e.length-1][1].end)},u={type:"label",start:Object.assign({},e[a][1].start),end:Object.assign({},e[o][1].end)},c={type:"labelText",start:Object.assign({},e[a+r+2][1].end),end:Object.assign({},e[o-2][1].start)};return s=[["enter",l,t],["enter",u,t]],s=Ts(s,e.slice(a+1,a+r+3)),s=Ts(s,[["enter",c,t]]),s=Ts(s,pA(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=Ts(s,[["exit",c,t],e[o-2],e[o-1],["exit",u,t]]),s=Ts(s,e.slice(o+1)),s=Ts(s,[["exit",l,t]]),jo(e,a,e.length,s),e}function Bit(e,t,n){const r=this;let i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(f){return a?a._inactive?d(f):(o=r.parser.defined.includes(Sl(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),l):n(f)}function l(f){return f===40?e.attempt(Mit,c,o?c:d)(f):f===91?e.attempt(Lit,c,o?u:d)(f):o?c(f):d(f)}function u(f){return e.attempt(kit,c,d)(f)}function c(f){return t(f)}function d(f){return a._balanced=!0,n(f)}}function Uit(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return yr(d)?j1(e,a)(d):a(d)}function a(d){return d===41?c(d):gle(e,o,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function o(d){return yr(d)?j1(e,l)(d):c(d)}function s(d){return n(d)}function l(d){return d===34||d===39||d===40?Ele(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):c(d)}function u(d){return yr(d)?j1(e,c)(d):c(d)}function c(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function $it(e,t,n){const r=this;return i;function i(s){return _le.call(r,e,a,o,"reference","referenceMarker","referenceString")(s)}function a(s){return r.parser.defined.includes(Sl(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(s):n(s)}function o(s){return n(s)}}function zit(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),i}function i(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const Hit={name:"labelStartImage",tokenize:Git,resolveAll:c7.resolveAll};function Git(e,t,n){const r=this;return i;function i(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),a}function a(s){return s===91?(e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),o):n(s)}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const Vit={name:"labelStartLink",tokenize:Yit,resolveAll:c7.resolveAll};function Yit(e,t,n){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),a}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const kN={name:"lineEnding",tokenize:qit};function qit(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Mn(e,t,"linePrefix")}}const ST={name:"thematicBreak",tokenize:Wit};function Wit(e,t,n){let r=0,i;return a;function a(u){return e.enter("thematicBreak"),o(u)}function o(u){return i=u,s(u)}function s(u){return u===i?(e.enter("thematicBreakSequence"),l(u)):r>=3&&(u===null||Wt(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===i?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),kn(u)?Mn(e,s,"whitespace")(u):s(u))}}const no={name:"list",tokenize:Qit,continuation:{tokenize:Xit},exit:Jit},Kit={tokenize:eat,partial:!0},jit={tokenize:Zit,partial:!0};function Qit(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(m){const h=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(h==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:Y6(m)){if(r.containerState.type||(r.containerState.type=h,e.enter(h,{_container:!0})),h==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(ST,n,u)(m):u(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(m)}return n(m)}function l(m){return Y6(m)&&++o<10?(e.consume(m),l):(!r.interrupt||o<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),u(m)):n(m)}function u(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(Uv,r.interrupt?n:c,e.attempt(Kit,f,d))}function c(m){return r.containerState.initialBlankLine=!0,a++,f(m)}function d(m){return kn(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),f):n(m)}function f(m){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function Xit(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Uv,i,a);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Mn(e,t,"listItemIndent",r.containerState.size+1)(s)}function a(s){return r.containerState.furtherBlankLines||!kn(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(jit,t,o)(s))}function o(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,Mn(e,e.attempt(no,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function Zit(e,t,n){const r=this;return Mn(e,i,"listItemIndent",r.containerState.size+1);function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(a):n(a)}}function Jit(e){e.exit(this.containerState.type)}function eat(e,t,n){const r=this;return Mn(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4+1);function i(a){const o=r.events[r.events.length-1];return!kn(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const xV={name:"setextUnderline",tokenize:nat,resolveTo:tat};function tat(e,t){let n=e.length,r,i,a;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),!a&&e[n][1].type==="definition"&&(a=n);const o={type:"setextHeading",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",o,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[a][1].end)):e[r][1]=o,e.push(["exit",o,t]),e}function nat(e,t,n){const r=this;let i;return a;function a(u){let c=r.events.length,d;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){d=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=u,o(u)):n(u)}function o(u){return e.enter("setextHeadingLineSequence"),s(u)}function s(u){return u===i?(e.consume(u),s):(e.exit("setextHeadingLineSequence"),kn(u)?Mn(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||Wt(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const rat={tokenize:iat};function iat(e){const t=this,n=e.attempt(Uv,r,e.attempt(this.parser.constructs.flowInitial,i,Mn(e,e.attempt(this.parser.constructs.flow,i,e.attempt(uit,i)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const aat={resolveAll:Sle()},oat=vle("string"),sat=vle("text");function vle(e){return{tokenize:t,resolveAll:Sle(e==="text"?lat:void 0)};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,o,s);return o;function o(c){return u(c)?a(c):s(c)}function s(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),l}function l(c){return u(c)?(n.exit("data"),a(c)):(n.consume(c),l)}function u(c){if(c===null)return!0;const d=i[c];let f=-1;if(d)for(;++f<d.length;){const m=d[f];if(!m.previous||m.previous.call(r,r.previous))return!0}return!1}}}function Sle(e){return t;function t(n,r){let i=-1,a;for(;++i<=n.length;)a===void 0?n[i]&&n[i][1].type==="data"&&(a=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==a+2&&(n[a][1].end=n[i-1][1].end,n.splice(a+2,i-a-2),i=a+2),a=void 0);return e?e(n,r):n}}function lat(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 a=i.length,o=-1,s=0,l;for(;a--;){const u=i[a];if(typeof u=="string"){for(o=u.length;u.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(u===-2)l=!0,s++;else if(u!==-1){a++;break}}if(s){const u={type:n===e.length||l||s<2?"lineSuffix":"hardBreakTrailing",start:{line:r.end.line,column:r.end.column-s,offset:r.end.offset-s,_index:r.start._index+a,_bufferIndex:a?o:r.start._bufferIndex+o},end:Object.assign({},r.end)};r.end=Object.assign({},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}function uat(e,t,n){let r=Object.assign(n?Object.assign({},n):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const i={},a=[];let o=[],s=[];const l={consume:y,enter:T,exit:C,attempt:w(O),check:w(N),interrupt:w(N,{interrupt:!0})},u={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:m,sliceSerialize:f,now:h,defineSkip:_,write:d};let c=t.tokenize.call(u,l);return t.resolveAll&&a.push(t),u;function d($){return o=Ts(o,$),b(),o[o.length-1]!==null?[]:(B(t,0),u.events=pA(a,u.events,u),u.events)}function f($,U){return dat(m($),U)}function m($){return cat(o,$)}function h(){const{line:$,column:U,offset:H,_index:Y,_bufferIndex:re}=r;return{line:$,column:U,offset:H,_index:Y,_bufferIndex:re}}function _($){i[$.line]=$.column,M()}function b(){let $;for(;r._index<o.length;){const U=o[r._index];if(typeof U=="string")for($=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===$&&r._bufferIndex<U.length;)S(U.charCodeAt(r._bufferIndex));else S(U)}}function S($){c=c($)}function y($){Wt($)?(r.line++,r.column=1,r.offset+=$===-3?2:1,M()):$!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=$}function T($,U){const H=U||{};return H.type=$,H.start=h(),u.events.push(["enter",H,u]),s.push(H),H}function C($){const U=s.pop();return U.end=h(),u.events.push(["exit",U,u]),U}function O($,U){B($,U.from)}function N($,U){U.restore()}function w($,U){return H;function H(Y,re,ce){let Z,j,W,k;return Array.isArray(Y)?ne(Y):"tokenize"in Y?ne([Y]):se(Y);function se(ge){return De;function De(we){const Be=we!==null&&ge[we],Qe=we!==null&&ge.null,Ze=[...Array.isArray(Be)?Be:Be?[Be]:[],...Array.isArray(Qe)?Qe:Qe?[Qe]:[]];return ne(Ze)(we)}}function ne(ge){return Z=ge,j=0,ge.length===0?ce:G(ge[j])}function G(ge){return De;function De(we){return k=z(),W=ge,ge.partial||(u.currentConstruct=ge),ge.name&&u.parser.constructs.disable.null.includes(ge.name)?ye():ge.tokenize.call(U?Object.assign(Object.create(u),U):u,l,Ee,ye)(we)}}function Ee(ge){return $(W,k),re}function ye(ge){return k.restore(),++j<Z.length?G(Z[j]):ce}}}function B($,U){$.resolveAll&&!a.includes($)&&a.push($),$.resolve&&jo(u.events,U,u.events.length-U,$.resolve(u.events.slice(U),u)),$.resolveTo&&(u.events=$.resolveTo(u.events,u))}function z(){const $=h(),U=u.previous,H=u.currentConstruct,Y=u.events.length,re=Array.from(s);return{restore:ce,from:Y};function ce(){r=$,u.previous=U,u.currentConstruct=H,u.events.length=Y,s=re,M()}}function M(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function cat(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){const s=o[0];typeof s=="string"?o[0]=s.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function dat(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const a=e[n];let o;if(typeof a=="string")o=a;else switch(a){case-5:{o="\r";break}case-4:{o=`
|
|
343
343
|
`;break}case-3:{o=`\r
|
|
344
344
|
`;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join("")}const fat={42:no,43:no,45:no,48:no,49:no,50:no,51:no,52:no,53:no,54:no,55:no,56:no,57:no,62:fle},pat={91:mit},mat={[-2]:LN,[-1]:LN,32:LN},hat={35:Sit,42:ST,45:[xV,ST],60:Cit,61:xV,95:ST,96:RV,126:RV},gat={38:mle,92:ple},_at={[-5]:kN,[-4]:kN,[-3]:kN,33:Hit,38:mle,42:q6,60:[Yrt,wit],91:Vit,92:[Eit,ple],93:c7,95:q6,96:iit},Eat={null:[q6,aat]},vat={null:[42,95]},Sat={null:[]},bat=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:vat,contentInitial:pat,disable:Sat,document:fat,flow:hat,flowInitial:mat,insideSpan:Eat,string:gat,text:_at},Symbol.toStringTag,{value:"Module"}));function yat(e){const n=cle([bat,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:i(Brt),document:i($rt),flow:i(rat),string:i(oat),text:i(sat)};return r;function i(a){return o;function o(s){return uat(r,a,s)}}}function Tat(e){for(;!hle(e););return e}const OV=/[\0\t\n\r]/g;function Cat(){let e=1,t="",n=!0,r;return i;function i(a,o,s){const l=[];let u,c,d,f,m;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(o||void 0).decode(a)),d=0,t="",n&&(a.charCodeAt(0)===65279&&d++,n=void 0);d<a.length;){if(OV.lastIndex=d,u=OV.exec(a),f=u&&u.index!==void 0?u.index:a.length,m=a.charCodeAt(f),!u){t=a.slice(d);break}if(m===10&&d===f&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),d<f&&(l.push(a.slice(d,f)),e+=f-d),m){case 0:{l.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,l.push(-2);e++<c;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}d=f+1}return s&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const Rat=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Aat(e){return e.replace(Rat,xat)}function xat(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return dle(n.slice(a?2:1),a?16:10)}return u7(n)||e}const ble={}.hasOwnProperty;function Oat(e,t,n){return typeof t!="string"&&(n=t,t=void 0),Nat(n)(Tat(yat(n).document().write(Cat()(e,t,!0))))}function Nat(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(rt),autolinkProtocol:z,autolinkEmail:z,atxHeading:a(Ve),blockQuote:a(Be),characterEscape:z,characterReference:z,codeFenced:a(Qe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(Qe,o),codeText:a(Ze,o),codeTextData:z,data:z,codeFlowValue:z,definition:a(ze),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(Le),hardBreakEscape:a(Ue),hardBreakTrailing:a(Ue),htmlFlow:a(ft,o),htmlFlowData:z,htmlText:a(ft,o),htmlTextData:z,image:a(dt),label:o,link:a(rt),listItem:a(ct),listItemValue:f,listOrdered:a(Xe,d),listUnordered:a(Xe),paragraph:a(lt),reference:G,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(Ve),strong:a(fe),thematicBreak:a(Se)},exit:{atxHeading:l(),atxHeadingSequence:O,autolink:l(),autolinkEmail:we,autolinkProtocol:De,blockQuote:l(),characterEscapeValue:M,characterReferenceMarkerHexadecimal:ye,characterReferenceMarkerNumeric:ye,characterReferenceValue:ge,codeFenced:l(b),codeFencedFence:_,codeFencedFenceInfo:m,codeFencedFenceMeta:h,codeFlowValue:M,codeIndented:l(S),codeText:l(re),codeTextData:M,data:M,definition:l(),definitionDestinationString:C,definitionLabelString:y,definitionTitleString:T,emphasis:l(),hardBreakEscape:l(U),hardBreakTrailing:l(U),htmlFlow:l(H),htmlFlowData:M,htmlText:l(Y),htmlTextData:M,image:l(Z),label:W,labelText:j,lineEnding:$,link:l(ce),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:Ee,resourceDestinationString:k,resourceTitleString:se,resource:ne,setextHeading:l(B),setextHeadingLineSequence:w,setextHeadingText:N,strong:l(),thematicBreak:l()}};yle(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(Q){let he={type:"root",children:[]};const ae={stack:[he],tokenStack:[],config:t,enter:s,exit:u,buffer:o,resume:c,data:n},_e=[];let Ie=-1;for(;++Ie<Q.length;)if(Q[Ie][1].type==="listOrdered"||Q[Ie][1].type==="listUnordered")if(Q[Ie][0]==="enter")_e.push(Ie);else{const ot=_e.pop();Ie=i(Q,ot,Ie)}for(Ie=-1;++Ie<Q.length;){const ot=t[Q[Ie][0]];ble.call(ot,Q[Ie][1].type)&&ot[Q[Ie][1].type].call(Object.assign({sliceSerialize:Q[Ie][2].sliceSerialize},ae),Q[Ie][1])}if(ae.tokenStack.length>0){const ot=ae.tokenStack[ae.tokenStack.length-1];(ot[1]||NV).call(ae,void 0,ot[0])}for(he.position={start:nd(Q.length>0?Q[0][1].start:{line:1,column:1,offset:0}),end:nd(Q.length>0?Q[Q.length-2][1].end:{line:1,column:1,offset:0})},Ie=-1;++Ie<t.transforms.length;)he=t.transforms[Ie](he)||he;return he}function i(Q,he,ae){let _e=he-1,Ie=-1,ot=!1,it,$e,Tt,xe;for(;++_e<=ae;){const K=Q[_e];switch(K[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{K[0]==="enter"?Ie++:Ie--,xe=void 0;break}case"lineEndingBlank":{K[0]==="enter"&&(it&&!xe&&!Ie&&!Tt&&(Tt=_e),xe=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:xe=void 0}if(!Ie&&K[0]==="enter"&&K[1].type==="listItemPrefix"||Ie===-1&&K[0]==="exit"&&(K[1].type==="listUnordered"||K[1].type==="listOrdered")){if(it){let te=_e;for($e=void 0;te--;){const ve=Q[te];if(ve[1].type==="lineEnding"||ve[1].type==="lineEndingBlank"){if(ve[0]==="exit")continue;$e&&(Q[$e][1].type="lineEndingBlank",ot=!0),ve[1].type="lineEnding",$e=te}else if(!(ve[1].type==="linePrefix"||ve[1].type==="blockQuotePrefix"||ve[1].type==="blockQuotePrefixWhitespace"||ve[1].type==="blockQuoteMarker"||ve[1].type==="listItemIndent"))break}Tt&&(!$e||Tt<$e)&&(it._spread=!0),it.end=Object.assign({},$e?Q[$e][1].start:K[1].end),Q.splice($e||_e,0,["exit",it,K[2]]),_e++,ae++}if(K[1].type==="listItemPrefix"){const te={type:"listItem",_spread:!1,start:Object.assign({},K[1].start),end:void 0};it=te,Q.splice(_e,0,["enter",te,K[2]]),_e++,ae++,Tt=void 0,xe=!0}}}return Q[he][1]._spread=ot,ae}function a(Q,he){return ae;function ae(_e){s.call(this,Q(_e),_e),he&&he.call(this,_e)}}function o(){this.stack.push({type:"fragment",children:[]})}function s(Q,he,ae){this.stack[this.stack.length-1].children.push(Q),this.stack.push(Q),this.tokenStack.push([he,ae]),Q.position={start:nd(he.start),end:void 0}}function l(Q){return he;function he(ae){Q&&Q.call(this,ae),u.call(this,ae)}}function u(Q,he){const ae=this.stack.pop(),_e=this.tokenStack.pop();if(_e)_e[0].type!==Q.type&&(he?he.call(this,Q,_e[0]):(_e[1]||NV).call(this,Q,_e[0]));else throw new Error("Cannot close `"+Q.type+"` ("+K1({start:Q.start,end:Q.end})+"): it’s not open");ae.position.end=nd(Q.end)}function c(){return l7(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(Q){if(this.data.expectingFirstListItemValue){const he=this.stack[this.stack.length-2];he.start=Number.parseInt(this.sliceSerialize(Q),10),this.data.expectingFirstListItemValue=void 0}}function m(){const Q=this.resume(),he=this.stack[this.stack.length-1];he.lang=Q}function h(){const Q=this.resume(),he=this.stack[this.stack.length-1];he.meta=Q}function _(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const Q=this.resume(),he=this.stack[this.stack.length-1];he.value=Q.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const Q=this.resume(),he=this.stack[this.stack.length-1];he.value=Q.replace(/(\r?\n|\r)$/g,"")}function y(Q){const he=this.resume(),ae=this.stack[this.stack.length-1];ae.label=he,ae.identifier=Sl(this.sliceSerialize(Q)).toLowerCase()}function T(){const Q=this.resume(),he=this.stack[this.stack.length-1];he.title=Q}function C(){const Q=this.resume(),he=this.stack[this.stack.length-1];he.url=Q}function O(Q){const he=this.stack[this.stack.length-1];if(!he.depth){const ae=this.sliceSerialize(Q).length;he.depth=ae}}function N(){this.data.setextHeadingSlurpLineEnding=!0}function w(Q){const he=this.stack[this.stack.length-1];he.depth=this.sliceSerialize(Q).codePointAt(0)===61?1:2}function B(){this.data.setextHeadingSlurpLineEnding=void 0}function z(Q){const ae=this.stack[this.stack.length-1].children;let _e=ae[ae.length-1];(!_e||_e.type!=="text")&&(_e=Ke(),_e.position={start:nd(Q.start),end:void 0},ae.push(_e)),this.stack.push(_e)}function M(Q){const he=this.stack.pop();he.value+=this.sliceSerialize(Q),he.position.end=nd(Q.end)}function $(Q){const he=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ae=he.children[he.children.length-1];ae.position.end=nd(Q.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(he.type)&&(z.call(this,Q),M.call(this,Q))}function U(){this.data.atHardBreak=!0}function H(){const Q=this.resume(),he=this.stack[this.stack.length-1];he.value=Q}function Y(){const Q=this.resume(),he=this.stack[this.stack.length-1];he.value=Q}function re(){const Q=this.resume(),he=this.stack[this.stack.length-1];he.value=Q}function ce(){const Q=this.stack[this.stack.length-1];if(this.data.inReference){const he=this.data.referenceType||"shortcut";Q.type+="Reference",Q.referenceType=he,delete Q.url,delete Q.title}else delete Q.identifier,delete Q.label;this.data.referenceType=void 0}function Z(){const Q=this.stack[this.stack.length-1];if(this.data.inReference){const he=this.data.referenceType||"shortcut";Q.type+="Reference",Q.referenceType=he,delete Q.url,delete Q.title}else delete Q.identifier,delete Q.label;this.data.referenceType=void 0}function j(Q){const he=this.sliceSerialize(Q),ae=this.stack[this.stack.length-2];ae.label=Aat(he),ae.identifier=Sl(he).toLowerCase()}function W(){const Q=this.stack[this.stack.length-1],he=this.resume(),ae=this.stack[this.stack.length-1];if(this.data.inReference=!0,ae.type==="link"){const _e=Q.children;ae.children=_e}else ae.alt=he}function k(){const Q=this.resume(),he=this.stack[this.stack.length-1];he.url=Q}function se(){const Q=this.resume(),he=this.stack[this.stack.length-1];he.title=Q}function ne(){this.data.inReference=void 0}function G(){this.data.referenceType="collapsed"}function Ee(Q){const he=this.resume(),ae=this.stack[this.stack.length-1];ae.label=he,ae.identifier=Sl(this.sliceSerialize(Q)).toLowerCase(),this.data.referenceType="full"}function ye(Q){this.data.characterReferenceType=Q.type}function ge(Q){const he=this.sliceSerialize(Q),ae=this.data.characterReferenceType;let _e;ae?(_e=dle(he,ae==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):_e=u7(he);const Ie=this.stack.pop();Ie.value+=_e,Ie.position.end=nd(Q.end)}function De(Q){M.call(this,Q);const he=this.stack[this.stack.length-1];he.url=this.sliceSerialize(Q)}function we(Q){M.call(this,Q);const he=this.stack[this.stack.length-1];he.url="mailto:"+this.sliceSerialize(Q)}function Be(){return{type:"blockquote",children:[]}}function Qe(){return{type:"code",lang:null,meta:null,value:""}}function Ze(){return{type:"inlineCode",value:""}}function ze(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Le(){return{type:"emphasis",children:[]}}function Ve(){return{type:"heading",depth:0,children:[]}}function Ue(){return{type:"break"}}function ft(){return{type:"html",value:""}}function dt(){return{type:"image",title:null,url:"",alt:null}}function rt(){return{type:"link",title:null,url:"",children:[]}}function Xe(Q){return{type:"list",ordered:Q.type==="listOrdered",start:null,spread:Q._spread,children:[]}}function ct(Q){return{type:"listItem",spread:Q._spread,checked:null,children:[]}}function lt(){return{type:"paragraph",children:[]}}function fe(){return{type:"strong",children:[]}}function Ke(){return{type:"text",value:""}}function Se(){return{type:"thematicBreak"}}}function nd(e){return{line:e.line,column:e.column,offset:e.offset}}function yle(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?yle(e,r):Iat(e,r)}}function Iat(e,t){let n;for(n in t)if(ble.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 NV(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+K1({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+K1({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+K1({start:t.start,end:t.end})+") is still open")}function wat(e){const t=this;t.parser=n;function n(r){return Oat(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Dat(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 Mat(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|