@workerdeck/web 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/dist/assets/abap-DLDM7-KI.js +1 -0
- package/dist/assets/apex-DNDY2TF8.js +1 -0
- package/dist/assets/azcli-Y6nb8tq_.js +1 -0
- package/dist/assets/bat-BwHxbl9M.js +1 -0
- package/dist/assets/bicep-CFznDFnq.js +2 -0
- package/dist/assets/cameligo-Bf6VGUru.js +1 -0
- package/dist/assets/clojure-Dnu-v4kV.js +1 -0
- package/dist/assets/codicon-Brq4_Ui5.ttf +0 -0
- package/dist/assets/coffee-Bd8akH9Z.js +1 -0
- package/dist/assets/cpp-BbWJElDN.js +1 -0
- package/dist/assets/csharp-Co3qMtFm.js +1 -0
- package/dist/assets/csp-D-4FJmMZ.js +1 -0
- package/dist/assets/css-DdJfP1eB.js +3 -0
- package/dist/assets/cypher-cTPe9QuQ.js +1 -0
- package/dist/assets/dart-BOtBlQCF.js +1 -0
- package/dist/assets/dockerfile-BG73LgW2.js +1 -0
- package/dist/assets/ecl-BEgZUVRK.js +1 -0
- package/dist/assets/elixir-BkW5O-1t.js +1 -0
- package/dist/assets/flow9-BeJ5waoc.js +1 -0
- package/dist/assets/freemarker2-Cy3ZXQJU.js +3 -0
- package/dist/assets/fsharp-PahG7c26.js +1 -0
- package/dist/assets/go-acbASCJo.js +1 -0
- package/dist/assets/graphql-BxJiqAUM.js +1 -0
- package/dist/assets/handlebars-KuFsgEgG.js +1 -0
- package/dist/assets/hcl-DtV1sZF8.js +1 -0
- package/dist/assets/{highlighted-body-OFNGDK62-CZjhGmx1.js → highlighted-body-OFNGDK62-Dbepw_E8.js} +1 -1
- package/dist/assets/html-AWyZYBD0.js +1 -0
- package/dist/assets/index-976cPiHW.js +930 -0
- package/dist/assets/{index-DzTxp_3z.js → index-9_St22G9.js} +1 -1
- package/dist/assets/index-B2jK72g9.css +1 -0
- package/dist/assets/index-BWTzh9Nw.js +673 -0
- package/dist/assets/index-CXkKwxiP.css +1 -0
- package/dist/assets/{index-CAaft92r.js → index-sM-myQ3-.js} +1 -1
- package/dist/assets/ini-Kd9XrMLS.js +1 -0
- package/dist/assets/java-CXBNlu9o.js +1 -0
- package/dist/assets/javascript-CiUx2V4j.js +1 -0
- package/dist/assets/julia-cl7-CwDS.js +1 -0
- package/dist/assets/kotlin-s7OhZKlX.js +1 -0
- package/dist/assets/less-9HpZscsL.js +2 -0
- package/dist/assets/lexon-OrD6JF1K.js +1 -0
- package/dist/assets/liquid-CHK8BGoh.js +1 -0
- package/dist/assets/lua-Cyyb5UIc.js +1 -0
- package/dist/assets/m3-B8OfTtLu.js +1 -0
- package/dist/assets/markdown-BFxVWTOG.js +1 -0
- package/dist/assets/mdx-D42Y48x4.js +1 -0
- package/dist/assets/mips-CiqrrVzr.js +1 -0
- package/dist/assets/msdax-DmeGPVcC.js +1 -0
- package/dist/assets/mysql-C_tMU-Nz.js +1 -0
- package/dist/assets/objective-c-BDtDVThU.js +1 -0
- package/dist/assets/pascal-vHIfCaH5.js +1 -0
- package/dist/assets/pascaligo-DtZ0uQbO.js +1 -0
- package/dist/assets/perl-Ub6l9XKa.js +1 -0
- package/dist/assets/pgsql-BlNEE0v7.js +1 -0
- package/dist/assets/php-BBUBE1dy.js +1 -0
- package/dist/assets/pla-DSh2-awV.js +1 -0
- package/dist/assets/postiats-CocnycG-.js +1 -0
- package/dist/assets/powerquery-tScXyioY.js +1 -0
- package/dist/assets/powershell-COWaemsV.js +1 -0
- package/dist/assets/protobuf-Brw8urJB.js +2 -0
- package/dist/assets/pug-8SOpv6rk.js +1 -0
- package/dist/assets/python-QL8CMZS5.js +1 -0
- package/dist/assets/qsharp-Bw9ernYp.js +1 -0
- package/dist/assets/r-j7ic8hl3.js +1 -0
- package/dist/assets/razor-CVv2Aqrb.js +1 -0
- package/dist/assets/redis-Bu5POkcn.js +1 -0
- package/dist/assets/redshift-Bs9aos_-.js +1 -0
- package/dist/assets/restructuredtext-CqXO7rUv.js +1 -0
- package/dist/assets/ruby-zBfavPgS.js +1 -0
- package/dist/assets/rust-BzKRNQWT.js +1 -0
- package/dist/assets/sb-BBc9UKZt.js +1 -0
- package/dist/assets/scala-D9hQfWCl.js +1 -0
- package/dist/assets/scheme-BPhDTwHR.js +1 -0
- package/dist/assets/scss-CBJaRo0y.js +3 -0
- package/dist/assets/shell-DiJ1NA_G.js +1 -0
- package/dist/assets/solidity-Db0IVjzk.js +1 -0
- package/dist/assets/sophia-CnS9iZB_.js +1 -0
- package/dist/assets/sparql-CJmd_6j2.js +1 -0
- package/dist/assets/sql-ClhHkBeG.js +1 -0
- package/dist/assets/st-CHwy0fLd.js +1 -0
- package/dist/assets/swift-Bqt4WxQ4.js +3 -0
- package/dist/assets/systemverilog-Bs9z6M-B.js +1 -0
- package/dist/assets/tcl-Dm6ycUr_.js +1 -0
- package/dist/assets/twig-Csy3S7wG.js +1 -0
- package/dist/assets/typescript-DPsy66SU.js +1 -0
- package/dist/assets/typespec-Btyra-wh.js +1 -0
- package/dist/assets/vb-Db0cS2oM.js +1 -0
- package/dist/assets/wgsl-DumH7NcR.js +298 -0
- package/dist/assets/xml-CfvQk54q.js +1 -0
- package/dist/assets/yaml-C4r-ikYF.js +1 -0
- package/dist/favicon.svg +4 -4
- package/dist/index.html +2 -2
- package/package.json +6 -5
- package/dist/assets/index-B-JWhnmk.css +0 -1
- package/dist/assets/index-DqvGnaUJ.js +0 -481
|
@@ -1,481 +0,0 @@
|
|
|
1
|
-
function UO(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function Ah(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var w0={exports:{}},Eu={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var lv;function zO(){if(lv)return Eu;lv=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,o){var l=null;if(o!==void 0&&(l=""+o),i.key!==void 0&&(l=""+i.key),"key"in i){o={};for(var c in i)c!=="key"&&(o[c]=i[c])}else o=i;return i=o.ref,{$$typeof:e,type:r,key:l,ref:i!==void 0?i:null,props:o}}return Eu.Fragment=t,Eu.jsx=n,Eu.jsxs=n,Eu}var uv;function FO(){return uv||(uv=1,w0.exports=zO()),w0.exports}var g=FO(),k0={exports:{}},ht={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react.production.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var cv;function VO(){if(cv)return ht;cv=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),b=Symbol.iterator;function y(P){return P===null||typeof P!="object"?null:(P=b&&P[b]||P["@@iterator"],typeof P=="function"?P:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,k={};function C(P,$,L){this.props=P,this.context=$,this.refs=k,this.updater=L||E}C.prototype.isReactComponent={},C.prototype.setState=function(P,$){if(typeof P!="object"&&typeof P!="function"&&P!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,P,$,"setState")},C.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function A(){}A.prototype=C.prototype;function _(P,$,L){this.props=P,this.context=$,this.refs=k,this.updater=L||E}var N=_.prototype=new A;N.constructor=_,w(N,C.prototype),N.isPureReactComponent=!0;var D=Array.isArray;function O(){}var j={H:null,A:null,T:null,S:null},M=Object.prototype.hasOwnProperty;function q(P,$,L){var ae=L.ref;return{$$typeof:e,type:P,key:$,ref:ae!==void 0?ae:null,props:L}}function U(P,$){return q(P.type,$,P.props)}function Q(P){return typeof P=="object"&&P!==null&&P.$$typeof===e}function Z(P){var $={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(L){return $[L]})}var G=/\/+/g;function ee(P,$){return typeof P=="object"&&P!==null&&P.key!=null?Z(""+P.key):$.toString(36)}function Y(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(O,O):(P.status="pending",P.then(function($){P.status==="pending"&&(P.status="fulfilled",P.value=$)},function($){P.status==="pending"&&(P.status="rejected",P.reason=$)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function H(P,$,L,ae,ie){var fe=typeof P;(fe==="undefined"||fe==="boolean")&&(P=null);var de=!1;if(P===null)de=!0;else switch(fe){case"bigint":case"string":case"number":de=!0;break;case"object":switch(P.$$typeof){case e:case t:de=!0;break;case m:return de=P._init,H(de(P._payload),$,L,ae,ie)}}if(de)return ie=ie(P),de=ae===""?"."+ee(P,0):ae,D(ie)?(L="",de!=null&&(L=de.replace(G,"$&/")+"/"),H(ie,$,L,"",function(Ue){return Ue})):ie!=null&&(Q(ie)&&(ie=U(ie,L+(ie.key==null||P&&P.key===ie.key?"":(""+ie.key).replace(G,"$&/")+"/")+de)),$.push(ie)),1;de=0;var he=ae===""?".":ae+":";if(D(P))for(var ve=0;ve<P.length;ve++)ae=P[ve],fe=he+ee(ae,ve),de+=H(ae,$,L,fe,ie);else if(ve=y(P),typeof ve=="function")for(P=ve.call(P),ve=0;!(ae=P.next()).done;)ae=ae.value,fe=he+ee(ae,ve++),de+=H(ae,$,L,fe,ie);else if(fe==="object"){if(typeof P.then=="function")return H(Y(P),$,L,ae,ie);throw $=String(P),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return de}function K(P,$,L){if(P==null)return P;var ae=[],ie=0;return H(P,ae,"","",function(fe){return $.call(L,fe,ie++)}),ae}function te(P){if(P._status===-1){var $=P._result;$=$(),$.then(function(L){(P._status===0||P._status===-1)&&(P._status=1,P._result=L)},function(L){(P._status===0||P._status===-1)&&(P._status=2,P._result=L)}),P._status===-1&&(P._status=0,P._result=$)}if(P._status===1)return P._result.default;throw P._result}var le=typeof reportError=="function"?reportError:function(P){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof P=="object"&&P!==null&&typeof P.message=="string"?String(P.message):String(P),error:P});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",P);return}console.error(P)},I={map:K,forEach:function(P,$,L){K(P,function(){$.apply(this,arguments)},L)},count:function(P){var $=0;return K(P,function(){$++}),$},toArray:function(P){return K(P,function($){return $})||[]},only:function(P){if(!Q(P))throw Error("React.Children.only expected to receive a single React element child.");return P}};return ht.Activity=p,ht.Children=I,ht.Component=C,ht.Fragment=n,ht.Profiler=i,ht.PureComponent=_,ht.StrictMode=r,ht.Suspense=f,ht.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,ht.__COMPILER_RUNTIME={__proto__:null,c:function(P){return j.H.useMemoCache(P)}},ht.cache=function(P){return function(){return P.apply(null,arguments)}},ht.cacheSignal=function(){return null},ht.cloneElement=function(P,$,L){if(P==null)throw Error("The argument must be a React element, but you passed "+P+".");var ae=w({},P.props),ie=P.key;if($!=null)for(fe in $.key!==void 0&&(ie=""+$.key),$)!M.call($,fe)||fe==="key"||fe==="__self"||fe==="__source"||fe==="ref"&&$.ref===void 0||(ae[fe]=$[fe]);var fe=arguments.length-2;if(fe===1)ae.children=L;else if(1<fe){for(var de=Array(fe),he=0;he<fe;he++)de[he]=arguments[he+2];ae.children=de}return q(P.type,ie,ae)},ht.createContext=function(P){return P={$$typeof:l,_currentValue:P,_currentValue2:P,_threadCount:0,Provider:null,Consumer:null},P.Provider=P,P.Consumer={$$typeof:o,_context:P},P},ht.createElement=function(P,$,L){var ae,ie={},fe=null;if($!=null)for(ae in $.key!==void 0&&(fe=""+$.key),$)M.call($,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(ie[ae]=$[ae]);var de=arguments.length-2;if(de===1)ie.children=L;else if(1<de){for(var he=Array(de),ve=0;ve<de;ve++)he[ve]=arguments[ve+2];ie.children=he}if(P&&P.defaultProps)for(ae in de=P.defaultProps,de)ie[ae]===void 0&&(ie[ae]=de[ae]);return q(P,fe,ie)},ht.createRef=function(){return{current:null}},ht.forwardRef=function(P){return{$$typeof:c,render:P}},ht.isValidElement=Q,ht.lazy=function(P){return{$$typeof:m,_payload:{_status:-1,_result:P},_init:te}},ht.memo=function(P,$){return{$$typeof:d,type:P,compare:$===void 0?null:$}},ht.startTransition=function(P){var $=j.T,L={};j.T=L;try{var ae=P(),ie=j.S;ie!==null&&ie(L,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(O,le)}catch(fe){le(fe)}finally{$!==null&&L.types!==null&&($.types=L.types),j.T=$}},ht.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},ht.use=function(P){return j.H.use(P)},ht.useActionState=function(P,$,L){return j.H.useActionState(P,$,L)},ht.useCallback=function(P,$){return j.H.useCallback(P,$)},ht.useContext=function(P){return j.H.useContext(P)},ht.useDebugValue=function(){},ht.useDeferredValue=function(P,$){return j.H.useDeferredValue(P,$)},ht.useEffect=function(P,$){return j.H.useEffect(P,$)},ht.useEffectEvent=function(P){return j.H.useEffectEvent(P)},ht.useId=function(){return j.H.useId()},ht.useImperativeHandle=function(P,$,L){return j.H.useImperativeHandle(P,$,L)},ht.useInsertionEffect=function(P,$){return j.H.useInsertionEffect(P,$)},ht.useLayoutEffect=function(P,$){return j.H.useLayoutEffect(P,$)},ht.useMemo=function(P,$){return j.H.useMemo(P,$)},ht.useOptimistic=function(P,$){return j.H.useOptimistic(P,$)},ht.useReducer=function(P,$,L){return j.H.useReducer(P,$,L)},ht.useRef=function(P){return j.H.useRef(P)},ht.useState=function(P){return j.H.useState(P)},ht.useSyncExternalStore=function(P,$,L){return j.H.useSyncExternalStore(P,$,L)},ht.useTransition=function(){return j.H.useTransition()},ht.version="19.2.7",ht}var fv;function vc(){return fv||(fv=1,k0.exports=VO()),k0.exports}var S=vc();const De=Ah(S),$O=UO({__proto__:null,default:De},[S]);var A0={exports:{}},Tu={},_0={exports:{}},N0={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var dv;function qO(){return dv||(dv=1,(function(e){function t(H,K){var te=H.length;H.push(K);e:for(;0<te;){var le=te-1>>>1,I=H[le];if(0<i(I,K))H[le]=K,H[te]=I,te=le;else break e}}function n(H){return H.length===0?null:H[0]}function r(H){if(H.length===0)return null;var K=H[0],te=H.pop();if(te!==K){H[0]=te;e:for(var le=0,I=H.length,P=I>>>1;le<P;){var $=2*(le+1)-1,L=H[$],ae=$+1,ie=H[ae];if(0>i(L,te))ae<I&&0>i(ie,L)?(H[le]=ie,H[ae]=te,le=ae):(H[le]=L,H[$]=te,le=$);else if(ae<I&&0>i(ie,te))H[le]=ie,H[ae]=te,le=ae;else break e}}return K}function i(H,K){var te=H.sortIndex-K.sortIndex;return te!==0?te:H.id-K.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var f=[],d=[],m=1,p=null,b=3,y=!1,E=!1,w=!1,k=!1,C=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function N(H){for(var K=n(d);K!==null;){if(K.callback===null)r(d);else if(K.startTime<=H)r(d),K.sortIndex=K.expirationTime,t(f,K);else break;K=n(d)}}function D(H){if(w=!1,N(H),!E)if(n(f)!==null)E=!0,O||(O=!0,Z());else{var K=n(d);K!==null&&Y(D,K.startTime-H)}}var O=!1,j=-1,M=5,q=-1;function U(){return k?!0:!(e.unstable_now()-q<M)}function Q(){if(k=!1,O){var H=e.unstable_now();q=H;var K=!0;try{e:{E=!1,w&&(w=!1,A(j),j=-1),y=!0;var te=b;try{t:{for(N(H),p=n(f);p!==null&&!(p.expirationTime>H&&U());){var le=p.callback;if(typeof le=="function"){p.callback=null,b=p.priorityLevel;var I=le(p.expirationTime<=H);if(H=e.unstable_now(),typeof I=="function"){p.callback=I,N(H),K=!0;break t}p===n(f)&&r(f),N(H)}else r(f);p=n(f)}if(p!==null)K=!0;else{var P=n(d);P!==null&&Y(D,P.startTime-H),K=!1}}break e}finally{p=null,b=te,y=!1}K=void 0}}finally{K?Z():O=!1}}}var Z;if(typeof _=="function")Z=function(){_(Q)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,ee=G.port2;G.port1.onmessage=Q,Z=function(){ee.postMessage(null)}}else Z=function(){C(Q,0)};function Y(H,K){j=C(function(){H(e.unstable_now())},K)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(H){H.callback=null},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(H){switch(b){case 1:case 2:case 3:var K=3;break;default:K=b}var te=b;b=K;try{return H()}finally{b=te}},e.unstable_requestPaint=function(){k=!0},e.unstable_runWithPriority=function(H,K){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var te=b;b=H;try{return K()}finally{b=te}},e.unstable_scheduleCallback=function(H,K,te){var le=e.unstable_now();switch(typeof te=="object"&&te!==null?(te=te.delay,te=typeof te=="number"&&0<te?le+te:le):te=le,H){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return I=te+I,H={id:m++,callback:K,priorityLevel:H,startTime:te,expirationTime:I,sortIndex:-1},te>le?(H.sortIndex=te,t(d,H),n(f)===null&&H===n(d)&&(w?(A(j),j=-1):w=!0,Y(D,te-le))):(H.sortIndex=I,t(f,H),E||y||(E=!0,O||(O=!0,Z()))),H},e.unstable_shouldYield=U,e.unstable_wrapCallback=function(H){var K=b;return function(){var te=b;b=K;try{return H.apply(this,arguments)}finally{b=te}}}})(N0)),N0}var hv;function YO(){return hv||(hv=1,_0.exports=qO()),_0.exports}var R0={exports:{}},Zn={};/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var pv;function GO(){if(pv)return Zn;pv=1;var e=vc();function t(f){var d="https://react.dev/errors/"+f;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)d+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+f+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function o(f,d,m){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:p==null?null:""+p,children:f,containerInfo:d,implementation:m}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(f,d){if(f==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return Zn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Zn.createPortal=function(f,d){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(t(299));return o(f,d,null,m)},Zn.flushSync=function(f){var d=l.T,m=r.p;try{if(l.T=null,r.p=2,f)return f()}finally{l.T=d,r.p=m,r.d.f()}},Zn.preconnect=function(f,d){typeof f=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,r.d.C(f,d))},Zn.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},Zn.preinit=function(f,d){if(typeof f=="string"&&d&&typeof d.as=="string"){var m=d.as,p=c(m,d.crossOrigin),b=typeof d.integrity=="string"?d.integrity:void 0,y=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;m==="style"?r.d.S(f,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:p,integrity:b,fetchPriority:y}):m==="script"&&r.d.X(f,{crossOrigin:p,integrity:b,fetchPriority:y,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Zn.preinitModule=function(f,d){if(typeof f=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var m=c(d.as,d.crossOrigin);r.d.M(f,{crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&r.d.M(f)},Zn.preload=function(f,d){if(typeof f=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var m=d.as,p=c(m,d.crossOrigin);r.d.L(f,m,{crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},Zn.preloadModule=function(f,d){if(typeof f=="string")if(d){var m=c(d.as,d.crossOrigin);r.d.m(f,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(f)},Zn.requestFormReset=function(f){r.d.r(f)},Zn.unstable_batchedUpdates=function(f,d){return f(d)},Zn.useFormState=function(f,d,m){return l.H.useFormState(f,d,m)},Zn.useFormStatus=function(){return l.H.useHostTransitionStatus()},Zn.version="19.2.7",Zn}var mv;function aw(){if(mv)return R0.exports;mv=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),R0.exports=GO(),R0.exports}/**
|
|
34
|
-
* @license React
|
|
35
|
-
* react-dom-client.production.js
|
|
36
|
-
*
|
|
37
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the MIT license found in the
|
|
40
|
-
* LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/var gv;function XO(){if(gv)return Tu;gv=1;var e=YO(),t=vc(),n=aw();function r(s){var a="https://react.dev/errors/"+s;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)a+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+s+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function o(s){var a=s,u=s;if(s.alternate)for(;a.return;)a=a.return;else{s=a;do a=s,(a.flags&4098)!==0&&(u=a.return),s=a.return;while(s)}return a.tag===3?u:null}function l(s){if(s.tag===13){var a=s.memoizedState;if(a===null&&(s=s.alternate,s!==null&&(a=s.memoizedState)),a!==null)return a.dehydrated}return null}function c(s){if(s.tag===31){var a=s.memoizedState;if(a===null&&(s=s.alternate,s!==null&&(a=s.memoizedState)),a!==null)return a.dehydrated}return null}function f(s){if(o(s)!==s)throw Error(r(188))}function d(s){var a=s.alternate;if(!a){if(a=o(s),a===null)throw Error(r(188));return a!==s?null:s}for(var u=s,h=a;;){var x=u.return;if(x===null)break;var T=x.alternate;if(T===null){if(h=x.return,h!==null){u=h;continue}break}if(x.child===T.child){for(T=x.child;T;){if(T===u)return f(x),s;if(T===h)return f(x),a;T=T.sibling}throw Error(r(188))}if(u.return!==h.return)u=x,h=T;else{for(var R=!1,B=x.child;B;){if(B===u){R=!0,u=x,h=T;break}if(B===h){R=!0,h=x,u=T;break}B=B.sibling}if(!R){for(B=T.child;B;){if(B===u){R=!0,u=T,h=x;break}if(B===h){R=!0,h=T,u=x;break}B=B.sibling}if(!R)throw Error(r(189))}}if(u.alternate!==h)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?s:a}function m(s){var a=s.tag;if(a===5||a===26||a===27||a===6)return s;for(s=s.child;s!==null;){if(a=m(s),a!==null)return a;s=s.sibling}return null}var p=Object.assign,b=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),_=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),U=Symbol.for("react.memo_cache_sentinel"),Q=Symbol.iterator;function Z(s){return s===null||typeof s!="object"?null:(s=Q&&s[Q]||s["@@iterator"],typeof s=="function"?s:null)}var G=Symbol.for("react.client.reference");function ee(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===G?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case w:return"Fragment";case C:return"Profiler";case k:return"StrictMode";case D:return"Suspense";case O:return"SuspenseList";case q:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case E:return"Portal";case _:return s.displayName||"Context";case A:return(s._context.displayName||"Context")+".Consumer";case N:var a=s.render;return s=s.displayName,s||(s=a.displayName||a.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case j:return a=s.displayName||null,a!==null?a:ee(s.type)||"Memo";case M:a=s._payload,s=s._init;try{return ee(s(a))}catch{}}return null}var Y=Array.isArray,H=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te={pending:!1,data:null,method:null,action:null},le=[],I=-1;function P(s){return{current:s}}function $(s){0>I||(s.current=le[I],le[I]=null,I--)}function L(s,a){I++,le[I]=s.current,s.current=a}var ae=P(null),ie=P(null),fe=P(null),de=P(null);function he(s,a){switch(L(fe,a),L(ie,s),L(ae,null),a.nodeType){case 9:case 11:s=(s=a.documentElement)&&(s=s.namespaceURI)?OT(s):0;break;default:if(s=a.tagName,a=a.namespaceURI)a=OT(a),s=IT(a,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}$(ae),L(ae,s)}function ve(){$(ae),$(ie),$(fe)}function Ue(s){s.memoizedState!==null&&L(de,s);var a=ae.current,u=IT(a,s.type);a!==u&&(L(ie,s),L(ae,u))}function Pe(s){ie.current===s&&($(ae),$(ie)),de.current===s&&($(de),gu._currentValue=te)}var Te,Ie;function je(s){if(Te===void 0)try{throw Error()}catch(u){var a=u.stack.trim().match(/\n( *(at )?)/);Te=a&&a[1]||"",Ie=-1<u.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+Te+s+Ie}var We=!1;function Xe(s,a){if(!s||We)return"";We=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(a){var _e=function(){throw Error()};if(Object.defineProperty(_e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(_e,[])}catch(ye){var xe=ye}Reflect.construct(s,[],_e)}else{try{_e.call()}catch(ye){xe=ye}s.call(_e.prototype)}}else{try{throw Error()}catch(ye){xe=ye}(_e=s())&&typeof _e.catch=="function"&&_e.catch(function(){})}}catch(ye){if(ye&&xe&&typeof ye.stack=="string")return[ye.stack,xe.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var x=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");x&&x.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var T=h.DetermineComponentFrameRoot(),R=T[0],B=T[1];if(R&&B){var ne=R.split(`
|
|
44
|
-
`),be=B.split(`
|
|
45
|
-
`);for(x=h=0;h<ne.length&&!ne[h].includes("DetermineComponentFrameRoot");)h++;for(;x<be.length&&!be[x].includes("DetermineComponentFrameRoot");)x++;if(h===ne.length||x===be.length)for(h=ne.length-1,x=be.length-1;1<=h&&0<=x&&ne[h]!==be[x];)x--;for(;1<=h&&0<=x;h--,x--)if(ne[h]!==be[x]){if(h!==1||x!==1)do if(h--,x--,0>x||ne[h]!==be[x]){var Se=`
|
|
46
|
-
`+ne[h].replace(" at new "," at ");return s.displayName&&Se.includes("<anonymous>")&&(Se=Se.replace("<anonymous>",s.displayName)),Se}while(1<=h&&0<=x);break}}}finally{We=!1,Error.prepareStackTrace=u}return(u=s?s.displayName||s.name:"")?je(u):""}function Me(s,a){switch(s.tag){case 26:case 27:case 5:return je(s.type);case 16:return je("Lazy");case 13:return s.child!==a&&a!==null?je("Suspense Fallback"):je("Suspense");case 19:return je("SuspenseList");case 0:case 15:return Xe(s.type,!1);case 11:return Xe(s.type.render,!1);case 1:return Xe(s.type,!0);case 31:return je("Activity");default:return""}}function Ce(s){try{var a="",u=null;do a+=Me(s,u),u=s,s=s.return;while(s);return a}catch(h){return`
|
|
47
|
-
Error generating stack: `+h.message+`
|
|
48
|
-
`+h.stack}}var we=Object.prototype.hasOwnProperty,Be=e.unstable_scheduleCallback,$e=e.unstable_cancelCallback,W=e.unstable_shouldYield,me=e.unstable_requestPaint,se=e.unstable_now,re=e.unstable_getCurrentPriorityLevel,V=e.unstable_ImmediatePriority,z=e.unstable_UserBlockingPriority,ue=e.unstable_NormalPriority,ke=e.unstable_LowPriority,Re=e.unstable_IdlePriority,qe=e.log,rt=e.unstable_setDisableYieldValue,et=null,ot=null;function ut(s){if(typeof qe=="function"&&rt(s),ot&&typeof ot.setStrictMode=="function")try{ot.setStrictMode(et,s)}catch{}}var Fe=Math.clz32?Math.clz32:at,Dt=Math.log,jt=Math.LN2;function at(s){return s>>>=0,s===0?32:31-(Dt(s)/jt|0)|0}var Ot=256,Qt=262144,Wt=4194304;function Zt(s){var a=s&42;if(a!==0)return a;switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function Ye(s,a,u){var h=s.pendingLanes;if(h===0)return 0;var x=0,T=s.suspendedLanes,R=s.pingedLanes;s=s.warmLanes;var B=h&134217727;return B!==0?(h=B&~T,h!==0?x=Zt(h):(R&=B,R!==0?x=Zt(R):u||(u=B&~s,u!==0&&(x=Zt(u))))):(B=h&~T,B!==0?x=Zt(B):R!==0?x=Zt(R):u||(u=h&~s,u!==0&&(x=Zt(u)))),x===0?0:a!==0&&a!==x&&(a&T)===0&&(T=x&-x,u=a&-a,T>=u||T===32&&(u&4194048)!==0)?a:x}function gt(s,a){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&a)===0}function Ut(s,a){switch(s){case 1:case 2:case 4:case 8:case 64:return a+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Jt(){var s=Wt;return Wt<<=1,(Wt&62914560)===0&&(Wt=4194304),s}function Fn(s){for(var a=[],u=0;31>u;u++)a.push(s);return a}function bt(s,a){s.pendingLanes|=a,a!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function an(s,a,u,h,x,T){var R=s.pendingLanes;s.pendingLanes=u,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=u,s.entangledLanes&=u,s.errorRecoveryDisabledLanes&=u,s.shellSuspendCounter=0;var B=s.entanglements,ne=s.expirationTimes,be=s.hiddenUpdates;for(u=R&~u;0<u;){var Se=31-Fe(u),_e=1<<Se;B[Se]=0,ne[Se]=-1;var xe=be[Se];if(xe!==null)for(be[Se]=null,Se=0;Se<xe.length;Se++){var ye=xe[Se];ye!==null&&(ye.lane&=-536870913)}u&=~_e}h!==0&&hr(s,h,0),T!==0&&x===0&&s.tag!==0&&(s.suspendedLanes|=T&~(R&~a))}function hr(s,a,u){s.pendingLanes|=a,s.suspendedLanes&=~a;var h=31-Fe(a);s.entangledLanes|=a,s.entanglements[h]=s.entanglements[h]|1073741824|u&261930}function hn(s,a){var u=s.entangledLanes|=a;for(s=s.entanglements;u;){var h=31-Fe(u),x=1<<h;x&a|s[h]&a&&(s[h]|=a),u&=~x}}function En(s,a){var u=a&-a;return u=(u&42)!==0?1:ft(u),(u&(s.suspendedLanes|a))!==0?0:u}function ft(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function At(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function pn(){var s=K.p;return s!==0?s:(s=window.event,s===void 0?32:tv(s.type))}function Dn(s,a){var u=K.p;try{return K.p=s,a()}finally{K.p=u}}var On=Math.random().toString(36).slice(2),en="__reactFiber$"+On,Vn="__reactProps$"+On,hs="__reactContainer$"+On,Rl="__reactEvents$"+On,Hc="__reactListeners$"+On,RR="__reactHandles$"+On,xx="__reactResources$"+On,Ol="__reactMarker$"+On;function bp(s){delete s[en],delete s[Vn],delete s[Rl],delete s[Hc],delete s[RR]}function go(s){var a=s[en];if(a)return a;for(var u=s.parentNode;u;){if(a=u[hs]||u[en]){if(u=a.alternate,a.child!==null||u!==null&&u.child!==null)for(s=HT(s);s!==null;){if(u=s[en])return u;s=HT(s)}return a}s=u,u=s.parentNode}return null}function bo(s){if(s=s[en]||s[hs]){var a=s.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return s}return null}function Il(s){var a=s.tag;if(a===5||a===26||a===27||a===6)return s.stateNode;throw Error(r(33))}function xo(s){var a=s[xx];return a||(a=s[xx]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function Pn(s){s[Ol]=!0}var yx=new Set,Ex={};function pa(s,a){yo(s,a),yo(s+"Capture",a)}function yo(s,a){for(Ex[s]=a,s=0;s<a.length;s++)yx.add(a[s])}var OR=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Tx={},vx={};function IR(s){return we.call(vx,s)?!0:we.call(Tx,s)?!1:OR.test(s)?vx[s]=!0:(Tx[s]=!0,!1)}function Uc(s,a,u){if(IR(a))if(u===null)s.removeAttribute(a);else{switch(typeof u){case"undefined":case"function":case"symbol":s.removeAttribute(a);return;case"boolean":var h=a.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){s.removeAttribute(a);return}}s.setAttribute(a,""+u)}}function zc(s,a,u){if(u===null)s.removeAttribute(a);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(a);return}s.setAttribute(a,""+u)}}function Ds(s,a,u,h){if(h===null)s.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(u);return}s.setAttributeNS(a,u,""+h)}}function zr(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function Sx(s){var a=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function LR(s,a,u){var h=Object.getOwnPropertyDescriptor(s.constructor.prototype,a);if(!s.hasOwnProperty(a)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var x=h.get,T=h.set;return Object.defineProperty(s,a,{configurable:!0,get:function(){return x.call(this)},set:function(R){u=""+R,T.call(this,R)}}),Object.defineProperty(s,a,{enumerable:h.enumerable}),{getValue:function(){return u},setValue:function(R){u=""+R},stopTracking:function(){s._valueTracker=null,delete s[a]}}}}function xp(s){if(!s._valueTracker){var a=Sx(s)?"checked":"value";s._valueTracker=LR(s,a,""+s[a])}}function Cx(s){if(!s)return!1;var a=s._valueTracker;if(!a)return!0;var u=a.getValue(),h="";return s&&(h=Sx(s)?s.checked?"true":"false":s.value),s=h,s!==u?(a.setValue(s),!0):!1}function Fc(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var MR=/[\n"\\]/g;function Fr(s){return s.replace(MR,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function yp(s,a,u,h,x,T,R,B){s.name="",R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?s.type=R:s.removeAttribute("type"),a!=null?R==="number"?(a===0&&s.value===""||s.value!=a)&&(s.value=""+zr(a)):s.value!==""+zr(a)&&(s.value=""+zr(a)):R!=="submit"&&R!=="reset"||s.removeAttribute("value"),a!=null?Ep(s,R,zr(a)):u!=null?Ep(s,R,zr(u)):h!=null&&s.removeAttribute("value"),x==null&&T!=null&&(s.defaultChecked=!!T),x!=null&&(s.checked=x&&typeof x!="function"&&typeof x!="symbol"),B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"?s.name=""+zr(B):s.removeAttribute("name")}function wx(s,a,u,h,x,T,R,B){if(T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(s.type=T),a!=null||u!=null){if(!(T!=="submit"&&T!=="reset"||a!=null)){xp(s);return}u=u!=null?""+zr(u):"",a=a!=null?""+zr(a):u,B||a===s.value||(s.value=a),s.defaultValue=a}h=h??x,h=typeof h!="function"&&typeof h!="symbol"&&!!h,s.checked=B?s.checked:!!h,s.defaultChecked=!!h,R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"&&(s.name=R),xp(s)}function Ep(s,a,u){a==="number"&&Fc(s.ownerDocument)===s||s.defaultValue===""+u||(s.defaultValue=""+u)}function Eo(s,a,u,h){if(s=s.options,a){a={};for(var x=0;x<u.length;x++)a["$"+u[x]]=!0;for(u=0;u<s.length;u++)x=a.hasOwnProperty("$"+s[u].value),s[u].selected!==x&&(s[u].selected=x),x&&h&&(s[u].defaultSelected=!0)}else{for(u=""+zr(u),a=null,x=0;x<s.length;x++){if(s[x].value===u){s[x].selected=!0,h&&(s[x].defaultSelected=!0);return}a!==null||s[x].disabled||(a=s[x])}a!==null&&(a.selected=!0)}}function kx(s,a,u){if(a!=null&&(a=""+zr(a),a!==s.value&&(s.value=a),u==null)){s.defaultValue!==a&&(s.defaultValue=a);return}s.defaultValue=u!=null?""+zr(u):""}function Ax(s,a,u,h){if(a==null){if(h!=null){if(u!=null)throw Error(r(92));if(Y(h)){if(1<h.length)throw Error(r(93));h=h[0]}u=h}u==null&&(u=""),a=u}u=zr(a),s.defaultValue=u,h=s.textContent,h===u&&h!==""&&h!==null&&(s.value=h),xp(s)}function To(s,a){if(a){var u=s.firstChild;if(u&&u===s.lastChild&&u.nodeType===3){u.nodeValue=a;return}}s.textContent=a}var DR=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function _x(s,a,u){var h=a.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?h?s.setProperty(a,""):a==="float"?s.cssFloat="":s[a]="":h?s.setProperty(a,u):typeof u!="number"||u===0||DR.has(a)?a==="float"?s.cssFloat=u:s[a]=(""+u).trim():s[a]=u+"px"}function Nx(s,a,u){if(a!=null&&typeof a!="object")throw Error(r(62));if(s=s.style,u!=null){for(var h in u)!u.hasOwnProperty(h)||a!=null&&a.hasOwnProperty(h)||(h.indexOf("--")===0?s.setProperty(h,""):h==="float"?s.cssFloat="":s[h]="");for(var x in a)h=a[x],a.hasOwnProperty(x)&&u[x]!==h&&_x(s,x,h)}else for(var T in a)a.hasOwnProperty(T)&&_x(s,T,a[T])}function Tp(s){if(s.indexOf("-")===-1)return!1;switch(s){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var PR=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["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"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["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"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["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"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),jR=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Vc(s){return jR.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function Ps(){}var vp=null;function Sp(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var vo=null,So=null;function Rx(s){var a=bo(s);if(a&&(s=a.stateNode)){var u=s[Vn]||null;e:switch(s=a.stateNode,a.type){case"input":if(yp(s,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),a=u.name,u.type==="radio"&&a!=null){for(u=s;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+Fr(""+a)+'"][type="radio"]'),a=0;a<u.length;a++){var h=u[a];if(h!==s&&h.form===s.form){var x=h[Vn]||null;if(!x)throw Error(r(90));yp(h,x.value,x.defaultValue,x.defaultValue,x.checked,x.defaultChecked,x.type,x.name)}}for(a=0;a<u.length;a++)h=u[a],h.form===s.form&&Cx(h)}break e;case"textarea":kx(s,u.value,u.defaultValue);break e;case"select":a=u.value,a!=null&&Eo(s,!!u.multiple,a,!1)}}}var Cp=!1;function Ox(s,a,u){if(Cp)return s(a,u);Cp=!0;try{var h=s(a);return h}finally{if(Cp=!1,(vo!==null||So!==null)&&(Of(),vo&&(a=vo,s=So,So=vo=null,Rx(a),s)))for(a=0;a<s.length;a++)Rx(s[a])}}function Ll(s,a){var u=s.stateNode;if(u===null)return null;var h=u[Vn]||null;if(h===null)return null;u=h[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(s=s.type,h=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!h;break e;default:s=!1}if(s)return null;if(u&&typeof u!="function")throw Error(r(231,a,typeof u));return u}var js=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),wp=!1;if(js)try{var Ml={};Object.defineProperty(Ml,"passive",{get:function(){wp=!0}}),window.addEventListener("test",Ml,Ml),window.removeEventListener("test",Ml,Ml)}catch{wp=!1}var mi=null,kp=null,$c=null;function Ix(){if($c)return $c;var s,a=kp,u=a.length,h,x="value"in mi?mi.value:mi.textContent,T=x.length;for(s=0;s<u&&a[s]===x[s];s++);var R=u-s;for(h=1;h<=R&&a[u-h]===x[T-h];h++);return $c=x.slice(s,1<h?1-h:void 0)}function qc(s){var a=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&a===13&&(s=13)):s=a,s===10&&(s=13),32<=s||s===13?s:0}function Yc(){return!0}function Lx(){return!1}function pr(s){function a(u,h,x,T,R){this._reactName=u,this._targetInst=x,this.type=h,this.nativeEvent=T,this.target=R,this.currentTarget=null;for(var B in s)s.hasOwnProperty(B)&&(u=s[B],this[B]=u?u(T):T[B]);return this.isDefaultPrevented=(T.defaultPrevented!=null?T.defaultPrevented:T.returnValue===!1)?Yc:Lx,this.isPropagationStopped=Lx,this}return p(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=Yc)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Yc)},persist:function(){},isPersistent:Yc}),a}var ma={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Gc=pr(ma),Dl=p({},ma,{view:0,detail:0}),BR=pr(Dl),Ap,_p,Pl,Xc=p({},Dl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Rp,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==Pl&&(Pl&&s.type==="mousemove"?(Ap=s.screenX-Pl.screenX,_p=s.screenY-Pl.screenY):_p=Ap=0,Pl=s),Ap)},movementY:function(s){return"movementY"in s?s.movementY:_p}}),Mx=pr(Xc),HR=p({},Xc,{dataTransfer:0}),UR=pr(HR),zR=p({},Dl,{relatedTarget:0}),Np=pr(zR),FR=p({},ma,{animationName:0,elapsedTime:0,pseudoElement:0}),VR=pr(FR),$R=p({},ma,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),qR=pr($R),YR=p({},ma,{data:0}),Dx=pr(YR),GR={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},XR={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},KR={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function QR(s){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(s):(s=KR[s])?!!a[s]:!1}function Rp(){return QR}var WR=p({},Dl,{key:function(s){if(s.key){var a=GR[s.key]||s.key;if(a!=="Unidentified")return a}return s.type==="keypress"?(s=qc(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?XR[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Rp,charCode:function(s){return s.type==="keypress"?qc(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?qc(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),ZR=pr(WR),JR=p({},Xc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Px=pr(JR),e6=p({},Dl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Rp}),t6=pr(e6),n6=p({},ma,{propertyName:0,elapsedTime:0,pseudoElement:0}),r6=pr(n6),s6=p({},Xc,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),i6=pr(s6),a6=p({},ma,{newState:0,oldState:0}),o6=pr(a6),l6=[9,13,27,32],Op=js&&"CompositionEvent"in window,jl=null;js&&"documentMode"in document&&(jl=document.documentMode);var u6=js&&"TextEvent"in window&&!jl,jx=js&&(!Op||jl&&8<jl&&11>=jl),Bx=" ",Hx=!1;function Ux(s,a){switch(s){case"keyup":return l6.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function zx(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Co=!1;function c6(s,a){switch(s){case"compositionend":return zx(a);case"keypress":return a.which!==32?null:(Hx=!0,Bx);case"textInput":return s=a.data,s===Bx&&Hx?null:s;default:return null}}function f6(s,a){if(Co)return s==="compositionend"||!Op&&Ux(s,a)?(s=Ix(),$c=kp=mi=null,Co=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return jx&&a.locale!=="ko"?null:a.data;default:return null}}var d6={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Fx(s){var a=s&&s.nodeName&&s.nodeName.toLowerCase();return a==="input"?!!d6[s.type]:a==="textarea"}function Vx(s,a,u,h){vo?So?So.push(h):So=[h]:vo=h,a=Bf(a,"onChange"),0<a.length&&(u=new Gc("onChange","change",null,u,h),s.push({event:u,listeners:a}))}var Bl=null,Hl=null;function h6(s){wT(s,0)}function Kc(s){var a=Il(s);if(Cx(a))return s}function $x(s,a){if(s==="change")return a}var qx=!1;if(js){var Ip;if(js){var Lp="oninput"in document;if(!Lp){var Yx=document.createElement("div");Yx.setAttribute("oninput","return;"),Lp=typeof Yx.oninput=="function"}Ip=Lp}else Ip=!1;qx=Ip&&(!document.documentMode||9<document.documentMode)}function Gx(){Bl&&(Bl.detachEvent("onpropertychange",Xx),Hl=Bl=null)}function Xx(s){if(s.propertyName==="value"&&Kc(Hl)){var a=[];Vx(a,Hl,s,Sp(s)),Ox(h6,a)}}function p6(s,a,u){s==="focusin"?(Gx(),Bl=a,Hl=u,Bl.attachEvent("onpropertychange",Xx)):s==="focusout"&&Gx()}function m6(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return Kc(Hl)}function g6(s,a){if(s==="click")return Kc(a)}function b6(s,a){if(s==="input"||s==="change")return Kc(a)}function x6(s,a){return s===a&&(s!==0||1/s===1/a)||s!==s&&a!==a}var Ar=typeof Object.is=="function"?Object.is:x6;function Ul(s,a){if(Ar(s,a))return!0;if(typeof s!="object"||s===null||typeof a!="object"||a===null)return!1;var u=Object.keys(s),h=Object.keys(a);if(u.length!==h.length)return!1;for(h=0;h<u.length;h++){var x=u[h];if(!we.call(a,x)||!Ar(s[x],a[x]))return!1}return!0}function Kx(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function Qx(s,a){var u=Kx(s);s=0;for(var h;u;){if(u.nodeType===3){if(h=s+u.textContent.length,s<=a&&h>=a)return{node:u,offset:a-s};s=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=Kx(u)}}function Wx(s,a){return s&&a?s===a?!0:s&&s.nodeType===3?!1:a&&a.nodeType===3?Wx(s,a.parentNode):"contains"in s?s.contains(a):s.compareDocumentPosition?!!(s.compareDocumentPosition(a)&16):!1:!1}function Zx(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var a=Fc(s.document);a instanceof s.HTMLIFrameElement;){try{var u=typeof a.contentWindow.location.href=="string"}catch{u=!1}if(u)s=a.contentWindow;else break;a=Fc(s.document)}return a}function Mp(s){var a=s&&s.nodeName&&s.nodeName.toLowerCase();return a&&(a==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||a==="textarea"||s.contentEditable==="true")}var y6=js&&"documentMode"in document&&11>=document.documentMode,wo=null,Dp=null,zl=null,Pp=!1;function Jx(s,a,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Pp||wo==null||wo!==Fc(h)||(h=wo,"selectionStart"in h&&Mp(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),zl&&Ul(zl,h)||(zl=h,h=Bf(Dp,"onSelect"),0<h.length&&(a=new Gc("onSelect","select",null,a,u),s.push({event:a,listeners:h}),a.target=wo)))}function ga(s,a){var u={};return u[s.toLowerCase()]=a.toLowerCase(),u["Webkit"+s]="webkit"+a,u["Moz"+s]="moz"+a,u}var ko={animationend:ga("Animation","AnimationEnd"),animationiteration:ga("Animation","AnimationIteration"),animationstart:ga("Animation","AnimationStart"),transitionrun:ga("Transition","TransitionRun"),transitionstart:ga("Transition","TransitionStart"),transitioncancel:ga("Transition","TransitionCancel"),transitionend:ga("Transition","TransitionEnd")},jp={},ey={};js&&(ey=document.createElement("div").style,"AnimationEvent"in window||(delete ko.animationend.animation,delete ko.animationiteration.animation,delete ko.animationstart.animation),"TransitionEvent"in window||delete ko.transitionend.transition);function ba(s){if(jp[s])return jp[s];if(!ko[s])return s;var a=ko[s],u;for(u in a)if(a.hasOwnProperty(u)&&u in ey)return jp[s]=a[u];return s}var ty=ba("animationend"),ny=ba("animationiteration"),ry=ba("animationstart"),E6=ba("transitionrun"),T6=ba("transitionstart"),v6=ba("transitioncancel"),sy=ba("transitionend"),iy=new Map,Bp="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Bp.push("scrollEnd");function rs(s,a){iy.set(s,a),pa(a,[s])}var Qc=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},Vr=[],Ao=0,Hp=0;function Wc(){for(var s=Ao,a=Hp=Ao=0;a<s;){var u=Vr[a];Vr[a++]=null;var h=Vr[a];Vr[a++]=null;var x=Vr[a];Vr[a++]=null;var T=Vr[a];if(Vr[a++]=null,h!==null&&x!==null){var R=h.pending;R===null?x.next=x:(x.next=R.next,R.next=x),h.pending=x}T!==0&&ay(u,x,T)}}function Zc(s,a,u,h){Vr[Ao++]=s,Vr[Ao++]=a,Vr[Ao++]=u,Vr[Ao++]=h,Hp|=h,s.lanes|=h,s=s.alternate,s!==null&&(s.lanes|=h)}function Up(s,a,u,h){return Zc(s,a,u,h),Jc(s)}function xa(s,a){return Zc(s,null,null,a),Jc(s)}function ay(s,a,u){s.lanes|=u;var h=s.alternate;h!==null&&(h.lanes|=u);for(var x=!1,T=s.return;T!==null;)T.childLanes|=u,h=T.alternate,h!==null&&(h.childLanes|=u),T.tag===22&&(s=T.stateNode,s===null||s._visibility&1||(x=!0)),s=T,T=T.return;return s.tag===3?(T=s.stateNode,x&&a!==null&&(x=31-Fe(u),s=T.hiddenUpdates,h=s[x],h===null?s[x]=[a]:h.push(a),a.lane=u|536870912),T):null}function Jc(s){if(50<uu)throw uu=0,Km=null,Error(r(185));for(var a=s.return;a!==null;)s=a,a=s.return;return s.tag===3?s.stateNode:null}var _o={};function S6(s,a,u,h){this.tag=s,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _r(s,a,u,h){return new S6(s,a,u,h)}function zp(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Bs(s,a){var u=s.alternate;return u===null?(u=_r(s.tag,a,s.key,s.mode),u.elementType=s.elementType,u.type=s.type,u.stateNode=s.stateNode,u.alternate=s,s.alternate=u):(u.pendingProps=a,u.type=s.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=s.flags&65011712,u.childLanes=s.childLanes,u.lanes=s.lanes,u.child=s.child,u.memoizedProps=s.memoizedProps,u.memoizedState=s.memoizedState,u.updateQueue=s.updateQueue,a=s.dependencies,u.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},u.sibling=s.sibling,u.index=s.index,u.ref=s.ref,u.refCleanup=s.refCleanup,u}function oy(s,a){s.flags&=65011714;var u=s.alternate;return u===null?(s.childLanes=0,s.lanes=a,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=u.childLanes,s.lanes=u.lanes,s.child=u.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=u.memoizedProps,s.memoizedState=u.memoizedState,s.updateQueue=u.updateQueue,s.type=u.type,a=u.dependencies,s.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),s}function ef(s,a,u,h,x,T){var R=0;if(h=s,typeof s=="function")zp(s)&&(R=1);else if(typeof s=="string")R=_O(s,u,ae.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case q:return s=_r(31,u,a,x),s.elementType=q,s.lanes=T,s;case w:return ya(u.children,x,T,a);case k:R=8,x|=24;break;case C:return s=_r(12,u,a,x|2),s.elementType=C,s.lanes=T,s;case D:return s=_r(13,u,a,x),s.elementType=D,s.lanes=T,s;case O:return s=_r(19,u,a,x),s.elementType=O,s.lanes=T,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case _:R=10;break e;case A:R=9;break e;case N:R=11;break e;case j:R=14;break e;case M:R=16,h=null;break e}R=29,u=Error(r(130,s===null?"null":typeof s,"")),h=null}return a=_r(R,u,a,x),a.elementType=s,a.type=h,a.lanes=T,a}function ya(s,a,u,h){return s=_r(7,s,h,a),s.lanes=u,s}function Fp(s,a,u){return s=_r(6,s,null,a),s.lanes=u,s}function ly(s){var a=_r(18,null,null,0);return a.stateNode=s,a}function Vp(s,a,u){return a=_r(4,s.children!==null?s.children:[],s.key,a),a.lanes=u,a.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},a}var uy=new WeakMap;function $r(s,a){if(typeof s=="object"&&s!==null){var u=uy.get(s);return u!==void 0?u:(a={value:s,source:a,stack:Ce(a)},uy.set(s,a),a)}return{value:s,source:a,stack:Ce(a)}}var No=[],Ro=0,tf=null,Fl=0,qr=[],Yr=0,gi=null,ps=1,ms="";function Hs(s,a){No[Ro++]=Fl,No[Ro++]=tf,tf=s,Fl=a}function cy(s,a,u){qr[Yr++]=ps,qr[Yr++]=ms,qr[Yr++]=gi,gi=s;var h=ps;s=ms;var x=32-Fe(h)-1;h&=~(1<<x),u+=1;var T=32-Fe(a)+x;if(30<T){var R=x-x%5;T=(h&(1<<R)-1).toString(32),h>>=R,x-=R,ps=1<<32-Fe(a)+x|u<<x|h,ms=T+s}else ps=1<<T|u<<x|h,ms=s}function $p(s){s.return!==null&&(Hs(s,1),cy(s,1,0))}function qp(s){for(;s===tf;)tf=No[--Ro],No[Ro]=null,Fl=No[--Ro],No[Ro]=null;for(;s===gi;)gi=qr[--Yr],qr[Yr]=null,ms=qr[--Yr],qr[Yr]=null,ps=qr[--Yr],qr[Yr]=null}function fy(s,a){qr[Yr++]=ps,qr[Yr++]=ms,qr[Yr++]=gi,ps=a.id,ms=a.overflow,gi=s}var $n=null,on=null,It=!1,bi=null,Gr=!1,Yp=Error(r(519));function xi(s){var a=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Vl($r(a,s)),Yp}function dy(s){var a=s.stateNode,u=s.type,h=s.memoizedProps;switch(a[en]=s,a[Vn]=h,u){case"dialog":wt("cancel",a),wt("close",a);break;case"iframe":case"object":case"embed":wt("load",a);break;case"video":case"audio":for(u=0;u<fu.length;u++)wt(fu[u],a);break;case"source":wt("error",a);break;case"img":case"image":case"link":wt("error",a),wt("load",a);break;case"details":wt("toggle",a);break;case"input":wt("invalid",a),wx(a,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0);break;case"select":wt("invalid",a);break;case"textarea":wt("invalid",a),Ax(a,h.value,h.defaultValue,h.children)}u=h.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||a.textContent===""+u||h.suppressHydrationWarning===!0||NT(a.textContent,u)?(h.popover!=null&&(wt("beforetoggle",a),wt("toggle",a)),h.onScroll!=null&&wt("scroll",a),h.onScrollEnd!=null&&wt("scrollend",a),h.onClick!=null&&(a.onclick=Ps),a=!0):a=!1,a||xi(s,!0)}function hy(s){for($n=s.return;$n;)switch($n.tag){case 5:case 31:case 13:Gr=!1;return;case 27:case 3:Gr=!0;return;default:$n=$n.return}}function Oo(s){if(s!==$n)return!1;if(!It)return hy(s),It=!0,!1;var a=s.tag,u;if((u=a!==3&&a!==27)&&((u=a===5)&&(u=s.type,u=!(u!=="form"&&u!=="button")||c0(s.type,s.memoizedProps)),u=!u),u&&on&&xi(s),hy(s),a===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));on=BT(s)}else if(a===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));on=BT(s)}else a===27?(a=on,Ii(s.type)?(s=m0,m0=null,on=s):on=a):on=$n?Kr(s.stateNode.nextSibling):null;return!0}function Ea(){on=$n=null,It=!1}function Gp(){var s=bi;return s!==null&&(xr===null?xr=s:xr.push.apply(xr,s),bi=null),s}function Vl(s){bi===null?bi=[s]:bi.push(s)}var Xp=P(null),Ta=null,Us=null;function yi(s,a,u){L(Xp,a._currentValue),a._currentValue=u}function zs(s){s._currentValue=Xp.current,$(Xp)}function Kp(s,a,u){for(;s!==null;){var h=s.alternate;if((s.childLanes&a)!==a?(s.childLanes|=a,h!==null&&(h.childLanes|=a)):h!==null&&(h.childLanes&a)!==a&&(h.childLanes|=a),s===u)break;s=s.return}}function Qp(s,a,u,h){var x=s.child;for(x!==null&&(x.return=s);x!==null;){var T=x.dependencies;if(T!==null){var R=x.child;T=T.firstContext;e:for(;T!==null;){var B=T;T=x;for(var ne=0;ne<a.length;ne++)if(B.context===a[ne]){T.lanes|=u,B=T.alternate,B!==null&&(B.lanes|=u),Kp(T.return,u,s),h||(R=null);break e}T=B.next}}else if(x.tag===18){if(R=x.return,R===null)throw Error(r(341));R.lanes|=u,T=R.alternate,T!==null&&(T.lanes|=u),Kp(R,u,s),R=null}else R=x.child;if(R!==null)R.return=x;else for(R=x;R!==null;){if(R===s){R=null;break}if(x=R.sibling,x!==null){x.return=R.return,R=x;break}R=R.return}x=R}}function Io(s,a,u,h){s=null;for(var x=a,T=!1;x!==null;){if(!T){if((x.flags&524288)!==0)T=!0;else if((x.flags&262144)!==0)break}if(x.tag===10){var R=x.alternate;if(R===null)throw Error(r(387));if(R=R.memoizedProps,R!==null){var B=x.type;Ar(x.pendingProps.value,R.value)||(s!==null?s.push(B):s=[B])}}else if(x===de.current){if(R=x.alternate,R===null)throw Error(r(387));R.memoizedState.memoizedState!==x.memoizedState.memoizedState&&(s!==null?s.push(gu):s=[gu])}x=x.return}s!==null&&Qp(a,s,u,h),a.flags|=262144}function nf(s){for(s=s.firstContext;s!==null;){if(!Ar(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function va(s){Ta=s,Us=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function qn(s){return py(Ta,s)}function rf(s,a){return Ta===null&&va(s),py(s,a)}function py(s,a){var u=a._currentValue;if(a={context:a,memoizedValue:u,next:null},Us===null){if(s===null)throw Error(r(308));Us=a,s.dependencies={lanes:0,firstContext:a},s.flags|=524288}else Us=Us.next=a;return u}var C6=typeof AbortController<"u"?AbortController:function(){var s=[],a=this.signal={aborted:!1,addEventListener:function(u,h){s.push(h)}};this.abort=function(){a.aborted=!0,s.forEach(function(u){return u()})}},w6=e.unstable_scheduleCallback,k6=e.unstable_NormalPriority,Cn={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Wp(){return{controller:new C6,data:new Map,refCount:0}}function $l(s){s.refCount--,s.refCount===0&&w6(k6,function(){s.controller.abort()})}var ql=null,Zp=0,Lo=0,Mo=null;function A6(s,a){if(ql===null){var u=ql=[];Zp=0,Lo=t0(),Mo={status:"pending",value:void 0,then:function(h){u.push(h)}}}return Zp++,a.then(my,my),a}function my(){if(--Zp===0&&ql!==null){Mo!==null&&(Mo.status="fulfilled");var s=ql;ql=null,Lo=0,Mo=null;for(var a=0;a<s.length;a++)(0,s[a])()}}function _6(s,a){var u=[],h={status:"pending",value:null,reason:null,then:function(x){u.push(x)}};return s.then(function(){h.status="fulfilled",h.value=a;for(var x=0;x<u.length;x++)(0,u[x])(a)},function(x){for(h.status="rejected",h.reason=x,x=0;x<u.length;x++)(0,u[x])(void 0)}),h}var gy=H.S;H.S=function(s,a){JE=se(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&A6(s,a),gy!==null&&gy(s,a)};var Sa=P(null);function Jp(){var s=Sa.current;return s!==null?s:tn.pooledCache}function sf(s,a){a===null?L(Sa,Sa.current):L(Sa,a.pool)}function by(){var s=Jp();return s===null?null:{parent:Cn._currentValue,pool:s}}var Do=Error(r(460)),em=Error(r(474)),af=Error(r(542)),of={then:function(){}};function xy(s){return s=s.status,s==="fulfilled"||s==="rejected"}function yy(s,a,u){switch(u=s[u],u===void 0?s.push(a):u!==a&&(a.then(Ps,Ps),a=u),a.status){case"fulfilled":return a.value;case"rejected":throw s=a.reason,Ty(s),s;default:if(typeof a.status=="string")a.then(Ps,Ps);else{if(s=tn,s!==null&&100<s.shellSuspendCounter)throw Error(r(482));s=a,s.status="pending",s.then(function(h){if(a.status==="pending"){var x=a;x.status="fulfilled",x.value=h}},function(h){if(a.status==="pending"){var x=a;x.status="rejected",x.reason=h}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw s=a.reason,Ty(s),s}throw wa=a,Do}}function Ca(s){try{var a=s._init;return a(s._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(wa=u,Do):u}}var wa=null;function Ey(){if(wa===null)throw Error(r(459));var s=wa;return wa=null,s}function Ty(s){if(s===Do||s===af)throw Error(r(483))}var Po=null,Yl=0;function lf(s){var a=Yl;return Yl+=1,Po===null&&(Po=[]),yy(Po,s,a)}function Gl(s,a){a=a.props.ref,s.ref=a!==void 0?a:null}function uf(s,a){throw a.$$typeof===b?Error(r(525)):(s=Object.prototype.toString.call(a),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":s)))}function vy(s){function a(ce,oe){if(s){var ge=ce.deletions;ge===null?(ce.deletions=[oe],ce.flags|=16):ge.push(oe)}}function u(ce,oe){if(!s)return null;for(;oe!==null;)a(ce,oe),oe=oe.sibling;return null}function h(ce){for(var oe=new Map;ce!==null;)ce.key!==null?oe.set(ce.key,ce):oe.set(ce.index,ce),ce=ce.sibling;return oe}function x(ce,oe){return ce=Bs(ce,oe),ce.index=0,ce.sibling=null,ce}function T(ce,oe,ge){return ce.index=ge,s?(ge=ce.alternate,ge!==null?(ge=ge.index,ge<oe?(ce.flags|=67108866,oe):ge):(ce.flags|=67108866,oe)):(ce.flags|=1048576,oe)}function R(ce){return s&&ce.alternate===null&&(ce.flags|=67108866),ce}function B(ce,oe,ge,Ae){return oe===null||oe.tag!==6?(oe=Fp(ge,ce.mode,Ae),oe.return=ce,oe):(oe=x(oe,ge),oe.return=ce,oe)}function ne(ce,oe,ge,Ae){var tt=ge.type;return tt===w?Se(ce,oe,ge.props.children,Ae,ge.key):oe!==null&&(oe.elementType===tt||typeof tt=="object"&&tt!==null&&tt.$$typeof===M&&Ca(tt)===oe.type)?(oe=x(oe,ge.props),Gl(oe,ge),oe.return=ce,oe):(oe=ef(ge.type,ge.key,ge.props,null,ce.mode,Ae),Gl(oe,ge),oe.return=ce,oe)}function be(ce,oe,ge,Ae){return oe===null||oe.tag!==4||oe.stateNode.containerInfo!==ge.containerInfo||oe.stateNode.implementation!==ge.implementation?(oe=Vp(ge,ce.mode,Ae),oe.return=ce,oe):(oe=x(oe,ge.children||[]),oe.return=ce,oe)}function Se(ce,oe,ge,Ae,tt){return oe===null||oe.tag!==7?(oe=ya(ge,ce.mode,Ae,tt),oe.return=ce,oe):(oe=x(oe,ge),oe.return=ce,oe)}function _e(ce,oe,ge){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return oe=Fp(""+oe,ce.mode,ge),oe.return=ce,oe;if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case y:return ge=ef(oe.type,oe.key,oe.props,null,ce.mode,ge),Gl(ge,oe),ge.return=ce,ge;case E:return oe=Vp(oe,ce.mode,ge),oe.return=ce,oe;case M:return oe=Ca(oe),_e(ce,oe,ge)}if(Y(oe)||Z(oe))return oe=ya(oe,ce.mode,ge,null),oe.return=ce,oe;if(typeof oe.then=="function")return _e(ce,lf(oe),ge);if(oe.$$typeof===_)return _e(ce,rf(ce,oe),ge);uf(ce,oe)}return null}function xe(ce,oe,ge,Ae){var tt=oe!==null?oe.key:null;if(typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint")return tt!==null?null:B(ce,oe,""+ge,Ae);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case y:return ge.key===tt?ne(ce,oe,ge,Ae):null;case E:return ge.key===tt?be(ce,oe,ge,Ae):null;case M:return ge=Ca(ge),xe(ce,oe,ge,Ae)}if(Y(ge)||Z(ge))return tt!==null?null:Se(ce,oe,ge,Ae,null);if(typeof ge.then=="function")return xe(ce,oe,lf(ge),Ae);if(ge.$$typeof===_)return xe(ce,oe,rf(ce,ge),Ae);uf(ce,ge)}return null}function ye(ce,oe,ge,Ae,tt){if(typeof Ae=="string"&&Ae!==""||typeof Ae=="number"||typeof Ae=="bigint")return ce=ce.get(ge)||null,B(oe,ce,""+Ae,tt);if(typeof Ae=="object"&&Ae!==null){switch(Ae.$$typeof){case y:return ce=ce.get(Ae.key===null?ge:Ae.key)||null,ne(oe,ce,Ae,tt);case E:return ce=ce.get(Ae.key===null?ge:Ae.key)||null,be(oe,ce,Ae,tt);case M:return Ae=Ca(Ae),ye(ce,oe,ge,Ae,tt)}if(Y(Ae)||Z(Ae))return ce=ce.get(ge)||null,Se(oe,ce,Ae,tt,null);if(typeof Ae.then=="function")return ye(ce,oe,ge,lf(Ae),tt);if(Ae.$$typeof===_)return ye(ce,oe,ge,rf(oe,Ae),tt);uf(oe,Ae)}return null}function Qe(ce,oe,ge,Ae){for(var tt=null,Bt=null,Ze=oe,mt=oe=0,Nt=null;Ze!==null&&mt<ge.length;mt++){Ze.index>mt?(Nt=Ze,Ze=null):Nt=Ze.sibling;var Ht=xe(ce,Ze,ge[mt],Ae);if(Ht===null){Ze===null&&(Ze=Nt);break}s&&Ze&&Ht.alternate===null&&a(ce,Ze),oe=T(Ht,oe,mt),Bt===null?tt=Ht:Bt.sibling=Ht,Bt=Ht,Ze=Nt}if(mt===ge.length)return u(ce,Ze),It&&Hs(ce,mt),tt;if(Ze===null){for(;mt<ge.length;mt++)Ze=_e(ce,ge[mt],Ae),Ze!==null&&(oe=T(Ze,oe,mt),Bt===null?tt=Ze:Bt.sibling=Ze,Bt=Ze);return It&&Hs(ce,mt),tt}for(Ze=h(Ze);mt<ge.length;mt++)Nt=ye(Ze,ce,mt,ge[mt],Ae),Nt!==null&&(s&&Nt.alternate!==null&&Ze.delete(Nt.key===null?mt:Nt.key),oe=T(Nt,oe,mt),Bt===null?tt=Nt:Bt.sibling=Nt,Bt=Nt);return s&&Ze.forEach(function(ji){return a(ce,ji)}),It&&Hs(ce,mt),tt}function it(ce,oe,ge,Ae){if(ge==null)throw Error(r(151));for(var tt=null,Bt=null,Ze=oe,mt=oe=0,Nt=null,Ht=ge.next();Ze!==null&&!Ht.done;mt++,Ht=ge.next()){Ze.index>mt?(Nt=Ze,Ze=null):Nt=Ze.sibling;var ji=xe(ce,Ze,Ht.value,Ae);if(ji===null){Ze===null&&(Ze=Nt);break}s&&Ze&&ji.alternate===null&&a(ce,Ze),oe=T(ji,oe,mt),Bt===null?tt=ji:Bt.sibling=ji,Bt=ji,Ze=Nt}if(Ht.done)return u(ce,Ze),It&&Hs(ce,mt),tt;if(Ze===null){for(;!Ht.done;mt++,Ht=ge.next())Ht=_e(ce,Ht.value,Ae),Ht!==null&&(oe=T(Ht,oe,mt),Bt===null?tt=Ht:Bt.sibling=Ht,Bt=Ht);return It&&Hs(ce,mt),tt}for(Ze=h(Ze);!Ht.done;mt++,Ht=ge.next())Ht=ye(Ze,ce,mt,Ht.value,Ae),Ht!==null&&(s&&Ht.alternate!==null&&Ze.delete(Ht.key===null?mt:Ht.key),oe=T(Ht,oe,mt),Bt===null?tt=Ht:Bt.sibling=Ht,Bt=Ht);return s&&Ze.forEach(function(HO){return a(ce,HO)}),It&&Hs(ce,mt),tt}function Gt(ce,oe,ge,Ae){if(typeof ge=="object"&&ge!==null&&ge.type===w&&ge.key===null&&(ge=ge.props.children),typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case y:e:{for(var tt=ge.key;oe!==null;){if(oe.key===tt){if(tt=ge.type,tt===w){if(oe.tag===7){u(ce,oe.sibling),Ae=x(oe,ge.props.children),Ae.return=ce,ce=Ae;break e}}else if(oe.elementType===tt||typeof tt=="object"&&tt!==null&&tt.$$typeof===M&&Ca(tt)===oe.type){u(ce,oe.sibling),Ae=x(oe,ge.props),Gl(Ae,ge),Ae.return=ce,ce=Ae;break e}u(ce,oe);break}else a(ce,oe);oe=oe.sibling}ge.type===w?(Ae=ya(ge.props.children,ce.mode,Ae,ge.key),Ae.return=ce,ce=Ae):(Ae=ef(ge.type,ge.key,ge.props,null,ce.mode,Ae),Gl(Ae,ge),Ae.return=ce,ce=Ae)}return R(ce);case E:e:{for(tt=ge.key;oe!==null;){if(oe.key===tt)if(oe.tag===4&&oe.stateNode.containerInfo===ge.containerInfo&&oe.stateNode.implementation===ge.implementation){u(ce,oe.sibling),Ae=x(oe,ge.children||[]),Ae.return=ce,ce=Ae;break e}else{u(ce,oe);break}else a(ce,oe);oe=oe.sibling}Ae=Vp(ge,ce.mode,Ae),Ae.return=ce,ce=Ae}return R(ce);case M:return ge=Ca(ge),Gt(ce,oe,ge,Ae)}if(Y(ge))return Qe(ce,oe,ge,Ae);if(Z(ge)){if(tt=Z(ge),typeof tt!="function")throw Error(r(150));return ge=tt.call(ge),it(ce,oe,ge,Ae)}if(typeof ge.then=="function")return Gt(ce,oe,lf(ge),Ae);if(ge.$$typeof===_)return Gt(ce,oe,rf(ce,ge),Ae);uf(ce,ge)}return typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint"?(ge=""+ge,oe!==null&&oe.tag===6?(u(ce,oe.sibling),Ae=x(oe,ge),Ae.return=ce,ce=Ae):(u(ce,oe),Ae=Fp(ge,ce.mode,Ae),Ae.return=ce,ce=Ae),R(ce)):u(ce,oe)}return function(ce,oe,ge,Ae){try{Yl=0;var tt=Gt(ce,oe,ge,Ae);return Po=null,tt}catch(Ze){if(Ze===Do||Ze===af)throw Ze;var Bt=_r(29,Ze,null,ce.mode);return Bt.lanes=Ae,Bt.return=ce,Bt}finally{}}}var ka=vy(!0),Sy=vy(!1),Ei=!1;function tm(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function nm(s,a){s=s.updateQueue,a.updateQueue===s&&(a.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function Ti(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function vi(s,a,u){var h=s.updateQueue;if(h===null)return null;if(h=h.shared,(zt&2)!==0){var x=h.pending;return x===null?a.next=a:(a.next=x.next,x.next=a),h.pending=a,a=Jc(s),ay(s,null,u),a}return Zc(s,h,a,u),Jc(s)}function Xl(s,a,u){if(a=a.updateQueue,a!==null&&(a=a.shared,(u&4194048)!==0)){var h=a.lanes;h&=s.pendingLanes,u|=h,a.lanes=u,hn(s,u)}}function rm(s,a){var u=s.updateQueue,h=s.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var x=null,T=null;if(u=u.firstBaseUpdate,u!==null){do{var R={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};T===null?x=T=R:T=T.next=R,u=u.next}while(u!==null);T===null?x=T=a:T=T.next=a}else x=T=a;u={baseState:h.baseState,firstBaseUpdate:x,lastBaseUpdate:T,shared:h.shared,callbacks:h.callbacks},s.updateQueue=u;return}s=u.lastBaseUpdate,s===null?u.firstBaseUpdate=a:s.next=a,u.lastBaseUpdate=a}var sm=!1;function Kl(){if(sm){var s=Mo;if(s!==null)throw s}}function Ql(s,a,u,h){sm=!1;var x=s.updateQueue;Ei=!1;var T=x.firstBaseUpdate,R=x.lastBaseUpdate,B=x.shared.pending;if(B!==null){x.shared.pending=null;var ne=B,be=ne.next;ne.next=null,R===null?T=be:R.next=be,R=ne;var Se=s.alternate;Se!==null&&(Se=Se.updateQueue,B=Se.lastBaseUpdate,B!==R&&(B===null?Se.firstBaseUpdate=be:B.next=be,Se.lastBaseUpdate=ne))}if(T!==null){var _e=x.baseState;R=0,Se=be=ne=null,B=T;do{var xe=B.lane&-536870913,ye=xe!==B.lane;if(ye?(_t&xe)===xe:(h&xe)===xe){xe!==0&&xe===Lo&&(sm=!0),Se!==null&&(Se=Se.next={lane:0,tag:B.tag,payload:B.payload,callback:null,next:null});e:{var Qe=s,it=B;xe=a;var Gt=u;switch(it.tag){case 1:if(Qe=it.payload,typeof Qe=="function"){_e=Qe.call(Gt,_e,xe);break e}_e=Qe;break e;case 3:Qe.flags=Qe.flags&-65537|128;case 0:if(Qe=it.payload,xe=typeof Qe=="function"?Qe.call(Gt,_e,xe):Qe,xe==null)break e;_e=p({},_e,xe);break e;case 2:Ei=!0}}xe=B.callback,xe!==null&&(s.flags|=64,ye&&(s.flags|=8192),ye=x.callbacks,ye===null?x.callbacks=[xe]:ye.push(xe))}else ye={lane:xe,tag:B.tag,payload:B.payload,callback:B.callback,next:null},Se===null?(be=Se=ye,ne=_e):Se=Se.next=ye,R|=xe;if(B=B.next,B===null){if(B=x.shared.pending,B===null)break;ye=B,B=ye.next,ye.next=null,x.lastBaseUpdate=ye,x.shared.pending=null}}while(!0);Se===null&&(ne=_e),x.baseState=ne,x.firstBaseUpdate=be,x.lastBaseUpdate=Se,T===null&&(x.shared.lanes=0),Ai|=R,s.lanes=R,s.memoizedState=_e}}function Cy(s,a){if(typeof s!="function")throw Error(r(191,s));s.call(a)}function wy(s,a){var u=s.callbacks;if(u!==null)for(s.callbacks=null,s=0;s<u.length;s++)Cy(u[s],a)}var jo=P(null),cf=P(0);function ky(s,a){s=Qs,L(cf,s),L(jo,a),Qs=s|a.baseLanes}function im(){L(cf,Qs),L(jo,jo.current)}function am(){Qs=cf.current,$(jo),$(cf)}var Nr=P(null),Xr=null;function Si(s){var a=s.alternate;L(Tn,Tn.current&1),L(Nr,s),Xr===null&&(a===null||jo.current!==null||a.memoizedState!==null)&&(Xr=s)}function om(s){L(Tn,Tn.current),L(Nr,s),Xr===null&&(Xr=s)}function Ay(s){s.tag===22?(L(Tn,Tn.current),L(Nr,s),Xr===null&&(Xr=s)):Ci()}function Ci(){L(Tn,Tn.current),L(Nr,Nr.current)}function Rr(s){$(Nr),Xr===s&&(Xr=null),$(Tn)}var Tn=P(0);function ff(s){for(var a=s;a!==null;){if(a.tag===13){var u=a.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||h0(u)||p0(u)))return a}else if(a.tag===19&&(a.memoizedProps.revealOrder==="forwards"||a.memoizedProps.revealOrder==="backwards"||a.memoizedProps.revealOrder==="unstable_legacy-backwards"||a.memoizedProps.revealOrder==="together")){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===s)break;for(;a.sibling===null;){if(a.return===null||a.return===s)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var Fs=0,pt=null,qt=null,wn=null,df=!1,Bo=!1,Aa=!1,hf=0,Wl=0,Ho=null,N6=0;function mn(){throw Error(r(321))}function lm(s,a){if(a===null)return!1;for(var u=0;u<a.length&&u<s.length;u++)if(!Ar(s[u],a[u]))return!1;return!0}function um(s,a,u,h,x,T){return Fs=T,pt=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,H.H=s===null||s.memoizedState===null?cE:Cm,Aa=!1,T=u(h,x),Aa=!1,Bo&&(T=Ny(a,u,h,x)),_y(s),T}function _y(s){H.H=eu;var a=qt!==null&&qt.next!==null;if(Fs=0,wn=qt=pt=null,df=!1,Wl=0,Ho=null,a)throw Error(r(300));s===null||kn||(s=s.dependencies,s!==null&&nf(s)&&(kn=!0))}function Ny(s,a,u,h){pt=s;var x=0;do{if(Bo&&(Ho=null),Wl=0,Bo=!1,25<=x)throw Error(r(301));if(x+=1,wn=qt=null,s.updateQueue!=null){var T=s.updateQueue;T.lastEffect=null,T.events=null,T.stores=null,T.memoCache!=null&&(T.memoCache.index=0)}H.H=fE,T=a(u,h)}while(Bo);return T}function R6(){var s=H.H,a=s.useState()[0];return a=typeof a.then=="function"?Zl(a):a,s=s.useState()[0],(qt!==null?qt.memoizedState:null)!==s&&(pt.flags|=1024),a}function cm(){var s=hf!==0;return hf=0,s}function fm(s,a,u){a.updateQueue=s.updateQueue,a.flags&=-2053,s.lanes&=~u}function dm(s){if(df){for(s=s.memoizedState;s!==null;){var a=s.queue;a!==null&&(a.pending=null),s=s.next}df=!1}Fs=0,wn=qt=pt=null,Bo=!1,Wl=hf=0,Ho=null}function rr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return wn===null?pt.memoizedState=wn=s:wn=wn.next=s,wn}function vn(){if(qt===null){var s=pt.alternate;s=s!==null?s.memoizedState:null}else s=qt.next;var a=wn===null?pt.memoizedState:wn.next;if(a!==null)wn=a,qt=s;else{if(s===null)throw pt.alternate===null?Error(r(467)):Error(r(310));qt=s,s={memoizedState:qt.memoizedState,baseState:qt.baseState,baseQueue:qt.baseQueue,queue:qt.queue,next:null},wn===null?pt.memoizedState=wn=s:wn=wn.next=s}return wn}function pf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Zl(s){var a=Wl;return Wl+=1,Ho===null&&(Ho=[]),s=yy(Ho,s,a),a=pt,(wn===null?a.memoizedState:wn.next)===null&&(a=a.alternate,H.H=a===null||a.memoizedState===null?cE:Cm),s}function mf(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return Zl(s);if(s.$$typeof===_)return qn(s)}throw Error(r(438,String(s)))}function hm(s){var a=null,u=pt.updateQueue;if(u!==null&&(a=u.memoCache),a==null){var h=pt.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(a={data:h.data.map(function(x){return x.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),u===null&&(u=pf(),pt.updateQueue=u),u.memoCache=a,u=a.data[a.index],u===void 0)for(u=a.data[a.index]=Array(s),h=0;h<s;h++)u[h]=U;return a.index++,u}function Vs(s,a){return typeof a=="function"?a(s):a}function gf(s){var a=vn();return pm(a,qt,s)}function pm(s,a,u){var h=s.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=u;var x=s.baseQueue,T=h.pending;if(T!==null){if(x!==null){var R=x.next;x.next=T.next,T.next=R}a.baseQueue=x=T,h.pending=null}if(T=s.baseState,x===null)s.memoizedState=T;else{a=x.next;var B=R=null,ne=null,be=a,Se=!1;do{var _e=be.lane&-536870913;if(_e!==be.lane?(_t&_e)===_e:(Fs&_e)===_e){var xe=be.revertLane;if(xe===0)ne!==null&&(ne=ne.next={lane:0,revertLane:0,gesture:null,action:be.action,hasEagerState:be.hasEagerState,eagerState:be.eagerState,next:null}),_e===Lo&&(Se=!0);else if((Fs&xe)===xe){be=be.next,xe===Lo&&(Se=!0);continue}else _e={lane:0,revertLane:be.revertLane,gesture:null,action:be.action,hasEagerState:be.hasEagerState,eagerState:be.eagerState,next:null},ne===null?(B=ne=_e,R=T):ne=ne.next=_e,pt.lanes|=xe,Ai|=xe;_e=be.action,Aa&&u(T,_e),T=be.hasEagerState?be.eagerState:u(T,_e)}else xe={lane:_e,revertLane:be.revertLane,gesture:be.gesture,action:be.action,hasEagerState:be.hasEagerState,eagerState:be.eagerState,next:null},ne===null?(B=ne=xe,R=T):ne=ne.next=xe,pt.lanes|=_e,Ai|=_e;be=be.next}while(be!==null&&be!==a);if(ne===null?R=T:ne.next=B,!Ar(T,s.memoizedState)&&(kn=!0,Se&&(u=Mo,u!==null)))throw u;s.memoizedState=T,s.baseState=R,s.baseQueue=ne,h.lastRenderedState=T}return x===null&&(h.lanes=0),[s.memoizedState,h.dispatch]}function mm(s){var a=vn(),u=a.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=s;var h=u.dispatch,x=u.pending,T=a.memoizedState;if(x!==null){u.pending=null;var R=x=x.next;do T=s(T,R.action),R=R.next;while(R!==x);Ar(T,a.memoizedState)||(kn=!0),a.memoizedState=T,a.baseQueue===null&&(a.baseState=T),u.lastRenderedState=T}return[T,h]}function Ry(s,a,u){var h=pt,x=vn(),T=It;if(T){if(u===void 0)throw Error(r(407));u=u()}else u=a();var R=!Ar((qt||x).memoizedState,u);if(R&&(x.memoizedState=u,kn=!0),x=x.queue,xm(Ly.bind(null,h,x,s),[s]),x.getSnapshot!==a||R||wn!==null&&wn.memoizedState.tag&1){if(h.flags|=2048,Uo(9,{destroy:void 0},Iy.bind(null,h,x,u,a),null),tn===null)throw Error(r(349));T||(Fs&127)!==0||Oy(h,a,u)}return u}function Oy(s,a,u){s.flags|=16384,s={getSnapshot:a,value:u},a=pt.updateQueue,a===null?(a=pf(),pt.updateQueue=a,a.stores=[s]):(u=a.stores,u===null?a.stores=[s]:u.push(s))}function Iy(s,a,u,h){a.value=u,a.getSnapshot=h,My(a)&&Dy(s)}function Ly(s,a,u){return u(function(){My(a)&&Dy(s)})}function My(s){var a=s.getSnapshot;s=s.value;try{var u=a();return!Ar(s,u)}catch{return!0}}function Dy(s){var a=xa(s,2);a!==null&&yr(a,s,2)}function gm(s){var a=rr();if(typeof s=="function"){var u=s;if(s=u(),Aa){ut(!0);try{u()}finally{ut(!1)}}}return a.memoizedState=a.baseState=s,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vs,lastRenderedState:s},a}function Py(s,a,u,h){return s.baseState=u,pm(s,qt,typeof h=="function"?h:Vs)}function O6(s,a,u,h,x){if(yf(s))throw Error(r(485));if(s=a.action,s!==null){var T={payload:x,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(R){T.listeners.push(R)}};H.T!==null?u(!0):T.isTransition=!1,h(T),u=a.pending,u===null?(T.next=a.pending=T,jy(a,T)):(T.next=u.next,a.pending=u.next=T)}}function jy(s,a){var u=a.action,h=a.payload,x=s.state;if(a.isTransition){var T=H.T,R={};H.T=R;try{var B=u(x,h),ne=H.S;ne!==null&&ne(R,B),By(s,a,B)}catch(be){bm(s,a,be)}finally{T!==null&&R.types!==null&&(T.types=R.types),H.T=T}}else try{T=u(x,h),By(s,a,T)}catch(be){bm(s,a,be)}}function By(s,a,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(h){Hy(s,a,h)},function(h){return bm(s,a,h)}):Hy(s,a,u)}function Hy(s,a,u){a.status="fulfilled",a.value=u,Uy(a),s.state=u,a=s.pending,a!==null&&(u=a.next,u===a?s.pending=null:(u=u.next,a.next=u,jy(s,u)))}function bm(s,a,u){var h=s.pending;if(s.pending=null,h!==null){h=h.next;do a.status="rejected",a.reason=u,Uy(a),a=a.next;while(a!==h)}s.action=null}function Uy(s){s=s.listeners;for(var a=0;a<s.length;a++)(0,s[a])()}function zy(s,a){return a}function Fy(s,a){if(It){var u=tn.formState;if(u!==null){e:{var h=pt;if(It){if(on){t:{for(var x=on,T=Gr;x.nodeType!==8;){if(!T){x=null;break t}if(x=Kr(x.nextSibling),x===null){x=null;break t}}T=x.data,x=T==="F!"||T==="F"?x:null}if(x){on=Kr(x.nextSibling),h=x.data==="F!";break e}}xi(h)}h=!1}h&&(a=u[0])}}return u=rr(),u.memoizedState=u.baseState=a,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:zy,lastRenderedState:a},u.queue=h,u=oE.bind(null,pt,h),h.dispatch=u,h=gm(!1),T=Sm.bind(null,pt,!1,h.queue),h=rr(),x={state:a,dispatch:null,action:s,pending:null},h.queue=x,u=O6.bind(null,pt,x,T,u),x.dispatch=u,h.memoizedState=s,[a,u,!1]}function Vy(s){var a=vn();return $y(a,qt,s)}function $y(s,a,u){if(a=pm(s,a,zy)[0],s=gf(Vs)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var h=Zl(a)}catch(R){throw R===Do?af:R}else h=a;a=vn();var x=a.queue,T=x.dispatch;return u!==a.memoizedState&&(pt.flags|=2048,Uo(9,{destroy:void 0},I6.bind(null,x,u),null)),[h,T,s]}function I6(s,a){s.action=a}function qy(s){var a=vn(),u=qt;if(u!==null)return $y(a,u,s);vn(),a=a.memoizedState,u=vn();var h=u.queue.dispatch;return u.memoizedState=s,[a,h,!1]}function Uo(s,a,u,h){return s={tag:s,create:u,deps:h,inst:a,next:null},a=pt.updateQueue,a===null&&(a=pf(),pt.updateQueue=a),u=a.lastEffect,u===null?a.lastEffect=s.next=s:(h=u.next,u.next=s,s.next=h,a.lastEffect=s),s}function Yy(){return vn().memoizedState}function bf(s,a,u,h){var x=rr();pt.flags|=s,x.memoizedState=Uo(1|a,{destroy:void 0},u,h===void 0?null:h)}function xf(s,a,u,h){var x=vn();h=h===void 0?null:h;var T=x.memoizedState.inst;qt!==null&&h!==null&&lm(h,qt.memoizedState.deps)?x.memoizedState=Uo(a,T,u,h):(pt.flags|=s,x.memoizedState=Uo(1|a,T,u,h))}function Gy(s,a){bf(8390656,8,s,a)}function xm(s,a){xf(2048,8,s,a)}function L6(s){pt.flags|=4;var a=pt.updateQueue;if(a===null)a=pf(),pt.updateQueue=a,a.events=[s];else{var u=a.events;u===null?a.events=[s]:u.push(s)}}function Xy(s){var a=vn().memoizedState;return L6({ref:a,nextImpl:s}),function(){if((zt&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}function Ky(s,a){return xf(4,2,s,a)}function Qy(s,a){return xf(4,4,s,a)}function Wy(s,a){if(typeof a=="function"){s=s();var u=a(s);return function(){typeof u=="function"?u():a(null)}}if(a!=null)return s=s(),a.current=s,function(){a.current=null}}function Zy(s,a,u){u=u!=null?u.concat([s]):null,xf(4,4,Wy.bind(null,a,s),u)}function ym(){}function Jy(s,a){var u=vn();a=a===void 0?null:a;var h=u.memoizedState;return a!==null&&lm(a,h[1])?h[0]:(u.memoizedState=[s,a],s)}function eE(s,a){var u=vn();a=a===void 0?null:a;var h=u.memoizedState;if(a!==null&&lm(a,h[1]))return h[0];if(h=s(),Aa){ut(!0);try{s()}finally{ut(!1)}}return u.memoizedState=[h,a],h}function Em(s,a,u){return u===void 0||(Fs&1073741824)!==0&&(_t&261930)===0?s.memoizedState=a:(s.memoizedState=u,s=tT(),pt.lanes|=s,Ai|=s,u)}function tE(s,a,u,h){return Ar(u,a)?u:jo.current!==null?(s=Em(s,u,h),Ar(s,a)||(kn=!0),s):(Fs&42)===0||(Fs&1073741824)!==0&&(_t&261930)===0?(kn=!0,s.memoizedState=u):(s=tT(),pt.lanes|=s,Ai|=s,a)}function nE(s,a,u,h,x){var T=K.p;K.p=T!==0&&8>T?T:8;var R=H.T,B={};H.T=B,Sm(s,!1,a,u);try{var ne=x(),be=H.S;if(be!==null&&be(B,ne),ne!==null&&typeof ne=="object"&&typeof ne.then=="function"){var Se=_6(ne,h);Jl(s,a,Se,Lr(s))}else Jl(s,a,h,Lr(s))}catch(_e){Jl(s,a,{then:function(){},status:"rejected",reason:_e},Lr())}finally{K.p=T,R!==null&&B.types!==null&&(R.types=B.types),H.T=R}}function M6(){}function Tm(s,a,u,h){if(s.tag!==5)throw Error(r(476));var x=rE(s).queue;nE(s,x,a,te,u===null?M6:function(){return sE(s),u(h)})}function rE(s){var a=s.memoizedState;if(a!==null)return a;a={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vs,lastRenderedState:te},next:null};var u={};return a.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vs,lastRenderedState:u},next:null},s.memoizedState=a,s=s.alternate,s!==null&&(s.memoizedState=a),a}function sE(s){var a=rE(s);a.next===null&&(a=s.alternate.memoizedState),Jl(s,a.next.queue,{},Lr())}function vm(){return qn(gu)}function iE(){return vn().memoizedState}function aE(){return vn().memoizedState}function D6(s){for(var a=s.return;a!==null;){switch(a.tag){case 24:case 3:var u=Lr();s=Ti(u);var h=vi(a,s,u);h!==null&&(yr(h,a,u),Xl(h,a,u)),a={cache:Wp()},s.payload=a;return}a=a.return}}function P6(s,a,u){var h=Lr();u={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},yf(s)?lE(a,u):(u=Up(s,a,u,h),u!==null&&(yr(u,s,h),uE(u,a,h)))}function oE(s,a,u){var h=Lr();Jl(s,a,u,h)}function Jl(s,a,u,h){var x={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(yf(s))lE(a,x);else{var T=s.alternate;if(s.lanes===0&&(T===null||T.lanes===0)&&(T=a.lastRenderedReducer,T!==null))try{var R=a.lastRenderedState,B=T(R,u);if(x.hasEagerState=!0,x.eagerState=B,Ar(B,R))return Zc(s,a,x,0),tn===null&&Wc(),!1}catch{}finally{}if(u=Up(s,a,x,h),u!==null)return yr(u,s,h),uE(u,a,h),!0}return!1}function Sm(s,a,u,h){if(h={lane:2,revertLane:t0(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},yf(s)){if(a)throw Error(r(479))}else a=Up(s,u,h,2),a!==null&&yr(a,s,2)}function yf(s){var a=s.alternate;return s===pt||a!==null&&a===pt}function lE(s,a){Bo=df=!0;var u=s.pending;u===null?a.next=a:(a.next=u.next,u.next=a),s.pending=a}function uE(s,a,u){if((u&4194048)!==0){var h=a.lanes;h&=s.pendingLanes,u|=h,a.lanes=u,hn(s,u)}}var eu={readContext:qn,use:mf,useCallback:mn,useContext:mn,useEffect:mn,useImperativeHandle:mn,useLayoutEffect:mn,useInsertionEffect:mn,useMemo:mn,useReducer:mn,useRef:mn,useState:mn,useDebugValue:mn,useDeferredValue:mn,useTransition:mn,useSyncExternalStore:mn,useId:mn,useHostTransitionStatus:mn,useFormState:mn,useActionState:mn,useOptimistic:mn,useMemoCache:mn,useCacheRefresh:mn};eu.useEffectEvent=mn;var cE={readContext:qn,use:mf,useCallback:function(s,a){return rr().memoizedState=[s,a===void 0?null:a],s},useContext:qn,useEffect:Gy,useImperativeHandle:function(s,a,u){u=u!=null?u.concat([s]):null,bf(4194308,4,Wy.bind(null,a,s),u)},useLayoutEffect:function(s,a){return bf(4194308,4,s,a)},useInsertionEffect:function(s,a){bf(4,2,s,a)},useMemo:function(s,a){var u=rr();a=a===void 0?null:a;var h=s();if(Aa){ut(!0);try{s()}finally{ut(!1)}}return u.memoizedState=[h,a],h},useReducer:function(s,a,u){var h=rr();if(u!==void 0){var x=u(a);if(Aa){ut(!0);try{u(a)}finally{ut(!1)}}}else x=a;return h.memoizedState=h.baseState=x,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:x},h.queue=s,s=s.dispatch=P6.bind(null,pt,s),[h.memoizedState,s]},useRef:function(s){var a=rr();return s={current:s},a.memoizedState=s},useState:function(s){s=gm(s);var a=s.queue,u=oE.bind(null,pt,a);return a.dispatch=u,[s.memoizedState,u]},useDebugValue:ym,useDeferredValue:function(s,a){var u=rr();return Em(u,s,a)},useTransition:function(){var s=gm(!1);return s=nE.bind(null,pt,s.queue,!0,!1),rr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,a,u){var h=pt,x=rr();if(It){if(u===void 0)throw Error(r(407));u=u()}else{if(u=a(),tn===null)throw Error(r(349));(_t&127)!==0||Oy(h,a,u)}x.memoizedState=u;var T={value:u,getSnapshot:a};return x.queue=T,Gy(Ly.bind(null,h,T,s),[s]),h.flags|=2048,Uo(9,{destroy:void 0},Iy.bind(null,h,T,u,a),null),u},useId:function(){var s=rr(),a=tn.identifierPrefix;if(It){var u=ms,h=ps;u=(h&~(1<<32-Fe(h)-1)).toString(32)+u,a="_"+a+"R_"+u,u=hf++,0<u&&(a+="H"+u.toString(32)),a+="_"}else u=N6++,a="_"+a+"r_"+u.toString(32)+"_";return s.memoizedState=a},useHostTransitionStatus:vm,useFormState:Fy,useActionState:Fy,useOptimistic:function(s){var a=rr();a.memoizedState=a.baseState=s;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=u,a=Sm.bind(null,pt,!0,u),u.dispatch=a,[s,a]},useMemoCache:hm,useCacheRefresh:function(){return rr().memoizedState=D6.bind(null,pt)},useEffectEvent:function(s){var a=rr(),u={impl:s};return a.memoizedState=u,function(){if((zt&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}},Cm={readContext:qn,use:mf,useCallback:Jy,useContext:qn,useEffect:xm,useImperativeHandle:Zy,useInsertionEffect:Ky,useLayoutEffect:Qy,useMemo:eE,useReducer:gf,useRef:Yy,useState:function(){return gf(Vs)},useDebugValue:ym,useDeferredValue:function(s,a){var u=vn();return tE(u,qt.memoizedState,s,a)},useTransition:function(){var s=gf(Vs)[0],a=vn().memoizedState;return[typeof s=="boolean"?s:Zl(s),a]},useSyncExternalStore:Ry,useId:iE,useHostTransitionStatus:vm,useFormState:Vy,useActionState:Vy,useOptimistic:function(s,a){var u=vn();return Py(u,qt,s,a)},useMemoCache:hm,useCacheRefresh:aE};Cm.useEffectEvent=Xy;var fE={readContext:qn,use:mf,useCallback:Jy,useContext:qn,useEffect:xm,useImperativeHandle:Zy,useInsertionEffect:Ky,useLayoutEffect:Qy,useMemo:eE,useReducer:mm,useRef:Yy,useState:function(){return mm(Vs)},useDebugValue:ym,useDeferredValue:function(s,a){var u=vn();return qt===null?Em(u,s,a):tE(u,qt.memoizedState,s,a)},useTransition:function(){var s=mm(Vs)[0],a=vn().memoizedState;return[typeof s=="boolean"?s:Zl(s),a]},useSyncExternalStore:Ry,useId:iE,useHostTransitionStatus:vm,useFormState:qy,useActionState:qy,useOptimistic:function(s,a){var u=vn();return qt!==null?Py(u,qt,s,a):(u.baseState=s,[s,u.queue.dispatch])},useMemoCache:hm,useCacheRefresh:aE};fE.useEffectEvent=Xy;function wm(s,a,u,h){a=s.memoizedState,u=u(h,a),u=u==null?a:p({},a,u),s.memoizedState=u,s.lanes===0&&(s.updateQueue.baseState=u)}var km={enqueueSetState:function(s,a,u){s=s._reactInternals;var h=Lr(),x=Ti(h);x.payload=a,u!=null&&(x.callback=u),a=vi(s,x,h),a!==null&&(yr(a,s,h),Xl(a,s,h))},enqueueReplaceState:function(s,a,u){s=s._reactInternals;var h=Lr(),x=Ti(h);x.tag=1,x.payload=a,u!=null&&(x.callback=u),a=vi(s,x,h),a!==null&&(yr(a,s,h),Xl(a,s,h))},enqueueForceUpdate:function(s,a){s=s._reactInternals;var u=Lr(),h=Ti(u);h.tag=2,a!=null&&(h.callback=a),a=vi(s,h,u),a!==null&&(yr(a,s,u),Xl(a,s,u))}};function dE(s,a,u,h,x,T,R){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(h,T,R):a.prototype&&a.prototype.isPureReactComponent?!Ul(u,h)||!Ul(x,T):!0}function hE(s,a,u,h){s=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(u,h),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(u,h),a.state!==s&&km.enqueueReplaceState(a,a.state,null)}function _a(s,a){var u=a;if("ref"in a){u={};for(var h in a)h!=="ref"&&(u[h]=a[h])}if(s=s.defaultProps){u===a&&(u=p({},u));for(var x in s)u[x]===void 0&&(u[x]=s[x])}return u}function pE(s){Qc(s)}function mE(s){console.error(s)}function gE(s){Qc(s)}function Ef(s,a){try{var u=s.onUncaughtError;u(a.value,{componentStack:a.stack})}catch(h){setTimeout(function(){throw h})}}function bE(s,a,u){try{var h=s.onCaughtError;h(u.value,{componentStack:u.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(x){setTimeout(function(){throw x})}}function Am(s,a,u){return u=Ti(u),u.tag=3,u.payload={element:null},u.callback=function(){Ef(s,a)},u}function xE(s){return s=Ti(s),s.tag=3,s}function yE(s,a,u,h){var x=u.type.getDerivedStateFromError;if(typeof x=="function"){var T=h.value;s.payload=function(){return x(T)},s.callback=function(){bE(a,u,h)}}var R=u.stateNode;R!==null&&typeof R.componentDidCatch=="function"&&(s.callback=function(){bE(a,u,h),typeof x!="function"&&(_i===null?_i=new Set([this]):_i.add(this));var B=h.stack;this.componentDidCatch(h.value,{componentStack:B!==null?B:""})})}function j6(s,a,u,h,x){if(u.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(a=u.alternate,a!==null&&Io(a,u,x,!0),u=Nr.current,u!==null){switch(u.tag){case 31:case 13:return Xr===null?If():u.alternate===null&&gn===0&&(gn=3),u.flags&=-257,u.flags|=65536,u.lanes=x,h===of?u.flags|=16384:(a=u.updateQueue,a===null?u.updateQueue=new Set([h]):a.add(h),Zm(s,h,x)),!1;case 22:return u.flags|=65536,h===of?u.flags|=16384:(a=u.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([h])},u.updateQueue=a):(u=a.retryQueue,u===null?a.retryQueue=new Set([h]):u.add(h)),Zm(s,h,x)),!1}throw Error(r(435,u.tag))}return Zm(s,h,x),If(),!1}if(It)return a=Nr.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=x,h!==Yp&&(s=Error(r(422),{cause:h}),Vl($r(s,u)))):(h!==Yp&&(a=Error(r(423),{cause:h}),Vl($r(a,u))),s=s.current.alternate,s.flags|=65536,x&=-x,s.lanes|=x,h=$r(h,u),x=Am(s.stateNode,h,x),rm(s,x),gn!==4&&(gn=2)),!1;var T=Error(r(520),{cause:h});if(T=$r(T,u),lu===null?lu=[T]:lu.push(T),gn!==4&&(gn=2),a===null)return!0;h=$r(h,u),u=a;do{switch(u.tag){case 3:return u.flags|=65536,s=x&-x,u.lanes|=s,s=Am(u.stateNode,h,s),rm(u,s),!1;case 1:if(a=u.type,T=u.stateNode,(u.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||T!==null&&typeof T.componentDidCatch=="function"&&(_i===null||!_i.has(T))))return u.flags|=65536,x&=-x,u.lanes|=x,x=xE(x),yE(x,s,u,h),rm(u,x),!1}u=u.return}while(u!==null);return!1}var _m=Error(r(461)),kn=!1;function Yn(s,a,u,h){a.child=s===null?Sy(a,null,u,h):ka(a,s.child,u,h)}function EE(s,a,u,h,x){u=u.render;var T=a.ref;if("ref"in h){var R={};for(var B in h)B!=="ref"&&(R[B]=h[B])}else R=h;return va(a),h=um(s,a,u,R,T,x),B=cm(),s!==null&&!kn?(fm(s,a,x),$s(s,a,x)):(It&&B&&$p(a),a.flags|=1,Yn(s,a,h,x),a.child)}function TE(s,a,u,h,x){if(s===null){var T=u.type;return typeof T=="function"&&!zp(T)&&T.defaultProps===void 0&&u.compare===null?(a.tag=15,a.type=T,vE(s,a,T,h,x)):(s=ef(u.type,null,h,a,a.mode,x),s.ref=a.ref,s.return=a,a.child=s)}if(T=s.child,!Pm(s,x)){var R=T.memoizedProps;if(u=u.compare,u=u!==null?u:Ul,u(R,h)&&s.ref===a.ref)return $s(s,a,x)}return a.flags|=1,s=Bs(T,h),s.ref=a.ref,s.return=a,a.child=s}function vE(s,a,u,h,x){if(s!==null){var T=s.memoizedProps;if(Ul(T,h)&&s.ref===a.ref)if(kn=!1,a.pendingProps=h=T,Pm(s,x))(s.flags&131072)!==0&&(kn=!0);else return a.lanes=s.lanes,$s(s,a,x)}return Nm(s,a,u,h,x)}function SE(s,a,u,h){var x=h.children,T=s!==null?s.memoizedState:null;if(s===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),h.mode==="hidden"){if((a.flags&128)!==0){if(T=T!==null?T.baseLanes|u:u,s!==null){for(h=a.child=s.child,x=0;h!==null;)x=x|h.lanes|h.childLanes,h=h.sibling;h=x&~T}else h=0,a.child=null;return CE(s,a,T,u,h)}if((u&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},s!==null&&sf(a,T!==null?T.cachePool:null),T!==null?ky(a,T):im(),Ay(a);else return h=a.lanes=536870912,CE(s,a,T!==null?T.baseLanes|u:u,u,h)}else T!==null?(sf(a,T.cachePool),ky(a,T),Ci(),a.memoizedState=null):(s!==null&&sf(a,null),im(),Ci());return Yn(s,a,x,u),a.child}function tu(s,a){return s!==null&&s.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function CE(s,a,u,h,x){var T=Jp();return T=T===null?null:{parent:Cn._currentValue,pool:T},a.memoizedState={baseLanes:u,cachePool:T},s!==null&&sf(a,null),im(),Ay(a),s!==null&&Io(s,a,h,!0),a.childLanes=x,null}function Tf(s,a){return a=Sf({mode:a.mode,children:a.children},s.mode),a.ref=s.ref,s.child=a,a.return=s,a}function wE(s,a,u){return ka(a,s.child,null,u),s=Tf(a,a.pendingProps),s.flags|=2,Rr(a),a.memoizedState=null,s}function B6(s,a,u){var h=a.pendingProps,x=(a.flags&128)!==0;if(a.flags&=-129,s===null){if(It){if(h.mode==="hidden")return s=Tf(a,h),a.lanes=536870912,tu(null,s);if(om(a),(s=on)?(s=jT(s,Gr),s=s!==null&&s.data==="&"?s:null,s!==null&&(a.memoizedState={dehydrated:s,treeContext:gi!==null?{id:ps,overflow:ms}:null,retryLane:536870912,hydrationErrors:null},u=ly(s),u.return=a,a.child=u,$n=a,on=null)):s=null,s===null)throw xi(a);return a.lanes=536870912,null}return Tf(a,h)}var T=s.memoizedState;if(T!==null){var R=T.dehydrated;if(om(a),x)if(a.flags&256)a.flags&=-257,a=wE(s,a,u);else if(a.memoizedState!==null)a.child=s.child,a.flags|=128,a=null;else throw Error(r(558));else if(kn||Io(s,a,u,!1),x=(u&s.childLanes)!==0,kn||x){if(h=tn,h!==null&&(R=En(h,u),R!==0&&R!==T.retryLane))throw T.retryLane=R,xa(s,R),yr(h,s,R),_m;If(),a=wE(s,a,u)}else s=T.treeContext,on=Kr(R.nextSibling),$n=a,It=!0,bi=null,Gr=!1,s!==null&&fy(a,s),a=Tf(a,h),a.flags|=4096;return a}return s=Bs(s.child,{mode:h.mode,children:h.children}),s.ref=a.ref,a.child=s,s.return=a,s}function vf(s,a){var u=a.ref;if(u===null)s!==null&&s.ref!==null&&(a.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(r(284));(s===null||s.ref!==u)&&(a.flags|=4194816)}}function Nm(s,a,u,h,x){return va(a),u=um(s,a,u,h,void 0,x),h=cm(),s!==null&&!kn?(fm(s,a,x),$s(s,a,x)):(It&&h&&$p(a),a.flags|=1,Yn(s,a,u,x),a.child)}function kE(s,a,u,h,x,T){return va(a),a.updateQueue=null,u=Ny(a,h,u,x),_y(s),h=cm(),s!==null&&!kn?(fm(s,a,T),$s(s,a,T)):(It&&h&&$p(a),a.flags|=1,Yn(s,a,u,T),a.child)}function AE(s,a,u,h,x){if(va(a),a.stateNode===null){var T=_o,R=u.contextType;typeof R=="object"&&R!==null&&(T=qn(R)),T=new u(h,T),a.memoizedState=T.state!==null&&T.state!==void 0?T.state:null,T.updater=km,a.stateNode=T,T._reactInternals=a,T=a.stateNode,T.props=h,T.state=a.memoizedState,T.refs={},tm(a),R=u.contextType,T.context=typeof R=="object"&&R!==null?qn(R):_o,T.state=a.memoizedState,R=u.getDerivedStateFromProps,typeof R=="function"&&(wm(a,u,R,h),T.state=a.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof T.getSnapshotBeforeUpdate=="function"||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(R=T.state,typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount(),R!==T.state&&km.enqueueReplaceState(T,T.state,null),Ql(a,h,T,x),Kl(),T.state=a.memoizedState),typeof T.componentDidMount=="function"&&(a.flags|=4194308),h=!0}else if(s===null){T=a.stateNode;var B=a.memoizedProps,ne=_a(u,B);T.props=ne;var be=T.context,Se=u.contextType;R=_o,typeof Se=="object"&&Se!==null&&(R=qn(Se));var _e=u.getDerivedStateFromProps;Se=typeof _e=="function"||typeof T.getSnapshotBeforeUpdate=="function",B=a.pendingProps!==B,Se||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(B||be!==R)&&hE(a,T,h,R),Ei=!1;var xe=a.memoizedState;T.state=xe,Ql(a,h,T,x),Kl(),be=a.memoizedState,B||xe!==be||Ei?(typeof _e=="function"&&(wm(a,u,_e,h),be=a.memoizedState),(ne=Ei||dE(a,u,ne,h,xe,be,R))?(Se||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount()),typeof T.componentDidMount=="function"&&(a.flags|=4194308)):(typeof T.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=h,a.memoizedState=be),T.props=h,T.state=be,T.context=R,h=ne):(typeof T.componentDidMount=="function"&&(a.flags|=4194308),h=!1)}else{T=a.stateNode,nm(s,a),R=a.memoizedProps,Se=_a(u,R),T.props=Se,_e=a.pendingProps,xe=T.context,be=u.contextType,ne=_o,typeof be=="object"&&be!==null&&(ne=qn(be)),B=u.getDerivedStateFromProps,(be=typeof B=="function"||typeof T.getSnapshotBeforeUpdate=="function")||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(R!==_e||xe!==ne)&&hE(a,T,h,ne),Ei=!1,xe=a.memoizedState,T.state=xe,Ql(a,h,T,x),Kl();var ye=a.memoizedState;R!==_e||xe!==ye||Ei||s!==null&&s.dependencies!==null&&nf(s.dependencies)?(typeof B=="function"&&(wm(a,u,B,h),ye=a.memoizedState),(Se=Ei||dE(a,u,Se,h,xe,ye,ne)||s!==null&&s.dependencies!==null&&nf(s.dependencies))?(be||typeof T.UNSAFE_componentWillUpdate!="function"&&typeof T.componentWillUpdate!="function"||(typeof T.componentWillUpdate=="function"&&T.componentWillUpdate(h,ye,ne),typeof T.UNSAFE_componentWillUpdate=="function"&&T.UNSAFE_componentWillUpdate(h,ye,ne)),typeof T.componentDidUpdate=="function"&&(a.flags|=4),typeof T.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof T.componentDidUpdate!="function"||R===s.memoizedProps&&xe===s.memoizedState||(a.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||R===s.memoizedProps&&xe===s.memoizedState||(a.flags|=1024),a.memoizedProps=h,a.memoizedState=ye),T.props=h,T.state=ye,T.context=ne,h=Se):(typeof T.componentDidUpdate!="function"||R===s.memoizedProps&&xe===s.memoizedState||(a.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||R===s.memoizedProps&&xe===s.memoizedState||(a.flags|=1024),h=!1)}return T=h,vf(s,a),h=(a.flags&128)!==0,T||h?(T=a.stateNode,u=h&&typeof u.getDerivedStateFromError!="function"?null:T.render(),a.flags|=1,s!==null&&h?(a.child=ka(a,s.child,null,x),a.child=ka(a,null,u,x)):Yn(s,a,u,x),a.memoizedState=T.state,s=a.child):s=$s(s,a,x),s}function _E(s,a,u,h){return Ea(),a.flags|=256,Yn(s,a,u,h),a.child}var Rm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Om(s){return{baseLanes:s,cachePool:by()}}function Im(s,a,u){return s=s!==null?s.childLanes&~u:0,a&&(s|=Ir),s}function NE(s,a,u){var h=a.pendingProps,x=!1,T=(a.flags&128)!==0,R;if((R=T)||(R=s!==null&&s.memoizedState===null?!1:(Tn.current&2)!==0),R&&(x=!0,a.flags&=-129),R=(a.flags&32)!==0,a.flags&=-33,s===null){if(It){if(x?Si(a):Ci(),(s=on)?(s=jT(s,Gr),s=s!==null&&s.data!=="&"?s:null,s!==null&&(a.memoizedState={dehydrated:s,treeContext:gi!==null?{id:ps,overflow:ms}:null,retryLane:536870912,hydrationErrors:null},u=ly(s),u.return=a,a.child=u,$n=a,on=null)):s=null,s===null)throw xi(a);return p0(s)?a.lanes=32:a.lanes=536870912,null}var B=h.children;return h=h.fallback,x?(Ci(),x=a.mode,B=Sf({mode:"hidden",children:B},x),h=ya(h,x,u,null),B.return=a,h.return=a,B.sibling=h,a.child=B,h=a.child,h.memoizedState=Om(u),h.childLanes=Im(s,R,u),a.memoizedState=Rm,tu(null,h)):(Si(a),Lm(a,B))}var ne=s.memoizedState;if(ne!==null&&(B=ne.dehydrated,B!==null)){if(T)a.flags&256?(Si(a),a.flags&=-257,a=Mm(s,a,u)):a.memoizedState!==null?(Ci(),a.child=s.child,a.flags|=128,a=null):(Ci(),B=h.fallback,x=a.mode,h=Sf({mode:"visible",children:h.children},x),B=ya(B,x,u,null),B.flags|=2,h.return=a,B.return=a,h.sibling=B,a.child=h,ka(a,s.child,null,u),h=a.child,h.memoizedState=Om(u),h.childLanes=Im(s,R,u),a.memoizedState=Rm,a=tu(null,h));else if(Si(a),p0(B)){if(R=B.nextSibling&&B.nextSibling.dataset,R)var be=R.dgst;R=be,h=Error(r(419)),h.stack="",h.digest=R,Vl({value:h,source:null,stack:null}),a=Mm(s,a,u)}else if(kn||Io(s,a,u,!1),R=(u&s.childLanes)!==0,kn||R){if(R=tn,R!==null&&(h=En(R,u),h!==0&&h!==ne.retryLane))throw ne.retryLane=h,xa(s,h),yr(R,s,h),_m;h0(B)||If(),a=Mm(s,a,u)}else h0(B)?(a.flags|=192,a.child=s.child,a=null):(s=ne.treeContext,on=Kr(B.nextSibling),$n=a,It=!0,bi=null,Gr=!1,s!==null&&fy(a,s),a=Lm(a,h.children),a.flags|=4096);return a}return x?(Ci(),B=h.fallback,x=a.mode,ne=s.child,be=ne.sibling,h=Bs(ne,{mode:"hidden",children:h.children}),h.subtreeFlags=ne.subtreeFlags&65011712,be!==null?B=Bs(be,B):(B=ya(B,x,u,null),B.flags|=2),B.return=a,h.return=a,h.sibling=B,a.child=h,tu(null,h),h=a.child,B=s.child.memoizedState,B===null?B=Om(u):(x=B.cachePool,x!==null?(ne=Cn._currentValue,x=x.parent!==ne?{parent:ne,pool:ne}:x):x=by(),B={baseLanes:B.baseLanes|u,cachePool:x}),h.memoizedState=B,h.childLanes=Im(s,R,u),a.memoizedState=Rm,tu(s.child,h)):(Si(a),u=s.child,s=u.sibling,u=Bs(u,{mode:"visible",children:h.children}),u.return=a,u.sibling=null,s!==null&&(R=a.deletions,R===null?(a.deletions=[s],a.flags|=16):R.push(s)),a.child=u,a.memoizedState=null,u)}function Lm(s,a){return a=Sf({mode:"visible",children:a},s.mode),a.return=s,s.child=a}function Sf(s,a){return s=_r(22,s,null,a),s.lanes=0,s}function Mm(s,a,u){return ka(a,s.child,null,u),s=Lm(a,a.pendingProps.children),s.flags|=2,a.memoizedState=null,s}function RE(s,a,u){s.lanes|=a;var h=s.alternate;h!==null&&(h.lanes|=a),Kp(s.return,a,u)}function Dm(s,a,u,h,x,T){var R=s.memoizedState;R===null?s.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:h,tail:u,tailMode:x,treeForkCount:T}:(R.isBackwards=a,R.rendering=null,R.renderingStartTime=0,R.last=h,R.tail=u,R.tailMode=x,R.treeForkCount=T)}function OE(s,a,u){var h=a.pendingProps,x=h.revealOrder,T=h.tail;h=h.children;var R=Tn.current,B=(R&2)!==0;if(B?(R=R&1|2,a.flags|=128):R&=1,L(Tn,R),Yn(s,a,h,u),h=It?Fl:0,!B&&s!==null&&(s.flags&128)!==0)e:for(s=a.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&RE(s,u,a);else if(s.tag===19)RE(s,u,a);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===a)break e;for(;s.sibling===null;){if(s.return===null||s.return===a)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(x){case"forwards":for(u=a.child,x=null;u!==null;)s=u.alternate,s!==null&&ff(s)===null&&(x=u),u=u.sibling;u=x,u===null?(x=a.child,a.child=null):(x=u.sibling,u.sibling=null),Dm(a,!1,x,u,T,h);break;case"backwards":case"unstable_legacy-backwards":for(u=null,x=a.child,a.child=null;x!==null;){if(s=x.alternate,s!==null&&ff(s)===null){a.child=x;break}s=x.sibling,x.sibling=u,u=x,x=s}Dm(a,!0,u,null,T,h);break;case"together":Dm(a,!1,null,null,void 0,h);break;default:a.memoizedState=null}return a.child}function $s(s,a,u){if(s!==null&&(a.dependencies=s.dependencies),Ai|=a.lanes,(u&a.childLanes)===0)if(s!==null){if(Io(s,a,u,!1),(u&a.childLanes)===0)return null}else return null;if(s!==null&&a.child!==s.child)throw Error(r(153));if(a.child!==null){for(s=a.child,u=Bs(s,s.pendingProps),a.child=u,u.return=a;s.sibling!==null;)s=s.sibling,u=u.sibling=Bs(s,s.pendingProps),u.return=a;u.sibling=null}return a.child}function Pm(s,a){return(s.lanes&a)!==0?!0:(s=s.dependencies,!!(s!==null&&nf(s)))}function H6(s,a,u){switch(a.tag){case 3:he(a,a.stateNode.containerInfo),yi(a,Cn,s.memoizedState.cache),Ea();break;case 27:case 5:Ue(a);break;case 4:he(a,a.stateNode.containerInfo);break;case 10:yi(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,om(a),null;break;case 13:var h=a.memoizedState;if(h!==null)return h.dehydrated!==null?(Si(a),a.flags|=128,null):(u&a.child.childLanes)!==0?NE(s,a,u):(Si(a),s=$s(s,a,u),s!==null?s.sibling:null);Si(a);break;case 19:var x=(s.flags&128)!==0;if(h=(u&a.childLanes)!==0,h||(Io(s,a,u,!1),h=(u&a.childLanes)!==0),x){if(h)return OE(s,a,u);a.flags|=128}if(x=a.memoizedState,x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),L(Tn,Tn.current),h)break;return null;case 22:return a.lanes=0,SE(s,a,u,a.pendingProps);case 24:yi(a,Cn,s.memoizedState.cache)}return $s(s,a,u)}function IE(s,a,u){if(s!==null)if(s.memoizedProps!==a.pendingProps)kn=!0;else{if(!Pm(s,u)&&(a.flags&128)===0)return kn=!1,H6(s,a,u);kn=(s.flags&131072)!==0}else kn=!1,It&&(a.flags&1048576)!==0&&cy(a,Fl,a.index);switch(a.lanes=0,a.tag){case 16:e:{var h=a.pendingProps;if(s=Ca(a.elementType),a.type=s,typeof s=="function")zp(s)?(h=_a(s,h),a.tag=1,a=AE(null,a,s,h,u)):(a.tag=0,a=Nm(null,a,s,h,u));else{if(s!=null){var x=s.$$typeof;if(x===N){a.tag=11,a=EE(null,a,s,h,u);break e}else if(x===j){a.tag=14,a=TE(null,a,s,h,u);break e}}throw a=ee(s)||s,Error(r(306,a,""))}}return a;case 0:return Nm(s,a,a.type,a.pendingProps,u);case 1:return h=a.type,x=_a(h,a.pendingProps),AE(s,a,h,x,u);case 3:e:{if(he(a,a.stateNode.containerInfo),s===null)throw Error(r(387));h=a.pendingProps;var T=a.memoizedState;x=T.element,nm(s,a),Ql(a,h,null,u);var R=a.memoizedState;if(h=R.cache,yi(a,Cn,h),h!==T.cache&&Qp(a,[Cn],u,!0),Kl(),h=R.element,T.isDehydrated)if(T={element:h,isDehydrated:!1,cache:R.cache},a.updateQueue.baseState=T,a.memoizedState=T,a.flags&256){a=_E(s,a,h,u);break e}else if(h!==x){x=$r(Error(r(424)),a),Vl(x),a=_E(s,a,h,u);break e}else{switch(s=a.stateNode.containerInfo,s.nodeType){case 9:s=s.body;break;default:s=s.nodeName==="HTML"?s.ownerDocument.body:s}for(on=Kr(s.firstChild),$n=a,It=!0,bi=null,Gr=!0,u=Sy(a,null,h,u),a.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(Ea(),h===x){a=$s(s,a,u);break e}Yn(s,a,h,u)}a=a.child}return a;case 26:return vf(s,a),s===null?(u=VT(a.type,null,a.pendingProps,null))?a.memoizedState=u:It||(u=a.type,s=a.pendingProps,h=Hf(fe.current).createElement(u),h[en]=a,h[Vn]=s,Gn(h,u,s),Pn(h),a.stateNode=h):a.memoizedState=VT(a.type,s.memoizedProps,a.pendingProps,s.memoizedState),null;case 27:return Ue(a),s===null&&It&&(h=a.stateNode=UT(a.type,a.pendingProps,fe.current),$n=a,Gr=!0,x=on,Ii(a.type)?(m0=x,on=Kr(h.firstChild)):on=x),Yn(s,a,a.pendingProps.children,u),vf(s,a),s===null&&(a.flags|=4194304),a.child;case 5:return s===null&&It&&((x=h=on)&&(h=mO(h,a.type,a.pendingProps,Gr),h!==null?(a.stateNode=h,$n=a,on=Kr(h.firstChild),Gr=!1,x=!0):x=!1),x||xi(a)),Ue(a),x=a.type,T=a.pendingProps,R=s!==null?s.memoizedProps:null,h=T.children,c0(x,T)?h=null:R!==null&&c0(x,R)&&(a.flags|=32),a.memoizedState!==null&&(x=um(s,a,R6,null,null,u),gu._currentValue=x),vf(s,a),Yn(s,a,h,u),a.child;case 6:return s===null&&It&&((s=u=on)&&(u=gO(u,a.pendingProps,Gr),u!==null?(a.stateNode=u,$n=a,on=null,s=!0):s=!1),s||xi(a)),null;case 13:return NE(s,a,u);case 4:return he(a,a.stateNode.containerInfo),h=a.pendingProps,s===null?a.child=ka(a,null,h,u):Yn(s,a,h,u),a.child;case 11:return EE(s,a,a.type,a.pendingProps,u);case 7:return Yn(s,a,a.pendingProps,u),a.child;case 8:return Yn(s,a,a.pendingProps.children,u),a.child;case 12:return Yn(s,a,a.pendingProps.children,u),a.child;case 10:return h=a.pendingProps,yi(a,a.type,h.value),Yn(s,a,h.children,u),a.child;case 9:return x=a.type._context,h=a.pendingProps.children,va(a),x=qn(x),h=h(x),a.flags|=1,Yn(s,a,h,u),a.child;case 14:return TE(s,a,a.type,a.pendingProps,u);case 15:return vE(s,a,a.type,a.pendingProps,u);case 19:return OE(s,a,u);case 31:return B6(s,a,u);case 22:return SE(s,a,u,a.pendingProps);case 24:return va(a),h=qn(Cn),s===null?(x=Jp(),x===null&&(x=tn,T=Wp(),x.pooledCache=T,T.refCount++,T!==null&&(x.pooledCacheLanes|=u),x=T),a.memoizedState={parent:h,cache:x},tm(a),yi(a,Cn,x)):((s.lanes&u)!==0&&(nm(s,a),Ql(a,null,null,u),Kl()),x=s.memoizedState,T=a.memoizedState,x.parent!==h?(x={parent:h,cache:h},a.memoizedState=x,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=x),yi(a,Cn,h)):(h=T.cache,yi(a,Cn,h),h!==x.cache&&Qp(a,[Cn],u,!0))),Yn(s,a,a.pendingProps.children,u),a.child;case 29:throw a.pendingProps}throw Error(r(156,a.tag))}function qs(s){s.flags|=4}function jm(s,a,u,h,x){if((a=(s.mode&32)!==0)&&(a=!1),a){if(s.flags|=16777216,(x&335544128)===x)if(s.stateNode.complete)s.flags|=8192;else if(iT())s.flags|=8192;else throw wa=of,em}else s.flags&=-16777217}function LE(s,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!XT(a))if(iT())s.flags|=8192;else throw wa=of,em}function Cf(s,a){a!==null&&(s.flags|=4),s.flags&16384&&(a=s.tag!==22?Jt():536870912,s.lanes|=a,$o|=a)}function nu(s,a){if(!It)switch(s.tailMode){case"hidden":a=s.tail;for(var u=null;a!==null;)a.alternate!==null&&(u=a),a=a.sibling;u===null?s.tail=null:u.sibling=null;break;case"collapsed":u=s.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?a||s.tail===null?s.tail=null:s.tail.sibling=null:h.sibling=null}}function ln(s){var a=s.alternate!==null&&s.alternate.child===s.child,u=0,h=0;if(a)for(var x=s.child;x!==null;)u|=x.lanes|x.childLanes,h|=x.subtreeFlags&65011712,h|=x.flags&65011712,x.return=s,x=x.sibling;else for(x=s.child;x!==null;)u|=x.lanes|x.childLanes,h|=x.subtreeFlags,h|=x.flags,x.return=s,x=x.sibling;return s.subtreeFlags|=h,s.childLanes=u,a}function U6(s,a,u){var h=a.pendingProps;switch(qp(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ln(a),null;case 1:return ln(a),null;case 3:return u=a.stateNode,h=null,s!==null&&(h=s.memoizedState.cache),a.memoizedState.cache!==h&&(a.flags|=2048),zs(Cn),ve(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(s===null||s.child===null)&&(Oo(a)?qs(a):s===null||s.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,Gp())),ln(a),null;case 26:var x=a.type,T=a.memoizedState;return s===null?(qs(a),T!==null?(ln(a),LE(a,T)):(ln(a),jm(a,x,null,h,u))):T?T!==s.memoizedState?(qs(a),ln(a),LE(a,T)):(ln(a),a.flags&=-16777217):(s=s.memoizedProps,s!==h&&qs(a),ln(a),jm(a,x,s,h,u)),null;case 27:if(Pe(a),u=fe.current,x=a.type,s!==null&&a.stateNode!=null)s.memoizedProps!==h&&qs(a);else{if(!h){if(a.stateNode===null)throw Error(r(166));return ln(a),null}s=ae.current,Oo(a)?dy(a):(s=UT(x,h,u),a.stateNode=s,qs(a))}return ln(a),null;case 5:if(Pe(a),x=a.type,s!==null&&a.stateNode!=null)s.memoizedProps!==h&&qs(a);else{if(!h){if(a.stateNode===null)throw Error(r(166));return ln(a),null}if(T=ae.current,Oo(a))dy(a);else{var R=Hf(fe.current);switch(T){case 1:T=R.createElementNS("http://www.w3.org/2000/svg",x);break;case 2:T=R.createElementNS("http://www.w3.org/1998/Math/MathML",x);break;default:switch(x){case"svg":T=R.createElementNS("http://www.w3.org/2000/svg",x);break;case"math":T=R.createElementNS("http://www.w3.org/1998/Math/MathML",x);break;case"script":T=R.createElement("div"),T.innerHTML="<script><\/script>",T=T.removeChild(T.firstChild);break;case"select":T=typeof h.is=="string"?R.createElement("select",{is:h.is}):R.createElement("select"),h.multiple?T.multiple=!0:h.size&&(T.size=h.size);break;default:T=typeof h.is=="string"?R.createElement(x,{is:h.is}):R.createElement(x)}}T[en]=a,T[Vn]=h;e:for(R=a.child;R!==null;){if(R.tag===5||R.tag===6)T.appendChild(R.stateNode);else if(R.tag!==4&&R.tag!==27&&R.child!==null){R.child.return=R,R=R.child;continue}if(R===a)break e;for(;R.sibling===null;){if(R.return===null||R.return===a)break e;R=R.return}R.sibling.return=R.return,R=R.sibling}a.stateNode=T;e:switch(Gn(T,x,h),x){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&qs(a)}}return ln(a),jm(a,a.type,s===null?null:s.memoizedProps,a.pendingProps,u),null;case 6:if(s&&a.stateNode!=null)s.memoizedProps!==h&&qs(a);else{if(typeof h!="string"&&a.stateNode===null)throw Error(r(166));if(s=fe.current,Oo(a)){if(s=a.stateNode,u=a.memoizedProps,h=null,x=$n,x!==null)switch(x.tag){case 27:case 5:h=x.memoizedProps}s[en]=a,s=!!(s.nodeValue===u||h!==null&&h.suppressHydrationWarning===!0||NT(s.nodeValue,u)),s||xi(a,!0)}else s=Hf(s).createTextNode(h),s[en]=a,a.stateNode=s}return ln(a),null;case 31:if(u=a.memoizedState,s===null||s.memoizedState!==null){if(h=Oo(a),u!==null){if(s===null){if(!h)throw Error(r(318));if(s=a.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[en]=a}else Ea(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;ln(a),s=!1}else u=Gp(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=u),s=!0;if(!s)return a.flags&256?(Rr(a),a):(Rr(a),null);if((a.flags&128)!==0)throw Error(r(558))}return ln(a),null;case 13:if(h=a.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(x=Oo(a),h!==null&&h.dehydrated!==null){if(s===null){if(!x)throw Error(r(318));if(x=a.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(r(317));x[en]=a}else Ea(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;ln(a),x=!1}else x=Gp(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=x),x=!0;if(!x)return a.flags&256?(Rr(a),a):(Rr(a),null)}return Rr(a),(a.flags&128)!==0?(a.lanes=u,a):(u=h!==null,s=s!==null&&s.memoizedState!==null,u&&(h=a.child,x=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(x=h.alternate.memoizedState.cachePool.pool),T=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(T=h.memoizedState.cachePool.pool),T!==x&&(h.flags|=2048)),u!==s&&u&&(a.child.flags|=8192),Cf(a,a.updateQueue),ln(a),null);case 4:return ve(),s===null&&i0(a.stateNode.containerInfo),ln(a),null;case 10:return zs(a.type),ln(a),null;case 19:if($(Tn),h=a.memoizedState,h===null)return ln(a),null;if(x=(a.flags&128)!==0,T=h.rendering,T===null)if(x)nu(h,!1);else{if(gn!==0||s!==null&&(s.flags&128)!==0)for(s=a.child;s!==null;){if(T=ff(s),T!==null){for(a.flags|=128,nu(h,!1),s=T.updateQueue,a.updateQueue=s,Cf(a,s),a.subtreeFlags=0,s=u,u=a.child;u!==null;)oy(u,s),u=u.sibling;return L(Tn,Tn.current&1|2),It&&Hs(a,h.treeForkCount),a.child}s=s.sibling}h.tail!==null&&se()>Nf&&(a.flags|=128,x=!0,nu(h,!1),a.lanes=4194304)}else{if(!x)if(s=ff(T),s!==null){if(a.flags|=128,x=!0,s=s.updateQueue,a.updateQueue=s,Cf(a,s),nu(h,!0),h.tail===null&&h.tailMode==="hidden"&&!T.alternate&&!It)return ln(a),null}else 2*se()-h.renderingStartTime>Nf&&u!==536870912&&(a.flags|=128,x=!0,nu(h,!1),a.lanes=4194304);h.isBackwards?(T.sibling=a.child,a.child=T):(s=h.last,s!==null?s.sibling=T:a.child=T,h.last=T)}return h.tail!==null?(s=h.tail,h.rendering=s,h.tail=s.sibling,h.renderingStartTime=se(),s.sibling=null,u=Tn.current,L(Tn,x?u&1|2:u&1),It&&Hs(a,h.treeForkCount),s):(ln(a),null);case 22:case 23:return Rr(a),am(),h=a.memoizedState!==null,s!==null?s.memoizedState!==null!==h&&(a.flags|=8192):h&&(a.flags|=8192),h?(u&536870912)!==0&&(a.flags&128)===0&&(ln(a),a.subtreeFlags&6&&(a.flags|=8192)):ln(a),u=a.updateQueue,u!==null&&Cf(a,u.retryQueue),u=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(u=s.memoizedState.cachePool.pool),h=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(h=a.memoizedState.cachePool.pool),h!==u&&(a.flags|=2048),s!==null&&$(Sa),null;case 24:return u=null,s!==null&&(u=s.memoizedState.cache),a.memoizedState.cache!==u&&(a.flags|=2048),zs(Cn),ln(a),null;case 25:return null;case 30:return null}throw Error(r(156,a.tag))}function z6(s,a){switch(qp(a),a.tag){case 1:return s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 3:return zs(Cn),ve(),s=a.flags,(s&65536)!==0&&(s&128)===0?(a.flags=s&-65537|128,a):null;case 26:case 27:case 5:return Pe(a),null;case 31:if(a.memoizedState!==null){if(Rr(a),a.alternate===null)throw Error(r(340));Ea()}return s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 13:if(Rr(a),s=a.memoizedState,s!==null&&s.dehydrated!==null){if(a.alternate===null)throw Error(r(340));Ea()}return s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 19:return $(Tn),null;case 4:return ve(),null;case 10:return zs(a.type),null;case 22:case 23:return Rr(a),am(),s!==null&&$(Sa),s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 24:return zs(Cn),null;case 25:return null;default:return null}}function ME(s,a){switch(qp(a),a.tag){case 3:zs(Cn),ve();break;case 26:case 27:case 5:Pe(a);break;case 4:ve();break;case 31:a.memoizedState!==null&&Rr(a);break;case 13:Rr(a);break;case 19:$(Tn);break;case 10:zs(a.type);break;case 22:case 23:Rr(a),am(),s!==null&&$(Sa);break;case 24:zs(Cn)}}function ru(s,a){try{var u=a.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var x=h.next;u=x;do{if((u.tag&s)===s){h=void 0;var T=u.create,R=u.inst;h=T(),R.destroy=h}u=u.next}while(u!==x)}}catch(B){Vt(a,a.return,B)}}function wi(s,a,u){try{var h=a.updateQueue,x=h!==null?h.lastEffect:null;if(x!==null){var T=x.next;h=T;do{if((h.tag&s)===s){var R=h.inst,B=R.destroy;if(B!==void 0){R.destroy=void 0,x=a;var ne=u,be=B;try{be()}catch(Se){Vt(x,ne,Se)}}}h=h.next}while(h!==T)}}catch(Se){Vt(a,a.return,Se)}}function DE(s){var a=s.updateQueue;if(a!==null){var u=s.stateNode;try{wy(a,u)}catch(h){Vt(s,s.return,h)}}}function PE(s,a,u){u.props=_a(s.type,s.memoizedProps),u.state=s.memoizedState;try{u.componentWillUnmount()}catch(h){Vt(s,a,h)}}function su(s,a){try{var u=s.ref;if(u!==null){switch(s.tag){case 26:case 27:case 5:var h=s.stateNode;break;case 30:h=s.stateNode;break;default:h=s.stateNode}typeof u=="function"?s.refCleanup=u(h):u.current=h}}catch(x){Vt(s,a,x)}}function gs(s,a){var u=s.ref,h=s.refCleanup;if(u!==null)if(typeof h=="function")try{h()}catch(x){Vt(s,a,x)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(x){Vt(s,a,x)}else u.current=null}function jE(s){var a=s.type,u=s.memoizedProps,h=s.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":u.autoFocus&&h.focus();break e;case"img":u.src?h.src=u.src:u.srcSet&&(h.srcset=u.srcSet)}}catch(x){Vt(s,s.return,x)}}function Bm(s,a,u){try{var h=s.stateNode;uO(h,s.type,u,a),h[Vn]=a}catch(x){Vt(s,s.return,x)}}function BE(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&Ii(s.type)||s.tag===4}function Hm(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||BE(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&Ii(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function Um(s,a,u){var h=s.tag;if(h===5||h===6)s=s.stateNode,a?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(s,a):(a=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,a.appendChild(s),u=u._reactRootContainer,u!=null||a.onclick!==null||(a.onclick=Ps));else if(h!==4&&(h===27&&Ii(s.type)&&(u=s.stateNode,a=null),s=s.child,s!==null))for(Um(s,a,u),s=s.sibling;s!==null;)Um(s,a,u),s=s.sibling}function wf(s,a,u){var h=s.tag;if(h===5||h===6)s=s.stateNode,a?u.insertBefore(s,a):u.appendChild(s);else if(h!==4&&(h===27&&Ii(s.type)&&(u=s.stateNode),s=s.child,s!==null))for(wf(s,a,u),s=s.sibling;s!==null;)wf(s,a,u),s=s.sibling}function HE(s){var a=s.stateNode,u=s.memoizedProps;try{for(var h=s.type,x=a.attributes;x.length;)a.removeAttributeNode(x[0]);Gn(a,h,u),a[en]=s,a[Vn]=u}catch(T){Vt(s,s.return,T)}}var Ys=!1,An=!1,zm=!1,UE=typeof WeakSet=="function"?WeakSet:Set,jn=null;function F6(s,a){if(s=s.containerInfo,l0=Yf,s=Zx(s),Mp(s)){if("selectionStart"in s)var u={start:s.selectionStart,end:s.selectionEnd};else e:{u=(u=s.ownerDocument)&&u.defaultView||window;var h=u.getSelection&&u.getSelection();if(h&&h.rangeCount!==0){u=h.anchorNode;var x=h.anchorOffset,T=h.focusNode;h=h.focusOffset;try{u.nodeType,T.nodeType}catch{u=null;break e}var R=0,B=-1,ne=-1,be=0,Se=0,_e=s,xe=null;t:for(;;){for(var ye;_e!==u||x!==0&&_e.nodeType!==3||(B=R+x),_e!==T||h!==0&&_e.nodeType!==3||(ne=R+h),_e.nodeType===3&&(R+=_e.nodeValue.length),(ye=_e.firstChild)!==null;)xe=_e,_e=ye;for(;;){if(_e===s)break t;if(xe===u&&++be===x&&(B=R),xe===T&&++Se===h&&(ne=R),(ye=_e.nextSibling)!==null)break;_e=xe,xe=_e.parentNode}_e=ye}u=B===-1||ne===-1?null:{start:B,end:ne}}else u=null}u=u||{start:0,end:0}}else u=null;for(u0={focusedElem:s,selectionRange:u},Yf=!1,jn=a;jn!==null;)if(a=jn,s=a.child,(a.subtreeFlags&1028)!==0&&s!==null)s.return=a,jn=s;else for(;jn!==null;){switch(a=jn,T=a.alternate,s=a.flags,a.tag){case 0:if((s&4)!==0&&(s=a.updateQueue,s=s!==null?s.events:null,s!==null))for(u=0;u<s.length;u++)x=s[u],x.ref.impl=x.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&T!==null){s=void 0,u=a,x=T.memoizedProps,T=T.memoizedState,h=u.stateNode;try{var Qe=_a(u.type,x);s=h.getSnapshotBeforeUpdate(Qe,T),h.__reactInternalSnapshotBeforeUpdate=s}catch(it){Vt(u,u.return,it)}}break;case 3:if((s&1024)!==0){if(s=a.stateNode.containerInfo,u=s.nodeType,u===9)d0(s);else if(u===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":d0(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(r(163))}if(s=a.sibling,s!==null){s.return=a.return,jn=s;break}jn=a.return}}function zE(s,a,u){var h=u.flags;switch(u.tag){case 0:case 11:case 15:Xs(s,u),h&4&&ru(5,u);break;case 1:if(Xs(s,u),h&4)if(s=u.stateNode,a===null)try{s.componentDidMount()}catch(R){Vt(u,u.return,R)}else{var x=_a(u.type,a.memoizedProps);a=a.memoizedState;try{s.componentDidUpdate(x,a,s.__reactInternalSnapshotBeforeUpdate)}catch(R){Vt(u,u.return,R)}}h&64&&DE(u),h&512&&su(u,u.return);break;case 3:if(Xs(s,u),h&64&&(s=u.updateQueue,s!==null)){if(a=null,u.child!==null)switch(u.child.tag){case 27:case 5:a=u.child.stateNode;break;case 1:a=u.child.stateNode}try{wy(s,a)}catch(R){Vt(u,u.return,R)}}break;case 27:a===null&&h&4&&HE(u);case 26:case 5:Xs(s,u),a===null&&h&4&&jE(u),h&512&&su(u,u.return);break;case 12:Xs(s,u);break;case 31:Xs(s,u),h&4&&$E(s,u);break;case 13:Xs(s,u),h&4&&qE(s,u),h&64&&(s=u.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(u=W6.bind(null,u),bO(s,u))));break;case 22:if(h=u.memoizedState!==null||Ys,!h){a=a!==null&&a.memoizedState!==null||An,x=Ys;var T=An;Ys=h,(An=a)&&!T?Ks(s,u,(u.subtreeFlags&8772)!==0):Xs(s,u),Ys=x,An=T}break;case 30:break;default:Xs(s,u)}}function FE(s){var a=s.alternate;a!==null&&(s.alternate=null,FE(a)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(a=s.stateNode,a!==null&&bp(a)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var un=null,mr=!1;function Gs(s,a,u){for(u=u.child;u!==null;)VE(s,a,u),u=u.sibling}function VE(s,a,u){if(ot&&typeof ot.onCommitFiberUnmount=="function")try{ot.onCommitFiberUnmount(et,u)}catch{}switch(u.tag){case 26:An||gs(u,a),Gs(s,a,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:An||gs(u,a);var h=un,x=mr;Ii(u.type)&&(un=u.stateNode,mr=!1),Gs(s,a,u),hu(u.stateNode),un=h,mr=x;break;case 5:An||gs(u,a);case 6:if(h=un,x=mr,un=null,Gs(s,a,u),un=h,mr=x,un!==null)if(mr)try{(un.nodeType===9?un.body:un.nodeName==="HTML"?un.ownerDocument.body:un).removeChild(u.stateNode)}catch(T){Vt(u,a,T)}else try{un.removeChild(u.stateNode)}catch(T){Vt(u,a,T)}break;case 18:un!==null&&(mr?(s=un,DT(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,u.stateNode),Zo(s)):DT(un,u.stateNode));break;case 4:h=un,x=mr,un=u.stateNode.containerInfo,mr=!0,Gs(s,a,u),un=h,mr=x;break;case 0:case 11:case 14:case 15:wi(2,u,a),An||wi(4,u,a),Gs(s,a,u);break;case 1:An||(gs(u,a),h=u.stateNode,typeof h.componentWillUnmount=="function"&&PE(u,a,h)),Gs(s,a,u);break;case 21:Gs(s,a,u);break;case 22:An=(h=An)||u.memoizedState!==null,Gs(s,a,u),An=h;break;default:Gs(s,a,u)}}function $E(s,a){if(a.memoizedState===null&&(s=a.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{Zo(s)}catch(u){Vt(a,a.return,u)}}}function qE(s,a){if(a.memoizedState===null&&(s=a.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{Zo(s)}catch(u){Vt(a,a.return,u)}}function V6(s){switch(s.tag){case 31:case 13:case 19:var a=s.stateNode;return a===null&&(a=s.stateNode=new UE),a;case 22:return s=s.stateNode,a=s._retryCache,a===null&&(a=s._retryCache=new UE),a;default:throw Error(r(435,s.tag))}}function kf(s,a){var u=V6(s);a.forEach(function(h){if(!u.has(h)){u.add(h);var x=Z6.bind(null,s,h);h.then(x,x)}})}function gr(s,a){var u=a.deletions;if(u!==null)for(var h=0;h<u.length;h++){var x=u[h],T=s,R=a,B=R;e:for(;B!==null;){switch(B.tag){case 27:if(Ii(B.type)){un=B.stateNode,mr=!1;break e}break;case 5:un=B.stateNode,mr=!1;break e;case 3:case 4:un=B.stateNode.containerInfo,mr=!0;break e}B=B.return}if(un===null)throw Error(r(160));VE(T,R,x),un=null,mr=!1,T=x.alternate,T!==null&&(T.return=null),x.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)YE(a,s),a=a.sibling}var ss=null;function YE(s,a){var u=s.alternate,h=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:gr(a,s),br(s),h&4&&(wi(3,s,s.return),ru(3,s),wi(5,s,s.return));break;case 1:gr(a,s),br(s),h&512&&(An||u===null||gs(u,u.return)),h&64&&Ys&&(s=s.updateQueue,s!==null&&(h=s.callbacks,h!==null&&(u=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=u===null?h:u.concat(h))));break;case 26:var x=ss;if(gr(a,s),br(s),h&512&&(An||u===null||gs(u,u.return)),h&4){var T=u!==null?u.memoizedState:null;if(h=s.memoizedState,u===null)if(h===null)if(s.stateNode===null){e:{h=s.type,u=s.memoizedProps,x=x.ownerDocument||x;t:switch(h){case"title":T=x.getElementsByTagName("title")[0],(!T||T[Ol]||T[en]||T.namespaceURI==="http://www.w3.org/2000/svg"||T.hasAttribute("itemprop"))&&(T=x.createElement(h),x.head.insertBefore(T,x.querySelector("head > title"))),Gn(T,h,u),T[en]=s,Pn(T),h=T;break e;case"link":var R=YT("link","href",x).get(h+(u.href||""));if(R){for(var B=0;B<R.length;B++)if(T=R[B],T.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&T.getAttribute("rel")===(u.rel==null?null:u.rel)&&T.getAttribute("title")===(u.title==null?null:u.title)&&T.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){R.splice(B,1);break t}}T=x.createElement(h),Gn(T,h,u),x.head.appendChild(T);break;case"meta":if(R=YT("meta","content",x).get(h+(u.content||""))){for(B=0;B<R.length;B++)if(T=R[B],T.getAttribute("content")===(u.content==null?null:""+u.content)&&T.getAttribute("name")===(u.name==null?null:u.name)&&T.getAttribute("property")===(u.property==null?null:u.property)&&T.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&T.getAttribute("charset")===(u.charSet==null?null:u.charSet)){R.splice(B,1);break t}}T=x.createElement(h),Gn(T,h,u),x.head.appendChild(T);break;default:throw Error(r(468,h))}T[en]=s,Pn(T),h=T}s.stateNode=h}else GT(x,s.type,s.stateNode);else s.stateNode=qT(x,h,s.memoizedProps);else T!==h?(T===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):T.count--,h===null?GT(x,s.type,s.stateNode):qT(x,h,s.memoizedProps)):h===null&&s.stateNode!==null&&Bm(s,s.memoizedProps,u.memoizedProps)}break;case 27:gr(a,s),br(s),h&512&&(An||u===null||gs(u,u.return)),u!==null&&h&4&&Bm(s,s.memoizedProps,u.memoizedProps);break;case 5:if(gr(a,s),br(s),h&512&&(An||u===null||gs(u,u.return)),s.flags&32){x=s.stateNode;try{To(x,"")}catch(Qe){Vt(s,s.return,Qe)}}h&4&&s.stateNode!=null&&(x=s.memoizedProps,Bm(s,x,u!==null?u.memoizedProps:x)),h&1024&&(zm=!0);break;case 6:if(gr(a,s),br(s),h&4){if(s.stateNode===null)throw Error(r(162));h=s.memoizedProps,u=s.stateNode;try{u.nodeValue=h}catch(Qe){Vt(s,s.return,Qe)}}break;case 3:if(Ff=null,x=ss,ss=Uf(a.containerInfo),gr(a,s),ss=x,br(s),h&4&&u!==null&&u.memoizedState.isDehydrated)try{Zo(a.containerInfo)}catch(Qe){Vt(s,s.return,Qe)}zm&&(zm=!1,GE(s));break;case 4:h=ss,ss=Uf(s.stateNode.containerInfo),gr(a,s),br(s),ss=h;break;case 12:gr(a,s),br(s);break;case 31:gr(a,s),br(s),h&4&&(h=s.updateQueue,h!==null&&(s.updateQueue=null,kf(s,h)));break;case 13:gr(a,s),br(s),s.child.flags&8192&&s.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(_f=se()),h&4&&(h=s.updateQueue,h!==null&&(s.updateQueue=null,kf(s,h)));break;case 22:x=s.memoizedState!==null;var ne=u!==null&&u.memoizedState!==null,be=Ys,Se=An;if(Ys=be||x,An=Se||ne,gr(a,s),An=Se,Ys=be,br(s),h&8192)e:for(a=s.stateNode,a._visibility=x?a._visibility&-2:a._visibility|1,x&&(u===null||ne||Ys||An||Na(s)),u=null,a=s;;){if(a.tag===5||a.tag===26){if(u===null){ne=u=a;try{if(T=ne.stateNode,x)R=T.style,typeof R.setProperty=="function"?R.setProperty("display","none","important"):R.display="none";else{B=ne.stateNode;var _e=ne.memoizedProps.style,xe=_e!=null&&_e.hasOwnProperty("display")?_e.display:null;B.style.display=xe==null||typeof xe=="boolean"?"":(""+xe).trim()}}catch(Qe){Vt(ne,ne.return,Qe)}}}else if(a.tag===6){if(u===null){ne=a;try{ne.stateNode.nodeValue=x?"":ne.memoizedProps}catch(Qe){Vt(ne,ne.return,Qe)}}}else if(a.tag===18){if(u===null){ne=a;try{var ye=ne.stateNode;x?PT(ye,!0):PT(ne.stateNode,!1)}catch(Qe){Vt(ne,ne.return,Qe)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===s)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===s)break e;for(;a.sibling===null;){if(a.return===null||a.return===s)break e;u===a&&(u=null),a=a.return}u===a&&(u=null),a.sibling.return=a.return,a=a.sibling}h&4&&(h=s.updateQueue,h!==null&&(u=h.retryQueue,u!==null&&(h.retryQueue=null,kf(s,u))));break;case 19:gr(a,s),br(s),h&4&&(h=s.updateQueue,h!==null&&(s.updateQueue=null,kf(s,h)));break;case 30:break;case 21:break;default:gr(a,s),br(s)}}function br(s){var a=s.flags;if(a&2){try{for(var u,h=s.return;h!==null;){if(BE(h)){u=h;break}h=h.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var x=u.stateNode,T=Hm(s);wf(s,T,x);break;case 5:var R=u.stateNode;u.flags&32&&(To(R,""),u.flags&=-33);var B=Hm(s);wf(s,B,R);break;case 3:case 4:var ne=u.stateNode.containerInfo,be=Hm(s);Um(s,be,ne);break;default:throw Error(r(161))}}catch(Se){Vt(s,s.return,Se)}s.flags&=-3}a&4096&&(s.flags&=-4097)}function GE(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var a=s;GE(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),s=s.sibling}}function Xs(s,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)zE(s,a.alternate,a),a=a.sibling}function Na(s){for(s=s.child;s!==null;){var a=s;switch(a.tag){case 0:case 11:case 14:case 15:wi(4,a,a.return),Na(a);break;case 1:gs(a,a.return);var u=a.stateNode;typeof u.componentWillUnmount=="function"&&PE(a,a.return,u),Na(a);break;case 27:hu(a.stateNode);case 26:case 5:gs(a,a.return),Na(a);break;case 22:a.memoizedState===null&&Na(a);break;case 30:Na(a);break;default:Na(a)}s=s.sibling}}function Ks(s,a,u){for(u=u&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var h=a.alternate,x=s,T=a,R=T.flags;switch(T.tag){case 0:case 11:case 15:Ks(x,T,u),ru(4,T);break;case 1:if(Ks(x,T,u),h=T,x=h.stateNode,typeof x.componentDidMount=="function")try{x.componentDidMount()}catch(be){Vt(h,h.return,be)}if(h=T,x=h.updateQueue,x!==null){var B=h.stateNode;try{var ne=x.shared.hiddenCallbacks;if(ne!==null)for(x.shared.hiddenCallbacks=null,x=0;x<ne.length;x++)Cy(ne[x],B)}catch(be){Vt(h,h.return,be)}}u&&R&64&&DE(T),su(T,T.return);break;case 27:HE(T);case 26:case 5:Ks(x,T,u),u&&h===null&&R&4&&jE(T),su(T,T.return);break;case 12:Ks(x,T,u);break;case 31:Ks(x,T,u),u&&R&4&&$E(x,T);break;case 13:Ks(x,T,u),u&&R&4&&qE(x,T);break;case 22:T.memoizedState===null&&Ks(x,T,u),su(T,T.return);break;case 30:break;default:Ks(x,T,u)}a=a.sibling}}function Fm(s,a){var u=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(u=s.memoizedState.cachePool.pool),s=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(s=a.memoizedState.cachePool.pool),s!==u&&(s!=null&&s.refCount++,u!=null&&$l(u))}function Vm(s,a){s=null,a.alternate!==null&&(s=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==s&&(a.refCount++,s!=null&&$l(s))}function is(s,a,u,h){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)XE(s,a,u,h),a=a.sibling}function XE(s,a,u,h){var x=a.flags;switch(a.tag){case 0:case 11:case 15:is(s,a,u,h),x&2048&&ru(9,a);break;case 1:is(s,a,u,h);break;case 3:is(s,a,u,h),x&2048&&(s=null,a.alternate!==null&&(s=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==s&&(a.refCount++,s!=null&&$l(s)));break;case 12:if(x&2048){is(s,a,u,h),s=a.stateNode;try{var T=a.memoizedProps,R=T.id,B=T.onPostCommit;typeof B=="function"&&B(R,a.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(ne){Vt(a,a.return,ne)}}else is(s,a,u,h);break;case 31:is(s,a,u,h);break;case 13:is(s,a,u,h);break;case 23:break;case 22:T=a.stateNode,R=a.alternate,a.memoizedState!==null?T._visibility&2?is(s,a,u,h):iu(s,a):T._visibility&2?is(s,a,u,h):(T._visibility|=2,zo(s,a,u,h,(a.subtreeFlags&10256)!==0||!1)),x&2048&&Fm(R,a);break;case 24:is(s,a,u,h),x&2048&&Vm(a.alternate,a);break;default:is(s,a,u,h)}}function zo(s,a,u,h,x){for(x=x&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var T=s,R=a,B=u,ne=h,be=R.flags;switch(R.tag){case 0:case 11:case 15:zo(T,R,B,ne,x),ru(8,R);break;case 23:break;case 22:var Se=R.stateNode;R.memoizedState!==null?Se._visibility&2?zo(T,R,B,ne,x):iu(T,R):(Se._visibility|=2,zo(T,R,B,ne,x)),x&&be&2048&&Fm(R.alternate,R);break;case 24:zo(T,R,B,ne,x),x&&be&2048&&Vm(R.alternate,R);break;default:zo(T,R,B,ne,x)}a=a.sibling}}function iu(s,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var u=s,h=a,x=h.flags;switch(h.tag){case 22:iu(u,h),x&2048&&Fm(h.alternate,h);break;case 24:iu(u,h),x&2048&&Vm(h.alternate,h);break;default:iu(u,h)}a=a.sibling}}var au=8192;function Fo(s,a,u){if(s.subtreeFlags&au)for(s=s.child;s!==null;)KE(s,a,u),s=s.sibling}function KE(s,a,u){switch(s.tag){case 26:Fo(s,a,u),s.flags&au&&s.memoizedState!==null&&NO(u,ss,s.memoizedState,s.memoizedProps);break;case 5:Fo(s,a,u);break;case 3:case 4:var h=ss;ss=Uf(s.stateNode.containerInfo),Fo(s,a,u),ss=h;break;case 22:s.memoizedState===null&&(h=s.alternate,h!==null&&h.memoizedState!==null?(h=au,au=16777216,Fo(s,a,u),au=h):Fo(s,a,u));break;default:Fo(s,a,u)}}function QE(s){var a=s.alternate;if(a!==null&&(s=a.child,s!==null)){a.child=null;do a=s.sibling,s.sibling=null,s=a;while(s!==null)}}function ou(s){var a=s.deletions;if((s.flags&16)!==0){if(a!==null)for(var u=0;u<a.length;u++){var h=a[u];jn=h,ZE(h,s)}QE(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)WE(s),s=s.sibling}function WE(s){switch(s.tag){case 0:case 11:case 15:ou(s),s.flags&2048&&wi(9,s,s.return);break;case 3:ou(s);break;case 12:ou(s);break;case 22:var a=s.stateNode;s.memoizedState!==null&&a._visibility&2&&(s.return===null||s.return.tag!==13)?(a._visibility&=-3,Af(s)):ou(s);break;default:ou(s)}}function Af(s){var a=s.deletions;if((s.flags&16)!==0){if(a!==null)for(var u=0;u<a.length;u++){var h=a[u];jn=h,ZE(h,s)}QE(s)}for(s=s.child;s!==null;){switch(a=s,a.tag){case 0:case 11:case 15:wi(8,a,a.return),Af(a);break;case 22:u=a.stateNode,u._visibility&2&&(u._visibility&=-3,Af(a));break;default:Af(a)}s=s.sibling}}function ZE(s,a){for(;jn!==null;){var u=jn;switch(u.tag){case 0:case 11:case 15:wi(8,u,a);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var h=u.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:$l(u.memoizedState.cache)}if(h=u.child,h!==null)h.return=u,jn=h;else e:for(u=s;jn!==null;){h=jn;var x=h.sibling,T=h.return;if(FE(h),h===u){jn=null;break e}if(x!==null){x.return=T,jn=x;break e}jn=T}}}var $6={getCacheForType:function(s){var a=qn(Cn),u=a.data.get(s);return u===void 0&&(u=s(),a.data.set(s,u)),u},cacheSignal:function(){return qn(Cn).controller.signal}},q6=typeof WeakMap=="function"?WeakMap:Map,zt=0,tn=null,Ct=null,_t=0,Ft=0,Or=null,ki=!1,Vo=!1,$m=!1,Qs=0,gn=0,Ai=0,Ra=0,qm=0,Ir=0,$o=0,lu=null,xr=null,Ym=!1,_f=0,JE=0,Nf=1/0,Rf=null,_i=null,In=0,Ni=null,qo=null,Ws=0,Gm=0,Xm=null,eT=null,uu=0,Km=null;function Lr(){return(zt&2)!==0&&_t!==0?_t&-_t:H.T!==null?t0():pn()}function tT(){if(Ir===0)if((_t&536870912)===0||It){var s=Qt;Qt<<=1,(Qt&3932160)===0&&(Qt=262144),Ir=s}else Ir=536870912;return s=Nr.current,s!==null&&(s.flags|=32),Ir}function yr(s,a,u){(s===tn&&(Ft===2||Ft===9)||s.cancelPendingCommit!==null)&&(Yo(s,0),Ri(s,_t,Ir,!1)),bt(s,u),((zt&2)===0||s!==tn)&&(s===tn&&((zt&2)===0&&(Ra|=u),gn===4&&Ri(s,_t,Ir,!1)),bs(s))}function nT(s,a,u){if((zt&6)!==0)throw Error(r(327));var h=!u&&(a&127)===0&&(a&s.expiredLanes)===0||gt(s,a),x=h?X6(s,a):Wm(s,a,!0),T=h;do{if(x===0){Vo&&!h&&Ri(s,a,0,!1);break}else{if(u=s.current.alternate,T&&!Y6(u)){x=Wm(s,a,!1),T=!1;continue}if(x===2){if(T=a,s.errorRecoveryDisabledLanes&T)var R=0;else R=s.pendingLanes&-536870913,R=R!==0?R:R&536870912?536870912:0;if(R!==0){a=R;e:{var B=s;x=lu;var ne=B.current.memoizedState.isDehydrated;if(ne&&(Yo(B,R).flags|=256),R=Wm(B,R,!1),R!==2){if($m&&!ne){B.errorRecoveryDisabledLanes|=T,Ra|=T,x=4;break e}T=xr,xr=x,T!==null&&(xr===null?xr=T:xr.push.apply(xr,T))}x=R}if(T=!1,x!==2)continue}}if(x===1){Yo(s,0),Ri(s,a,0,!0);break}e:{switch(h=s,T=x,T){case 0:case 1:throw Error(r(345));case 4:if((a&4194048)!==a)break;case 6:Ri(h,a,Ir,!ki);break e;case 2:xr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((a&62914560)===a&&(x=_f+300-se(),10<x)){if(Ri(h,a,Ir,!ki),Ye(h,0,!0)!==0)break e;Ws=a,h.timeoutHandle=LT(rT.bind(null,h,u,xr,Rf,Ym,a,Ir,Ra,$o,ki,T,"Throttled",-0,0),x);break e}rT(h,u,xr,Rf,Ym,a,Ir,Ra,$o,ki,T,null,-0,0)}}break}while(!0);bs(s)}function rT(s,a,u,h,x,T,R,B,ne,be,Se,_e,xe,ye){if(s.timeoutHandle=-1,_e=a.subtreeFlags,_e&8192||(_e&16785408)===16785408){_e={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ps},KE(a,T,_e);var Qe=(T&62914560)===T?_f-se():(T&4194048)===T?JE-se():0;if(Qe=RO(_e,Qe),Qe!==null){Ws=T,s.cancelPendingCommit=Qe(fT.bind(null,s,a,T,u,h,x,R,B,ne,Se,_e,null,xe,ye)),Ri(s,T,R,!be);return}}fT(s,a,T,u,h,x,R,B,ne)}function Y6(s){for(var a=s;;){var u=a.tag;if((u===0||u===11||u===15)&&a.flags&16384&&(u=a.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var h=0;h<u.length;h++){var x=u[h],T=x.getSnapshot;x=x.value;try{if(!Ar(T(),x))return!1}catch{return!1}}if(u=a.child,a.subtreeFlags&16384&&u!==null)u.return=a,a=u;else{if(a===s)break;for(;a.sibling===null;){if(a.return===null||a.return===s)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function Ri(s,a,u,h){a&=~qm,a&=~Ra,s.suspendedLanes|=a,s.pingedLanes&=~a,h&&(s.warmLanes|=a),h=s.expirationTimes;for(var x=a;0<x;){var T=31-Fe(x),R=1<<T;h[T]=-1,x&=~R}u!==0&&hr(s,u,a)}function Of(){return(zt&6)===0?(cu(0),!1):!0}function Qm(){if(Ct!==null){if(Ft===0)var s=Ct.return;else s=Ct,Us=Ta=null,dm(s),Po=null,Yl=0,s=Ct;for(;s!==null;)ME(s.alternate,s),s=s.return;Ct=null}}function Yo(s,a){var u=s.timeoutHandle;u!==-1&&(s.timeoutHandle=-1,dO(u)),u=s.cancelPendingCommit,u!==null&&(s.cancelPendingCommit=null,u()),Ws=0,Qm(),tn=s,Ct=u=Bs(s.current,null),_t=a,Ft=0,Or=null,ki=!1,Vo=gt(s,a),$m=!1,$o=Ir=qm=Ra=Ai=gn=0,xr=lu=null,Ym=!1,(a&8)!==0&&(a|=a&32);var h=s.entangledLanes;if(h!==0)for(s=s.entanglements,h&=a;0<h;){var x=31-Fe(h),T=1<<x;a|=s[x],h&=~T}return Qs=a,Wc(),u}function sT(s,a){pt=null,H.H=eu,a===Do||a===af?(a=Ey(),Ft=3):a===em?(a=Ey(),Ft=4):Ft=a===_m?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,Or=a,Ct===null&&(gn=1,Ef(s,$r(a,s.current)))}function iT(){var s=Nr.current;return s===null?!0:(_t&4194048)===_t?Xr===null:(_t&62914560)===_t||(_t&536870912)!==0?s===Xr:!1}function aT(){var s=H.H;return H.H=eu,s===null?eu:s}function oT(){var s=H.A;return H.A=$6,s}function If(){gn=4,ki||(_t&4194048)!==_t&&Nr.current!==null||(Vo=!0),(Ai&134217727)===0&&(Ra&134217727)===0||tn===null||Ri(tn,_t,Ir,!1)}function Wm(s,a,u){var h=zt;zt|=2;var x=aT(),T=oT();(tn!==s||_t!==a)&&(Rf=null,Yo(s,a)),a=!1;var R=gn;e:do try{if(Ft!==0&&Ct!==null){var B=Ct,ne=Or;switch(Ft){case 8:Qm(),R=6;break e;case 3:case 2:case 9:case 6:Nr.current===null&&(a=!0);var be=Ft;if(Ft=0,Or=null,Go(s,B,ne,be),u&&Vo){R=0;break e}break;default:be=Ft,Ft=0,Or=null,Go(s,B,ne,be)}}G6(),R=gn;break}catch(Se){sT(s,Se)}while(!0);return a&&s.shellSuspendCounter++,Us=Ta=null,zt=h,H.H=x,H.A=T,Ct===null&&(tn=null,_t=0,Wc()),R}function G6(){for(;Ct!==null;)lT(Ct)}function X6(s,a){var u=zt;zt|=2;var h=aT(),x=oT();tn!==s||_t!==a?(Rf=null,Nf=se()+500,Yo(s,a)):Vo=gt(s,a);e:do try{if(Ft!==0&&Ct!==null){a=Ct;var T=Or;t:switch(Ft){case 1:Ft=0,Or=null,Go(s,a,T,1);break;case 2:case 9:if(xy(T)){Ft=0,Or=null,uT(a);break}a=function(){Ft!==2&&Ft!==9||tn!==s||(Ft=7),bs(s)},T.then(a,a);break e;case 3:Ft=7;break e;case 4:Ft=5;break e;case 7:xy(T)?(Ft=0,Or=null,uT(a)):(Ft=0,Or=null,Go(s,a,T,7));break;case 5:var R=null;switch(Ct.tag){case 26:R=Ct.memoizedState;case 5:case 27:var B=Ct;if(R?XT(R):B.stateNode.complete){Ft=0,Or=null;var ne=B.sibling;if(ne!==null)Ct=ne;else{var be=B.return;be!==null?(Ct=be,Lf(be)):Ct=null}break t}}Ft=0,Or=null,Go(s,a,T,5);break;case 6:Ft=0,Or=null,Go(s,a,T,6);break;case 8:Qm(),gn=6;break e;default:throw Error(r(462))}}K6();break}catch(Se){sT(s,Se)}while(!0);return Us=Ta=null,H.H=h,H.A=x,zt=u,Ct!==null?0:(tn=null,_t=0,Wc(),gn)}function K6(){for(;Ct!==null&&!W();)lT(Ct)}function lT(s){var a=IE(s.alternate,s,Qs);s.memoizedProps=s.pendingProps,a===null?Lf(s):Ct=a}function uT(s){var a=s,u=a.alternate;switch(a.tag){case 15:case 0:a=kE(u,a,a.pendingProps,a.type,void 0,_t);break;case 11:a=kE(u,a,a.pendingProps,a.type.render,a.ref,_t);break;case 5:dm(a);default:ME(u,a),a=Ct=oy(a,Qs),a=IE(u,a,Qs)}s.memoizedProps=s.pendingProps,a===null?Lf(s):Ct=a}function Go(s,a,u,h){Us=Ta=null,dm(a),Po=null,Yl=0;var x=a.return;try{if(j6(s,x,a,u,_t)){gn=1,Ef(s,$r(u,s.current)),Ct=null;return}}catch(T){if(x!==null)throw Ct=x,T;gn=1,Ef(s,$r(u,s.current)),Ct=null;return}a.flags&32768?(It||h===1?s=!0:Vo||(_t&536870912)!==0?s=!1:(ki=s=!0,(h===2||h===9||h===3||h===6)&&(h=Nr.current,h!==null&&h.tag===13&&(h.flags|=16384))),cT(a,s)):Lf(a)}function Lf(s){var a=s;do{if((a.flags&32768)!==0){cT(a,ki);return}s=a.return;var u=U6(a.alternate,a,Qs);if(u!==null){Ct=u;return}if(a=a.sibling,a!==null){Ct=a;return}Ct=a=s}while(a!==null);gn===0&&(gn=5)}function cT(s,a){do{var u=z6(s.alternate,s);if(u!==null){u.flags&=32767,Ct=u;return}if(u=s.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!a&&(s=s.sibling,s!==null)){Ct=s;return}Ct=s=u}while(s!==null);gn=6,Ct=null}function fT(s,a,u,h,x,T,R,B,ne){s.cancelPendingCommit=null;do Mf();while(In!==0);if((zt&6)!==0)throw Error(r(327));if(a!==null){if(a===s.current)throw Error(r(177));if(T=a.lanes|a.childLanes,T|=Hp,an(s,u,T,R,B,ne),s===tn&&(Ct=tn=null,_t=0),qo=a,Ni=s,Ws=u,Gm=T,Xm=x,eT=h,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,J6(ue,function(){return gT(),null})):(s.callbackNode=null,s.callbackPriority=0),h=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||h){h=H.T,H.T=null,x=K.p,K.p=2,R=zt,zt|=4;try{F6(s,a,u)}finally{zt=R,K.p=x,H.T=h}}In=1,dT(),hT(),pT()}}function dT(){if(In===1){In=0;var s=Ni,a=qo,u=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||u){u=H.T,H.T=null;var h=K.p;K.p=2;var x=zt;zt|=4;try{YE(a,s);var T=u0,R=Zx(s.containerInfo),B=T.focusedElem,ne=T.selectionRange;if(R!==B&&B&&B.ownerDocument&&Wx(B.ownerDocument.documentElement,B)){if(ne!==null&&Mp(B)){var be=ne.start,Se=ne.end;if(Se===void 0&&(Se=be),"selectionStart"in B)B.selectionStart=be,B.selectionEnd=Math.min(Se,B.value.length);else{var _e=B.ownerDocument||document,xe=_e&&_e.defaultView||window;if(xe.getSelection){var ye=xe.getSelection(),Qe=B.textContent.length,it=Math.min(ne.start,Qe),Gt=ne.end===void 0?it:Math.min(ne.end,Qe);!ye.extend&&it>Gt&&(R=Gt,Gt=it,it=R);var ce=Qx(B,it),oe=Qx(B,Gt);if(ce&&oe&&(ye.rangeCount!==1||ye.anchorNode!==ce.node||ye.anchorOffset!==ce.offset||ye.focusNode!==oe.node||ye.focusOffset!==oe.offset)){var ge=_e.createRange();ge.setStart(ce.node,ce.offset),ye.removeAllRanges(),it>Gt?(ye.addRange(ge),ye.extend(oe.node,oe.offset)):(ge.setEnd(oe.node,oe.offset),ye.addRange(ge))}}}}for(_e=[],ye=B;ye=ye.parentNode;)ye.nodeType===1&&_e.push({element:ye,left:ye.scrollLeft,top:ye.scrollTop});for(typeof B.focus=="function"&&B.focus(),B=0;B<_e.length;B++){var Ae=_e[B];Ae.element.scrollLeft=Ae.left,Ae.element.scrollTop=Ae.top}}Yf=!!l0,u0=l0=null}finally{zt=x,K.p=h,H.T=u}}s.current=a,In=2}}function hT(){if(In===2){In=0;var s=Ni,a=qo,u=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||u){u=H.T,H.T=null;var h=K.p;K.p=2;var x=zt;zt|=4;try{zE(s,a.alternate,a)}finally{zt=x,K.p=h,H.T=u}}In=3}}function pT(){if(In===4||In===3){In=0,me();var s=Ni,a=qo,u=Ws,h=eT;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?In=5:(In=0,qo=Ni=null,mT(s,s.pendingLanes));var x=s.pendingLanes;if(x===0&&(_i=null),At(u),a=a.stateNode,ot&&typeof ot.onCommitFiberRoot=="function")try{ot.onCommitFiberRoot(et,a,void 0,(a.current.flags&128)===128)}catch{}if(h!==null){a=H.T,x=K.p,K.p=2,H.T=null;try{for(var T=s.onRecoverableError,R=0;R<h.length;R++){var B=h[R];T(B.value,{componentStack:B.stack})}}finally{H.T=a,K.p=x}}(Ws&3)!==0&&Mf(),bs(s),x=s.pendingLanes,(u&261930)!==0&&(x&42)!==0?s===Km?uu++:(uu=0,Km=s):uu=0,cu(0)}}function mT(s,a){(s.pooledCacheLanes&=a)===0&&(a=s.pooledCache,a!=null&&(s.pooledCache=null,$l(a)))}function Mf(){return dT(),hT(),pT(),gT()}function gT(){if(In!==5)return!1;var s=Ni,a=Gm;Gm=0;var u=At(Ws),h=H.T,x=K.p;try{K.p=32>u?32:u,H.T=null,u=Xm,Xm=null;var T=Ni,R=Ws;if(In=0,qo=Ni=null,Ws=0,(zt&6)!==0)throw Error(r(331));var B=zt;if(zt|=4,WE(T.current),XE(T,T.current,R,u),zt=B,cu(0,!1),ot&&typeof ot.onPostCommitFiberRoot=="function")try{ot.onPostCommitFiberRoot(et,T)}catch{}return!0}finally{K.p=x,H.T=h,mT(s,a)}}function bT(s,a,u){a=$r(u,a),a=Am(s.stateNode,a,2),s=vi(s,a,2),s!==null&&(bt(s,2),bs(s))}function Vt(s,a,u){if(s.tag===3)bT(s,s,u);else for(;a!==null;){if(a.tag===3){bT(a,s,u);break}else if(a.tag===1){var h=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(_i===null||!_i.has(h))){s=$r(u,s),u=xE(2),h=vi(a,u,2),h!==null&&(yE(u,h,a,s),bt(h,2),bs(h));break}}a=a.return}}function Zm(s,a,u){var h=s.pingCache;if(h===null){h=s.pingCache=new q6;var x=new Set;h.set(a,x)}else x=h.get(a),x===void 0&&(x=new Set,h.set(a,x));x.has(u)||($m=!0,x.add(u),s=Q6.bind(null,s,a,u),a.then(s,s))}function Q6(s,a,u){var h=s.pingCache;h!==null&&h.delete(a),s.pingedLanes|=s.suspendedLanes&u,s.warmLanes&=~u,tn===s&&(_t&u)===u&&(gn===4||gn===3&&(_t&62914560)===_t&&300>se()-_f?(zt&2)===0&&Yo(s,0):qm|=u,$o===_t&&($o=0)),bs(s)}function xT(s,a){a===0&&(a=Jt()),s=xa(s,a),s!==null&&(bt(s,a),bs(s))}function W6(s){var a=s.memoizedState,u=0;a!==null&&(u=a.retryLane),xT(s,u)}function Z6(s,a){var u=0;switch(s.tag){case 31:case 13:var h=s.stateNode,x=s.memoizedState;x!==null&&(u=x.retryLane);break;case 19:h=s.stateNode;break;case 22:h=s.stateNode._retryCache;break;default:throw Error(r(314))}h!==null&&h.delete(a),xT(s,u)}function J6(s,a){return Be(s,a)}var Df=null,Xo=null,Jm=!1,Pf=!1,e0=!1,Oi=0;function bs(s){s!==Xo&&s.next===null&&(Xo===null?Df=Xo=s:Xo=Xo.next=s),Pf=!0,Jm||(Jm=!0,tO())}function cu(s,a){if(!e0&&Pf){e0=!0;do for(var u=!1,h=Df;h!==null;){if(s!==0){var x=h.pendingLanes;if(x===0)var T=0;else{var R=h.suspendedLanes,B=h.pingedLanes;T=(1<<31-Fe(42|s)+1)-1,T&=x&~(R&~B),T=T&201326741?T&201326741|1:T?T|2:0}T!==0&&(u=!0,vT(h,T))}else T=_t,T=Ye(h,h===tn?T:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(T&3)===0||gt(h,T)||(u=!0,vT(h,T));h=h.next}while(u);e0=!1}}function eO(){yT()}function yT(){Pf=Jm=!1;var s=0;Oi!==0&&fO()&&(s=Oi);for(var a=se(),u=null,h=Df;h!==null;){var x=h.next,T=ET(h,a);T===0?(h.next=null,u===null?Df=x:u.next=x,x===null&&(Xo=u)):(u=h,(s!==0||(T&3)!==0)&&(Pf=!0)),h=x}In!==0&&In!==5||cu(s),Oi!==0&&(Oi=0)}function ET(s,a){for(var u=s.suspendedLanes,h=s.pingedLanes,x=s.expirationTimes,T=s.pendingLanes&-62914561;0<T;){var R=31-Fe(T),B=1<<R,ne=x[R];ne===-1?((B&u)===0||(B&h)!==0)&&(x[R]=Ut(B,a)):ne<=a&&(s.expiredLanes|=B),T&=~B}if(a=tn,u=_t,u=Ye(s,s===a?u:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),h=s.callbackNode,u===0||s===a&&(Ft===2||Ft===9)||s.cancelPendingCommit!==null)return h!==null&&h!==null&&$e(h),s.callbackNode=null,s.callbackPriority=0;if((u&3)===0||gt(s,u)){if(a=u&-u,a===s.callbackPriority)return a;switch(h!==null&&$e(h),At(u)){case 2:case 8:u=z;break;case 32:u=ue;break;case 268435456:u=Re;break;default:u=ue}return h=TT.bind(null,s),u=Be(u,h),s.callbackPriority=a,s.callbackNode=u,a}return h!==null&&h!==null&&$e(h),s.callbackPriority=2,s.callbackNode=null,2}function TT(s,a){if(In!==0&&In!==5)return s.callbackNode=null,s.callbackPriority=0,null;var u=s.callbackNode;if(Mf()&&s.callbackNode!==u)return null;var h=_t;return h=Ye(s,s===tn?h:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),h===0?null:(nT(s,h,a),ET(s,se()),s.callbackNode!=null&&s.callbackNode===u?TT.bind(null,s):null)}function vT(s,a){if(Mf())return null;nT(s,a,!0)}function tO(){hO(function(){(zt&6)!==0?Be(V,eO):yT()})}function t0(){if(Oi===0){var s=Lo;s===0&&(s=Ot,Ot<<=1,(Ot&261888)===0&&(Ot=256)),Oi=s}return Oi}function ST(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:Vc(""+s)}function CT(s,a){var u=a.ownerDocument.createElement("input");return u.name=a.name,u.value=a.value,s.id&&u.setAttribute("form",s.id),a.parentNode.insertBefore(u,a),s=new FormData(s),u.parentNode.removeChild(u),s}function nO(s,a,u,h,x){if(a==="submit"&&u&&u.stateNode===x){var T=ST((x[Vn]||null).action),R=h.submitter;R&&(a=(a=R[Vn]||null)?ST(a.formAction):R.getAttribute("formAction"),a!==null&&(T=a,R=null));var B=new Gc("action","action",null,h,x);s.push({event:B,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(Oi!==0){var ne=R?CT(x,R):new FormData(x);Tm(u,{pending:!0,data:ne,method:x.method,action:T},null,ne)}}else typeof T=="function"&&(B.preventDefault(),ne=R?CT(x,R):new FormData(x),Tm(u,{pending:!0,data:ne,method:x.method,action:T},T,ne))},currentTarget:x}]})}}for(var n0=0;n0<Bp.length;n0++){var r0=Bp[n0],rO=r0.toLowerCase(),sO=r0[0].toUpperCase()+r0.slice(1);rs(rO,"on"+sO)}rs(ty,"onAnimationEnd"),rs(ny,"onAnimationIteration"),rs(ry,"onAnimationStart"),rs("dblclick","onDoubleClick"),rs("focusin","onFocus"),rs("focusout","onBlur"),rs(E6,"onTransitionRun"),rs(T6,"onTransitionStart"),rs(v6,"onTransitionCancel"),rs(sy,"onTransitionEnd"),yo("onMouseEnter",["mouseout","mouseover"]),yo("onMouseLeave",["mouseout","mouseover"]),yo("onPointerEnter",["pointerout","pointerover"]),yo("onPointerLeave",["pointerout","pointerover"]),pa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),pa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),pa("onBeforeInput",["compositionend","keypress","textInput","paste"]),pa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),pa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),pa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var fu="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),iO=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(fu));function wT(s,a){a=(a&4)!==0;for(var u=0;u<s.length;u++){var h=s[u],x=h.event;h=h.listeners;e:{var T=void 0;if(a)for(var R=h.length-1;0<=R;R--){var B=h[R],ne=B.instance,be=B.currentTarget;if(B=B.listener,ne!==T&&x.isPropagationStopped())break e;T=B,x.currentTarget=be;try{T(x)}catch(Se){Qc(Se)}x.currentTarget=null,T=ne}else for(R=0;R<h.length;R++){if(B=h[R],ne=B.instance,be=B.currentTarget,B=B.listener,ne!==T&&x.isPropagationStopped())break e;T=B,x.currentTarget=be;try{T(x)}catch(Se){Qc(Se)}x.currentTarget=null,T=ne}}}}function wt(s,a){var u=a[Rl];u===void 0&&(u=a[Rl]=new Set);var h=s+"__bubble";u.has(h)||(kT(a,s,2,!1),u.add(h))}function s0(s,a,u){var h=0;a&&(h|=4),kT(u,s,h,a)}var jf="_reactListening"+Math.random().toString(36).slice(2);function i0(s){if(!s[jf]){s[jf]=!0,yx.forEach(function(u){u!=="selectionchange"&&(iO.has(u)||s0(u,!1,s),s0(u,!0,s))});var a=s.nodeType===9?s:s.ownerDocument;a===null||a[jf]||(a[jf]=!0,s0("selectionchange",!1,a))}}function kT(s,a,u,h){switch(tv(a)){case 2:var x=LO;break;case 8:x=MO;break;default:x=E0}u=x.bind(null,a,u,s),x=void 0,!wp||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(x=!0),h?x!==void 0?s.addEventListener(a,u,{capture:!0,passive:x}):s.addEventListener(a,u,!0):x!==void 0?s.addEventListener(a,u,{passive:x}):s.addEventListener(a,u,!1)}function a0(s,a,u,h,x){var T=h;if((a&1)===0&&(a&2)===0&&h!==null)e:for(;;){if(h===null)return;var R=h.tag;if(R===3||R===4){var B=h.stateNode.containerInfo;if(B===x)break;if(R===4)for(R=h.return;R!==null;){var ne=R.tag;if((ne===3||ne===4)&&R.stateNode.containerInfo===x)return;R=R.return}for(;B!==null;){if(R=go(B),R===null)return;if(ne=R.tag,ne===5||ne===6||ne===26||ne===27){h=T=R;continue e}B=B.parentNode}}h=h.return}Ox(function(){var be=T,Se=Sp(u),_e=[];e:{var xe=iy.get(s);if(xe!==void 0){var ye=Gc,Qe=s;switch(s){case"keypress":if(qc(u)===0)break e;case"keydown":case"keyup":ye=ZR;break;case"focusin":Qe="focus",ye=Np;break;case"focusout":Qe="blur",ye=Np;break;case"beforeblur":case"afterblur":ye=Np;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ye=Mx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ye=UR;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ye=t6;break;case ty:case ny:case ry:ye=VR;break;case sy:ye=r6;break;case"scroll":case"scrollend":ye=BR;break;case"wheel":ye=i6;break;case"copy":case"cut":case"paste":ye=qR;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ye=Px;break;case"toggle":case"beforetoggle":ye=o6}var it=(a&4)!==0,Gt=!it&&(s==="scroll"||s==="scrollend"),ce=it?xe!==null?xe+"Capture":null:xe;it=[];for(var oe=be,ge;oe!==null;){var Ae=oe;if(ge=Ae.stateNode,Ae=Ae.tag,Ae!==5&&Ae!==26&&Ae!==27||ge===null||ce===null||(Ae=Ll(oe,ce),Ae!=null&&it.push(du(oe,Ae,ge))),Gt)break;oe=oe.return}0<it.length&&(xe=new ye(xe,Qe,null,u,Se),_e.push({event:xe,listeners:it}))}}if((a&7)===0){e:{if(xe=s==="mouseover"||s==="pointerover",ye=s==="mouseout"||s==="pointerout",xe&&u!==vp&&(Qe=u.relatedTarget||u.fromElement)&&(go(Qe)||Qe[hs]))break e;if((ye||xe)&&(xe=Se.window===Se?Se:(xe=Se.ownerDocument)?xe.defaultView||xe.parentWindow:window,ye?(Qe=u.relatedTarget||u.toElement,ye=be,Qe=Qe?go(Qe):null,Qe!==null&&(Gt=o(Qe),it=Qe.tag,Qe!==Gt||it!==5&&it!==27&&it!==6)&&(Qe=null)):(ye=null,Qe=be),ye!==Qe)){if(it=Mx,Ae="onMouseLeave",ce="onMouseEnter",oe="mouse",(s==="pointerout"||s==="pointerover")&&(it=Px,Ae="onPointerLeave",ce="onPointerEnter",oe="pointer"),Gt=ye==null?xe:Il(ye),ge=Qe==null?xe:Il(Qe),xe=new it(Ae,oe+"leave",ye,u,Se),xe.target=Gt,xe.relatedTarget=ge,Ae=null,go(Se)===be&&(it=new it(ce,oe+"enter",Qe,u,Se),it.target=ge,it.relatedTarget=Gt,Ae=it),Gt=Ae,ye&&Qe)t:{for(it=aO,ce=ye,oe=Qe,ge=0,Ae=ce;Ae;Ae=it(Ae))ge++;Ae=0;for(var tt=oe;tt;tt=it(tt))Ae++;for(;0<ge-Ae;)ce=it(ce),ge--;for(;0<Ae-ge;)oe=it(oe),Ae--;for(;ge--;){if(ce===oe||oe!==null&&ce===oe.alternate){it=ce;break t}ce=it(ce),oe=it(oe)}it=null}else it=null;ye!==null&&AT(_e,xe,ye,it,!1),Qe!==null&&Gt!==null&&AT(_e,Gt,Qe,it,!0)}}e:{if(xe=be?Il(be):window,ye=xe.nodeName&&xe.nodeName.toLowerCase(),ye==="select"||ye==="input"&&xe.type==="file")var Bt=$x;else if(Fx(xe))if(qx)Bt=b6;else{Bt=m6;var Ze=p6}else ye=xe.nodeName,!ye||ye.toLowerCase()!=="input"||xe.type!=="checkbox"&&xe.type!=="radio"?be&&Tp(be.elementType)&&(Bt=$x):Bt=g6;if(Bt&&(Bt=Bt(s,be))){Vx(_e,Bt,u,Se);break e}Ze&&Ze(s,xe,be),s==="focusout"&&be&&xe.type==="number"&&be.memoizedProps.value!=null&&Ep(xe,"number",xe.value)}switch(Ze=be?Il(be):window,s){case"focusin":(Fx(Ze)||Ze.contentEditable==="true")&&(wo=Ze,Dp=be,zl=null);break;case"focusout":zl=Dp=wo=null;break;case"mousedown":Pp=!0;break;case"contextmenu":case"mouseup":case"dragend":Pp=!1,Jx(_e,u,Se);break;case"selectionchange":if(y6)break;case"keydown":case"keyup":Jx(_e,u,Se)}var mt;if(Op)e:{switch(s){case"compositionstart":var Nt="onCompositionStart";break e;case"compositionend":Nt="onCompositionEnd";break e;case"compositionupdate":Nt="onCompositionUpdate";break e}Nt=void 0}else Co?Ux(s,u)&&(Nt="onCompositionEnd"):s==="keydown"&&u.keyCode===229&&(Nt="onCompositionStart");Nt&&(jx&&u.locale!=="ko"&&(Co||Nt!=="onCompositionStart"?Nt==="onCompositionEnd"&&Co&&(mt=Ix()):(mi=Se,kp="value"in mi?mi.value:mi.textContent,Co=!0)),Ze=Bf(be,Nt),0<Ze.length&&(Nt=new Dx(Nt,s,null,u,Se),_e.push({event:Nt,listeners:Ze}),mt?Nt.data=mt:(mt=zx(u),mt!==null&&(Nt.data=mt)))),(mt=u6?c6(s,u):f6(s,u))&&(Nt=Bf(be,"onBeforeInput"),0<Nt.length&&(Ze=new Dx("onBeforeInput","beforeinput",null,u,Se),_e.push({event:Ze,listeners:Nt}),Ze.data=mt)),nO(_e,s,be,u,Se)}wT(_e,a)})}function du(s,a,u){return{instance:s,listener:a,currentTarget:u}}function Bf(s,a){for(var u=a+"Capture",h=[];s!==null;){var x=s,T=x.stateNode;if(x=x.tag,x!==5&&x!==26&&x!==27||T===null||(x=Ll(s,u),x!=null&&h.unshift(du(s,x,T)),x=Ll(s,a),x!=null&&h.push(du(s,x,T))),s.tag===3)return h;s=s.return}return[]}function aO(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function AT(s,a,u,h,x){for(var T=a._reactName,R=[];u!==null&&u!==h;){var B=u,ne=B.alternate,be=B.stateNode;if(B=B.tag,ne!==null&&ne===h)break;B!==5&&B!==26&&B!==27||be===null||(ne=be,x?(be=Ll(u,T),be!=null&&R.unshift(du(u,be,ne))):x||(be=Ll(u,T),be!=null&&R.push(du(u,be,ne)))),u=u.return}R.length!==0&&s.push({event:a,listeners:R})}var oO=/\r\n?/g,lO=/\u0000|\uFFFD/g;function _T(s){return(typeof s=="string"?s:""+s).replace(oO,`
|
|
49
|
-
`).replace(lO,"")}function NT(s,a){return a=_T(a),_T(s)===a}function Yt(s,a,u,h,x,T){switch(u){case"children":typeof h=="string"?a==="body"||a==="textarea"&&h===""||To(s,h):(typeof h=="number"||typeof h=="bigint")&&a!=="body"&&To(s,""+h);break;case"className":zc(s,"class",h);break;case"tabIndex":zc(s,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":zc(s,u,h);break;case"style":Nx(s,h,T);break;case"data":if(a!=="object"){zc(s,"data",h);break}case"src":case"href":if(h===""&&(a!=="a"||u!=="href")){s.removeAttribute(u);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){s.removeAttribute(u);break}h=Vc(""+h),s.setAttribute(u,h);break;case"action":case"formAction":if(typeof h=="function"){s.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof T=="function"&&(u==="formAction"?(a!=="input"&&Yt(s,a,"name",x.name,x,null),Yt(s,a,"formEncType",x.formEncType,x,null),Yt(s,a,"formMethod",x.formMethod,x,null),Yt(s,a,"formTarget",x.formTarget,x,null)):(Yt(s,a,"encType",x.encType,x,null),Yt(s,a,"method",x.method,x,null),Yt(s,a,"target",x.target,x,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){s.removeAttribute(u);break}h=Vc(""+h),s.setAttribute(u,h);break;case"onClick":h!=null&&(s.onclick=Ps);break;case"onScroll":h!=null&&wt("scroll",s);break;case"onScrollEnd":h!=null&&wt("scrollend",s);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(u=h.__html,u!=null){if(x.children!=null)throw Error(r(60));s.innerHTML=u}}break;case"multiple":s.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":s.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){s.removeAttribute("xlink:href");break}u=Vc(""+h),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?s.setAttribute(u,""+h):s.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":h&&typeof h!="function"&&typeof h!="symbol"?s.setAttribute(u,""):s.removeAttribute(u);break;case"capture":case"download":h===!0?s.setAttribute(u,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?s.setAttribute(u,h):s.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?s.setAttribute(u,h):s.removeAttribute(u);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?s.removeAttribute(u):s.setAttribute(u,h);break;case"popover":wt("beforetoggle",s),wt("toggle",s),Uc(s,"popover",h);break;case"xlinkActuate":Ds(s,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":Ds(s,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":Ds(s,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":Ds(s,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":Ds(s,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":Ds(s,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":Ds(s,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":Ds(s,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":Ds(s,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":Uc(s,"is",h);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=PR.get(u)||u,Uc(s,u,h))}}function o0(s,a,u,h,x,T){switch(u){case"style":Nx(s,h,T);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(u=h.__html,u!=null){if(x.children!=null)throw Error(r(60));s.innerHTML=u}}break;case"children":typeof h=="string"?To(s,h):(typeof h=="number"||typeof h=="bigint")&&To(s,""+h);break;case"onScroll":h!=null&&wt("scroll",s);break;case"onScrollEnd":h!=null&&wt("scrollend",s);break;case"onClick":h!=null&&(s.onclick=Ps);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ex.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(x=u.endsWith("Capture"),a=u.slice(2,x?u.length-7:void 0),T=s[Vn]||null,T=T!=null?T[u]:null,typeof T=="function"&&s.removeEventListener(a,T,x),typeof h=="function")){typeof T!="function"&&T!==null&&(u in s?s[u]=null:s.hasAttribute(u)&&s.removeAttribute(u)),s.addEventListener(a,h,x);break e}u in s?s[u]=h:h===!0?s.setAttribute(u,""):Uc(s,u,h)}}}function Gn(s,a,u){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":wt("error",s),wt("load",s);var h=!1,x=!1,T;for(T in u)if(u.hasOwnProperty(T)){var R=u[T];if(R!=null)switch(T){case"src":h=!0;break;case"srcSet":x=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:Yt(s,a,T,R,u,null)}}x&&Yt(s,a,"srcSet",u.srcSet,u,null),h&&Yt(s,a,"src",u.src,u,null);return;case"input":wt("invalid",s);var B=T=R=x=null,ne=null,be=null;for(h in u)if(u.hasOwnProperty(h)){var Se=u[h];if(Se!=null)switch(h){case"name":x=Se;break;case"type":R=Se;break;case"checked":ne=Se;break;case"defaultChecked":be=Se;break;case"value":T=Se;break;case"defaultValue":B=Se;break;case"children":case"dangerouslySetInnerHTML":if(Se!=null)throw Error(r(137,a));break;default:Yt(s,a,h,Se,u,null)}}wx(s,T,B,ne,be,R,x,!1);return;case"select":wt("invalid",s),h=R=T=null;for(x in u)if(u.hasOwnProperty(x)&&(B=u[x],B!=null))switch(x){case"value":T=B;break;case"defaultValue":R=B;break;case"multiple":h=B;default:Yt(s,a,x,B,u,null)}a=T,u=R,s.multiple=!!h,a!=null?Eo(s,!!h,a,!1):u!=null&&Eo(s,!!h,u,!0);return;case"textarea":wt("invalid",s),T=x=h=null;for(R in u)if(u.hasOwnProperty(R)&&(B=u[R],B!=null))switch(R){case"value":h=B;break;case"defaultValue":x=B;break;case"children":T=B;break;case"dangerouslySetInnerHTML":if(B!=null)throw Error(r(91));break;default:Yt(s,a,R,B,u,null)}Ax(s,h,x,T);return;case"option":for(ne in u)if(u.hasOwnProperty(ne)&&(h=u[ne],h!=null))switch(ne){case"selected":s.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:Yt(s,a,ne,h,u,null)}return;case"dialog":wt("beforetoggle",s),wt("toggle",s),wt("cancel",s),wt("close",s);break;case"iframe":case"object":wt("load",s);break;case"video":case"audio":for(h=0;h<fu.length;h++)wt(fu[h],s);break;case"image":wt("error",s),wt("load",s);break;case"details":wt("toggle",s);break;case"embed":case"source":case"link":wt("error",s),wt("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(be in u)if(u.hasOwnProperty(be)&&(h=u[be],h!=null))switch(be){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:Yt(s,a,be,h,u,null)}return;default:if(Tp(a)){for(Se in u)u.hasOwnProperty(Se)&&(h=u[Se],h!==void 0&&o0(s,a,Se,h,u,void 0));return}}for(B in u)u.hasOwnProperty(B)&&(h=u[B],h!=null&&Yt(s,a,B,h,u,null))}function uO(s,a,u,h){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var x=null,T=null,R=null,B=null,ne=null,be=null,Se=null;for(ye in u){var _e=u[ye];if(u.hasOwnProperty(ye)&&_e!=null)switch(ye){case"checked":break;case"value":break;case"defaultValue":ne=_e;default:h.hasOwnProperty(ye)||Yt(s,a,ye,null,h,_e)}}for(var xe in h){var ye=h[xe];if(_e=u[xe],h.hasOwnProperty(xe)&&(ye!=null||_e!=null))switch(xe){case"type":T=ye;break;case"name":x=ye;break;case"checked":be=ye;break;case"defaultChecked":Se=ye;break;case"value":R=ye;break;case"defaultValue":B=ye;break;case"children":case"dangerouslySetInnerHTML":if(ye!=null)throw Error(r(137,a));break;default:ye!==_e&&Yt(s,a,xe,ye,h,_e)}}yp(s,R,B,ne,be,Se,T,x);return;case"select":ye=R=B=xe=null;for(T in u)if(ne=u[T],u.hasOwnProperty(T)&&ne!=null)switch(T){case"value":break;case"multiple":ye=ne;default:h.hasOwnProperty(T)||Yt(s,a,T,null,h,ne)}for(x in h)if(T=h[x],ne=u[x],h.hasOwnProperty(x)&&(T!=null||ne!=null))switch(x){case"value":xe=T;break;case"defaultValue":B=T;break;case"multiple":R=T;default:T!==ne&&Yt(s,a,x,T,h,ne)}a=B,u=R,h=ye,xe!=null?Eo(s,!!u,xe,!1):!!h!=!!u&&(a!=null?Eo(s,!!u,a,!0):Eo(s,!!u,u?[]:"",!1));return;case"textarea":ye=xe=null;for(B in u)if(x=u[B],u.hasOwnProperty(B)&&x!=null&&!h.hasOwnProperty(B))switch(B){case"value":break;case"children":break;default:Yt(s,a,B,null,h,x)}for(R in h)if(x=h[R],T=u[R],h.hasOwnProperty(R)&&(x!=null||T!=null))switch(R){case"value":xe=x;break;case"defaultValue":ye=x;break;case"children":break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(r(91));break;default:x!==T&&Yt(s,a,R,x,h,T)}kx(s,xe,ye);return;case"option":for(var Qe in u)if(xe=u[Qe],u.hasOwnProperty(Qe)&&xe!=null&&!h.hasOwnProperty(Qe))switch(Qe){case"selected":s.selected=!1;break;default:Yt(s,a,Qe,null,h,xe)}for(ne in h)if(xe=h[ne],ye=u[ne],h.hasOwnProperty(ne)&&xe!==ye&&(xe!=null||ye!=null))switch(ne){case"selected":s.selected=xe&&typeof xe!="function"&&typeof xe!="symbol";break;default:Yt(s,a,ne,xe,h,ye)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var it in u)xe=u[it],u.hasOwnProperty(it)&&xe!=null&&!h.hasOwnProperty(it)&&Yt(s,a,it,null,h,xe);for(be in h)if(xe=h[be],ye=u[be],h.hasOwnProperty(be)&&xe!==ye&&(xe!=null||ye!=null))switch(be){case"children":case"dangerouslySetInnerHTML":if(xe!=null)throw Error(r(137,a));break;default:Yt(s,a,be,xe,h,ye)}return;default:if(Tp(a)){for(var Gt in u)xe=u[Gt],u.hasOwnProperty(Gt)&&xe!==void 0&&!h.hasOwnProperty(Gt)&&o0(s,a,Gt,void 0,h,xe);for(Se in h)xe=h[Se],ye=u[Se],!h.hasOwnProperty(Se)||xe===ye||xe===void 0&&ye===void 0||o0(s,a,Se,xe,h,ye);return}}for(var ce in u)xe=u[ce],u.hasOwnProperty(ce)&&xe!=null&&!h.hasOwnProperty(ce)&&Yt(s,a,ce,null,h,xe);for(_e in h)xe=h[_e],ye=u[_e],!h.hasOwnProperty(_e)||xe===ye||xe==null&&ye==null||Yt(s,a,_e,xe,h,ye)}function RT(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function cO(){if(typeof performance.getEntriesByType=="function"){for(var s=0,a=0,u=performance.getEntriesByType("resource"),h=0;h<u.length;h++){var x=u[h],T=x.transferSize,R=x.initiatorType,B=x.duration;if(T&&B&&RT(R)){for(R=0,B=x.responseEnd,h+=1;h<u.length;h++){var ne=u[h],be=ne.startTime;if(be>B)break;var Se=ne.transferSize,_e=ne.initiatorType;Se&&RT(_e)&&(ne=ne.responseEnd,R+=Se*(ne<B?1:(B-be)/(ne-be)))}if(--h,a+=8*(T+R)/(x.duration/1e3),s++,10<s)break}}if(0<s)return a/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var l0=null,u0=null;function Hf(s){return s.nodeType===9?s:s.ownerDocument}function OT(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function IT(s,a){if(s===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&a==="foreignObject"?0:s}function c0(s,a){return s==="textarea"||s==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var f0=null;function fO(){var s=window.event;return s&&s.type==="popstate"?s===f0?!1:(f0=s,!0):(f0=null,!1)}var LT=typeof setTimeout=="function"?setTimeout:void 0,dO=typeof clearTimeout=="function"?clearTimeout:void 0,MT=typeof Promise=="function"?Promise:void 0,hO=typeof queueMicrotask=="function"?queueMicrotask:typeof MT<"u"?function(s){return MT.resolve(null).then(s).catch(pO)}:LT;function pO(s){setTimeout(function(){throw s})}function Ii(s){return s==="head"}function DT(s,a){var u=a,h=0;do{var x=u.nextSibling;if(s.removeChild(u),x&&x.nodeType===8)if(u=x.data,u==="/$"||u==="/&"){if(h===0){s.removeChild(x),Zo(a);return}h--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")h++;else if(u==="html")hu(s.ownerDocument.documentElement);else if(u==="head"){u=s.ownerDocument.head,hu(u);for(var T=u.firstChild;T;){var R=T.nextSibling,B=T.nodeName;T[Ol]||B==="SCRIPT"||B==="STYLE"||B==="LINK"&&T.rel.toLowerCase()==="stylesheet"||u.removeChild(T),T=R}}else u==="body"&&hu(s.ownerDocument.body);u=x}while(u);Zo(a)}function PT(s,a){var u=s;s=0;do{var h=u.nextSibling;if(u.nodeType===1?a?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(a?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),h&&h.nodeType===8)if(u=h.data,u==="/$"){if(s===0)break;s--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||s++;u=h}while(u)}function d0(s){var a=s.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var u=a;switch(a=a.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":d0(u),bp(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}s.removeChild(u)}}function mO(s,a,u,h){for(;s.nodeType===1;){var x=u;if(s.nodeName.toLowerCase()!==a.toLowerCase()){if(!h&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(h){if(!s[Ol])switch(a){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(T=s.getAttribute("rel"),T==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(T!==x.rel||s.getAttribute("href")!==(x.href==null||x.href===""?null:x.href)||s.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin)||s.getAttribute("title")!==(x.title==null?null:x.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(T=s.getAttribute("src"),(T!==(x.src==null?null:x.src)||s.getAttribute("type")!==(x.type==null?null:x.type)||s.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin))&&T&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(a==="input"&&s.type==="hidden"){var T=x.name==null?null:""+x.name;if(x.type==="hidden"&&s.getAttribute("name")===T)return s}else return s;if(s=Kr(s.nextSibling),s===null)break}return null}function gO(s,a,u){if(a==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!u||(s=Kr(s.nextSibling),s===null))return null;return s}function jT(s,a){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!a||(s=Kr(s.nextSibling),s===null))return null;return s}function h0(s){return s.data==="$?"||s.data==="$~"}function p0(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function bO(s,a){var u=s.ownerDocument;if(s.data==="$~")s._reactRetry=a;else if(s.data!=="$?"||u.readyState!=="loading")a();else{var h=function(){a(),u.removeEventListener("DOMContentLoaded",h)};u.addEventListener("DOMContentLoaded",h),s._reactRetry=h}}function Kr(s){for(;s!=null;s=s.nextSibling){var a=s.nodeType;if(a===1||a===3)break;if(a===8){if(a=s.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return s}var m0=null;function BT(s){s=s.nextSibling;for(var a=0;s;){if(s.nodeType===8){var u=s.data;if(u==="/$"||u==="/&"){if(a===0)return Kr(s.nextSibling);a--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||a++}s=s.nextSibling}return null}function HT(s){s=s.previousSibling;for(var a=0;s;){if(s.nodeType===8){var u=s.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(a===0)return s;a--}else u!=="/$"&&u!=="/&"||a++}s=s.previousSibling}return null}function UT(s,a,u){switch(a=Hf(u),s){case"html":if(s=a.documentElement,!s)throw Error(r(452));return s;case"head":if(s=a.head,!s)throw Error(r(453));return s;case"body":if(s=a.body,!s)throw Error(r(454));return s;default:throw Error(r(451))}}function hu(s){for(var a=s.attributes;a.length;)s.removeAttributeNode(a[0]);bp(s)}var Qr=new Map,zT=new Set;function Uf(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var Zs=K.d;K.d={f:xO,r:yO,D:EO,C:TO,L:vO,m:SO,X:wO,S:CO,M:kO};function xO(){var s=Zs.f(),a=Of();return s||a}function yO(s){var a=bo(s);a!==null&&a.tag===5&&a.type==="form"?sE(a):Zs.r(s)}var Ko=typeof document>"u"?null:document;function FT(s,a,u){var h=Ko;if(h&&typeof a=="string"&&a){var x=Fr(a);x='link[rel="'+s+'"][href="'+x+'"]',typeof u=="string"&&(x+='[crossorigin="'+u+'"]'),zT.has(x)||(zT.add(x),s={rel:s,crossOrigin:u,href:a},h.querySelector(x)===null&&(a=h.createElement("link"),Gn(a,"link",s),Pn(a),h.head.appendChild(a)))}}function EO(s){Zs.D(s),FT("dns-prefetch",s,null)}function TO(s,a){Zs.C(s,a),FT("preconnect",s,a)}function vO(s,a,u){Zs.L(s,a,u);var h=Ko;if(h&&s&&a){var x='link[rel="preload"][as="'+Fr(a)+'"]';a==="image"&&u&&u.imageSrcSet?(x+='[imagesrcset="'+Fr(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(x+='[imagesizes="'+Fr(u.imageSizes)+'"]')):x+='[href="'+Fr(s)+'"]';var T=x;switch(a){case"style":T=Qo(s);break;case"script":T=Wo(s)}Qr.has(T)||(s=p({rel:"preload",href:a==="image"&&u&&u.imageSrcSet?void 0:s,as:a},u),Qr.set(T,s),h.querySelector(x)!==null||a==="style"&&h.querySelector(pu(T))||a==="script"&&h.querySelector(mu(T))||(a=h.createElement("link"),Gn(a,"link",s),Pn(a),h.head.appendChild(a)))}}function SO(s,a){Zs.m(s,a);var u=Ko;if(u&&s){var h=a&&typeof a.as=="string"?a.as:"script",x='link[rel="modulepreload"][as="'+Fr(h)+'"][href="'+Fr(s)+'"]',T=x;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":T=Wo(s)}if(!Qr.has(T)&&(s=p({rel:"modulepreload",href:s},a),Qr.set(T,s),u.querySelector(x)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(mu(T)))return}h=u.createElement("link"),Gn(h,"link",s),Pn(h),u.head.appendChild(h)}}}function CO(s,a,u){Zs.S(s,a,u);var h=Ko;if(h&&s){var x=xo(h).hoistableStyles,T=Qo(s);a=a||"default";var R=x.get(T);if(!R){var B={loading:0,preload:null};if(R=h.querySelector(pu(T)))B.loading=5;else{s=p({rel:"stylesheet",href:s,"data-precedence":a},u),(u=Qr.get(T))&&g0(s,u);var ne=R=h.createElement("link");Pn(ne),Gn(ne,"link",s),ne._p=new Promise(function(be,Se){ne.onload=be,ne.onerror=Se}),ne.addEventListener("load",function(){B.loading|=1}),ne.addEventListener("error",function(){B.loading|=2}),B.loading|=4,zf(R,a,h)}R={type:"stylesheet",instance:R,count:1,state:B},x.set(T,R)}}}function wO(s,a){Zs.X(s,a);var u=Ko;if(u&&s){var h=xo(u).hoistableScripts,x=Wo(s),T=h.get(x);T||(T=u.querySelector(mu(x)),T||(s=p({src:s,async:!0},a),(a=Qr.get(x))&&b0(s,a),T=u.createElement("script"),Pn(T),Gn(T,"link",s),u.head.appendChild(T)),T={type:"script",instance:T,count:1,state:null},h.set(x,T))}}function kO(s,a){Zs.M(s,a);var u=Ko;if(u&&s){var h=xo(u).hoistableScripts,x=Wo(s),T=h.get(x);T||(T=u.querySelector(mu(x)),T||(s=p({src:s,async:!0,type:"module"},a),(a=Qr.get(x))&&b0(s,a),T=u.createElement("script"),Pn(T),Gn(T,"link",s),u.head.appendChild(T)),T={type:"script",instance:T,count:1,state:null},h.set(x,T))}}function VT(s,a,u,h){var x=(x=fe.current)?Uf(x):null;if(!x)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(a=Qo(u.href),u=xo(x).hoistableStyles,h=u.get(a),h||(h={type:"style",instance:null,count:0,state:null},u.set(a,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){s=Qo(u.href);var T=xo(x).hoistableStyles,R=T.get(s);if(R||(x=x.ownerDocument||x,R={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},T.set(s,R),(T=x.querySelector(pu(s)))&&!T._p&&(R.instance=T,R.state.loading=5),Qr.has(s)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},Qr.set(s,u),T||AO(x,s,u,R.state))),a&&h===null)throw Error(r(528,""));return R}if(a&&h!==null)throw Error(r(529,""));return null;case"script":return a=u.async,u=u.src,typeof u=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=Wo(u),u=xo(x).hoistableScripts,h=u.get(a),h||(h={type:"script",instance:null,count:0,state:null},u.set(a,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function Qo(s){return'href="'+Fr(s)+'"'}function pu(s){return'link[rel="stylesheet"]['+s+"]"}function $T(s){return p({},s,{"data-precedence":s.precedence,precedence:null})}function AO(s,a,u,h){s.querySelector('link[rel="preload"][as="style"]['+a+"]")?h.loading=1:(a=s.createElement("link"),h.preload=a,a.addEventListener("load",function(){return h.loading|=1}),a.addEventListener("error",function(){return h.loading|=2}),Gn(a,"link",u),Pn(a),s.head.appendChild(a))}function Wo(s){return'[src="'+Fr(s)+'"]'}function mu(s){return"script[async]"+s}function qT(s,a,u){if(a.count++,a.instance===null)switch(a.type){case"style":var h=s.querySelector('style[data-href~="'+Fr(u.href)+'"]');if(h)return a.instance=h,Pn(h),h;var x=p({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return h=(s.ownerDocument||s).createElement("style"),Pn(h),Gn(h,"style",x),zf(h,u.precedence,s),a.instance=h;case"stylesheet":x=Qo(u.href);var T=s.querySelector(pu(x));if(T)return a.state.loading|=4,a.instance=T,Pn(T),T;h=$T(u),(x=Qr.get(x))&&g0(h,x),T=(s.ownerDocument||s).createElement("link"),Pn(T);var R=T;return R._p=new Promise(function(B,ne){R.onload=B,R.onerror=ne}),Gn(T,"link",h),a.state.loading|=4,zf(T,u.precedence,s),a.instance=T;case"script":return T=Wo(u.src),(x=s.querySelector(mu(T)))?(a.instance=x,Pn(x),x):(h=u,(x=Qr.get(T))&&(h=p({},u),b0(h,x)),s=s.ownerDocument||s,x=s.createElement("script"),Pn(x),Gn(x,"link",h),s.head.appendChild(x),a.instance=x);case"void":return null;default:throw Error(r(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(h=a.instance,a.state.loading|=4,zf(h,u.precedence,s));return a.instance}function zf(s,a,u){for(var h=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),x=h.length?h[h.length-1]:null,T=x,R=0;R<h.length;R++){var B=h[R];if(B.dataset.precedence===a)T=B;else if(T!==x)break}T?T.parentNode.insertBefore(s,T.nextSibling):(a=u.nodeType===9?u.head:u,a.insertBefore(s,a.firstChild))}function g0(s,a){s.crossOrigin==null&&(s.crossOrigin=a.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=a.referrerPolicy),s.title==null&&(s.title=a.title)}function b0(s,a){s.crossOrigin==null&&(s.crossOrigin=a.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=a.referrerPolicy),s.integrity==null&&(s.integrity=a.integrity)}var Ff=null;function YT(s,a,u){if(Ff===null){var h=new Map,x=Ff=new Map;x.set(u,h)}else x=Ff,h=x.get(u),h||(h=new Map,x.set(u,h));if(h.has(s))return h;for(h.set(s,null),u=u.getElementsByTagName(s),x=0;x<u.length;x++){var T=u[x];if(!(T[Ol]||T[en]||s==="link"&&T.getAttribute("rel")==="stylesheet")&&T.namespaceURI!=="http://www.w3.org/2000/svg"){var R=T.getAttribute(a)||"";R=s+R;var B=h.get(R);B?B.push(T):h.set(R,[T])}}return h}function GT(s,a,u){s=s.ownerDocument||s,s.head.insertBefore(u,a==="title"?s.querySelector("head > title"):null)}function _O(s,a,u){if(u===1||a.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;switch(a.rel){case"stylesheet":return s=a.disabled,typeof a.precedence=="string"&&s==null;default:return!0}case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function XT(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function NO(s,a,u,h){if(u.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var x=Qo(h.href),T=a.querySelector(pu(x));if(T){a=T._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(s.count++,s=Vf.bind(s),a.then(s,s)),u.state.loading|=4,u.instance=T,Pn(T);return}T=a.ownerDocument||a,h=$T(h),(x=Qr.get(x))&&g0(h,x),T=T.createElement("link"),Pn(T);var R=T;R._p=new Promise(function(B,ne){R.onload=B,R.onerror=ne}),Gn(T,"link",h),u.instance=T}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(u,a),(a=u.state.preload)&&(u.state.loading&3)===0&&(s.count++,u=Vf.bind(s),a.addEventListener("load",u),a.addEventListener("error",u))}}var x0=0;function RO(s,a){return s.stylesheets&&s.count===0&&qf(s,s.stylesheets),0<s.count||0<s.imgCount?function(u){var h=setTimeout(function(){if(s.stylesheets&&qf(s,s.stylesheets),s.unsuspend){var T=s.unsuspend;s.unsuspend=null,T()}},6e4+a);0<s.imgBytes&&x0===0&&(x0=62500*cO());var x=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&qf(s,s.stylesheets),s.unsuspend)){var T=s.unsuspend;s.unsuspend=null,T()}},(s.imgBytes>x0?50:800)+a);return s.unsuspend=u,function(){s.unsuspend=null,clearTimeout(h),clearTimeout(x)}}:null}function Vf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)qf(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var $f=null;function qf(s,a){s.stylesheets=null,s.unsuspend!==null&&(s.count++,$f=new Map,a.forEach(OO,s),$f=null,Vf.call(s))}function OO(s,a){if(!(a.state.loading&4)){var u=$f.get(s);if(u)var h=u.get(null);else{u=new Map,$f.set(s,u);for(var x=s.querySelectorAll("link[data-precedence],style[data-precedence]"),T=0;T<x.length;T++){var R=x[T];(R.nodeName==="LINK"||R.getAttribute("media")!=="not all")&&(u.set(R.dataset.precedence,R),h=R)}h&&u.set(null,h)}x=a.instance,R=x.getAttribute("data-precedence"),T=u.get(R)||h,T===h&&u.set(null,x),u.set(R,x),this.count++,h=Vf.bind(this),x.addEventListener("load",h),x.addEventListener("error",h),T?T.parentNode.insertBefore(x,T.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(x,s.firstChild)),a.state.loading|=4}}var gu={$$typeof:_,Provider:null,Consumer:null,_currentValue:te,_currentValue2:te,_threadCount:0};function IO(s,a,u,h,x,T,R,B,ne){this.tag=1,this.containerInfo=s,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Fn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Fn(0),this.hiddenUpdates=Fn(null),this.identifierPrefix=h,this.onUncaughtError=x,this.onCaughtError=T,this.onRecoverableError=R,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ne,this.incompleteTransitions=new Map}function KT(s,a,u,h,x,T,R,B,ne,be,Se,_e){return s=new IO(s,a,u,R,ne,be,Se,_e,B),a=1,T===!0&&(a|=24),T=_r(3,null,null,a),s.current=T,T.stateNode=s,a=Wp(),a.refCount++,s.pooledCache=a,a.refCount++,T.memoizedState={element:h,isDehydrated:u,cache:a},tm(T),s}function QT(s){return s?(s=_o,s):_o}function WT(s,a,u,h,x,T){x=QT(x),h.context===null?h.context=x:h.pendingContext=x,h=Ti(a),h.payload={element:u},T=T===void 0?null:T,T!==null&&(h.callback=T),u=vi(s,h,a),u!==null&&(yr(u,s,a),Xl(u,s,a))}function ZT(s,a){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var u=s.retryLane;s.retryLane=u!==0&&u<a?u:a}}function y0(s,a){ZT(s,a),(s=s.alternate)&&ZT(s,a)}function JT(s){if(s.tag===13||s.tag===31){var a=xa(s,67108864);a!==null&&yr(a,s,67108864),y0(s,67108864)}}function ev(s){if(s.tag===13||s.tag===31){var a=Lr();a=ft(a);var u=xa(s,a);u!==null&&yr(u,s,a),y0(s,a)}}var Yf=!0;function LO(s,a,u,h){var x=H.T;H.T=null;var T=K.p;try{K.p=2,E0(s,a,u,h)}finally{K.p=T,H.T=x}}function MO(s,a,u,h){var x=H.T;H.T=null;var T=K.p;try{K.p=8,E0(s,a,u,h)}finally{K.p=T,H.T=x}}function E0(s,a,u,h){if(Yf){var x=T0(h);if(x===null)a0(s,a,h,Gf,u),nv(s,h);else if(PO(x,s,a,u,h))h.stopPropagation();else if(nv(s,h),a&4&&-1<DO.indexOf(s)){for(;x!==null;){var T=bo(x);if(T!==null)switch(T.tag){case 3:if(T=T.stateNode,T.current.memoizedState.isDehydrated){var R=Zt(T.pendingLanes);if(R!==0){var B=T;for(B.pendingLanes|=2,B.entangledLanes|=2;R;){var ne=1<<31-Fe(R);B.entanglements[1]|=ne,R&=~ne}bs(T),(zt&6)===0&&(Nf=se()+500,cu(0))}}break;case 31:case 13:B=xa(T,2),B!==null&&yr(B,T,2),Of(),y0(T,2)}if(T=T0(h),T===null&&a0(s,a,h,Gf,u),T===x)break;x=T}x!==null&&h.stopPropagation()}else a0(s,a,h,null,u)}}function T0(s){return s=Sp(s),v0(s)}var Gf=null;function v0(s){if(Gf=null,s=go(s),s!==null){var a=o(s);if(a===null)s=null;else{var u=a.tag;if(u===13){if(s=l(a),s!==null)return s;s=null}else if(u===31){if(s=c(a),s!==null)return s;s=null}else if(u===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;s=null}else a!==s&&(s=null)}}return Gf=s,null}function tv(s){switch(s){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(re()){case V:return 2;case z:return 8;case ue:case ke:return 32;case Re:return 268435456;default:return 32}default:return 32}}var S0=!1,Li=null,Mi=null,Di=null,bu=new Map,xu=new Map,Pi=[],DO="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function nv(s,a){switch(s){case"focusin":case"focusout":Li=null;break;case"dragenter":case"dragleave":Mi=null;break;case"mouseover":case"mouseout":Di=null;break;case"pointerover":case"pointerout":bu.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":xu.delete(a.pointerId)}}function yu(s,a,u,h,x,T){return s===null||s.nativeEvent!==T?(s={blockedOn:a,domEventName:u,eventSystemFlags:h,nativeEvent:T,targetContainers:[x]},a!==null&&(a=bo(a),a!==null&&JT(a)),s):(s.eventSystemFlags|=h,a=s.targetContainers,x!==null&&a.indexOf(x)===-1&&a.push(x),s)}function PO(s,a,u,h,x){switch(a){case"focusin":return Li=yu(Li,s,a,u,h,x),!0;case"dragenter":return Mi=yu(Mi,s,a,u,h,x),!0;case"mouseover":return Di=yu(Di,s,a,u,h,x),!0;case"pointerover":var T=x.pointerId;return bu.set(T,yu(bu.get(T)||null,s,a,u,h,x)),!0;case"gotpointercapture":return T=x.pointerId,xu.set(T,yu(xu.get(T)||null,s,a,u,h,x)),!0}return!1}function rv(s){var a=go(s.target);if(a!==null){var u=o(a);if(u!==null){if(a=u.tag,a===13){if(a=l(u),a!==null){s.blockedOn=a,Dn(s.priority,function(){ev(u)});return}}else if(a===31){if(a=c(u),a!==null){s.blockedOn=a,Dn(s.priority,function(){ev(u)});return}}else if(a===3&&u.stateNode.current.memoizedState.isDehydrated){s.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}s.blockedOn=null}function Xf(s){if(s.blockedOn!==null)return!1;for(var a=s.targetContainers;0<a.length;){var u=T0(s.nativeEvent);if(u===null){u=s.nativeEvent;var h=new u.constructor(u.type,u);vp=h,u.target.dispatchEvent(h),vp=null}else return a=bo(u),a!==null&&JT(a),s.blockedOn=u,!1;a.shift()}return!0}function sv(s,a,u){Xf(s)&&u.delete(a)}function jO(){S0=!1,Li!==null&&Xf(Li)&&(Li=null),Mi!==null&&Xf(Mi)&&(Mi=null),Di!==null&&Xf(Di)&&(Di=null),bu.forEach(sv),xu.forEach(sv)}function Kf(s,a){s.blockedOn===a&&(s.blockedOn=null,S0||(S0=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,jO)))}var Qf=null;function iv(s){Qf!==s&&(Qf=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Qf===s&&(Qf=null);for(var a=0;a<s.length;a+=3){var u=s[a],h=s[a+1],x=s[a+2];if(typeof h!="function"){if(v0(h||u)===null)continue;break}var T=bo(u);T!==null&&(s.splice(a,3),a-=3,Tm(T,{pending:!0,data:x,method:u.method,action:h},h,x))}}))}function Zo(s){function a(ne){return Kf(ne,s)}Li!==null&&Kf(Li,s),Mi!==null&&Kf(Mi,s),Di!==null&&Kf(Di,s),bu.forEach(a),xu.forEach(a);for(var u=0;u<Pi.length;u++){var h=Pi[u];h.blockedOn===s&&(h.blockedOn=null)}for(;0<Pi.length&&(u=Pi[0],u.blockedOn===null);)rv(u),u.blockedOn===null&&Pi.shift();if(u=(s.ownerDocument||s).$$reactFormReplay,u!=null)for(h=0;h<u.length;h+=3){var x=u[h],T=u[h+1],R=x[Vn]||null;if(typeof T=="function")R||iv(u);else if(R){var B=null;if(T&&T.hasAttribute("formAction")){if(x=T,R=T[Vn]||null)B=R.formAction;else if(v0(x)!==null)continue}else B=R.action;typeof B=="function"?u[h+1]=B:(u.splice(h,3),h-=3),iv(u)}}}function av(){function s(T){T.canIntercept&&T.info==="react-transition"&&T.intercept({handler:function(){return new Promise(function(R){return x=R})},focusReset:"manual",scroll:"manual"})}function a(){x!==null&&(x(),x=null),h||setTimeout(u,20)}function u(){if(!h&&!navigation.transition){var T=navigation.currentEntry;T&&T.url!=null&&navigation.navigate(T.url,{state:T.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var h=!1,x=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(u,100),function(){h=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),x!==null&&(x(),x=null)}}}function C0(s){this._internalRoot=s}Wf.prototype.render=C0.prototype.render=function(s){var a=this._internalRoot;if(a===null)throw Error(r(409));var u=a.current,h=Lr();WT(u,h,s,a,null,null)},Wf.prototype.unmount=C0.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var a=s.containerInfo;WT(s.current,2,null,s,null,null),Of(),a[hs]=null}};function Wf(s){this._internalRoot=s}Wf.prototype.unstable_scheduleHydration=function(s){if(s){var a=pn();s={blockedOn:null,target:s,priority:a};for(var u=0;u<Pi.length&&a!==0&&a<Pi[u].priority;u++);Pi.splice(u,0,s),u===0&&rv(s)}};var ov=t.version;if(ov!=="19.2.7")throw Error(r(527,ov,"19.2.7"));K.findDOMNode=function(s){var a=s._reactInternals;if(a===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=d(a),s=s!==null?m(s):null,s=s===null?null:s.stateNode,s};var BO={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Zf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Zf.isDisabled&&Zf.supportsFiber)try{et=Zf.inject(BO),ot=Zf}catch{}}return Tu.createRoot=function(s,a){if(!i(s))throw Error(r(299));var u=!1,h="",x=pE,T=mE,R=gE;return a!=null&&(a.unstable_strictMode===!0&&(u=!0),a.identifierPrefix!==void 0&&(h=a.identifierPrefix),a.onUncaughtError!==void 0&&(x=a.onUncaughtError),a.onCaughtError!==void 0&&(T=a.onCaughtError),a.onRecoverableError!==void 0&&(R=a.onRecoverableError)),a=KT(s,1,!1,null,null,u,h,null,x,T,R,av),s[hs]=a.current,i0(s),new C0(a)},Tu.hydrateRoot=function(s,a,u){if(!i(s))throw Error(r(299));var h=!1,x="",T=pE,R=mE,B=gE,ne=null;return u!=null&&(u.unstable_strictMode===!0&&(h=!0),u.identifierPrefix!==void 0&&(x=u.identifierPrefix),u.onUncaughtError!==void 0&&(T=u.onUncaughtError),u.onCaughtError!==void 0&&(R=u.onCaughtError),u.onRecoverableError!==void 0&&(B=u.onRecoverableError),u.formState!==void 0&&(ne=u.formState)),a=KT(s,1,!0,a,u??null,h,x,ne,T,R,B,av),a.context=QT(null),u=a.current,h=Lr(),h=ft(h),x=Ti(h),x.callback=null,vi(u,x,h),u=h,a.current.lanes=u,bt(a,u),bs(a),s[hs]=a.current,i0(s),new Wf(a)},Tu.version="19.2.7",Tu}var bv;function KO(){if(bv)return A0.exports;bv=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),A0.exports=XO(),A0.exports}var QO=KO();const ow="workerdeck.theme";function Hb(){try{const e=localStorage.getItem(ow);if(e==="light"||e==="dark")return e}catch{}return matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function lw(e=Hb()){document.documentElement.setAttribute("data-theme",e)}function WO(e){try{localStorage.setItem(ow,e)}catch{}lw(e)}function ZO(){const e=Hb()==="dark"?"light":"dark";return WO(e),e}var ju=typeof window<"u"?S.useLayoutEffect:S.useEffect;function O0(e){const t=S.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function JO(e,t,n={},r={}){S.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const i=new IntersectionObserver(([o])=>{t(o)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function e4(e){const t=S.useRef(null);return S.useImperativeHandle(e,()=>t.current,[]),t}const uw=!1;function ic(e){return e[e.length-1]}function t4(e){return typeof e=="function"}function za(e,t){return t4(e)?e(t):e}const cw=Object.prototype.hasOwnProperty,xv=Object.prototype.propertyIsEnumerable;function fw(e){for(const t in e)if(cw.call(e,t))return!0;return!1}const n4=()=>Object.create(null),Oa=(e,t)=>Fa(e,t,n4);function Fa(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const i=t,o=Tv(e)&&Tv(i);if(!o&&!(Xd(e)&&Xd(i)))return i;const l=o?e:yv(e);if(!l)return i;const c=o?i:yv(i);if(!c)return i;const f=l.length,d=c.length,m=o?new Array(d):n();let p=0;for(let b=0;b<d;b++){const y=o?b:c[b],E=e[y],w=i[y];if(E===w){m[y]=E,(o?b<f:cw.call(e,y))&&p++;continue}if(E===null||w===null||typeof E!="object"||typeof w!="object"){m[y]=w;continue}const k=Fa(E,w,n,r+1);m[y]=k,k===E&&p++}return f===d&&p===f?e:m}function yv(e){const t=Object.getOwnPropertyNames(e);for(const i of t)if(!xv.call(e,i))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const r=t;for(const i of n){if(!xv.call(e,i))return!1;r.push(i)}return r}function Xd(e){if(!Ev(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!Ev(n)||!n.hasOwnProperty("isPrototypeOf"))}function Ev(e){return Object.prototype.toString.call(e)==="[object Object]"}function Tv(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ya(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!Ya(e[r],t[r],n))return!1;return!0}if(Xd(e)&&Xd(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const l in t)if((!r||t[l]!==void 0)&&!Ya(e[l],t[l],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(const l in e)e[l]!==void 0&&i++;let o=0;for(const l in t)if((!r||t[l]!==void 0)&&(o++,o>i||!Ya(e[l],t[l],n)))return!1;return i===o}return!1}function fl(e){let t,n;const r=new Promise((i,o)=>{t=i,n=o});return r.status="pending",r.resolve=i=>{r.status="resolved",r.value=i,t(i),e?.(i)},r.reject=i=>{r.status="rejected",n(i)},r}function ac(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}const r4=/[\x00-\x1f\x7f"<>`{}]/g;function s4(e){return e.replace(r4,t=>"%"+t.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0"))}function vv(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return s4(t)}const i4=["http:","https:","mailto:","tel:"];function Kd(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function vu(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let n=0,r="",i;for(;(i=t.exec(e))!==null;)r+=vv(e.slice(n,i.index))+i[0],n=t.lastIndex;r=r+vv(n?e.slice(n):e);let o=!1;return r.startsWith("//")&&(o=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:o}}function a4(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function o4(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function ii(){throw new Error("Invariant failed")}function oc(e){const t=new Map;let n,r;const i=o=>{o.next&&(o.prev?(o.prev.next=o.next,o.next.prev=o.prev,o.next=void 0,r&&(r.next=o,o.prev=r)):(o.next.prev=void 0,n=o.next,o.next=void 0,r&&(o.prev=r,r.next=o)),r=o)};return{get(o){const l=t.get(o);if(l)return i(l),l.value},set(o,l){if(t.size>=e&&n){const f=n;t.delete(f.key),f.next&&(n=f.next,f.next.prev=void 0),f===r&&(r=void 0)}const c=t.get(o);if(c)c.value=l,i(c);else{const f={key:o,value:l,prev:r};r&&(r.next=f),r=f,n||(n=f),t.set(o,f)}},clear(){t.clear(),n=void 0,r=void 0}}}const Gi=4,dw=5;function l4(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function hw(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),i=r===-1?e.length:r,o=e.substring(t,i);if(!o||!o.includes("$"))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(o==="$"){const c=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=c,n[4]=c,n[5]=c,n}if(o.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;const l=l4(o);if(l){const[c,f]=l,d=o.charCodeAt(c+1);if(d===45){if(c+2<o.length&&o.charCodeAt(c+2)===36){const m=c+3,p=f;if(m<p)return n[0]=3,n[1]=t+c,n[2]=t+m,n[3]=t+p,n[4]=t+f+1,n[5]=i,n}}else if(d===36){const m=c+1,p=c+2;return p===f?(n[0]=2,n[1]=t+c,n[2]=t+m,n[3]=t+p,n[4]=t+f+1,n[5]=e.length,n):(n[0]=1,n[1]=t+c,n[2]=t+p,n[3]=t+f,n[4]=t+f+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function _h(e,t,n,r,i,o,l){l?.(n);let c=r;{const f=n.fullPath??n.from,d=f.length,m=n.options?.caseSensitive??e,p=n.options?.params?.parse??n.options?.parseParams;for(;c<d;){const y=hw(f,c,t);let E;const w=c,k=y[5];switch(c=k+1,o++,y[0]){case 0:{const C=f.substring(y[2],y[3]);if(m){const A=i.static?.get(C);if(A)E=A;else{i.static??=new Map;const _=Va(n.fullPath??n.from);_.parent=i,_.depth=o,E=_,i.static.set(C,_)}}else{const A=C.toLowerCase(),_=i.staticInsensitive?.get(A);if(_)E=_;else{i.staticInsensitive??=new Map;const N=Va(n.fullPath??n.from);N.parent=i,N.depth=o,E=N,i.staticInsensitive.set(A,N)}}break}case 1:{const C=f.substring(w,y[1]),A=f.substring(y[4],k),_=m&&!!(C||A),N=C?_?C:C.toLowerCase():void 0,D=A?_?A:A.toLowerCase():void 0,O=!p&&i.dynamic?.find(j=>!j.parse&&j.caseSensitive===_&&j.prefix===N&&j.suffix===D);if(O)E=O;else{const j=L0(1,n.fullPath??n.from,_,N,D);E=j,j.depth=o,j.parent=i,i.dynamic??=[],i.dynamic.push(j)}break}case 3:{const C=f.substring(w,y[1]),A=f.substring(y[4],k),_=m&&!!(C||A),N=C?_?C:C.toLowerCase():void 0,D=A?_?A:A.toLowerCase():void 0,O=!p&&i.optional?.find(j=>!j.parse&&j.caseSensitive===_&&j.prefix===N&&j.suffix===D);if(O)E=O;else{const j=L0(3,n.fullPath??n.from,_,N,D);E=j,j.parent=i,j.depth=o,i.optional??=[],i.optional.push(j)}break}case 2:{const C=f.substring(w,y[1]),A=f.substring(y[4],k),_=m&&!!(C||A),N=C?_?C:C.toLowerCase():void 0,D=A?_?A:A.toLowerCase():void 0,O=L0(2,n.fullPath??n.from,_,N,D);E=O,O.parent=i,O.depth=o,i.wildcard??=[],i.wildcard.push(O)}}i=E}if(p&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const y=Va(n.fullPath??n.from);y.kind=dw,y.parent=i,o++,y.depth=o,i.pathless??=[],i.pathless.push(y),i=y}const b=(n.path||!n.children)&&!n.isRoot;if(b&&f.endsWith("/")){const y=Va(n.fullPath??n.from);y.kind=Gi,y.parent=i,o++,y.depth=o,i.index=y,i=y}i.parse=p??null,i.priority=n.options?.params?.priority??0,b&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(const f of n.children)_h(e,t,f,c,i,o,l)}function I0(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function qi(e){if(e.pathless)for(const t of e.pathless)qi(t);if(e.static)for(const t of e.static.values())qi(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())qi(t);if(e.dynamic?.length){e.dynamic.sort(I0);for(const t of e.dynamic)qi(t)}if(e.optional?.length){e.optional.sort(I0);for(const t of e.optional)qi(t)}if(e.wildcard?.length){e.wildcard.sort(I0);for(const t of e.wildcard)qi(t)}}function Va(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function L0(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function u4(e,t){const n=Va("/"),r=new Uint16Array(6);for(const i of e)_h(!1,r,i,1,n,0);qi(n),t.masksTree=n,t.flatCache=oc(1e3)}function c4(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=Ub(e,t.masksTree);return t.flatCache.set(e,r),r}function f4(e,t,n,r,i){e||="/",r||="/";const o=t?`case\0${e}`:e;let l=i.singleCache.get(o);return l||(l=Va("/"),_h(t,new Uint16Array(6),{from:e},1,l,0),i.singleCache.set(o,l)),Ub(r,l,n)}function d4(e,t,n=!1){const r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||="/";let o;try{o=Ub(e,t.segmentTree,n)}catch(l){if(l instanceof URIError)o=null;else throw l}return o&&(o.branch=mw(o.route)),t.matchCache.set(r,o),o}function h4(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function p4(e,t=!1,n){const r=Va(e.fullPath),i=new Uint16Array(6),o={},l={};let c=0;return _h(t,i,e,1,r,0,f=>{if(n?.(f,c),f.id in o&&ii(),o[f.id]=f,c!==0&&f.path){const d=h4(f.fullPath);(!l[d]||f.fullPath.endsWith("/"))&&(l[d]=f)}c++}),qi(r),{processedTree:{segmentTree:r,singleCache:oc(1e3),matchCache:oc(1e3),flatCache:null,masksTree:null},routesById:o,routesByPath:l}}function Ub(e,t,n=!1){const r=e.split("/"),i=g4(e,r,t,n);if(!i)return null;const[o]=pw(e,r,i);return{route:i.node.route,rawParams:o}}function pw(e,t,n){const r=m4(n.node);let i=null;const o=Object.create(null);let l=n.extract?.part??0,c=n.extract?.node??0,f=n.extract?.path??0,d=n.extract?.segment??0;for(;c<r.length;l++,c++,f++,d++){const m=r[c];if(m.kind===Gi)break;if(m.kind===dw){d--,l--,f--;continue}const p=t[l],b=f;if(p&&(f+=p.length),m.kind===1){i??=n.node.fullPath.split("/");const y=i[d],E=m.prefix?.length??0;if(y.charCodeAt(E)===123){const w=m.suffix?.length??0,k=y.substring(E+2,y.length-w-1),C=p.substring(E,p.length-w);o[k]=decodeURIComponent(C)}else{const w=y.substring(1);o[w]=decodeURIComponent(p)}}else if(m.kind===3){if(n.skipped&1<<c){l--,f=b-1;continue}i??=n.node.fullPath.split("/");const y=i[d],E=m.prefix?.length??0,w=m.suffix?.length??0,k=y.substring(E+3,y.length-w-1),C=m.suffix||m.prefix?p.substring(E,p.length-w):p;C&&(o[k]=decodeURIComponent(C))}else if(m.kind===2){const y=m,E=e.substring(b+(y.prefix?.length??0),e.length-(y.suffix?.length??0)),w=decodeURIComponent(E);o["*"]=w,o._splat=w;break}}return n.rawParams&&Object.assign(o,n.rawParams),[o,{part:l,node:c,path:f,segment:d}]}function mw(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function m4(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function g4(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const i=!ic(t),o=i&&e!=="/",l=t.length-(i?1:0),c=[{node:n,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}];let f=null,d=null;for(;c.length;){const m=c.pop(),{node:p,index:b,skipped:y,depth:E,statics:w,dynamics:k,optionals:C}=m;let{extract:A,rawParams:_}=m;if(p.kind===2&&p.route&&!ed(d,m))continue;if(p.parse){if(!Sv(e,t,m))continue;_=m.rawParams,A=m.extract}r&&p.route&&p.kind!==Gi&&ed(f,m)&&(f=m);const N=b===l;if(N&&(p.route&&(!o||p.kind===Gi||p.kind===2)&&ed(d,m)&&(d=m),!p.optional&&!p.wildcard&&!p.index&&!p.pathless))continue;const D=N?void 0:t[b];let O;if(N&&p.index){const j={node:p.index,index:b,skipped:y,depth:E+1,statics:w,dynamics:k,optionals:C,extract:A,rawParams:_};let M=!0;if(p.index.parse&&(Sv(e,t,j)||(M=!1)),M){if(!k&&!C&&!y&&b4(w,l))return j;ed(d,j)&&(d=j)}}if(p.wildcard)for(let j=p.wildcard.length-1;j>=0;j--){const M=p.wildcard[j],{prefix:q,suffix:U}=M;if(!(q&&(N||!(M.caseSensitive?D:O??=D.toLowerCase()).startsWith(q)))){if(U){if(N)continue;const Q=t.slice(b).join("/").slice(-U.length);if((M.caseSensitive?Q:Q.toLowerCase())!==U)continue}c.push({node:M,index:l,skipped:y,depth:E+1,statics:w,dynamics:k,optionals:C,extract:A,rawParams:_})}}if(p.optional){const j=y|1<<E,M=E+1;for(let q=p.optional.length-1;q>=0;q--){const U=p.optional[q];c.push({node:U,index:b,skipped:j,depth:M,statics:w,dynamics:k,optionals:C,extract:A,rawParams:_})}if(!N)for(let q=p.optional.length-1;q>=0;q--){const U=p.optional[q],{prefix:Q,suffix:Z}=U;if(Q||Z){const G=U.caseSensitive?D:O??=D.toLowerCase();if(Q&&!G.startsWith(Q)||Z&&!G.endsWith(Z))continue}c.push({node:U,index:b+1,skipped:y,depth:M,statics:w,dynamics:k,optionals:C+Jf(l,b),extract:A,rawParams:_})}}if(!N&&p.dynamic&&D)for(let j=p.dynamic.length-1;j>=0;j--){const M=p.dynamic[j],{prefix:q,suffix:U}=M;if(q||U){const Q=M.caseSensitive?D:O??=D.toLowerCase();if(q&&!Q.startsWith(q)||U&&!Q.endsWith(U))continue}c.push({node:M,index:b+1,skipped:y,depth:E+1,statics:w,dynamics:k+Jf(l,b),optionals:C,extract:A,rawParams:_})}if(!N&&p.staticInsensitive){const j=p.staticInsensitive.get(O??=D.toLowerCase());j&&c.push({node:j,index:b+1,skipped:y,depth:E+1,statics:w+Jf(l,b),dynamics:k,optionals:C,extract:A,rawParams:_})}if(!N&&p.static){const j=p.static.get(D);j&&c.push({node:j,index:b+1,skipped:y,depth:E+1,statics:w+Jf(l,b),dynamics:k,optionals:C,extract:A,rawParams:_})}if(p.pathless){const j=E+1;for(let M=p.pathless.length-1;M>=0;M--){const q=p.pathless[M];c.push({node:q,index:b,skipped:y,depth:j,statics:w,dynamics:k,optionals:C,extract:A,rawParams:_})}}}if(d)return d;if(r&&f){let m=f.index;for(let b=0;b<f.index;b++)m+=t[b].length;const p=m===e.length?"/":e.slice(m);return f.rawParams??=Object.create(null),f.rawParams["**"]=decodeURIComponent(p),f}return null}function Jf(e,t){return 2**(e-t-1)}function b4(e,t){return e===2**(t-1)-1}function Sv(e,t,n){let r,i;try{[r,i]=pw(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function ed(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Gi)>(e.node.kind===Gi)||t.node.kind===Gi==(e.node.kind===Gi)&&t.depth>e.depth))):!0}function Ld(e){return zb(e.filter(t=>t!==void 0).join("/"))}function zb(e){return e.replace(/\/{2,}/g,"/")}function gw(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function si(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function bw(e){return si(gw(e))}function Qd(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function x4(e,t,n){return Qd(e,n)===Qd(t,n)}function y4({base:e,to:t,trailingSlash:n="never",cache:r}){const i=t.startsWith("/"),o=!i&&t===".";let l;if(r){l=i?t:o?e:e+"\0"+t;const d=r.get(l);if(d)return d}let c;if(o)c=e.split("/");else if(i)c=t.split("/");else{for(c=e.split("/");c.length>1&&ic(c)==="";)c.pop();const d=t.split("/");for(let m=0,p=d.length;m<p;m++){const b=d[m];b===""?m?m===p-1&&c.push(b):c=[b]:b===".."?c.pop():b==="."||c.push(b)}}c.length>1&&(ic(c)===""?n==="never"&&c.pop():n==="always"&&c.push(""));const f=zb(c.join("/"))||"/";return l&&r&&r.set(l,f),f}function E4(e){const t=new Map(e.map(i=>[encodeURIComponent(i),i])),n=Array.from(t.keys()).map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return i=>i.replace(r,o=>t.get(o)??o)}function M0(e,t,n){const r=t[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(i=>wv(i,n)).join("/"):wv(r,n)}function Cv({path:e,params:t,decoder:n,...r}){let i=!1;const o=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:o,isMissingParams:i};if(!e.includes("$"))return{interpolatedPath:e,usedParams:o,isMissingParams:i};const l=e.length;let c=0,f,d="";for(;c<l;){const m=c;f=hw(e,m,f);const p=f[5];if(c=p+1,m===p)continue;const b=f[0];if(b===0){d+="/"+e.substring(m,p);continue}if(b===2){const y=t._splat;o._splat=y,o["*"]=y;const E=e.substring(m,f[1]),w=e.substring(f[4],p);if(!y){i=!0,(E||w)&&(d+="/"+E+w);continue}const k=M0("_splat",t,n);d+="/"+E+k+w;continue}if(b===1){const y=e.substring(f[2],f[3]);!i&&!(y in t)&&(i=!0),o[y]=t[y];const E=e.substring(m,f[1]),w=e.substring(f[4],p),k=M0(y,t,n)??"undefined";d+="/"+E+k+w;continue}if(b===3){const y=e.substring(f[2],f[3]),E=t[y];if(E==null)continue;o[y]=E;const w=e.substring(m,f[1]),k=e.substring(f[4],p),C=M0(y,t,n)??"";d+="/"+w+C+k;continue}}return e.endsWith("/")&&(d+="/"),{usedParams:o,interpolatedPath:d||"/",isMissingParams:i}}function wv(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function er(e){return e?.isNotFound===!0}function T4(){try{return sessionStorage}catch{return}}const v4="tsr-scroll-restoration-v1_3",xw=T4();function S4(){try{return JSON.parse(xw?.getItem("tsr-scroll-restoration-v1_3")||"{}")}catch{return{}}}function C4(){try{xw?.setItem(v4,JSON.stringify(tl))}catch{}}const tl=S4(),kv="data-scroll-restoration-id",w4=e=>e.state.__TSR_key||e.href;function k4(e){const t=e.getAttribute(kv);if(t)return`[${kv}="${t}"]`;let n="",r=e,i;for(;i=r.parentNode;){let o=1,l=r;for(;l=l.previousElementSibling;)o++;const c=`${r.localName}:nth-child(${o})`;n=n?`${c} > ${n}`:c,r=i}return n}let td=!1;const Md="window";function Pg(e){try{return typeof e=="function"?e():document.querySelector(e)}catch{}}function Av(e){const t=new Set;for(const n of e){if(n===Md)continue;const r=Pg(n);r&&t.add(r)}return t}function A4(e,t){const n=e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);const i=e.options.getScrollRestorationKey||w4,o=new Set,l=c=>{const f=tl[c]||={};for(const d of o)d===document?f[Md]={scrollX,scrollY}:d.isConnected&&(f[k4(d)]={scrollX:d.scrollLeft,scrollY:d.scrollTop})};n&&!r.restoration&&(r.restoration=!0,td=!1,history.scrollRestoration="manual",document.addEventListener("scroll",c=>{td||o.add(c.target)},!0),e.subscribe("onBeforeLoad",c=>{c.fromLocation&&l(i(c.fromLocation)),o.clear()}),addEventListener("pagehide",()=>{l(i(e.stores.resolvedLocation.get()??e.stores.location.get())),C4()})),!r.reset&&(r.reset=!0,e.subscribe("onRendered",c=>{const f=e.options.scrollRestorationBehavior,d=e.options.scrollToTopSelectors,m=r.next,p=r.hash;let b;if(o.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return;const y=i(c.toLocation),E=c.fromLocation&&i(c.fromLocation);if(r.restoring&&E&&E!==y){const w=tl[E];if(w){let k=tl[y];for(const C in w){if(C===Md){if(m)continue}else{const A=Pg(C);if(!A||m&&d&&(b??=Av(d),b.has(A)))continue}k||(k=tl[y]={}),k[C]??=w[C]}}}td=!0;try{const w=c.toLocation.hash,k=c.toLocation.state.__hashScrollIntoViewOptions??!0;let C=!1;if(m){!w&&d&&(b??=Av(d));const A=w&&k&&p,_=r.restoring?tl[y]:void 0;if(_)for(const N in _){const{scrollX:D,scrollY:O}=_[N];if(N===Md){if(A)continue;scrollTo({top:O,left:D,behavior:f}),C=!0}else{const j=Pg(N);j&&(j.scrollLeft=D,j.scrollTop=O,b?.delete(j))}}if(!w){const N={top:0,left:0,behavior:f};if(C||scrollTo(N),b)for(const D of b)D.scrollTo(N)}}!C&&w&&k&&document.getElementById(w)?.scrollIntoView(k)}finally{td=!1}}))}function _4(e,t=String){const n=new URLSearchParams;for(const r in e){const i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function D0(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function N4(e){const t=new URLSearchParams(e),n=Object.create(null);for(const[r,i]of t.entries()){const o=n[r];o==null?n[r]=D0(i):Array.isArray(o)?o.push(D0(i)):n[r]=[o,D0(i)]}return n}const R4=I4(JSON.parse),O4=L4(JSON.stringify,JSON.parse);function I4(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=N4(t);for(const r in n){const i=n[r];if(typeof i=="string")try{n[r]=e(i)}catch{}}return n}}function L4(e,t){const n=typeof t=="function";function r(i){if(typeof i=="object"&&i!==null)try{return e(i)}catch{}else if(n&&typeof i=="string")try{return t(i),e(i)}catch{}return i}return i=>{const o=_4(i,r);return o?`?${o}`:""}}const Ga="__root__";function yw(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function wr(e){return e instanceof Response&&!!e.options}function M4(e){return{input:({url:t})=>{for(const n of e)t=jg(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Ew(e[n],t);return t}}}function D4(e){const t=bw(e.basepath),n=`/${t}`,r=e.caseSensitive?n:n.toLowerCase(),i=`${r}/`;return{input:({url:o})=>{const l=e.caseSensitive?o.pathname:o.pathname.toLowerCase();return l===r?o.pathname="/":l.startsWith(i)&&(o.pathname=o.pathname.slice(n.length)),o},output:({url:o})=>(o.pathname=Ld(["/",t,o.pathname]),o)}}function jg(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function Ew(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function P4(e,t){const{createMutableStore:n,createReadonlyStore:r,batch:i,init:o}=t,l=new Map,c=new Map,f=new Map,d=n(e.status),m=n(e.loadedAt),p=n(e.isLoading),b=n(e.isTransitioning),y=n(e.location),E=n(e.resolvedLocation),w=n(e.statusCode),k=n(e.redirect),C=n([]),A=n([]),_=n([]),N=r(()=>P0(l,C.get())),D=r(()=>P0(c,A.get())),O=r(()=>P0(f,_.get())),j=r(()=>C.get()[0]),M=r(()=>C.get().some(K=>l.get(K)?.get().status==="pending")),q=r(()=>({locationHref:y.get().href,resolvedLocationHref:E.get()?.href,status:d.get()})),U=r(()=>({status:d.get(),loadedAt:m.get(),isLoading:p.get(),isTransitioning:b.get(),matches:N.get(),location:y.get(),resolvedLocation:E.get(),statusCode:w.get(),redirect:k.get()})),Q=oc(64);function Z(K){let te=Q.get(K);return te||(te=r(()=>{const le=C.get();for(const I of le){const P=l.get(I);if(P&&P.routeId===K)return P.get()}}),Q.set(K,te)),te}const G={status:d,loadedAt:m,isLoading:p,isTransitioning:b,location:y,resolvedLocation:E,statusCode:w,redirect:k,matchesId:C,pendingIds:A,cachedIds:_,matches:N,pendingMatches:D,cachedMatches:O,firstId:j,hasPending:M,matchRouteDeps:q,matchStores:l,pendingMatchStores:c,cachedMatchStores:f,__store:U,getRouteMatchStore:Z,setMatches:ee,setPending:Y,setCached:H};ee(e.matches),o?.(G);function ee(K){j0(K,l,C,n,i)}function Y(K){j0(K,c,A,n,i)}function H(K){j0(K,f,_,n,i)}return G}function P0(e,t){const n=[];for(const r of t){const i=e.get(r);i&&n.push(i.get())}return n}function j0(e,t,n,r,i){const o=e.map(c=>c.id),l=new Set(o);i(()=>{for(const c of t.keys())l.has(c)||t.delete(c);for(const c of e){const f=t.get(c.id);if(!f){const d=r(c);d.routeId=c.routeId,t.set(c.id,d);continue}f.routeId=c.routeId,f.get()!==c&&f.set(c)}o4(n.get(),o)||n.set(o)})}const Bg=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},j4=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),Nh=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),Xa=(e,t,n=!0)=>{const r={...e.router.options.context??{}},i=n?t:t-1;for(let o=0;o<=i;o++){const l=e.matches[o];if(!l)continue;const c=e.router.getMatch(l.id);c&&Object.assign(r,c.__routeContext,c.__beforeLoadContext)}return r},_v=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,r=e.matches.findIndex(l=>l.routeId===e.router.routeTree.id),i=r>=0?r:0;let o=n?e.matches.findIndex(l=>l.routeId===n):e.firstBadMatchIndex??e.matches.length-1;o<0&&(o=i);for(let l=o;l>=0;l--){const c=e.matches[l];if(e.router.looseRoutesById[c.routeId].options.notFoundComponent)return l}return n?o:i},Xi=(e,t,n)=>{if(!(!wr(n)&&!er(n)))throw wr(n)&&n.redirectHandled&&!n.options.reloadDocument||(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:wr(n)?"redirected":er(n)?"notFound":r.status==="pending"?"success":r.status,context:Xa(e,t.index),isFetching:!1,error:n})),er(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),wr(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},Tw=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},Nv=(e,t,n)=>{const r=Xa(e,n);e.updateMatch(t,i=>({...i,context:r}))},Su=(e,t,n)=>{const{id:r,routeId:i}=e.matches[t],o=e.router.looseRoutesById[i];if(n instanceof Promise)throw n;e.firstBadMatchIndex??=t,Xi(e,e.router.getMatch(r),n);try{o.options.onError?.(n)}catch(l){n=l,Xi(e,e.router.getMatch(r),n)}e.updateMatch(r,l=>(l._nonReactive.beforeLoadPromise?.resolve(),l._nonReactive.beforeLoadPromise=void 0,l._nonReactive.loadPromise?.resolve(),{...l,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!wr(n)&&!er(n)&&(e.serialError??=n)},vw=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Nh(e,t)&&(n.options.loader||n.options.beforeLoad||Cw(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){const o=setTimeout(()=>{Bg(e)},i);r._nonReactive.pendingTimeout=o}},B4=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;vw(e,t,n,r);const i=()=>{const o=e.router.getMatch(t);o.preload&&(o.status==="redirected"||o.status==="notFound")&&Xi(e,o,o.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},H4=(e,t,n,r)=>{const i=e.router.getMatch(t);let o=i._nonReactive.loadPromise;i._nonReactive.loadPromise=fl(()=>{o?.resolve(),o=void 0});const{paramsError:l,searchError:c}=i;l&&Su(e,n,l),c&&Su(e,n,c),vw(e,t,r,i);const f=new AbortController;let d=!1;const m=()=>{d||(d=!0,e.updateMatch(t,N=>({...N,isFetching:"beforeLoad",fetchCount:N.fetchCount+1,abortController:f})))},p=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,N=>({...N,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{m(),p()});return}i._nonReactive.beforeLoadPromise=fl();const b={...Xa(e,n,!1),...i.__routeContext},{search:y,params:E,cause:w}=i,k=Nh(e,t),C={search:y,abortController:f,params:E,preload:k,context:b,location:e.location,navigate:N=>e.router.navigate({...N,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:k?"preload":w,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},A=N=>{if(N===void 0){e.router.batch(()=>{m(),p()});return}(wr(N)||er(N))&&(m(),Su(e,n,N)),e.router.batch(()=>{m(),e.updateMatch(t,D=>({...D,__beforeLoadContext:N})),p()})};let _;try{if(_=r.options.beforeLoad(C),ac(_))return m(),_.catch(N=>{Su(e,n,N)}).then(A)}catch(N){m(),Su(e,n,N)}A(_)},U4=(e,t)=>{const{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],o=()=>c(),l=()=>H4(e,n,t,i),c=()=>{if(Tw(e,n))return;const f=B4(e,n,i);return ac(f)?f.then(l):l()};return o()},z4=(e,t,n)=>{const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([o,l,c])=>({meta:o?.meta,links:o?.links,headScripts:o?.scripts,headers:c,scripts:l,styles:o?.styles}))},Sw=(e,t,n,r,i)=>{const o=t[r-1],{params:l,loaderDeps:c,abortController:f,cause:d}=e.router.getMatch(n),m=Xa(e,r),p=Nh(e,n);return{params:l,deps:c,preload:!!p,parentMatchPromise:o,abortController:f,context:m,location:e.location,navigate:b=>e.router.navigate({...b,_fromLocation:e.location}),cause:p?"preload":d,route:i,...e.router.options.additionalContext}},Rv=async(e,t,n,r,i)=>{try{const o=e.router.getMatch(n);try{(!(uw??e.router.isServer)||o.ssr===!0)&&lc(i);const l=i.options.loader,c=typeof l=="function"?l:l?.handler,f=c?.(Sw(e,t,n,r,i)),d=!!c&&ac(f);if((d||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||o._nonReactive.minPendingPromise)&&e.updateMatch(n,p=>({...p,isFetching:"loader"})),c){const p=d?await f:f;Xi(e,e.router.getMatch(n),p),p!==void 0&&e.updateMatch(n,b=>({...b,loaderData:p}))}i._lazyPromise&&await i._lazyPromise;const m=o._nonReactive.minPendingPromise;m&&await m,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,p=>({...p,error:void 0,context:Xa(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(l){let c=l;if(c?.name==="AbortError"){if(o.abortController.signal.aborted){o._nonReactive.loaderPromise?.resolve(),o._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,d=>({...d,status:d.status==="pending"?"success":d.status,isFetching:!1,context:Xa(e,r)}));return}const f=o._nonReactive.minPendingPromise;f&&await f,er(l)&&await i.options.notFoundComponent?.preload?.(),Xi(e,e.router.getMatch(n),l);try{i.options.onError?.(l)}catch(d){c=d,Xi(e,e.router.getMatch(n),d)}!wr(c)&&!er(c)&&await lc(i,["errorComponent"]),e.updateMatch(n,d=>({...d,error:c,context:Xa(e,r),status:"error",isFetching:!1}))}}catch(o){const l=e.router.getMatch(n);l&&(l._nonReactive.loaderPromise=void 0),Xi(e,l,o)}},F4=async(e,t,n)=>{async function r(y,E,w,k,C){const A=Date.now()-E.updatedAt,_=y?C.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:C.options.staleTime??e.router.options.defaultStaleTime??0,N=C.options.shouldReload,D=typeof N=="function"?N(Sw(e,t,i,n,C)):N,{status:O,invalid:j}=k,M=A>=_&&(!!e.forceStaleReload||k.cause==="enter"||w!==void 0&&w!==k.id);l=O==="success"&&(j||(D??M)),y&&C.options.preload===!1||(l&&!e.sync&&m?(c=!0,(async()=>{try{await Rv(e,t,i,n,C);const q=e.router.getMatch(i);q._nonReactive.loaderPromise?.resolve(),q._nonReactive.loadPromise?.resolve(),q._nonReactive.loaderPromise=void 0,q._nonReactive.loadPromise=void 0}catch(q){wr(q)&&await e.router.navigate(q.options)}})()):O!=="success"||l?await Rv(e,t,i,n,C):Nv(e,i,n))}const{id:i,routeId:o}=e.matches[n];let l=!1,c=!1;const f=e.router.looseRoutesById[o],d=f.options.loader,m=((typeof d=="function"?void 0:d?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(Tw(e,i)){if(!e.router.getMatch(i))return e.matches[n];Nv(e,i,n)}else{const y=e.router.getMatch(i),E=e.router.stores.matchesId.get()[n],w=(E&&e.router.stores.matchStores.get(E)||null)?.routeId===o?E:e.router.stores.matches.get().find(C=>C.routeId===o)?.id,k=Nh(e,i);if(y._nonReactive.loaderPromise){if(y.status==="success"&&!e.sync&&!y.preload&&m)return y;await y._nonReactive.loaderPromise;const C=e.router.getMatch(i),A=C._nonReactive.error||C.error;A&&Xi(e,C,A),C.status==="pending"&&await r(k,y,w,C,f)}else{const C=k&&!e.router.stores.matchStores.has(i),A=e.router.getMatch(i);A._nonReactive.loaderPromise=fl(),C!==A.preload&&e.updateMatch(i,_=>({..._,preload:C})),await r(k,y,w,A,f)}}const p=e.router.getMatch(i);c||(p._nonReactive.loaderPromise?.resolve(),p._nonReactive.loadPromise?.resolve(),p._nonReactive.loadPromise=void 0),clearTimeout(p._nonReactive.pendingTimeout),p._nonReactive.pendingTimeout=void 0,c||(p._nonReactive.loaderPromise=void 0),p._nonReactive.dehydrated=void 0;const b=c?p.isFetching:!1;return b!==p.isFetching||p.invalid!==!1?(e.updateMatch(i,y=>({...y,isFetching:b,invalid:!1})),e.router.getMatch(i)):p};async function Ov(e){const t=e,n=[];j4(t.router)&&Bg(t);let r;for(let b=0;b<t.matches.length;b++){try{const y=U4(t,b);ac(y)&&await y}catch(y){if(wr(y))throw y;if(er(y))r=y;else if(!t.preload)throw y;break}if(t.serialError||t.firstBadMatchIndex!=null)break}const i=t.firstBadMatchIndex??t.matches.length,o=r&&!t.preload?_v(t,r):void 0,l=r&&t.preload?0:o!==void 0?Math.min(o+1,i):i;let c,f;for(let b=0;b<l;b++)n.push(F4(t,n,b));try{await Promise.all(n)}catch{const b=await Promise.allSettled(n);for(const y of b){if(y.status!=="rejected")continue;const E=y.reason;if(wr(E))throw E;er(E)?c??=E:f??=E}if(f!==void 0)throw f}const d=c??(r&&!t.preload?r:void 0);let m=t.firstBadMatchIndex!==void 0?t.firstBadMatchIndex:t.matches.length-1;if(!d&&r&&t.preload)return t.matches;if(d){const b=_v(t,d);b===void 0&&ii();const y=t.matches[b],E=t.router.looseRoutesById[y.routeId],w=t.router.options?.defaultNotFoundComponent;!E.options.notFoundComponent&&w&&(E.options.notFoundComponent=w),d.routeId=y.routeId;const k=y.routeId===t.router.routeTree.id;t.updateMatch(y.id,C=>({...C,...k?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:d},isFetching:!1})),m=b,await lc(E,["notFoundComponent"])}else if(!t.preload){const b=t.matches[0];b.globalNotFound||t.router.getMatch(b.id)?.globalNotFound&&t.updateMatch(b.id,y=>({...y,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const b=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await lc(b,["errorComponent"])}for(let b=0;b<=m;b++){const{id:y,routeId:E}=t.matches[b],w=t.router.looseRoutesById[E];try{const k=z4(t,y,w);if(k){const C=await k;t.updateMatch(y,A=>({...A,...C}))}}catch(k){console.error(`Error executing head for route ${E}:`,k)}}const p=Bg(t);if(ac(p)&&await p,d)throw d;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function Iv(e,t){const n=t.map(r=>e.options[r]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function lc(e,t=Dd){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(r=>{const{id:i,...o}=r.options;Object.assign(e.options,o),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const n=()=>e._componentsLoaded?void 0:t===Dd?(()=>{if(e._componentsPromise===void 0){const r=Iv(e,Dd);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():Iv(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function Cw(e){for(const t of Dd)if(e.options[t]?.preload)return!0;return!1}const Dd=["component","errorComponent","pendingComponent","notFoundComponent"];var Zi="__TSR_index",Lv="popstate",Mv="beforeunload";function V4(e){let t=e.getLocation();const n=new Set,r=l=>{t=e.getLocation(),n.forEach(c=>c({location:t,action:l}))},i=l=>{e.notifyOnIndexChange??!0?r(l):t=e.getLocation()},o=async({task:l,navigateOpts:c,...f})=>{if(c?.ignoreBlocker??!1){l();return}const d=e.getBlockers?.()??[],m=f.type==="PUSH"||f.type==="REPLACE";if(typeof document<"u"&&d.length&&m)for(const p of d){const b=uc(f.path,f.state);if(await p.blockerFn({currentLocation:t,nextLocation:b,action:f.type})){e.onBlocked?.();return}}l()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:l=>(n.add(l),()=>{n.delete(l)}),push:(l,c,f)=>{const d=t.state[Zi];c=Dv(d+1,c),o({task:()=>{e.pushState(l,c),r({type:"PUSH"})},navigateOpts:f,type:"PUSH",path:l,state:c})},replace:(l,c,f)=>{const d=t.state[Zi];c=Dv(d,c),o({task:()=>{e.replaceState(l,c),r({type:"REPLACE"})},navigateOpts:f,type:"REPLACE",path:l,state:c})},go:(l,c)=>{o({task:()=>{e.go(l),i({type:"GO",index:l})},navigateOpts:c,type:"GO"})},back:l=>{o({task:()=>{e.back(l?.ignoreBlocker??!1),i({type:"BACK"})},navigateOpts:l,type:"BACK"})},forward:l=>{o({task:()=>{e.forward(l?.ignoreBlocker??!1),i({type:"FORWARD"})},navigateOpts:l,type:"FORWARD"})},canGoBack:()=>t.state[Zi]!==0,createHref:l=>e.createHref(l),block:l=>{if(!e.setBlockers)return()=>{};const c=e.getBlockers?.()??[];return e.setBlockers([...c,l]),()=>{const f=e.getBlockers?.()??[];e.setBlockers?.(f.filter(d=>d!==l))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function Dv(e,t){t||(t={});const n=Fb();return{...t,key:n,__TSR_key:n,[Zi]:e}}function ww(e){const t=e?.window??(typeof document<"u"?window:void 0),n=t.history.pushState,r=t.history.replaceState;let i=[];const o=()=>i,l=M=>i=M,c=e?.createHref??(M=>M),f=e?.parseLocation??(()=>uc(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const M=Fb();t.history.replaceState({[Zi]:0,key:M,__TSR_key:M},"")}let d=f(),m,p=!1,b=!1,y=!1,E=!1;const w=()=>d;let k,C;const A=()=>{k&&(j._ignoreSubscribers=!0,(k.isPush?t.history.pushState:t.history.replaceState)(k.state,"",k.href),j._ignoreSubscribers=!1,k=void 0,C=void 0,m=void 0)},_=(M,q,U)=>{const Q=c(q);C||(m=d),d=uc(q,U),k={href:Q,state:U,isPush:k?.isPush||M==="push"},C||(C=Promise.resolve().then(()=>A()))},N=M=>{d=f(),j.notify({type:M})},D=async()=>{if(b){b=!1;return}const M=f(),q=M.state[Zi]-d.state[Zi],U=q===1,Q=q===-1,Z=!U&&!Q||p;p=!1;const G=Z?"GO":Q?"BACK":"FORWARD",ee=Z?{type:"GO",index:q}:{type:Q?"BACK":"FORWARD"};if(y)y=!1;else{const Y=o();if(typeof document<"u"&&Y.length){for(const H of Y)if(await H.blockerFn({currentLocation:d,nextLocation:M,action:G})){b=!0,t.history.go(1),j.notify(ee);return}}}d=f(),j.notify(ee)},O=M=>{if(E){E=!1;return}let q=!1;const U=o();if(typeof document<"u"&&U.length)for(const Q of U){const Z=Q.enableBeforeUnload??!0;if(Z===!0){q=!0;break}if(typeof Z=="function"&&Z()===!0){q=!0;break}}if(q)return M.preventDefault(),M.returnValue=""},j=V4({getLocation:w,getLength:()=>t.history.length,pushState:(M,q)=>_("push",M,q),replaceState:(M,q)=>_("replace",M,q),back:M=>(M&&(y=!0),E=!0,t.history.back()),forward:M=>{M&&(y=!0),E=!0,t.history.forward()},go:M=>{p=!0,t.history.go(M)},createHref:M=>c(M),flush:A,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Mv,O,{capture:!0}),t.removeEventListener(Lv,D)},onBlocked:()=>{m&&d!==m&&(d=m)},getBlockers:o,setBlockers:l,notifyOnIndexChange:!1});return t.addEventListener(Mv,O,{capture:!0}),t.addEventListener(Lv,D),t.history.pushState=function(...M){const q=n.apply(t.history,M);return j._ignoreSubscribers||N("PUSH"),q},t.history.replaceState=function(...M){const q=r.apply(t.history,M);return j._ignoreSubscribers||N("REPLACE"),q},j}function $4(e){const t=typeof document<"u"?window:void 0;return ww({window:t,parseLocation:()=>{const n=t.location.hash.split("#").slice(1),r=n[0]??"/",i=t.location.search,o=n.slice(1);return uc(`${r}${i}${o.length===0?"":`#${o.join("#")}`}`,t.history.state)},createHref:n=>`${t.location.pathname}${t.location.search}#${n}`})}function q4(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function uc(e,t){const n=q4(e),r=n.indexOf("#"),i=n.indexOf("?"),o=Fb();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):"",search:i>-1?n.slice(i,r===-1?void 0:r):"",state:t||{[Zi]:0,key:o,__TSR_key:o}}}function Fb(){return(Math.random()+1).toString(36).substring(7)}function ll(e,t){const n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:n?.pathname!==r.pathname,hrefChanged:n?.href!==r.href,hashChanged:n?.hash!==r.hash}}var Y4=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=n=>n(),this.update=n=>{const r=this.options,i=this.basepath??r?.basepath??"/",o=this.basepath===void 0,l=r?.rewrite;if(this.options={...r,...n},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=E4(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=ww()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let m;this.resolvePathCache=oc(1e3),m=this.buildRouteTree(),this.setRoutes(m)}if(!this.stores&&this.latestLocation){const m=this.getStoreConfig(this);this.batch=m.batch,this.stores=P4(X4(this.latestLocation),m),A4(this)}let c=!1;const f=this.options.basepath??"/",d=this.options.rewrite;if(o||i!==f||l!==d){this.basepath=f;const m=[],p=bw(f);p&&p!=="/"&&m.push(D4({basepath:f})),d&&m.push(d),this.rewrite=m.length===0?void 0:m.length===1?m[0]:M4(m),this.history&&this.updateLatestLocation(),c=!0}c&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a))"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const n=p4(this.routeTree,this.options.caseSensitive,(r,i)=>{r.init({originalIndex:i})});return this.options.routeMasks&&u4(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,r)=>{const i={eventType:n,fn:r};return this.subscribers.add(i),()=>{this.subscribers.delete(i)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=(n,r)=>{const i=({pathname:f,search:d,hash:m,href:p,state:b})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(f)){const C=this.options.parseSearch(d),A=this.options.stringifySearch(C);return{href:f+A+m,publicHref:f+A+m,pathname:vu(f).path,external:!1,searchStr:A,search:Oa(r?.search,C),hash:vu(m.slice(1)).path,state:Fa(r?.state,b)}}const y=new URL(p,this.origin),E=jg(this.rewrite,y),w=this.options.parseSearch(E.search),k=this.options.stringifySearch(w);return E.search=k,{href:E.href.replace(E.origin,""),publicHref:p,pathname:vu(E.pathname).path,external:!!this.rewrite&&E.origin!==this.origin,searchStr:k,search:Oa(r?.search,w),hash:vu(E.hash.slice(1)).path,state:Fa(r?.state,b)}},o=i(n),{__tempLocation:l,__tempKey:c}=o.state;if(l&&(!c||c===this.tempLocationKey)){const f=i(l);return f.state.key=o.state.key,f.state.__TSR_key=o.state.__TSR_key,delete f.state.__tempLocation,{...f,maskedLocation:o}}return o},this.resolvePathWithBase=(n,r)=>y4({base:n,to:r.includes("//")?zb(r):r,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,r,i)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},i):this.matchRoutesInternal(n,r),this.getMatchedRoutes=n=>K4({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const r=this.getMatch(n);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(n=>{this.cancelMatch(n)}),this.stores.matchesId.get().forEach(n=>{if(this.stores.pendingMatchStores.has(n))return;const r=this.stores.matchStores.get(n)?.get();r&&(r.status==="pending"||r.isFetching==="loader")&&this.cancelMatch(n)})},this.buildLocation=n=>{const r=(o={})=>{const l=o._fromLocation||this.pendingBuiltLocation||this.latestLocation,c=this.matchRoutesLightweight(l);o.from;const f=o.unsafeRelative==="path"?l.pathname:o.from??c.fullPath,d=o.to?`${o.to}`:void 0,m=c.search,p=Object.assign(Object.create(null),c.params),b=d?.charCodeAt(0)===47?"/":this.resolvePathWithBase(f,"."),y=d?this.resolvePathWithBase(b,d):b,E=o.params===!1||o.params===null?Object.create(null):(o.params??!0)===!0?p:Object.assign(p,za(o.params,p)),w=this.routesByPath[si(y)];let k;if(w)k=this.getRouteBranch(w);else if(y.includes("$"))k=[];else{const Q=this.getMatchedRoutes(y);k=Q.matchedRoutes,this.options.notFoundRoute&&(!Q.foundRoute||Q.foundRoute.path!=="/"&&Q.routeParams["**"])&&(k=[...k,this.options.notFoundRoute])}if(k.length&&fw(E))for(const Q of k){const Z=Q.options.params?.stringify??Q.options.stringifyParams;if(Z)try{Object.assign(E,Z(E))}catch{}}const C=n.leaveParams?y:vu(Cv({path:y,params:E,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let A=m;if(n._includeValidateSearch&&this.options.search?.strict){const Q={};k.forEach(Z=>{if(Z.options.validateSearch)try{Object.assign(Q,Pd(Z.options.validateSearch,{...Q,...A}))}catch{}}),A=Q}A=Q4({search:A,dest:o,destRoutes:k,_includeValidateSearch:n._includeValidateSearch}),A=Oa(m,A);const _=this.options.stringifySearch(A),N=o.hash===!0?l.hash:o.hash?za(o.hash,l.hash):void 0,D=N?`#${N}`:"";let O=o.state===!0?l.state:o.state?za(o.state,l.state):{};O=Fa(l.state,O);const j=`${C}${_}${D}`;let M,q,U=!1;if(this.rewrite){const Q=new URL(j,this.origin),Z=Ew(this.rewrite,Q);M=Q.href.replace(Q.origin,""),Z.origin!==this.origin?(q=Z.href,U=!0):q=Z.pathname+Z.search+Z.hash}else M=a4(j),q=M;return{publicHref:q,href:M,pathname:C,search:A,searchStr:_,state:O,hash:N??"",external:U,unmaskOnReload:o.unmaskOnReload}},i=(o={},l)=>{const c=r(o);let f=l?r(l):void 0;if(!f){const d=Object.create(null);if(this.options.routeMasks){const m=c4(c.pathname,this.processedTree);if(m){Object.assign(d,m.rawParams);const{from:p,params:b,...y}=m.route,E=b===!1||b===null?Object.create(null):(b??!0)===!0?d:Object.assign(d,za(b,d));l={from:n.from,...y,params:E},f=r(l)}}}return f&&(c.maskedLocation=f),c};return n.mask?i(n,{from:n.from,...n.mask}):i(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:r,...i})=>{let o;const l=()=>{const d=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];d.forEach(p=>{i.state[p]=this.latestLocation.state[p]});const m=Ya(i.state,this.latestLocation.state);return d.forEach(p=>{delete i.state[p]}),m},c=si(this.latestLocation.href)===si(i.href);let f=this.commitLocationPromise;if(this.commitLocationPromise=fl(()=>{f?.resolve(),f=void 0}),c&&l())this.load();else{let{maskedLocation:d,hashScrollIntoView:m,...p}=i;d&&(p={...d,state:{...d.state,__tempKey:void 0,__tempLocation:{...p,search:p.searchStr,state:{...p.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(p.unmaskOnReload??this.options.unmaskOnReload??!1)&&(p.state.__tempKey=this.tempLocationKey)),p.state.__hashScrollIntoViewOptions=m??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,o=i.replace?"REPLACE":"PUSH",this.history[o==="REPLACE"?"replace":"push"](p.publicHref,p.state,{ignoreBlocker:r})}return this._scroll.next=i.resetScroll??!0,this.history.subscribers.size||this.load(o?{action:{type:o}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:i,viewTransition:o,ignoreBlocker:l,href:c,...f}={})=>{if(c){const p=this.history.location.state.__TSR_index,b=uc(c,{__TSR_index:n?p:p+1}),y=new URL(b.pathname,this.origin);f.to=jg(this.rewrite,y).pathname,f.search=this.options.parseSearch(b.search),f.hash=b.hash.slice(1)}const d=this.buildLocation({...f,_includeValidateSearch:!0});this.pendingBuiltLocation=d;const m=this.commitLocation({...d,viewTransition:o,replace:n,resetScroll:r,hashScrollIntoView:i,ignoreBlocker:l});return queueMicrotask(()=>{this.pendingBuiltLocation===d&&(this.pendingBuiltLocation=void 0)}),m},this.navigate=async({to:n,reloadDocument:r,href:i,publicHref:o,...l})=>{let c=!1;if(i)try{new URL(`${i}`),c=!0}catch{}if(c&&!r&&(r=!0),r){if(n!==void 0||!i){const d=this.buildLocation({to:n,...l});i=i??d.publicHref,o=o??d.publicHref}const f=!c&&o?o:i;if(Kd(f,this.protocolAllowlist))return;if(!l.ignoreBlocker){const d=this.history.getBlockers?.()??[];for(const m of d)if(m?.blockerFn&&await m.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return}l.replace?window.location.replace(f):window.location.href=f;return}return this.buildAndCommitLocation({...l,href:i,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation),r=this.stores.cachedMatches.get().filter(i=>!n.some(o=>o.id===i.id));this.batch(()=>{this.stores.status.set("pending"),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(n),this.stores.setCached(r)})},this.load=async n=>{const r=n?.action?.type;let i,o,l;const c=this.stores.resolvedLocation.get()??this.stores.location.get();for(l=new Promise(d=>{this.startTransition(async()=>{try{this.beforeLoad(),r&&(this._scroll.hash=r==="PUSH"||r==="REPLACE");const m=this.latestLocation,p=ll(m,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...p}),this.emit({type:"onBeforeLoad",...p}),await Ov({router:this,sync:n?.sync,forceStaleReload:c.href===m.href,matches:this.stores.pendingMatches.get(),location:m,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let b=null,y=null,E=null,w=null;this.batch(()=>{const k=this.stores.pendingMatches.get(),C=k.length,A=this.stores.matches.get();b=C?A.filter(D=>!this.stores.pendingMatchStores.has(D.id)):null;const _=new Set;for(const D of this.stores.pendingMatchStores.values())D.routeId&&_.add(D.routeId);const N=new Set;for(const D of this.stores.matchStores.values())D.routeId&&N.add(D.routeId);y=C?A.filter(D=>!_.has(D.routeId)):null,E=C?k.filter(D=>!N.has(D.routeId)):null,w=C?k.filter(D=>N.has(D.routeId)):A,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),C&&(this.stores.setMatches(k),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...b.filter(D=>D.status!=="error"&&D.status!=="notFound"&&D.status!=="redirected")]),this.clearExpiredCache())});for(const[k,C]of[[y,"onLeave"],[E,"onEnter"],[w,"onStay"]])if(k)for(const A of k)this.looseRoutesById[A.routeId].options[C]?.(A)})})}})}catch(m){wr(m)?(i=m,this.navigate({...i.options,replace:!0,ignoreBlocker:!0})):er(m)&&(o=m);const p=i?i.status:o?404:this.stores.matches.get().some(b=>b.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(p),this.stores.redirect.set(i)})}this.latestLoadPromise===l&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),d()})}),this.latestLoadPromise=l,await l;this.latestLoadPromise&&l!==this.latestLoadPromise;)await this.latestLoadPromise;let f;this.hasNotFoundMatch()?f=404:this.stores.matches.get().some(d=>d.status==="error")&&(f=500),f!==void 0&&this.stores.statusCode.set(f)},this.startViewTransition=n=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let i;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const o=this.latestLocation,l=this.stores.resolvedLocation.get(),c=typeof r.types=="function"?r.types(ll(o,l)):r.types;if(c===!1){n();return}i={update:n,types:c}}else i=n;document.startViewTransition(i)}else n()},this.updateMatch=(n,r)=>{this.startTransition(()=>{const i=this.stores.pendingMatchStores.get(n);if(i){i.set(r);return}const o=this.stores.matchStores.get(n);if(o){o.set(r);return}const l=this.stores.cachedMatchStores.get(n);if(l){const c=r(l.get());c.status==="redirected"?this.stores.cachedMatchStores.delete(n)&&this.stores.cachedIds.set(f=>f.filter(d=>d!==n)):l.set(c)}})},this.getMatch=n=>this.stores.cachedMatchStores.get(n)?.get()??this.stores.pendingMatchStores.get(n)?.get()??this.stores.matchStores.get(n)?.get(),this.invalidate=n=>{const r=i=>n?.filter?.(i)??!0?{...i,invalid:!0,...n?.forcePending||i.status==="error"||i.status==="notFound"?{status:"pending",error:void 0}:void 0}:i;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(r)),this.stores.setCached(this.stores.cachedMatches.get().map(r)),this.stores.setPending(this.stores.pendingMatches.get().map(r))}),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const r=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const i=n.options._builtLocation??this.buildLocation(n.options),o=this.getParsedLocationHref(i);n.options.href=o,n.headers.set("Location",o)}else if(r)try{const i=new URL(r);if(this.origin&&i.origin===this.origin){const o=i.pathname+i.search+i.hash;n.options.href=o,n.headers.set("Location",o)}}catch{}if(n.options.href&&!n.options._builtLocation&&Kd(n.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const r=n?.filter;r!==void 0?this.stores.setCached(this.stores.cachedMatches.get().filter(i=>!r(i))):this.stores.setCached([])},this.clearExpiredCache=()=>{const n=Date.now(),r=i=>{const o=this.looseRoutesById[i.routeId];if(!o.options.loader)return!0;const l=(i.preload?o.options.preloadGcTime??this.options.defaultPreloadGcTime:o.options.gcTime??this.options.defaultGcTime)??300*1e3;return i.status==="error"?!0:n-i.updatedAt>=l};this.clearCache({filter:r})},this.loadRouteChunk=lc,this.preloadRoute=async n=>{const r=n._builtLocation??this.buildLocation(n);let i=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:n});const o=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),l=new Set([...o,...this.stores.cachedIds.get()]),c=i.filter(f=>!l.has(f.id));if(c.length){const f=this.stores.cachedMatches.get();this.stores.setCached([...f,...c])}try{return i=await Ov({router:this,matches:i,location:r,preload:!0,updateMatch:(f,d)=>{o.has(f)?i=i.map(m=>m.id===f?d(m):m):this.updateMatch(f,d)}}),i}catch(f){if(wr(f))return f.options.reloadDocument?void 0:await this.preloadRoute({...f.options,_fromLocation:r});er(f)||console.error(f);return}},this.matchRoute=(n,r)=>{const i={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},o=this.buildLocation(i);if(r?.pending&&this.stores.status.get()!=="pending")return!1;const l=(r?.pending===void 0?!this.stores.isLoading.get():r.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),c=f4(o.pathname,r?.caseSensitive??!1,r?.fuzzy??!1,l.pathname,this.processedTree);return!c||n.params&&!Ya(c.rawParams,n.params,{partial:!0})?!1:r?.includeSearch??!0?Ya(l.search,o.search,{partial:!0})?c.rawParams:!1:c.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(n=>n.status==="notFound"||n.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??O4,parseSearch:e.parseSearch??R4,protocolAllowlist:e.protocolAllowlist??i4}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=mw(e),this.routeBranchCache.set(e,t)),t}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){const n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i}=n;let{matchedRoutes:o}=n,l=!1;(r?r.path!=="/"&&i["**"]:si(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:l=!0);const c=l?Z4(this.options.notFoundMode,o):void 0,f=new Array(o.length),d=new Map;for(const m of this.stores.matchStores.values())m.routeId&&d.set(m.routeId,m.get());for(let m=0;m<o.length;m++){const p=o[m],b=f[m-1];let y,E,w;{const Z=b?.search??e.search,G=b?._strictSearch??void 0;try{const ee=Pd(p.options.validateSearch,{...Z})??void 0;y={...Z,...ee},E={...G,...ee},w=void 0}catch(ee){let Y=ee;if(ee instanceof Wd||(Y=new Wd(ee.message,{cause:ee})),t?.throwOnError)throw Y;y=Z,E={},w=Y}}const k=p.options.loaderDeps?.({search:y})??"",C=k?JSON.stringify(k):"",{interpolatedPath:A,usedParams:_}=Cv({path:p.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),N=p.id+A+C,D=this.getMatch(N),O=d.get(p.id),j=D?._strictParams??_;let M;if(!D)try{Pv(p,j)}catch(Z){if(er(Z)||wr(Z)?M=Z:M=new G4(Z.message,{cause:Z}),t?.throwOnError)throw M}Object.assign(i,j);const q=O?"stay":"enter";let U;if(D)U={...D,cause:q,params:O?.params??i,_strictParams:j,search:Oa(O?O.search:D.search,y),_strictSearch:E};else{const Z=p.options.loader||p.options.beforeLoad||p.lazyFn||Cw(p)?"pending":"success";U={id:N,ssr:p.options.ssr,index:m,routeId:p.id,params:O?.params??i,_strictParams:j,pathname:A,updatedAt:Date.now(),search:O?Oa(O.search,y):y,_strictSearch:E,searchError:void 0,status:Z,isFetching:!1,error:void 0,paramsError:M,__routeContext:void 0,_nonReactive:{loadPromise:fl()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:q,loaderDeps:O?Fa(O.loaderDeps,k):k,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:p.options.staticData||{},fullPath:p.fullPath}}t?.preload||(U.globalNotFound=c===p.id),U.searchError=w;const Q=this.getParentContext(b);U.context={...Q,...U.__routeContext,...U.__beforeLoadContext},f[m]=U}for(let m=0;m<f.length;m++){const p=f[m],b=this.looseRoutesById[p.routeId],y=this.getMatch(p.id),E=d.get(p.routeId);if(p.params=E?Oa(E.params,i):i,!y){const w=f[m-1],k=this.getParentContext(w);if(b.options.context){const C={deps:p.loaderDeps,params:p.params,context:k??{},location:e,navigate:A=>this.navigate({...A,_fromLocation:e}),buildLocation:this.buildLocation,cause:p.cause,abortController:p.abortController,preload:!!p.preload,matches:f,routeId:b.id};p.__routeContext=b.options.context(C)??void 0}p.context={...k,...p.__routeContext,...p.__beforeLoadContext}}}return f}matchRoutesLightweight(e){const t=ic(this.stores.matchesId.get()),n=this.lightweightCache.get(e);if(n&&n[0]===t)return n[1];const{matchedRoutes:r,routeParams:i}=this.getMatchedRoutes(e.pathname),o=ic(r),l={...e.search};for(const p of r)try{Object.assign(l,Pd(p.options.validateSearch,l))}catch{}const c=t&&this.stores.matchStores.get(t)?.get(),f=c&&c.routeId===o.id&&c.pathname===e.pathname;let d;if(f)d=c.params;else{const p=Object.assign(Object.create(null),i);for(const b of r)try{Pv(b,p)}catch{}d=p}const m={matchedRoutes:r,fullPath:o.fullPath,search:l,params:d};return this.lightweightCache.set(e,[t,m]),m}},Wd=class extends Error{},G4=class extends Error{};function X4(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function Pd(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Wd("Async validation not supported");if(n.issues)throw new Wd(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function K4({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),i=si(e);let o;const l=d4(i,n,!0);return l&&(o=l.route,Object.assign(r,l.rawParams)),{matchedRoutes:l?.branch||[t.__root__],routeParams:r,foundRoute:o}}function Q4({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return W4(n)(e,t,r??!1)}function W4(e){let t,n;const r=[];for(const o of e){const l=o.options;if("search"in l)l.search?.middlewares&&r.push(...l.search.middlewares);else if(l.preSearchFilters||l.postSearchFilters){const f=({search:d,next:m})=>{const p=m(l.preSearchFilters?l.preSearchFilters.reduce((b,y)=>y(b),d):d);return l.postSearchFilters?l.postSearchFilters.reduce((b,y)=>y(b),p):p};r.push(f)}const c=l.validateSearch;if(c){const f=({search:d,next:m,meta:p})=>{const b=m(d);if(n)try{const y=Pd(c,b);if(p&&y)for(const E in y)E in b||(p.defaulted||=new Map).set(E,y[E]);return{...b,...y}}catch{}return b};r.push(f)}}const i=(o,l,c)=>{if(o>=r.length){if(!t.search)return{};if(t.search===!0)return l;const d=za(t.search,l);return c&&(c.explicit=d),d}const f=(d,m)=>{if(m){const p=c||{};return{search:i(o+1,d,p),meta:p}}return i(o+1,d,c)};return r[o]({search:l,next:f,meta:c})};return function(l,c,f){return t=c,n=f,i(0,l)}}function Z4(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.children)return r.id}return Ga}function Pv(e,t){const n=e.options.params?.parse??e.options.parseParams;if(n){const r=n(t);if(r===!1)throw new Error("Route params.parse returned false for a matched route");Object.assign(t,r)}}const J4="Error preloading route! ☝️";var kw=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=t=>{this.originalIndex=t.originalIndex;const n=this.options,r=!n?.path&&!n?.id;this.parentRoute=this.options.getParentRoute?.(),r?this._path=Ga:this.parentRoute||ii();let i=r?Ga:n?.path;i&&i!=="/"&&(i=gw(i));const o=n?.id||i;let l=r?Ga:Ld([this.parentRoute.id==="__root__"?"":this.parentRoute.id,o]);i==="__root__"&&(i="/"),l!=="__root__"&&(l=Ld(["/",l]));const c=l==="__root__"?"/":Ld([this.parentRoute.fullPath,i]);this._path=i,this._id=l,this._fullPath=c,this._to=si(c)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),typeof t=="object"&&t!==null&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>yw({from:this.fullPath,...t}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}},eI=class extends kw{constructor(e){super(e)}};function Vb(e){const t=e.errorComponent??$b;return g.jsx(tI,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?S.createElement(t,{error:n,reset:r}):e.children})}var tI=class extends S.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){const n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function $b({error:e}){const[t,n]=S.useState(!1);return g.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[g.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),g.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),g.jsx("div",{style:{height:".25rem"}}),t?g.jsx("div",{children:g.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?g.jsx("code",{children:e.message}):null})}):null]})}function nI({children:e,fallback:t=null}){return Aw()?g.jsx(De.Fragment,{children:e}):g.jsx(De.Fragment,{children:t})}function Aw(){return De.useSyncExternalStore(rI,()=>!0,()=>!1)}function rI(){return()=>{}}var _w=S.createContext(null);function Ur(e){return S.useContext(_w)}var Rh=S.createContext(void 0),sI=S.createContext(void 0),fn=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(fn||{});function iI({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:o,checkDirty:l,shallowPropagate:c};function r(d,m,p){const b=m.depsTail;if(b!==void 0&&b.dep===d)return;const y=b!==void 0?b.nextDep:m.deps;if(y!==void 0&&y.dep===d){y.version=p,m.depsTail=y;return}const E=d.subsTail;if(E!==void 0&&E.version===p&&E.sub===m)return;const w=m.depsTail=d.subsTail={version:p,dep:d,sub:m,prevDep:b,nextDep:y,prevSub:E,nextSub:void 0};y!==void 0&&(y.prevDep=w),b!==void 0?b.nextDep=w:m.deps=w,E!==void 0?E.nextSub=w:d.subs=w}function i(d,m=d.sub){const p=d.dep,b=d.prevDep,y=d.nextDep,E=d.nextSub,w=d.prevSub;return y!==void 0?y.prevDep=b:m.depsTail=b,b!==void 0?b.nextDep=y:m.deps=y,E!==void 0?E.prevSub=w:p.subsTail=w,w!==void 0?w.nextSub=E:(p.subs=E)===void 0&&n(p),y}function o(d){let m=d.nextSub,p;e:do{const b=d.sub;let y=b.flags;if(y&60?y&12?y&4?!(y&48)&&f(d,b)?(b.flags=y|40,y&=1):y=0:b.flags=y&-9|32:y=0:b.flags=y|32,y&2&&t(b),y&1){const E=b.subs;if(E!==void 0){const w=(d=E).nextSub;w!==void 0&&(p={value:m,prev:p},m=w);continue}}if((d=m)!==void 0){m=d.nextSub;continue}for(;p!==void 0;)if(d=p.value,p=p.prev,d!==void 0){m=d.nextSub;continue e}break}while(!0)}function l(d,m){let p,b=0,y=!1;e:do{const E=d.dep,w=E.flags;if(m.flags&16)y=!0;else if((w&17)===17){if(e(E)){const k=E.subs;k.nextSub!==void 0&&c(k),y=!0}}else if((w&33)===33){(d.nextSub!==void 0||d.prevSub!==void 0)&&(p={value:d,prev:p}),d=E.deps,m=E,++b;continue}if(!y){const k=d.nextDep;if(k!==void 0){d=k;continue}}for(;b--;){const k=m.subs,C=k.nextSub!==void 0;if(C?(d=p.value,p=p.prev):d=k,y){if(e(m)){C&&c(k),m=d.sub;continue}y=!1}else m.flags&=-33;m=d.sub;const A=d.nextDep;if(A!==void 0){d=A;continue e}}return y}while(!0)}function c(d){do{const m=d.sub,p=m.flags;(p&48)===32&&(m.flags=p|16,(p&6)===2&&t(m))}while((d=d.nextSub)!==void 0)}function f(d,m){let p=m.depsTail;for(;p!==void 0;){if(p===d)return!0;p=p.prevDep}return!1}}function aI(e,t,n){const r=typeof e=="object",i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}const Hg=[];let jd=0;const{link:jv,unlink:oI,propagate:lI,checkDirty:Nw,shallowPropagate:Bv}=iI({update(e){return e._update()},notify(e){Hg[Ug++]=e,e.flags&=~fn.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=fn.Mutable|fn.Dirty,Zd(e))}});let nd=0,Ug=0,vs,zg=0;function Rw(e){try{++zg,e()}finally{--zg||Ow()}}function Zd(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=oI(n,e)}function Ow(){if(!(zg>0)){for(;nd<Ug;){const e=Hg[nd];Hg[nd++]=void 0,e.notify()}nd=0,Ug=0}}function Hv(e,t){const n=typeof e=="function",r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?fn.None:fn.Mutable,get(){return vs!==void 0&&jv(i,vs,jd),i._snapshot},subscribe(o){const l=aI(o),c={current:!1},f=uI(()=>{i.get(),c.current?l.next?.(i._snapshot):c.current=!0});return{unsubscribe:()=>{f.stop()}}},_update(o){const l=vs,c=t?.compare??Object.is;if(n)vs=i,++jd,i.depsTail=void 0;else if(o===void 0)return!1;n&&(i.flags=fn.Mutable|fn.RecursedCheck);try{const f=i._snapshot,d=typeof o=="function"?o(f):o===void 0&&n?r(f):o;return f===void 0||!c(f,d)?(i._snapshot=d,!0):!1}finally{vs=l,n&&(i.flags&=~fn.RecursedCheck),Zd(i)}}};return n?(i.flags=fn.Mutable|fn.Dirty,i.get=function(){const o=i.flags;if(o&fn.Dirty||o&fn.Pending&&Nw(i.deps,i)){if(i._update()){const l=i.subs;l!==void 0&&Bv(l)}}else o&fn.Pending&&(i.flags=o&~fn.Pending);return vs!==void 0&&jv(i,vs,jd),i._snapshot}):i.set=function(o){if(i._update(o)){const l=i.subs;l!==void 0&&(lI(l),Bv(l),Ow())}},i}function uI(e){const t=()=>{const r=vs;vs=n,++jd,n.depsTail=void 0,n.flags=fn.Watching|fn.RecursedCheck;try{return e()}finally{vs=r,n.flags&=~fn.RecursedCheck,Zd(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:fn.Watching|fn.RecursedCheck,notify(){const r=this.flags;r&fn.Dirty||r&fn.Pending&&Nw(this.deps,this)?t():this.flags=fn.Watching},stop(){this.flags=fn.None,this.depsTail=void 0,Zd(this)}};return t(),n}var B0={exports:{}},H0={},U0={exports:{}},z0={};/**
|
|
50
|
-
* @license React
|
|
51
|
-
* use-sync-external-store-shim.production.js
|
|
52
|
-
*
|
|
53
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
54
|
-
*
|
|
55
|
-
* This source code is licensed under the MIT license found in the
|
|
56
|
-
* LICENSE file in the root directory of this source tree.
|
|
57
|
-
*/var Uv;function cI(){if(Uv)return z0;Uv=1;var e=vc();function t(p,b){return p===b&&(p!==0||1/p===1/b)||p!==p&&b!==b}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,l=e.useDebugValue;function c(p,b){var y=b(),E=r({inst:{value:y,getSnapshot:b}}),w=E[0].inst,k=E[1];return o(function(){w.value=y,w.getSnapshot=b,f(w)&&k({inst:w})},[p,y,b]),i(function(){return f(w)&&k({inst:w}),p(function(){f(w)&&k({inst:w})})},[p]),l(y),y}function f(p){var b=p.getSnapshot;p=p.value;try{var y=b();return!n(p,y)}catch{return!0}}function d(p,b){return b()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:c;return z0.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,z0}var zv;function Iw(){return zv||(zv=1,U0.exports=cI()),U0.exports}/**
|
|
58
|
-
* @license React
|
|
59
|
-
* use-sync-external-store-shim/with-selector.production.js
|
|
60
|
-
*
|
|
61
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
62
|
-
*
|
|
63
|
-
* This source code is licensed under the MIT license found in the
|
|
64
|
-
* LICENSE file in the root directory of this source tree.
|
|
65
|
-
*/var Fv;function fI(){if(Fv)return H0;Fv=1;var e=vc(),t=Iw();function n(d,m){return d===m&&(d!==0||1/d===1/m)||d!==d&&m!==m}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,l=e.useEffect,c=e.useMemo,f=e.useDebugValue;return H0.useSyncExternalStoreWithSelector=function(d,m,p,b,y){var E=o(null);if(E.current===null){var w={hasValue:!1,value:null};E.current=w}else w=E.current;E=c(function(){function C(O){if(!A){if(A=!0,_=O,O=b(O),y!==void 0&&w.hasValue){var j=w.value;if(y(j,O))return N=j}return N=O}if(j=N,r(_,O))return j;var M=b(O);return y!==void 0&&y(j,M)?(_=O,j):(_=O,N=M)}var A=!1,_,N,D=p===void 0?null:p;return[function(){return C(m())},D===null?void 0:function(){return C(D())}]},[m,p,b,y]);var k=i(d,E[0],E[1]);return l(function(){w.hasValue=!0,w.value=k},[k]),f(k),k},H0}var Vv;function dI(){return Vv||(Vv=1,B0.exports=fI()),B0.exports}var Lw=dI();function hI(e,t){return e===t}function cr(e,t,n=hI){const r=S.useCallback(l=>{if(!e)return()=>{};const{unsubscribe:c}=e.subscribe(l);return c},[e]),i=S.useCallback(()=>e?.get(),[e]);return Lw.useSyncExternalStoreWithSelector(r,i,i,t,n)}var F0={get(){},subscribe(){return{unsubscribe(){}}}};function Mw(e,t){const n=S.useRef();return r=>{const i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=Fa(n.current,i):i}}function oo(e){const t=Ur(),n=S.useContext(e.from?sI:Rh),r=e.from?t.stores.getRouteMatchStore(e.from):t.stores.matchStores.get(n),i=Mw(e,t),o=cr(r??F0,l=>l?i(l):F0);if(o!==F0)return o;(e.shouldThrow??!0)&&ii()}function Dw(e){return oo({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Pw(e){const{select:t,...n}=e;return oo({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function Oh(e){return oo({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function jw(e){return oo({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function yl(e){const t=Ur();return S.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function Bw(e){return oo({...e,select:t=>e.select?e.select(t.context):t.context})}var cs=aw();const pI=Ah(cs);function mI(e,t){const n=Ur(),r=e4(t),{activeProps:i,inactiveProps:o,activeOptions:l,to:c,preload:f,preloadDelay:d,preloadIntentProximity:m,hashScrollIntoView:p,replace:b,startTransition:y,resetScroll:E,viewTransition:w,children:k,target:C,disabled:A,style:_,className:N,onClick:D,onBlur:O,onFocus:j,onMouseEnter:M,onMouseLeave:q,onTouchStart:U,ignoreBlocker:Q,params:Z,search:G,hash:ee,state:Y,mask:H,reloadDocument:K,unsafeRelative:te,from:le,_fromLocation:I,...P}=e,$=Aw(),L=S.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ae=cr(n.stores.location,re=>re,(re,V)=>re.href===V.href),ie=S.useMemo(()=>{const re={_fromLocation:ae,...L};return n.buildLocation(re)},[n,ae,L]),fe=ie.maskedLocation?ie.maskedLocation.publicHref:ie.publicHref,de=ie.maskedLocation?ie.maskedLocation.external:ie.external,he=S.useMemo(()=>TI(fe,de,n.history,A),[A,de,fe,n.history]),ve=S.useMemo(()=>{if(he?.external)return Kd(he.href,n.protocolAllowlist)?void 0:he.href;if(!vI(c)&&!(typeof c!="string"||c.indexOf(":")===-1))try{return new URL(c),Kd(c,n.protocolAllowlist)?void 0:c}catch{}},[c,he,n.protocolAllowlist]),Ue=S.useMemo(()=>{if(ve)return!1;if(l?.exact){if(!x4(ae.pathname,ie.pathname,n.basepath))return!1}else{const re=Qd(ae.pathname,n.basepath),V=Qd(ie.pathname,n.basepath);if(!(re.startsWith(V)&&(re.length===V.length||re[V.length]==="/")))return!1}return(l?.includeSearch??!0)&&!Ya(ae.search,ie.search,{partial:!l?.exact,ignoreUndefined:!l?.explicitUndefined})?!1:l?.includeHash?$&&ae.hash===ie.hash:!0},[l?.exact,l?.explicitUndefined,l?.includeHash,l?.includeSearch,ae,ve,$,ie.hash,ie.pathname,ie.search,n.basepath]),Pe=Ue?za(i,{})??gI:V0,Te=Ue?V0:za(o,{})??V0,Ie=[N,Pe.className,Te.className].filter(Boolean).join(" "),je=(_||Pe.style||Te.style)&&{..._,...Pe.style,...Te.style},[We,Xe]=S.useState(!1),Me=S.useRef(!1),Ce=e.reloadDocument||ve?!1:f??n.options.defaultPreload,we=d??n.options.defaultPreloadDelay??0,Be=S.useCallback(()=>{n.preloadRoute({...L,_builtLocation:ie}).catch(re=>{console.warn(re),console.warn(J4)})},[n,L,ie]);JO(r,S.useCallback(re=>{re?.isIntersecting&&Be()},[Be]),EI,{disabled:!!A||Ce!=="viewport"}),S.useEffect(()=>{Me.current||!A&&Ce==="render"&&(Be(),Me.current=!0)},[A,Be,Ce]);const $e=re=>{const V=re.currentTarget.getAttribute("target"),z=C!==void 0?C:V;if(!A&&!SI(re)&&!re.defaultPrevented&&(!z||z==="_self")&&re.button===0){re.preventDefault(),cs.flushSync(()=>{Xe(!0)});const ue=n.subscribe("onResolved",()=>{ue(),Xe(!1)});n.navigate({...L,replace:b,resetScroll:E,hashScrollIntoView:p,startTransition:y,viewTransition:w,ignoreBlocker:Q})}};if(ve)return{...P,ref:r,href:ve,...k&&{children:k},...C&&{target:C},...A&&{disabled:A},..._&&{style:_},...N&&{className:N},...D&&{onClick:D},...O&&{onBlur:O},...j&&{onFocus:j},...M&&{onMouseEnter:M},...q&&{onMouseLeave:q},...U&&{onTouchStart:U}};const W=re=>{if(A||Ce!=="intent")return;if(!we){Be();return}const V=re.currentTarget;if(Cu.has(V))return;const z=setTimeout(()=>{Cu.delete(V),Be()},we);Cu.set(V,z)},me=re=>{A||Ce!=="intent"||Be()},se=re=>{if(A||!Ce||!we)return;const V=re.currentTarget,z=Cu.get(V);z&&(clearTimeout(z),Cu.delete(V))};return{...P,...Pe,...Te,href:he?.href,ref:r,onClick:Jo([D,$e]),onBlur:Jo([O,se]),onFocus:Jo([j,W]),onMouseEnter:Jo([M,W]),onMouseLeave:Jo([q,se]),onTouchStart:Jo([U,me]),disabled:!!A,target:C,...je&&{style:je},...Ie&&{className:Ie},...A&&bI,...Ue&&xI,...$&&We&&yI}}var V0={},gI={className:"active"},bI={role:"link","aria-disabled":!0},xI={"data-status":"active","aria-current":"page"},yI={"data-transitioning":"transitioning"},Cu=new WeakMap,EI={rootMargin:"100px"},Jo=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function TI(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function vI(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Sc=S.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:i,...o}=mI(r,t),l=typeof r.children=="function"?r.children({isActive:o["data-status"]==="active"}):r.children;if(!n){const{disabled:c,...f}=o;return S.createElement("a",f,l)}return S.createElement(n,o,l)});function SI(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var CI=class extends kw{constructor(e){super(e),this.useMatch=t=>oo({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>Bw({...t,from:this.id}),this.useSearch=t=>jw({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Oh({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Pw({...t,from:this.id}),this.useLoaderData=t=>Dw({...t,from:this.id}),this.useNavigate=()=>yl({from:this.fullPath}),this.Link=De.forwardRef((t,n)=>g.jsx(Sc,{ref:n,from:this.fullPath,...t}))}};function lo(e){return new CI(e)}var wI=class extends eI{constructor(e){super(e),this.useMatch=t=>oo({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>Bw({...t,from:this.id}),this.useSearch=t=>jw({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Oh({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Pw({...t,from:this.id}),this.useLoaderData=t=>Dw({...t,from:this.id}),this.useNavigate=()=>yl({from:this.fullPath}),this.Link=De.forwardRef((t,n)=>g.jsx(Sc,{ref:n,from:this.fullPath,...t}))}};function kI(e){return new wI(e)}function AI(e){const t=Ur(),n=`not-found-${cr(t.stores.location,r=>r.pathname)}-${cr(t.stores.status,r=>r)}`;return g.jsx(Vb,{getResetKey:()=>n,onCatch:(r,i)=>{if(er(r))e.onCatch?.(r,i);else throw r},errorComponent:({error:r})=>{if(er(r))return e.fallback?.(r);throw r},children:e.children})}function _I(){return g.jsx("p",{children:"Not Found"})}function nl(e){return g.jsx(g.Fragment,{children:e.children})}function Hw(e,t,n){return t.options.notFoundComponent?g.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?g.jsx(e.options.defaultNotFoundComponent,{...n}):g.jsx(_I,{})}function NI(e){return null}function RI(){return NI(Ur()),null}var OI=(e,t)=>e.routeId===t.routeId&&e._displayPending===t._displayPending,II=(e,t)=>e[0]===t[0]&&e[1]===t[1],Uw=S.memo(function({matchId:t}){const n=Ur(),r=n.stores.matchStores.get(t);r||ii();const i=cr(n.stores.loadedAt,l=>l),o=cr(r,l=>l,OI);return g.jsx(LI,{router:n,matchId:t,resetKey:i,matchState:S.useMemo(()=>{const l=o.routeId,c=n.routesById[l].parentRoute?.id;return{routeId:l,ssr:o.ssr,_displayPending:o._displayPending,parentRouteId:c}},[o._displayPending,o.routeId,o.ssr,n.routesById])})});function LI({router:e,matchId:t,resetKey:n,matchState:r}){const i=e.routesById[r.routeId],o=i.options.pendingComponent??e.options.defaultPendingComponent,l=o?g.jsx(o,{}):null,c=i.options.errorComponent??e.options.defaultErrorComponent,f=i.options.onCatch??e.options.defaultOnCatch,d=i.isRoot?i.options.notFoundComponent??e.options.notFoundRoute?.options.component:i.options.notFoundComponent,m=r.ssr===!1||r.ssr==="data-only",p=(!i.isRoot||i.options.wrapInSuspense||m)&&(i.options.wrapInSuspense??o??(i.options.errorComponent?.preload||m))?S.Suspense:nl,b=c?Vb:nl,y=d?AI:nl;return g.jsxs(i.isRoot?i.options.shellComponent??nl:nl,{children:[g.jsx(Rh.Provider,{value:t,children:g.jsx(p,{fallback:l,children:g.jsx(b,{getResetKey:()=>n,errorComponent:c||$b,onCatch:(E,w)=>{if(er(E))throw E.routeId??=r.routeId,E;f?.(E,w)},children:g.jsx(y,{fallback:E=>{if(E.routeId??=r.routeId,!d||E.routeId&&E.routeId!==r.routeId||!E.routeId&&!i.isRoot)throw E;return S.createElement(d,E)},children:m||r._displayPending?g.jsx(nI,{fallback:l,children:g.jsx($v,{matchId:t})}):g.jsx($v,{matchId:t})})})})}),r.parentRouteId===Ga?g.jsxs(g.Fragment,{children:[g.jsx(MI,{}),e.options.scrollRestoration&&uw?g.jsx(RI,{}):null]}):null]})}function MI(){const e=Ur(),t=S.useRef();return ju(()=>{const n=e.stores.resolvedLocation.get(),r=t.current;n&&(!r||r.href!==n.href)&&e.emit({type:"onRendered",...ll(e.stores.location.get(),r??n)}),t.current=n},[cr(e.stores.resolvedLocation,n=>n?.state.__TSR_key),e]),null}var $v=S.memo(function({matchId:t}){const n=Ur(),r=(m,p)=>n.getMatch(m.id)?._nonReactive[p]??m._nonReactive[p],i=n.stores.matchStores.get(t);i||ii();const o=cr(i,m=>m),l=o.routeId,c=n.routesById[l],f=S.useMemo(()=>{const m=(n.routesById[l].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:l,loaderDeps:o.loaderDeps,params:o._strictParams,search:o._strictSearch});return m?JSON.stringify(m):void 0},[l,o.loaderDeps,o._strictParams,o._strictSearch,n.options.defaultRemountDeps,n.routesById]),d=S.useMemo(()=>{const m=c.options.component??n.options.defaultComponent;return m?g.jsx(m,{},f):g.jsx(zw,{})},[f,c.options.component,n.options.defaultComponent]);if(o._displayPending)throw r(o,"displayPendingPromise");if(o._forcePending)throw r(o,"minPendingPromise");if(o.status==="pending"){const m=c.options.pendingMinMs??n.options.defaultPendingMinMs;if(m){const p=n.getMatch(o.id);if(p&&!p._nonReactive.minPendingPromise){const b=fl();p._nonReactive.minPendingPromise=b,setTimeout(()=>{b.resolve(),p._nonReactive.minPendingPromise=void 0},m)}}throw r(o,"loadPromise")}if(o.status==="notFound")return er(o.error)||ii(),Hw(n,c,o.error);if(o.status==="redirected")throw wr(o.error)||ii(),r(o,"loadPromise");if(o.status==="error")throw o.error;return d}),zw=S.memo(function(){const t=Ur(),n=S.useContext(Rh);let r,i=!1,o;{const d=n?t.stores.matchStores.get(n):void 0;[r,i]=cr(d,m=>[m?.routeId,m?.globalNotFound??!1],II),o=cr(t.stores.matchesId,m=>m[m.findIndex(p=>p===n)+1])}const l=r?t.routesById[r]:void 0,c=t.options.defaultPendingComponent?g.jsx(t.options.defaultPendingComponent,{}):null;if(i)return l||ii(),Hw(t,l,void 0);if(!o)return null;const f=g.jsx(Uw,{matchId:o});return r===Ga?g.jsx(S.Suspense,{fallback:c,children:f}):f});function DI(){const e=Ur(),t=S.useRef({router:e,mounted:!1}),[n,r]=S.useState(!1),i=cr(e.stores.isLoading,p=>p),o=cr(e.stores.hasPending,p=>p),l=O0(i),c=i||n||o,f=O0(c),d=i||o,m=O0(d);return e.startTransition=p=>{r(!0),S.startTransition(()=>{p(),r(!1)})},S.useEffect(()=>{const p=e.history.subscribe(e.load),b=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return si(e.latestLocation.publicHref)!==si(b.publicHref)&&e.commitLocation({...b,replace:!0}),()=>{p()}},[e,e.history]),ju(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(b){console.error(b)}})()},[e]),ju(()=>{l&&!i&&e.emit({type:"onLoad",...ll(e.stores.location.get(),e.stores.resolvedLocation.get())})},[l,e,i]),ju(()=>{m&&!d&&e.emit({type:"onBeforeRouteMount",...ll(e.stores.location.get(),e.stores.resolvedLocation.get())})},[d,m,e]),ju(()=>{if(f&&!c){const p=ll(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:"onResolved",...p}),Rw(()=>{e.stores.status.set("idle"),e.stores.resolvedLocation.set(e.stores.location.get())})}},[c,f,e]),null}function PI(){const e=Ur(),t=e.routesById[Ga].options.pendingComponent??e.options.defaultPendingComponent,n=t?g.jsx(t,{}):null,r=g.jsxs(typeof document<"u"&&e.ssr?nl:S.Suspense,{fallback:n,children:[g.jsx(DI,{}),g.jsx(jI,{})]});return e.options.InnerWrap?g.jsx(e.options.InnerWrap,{children:r}):r}function jI(){const e=Ur(),t=cr(e.stores.firstId,i=>i),n=cr(e.stores.loadedAt,i=>i),r=t?g.jsx(Uw,{matchId:t}):null;return g.jsx(Rh.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:g.jsx(Vb,{getResetKey:()=>n,errorComponent:$b,onCatch:void 0,children:r})})}var BI=e=>({createMutableStore:Hv,createReadonlyStore:Hv,batch:Rw}),HI=e=>new UI(e),UI=class extends Y4{constructor(e){super(e,BI)}};function zI({router:e,children:t,...n}){fw(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=g.jsx(_w.Provider,{value:e,children:t});return e.options.Wrap?g.jsx(e.options.Wrap,{children:r}):r}function FI({router:e,...t}){return g.jsx(zI,{router:e,...t,children:g.jsx(PI,{})})}function VI(e){const t=Ur({warn:e?.router===void 0}),n=e?.router||t;return cr(n.stores.__store,Mw(e,n))}function Fw(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Fw(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ih(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Fw(e))&&(r&&(r+=" "),r+=t);return r}const qv=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Yv=Ih,Vw=(e,t)=>n=>{var r;if(t?.variants==null)return Yv(e,n?.class,n?.className);const{variants:i,defaultVariants:o}=t,l=Object.keys(i).map(d=>{const m=n?.[d],p=o?.[d];if(m===null)return null;const b=qv(m)||qv(p);return i[d][b]}),c=n&&Object.entries(n).reduce((d,m)=>{let[p,b]=m;return b===void 0||(d[p]=b),d},{}),f=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,m)=>{let{class:p,className:b,...y}=m;return Object.entries(y).every(E=>{let[w,k]=E;return Array.isArray(k)?k.includes({...o,...c}[w]):{...o,...c}[w]===k})?[...d,p,b]:d},[]);return Yv(e,l,f,n?.class,n?.className)},$I=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},qI=(e,t)=>({classGroupId:e,validator:t}),$w=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Jd="-",Gv=[],YI="arbitrary..",GI=e=>{const t=KI(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return XI(l);const c=l.split(Jd),f=c[0]===""&&c.length>1?1:0;return qw(c,f,t)},getConflictingClassGroupIds:(l,c)=>{if(c){const f=r[l],d=n[l];return f?d?$I(d,f):f:d||Gv}return n[l]||Gv}}},qw=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],o=n.nextPart.get(i);if(o){const d=qw(e,t+1,o);if(d)return d}const l=n.validators;if(l===null)return;const c=t===0?e.join(Jd):e.slice(t).join(Jd),f=l.length;for(let d=0;d<f;d++){const m=l[d];if(m.validator(c))return m.classGroupId}},XI=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?YI+r:void 0})(),KI=e=>{const{theme:t,classGroups:n}=e;return QI(n,t)},QI=(e,t)=>{const n=$w();for(const r in e){const i=e[r];qb(i,n,r,t)}return n},qb=(e,t,n,r)=>{const i=e.length;for(let o=0;o<i;o++){const l=e[o];WI(l,t,n,r)}},WI=(e,t,n,r)=>{if(typeof e=="string"){ZI(e,t,n);return}if(typeof e=="function"){JI(e,t,n,r);return}e5(e,t,n,r)},ZI=(e,t,n)=>{const r=e===""?t:Yw(t,e);r.classGroupId=n},JI=(e,t,n,r)=>{if(t5(e)){qb(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(qI(n,e))},e5=(e,t,n,r)=>{const i=Object.entries(e),o=i.length;for(let l=0;l<o;l++){const[c,f]=i[l];qb(f,Yw(t,c),n,r)}},Yw=(e,t)=>{let n=e;const r=t.split(Jd),i=r.length;for(let o=0;o<i;o++){const l=r[o];let c=n.nextPart.get(l);c||(c=$w(),n.nextPart.set(l,c)),n=c}return n},t5=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,n5=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(o,l)=>{n[o]=l,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(o){let l=n[o];if(l!==void 0)return l;if((l=r[o])!==void 0)return i(o,l),l},set(o,l){o in n?n[o]=l:i(o,l)}}},Fg="!",Xv=":",r5=[],Kv=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),s5=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const o=[];let l=0,c=0,f=0,d;const m=i.length;for(let w=0;w<m;w++){const k=i[w];if(l===0&&c===0){if(k===Xv){o.push(i.slice(f,w)),f=w+1;continue}if(k==="/"){d=w;continue}}k==="["?l++:k==="]"?l--:k==="("?c++:k===")"&&c--}const p=o.length===0?i:i.slice(f);let b=p,y=!1;p.endsWith(Fg)?(b=p.slice(0,-1),y=!0):p.startsWith(Fg)&&(b=p.slice(1),y=!0);const E=d&&d>f?d-f:void 0;return Kv(o,y,b,E)};if(t){const i=t+Xv,o=r;r=l=>l.startsWith(i)?o(l.slice(i.length)):Kv(r5,!1,l,void 0,!0)}if(n){const i=r;r=o=>n({className:o,parseClassName:i})}return r},i5=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let o=0;o<n.length;o++){const l=n[o],c=l[0]==="[",f=t.has(l);c||f?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(l)):i.push(l)}return i.length>0&&(i.sort(),r.push(...i)),r}},a5=e=>({cache:n5(e.cacheSize),parseClassName:s5(e),sortModifiers:i5(e),postfixLookupClassGroupIds:o5(e),...GI(e)}),o5=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)t[n[r]]=!0;return t},l5=/\s+/,u5=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:o,postfixLookupClassGroupIds:l}=t,c=[],f=e.trim().split(l5);let d="";for(let m=f.length-1;m>=0;m-=1){const p=f[m],{isExternal:b,modifiers:y,hasImportantModifier:E,baseClassName:w,maybePostfixModifierPosition:k}=n(p);if(b){d=p+(d.length>0?" "+d:d);continue}let C=!!k,A;if(C){const j=w.substring(0,k);A=r(j);const M=A&&l[A]?r(w):void 0;M&&M!==A&&(A=M,C=!1)}else A=r(w);if(!A){if(!C){d=p+(d.length>0?" "+d:d);continue}if(A=r(w),!A){d=p+(d.length>0?" "+d:d);continue}C=!1}const _=y.length===0?"":y.length===1?y[0]:o(y).join(":"),N=E?_+Fg:_,D=N+A;if(c.indexOf(D)>-1)continue;c.push(D);const O=i(A,C);for(let j=0;j<O.length;++j){const M=O[j];c.push(N+M)}d=p+(d.length>0?" "+d:d)}return d},c5=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=Gw(n))&&(i&&(i+=" "),i+=r);return i},Gw=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Gw(e[r]))&&(n&&(n+=" "),n+=t);return n},Vg=(e,...t)=>{let n,r,i,o;const l=f=>{const d=t.reduce((m,p)=>p(m),e());return n=a5(d),r=n.cache.get,i=n.cache.set,o=c,c(f)},c=f=>{const d=r(f);if(d)return d;const m=u5(f,n);return i(f,m),m};return o=l,(...f)=>o(c5(...f))},f5=[],Ln=e=>{const t=n=>n[e]||f5;return t.isThemeGetter=!0,t},Xw=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Kw=/^\((?:(\w[\w-]*):)?(.+)\)$/i,d5=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,h5=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,p5=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,m5=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,g5=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,b5=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Bi=e=>d5.test(e),xt=e=>!!e&&!Number.isNaN(Number(e)),xs=e=>!!e&&Number.isInteger(Number(e)),$0=e=>e.endsWith("%")&&xt(e.slice(0,-1)),Js=e=>h5.test(e),Qw=()=>!0,x5=e=>p5.test(e)&&!m5.test(e),Yb=()=>!1,y5=e=>g5.test(e),E5=e=>b5.test(e),T5=e=>!Ge(e)&&!Ke(e),v5=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),S5=e=>aa(e,Jw,Yb),Ge=e=>Xw.test(e),Ia=e=>aa(e,ek,x5),Qv=e=>aa(e,O5,xt),C5=e=>aa(e,nk,Qw),w5=e=>aa(e,tk,Yb),Wv=e=>aa(e,Ww,Yb),k5=e=>aa(e,Zw,E5),rd=e=>aa(e,rk,y5),Ke=e=>Kw.test(e),wu=e=>uo(e,ek),A5=e=>uo(e,tk),Zv=e=>uo(e,Ww),_5=e=>uo(e,Jw),N5=e=>uo(e,Zw),sd=e=>uo(e,rk,!0),R5=e=>uo(e,nk,!0),aa=(e,t,n)=>{const r=Xw.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},uo=(e,t,n=!1)=>{const r=Kw.exec(e);return r?r[1]?t(r[1]):n:!1},Ww=e=>e==="position"||e==="percentage",Zw=e=>e==="image"||e==="url",Jw=e=>e==="length"||e==="size"||e==="bg-size",ek=e=>e==="length",O5=e=>e==="number",tk=e=>e==="family-name",nk=e=>e==="number"||e==="weight",rk=e=>e==="shadow",$g=()=>{const e=Ln("color"),t=Ln("font"),n=Ln("text"),r=Ln("font-weight"),i=Ln("tracking"),o=Ln("leading"),l=Ln("breakpoint"),c=Ln("container"),f=Ln("spacing"),d=Ln("radius"),m=Ln("shadow"),p=Ln("inset-shadow"),b=Ln("text-shadow"),y=Ln("drop-shadow"),E=Ln("blur"),w=Ln("perspective"),k=Ln("aspect"),C=Ln("ease"),A=Ln("animate"),_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],N=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...N(),Ke,Ge],O=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],M=()=>[Ke,Ge,f],q=()=>[Bi,"full","auto",...M()],U=()=>[xs,"none","subgrid",Ke,Ge],Q=()=>["auto",{span:["full",xs,Ke,Ge]},xs,Ke,Ge],Z=()=>[xs,"auto",Ke,Ge],G=()=>["auto","min","max","fr",Ke,Ge],ee=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...M()],K=()=>[Bi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],te=()=>[Bi,"screen","full","dvw","lvw","svw","min","max","fit",...M()],le=()=>[Bi,"screen","full","lh","dvh","lvh","svh","min","max","fit",...M()],I=()=>[e,Ke,Ge],P=()=>[...N(),Zv,Wv,{position:[Ke,Ge]}],$=()=>["no-repeat",{repeat:["","x","y","space","round"]}],L=()=>["auto","cover","contain",_5,S5,{size:[Ke,Ge]}],ae=()=>[$0,wu,Ia],ie=()=>["","none","full",d,Ke,Ge],fe=()=>["",xt,wu,Ia],de=()=>["solid","dashed","dotted","double"],he=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ve=()=>[xt,$0,Zv,Wv],Ue=()=>["","none",E,Ke,Ge],Pe=()=>["none",xt,Ke,Ge],Te=()=>["none",xt,Ke,Ge],Ie=()=>[xt,Ke,Ge],je=()=>[Bi,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Js],breakpoint:[Js],color:[Qw],container:[Js],"drop-shadow":[Js],ease:["in","out","in-out"],font:[T5],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Js],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Js],shadow:[Js],spacing:["px",xt],text:[Js],"text-shadow":[Js],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Bi,Ge,Ke,k]}],container:["container"],"container-type":[{"@container":["","normal","size",Ke,Ge]}],"container-named":[v5],columns:[{columns:[xt,Ge,Ke,c]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:D()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:q()}],"inset-x":[{"inset-x":q()}],"inset-y":[{"inset-y":q()}],start:[{"inset-s":q(),start:q()}],end:[{"inset-e":q(),end:q()}],"inset-bs":[{"inset-bs":q()}],"inset-be":[{"inset-be":q()}],top:[{top:q()}],right:[{right:q()}],bottom:[{bottom:q()}],left:[{left:q()}],visibility:["visible","invisible","collapse"],z:[{z:[xs,"auto",Ke,Ge]}],basis:[{basis:[Bi,"full","auto",c,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[xt,Bi,"auto","initial","none",Ge]}],grow:[{grow:["",xt,Ke,Ge]}],shrink:[{shrink:["",xt,Ke,Ge]}],order:[{order:[xs,"first","last","none",Ke,Ge]}],"grid-cols":[{"grid-cols":U()}],"col-start-end":[{col:Q()}],"col-start":[{"col-start":Z()}],"col-end":[{"col-end":Z()}],"grid-rows":[{"grid-rows":U()}],"row-start-end":[{row:Q()}],"row-start":[{"row-start":Z()}],"row-end":[{"row-end":Z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":G()}],"auto-rows":[{"auto-rows":G()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...ee(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...ee()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":ee()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],p:[{p:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pbs:[{pbs:M()}],pbe:[{pbe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],m:[{m:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mbs:[{mbs:H()}],mbe:[{mbe:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:K()}],"inline-size":[{inline:["auto",...te()]}],"min-inline-size":[{"min-inline":["auto",...te()]}],"max-inline-size":[{"max-inline":["none",...te()]}],"block-size":[{block:["auto",...le()]}],"min-block-size":[{"min-block":["auto",...le()]}],"max-block-size":[{"max-block":["none",...le()]}],w:[{w:[c,"screen",...K()]}],"min-w":[{"min-w":[c,"screen","none",...K()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[l]},...K()]}],h:[{h:["screen","lh",...K()]}],"min-h":[{"min-h":["screen","lh","none",...K()]}],"max-h":[{"max-h":["screen","lh",...K()]}],"font-size":[{text:["base",n,wu,Ia]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,R5,C5]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",$0,Ge]}],"font-family":[{font:[A5,w5,t]}],"font-features":[{"font-features":[Ge]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,Ke,Ge]}],"line-clamp":[{"line-clamp":[xt,"none",Ke,Qv]}],leading:[{leading:[o,...M()]}],"list-image":[{"list-image":["none",Ke,Ge]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ke,Ge]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...de(),"wavy"]}],"text-decoration-thickness":[{decoration:[xt,"from-font","auto",Ke,Ia]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[xt,"auto",Ke,Ge]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"tab-size":[{tab:[xs,Ke,Ge]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ke,Ge]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ke,Ge]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:$()}],"bg-size":[{bg:L()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},xs,Ke,Ge],radial:["",Ke,Ge],conic:[xs,Ke,Ge]},N5,k5]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:ae()}],"gradient-via-pos":[{via:ae()}],"gradient-to-pos":[{to:ae()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:ie()}],"rounded-s":[{"rounded-s":ie()}],"rounded-e":[{"rounded-e":ie()}],"rounded-t":[{"rounded-t":ie()}],"rounded-r":[{"rounded-r":ie()}],"rounded-b":[{"rounded-b":ie()}],"rounded-l":[{"rounded-l":ie()}],"rounded-ss":[{"rounded-ss":ie()}],"rounded-se":[{"rounded-se":ie()}],"rounded-ee":[{"rounded-ee":ie()}],"rounded-es":[{"rounded-es":ie()}],"rounded-tl":[{"rounded-tl":ie()}],"rounded-tr":[{"rounded-tr":ie()}],"rounded-br":[{"rounded-br":ie()}],"rounded-bl":[{"rounded-bl":ie()}],"border-w":[{border:fe()}],"border-w-x":[{"border-x":fe()}],"border-w-y":[{"border-y":fe()}],"border-w-s":[{"border-s":fe()}],"border-w-e":[{"border-e":fe()}],"border-w-bs":[{"border-bs":fe()}],"border-w-be":[{"border-be":fe()}],"border-w-t":[{"border-t":fe()}],"border-w-r":[{"border-r":fe()}],"border-w-b":[{"border-b":fe()}],"border-w-l":[{"border-l":fe()}],"divide-x":[{"divide-x":fe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":fe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...de(),"hidden","none"]}],"divide-style":[{divide:[...de(),"hidden","none"]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...de(),"none","hidden"]}],"outline-offset":[{"outline-offset":[xt,Ke,Ge]}],"outline-w":[{outline:["",xt,wu,Ia]}],"outline-color":[{outline:I()}],shadow:[{shadow:["","none",m,sd,rd]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":["none",p,sd,rd]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:fe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[xt,Ia]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":fe()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":["none",b,sd,rd]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[xt,Ke,Ge]}],"mix-blend":[{"mix-blend":[...he(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":he()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[xt]}],"mask-image-linear-from-pos":[{"mask-linear-from":ve()}],"mask-image-linear-to-pos":[{"mask-linear-to":ve()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":ve()}],"mask-image-t-to-pos":[{"mask-t-to":ve()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":ve()}],"mask-image-r-to-pos":[{"mask-r-to":ve()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":ve()}],"mask-image-b-to-pos":[{"mask-b-to":ve()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":ve()}],"mask-image-l-to-pos":[{"mask-l-to":ve()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":ve()}],"mask-image-x-to-pos":[{"mask-x-to":ve()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":ve()}],"mask-image-y-to-pos":[{"mask-y-to":ve()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[Ke,Ge]}],"mask-image-radial-from-pos":[{"mask-radial-from":ve()}],"mask-image-radial-to-pos":[{"mask-radial-to":ve()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":N()}],"mask-image-conic-pos":[{"mask-conic":[xt]}],"mask-image-conic-from-pos":[{"mask-conic-from":ve()}],"mask-image-conic-to-pos":[{"mask-conic-to":ve()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:$()}],"mask-size":[{mask:L()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ke,Ge]}],filter:[{filter:["","none",Ke,Ge]}],blur:[{blur:Ue()}],brightness:[{brightness:[xt,Ke,Ge]}],contrast:[{contrast:[xt,Ke,Ge]}],"drop-shadow":[{"drop-shadow":["","none",y,sd,rd]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:["",xt,Ke,Ge]}],"hue-rotate":[{"hue-rotate":[xt,Ke,Ge]}],invert:[{invert:["",xt,Ke,Ge]}],saturate:[{saturate:[xt,Ke,Ge]}],sepia:[{sepia:["",xt,Ke,Ge]}],"backdrop-filter":[{"backdrop-filter":["","none",Ke,Ge]}],"backdrop-blur":[{"backdrop-blur":Ue()}],"backdrop-brightness":[{"backdrop-brightness":[xt,Ke,Ge]}],"backdrop-contrast":[{"backdrop-contrast":[xt,Ke,Ge]}],"backdrop-grayscale":[{"backdrop-grayscale":["",xt,Ke,Ge]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[xt,Ke,Ge]}],"backdrop-invert":[{"backdrop-invert":["",xt,Ke,Ge]}],"backdrop-opacity":[{"backdrop-opacity":[xt,Ke,Ge]}],"backdrop-saturate":[{"backdrop-saturate":[xt,Ke,Ge]}],"backdrop-sepia":[{"backdrop-sepia":["",xt,Ke,Ge]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ke,Ge]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[xt,"initial",Ke,Ge]}],ease:[{ease:["linear","initial",C,Ke,Ge]}],delay:[{delay:[xt,Ke,Ge]}],animate:[{animate:["none",A,Ke,Ge]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,Ke,Ge]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:Pe()}],"rotate-x":[{"rotate-x":Pe()}],"rotate-y":[{"rotate-y":Pe()}],"rotate-z":[{"rotate-z":Pe()}],scale:[{scale:Te()}],"scale-x":[{"scale-x":Te()}],"scale-y":[{"scale-y":Te()}],"scale-z":[{"scale-z":Te()}],"scale-3d":["scale-3d"],skew:[{skew:Ie()}],"skew-x":[{"skew-x":Ie()}],"skew-y":[{"skew-y":Ie()}],transform:[{transform:[Ke,Ge,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:je()}],"translate-x":[{"translate-x":je()}],"translate-y":[{"translate-y":je()}],"translate-z":[{"translate-z":je()}],"translate-none":["translate-none"],zoom:[{zoom:[xs,Ke,Ge]}],accent:[{accent:I()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ke,Ge]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mbs":[{"scroll-mbs":M()}],"scroll-mbe":[{"scroll-mbe":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pbs":[{"scroll-pbs":M()}],"scroll-pbe":[{"scroll-pbe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ke,Ge]}],fill:[{fill:["none",...I()]}],"stroke-w":[{stroke:[xt,wu,Ia,Qv]}],stroke:[{stroke:["none",...I()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},I5=(e,{cacheSize:t,prefix:n,experimentalParseClassName:r,extend:i={},override:o={}})=>(rl(e,"cacheSize",t),rl(e,"prefix",n),rl(e,"experimentalParseClassName",r),id(e.theme,o.theme),id(e.classGroups,o.classGroups),id(e.conflictingClassGroups,o.conflictingClassGroups),id(e.conflictingClassGroupModifiers,o.conflictingClassGroupModifiers),rl(e,"postfixLookupClassGroups",o.postfixLookupClassGroups),rl(e,"orderSensitiveModifiers",o.orderSensitiveModifiers),ad(e.theme,i.theme),ad(e.classGroups,i.classGroups),ad(e.conflictingClassGroups,i.conflictingClassGroups),ad(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),qg(e,i,"postfixLookupClassGroups"),qg(e,i,"orderSensitiveModifiers"),e),rl=(e,t,n)=>{n!==void 0&&(e[t]=n)},id=(e,t)=>{if(t)for(const n in t)rl(e,n,t[n])},ad=(e,t)=>{if(t)for(const n in t)qg(e,t,n)},qg=(e,t,n)=>{const r=t[n];r!==void 0&&(e[n]=e[n]?e[n].concat(r):r)},L5=(e,...t)=>typeof e=="function"?Vg($g,e,...t):Vg(()=>I5($g(),e),...t),sk=Vg($g),M5=L5({extend:{classGroups:{"font-size":[{text:["display-xl","display-lg","display-md","display-sm","heading-1","heading-2","heading-3","body","body-sm","label","code"]}]}}});function He(...e){return M5(Ih(e))}const D5=Vw("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-colors outline-none select-none focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:ring-offset-1 focus-visible:ring-offset-bg disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-accent-hover",outline:"border-border bg-surface hover:border-border-strong hover:bg-surface-hover",secondary:"bg-secondary text-secondary-foreground hover:bg-surface-hover",ghost:"text-fg-2 hover:bg-surface-hover hover:text-foreground",destructive:"text-danger hover:bg-danger-bg",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-3",xs:"h-6 gap-1 px-2 text-xs [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 px-2.5 text-xs",lg:"h-9 gap-1.5 px-3.5",icon:"size-8","icon-sm":"size-7"}},defaultVariants:{variant:"default",size:"default"}}),$t=S.forwardRef(({className:e,variant:t="default",size:n="default",type:r="button",...i},o)=>g.jsx("button",{ref:o,type:r,"data-slot":"button",className:He(D5({variant:t,size:n,className:e})),...i}));$t.displayName="Button";const P5=Vw("inline-flex items-center gap-1.5 rounded-full border px-2 py-0.5 text-label font-medium whitespace-nowrap",{variants:{variant:{neutral:"border-border bg-surface text-fg-2",accent:"border-transparent bg-accent-bg text-fg-1",success:"border-transparent bg-success-bg text-success",warning:"border-transparent bg-warning-bg text-warning",danger:"border-transparent bg-danger-bg text-danger",info:"border-transparent bg-info-bg text-info"},mono:{true:"font-mono text-code",false:""}},defaultVariants:{variant:"neutral",mono:!1}});function ts({className:e,variant:t="neutral",mono:n,dot:r,children:i,...o}){return g.jsxs("span",{"data-slot":"badge",className:He(P5({variant:t,mono:n,className:e})),...o,children:[r?g.jsx("span",{"aria-hidden":!0,className:"size-1.5 rounded-full bg-current"}):null,i]})}function As({className:e,...t}){return g.jsx("div",{"data-slot":"card",className:He("rounded-lg border border-border bg-surface",e),...t})}function _s({className:e,...t}){return g.jsx("div",{className:He("flex items-start justify-between gap-3 px-4 pt-3.5 pb-3",e),...t})}function Ns({className:e,...t}){return g.jsx("h3",{className:He("text-heading-3 font-semibold text-text",e),...t})}function Rs({className:e,...t}){return g.jsx("div",{className:He("px-4 pb-4",e),...t})}const bn=S.forwardRef(({className:e,...t},n)=>g.jsx("input",{ref:n,"data-slot":"input",className:He("h-8 w-full rounded-md border border-border bg-bg px-2.5 text-body-sm text-text","placeholder:text-fg-4 transition-colors outline-none","hover:border-border-strong focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/40","disabled:pointer-events-none disabled:opacity-50",e),...t}));bn.displayName="Input";const Gb=S.forwardRef(({className:e,...t},n)=>g.jsx("textarea",{ref:n,"data-slot":"textarea",className:He("w-full resize-none rounded-md border border-border bg-bg px-2.5 py-2 text-body-sm text-text","placeholder:text-fg-4 transition-colors outline-none","hover:border-border-strong focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/40","disabled:pointer-events-none disabled:opacity-50",e),...t}));Gb.displayName="Textarea";const ik={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},ak={...ik,position:"fixed",top:0,left:0},j5={...ik,position:"absolute"},Jv={};function jr(e,t){const n=S.useRef(Jv);return n.current===Jv&&(n.current=e(t)),n}function cc(e,t,n,r){const i=jr(ok).current;return H5(i,e,t,n,r)&&lk(i,[e,t,n,r]),i.callback}function B5(e){const t=jr(ok).current;return U5(t,e)&&lk(t,e),t.callback}function ok(){return{callback:null,cleanup:null,refs:[]}}function H5(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function U5(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function lk(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const r=Array(t.length).fill(null);for(let i=0;i<t.length;i+=1){const o=t[i];if(o!=null)switch(typeof o){case"function":{const l=o(n);typeof l=="function"&&(r[i]=l);break}case"object":{o.current=n;break}}}e.cleanup=()=>{for(let i=0;i<t.length;i+=1){const o=t[i];if(o!=null)switch(typeof o){case"function":{const l=r[i];typeof l=="function"?l():o(null);break}case"object":{o.current=null;break}}}}}}}function Xb(e){const t=S.useRef(!0);t.current&&(t.current=!1,e())}function z5(e){const[t,n]=S.useState({current:e,previous:null});return e!==t.current&&n({current:e,previous:t.current}),t.previous}function F5(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}function e2({controlled:e,default:t,name:n,state:r="value"}){const{current:i}=S.useRef(e!==void 0),[o,l]=S.useState(t),c=i?e:o,f=S.useCallback(d=>{i||l(d)},[]);return[c,f]}const V5=()=>{},Ve=typeof document<"u"?S.useLayoutEffect:V5,Kb={...$O},q0=Kb.useInsertionEffect,$5=q0&&q0!==Kb.useLayoutEffect?q0:e=>e();function Je(e){const t=jr(q5).current;return t.next=e,$5(t.effect),t.trampoline}function q5(){const e={next:void 0,callback:Y5,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Y5(){}function xn(e){const t=jr(G5,e).current;return t.next=e,Ve(t.effect),t}function G5(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function X5(e,t){return function(r,...i){const o=new URL(e);return o.searchParams.set("code",r.toString()),i.forEach(l=>o.searchParams.append("args[]",l)),`${t} error #${r}; visit ${o} for the full message.`}}const dr=X5("https://base-ui.com/production-error","Base UI"),ze=(e,t,n,r,i,o,...l)=>{if(l.length>0)throw new Error(dr(1));let c;if(e)c=e;else throw new Error("Missing arguments");return c};var uk=Iw();const K5=parseInt(S.version,10);function Qb(e){return K5>=e}const Yg=[];let Gg;function Q5(){return Gg}function W5(e){Yg.push(e)}function ck(e){const t=(n,r)=>{const i=jr(J5).current;let o;try{Gg=i;for(const l of Yg)l.before(i);o=e(n,r);for(const l of Yg)l.after(i);i.didInitialize=!0}finally{Gg=void 0}return o};return t.displayName=e.displayName||e.name,t}function Z5(e){return S.forwardRef(ck(e))}function J5(){return{didInitialize:!1}}const eL=Qb(19),tL=eL?rL:sL;function ct(e,t,n,r,i){return tL(e,t,n,r,i)}function nL(e,t,n,r,i){const o=S.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return uk.useSyncExternalStore(e.subscribe,o,o)}W5({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){const r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const n=new Set;for(const i of e.syncHooks)n.add(i.store);const r=[];for(const i of n)r.push(i.subscribe(t));return()=>{for(const i of r)i()}}),uk.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function rL(e,t,n,r,i){const o=Q5();if(!o)return nL(e,t,n,r,i);const l=o.syncIndex;o.syncIndex+=1;let c;return o.didInitialize?(c=o.syncHooks[l],(c.store!==e||c.selector!==t||!Object.is(c.a1,n)||!Object.is(c.a2,r)||!Object.is(c.a3,i))&&(c.store!==e&&(o.didChangeStore=!0),c.store=e,c.selector=t,c.a1=n,c.a2=r,c.a3=i,c.value=t(e.getSnapshot(),n,r,i))):(c={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},o.syncHooks.push(c)),c.value}function sL(e,t,n,r,i){return Lw.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,o=>t(o,n,r,i))}class fk{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,i){return ct(this,t,n,r,i)}}function Un(){}const Xg=Object.freeze([]),Rn=Object.freeze({});class Wb extends fk{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){S.useDebugValue(t);const r=this;Ve(()=>{r.state[t]!==n&&r.set(t,n)},[r,t,n])}useSyncedValueWithCleanup(t,n){const r=this;Ve(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);Ve(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){S.useDebugValue(t);const r=this,i=n!==void 0;Ve(()=>{i&&!Object.is(r.state[t],n)&&r.setState({...r.state,[t]:n})},[r,t,n,i])}select(t,n,r,i){const o=this.selectors[t];return o(this.state,n,r,i)}useState(t,n,r,i){return S.useDebugValue(t),ct(this,this.selectors[t],n,r,i)}useContextCallback(t,n){S.useDebugValue(t);const r=Je(n??Un);this.context[t]=r}useStateSetter(t){const n=S.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let i=r(this.state);return n(i,i,this),this.subscribe(o=>{const l=r(o);if(!Object.is(i,l)){const c=i;i=l,n(l,c,this)}})}}function Lh(){return typeof window<"u"}function Qn(e){return Zb(e)?(e.nodeName||"").toLowerCase():"#document"}function sn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function di(e){var t;return(t=(Zb(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Zb(e){return Lh()?e instanceof Node||e instanceof sn(e).Node:!1}function Et(e){return Lh()?e instanceof Element||e instanceof sn(e).Element:!1}function dn(e){return Lh()?e instanceof HTMLElement||e instanceof sn(e).HTMLElement:!1}function dl(e){return!Lh()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof sn(e).ShadowRoot}function co(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Br(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!=="inline"&&i!=="contents"}function iL(e){return/^(table|td|th)$/.test(Qn(e))}function Mh(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const aL=/transform|translate|scale|rotate|perspective|filter/,oL=/paint|layout|strict|content/,La=e=>!!e&&e!=="none";let Y0;function Jb(e){const t=Et(e)?Br(e):e;return La(t.transform)||La(t.translate)||La(t.scale)||La(t.rotate)||La(t.perspective)||!e1()&&(La(t.backdropFilter)||La(t.filter))||aL.test(t.willChange||"")||oL.test(t.contain||"")}function lL(e){let t=ea(e);for(;dn(t)&&!Ji(t);){if(Jb(t))return t;if(Mh(t))return null;t=ea(t)}return null}function e1(){return Y0==null&&(Y0=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Y0}function Ji(e){return/^(html|body|#document)$/.test(Qn(e))}function Br(e){return sn(e).getComputedStyle(e)}function Dh(e){return Et(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ea(e){if(Qn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||dl(e)&&e.host||di(e);return dl(t)?t.host:t}function dk(e){const t=ea(e);return Ji(t)?(e.ownerDocument||e).body:dn(t)&&co(t)?t:dk(t)}function fc(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=dk(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),l=sn(i);if(o){const c=Kg(l);return t.concat(l,l.visualViewport||[],co(i)?i:[],c&&n?fc(c):[])}else return t.concat(i,fc(i,[],n))}function Kg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Os(...e){return()=>{for(let t=0;t<e.length;t+=1){const n=e[t];n&&n()}}}function Pt(e){return e?.ownerDocument||document}function yt(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}const uL=[];function t1(e){S.useEffect(e,uL)}const od=null;class cL{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let i=0;i<n.length;i+=1)n[i]?.(t)};request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const ld=new cL;class Cs{static create(){return new Cs}static request(t){return ld.request(t)}static cancel(t){return ld.cancel(t)}currentId=od;request(t){this.cancel(),this.currentId=ld.request(()=>{this.currentId=od,t()})}cancel=()=>{this.currentId!==od&&(ld.cancel(this.currentId),this.currentId=od)};disposeEffect=()=>this.cancel}function hl(){const e=jr(Cs.create).current;return t1(e.disposeEffect),e}const ku=0;class us{static create(){return new us}currentId=ku;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=ku,n()},t)}isStarted(){return this.currentId!==ku}clear=()=>{this.currentId!==ku&&(clearTimeout(this.currentId),this.currentId=ku)};disposeEffect=()=>this.clear}function ns(){const e=jr(us.create).current;return t1(e.disposeEffect),e}function fL(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:dL,platform:hL,maxTouchPoints:pL}=fL(),Ph=dL.toLowerCase(),dc=hL.toLowerCase(),jh=/^i(os$|p)/.test(dc)||dc==="macintel"&&pL>1,t2="android",Qg=dc===t2||Ph.includes(t2),hk=!jh&&dc.startsWith("mac");dc.startsWith("win");const mL=hk||jh,oa=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none");!oa&&Ph.includes("firefox");!oa&&Ph.includes("chrom");const gL=mL,n1=/jsdom|happydom/.test(Ph);function Ss(e){e.preventDefault(),e.stopPropagation()}function bL(e){return"nativeEvent"in e}function r1(e){return e.pointerType===""&&e.isTrusted?!0:Qg&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function pk(e){return n1?!1:!Qg&&e.width===0&&e.height===0||Qg&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function Wa(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function xL(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const Wg="data-base-ui-focusable",mk="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Bh="ArrowLeft",Hh="ArrowRight",gk="ArrowUp",s1="ArrowDown";function Sr(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function nt(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&dl(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function ur(e){return"composedPath"in e?e.composedPath()[0]:e.target}function eh(e,t){if(!Et(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,r]of t.entries())if(nt(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function G0(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function yL(e){return e.matches("html,body")}function Uh(e){return dn(e)&&e.matches(mk)}function EL(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${mk}`)!=null}function Zg(e){return e?e.getAttribute("role")==="combobox"&&Uh(e):!1}function TL(e){if(!e||n1)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function th(e){return e?e.hasAttribute(Wg)?e:e.querySelector(`[${Wg}]`)||e:null}function vL(e,t){return t!=null&&!Wa(t)?0:typeof e=="function"?e():e}function nh(e,t,n){const r=vL(e,n);return typeof r=="number"?r:r?.[t]}function n2(e){return typeof e=="function"?e():e}function bk(e,t){return t||e==="click"||e==="mousedown"}function SL(e){return e?.includes("mouse")&&e!=="mousedown"}const El="none",Cc="trigger-press",Cr="trigger-hover",Bd="trigger-focus",i1="outside-press",X0="item-press",CL="close-press",zh="focus-out",a1="escape-key",r2="list-navigation",wL="cancel-open",kL="disabled",xk="imperative-action",AL="window-resize";function vt(e,t,n,r){let i=!1,o=!1;const l=Rn;return{reason:e,event:t??new Event("base-ui"),cancel(){i=!0},allowPropagation(){o=!0},get isCanceled(){return i},get isPropagationAllowed(){return o},trigger:n,...l}}const _L=S.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new us,currentIdRef:{current:null},currentContextRef:{current:null}});function NL(e,t){e.current=t.current}function RL(e,t={open:!1}){const{open:n}=t,r="rootStore"in e?e.rootStore:e,i=r.useState("floatingId"),o=S.useContext(_L),{currentIdRef:l,delayRef:c,timeoutMs:f,initialDelayRef:d,currentContextRef:m,hasProvider:p,timeout:b}=o,[y,E]=S.useState(!1),w=S.useRef(n),k=S.useRef(!1);return Ve(()=>{w.current=n},[n]),Ve(()=>()=>{k.current=!0},[]),Ve(()=>{function C(){k.current||E(!1),m.current?.setIsInstantPhase(!1),l.current=null,m.current=null,c.current=d.current,b.clear()}if(l.current&&!n&&l.current===i){if(E(!1),f){const A=i;return b.start(f,()=>{r.select("open")||l.current&&l.current!==A||C()}),()=>{(w.current||l.current!==A)&&b.clear()}}C()}},[n,i,l,c,f,d,m,b,r]),Ve(()=>{if(!n)return;const C=m.current,A=l.current;b.clear(),m.current={onOpenChange:r.setOpen,setIsInstantPhase:E},l.current=i,c.current={open:0,close:nh(d.current,"close")},A!==null&&A!==i?(E(!0),C?.setIsInstantPhase(!0),C?.onOpenChange(!1,vt(El))):(E(!1),C?.setIsInstantPhase(!1))},[n,i,r,l,c,d,m,b]),Ve(()=>()=>{if(l.current===i){if(m.current=null,!w.current)return;l.current=null,NL(c,d),b.clear()}},[m,l,c,i,d,b]),S.useMemo(()=>({hasProvider:p,delayRef:c,isInstantPhase:y}),[p,c,y])}const rh=S.forwardRef(function(t,n){const[r,i]=S.useState();Ve(()=>{gL&&oa&&i("button")},[]);const o={tabIndex:0,role:r};return g.jsx("span",{...t,ref:n,style:ak,"aria-hidden":r?void 0:!0,...o,"data-base-ui-focus-guard":""})}),OL=["top","right","bottom","left"],pl=Math.min,ai=Math.max,sh=Math.round,ud=Math.floor,oi=e=>({x:e,y:e}),IL={left:"right",right:"left",bottom:"top",top:"bottom"};function yk(e,t,n){return ai(e,pl(t,n))}function ui(e,t){return typeof e=="function"?e(t):e}function Dr(e){return e.split("-")[0]}function la(e){return e.split("-")[1]}function o1(e){return e==="x"?"y":"x"}function l1(e){return e==="y"?"height":"width"}function es(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function u1(e){return o1(es(e))}function LL(e,t,n){n===void 0&&(n=!1);const r=la(e),i=u1(e),o=l1(i);let l=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=ih(l)),[l,ih(l)]}function ML(e){const t=ih(e);return[Jg(e),t,Jg(t)]}function Jg(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const s2=["left","right"],i2=["right","left"],DL=["top","bottom"],PL=["bottom","top"];function jL(e,t,n){switch(e){case"top":case"bottom":return n?t?i2:s2:t?s2:i2;case"left":case"right":return t?DL:PL;default:return[]}}function BL(e,t,n,r){const i=la(e);let o=jL(Dr(e),n==="start",r);return i&&(o=o.map(l=>l+"-"+i),t&&(o=o.concat(o.map(Jg)))),o}function ih(e){const t=Dr(e);return IL[t]+e.slice(t.length)}function HL(e){var t,n,r,i;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(i=e.left)!=null?i:0}}function Ek(e){return typeof e!="number"?HL(e):{top:e,right:e,bottom:e,left:e}}function hc(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function a2(e,t){return t<0||t>=e.length}function K0(e,t){return il(e.current,{disabledIndices:t})}function o2(e,t){return il(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function il(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let o=t;do o+=n?-i:i;while(o>=0&&o<=e.length-1&&Tk(e,o,r));return o}function Tk(e,t,n){if(typeof n=="function"?n(t):n?.includes(t)??!1)return!0;const i=e[t];return i?Fh(i)?!n&&(i.hasAttribute("disabled")||i.getAttribute("aria-disabled")==="true"):!0:!1}function UL(e){return e.visibility==="hidden"||e.visibility==="collapse"}function Fh(e,t=e?Br(e):null){return!e||!e.isConnected||!t||UL(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const zL='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function FL(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return dl(n)?n.host:null}function eb(e){for(const t of Array.from(e.children))if(Qn(t)==="summary")return t;return null}function VL(e,t){const n=eb(t);return!!n&&(e===n||nt(n,e))}function vk(e){const t=e?Qn(e):"";return e!=null&&e.matches(zL)&&(t!=="summary"||e.parentElement!=null&&Qn(e.parentElement)==="details"&&eb(e.parentElement)===e)&&(t!=="details"||eb(e)==null)&&(t!=="input"||e.type!=="hidden")}function Sk(e){if(!vk(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=FL(t)){const n=t!==e,r=Qn(t)==="slot";if(t.hasAttribute("inert")||n&&Qn(t)==="details"&&!t.open&&!VL(e,t)||t.hasAttribute("hidden")||!r&&!$L(t,n))return!1}return!0}function $L(e,t){const n=Br(e);return t?n.display!=="none":Fh(e,n)}function Ck(e){const t=e.tabIndex;if(t<0){const n=Qn(e);if(n==="details"||n==="audio"||n==="video"||dn(e)&&e.isContentEditable)return 0}return t}function Q0(e){if(Qn(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function qL(e,t){const n=Q0(e);if(!n)return!0;const r=t.find(i=>{const o=Q0(i);return o?.name===n.name&&o.form===n.form&&o.checked});return r?r===n:t.find(i=>{const o=Q0(i);return o?.name===n.name&&o.form===n.form})===n}function wk(e){if(dn(e)&&Qn(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return dn(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function kk(e,t){wk(e).forEach(n=>{vk(n)&&t.push(n),kk(n,t)})}function Ak(e,t,n){wk(e).forEach(r=>{dn(r)&&r.matches(t)&&n.push(r),Ak(r,t,n)})}function c1(e){return Sk(e)&&Ck(e)>=0}function _k(e){const t=[];return kk(e,t),t.filter(Sk)}function Vh(e){const t=_k(e);return t.filter(n=>Ck(n)>=0&&qL(n,t))}function Nk(e,t){const n=Vh(e),r=n.length;if(r===0)return;const i=Sr(Pt(e)),o=n.indexOf(i),l=o===-1?t===1?0:r-1:o+t;return n[l]}function Rk(e){return Nk(Pt(e).body,1)||e}function Ok(e){return Nk(Pt(e).body,-1)||e}function Yu(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!nt(n,r)}function YL(e){Vh(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function l2(e){const t=[];Ak(e,"[data-tabindex]",t),t.forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function ta(e,t,n=!0){return e.filter(i=>i.parentId===t).flatMap(i=>[...!n||i.context?.open?[i]:[],...ta(e,i.id,n)])}function u2(e,t){let n=[],r=e.find(i=>i.id===t)?.parentId;for(;r;){const i=e.find(o=>o.id===r);r=i?.parentId,i&&(n=n.concat(i))}return n}function pc(e){return`data-base-ui-${e}`}let cd=0;function Hd(e,t={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(cd);function o(){i&&!i()||e?.focus({preventScroll:n})}if(r)return o(),Un;const l=requestAnimationFrame(o);return cd=l,()=>{cd===l&&(cancelAnimationFrame(l),cd=0)}}const W0={inert:new WeakMap,"aria-hidden":new WeakMap},c2="data-base-ui-inert",tb={inert:new WeakSet,"aria-hidden":new WeakSet};let Au=new WeakMap,Z0=0;function GL(e){return tb[e]}function Ik(e){return e?dl(e)?e.host:Ik(e.parentNode):null}const f2=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=Ik(n);return e.contains(r)?r:null}).filter(n=>n!=null),d2=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},h2=(e,t,n)=>{const r=[],i=o=>{!o||n.has(o)||Array.from(o.children).forEach(l=>{Qn(l)!=="script"&&(t.has(l)?i(l):r.push(l))})};return i(e),r};function XL(e,t,n,r,{mark:i=!0}){let o=null;r?o="inert":n&&(o="aria-hidden");let l=null,c=null;const f=f2(t,e),d=i?h2(t,d2(f),new Set(f)):[],m=[],p=[];if(o){const b=W0[o],y=GL(o);c=y,l=b;const E=f2(t,Array.from(t.querySelectorAll("[aria-live]"))),w=f.concat(E);h2(t,d2(w),new Set(w)).forEach(C=>{const A=C.getAttribute(o),_=A!==null&&A!=="false",N=(b.get(C)||0)+1;b.set(C,N),m.push(C),N===1&&_&&y.add(C),_||C.setAttribute(o,o==="inert"?"":"true")})}return i&&d.forEach(b=>{const y=(Au.get(b)||0)+1;Au.set(b,y),p.push(b),y===1&&b.setAttribute(c2,"")}),Z0+=1,()=>{l&&m.forEach(b=>{const E=(l.get(b)||0)-1;l.set(b,E),E||(!c?.has(b)&&o&&b.removeAttribute(o),c?.delete(b))}),i&&p.forEach(b=>{const y=(Au.get(b)||0)-1;Au.set(b,y),y||b.removeAttribute(c2)}),Z0-=1,Z0||(W0.inert=new WeakMap,W0["aria-hidden"]=new WeakMap,tb.inert=new WeakSet,tb["aria-hidden"]=new WeakSet,Au=new WeakMap)}}function p2(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,o=Pt(e[0]).body;return XL(e,o,n,r,{mark:i})}let m2=0;function KL(e,t="mui"){const[n,r]=S.useState(e),i=e||n;return S.useEffect(()=>{n==null&&(m2+=1,r(`${t}-${m2}`))},[n,t]),i}const g2=Kb.useId;function $h(e,t){if(g2!==void 0){const n=g2();return e??(t?`${t}-${n}`:n)}return KL(e,t)}function b2(e){if(!S.isValidElement(e))return null;const t=e,n=t.props;return(Qb(19)?n?.ref:t.ref)??null}function nb(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function QL(e,t){const n={};for(const r in e){const i=e[r];if(t?.hasOwnProperty(r)){const o=t[r](i);o!=null&&Object.assign(n,o);continue}i===!0?n[`data-${r.toLowerCase()}`]="":i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function WL(e,t){return typeof e=="function"?e(t):e}function ZL(e,t){return typeof e=="function"?e(t):e}const f1={};function li(e,t,n,r,i){if(!n&&!r&&!i&&!e)return ah(t);let o=ah(e);return t&&(o=Bu(o,t)),n&&(o=Bu(o,n)),r&&(o=Bu(o,r)),i&&(o=Bu(o,i)),o}function JL(e){if(e.length===0)return f1;if(e.length===1)return ah(e[0]);let t=ah(e[0]);for(let n=1;n<e.length;n+=1)t=Bu(t,e[n]);return t}function ah(e){return d1(e)?{...Mk(e,f1)}:eM(e)}function Bu(e,t){return d1(t)?Mk(t,e):tM(e,t)}function eM(e){const t={...e};for(const n in t){const r=t[n];Lk(n,r)&&(t[n]=Dk(r))}return t}function tM(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=nb(e.style,r);break}case"className":{e[n]=Pk(e.className,r);break}default:Lk(n,r)?e[n]=nM(e[n],r):e[n]=r}}return e}function Lk(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t=="function"||typeof t>"u")}function d1(e){return typeof e=="function"}function Mk(e,t){return d1(e)?e(t):e??f1}function nM(e,t){return t?e?(...n)=>{const r=n[0];if(jk(r)){const o=r;oh(o);const l=t(...n);return o.baseUIHandlerPrevented||e?.(...n),l}const i=t(...n);return e?.(...n),i}:Dk(t):e}function Dk(e){return e&&((...t)=>{const n=t[0];return jk(n)&&oh(n),e(...t)})}function oh(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Pk(e,t){return t?e?t+" "+e:t:e}function jk(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Wn(e,t,n={}){const r=t.render,i=rM(t,n);if(n.enabled===!1)return null;const o=n.state??Rn;return aM(e,r,i,o)}function rM(e,t={}){const{className:n,style:r,render:i}=e,{state:o=Rn,ref:l,props:c,stateAttributesMapping:f,enabled:d=!0}=t,m=d?WL(n,o):void 0,p=d?ZL(r,o):void 0,b=d?QL(o,f):Rn,y=d&&c?sM(c):void 0,E=d?nb(b,y)??{}:Rn;return typeof document<"u"&&(d?Array.isArray(l)?E.ref=B5([E.ref,b2(i),...l]):E.ref=cc(E.ref,b2(i),l):cc(null,null)),d?(m!==void 0&&(E.className=Pk(E.className,m)),p!==void 0&&(E.style=nb(E.style,p)),E):Rn}function sM(e){return Array.isArray(e)?JL(e):li(void 0,e)}const iM=Symbol.for("react.lazy");function aM(e,t,n,r){if(t){if(typeof t=="function")return t(n,r);const i=li(n,t.props);i.ref=n.ref;let o=t;return o?.$$typeof===iM&&(o=S.Children.toArray(t)[0]),S.cloneElement(o,i)}if(e&&typeof e=="string")return oM(e,n);throw new Error(dr(8))}function oM(e,t){return e==="button"?S.createElement("button",{type:"button",...t,key:t.key}):e==="img"?S.createElement("img",{alt:"",...t,key:t.key}):S.createElement(e,t)}const lM={style:{transition:"none"}},Bk="data-base-ui-click-trigger",uM={fallbackAxisSide:"none"},cM={fallbackAxisSide:"end"},fM={clipPath:"inset(50%)",position:"fixed",top:0,left:0},Hk=S.createContext(null),Uk=()=>S.useContext(Hk),dM=pc("portal");function zk(e={}){const{ref:t,container:n,componentProps:r=Rn,elementProps:i}=e,o=$h(),c=Uk()?.portalNode,[f,d]=S.useState(null),[m,p]=S.useState(null),b=Je(k=>{k!==null&&p(k)}),y=S.useRef(null);Ve(()=>{if(n===null){y.current&&(y.current=null,p(null),d(null));return}if(o==null)return;const k=(n&&(Zb(n)?n:n.current))??c??document.body;if(k==null){y.current&&(y.current=null,p(null),d(null));return}y.current!==k&&(y.current=k,p(null),d(k))},[n,c,o]);const E=Wn("div",r,{ref:[t,b],props:[{id:o,[dM]:""},i]});return{portalNode:m,portalSubtree:f&&E?cs.createPortal(E,f):null}}const Fk=S.forwardRef(function(t,n){const{render:r,className:i,style:o,children:l,container:c,renderGuards:f,...d}=t,{portalNode:m,portalSubtree:p}=zk({container:c,ref:n,componentProps:t,elementProps:d}),b=S.useRef(null),y=S.useRef(null),E=S.useRef(null),w=S.useRef(null),[k,C]=S.useState(null),A=S.useRef(!1),_=k?.modal,N=k?.open,D=typeof f=="boolean"?f:!!k&&!k.modal&&k.open&&!!m;S.useEffect(()=>{if(!m||_)return;function j(M){m&&M.relatedTarget&&Yu(M)&&(M.type==="focusin"?A.current&&(l2(m),A.current=!1):(YL(m),A.current=!0))}return Os(yt(m,"focusin",j,!0),yt(m,"focusout",j,!0))},[m,_]),Ve(()=>{!m||N!==!0||!A.current||(l2(m),A.current=!1)},[N,m]);const O=S.useMemo(()=>({beforeOutsideRef:b,afterOutsideRef:y,beforeInsideRef:E,afterInsideRef:w,portalNode:m,setFocusManagerState:C}),[m]);return g.jsxs(S.Fragment,{children:[p,g.jsxs(Hk.Provider,{value:O,children:[D&&m&&g.jsx(rh,{"data-type":"outside",ref:b,onFocus:j=>{if(Yu(j,m))E.current?.focus();else{const M=k?k.domReference:null;Ok(M)?.focus()}}}),D&&m&&g.jsx("span",{"aria-owns":m.id,style:fM}),m&&cs.createPortal(l,m),D&&m&&g.jsx(rh,{"data-type":"outside",ref:y,onFocus:j=>{if(Yu(j,m))w.current?.focus();else{const M=k?k.domReference:null;Rk(M)?.focus(),k?.closeOnFocusOut&&k?.onOpenChange(!1,vt(zh,j.nativeEvent))}}})]})]})});function hM(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}const pM=S.createContext(null),mM=S.createContext(null),qh=()=>S.useContext(pM)?.id||null,Tl=e=>{const t=S.useContext(mM);return e??t};function ei(e){return e==null?e:"current"in e?e.current:e}function gM(e,t){const n=sn(ur(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const x2=20;let Ki=[];function h1(){Ki=Ki.filter(e=>e.deref()?.isConnected)}function y2(e){h1(),e&&Qn(e)!=="body"&&(Ki.push(new WeakRef(e)),Ki.length>x2&&(Ki=Ki.slice(-x2)))}function E2(){return h1(),Ki[Ki.length-1]?.deref()}function bM(e){return e?c1(e)?e:Vh(e)[0]||e:null}function T2(e){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!e.getAttribute("role")?.includes("dialog"))return;const n=_k(e).filter(i=>{const o=i.getAttribute("data-tabindex")||"";return c1(i)||i.hasAttribute("data-tabindex")&&!o.startsWith("-")}),r=e.getAttribute("tabindex");n.length===0?r!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(r!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function Vk(e){const{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:o=!0,restoreFocus:l=!1,modal:c=!0,closeOnFocusOut:f=!0,openInteractionType:d="",nextFocusableElement:m,previousFocusableElement:p,beforeContentFocusGuardRef:b,externalTree:y,getInsideElements:E}=e,w="rootStore"in t?t.rootStore:t,k=w.useState("open"),C=w.useState("domReferenceElement"),A=w.useState("floatingElement"),{events:_,dataRef:N}=w.context,D=Je(()=>N.current.floatingContext?.nodeId),O=i===!1,j=Zg(C)&&O,M=xn(i),q=xn(o),U=xn(d),Q=xn(k),Z=Tl(y),G=Uk(),ee=S.useRef(!1),Y=S.useRef(!1),H=S.useRef(!1),K=S.useRef(null),te=S.useRef(""),le=S.useRef(""),I=S.useRef(null),P=S.useRef(null),$=cc(I,b,G?.beforeInsideRef),L=cc(P,G?.afterInsideRef),ae=ns(),ie=ns(),fe=hl(),de=G!=null,he=th(A),ve=Je((Te=he)=>Te?Vh(Te):[]),Ue=Je(()=>E?.().filter(Te=>Te!=null)??[]);S.useEffect(()=>{if(r||!c)return;function Te(je){je.key==="Tab"&&nt(he,Sr(Pt(he)))&&ve().length===0&&!j&&Ss(je)}const Ie=Pt(he);return yt(Ie,"keydown",Te)},[r,he,c,j,ve]),S.useEffect(()=>{if(r||!k)return;const Te=Pt(he);function Ie(){H.current=!1}function je(Xe){const Me=ur(Xe),Ce=Ue(),we=nt(A,Me)||nt(C,Me)||nt(G?.portalNode,Me)||Ce.some(Be=>Be===Me||nt(Be,Me));H.current=!we,le.current=Xe.pointerType||"keyboard",Me?.closest(`[${Bk}]`)&&(Y.current=!0,ie.start(0,()=>{Y.current=!1}))}function We(){le.current="keyboard"}return Os(yt(Te,"pointerdown",je,!0),yt(Te,"pointerup",Ie,!0),yt(Te,"pointercancel",Ie,!0),yt(Te,"keydown",We,!0),Ie)},[r,A,C,he,k,G,ie,Ue]),S.useEffect(()=>{if(r||!f)return;const Te=Pt(he);function Ie(){Y.current=!0,ie.start(0,()=>{Y.current=!1})}function je(Ce){const we=ur(Ce);c1(we)&&(K.current=we)}function We(Ce){const we=Ce.relatedTarget,Be=Ce.currentTarget,$e=ur(Ce);c&&we==null&&$e!=null&&nt(A,$e)&&y2($e),queueMicrotask(()=>{const W=D(),me=w.context.triggerElements,se=Ue(),re=we?.hasAttribute(pc("focus-guard"))&&[I.current,P.current,G?.beforeInsideRef.current,G?.afterInsideRef.current,G?.beforeOutsideRef.current,G?.afterOutsideRef.current,ei(p),ei(m)].includes(we),V=!(nt(C,we)||nt(A,we)||nt(we,A)||nt(G?.portalNode,we)||se.some(z=>z===we||nt(z,we))||we!=null&&me.hasElement(we)||me.hasMatchingElement(z=>nt(z,we))||re||Z&&(ta(Z.nodesRef.current,W).find(z=>nt(z.context?.elements.floating,we)||nt(z.context?.elements.domReference,we))||u2(Z.nodesRef.current,W).find(z=>[z.context?.elements.floating,th(z.context?.elements.floating)].includes(we)||z.context?.elements.domReference===we)));if(Be===C&&he&&T2(he),l&&Be!==C&&!Fh($e)&&Sr(Te)===Te.body){if(dn(he)&&(he.focus(),l==="popup")){fe.request(()=>{he.focus()});return}const z=ve(),ue=K.current,ke=(ue&&z.includes(ue)?ue:null)||z[z.length-1]||he;dn(ke)&&ke.focus()}if(N.current.insideReactTree){N.current.insideReactTree=!1;return}(j||!c)&&we&&V&&!Y.current&&(j||we!==E2())&&(ee.current=!0,w.setOpen(!1,vt(zh,Ce)))})}function Xe(){H.current||(N.current.insideReactTree=!0,ae.start(0,()=>{N.current.insideReactTree=!1}))}const Me=dn(C)?C:null;if(!(!A&&!Me))return Os(Me&&yt(Me,"focusout",We),Me&&yt(Me,"pointerdown",Ie),A&&yt(A,"focusin",je),A&&yt(A,"focusout",We),A&&G&&yt(A,"focusout",Xe,!0))},[r,C,A,he,c,Z,G,w,f,l,ve,j,D,N,ae,ie,fe,m,p,Ue]),S.useEffect(()=>{if(r||!A||!k)return;const Te=Array.from(G?.portalNode?.querySelectorAll(`[${pc("portal")}]`)||[]),je=(Z?u2(Z.nodesRef.current,D()):[]).find(Be=>Zg(Be.context?.elements.domReference||null))?.context?.elements.domReference,Xe=[...[A,...Te,I.current,P.current,G?.beforeOutsideRef.current,G?.afterOutsideRef.current,...Ue()],je,ei(p),ei(m),j?C:null].filter(Be=>Be!=null),Me=p2(Xe,{ariaHidden:c||j,mark:!1}),Ce=[A,...Te].filter(Be=>Be!=null),we=p2(Ce);return()=>{we(),Me()}},[k,r,C,A,c,G,j,Z,D,m,p,Ue]),Ve(()=>{if(!k||r||!dn(he))return;const Te=Pt(he),Ie=Sr(Te);queueMicrotask(()=>{const je=M.current,We=typeof je=="function"?je(U.current||""):je;if(We===void 0||We===!1||nt(he,Ie))return;let Me=null;const Ce=()=>(Me==null&&(Me=ve(he)),Me[0]||he);let we;We===!0||We===null?we=Ce():we=ei(We),we=we||Ce();const Be=nt(he,Sr(Te));Hd(we,{preventScroll:we===he,shouldFocus(){if(!Q.current)return!1;if(Be)return!0;const $e=Sr(Te);return!($e!==we&&nt(he,$e))}})})},[r,k,he,ve,M,U,Q]),Ve(()=>{if(r||!he)return;const Te=Pt(he),Ie=Sr(Te),je=U.current==null;y2(Ie);function We(Me){if(Me.open||(te.current=gM(Me.nativeEvent,le.current)),Me.reason===Cr&&Me.nativeEvent.type==="mouseleave"&&(ee.current=!0),Me.reason===i1)if(Me.nested)ee.current=!1;else if(r1(Me.nativeEvent)||pk(Me.nativeEvent))ee.current=!1;else{let Ce=!1;Pt(he).createElement("div").focus({get preventScroll(){return Ce=!0,!1}}),Ce?ee.current=!1:ee.current=!0}}_.on("openchange",We);function Xe(){const Me=q.current;let Ce=typeof Me=="function"?Me(te.current):Me;if(Ce===void 0||Ce===!1)return null;Ce===null&&(Ce=!0);const we=C?.isConnected?C:null,Be=Ie?.isConnected&&Qn(Ie)!=="body"?Ie:null;let $e=je?Be||we:we||Be;return $e||($e=E2()||null),typeof Ce=="boolean"?$e:ei(Ce)||$e||null}return()=>{_.off("openchange",We);const Me=Sr(Te),Ce=Ue(),we=nt(A,Me)||Ce.some(W=>W===Me||nt(W,Me))||Z&&ta(Z.nodesRef.current,D(),!1).some(W=>nt(W.context?.elements.floating,Me)),Be=q.current,$e=Xe();queueMicrotask(()=>{const W=bM($e),me=typeof Be!="boolean";Be&&!ee.current&&dn(W)&&(!(!me&&W!==Me&&Me!==Te.body)||we)&&W.focus({preventScroll:!0}),ee.current=!1})}},[r,A,he,q,U,_,Z,C,D,Ue]),Ve(()=>{if(!oa||k||!A)return;const Te=Sr(Pt(A));!dn(Te)||!Uh(Te)||nt(A,Te)&&Te.blur()},[k,A]),Ve(()=>{if(!(r||!G))return G.setFocusManagerState({modal:c,closeOnFocusOut:f,open:k,onOpenChange:w.setOpen,domReference:C}),()=>{G.setFocusManagerState(null)}},[r,G,c,k,w,f,C]),Ve(()=>{if(!(r||!he))return T2(he),()=>{queueMicrotask(h1)}},[r,he]);const Pe=!r&&(c?!j:!0)&&(de||c);return g.jsxs(S.Fragment,{children:[Pe&&g.jsx(rh,{"data-type":"inside",ref:$,onFocus:Te=>{if(c){const Ie=ve();Hd(Ie[Ie.length-1])}else G?.portalNode&&(ee.current=!1,Yu(Te,G.portalNode)?Rk(C)?.focus():ei(p??G.beforeOutsideRef)?.focus())}}),n,Pe&&g.jsx(rh,{"data-type":"inside",ref:L,onFocus:Te=>{c?Hd(ve()[0]):G?.portalNode&&(f&&(ee.current=!0),Yu(Te,G.portalNode)?Ok(C)?.focus():ei(m??G.afterOutsideRef)?.focus())}})]})}function $k(e,t={}){const{enabled:n=!0,event:r="click",toggle:i=!0,ignoreMouse:o=!1,stickIfOpen:l=!0,touchOpenDelay:c=0,reason:f=Cc}=t,d="rootStore"in e?e.rootStore:e,m=d.context.dataRef,p=S.useRef(void 0),b=hl(),y=ns(),E=S.useMemo(()=>{function w(C,A,_,N){const D=vt(f,A,_);C&&N==="touch"&&c>0?y.start(c,()=>{d.setOpen(!0,D)}):d.setOpen(C,D)}function k(C,A,_){const N=m.current.openEvent,D=d.select("domReferenceElement")!==A;return C&&D||!C||!i?!0:N&&l?!_(N.type):!1}return{onPointerDown(C){p.current=C.pointerType},onMouseDown(C){const A=p.current,_=C.nativeEvent,N=d.select("open");if(C.button!==0||r==="click"||Wa(A,!0)&&o)return;const D=k(N,C.currentTarget,M=>M==="click"||M==="mousedown"),O=ur(_);if(Uh(O)){w(D,_,O,A);return}const j=C.currentTarget;b.request(()=>{w(D,_,j,A)})},onClick(C){if(r==="mousedown-only")return;const A=p.current;if(r==="mousedown"&&A){p.current=void 0;return}if(Wa(A,!0)&&o)return;const _=d.select("open"),N=k(_,C.currentTarget,D=>D==="click"||D==="mousedown"||D==="keydown"||D==="keyup");w(N,C.nativeEvent,C.currentTarget,A)},onKeyDown(){p.current=void 0}}},[m,r,o,f,d,l,i,b,y,c]);return S.useMemo(()=>n?{reference:E}:Rn,[n,E])}function xM(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){const o=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},l=t.axis==="x"||t.axis==="both",c=t.axis==="y"||t.axis==="both",f=["mouseenter","mousemove"].includes(t.dataRef.current.openEvent?.type||"")&&t.pointerType!=="touch";let d=o.width,m=o.height,p=o.x,b=o.y;return n==null&&t.x&&l&&(n=o.x-t.x),r==null&&t.y&&c&&(r=o.y-t.y),p-=n||0,b-=r||0,d=0,m=0,!i||f?(d=t.axis==="y"?o.width:0,m=t.axis==="x"?o.height:0,p=l&&t.x!=null?t.x:p,b=c&&t.y!=null?t.y:b):i&&!f&&(m=t.axis==="x"?o.height:m,d=t.axis==="y"?o.width:d),i=!0,{width:d,height:m,x:p,y:b,top:b,right:p+d,bottom:b+m,left:p}}}}function v2(e){return e!=null&&e.clientX!=null}function yM(e,t={}){const{enabled:n=!0,axis:r="both"}=t,i="rootStore"in e?e.rootStore:e,o=i.useState("open"),l=i.useState("floatingElement"),c=i.useState("domReferenceElement"),f=i.context.dataRef,d=S.useRef(!1),m=S.useRef(null),[p,b]=S.useState(),[y,E]=S.useState([]),w=Je(N=>{i.set("positionReference",N)}),k=Je((N,D,O)=>{d.current||f.current.openEvent&&!v2(f.current.openEvent)||i.set("positionReference",xM(O??c,{x:N,y:D,axis:r,dataRef:f,pointerType:p}))}),C=Je(N=>{o?m.current||(k(N.clientX,N.clientY,N.currentTarget),E([])):k(N.clientX,N.clientY,N.currentTarget)}),A=Wa(p)?l:o;S.useEffect(()=>{if(!n){w(c);return}if(!A)return;function N(){m.current?.(),m.current=null}const D=sn(l);function O(j){const M=ur(j);nt(l,M)?N():k(j.clientX,j.clientY)}return!f.current.openEvent||v2(f.current.openEvent)?m.current=yt(D,"mousemove",O):w(c),N},[A,n,l,f,c,i,k,w,y]),S.useEffect(()=>()=>{i.set("positionReference",null)},[i]),S.useEffect(()=>{n&&!l&&(d.current=!1)},[n,l]),S.useEffect(()=>{!n&&o&&(d.current=!0)},[n,o]);const _=S.useMemo(()=>{function N(D){b(D.pointerType)}return{onPointerDown:N,onPointerEnter:N,onMouseMove:C,onMouseEnter:C}},[C]);return S.useMemo(()=>n?{reference:_,trigger:_}:{},[n,_])}function EM(){return!1}function TM(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function p1(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:o="sloppy",referencePress:l=EM,bubbles:c,externalTree:f}=t,d="rootStore"in e?e.rootStore:e,m=d.useState("open"),p=d.useState("floatingElement"),{dataRef:b}=d.context,y=Tl(f),E=Je(typeof i=="function"?i:()=>!1),w=typeof i=="function"?E:i,k=w!==!1,C=Je(()=>o),{escapeKey:A,outsidePress:_}=TM(c),N=S.useRef(!1),D=S.useRef(!1),O=S.useRef(!1),j=S.useRef(!1),M=S.useRef(""),q=S.useRef(null),U=ns(),Q=ns(),Z=Je(()=>{Q.clear(),b.current.insideReactTree=!1}),G=Je($=>{const L=b.current.floatingContext?.nodeId;return(y?ta(y.nodesRef.current,L):[]).some(ie=>ie.context?.open&&!ie.context.dataRef.current[$])}),ee=Je($=>G0($,d.select("floatingElement"))||G0($,d.select("domReferenceElement"))),Y=Je($=>{l()&&d.setOpen(!1,vt(Cc,$.nativeEvent))}),H=Je($=>{if(!m||!n||!r||$.key!=="Escape"||j.current||!A&&G("__escapeKeyBubbles"))return;const L=bL($)?$.nativeEvent:$,ae=vt(a1,L);d.setOpen(!1,ae),ae.isCanceled||$.preventDefault(),!A&&!ae.isPropagationAllowed&&$.stopPropagation()}),K=Je(()=>{b.current.insideReactTree=!0,Q.start(0,Z)}),te=Je($=>{if(!m||!n||$.button!==0)return;const L=ur($.nativeEvent);nt(d.select("floatingElement"),L)&&(N.current||(N.current=!0,D.current=!1))}),le=Je($=>{!m||!n||($.defaultPrevented||$.nativeEvent.defaultPrevented)&&N.current&&(D.current=!0)});S.useEffect(()=>{if(!m||!n)return;b.current.__escapeKeyBubbles=A,b.current.__outsidePressBubbles=_;const $=new us,L=new us;function ae(){$.clear(),j.current=!0}function ie(){$.start(oa?5:0,()=>{j.current=!1})}function fe(){O.current=!0,L.start(0,()=>{O.current=!1})}function de(){N.current=!1,D.current=!1}function he(){const se=M.current,re=se==="pen"||!se?"mouse":se,V=C(),z=typeof V=="function"?V():V;return typeof z=="string"?z:z[re]}function ve(se){const re=he();return re==="intentional"&&se.type!=="click"||re==="sloppy"&&se.type==="click"}function Ue(se){const re=b.current.floatingContext?.nodeId,V=y&&ta(y.nodesRef.current,re).some(z=>G0(se,z.context?.elements.floating));return ee(se)||V}function Pe(se){if(ve(se)){se.type!=="click"&&!ee(se)&&(L.clear(),O.current=!1),Z();return}if(b.current.insideReactTree){Z();return}const re=ur(se),V=`[${pc("inert")}]`,z=Et(re)?re.getRootNode():null,ue=Array.from((dl(z)?z:Pt(d.select("floatingElement"))).querySelectorAll(V)),ke=d.context.triggerElements;if(re&&(ke.hasElement(re)||ke.hasMatchingElement(qe=>nt(qe,re))))return;let Re=Et(re)?re:null;for(;Re&&!Ji(Re);){const qe=ea(Re);if(Ji(qe)||!Et(qe))break;Re=qe}if(!(ue.length&&Et(re)&&!yL(re)&&!nt(re,d.select("floatingElement"))&&ue.every(qe=>!nt(Re,qe)))){if(dn(re)&&!("touches"in se)){const qe=Ji(re),rt=Br(re),et=/auto|scroll/,ot=qe||et.test(rt.overflowX),ut=qe||et.test(rt.overflowY),Fe=ot&&re.clientWidth>0&&re.scrollWidth>re.clientWidth,Dt=ut&&re.clientHeight>0&&re.scrollHeight>re.clientHeight,jt=rt.direction==="rtl",at=Dt&&(jt?se.offsetX<=re.offsetWidth-re.clientWidth:se.offsetX>re.clientWidth),Ot=Fe&&se.offsetY>re.clientHeight;if(at||Ot)return}if(!Ue(se)){if(he()==="intentional"&&O.current){L.clear(),O.current=!1;return}typeof w=="function"&&!w(se)||G("__outsidePressBubbles")||(d.setOpen(!1,vt(i1,se)),Z())}}}function Te(se){he()!=="sloppy"||se.pointerType==="touch"||!d.select("open")||!n||ee(se)||Pe(se)}function Ie(se){if(he()!=="sloppy"||!d.select("open")||!n||ee(se))return;const re=se.touches[0];re&&(q.current={startTime:Date.now(),startX:re.clientX,startY:re.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},U.start(1e3,()=>{q.current&&(q.current.dismissOnTouchEnd=!1,q.current.dismissOnMouseDown=!1)}))}function je(se,re){const V=ur(se);if(!V)return;const z=yt(V,se.type,()=>{re(se),z()})}function We(se){M.current="touch",je(se,Ie)}function Xe(se){U.clear(),se.type==="pointerdown"&&(M.current=se.pointerType),!(se.type==="mousedown"&&q.current&&!q.current.dismissOnMouseDown)&&je(se,re=>{re.type==="pointerdown"?Te(re):Pe(re)})}function Me(se){if(!N.current)return;const re=D.current;if(de(),he()==="intentional"){if(se.type==="pointercancel"){re&&fe();return}if(!Ue(se)){if(re){fe();return}typeof w=="function"&&!w(se)||(L.clear(),O.current=!0,Z())}}}function Ce(se){if(he()!=="sloppy"||!q.current||ee(se))return;const re=se.touches[0];if(!re)return;const V=Math.abs(re.clientX-q.current.startX),z=Math.abs(re.clientY-q.current.startY),ue=Math.sqrt(V*V+z*z);ue>5&&(q.current.dismissOnTouchEnd=!0),ue>10&&(Pe(se),U.clear(),q.current=null)}function we(se){je(se,Ce)}function Be(se){he()!=="sloppy"||!q.current||ee(se)||(q.current.dismissOnTouchEnd&&Pe(se),U.clear(),q.current=null)}function $e(se){je(se,Be)}const W=Pt(p),me=Os(r&&Os(yt(W,"keydown",H),yt(W,"compositionstart",ae),yt(W,"compositionend",ie)),k&&Os(yt(W,"click",Xe,!0),yt(W,"pointerdown",Xe,!0),yt(W,"pointerup",Me,!0),yt(W,"pointercancel",Me,!0),yt(W,"mousedown",Xe,!0),yt(W,"mouseup",Me,!0),yt(W,"touchstart",We,!0),yt(W,"touchmove",we,!0),yt(W,"touchend",$e,!0)));return()=>{me(),$.clear(),L.clear(),de(),O.current=!1}},[b,p,r,k,w,m,n,A,_,H,Z,C,G,ee,y,d,U]),S.useEffect(Z,[w,Z]);const I=S.useMemo(()=>({onKeyDown:H,onPointerDown:Y,onClick:Y}),[H,Y]),P=S.useMemo(()=>({onKeyDown:H,onPointerDown:le,onMouseDown:le,onClickCapture:K,onMouseDownCapture($){K(),te($)},onPointerDownCapture($){K(),te($)},onMouseUpCapture:K,onTouchEndCapture:K,onTouchMoveCapture:K}),[H,K,te,le]);return S.useMemo(()=>n?{reference:I,floating:P,trigger:I}:{},[n,I,P])}function S2(e,t,n){let{reference:r,floating:i}=e;const o=es(t),l=u1(t),c=l1(l),f=Dr(t),d=o==="y",m=r.x+r.width/2-i.width/2,p=r.y+r.height/2-i.height/2,b=r[c]/2-i[c]/2;let y;switch(f){case"top":y={x:m,y:r.y-i.height};break;case"bottom":y={x:m,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:p};break;case"left":y={x:r.x-i.width,y:p};break;default:y={x:r.x,y:r.y}}const E=la(t);return E&&(y[l]+=b*(E==="end"?1:-1)*(n&&d?-1:1)),y}async function vM(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:l,elements:c,strategy:f}=e,{boundary:d="clippingAncestors",rootBoundary:m="viewport",elementContext:p="floating",altBoundary:b=!1,padding:y=0}=ui(t,e),E=Ek(y),k=c[b?p==="floating"?"reference":"floating":p],C=hc(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(k)))==null||n?k:k.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(c.floating)),boundary:d,rootBoundary:m,strategy:f})),A=p==="floating"?{x:r,y:i,width:l.floating.width,height:l.floating.height}:l.reference,_=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c.floating)),N=await(o.isElement==null?void 0:o.isElement(_))&&await(o.getScale==null?void 0:o.getScale(_))||{x:1,y:1},D=hc(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:A,offsetParent:_,strategy:f}):A);return{top:(C.top-D.top+E.top)/N.y,bottom:(D.bottom-C.bottom+E.bottom)/N.y,left:(C.left-D.left+E.left)/N.x,right:(D.right-C.right+E.right)/N.x}}const SM=50,CM=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:l}=n,c=l.detectOverflow?l:{...l,detectOverflow:vM},f=await(l.isRTL==null?void 0:l.isRTL(t));let d=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:m,y:p}=S2(d,r,f),b=r,y=0;const E={};for(let w=0;w<o.length;w++){const k=o[w];if(!k)continue;const{name:C,fn:A}=k,{x:_,y:N,data:D,reset:O}=await A({x:m,y:p,initialPlacement:r,placement:b,strategy:i,middlewareData:E,rects:d,platform:c,elements:{reference:e,floating:t}});m=_??m,p=N??p,E[C]={...E[C],...D},O&&y<SM&&(y++,typeof O=="object"&&(O.placement&&(b=O.placement),O.rects&&(d=O.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:i}):O.rects),{x:m,y:p}=S2(d,b,f)),w=-1)}return{x:m,y:p,placement:b,strategy:i,middlewareData:E}},wM=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:l,initialPlacement:c,platform:f,elements:d}=t,{mainAxis:m=!0,crossAxis:p=!0,fallbackPlacements:b,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:w=!0,...k}=ui(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const C=Dr(i),A=es(c),_=Dr(c)===c,N=await(f.isRTL==null?void 0:f.isRTL(d.floating)),D=b||(_||!w?[ih(c)]:ML(c)),O=E!=="none";!b&&O&&D.push(...BL(c,w,E,N));const j=[c,...D],M=await f.detectOverflow(t,k),q=[];let U=((r=o.flip)==null?void 0:r.overflows)||[];if(m&&q.push(M[C]),p){const ee=LL(i,l,N);q.push(M[ee[0]],M[ee[1]])}if(U=[...U,{placement:i,overflows:q}],!q.every(ee=>ee<=0)){var Q,Z;const ee=(((Q=o.flip)==null?void 0:Q.index)||0)+1,Y=j[ee];if(Y&&(!(p==="alignment"?A!==es(Y):!1)||U.every(te=>es(te.placement)===A?te.overflows[0]>0:!0)))return{data:{index:ee,overflows:U},reset:{placement:Y}};let H=(Z=U.filter(K=>K.overflows[0]<=0).sort((K,te)=>K.overflows[1]-te.overflows[1])[0])==null?void 0:Z.placement;if(!H)switch(y){case"bestFit":{var G;const K=(G=U.filter(te=>{if(O){const le=es(te.placement);return le===A||le==="y"}return!0}).map(te=>[te.placement,te.overflows.filter(le=>le>0).reduce((le,I)=>le+I,0)]).sort((te,le)=>te[1]-le[1])[0])==null?void 0:G[0];K&&(H=K);break}case"initialPlacement":H=c;break}if(i!==H)return{reset:{placement:H}}}return{}}}};function C2(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function w2(e){return OL.some(t=>e[t]>=0)}const kM=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:i="referenceHidden",...o}=ui(e,t);switch(i){case"referenceHidden":{const l=await r.detectOverflow(t,{...o,elementContext:"reference"}),c=C2(l,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:w2(c)}}}case"escaped":{const l=await r.detectOverflow(t,{...o,altBoundary:!0}),c=C2(l,n.floating);return{data:{escapedOffsets:c,escaped:w2(c)}}}default:return{}}}}},qk=new Set(["left","top"]);async function AM(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),l=Dr(n),c=la(n),f=es(n)==="y",d=qk.has(l)?-1:1,m=o&&f?-1:1,p=ui(t,e);let{mainAxis:b,crossAxis:y,alignmentAxis:E}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return c&&typeof E=="number"&&(y=c==="end"?E*-1:E),f?{x:y*m,y:b*d}:{x:b*d,y:y*m}}const _M=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:l,middlewareData:c}=t,f=await AM(t,e);return l===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:i+f.x,y:o+f.y,data:{...f,placement:l}}}}},NM=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i,platform:o}=t,{mainAxis:l=!0,crossAxis:c=!1,limiter:f={fn:A=>{let{x:_,y:N}=A;return{x:_,y:N}}},...d}=ui(e,t),m={x:n,y:r},p=await o.detectOverflow(t,d),b=es(i),y=o1(b);let E=m[y],w=m[b];const k=(A,_)=>yk(_+p[A==="y"?"top":"left"],_,_-p[A==="y"?"bottom":"right"]);l&&(E=k(y,E)),c&&(w=k(b,w));const C=f.fn({...t,[y]:E,[b]:w});return{...C,data:{x:C.x-n,y:C.y-r,enabled:{[y]:l,[b]:c}}}}}},RM=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;const{x:i,y:o,placement:l,rects:c,middlewareData:f}=t,{offset:d=0,mainAxis:m=!0,crossAxis:p=!0}=ui(e,t),b={x:i,y:o},y=es(l),E=o1(y);let w=b[E],k=b[y];const C=ui(d,t),A=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:(n=C.mainAxis)!=null?n:0,crossAxis:(r=C.crossAxis)!=null?r:0};if(m){const D=E==="y"?"height":"width",O=c.reference[E]-c.floating[D]+A.mainAxis,j=c.reference[E]+c.reference[D]-A.mainAxis;w<O?w=O:w>j&&(w=j)}if(p){var _,N;const D=E==="y"?"width":"height",O=qk.has(Dr(l)),j=c.reference[y]-c.floating[D]+(O&&((_=f.offset)==null?void 0:_[y])||0)+(O?0:A.crossAxis),M=c.reference[y]+c.reference[D]+(O?0:((N=f.offset)==null?void 0:N[y])||0)-(O?A.crossAxis:0);k<j?k=j:k>M&&(k=M)}return{[E]:w,[y]:k}}}},OM=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:o}=t,{apply:l=()=>{},...c}=ui(e,t),f=await i.detectOverflow(t,c),d=Dr(n),m=la(n),p=es(n)==="y",{width:b,height:y}=r.floating;let E,w;d==="top"||d==="bottom"?(E=d,w=m===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(w=d,E=m==="end"?"top":"bottom");const k=y-f.top-f.bottom,C=b-f.left-f.right,A=pl(y-f[E],k),_=pl(b-f[w],C),N=t.middlewareData.shift,D=!N;let O=A,j=_;N!=null&&N.enabled.x&&(j=C),N!=null&&N.enabled.y&&(O=k),D&&!m&&(p?j=b-2*ai(f.left,f.right):O=y-2*ai(f.top,f.bottom)),await l({...t,availableWidth:j,availableHeight:O});const M=await i.getDimensions(o.floating);return b!==M.width||y!==M.height?{reset:{rects:!0}}:{}}}};function Yk(e){const t=Br(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=dn(e),o=i?e.offsetWidth:n,l=i?e.offsetHeight:r,c=sh(n)!==o||sh(r)!==l;return c&&(n=o,r=l),{width:n,height:r,$:c}}function m1(e){return Et(e)?e:e.contextElement}function ul(e){const t=m1(e);if(!dn(t))return oi(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=Yk(t);let l=(o?sh(n.width):n.width)/r,c=(o?sh(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!c||!Number.isFinite(c))&&(c=1),{x:l,y:c}}const IM=oi(0);function Gk(e){const t=sn(e);return!e1()||!t.visualViewport?IM:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function LM(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===sn(e)}function Za(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=m1(e);let l=oi(1);t&&(r?Et(r)&&(l=ul(r)):l=ul(e));const c=LM(o,n,r)?Gk(o):oi(0);let f=(i.left+c.x)/l.x,d=(i.top+c.y)/l.y,m=i.width/l.x,p=i.height/l.y;if(o&&r){const b=sn(o),y=Et(r)?sn(r):r;let E=b,w=Kg(E);for(;w&&y!==E;){const k=ul(w),C=w.getBoundingClientRect(),A=Br(w),_=C.left+(w.clientLeft+parseFloat(A.paddingLeft))*k.x,N=C.top+(w.clientTop+parseFloat(A.paddingTop))*k.y;f*=k.x,d*=k.y,m*=k.x,p*=k.y,f+=_,d+=N,E=sn(w),w=Kg(E)}}return hc({width:m,height:p,x:f,y:d})}function Yh(e,t){const n=Dh(e).scrollLeft;return t?t.left+n:Za(di(e)).left+n}function Xk(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Yh(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function MM(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",l=di(r),c=t?Mh(t.floating):!1;if(r===l||c&&o)return n;let f={scrollLeft:0,scrollTop:0},d=oi(1);const m=oi(0),p=dn(r);if((p||!o)&&((Qn(r)!=="body"||co(l))&&(f=Dh(r)),p)){const y=Za(r);d=ul(r),m.x=y.x+r.clientLeft,m.y=y.y+r.clientTop}const b=l&&!p&&!o?Xk(l,f):oi(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-f.scrollLeft*d.x+m.x+b.x,y:n.y*d.y-f.scrollTop*d.y+m.y+b.y}}function DM(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function PM(e){const t=Dh(e),n=e.ownerDocument.body,r=ai(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=ai(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-t.scrollLeft+Yh(e);const l=-t.scrollTop;return Br(n).direction==="rtl"&&(o+=ai(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:o,y:l}}const jM=25;function BM(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",i=sn(e),o=di(e),l=i.visualViewport;let c=o.clientWidth,f=o.clientHeight,d=0,m=0;if(l){const b=!e1()||t==="fixed";r?b||(d=-l.offsetLeft,m=-l.offsetTop):(c=l.width,f=l.height,b&&(d=l.offsetLeft,m=l.offsetTop))}if(Yh(o)<=0){const b=o.ownerDocument,y=b.body,E=getComputedStyle(y),w=b.compatMode==="CSS1Compat"&&parseFloat(E.marginLeft)+parseFloat(E.marginRight)||0,k=Math.abs(o.clientWidth-y.clientWidth-w),C=getComputedStyle(o).scrollbarGutter==="stable both-edges"?k/2:k;C<=jM&&(c-=C)}return{width:c,height:f,x:d,y:m}}function HM(e,t){const n=Za(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=ul(e),l=e.clientWidth*o.x,c=e.clientHeight*o.y,f=i*o.x,d=r*o.y;return{width:l,height:c,x:f,y:d}}function k2(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=BM(e,n,t);else if(t==="document")r=PM(di(e));else if(Et(t))r=HM(t,n);else{const i=Gk(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return hc(r)}function UM(e,t){const n=t.get(e);if(n)return n;let r=fc(e,[],!1).filter(c=>Et(c)&&Qn(c)!=="body"),i=null;const o=Br(e).position==="fixed";let l=o?ea(e):e;for(;Et(l)&&!Ji(l);){const c=Br(l),f=Jb(l),d=i?i.position:o?"fixed":"";!f&&(d==="fixed"||d==="absolute"&&c.position==="static")?r=r.filter(p=>p!==l):i=c,l=ea(l)}return t.set(e,r),r}function zM(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const l=[...n==="clippingAncestors"?Mh(t)?[]:UM(t,this._c):[].concat(n),r],c=k2(t,l[0],i);let f=c.top,d=c.right,m=c.bottom,p=c.left;for(let b=1;b<l.length;b++){const y=k2(t,l[b],i);f=ai(y.top,f),d=pl(y.right,d),m=pl(y.bottom,m),p=ai(y.left,p)}return{width:d-p,height:m-f,x:p,y:f}}function FM(e){const{width:t,height:n}=Yk(e);return{width:t,height:n}}function VM(e,t,n){const r=dn(t),i=di(t),o=n==="fixed",l=Za(e,!0,o,t);let c={scrollLeft:0,scrollTop:0};const f=oi(0);if((r||!o)&&((Qn(t)!=="body"||co(i))&&(c=Dh(t)),r)){const b=Za(t,!0,o,t);f.x=b.x+t.clientLeft,f.y=b.y+t.clientTop}!r&&i&&(f.x=Yh(i));const d=i&&!r&&!o?Xk(i,c):oi(0),m=l.left+c.scrollLeft-f.x-d.x,p=l.top+c.scrollTop-f.y-d.y;return{x:m,y:p,width:l.width,height:l.height}}function J0(e){return Br(e).position==="static"}function A2(e,t){if(!dn(e)||Br(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return di(e)===n&&(n=n.ownerDocument.body),n}function Kk(e,t){const n=sn(e);if(Mh(e))return n;if(!dn(e)){let i=ea(e);for(;i&&!Ji(i);){if(Et(i)&&!J0(i))return i;i=ea(i)}return n}let r=A2(e,t);for(;r&&iL(r)&&J0(r);)r=A2(r,t);return r&&Ji(r)&&J0(r)&&!Jb(r)?n:r||lL(e)||n}const $M=async function(e){const t=this.getOffsetParent||Kk,n=this.getDimensions,r=await n(e.floating);return{reference:VM(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function qM(e){return Br(e).direction==="rtl"}const Qk={convertOffsetParentRelativeRectToViewportRelativeRect:MM,getDocumentElement:di,getClippingRect:zM,getOffsetParent:Kk,getElementRects:$M,getClientRects:DM,getDimensions:FM,getScale:ul,isElement:Et,isRTL:qM};function Wk(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function YM(e,t,n){let r=null,i;const o=di(e);function l(){var m;clearTimeout(i),(m=r)==null||m.disconnect(),r=null}function c(m,p){m===void 0&&(m=!1),p===void 0&&(p=1),l();const b=e.getBoundingClientRect(),{left:y,top:E,width:w,height:k}=b;if(m||t(),!w||!k)return;const C=ud(E),A=ud(o.clientWidth-(y+w)),_=ud(o.clientHeight-(E+k)),N=ud(y),O={rootMargin:-C+"px "+-A+"px "+-_+"px "+-N+"px",threshold:ai(0,pl(1,p))||1};let j=!0;function M(q){const U=q[0].intersectionRatio;if(!Wk(b,e.getBoundingClientRect()))return c();if(U!==p){if(!j)return c();U?c(!1,U):i=setTimeout(()=>{c(!1,1e-7)},1e3)}j=!1}try{r=new IntersectionObserver(M,{...O,root:o.ownerDocument})}catch{r=new IntersectionObserver(M,O)}r.observe(e)}const f=sn(e),d=()=>c(n);return f.addEventListener("resize",d),c(!0),()=>{f.removeEventListener("resize",d),l()}}function _2(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,d=m1(e),m=i||o?[...d?fc(d):[],...t?fc(t):[]]:[];m.forEach(C=>{i&&C.addEventListener("scroll",n),o&&C.addEventListener("resize",n)});const p=d&&c?YM(d,n,o):null;let b=-1,y=null;l&&(y=new ResizeObserver(C=>{let[A]=C;A&&A.target===d&&y&&t&&(y.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var _;(_=y)==null||_.observe(t)})),n()}),d&&!f&&y.observe(d),t&&y.observe(t));let E,w=f?Za(e):null;f&&k();function k(){const C=Za(e);w&&!Wk(w,C)&&n(),w=C,E=requestAnimationFrame(k)}return n(),()=>{var C;m.forEach(A=>{i&&A.removeEventListener("scroll",n),o&&A.removeEventListener("resize",n)}),p?.(),(C=y)==null||C.disconnect(),y=null,f&&cancelAnimationFrame(E)}}const GM=_M,XM=NM,KM=wM,QM=OM,WM=kM,ZM=RM,JM=(e,t,n)=>{const r=new Map,i=n??{},o={...Qk,...i.platform,_c:r};return CM(e,t,{...i,platform:o})};var eD=typeof document<"u",tD=function(){},Ud=eD?S.useLayoutEffect:tD;function lh(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!lh(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!lh(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Zk(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function N2(e,t){const n=Zk(e);return Math.round(t*n)/n}function eg(e){const t=S.useRef(e);return Ud(()=>{t.current=e}),t}function nD(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:l}={},transform:c=!0,whileElementsMounted:f,open:d}=e,[m,p]=S.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[b,y]=S.useState(r);lh(b,r)||y(r);const[E,w]=S.useState(null),[k,C]=S.useState(null),A=S.useCallback(te=>{te!==O.current&&(O.current=te,w(te))},[]),_=S.useCallback(te=>{te!==j.current&&(j.current=te,C(te))},[]),N=o||E,D=l||k,O=S.useRef(null),j=S.useRef(null),M=S.useRef(m),q=f!=null,U=eg(f),Q=eg(i),Z=eg(d),G=S.useCallback(()=>{if(!O.current||!j.current)return;const te={placement:t,strategy:n,middleware:b};Q.current&&(te.platform=Q.current),JM(O.current,j.current,te).then(le=>{const I={...le,isPositioned:Z.current!==!1};ee.current&&!lh(M.current,I)&&(M.current=I,cs.flushSync(()=>{p(I)}))})},[b,t,n,Q,Z]);Ud(()=>{d===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,p(te=>({...te,isPositioned:!1})))},[d]);const ee=S.useRef(!1);Ud(()=>(ee.current=!0,()=>{ee.current=!1}),[]),Ud(()=>{if(N&&(O.current=N),D&&(j.current=D),N&&D){if(U.current)return U.current(N,D,G);G()}},[N,D,G,U,q]);const Y=S.useMemo(()=>({reference:O,floating:j,setReference:A,setFloating:_}),[A,_]),H=S.useMemo(()=>({reference:N,floating:D}),[N,D]),K=S.useMemo(()=>{const te={position:n,left:0,top:0};if(!H.floating)return te;const le=N2(H.floating,m.x),I=N2(H.floating,m.y);return c?{...te,transform:"translate("+le+"px, "+I+"px)",...Zk(H.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:le,top:I}},[n,c,H.floating,m.x,m.y]);return S.useMemo(()=>({...m,update:G,refs:Y,elements:H,floatingStyles:K}),[m,G,Y,H,K])}const rD=(e,t)=>{const n=GM(e);return{name:n.name,fn:n.fn,options:[e,t]}},sD=(e,t)=>{const n=XM(e);return{name:n.name,fn:n.fn,options:[e,t]}},iD=(e,t)=>({fn:ZM(e).fn,options:[e,t]}),aD=(e,t)=>{const n=KM(e);return{name:n.name,fn:n.fn,options:[e,t]}},oD=(e,t)=>{const n=QM(e);return{name:n.name,fn:n.fn,options:[e,t]}},lD=(e,t)=>{const n=WM(e);return{name:n.name,fn:n.fn,options:[e,t]}},uD={open:ze(e=>e.open),transitionStatus:ze(e=>e.transitionStatus),domReferenceElement:ze(e=>e.domReferenceElement),referenceElement:ze(e=>e.positionReference??e.referenceElement),floatingElement:ze(e=>e.floatingElement),floatingId:ze(e=>e.floatingId)};class Gh extends Wb{constructor(t){const{syncOnly:n,nested:r,onOpenChange:i,triggerElements:o,...l}=t;super({...l,positionReference:l.referenceElement,domReferenceElement:l.referenceElement},{onOpenChange:i,dataRef:{current:{}},events:hM(),nested:r,triggerElements:o},uD),this.syncOnly=n}syncOpenEvent=(t,n)=>{(!t||!this.state.open||n!=null&&xL(n))&&(this.context.dataRef.current.openEvent=t?n:void 0)};dispatchOpenChange=(t,n)=>{this.syncOpenEvent(t,n.event);const r={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)};setOpen=(t,n)=>{if(this.syncOnly){this.context.onOpenChange?.(t,n);return}this.dispatchOpenChange(t,n),this.context.onOpenChange?.(t,n)}}function cD(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:o,onOpenChange:l}=e,c=t.useState("open"),f=t.useState("activeTriggerElement"),d=t.useState(n?"popupElement":"positionerElement"),m=t.context.triggerElements,p=l,b=S.useRef(null);r===void 0&&b.current===null&&(b.current=new Gh({open:c,transitionStatus:void 0,referenceElement:f,floatingElement:d,triggerElements:m,onOpenChange:p,floatingId:i,syncOnly:!0,nested:o}));const y=r??b.current;return t.useSyncedValue("floatingId",i),Ve(()=>{const E={open:c,floatingId:i,referenceElement:f,floatingElement:d};Et(f)&&(E.domReferenceElement=f),y.state.positionReference===y.state.referenceElement&&(E.positionReference=f),y.update(E)},[c,i,f,d,y]),y.context.onOpenChange=p,y.context.nested=o,y}function g1(e,t=!1,n=!1){const[r,i]=S.useState(e&&t?"idle":void 0),[o,l]=S.useState(e);return e&&!o&&(l(!0),i("starting")),!e&&o&&r!=="ending"&&!n&&i("ending"),!e&&!o&&r==="ending"&&i(void 0),Ve(()=>{if(!e&&o&&r!=="ending"&&n){const c=Cs.request(()=>{i("ending")});return()=>{Cs.cancel(c)}}},[e,o,r,n]),Ve(()=>{if(!e||t)return;const c=Cs.request(()=>{i(void 0)});return()=>{Cs.cancel(c)}},[t,e]),Ve(()=>{if(!e||!t)return;e&&o&&r!=="idle"&&i("starting");const c=Cs.request(()=>{i("idle")});return()=>{Cs.cancel(c)}},[t,e,o,r]),{mounted:o,setMounted:l,transitionStatus:r}}let mc=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const fD={[mc.startingStyle]:""},dD={[mc.endingStyle]:""},wc={transitionStatus(e){return e==="starting"?fD:e==="ending"?dD:null}};function hD(e,t=!1,n=!0){const r=hl();return Je((i,o=null)=>{r.cancel();const l=ei(e);if(l==null)return;const c=l,f=()=>{cs.flushSync(i)};if(typeof c.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function d(){Promise.all(c.getAnimations().map(m=>m.finished)).then(()=>{o?.aborted||f()}).catch(()=>{if(n){o?.aborted||f();return}const m=c.getAnimations();!o?.aborted&&m.length>0&&m.some(p=>p.pending||p.playState!=="finished")&&d()})}if(t){const m=mc.startingStyle;if(!c.hasAttribute(m)){r.request(d);return}const p=new MutationObserver(()=>{c.hasAttribute(m)||(p.disconnect(),d())});p.observe(c,{attributes:!0,attributeFilter:[m]}),o?.addEventListener("abort",()=>p.disconnect(),{once:!0});return}r.request(d)})}function vl(e){const{enabled:t=!0,open:n,ref:r,onComplete:i}=e,o=Je(i),l=hD(r,n,!1);S.useEffect(()=>{if(!t)return;const c=new AbortController;return l(o,c.signal),()=>{c.abort()}},[t,n,o,l])}const b1={tabIndex:-1,[Wg]:""};function pD(e){return t=>t==="touch"?e.current:!0}function Jk(e,t,n=!1){const r=$h(),i=qh()!=null,o=S.useRef(null);e===void 0&&o.current===null&&(o.current=t(r,i));const l=e??o.current;return cD({popupStore:l,treatPopupAsFloatingElement:n,floatingRootContext:l.state.floatingRootContext,floatingId:r,nested:i,onOpenChange:l.setOpen}),{store:l,internalStore:o.current}}function mD(e,t){const n=S.useRef(null),r=S.useRef(null);return S.useCallback(i=>{if(e===void 0)return;let o=!1;if(n.current!==null){const l=n.current,c=r.current,f=t.context.triggerElements.getById(l);c&&f===c&&(t.context.triggerElements.delete(l),o=!0),n.current=null,r.current=null}if(i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i),o=!0),o){const l=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==l&&t.set("triggerCount",l)}},[t,e])}function e3(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);const i=n?.id??null;(i||t)&&(e.activeTriggerId=i,e.activeTriggerElement=n??null)}function gD(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function bD(e,t,n,r={}){const i=n.reason,o=i===Cr,l=t&&i===Bd,c=!t&&(i===Cc||i===a1),f=gD(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);const d=()=>{const m={...r.extraState,open:t};l?m.instantType="focus":c?m.instantType="dismiss":o&&(m.instantType=void 0),e3(m,t,n.trigger,f()),e.update(m)};o?cs.flushSync(d):d()}function xD(e,t,n,r){Xb(()=>{t===void 0&&e.state.open===!1&&n&&(e.state={...e.state,open:!0,activeTriggerId:r,preventUnmountingOnClose:!1})})}function t3(e,t,n,r){const i=n.useState("isMountedByTrigger",e),o=mD(e,n),l=Je(c=>{if(o(c),!c)return;const f=n.select("open"),d=n.select("activeTriggerId");if(d===e){n.update({activeTriggerElement:c,...f?r:null});return}d==null&&f&&n.update({activeTriggerId:e,activeTriggerElement:c,...r})});return Ve(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:l,isMountedByThisTrigger:i}}function n3(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,r=e.useState("open"),i=e.useState("triggerCount");Ve(()=>{if(!r){e.state.triggerCount!==0&&e.set("triggerCount",0);return}const o=e.context.triggerElements.size,l={};e.state.triggerCount!==o&&(l.triggerCount=o);const c=e.select("activeTriggerId");let f=null;if(c){const d=e.context.triggerElements.getById(c);d?d!==e.state.activeTriggerElement&&(l.activeTriggerElement=d):f=c}if(!f&&!c&&o===1){const d=e.context.triggerElements.entries().next();if(!d.done){const[m,p]=d.value;l.activeTriggerId=m,l.activeTriggerElement=p}}(l.triggerCount!==void 0||l.activeTriggerId!==void 0||l.activeTriggerElement!==void 0)&&e.update(l),f&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===f&&!e.context.triggerElements.getById(f)){const d=vt(El);e.setOpen(!1,d),d.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[r,e,i,n])}function r3(e,t,n){const{mounted:r,setMounted:i,transitionStatus:o}=g1(e),l=t.useState("preventUnmountingOnClose"),c=e?!1:l;t.useSyncedValues({mounted:r,transitionStatus:o,preventUnmountingOnClose:c});const f=Je(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),t.context.onOpenChangeComplete?.(!1)});return vl({enabled:r&&!e&&!c,open:e,ref:t.context.popupRef,onComplete(){e||f()}}),{forceUnmount:f,transitionStatus:o}}function s3(e,t){e.useSyncedValues(t),Ve(()=>()=>{e.update({activeTriggerProps:Rn,inactiveTriggerProps:Rn,popupProps:Rn})},[e])}function yD(e,t){Ve(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),Ve(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class Xh{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,n){const r=this.idMap.get(t);r!==n&&(r!==void 0&&this.elementsSet.delete(r),this.elementsSet.add(n),this.idMap.set(t,n))}delete(t){const n=this.idMap.get(t);n&&(this.elementsSet.delete(n),this.idMap.delete(t))}hasElement(t){return this.elementsSet.has(t)}hasMatchingElement(t){for(const n of this.elementsSet)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function ED(){return new Gh({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new Xh,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function i3(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:ED(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Rn,inactiveTriggerProps:Rn,popupProps:Rn}}function a3(e,t,n=!1){return new Gh({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}const Gu=ze(e=>e.triggerIdProp??e.activeTriggerId),x1=ze(e=>e.openProp??e.open),R2=ze(e=>(e.popupElement?.id??e.floatingId)||void 0);function o3(e,t){return t!==void 0&&x1(e)&&Gu(e)===t}function TD(e,t){return o3(e,t)?!0:t!==void 0&&x1(e)&&Gu(e)==null&&e.triggerCount===1}const l3={open:x1,mounted:ze(e=>e.mounted),transitionStatus:ze(e=>e.transitionStatus),floatingRootContext:ze(e=>e.floatingRootContext),triggerCount:ze(e=>e.triggerCount),preventUnmountingOnClose:ze(e=>e.preventUnmountingOnClose),payload:ze(e=>e.payload),activeTriggerId:Gu,activeTriggerElement:ze(e=>e.mounted?e.activeTriggerElement:null),popupId:R2,isTriggerActive:ze((e,t)=>t!==void 0&&Gu(e)===t),isOpenedByTrigger:ze((e,t)=>o3(e,t)),isMountedByTrigger:ze((e,t)=>t!==void 0&&Gu(e)===t&&e.mounted),triggerProps:ze((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),triggerPopupId:ze((e,t)=>TD(e,t)?R2(e):void 0),popupProps:ze(e=>e.popupProps),popupElement:ze(e=>e.popupElement),positionerElement:ze(e=>e.positionerElement)};function u3(e){const{open:t=!1,onOpenChange:n,elements:r={}}=e,i=$h(),o=qh()!=null,l=jr(()=>new Gh({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new Xh,floatingId:i,syncOnly:!1,nested:o})).current;return Ve(()=>{const c={open:t,floatingId:i};r.reference!==void 0&&(c.referenceElement=r.reference,c.domReferenceElement=Et(r.reference)?r.reference:null),r.floating!==void 0&&(c.floatingElement=r.floating),l.update(c)},[t,i,r.reference,r.floating,l]),l.context.onOpenChange=n,l.context.nested=o,l}function vD(e={}){const{nodeId:t,externalTree:n}=e,r=u3(e),i=e.rootContext||r,o=i.useState("referenceElement"),l=i.useState("floatingElement"),c=i.useState("domReferenceElement"),f=i.useState("open"),d=i.useState("floatingId"),[m,p]=S.useState(null),[b,y]=S.useState(void 0),[E,w]=S.useState(void 0),k=S.useRef(null),C=Tl(n),A=S.useMemo(()=>({reference:o,floating:l,domReference:c}),[o,l,c]),_=nD({...e,elements:{...A,...m&&{reference:m}}}),N=Et(b)?b:null,D=E===void 0?i.state.floatingElement:E;i.useSyncedValue("referenceElement",b??null),i.useSyncedValue("domReferenceElement",b===void 0?c:N),i.useSyncedValue("floatingElement",D);const O=S.useCallback(Z=>{const G=Et(Z)?{getBoundingClientRect:()=>Z.getBoundingClientRect(),getClientRects:()=>Z.getClientRects(),contextElement:Z}:Z;p(G),_.refs.setReference(G)},[_.refs]),j=S.useCallback(Z=>{(Et(Z)||Z===null)&&(k.current=Z,y(Z)),(Et(_.refs.reference.current)||_.refs.reference.current===null||Z!==null&&!Et(Z))&&_.refs.setReference(Z)},[_.refs,y]),M=S.useCallback(Z=>{w(Z),_.refs.setFloating(Z)},[_.refs]),q=S.useMemo(()=>({..._.refs,setReference:j,setFloating:M,setPositionReference:O,domReference:k}),[_.refs,j,M,O]),U=S.useMemo(()=>({..._.elements,domReference:c}),[_.elements,c]),Q=S.useMemo(()=>({..._,dataRef:i.context.dataRef,open:f,onOpenChange:i.setOpen,events:i.context.events,floatingId:d,refs:q,elements:U,nodeId:t,rootStore:i}),[_,q,U,t,i,f,d]);return Ve(()=>{c&&(k.current=c)},[c]),Ve(()=>{i.context.dataRef.current.floatingContext=Q;const Z=C?.nodesRef.current.find(G=>G.id===t);Z&&(Z.context=Q)}),S.useMemo(()=>({..._,context:Q,refs:q,elements:U,rootStore:i}),[_,q,U,Q,i])}const tg=hk&&oa;function SD(e,t={}){const{enabled:n=!0,delay:r}=t,i="rootStore"in e?e.rootStore:e,{events:o,dataRef:l}=i.context,c=S.useRef(!1),f=S.useRef(null),d=S.useRef(!0),m=ns();S.useEffect(()=>{const b=i.select("domReferenceElement");if(!n)return;const y=sn(b);function E(){const C=i.select("domReferenceElement");!i.select("open")&&dn(C)&&C===Sr(Pt(C))&&(c.current=!0)}function w(){d.current=!0}function k(){d.current=!1}return Os(yt(y,"blur",E),tg&&yt(y,"keydown",w,!0),tg&&yt(y,"pointerdown",k,!0))},[i,n]),S.useEffect(()=>{if(!n)return;function b(y){if(y.reason===Cc||y.reason===a1){const E=i.select("domReferenceElement");Et(E)&&(f.current=E,c.current=!0)}}return o.on("openchange",b),()=>{o.off("openchange",b)}},[o,n,i]);const p=S.useMemo(()=>{function b(){c.current=!1,f.current=null}return{onMouseLeave(){b()},onFocus(y){const E=y.currentTarget;if(c.current){if(f.current===E)return;b()}const w=ur(y.nativeEvent);if(Et(w)){if(tg&&!y.relatedTarget){if(!d.current&&!Uh(w))return}else if(!TL(w))return}const k=eh(y.relatedTarget,i.context.triggerElements),{nativeEvent:C,currentTarget:A}=y,_=typeof r=="function"?r():r;if(i.select("open")&&k||_===0||_===void 0){i.setOpen(!0,vt(Bd,C,A));return}m.start(_,()=>{c.current||i.setOpen(!0,vt(Bd,C,A))})},onBlur(y){b();const E=y.relatedTarget,w=y.nativeEvent,k=Et(E)&&E.hasAttribute(pc("focus-guard"))&&E.getAttribute("data-type")==="outside";m.start(0,()=>{const C=i.select("domReferenceElement"),A=Sr(Pt(C));!E&&A===C||nt(l.current.floatingContext?.refs.floating.current,A)||nt(C,A)||k||eh(E??A,i.context.triggerElements)||i.setOpen(!1,vt(Bd,w))})}}},[l,r,i,m]);return S.useMemo(()=>n?{reference:p,trigger:p}:{},[n,p])}class y1{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new us,this.restTimeout=new us,this.handleCloseOptions=void 0}static create(){return new y1}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}const uh=new WeakMap;function ch(e){if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&uh.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty("pointer-events"),e.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),e.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),uh.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function c3(e,t){const{scopeElement:n,referenceElement:r,floatingElement:i}=t,o=uh.get(n);o&&o!==e&&ch(o),ch(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,uh.set(n,e),n.style.pointerEvents="none",r.style.pointerEvents="auto",i.style.pointerEvents="auto"}function E1(e){const t=e.context.dataRef.current,n=jr(()=>t.hoverInteractionState??y1.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=n),t1(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function CD(e,t={}){const{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,o="rootStore"in e?e.rootStore:e,l=o.useState("open"),c=o.useState("floatingElement"),f=o.useState("domReferenceElement"),{dataRef:d}=o.context,m=Tl(),p=qh(),b=E1(o),y=ns(),E=Je(()=>bk(d.current.openEvent?.type,b.interactedInside)),w=Je(()=>SL(d.current.openEvent?.type)),k=Je(()=>{ch(b)});Ve(()=>{l||(b.pointerType=void 0,b.restTimeoutPending=!1,b.interactedInside=!1,k())},[l,b,k]),S.useEffect(()=>k,[k]),Ve(()=>{if(n&&l&&b.handleCloseOptions?.blockPointerEvents&&w()&&Et(f)&&c){const C=f,A=c,_=Pt(c),N=m?.nodesRef.current.find(M=>M.id===p)?.context?.elements.floating;N&&(N.style.pointerEvents="");const D=b.pointerEventsScopeElement!==A?b.pointerEventsScopeElement:null,O=N!==A?N:null,j=b.handleCloseOptions?.getScope?.()??D??O??C.closest("[data-rootownerid]")??_.body;return c3(b,{scopeElement:j,referenceElement:C,floatingElement:A}),()=>{k()}}},[n,l,f,c,b,w,m,p,k]),S.useEffect(()=>{if(!n)return;function C(){return!!(m&&p&&ta(m.nodesRef.current,p).length>0)}function A(M){const q=nh(r,"close",b.pointerType),U=()=>{o.setOpen(!1,vt(Cr,M)),m?.events.emit("floating.closed",M)};q?b.openChangeTimeout.start(q,U):(b.openChangeTimeout.clear(),U())}function _(M){const q=ur(M);if(!EL(q)){b.interactedInside=!1;return}b.interactedInside=q?.closest("[aria-haspopup]")!=null}function N(){b.openChangeTimeout.clear(),y.clear(),m?.events.off("floating.closed",O),k()}function D(M){if(C()&&m){m.events.on("floating.closed",O);return}if(eh(M.relatedTarget,o.context.triggerElements))return;const q=d.current.floatingContext?.nodeId??i,U=M.relatedTarget;if(!(m&&q&&Et(U)&&ta(m.nodesRef.current,q,!1).some(Z=>nt(Z.context?.elements.floating,U)))){if(b.handler){b.handler(M);return}k(),w()&&!E()&&A(M)}}function O(M){!m||!p||C()||y.start(0,()=>{m.events.off("floating.closed",O),o.setOpen(!1,vt(Cr,M)),m.events.emit("floating.closed",M)})}const j=c;return Os(j&&yt(j,"mouseenter",N),j&&yt(j,"mouseleave",D),j&&yt(j,"pointerdown",_,!0),()=>{m?.events.off("floating.closed",O)})},[n,c,o,d,r,i,w,E,k,b,m,p,y])}const wD={current:null};function kD(e,t={}){const{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:o=!1,restMs:l=0,move:c=!0,triggerElementRef:f=wD,externalTree:d,isActiveTrigger:m=!0,getHandleCloseContext:p,isClosing:b,shouldOpen:y}=t,E="rootStore"in e?e.rootStore:e,{dataRef:w,events:k}=E.context,C=Tl(d),A=E1(E),_=S.useRef(!1),N=xn(i),D=xn(r),O=xn(l),j=xn(n),M=xn(y),q=xn(b),U=Je(()=>bk(w.current.openEvent?.type,A.interactedInside)),Q=Je(()=>M.current?.()!==!1),Z=Je((Y,H,K)=>{const te=E.context.triggerElements;if(te.hasElement(H))return!Y||!nt(Y,H);if(!Et(K))return!1;const le=K;return te.hasMatchingElement(I=>nt(I,le))&&(!Y||!nt(Y,le))}),G=Je(()=>{if(!A.handler)return;Pt(E.select("domReferenceElement")).removeEventListener("mousemove",A.handler),A.handler=void 0}),ee=Je(()=>{ch(A)});return m&&(A.handleCloseOptions=N.current?.__options),S.useEffect(()=>G,[G]),S.useEffect(()=>{if(!n)return;function Y(H){H.open?_.current=!1:(_.current=H.reason===Cr,G(),A.openChangeTimeout.clear(),A.restTimeout.clear(),A.blockMouseMove=!0,A.restTimeoutPending=!1)}return k.on("openchange",Y),()=>{k.off("openchange",Y)}},[n,k,A,G]),S.useEffect(()=>{if(!n)return;function Y(le,I=!0){const P=nh(D.current,"close",A.pointerType);P?A.openChangeTimeout.start(P,()=>{E.setOpen(!1,vt(Cr,le)),C?.events.emit("floating.closed",le)}):I&&(A.openChangeTimeout.clear(),E.setOpen(!1,vt(Cr,le)),C?.events.emit("floating.closed",le))}const H=f.current??(m?E.select("domReferenceElement"):null);if(!Et(H))return;function K(le){if(A.openChangeTimeout.clear(),A.blockMouseMove=!1,o&&!Wa(A.pointerType))return;const I=n2(O.current),P=nh(D.current,"open",A.pointerType),$=ur(le),L=le.currentTarget??null,ae=E.select("domReferenceElement");let ie=L;if(Et($)&&!E.context.triggerElements.hasElement($)){for(const je of E.context.triggerElements.elements())if(nt(je,$)){ie=je;break}}Et(L)&&Et(ae)&&!E.context.triggerElements.hasElement(L)&&nt(L,ae)&&(ie=ae);const fe=ie==null?!1:Z(ae,ie,$),de=E.select("open"),he=q.current?.()??E.select("transitionStatus")==="ending",ve=!de&&he&&_.current,Ue=!fe&&Et(ie)&&Et(ae)&&nt(ae,ie)&&ve,Pe=I>0&&!P,Te=fe&&(de||ve)||Ue,Ie=!de||fe;if(Te){Q()&&E.setOpen(!0,vt(Cr,le,ie));return}Pe||(P?A.openChangeTimeout.start(P,()=>{Ie&&Q()&&E.setOpen(!0,vt(Cr,le,ie))}):Ie&&Q()&&E.setOpen(!0,vt(Cr,le,ie)))}function te(le){if(U()){ee();return}G();const I=E.select("domReferenceElement"),P=Pt(I);A.restTimeout.clear(),A.restTimeoutPending=!1;const $=w.current.floatingContext??p?.();if(eh(le.relatedTarget,E.context.triggerElements))return;if(N.current&&$){E.select("open")||A.openChangeTimeout.clear();const ae=f.current;A.handler=N.current({...$,tree:C,x:le.clientX,y:le.clientY,onClose(){ee(),G(),j.current&&!U()&&ae===E.select("domReferenceElement")&&Y(le,!0)}}),P.addEventListener("mousemove",A.handler),A.handler(le);return}(A.pointerType==="touch"?!nt(E.select("floatingElement"),le.relatedTarget):!0)&&Y(le)}return c?Os(yt(H,"mousemove",K,{once:!0}),yt(H,"mouseenter",K),yt(H,"mouseleave",te)):Os(yt(H,"mouseenter",K),yt(H,"mouseleave",te))},[G,ee,w,D,E,n,N,A,m,Z,U,o,c,O,f,C,j,p,q,Q]),S.useMemo(()=>{if(!n)return;function Y(H){A.pointerType=H.pointerType}return{onPointerDown:Y,onPointerEnter:Y,onMouseMove(H){const{nativeEvent:K}=H,te=H.currentTarget,le=E.select("domReferenceElement"),I=E.select("open"),P=Z(le,te,H.target);if(o&&!Wa(A.pointerType))return;if(I&&P&&A.handleCloseOptions?.blockPointerEvents){const ae=E.select("floatingElement");if(ae){const ie=A.handleCloseOptions?.getScope?.()??te.ownerDocument.body;c3(A,{scopeElement:ie,referenceElement:te,floatingElement:ae})}}const $=n2(O.current);if(I&&!P||$===0||!P&&A.restTimeoutPending&&H.movementX**2+H.movementY**2<2)return;A.restTimeout.clear();function L(){if(A.restTimeoutPending=!1,U())return;const ae=E.select("open");!A.blockMouseMove&&(!ae||P)&&Q()&&E.setOpen(!0,vt(Cr,K,te))}A.pointerType==="touch"?cs.flushSync(()=>{L()}):P&&I?L():(A.restTimeoutPending=!0,A.restTimeout.start($,L))}}},[n,A,U,Z,o,E,O,Q])}const AD="Escape";function Kh(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function fd(e,t){return Kh(t,e===gk||e===s1,e===Bh||e===Hh)}function ng(e,t,n){return Kh(t,e===s1,n?e===Bh:e===Hh)||e==="Enter"||e===" "||e===""}function _D(e,t,n){return Kh(t,n?e===Bh:e===Hh,e===s1)}function ND(e,t,n,r){const i=n?e===Hh:e===Bh,o=e===gk;return t==="both"||t==="horizontal"&&r?e===AD:Kh(t,i,o)}function RD(e,t){const{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:o=!0,selectedIndex:l=null,allowEscape:c=!1,loopFocus:f=!1,nested:d=!1,rtl:m=!1,virtual:p=!1,focusItemOnOpen:b="auto",focusItemOnHover:y=!0,openOnArrowKeyDown:E=!0,disabledIndices:w=void 0,orientation:k="vertical",parentOrientation:C,id:A,resetOnPointerLeave:_=!0,externalTree:N,grid:D}=t,O=D!=null,j="rootStore"in e?e.rootStore:e,M=j.useState("open"),q=j.useState("floatingElement"),U=j.useState("domReferenceElement"),Q=j.context.dataRef,Z=th(q),G=Zg(U),ee=xn(Z),Y=qh(),H=Tl(N),K=S.useRef(b),te=S.useRef(l??-1),le=S.useRef(null),I=S.useRef(!0),P=Je(se=>{i(te.current===-1?null:te.current,se)}),$=S.useRef(!!q),L=S.useRef(M),ae=S.useRef(!1),ie=S.useRef(!1),fe=S.useRef(null),de=xn(w),he=xn(M),ve=xn(l),Ue=xn(_),Pe=hl(),Te=hl(),Ie=Je(()=>{function se(ue){p?H?.events.emit("virtualfocus",ue):fe.current=Hd(ue,{sync:ae.current,preventScroll:!0})}const re=n.current[te.current],V=ie.current;re&&se(re),(ae.current?ue=>ue():ue=>Pe.request(ue))(()=>{const ue=n.current[te.current]||re;if(!ue)return;re||se(ue),we&&(V||!I.current)&&ue.scrollIntoView?.({block:"nearest",inline:"nearest"})})});Ve(()=>{Q.current.orientation=k},[Q,k]),Ve(()=>{o&&(M&&q?(te.current=l??-1,K.current&&l!=null&&(ie.current=!0,P())):$.current&&(te.current=-1,P()))},[o,M,q,l,P]),Ve(()=>{if(o){if(!M){ae.current=!1;return}if(q)if(r==null){if(ae.current=!1,ve.current!=null)return;if($.current&&(te.current=-1,Ie()),(!L.current||!$.current)&&K.current&&(le.current!=null||K.current===!0&&le.current==null)){let se=0;const re=()=>{n.current[0]==null?(se<2&&(se?z=>Te.request(z):queueMicrotask)(re),se+=1):(te.current=le.current==null||ng(le.current,k,m)||d?K0(n):o2(n),le.current=null,P())};re()}}else a2(n.current,r)||(te.current=r,Ie(),ie.current=!1)}},[o,M,q,r,ve,d,n,k,m,P,Ie,Te]),Ve(()=>{if(!o||q||!H||p||!$.current)return;const se=H.nodesRef.current,re=se.find(ue=>ue.id===Y)?.context?.elements.floating,V=Sr(Pt(U??re??null)),z=se.some(ue=>ue.context&&nt(ue.context.elements.floating,V));re&&!z&&I.current&&re.focus({preventScroll:!0})},[o,q,U,H,Y,p]),Ve(()=>{L.current=M,$.current=!!q}),Ve(()=>{M||(le.current=null,K.current=b)},[M,b]);const je=r!=null,We=Je(se=>{if(!he.current)return;const re=n.current.indexOf(se.currentTarget);re!==-1&&(te.current!==re||r!==re)&&(te.current=re,P(se))}),Xe=Je(()=>C??H?.nodesRef.current.find(se=>se.id===Y)?.context?.dataRef?.current.orientation),Me=Je(()=>K0(n,de.current)),Ce=Je(se=>{if(I.current=!1,ae.current=!0,se.which===229||!he.current&&se.currentTarget===ee.current)return;if(d&&ND(se.key,k,m,O)){fd(se.key,Xe())||Ss(se),j.setOpen(!1,vt(r2,se.nativeEvent)),dn(U)&&(p?H?.events.emit("virtualfocus",U):U.focus());return}const re=te.current,V=K0(n,w),z=o2(n,w);if(G||(se.key==="Home"&&(Ss(se),te.current=V,P(se)),se.key==="End"&&(Ss(se),te.current=z,P(se))),D!=null){const ue=D(se,te.current,n,k,f,m,w,V,z);if(ue!=null&&(te.current=ue,P(se)),k==="both")return}if(fd(se.key,k)){if(Ss(se),M&&!p&&Sr(se.currentTarget.ownerDocument)===se.currentTarget){te.current=ng(se.key,k,m)?V:z,P(se);return}ng(se.key,k,m)?f?re>=z?c&&re!==n.current.length?te.current=-1:(ae.current=!1,te.current=V):te.current=il(n.current,{startingIndex:re,disabledIndices:w}):te.current=Math.min(z,il(n.current,{startingIndex:re,disabledIndices:w})):f?re<=V?c&&re!==-1?te.current=n.current.length:(ae.current=!1,te.current=z):te.current=il(n.current,{startingIndex:re,decrement:!0,disabledIndices:w}):te.current=Math.max(V,il(n.current,{startingIndex:re,decrement:!0,disabledIndices:w})),a2(n.current,te.current)&&(te.current=-1),P(se)}}),we=S.useMemo(()=>({onFocus(re){ae.current=!0,We(re)},onClick:({currentTarget:re})=>re.focus({preventScroll:!0}),onMouseMove(re){ae.current=!0,ie.current=!1,y&&We(re)},onPointerLeave(re){if(!he.current||!I.current||re.pointerType==="touch")return;ae.current=!0;const V=re.relatedTarget;if(!(!y||n.current.includes(V))&&Ue.current&&(fe.current?.(),fe.current=null,te.current=-1,P(re),!p)){const z=ee.current,ue=Sr(Pt(z));z&&nt(z,ue)&&z.focus({preventScroll:!0})}}}),[We,he,ee,y,n,P,Ue,p]),Be=S.useMemo(()=>p&&M&&je&&{"aria-activedescendant":`${A}-${r}`},[p,M,je,A,r]),$e=S.useMemo(()=>({"aria-orientation":k==="both"?void 0:k,...G?{}:Be,onKeyDown(se){if(se.key==="Tab"&&se.shiftKey&&M&&!p){const re=ur(se.nativeEvent);if(re&&!nt(ee.current,re))return;Ss(se),j.setOpen(!1,vt(zh,se.nativeEvent)),dn(U)&&U.focus();return}Ce(se)},onPointerMove(){I.current=!0}}),[Be,Ce,ee,k,G,j,M,p,U]),W=S.useMemo(()=>{function se(z){j.setOpen(!0,vt(r2,z.nativeEvent,z.currentTarget))}function re(z){b==="auto"&&r1(z.nativeEvent)&&(K.current=!p)}function V(z){K.current=b,b==="auto"&&pk(z.nativeEvent)&&(K.current=!0)}return{onKeyDown(z){const ue=j.select("open");I.current=!1;const ke=z.key.startsWith("Arrow"),Re=_D(z.key,Xe(),m),qe=fd(z.key,k),rt=(d?Re:qe)||z.key==="Enter"||z.key.trim()==="";if(p&&ue)return Ce(z);if(!(!ue&&!E&&ke)){if(rt){const et=fd(z.key,Xe());le.current=d&&et?null:z.key}if(d){Re&&(Ss(z),ue?(te.current=Me(),P(z)):se(z));return}qe&&(ve.current!=null&&(te.current=ve.current),Ss(z),!ue&&E?se(z):Ce(z),ue&&P(z))}},onFocus(z){j.select("open")&&!p&&(te.current=-1,P(z))},onPointerDown:V,onPointerEnter:V,onMouseDown:re,onClick:re}},[Ce,b,Me,d,P,j,E,k,Xe,m,ve,p]),me=S.useMemo(()=>({...Be,...W}),[Be,W]);return S.useMemo(()=>o?{reference:me,floating:$e,item:we,trigger:W}:{},[o,me,$e,W,we])}function OD(e,t){const{listRef:n,elementsRef:r,activeIndex:i,onMatch:o,disabledIndices:l,onTyping:c,enabled:f=!0,resetMs:d=750,selectedIndex:m=null}=t,p="rootStore"in e?e.rootStore:e,b=p.useState("open"),y=ns(),E=S.useRef(""),w=S.useRef(m??i??-1),k=S.useRef(null),C=Je(N=>{function D(ee){const Y=r?.current[ee];return!Y||Fh(Y)}function O(ee){return D(ee)?l==null||!Tk(Xg,ee,l):!1}function j(ee,Y,H=0){if(ee.length===0)return-1;const K=(H%ee.length+ee.length)%ee.length,te=Y.toLowerCase();for(let le=0;le<ee.length;le+=1){const I=(K+le)%ee.length;if(!(!ee[I]?.toLowerCase().startsWith(te)||!O(I)))return I}return-1}const M=n.current;if(E.current.length>0&&N.key===" "&&(Ss(N),c?.(!0)),E.current.length>0&&E.current[0]!==" "&&j(M,E.current)===-1&&N.key!==" "&&c?.(!1),M==null||N.key.length!==1||N.ctrlKey||N.metaKey||N.altKey)return;b&&N.key!==" "&&(Ss(N),c?.(!0));const q=E.current==="";q&&(w.current=m??i??-1),M.every((ee,Y)=>ee&&O(Y)?ee[0]?.toLowerCase()!==ee[1]?.toLowerCase():!0)&&E.current===N.key&&(E.current="",w.current=k.current),E.current+=N.key,y.start(d,()=>{E.current="",w.current=k.current,c?.(!1)});const Z=((q?m??i??-1:w.current)??0)+1,G=j(M,E.current,Z);G!==-1?(o?.(G),k.current=G):N.key!==" "&&(E.current="",c?.(!1))}),A=Je(N=>{const D=N.relatedTarget,O=p.select("domReferenceElement"),j=p.select("floatingElement");nt(O,D)||nt(j,D)||(y.clear(),E.current="",w.current=k.current,c?.(!1))});Ve(()=>{!b&&m!==null||(y.clear(),k.current=null,E.current!==""&&(E.current=""))},[b,m,y]),Ve(()=>{b&&E.current===""&&(w.current=m??i??-1)},[b,m,i]);const _=S.useMemo(()=>({onKeyDown:C,onBlur:A}),[C,A]);return S.useMemo(()=>f?{reference:_,floating:_}:{},[f,_])}const O2=.1,ID=O2*O2,Xt=.5;function dd(e,t,n,r,i,o){return r>=t!=o>=t&&e<=(i-n)*(t-r)/(o-r)+n}function hd(e,t,n,r,i,o,l,c,f,d){let m=!1;return dd(e,t,n,r,i,o)&&(m=!m),dd(e,t,i,o,l,c)&&(m=!m),dd(e,t,l,c,f,d)&&(m=!m),dd(e,t,f,d,n,r)&&(m=!m),m}function LD(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function pd(e,t,n,r,i,o){const l=Math.min(n,i),c=Math.max(n,i),f=Math.min(r,o),d=Math.max(r,o);return e>=l&&e<=c&&t>=f&&t<=d}function MD(e={}){const{blockPointerEvents:t=!1}=e,n=new us,r=({x:i,y:o,placement:l,elements:c,onClose:f,nodeId:d,tree:m})=>{const p=l?.split("-")[0];let b=!1,y=null,E=null,w=typeof performance<"u"?performance.now():0;function k(A,_){const N=performance.now(),D=N-w;if(y===null||E===null||D===0)return y=A,E=_,w=N,!1;const O=A-y,j=_-E,M=O*O+j*j,q=D*D*ID;return y=A,E=_,w=N,M<q}function C(){n.clear(),f()}return function(_){n.clear();const N=c.domReference,D=c.floating;if(!N||!D||p==null||i==null||o==null)return;const{clientX:O,clientY:j}=_,M=ur(_),q=_.type==="mouseleave",U=nt(D,M),Q=nt(N,M);if(U&&(b=!0,!q))return;if(Q&&(b=!1,!q)){b=!0;return}if(q&&Et(_.relatedTarget)&&nt(D,_.relatedTarget))return;function Z(){return!!(m&&ta(m.nodesRef.current,d).length>0)}function G(){Z()||C()}if(Z())return;const ee=N.getBoundingClientRect(),Y=D.getBoundingClientRect(),H=i>Y.right-Y.width/2,K=o>Y.bottom-Y.height/2,te=Y.width>ee.width,le=Y.height>ee.height,I=(te?ee:Y).left,P=(te?ee:Y).right,$=(le?ee:Y).top,L=(le?ee:Y).bottom;if(p==="top"&&o>=ee.bottom-1||p==="bottom"&&o<=ee.top+1||p==="left"&&i>=ee.right-1||p==="right"&&i<=ee.left+1){G();return}let ae=!1;switch(p){case"top":ae=pd(O,j,I,ee.top+1,P,Y.bottom-1);break;case"bottom":ae=pd(O,j,I,Y.top+1,P,ee.bottom-1);break;case"left":ae=pd(O,j,Y.right-1,L,ee.left+1,$);break;case"right":ae=pd(O,j,ee.right-1,L,Y.left+1,$);break}if(ae)return;if(b&&!LD(O,j,ee)){G();return}if(!q&&k(O,j)){G();return}let ie=!1;switch(p){case"top":{const fe=te?Xt/2:Xt*4,de=te||H?i+fe:i-fe,he=te?i-fe:H?i+fe:i-fe,ve=o+Xt+1,Ue=H||te?Y.bottom-Xt:Y.top,Pe=H?te?Y.bottom-Xt:Y.top:Y.bottom-Xt;ie=hd(O,j,de,ve,he,ve,Y.left,Ue,Y.right,Pe);break}case"bottom":{const fe=te?Xt/2:Xt*4,de=te||H?i+fe:i-fe,he=te?i-fe:H?i+fe:i-fe,ve=o-Xt,Ue=H||te?Y.top+Xt:Y.bottom,Pe=H?te?Y.top+Xt:Y.bottom:Y.top+Xt;ie=hd(O,j,de,ve,he,ve,Y.left,Ue,Y.right,Pe);break}case"left":{const fe=le?Xt/2:Xt*4,de=le||K?o+fe:o-fe,he=le?o-fe:K?o+fe:o-fe,ve=i+Xt+1,Ue=K||le?Y.right-Xt:Y.left,Pe=K?le?Y.right-Xt:Y.left:Y.right-Xt;ie=hd(O,j,Ue,Y.top,Pe,Y.bottom,ve,de,ve,he);break}case"right":{const fe=le?Xt/2:Xt*4,de=le||K?o+fe:o-fe,he=le?o-fe:K?o+fe:o-fe,ve=i-Xt,Ue=K||le?Y.left+Xt:Y.right,Pe=K?le?Y.left+Xt:Y.right:Y.left+Xt;ie=hd(O,j,ve,de,ve,he,Ue,Y.top,Pe,Y.bottom);break}}ie?b||n.start(40,G):G()}};return r.__options={...e,blockPointerEvents:t},r}const f3=S.createContext(null),d3=S.createContext(null);function ua(){const e=S.useContext(f3);if(e===null)throw new Error(dr(60));return e}function h3(){const e=S.useContext(d3);if(e===null)throw new Error(dr(61));return e}let I2=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const DD={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Hu={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},PD={disabled:!1,...Hu},jD={valid(e){return e===null?null:e?{[I2.valid]:""}:{[I2.invalid]:""}}},BD={invalid:void 0,name:void 0,validityData:{state:DD,errors:[],error:"",value:"",initialValue:null},setValidityData:Un,disabled:void 0,touched:Hu.touched,setTouched:Un,dirty:Hu.dirty,setDirty:Un,filled:Hu.filled,setFilled:Un,focused:Hu.focused,setFocused:Un,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:PD,markedDirtyRef:{current:!1},registerFieldControl:Un,validation:{getValidationProps:(e,t=Rn)=>t,inputRef:{current:null},registerInput:Un,commit:async()=>{},change:Un}},HD=S.createContext(BD);function T1(e=!0){const t=S.useContext(HD);if(t.setValidityData===Un&&!e)throw new Error(dr(28));return t}function UD(e,t,n,r,i=!0,o){const{registerFieldControl:l}=T1(),c=S.useRef(null);c.current||(c.current=Symbol()),Ve(()=>{const f=c.current;return!f||!i?void 0:(l(f,{controlRef:e,getValue:r,id:t,name:o,value:n}),()=>{l(f,void 0)})},[e,i,r,t,o,l,n])}function kc(e){return $h(e,"base-ui")}const zD=S.createContext({controlId:void 0,registerControlId:Un,labelId:void 0,setLabelId:Un,messageIds:[],setMessageIds:Un,getDescriptionProps:e=>e});function p3(){return S.useContext(zD)}function m3(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,registerControlId:o}=p3(),l=kc(t),c=n?i:void 0,f=jr(()=>Symbol("labelable-control")),d=S.useRef(!1),m=S.useRef(t!=null),p=Je(()=>{!d.current||o===Un||(d.current=!1,o(f.current,void 0))});return Ve(()=>{if(o===Un)return;let b;if(n){const y=r?.current;Et(y)&&y.closest("label")!=null?b=t??null:b=c??l}else if(t!=null)m.current=!0,b=t;else if(m.current)b=l;else{p();return}if(b===void 0){p();return}d.current=!0,o(f.current,b)},[t,r,c,o,n,l,f,p]),S.useEffect(()=>p,[p]),i??l}const FD=(e,t)=>Object.is(e,t);function Ja(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function VD(e,t,n){return!e||e.length===0?!1:e.some(r=>r===void 0?!1:Ja(t,r,n))}function Xu(e,t,n){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:Ja(r,t,n))}function $D(e,t,n){return e.filter(r=>!Ja(t,r,n))}function rb(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function g3(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function qD(e){if(!Array.isArray(e))return e!=null&&"null"in e;const t=e;if(g3(t)){for(const n of t)for(const r of n.items)if(r&&r.value==null&&r.label!=null)return!0;return!1}for(const n of t)if(n&&n.value==null&&n.label!=null)return!0;return!1}function b3(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return rb(e)}function ja(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?rb(e.value):rb(e)}function x3(e,t,n){function r(){return b3(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){const i=t,o=g3(i)?i.flatMap(l=>l.items):i;if(e==null||typeof e!="object"){const l=o.find(c=>c.value===e);return l&&l.label!=null?l.label:r()}if("value"in e){const l=o.find(c=>c&&c.value===e.value);if(l&&l.label!=null)return l.label}}return r()}function YD(e,t,n){return e.reduce((r,i,o)=>(o>0&&r.push(", "),r.push(g.jsx(S.Fragment,{children:x3(i,t,n)},o)),r),[])}const lt={id:ze(e=>e.id),labelId:ze(e=>e.labelId),modal:ze(e=>e.modal),multiple:ze(e=>e.multiple),items:ze(e=>e.items),itemToStringLabel:ze(e=>e.itemToStringLabel),itemToStringValue:ze(e=>e.itemToStringValue),isItemEqualToValue:ze(e=>e.isItemEqualToValue),value:ze(e=>e.value),hasSelectedValue:ze(e=>{const{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:ja(t,r)!==""}),hasNullItemLabel:ze((e,t)=>t?qD(e.items):!1),open:ze(e=>e.open),mounted:ze(e=>e.mounted),forceMount:ze(e=>e.forceMount),transitionStatus:ze(e=>e.transitionStatus),openMethod:ze(e=>e.openMethod),activeIndex:ze(e=>e.activeIndex),selectedIndex:ze(e=>e.selectedIndex),isActive:ze((e,t)=>e.activeIndex===t),isSelected:ze((e,t)=>{const n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(i=>Ja(t,i,n)):Ja(t,r,n)}),isSelectedByFocus:ze((e,t)=>e.selectedIndex===t),popupProps:ze(e=>e.popupProps),triggerProps:ze(e=>e.triggerProps),triggerElement:ze(e=>e.triggerElement),positionerElement:ze(e=>e.positionerElement),listElement:ze(e=>e.listElement),popupSide:ze(e=>e.popupSide),scrollUpArrowVisible:ze(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:ze(e=>e.scrollDownArrowVisible),hasScrollArrows:ze(e=>e.hasScrollArrows)},GD=S.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Un,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function XD(){return S.useContext(GD)}function KD(e,t,n=(r,i)=>r===i){return e.length===t.length&&e.every((r,i)=>n(r,t[i]))}function y3(e,t){const n=S.useRef(e),r=Je(t);Ve(()=>{n.current!==e&&r(n.current)},[e,r]),Ve(()=>{n.current=e},[e])}function QD(e){const t=S.useRef(""),n=S.useCallback(i=>{i.defaultPrevented||(t.current=i.pointerType,e(i,i.pointerType))},[e]);return{onClick:S.useCallback(i=>{if(i.detail===0){e(i,"keyboard");return}"pointerType"in i?e(i,i.pointerType):e(i,t.current),t.current=""},[e]),onPointerDown:n}}function E3(e,t){const n=Je((o,l)=>{(typeof e=="function"?e():e)||t(l||(jh?"touch":""))}),{onClick:r,onPointerDown:i}=QD(n);return S.useMemo(()=>({onClick:r,onPointerDown:i}),[r,i])}function WD(e){const[t,n]=S.useState(null),r=E3(e,n);return y3(e,i=>{i&&!e&&n(null)}),S.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function Uu(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const ti=1;function T3(e,t){return Math.max(0,e-t)}function ZD(e,t){if(t<=0)return 0;const n=Uu(e,0,t),r=n,i=t-n,o=r<=ti,l=i<=ti;return o&&l?r<=i?0:t:o?0:l?t:n}function JD(e){const{id:t,value:n,defaultValue:r=null,onValueChange:i,open:o,defaultOpen:l=!1,onOpenChange:c,name:f,form:d,autoComplete:m,disabled:p=!1,readOnly:b=!1,required:y=!1,modal:E=!0,actionsRef:w,inputRef:k,onOpenChangeComplete:C,items:A,multiple:_=!1,itemToStringLabel:N,itemToStringValue:D,isItemEqualToValue:O=FD,highlightItemOnHover:j=!0,children:M}=e,{clearErrors:q}=XD(),{setDirty:U,setTouched:Q,setFocused:Z,validityData:G,setFilled:ee,name:Y,disabled:H,validation:K,validationMode:te}=T1(),le=m3({id:t}),I=H||p,P=Y??f,[$,L]=e2({controlled:n,default:_?r??Xg:r,name:"Select",state:"value"}),[ae,ie]=e2({controlled:o,default:l,name:"Select",state:"open"}),fe=S.useRef([]),de=S.useRef([]),he=S.useRef(null),ve=S.useRef(null),Ue=S.useRef(0),Pe=S.useRef(null),Te=S.useRef([]),Ie=S.useRef(!1),je=S.useRef(null),We=S.useRef(null),Xe=S.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),Me=S.useRef(!1),{mounted:Ce,setMounted:we,transitionStatus:Be}=g1(ae),{openMethod:$e,triggerProps:W}=WD(ae),me=jr(()=>new fk({id:le,labelId:void 0,modal:E,multiple:_,itemToStringLabel:N,itemToStringValue:D,isItemEqualToValue:O,value:$,open:ae,mounted:Ce,transitionStatus:Be,items:A,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,se=ct(me,lt.activeIndex),re=ct(me,lt.selectedIndex),V=ct(me,lt.triggerElement),z=ct(me,lt.positionerElement),ue=z5($e),ke=$e??ue??null,Re=S.useMemo(()=>_?"":ja($,D),[_,$,D]),qe=S.useMemo(()=>_&&Array.isArray($)?$.map(ft=>ja(ft,D)):ja($,D),[_,$,D]),rt=xn(me.state.triggerElement),et=Je(()=>qe);UD(rt,le,$,et,!I,f);const ot=S.useRef($),ut=_?Array.isArray($)&&$.length>0:$!=null&&ja($,D)!=="";Ve(()=>{$!==ot.current&&me.set("forceMount",!0)},[me,$]),Ve(()=>{ee(ut)},[ut,ee]),Ve(function(){const At=Te.current;let pn;if(_){const Dn=Array.isArray($)?$:[];if(Dn.length===0)pn=null;else{const On=Dn[Dn.length-1],en=Xu(At,On,O);pn=en===-1?null:en}}else{const Dn=Xu(At,$,O);pn=Dn===-1?null:Dn}pn===null&&(We.current=null),!ae&&me.set("selectedIndex",pn)},[ut,_,ae,$,Te,O,me,We]);function Fe(ft){const At=G.initialValue;return Array.isArray(ft)&&Array.isArray(At)?!KD(ft,At,(pn,Dn)=>Ja(pn,Dn,O)):ft!==At}y3($,()=>{q(P),U(Fe($)),K.change($)});const Dt=Je((ft,At)=>{c?.(ft,At),!At.isCanceled&&(ie(ft),!ft&&(At.reason===zh||At.reason===i1)&&(Q(!0),Z(!1),te==="onBlur"&&K.commit($)))}),jt=Je(()=>{we(!1),me.update({activeIndex:null,openMethod:null}),C?.(!1)});vl({enabled:!w,open:ae,ref:he,onComplete(){ae||jt()}}),S.useImperativeHandle(w,()=>({unmount:jt}),[jt]);const at=Je((ft,At)=>{i?.(ft,At),!At.isCanceled&&L(ft)}),Ot=Je(()=>{const ft=me.state.listElement||he.current;if(!ft)return;const At=T3(ft.scrollHeight,ft.clientHeight),pn=ZD(ft.scrollTop,At),Dn=pn>0,On=pn<At;me.state.scrollUpArrowVisible!==Dn&&me.set("scrollUpArrowVisible",Dn),me.state.scrollDownArrowVisible!==On&&me.set("scrollDownArrowVisible",On)}),Qt=u3({open:ae,onOpenChange:Dt,elements:{reference:V,floating:z}}),Wt=$k(Qt,{enabled:!b&&!I,event:"mousedown"}),Zt=p1(Qt),Ye=RD(Qt,{enabled:!b&&!I,listRef:fe,activeIndex:se,selectedIndex:re,disabledIndices:Xg,onNavigate(ft){ft===null&&!ae||me.set("activeIndex",ft)},focusItemOnHover:j}),gt=OD(Qt,{enabled:!b&&!I&&(ae||!_),listRef:de,activeIndex:se,selectedIndex:re,disabledIndices:ft=>F5(fe.current[ft]),onMatch(ft){ae?me.set("activeIndex",ft):at(Te.current[ft],vt("none"))},onTyping(ft){Ie.current=ft}}),Ut=S.useMemo(()=>{const ft=li(gt.reference,Ye.reference,Zt.reference,Wt.reference,W);return le&&(ft.id=le),ft},[Wt.reference,gt.reference,Ye.reference,Zt.reference,W,le]),Jt=S.useMemo(()=>li(b1,gt.floating,Ye.floating,Zt.floating),[gt.floating,Ye.floating,Zt.floating]),Fn=Ye.item??Rn;Xb(()=>{me.update({popupProps:Jt,triggerProps:Ut})}),Ve(()=>{me.update({id:le,modal:E,multiple:_,value:$,open:ae,mounted:Ce,transitionStatus:Be,popupProps:Jt,triggerProps:Ut,items:A,itemToStringLabel:N,itemToStringValue:D,isItemEqualToValue:O,openMethod:ke})},[me,le,E,_,$,ae,Ce,Be,Jt,Ut,A,N,D,O,ke]);const bt=S.useMemo(()=>({store:me,name:P,required:y,disabled:I,readOnly:b,multiple:_,highlightItemOnHover:j,setValue:at,setOpen:Dt,listRef:fe,popupRef:he,scrollHandlerRef:ve,handleScrollArrowVisibility:Ot,scrollArrowsMountedCountRef:Ue,itemProps:Fn,valueRef:Pe,valuesRef:Te,labelsRef:de,typingRef:Ie,selectionRef:Xe,firstItemTextRef:je,selectedItemTextRef:We,validation:K,onOpenChangeComplete:C,alignItemWithTriggerActiveRef:Me,initialValueRef:ot}),[me,P,y,I,b,_,j,at,Dt,Fn,K,C,Ot]),an=cc(k,K.inputRef),hr=_&&Array.isArray($)&&$.length>0,hn=_?void 0:P,En=S.useMemo(()=>!_||!Array.isArray($)||!P?null:$.map(ft=>{const At=ja(ft,D);return g.jsx("input",{type:"hidden",form:d,name:P,value:At,disabled:I},At)}),[_,$,d,P,D,I]);return g.jsx(f3.Provider,{value:bt,children:g.jsxs(d3.Provider,{value:Qt,children:[M,g.jsx("input",{...K.getValidationProps(I,{onFocus(){me.state.triggerElement?.focus({focusVisible:!0})},onChange(ft){if(ft.nativeEvent.defaultPrevented||I||b)return;const At=ft.currentTarget.value,pn=vt(El,ft.nativeEvent);function Dn(){if(_)return;const On=At.toLowerCase();let en=Te.current.findIndex(hs=>ja(hs,D).toLowerCase()===On||b3(hs,N).toLowerCase()===On);en===-1&&(en=Te.current.findIndex((hs,Rl)=>{const Hc=de.current[Rl];return Hc!=null&&Hc.toLowerCase()===On}));const Vn=en===-1?void 0:Te.current[en];Vn!=null&&at(Vn,pn)}me.set("forceMount",!0),queueMicrotask(Dn)}}),id:le&&hn==null?`${le}-hidden-input`:void 0,form:d,name:hn,autoComplete:m,value:Re,disabled:I,required:y&&!hr,readOnly:b,ref:an,style:P?j5:ak,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),En]})})}function e8(e,t){return e??t}let $a=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=mc.startingStyle]="startingStyle",e[e.endingStyle=mc.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),fh=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const t8={[fh.popupOpen]:""},n8={[fh.popupOpen]:"",[fh.pressed]:""},r8={[$a.open]:""},s8={[$a.closed]:""},i8={[$a.anchorHidden]:""},v1={open(e){return e?t8:null}},a8={open(e){return e?n8:null}},Ac={open(e){return e?r8:s8},anchorHidden(e){return e?i8:null}};function o8(e){const t=e.getBoundingClientRect(),n=sn(e);if(n1)return t;const r=n.getComputedStyle(e,"::before"),i=n.getComputedStyle(e,"::after");if(!(r.content!=="none"||i.content!=="none"))return t;const l=parseFloat(r.width)||0,c=parseFloat(r.height)||0,f=parseFloat(i.width)||0,d=parseFloat(i.height)||0,m=Math.max(t.width,l,f),p=Math.max(t.height,c,d),b=m-t.width,y=p-t.height;return{left:t.left-b/2,right:t.right+b/2,top:t.top-y/2,bottom:t.bottom+y/2}}const l8=S.createContext(void 0);function u8(e=!1){const t=S.useContext(l8);if(t===void 0&&!e)throw new Error(dr(16));return t}function c8(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:o}=e,l=r&&t!==!1,c=r&&t===!1;return{props:S.useMemo(()=>{const d={onKeyDown(m){n&&t&&m.key!=="Tab"&&m.preventDefault()}};return r||(d.tabIndex=i,!o&&n&&(d.tabIndex=t?i:-1)),(o&&(t||l)||!o&&n)&&(d["aria-disabled"]=n),o&&(!t||c)&&(d.disabled=n),d},[r,n,t,l,c,o,i])}}function Qh(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:o}=e,l=S.useRef(null),c=u8(!0),f=o??c!==void 0,{props:d}=c8({focusableWhenDisabled:n,disabled:t,composite:f,tabIndex:r,isNativeButton:i}),m=S.useCallback(()=>{const y=l.current;rg(y)&&f&&t&&d.disabled===void 0&&y.disabled&&(y.disabled=!1)},[t,d.disabled,f]);Ve(m,[m]);const p=S.useCallback((y={})=>{const{onClick:E,onMouseDown:w,onKeyUp:k,onKeyDown:C,onPointerDown:A,..._}=y;return li({onClick(N){if(t){N.preventDefault();return}E?.(N)},onMouseDown(N){t||w?.(N)},onKeyDown(N){if(t||(oh(N),C?.(N),N.baseUIHandlerPrevented))return;const D=N.target===N.currentTarget,O=N.currentTarget,j=rg(O),M=!i&&f8(O),q=D&&(i?j:!M),U=N.key==="Enter",Q=N.key===" ",Z=O.getAttribute("role"),G=Z?.startsWith("menuitem")||Z==="option"||Z==="gridcell";if(D&&f&&Q){if(N.defaultPrevented&&G)return;N.preventDefault(),M||i&&j?(O.click(),N.preventBaseUIHandler()):q&&(E?.(N),N.preventBaseUIHandler());return}q&&(!i&&(Q||U)&&N.preventDefault(),!i&&U&&E?.(N))},onKeyUp(N){if(!t){if(oh(N),k?.(N),N.target===N.currentTarget&&i&&f&&rg(N.currentTarget)&&N.key===" "){N.preventDefault();return}N.baseUIHandlerPrevented||N.target===N.currentTarget&&!i&&!f&&N.key===" "&&E?.(N)}},onPointerDown(N){if(t){N.preventDefault();return}A?.(N)}},i?{type:"button"}:{role:"button"},d,_)},[t,d,f,i]),b=Je(y=>{l.current=y,m()});return{getButtonProps:p,buttonRef:b}}function rg(e){return dn(e)&&e.tagName==="BUTTON"}function f8(e){return!!(e?.tagName==="A"&&e?.href)}const md=2,d8=400,h8={...a8,...jD,popupSide:e=>e?{"data-popup-side":e}:null,value:()=>null},p8=S.forwardRef(function(t,n){const{render:r,className:i,id:o,disabled:l=!1,nativeButton:c=!0,style:f,...d}=t,{setTouched:m,setFocused:p,validationMode:b,state:y,disabled:E}=T1(),{labelId:w}=p3(),{store:k,setOpen:C,selectionRef:A,validation:_,readOnly:N,required:D,alignItemWithTriggerActiveRef:O,disabled:j}=ua(),M=E||j||l,q=ct(k,lt.open),U=ct(k,lt.mounted),Q=ct(k,lt.value),Z=ct(k,lt.triggerProps),G=ct(k,lt.positionerElement),ee=ct(k,lt.listElement),Y=ct(k,lt.popupSide),H=ct(k,lt.id),K=ct(k,lt.labelId),te=ct(k,lt.hasSelectedValue),le=U&&G?Y:null,I=o??H,P=e8(w,K);m3({id:I});const $=xn(G),L=S.useRef(null),{getButtonProps:ae,buttonRef:ie}=Qh({disabled:M,native:c}),fe=Je(Ie=>{k.set("triggerElement",Ie)}),de=ns(),he=ns(),ve=ns();S.useEffect(()=>{if(q)return ve.start(d8,()=>{A.current.allowUnselectedMouseUp=!0,A.current.allowSelectedMouseUp=!0}),()=>{ve.clear()};A.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},he.clear()},[q,A,he,ve]);const Ue=li(Z,{id:I,role:"combobox","aria-expanded":q?"true":"false","aria-haspopup":"listbox","aria-controls":q?ee?.id??th(G)?.id:void 0,"aria-labelledby":P,"aria-readonly":N||void 0,"aria-required":D||void 0,tabIndex:M?-1:0,onFocus(Ie){p(!0),q&&O.current&&C(!1,vt(El,Ie.nativeEvent)),de.start(0,()=>{k.set("forceMount",!0)})},onBlur(Ie){nt(G,Ie.relatedTarget)||(m(!0),p(!1),b==="onBlur"&&_.commit(Q))},onMouseDown(Ie){if(q)return;const je=Pt(Ie.currentTarget);function We(Xe){if(!L.current)return;const Me=Xe.target;if(nt(L.current,Me)||nt($.current,Me))return;const Ce=o8(L.current);Xe.clientX>=Ce.left-md&&Xe.clientX<=Ce.right+md&&Xe.clientY>=Ce.top-md&&Xe.clientY<=Ce.bottom+md||C(!1,vt(wL,Xe))}he.start(0,()=>{je.addEventListener("mouseup",We,{once:!0})})}},d,ae),Pe=_.getValidationProps(M,Ue);Pe.role="combobox";const Te={...y,open:q,disabled:M,value:Q,readOnly:N,popupSide:le,placeholder:!te};return Wn("button",t,{ref:[n,L,ie,fe],state:Te,stateAttributesMapping:h8,props:Pe})}),m8={value:()=>null},g8=S.forwardRef(function(t,n){const{className:r,render:i,children:o,placeholder:l,style:c,...f}=t,{store:d,valueRef:m}=ua(),p=ct(d,lt.value),b=ct(d,lt.items),y=ct(d,lt.itemToStringLabel),E=ct(d,lt.hasSelectedValue),w=!E&&l!=null&&o==null,k=ct(d,lt.hasNullItemLabel,w),C={value:p,placeholder:!E};let A=null;return typeof o=="function"?A=o(p):o!=null?A=o:!E&&l!=null&&!k?A=l:Array.isArray(p)?A=YD(p,b,y):A=x3(p,b,y),Wn("span",t,{state:C,ref:[n,m],props:[{children:A},f],stateAttributesMapping:m8})}),b8=S.forwardRef(function(t,n){const{render:r,className:i,style:o,...l}=t,{store:c}=ua(),d={open:ct(c,lt.open)};return Wn("span",t,{state:d,ref:n,props:[{"aria-hidden":!0,children:"▼"},l],stateAttributesMapping:v1})}),x8=S.createContext(void 0),y8=S.forwardRef(function(t,n){const{store:r}=ua(),i=ct(r,lt.mounted),o=ct(r,lt.forceMount);return i||o?g.jsx(x8.Provider,{value:!0,children:g.jsx(Fk,{ref:n,...t})}):null});function v3(e){return Qb(19)?e:e?"true":void 0}const S3=S.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function E8(){return S.useContext(S3)}function T8(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,o=Je(i),l=S.useRef(0),c=jr(S8).current,f=jr(v8).current,[d,m]=S.useState(0),p=S.useRef(d),b=Je((C,A)=>{f.set(C,A??null),p.current+=1,m(p.current)}),y=Je(C=>{f.delete(C),p.current+=1,m(p.current)}),E=S.useMemo(()=>{const C=new Map;return Array.from(f.keys()).filter(_=>_.isConnected).sort(C8).forEach((_,N)=>{const D=f.get(_)??{};C.set(_,{...D,index:N})}),C},[f,d]);Ve(()=>{if(typeof MutationObserver!="function"||E.size===0)return;const C=new MutationObserver(A=>{const _=new Set,N=D=>_.has(D)?_.delete(D):_.add(D);A.forEach(D=>{D.removedNodes.forEach(N),D.addedNodes.forEach(N)}),_.size===0&&(p.current+=1,m(p.current))});return E.forEach((A,_)=>{_.parentElement&&C.observe(_.parentElement,{childList:!0})}),()=>{C.disconnect()}},[E]),Ve(()=>{p.current===d&&(n.current.length!==E.size&&(n.current.length=E.size),r&&r.current.length!==E.size&&(r.current.length=E.size),l.current=E.size),o(E)},[o,E,n,r,d]),Ve(()=>()=>{n.current=[]},[n]),Ve(()=>()=>{r&&(r.current=[])},[r]);const w=Je(C=>(c.add(C),()=>{c.delete(C)}));Ve(()=>{c.forEach(C=>C(E))},[c,E]);const k=S.useMemo(()=>({register:b,unregister:y,subscribeMapChange:w,elementsRef:n,labelsRef:r,nextIndexRef:l}),[b,y,w,n,r,l]);return g.jsx(S3.Provider,{value:k,children:t})}function v8(){return new Map}function S8(){return new Set}function C8(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const w8=S.createContext(void 0);function C3(){return S.useContext(w8)?.direction??"ltr"}const k8=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:l,elements:c,middlewareData:f}=t,{element:d,padding:m=0,offsetParent:p="real"}=ui(e,t)||{};if(d==null)return{};const b=Ek(m),y={x:n,y:r},E=u1(i),w=l1(E),k=await l.getDimensions(d),C=E==="y",A=C?"top":"left",_=C?"bottom":"right",N=C?"clientHeight":"clientWidth",D=o.reference[w]+o.reference[E]-y[E]-o.floating[w],O=y[E]-o.reference[E],j=p==="real"?await l.getOffsetParent?.(d):c.floating;let M=c.floating[N]||o.floating[w];(!M||!await l.isElement?.(j))&&(M=c.floating[N]||o.floating[w]);const q=D/2-O/2,U=M/2-k[w]/2-1,Q=Math.min(b[A],U),Z=Math.min(b[_],U),G=Q,ee=M-k[w]-Z,Y=M/2-k[w]/2+q,H=yk(G,Y,ee),K=!f.arrow&&la(i)!=null&&Y!==H&&o.reference[w]/2-(Y<G?Q:Z)-k[w]/2<0,te=K?Y<G?Y-G:Y-ee:0;return{[E]:y[E]+te,data:{[E]:H,centerOffset:Y-H-te,...K&&{alignmentOffset:te}},reset:K}}}),A8=(e,t)=>({...k8(e),options:[e,t]}),_8=lD().fn,N8={name:"hide",async fn(e){const{width:t,height:n,x:r,y:i}=e.rects.reference,o=t===0&&n===0&&r===0&&i===0;return{data:{referenceHidden:(await _8(e)).data?.referenceHidden||o}}}},zd={sideX:"left",sideY:"top"},R8={name:"adaptiveOrigin",async fn(e){const{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:o,strategy:l,placement:c}=e,f=sn(i),d=f.getComputedStyle(i);if(!(d.transitionDuration!=="0s"&&d.transitionDuration!==""))return{x:t,y:n,data:zd};const p=await o.getOffsetParent?.(i);let b={width:0,height:0};if(l==="fixed"&&f?.visualViewport)b={width:f.visualViewport.width,height:f.visualViewport.height};else if(p===f){const A=Pt(i);b={width:A.documentElement.clientWidth,height:A.documentElement.clientHeight}}else await o.isElement?.(p)&&(b=await o.getDimensions(p));const y=Dr(c);let E=t,w=n;y==="left"&&(E=b.width-(t+r.width)),y==="top"&&(w=b.height-(n+r.height));const k=y==="left"?"right":zd.sideX,C=y==="top"?"bottom":zd.sideY;return{x:E,y:w,data:{sideX:k,sideY:C}}}};function w3(e,t,n){const r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[t]}function L2(e,t,n){const{rects:r,placement:i}=e;return{side:w3(t,Dr(i),n),align:la(i)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function k3(e){const{anchor:t,positionMethod:n="absolute",side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:l=0,collisionBoundary:c,collisionPadding:f=5,sticky:d=!1,arrowPadding:m=5,disableAnchorTracking:p=!1,inline:b,keepMounted:y=!1,floatingRootContext:E,mounted:w,collisionAvoidance:k,shiftCrossAxis:C=!1,nodeId:A,adaptiveOrigin:_,lazyFlip:N=!1,externalTree:D}=e,[O,j]=S.useState(null);!w&&O!==null&&j(null);const M=k.side||"flip",q=k.align||"flip",U=k.fallbackAxisSide||"end",Q=typeof t=="function"?t:void 0,Z=Je(Q),G=Q?Z:t,ee=xn(t),Y=xn(w),K=C3()==="rtl",te=O||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":K?"left":"right","inline-start":K?"right":"left"}[r],le=o==="center"?te:`${te}-${o}`;let I=f;const P=1,$=r==="bottom"?P:0,L=r==="top"?P:0,ae=r==="right"?P:0,ie=r==="left"?P:0;typeof I=="number"?I={top:I+$,right:I+ie,bottom:I+L,left:I+ae}:I&&(I={top:(I.top||0)+$,right:(I.right||0)+ie,bottom:(I.bottom||0)+L,left:(I.left||0)+ae});const fe={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:I},de=S.useRef(null),he=xn(i),ve=xn(l),Ue=typeof i!="function"?i:0,Pe=typeof l!="function"?l:0,Te=[];b&&Te.push(b),Te.push(rD(at=>{const Ot=L2(at,r,K),Qt=typeof he.current=="function"?he.current(Ot):he.current,Wt=typeof ve.current=="function"?ve.current(Ot):ve.current;return{mainAxis:Qt,crossAxis:Wt,alignmentAxis:Wt}},[Ue,Pe,K,r]));const Ie=q==="none"&&M!=="shift",je=!Ie&&(d||C||M==="shift"),We=M==="none"?null:aD({...fe,padding:{top:I.top+P,right:I.right+P,bottom:I.bottom+P,left:I.left+P},mainAxis:!C&&M==="flip",crossAxis:q==="flip"?"alignment":!1,fallbackAxisSideDirection:U}),Xe=Ie?null:sD(at=>{const Ot=Pt(at.elements.floating).documentElement;return{...fe,rootBoundary:C?{x:0,y:0,width:Ot.clientWidth,height:Ot.clientHeight}:void 0,mainAxis:q!=="none",crossAxis:je,limiter:d||C?void 0:iD(Qt=>{if(!de.current)return{};const{width:Wt,height:Zt}=de.current.getBoundingClientRect(),Ye=es(Dr(Qt.placement)),gt=Ye==="y"?Wt:Zt,Ut=Ye==="y"?I.left+I.right:I.top+I.bottom;return{offset:gt/2+Ut/2}})}},[fe,d,C,I,q]);M==="shift"||q==="shift"||o==="center"?Te.push(Xe,We):Te.push(We,Xe),Te.push(oD({...fe,apply({elements:{floating:at},availableWidth:Ot,availableHeight:Qt,rects:Wt}){if(!Y.current)return;const Zt=at.style;Zt.setProperty("--available-width",`${Ot}px`),Zt.setProperty("--available-height",`${Qt}px`);const Ye=sn(at).devicePixelRatio||1,{x:gt,y:Ut,width:Jt,height:Fn}=Wt.reference,bt=(Math.round((gt+Jt)*Ye)-Math.round(gt*Ye))/Ye,an=(Math.round((Ut+Fn)*Ye)-Math.round(Ut*Ye))/Ye;Zt.setProperty("--anchor-width",`${bt}px`),Zt.setProperty("--anchor-height",`${an}px`)}}),A8(at=>({element:de.current||Pt(at.elements.floating).createElement("div"),padding:m,offsetParent:"floating"}),[m]),{name:"transformOrigin",fn(at){const{elements:Ot,middlewareData:Qt,placement:Wt,rects:Zt,y:Ye}=at,gt=Dr(Wt),Ut=es(gt),Jt=de.current,Fn=Qt.arrow?.x||0,bt=Qt.arrow?.y||0,an=Jt?.clientWidth||0,hr=Jt?.clientHeight||0,hn=Fn+an/2,En=bt+hr/2,ft=Math.abs(Qt.shift?.y||0),At=Zt.reference.height/2,pn=typeof i=="function"?i(L2(at,r,K)):i,Dn=ft>pn,On={top:`${hn}px calc(100% + ${pn}px)`,bottom:`${hn}px ${-pn}px`,left:`calc(100% + ${pn}px) ${En}px`,right:`${-pn}px ${En}px`}[gt],en=`${hn}px ${Zt.reference.y+At-Ye}px`;return Ot.floating.style.setProperty("--transform-origin",je&&Ut==="y"&&Dn?en:On),{}}},N8,_),Ve(()=>{!w&&E&&E.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[w,E]);const Me=S.useMemo(()=>({elementResize:!p&&typeof ResizeObserver<"u",layoutShift:!p&&typeof IntersectionObserver<"u"}),[p]),{refs:Ce,elements:we,x:Be,y:$e,middlewareData:W,update:me,placement:se,context:re,isPositioned:V,floatingStyles:z}=vD({rootContext:E,open:y?w:void 0,placement:le,middleware:Te,strategy:n,whileElementsMounted:y?void 0:(...at)=>_2(...at,Me),nodeId:A,externalTree:D}),{sideX:ue,sideY:ke}=W.adaptiveOrigin||zd,Re=V?n:"fixed",qe=S.useMemo(()=>{const at=_?{position:Re,[ue]:Be,[ke]:$e}:{position:Re,...z};return V||(at.opacity=0),at},[_,Re,ue,Be,ke,$e,z,V]),rt=S.useRef(null);Ve(()=>{if(!w)return;const at=ee.current,Ot=typeof at=="function"?at():at,Wt=(M2(Ot)?Ot.current:Ot)||null||null;Wt!==rt.current&&(Ce.setPositionReference(Wt),rt.current=Wt)},[w,Ce,G,ee]),S.useEffect(()=>{if(!w)return;const at=ee.current;typeof at!="function"&&M2(at)&&at.current!==rt.current&&(Ce.setPositionReference(at.current),rt.current=at.current)},[w,Ce,G,ee]),S.useEffect(()=>{if(y&&w&&we.reference&&we.floating)return _2(we.reference,we.floating,me,Me)},[y,w,we,me,Me]);const et=Dr(se),ot=w3(r,et,K),ut=la(se)||"center",Fe=!!W.hide?.referenceHidden;Ve(()=>{N&&w&&V&&j(et)},[N,w,V,et]);const Dt=S.useMemo(()=>({position:"absolute",top:W.arrow?.y,left:W.arrow?.x}),[W.arrow]),jt=W.arrow?.centerOffset!==0;return S.useMemo(()=>({positionerStyles:qe,arrowStyles:Dt,arrowRef:de,arrowUncentered:jt,side:ot,align:ut,physicalSide:et,anchorHidden:Fe,refs:Ce,context:re,isPositioned:V,update:me}),[qe,Dt,de,jt,ot,ut,et,Fe,Ce,re,V,me])}function M2(e){return e!=null&&"current"in e}const A3=S.createContext(void 0);function O8(){const e=S.useContext(A3);if(!e)throw new Error(dr(59));return e}const _3=S.forwardRef(function(t,n){const{cutout:r,...i}=t;let o;if(r){const l=r.getBoundingClientRect();o=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${l.left}px ${l.top}px,${l.left}px ${l.bottom}px,${l.right}px ${l.bottom}px,${l.right}px ${l.top}px,${l.left}px ${l.top}px)`}return g.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...i,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:o}})});function dh(e,t){e&&Object.assign(e.style,t)}const I8={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"};function S1(e){return e==="starting"?lM:Rn}function N3(e,t,{styles:n,transitionStatus:r,props:i,refs:o,hidden:l,inert:c=!1}){const f={...n};return c&&(f.pointerEvents="none"),Wn("div",e,{state:t,ref:o,props:[{role:"presentation",hidden:l,style:f},S1(r),i],stateAttributesMapping:Ac})}let D2={},P2={},j2="";function L8(e){if(typeof document>"u")return!1;const t=Pt(e);return sn(t).innerWidth-t.documentElement.clientWidth>0}function M8(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Pt(e),r=n.documentElement,i=n.body,o=co(r)?r:i,l=o.style.overflowY,c=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",o.style.overflowY="scroll";const f=o.offsetWidth;o.style.overflowY="hidden";const d=o.offsetWidth;return o.style.overflowY=l,r.style.scrollbarGutter=c,f===d}function D8(e){const t=Pt(e),n=t.documentElement,r=t.body,i=co(n)?n:r,o={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(i.style,o)}}function P8(e){const t=Pt(e),n=t.documentElement,r=t.body,i=sn(n);let o=0,l=0,c=!1;const f=Cs.create();if(oa&&(i.visualViewport?.scale??1)!==1)return()=>{};function d(){const y=i.getComputedStyle(n),E=i.getComputedStyle(r),C=(y.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";o=n.scrollTop,l=n.scrollLeft,D2={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},j2=n.style.scrollBehavior,P2={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const A=n.scrollHeight>n.clientHeight,_=n.scrollWidth>n.clientWidth,N=y.overflowY==="scroll"||E.overflowY==="scroll",D=y.overflowX==="scroll"||E.overflowX==="scroll",O=Math.max(0,i.innerWidth-r.clientWidth),j=Math.max(0,i.innerHeight-r.clientHeight),M=parseFloat(E.marginTop)+parseFloat(E.marginBottom),q=parseFloat(E.marginLeft)+parseFloat(E.marginRight),U=co(n)?n:r;if(c=M8(e),c){n.style.scrollbarGutter=C,U.style.overflowY="hidden",U.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:C,overflowY:"hidden",overflowX:"hidden"}),(A||N)&&(n.style.overflowY="scroll"),(_||D)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:M||j?`calc(100dvh - ${M+j}px)`:"100dvh",width:q||O?`calc(100vw - ${q+O}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=o,r.scrollLeft=l,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function m(){Object.assign(n.style,D2),Object.assign(r.style,P2),c||(n.scrollTop=o,n.scrollLeft=l,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=j2)}function p(){m(),f.request(d)}d();const b=yt(i,"resize",p);return()=>{f.cancel(),m(),typeof i.removeEventListener=="function"&&b()}}class j8{lockCount=0;restore=null;timeoutLock=us.create();timeoutUnlock=us.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const r=Pt(t).documentElement,i=sn(r).getComputedStyle(r).overflowY;if(i==="hidden"||i==="clip"){this.restore=Un;return}const o=jh||!L8(t);this.restore=o?D8(t):P8(t)}}const B8=new j8;function R3(e=!0,t=null){Ve(()=>{if(e)return B8.acquire(t)},[e,t])}const H8=20;function U8(e,t,n,r){const[i,o]=S.useState(!1);Ve(()=>{if(!e||!t||n==null){o(!1);return}const l=Pt(n).documentElement.clientWidth,c=n.offsetWidth;o(l>0&&c>0&&c>=l-H8)},[e,t,n]),R3(e&&(!t||i),r)}const z8={position:"fixed"},F8=S.forwardRef(function(t,n){const{anchor:r,positionMethod:i="absolute",className:o,render:l,side:c="bottom",align:f="center",sideOffset:d=0,alignOffset:m=0,collisionBoundary:p="clipping-ancestors",collisionPadding:b,arrowPadding:y=5,sticky:E=!1,disableAnchorTracking:w,alignItemWithTrigger:k=!0,collisionAvoidance:C=uM,style:A,..._}=t,{store:N,listRef:D,labelsRef:O,alignItemWithTriggerActiveRef:j,selectedItemTextRef:M,valuesRef:q,initialValueRef:U,popupRef:Q,setValue:Z}=ua(),G=h3(),ee=ct(N,lt.open),Y=ct(N,lt.mounted),H=ct(N,lt.modal),K=ct(N,lt.value),te=ct(N,lt.openMethod),le=ct(N,lt.positionerElement),I=ct(N,lt.triggerElement),P=ct(N,lt.isItemEqualToValue),$=ct(N,lt.transitionStatus),L=S.useRef(null),ae=S.useRef(null),[ie,fe]=S.useState(k),de=Y&&ie&&te!=="touch";!Y&&ie!==k&&fe(k),Ve(()=>{Y||(lt.scrollUpArrowVisible(N.state)&&N.set("scrollUpArrowVisible",!1),lt.scrollDownArrowVisible(N.state)&&N.set("scrollDownArrowVisible",!1))},[N,Y]),S.useImperativeHandle(j,()=>de),U8((de||H)&&ee,te==="touch",le,I);const he=k3({anchor:r,floatingRootContext:G,positionMethod:i,mounted:Y,side:c,sideOffset:d,align:f,alignOffset:m,arrowPadding:y,collisionBoundary:p,collisionPadding:b,sticky:E,disableAnchorTracking:w??de,collisionAvoidance:C,keepMounted:!0}),ve=de?"none":he.side,Ue=de?z8:he.positionerStyles,Pe={open:ee,side:ve,align:he.align,anchorHidden:he.anchorHidden};Ve(()=>{N.set("popupSide",he.side)},[N,he.side]);const Te=Je(Me=>{N.set("positionerElement",Me)}),Ie=N3(t,Pe,{styles:Ue,transitionStatus:$,props:_,refs:[n,Te],hidden:!Y,inert:!ee}),je=S.useRef(0),We=Je(Me=>{if(Me.size===0&&je.current===0||q.current.length===0)return;const Ce=je.current;if(je.current=Me.size,Me.size===Ce)return;const we=vt(El);if(Ce!==0&&!N.state.multiple&&K!==null&&Xu(q.current,K,P)===-1){const $e=U.current,me=$e!=null&&Xu(q.current,$e,P)!==-1?$e:null;Z(me,we),me===null&&(N.set("selectedIndex",null),M.current=null)}if(Ce!==0&&N.state.multiple&&Array.isArray(K)){const Be=W=>Xu(q.current,W,P)!==-1,$e=K.filter(W=>Be(W));($e.length!==K.length||$e.some(W=>!VD(K,W,P)))&&(Z($e,we),$e.length===0&&(N.set("selectedIndex",null),M.current=null))}if(ee&&de){N.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const Be={height:""};dh(le,Be),dh(Q.current,Be)}}),Xe=S.useMemo(()=>({...he,side:ve,alignItemWithTriggerActive:de,setControlledAlignItemWithTrigger:fe,scrollUpArrowRef:L,scrollDownArrowRef:ae}),[he,ve,de,fe]);return g.jsx(T8,{elementsRef:D,labelsRef:O,onMapChange:We,children:g.jsxs(A3.Provider,{value:Xe,children:[Y&&H&&g.jsx(_3,{inert:v3(!ee),cutout:I}),Ie]})})}),gd="base-ui-disable-scrollbar",B2={className:gd,getElement(e){return g.jsx("style",{nonce:e,href:gd,precedence:"base-ui:low",children:`.${gd}{scrollbar-width:none}.${gd}::-webkit-scrollbar{display:none}`})}},V8=S.createContext(void 0);function $8(e){return S.useContext(V8)}const q8="ArrowUp",Y8="ArrowDown",G8="ArrowLeft",X8="ArrowRight",K8="Home",Q8="End",W8=new Set([G8,X8]),Z8=new Set([q8,Y8]),J8=new Set([...W8,...Z8]),O3=new Set([...J8,K8,Q8]),eP=S.createContext(void 0),tP={disableStyleElements:!1};function nP(){return S.useContext(eP)??tP}const rP={...Ac,...wc},sP=S.forwardRef(function(t,n){const{render:r,className:i,style:o,finalFocus:l,...c}=t,{store:f,popupRef:d,onOpenChangeComplete:m,setOpen:p,valueRef:b,firstItemTextRef:y,selectedItemTextRef:E,multiple:w,handleScrollArrowVisibility:k,scrollHandlerRef:C,listRef:A,highlightItemOnHover:_}=ua(),{side:N,align:D,alignItemWithTriggerActive:O,isPositioned:j,setControlledAlignItemWithTrigger:M}=O8(),q=$8()!=null,U=h3(),Q=C3(),{nonce:Z,disableStyleElements:G}=nP(),ee=ct(f,lt.id),Y=ct(f,lt.open),H=ct(f,lt.openMethod),K=ct(f,lt.mounted),te=ct(f,lt.popupProps),le=ct(f,lt.transitionStatus),I=ct(f,lt.triggerElement),P=ct(f,lt.positionerElement),$=ct(f,lt.listElement),L=S.useRef(!1),ae=S.useRef(!1),ie=S.useRef({}),fe=hl(),de=Je(Pe=>{if(!P||!d.current||!ae.current)return;if(L.current||!O){k();return}const Te=P.style.top==="0px",Ie=P.style.bottom==="0px";if(!Te&&!Ie){k();return}const je=U2(P),We=zu(P.getBoundingClientRect().height,"y",je),Xe=Pt(P),Me=sn(P),Ce=Me.getComputedStyle(P),we=parseFloat(Ce.marginTop),Be=parseFloat(Ce.marginBottom),$e=H2(Me.getComputedStyle(d.current)),W=Math.min(Xe.documentElement.clientHeight-we-Be,$e),me=Pe.scrollTop,se=bd(Pe);let re=0,V=null,z=!1,ue=!1;const ke=et=>{P.style.height=`${et}px`},Re=(et,ot)=>{const ut=Uu(et,0,W-We);ut>0&&ke(We+ut),Pe.scrollTop=ot,W-(We+ut)<=ti&&(L.current=!0),k()},qe=Te?se-me:me,rt=Math.min(We+qe,W);if(re=rt,qe<=ti){Re(qe,Te?se:0);return}if(W-rt>ti)Te?ue=!0:V=0;else if(z=!0,Ie&&me<se){const et=We+qe-W;V=me-(qe-et)}if(re=Math.ceil(re),re!==0&&ke(re),ue||V!=null){const et=bd(Pe),ot=ue?et:Uu(V,0,et);Math.abs(Pe.scrollTop-ot)>ti&&(Pe.scrollTop=ot)}(z||re>=W-ti)&&(L.current=!0),k()});S.useImperativeHandle(C,()=>de,[de]),vl({open:Y,ref:d,onComplete(){Y&&m?.(!0)}});const he={open:Y,transitionStatus:le,side:N,align:D};Ve(()=>{!P||!d.current||Object.keys(ie.current).length||(ie.current={top:P.style.top||"0",left:P.style.left||"0",right:P.style.right,height:P.style.height,bottom:P.style.bottom,minHeight:P.style.minHeight,maxHeight:P.style.maxHeight,marginTop:P.style.marginTop,marginBottom:P.style.marginBottom})},[d,P]),Ve(()=>{Y||O||(ae.current=!1,L.current=!1,dh(P,ie.current))},[Y,O,P,d]),Ve(()=>{const Pe=d.current;if(!Y||!I||!P||!Pe||O&&!j||f.state.transitionStatus==="ending")return;if(!O){ae.current=!0,fe.request(k),Pe.style.removeProperty("--transform-origin");return}const Te=iP(Pe);Pe.style.removeProperty("--transform-origin");try{let Ie=E.current;Ie?.isConnected||(Ie=!lt.hasSelectedValue(f.state)&&y.current?.isConnected?y.current:null);const je=b.current,We=sn(P),Xe=We.getComputedStyle(P),Me=We.getComputedStyle(Pe),Ce=Pt(I),we=U2(I),Be=xd(I.getBoundingClientRect(),we),$e=xd(P.getBoundingClientRect(),we),W=Be.height,me=$||Pe,se=me.scrollHeight,re=parseFloat(Me.borderBottomWidth),V=parseFloat(Xe.marginTop)||10,z=parseFloat(Xe.marginBottom)||10,ue=parseFloat(Xe.minHeight)||100,ke=H2(Me),Re=5,qe=5,rt=20,et=Ce.documentElement.clientHeight-V-z,ot=Ce.documentElement.clientWidth,ut=et-Be.bottom+W;let Fe,Dt=Q==="rtl"?Be.right-$e.width:Be.left,jt=0;if(Ie&&je){const bt=xd(je.getBoundingClientRect(),we);Fe=xd(Ie.getBoundingClientRect(),we),Dt=$e.left+(Q==="rtl"?bt.right-Fe.right:bt.left-Fe.left);const an=bt.top-Be.top+bt.height/2;jt=Fe.top-$e.top+Fe.height/2-an}const at=ut+jt+z+re;let Ot=Math.min(et,at);const Qt=et-V-z,Wt=at-Ot,Zt=ot-qe;P.style.left=`${Uu(Dt,Re,Zt-$e.width)}px`,P.style.height=`${Ot}px`,P.style.maxHeight="none",P.style.marginTop=`${V}px`,P.style.marginBottom=`${z}px`,Pe.style.height="100%";const Ye=bd(me),gt=Wt>=Ye-ti;gt&&(Ot=Math.min(et,$e.height)-(Wt-Ye));const Ut=Be.top<rt||Be.bottom>et-rt||Math.ceil(Ot)+ti<Math.min(se,ue),Jt=(We.visualViewport?.scale??1)!==1&&oa;if(Ut||Jt){ae.current=!0,dh(P,ie.current),M(!1);return}const Fn=Math.max(ue,Ot);if(gt){const bt=Math.max(0,et-at);P.style.top=$e.height>=Qt?"0":`${bt}px`,P.style.height=`${Ot}px`,me.scrollTop=bd(me)}else P.style.bottom="0",me.scrollTop=Wt;if(Fe){const bt=$e.top,an=$e.height,hr=Fe.top+Fe.height/2,hn=an>0?(hr-bt)/an*100:50,En=Uu(hn,0,100);Pe.style.setProperty("--transform-origin",`50% ${En}%`)}(Fn===et||Ot>=ke)&&(L.current=!0),k(),_&&f.state.selectedIndex===null&&f.state.activeIndex===null&&A.current[0]!=null&&f.set("activeIndex",0),ae.current=!0}finally{Te()}},[f,Y,P,I,b,y,E,d,k,O,M,fe,$,A,_,Q,j]),S.useEffect(()=>{if(!O||!P||!Y)return;const Pe=sn(P);function Te(Ie){p(!1,vt(AL,Ie))}return yt(Pe,"resize",Te)},[p,O,P,Y]);const ve={...$?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":w||void 0,id:`${ee}-list`},onKeyDown(Pe){q&&O3.has(Pe.key)&&Pe.stopPropagation()},onScroll(Pe){$||de(Pe.currentTarget)},...O&&{style:$?{height:"100%"}:I8}},Ue=Wn("div",t,{ref:[n,d],state:he,stateAttributesMapping:rP,props:[te,ve,S1(le),{className:!$&&O?B2.className:void 0},c]});return g.jsxs(S.Fragment,{children:[!G&&B2.getElement(Z),g.jsx(Vk,{context:U,modal:!1,disabled:!K,openInteractionType:H,returnFocus:l,restoreFocus:!0,children:Ue})]})});function H2(e){const t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}function bd(e){return T3(e.scrollHeight,e.clientHeight)}function U2(e){return Qk.getScale(e)}function zu(e,t,n){return e/n[t]}function xd(e,t){return hc({x:zu(e.x,"x",t),y:zu(e.y,"y",t),width:zu(e.width,"x",t),height:zu(e.height,"y",t)})}const z2=[["transform","none"],["scale","1"],["translate","0 0"]];function iP(e){const{style:t}=e,n={};for(const[r,i]of z2)n[r]=t.getPropertyValue(r),t.setProperty(r,i,"important");return()=>{for(const[r]of z2){const i=n[r];i?t.setProperty(r,i):t.removeProperty(r)}}}let I3=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function aP(e={}){const{label:t,metadata:n,textRef:r,indexGuessBehavior:i,index:o}=e,{register:l,unregister:c,subscribeMapChange:f,elementsRef:d,labelsRef:m,nextIndexRef:p}=E8(),b=S.useRef(-1),[y,E]=S.useState(o??(i===I3.GuessFromOrder?()=>{if(b.current===-1){const C=p.current;p.current+=1,b.current=C}return b.current}:-1)),w=S.useRef(null),k=S.useCallback(C=>{if(w.current=C,y!==-1&&C!==null&&(d.current[y]=C,m)){const A=t!==void 0;m.current[y]=A?t:r?.current?.textContent??C.textContent}},[y,d,m,t,r]);return Ve(()=>{if(o!=null)return;const C=w.current;if(C)return l(C,n),()=>{c(C)}},[o,l,c,n]),Ve(()=>{if(o==null)return f(C=>{const A=w.current?C.get(w.current)?.index:null;A!=null&&E(A)})},[o,f,E]),{ref:k,index:y}}const L3=S.createContext(void 0);function C1(){const e=S.useContext(L3);if(!e)throw new Error(dr(57));return e}const oP=S.memo(S.forwardRef(function(t,n){const{render:r,className:i,style:o,value:l=null,label:c,disabled:f=!1,nativeButton:d=!1,...m}=t,p=S.useRef(null),b=aP({label:c,textRef:p,indexGuessBehavior:I3.GuessFromOrder}),{store:y,itemProps:E,setOpen:w,setValue:k,selectionRef:C,typingRef:A,valuesRef:_,multiple:N,selectedItemTextRef:D,disabled:O,readOnly:j}=ua(),M=ct(y,lt.isActive,b.index),q=ct(y,lt.open),U=ct(y,lt.isSelected,l),Q=ct(y,lt.isSelectedByFocus,b.index),Z=ct(y,lt.isItemEqualToValue),G=b.index,ee=G!==-1,Y=S.useRef(null);Ve(()=>{if(!ee)return;const de=_.current;return de[G]=l,()=>{delete de[G]}},[ee,G,l,_]),Ve(()=>{if(!ee)return;const de=y.state.value;let he=de;N&&Array.isArray(de)&&(he=de.length>0?de[de.length-1]:void 0),he!==void 0&&Ja(l,he,Z)&&(y.set("selectedIndex",G),p.current&&(D.current=p.current))},[ee,G,N,Z,y,l,D]);const H=S.useRef(null),K=S.useRef("mouse"),te=S.useRef(!1),{getButtonProps:le,buttonRef:I}=Qh({disabled:f,focusableWhenDisabled:!0,native:d,composite:!0}),P={disabled:f,selected:U,highlighted:M};function $(de){if(O||j)return;const he=y.state.value;if(N){const ve=Array.isArray(he)?he:[],Ue=U?$D(ve,l,Z):[...ve,l];k(Ue,vt(X0,de))}else k(l,vt(X0,de)),w(!1,vt(X0,de))}function L(){C.current.dragY=0}const ae={role:"option","aria-selected":U,tabIndex:q&&M?0:-1,onKeyDown(de){H.current=de.key,y.set("activeIndex",G),de.key===" "&&A.current&&de.preventDefault()},onClick(de){const he=de.type==="click"&&K.current!=="touch",ve=de.nativeEvent.pointerType,Ue=he&&r1(de.nativeEvent)&&(ve!==void 0||M),Pe=he&&!Ue&&!te.current;te.current=!1,!(de.type==="keydown"&&H.current===null)&&(f||de.type==="keydown"&&H.current===" "&&A.current||Pe||(H.current=null,$(de.nativeEvent)))},onPointerEnter(de){K.current=de.pointerType},onPointerMove(de){if(de.pointerType==="mouse"&&de.buttons===1){const he=C.current;he.dragY+=de.movementY,he.dragY**2>=64&&(he.allowUnselectedMouseUp=!0)}},onPointerDown(de){K.current=de.pointerType,te.current=!0,L()},onMouseUp(){if(L(),f||K.current==="touch"||te.current)return;const de=!C.current.allowSelectedMouseUp&&U,he=!C.current.allowUnselectedMouseUp&&!U;de||he||(te.current=!0,Y.current?.click(),te.current=!1)}},ie=Wn("div",t,{ref:[I,n,b.ref,Y],state:P,props:[E,ae,m,le]}),fe=S.useMemo(()=>({selected:U,index:G,textRef:p,selectedByFocus:Q,hasRegistered:ee}),[U,G,p,Q,ee]);return g.jsx(L3.Provider,{value:fe,children:ie})})),lP=S.forwardRef(function(t,n){const r=t.keepMounted??!1,{selected:i}=C1();return r||i?g.jsx(uP,{...t,ref:n}):null}),uP=S.memo(S.forwardRef((e,t)=>{const{render:n,className:r,style:i,keepMounted:o,...l}=e,{selected:c}=C1(),f=S.useRef(null),{transitionStatus:d,setMounted:m}=g1(c),b=Wn("span",e,{ref:[t,f],state:{selected:c,transitionStatus:d},props:[{"aria-hidden":!0,children:"✔️"},l],stateAttributesMapping:wc});return vl({open:c,ref:f,onComplete(){c||m(!1)}}),b})),cP=S.memo(S.forwardRef(function(t,n){const{index:r,textRef:i,selectedByFocus:o,hasRegistered:l}=C1(),{firstItemTextRef:c,selectedItemTextRef:f}=ua(),{render:d,className:m,style:p,...b}=t,y=S.useCallback(w=>{w&&(l&&r===0&&(c.current=w),l&&o&&(f.current=w))},[c,f,r,o,l]);return Wn("div",t,{ref:[y,n,i],props:b})}));/**
|
|
66
|
-
* @license lucide-react v1.25.0 - ISC
|
|
67
|
-
*
|
|
68
|
-
* This source code is licensed under the ISC license.
|
|
69
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
-
*/const M3=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
71
|
-
* @license lucide-react v1.25.0 - ISC
|
|
72
|
-
*
|
|
73
|
-
* This source code is licensed under the ISC license.
|
|
74
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
-
*/const fP=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
76
|
-
* @license lucide-react v1.25.0 - ISC
|
|
77
|
-
*
|
|
78
|
-
* This source code is licensed under the ISC license.
|
|
79
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
-
*/const dP=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
|
|
81
|
-
* @license lucide-react v1.25.0 - ISC
|
|
82
|
-
*
|
|
83
|
-
* This source code is licensed under the ISC license.
|
|
84
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
-
*/const F2=e=>{const t=dP(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
|
|
86
|
-
* @license lucide-react v1.25.0 - ISC
|
|
87
|
-
*
|
|
88
|
-
* This source code is licensed under the ISC license.
|
|
89
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
-
*/var sg={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
91
|
-
* @license lucide-react v1.25.0 - ISC
|
|
92
|
-
*
|
|
93
|
-
* This source code is licensed under the ISC license.
|
|
94
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
-
*/const hP=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},pP=S.createContext({}),mP=()=>S.useContext(pP),gP=S.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i="",children:o,iconNode:l,...c},f)=>{const{size:d=24,strokeWidth:m=2,absoluteStrokeWidth:p=!1,color:b="currentColor",className:y=""}=mP()??{},E=r??p?Number(n??m)*24/Number(t??d):n??m;return S.createElement("svg",{ref:f,...sg,width:t??d??sg.width,height:t??d??sg.height,stroke:e??b,strokeWidth:E,className:M3("lucide",y,i),...!o&&!hP(c)&&{"aria-hidden":"true"},...c},[...l.map(([w,k])=>S.createElement(w,k)),...Array.isArray(o)?o:[o]])});/**
|
|
96
|
-
* @license lucide-react v1.25.0 - ISC
|
|
97
|
-
*
|
|
98
|
-
* This source code is licensed under the ISC license.
|
|
99
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
-
*/const Rt=(e,t)=>{const n=S.forwardRef(({className:r,...i},o)=>S.createElement(gP,{ref:o,iconNode:t,className:M3(`lucide-${fP(F2(e))}`,`lucide-${e}`,r),...i}));return n.displayName=F2(e),n};/**
|
|
101
|
-
* @license lucide-react v1.25.0 - ISC
|
|
102
|
-
*
|
|
103
|
-
* This source code is licensed under the ISC license.
|
|
104
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
-
*/const bP=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],xP=Rt("arrow-down",bP);/**
|
|
106
|
-
* @license lucide-react v1.25.0 - ISC
|
|
107
|
-
*
|
|
108
|
-
* This source code is licensed under the ISC license.
|
|
109
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
-
*/const yP=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],D3=Rt("arrow-left",yP);/**
|
|
111
|
-
* @license lucide-react v1.25.0 - ISC
|
|
112
|
-
*
|
|
113
|
-
* This source code is licensed under the ISC license.
|
|
114
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
-
*/const EP=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],TP=Rt("arrow-up",EP);/**
|
|
116
|
-
* @license lucide-react v1.25.0 - ISC
|
|
117
|
-
*
|
|
118
|
-
* This source code is licensed under the ISC license.
|
|
119
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
-
*/const vP=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],SP=Rt("brain",vP);/**
|
|
121
|
-
* @license lucide-react v1.25.0 - ISC
|
|
122
|
-
*
|
|
123
|
-
* This source code is licensed under the ISC license.
|
|
124
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
-
*/const CP=[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]],wP=Rt("calendar-clock",CP);/**
|
|
126
|
-
* @license lucide-react v1.25.0 - ISC
|
|
127
|
-
*
|
|
128
|
-
* This source code is licensed under the ISC license.
|
|
129
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
-
*/const kP=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],P3=Rt("check",kP);/**
|
|
131
|
-
* @license lucide-react v1.25.0 - ISC
|
|
132
|
-
*
|
|
133
|
-
* This source code is licensed under the ISC license.
|
|
134
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
-
*/const AP=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],j3=Rt("chevron-down",AP);/**
|
|
136
|
-
* @license lucide-react v1.25.0 - ISC
|
|
137
|
-
*
|
|
138
|
-
* This source code is licensed under the ISC license.
|
|
139
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
-
*/const _P=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],NP=Rt("chevrons-up-down",_P);/**
|
|
141
|
-
* @license lucide-react v1.25.0 - ISC
|
|
142
|
-
*
|
|
143
|
-
* This source code is licensed under the ISC license.
|
|
144
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
145
|
-
*/const RP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],OP=Rt("clock",RP);/**
|
|
146
|
-
* @license lucide-react v1.25.0 - ISC
|
|
147
|
-
*
|
|
148
|
-
* This source code is licensed under the ISC license.
|
|
149
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
-
*/const IP=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],B3=Rt("code",IP);/**
|
|
151
|
-
* @license lucide-react v1.25.0 - ISC
|
|
152
|
-
*
|
|
153
|
-
* This source code is licensed under the ISC license.
|
|
154
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
-
*/const LP=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],MP=Rt("copy",LP);/**
|
|
156
|
-
* @license lucide-react v1.25.0 - ISC
|
|
157
|
-
*
|
|
158
|
-
* This source code is licensed under the ISC license.
|
|
159
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
160
|
-
*/const DP=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],PP=Rt("download",DP);/**
|
|
161
|
-
* @license lucide-react v1.25.0 - ISC
|
|
162
|
-
*
|
|
163
|
-
* This source code is licensed under the ISC license.
|
|
164
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
-
*/const jP=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],H3=Rt("eye",jP);/**
|
|
166
|
-
* @license lucide-react v1.25.0 - ISC
|
|
167
|
-
*
|
|
168
|
-
* This source code is licensed under the ISC license.
|
|
169
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
170
|
-
*/const BP=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],HP=Rt("file-text",BP);/**
|
|
171
|
-
* @license lucide-react v1.25.0 - ISC
|
|
172
|
-
*
|
|
173
|
-
* This source code is licensed under the ISC license.
|
|
174
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
-
*/const UP=[["path",{d:"M10.3 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.98a2 2 0 0 1 1.69.9l.66 1.2A2 2 0 0 0 12 6h8a2 2 0 0 1 2 2v3.3",key:"128dxu"}],["path",{d:"m14.305 19.53.923-.382",key:"3m78fa"}],["path",{d:"m15.228 16.852-.923-.383",key:"npixar"}],["path",{d:"m16.852 15.228-.383-.923",key:"5xggr7"}],["path",{d:"m16.852 20.772-.383.924",key:"dpfhf9"}],["path",{d:"m19.148 15.228.383-.923",key:"1reyyz"}],["path",{d:"m19.53 21.696-.382-.924",key:"1goivc"}],["path",{d:"m20.772 16.852.924-.383",key:"htqkph"}],["path",{d:"m20.772 19.148.924.383",key:"9w9pjp"}],["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}]],zP=Rt("folder-cog",UP);/**
|
|
176
|
-
* @license lucide-react v1.25.0 - ISC
|
|
177
|
-
*
|
|
178
|
-
* This source code is licensed under the ISC license.
|
|
179
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
-
*/const FP=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],VP=Rt("history",FP);/**
|
|
181
|
-
* @license lucide-react v1.25.0 - ISC
|
|
182
|
-
*
|
|
183
|
-
* This source code is licensed under the ISC license.
|
|
184
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
185
|
-
*/const $P=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],U3=Rt("list-checks",$P);/**
|
|
186
|
-
* @license lucide-react v1.25.0 - ISC
|
|
187
|
-
*
|
|
188
|
-
* This source code is licensed under the ISC license.
|
|
189
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
190
|
-
*/const qP=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],YP=Rt("loader-circle",qP);/**
|
|
191
|
-
* @license lucide-react v1.25.0 - ISC
|
|
192
|
-
*
|
|
193
|
-
* This source code is licensed under the ISC license.
|
|
194
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
195
|
-
*/const GP=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],XP=Rt("message-circle-question-mark",GP);/**
|
|
196
|
-
* @license lucide-react v1.25.0 - ISC
|
|
197
|
-
*
|
|
198
|
-
* This source code is licensed under the ISC license.
|
|
199
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
200
|
-
*/const KP=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],QP=Rt("moon",KP);/**
|
|
201
|
-
* @license lucide-react v1.25.0 - ISC
|
|
202
|
-
*
|
|
203
|
-
* This source code is licensed under the ISC license.
|
|
204
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
205
|
-
*/const WP=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],ZP=Rt("panel-left-close",WP);/**
|
|
206
|
-
* @license lucide-react v1.25.0 - ISC
|
|
207
|
-
*
|
|
208
|
-
* This source code is licensed under the ISC license.
|
|
209
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
210
|
-
*/const JP=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]],e9=Rt("panel-left-open",JP);/**
|
|
211
|
-
* @license lucide-react v1.25.0 - ISC
|
|
212
|
-
*
|
|
213
|
-
* This source code is licensed under the ISC license.
|
|
214
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
215
|
-
*/const t9=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],w1=Rt("plus",t9);/**
|
|
216
|
-
* @license lucide-react v1.25.0 - ISC
|
|
217
|
-
*
|
|
218
|
-
* This source code is licensed under the ISC license.
|
|
219
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
220
|
-
*/const n9=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],z3=Rt("refresh-cw",n9);/**
|
|
221
|
-
* @license lucide-react v1.25.0 - ISC
|
|
222
|
-
*
|
|
223
|
-
* This source code is licensed under the ISC license.
|
|
224
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
225
|
-
*/const r9=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],s9=Rt("save",r9);/**
|
|
226
|
-
* @license lucide-react v1.25.0 - ISC
|
|
227
|
-
*
|
|
228
|
-
* This source code is licensed under the ISC license.
|
|
229
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
230
|
-
*/const i9=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],a9=Rt("settings",i9);/**
|
|
231
|
-
* @license lucide-react v1.25.0 - ISC
|
|
232
|
-
*
|
|
233
|
-
* This source code is licensed under the ISC license.
|
|
234
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
235
|
-
*/const o9=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],l9=Rt("shield-alert",o9);/**
|
|
236
|
-
* @license lucide-react v1.25.0 - ISC
|
|
237
|
-
*
|
|
238
|
-
* This source code is licensed under the ISC license.
|
|
239
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
240
|
-
*/const u9=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],c9=Rt("square-terminal",u9);/**
|
|
241
|
-
* @license lucide-react v1.25.0 - ISC
|
|
242
|
-
*
|
|
243
|
-
* This source code is licensed under the ISC license.
|
|
244
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
245
|
-
*/const f9=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],d9=Rt("square",f9);/**
|
|
246
|
-
* @license lucide-react v1.25.0 - ISC
|
|
247
|
-
*
|
|
248
|
-
* This source code is licensed under the ISC license.
|
|
249
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
250
|
-
*/const h9=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],p9=Rt("sun",h9);/**
|
|
251
|
-
* @license lucide-react v1.25.0 - ISC
|
|
252
|
-
*
|
|
253
|
-
* This source code is licensed under the ISC license.
|
|
254
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
255
|
-
*/const m9=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],k1=Rt("trash-2",m9);/**
|
|
256
|
-
* @license lucide-react v1.25.0 - ISC
|
|
257
|
-
*
|
|
258
|
-
* This source code is licensed under the ISC license.
|
|
259
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
260
|
-
*/const g9=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],b9=Rt("user-round",g9);/**
|
|
261
|
-
* @license lucide-react v1.25.0 - ISC
|
|
262
|
-
*
|
|
263
|
-
* This source code is licensed under the ISC license.
|
|
264
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
265
|
-
*/const x9=[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]],y9=Rt("users-round",x9);/**
|
|
266
|
-
* @license lucide-react v1.25.0 - ISC
|
|
267
|
-
*
|
|
268
|
-
* This source code is licensed under the ISC license.
|
|
269
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
270
|
-
*/const E9=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],T9=Rt("wifi-off",E9);/**
|
|
271
|
-
* @license lucide-react v1.25.0 - ISC
|
|
272
|
-
*
|
|
273
|
-
* This source code is licensed under the ISC license.
|
|
274
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
275
|
-
*/const v9=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],S9=Rt("wrench",v9);/**
|
|
276
|
-
* @license lucide-react v1.25.0 - ISC
|
|
277
|
-
*
|
|
278
|
-
* This source code is licensed under the ISC license.
|
|
279
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
280
|
-
*/const C9=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],F3=Rt("x",C9),eo=JD,to=g8,na=cP,no=({className:e,children:t,...n})=>g.jsxs(p8,{"data-slot":"select-trigger",className:He("inline-flex h-7 items-center justify-between gap-1.5 rounded-md border border-border bg-bg px-2 text-body-sm text-text","transition-colors outline-none hover:border-border-strong focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/40","data-popup-open:border-border-strong disabled:pointer-events-none disabled:opacity-50",e),...n,children:[t,g.jsx(b8,{className:"text-fg-4",children:g.jsx(NP,{className:"size-3.5"})})]}),ro=({className:e,align:t="start",alignItemWithTrigger:n=!1,side:r="bottom",sideOffset:i=6,...o})=>g.jsx(y8,{children:g.jsx(F8,{align:t,alignItemWithTrigger:n,side:r,sideOffset:i,className:"isolate z-60 outline-none",children:g.jsx(sP,{"data-slot":"select-content",className:He("max-h-[min(24rem,var(--available-height))] min-w-[var(--anchor-width)] overflow-y-auto","rounded-md border border-border bg-surface p-1 text-fg-1 shadow-(--shadow-lg) outline-none",e),...o})})}),ra=({className:e,children:t,...n})=>g.jsxs(oP,{"data-slot":"select-item",className:He("flex cursor-pointer items-start gap-2 rounded-sm px-2 py-1.5 text-body-sm text-text outline-none select-none","data-highlighted:bg-surface-hover",e),...n,children:[g.jsx("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:t}),g.jsx(lP,{className:"mt-0.5 text-fg-1",children:g.jsx(P3,{className:"size-3.5"})})]});function w9(e){const{store:t,actionsRef:n}=e,r=t.useState("open");yD(t,r),n3(t);const{forceUnmount:i}=r3(r,t),o=S.useCallback(()=>{t.setOpen(!1,vt(xk))},[t]);S.useImperativeHandle(n,()=>({unmount:i,close:o}),[i,o])}function k9({store:e,parentContext:t,isDrawer:n}){const r=e.useState("open"),i=e.useState("disablePointerDismissal"),o=e.useState("modal"),l=e.useState("popupElement"),c=e.useState("floatingRootContext"),[f,d]=S.useState(0),[m,p]=S.useState(0),b=f===0,y=p1(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:o==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(C){if(!e.context.outsidePressEnabledRef.current||"button"in C&&C.button!==0||"touches"in C&&C.touches.length!==1)return!1;const A=ur(C);return b&&!i?o&&(e.context.internalBackdropRef.current||e.context.backdropRef.current)?e.context.internalBackdropRef.current===A||e.context.backdropRef.current===A||nt(A,l)&&!A?.hasAttribute("data-base-ui-portal"):!0:!1},escapeKey:b});R3(r&&o===!0,l),e.useContextCallback("onNestedDialogOpen",(C,A)=>{d(C),p(A)}),e.useContextCallback("onNestedDialogClose",()=>{d(0),p(0)}),S.useEffect(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(f+1,m+(n?1:0)),t?.onNestedDialogClose&&!r&&t.onNestedDialogClose(),()=>{t?.onNestedDialogClose&&r&&t.onNestedDialogClose()}),[n,r,f,m,t]);const E=y.reference??Rn,w=y.trigger??Rn,k=y.floating??Rn;return s3(e,{activeTriggerProps:E,inactiveTriggerProps:w,popupProps:k,nestedOpenDialogCount:f,nestedOpenDrawerCount:m}),null}const A9=S.createContext(!1),V3=S.createContext(void 0);function ca(e){const t=S.useContext(V3);if(e===!1&&t===void 0)throw new Error(dr(27));return t}const _9={...l3,modal:ze(e=>e.modal),nested:ze(e=>e.nested),nestedOpenDialogCount:ze(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:ze(e=>e.nestedOpenDrawerCount),disablePointerDismissal:ze(e=>e.disablePointerDismissal),openMethod:ze(e=>e.openMethod),descriptionElementId:ze(e=>e.descriptionElementId),titleElementId:ze(e=>e.titleElementId),viewportElement:ze(e=>e.viewportElement),role:ze(e=>e.role)};class A1 extends Wb{constructor(t,n,r=!1){const i=new Xh,o=N9(t);o.floatingRootContext=a3(i,n,r),super(o,{popupRef:S.createRef(),backdropRef:S.createRef(),internalBackdropRef:S.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:i,onOpenChange:void 0,onOpenChangeComplete:void 0},_9)}setOpen=(t,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(t,n);const r={open:t};e3(r,t,n.trigger),this.update(r)};static useStore(t,n){return Jk(t,(i,o)=>new A1(n,i,o),!0).store}}function N9(e={}){return{...i3(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}function R9(e,t="dialog"){const{children:n,open:r,defaultOpen:i=!1,onOpenChange:o,onOpenChangeComplete:l,disablePointerDismissal:c=!1,modal:f=!0,actionsRef:d,handle:m,triggerId:p,defaultTriggerId:b=null}=e,y=t==="drawer",E=t==="alert-dialog",w=E?!0:f,k=E||c,C=E?"alertdialog":"dialog",A=ca(!0),N={modal:w,disablePointerDismissal:k,nested:!!A,role:C},D=A1.useStore(m?.store,{open:i,openProp:r,activeTriggerId:b,triggerIdProp:p,...N});Xb(()=>{const Q=r===void 0&&D.state.open===!1&&i===!0?{open:!0,activeTriggerId:b}:null;E?D.update(Q?{...N,...Q}:N):Q&&D.update(Q)}),D.useControlledProp("openProp",r),D.useControlledProp("triggerIdProp",p),D.useSyncedValues(N),D.useContextCallback("onOpenChange",o),D.useContextCallback("onOpenChangeComplete",l);const O=D.useState("open"),j=D.useState("mounted"),M=D.useState("payload");w9({store:D,actionsRef:d});const q=O||j,U=S.useMemo(()=>({store:D}),[D]);return g.jsx(A9.Provider,{value:!1,children:g.jsxs(V3.Provider,{value:U,children:[q&&g.jsx(k9,{store:D,parentContext:A?.store.context,isDrawer:y}),typeof n=="function"?n({payload:M}):n]})})}function O9(e){return R9(e,"alert-dialog")}const I9={...Ac,...wc},L9=S.forwardRef(function(t,n){const{render:r,className:i,style:o,forceRender:l=!1,...c}=t,{store:f}=ca(),d=f.useState("open"),m=f.useState("nested"),p=f.useState("mounted"),b=f.useState("transitionStatus");return Wn("div",t,{state:{open:d,transitionStatus:b},ref:[f.context.backdropRef,n],stateAttributesMapping:I9,props:[{role:"presentation",hidden:!p,style:{userSelect:"none",WebkitUserSelect:"none"}},c],enabled:l||!m})}),M9=S.forwardRef(function(t,n){const{render:r,className:i,style:o,disabled:l=!1,nativeButton:c=!0,...f}=t,{store:d}=ca(),m=d.useState("open"),{getButtonProps:p,buttonRef:b}=Qh({disabled:l,native:c}),y={disabled:l};function E(w){m&&d.setOpen(!1,vt(CL,w.nativeEvent))}return Wn("button",t,{state:y,ref:[n,b],props:[{onClick:E},f,p]})}),D9=S.forwardRef(function(t,n){const{render:r,className:i,style:o,id:l,...c}=t,{store:f}=ca(),d=kc(l);return f.useSyncedValueWithCleanup("descriptionElementId",d),Wn("p",t,{ref:n,props:[{id:d},c]})});let P9=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),j9=(function(e){return e[e.open=$a.open]="open",e[e.closed=$a.closed]="closed",e[e.startingStyle=$a.startingStyle]="startingStyle",e[e.endingStyle=$a.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const $3=S.createContext(void 0);function B9(){const e=S.useContext($3);if(e===void 0)throw new Error(dr(26));return e}const H9={...Ac,...wc,nestedDialogOpen(e){return e?{[j9.nestedDialogOpen]:""}:null}},U9=S.forwardRef(function(t,n){const{render:r,className:i,style:o,finalFocus:l,initialFocus:c,...f}=t,{store:d}=ca(),m=d.useState("descriptionElementId"),p=d.useState("disablePointerDismissal"),b=d.useState("floatingRootContext"),y=d.useState("popupProps"),E=d.useState("modal"),w=d.useState("mounted"),k=d.useState("nested"),C=d.useState("nestedOpenDialogCount"),A=d.useState("open"),_=d.useState("openMethod"),N=d.useState("titleElementId"),D=d.useState("transitionStatus"),O=d.useState("role"),j=b.useState("floatingId"),M=f.id??j;B9(),vl({open:A,ref:d.context.popupRef,onComplete(){A&&d.context.onOpenChangeComplete?.(!0)}});const q=c===void 0?pD(d.context.popupRef):c,U=C>0,Q=d.useStateSetter("popupElement"),G=Wn("div",t,{state:{open:A,nested:k,transitionStatus:D,nestedDialogOpen:U},props:[y,{id:M,"aria-labelledby":N??void 0,"aria-describedby":m??void 0,role:O,...b1,hidden:!w,onKeyDown(ee){O3.has(ee.key)&&ee.stopPropagation()},style:{[P9.nestedDialogs]:C}},f],ref:[n,d.context.popupRef,Q],stateAttributesMapping:H9});return g.jsx(Vk,{context:b,openInteractionType:_,disabled:!w,closeOnFocusOut:!p,initialFocus:q,returnFocus:l,modal:E!==!1,restoreFocus:"popup",children:G})}),z9=S.forwardRef(function(t,n){const{keepMounted:r=!1,...i}=t,{store:o}=ca(),l=o.useState("mounted"),c=o.useState("modal"),f=o.useState("open");return l||r?g.jsx($3.Provider,{value:r,children:g.jsxs(Fk,{ref:n,...i,children:[l&&c===!0&&g.jsx(_3,{ref:o.context.internalBackdropRef,inert:v3(!f)}),t.children]})}):null}),F9=S.forwardRef(function(t,n){const{render:r,className:i,style:o,id:l,...c}=t,{store:f}=ca(),d=kc(l);return f.useSyncedValueWithCleanup("titleElementId",d),Wn("h2",t,{ref:n,props:[{id:d},c]})}),V9=S.forwardRef(function(t,n){const{render:r,className:i,style:o,disabled:l=!1,nativeButton:c=!0,id:f,payload:d,handle:m,...p}=t,b=ca(!0),y=m?.store??b?.store;if(!y)throw new Error(dr(79));const E=kc(f),w=y.useState("floatingRootContext"),k=y.useState("isOpenedByTrigger",E),C=y.useState("triggerPopupId",E),A=S.useRef(null),{registerTrigger:_,isMountedByThisTrigger:N}=t3(E,A,y,{payload:d}),{getButtonProps:D,buttonRef:O}=Qh({disabled:l,native:c}),j=$k(w,{enabled:w!=null}),M=E3(()=>y.select("open"),Q=>{y.set("openMethod",Q)}),q={disabled:l,open:k},U=y.useState("triggerProps",N);return Wn("button",t,{state:q,ref:[O,n,_,A],props:[j.reference,U,M,{[Bk]:"",id:E,"aria-haspopup":"dialog","aria-expanded":k,"aria-controls":C},p,D],stateAttributesMapping:v1})}),$9=V9,q9=O9,Y9=$9,G9=M9,X9=({className:e,children:t,...n})=>g.jsxs(z9,{children:[g.jsx(L9,{className:He("fixed inset-0 z-70 bg-black/40 backdrop-blur-[1px]","transition-opacity duration-(--motion-base)","data-starting-style:opacity-0 data-ending-style:opacity-0")}),g.jsx(U9,{"data-slot":"alert-dialog-content",className:He("fixed top-1/2 left-1/2 z-70 w-[min(28rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2","rounded-lg border border-border bg-surface p-5 shadow-(--shadow-lg) outline-none","transition-[opacity,transform] duration-(--motion-base)","data-starting-style:scale-95 data-starting-style:opacity-0","data-ending-style:scale-95 data-ending-style:opacity-0",e),...n,children:t})]}),K9=({className:e,...t})=>g.jsx(F9,{className:He("text-heading-3 font-semibold text-text",e),...t}),Q9=({className:e,...t})=>g.jsx(D9,{className:He("mt-1.5 text-body-sm text-muted-foreground",e),...t}),q3=S.createContext(void 0);function Wh(e){const t=S.useContext(q3);if(t===void 0&&!e)throw new Error(dr(72));return t}const W9={...l3,disabled:ze(e=>e.disabled),instantType:ze(e=>e.instantType),isInstantPhase:ze(e=>e.isInstantPhase),trackCursorAxis:ze(e=>e.trackCursorAxis),disableHoverablePopup:ze(e=>e.disableHoverablePopup),lastOpenChangeReason:ze(e=>e.openChangeReason),closeOnClick:ze(e=>e.closeOnClick),closeDelay:ze(e=>e.closeDelay),hasViewport:ze(e=>e.hasViewport)};class _1 extends Wb{constructor(t,n,r=!1){const i=new Xh,o={...Z9(),...t};o.floatingRootContext=a3(i,n,r),super(o,{popupRef:S.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:i},W9)}setOpen=(t,n)=>{bD(this,t,n,{extraState:{openChangeReason:n.reason}})};cancelPendingOpen(t){this.state.floatingRootContext.dispatchOpenChange(!1,vt(Cc,t))}static useStore(t,n){return Jk(t,(i,o)=>new _1(n,i,o)).store}}function Z9(){return{...i3(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,hasViewport:!1}}const J9=ck(function(t){const{disabled:n=!1,defaultOpen:r=!1,open:i,disableHoverablePopup:o=!1,trackCursorAxis:l="none",actionsRef:c,onOpenChange:f,onOpenChangeComplete:d,handle:m,triggerId:p,defaultTriggerId:b=null,children:y}=t,E=_1.useStore(m?.store,{open:r,openProp:i,activeTriggerId:b,triggerIdProp:p});xD(E,i,r,b),E.useControlledProp("openProp",i),E.useControlledProp("triggerIdProp",p),E.useContextCallback("onOpenChange",f),E.useContextCallback("onOpenChangeComplete",d);const w=E.useState("open"),k=!n&&w,C=E.useState("activeTriggerId"),A=E.useState("mounted"),_=E.useState("payload");E.useSyncedValues({trackCursorAxis:l,disableHoverablePopup:o}),E.useSyncedValue("disabled",n),n3(E,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:N,transitionStatus:D}=r3(k,E),O=E.useState("isInstantPhase"),j=E.useState("instantType"),M=E.useState("lastOpenChangeReason"),q=S.useRef(null);Ve(()=>{w&&n&&E.setOpen(!1,vt(kL))},[w,n,E]),Ve(()=>{D==="ending"&&M===El||D!=="ending"&&O?(j!=="delay"&&(q.current=j),E.set("instantType","delay")):q.current!==null&&(E.set("instantType",q.current),q.current=null)},[D,O,M,j,E]),Ve(()=>{k&&C==null&&E.set("payload",void 0)},[E,C,k]);const U=S.useCallback(()=>{E.setOpen(!1,vt(xk))},[E]);S.useImperativeHandle(c,()=>({unmount:N,close:U}),[N,U]);const Q=k||A||!n&&l!=="none";return g.jsxs(q3.Provider,{value:E,children:[Q&&g.jsx(e7,{store:E,disabled:n,trackCursorAxis:l}),typeof y=="function"?y({payload:_}):y]})});function e7({store:e,disabled:t,trackCursorAxis:n}){const r=e.useState("floatingRootContext"),i=p1(r,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),o=yM(r,{enabled:!t&&n!=="none",axis:n==="none"?void 0:n}),l=S.useMemo(()=>li(o.reference,i.reference),[o.reference,i.reference]),c=S.useMemo(()=>li(o.trigger,i.trigger),[o.trigger,i.trigger]),f=S.useMemo(()=>li(b1,o.floating,i.floating),[o.floating,i.floating]);return s3(e,{activeTriggerProps:l,inactiveTriggerProps:c,popupProps:f}),null}const t7=S.createContext(void 0);function n7(){return S.useContext(t7)}let r7=(function(e){return e[e.popupOpen=fh.popupOpen]="popupOpen",e.triggerDisabled="data-trigger-disabled",e})({});const s7=600,Y3="data-base-ui-tooltip-trigger";function V2(e){if("composedPath"in e){const n=e.composedPath();for(let r=0;r<n.length;r+=1){const i=n[r];if(Et(i))return i}}const t=e.target;return Et(t)?t:null}function i7(e){let t=e;for(;t;){if(t.hasAttribute(Y3))return t;const n=t.parentElement;if(n){t=n;continue}const r=t.getRootNode();t="host"in r&&Et(r.host)?r.host:null}return null}const a7=Z5(function(t,n){const{render:r,className:i,style:o,handle:l,payload:c,disabled:f,delay:d,closeOnClick:m=!0,closeDelay:p,id:b,...y}=t,E=Wh(!0),w=l?.store??E;if(!w)throw new Error(dr(82));const k=kc(b),C=w.useState("isTriggerActive",k),A=w.useState("isOpenedByTrigger",k),_=w.useState("floatingRootContext"),N=S.useRef(null),D=d??s7,O=p??0,{registerTrigger:j,isMountedByThisTrigger:M}=t3(k,N,w,{payload:c,closeOnClick:m,closeDelay:O}),q=n7(),{delayRef:U,isInstantPhase:Q,hasProvider:Z}=RL(_,{open:A}),G=E1(_);w.useSyncedValue("isInstantPhase",Q);const ee=w.useState("disabled"),Y=f??ee,H=xn(Y),K=w.useState("trackCursorAxis"),te=w.useState("disableHoverablePopup"),le=S.useRef(!1),I=ns(),P=S.useRef(void 0);function $(){const Te=q?.delay,Ie=typeof U.current=="object"?U.current.open:void 0;let je=D;return Z&&(Ie!==0?je=d??Te??D:je=0),je}function L(Te){const Ie=N.current;if(!Ie||!Te)return!1;const je=i7(Te);return je!==null&&je!==Ie&&nt(Ie,je)}function ae(Te){const Ie=L(Te);return le.current=Ie,Ie&&(G.openChangeTimeout.clear(),G.restTimeout.clear(),G.restTimeoutPending=!1,I.clear()),Ie}const ie=kD(_,{enabled:!Y,mouseOnly:!0,move:!1,handleClose:!te&&K!=="both"?MD():null,restMs:$,delay(){const Te=typeof U.current=="object"?U.current.close:void 0;let Ie=O;return p==null&&Z&&(Ie=Te),{close:Ie}},triggerElementRef:N,isActiveTrigger:C,isClosing:()=>w.select("transitionStatus")==="ending",shouldOpen(){return!le.current}}),fe=SD(_,{enabled:!Y}).reference,de=Te=>{const Ie=le.current,je=V2(Te),We=ae(je),Xe=N.current,Me=Xe&&je&&nt(Xe,je);if(We&&w.select("open")&&w.select("lastOpenChangeReason")===Cr){w.setOpen(!1,vt(Cr,Te));return}if(Ie&&!We&&Me&&!H.current&&!w.select("open")&&Xe&&Wa(P.current)){const Ce=()=>{!le.current&&!H.current&&!w.select("open")&&w.setOpen(!0,vt(Cr,Te,Xe))},we=$();we===0?(I.clear(),Ce()):I.start(we,Ce)}},he=w.useState("triggerProps",M);return Wn("button",t,{state:{open:A},ref:[n,j,N],props:[ie,fe,M||K!=="none"?he:void 0,{onMouseOver(Te){de(Te.nativeEvent)},onFocus(Te){L(V2(Te.nativeEvent))&&Te.preventBaseUIHandler()},onMouseLeave(){le.current=!1,I.clear(),P.current=void 0},onPointerEnter(Te){P.current=Te.pointerType},onPointerDown(Te){P.current=Te.pointerType,w.set("closeOnClick",m),m&&!w.select("open")&&w.cancelPendingOpen(Te.nativeEvent)},onClick(Te){m&&!w.select("open")&&w.cancelPendingOpen(Te.nativeEvent)},id:k,[r7.triggerDisabled]:Y?"":void 0,[Y3]:Y?void 0:""},y],stateAttributesMapping:v1})}),G3=S.createContext(void 0);function o7(){const e=S.useContext(G3);if(e===void 0)throw new Error(dr(70));return e}const l7=S.forwardRef(function(t,n){const{children:r,container:i,className:o,render:l,style:c,...f}=t,{portalNode:d,portalSubtree:m}=zk({container:i,ref:n,componentProps:t,elementProps:f});return!m&&!d?null:g.jsxs(S.Fragment,{children:[m,d&&cs.createPortal(r,d)]})}),u7=S.forwardRef(function(t,n){const{keepMounted:r=!1,...i}=t;return Wh().useState("mounted")||r?g.jsx(G3.Provider,{value:r,children:g.jsx(l7,{ref:n,...i})}):null}),X3=S.createContext(void 0);function c7(){const e=S.useContext(X3);if(e===void 0)throw new Error(dr(71));return e}const f7=S.forwardRef(function(t,n){const{render:r,className:i,anchor:o,positionMethod:l="absolute",side:c="top",align:f="center",sideOffset:d=0,alignOffset:m=0,collisionBoundary:p="clipping-ancestors",collisionPadding:b=5,arrowPadding:y=5,sticky:E=!1,disableAnchorTracking:w=!1,collisionAvoidance:k=cM,style:C,...A}=t,_=Wh(),N=o7(),D=_.useState("open"),O=_.useState("mounted"),j=_.useState("trackCursorAxis"),M=_.useState("disableHoverablePopup"),q=_.useState("floatingRootContext"),U=_.useState("instantType"),Q=_.useState("transitionStatus"),Z=_.useState("hasViewport"),G=k3({anchor:o,positionMethod:l,floatingRootContext:q,mounted:O,side:c,sideOffset:d,align:f,alignOffset:m,collisionBoundary:p,collisionPadding:b,sticky:E,arrowPadding:y,disableAnchorTracking:w,keepMounted:N,collisionAvoidance:k,adaptiveOrigin:Z?R8:void 0}),ee=S.useMemo(()=>({open:D,side:G.side,align:G.align,anchorHidden:G.anchorHidden,instant:j!=="none"?"tracking-cursor":U}),[D,G.side,G.align,G.anchorHidden,j,U]),Y=N3(t,ee,{styles:G.positionerStyles,transitionStatus:Q,props:A,refs:[n,_.useStateSetter("positionerElement")],hidden:!O,inert:!D||j==="both"||M});return g.jsx(X3.Provider,{value:G,children:Y})}),d7={...Ac,...wc},h7=S.forwardRef(function(t,n){const{render:r,className:i,style:o,...l}=t,c=Wh(),{side:f,align:d}=c7(),m=c.useState("open"),p=c.useState("instantType"),b=c.useState("transitionStatus"),y=c.useState("popupProps"),E=c.useState("floatingRootContext"),w=c.useState("disabled"),k=c.useState("closeDelay");vl({open:m,ref:c.context.popupRef,onComplete(){m&&c.context.onOpenChangeComplete?.(!0)}}),CD(E,{enabled:!w,closeDelay:k});const C=c.useStateSetter("popupElement");return Wn("div",t,{state:{open:m,side:f,align:d,instant:p,transitionStatus:b},ref:[n,c.context.popupRef,C],props:[y,S1(b),l],stateAttributesMapping:d7})}),p7=({className:e,side:t="top",sideOffset:n=6,...r})=>g.jsx(u7,{children:g.jsx(f7,{side:t,sideOffset:n,className:"isolate z-60",children:g.jsx(h7,{"data-slot":"tooltip-content",className:He("rounded-md border border-border bg-surface px-2 py-1 text-label text-fg-2 shadow-(--shadow-md) outline-none",e),...r})})});function K3({content:e,children:t}){return g.jsxs(J9,{children:[g.jsx(a7,{render:g.jsx("span",{className:"inline-flex"}),children:t}),g.jsx(p7,{children:e})]})}function m7(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const g7=e=>{switch(e){case"success":return y7;case"info":return T7;case"warning":return E7;case"error":return v7;default:return null}},b7=Array(12).fill(0),x7=({visible:e,className:t})=>De.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},De.createElement("div",{className:"sonner-spinner"},b7.map((n,r)=>De.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),y7=De.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},De.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"})),E7=De.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},De.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"})),T7=De.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},De.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"})),v7=De.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},De.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"})),S7=De.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"},De.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),De.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),C7=()=>{const[e,t]=De.useState(document.hidden);return De.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let sb=1;class w7{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...i}=t,o=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:sb++,l=this.toasts.find(f=>f.id===o),c=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),l?this.toasts=this.toasts.map(f=>f.id===o?(this.publish({...f,...t,id:o,title:r}),{...f,...t,id:o,dismissible:c,title:r}):f):this.addToast({title:r,...i,dismissible:c,id:o}),o},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const i=Promise.resolve(t instanceof Function?t():t);let o=r!==void 0,l;const c=i.then(async d=>{if(l=["resolve",d],De.isValidElement(d))o=!1,this.create({id:r,type:"default",message:d});else if(A7(d)&&!d.ok){o=!1;const p=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,b=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,E=typeof p=="object"&&!De.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:b,...E})}else if(d instanceof Error){o=!1;const p=typeof n.error=="function"?await n.error(d):n.error,b=typeof n.description=="function"?await n.description(d):n.description,E=typeof p=="object"&&!De.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:b,...E})}else if(n.success!==void 0){o=!1;const p=typeof n.success=="function"?await n.success(d):n.success,b=typeof n.description=="function"?await n.description(d):n.description,E=typeof p=="object"&&!De.isValidElement(p)?p:{message:p};this.create({id:r,type:"success",description:b,...E})}}).catch(async d=>{if(l=["reject",d],n.error!==void 0){o=!1;const m=typeof n.error=="function"?await n.error(d):n.error,p=typeof n.description=="function"?await n.description(d):n.description,y=typeof m=="object"&&!De.isValidElement(m)?m:{message:m};this.create({id:r,type:"error",description:p,...y})}}).finally(()=>{o&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),f=()=>new Promise((d,m)=>c.then(()=>l[0]==="reject"?m(l[1]):d(l[1])).catch(m));return typeof r!="string"&&typeof r!="number"?{unwrap:f}:Object.assign(r,{unwrap:f})},this.custom=(t,n)=>{const r=n?.id||sb++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const vr=new w7,k7=(e,t)=>{const n=t?.id||sb++;return vr.addToast({title:e,...t,id:n}),n},A7=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",_7=k7,N7=()=>vr.toasts,R7=()=>vr.getActiveToasts(),Mn=Object.assign(_7,{success:vr.success,info:vr.info,warning:vr.warning,error:vr.error,custom:vr.custom,message:vr.message,promise:vr.promise,dismiss:vr.dismiss,loading:vr.loading},{getHistory:N7,getToasts:R7});m7("[data-sonner-toaster][dir=ltr],html[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%)}[data-sonner-toaster][dir=rtl],html[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:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-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;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;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 rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[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-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [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-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [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;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [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;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[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][data-expanded=true]::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) * 0.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-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[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-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--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-sonner-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-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--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, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--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-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[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]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[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]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[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]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[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:first-child{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)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function yd(e){return e.label!==void 0}const O7=3,I7="24px",L7="16px",$2=4e3,M7=356,D7=14,P7=45,j7=200;function ys(...e){return e.filter(Boolean).join(" ")}function B7(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const H7=e=>{var t,n,r,i,o,l,c,f,d;const{invert:m,toast:p,unstyled:b,interacting:y,setHeights:E,visibleToasts:w,heights:k,index:C,toasts:A,expanded:_,removeToast:N,defaultRichColors:D,closeButton:O,style:j,cancelButtonStyle:M,actionButtonStyle:q,className:U="",descriptionClassName:Q="",duration:Z,position:G,gap:ee,expandByDefault:Y,classNames:H,icons:K,closeButtonAriaLabel:te="Close toast"}=e,[le,I]=De.useState(null),[P,$]=De.useState(null),[L,ae]=De.useState(!1),[ie,fe]=De.useState(!1),[de,he]=De.useState(!1),[ve,Ue]=De.useState(!1),[Pe,Te]=De.useState(!1),[Ie,je]=De.useState(0),[We,Xe]=De.useState(0),Me=De.useRef(p.duration||Z||$2),Ce=De.useRef(null),we=De.useRef(null),Be=C===0,$e=C+1<=w,W=p.type,me=p.dismissible!==!1,se=p.className||"",re=p.descriptionClassName||"",V=De.useMemo(()=>k.findIndex(Ye=>Ye.toastId===p.id)||0,[k,p.id]),z=De.useMemo(()=>{var Ye;return(Ye=p.closeButton)!=null?Ye:O},[p.closeButton,O]),ue=De.useMemo(()=>p.duration||Z||$2,[p.duration,Z]),ke=De.useRef(0),Re=De.useRef(0),qe=De.useRef(0),rt=De.useRef(null),[et,ot]=G.split("-"),ut=De.useMemo(()=>k.reduce((Ye,gt,Ut)=>Ut>=V?Ye:Ye+gt.height,0),[k,V]),Fe=C7(),Dt=p.invert||m,jt=W==="loading";Re.current=De.useMemo(()=>V*ee+ut,[V,ut]),De.useEffect(()=>{Me.current=ue},[ue]),De.useEffect(()=>{ae(!0)},[]),De.useEffect(()=>{const Ye=we.current;if(Ye){const gt=Ye.getBoundingClientRect().height;return Xe(gt),E(Ut=>[{toastId:p.id,height:gt,position:p.position},...Ut]),()=>E(Ut=>Ut.filter(Jt=>Jt.toastId!==p.id))}},[E,p.id]),De.useLayoutEffect(()=>{if(!L)return;const Ye=we.current,gt=Ye.style.height;Ye.style.height="auto";const Ut=Ye.getBoundingClientRect().height;Ye.style.height=gt,Xe(Ut),E(Jt=>Jt.find(bt=>bt.toastId===p.id)?Jt.map(bt=>bt.toastId===p.id?{...bt,height:Ut}:bt):[{toastId:p.id,height:Ut,position:p.position},...Jt])},[L,p.title,p.description,E,p.id,p.jsx,p.action,p.cancel]);const at=De.useCallback(()=>{fe(!0),je(Re.current),E(Ye=>Ye.filter(gt=>gt.toastId!==p.id)),setTimeout(()=>{N(p)},j7)},[p,N,E,Re]);De.useEffect(()=>{if(p.promise&&W==="loading"||p.duration===1/0||p.type==="loading")return;let Ye;return _||y||Fe?(()=>{if(qe.current<ke.current){const Jt=new Date().getTime()-ke.current;Me.current=Me.current-Jt}qe.current=new Date().getTime()})():(()=>{Me.current!==1/0&&(ke.current=new Date().getTime(),Ye=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),at()},Me.current))})(),()=>clearTimeout(Ye)},[_,y,p,W,Fe,at]),De.useEffect(()=>{p.delete&&(at(),p.onDismiss==null||p.onDismiss.call(p,p))},[at,p.delete]);function Ot(){var Ye;if(K?.loading){var gt;return De.createElement("div",{className:ys(H?.loader,p==null||(gt=p.classNames)==null?void 0:gt.loader,"sonner-loader"),"data-visible":W==="loading"},K.loading)}return De.createElement(x7,{className:ys(H?.loader,p==null||(Ye=p.classNames)==null?void 0:Ye.loader),visible:W==="loading"})}const Qt=p.icon||K?.[W]||g7(W);var Wt,Zt;return De.createElement("li",{tabIndex:0,ref:we,className:ys(U,se,H?.toast,p==null||(t=p.classNames)==null?void 0:t.toast,H?.default,H?.[W],p==null||(n=p.classNames)==null?void 0:n[W]),"data-sonner-toast":"","data-rich-colors":(Wt=p.richColors)!=null?Wt:D,"data-styled":!(p.jsx||p.unstyled||b),"data-mounted":L,"data-promise":!!p.promise,"data-swiped":Pe,"data-removed":ie,"data-visible":$e,"data-y-position":et,"data-x-position":ot,"data-index":C,"data-front":Be,"data-swiping":de,"data-dismissible":me,"data-type":W,"data-invert":Dt,"data-swipe-out":ve,"data-swipe-direction":P,"data-expanded":!!(_||Y&&L),"data-testid":p.testId,style:{"--index":C,"--toasts-before":C,"--z-index":A.length-C,"--offset":`${ie?Ie:Re.current}px`,"--initial-height":Y?"auto":`${We}px`,...j,...p.style},onDragEnd:()=>{he(!1),I(null),rt.current=null},onPointerDown:Ye=>{Ye.button!==2&&(jt||!me||(Ce.current=new Date,je(Re.current),Ye.target.setPointerCapture(Ye.pointerId),Ye.target.tagName!=="BUTTON"&&(he(!0),rt.current={x:Ye.clientX,y:Ye.clientY})))},onPointerUp:()=>{var Ye,gt,Ut;if(ve||!me)return;rt.current=null;const Jt=Number(((Ye=we.current)==null?void 0:Ye.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Fn=Number(((gt=we.current)==null?void 0:gt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),bt=new Date().getTime()-((Ut=Ce.current)==null?void 0:Ut.getTime()),an=le==="x"?Jt:Fn,hr=Math.abs(an)/bt;if(Math.abs(an)>=P7||hr>.11){je(Re.current),p.onDismiss==null||p.onDismiss.call(p,p),$(le==="x"?Jt>0?"right":"left":Fn>0?"down":"up"),at(),Ue(!0);return}else{var hn,En;(hn=we.current)==null||hn.style.setProperty("--swipe-amount-x","0px"),(En=we.current)==null||En.style.setProperty("--swipe-amount-y","0px")}Te(!1),he(!1),I(null)},onPointerMove:Ye=>{var gt,Ut,Jt;if(!rt.current||!me||((gt=window.getSelection())==null?void 0:gt.toString().length)>0)return;const bt=Ye.clientY-rt.current.y,an=Ye.clientX-rt.current.x;var hr;const hn=(hr=e.swipeDirections)!=null?hr:B7(G);!le&&(Math.abs(an)>1||Math.abs(bt)>1)&&I(Math.abs(an)>Math.abs(bt)?"x":"y");let En={x:0,y:0};const ft=At=>1/(1.5+Math.abs(At)/20);if(le==="y"){if(hn.includes("top")||hn.includes("bottom"))if(hn.includes("top")&&bt<0||hn.includes("bottom")&&bt>0)En.y=bt;else{const At=bt*ft(bt);En.y=Math.abs(At)<Math.abs(bt)?At:bt}}else if(le==="x"&&(hn.includes("left")||hn.includes("right")))if(hn.includes("left")&&an<0||hn.includes("right")&&an>0)En.x=an;else{const At=an*ft(an);En.x=Math.abs(At)<Math.abs(an)?At:an}(Math.abs(En.x)>0||Math.abs(En.y)>0)&&Te(!0),(Ut=we.current)==null||Ut.style.setProperty("--swipe-amount-x",`${En.x}px`),(Jt=we.current)==null||Jt.style.setProperty("--swipe-amount-y",`${En.y}px`)}},z&&!p.jsx&&W!=="loading"?De.createElement("button",{"aria-label":te,"data-disabled":jt,"data-close-button":!0,onClick:jt||!me?()=>{}:()=>{at(),p.onDismiss==null||p.onDismiss.call(p,p)},className:ys(H?.closeButton,p==null||(r=p.classNames)==null?void 0:r.closeButton)},(Zt=K?.close)!=null?Zt:S7):null,(W||p.icon||p.promise)&&p.icon!==null&&(K?.[W]!==null||p.icon)?De.createElement("div",{"data-icon":"",className:ys(H?.icon,p==null||(i=p.classNames)==null?void 0:i.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||Ot():null,p.type!=="loading"?Qt:null):null,De.createElement("div",{"data-content":"",className:ys(H?.content,p==null||(o=p.classNames)==null?void 0:o.content)},De.createElement("div",{"data-title":"",className:ys(H?.title,p==null||(l=p.classNames)==null?void 0:l.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?De.createElement("div",{"data-description":"",className:ys(Q,re,H?.description,p==null||(c=p.classNames)==null?void 0:c.description)},typeof p.description=="function"?p.description():p.description):null),De.isValidElement(p.cancel)?p.cancel:p.cancel&&yd(p.cancel)?De.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||M,onClick:Ye=>{yd(p.cancel)&&me&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,Ye),at())},className:ys(H?.cancelButton,p==null||(f=p.classNames)==null?void 0:f.cancelButton)},p.cancel.label):null,De.isValidElement(p.action)?p.action:p.action&&yd(p.action)?De.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||q,onClick:Ye=>{yd(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,Ye),!Ye.defaultPrevented&&at())},className:ys(H?.actionButton,p==null||(d=p.classNames)==null?void 0:d.actionButton)},p.action.label):null)};function q2(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function U7(e,t){const n={};return[e,t].forEach((r,i)=>{const o=i===1,l=o?"--mobile-offset":"--offset",c=o?L7:I7;function f(d){["top","right","bottom","left"].forEach(m=>{n[`${l}-${m}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?f(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${l}-${d}`]=c:n[`${l}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):f(c)}),n}const z7=De.forwardRef(function(t,n){const{id:r,invert:i,position:o="bottom-right",hotkey:l=["altKey","KeyT"],expand:c,closeButton:f,className:d,offset:m,mobileOffset:p,theme:b="light",richColors:y,duration:E,style:w,visibleToasts:k=O7,toastOptions:C,dir:A=q2(),gap:_=D7,icons:N,containerAriaLabel:D="Notifications"}=t,[O,j]=De.useState([]),M=De.useMemo(()=>r?O.filter(L=>L.toasterId===r):O.filter(L=>!L.toasterId),[O,r]),q=De.useMemo(()=>Array.from(new Set([o].concat(M.filter(L=>L.position).map(L=>L.position)))),[M,o]),[U,Q]=De.useState([]),[Z,G]=De.useState(!1),[ee,Y]=De.useState(!1),[H,K]=De.useState(b!=="system"?b:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),te=De.useRef(null),le=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),I=De.useRef(null),P=De.useRef(!1),$=De.useCallback(L=>{j(ae=>{var ie;return(ie=ae.find(fe=>fe.id===L.id))!=null&&ie.delete||vr.dismiss(L.id),ae.filter(({id:fe})=>fe!==L.id)})},[]);return De.useEffect(()=>vr.subscribe(L=>{if(L.dismiss){requestAnimationFrame(()=>{j(ae=>ae.map(ie=>ie.id===L.id?{...ie,delete:!0}:ie))});return}setTimeout(()=>{pI.flushSync(()=>{j(ae=>{const ie=ae.findIndex(fe=>fe.id===L.id);return ie!==-1?[...ae.slice(0,ie),{...ae[ie],...L},...ae.slice(ie+1)]:[L,...ae]})})})}),[O]),De.useEffect(()=>{if(b!=="system"){K(b);return}if(b==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?K("dark"):K("light")),typeof window>"u")return;const L=window.matchMedia("(prefers-color-scheme: dark)");try{L.addEventListener("change",({matches:ae})=>{K(ae?"dark":"light")})}catch{L.addListener(({matches:ie})=>{try{K(ie?"dark":"light")}catch(fe){console.error(fe)}})}},[b]),De.useEffect(()=>{O.length<=1&&G(!1)},[O]),De.useEffect(()=>{const L=ae=>{var ie;if(l.every(he=>ae[he]||ae.code===he)){var de;G(!0),(de=te.current)==null||de.focus()}ae.code==="Escape"&&(document.activeElement===te.current||(ie=te.current)!=null&&ie.contains(document.activeElement))&&G(!1)};return document.addEventListener("keydown",L),()=>document.removeEventListener("keydown",L)},[l]),De.useEffect(()=>{if(te.current)return()=>{I.current&&(I.current.focus({preventScroll:!0}),I.current=null,P.current=!1)}},[te.current]),De.createElement("section",{ref:n,"aria-label":`${D} ${le}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},q.map((L,ae)=>{var ie;const[fe,de]=L.split("-");return M.length?De.createElement("ol",{key:L,dir:A==="auto"?q2():A,tabIndex:-1,ref:te,className:d,"data-sonner-toaster":!0,"data-sonner-theme":H,"data-y-position":fe,"data-x-position":de,style:{"--front-toast-height":`${((ie=U[0])==null?void 0:ie.height)||0}px`,"--width":`${M7}px`,"--gap":`${_}px`,...w,...U7(m,p)},onBlur:he=>{P.current&&!he.currentTarget.contains(he.relatedTarget)&&(P.current=!1,I.current&&(I.current.focus({preventScroll:!0}),I.current=null))},onFocus:he=>{he.target instanceof HTMLElement&&he.target.dataset.dismissible==="false"||P.current||(P.current=!0,I.current=he.relatedTarget)},onMouseEnter:()=>G(!0),onMouseMove:()=>G(!0),onMouseLeave:()=>{ee||G(!1)},onDragEnd:()=>G(!1),onPointerDown:he=>{he.target instanceof HTMLElement&&he.target.dataset.dismissible==="false"||Y(!0)},onPointerUp:()=>Y(!1)},M.filter(he=>!he.position&&ae===0||he.position===L).map((he,ve)=>{var Ue,Pe;return De.createElement(H7,{key:he.id,icons:N,index:ve,toast:he,defaultRichColors:y,duration:(Ue=C?.duration)!=null?Ue:E,className:C?.className,descriptionClassName:C?.descriptionClassName,invert:i,visibleToasts:k,closeButton:(Pe=C?.closeButton)!=null?Pe:f,interacting:ee,position:L,style:C?.style,unstyled:C?.unstyled,classNames:C?.classNames,cancelButtonStyle:C?.cancelButtonStyle,actionButtonStyle:C?.actionButtonStyle,closeButtonAriaLabel:C?.closeButtonAriaLabel,removeToast:$,toasts:M.filter(Te=>Te.position==he.position),heights:U.filter(Te=>Te.position==he.position),setHeights:Q,expandByDefault:c,gap:_,expanded:Z,swipeDirections:t.swipeDirections})})):null}))});function F7(){return g.jsx(z7,{position:"bottom-right",toastOptions:{style:{background:"var(--surface)",color:"var(--text)",border:"1px solid var(--border)",boxShadow:"var(--shadow-md)",fontFamily:"var(--cw-font-sans)",fontSize:"var(--text-body-sm)"}}})}function Q3({value:e,className:t,variant:n="ghost",size:r="icon-sm",...i}){const[o,l]=S.useState(!1);return g.jsx($t,{variant:n,size:r,"aria-label":"Copy",className:He("text-fg-3",t),onClick:()=>{navigator.clipboard.writeText(e).then(()=>{l(!0),setTimeout(()=>l(!1),1500)})},...i,children:o?g.jsx(P3,{className:"size-3.5 text-success"}):g.jsx(MP,{className:"size-3.5"})})}function ci({className:e}){return g.jsx(YP,{"aria-label":"Loading",className:He("size-4 animate-spin text-fg-3",e)})}function ig({code:e,label:t,copyable:n=!0,className:r}){return g.jsxs("div",{"data-slot":"code-block",className:He("overflow-hidden rounded-md border border-border bg-code-bg",r),children:[t!==void 0||n?g.jsxs("div",{className:"flex h-8 items-center justify-between border-b border-border px-2.5",children:[g.jsx("span",{className:"font-mono text-label text-fg-3",children:t}),n?g.jsx(Q3,{value:e}):null]}):null,g.jsx("pre",{className:"max-h-64 overflow-auto px-3 py-2 font-mono text-label whitespace-pre-wrap text-fg-2",children:e})]})}function W3({value:e,size:t=13,strokeWidth:n=2,className:r}){const i=Math.min(100,Math.max(0,e)),o=(t-n)/2,l=2*Math.PI*o;return g.jsxs("svg",{"data-slot":"progress-ring",width:t,height:t,viewBox:`0 0 ${t} ${t}`,role:"img","aria-label":`${Math.round(i)}%`,className:He("shrink-0 -rotate-90",r),children:[g.jsx("circle",{cx:t/2,cy:t/2,r:o,fill:"none",stroke:"currentColor",strokeOpacity:.2,strokeWidth:n}),g.jsx("circle",{cx:t/2,cy:t/2,r:o,fill:"none",stroke:"currentColor",strokeWidth:n,strokeLinecap:"round",strokeDasharray:l,strokeDashoffset:l*(1-i/100)})]})}function Hn(e){return e.map(t=>t.type==="text"?t.text:`${t.trigger}${t.displayText}`).join("")}function V7(e){return e?[{type:"text",text:e}]:[]}function $7(e,t){if(t<=0)return[];const n=[];let r=0;for(const i of e){const o=i.type==="text"?i.text.length:i.trigger.length+i.displayText.length;if(r+o<=t){n.push(i),r+=o;continue}if(i.type==="text"){let l=t-r;if(l>0){const c=i.text.charCodeAt(l-1);c>=55296&&c<=56319&&(l-=1),l>0&&n.push({type:"text",text:i.text.slice(0,l)})}}break}return n}function Ku(e){return e===" "||e===`
|
|
281
|
-
`||e===" "}function Z3(e){const t=new Map;for(const n of e)t.has(n.char)||t.set(n.char,n);return t}function hh(e,t,n){if(t===0)return!0;const r=e[t-1];return n==="start"?r===`
|
|
282
|
-
`:Ku(r)}function q7(e,t,n){if(!e||t===0||n.length===0)return null;const r=Z3(n);for(let i=t-1;i>=0;i--){const o=e[i];if(Ku(o)){if(i+1<t){const c=e[i+1],f=r.get(c);if(f&&hh(e,i+1,f.position))return{config:f,startOffset:i+1,query:e.slice(i+2,t)}}return null}const l=r.get(o);if(l&&hh(e,i,l.position))return{config:l,startOffset:i,query:e.slice(i+1,t)}}return null}function ag(e,t,n){const r=t.startOffset,i=r+1+t.query.length,o=[];let l=0;for(const p of e)if(p.type==="chip"){const b=`${p.trigger}${p.displayText}`,y=l,E=l+b.length;(E<=r||y>=i)&&o.push(p),l=E}else{const b=l,y=l+p.text.length;if(y<=r)o.push(p);else if(b>=i)o.push(p);else{const E=p.text.slice(0,Math.max(0,r-b)),w=p.text.slice(Math.min(p.text.length,i-b));E&&o.push({type:"text",text:E});const k={type:"chip",trigger:t.config.char,value:n.value,displayText:n.displayText,...n.data!==void 0?{data:n.data}:{},...n.autoResolved?{autoResolved:!0}:{}};o.push(k),w?o.push({type:"text",text:" "+w.replace(/^\s/,"")}):o.push({type:"text",text:" "})}l=y}const c=Sl(o);let f=-1,d=0;for(const p of c)p.type==="text"?d+=p.text.length:(d+=p.trigger.length+p.displayText.length,p.value===n.value&&p.displayText===n.displayText&&p.trigger===t.config.char&&(f=d));const m=f===-1?d:f+1;return{segments:c,cursorOffset:m}}function Y7(e,t){if(t<0||t>=e.length||e[t].type!=="chip")return e;const n=[...e.slice(0,t),...e.slice(t+1)];return Sl(n)}function G7(e,t){if(t<0||t>=e.length)return null;const n=e[t];if(n.type!=="chip"||!n.autoResolved)return null;const r=`${n.trigger}${n.displayText}`,i=[...e.slice(0,t),{type:"text",text:r},...e.slice(t+1)];return{segments:Sl(i),revertedText:r}}function X7(e,t){const n=t.filter(o=>o.resolveOnSpace);if(n.length===0)return e;const r=Z3(n),i=[];for(const o of e){if(o.type==="chip"){i.push(o);continue}const l=K7(o.text,r);i.push(...l)}return Sl(i)}function K7(e,t){if(!e)return[];const n=[];let r=0;for(;r<e.length;){const i=e[r];if(t.has(i)&&(r===0||Ku(e[r-1]))){const c=t.get(i);if(c&&hh(e,r,c.position)){let f=r+1;for(;f<e.length&&!Ku(e[f]);)f++;const d=e.slice(r+1,f);if(d.length>0){const m=c.onSelect?.({value:d,label:d})||d;n.push({type:"chip",trigger:i,value:d,displayText:m,autoResolved:!0}),r=f;continue}}}const o=r;for(r++;r<e.length&&!(t.has(e[r])&&Ku(e[r-1]));)r++;n.push({type:"text",text:e.slice(o,r)})}return n}function or(e,t,n,r){const i=[];let o=0,l=!1;for(const c of e)if(c.type==="chip"){const f=`${c.trigger}${c.displayText}`,d=o,m=o+f.length;!l&&t===n&&d===t&&(i.push({type:"text",text:r}),l=!0),(m<=t||d>=n)&&i.push(c),o=m}else{const f=o,d=o+c.text.length,m=t===n?d<t:d<=t,p=t===n?f>n:f>=n;if(m)i.push(c);else if(p)i.push(c);else{const b=c.text.slice(0,Math.max(0,t-f)),y=c.text.slice(Math.min(c.text.length,n-f));b&&i.push({type:"text",text:b}),!l&&f<=t&&(i.push({type:"text",text:r}),l=!0),y&&i.push({type:"text",text:y})}o=d}return!l&&r&&i.push({type:"text",text:r}),Sl(i)}function Q7(e,t,n,r){if(t===n)return null;const i=Hn(e),o=r.length,l=t>=o&&i.slice(t-o,t)===r,c=n+o<=i.length&&i.slice(n,n+o)===r;let f=l&&c;if(f&&o===1){const p=t>o?i[t-o-1]:"",b=n+o<i.length?i[n+o]:"";(p===r||b===r)&&(f=!1)}if(f){const p=or(e,n,n+o,"");return{segments:or(p,t-o,t,""),selectionStart:t-o,selectionEnd:n-o}}const d=or(e,n,n,r);return{segments:or(d,t,t,r),selectionStart:t+o,selectionEnd:n+o}}function W7(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){const r=e[n],i=t[n];if(r.type!==i.type)return!1;if(r.type==="text"){if(i.type!=="text"||r.text!==i.text)return!1}else if(i.type!=="chip"||r.trigger!==i.trigger||r.value!==i.value||r.displayText!==i.displayText||r.autoResolved!==i.autoResolved)return!1}return!0}function Sl(e){const t=[];for(const n of e){if(n.type==="text"&&n.text==="")continue;const r=t[t.length-1];n.type==="text"&&r?.type==="text"?t[t.length-1]={type:"text",text:r.text+n.text}:t.push(n)}return t}function Zh(e){const t=e.match(/^(\s*)([•\-*]) /);if(t)return{kind:"bullet",indent:Math.floor(t[1].length/2),marker:t[2],prefixLen:t[0].length};const n=e.match(/^(\s*)(\d+)\. /);if(n){const r=n[1].length;return{kind:"numbered",indent:Math.floor(n[1].length/2),number:parseInt(n[2],10),numberStart:r,numberEnd:r+n[2].length,prefixLen:n[0].length}}return null}function ml(e,t){const n=e.lastIndexOf(`
|
|
283
|
-
`,t-1)+1,r=e.indexOf(`
|
|
284
|
-
`,t),i=e.slice(n,r===-1?e.length:r),o=Zh(i);return o?{lineStart:n,prefix:i.slice(0,o.prefixLen),indent:o.indent,listType:o.kind,...o.kind==="bullet"?{marker:o.marker}:{number:o.number},contentStart:n+o.prefixLen}:null}function Z7(e,t){const n=Hn(e),r=n.lastIndexOf(`
|
|
285
|
-
`,t-1)+1,i=n.slice(r,t),o=i.match(/^(\s*)[-*] $/);if(!o)return null;const c=`${o[1]}• `,f=r,d=r+i.length;return{segments:or(e,f,d,c),cursorOffset:r+c.length}}function J7(e,t){const n=Hn(e),r=ml(n,t);if(!r)return null;const i=n.indexOf(`
|
|
286
|
-
`,t);if(n.slice(r.contentStart,i===-1?n.length:i).trim()==="")return r.indent>0?{segments:or(e,r.lineStart,r.lineStart+2,""),cursorOffset:Math.max(r.lineStart,t-2)}:{segments:or(e,r.lineStart,r.lineStart+r.prefix.length,""),cursorOffset:r.lineStart};const l=" ".repeat(r.indent);let c;if(r.listType==="bullet")c=`${l}${r.marker??"•"} `;else{const m=(r.number??1)+1;c=`${l}${m}. `}const f=`
|
|
287
|
-
${c}`;return{segments:or(e,t,t,f),cursorOffset:t+f.length}}function ej(e,t){if(t===0)return null;const n=e.lastIndexOf(`
|
|
288
|
-
`,t-2)+1,r=Zh(e.slice(n,t-1));return r?r.indent:null}function tj(e,t){const n=Hn(e),r=ml(n,t);if(!r)return null;const i=ej(n,r.lineStart),o=i===null?0:i+1;return r.indent>=o?null:{segments:or(e,r.lineStart,r.lineStart," "),cursorOffset:t+2}}function nj(e,t){const n=Hn(e),r=ml(n,t);return!r||r.indent===0?null:{segments:or(e,r.lineStart,r.lineStart+2,""),cursorOffset:Math.max(r.lineStart,t-2)}}function rj(e,t){const n=Hn(e),r=ml(n,t);return!r||t>r.contentStart?null:{segments:or(e,r.lineStart,r.contentStart," ".repeat(r.indent)),cursorOffset:r.lineStart+r.indent*2}}const sj=/^\s*```/;function J3(e,t){return t?e.replace(/^(\s*)- /,"$1• "):e.replace(/^(\s*)• /,"$1- ")}function eA(e){const t=new Set;let n=-1;return e.forEach((r,i)=>{if(sj.test(r))if(n===-1)n=i;else{for(let o=n;o<=i;o++)t.add(o);n=-1}}),t}function ij(e,t){const n=e.split(`
|
|
289
|
-
`),r=eA(n);return n.map((i,o)=>r.has(o)?i:J3(i,t)).join(`
|
|
290
|
-
`)}function Y2(e,t){const n=[];e.forEach(c=>{c.type==="text"&&n.push(...c.text.split(`
|
|
291
|
-
`))});const r=eA(n);let i=0,o=!1;const l=e.map(c=>{if(c.type!=="text")return c;const f=c.text.split(`
|
|
292
|
-
`).map(d=>{const m=r.has(i)?d:J3(d,t);return i++,m}).join(`
|
|
293
|
-
`);return f===c.text?c:(o=!0,{...c,text:f})});return o?l:e}function tA(e){let t=null,n=0,r=0,i=0,o=!0;for(const l of e.split(`
|
|
294
|
-
`)){const c=Zh(l);if(c?.kind==="numbered"&&c.indent===t){if(o=o&&c.number===r+1,r=c.number,i++,i>=2&&(n===1||o))return!0}else c?.kind==="numbered"?(t=c.indent,n=c.number,r=c.number,i=1,o=!0):(t=null,i=0)}return!1}function nA(e){if(!/^[ \t]*\d+\. /m.test(e))return{text:e,edits:[]};const t=new Map,n=[],r=e.split(`
|
|
295
|
-
`);let i="",o=0;const l=(c,f)=>{for(const d of t.keys())(f?d>=c:d>c)&&t.delete(d)};for(let c=0;c<r.length;c++){const f=r[c],d=Zh(f);if(!d)t.clear(),i+=f;else if(d.kind==="bullet")l(d.indent,!0),i+=f;else{const m=d.indent;l(m,!1);const p=t.get(m),b=p===void 0?1:p+1;t.set(m,b);const y=String(b);y===String(d.number)?i+=f:(n.push({oldStart:o+d.numberStart,oldEnd:o+d.numberEnd,newText:y}),i+=f.slice(0,d.numberStart)+y+f.slice(d.numberEnd))}c<r.length-1&&(i+=`
|
|
296
|
-
`),o+=f.length+1}return n.length===0?{text:e,edits:n}:{text:i,edits:n}}function G2(e,t){let n=0;for(const r of t)if(r.oldEnd<=e)n+=r.newText.length-(r.oldEnd-r.oldStart);else{if(r.oldStart>=e)break;return r.oldStart+n+Math.min(e-r.oldStart,r.newText.length)}return e+n}function X2(e){const{edits:t}=nA(Hn(e));if(t.length===0)return{segments:e,edits:t};let n=e;for(let r=t.length-1;r>=0;r--){const i=t[r];n=or(n,i.oldStart,i.oldEnd,i.newText)}return{segments:n,edits:t}}function fi(e){return e instanceof HTMLElement}function Xn(e){return e instanceof HTMLElement&&e.dataset.chipTrigger!==void 0}function ph(e){return e instanceof HTMLBRElement}function _c(e){return e instanceof Text}function ib(e){return Xn(e)&&e.dataset.chipAutoResolved==="true"}function aj(e){return e instanceof HTMLAnchorElement&&e.dataset.url==="true"}function oj(e){try{return JSON.parse(e)}catch{return}}function Fd(e){try{return JSON.stringify(e)}catch{return}}function rA(e){if(Xn(e))return e.dataset.chipTrigger}function lj(e){if(Xn(e))return e.dataset.chipValue}function sA(e){if(Xn(e))return e.dataset.chipDisplay??e.textContent??void 0}function uj(e){if(!Xn(e))return;const t=e.dataset.chipData;if(t)return oj(t)}function iA(e){const t=e.dataset.chipTrigger??"",n=e.dataset.chipDisplay??e.textContent??"";return t.length+n.length}function mh(e){if(!Xn(e))return null;const t=rA(e),n=lj(e),r=sA(e);if(!t||n===void 0||!r)return null;const i=uj(e),o=ib(e);return{type:"chip",trigger:t,value:n,displayText:r,...i!==void 0?{data:i}:{},...o?{autoResolved:!0}:{}}}function Vd(e,t){const n=e.childNodes;for(let r=0;r<n.length;r++)if(n[r]===t)return r;return-1}function cj(e){return e.nodeType===Node.TEXT_NODE?(e.textContent??"")!=="":ph(e)?!e.dataset.sentinel:Xn(e)?mh(e)!==null:fi(e)?(e.textContent??"")!=="":!1}function og(e,t){let n=0;for(let r=0;r<t;r++)cj(e.childNodes[r])&&n++;return n}function ab(e,t){let n=t;for(;n!==null;){if(n.parentNode===e)return n;n=n.parentNode}return null}function fj(e,t){const n=document.createDocumentFragment();for(;t.firstChild;)n.appendChild(t.firstChild);n.appendChild(document.createElement("br")),e.replaceChild(n,t)}function ob(e){let t=!1;const n=new Set(["DIV","P","SECTION","ARTICLE","BLOCKQUOTE"]);for(let r=e.childNodes.length-1;r>=0;r--){const i=e.childNodes[r];if(!(i instanceof HTMLElement)||i.dataset.chipTrigger!==void 0||i instanceof HTMLBRElement)continue;const o=i.tagName;if(n.has(o))fj(e,i),t=!0;else if(o==="FONT"||o==="B"||o==="I"||o==="U"||o==="STRONG"||o==="EM"||o==="A"||o==="SPAN"){const l=i.textContent??"";l?e.replaceChild(document.createTextNode(l),i):e.removeChild(i),t=!0}}return e.normalize(),t}const K2=/https?:\/\/[^\s),]+/g;function dj(e){let t=!1;const n=[];for(let r=0;r<e.childNodes.length;r++){const i=e.childNodes[r];_c(i)&&i.textContent&&n.push(i)}for(const r of n){const i=r.textContent??"";K2.lastIndex=0;const o=[];let l;for(;(l=K2.exec(i))!==null;){let p=l[0];for(;p.length>0&&/[.;:!?]$/.test(p);)p=p.slice(0,-1);p.length>0&&o.push({url:p,index:l.index})}if(o.length===0)continue;const c=r.parentNode;if(!c)continue;const f=[];for(const{url:p,index:b}of o)try{const y=new URL(p);(y.protocol==="http:"||y.protocol==="https:")&&f.push({url:p,href:y.href,index:b})}catch{}if(f.length===0)continue;t=!0;const d=document.createDocumentFragment();let m=0;for(const{url:p,href:b,index:y}of f){y>m&&d.appendChild(document.createTextNode(i.slice(m,y)));const E=document.createElement("a");E.href=b,E.target="_blank",E.rel="noopener noreferrer",E.dataset.url="true",E.className="text-accent hover:text-accent-hover underline cursor-pointer",E.textContent=p,d.appendChild(E),m=y+p.length}m<i.length&&d.appendChild(document.createTextNode(i.slice(m))),c.replaceChild(d,r)}return t}const Q2=/(\*{3})(.+?)\*{3}|(\*{2})(.+?)\*{2}|(\*)(.+?)\*/g;function hj(e){let t=!1;const n=[];for(let r=0;r<e.childNodes.length;r++){const i=e.childNodes[r];_c(i)&&i.textContent&&n.push(i)}for(const r of n){const i=r.textContent??"";Q2.lastIndex=0;const o=[];let l;for(;(l=Q2.exec(i))!==null;)l[1]&&l[2]?o.push({fullMatch:l[0],marker:l[1],content:l[2],index:l.index,className:"font-bold italic"}):l[3]&&l[4]?o.push({fullMatch:l[0],marker:l[3],content:l[4],index:l.index,className:"font-bold"}):l[5]&&l[6]&&o.push({fullMatch:l[0],marker:l[5],content:l[6],index:l.index,className:"italic"});if(o.length===0)continue;t=!0;const c=r.parentNode;if(!c)continue;const f=document.createDocumentFragment();let d=0;for(const{fullMatch:m,marker:p,content:b,index:y,className:E}of o){y>d&&f.appendChild(document.createTextNode(i.slice(d,y)));const w=document.createElement("span");w.dataset.md="true";const k=document.createElement("span");k.className="prompt-area-md-marker",k.textContent=p;const C=document.createElement("span");C.className=E,C.textContent=b;const A=document.createElement("span");A.className="prompt-area-md-marker",A.textContent=p,w.appendChild(k),w.appendChild(C),w.appendChild(A),f.appendChild(w),d=y+m.length}d<i.length&&f.appendChild(document.createTextNode(i.slice(d))),c.replaceChild(f,r)}return t}const W2=/(^|\n)([ \t]*)•/g;function pj(e){let t=!1;const n=[];for(let r=0;r<e.childNodes.length;r++){const i=e.childNodes[r];_c(i)&&i.textContent?.includes("•")&&n.push(i)}for(const r of n){const i=r.textContent??"";W2.lastIndex=0;const o=[];let l;for(;(l=W2.exec(i))!==null;)o.push(l.index+l[1].length+l[2].length);if(o.length===0)continue;t=!0;const c=r.parentNode;if(!c)continue;const f=document.createDocumentFragment();let d=0;for(const m of o){m>d&&f.appendChild(document.createTextNode(i.slice(d,m)));const p=document.createElement("span");p.dataset.md="true",p.className="prompt-area-list-bullet",p.textContent="•",f.appendChild(p),d=m+1}d<i.length&&f.appendChild(document.createTextNode(i.slice(d))),c.replaceChild(f,r)}return t}const Z2=/(^|\n)([ \t]+)(?=(?:[•\-*] |\d+\. ))/g;function mj(e){let t=!1;const n=[];for(let r=0;r<e.childNodes.length;r++){const i=e.childNodes[r];_c(i)&&n.push(i)}for(const r of n){const i=r.textContent??"";Z2.lastIndex=0;const o=[];let l;for(;(l=Z2.exec(i))!==null;){const m=l.index+l[1].length;o.push({start:m,end:m+l[2].length})}if(o.length===0)continue;t=!0;const c=r.parentNode;if(!c)continue;const f=document.createDocumentFragment();let d=0;for(const{start:m,end:p}of o){m>d&&f.appendChild(document.createTextNode(i.slice(d,m)));const b=i.slice(m,p),y=Math.floor(b.length/2),E=document.createElement("span");E.dataset.md="true",E.className="prompt-area-list-indent",E.style.width=`calc(var(--prompt-area-indent-size, 1.5em) * ${y})`,E.textContent=b,f.appendChild(E),d=p}d<i.length&&f.appendChild(document.createTextNode(i.slice(d))),c.replaceChild(f,r)}return t}function J2(e,t){t&&(mj(e),pj(e)),dj(e),t&&hj(e)}function ks(){const e=window.getSelection();return!e||e.rangeCount===0?null:e.getRangeAt(0)}function gj(e){const t=ks();if(!t||!e.contains(t.startContainer))return null;const n=t.startContainer;if(n===e)return{nodeIndex:t.startOffset,offset:0};const r=ab(e,n);return r?{nodeIndex:Vd(e,r),offset:t.startOffset}:null}function bj(e,t){const n=window.getSelection();if(!n)return;const r=e.childNodes;if(r.length===0)return;const i=document.createRange();if(t.nodeIndex>=r.length){const o=r[r.length-1];o.nodeType===Node.TEXT_NODE?i.setStart(o,(o.textContent??"").length):i.setStartAfter(o)}else{const o=r[t.nodeIndex];if(o.nodeType===Node.TEXT_NODE){const l=(o.textContent??"").length;i.setStart(o,Math.min(t.offset,l))}else i.setStartAfter(o)}i.collapse(!0),n.removeAllRanges(),n.addRange(i)}function Hi(e){const t=ks();if(!t||!e.contains(t.startContainer))return null;const n=document.createRange();return n.selectNodeContents(e),n.setEnd(t.startContainer,t.startOffset),gh(n)}function xj(e,t){const n=gc(e,t);if(!n)return null;const r=document.createRange();return r.setStart(n.node,n.offset),r.collapse(!0),r}function sr(e,t){const n=window.getSelection();if(!n)return;const r=gc(e,t);if(r){const o=document.createRange();o.setStart(r.node,r.offset),o.collapse(!0),n.removeAllRanges(),n.addRange(o);return}const i=document.createRange();i.selectNodeContents(e),i.collapse(!1),n.removeAllRanges(),n.addRange(i)}function gh(e){const t=e.cloneContents();let n=0;const r=i=>{if(i.nodeType===Node.TEXT_NODE)n+=(i.textContent??"").length;else if(Xn(i))n+=iA(i);else if(fi(i)&&i.tagName==="BR"){if(i.dataset.sentinel)return;n+=1}else fi(i)&&i.childNodes.forEach(r)};return t.childNodes.forEach(r),n}function Ed(e){const t=ks();if(!t||!e.contains(t.startContainer))return null;const n=document.createRange();n.selectNodeContents(e),n.setEnd(t.startContainer,t.startOffset);const r=gh(n);if(t.collapsed)return{start:r,end:r};const i=document.createRange();i.selectNodeContents(e),i.setEnd(t.endContainer,t.endOffset);const o=gh(i);return{start:r,end:o}}function eS(e,t,n){const r=window.getSelection();if(!r)return;if(t===n){sr(e,t);return}const i=gc(e,t),o=gc(e,n);if(!i||!o)return;const l=document.createRange();l.setStart(i.node,i.offset),l.setEnd(o.node,o.offset),r.removeAllRanges(),r.addRange(l)}function gc(e,t){let n=t;for(let r=0;r<e.childNodes.length;r++){const i=e.childNodes[r];if(i.nodeType===Node.TEXT_NODE){const o=(i.textContent??"").length;if(n<=o)return{node:i,offset:n};n-=o}else if(Xn(i)){const o=iA(i);if(n<=o)return{node:e,offset:r+1};n-=o}else if(ph(i)){if(i.dataset.sentinel)continue;if(n<=1)return{node:e,offset:r+1};n-=1}else if(fi(i)){const o=(i.textContent??"").length;if(n<=o){const l=gc(i,n);if(l)return l}n-=o}}return{node:e,offset:e.childNodes.length}}function yj(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function aA(e,t){const n=r=>{r.nodeType===Node.TEXT_NODE?t.onText(r.textContent??""):Xn(r)?t.onChip(r):fi(r)&&r.tagName==="BR"?t.onBreak():r.childNodes.forEach(n)};e.childNodes.forEach(n)}function Ej(e){let t="";return aA(e,{onText:n=>{t+=n},onChip:n=>{t+=(rA(n)??"")+(sA(n)??"")},onBreak:()=>{t+=`
|
|
297
|
-
`}}),t}function Tj(e){const t=[];return aA(e,{onText:n=>{n&&t.push({type:"text",text:n})},onChip:n=>{const r=mh(n);r&&t.push(r)},onBreak:()=>{t.push({type:"text",text:`
|
|
298
|
-
`})}}),t}function vj(e){try{const t=JSON.parse(e);if(!Array.isArray(t))return null;const n=[];for(const r of t){if(!yj(r))return null;if(r.type==="text"&&typeof r.text=="string")n.push({type:"text",text:r.text});else if(r.type==="chip"&&typeof r.trigger=="string"&&typeof r.value=="string"&&typeof r.displayText=="string"){const i={type:"chip",trigger:r.trigger,value:r.value,displayText:r.displayText,...r.data!==void 0?{data:r.data}:{},...r.autoResolved?{autoResolved:!0}:{}};n.push(i)}else return null}return n}catch{return null}}function Sj(e,t,n){const r=ks();if(!r)return[...e,...t];const i=document.createRange();i.selectNodeContents(n),i.setEnd(r.startContainer,r.startOffset);const o=gh(i),l=[];let c=0,f=!1;const d=()=>{f||(l.push(...t),f=!0)};for(const m of e){if(m.type==="chip"){const b=m.trigger.length+m.displayText.length;c>=o&&d(),l.push(m),c+=b;continue}const p=c+m.text.length;if(p<=o)l.push(m);else if(c>=o)d(),l.push(m);else{const b=o-c,y=m.text.slice(0,b),E=m.text.slice(b);y&&l.push({type:"text",text:y}),d(),E&&l.push({type:"text",text:E})}c=p}return d(),Sl(l)}function lg(e,t){const n=new RegExp(`(?:^|;)\\s*${t}\\s*:\\s*([^;]+)`,"i").exec(e);return n?n[1].trim().toLowerCase():""}function Cj(e){if(e==="bold"||e==="bolder")return!0;const t=Number.parseInt(e,10);return!Number.isNaN(t)&&t>=600}function wj(e){const t=e.tagName,n=e.getAttribute("style")??"",r=lg(n,"font-weight"),i=r?Cj(r):t==="B"||t==="STRONG",o=lg(n,"font-style"),l=o?o==="italic"||o==="oblique":t==="I"||t==="EM",c=lg(n,"text-decoration"),f=t==="S"||t==="DEL"||t==="STRIKE"||c.includes("line-through"),d=(f?"~~":"")+(i?"**":"")+(l?"*":""),m=(l?"*":"")+(i?"**":"")+(f?"~~":"");return{prefix:d,suffix:m}}function kj(e){return e.replace(/\s+/g," ")}function Aj(e){return e.replace(/\*/g,"\\*")}function _j(e){const t=e.querySelector("code"),n=`${e.className} ${t?.className??""}`,r=/(?:language|lang)-([\w-]+)/.exec(n);return r?r[1]:e.getAttribute("lang")??t?.getAttribute("lang")??""}function Nj(e){const t=_j(e),n=(e.textContent??"").replace(/\n$/,"");return`
|
|
299
|
-
|
|
300
|
-
\`\`\`${t}
|
|
301
|
-
${n}
|
|
302
|
-
\`\`\`
|
|
303
|
-
|
|
304
|
-
`}function Rj(e){const t=e.textContent??"";return t.includes("`")?`\`\` ${t} \`\``:`\`${t}\``}function oA(e){return/^(https?:|mailto:)/i.test(e)}function Oj(e,t){const n=e.getAttribute("href")??"",r=ni(e,t).trim();return oA(n)?!r||r===n?n:`[${r}](${n})`:r}function Ij(e){const t=e.getAttribute("src")??"";return!t||!oA(t)?"":``}function Lj(e,t){return`
|
|
305
|
-
|
|
306
|
-
${ni(e,t).trim().split(`
|
|
307
|
-
`).map(i=>i?`> ${i}`:">").join(`
|
|
308
|
-
`)}
|
|
309
|
-
|
|
310
|
-
`}function lA(e,t){const n=e.tagName==="OL",r=Number.parseInt(e.getAttribute("start")??"",10);let i=Number.isNaN(r)?1:r;const o=" ".repeat(t),l=[];for(const c of Array.from(e.childNodes)){if(!fi(c)||c.tagName!=="LI")continue;const f=n?`${i}. `:"- ";i++;let d="",m="";for(const p of Array.from(c.childNodes))fi(p)&&(p.tagName==="UL"||p.tagName==="OL")?m+=`
|
|
311
|
-
${lA(p,t+1)}`:d+=uA(p,t);l.push(`${o}${f}${d.trim()}${m}`)}return l.join(`
|
|
312
|
-
`)}function Mj(e,t){const n=Array.from(e.querySelectorAll("tr"));if(n.length===0)return"";const r=n.map(c=>Array.from(c.children).filter(f=>f.tagName==="TD"||f.tagName==="TH").map(f=>ni(f,t).replace(/\n+/g," ").replace(/\|/g,"\\|").trim())),i=r[0],o=i.map(()=>"---"),l=c=>`| ${c.join(" | ")} |`;return[l(i),l(o),...r.slice(1).map(l)].join(`
|
|
313
|
-
`)}function ni(e,t){let n="";return e.childNodes.forEach(r=>{n+=uA(r,t)}),n}function uA(e,t){if(_c(e))return Aj(kj(e.textContent??""));if(!fi(e))return"";const n=e.tagName;switch(n){case"SCRIPT":case"STYLE":case"NOSCRIPT":case"HEAD":case"TITLE":return"";case"BR":return`
|
|
314
|
-
`;case"HR":return`
|
|
315
|
-
|
|
316
|
-
---
|
|
317
|
-
|
|
318
|
-
`;case"H1":case"H2":case"H3":case"H4":case"H5":case"H6":return`
|
|
319
|
-
|
|
320
|
-
${"#".repeat(Number(n[1]))} ${ni(e,t).trim()}
|
|
321
|
-
|
|
322
|
-
`;case"P":return`
|
|
323
|
-
|
|
324
|
-
${ni(e,t).trim()}
|
|
325
|
-
|
|
326
|
-
`;case"DIV":return`
|
|
327
|
-
${ni(e,t).trim()}
|
|
328
|
-
`;case"BLOCKQUOTE":return Lj(e,t);case"UL":case"OL":return`
|
|
329
|
-
|
|
330
|
-
${lA(e,t)}
|
|
331
|
-
|
|
332
|
-
`;case"LI":return`${ni(e,t).trim()}
|
|
333
|
-
`;case"PRE":return Nj(e);case"CODE":return Rj(e);case"A":return Oj(e,t);case"IMG":return Ij(e);case"TABLE":return`
|
|
334
|
-
|
|
335
|
-
${Mj(e,t)}
|
|
336
|
-
|
|
337
|
-
`;default:{const{prefix:r,suffix:i}=wj(e);return r+ni(e,t)+i}}}function Dj(e){return e.replace(/[ \t]+\n/g,`
|
|
338
|
-
`).replace(/\n[ \t]*\n[ \t\n]*/g,`
|
|
339
|
-
|
|
340
|
-
`).trim()}function Pj(e){if(!e)return"";const t=new DOMParser().parseFromString(e,"text/html");return t.body?Dj(ni(t.body,0)):""}const jj=100,cA=150;function Bj(e){const{editorRef:t,readSegmentsFromDOM:n,onChange:r,renderSegmentsToDOM:i,runTriggerDetection:o,dismissTrigger:l,triggers:c,markdownEnabled:f,normalizeBullets:d,onPaste:m,onUndo:p,onRedo:b,onChipAdd:y,onImagePaste:E,onRawPaste:w}=e,k=S.useRef(!1),C=S.useRef({undoStack:[],redoStack:[]}),A=S.useCallback(G=>{const ee=C.current;ee.undoStack.push(G),ee.undoStack.length>jj&&ee.undoStack.shift(),ee.redoStack=[]},[]),_=S.useCallback(()=>{C.current={undoStack:[],redoStack:[]}},[]),N=S.useCallback(G=>{if(w?.(G),G.defaultPrevented)return;G.preventDefault();const ee=t.current;if(!ee)return;const Y=Array.from(G.clipboardData.files).find(ie=>ie.type.startsWith("image/"))??(Array.from(G.clipboardData.items).find(fe=>fe.type.startsWith("image/"))?.getAsFile()??null);if(Y){E?.(Y);return}const H=n();A(H);const K=G.clipboardData.getData("text/prompt-area-segments");if(K){const ie=vj(K);if(ie&&ie.length>0){const fe=ks();if(!fe)return;fe.deleteContents();const de=n(),he=Sj(de,ie,ee);r(he),i(he),m?.({segments:he,source:"internal"});for(const ve of ie)ve.type==="chip"&&y?.(ve);o();return}}let te="";if(f)if(te=G.clipboardData.getData("text/markdown"),te)te=te.replace(/\\([()])/g,"$1");else{const ie=G.clipboardData.getData("text/html");if(ie)try{te=Pj(ie)}catch{te=""}}if(te||(te=G.clipboardData.getData("text/plain")),!te)return;f&&d&&(te=ij(te,!0)),f&&tA(te)&&(te=nA(te).text);const le=ks();if(!le)return;le.deleteContents();const I=te.split(`
|
|
341
|
-
`),P=document.createDocumentFragment();for(let ie=0;ie<I.length;ie++)I[ie]&&P.appendChild(document.createTextNode(I[ie])),ie<I.length-1&&P.appendChild(document.createElement("br"));le.insertNode(P),le.collapse(!1);const $=window.getSelection();$?.removeAllRanges(),$?.addRange(le),ob(ee);const L=n(),ae=X7(L,c);if(ae!==L){r(ae),i(ae);for(const ie of ae)ie.type==="chip"&&!L.some(fe=>fe.type==="chip"&&fe.trigger===ie.trigger&&fe.value===ie.value&&fe.displayText===ie.displayText)&&y?.(ie)}else r(L);m?.({segments:ae,source:"external"}),o()},[t,n,r,A,o,i,c,f,d,m,y,E,w]),D=S.useCallback(G=>{G.preventDefault();const ee=ks();if(!ee)return;const Y=ee.cloneContents(),H=Ej(Y);G.clipboardData.setData("text/plain",H);const K=Tj(Y);if(K.some(le=>le.type==="chip")){const le=Fd(K);le&&G.clipboardData.setData("text/prompt-area-segments",le)}},[]),O=S.useCallback(G=>{D(G);const ee=ks();if(!ee)return;const Y=n();A(Y),ee.deleteContents();const H=t.current;H&&ob(H);const K=n();r(K),o()},[D,t,n,r,A,o]),j=S.useCallback(G=>{G.preventDefault()},[]),M=S.useCallback(G=>{G.preventDefault()},[]),q=S.useCallback(()=>{k.current=!0},[]),U=S.useCallback(()=>{k.current=!1,o()},[o]),Q=S.useCallback(()=>{setTimeout(()=>{const G=t.current;if(!G)return;const ee=document.activeElement;ee&&G.parentElement?.contains(ee)||l()},cA)},[t,l]),Z=S.useCallback(G=>{if(!(G.metaKey||G.ctrlKey)||G.key!=="z")return!1;G.preventDefault();const Y=C.current;if(G.shiftKey){if(Y.redoStack.length===0)return!0;const H=Y.redoStack.pop();if(!H)return!0;const K=n();Y.undoStack.push(K),r(H),i(H),b?.(H)}else{if(Y.undoStack.length===0)return!0;const H=Y.undoStack.pop();if(!H)return!0;const K=n();Y.redoStack.push(K),r(H),i(H),p?.(H)}return!0},[n,r,i,p,b]);return{handlePaste:N,handleCopy:D,handleCut:O,handleDrop:j,handleDragOver:M,handleCompositionStart:q,handleCompositionEnd:U,handleBlur:Q,handleKeyDownForUndoRedo:Z,pushUndo:A,resetUndoHistory:_,isComposing:k}}function Hj(){const[e,t]=S.useState([]),[n,r]=S.useState(!1),[i,o]=S.useState(null),l=S.useRef(0),c=S.useRef(null),f=S.useRef(null),d=S.useCallback(()=>{c.current?.abort(),f.current&&clearTimeout(f.current),t([]),r(!1),o(null)},[]),m=S.useCallback((p,b)=>{if(!b.onSearch)return;c.current?.abort(),f.current&&clearTimeout(f.current),r(!0),o(null),l.current++;const y=l.current,E=new AbortController;c.current=E;const{onSearch:w,onSearchError:k,searchDebounceMs:C}=b,A=()=>{const _=w(p,{signal:E.signal});_ instanceof Promise?_.then(N=>{E.signal.aborted||l.current!==y||(t(N),r(!1))},N=>{E.signal.aborted||l.current!==y||N instanceof DOMException&&N.name==="AbortError"||(o(N instanceof Error?N.message:"Search failed"),r(!1),k?.(N))}):(t(_),r(!1))};C&&C>0&&p.length>0?f.current=setTimeout(A,C):A()},[]);return S.useEffect(()=>()=>{c.current?.abort(),f.current&&clearTimeout(f.current)},[]),{suggestions:e,suggestionsLoading:n,suggestionsError:i,search:m,reset:d}}const Uj=300;function zj({value:e,onChange:t,triggers:n=[],disabled:r=!1,onSubmit:i,onEscape:o,onChipClick:l,onChipAdd:c,onChipDelete:f,onLinkClick:d,onPaste:m,onRawPaste:p,onUndo:b,onRedo:y,onImagePaste:E,markdown:w=!0,normalizeBullets:k=!0,submitOnEnter:C=!0,maxLength:A}){const _=S.useRef(null),[N,D]=S.useState(null),[O,j]=S.useState(0),[M,q]=S.useState(null),U=S.useRef(null),Q=S.useRef(null),Z=S.useRef(null),{suggestions:G,suggestionsLoading:ee,suggestionsError:Y,search:H,reset:K}=Hj(),te=S.useRef(!1),le=S.useRef([]),I=S.useRef(null),P=S.useRef(null),$=S.useCallback(()=>{const W=_.current;if(!W)return[];const me=[];let se=!1,re=!1;for(let V=0;V<W.childNodes.length;V++){const z=W.childNodes[V];if(z.nodeType===Node.TEXT_NODE){const ue=z.textContent??"";ue&&(me.push({type:"text",text:ue}),se=!0)}else if(Xn(z)){const ue=mh(z);ue&&(me.push(ue),se=!0)}else if(ph(z)){if(z.dataset.sentinel){re=!0;continue}me.push({type:"text",text:`
|
|
342
|
-
`})}else if(fi(z)){const ue=z.textContent??"";ue&&(me.push({type:"text",text:ue}),se=!0)}}return!se&&!re?[]:me},[]),L=S.useCallback(W=>{const me=_.current;if(!me)return;te.current=!0;const se=gj(me);for(;me.firstChild;)me.removeChild(me.firstChild);for(const re of W)if(re.type==="text"){const V=re.text.split(`
|
|
343
|
-
`);for(let z=0;z<V.length;z++)V[z]&&me.appendChild(document.createTextNode(V[z])),z<V.length-1&&me.appendChild(document.createElement("br"))}else{const V=document.createElement("span");if(V.contentEditable="false",V.dataset.chipTrigger=re.trigger,V.dataset.chipValue=re.value,V.dataset.chipDisplay=re.displayText,re.data!==void 0){const ke=Fd(re.data);ke&&(V.dataset.chipData=ke)}re.autoResolved&&(V.dataset.chipAutoResolved="true");const z=n.find(ke=>ke.char===re.trigger),ue=z?.chipStyle??"pill";V.dataset.chipStyle=ue,V.className=He("prompt-area-chip",ue==="inline"&&"prompt-area-chip--inline",z?.chipClassName),V.textContent=`${re.trigger}${re.displayText}`,V.setAttribute("role","button"),V.setAttribute("tabindex","-1"),me.appendChild(V)}if(me.lastChild&&ph(me.lastChild)){const re=document.createElement("br");re.dataset.sentinel="true",me.appendChild(re)}J2(me,w),se&&bj(me,se),le.current=W,te.current=!1},[n,w]),ae=S.useCallback((W,me)=>se=>{const re=ag(W,me,{value:se.value,displayText:se.displayText,data:se.data});t(re.segments),L(re.segments),c?.({type:"chip",trigger:me.config.char,value:se.value,displayText:se.displayText,...se.data!==void 0?{data:se.data}:{}});const V=_.current;V&&sr(V,re.cursorOffset)},[t,L,c]),ie=S.useCallback(()=>{const W=_.current;if(!W)return;const me=$(),se=Hn(me),re=Hi(W);if(re===null)return;const V=q7(se,re,n);if(U.current=null,Q.current=null,V){D(V),j(0);const z=xj(W,V.startOffset);if(z){const ue=z.getBoundingClientRect();(ue.height>0||ue.left>0||ue.top>0)&&q(ue)}V.config.mode==="dropdown"&&V.config.onSearch&&H(V.query,V.config),V.config.mode==="callback"&&V.config.onActivate&&V.config.onActivate({text:se,cursorPosition:re,insertChip:ae(me,V)})}else D(null),K()},[n,$,ae,K,H]),fe=S.useCallback(()=>{U.current=null,Q.current=null,D(null),j(0),K()},[K]),de=Bj({editorRef:_,readSegmentsFromDOM:$,onChange:t,renderSegmentsToDOM:L,runTriggerDetection:ie,dismissTrigger:fe,triggers:n,markdownEnabled:w,normalizeBullets:k,onPaste:m,onRawPaste:p,onUndo:b,onRedo:y,onChipAdd:c,onImagePaste:E});S.useEffect(()=>{if(!te.current&&!W7(e,le.current)){if(w&&k){const W=Y2(e,!0);if(W!==e){t(W);return}}L(e)}},[e,L,w,k,t]);const he=S.useRef(w);S.useEffect(()=>{if(he.current===w)return;he.current=w;const W=k?Y2(e,w):e;W!==e?t(W):L(e)},[w,k,L,e,t]),S.useEffect(()=>()=>{I.current&&clearTimeout(I.current)},[]);const ve=S.useCallback(()=>{if(te.current)return;if(de.isComposing.current){const z=$();le.current=z,t(z);return}const W=_.current,me=W?Hi(W):null;W&&ob(W);const se=$();if(A!=null&&W&&Hn(se).length>A){const z=Hi(W),ue=$7(se,A);le.current=ue,t(ue),L(ue),sr(W,z!=null?Math.min(z,A):A),ie();return}if(w&&k&&W&&me!==null){const z=Z7(se,me);if(z){le.current=z.segments,t(z.segments),L(z.segments),sr(W,z.cursorOffset),ie();return}}let re=se,V=null;if(w&&me!==null&&tA(Hn(se))){const z=X2(se);z.edits.length>0&&(re=z.segments,V=G2(me,z.edits))}P.current||(P.current=le.current),le.current=re,t(re),I.current&&clearTimeout(I.current),I.current=setTimeout(()=>{P.current&&(de.pushUndo(P.current),P.current=null),I.current=null},Uj),W&&(V!==null?(L(re),sr(W,V)):(J2(W,w),me!==null&&sr(W,me))),ie()},[t,$,ie,L,w,k,A,de]),Ue=S.useCallback(W=>{const me=W.target;if(!(me instanceof Node))return;const se=_.current;if(!se)return;let re=me;for(;re&&re!==se;){if(aj(re)){if(W.metaKey||W.ctrlKey){W.preventDefault(),d?.(re.href),window.open(re.href,"_blank","noopener,noreferrer");return}break}if(Xn(re)){const V=re.getBoundingClientRect(),z=document.createElement("span");z.className="prompt-area-chip-ripple";const ue=Math.max(V.width,V.height);z.style.width=`${ue}px`,z.style.height=`${ue}px`,z.style.left=`${W.clientX-V.left-ue/2}px`,z.style.top=`${W.clientY-V.top-ue/2}px`,re.appendChild(z),z.addEventListener("animationend",()=>z.remove());const ke=mh(re);if(ke){const Re=n.find(rt=>rt.char===ke.trigger),qe=Z.current===re;if(Z.current=null,!r&&!qe&&Re?.reopenOnChipClick&&Re.mode==="dropdown"&&Re.onSearch){const rt=Vd(se,re);U.current={chip:ke,segIndex:og(se,rt)},Q.current=re,D({config:Re,startOffset:0,query:""}),j(0),q(V),H("",Re)}l?.(ke)}return}re=re.parentNode}},[l,d,n,H,r]),Pe=S.useCallback(W=>{const me=W.target,se=_.current;if(!se||!(me instanceof Node)){Z.current=null;return}let re=me;for(;re&&re!==se;){if(Xn(re)){Z.current=Q.current===re?re:null;return}re=re.parentNode}Z.current=null},[]),Te=S.useCallback((W,me)=>{const se=$(),re=Vd(W,me);if(re===-1)return!1;const V=og(W,re),z=se[V],ue=Y7(se,V);return t(ue),L(ue),z?.type==="chip"&&f?.(z),!0},[$,t,L,f]),Ie=S.useCallback((W,me)=>{const se=$(),re=Vd(W,me);if(re===-1)return!1;const V=og(W,re),z=se[V],ue=G7(se,V);if(!ue)return!1;let ke=0;for(let Re=0;Re<V;Re++){const qe=se[Re];qe.type==="text"?ke+=qe.text.length:ke+=qe.trigger.length+qe.displayText.length}return ke+=ue.revertedText.length,t(ue.segments),L(ue.segments),sr(W,ke),z?.type==="chip"&&f?.(z),!0},[$,t,L,f]),je=S.useCallback(()=>{const W=_.current;if(!W)return!1;const me=ks();if(!me||!me.collapsed)return!1;const se=me.startContainer,re=me.startOffset;if(se===W&&re>0){const V=W.childNodes[re-1];if(V&&Xn(V))return ib(V)?Ie(W,V):Te(W,V)}if(se.nodeType===Node.TEXT_NODE&&re===0){const V=ab(W,se);if(!V)return!1;let z=V.previousSibling;for(;z&&z.nodeType===Node.TEXT_NODE&&z.textContent==="";)z=z.previousSibling;if(z&&Xn(z))return ib(z)?Ie(W,z):Te(W,z)}return!1},[Te,Ie]),We=S.useCallback(()=>{const W=_.current;if(!W)return!1;const me=ks();if(!me||!me.collapsed)return!1;const se=me.startContainer,re=me.startOffset;if(se===W&&re<W.childNodes.length){const V=W.childNodes[re];if(V&&Xn(V))return Te(W,V)}if(se.nodeType===Node.TEXT_NODE&&re===(se.textContent??"").length){const V=ab(W,se);if(!V)return!1;let z=V.nextSibling;for(;z&&z.nodeType===Node.TEXT_NODE&&z.textContent==="";)z=z.nextSibling;if(z&&Xn(z))return Te(W,z)}return!1},[Te]),Xe=S.useCallback(W=>{const me=$(),se=W.query,re={value:se,label:se},V=W.config.onSelect?.(re)??se,z={value:se,displayText:V||se,autoResolved:!0},ue=ag(me,W,z);t(ue.segments),L(ue.segments),c?.({type:"chip",trigger:W.config.char,...z});const ke=_.current;ke&&sr(ke,ue.cursorOffset),fe()},[$,t,L,fe,c]),Me=S.useCallback(W=>{if(!N)return;const me=$(),se=N.config.onSelect?.(W)??W.label,re={value:W.value,displayText:se||W.label,data:W.data},V=U.current;if(V){const ke=_.current;if(ke&&!r){const Re=me[V.segIndex],rt=Re?.type==="chip"&&Re.trigger===V.chip.trigger&&Re.value===V.chip.value?V.segIndex:(()=>{const ot=[];return me.forEach((ut,Fe)=>{ut.type==="chip"&&ut.trigger===V.chip.trigger&&ut.value===V.chip.value&&ot.push(Fe)}),ot.length===1?ot[0]:-1})(),et=rt!==-1?me[rt]:void 0;if(et?.type==="chip"){const ot={type:"chip",trigger:N.config.char,...re};let ut=me.map((Ot,Qt)=>Qt===rt?ot:Ot);const Fe=ut[rt+1],Dt=!Fe||Fe.type!=="text"||Fe.text.length===0;Dt&&(ut=[...ut.slice(0,rt+1),{type:"text",text:" "},...ut.slice(rt+1)]),de.pushUndo(me),t(ut),L(ut),et.value===ot.value&&et.displayText===ot.displayText&&Fd(et.data)===Fd(ot.data)||(f?.(et),c?.(ot));const at=Hn(ut.slice(0,rt+1)).length+(Dt?1:0);sr(ke,at)}}fe(),setTimeout(()=>{_.current?.focus()},0);return}const z=ag(me,N,re);t(z.segments),L(z.segments),c?.({type:"chip",trigger:N.config.char,...re});const ue=_.current;ue&&sr(ue,z.cursorOffset),fe(),setTimeout(()=>{_.current?.focus()},0)},[N,$,t,L,fe,c,f,de,r]),Ce=Me;S.useEffect(()=>{const W=U.current;if(!W||!N?.config.reopenOnChipClick)return;const me=G.findIndex(se=>se.value===W.chip.value);me>0&&j(me)},[G,N]);const we=S.useCallback(W=>{const me=(z,ue)=>{let{segments:ke,cursorOffset:Re}=ue;if(w){const qe=X2(ke);ke=qe.segments,Re=G2(Re,qe.edits)}le.current=ke,t(ke),L(ke),sr(z,Re)},se=z=>{if(!w)return!1;const ue=$(),ke=Hi(z);if(ke===null)return!1;const Re=Hn(ue);if(!ml(Re,ke))return!1;const qe=J7(ue,ke);return qe&&me(z,qe),!0};if((W.metaKey||W.ctrlKey)&&W.key==="z"&&P.current&&(I.current&&(clearTimeout(I.current),I.current=null),de.pushUndo(P.current),P.current=null),de.handleKeyDownForUndoRedo(W))return;if(w&&(W.metaKey||W.ctrlKey)&&!W.shiftKey&&(W.key==="b"||W.key==="i")){W.preventDefault();const z=_.current;if(!z)return;const ue=Ed(z);if(!ue||ue.start===ue.end)return;const ke=W.key==="b"?"**":"*",Re=$();de.pushUndo(Re);const qe=Q7(Re,ue.start,ue.end,ke);if(!qe)return;le.current=qe.segments,t(qe.segments),L(qe.segments),eS(z,qe.selectionStart,qe.selectionEnd);return}if(!W.metaKey&&!W.ctrlKey&&!W.altKey&&!W.nativeEvent.isComposing&&W.key.length===1){const z=n.find(ke=>ke.mode==="launch"&&ke.char===W.key),ue=_.current;if(z?.onActivate&&ue){const ke=Hi(ue);if(ke!==null){const Re=$(),qe=Hn(Re);if(hh(qe,ke,z.position)){W.preventDefault(),z.onActivate({text:qe,cursorPosition:ke,insertChip:ae(or(Re,ke,ke,z.char),{config:z,startOffset:ke,query:""})});return}}}}if(N&&N.config.mode==="dropdown"&&(G.length>0||ee||Y!==null||!!N.config.emptyMessage)){if(W.key==="ArrowDown"){W.preventDefault(),G.length>0&&j(z=>Math.min(z+1,G.length-1));return}if(W.key==="ArrowUp"){W.preventDefault(),G.length>0&&j(z=>Math.max(z-1,0));return}if(W.key==="Enter"||W.key==="Tab"){W.preventDefault();const z=G[O];z&&Me(z);return}if(W.key==="Escape"){W.preventDefault(),fe();return}}if(W.key===" "&&N&&N.config.resolveOnSpace&&N.query.trim().length>0){W.preventDefault(),Xe(N);return}if(w&&W.key==="Tab"&&!N){const z=_.current;if(z){const ue=$(),ke=Hn(ue),Re=Hi(z);if(Re!==null&&ml(ke,Re)){W.preventDefault();const rt=W.shiftKey?nj(ue,Re):tj(ue,Re);rt&&me(z,rt);return}}}const V=z=>{const ue=Ed(z);if(!ue)return;const ke=$();de.pushUndo(ke);const Re=or(ke,ue.start,ue.end,`
|
|
344
|
-
`);me(z,{segments:Re,cursorOffset:ue.start+1})};if(W.key==="Enter"&&W.shiftKey&&!W.nativeEvent.isComposing){W.preventDefault();const z=_.current;z&&!se(z)&&V(z);return}if(W.key==="Enter"&&!W.shiftKey&&!W.nativeEvent.isComposing){const z=_.current;if(z&&se(z)){W.preventDefault();return}if(C){W.preventDefault(),i?.($());return}W.preventDefault(),z&&V(z);return}if(W.key==="Escape"&&o){o();return}if((W.key==="Backspace"||W.key==="Delete")&&!W.nativeEvent.isComposing){const z=_.current;if(z){const ue=Ed(z);if(ue&&ue.start!==ue.end){W.preventDefault();const ke=$();de.pushUndo(ke);const Re=or(ke,ue.start,ue.end,"");me(z,{segments:Re,cursorOffset:ue.start}),ie();return}}}if(W.key==="Backspace"){const z=_.current;if(z){const ue=$(),ke=Hi(z);if(w&&ke!==null){const Re=rj(ue,ke);if(Re){W.preventDefault(),me(z,Re),ie();return}}}if(je()){W.preventDefault(),ie();return}}if(W.key==="Delete"&&We()){W.preventDefault(),ie();return}},[N,G,ee,Y,O,i,C,o,$,t,L,w,fe,je,We,Xe,ie,Me,de,n,ae]),Be=S.useMemo(()=>({focus:()=>_.current?.focus(),blur:()=>_.current?.blur(),insertChip:W=>{const me=$(),se={type:"chip",...W},re=[...me,se,{type:"text",text:" "}];t(re),L(re),c?.(se)},getPlainText:()=>Hn($()),clear:()=>{t([]);const W=_.current;if(W)for(;W.firstChild;)W.removeChild(W.firstChild);de.resetUndoHistory(),I.current&&(clearTimeout(I.current),I.current=null),P.current=null},setText:W=>{de.pushUndo($());const me=V7(W);t(me),L(me);const se=_.current;se&&sr(se,W.length)},appendText:W=>{const me=$();de.pushUndo(me);const se=me[me.length-1],re=se?.type==="text"?[...me.slice(0,-1),{type:"text",text:se.text+W}]:[...me,{type:"text",text:W}];t(re),L(re);const V=_.current;V&&sr(V,Hn(re).length)},getCursorPosition:()=>{const W=_.current;return W?Hi(W):null},setCursorPosition:W=>{const me=_.current;me&&sr(me,W)},setCursorToEnd:()=>{const W=_.current;W&&sr(W,Hn($()).length)},getSelection:()=>{const W=_.current;return W?Ed(W):null},setSelection:(W,me)=>{const se=_.current;se&&eS(se,W,me)}}),[$,t,L,c,de]),$e=S.useMemo(()=>({onPaste:de.handlePaste,onCopy:de.handleCopy,onCut:de.handleCut,onDrop:de.handleDrop,onDragOver:de.handleDragOver,onCompositionStart:de.handleCompositionStart,onCompositionEnd:de.handleCompositionEnd,onBlur:de.handleBlur}),[de.handlePaste,de.handleCopy,de.handleCut,de.handleDrop,de.handleDragOver,de.handleCompositionStart,de.handleCompositionEnd,de.handleBlur]);return{editorRef:_,activeTrigger:N,suggestions:G,suggestionsLoading:ee,suggestionsError:Y,selectedSuggestionIndex:O,handleInput:ve,handleKeyDown:we,handleClick:Ue,handleMouseDown:Pe,selectSuggestion:Ce,dismissTrigger:fe,handle:Be,triggerRect:M,eventHandlers:$e}}const tS=240;function Fj({suggestions:e,loading:t,error:n,emptyMessage:r,selectedIndex:i,onSelect:o,onDismiss:l,triggerRect:c,triggerChar:f}){const d=S.useRef(null),m=S.useRef(null);if(S.useEffect(()=>{m.current?.scrollIntoView({block:"nearest"})},[i]),S.useEffect(()=>{const k=C=>{const A=C.target;d.current&&A instanceof Node&&!d.current.contains(A)&&l()};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[l]),!c||e.length===0&&!t&&!n&&!r)return null;const p=Math.min(320,window.innerWidth-16),b=Math.min(c.left,window.innerWidth-p-8),y=window.innerHeight-c.bottom,E=y<tS&&c.top>y,w={position:"fixed",left:`${Math.max(8,b)}px`,zIndex:50,maxWidth:`${p}px`,maxHeight:`${tS}px`,...E?{bottom:`${window.innerHeight-c.top+4}px`}:{top:`${c.bottom+4}px`}};return g.jsx("div",{ref:d,className:He("min-w-[200px] overflow-y-auto","bg-surface rounded-xl border p-2 shadow-md","animate-in fade-in-0 zoom-in-95"),style:w,role:"listbox","aria-label":`${f} suggestions`,children:t?g.jsx("div",{role:"option","aria-selected":!1,className:"text-muted-foreground px-3 py-2 text-sm",children:"Loading suggestions..."}):n?g.jsx("div",{role:"option","aria-selected":!1,className:"text-destructive px-3 py-2 text-sm",children:n}):e.length===0&&r?g.jsx("div",{role:"option","aria-selected":!1,className:"text-muted-foreground px-3 py-2 text-sm",children:r}):e.map((k,C)=>g.jsxs("button",{ref:C===i?m:void 0,type:"button",role:"option","aria-selected":C===i,className:He("text-foreground flex w-full items-start gap-2 rounded-lg px-3 py-2 text-left text-sm","hover:bg-surface-hover cursor-pointer transition-colors",C===i&&"bg-surface-hover"),onMouseDown:A=>{A.preventDefault(),o(k)},children:[k.icon&&g.jsx("span",{className:"mt-0.5 shrink-0",children:k.icon}),g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsx("div",{className:"truncate font-medium",children:k.label}),k.description&&g.jsx("div",{className:"text-muted-foreground truncate text-xs",children:k.description})]})]},k.value))})}function Vj({texts:e,interval:t=3e3}){const[n,r]=S.useState(0);return S.useEffect(()=>{if(e.length<=1)return;const i=setInterval(()=>{r(o=>(o+1)%e.length)},t);return()=>clearInterval(i)},[e.length,t]),g.jsx("div",{className:"pointer-events-none absolute top-0 left-0 overflow-hidden select-none",style:{color:"var(--prompt-area-placeholder, var(--muted-foreground))"},"aria-hidden":"true",children:g.jsx("div",{className:"animate-in fade-in-0 slide-in-from-top-4 duration-300 ease-in-out",children:e[n]},n)})}function fA({onClick:e,label:t,className:n}){return g.jsx("button",{type:"button",onClick:r=>{r.stopPropagation(),e()},className:He("absolute top-0.5 right-0.5 grid h-3.5 w-3.5 cursor-pointer place-items-center","rounded-full bg-black/60 text-white hover:bg-black/80 dark:bg-white/60 dark:text-black dark:hover:bg-white/80","transition-colors",n),"aria-label":t,children:g.jsxs("svg",{width:"8",height:"8",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",children:[g.jsx("line",{x1:"2.75",y1:"2.75",x2:"7.25",y2:"7.25"}),g.jsx("line",{x1:"7.25",y1:"2.75",x2:"2.75",y2:"7.25"})]})})}function $j({images:e,onRemove:t,onClick:n,className:r}){return e.length===0?null:g.jsx("div",{className:He("flex flex-wrap gap-2",r),role:"list","aria-label":"Attached images",children:e.map(i=>g.jsxs("div",{role:"listitem",className:He("border-border relative h-16 w-16 flex-shrink-0 overflow-hidden rounded-md border",n&&"cursor-pointer"),onClick:()=>n?.(i),children:[g.jsx("img",{src:i.url,alt:i.alt??"Attached image",className:"h-full w-full object-cover"}),i.loading&&g.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/40",children:g.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent"})}),t&&g.jsx(fA,{onClick:()=>t(i),label:`Remove ${i.alt??"image"}`})]},i.id))})}function Nc({className:e,children:t}){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e,children:t})}const Jh=g.jsxs(g.Fragment,{children:[g.jsx("path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}),g.jsx("path",{d:"M14 2v5a1 1 0 0 0 1 1h5"})]}),qj=({className:e})=>g.jsx(Nc,{className:e,children:Jh}),Yj=({className:e})=>g.jsxs(Nc,{className:e,children:[Jh,g.jsx("path",{d:"M10 9H8"}),g.jsx("path",{d:"M16 13H8"}),g.jsx("path",{d:"M16 17H8"})]}),Gj=({className:e})=>g.jsxs(Nc,{className:e,children:[Jh,g.jsx("path",{d:"M8 13h2"}),g.jsx("path",{d:"M14 13h2"}),g.jsx("path",{d:"M8 17h2"}),g.jsx("path",{d:"M14 17h2"})]}),Xj=({className:e})=>g.jsxs(Nc,{className:e,children:[Jh,g.jsx("path",{d:"M10 12.5 8 15l2 2.5"}),g.jsx("path",{d:"m14 12.5 2 2.5-2 2.5"})]}),Kj=({className:e})=>g.jsxs(Nc,{className:e,children:[g.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}),g.jsx("circle",{cx:"9",cy:"9",r:"2"}),g.jsx("path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"})]}),Td=3;function Qj(e){return e?e==="application/pdf"?"pdf":e.includes("spreadsheet")||e==="text/csv"?"spreadsheet":e.startsWith("text/")||e.includes("javascript")||e.includes("json")||e.includes("xml")?"code":e.startsWith("image/")?"image":"default":"default"}const Wj={pdf:Yj,spreadsheet:Gj,code:Xj,image:Kj,default:qj};function Zj(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(1)} GB`}function Jj(e){const t=e.lastIndexOf(".");return t===-1||t===e.length-1?null:e.slice(t+1).toUpperCase()}function nS({file:e,compact:t,onRemove:n,onClick:r}){const i=Jj(e.name),o=e.size!=null?Zj(e.size):null,l=[i,o].filter(Boolean).join(" · ");return g.jsxs("div",{role:"listitem",className:He("border-border relative flex flex-shrink-0 items-center gap-2 overflow-hidden rounded-lg border transition-colors","hover:bg-surface-hover",t?"h-10 w-36 px-2":"h-14 w-48 px-3",r&&"cursor-pointer"),onClick:()=>r?.(e),children:[(()=>{const c=Wj[Qj(e.type)];return g.jsx(c,{className:He("text-muted-foreground flex-shrink-0",t?"h-4 w-4":"h-5 w-5")})})(),g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsx("div",{className:He("truncate font-medium",t?"text-xs":"text-sm"),title:e.name,children:e.name}),!t&&l&&g.jsx("div",{className:"text-muted-foreground truncate text-xs",children:l})]}),e.loading&&g.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/40",children:g.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent"})}),n&&g.jsx(fA,{onClick:()=>n(e),label:`Remove ${e.name}`})]})}function eB({files:e,onRemove:t,onClick:n,className:r}){const[i,o]=S.useState(!1),l=S.useRef(null),c=S.useRef(null);if(S.useEffect(()=>{if(!i)return;const b=y=>{const E=y.target;E instanceof Node&&l.current&&!l.current.contains(E)&&!c.current?.contains(E)&&o(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[i]),e.length===0)return null;const f=e.length>Td,d=f,m=e.length-Td,p=e.slice(0,Td);return g.jsxs("div",{className:He("relative",r),children:[g.jsxs("div",{className:"flex flex-wrap gap-2",role:"list","aria-label":"Attached files",children:[(f?p:e).map(b=>g.jsx(nS,{file:b,compact:d,onRemove:t,onClick:n},b.id)),f&&g.jsx("div",{role:"listitem",children:g.jsx("button",{ref:c,type:"button",onClick:()=>o(b=>!b),className:He("border-border text-muted-foreground hover:bg-surface-hover flex flex-shrink-0 cursor-pointer items-center justify-center rounded-lg border transition-colors",d?"h-10 px-3 text-xs":"h-14 px-4 text-sm"),children:i?"Show less":`+${m} more`})})]}),i&&g.jsx("div",{ref:l,className:He("bg-surface border-border absolute bottom-full left-0 z-10 mb-2 max-h-48 overflow-y-auto rounded-lg border p-2 shadow-lg"),children:g.jsx("div",{className:"flex flex-wrap gap-2",role:"list","aria-label":"More attached files",children:e.slice(Td).map(b=>g.jsx(nS,{file:b,compact:d,onRemove:t,onClick:n},b.id))})})]})}function tB({value:e,onChange:t,triggers:n,placeholder:r,className:i,disabled:o=!1,markdown:l,normalizeBullets:c,onSubmit:f,onEscape:d,onChipClick:m,onChipAdd:p,onChipDelete:b,onLinkClick:y,onPaste:E,onUndo:w,onRedo:k,minHeight:C=80,maxHeight:A,autoFocus:_=!1,autoGrow:N=!1,"aria-label":D,"data-test-id":O,images:j=[],imagePosition:M="above",onImagePaste:q,onImageRemove:U,onImageClick:Q,files:Z=[],filePosition:G="above",onFileRemove:ee,onFileClick:Y,onKeyDown:H,onBlur:K,onRawPaste:te,submitOnEnter:le,spellCheck:I,maxLength:P,"aria-describedby":$,ref:L}){const{editorRef:ae,activeTrigger:ie,suggestions:fe,suggestionsLoading:de,suggestionsError:he,selectedSuggestionIndex:ve,handleInput:Ue,handleKeyDown:Pe,handleClick:Te,handleMouseDown:Ie,selectSuggestion:je,dismissTrigger:We,handle:Xe,triggerRect:Me,eventHandlers:Ce}=zj({value:e,onChange:t,triggers:n,disabled:o,onSubmit:f,onEscape:d,onChipClick:m,onChipAdd:p,onChipDelete:b,onLinkClick:y,onPaste:E,onRawPaste:te,onUndo:w,onRedo:k,onImagePaste:q,markdown:l,normalizeBullets:c,submitOnEnter:le,maxLength:P});S.useImperativeHandle(L,()=>Xe,[Xe]),S.useEffect(()=>{_&&ae.current?.focus()},[_,ae]);const[we,Be]=S.useState(!1),[$e,W]=S.useState(void 0),me=S.useCallback(()=>{const Fe=ae.current;if(!Fe)return;Fe.style.height="auto";const Dt=Fe.scrollHeight;Fe.style.height=`${Dt}px`,W(Dt)},[ae]),se=S.useCallback(()=>{N&&(Be(!0),me())},[N,me]),re=S.useCallback(()=>{Ce.onBlur(),N&&setTimeout(()=>{const Fe=ae.current;if(!Fe)return;const Dt=document.activeElement;Dt&&Fe.parentElement?.contains(Dt)||(Be(!1),W(void 0))},cA)},[Ce,N,ae]),V=S.useCallback(()=>{Ue(),N&&we&&me()},[Ue,N,we,me]);S.useEffect(()=>{N&&we&&requestAnimationFrame(()=>me())},[e,N,we,me]);const[z,ue]=S.useState(!1),ke=S.useRef(null);S.useEffect(()=>{if(!N)return;const Fe=()=>{if(we){ue(!1);return}const jt=ae.current;jt&&ue(jt.scrollHeight>jt.clientHeight)},Dt=we?0:160;return ke.current=setTimeout(Fe,Dt),()=>{ke.current!==null&&clearTimeout(ke.current)}},[N,we,e,ae]);const Re=S.useMemo(()=>{if(!N){const Fe={minHeight:`${C}px`};return A&&(Fe.maxHeight=`${A}px`,Fe.overflowY="auto"),Fe}return{height:we&&$e?`${$e}px`:`${C}px`,minHeight:`${C}px`,maxHeight:A?`${A}px`:"70dvh",overflowY:we?"auto":"hidden",transition:"height 150ms ease-out, min-height 240ms cubic-bezier(0.33, 1, 0.68, 1)"}},[N,C,A,we,$e]),qe=S.useCallback(Fe=>{H?.(Fe),!Fe.defaultPrevented&&Pe(Fe)},[H,Pe]),rt=S.useCallback(Fe=>{K?.(Fe),re()},[K,re]),et=e.length===0||e.length===1&&e[0].type==="text"&&e[0].text==="",ot=j.length>0?g.jsx($j,{images:j,onRemove:U,onClick:Q,className:M==="above"?"pb-2":"pt-2"}):null,ut=Z.length>0?g.jsx(eB,{files:Z,onRemove:ee,onClick:Y,className:G==="above"?"pb-2":"pt-2"}):null;return g.jsxs("div",{className:He("prompt-area-container relative text-sm leading-relaxed",i),children:[M==="above"&&ot,G==="above"&&ut,g.jsxs("div",{className:"relative",children:[g.jsx("div",{ref:ae,contentEditable:!o,suppressContentEditableWarning:!0,role:"textbox","aria-label":D??"Text input","aria-multiline":"true","aria-disabled":o||void 0,"aria-describedby":$,"data-test-id":O,spellCheck:I,className:He("prompt-area-editor","w-full min-w-0 break-words whitespace-pre-wrap outline-none",o&&"cursor-not-allowed opacity-50"),style:Re,onFocus:se,onInput:N?V:Ue,onKeyDown:qe,onMouseDown:Ie,onClick:Te,onPaste:Ce.onPaste,onCopy:Ce.onCopy,onCut:Ce.onCut,onDrop:Ce.onDrop,onDragOver:Ce.onDragOver,onCompositionStart:Ce.onCompositionStart,onCompositionEnd:Ce.onCompositionEnd,onBlur:rt}),N&&z&&!we&&g.jsx("div",{"aria-hidden":"true",className:"pointer-events-auto absolute right-0 bottom-0 left-0 cursor-pointer",style:{height:"32px"},onClick:()=>ae.current?.focus(),children:g.jsx("div",{className:"h-full w-full",style:{background:"linear-gradient(to bottom, transparent, color-mix(in srgb, var(--prompt-area-surface, var(--background)) 80%, transparent), var(--prompt-area-surface, var(--background)))"}})}),et&&r&&(Array.isArray(r)?g.jsx(Vj,{texts:r}):g.jsx("div",{className:"pointer-events-none absolute top-0 left-0 select-none",style:{color:"var(--prompt-area-placeholder, var(--muted-foreground))"},"aria-hidden":"true",children:r}))]}),G==="below"&&ut,M==="below"&&ot,ie&&ie.config.mode==="dropdown"&&g.jsx(Fj,{suggestions:fe,loading:de,error:he,emptyMessage:ie.config.emptyMessage,selectedIndex:ve,onSelect:je,onDismiss:We,triggerRect:Me,triggerChar:ie.config.char})]})}function nB(e={}){const{initialValue:t=[]}=e,[n,r]=S.useState(t),i=S.useRef(null),o=S.useMemo(()=>Hn(n),[n]),l=S.useMemo(()=>n.length===0?!0:n.every(E=>E.type==="text"&&E.text.trim()===""),[n]),c=S.useMemo(()=>n.some(E=>E.type==="chip"),[n]),f=S.useMemo(()=>n.filter(E=>E.type==="chip"),[n]),d=S.useMemo(()=>({ref:i,value:n,onChange:r}),[n]),m=S.useCallback(()=>{i.current?i.current.clear():r([])},[]),p=S.useCallback(()=>i.current?.focus(),[]),b=S.useCallback(()=>i.current?.blur(),[]),y=S.useCallback(E=>i.current?.insertChip(E),[]);return{bind:d,plainText:o,isEmpty:l,hasChips:c,chips:f,clear:m,focus:p,blur:b,insertChip:y}}function rB(e={}){const{char:t="/",position:n="any",...r}=e;return{char:t,position:n,mode:"dropdown",chipStyle:"inline",accessibilityLabel:"command",...r}}const dA={claude:{interactiveApprovals:!0,permissionModes:["default","acceptEdits","bypassPermissions","plan","dontAsk","auto"],defaultPermissionMode:"default",resume:!0,resumeBackfill:!0,listSessions:!0,contextUsage:!0,rateLimits:!0,mcpStatus:!0,sessionMcpServers:!0,slashCommands:!0,settingSources:!0,budgets:!0,attachments:["image","pdf","text"],reasoningEfforts:["low","medium","high","xhigh","max"],vfs:!1,streaming:"token"},codex:{interactiveApprovals:!0,permissionModes:["default","acceptEdits","bypassPermissions"],defaultPermissionMode:"default",resume:!0,resumeBackfill:!0,listSessions:!0,contextUsage:!0,rateLimits:!0,mcpStatus:!1,sessionMcpServers:!1,slashCommands:!1,settingSources:!1,budgets:!1,attachments:["image","text"],reasoningEfforts:["minimal","low","medium","high","xhigh"],vfs:!1,streaming:"token"},provider:{interactiveApprovals:!1,permissionModes:["default","bypassPermissions","dontAsk"],defaultPermissionMode:"default",resume:!1,resumeBackfill:!1,listSessions:!1,contextUsage:!1,rateLimits:!1,mcpStatus:!1,sessionMcpServers:!1,slashCommands:!1,settingSources:!1,budgets:!1,attachments:["image","pdf","text"],vfs:!0,streaming:"token"}},hA=dA.provider.permissionModes,sB={status:"starting",items:[],pendingApprovals:[],totalCostUsd:0,lastSeq:0},ug="streaming",vd="streaming-thinking";function iB(e){return e===void 0?"":typeof e=="string"?e:e.map(t=>typeof t.text=="string"?t.text:"").filter(Boolean).join(`
|
|
345
|
-
`)}function rS(e){return typeof e=="string"?[{type:"text",text:e}]:e}function aB(e){if(e.type==="text")return e.value;try{return JSON.stringify(e.value)}catch{return String(e.value)}}const oB=/^<local-command-(stdout|stderr)>([\s\S]*?)<\/local-command-\1>$/;function Ma(e,t){const n=e.findIndex(i=>i.id===t.id&&i.kind===t.kind);if(n===-1)return[...e,t];const r=[...e];return r[n]=t,r}function lB(e,t){return{...e,status:e.lastSeq===0?t.status:e.status,model:e.model??t.model,permissionMode:e.permissionMode??t.permissionMode,cwd:e.cwd??t.cwd,sdkSessionId:e.sdkSessionId??t.sdkSessionId,engine:t.engine??e.engine}}function uB(e,t){if(t.seq<=e.lastSeq)return e;const n={...e,lastSeq:t.seq};switch(t.type){case"system_init":return{...n,model:t.model,cwd:t.cwd,sdkSessionId:t.sdkSessionId,permissionMode:t.permissionMode};case"status_changed":return{...n,status:t.status,statusDetail:t.detail};case"capabilities":return{...n,models:t.models,commands:t.commands,defaultModel:t.defaultModel??n.defaultModel};case"model_changed":return t.model===void 0?n:{...n,model:t.model};case"permission_mode_changed":return{...n,permissionMode:t.mode};case"context_usage":return{...n,contextUsage:t.usage};case"rate_limit":{const r=t.info.rateLimitType;return r?{...n,rateLimits:{...n.rateLimits,[r]:t.info}}:n}case"plan_info":return{...n,subscriptionType:t.subscriptionType};case"user_message":{let r=n.items;for(const i of rS(t.message.content))if(i.type==="tool_result"){const o=i,l=o.is_error===!0;r=r.map(c=>c.kind==="tool_call"&&c.id===o.tool_use_id?{...c,status:l?"failed":"settled",result:{text:iB(o.content),isError:l}}:c)}else if(i.type==="text"&&!t.synthetic){const o=i.text,l=oB.exec(o.trim());l?r=Ma(r,{kind:"notice",id:t.uuid??`user-${t.seq}`,level:l[1]==="stderr"?"error":"info",text:l[2].trim()}):r=Ma(r,{kind:"user",id:t.uuid??`user-${t.seq}`,text:o,attachments:t.attachments})}return{...n,items:r}}case"assistant_message":{let r=n.items.find(l=>l.kind==="thinking"&&l.id===vd)?.text??"",i=n.items.filter(l=>!(l.kind==="assistant_text"&&l.id===ug)&&!(l.kind==="thinking"&&l.id===vd));return rS(t.message.content).forEach((l,c)=>{const f=`${t.uuid}-${c}`;if(l.type==="text")i=Ma(i,{kind:"assistant_text",id:f,text:l.text,streaming:!1,parentToolUseId:t.parentToolUseId});else if(l.type==="thinking"){const d=l.thinking||r;if(r="",d.trim()==="")return;i=Ma(i,{kind:"thinking",id:f,text:d,parentToolUseId:t.parentToolUseId})}else if(l.type==="tool_use"){const d=l;i=Ma(i,{kind:"tool_call",id:d.id,name:d.name,input:d.input,parentToolUseId:t.parentToolUseId,status:"running"})}}),{...n,items:i}}case"stream_delta":{const r=t.event;if(r.type!=="content_block_delta")return n;if(r.delta?.type==="text_delta"){const i=n.items.find(l=>l.kind==="assistant_text"&&l.id===ug),o={kind:"assistant_text",id:ug,text:(i?.text??"")+(r.delta.text??""),streaming:!0,parentToolUseId:t.parentToolUseId};return{...n,items:Ma(n.items,o)}}if(r.delta?.type==="thinking_delta"){const i=n.items.find(l=>l.kind==="thinking"&&l.id===vd),o={kind:"thinking",id:vd,text:(i?.text??"")+(r.delta.thinking??""),parentToolUseId:t.parentToolUseId};return{...n,items:Ma(n.items,o)}}return n}case"turn_result":return{...n,totalCostUsd:t.totalCostUsd,items:[...n.items,{kind:"turn_result",id:`turn-${t.seq}`,subtype:t.subtype,isError:t.isError,durationMs:t.durationMs,totalCostUsd:t.totalCostUsd,errors:t.errors}]};case"permission_requested":return{...n,pendingApprovals:[...n.pendingApprovals,t.request]};case"permission_resolved":return{...n,pendingApprovals:n.pendingApprovals.filter(r=>r.id!==t.requestId)};case"execution_dispatched":return{...n,items:n.items.map(r=>r.kind==="tool_call"&&r.id===t.executionId?{...r,status:t.deferred?"deferred":"pending",executionId:t.executionId,backend:t.backend}:r)};case"execution_result":return{...n,items:n.items.map(r=>r.kind==="tool_call"&&r.id===t.executionId?{...r,status:"settled",executionId:t.executionId,result:{text:aB(t.output),isError:!1},logs:t.logs??r.logs}:r)};case"execution_failed":return{...n,items:n.items.map(r=>r.kind==="tool_call"&&r.id===t.executionId?{...r,status:"failed",executionId:t.executionId,result:{text:`${t.reason}: ${t.error}`,isError:!0},logs:t.logs??r.logs}:r)};case"file_delivered":return{...n,items:[...n.items,{kind:"file_delivered",id:`file-${t.seq}`,path:t.path,bytes:t.bytes,description:t.description}]};case"session_error":return{...n,items:[...n.items,{kind:"notice",id:`err-${t.seq}`,level:"error",text:t.message}]};case"session_closed":return{...n,items:[...n.items,{kind:"notice",id:`closed-${t.seq}`,level:"info",text:`Session closed (${t.reason})`}]};case"sdk_event":default:return n}}function cB(e,t){return t.type==="attached"?lB(e,t.session):uB(e,t)}function fB(e,t,n){const[r,i]=S.useReducer(cB,sB),[o,l]=S.useState(!1),[c,f]=S.useState(),d=S.useRef(null),m=S.useRef(n?.onProtocolError);return m.current=n?.onProtocolError,S.useEffect(()=>{if(!t)return;const p=e.attach(t);d.current=p,f(p);const b=p.on("event",k=>i(k)),y=p.on("attached",k=>i(k)),E=p.on("connectionChange",l),w=p.on("protocolError",k=>{m.current?.(k)});return()=>{b(),y(),E(),w(),p.detach(),d.current=null,f(void 0)}},[e,t]),S.useMemo(()=>({state:r,connected:o,handle:c,send:(p,b)=>d.current?.send(p,b),approve:(p,b)=>d.current?.approve(p,b),deny:(p,b)=>d.current?.deny(p,b),interrupt:()=>d.current?.interrupt(),setPermissionMode:p=>d.current?.setPermissionMode(p),setModel:p=>d.current?.setModel(p),closeSession:()=>d.current?.closeSession()}),[r,o,c])}const dB="modulepreload",hB=function(e){return"/"+e},sS={},bc=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let l=function(d){return Promise.all(d.map(m=>Promise.resolve(m).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),f=c?.nonce||c?.getAttribute("nonce");i=l(n.map(d=>{if(d=hB(d),d in sS)return;sS[d]=!0;const m=d.endsWith(".css"),p=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${p}`))return;const b=document.createElement("link");if(b.rel=m?"stylesheet":dB,m||(b.as="script"),b.crossOrigin="",b.href=d,f&&b.setAttribute("nonce",f),document.head.appendChild(b),m)return new Promise((y,E)=>{b.addEventListener("load",y),b.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${d}`)))})}))}function o(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return i.then(l=>{for(const c of l||[])c.status==="rejected"&&o(c.reason);return t().catch(o)})};function pB(e,t={}){const n=new Map;let r,i=!1;const o=m=>t.onExecution?.(m),l=(m,p,b,y)=>{e.sendToolCallError(m.executionId,p,b),o({executionId:m.executionId,toolName:m.toolName,status:"failed",reason:p,startedAt:y,endedAt:Date.now()})},c=async m=>{const p=Date.now();if(!(t.tools??["eval_script"]).includes(m.toolName)){l(m,"unsupported_tool",`this client does not execute '${m.toolName}'`,p);return}const y=m.input?.script;if(typeof y!="string"){l(m,"invalid_input","expected a string `script` input",p);return}const E=new AbortController;n.set(m.executionId,E),o({executionId:m.executionId,toolName:m.toolName,status:"running",startedAt:p});try{const w=await bc(()=>import("./index-CAaft92r.js"),[]),k=w.createVfs(m.vfsSeed),C=Math.min(m.limits?.timeoutMs??Number.POSITIVE_INFINITY,t.timeoutMs??5e3),A=Math.min(m.limits?.memoryLimitBytes??Number.POSITIVE_INFINITY,t.memoryLimitBytes??64*1024*1024),_=t.execute?await t.execute({script:y,vfs:k,timeoutMs:C,memoryLimitBytes:A,signal:E.signal}):await(async()=>(r??=(t.loadEngine??mB)(),w.runScript(await r,{script:y,vfs:k,timeoutMs:C,memoryLimitBytes:A,signal:E.signal,fetchText:t.fetchText})))();if(i||!n.has(m.executionId))return;const N=_.logs.map(D=>`[${D.level}] ${D.text}`);_.ok?(e.sendToolCallResult(m.executionId,{type:"json",value:_.value},N),o({executionId:m.executionId,toolName:m.toolName,status:"settled",startedAt:p,endedAt:Date.now()})):(e.sendToolCallError(m.executionId,_.reason,_.error,N),o({executionId:m.executionId,toolName:m.toolName,status:"failed",reason:_.reason,startedAt:p,endedAt:Date.now()}))}catch(w){if(i||!n.has(m.executionId))return;l(m,"host_error",w instanceof Error?w.message:String(w),p)}finally{n.delete(m.executionId)}},f=e.on("toolCallRequest",m=>void c(m)),d=e.on("toolCallCanceled",({executionId:m,reason:p})=>{const b=n.get(m);b&&(b.abort(),n.delete(m),o({executionId:m,toolName:"",status:"canceled",reason:p,startedAt:Date.now(),endedAt:Date.now()}))});return{dispose:()=>{i=!0,f(),d();for(const m of n.values())m.abort();n.clear()}}}async function mB(){const[e,t]=await Promise.all([bc(()=>import("./index-CAaft92r.js"),[]),bc(()=>import("./index-DzTxp_3z.js"),[])]);return e.loadEngine(t)}function gB(e,t={}){const[n,r]=S.useState([]),i=S.useRef(t);return i.current=t,S.useEffect(()=>{if(!e||t.enabled===!1)return;const o=pB(e,{get tools(){return i.current.tools},get timeoutMs(){return i.current.timeoutMs},get memoryLimitBytes(){return i.current.memoryLimitBytes},get loadEngine(){return i.current.loadEngine},get execute(){return i.current.execute},get fetchText(){return i.current.fetchText},onExecution:l=>{i.current.onExecution?.(l);const c=i.current.historyLimit??50;r(f=>[...f.filter(d=>d.executionId!==l.executionId),l].slice(-c))}});return()=>o.dispose()},[e,t.enabled]),{executions:n}}const bB=e=>e.replace(/\s*\(MCP\)$/i,"");function xB({onSend:e,onInterrupt:t,busy:n,disabled:r,placeholder:i="Message Claude…",commands:o,toolbar:l,className:c}){const{bind:f,plainText:d,isEmpty:m,clear:p,focus:b}=nB(),y=S.useMemo(()=>{if(!o||o.length===0)return;const k=new Set,C=o.flatMap(A=>{const _=bB(A.name);return k.has(_)?[]:(k.add(_),[{...A,name:_}])});return[rB({onSearch:A=>{const _=A.toLowerCase(),N=C.flatMap(D=>{const O=[D.name,...D.aliases??[]].map(M=>M.toLowerCase()),j=O.some(M=>M.startsWith(_))?2:O.some(M=>M.includes(_))?1:0;return j===0?[]:[{c:D,score:j}]});return N.sort((D,O)=>O.score-D.score),N.map(({c:D})=>({value:D.name,label:`/${D.name}${D.argumentHint?` ${D.argumentHint}`:""}`,description:D.description}))},onSelect:A=>A.value,chipClassName:"font-mono"})]},[o]),E=()=>{const k=d.trim();!k||r||(e(k),p(),b())},w=!r&&!m;return g.jsxs("div",{"data-slot":"composer",className:He("px-3 pb-3",c),children:[g.jsxs("div",{className:He("mx-auto w-full max-w-3xl overflow-hidden rounded-lg border border-border bg-bg shadow-(--shadow-xs)","transition-colors focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/30",r&&"opacity-60"),children:[g.jsx(tB,{...f,triggers:y,onSubmit:E,disabled:r,placeholder:r?"Session ended":i,minHeight:28,maxHeight:192,"aria-label":"Message Claude",className:"px-3 pt-2.5 pb-1 text-body-sm text-text"}),g.jsxs("div",{className:"flex items-center justify-between gap-2 px-2 pb-2",children:[g.jsx("div",{className:"flex min-w-0 items-center gap-1",children:l}),n?g.jsx($t,{variant:"outline",size:"icon-sm","aria-label":"Interrupt",className:"rounded-full",onClick:t,children:g.jsx(d9,{className:"size-3"})}):g.jsx($t,{size:"icon-sm","aria-label":"Send",className:"rounded-full",disabled:!w,onClick:E,children:g.jsx(TP,{className:"size-4"})})]})]}),g.jsx("div",{className:"mx-auto mt-1 w-full max-w-3xl text-center text-label text-fg-4",children:"Enter to send · Shift+Enter for a new line"})]})}const lb=e=>e==="default";function yB(e,t){if(!t)return;const n=t.replace(/\[.*\]$/,""),r=e.filter(i=>!lb(i.value));return r.find(i=>i.value===n)??r.find(i=>n.includes(i.value)||i.value.includes(n))}function pA({models:e,model:t,onModelChange:n,variant:r="toolbar",disabled:i,className:o}){const l=yB(e,t)??(t?void 0:e.find(c=>lb(c.value)));return g.jsxs(eo,{items:e.map(c=>({value:c.value,label:c.displayName})),value:l?.value??null,onValueChange:c=>{typeof c!="string"||c===l?.value||n(lb(c)?void 0:c)},disabled:i,children:[g.jsx(no,{"aria-label":"Model",className:He(r==="toolbar"&&"h-6 max-w-56 border-transparent bg-transparent text-fg-3 hover:bg-surface-hover",o),children:g.jsx("span",{className:He("truncate",r==="toolbar"&&"font-mono text-label"),children:g.jsx(to,{placeholder:t??"model"})})}),g.jsx(ro,{className:"min-w-72",children:e.map(c=>g.jsxs(ra,{value:c.value,children:[g.jsx(na,{children:g.jsx("span",{className:"font-medium",children:c.displayName})}),c.description?g.jsx("span",{className:"text-label text-fg-4",children:c.description}):null]},c.value))})]})}const ub=[{value:"default",label:"default",description:"ask for approval"},{value:"acceptEdits",label:"acceptEdits",description:"auto-approve file edits"},{value:"plan",label:"plan",description:"read-only planning"},{value:"auto",label:"auto",description:"model decides when to ask"},{value:"dontAsk",label:"dontAsk",description:"never ask — deny unapproved"},{value:"bypassPermissions",label:"bypassPermissions",description:"no prompts (danger)",dangerous:!0}];function Rc({mode:e,onModeChange:t,modes:n,variant:r="toolbar",disabled:i,className:o}){const l=e==="bypassPermissions",c=n?ub.filter(f=>n.includes(f.value)):ub;return g.jsxs(eo,{items:c.map(f=>({value:f.value,label:f.label})),value:e??null,onValueChange:f=>{typeof f=="string"&&f!==e&&t(f)},disabled:i,children:[g.jsx(no,{"aria-label":"Permission mode",className:He(r==="toolbar"&&"h-6 max-w-44 border-transparent bg-transparent hover:bg-surface-hover",l?"text-danger":r==="toolbar"?"text-fg-3":void 0,o),children:g.jsx("span",{className:He("truncate",r==="toolbar"&&"font-mono text-label"),children:g.jsx(to,{placeholder:"permissions"})})}),g.jsx(ro,{className:"min-w-56",children:c.map(f=>g.jsxs(ra,{value:f.value,children:[g.jsx(na,{children:g.jsx("span",{className:He("font-medium",f.dangerous&&"text-danger"),children:f.label})}),g.jsx("span",{className:He("text-label",f.dangerous?"text-danger/80":"text-fg-4"),children:f.description})]},f.value))})]})}function EB({request:e,onApprove:t,onDeny:n,className:r}){const[i,o]=S.useState(!1);return g.jsx("div",{"data-slot":"permission-prompt",className:He("rounded-lg border border-warning/40 bg-warning-bg p-3",r),children:g.jsxs("div",{className:"flex items-start gap-2.5",children:[g.jsx(l9,{className:"mt-0.5 size-4 shrink-0 text-warning"}),g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsx("div",{className:"text-body-sm font-medium text-fg-1",children:e.title??`Claude wants to use ${e.toolName}`}),e.description?g.jsx("div",{className:"mt-0.5 text-label text-fg-3",children:e.description}):null,g.jsxs("button",{type:"button",className:"mt-1 font-mono text-label text-fg-3 underline-offset-2 hover:underline",onClick:()=>o(l=>!l),children:[i?"Hide":"Show"," ",e.toolName," input"]}),i?g.jsx("pre",{className:"mt-1.5 max-h-48 overflow-auto rounded-md bg-code-bg px-2.5 py-1.5 font-mono text-label whitespace-pre-wrap text-fg-2",children:JSON.stringify(e.input,null,2)}):null]}),g.jsxs("div",{className:"flex shrink-0 gap-1.5",children:[g.jsx($t,{size:"sm",onClick:()=>t(e.id),children:"Allow"}),g.jsx($t,{size:"sm",variant:"outline",onClick:()=>n(e.id,"Denied by user"),children:"Deny"})]})]})})}const iS=[{value:"auto",label:"Auto-answer",description:"pick each question’s recommended option"},{value:"ask",label:"Ask",description:"wait for a watcher or webhook controller to answer"},{value:"deny",label:"Disabled",description:"the agent is told to decide on its own"}];function mA(e){return(Array.isArray(e.questions)?e.questions:[]).flatMap(n=>{const r=n;if(typeof r.question!="string"||!Array.isArray(r.options))return[];const i=r.options.filter(o=>typeof o?.label=="string");return i.length===0?[]:[{question:r.question,header:typeof r.header=="string"?r.header:"",options:i,multiSelect:r.multiSelect===!0}]})}const _u={labels:[],other:"",otherActive:!1};function aS(e){const t=[...e.labels];return e.otherActive&&e.other.trim()&&t.push(e.other.trim()),t.join(", ")}function TB({request:e,onAnswer:t,onDismiss:n,className:r}){const i=mA(e.input),[o,l]=S.useState(()=>i.map(()=>_u)),c=(p,b)=>{l(y=>y.map((E,w)=>w===p?{...E,...b}:E))},f=(p,b,y)=>{const E=o[p]??_u;y?c(p,{labels:E.labels.includes(b)?E.labels.filter(w=>w!==b):[...E.labels,b]}):c(p,{labels:E.labels[0]===b?[]:[b],otherActive:!1})},d=i.every((p,b)=>aS(o[b]??_u)!==""),m=()=>{const p={};i.forEach((b,y)=>{p[b.question]=aS(o[y]??_u)}),t(e.id,{...e.input,answers:p})};return g.jsx("div",{"data-slot":"question-prompt",className:He("rounded-lg border border-info/40 bg-info-bg p-3",r),children:g.jsxs("div",{className:"flex items-start gap-2.5",children:[g.jsx(XP,{className:"mt-0.5 size-4 shrink-0 text-info"}),g.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-3",children:[i.map((p,b)=>{const y=o[b]??_u;return g.jsxs("div",{className:"flex flex-col gap-1.5",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[p.header?g.jsx(ts,{variant:"info",children:p.header}):null,g.jsx("span",{className:"text-body-sm font-medium text-fg-1",children:p.question})]}),g.jsxs("div",{className:"flex flex-col gap-1",children:[p.options.map(E=>{const w=y.labels.includes(E.label);return g.jsxs("button",{type:"button",onClick:()=>f(b,E.label,p.multiSelect===!0),className:He("rounded-md border px-2.5 py-1.5 text-left transition-colors",w?"border-info bg-bg":"border-border bg-bg/50 hover:border-border-strong hover:bg-bg"),children:[g.jsx("span",{className:"block text-body-sm font-medium text-fg-1",children:E.label}),E.description?g.jsx("span",{className:"block text-label text-fg-4",children:E.description}):null,w&&E.preview?g.jsx("pre",{className:"mt-1.5 max-h-40 overflow-auto rounded-md bg-code-bg px-2.5 py-1.5 font-mono text-label whitespace-pre-wrap text-fg-2",children:E.preview}):null]},E.label)}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("button",{type:"button",onClick:()=>c(b,{otherActive:!y.otherActive}),className:He("shrink-0 rounded-md border px-2.5 py-1.5 text-body-sm font-medium transition-colors",y.otherActive?"border-info bg-bg text-fg-1":"border-border bg-bg/50 text-fg-3 hover:border-border-strong hover:bg-bg"),children:"Other…"}),y.otherActive?g.jsx(bn,{autoFocus:!0,value:y.other,onChange:E=>c(b,{other:E.target.value}),placeholder:"Type your own answer",className:"flex-1"}):null]})]})]},b)}),g.jsx("div",{children:g.jsx($t,{size:"sm",onClick:m,disabled:!d,children:"Answer"})})]}),g.jsx($t,{variant:"ghost",size:"icon-sm","aria-label":"Dismiss question",className:"shrink-0",onClick:()=>n(e.id,"Question dismissed by user"),children:g.jsx(F3,{className:"size-3.5"})})]})})}function ep(e){return e===void 0||Number.isNaN(e)?"—":e===0?"$0.00":e<.01?"<$0.01":`$${e.toFixed(2)}`}function vB(e){if(e<1e3)return`${Math.round(e)}ms`;const t=e/1e3;return t<60?`${t.toFixed(1)}s`:`${Math.floor(t/60)}m ${Math.round(t%60)}s`}function Qi(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(Math.round(e))}function SB(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:e>=1024?`${(e/1024).toFixed(1)} KB`:`${e} B`}function oS(e,t=Date.now()){const n=e-t;if(n<=0)return"now";const r=Math.ceil(n/6e4);if(r<1)return"<1m";if(r<60)return`${r}m`;const i=Math.floor(r/1440);return i>=1?`${i}d ${Math.floor(r%1440/60)}h`:`${Math.floor(r/60)}h ${r%60}m`}function N1(e,t=Date.now()){if(!e)return"—";const n=Math.max(0,t-e),r=Math.floor(n/1e3);if(r<60)return"just now";const i=Math.floor(r/60);if(i<60)return`${i}m ago`;const o=Math.floor(i/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function CB(e,t=80){if(e==null)return"";if(typeof e=="object"){const r=e,i=r.command??r.file_path??r.path??r.url??r.pattern??r.query??r.description;if(typeof i=="string")return i.length>t?i.slice(0,t-1)+"…":i}const n=JSON.stringify(e)??"";return n.length>t?n.slice(0,t-1)+"…":n}const gA={starting:{label:"Starting",variant:"info",busy:!0},running:{label:"Running",variant:"info",busy:!0},awaiting_approval:{label:"Needs approval",variant:"warning",busy:!0},idle:{label:"Idle",variant:"success",busy:!1},parked:{label:"Parked",variant:"accent",busy:!1},failed:{label:"Failed",variant:"danger",busy:!1},closed:{label:"Closed",variant:"neutral",busy:!1}};function wB(e=3e4){const[t,n]=S.useState(()=>Date.now());return S.useEffect(()=>{const r=setInterval(()=>n(Date.now()),e);return()=>clearInterval(r)},[e]),t}const bA=e=>e>=95?"text-danger":e>=80?"text-warning":"text-fg-3",kB=e=>typeof CSS<"u"&&CSS.supports("color",e)?e:void 0;function AB({usage:e}){return g.jsx(K3,{content:g.jsxs("div",{className:"flex min-w-44 flex-col gap-1 py-0.5",children:[e.categories.map(t=>g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"size-2 shrink-0 rounded-full bg-fg-4",style:kB(t.color)?{backgroundColor:t.color}:void 0}),g.jsx("span",{className:"flex-1",children:t.name}),g.jsx("span",{className:"font-mono text-fg-3",children:Qi(t.tokens)})]},t.name)),g.jsxs("div",{className:"mt-0.5 flex items-center justify-between gap-2 border-t border-border pt-1",children:[g.jsx("span",{children:"Total"}),g.jsxs("span",{className:"font-mono text-fg-3",children:[Qi(e.totalTokens)," / ",Qi(e.maxTokens)," (",e.percentage.toFixed(0),"%)"]})]})]}),children:g.jsxs("span",{className:He("inline-flex cursor-default items-center gap-1 font-mono text-label",bA(e.percentage)),children:["Ctx ",Qi(e.totalTokens)]})})}function lS({label:e,info:t,now:n}){const r=t.utilization,i=t.resetsAt!==void 0?t.resetsAt*1e3:void 0;return g.jsx(K3,{content:g.jsxs("div",{className:"flex min-w-36 flex-col gap-1 py-0.5",children:[g.jsxs("div",{className:"flex items-center justify-between gap-2",children:[g.jsxs("span",{children:[e," usage"]}),g.jsx("span",{className:"font-mono text-fg-3",children:r!==void 0?`${r.toFixed(1)}%`:"—"})]}),i!==void 0?g.jsxs("div",{className:"flex items-center justify-between gap-2",children:[g.jsx("span",{children:"Resets in"}),g.jsx("span",{className:"font-mono text-fg-3",children:oS(i,n)})]}):null,t.isUsingOverage?g.jsx("div",{className:"text-warning",children:"Using overage"}):null,t.status==="rejected"?g.jsx("div",{className:"text-danger",children:"Limit reached"}):null]}),children:g.jsxs("span",{className:He("inline-flex cursor-default items-center gap-1 font-mono text-label",t.status==="rejected"?"text-danger":bA(r??0)),children:[g.jsx(W3,{value:r??0}),e,r!==void 0?` ${r.toFixed(0)}%`:"",i!==void 0?g.jsxs("span",{className:"text-fg-4",children:["· ",oS(i,n)]}):null]})})}function _B({state:e,connected:t,className:n}){const r=gA[e.status],i=wB(),o=e.rateLimits?.five_hour,l=e.rateLimits?.seven_day;return g.jsxs("div",{"data-slot":"status-bar",className:He("flex items-center gap-3 border-b border-border bg-surface px-3 py-2",n),children:[g.jsxs(ts,{variant:r.variant,dot:!r.busy,children:[r.busy?g.jsx(ci,{className:"size-3 text-current"}):null,r.label]}),e.contextUsage?g.jsx(AB,{usage:e.contextUsage}):null,o?g.jsx(lS,{label:"Session",info:o,now:i}):null,l?g.jsx(lS,{label:"Weekly",info:l,now:i}):null,g.jsx("span",{className:"flex-1"}),t?null:g.jsxs("span",{className:"inline-flex items-center gap-1 text-label text-warning",children:[g.jsx(T9,{className:"size-3"})," reconnecting…"]}),g.jsx("span",{className:"font-mono text-label text-fg-3",children:ep(e.totalCostUsd)})]})}/*!---------------------------------------------------------------------------------------------
|
|
346
|
-
* Copyright (c) StackBlitz. All rights reserved.
|
|
347
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
348
|
-
*--------------------------------------------------------------------------------------------*/const NB={damping:.7,stiffness:.05,mass:1.25},RB=70,OB=1e3/60,IB=350;let tp=!1;globalThis.document?.addEventListener("mousedown",()=>{tp=!0});globalThis.document?.addEventListener("mouseup",()=>{tp=!1});globalThis.document?.addEventListener("click",()=>{tp=!1});const LB=(e={})=>{const[t,n]=S.useState(!1),[r,i]=S.useState(e.initial!==!1),[o,l]=S.useState(!1),c=S.useRef(null);c.current=e;const f=S.useCallback(()=>{if(!tp)return!1;const A=window.getSelection();if(!A||!A.rangeCount)return!1;const _=A.getRangeAt(0);return _.commonAncestorContainer.contains(k.current)||k.current?.contains(_.commonAncestorContainer)},[]),d=S.useCallback(A=>{p.isAtBottom=A,i(A)},[]),m=S.useCallback(A=>{p.escapedFromLock=A,n(A)},[]),p=S.useMemo(()=>{let A;return{escapedFromLock:t,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return k.current?.scrollTop??0},set scrollTop(_){if(k.current){const{scrollBehavior:N}=getComputedStyle(k.current);N!=="auto"&&(k.current.style.scrollBehavior="auto"),k.current.scrollTop=_,p.ignoreScrollToTop=k.current.scrollTop,N!=="auto"&&(k.current.style.scrollBehavior=N)}},get targetScrollTop(){return!k.current||!C.current?0:k.current.scrollHeight-1-k.current.clientHeight},get calculatedTargetScrollTop(){if(!k.current||!C.current)return 0;const{targetScrollTop:_}=this;if(!e.targetScrollTop)return _;if(A?.targetScrollTop===_)return A.calculatedScrollTop;const N=Math.max(Math.min(e.targetScrollTop(_,{scrollElement:k.current,contentElement:C.current}),_),0);return A={targetScrollTop:_,calculatedScrollTop:N},requestAnimationFrame(()=>{A=void 0}),N},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=RB}}},[]),b=S.useCallback((A={})=>{typeof A=="string"&&(A={animation:A}),A.preserveScrollPosition||d(!0);const _=Date.now()+(Number(A.wait)||0),N=fg(c.current,A.animation),{ignoreEscapes:D=!1}=A;let O,j=p.calculatedTargetScrollTop;A.duration instanceof Promise?A.duration.finally(()=>{O=Date.now()}):O=_+(A.duration??0);const M=async()=>{const q=new Promise(requestAnimationFrame).then(()=>{if(!p.isAtBottom)return p.animation=void 0,!1;const{scrollTop:U}=p,Q=performance.now(),Z=(Q-(p.lastTick??Q))/OB;if(p.animation||(p.animation={behavior:N,promise:q,ignoreEscapes:D}),p.animation.behavior===N&&(p.lastTick=Q),f()||_>Date.now())return M();if(U<Math.min(j,p.calculatedTargetScrollTop)){if(p.animation?.behavior===N){if(N==="instant")return p.scrollTop=p.calculatedTargetScrollTop,M();p.velocity=(N.damping*p.velocity+N.stiffness*p.scrollDifference)/N.mass,p.accumulated+=p.velocity*Z,p.scrollTop+=p.accumulated,p.scrollTop!==U&&(p.accumulated=0)}return M()}return O>Date.now()?(j=p.calculatedTargetScrollTop,M()):(p.animation=void 0,p.scrollTop<p.calculatedTargetScrollTop?b({animation:fg(c.current,c.current.resize),ignoreEscapes:D,duration:Math.max(0,O-Date.now())||void 0}):p.isAtBottom)});return q.then(U=>(requestAnimationFrame(()=>{p.animation||(p.lastTick=void 0,p.velocity=0)}),U))};return A.wait!==!0&&(p.animation=void 0),p.animation?.behavior===N?p.animation.promise:M()},[d,f,p]),y=S.useCallback(()=>{m(!0),d(!1)},[m,d]),E=S.useCallback(({target:A})=>{if(A!==k.current)return;const{scrollTop:_,ignoreScrollToTop:N}=p;let{lastScrollTop:D=_}=p;p.lastScrollTop=_,p.ignoreScrollToTop=void 0,N&&N>_&&(D=N),l(p.isNearBottom),setTimeout(()=>{if(p.resizeDifference||_===N)return;if(f()){m(!0),d(!1);return}const O=_>D,j=_<D;if(p.animation?.ignoreEscapes){p.scrollTop=D;return}j&&(m(!0),d(!1)),O&&m(!1),!p.escapedFromLock&&p.isNearBottom&&d(!0)},1)},[m,d,f,p]),w=S.useCallback(({target:A,deltaY:_})=>{let N=A;for(;!["scroll","auto"].includes(getComputedStyle(N).overflow);){if(!N.parentElement)return;N=N.parentElement}N===k.current&&_<0&&k.current.scrollHeight>k.current.clientHeight&&!p.animation?.ignoreEscapes&&(m(!0),d(!1))},[m,d,p]),k=uS(A=>{k.current?.removeEventListener("scroll",E),k.current?.removeEventListener("wheel",w),A?.addEventListener("scroll",E,{passive:!0}),A?.addEventListener("wheel",w,{passive:!0})},[]),C=uS(A=>{if(p.resizeObserver?.disconnect(),p.resizeObserver=void 0,!A)return;let _;p.resizeObserver=new ResizeObserver(([N])=>{const{height:D}=N.contentRect,O=D-(_??D);if(p.resizeDifference=O,p.scrollTop>p.targetScrollTop&&(p.scrollTop=p.targetScrollTop),l(p.isNearBottom),O>=0){const j=fg(c.current,_?c.current.resize:c.current.initial);b({animation:j,wait:!0,preserveScrollPosition:!0,duration:j==="instant"?void 0:IB})}else p.isNearBottom&&(m(!1),d(!0));_=D,requestAnimationFrame(()=>{setTimeout(()=>{p.resizeDifference===O&&(p.resizeDifference=0)},1)})}),p.resizeObserver?.observe(A)},[]);return{contentRef:C,scrollRef:k,scrollToBottom:b,stopScroll:y,isAtBottom:r||o,isNearBottom:o,escapedFromLock:t,state:p}};function uS(e,t){const n=S.useCallback(r=>(n.current=r,e(r)),t);return n}const cg=new Map;function fg(...e){const t={...NB};let n=!1;for(const i of e){if(i==="instant"){n=!0;continue}typeof i=="object"&&(n=!1,t.damping=i.damping??t.damping,t.stiffness=i.stiffness??t.stiffness,t.mass=i.mass??t.mass)}const r=JSON.stringify(t);return cg.has(r)||cg.set(r,Object.freeze(t)),n?"instant":cg.get(r)}/*!---------------------------------------------------------------------------------------------
|
|
349
|
-
* Copyright (c) StackBlitz. All rights reserved.
|
|
350
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
351
|
-
*--------------------------------------------------------------------------------------------*/const xA=S.createContext(null),MB=typeof window<"u"?S.useLayoutEffect:S.useEffect;function bh({instance:e,children:t,resize:n,initial:r,mass:i,damping:o,stiffness:l,targetScrollTop:c,contextRef:f,...d}){const m=S.useRef(null),p=S.useCallback((D,O)=>(N?.targetScrollTop??c)?.(D,O)??D,[c]),b=LB({mass:i,damping:o,stiffness:l,resize:n,initial:r,targetScrollTop:p}),{scrollRef:y,contentRef:E,scrollToBottom:w,stopScroll:k,isAtBottom:C,escapedFromLock:A,state:_}=e??b,N=S.useMemo(()=>({scrollToBottom:w,stopScroll:k,scrollRef:y,isAtBottom:C,escapedFromLock:A,contentRef:E,state:_,get targetScrollTop(){return m.current},set targetScrollTop(D){m.current=D}}),[w,C,E,y,k,A,_]);return S.useImperativeHandle(f,()=>N,[N]),MB(()=>{y.current&&getComputedStyle(y.current).overflow==="visible"&&(y.current.style.overflow="auto")},[]),S.createElement(xA.Provider,{value:N},S.createElement("div",{...d},typeof t=="function"?t(N):t))}(function(e){function t({children:n,scrollClassName:r,...i}){const o=yA();return S.createElement("div",{ref:o.scrollRef,style:{height:"100%",width:"100%",scrollbarGutter:"stable both-edges"},className:r},S.createElement("div",{...i,ref:o.contentRef},typeof n=="function"?n(o):n))}e.Content=t})(bh||(bh={}));function yA(){const e=S.useContext(xA);if(!e)throw new Error("use-stick-to-bottom component context must be used within a StickToBottom component");return e}function DB({className:e,children:t,...n}){return g.jsx(bh,{"data-slot":"conversation",className:He("relative flex-1 overflow-y-auto",e),initial:"instant",resize:"smooth",role:"log",...n,children:t})}function PB({className:e,children:t,...n}){return g.jsx(bh.Content,{"data-slot":"conversation-content",className:He("mx-auto flex w-full max-w-3xl flex-col gap-4 px-4 py-4",e),...n,children:t})}function jB({className:e}){const{isAtBottom:t,scrollToBottom:n}=yA();return t?null:g.jsx($t,{variant:"outline",size:"icon","aria-label":"Scroll to bottom","data-slot":"conversation-scroll-button",className:He("absolute bottom-4 left-1/2 -translate-x-1/2 rounded-full shadow-(--shadow-md)",e),onClick:()=>void n(),children:g.jsx(xP,{className:"size-4"})})}function BB({item:e,href:t,className:n}){const r=e.path.split("/").pop()||e.path;return g.jsxs("div",{"data-slot":"file-delivered",className:He("flex w-full items-center gap-3 rounded-lg border border-border bg-surface px-3 py-2.5",n),children:[g.jsx(HP,{className:"size-4 shrink-0 text-fg-3"}),g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsx("div",{className:"truncate font-mono text-body-sm font-medium text-fg-1",children:r}),g.jsxs("div",{className:"truncate text-label text-fg-4",children:[SB(e.bytes),e.description?` · ${e.description}`:""]})]}),t?g.jsxs("a",{href:t,download:r,className:He("flex shrink-0 items-center gap-1.5 rounded-md border border-border px-2.5 py-1.5","text-body-sm text-fg-2 transition-colors hover:bg-surface-hover"),children:[g.jsx(PP,{className:"size-3.5"}),"Download"]}):null]})}function HB({label:e,className:t}){return g.jsxs("div",{"data-slot":"loader",className:He("flex items-center gap-2 py-1 text-body-sm text-fg-4",t),children:[g.jsx("span",{className:"flex items-center gap-1",children:[0,1,2].map(n=>g.jsx("span",{className:"size-1.5 animate-pulse rounded-full bg-fg-4",style:{animationDelay:`${n*160}ms`}},n))}),e?g.jsx("span",{children:e}):null]})}function cS({from:e,className:t,...n}){return g.jsx("div",{"data-slot":"message","data-from":e,className:He("flex w-full flex-col gap-1",e==="user"?"items-end":"items-start",t),...n})}function fS({className:e,...t}){return g.jsx("div",{"data-slot":"message-content",className:He("min-w-0 text-body-sm leading-6 text-fg-1","in-data-[from=user]:max-w-[85%] in-data-[from=user]:rounded-lg in-data-[from=user]:rounded-br-sm","in-data-[from=user]:bg-accent-bg in-data-[from=user]:px-3 in-data-[from=user]:py-2","in-data-[from=user]:whitespace-pre-wrap","in-data-[from=assistant]:w-full",e),...t})}const np=(function(e){if(e==null)return VB;if(typeof e=="function")return rp(e);if(typeof e=="object")return Array.isArray(e)?UB(e):zB(e);if(typeof e=="string")return FB(e);throw new Error("Expected function, string, or object as test")});function UB(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=np(e[n]);return rp(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function zB(e){const t=e;return rp(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function FB(e){return rp(t);function t(n){return n&&n.type===e}}function rp(e){return t;function t(n,r,i){return!!($B(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function VB(){return!0}function $B(e){return e!==null&&typeof e=="object"&&"type"in e}const EA=[],Fu=!0,cb=!1,al="skip";function R1(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=np(i),l=r?-1:1;c(e,void 0,[])();function c(f,d,m){const p=f&&typeof f=="object"?f:{};if(typeof p.type=="string"){const y=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(f.type+(y?"<"+y+">":""))+")"})}return b;function b(){let y=EA,E,w,k;if((!t||o(f,d,m[m.length-1]||void 0))&&(y=qB(n(f,m)),y[0]===cb))return y;if("children"in f&&f.children){const C=f;if(C.children&&y[0]!==al)for(w=(r?C.children.length:-1)+l,k=m.concat(C);w>-1&&w<C.children.length;){const A=C.children[w];if(E=c(A,w,k)(),E[0]===cb)return E;w=typeof E[1]=="number"?E[1]:w+l}}return y}}}function qB(e){return Array.isArray(e)?e:typeof e=="number"?[Fu,e]:e==null?EA:[e]}function Is(e,t,n,r){let i,o,l;typeof t=="function"&&typeof n!="function"?(o=void 0,l=t,i=n):(o=t,l=n,i=r),R1(e,o,c,i);function c(f,d){const m=d[d.length-1],p=m?m.children.indexOf(f):void 0;return l(f,p,m)}}const gl={indicator:"indicator",textOnly:"text-only",remove:"remove"};function YB({defaultOrigin:e="",allowedLinkPrefixes:t=[],allowedImagePrefixes:n=[],allowDataImages:r=!1,allowedProtocols:i=[],blockedImageClass:o="inline-block bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400 px-3 py-1 rounded text-sm",blockedLinkClass:l="text-gray-500",linkBlockPolicy:c=gl.indicator,imageBlockPolicy:f=gl.indicator}){const d=t.length&&!t.every(p=>p==="*"),m=n.length&&!n.every(p=>p==="*");if(!e&&(d||m))throw new Error("defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided");return p=>{const b=ZB(e,t,n,r,i,o,l,c,f);TA(p),Is(p,b)}}function dS(e,t){if(typeof e!="string")return null;try{return new URL(e)}catch{if(t)try{return new URL(e,t)}catch{return null}if(e.startsWith("/")||e.startsWith("./")||e.startsWith("../"))try{return new URL(e,"http://example.com")}catch{return null}return null}}function GB(e){return typeof e!="string"?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")}const XB=new Set(["https:","http:","irc:","ircs:","mailto:","xmpp:","blob:"]),KB=new Set(["javascript:","data:","file:","vbscript:"]);function hS(e,t,n,r=!1,i=!1,o=[]){if(!e)return null;if(typeof e=="string"&&e.startsWith("#")&&!i)try{if(new URL(e,"http://example.com").hash===e)return e}catch{}if(typeof e=="string"&&e.startsWith("data:"))return i&&r&&e.startsWith("data:image/")?e:null;if(typeof e=="string"&&e.startsWith("blob:")){try{if(new URL(e).protocol==="blob:"&&e.length>5){const m=e.substring(5);if(m&&m.length>0&&m!=="invalid")return e}}catch{return null}return null}const l=dS(e,n);if(!l||KB.has(l.protocol)||!(XB.has(l.protocol)||o.includes(l.protocol)||o.includes("*")))return null;if(l.protocol==="mailto:"||!l.protocol.match(/^https?:$/))return l.href;const f=GB(e);return l&&t.some(d=>{const m=dS(d,n);return!m||m.origin!==l.origin?!1:l.href.startsWith(m.href)})?f?l.pathname+l.search+l.hash:l.href:t.includes("*")?l.protocol!=="https:"&&l.protocol!=="http:"?null:f?l.pathname+l.search+l.hash:l.href:null}function TA(e){if("children"in e&&Array.isArray(e.children)){e.children=e.children.filter(t=>t!=null);for(const t of e.children)TA(t)}}const dg=Symbol("node-seen");function QB(e,t,n){return t===gl.remove?{type:"remove"}:t===gl.textOnly?{type:"replace",element:{type:"element",tagName:"span",properties:{},children:[...e.children]}}:{type:"replace",element:{type:"element",tagName:"span",properties:{title:"Blocked URL: "+String(e.properties.href),class:n},children:[...e.children,{type:"text",value:" [blocked]"}]}}}function WB(e,t,n){if(t===gl.remove)return{type:"remove"};if(t===gl.textOnly){const r=String(e.properties.alt||"");return r?{type:"replace",element:{type:"element",tagName:"span",properties:{},children:[{type:"text",value:r}]}}:{type:"remove"}}return{type:"replace",element:{type:"element",tagName:"span",properties:{class:n},children:[{type:"text",value:"[Image blocked: "+String(e.properties.alt||"No description")+"]"}]}}}const ZB=(e,t,n,r,i,o,l,c,f)=>{const d=(m,p,b)=>{if(m.type!=="element"||m[dg])return Fu;if(m.tagName==="a"){const y=hS(m.properties.href,t,e,!1,!1,i);if(y===null){if(m[dg]=!0,Is(m,d),b&&typeof p=="number"){const E=QB(m,c,l);if(E.type==="remove")return b.children.splice(p,1),[al,p];b.children[p]=E.element}return al}else return m.properties.href=y,m.properties.target="_blank",m.properties.rel="noopener noreferrer",Fu}if(m.tagName==="img"){const y=hS(m.properties.src,n,e,r,!0,i);if(y===null){if(m[dg]=!0,Is(m,d),b&&typeof p=="number"){const E=WB(m,f,o);if(E.type==="remove")return b.children.splice(p,1),[al,p];b.children[p]=E.element}return al}else return m.properties.src=y,Fu}return Fu};return d},vA=-1,sp=0,Qu=1,xh=2,O1=3,I1=4,L1=5,M1=6,SA=7,CA=8,wA=typeof self=="object"?self:globalThis,pS=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new wA[e](t)},JB=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,l]=t[i];switch(o){case sp:case vA:return n(l,i);case Qu:{const c=n([],i);for(const f of l)c.push(r(f));return c}case xh:{const c=n({},i);for(const[f,d]of l)c[r(f)]=r(d);return c}case O1:return n(new Date(l),i);case I1:{const{source:c,flags:f}=l;return n(new RegExp(c,f),i)}case L1:{const c=n(new Map,i);for(const[f,d]of l)c.set(r(f),r(d));return c}case M1:{const c=n(new Set,i);for(const f of l)c.add(r(f));return c}case SA:{const{name:c,message:f}=l;return n(typeof wA[c]=="function"?pS(c,f):new Error(f),i)}case CA:return n(BigInt(l),i);case"BigInt":return n(Object(BigInt(l)),i);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:c}=new Uint8Array(l);return n(new DataView(c),l)}}return n(pS(o,l),i)};return r},mS=e=>JB(new Map,e)(0),Ba="",{toString:eH}={},{keys:tH}=Object,Nu=e=>{const t=typeof e;if(t!=="object"||!e)return[sp,t];const n=eH.call(e).slice(8,-1);switch(n){case"Array":return[Qu,Ba];case"Object":return[xh,Ba];case"Date":return[O1,Ba];case"RegExp":return[I1,Ba];case"Map":return[L1,Ba];case"Set":return[M1,Ba];case"DataView":return[Qu,n]}return n.includes("Array")?[Qu,n]:e instanceof Error?[SA,e.name||"Error"]:[xh,n]},Sd=([e,t])=>e===sp&&(t==="function"||t==="symbol"),nH=(e,t,n,r)=>{const i=(l,c)=>{const f=r.push(l)-1;return n.set(c,f),f},o=l=>{if(n.has(l))return n.get(l);let[c,f]=Nu(l);switch(c){case sp:{let m=l;switch(f){case"bigint":c=CA,m=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);m=null;break;case"undefined":return i([vA],l)}return i([c,m],l)}case Qu:{if(f){let b=l;return f==="DataView"?b=new Uint8Array(l.buffer):f==="ArrayBuffer"&&(b=new Uint8Array(l)),i([f,[...b]],l)}const m=[],p=i([c,m],l);for(const b of l)m.push(o(b));return p}case xh:{if(f)switch(f){case"BigInt":return i([f,l.toString()],l);case"Boolean":case"Number":case"String":return i([f,l.valueOf()],l)}if(t&&"toJSON"in l)return o(l.toJSON());const m=[],p=i([c,m],l);for(const b of tH(l))(e||!Sd(Nu(l[b])))&&m.push([o(b),o(l[b])]);return p}case O1:return i([c,isNaN(l.getTime())?Ba:l.toISOString()],l);case I1:{const{source:m,flags:p}=l;return i([c,{source:m,flags:p}],l)}case L1:{const m=[],p=i([c,m],l);for(const[b,y]of l)(e||!(Sd(Nu(b))||Sd(Nu(y))))&&m.push([o(b),o(y)]);return p}case M1:{const m=[],p=i([c,m],l);for(const b of l)(e||!Sd(Nu(b)))&&m.push(o(b));return p}}const{message:d}=l;return i([c,{name:f,message:d}],l)};return o},gS=(e,{json:t,lossy:n}={})=>{const r=[];return nH(!(t||n),!!t,new Map,r)(e),r},so=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?mS(gS(e,t)):structuredClone(e):(e,t)=>mS(gS(e,t));class Oc{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Oc.prototype.normal={};Oc.prototype.property={};Oc.prototype.space=void 0;function kA(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Oc(n,r,t)}function xc(e){return e.toLowerCase()}class kr{constructor(t,n){this.attribute=n,this.property=t}}kr.prototype.attribute="";kr.prototype.booleanish=!1;kr.prototype.boolean=!1;kr.prototype.commaOrSpaceSeparated=!1;kr.prototype.commaSeparated=!1;kr.prototype.defined=!1;kr.prototype.mustUseProperty=!1;kr.prototype.number=!1;kr.prototype.overloadedBoolean=!1;kr.prototype.property="";kr.prototype.spaceSeparated=!1;kr.prototype.space=void 0;let rH=0;const dt=fo(),Nn=fo(),fb=fo(),Le=fo(),nn=fo(),Ka=fo(),Mr=fo();function fo(){return 2**++rH}const db=Object.freeze(Object.defineProperty({__proto__:null,boolean:dt,booleanish:Nn,commaOrSpaceSeparated:Mr,commaSeparated:Ka,number:Le,overloadedBoolean:fb,spaceSeparated:nn},Symbol.toStringTag,{value:"Module"})),hg=Object.keys(db);class D1 extends kr{constructor(t,n,r,i){let o=-1;if(super(t,n),bS(this,"space",i),typeof r=="number")for(;++o<hg.length;){const l=hg[o];bS(this,hg[o],(r&db[l])===db[l])}}}D1.prototype.defined=!0;function bS(e,t,n){n&&(e[t]=n)}function Cl(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new D1(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[xc(r)]=r,n[xc(o.attribute)]=r}return new Oc(t,n,e.space)}const AA=Cl({properties:{ariaActiveDescendant:null,ariaAtomic:Nn,ariaAutoComplete:null,ariaBusy:Nn,ariaChecked:Nn,ariaColCount:Le,ariaColIndex:Le,ariaColSpan:Le,ariaControls:nn,ariaCurrent:null,ariaDescribedBy:nn,ariaDetails:null,ariaDisabled:Nn,ariaDropEffect:nn,ariaErrorMessage:null,ariaExpanded:Nn,ariaFlowTo:nn,ariaGrabbed:Nn,ariaHasPopup:null,ariaHidden:Nn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:nn,ariaLevel:Le,ariaLive:null,ariaModal:Nn,ariaMultiLine:Nn,ariaMultiSelectable:Nn,ariaOrientation:null,ariaOwns:nn,ariaPlaceholder:null,ariaPosInSet:Le,ariaPressed:Nn,ariaReadOnly:Nn,ariaRelevant:null,ariaRequired:Nn,ariaRoleDescription:nn,ariaRowCount:Le,ariaRowIndex:Le,ariaRowSpan:Le,ariaSelected:Nn,ariaSetSize:Le,ariaSort:null,ariaValueMax:Le,ariaValueMin:Le,ariaValueNow:Le,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function _A(e,t){return t in e?e[t]:t}function NA(e,t){return _A(e,t.toLowerCase())}const sH=Cl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ka,acceptCharset:nn,accessKey:nn,action:null,allow:null,allowFullScreen:dt,allowPaymentRequest:dt,allowUserMedia:dt,alpha:dt,alt:null,as:null,async:dt,autoCapitalize:null,autoComplete:nn,autoFocus:dt,autoPlay:dt,blocking:nn,capture:null,charSet:null,checked:dt,cite:null,className:nn,closedBy:null,colorSpace:null,cols:Le,colSpan:Le,command:null,commandFor:null,content:null,contentEditable:Nn,controls:dt,controlsList:nn,coords:Le|Ka,crossOrigin:null,data:null,dateTime:null,decoding:null,default:dt,defer:dt,dir:null,dirName:null,disabled:dt,download:fb,draggable:Nn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:dt,formTarget:null,headers:nn,height:Le,hidden:fb,high:Le,href:null,hrefLang:null,htmlFor:nn,httpEquiv:nn,id:null,imageSizes:null,imageSrcSet:null,inert:dt,inputMode:null,integrity:null,is:null,isMap:dt,itemId:null,itemProp:nn,itemRef:nn,itemScope:dt,itemType:nn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:dt,low:Le,manifest:null,max:null,maxLength:Le,media:null,method:null,min:null,minLength:Le,multiple:dt,muted:dt,name:null,nonce:null,noModule:dt,noValidate:dt,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:dt,optimum:Le,pattern:null,ping:nn,placeholder:null,playsInline:dt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:dt,referrerPolicy:null,rel:nn,required:dt,reversed:dt,rows:Le,rowSpan:Le,sandbox:nn,scope:null,scoped:dt,seamless:dt,selected:dt,shadowRootClonable:dt,shadowRootCustomElementRegistry:dt,shadowRootDelegatesFocus:dt,shadowRootMode:null,shadowRootSerializable:dt,shape:null,size:Le,sizes:null,slot:null,span:Le,spellCheck:Nn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Le,step:null,style:null,tabIndex:Le,target:null,title:null,translate:null,type:null,typeMustMatch:dt,useMap:null,value:Nn,width:Le,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:nn,axis:null,background:null,bgColor:null,border:Le,borderColor:null,bottomMargin:Le,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:dt,declare:dt,event:null,face:null,frame:null,frameBorder:null,hSpace:Le,leftMargin:Le,link:null,longDesc:null,lowSrc:null,marginHeight:Le,marginWidth:Le,noResize:dt,noHref:dt,noShade:dt,noWrap:dt,object:null,profile:null,prompt:null,rev:null,rightMargin:Le,rules:null,scheme:null,scrolling:Nn,standby:null,summary:null,text:null,topMargin:Le,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Le,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:dt,disablePictureInPicture:dt,disableRemotePlayback:dt,exportParts:Ka,part:nn,prefix:null,property:null,results:Le,security:null,unselectable:null},space:"html",transform:NA}),iH=Cl({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",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Mr,accentHeight:Le,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Le,amplitude:Le,arabicForm:null,ascent:Le,attributeName:null,attributeType:null,azimuth:Le,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Le,by:null,calcMode:null,capHeight:Le,className:nn,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:Le,diffuseConstant:Le,direction:null,display:null,dur:null,divisor:Le,dominantBaseline:null,download:dt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Le,enableBackground:null,end:null,event:null,exponent:Le,externalResourcesRequired:null,fill:null,fillOpacity:Le,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:Ka,g2:Ka,glyphName:Ka,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Le,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Le,horizOriginX:Le,horizOriginY:Le,id:null,ideographic:Le,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Le,k:Le,k1:Le,k2:Le,k3:Le,k4:Le,kernelMatrix:Mr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Le,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Le,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:Le,overlineThickness:Le,paintOrder:null,panose1:null,path:null,pathLength:Le,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:nn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Le,pointsAtY:Le,pointsAtZ:Le,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Mr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Mr,rev:Mr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Mr,requiredFeatures:Mr,requiredFonts:Mr,requiredFormats:Mr,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:Le,specularExponent:Le,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Le,strikethroughThickness:Le,string:null,stroke:null,strokeDashArray:Mr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Le,strokeOpacity:Le,strokeWidth:null,style:null,surfaceScale:Le,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Mr,tabIndex:Le,tableValues:null,target:null,targetX:Le,targetY:Le,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Mr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Le,underlineThickness:Le,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Le,values:null,vAlphabetic:Le,vMathematical:Le,vectorEffect:null,vHanging:Le,vIdeographic:Le,version:null,vertAdvY:Le,vertOriginX:Le,vertOriginY:Le,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Le,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:_A}),RA=Cl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),OA=Cl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:NA}),IA=Cl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),aH={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"},oH=/[A-Z]/g,xS=/-[a-z]/g,lH=/^data[-\w.:]+$/i;function ip(e,t){const n=xc(t);let r=t,i=kr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&lH.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(xS,cH);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!xS.test(o)){let l=o.replace(oH,uH);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=D1}return new i(r,t)}function uH(e){return"-"+e.toLowerCase()}function cH(e){return e.charAt(1).toUpperCase()}const Ic=kA([AA,sH,RA,OA,IA],"html"),fa=kA([AA,iH,RA,OA,IA],"svg");function yS(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,o=!1;for(;!o;){r===-1&&(r=n.length,o=!0);const l=n.slice(i,r).trim();(l||!o)&&t.push(l),i=r+1,r=n.indexOf(",",i)}return t}function LA(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const ES=/[#.]/g;function fH(e,t){const n=e||"",r={};let i=0,o,l;for(;i<n.length;){ES.lastIndex=i;const c=ES.exec(n),f=n.slice(i,c?c.index:n.length);f&&(o?o==="#"?r.id=f:Array.isArray(r.className)?r.className.push(f):r.className=[f]:l=f,i+=f.length),c&&(o=c[0],i++)}return{type:"element",tagName:l||t||"div",properties:r,children:[]}}function TS(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function MA(e){return e.join(" ").trim()}function DA(e,t,n){const r=n?mH(n):void 0;function i(o,l,...c){let f;if(o==null){f={type:"root",children:[]};const d=l;c.unshift(d)}else{f=fH(o,t);const d=f.tagName.toLowerCase(),m=r?r.get(d):void 0;if(f.tagName=m||d,dH(l))c.unshift(l);else for(const[p,b]of Object.entries(l))hH(e,f.properties,p,b)}for(const d of c)hb(f.children,d);return f.type==="element"&&f.tagName==="template"&&(f.content={type:"root",children:f.children},f.children=[]),f}return i}function dH(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const i=t[r];if(i&&typeof i=="object"){if(!Array.isArray(i))return!0;const o=i;for(const l of o)if(typeof l!="number"&&typeof l!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function hH(e,t,n,r){const i=ip(e,n);let o;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;o=r}else typeof r=="boolean"?o=r:typeof r=="string"?i.spaceSeparated?o=TS(r):i.commaSeparated?o=yS(r):i.commaOrSpaceSeparated?o=TS(yS(r).join(" ")):o=vS(i,i.property,r):Array.isArray(r)?o=[...r]:o=i.property==="style"?pH(r):String(r);if(Array.isArray(o)){const l=[];for(const c of o)l.push(vS(i,i.property,c));o=l}i.property==="className"&&Array.isArray(t.className)&&(o=t.className.concat(o)),t[i.property]=o}}function hb(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)hb(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?hb(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function vS(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||xc(n)===xc(t)))return!0}return n}function pH(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function mH(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const gH=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],bH=DA(Ic,"div"),xH=DA(fa,"g",gH);function yH(e){const t=String(e),n=[];return{toOffset:i,toPoint:r};function r(o){if(typeof o=="number"&&o>-1&&o<=t.length){let l=0;for(;;){let c=n[l];if(c===void 0){const f=SS(t,n[l-1]);c=f===-1?t.length+1:f+1,n[l]=c}if(c>o)return{line:l+1,column:o-(l>0?n[l-1]:0)+1,offset:o};l++}}}function i(o){if(o&&typeof o.line=="number"&&typeof o.column=="number"&&!Number.isNaN(o.line)&&!Number.isNaN(o.column)){for(;n.length<o.line;){const c=n[n.length-1],f=SS(t,c),d=f===-1?t.length+1:f+1;if(c===d)break;n.push(d)}const l=(o.line>1?n[o.line-2]:0)+o.column-1;if(l<n[o.line-1])return l}}}function SS(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
|
|
352
|
-
`,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const qa={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},PA={}.hasOwnProperty,EH=Object.prototype;function TH(e,t){const n=t||{};return P1({file:n.file||void 0,location:!1,schema:n.space==="svg"?fa:Ic,verbose:n.verbose||!1},e)}function P1(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},$d(e,r,n),n}case"#document":case"#document-fragment":{const r=t,i="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:jA(e,t.childNodes),data:{quirksMode:i}},e.file&&e.location){const o=String(e.file),l=yH(o),c=l.toPoint(0),f=l.toPoint(o.length);n.position={start:c,end:f}}return n}case"#documentType":{const r=t;return n={type:"doctype"},$d(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},$d(e,r,n),n}default:return n=vH(e,t),n}}function jA(e,t){let n=-1;const r=[];for(;++n<t.length;){const i=P1(e,t[n]);r.push(i)}return r}function vH(e,t){const n=e.schema;e.schema=t.namespaceURI===qa.svg?fa:Ic;let r=-1;const i={};for(;++r<t.attrs.length;){const c=t.attrs[r],f=(c.prefix?c.prefix+":":"")+c.name;PA.call(EH,f)||(i[f]=c.value)}const l=(e.schema.space==="svg"?xH:bH)(t.tagName,i,jA(e,t.childNodes));if($d(e,t,l),l.tagName==="template"){const c=t,f=c.sourceCodeLocation,d=f&&f.startTag&&ol(f.startTag),m=f&&f.endTag&&ol(f.endTag),p=P1(e,c.content);d&&m&&e.file&&(p.position={start:d.end,end:m.start}),l.content=p}return e.schema=n,l}function $d(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=SH(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function SH(e,t,n){const r=ol(n);if(t.type==="element"){const i=t.children[t.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),e.verbose){const o={};let l;if(n.attrs)for(l in n.attrs)PA.call(n.attrs,l)&&(o[ip(e.schema,l).property]=ol(n.attrs[l]));n.startTag;const c=ol(n.startTag),f=n.endTag?ol(n.endTag):void 0,d={opening:c};f&&(d.closing=f),d.properties=o,t.data={position:d}}}return r}function ol(e){const t=CS({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=CS({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function CS(e){return e.line&&e.column?e:void 0}const wS={}.hasOwnProperty;function BA(e,t){const n=t||{};function r(i,...o){let l=r.invalid;const c=r.handlers;if(i&&wS.call(i,e)){const f=String(i[e]);l=wS.call(c,f)?c[f]:r.unknown}if(l)return l.call(this,i,...o)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const CH={},wH={}.hasOwnProperty,HA=BA("type",{handlers:{root:AH,element:IH,text:RH,comment:OH,doctype:NH}});function kH(e,t){const r=(t||CH).space;return HA(e,r==="svg"?fa:Ic)}function AH(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=j1(e.children,n,t),wl(e,n),n}function _H(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=j1(e.children,n,t),wl(e,n),n}function NH(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return wl(e,t),t}function RH(e){const t={nodeName:"#text",value:e.value,parentNode:null};return wl(e,t),t}function OH(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return wl(e,t),t}function IH(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=fa);const i=[];let o;if(e.properties){for(o in e.properties)if(o!=="children"&&wH.call(e.properties,o)){const f=LH(r,o,e.properties[o]);f&&i.push(f)}}const l=r.space,c={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:qa[l],childNodes:[],parentNode:null};return c.childNodes=j1(e.children,c,r),wl(e,c),e.tagName==="template"&&e.content&&(c.content=_H(e.content,r)),c}function LH(e,t,n){const r=ip(e,t);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?LA(n):MA(n));const i={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const o=i.name.indexOf(":");o<0?i.prefix="":(i.name=i.name.slice(o+1),i.prefix=r.attribute.slice(0,o)),i.namespace=qa[r.space]}return i}function j1(e,t,n){let r=-1;const i=[];if(e)for(;++r<e.length;){const o=HA(e[r],n);o.parentNode=t,i.push(o)}return i}function wl(e,t){const n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}const MH=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],DH=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),cn="�";var F;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(F||(F={}));const Er={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function UA(e){return e>=55296&&e<=57343}function PH(e){return e>=56320&&e<=57343}function jH(e,t){return(e-55296)*1024+9216+t}function zA(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function FA(e){return e>=64976&&e<=65007||DH.has(e)}var Ee;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(Ee||(Ee={}));const BH=65536;class HH{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=BH,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:r,col:i,offset:o}=this,l=i+n,c=o+n;return{code:t,startLine:r,endLine:r,startCol:l,endCol:l,startOffset:c,endOffset:c}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(PH(n))return this.pos++,this._addGap(),jH(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,F.EOF;return this._err(Ee.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let r=0;r<t.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==t.charCodeAt(r))return!1;return!0}peek(t){const n=this.pos+t;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,F.EOF;const r=this.html.charCodeAt(n);return r===F.CARRIAGE_RETURN?F.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,F.EOF;let t=this.html.charCodeAt(this.pos);return t===F.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,F.LINE_FEED):t===F.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,UA(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===F.LINE_FEED||t===F.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){zA(t)?this._err(Ee.controlCharacterInInputStream):FA(t)&&this._err(Ee.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var Tt;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(Tt||(Tt={}));function VA(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const UH=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),zH=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function FH(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=zH.get(e))!==null&&t!==void 0?t:e}var zn;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(zn||(zn={}));const VH=32;var Wi;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Wi||(Wi={}));function pb(e){return e>=zn.ZERO&&e<=zn.NINE}function $H(e){return e>=zn.UPPER_A&&e<=zn.UPPER_F||e>=zn.LOWER_A&&e<=zn.LOWER_F}function qH(e){return e>=zn.UPPER_A&&e<=zn.UPPER_Z||e>=zn.LOWER_A&&e<=zn.LOWER_Z||pb(e)}function YH(e){return e===zn.EQUALS||qH(e)}var Bn;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Bn||(Bn={}));var ri;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(ri||(ri={}));class GH{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=Bn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=ri.Strict}startEntity(t){this.decodeMode=t,this.state=Bn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Bn.EntityStart:return t.charCodeAt(n)===zn.NUM?(this.state=Bn.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Bn.NamedEntity,this.stateNamedEntity(t,n));case Bn.NumericStart:return this.stateNumericStart(t,n);case Bn.NumericDecimal:return this.stateNumericDecimal(t,n);case Bn.NumericHex:return this.stateNumericHex(t,n);case Bn.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|VH)===zn.LOWER_X?(this.state=Bn.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Bn.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,i){if(n!==r){const o=r-n;this.result=this.result*Math.pow(i,o)+Number.parseInt(t.substr(n,o),i),this.consumed+=o}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(pb(i)||$H(i))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(i,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(pb(i))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(i,2)}return this.addToNumericResult(t,r,n,10),-1}emitNumericEntity(t,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===zn.SEMI)this.consumed+=1;else if(this.decodeMode===ri.Strict)return 0;return this.emitCodePoint(FH(this.result),this.consumed),this.errors&&(t!==zn.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let i=r[this.treeIndex],o=(i&Wi.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const l=t.charCodeAt(n);if(this.treeIndex=XH(r,i,this.treeIndex+Math.max(1,o),l),this.treeIndex<0)return this.result===0||this.decodeMode===ri.Attribute&&(o===0||YH(l))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],o=(i&Wi.VALUE_LENGTH)>>14,o!==0){if(l===zn.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==ri.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,i=(r[n]&Wi.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[t]&~Wi.VALUE_LENGTH:i[t+1],r),n===3&&this.emitCodePoint(i[t+2],r),r}end(){var t;switch(this.state){case Bn.NamedEntity:return this.result!==0&&(this.decodeMode!==ri.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Bn.NumericDecimal:return this.emitNumericEntity(0,2);case Bn.NumericHex:return this.emitNumericEntity(0,3);case Bn.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Bn.EntityStart:return 0}}}function XH(e,t,n,r){const i=(t&Wi.BRANCH_LENGTH)>>7,o=t&Wi.JUMP_TABLE;if(i===0)return o!==0&&r===o?n:-1;if(o){const f=r-o;return f<0||f>=i?-1:e[n+f]-1}let l=n,c=l+i-1;for(;l<=c;){const f=l+c>>>1,d=e[f];if(d<r)l=f+1;else if(d>r)c=f-1;else return e[f+i]}return-1}var Ne;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(Ne||(Ne={}));var Qa;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(Qa||(Qa={}));var Wr;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(Wr||(Wr={}));var pe;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(pe||(pe={}));var v;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(v||(v={}));const KH=new Map([[pe.A,v.A],[pe.ADDRESS,v.ADDRESS],[pe.ANNOTATION_XML,v.ANNOTATION_XML],[pe.APPLET,v.APPLET],[pe.AREA,v.AREA],[pe.ARTICLE,v.ARTICLE],[pe.ASIDE,v.ASIDE],[pe.B,v.B],[pe.BASE,v.BASE],[pe.BASEFONT,v.BASEFONT],[pe.BGSOUND,v.BGSOUND],[pe.BIG,v.BIG],[pe.BLOCKQUOTE,v.BLOCKQUOTE],[pe.BODY,v.BODY],[pe.BR,v.BR],[pe.BUTTON,v.BUTTON],[pe.CAPTION,v.CAPTION],[pe.CENTER,v.CENTER],[pe.CODE,v.CODE],[pe.COL,v.COL],[pe.COLGROUP,v.COLGROUP],[pe.DD,v.DD],[pe.DESC,v.DESC],[pe.DETAILS,v.DETAILS],[pe.DIALOG,v.DIALOG],[pe.DIR,v.DIR],[pe.DIV,v.DIV],[pe.DL,v.DL],[pe.DT,v.DT],[pe.EM,v.EM],[pe.EMBED,v.EMBED],[pe.FIELDSET,v.FIELDSET],[pe.FIGCAPTION,v.FIGCAPTION],[pe.FIGURE,v.FIGURE],[pe.FONT,v.FONT],[pe.FOOTER,v.FOOTER],[pe.FOREIGN_OBJECT,v.FOREIGN_OBJECT],[pe.FORM,v.FORM],[pe.FRAME,v.FRAME],[pe.FRAMESET,v.FRAMESET],[pe.H1,v.H1],[pe.H2,v.H2],[pe.H3,v.H3],[pe.H4,v.H4],[pe.H5,v.H5],[pe.H6,v.H6],[pe.HEAD,v.HEAD],[pe.HEADER,v.HEADER],[pe.HGROUP,v.HGROUP],[pe.HR,v.HR],[pe.HTML,v.HTML],[pe.I,v.I],[pe.IMG,v.IMG],[pe.IMAGE,v.IMAGE],[pe.INPUT,v.INPUT],[pe.IFRAME,v.IFRAME],[pe.KEYGEN,v.KEYGEN],[pe.LABEL,v.LABEL],[pe.LI,v.LI],[pe.LINK,v.LINK],[pe.LISTING,v.LISTING],[pe.MAIN,v.MAIN],[pe.MALIGNMARK,v.MALIGNMARK],[pe.MARQUEE,v.MARQUEE],[pe.MATH,v.MATH],[pe.MENU,v.MENU],[pe.META,v.META],[pe.MGLYPH,v.MGLYPH],[pe.MI,v.MI],[pe.MO,v.MO],[pe.MN,v.MN],[pe.MS,v.MS],[pe.MTEXT,v.MTEXT],[pe.NAV,v.NAV],[pe.NOBR,v.NOBR],[pe.NOFRAMES,v.NOFRAMES],[pe.NOEMBED,v.NOEMBED],[pe.NOSCRIPT,v.NOSCRIPT],[pe.OBJECT,v.OBJECT],[pe.OL,v.OL],[pe.OPTGROUP,v.OPTGROUP],[pe.OPTION,v.OPTION],[pe.P,v.P],[pe.PARAM,v.PARAM],[pe.PLAINTEXT,v.PLAINTEXT],[pe.PRE,v.PRE],[pe.RB,v.RB],[pe.RP,v.RP],[pe.RT,v.RT],[pe.RTC,v.RTC],[pe.RUBY,v.RUBY],[pe.S,v.S],[pe.SCRIPT,v.SCRIPT],[pe.SEARCH,v.SEARCH],[pe.SECTION,v.SECTION],[pe.SELECT,v.SELECT],[pe.SOURCE,v.SOURCE],[pe.SMALL,v.SMALL],[pe.SPAN,v.SPAN],[pe.STRIKE,v.STRIKE],[pe.STRONG,v.STRONG],[pe.STYLE,v.STYLE],[pe.SUB,v.SUB],[pe.SUMMARY,v.SUMMARY],[pe.SUP,v.SUP],[pe.TABLE,v.TABLE],[pe.TBODY,v.TBODY],[pe.TEMPLATE,v.TEMPLATE],[pe.TEXTAREA,v.TEXTAREA],[pe.TFOOT,v.TFOOT],[pe.TD,v.TD],[pe.TH,v.TH],[pe.THEAD,v.THEAD],[pe.TITLE,v.TITLE],[pe.TR,v.TR],[pe.TRACK,v.TRACK],[pe.TT,v.TT],[pe.U,v.U],[pe.UL,v.UL],[pe.SVG,v.SVG],[pe.VAR,v.VAR],[pe.WBR,v.WBR],[pe.XMP,v.XMP]]);function kl(e){var t;return(t=KH.get(e))!==null&&t!==void 0?t:v.UNKNOWN}const Oe=v,QH={[Ne.HTML]:new Set([Oe.ADDRESS,Oe.APPLET,Oe.AREA,Oe.ARTICLE,Oe.ASIDE,Oe.BASE,Oe.BASEFONT,Oe.BGSOUND,Oe.BLOCKQUOTE,Oe.BODY,Oe.BR,Oe.BUTTON,Oe.CAPTION,Oe.CENTER,Oe.COL,Oe.COLGROUP,Oe.DD,Oe.DETAILS,Oe.DIR,Oe.DIV,Oe.DL,Oe.DT,Oe.EMBED,Oe.FIELDSET,Oe.FIGCAPTION,Oe.FIGURE,Oe.FOOTER,Oe.FORM,Oe.FRAME,Oe.FRAMESET,Oe.H1,Oe.H2,Oe.H3,Oe.H4,Oe.H5,Oe.H6,Oe.HEAD,Oe.HEADER,Oe.HGROUP,Oe.HR,Oe.HTML,Oe.IFRAME,Oe.IMG,Oe.INPUT,Oe.LI,Oe.LINK,Oe.LISTING,Oe.MAIN,Oe.MARQUEE,Oe.MENU,Oe.META,Oe.NAV,Oe.NOEMBED,Oe.NOFRAMES,Oe.NOSCRIPT,Oe.OBJECT,Oe.OL,Oe.P,Oe.PARAM,Oe.PLAINTEXT,Oe.PRE,Oe.SCRIPT,Oe.SECTION,Oe.SELECT,Oe.SOURCE,Oe.STYLE,Oe.SUMMARY,Oe.TABLE,Oe.TBODY,Oe.TD,Oe.TEMPLATE,Oe.TEXTAREA,Oe.TFOOT,Oe.TH,Oe.THEAD,Oe.TITLE,Oe.TR,Oe.TRACK,Oe.UL,Oe.WBR,Oe.XMP]),[Ne.MATHML]:new Set([Oe.MI,Oe.MO,Oe.MN,Oe.MS,Oe.MTEXT,Oe.ANNOTATION_XML]),[Ne.SVG]:new Set([Oe.TITLE,Oe.FOREIGN_OBJECT,Oe.DESC]),[Ne.XLINK]:new Set,[Ne.XML]:new Set,[Ne.XMLNS]:new Set},mb=new Set([Oe.H1,Oe.H2,Oe.H3,Oe.H4,Oe.H5,Oe.H6]);pe.STYLE,pe.SCRIPT,pe.XMP,pe.IFRAME,pe.NOEMBED,pe.NOFRAMES,pe.PLAINTEXT;var X;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(X||(X={}));const Sn={DATA:X.DATA,RCDATA:X.RCDATA,RAWTEXT:X.RAWTEXT,SCRIPT_DATA:X.SCRIPT_DATA,PLAINTEXT:X.PLAINTEXT,CDATA_SECTION:X.CDATA_SECTION};function WH(e){return e>=F.DIGIT_0&&e<=F.DIGIT_9}function Vu(e){return e>=F.LATIN_CAPITAL_A&&e<=F.LATIN_CAPITAL_Z}function ZH(e){return e>=F.LATIN_SMALL_A&&e<=F.LATIN_SMALL_Z}function Vi(e){return ZH(e)||Vu(e)}function kS(e){return Vi(e)||WH(e)}function Cd(e){return e+32}function $A(e){return e===F.SPACE||e===F.LINE_FEED||e===F.TABULATION||e===F.FORM_FEED}function AS(e){return $A(e)||e===F.SOLIDUS||e===F.GREATER_THAN_SIGN}function JH(e){return e===F.NULL?Ee.nullCharacterReference:e>1114111?Ee.characterReferenceOutsideUnicodeRange:UA(e)?Ee.surrogateCharacterReference:FA(e)?Ee.noncharacterCharacterReference:zA(e)||e===F.CARRIAGE_RETURN?Ee.controlCharacterReference:null}class eU{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=X.DATA,this.returnState=X.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new HH(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new GH(UH,(r,i)=>{this.preprocessor.pos=this.entityStartPos+i-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(Ee.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(Ee.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const i=JH(r);i&&this._err(i,1)}}:void 0)}_err(t,n=0){var r,i;(i=(r=this.handler).onParseError)===null||i===void 0||i.call(r,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t?.())}write(t,n,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r?.()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n<t;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(t,n){return this.preprocessor.startsWith(t,n)?(this._advanceBy(t.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:Tt.START_TAG,tagName:"",tagID:v.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:Tt.END_TAG,tagName:"",tagID:v.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:Tt.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:Tt.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(t,n){this.currentCharacterToken={type:t,chars:n,location:this.currentLocation}}_createAttr(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var t,n;const r=this.currentToken;if(VA(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const i=(t=(n=r.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);i[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(Ee.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this._emitCurrentCharacterToken(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const t=this.currentToken;this.prepareToken(t),t.tagID=kl(t.tagName),t.type===Tt.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(Ee.endTagWithAttributes),t.selfClosing&&this._err(Ee.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case Tt.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case Tt.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case Tt.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:Tt.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=$A(t)?Tt.WHITESPACE_CHARACTER:t===F.NULL?Tt.NULL_CHARACTER:Tt.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(Tt.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=X.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?ri.Attribute:ri.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===X.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===X.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===X.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case X.DATA:{this._stateData(t);break}case X.RCDATA:{this._stateRcdata(t);break}case X.RAWTEXT:{this._stateRawtext(t);break}case X.SCRIPT_DATA:{this._stateScriptData(t);break}case X.PLAINTEXT:{this._statePlaintext(t);break}case X.TAG_OPEN:{this._stateTagOpen(t);break}case X.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case X.TAG_NAME:{this._stateTagName(t);break}case X.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case X.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case X.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case X.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case X.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case X.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case X.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case X.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case X.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case X.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case X.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case X.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case X.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case X.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case X.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case X.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case X.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case X.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case X.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case X.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case X.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case X.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case X.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case X.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case X.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case X.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case X.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case X.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case X.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case X.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case X.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case X.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case X.BOGUS_COMMENT:{this._stateBogusComment(t);break}case X.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case X.COMMENT_START:{this._stateCommentStart(t);break}case X.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case X.COMMENT:{this._stateComment(t);break}case X.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case X.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case X.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case X.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case X.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case X.COMMENT_END:{this._stateCommentEnd(t);break}case X.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case X.DOCTYPE:{this._stateDoctype(t);break}case X.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case X.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case X.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case X.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case X.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case X.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case X.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case X.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case X.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case X.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case X.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case X.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case X.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case X.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case X.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case X.CDATA_SECTION:{this._stateCdataSection(t);break}case X.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case X.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case X.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case X.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case F.LESS_THAN_SIGN:{this.state=X.TAG_OPEN;break}case F.AMPERSAND:{this._startCharacterReference();break}case F.NULL:{this._err(Ee.unexpectedNullCharacter),this._emitCodePoint(t);break}case F.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case F.AMPERSAND:{this._startCharacterReference();break}case F.LESS_THAN_SIGN:{this.state=X.RCDATA_LESS_THAN_SIGN;break}case F.NULL:{this._err(Ee.unexpectedNullCharacter),this._emitChars(cn);break}case F.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case F.LESS_THAN_SIGN:{this.state=X.RAWTEXT_LESS_THAN_SIGN;break}case F.NULL:{this._err(Ee.unexpectedNullCharacter),this._emitChars(cn);break}case F.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case F.LESS_THAN_SIGN:{this.state=X.SCRIPT_DATA_LESS_THAN_SIGN;break}case F.NULL:{this._err(Ee.unexpectedNullCharacter),this._emitChars(cn);break}case F.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case F.NULL:{this._err(Ee.unexpectedNullCharacter),this._emitChars(cn);break}case F.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(Vi(t))this._createStartTagToken(),this.state=X.TAG_NAME,this._stateTagName(t);else switch(t){case F.EXCLAMATION_MARK:{this.state=X.MARKUP_DECLARATION_OPEN;break}case F.SOLIDUS:{this.state=X.END_TAG_OPEN;break}case F.QUESTION_MARK:{this._err(Ee.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=X.BOGUS_COMMENT,this._stateBogusComment(t);break}case F.EOF:{this._err(Ee.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(Ee.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=X.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(Vi(t))this._createEndTagToken(),this.state=X.TAG_NAME,this._stateTagName(t);else switch(t){case F.GREATER_THAN_SIGN:{this._err(Ee.missingEndTagName),this.state=X.DATA;break}case F.EOF:{this._err(Ee.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(Ee.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=X.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:{this.state=X.BEFORE_ATTRIBUTE_NAME;break}case F.SOLIDUS:{this.state=X.SELF_CLOSING_START_TAG;break}case F.GREATER_THAN_SIGN:{this.state=X.DATA,this.emitCurrentTagToken();break}case F.NULL:{this._err(Ee.unexpectedNullCharacter),n.tagName+=cn;break}case F.EOF:{this._err(Ee.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(Vu(t)?Cd(t):t)}}_stateRcdataLessThanSign(t){t===F.SOLIDUS?this.state=X.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=X.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){Vi(t)?(this.state=X.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=X.RCDATA,this._stateRcdata(t))}handleSpecialEndTag(t){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=X.BEFORE_ATTRIBUTE_NAME,!1;case F.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=X.SELF_CLOSING_START_TAG,!1;case F.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=X.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=X.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===F.SOLIDUS?this.state=X.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=X.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){Vi(t)?(this.state=X.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=X.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=X.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case F.SOLIDUS:{this.state=X.SCRIPT_DATA_END_TAG_OPEN;break}case F.EXCLAMATION_MARK:{this.state=X.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=X.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){Vi(t)?(this.state=X.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=X.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=X.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===F.HYPHEN_MINUS?(this.state=X.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=X.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===F.HYPHEN_MINUS?(this.state=X.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=X.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case F.HYPHEN_MINUS:{this.state=X.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case F.LESS_THAN_SIGN:{this.state=X.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case F.NULL:{this._err(Ee.unexpectedNullCharacter),this._emitChars(cn);break}case F.EOF:{this._err(Ee.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case F.HYPHEN_MINUS:{this.state=X.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case F.LESS_THAN_SIGN:{this.state=X.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case F.NULL:{this._err(Ee.unexpectedNullCharacter),this.state=X.SCRIPT_DATA_ESCAPED,this._emitChars(cn);break}case F.EOF:{this._err(Ee.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=X.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case F.HYPHEN_MINUS:{this._emitChars("-");break}case F.LESS_THAN_SIGN:{this.state=X.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case F.GREATER_THAN_SIGN:{this.state=X.SCRIPT_DATA,this._emitChars(">");break}case F.NULL:{this._err(Ee.unexpectedNullCharacter),this.state=X.SCRIPT_DATA_ESCAPED,this._emitChars(cn);break}case F.EOF:{this._err(Ee.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=X.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===F.SOLIDUS?this.state=X.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Vi(t)?(this._emitChars("<"),this.state=X.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=X.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){Vi(t)?(this.state=X.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=X.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=X.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(Er.SCRIPT,!1)&&AS(this.preprocessor.peek(Er.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Er.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=X.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case F.HYPHEN_MINUS:{this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case F.LESS_THAN_SIGN:{this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case F.NULL:{this._err(Ee.unexpectedNullCharacter),this._emitChars(cn);break}case F.EOF:{this._err(Ee.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case F.HYPHEN_MINUS:{this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case F.LESS_THAN_SIGN:{this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case F.NULL:{this._err(Ee.unexpectedNullCharacter),this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(cn);break}case F.EOF:{this._err(Ee.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case F.HYPHEN_MINUS:{this._emitChars("-");break}case F.LESS_THAN_SIGN:{this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case F.GREATER_THAN_SIGN:{this.state=X.SCRIPT_DATA,this._emitChars(">");break}case F.NULL:{this._err(Ee.unexpectedNullCharacter),this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(cn);break}case F.EOF:{this._err(Ee.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===F.SOLIDUS?(this.state=X.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(Er.SCRIPT,!1)&&AS(this.preprocessor.peek(Er.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Er.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=X.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:break;case F.SOLIDUS:case F.GREATER_THAN_SIGN:case F.EOF:{this.state=X.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case F.EQUALS_SIGN:{this._err(Ee.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=X.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=X.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:case F.SOLIDUS:case F.GREATER_THAN_SIGN:case F.EOF:{this._leaveAttrName(),this.state=X.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case F.EQUALS_SIGN:{this._leaveAttrName(),this.state=X.BEFORE_ATTRIBUTE_VALUE;break}case F.QUOTATION_MARK:case F.APOSTROPHE:case F.LESS_THAN_SIGN:{this._err(Ee.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case F.NULL:{this._err(Ee.unexpectedNullCharacter),this.currentAttr.name+=cn;break}default:this.currentAttr.name+=String.fromCodePoint(Vu(t)?Cd(t):t)}}_stateAfterAttributeName(t){switch(t){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:break;case F.SOLIDUS:{this.state=X.SELF_CLOSING_START_TAG;break}case F.EQUALS_SIGN:{this.state=X.BEFORE_ATTRIBUTE_VALUE;break}case F.GREATER_THAN_SIGN:{this.state=X.DATA,this.emitCurrentTagToken();break}case F.EOF:{this._err(Ee.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=X.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:break;case F.QUOTATION_MARK:{this.state=X.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case F.APOSTROPHE:{this.state=X.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case F.GREATER_THAN_SIGN:{this._err(Ee.missingAttributeValue),this.state=X.DATA,this.emitCurrentTagToken();break}default:this.state=X.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case F.QUOTATION_MARK:{this.state=X.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case F.AMPERSAND:{this._startCharacterReference();break}case F.NULL:{this._err(Ee.unexpectedNullCharacter),this.currentAttr.value+=cn;break}case F.EOF:{this._err(Ee.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case F.APOSTROPHE:{this.state=X.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case F.AMPERSAND:{this._startCharacterReference();break}case F.NULL:{this._err(Ee.unexpectedNullCharacter),this.currentAttr.value+=cn;break}case F.EOF:{this._err(Ee.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:{this._leaveAttrValue(),this.state=X.BEFORE_ATTRIBUTE_NAME;break}case F.AMPERSAND:{this._startCharacterReference();break}case F.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=X.DATA,this.emitCurrentTagToken();break}case F.NULL:{this._err(Ee.unexpectedNullCharacter),this.currentAttr.value+=cn;break}case F.QUOTATION_MARK:case F.APOSTROPHE:case F.LESS_THAN_SIGN:case F.EQUALS_SIGN:case F.GRAVE_ACCENT:{this._err(Ee.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case F.EOF:{this._err(Ee.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:{this._leaveAttrValue(),this.state=X.BEFORE_ATTRIBUTE_NAME;break}case F.SOLIDUS:{this._leaveAttrValue(),this.state=X.SELF_CLOSING_START_TAG;break}case F.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=X.DATA,this.emitCurrentTagToken();break}case F.EOF:{this._err(Ee.eofInTag),this._emitEOFToken();break}default:this._err(Ee.missingWhitespaceBetweenAttributes),this.state=X.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case F.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=X.DATA,this.emitCurrentTagToken();break}case F.EOF:{this._err(Ee.eofInTag),this._emitEOFToken();break}default:this._err(Ee.unexpectedSolidusInTag),this.state=X.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case F.GREATER_THAN_SIGN:{this.state=X.DATA,this.emitCurrentComment(n);break}case F.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case F.NULL:{this._err(Ee.unexpectedNullCharacter),n.data+=cn;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(Er.DASH_DASH,!0)?(this._createCommentToken(Er.DASH_DASH.length+1),this.state=X.COMMENT_START):this._consumeSequenceIfMatch(Er.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Er.DOCTYPE.length+1),this.state=X.DOCTYPE):this._consumeSequenceIfMatch(Er.CDATA_START,!0)?this.inForeignNode?this.state=X.CDATA_SECTION:(this._err(Ee.cdataInHtmlContent),this._createCommentToken(Er.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=X.BOGUS_COMMENT):this._ensureHibernation()||(this._err(Ee.incorrectlyOpenedComment),this._createCommentToken(2),this.state=X.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case F.HYPHEN_MINUS:{this.state=X.COMMENT_START_DASH;break}case F.GREATER_THAN_SIGN:{this._err(Ee.abruptClosingOfEmptyComment),this.state=X.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=X.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case F.HYPHEN_MINUS:{this.state=X.COMMENT_END;break}case F.GREATER_THAN_SIGN:{this._err(Ee.abruptClosingOfEmptyComment),this.state=X.DATA,this.emitCurrentComment(n);break}case F.EOF:{this._err(Ee.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=X.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case F.HYPHEN_MINUS:{this.state=X.COMMENT_END_DASH;break}case F.LESS_THAN_SIGN:{n.data+="<",this.state=X.COMMENT_LESS_THAN_SIGN;break}case F.NULL:{this._err(Ee.unexpectedNullCharacter),n.data+=cn;break}case F.EOF:{this._err(Ee.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case F.EXCLAMATION_MARK:{n.data+="!",this.state=X.COMMENT_LESS_THAN_SIGN_BANG;break}case F.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=X.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===F.HYPHEN_MINUS?this.state=X.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=X.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===F.HYPHEN_MINUS?this.state=X.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=X.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==F.GREATER_THAN_SIGN&&t!==F.EOF&&this._err(Ee.nestedComment),this.state=X.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case F.HYPHEN_MINUS:{this.state=X.COMMENT_END;break}case F.EOF:{this._err(Ee.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=X.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case F.GREATER_THAN_SIGN:{this.state=X.DATA,this.emitCurrentComment(n);break}case F.EXCLAMATION_MARK:{this.state=X.COMMENT_END_BANG;break}case F.HYPHEN_MINUS:{n.data+="-";break}case F.EOF:{this._err(Ee.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=X.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case F.HYPHEN_MINUS:{n.data+="--!",this.state=X.COMMENT_END_DASH;break}case F.GREATER_THAN_SIGN:{this._err(Ee.incorrectlyClosedComment),this.state=X.DATA,this.emitCurrentComment(n);break}case F.EOF:{this._err(Ee.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=X.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:{this.state=X.BEFORE_DOCTYPE_NAME;break}case F.GREATER_THAN_SIGN:{this.state=X.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case F.EOF:{this._err(Ee.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Ee.missingWhitespaceBeforeDoctypeName),this.state=X.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(Vu(t))this._createDoctypeToken(String.fromCharCode(Cd(t))),this.state=X.DOCTYPE_NAME;else switch(t){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:break;case F.NULL:{this._err(Ee.unexpectedNullCharacter),this._createDoctypeToken(cn),this.state=X.DOCTYPE_NAME;break}case F.GREATER_THAN_SIGN:{this._err(Ee.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=X.DATA;break}case F.EOF:{this._err(Ee.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=X.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:{this.state=X.AFTER_DOCTYPE_NAME;break}case F.GREATER_THAN_SIGN:{this.state=X.DATA,this.emitCurrentDoctype(n);break}case F.NULL:{this._err(Ee.unexpectedNullCharacter),n.name+=cn;break}case F.EOF:{this._err(Ee.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(Vu(t)?Cd(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:break;case F.GREATER_THAN_SIGN:{this.state=X.DATA,this.emitCurrentDoctype(n);break}case F.EOF:{this._err(Ee.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Er.PUBLIC,!1)?this.state=X.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Er.SYSTEM,!1)?this.state=X.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(Ee.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:{this.state=X.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case F.QUOTATION_MARK:{this._err(Ee.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=X.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case F.APOSTROPHE:{this._err(Ee.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=X.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case F.GREATER_THAN_SIGN:{this._err(Ee.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=X.DATA,this.emitCurrentDoctype(n);break}case F.EOF:{this._err(Ee.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Ee.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:break;case F.QUOTATION_MARK:{n.publicId="",this.state=X.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case F.APOSTROPHE:{n.publicId="",this.state=X.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case F.GREATER_THAN_SIGN:{this._err(Ee.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=X.DATA,this.emitCurrentDoctype(n);break}case F.EOF:{this._err(Ee.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Ee.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case F.QUOTATION_MARK:{this.state=X.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case F.NULL:{this._err(Ee.unexpectedNullCharacter),n.publicId+=cn;break}case F.GREATER_THAN_SIGN:{this._err(Ee.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=X.DATA;break}case F.EOF:{this._err(Ee.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case F.APOSTROPHE:{this.state=X.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case F.NULL:{this._err(Ee.unexpectedNullCharacter),n.publicId+=cn;break}case F.GREATER_THAN_SIGN:{this._err(Ee.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=X.DATA;break}case F.EOF:{this._err(Ee.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:{this.state=X.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case F.GREATER_THAN_SIGN:{this.state=X.DATA,this.emitCurrentDoctype(n);break}case F.QUOTATION_MARK:{this._err(Ee.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case F.APOSTROPHE:{this._err(Ee.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case F.EOF:{this._err(Ee.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Ee.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:break;case F.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=X.DATA;break}case F.QUOTATION_MARK:{n.systemId="",this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case F.APOSTROPHE:{n.systemId="",this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case F.EOF:{this._err(Ee.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Ee.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:{this.state=X.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case F.QUOTATION_MARK:{this._err(Ee.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case F.APOSTROPHE:{this._err(Ee.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case F.GREATER_THAN_SIGN:{this._err(Ee.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=X.DATA,this.emitCurrentDoctype(n);break}case F.EOF:{this._err(Ee.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Ee.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:break;case F.QUOTATION_MARK:{n.systemId="",this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case F.APOSTROPHE:{n.systemId="",this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case F.GREATER_THAN_SIGN:{this._err(Ee.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=X.DATA,this.emitCurrentDoctype(n);break}case F.EOF:{this._err(Ee.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Ee.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case F.QUOTATION_MARK:{this.state=X.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case F.NULL:{this._err(Ee.unexpectedNullCharacter),n.systemId+=cn;break}case F.GREATER_THAN_SIGN:{this._err(Ee.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=X.DATA;break}case F.EOF:{this._err(Ee.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case F.APOSTROPHE:{this.state=X.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case F.NULL:{this._err(Ee.unexpectedNullCharacter),n.systemId+=cn;break}case F.GREATER_THAN_SIGN:{this._err(Ee.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=X.DATA;break}case F.EOF:{this._err(Ee.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:break;case F.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=X.DATA;break}case F.EOF:{this._err(Ee.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Ee.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case F.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=X.DATA;break}case F.NULL:{this._err(Ee.unexpectedNullCharacter);break}case F.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case F.RIGHT_SQUARE_BRACKET:{this.state=X.CDATA_SECTION_BRACKET;break}case F.EOF:{this._err(Ee.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===F.RIGHT_SQUARE_BRACKET?this.state=X.CDATA_SECTION_END:(this._emitChars("]"),this.state=X.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case F.GREATER_THAN_SIGN:{this.state=X.DATA;break}case F.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=X.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0)if(this.preprocessor.lastChunkWritten)t=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}t===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(F.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&kS(this.preprocessor.peek(1))?X.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){kS(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===F.SEMICOLON&&this._err(Ee.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const qA=new Set([v.DD,v.DT,v.LI,v.OPTGROUP,v.OPTION,v.P,v.RB,v.RP,v.RT,v.RTC]),_S=new Set([...qA,v.CAPTION,v.COLGROUP,v.TBODY,v.TD,v.TFOOT,v.TH,v.THEAD,v.TR]),yh=new Set([v.APPLET,v.CAPTION,v.HTML,v.MARQUEE,v.OBJECT,v.TABLE,v.TD,v.TEMPLATE,v.TH]),tU=new Set([...yh,v.OL,v.UL]),nU=new Set([...yh,v.BUTTON]),NS=new Set([v.ANNOTATION_XML,v.MI,v.MN,v.MO,v.MS,v.MTEXT]),RS=new Set([v.DESC,v.FOREIGN_OBJECT,v.TITLE]),rU=new Set([v.TR,v.TEMPLATE,v.HTML]),sU=new Set([v.TBODY,v.TFOOT,v.THEAD,v.TEMPLATE,v.HTML]),iU=new Set([v.TABLE,v.TEMPLATE,v.HTML]),aU=new Set([v.TD,v.TH]);class oU{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=v.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===v.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===Ne.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,n){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,n,!0)}pop(){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){const i=this._indexOf(t)+1;this.items.splice(i,0,n),this.tagIDs.splice(i,0,r),this.stackTop++,i===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,i===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==Ne.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<t)}}popUntilElementPopped(t){const n=this._indexOf(t);this.shortenToLength(Math.max(n,0))}popUntilPopped(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(mb,Ne.HTML)}popUntilTableCellPopped(){this.popUntilPopped(aU,Ne.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,n){for(let r=this.stackTop;r>=0;r--)if(t.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(iU,Ne.HTML)}clearBackToTableBodyContext(){this.clearBackTo(sU,Ne.HTML)}clearBackToTableRowContext(){this.clearBackTo(rU,Ne.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===v.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===v.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const i=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case Ne.HTML:{if(i===t)return!0;if(n.has(i))return!1;break}case Ne.SVG:{if(RS.has(i))return!1;break}case Ne.MATHML:{if(NS.has(i))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,yh)}hasInListItemScope(t){return this.hasInDynamicScope(t,tU)}hasInButtonScope(t){return this.hasInDynamicScope(t,nU)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case Ne.HTML:{if(mb.has(n))return!0;if(yh.has(n))return!1;break}case Ne.SVG:{if(RS.has(n))return!1;break}case Ne.MATHML:{if(NS.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Ne.HTML)switch(this.tagIDs[n]){case t:return!0;case v.TABLE:case v.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===Ne.HTML)switch(this.tagIDs[t]){case v.TBODY:case v.THEAD:case v.TFOOT:return!0;case v.TABLE:case v.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Ne.HTML)switch(this.tagIDs[n]){case t:return!0;case v.OPTION:case v.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&qA.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&_S.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&_S.has(this.currentTagId);)this.pop()}}const pg=3;var ws;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(ws||(ws={}));const OS={type:ws.Marker};class lU{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],i=n.length,o=this.treeAdapter.getTagName(t),l=this.treeAdapter.getNamespaceURI(t);for(let c=0;c<this.entries.length;c++){const f=this.entries[c];if(f.type===ws.Marker)break;const{element:d}=f;if(this.treeAdapter.getTagName(d)===o&&this.treeAdapter.getNamespaceURI(d)===l){const m=this.treeAdapter.getAttrList(d);m.length===i&&r.push({idx:c,attrs:m})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<pg)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<pg)return;const i=new Map(n.map(l=>[l.name,l.value]));let o=0;for(let l=0;l<r.length;l++){const c=r[l];c.attrs.every(f=>i.get(f.name)===f.value)&&(o+=1,o>=pg&&this.entries.splice(c.idx,1))}}insertMarker(){this.entries.unshift(OS)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:ws.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:ws.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(OS);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===ws.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===ws.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===ws.Element&&n.element===t)}}const $i={createDocument(){return{nodeName:"#document",mode:Wr.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){const i=e.childNodes.find(o=>o.nodeName==="#documentType");if(i)i.name=t,i.publicId=n,i.systemId=r;else{const o={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};$i.appendChild(e,o)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if($i.isTextNode(n)){n.value+=t;return}}$i.appendChild(e,$i.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&$i.isTextNode(r)?r.value+=t:$i.insertBefore(e,$i.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName==="#text"},isCommentNode(e){return e.nodeName==="#comment"},isDocumentTypeNode(e){return e.nodeName==="#documentType"},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,"tagName")},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},YA="html",uU="about:legacy-compat",cU="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",GA=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],fU=[...GA,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],dU=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),XA=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],hU=[...XA,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function IS(e,t){return t.some(n=>e.startsWith(n))}function pU(e){return e.name===YA&&e.publicId===null&&(e.systemId===null||e.systemId===uU)}function mU(e){if(e.name!==YA)return Wr.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===cU)return Wr.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),dU.has(n))return Wr.QUIRKS;let r=t===null?fU:GA;if(IS(n,r))return Wr.QUIRKS;if(r=t===null?XA:hU,IS(n,r))return Wr.LIMITED_QUIRKS}return Wr.NO_QUIRKS}const LS={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},gU="definitionurl",bU="definitionURL",xU=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),yU=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:Ne.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:Ne.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:Ne.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:Ne.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:Ne.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:Ne.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:Ne.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:Ne.XML}],["xml:space",{prefix:"xml",name:"space",namespace:Ne.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:Ne.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:Ne.XMLNS}]]),EU=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),TU=new Set([v.B,v.BIG,v.BLOCKQUOTE,v.BODY,v.BR,v.CENTER,v.CODE,v.DD,v.DIV,v.DL,v.DT,v.EM,v.EMBED,v.H1,v.H2,v.H3,v.H4,v.H5,v.H6,v.HEAD,v.HR,v.I,v.IMG,v.LI,v.LISTING,v.MENU,v.META,v.NOBR,v.OL,v.P,v.PRE,v.RUBY,v.S,v.SMALL,v.SPAN,v.STRONG,v.STRIKE,v.SUB,v.SUP,v.TABLE,v.TT,v.U,v.UL,v.VAR]);function vU(e){const t=e.tagID;return t===v.FONT&&e.attrs.some(({name:r})=>r===Qa.COLOR||r===Qa.SIZE||r===Qa.FACE)||TU.has(t)}function KA(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===gU){e.attrs[t].name=bU;break}}function QA(e){for(let t=0;t<e.attrs.length;t++){const n=xU.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function B1(e){for(let t=0;t<e.attrs.length;t++){const n=yU.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function SU(e){const t=EU.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=kl(e.tagName))}function CU(e,t){return t===Ne.MATHML&&(e===v.MI||e===v.MO||e===v.MN||e===v.MS||e===v.MTEXT)}function wU(e,t,n){if(t===Ne.MATHML&&e===v.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===Qa.ENCODING){const i=n[r].value.toLowerCase();return i===LS.TEXT_HTML||i===LS.APPLICATION_XML}}return t===Ne.SVG&&(e===v.FOREIGN_OBJECT||e===v.DESC||e===v.TITLE)}function kU(e,t,n,r){return(!r||r===Ne.HTML)&&wU(e,t,n)||(!r||r===Ne.MATHML)&&CU(e,t)}const AU="hidden",_U=8,NU=3;var J;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(J||(J={}));const RU={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},WA=new Set([v.TABLE,v.TBODY,v.TFOOT,v.THEAD,v.TR]),MS={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:$i,onParseError:null};class DS{constructor(t,n,r=null,i=null){this.fragmentContext=r,this.scriptHandler=i,this.currentToken=null,this.stopped=!1,this.insertionMode=J.INITIAL,this.originalInsertionMode=J.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...MS,...t},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n??this.treeAdapter.createDocument(),this.tokenizer=new eU(this.options,this),this.activeFormattingElements=new lU(this.treeAdapter),this.fragmentContextID=r?kl(this.treeAdapter.getTagName(r)):v.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new oU(this.document,this.treeAdapter,this)}static parse(t,n){const r=new this(n);return r.tokenizer.write(t,!0),r.document}static getFragmentParser(t,n){const r={...MS,...n};t??(t=r.treeAdapter.createElement(pe.TEMPLATE,Ne.HTML,[]));const i=r.treeAdapter.createElement("documentmock",Ne.HTML,[]),o=new this(r,i,t);return o.fragmentContextID===v.TEMPLATE&&o.tmplInsertionModeStack.unshift(J.IN_TEMPLATE),o._initTokenizerForFragmentParsing(),o._insertFakeRootElement(),o._resetInsertionMode(),o._findFormInFragmentContext(),o}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,r){var i;if(!this.onParseError)return;const o=(i=t.location)!==null&&i!==void 0?i:RU,l={code:n,startLine:o.startLine,startCol:o.startCol,startOffset:o.startOffset,endLine:r?o.startLine:o.endLine,endCol:r?o.startCol:o.endCol,endOffset:r?o.startOffset:o.endOffset};this.onParseError(l)}onItemPush(t,n,r){var i,o;(o=(i=this.treeAdapter).onItemPush)===null||o===void 0||o.call(i,t),r&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var r,i;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(i=(r=this.treeAdapter).onItemPop)===null||i===void 0||i.call(r,t,this.openElements.current),n){let o,l;this.openElements.stackTop===0&&this.fragmentContext?(o=this.fragmentContext,l=this.fragmentContextID):{current:o,currentTagId:l}=this.openElements,this._setContextModes(o,l)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===Ne.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,Ne.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=J.TEXT}switchToPlaintextParsing(){this.insertionMode=J.TEXT,this.originalInsertionMode=J.IN_BODY,this.tokenizer.state=Sn.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===pe.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==Ne.HTML))switch(this.fragmentContextID){case v.TITLE:case v.TEXTAREA:{this.tokenizer.state=Sn.RCDATA;break}case v.STYLE:case v.XMP:case v.IFRAME:case v.NOEMBED:case v.NOFRAMES:case v.NOSCRIPT:{this.tokenizer.state=Sn.RAWTEXT;break}case v.SCRIPT:{this.tokenizer.state=Sn.SCRIPT_DATA;break}case v.PLAINTEXT:{this.tokenizer.state=Sn.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",i=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,i),t.location){const l=this.treeAdapter.getChildNodes(this.document).find(c=>this.treeAdapter.isDocumentTypeNode(c));l&&this.treeAdapter.setNodeSourceCodeLocation(l,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,t)}}_appendElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){const r=this.treeAdapter.createElement(t,Ne.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,Ne.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(pe.HTML,Ne.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,v.HTML)}_appendCommentNode(t,n){const r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,t.chars,r):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const i=this.treeAdapter.getChildNodes(n),o=r?i.lastIndexOf(r):i.length,l=i[o-1];if(this.treeAdapter.getNodeSourceCodeLocation(l)){const{endLine:f,endCol:d,endOffset:m}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(l,{endLine:f,endCol:d,endOffset:m})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(l,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,i=this.treeAdapter.getTagName(t),o=n.type===Tt.END_TAG&&i===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,o)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,t.tagID===v.SVG&&this.treeAdapter.getTagName(n)===pe.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===Ne.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===v.MGLYPH||t.tagID===v.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,Ne.HTML)}_processToken(t){switch(t.type){case Tt.CHARACTER:{this.onCharacter(t);break}case Tt.NULL_CHARACTER:{this.onNullCharacter(t);break}case Tt.COMMENT:{this.onComment(t);break}case Tt.DOCTYPE:{this.onDoctype(t);break}case Tt.START_TAG:{this._processStartTag(t);break}case Tt.END_TAG:{this.onEndTag(t);break}case Tt.EOF:{this.onEof(t);break}case Tt.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const i=this.treeAdapter.getNamespaceURI(n),o=this.treeAdapter.getAttrList(n);return kU(t,i,o,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(i=>i.type===ws.Marker||this.openElements.contains(i.element)),r=n===-1?t-1:n-1;for(let i=r;i>=0;i--){const o=this.activeFormattingElements.entries[i];this._insertElement(o.token,this.treeAdapter.getNamespaceURI(o.element)),o.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=J.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(v.P),this.openElements.popUntilTagNamePopped(v.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case v.TR:{this.insertionMode=J.IN_ROW;return}case v.TBODY:case v.THEAD:case v.TFOOT:{this.insertionMode=J.IN_TABLE_BODY;return}case v.CAPTION:{this.insertionMode=J.IN_CAPTION;return}case v.COLGROUP:{this.insertionMode=J.IN_COLUMN_GROUP;return}case v.TABLE:{this.insertionMode=J.IN_TABLE;return}case v.BODY:{this.insertionMode=J.IN_BODY;return}case v.FRAMESET:{this.insertionMode=J.IN_FRAMESET;return}case v.SELECT:{this._resetInsertionModeForSelect(t);return}case v.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case v.HTML:{this.insertionMode=this.headElement?J.AFTER_HEAD:J.BEFORE_HEAD;return}case v.TD:case v.TH:{if(t>0){this.insertionMode=J.IN_CELL;return}break}case v.HEAD:{if(t>0){this.insertionMode=J.IN_HEAD;return}break}}this.insertionMode=J.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===v.TEMPLATE)break;if(r===v.TABLE){this.insertionMode=J.IN_SELECT_IN_TABLE;return}}this.insertionMode=J.IN_SELECT}_isElementCausesFosterParenting(t){return WA.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case v.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===Ne.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case v.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const r=this.treeAdapter.getNamespaceURI(t);return QH[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){aF(this,t);return}switch(this.insertionMode){case J.INITIAL:{Ru(this,t);break}case J.BEFORE_HTML:{Wu(this,t);break}case J.BEFORE_HEAD:{Zu(this,t);break}case J.IN_HEAD:{Ju(this,t);break}case J.IN_HEAD_NO_SCRIPT:{ec(this,t);break}case J.AFTER_HEAD:{tc(this,t);break}case J.IN_BODY:case J.IN_CAPTION:case J.IN_CELL:case J.IN_TEMPLATE:{JA(this,t);break}case J.TEXT:case J.IN_SELECT:case J.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case J.IN_TABLE:case J.IN_TABLE_BODY:case J.IN_ROW:{mg(this,t);break}case J.IN_TABLE_TEXT:{i_(this,t);break}case J.IN_COLUMN_GROUP:{Eh(this,t);break}case J.AFTER_BODY:{Th(this,t);break}case J.AFTER_AFTER_BODY:{qd(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){iF(this,t);return}switch(this.insertionMode){case J.INITIAL:{Ru(this,t);break}case J.BEFORE_HTML:{Wu(this,t);break}case J.BEFORE_HEAD:{Zu(this,t);break}case J.IN_HEAD:{Ju(this,t);break}case J.IN_HEAD_NO_SCRIPT:{ec(this,t);break}case J.AFTER_HEAD:{tc(this,t);break}case J.TEXT:{this._insertCharacters(t);break}case J.IN_TABLE:case J.IN_TABLE_BODY:case J.IN_ROW:{mg(this,t);break}case J.IN_COLUMN_GROUP:{Eh(this,t);break}case J.AFTER_BODY:{Th(this,t);break}case J.AFTER_AFTER_BODY:{qd(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){gb(this,t);return}switch(this.insertionMode){case J.INITIAL:case J.BEFORE_HTML:case J.BEFORE_HEAD:case J.IN_HEAD:case J.IN_HEAD_NO_SCRIPT:case J.AFTER_HEAD:case J.IN_BODY:case J.IN_TABLE:case J.IN_CAPTION:case J.IN_COLUMN_GROUP:case J.IN_TABLE_BODY:case J.IN_ROW:case J.IN_CELL:case J.IN_SELECT:case J.IN_SELECT_IN_TABLE:case J.IN_TEMPLATE:case J.IN_FRAMESET:case J.AFTER_FRAMESET:{gb(this,t);break}case J.IN_TABLE_TEXT:{Ou(this,t);break}case J.AFTER_BODY:{jU(this,t);break}case J.AFTER_AFTER_BODY:case J.AFTER_AFTER_FRAMESET:{BU(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case J.INITIAL:{HU(this,t);break}case J.BEFORE_HEAD:case J.IN_HEAD:case J.IN_HEAD_NO_SCRIPT:case J.AFTER_HEAD:{this._err(t,Ee.misplacedDoctype);break}case J.IN_TABLE_TEXT:{Ou(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,Ee.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?oF(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case J.INITIAL:{Ru(this,t);break}case J.BEFORE_HTML:{UU(this,t);break}case J.BEFORE_HEAD:{FU(this,t);break}case J.IN_HEAD:{fs(this,t);break}case J.IN_HEAD_NO_SCRIPT:{qU(this,t);break}case J.AFTER_HEAD:{GU(this,t);break}case J.IN_BODY:{tr(this,t);break}case J.IN_TABLE:{bl(this,t);break}case J.IN_TABLE_TEXT:{Ou(this,t);break}case J.IN_CAPTION:{Vz(this,t);break}case J.IN_COLUMN_GROUP:{z1(this,t);break}case J.IN_TABLE_BODY:{lp(this,t);break}case J.IN_ROW:{up(this,t);break}case J.IN_CELL:{Yz(this,t);break}case J.IN_SELECT:{l_(this,t);break}case J.IN_SELECT_IN_TABLE:{Xz(this,t);break}case J.IN_TEMPLATE:{Qz(this,t);break}case J.AFTER_BODY:{Zz(this,t);break}case J.IN_FRAMESET:{Jz(this,t);break}case J.AFTER_FRAMESET:{tF(this,t);break}case J.AFTER_AFTER_BODY:{rF(this,t);break}case J.AFTER_AFTER_FRAMESET:{sF(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?lF(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case J.INITIAL:{Ru(this,t);break}case J.BEFORE_HTML:{zU(this,t);break}case J.BEFORE_HEAD:{VU(this,t);break}case J.IN_HEAD:{$U(this,t);break}case J.IN_HEAD_NO_SCRIPT:{YU(this,t);break}case J.AFTER_HEAD:{XU(this,t);break}case J.IN_BODY:{op(this,t);break}case J.TEXT:{Lz(this,t);break}case J.IN_TABLE:{yc(this,t);break}case J.IN_TABLE_TEXT:{Ou(this,t);break}case J.IN_CAPTION:{$z(this,t);break}case J.IN_COLUMN_GROUP:{qz(this,t);break}case J.IN_TABLE_BODY:{bb(this,t);break}case J.IN_ROW:{o_(this,t);break}case J.IN_CELL:{Gz(this,t);break}case J.IN_SELECT:{u_(this,t);break}case J.IN_SELECT_IN_TABLE:{Kz(this,t);break}case J.IN_TEMPLATE:{Wz(this,t);break}case J.AFTER_BODY:{f_(this,t);break}case J.IN_FRAMESET:{eF(this,t);break}case J.AFTER_FRAMESET:{nF(this,t);break}case J.AFTER_AFTER_BODY:{qd(this,t);break}}}onEof(t){switch(this.insertionMode){case J.INITIAL:{Ru(this,t);break}case J.BEFORE_HTML:{Wu(this,t);break}case J.BEFORE_HEAD:{Zu(this,t);break}case J.IN_HEAD:{Ju(this,t);break}case J.IN_HEAD_NO_SCRIPT:{ec(this,t);break}case J.AFTER_HEAD:{tc(this,t);break}case J.IN_BODY:case J.IN_TABLE:case J.IN_CAPTION:case J.IN_COLUMN_GROUP:case J.IN_TABLE_BODY:case J.IN_ROW:case J.IN_CELL:case J.IN_SELECT:case J.IN_SELECT_IN_TABLE:{r_(this,t);break}case J.TEXT:{Mz(this,t);break}case J.IN_TABLE_TEXT:{Ou(this,t);break}case J.IN_TEMPLATE:{c_(this,t);break}case J.AFTER_BODY:case J.IN_FRAMESET:case J.AFTER_FRAMESET:case J.AFTER_AFTER_BODY:case J.AFTER_AFTER_FRAMESET:{U1(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===F.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case J.IN_HEAD:case J.IN_HEAD_NO_SCRIPT:case J.AFTER_HEAD:case J.TEXT:case J.IN_COLUMN_GROUP:case J.IN_SELECT:case J.IN_SELECT_IN_TABLE:case J.IN_FRAMESET:case J.AFTER_FRAMESET:{this._insertCharacters(t);break}case J.IN_BODY:case J.IN_CAPTION:case J.IN_CELL:case J.IN_TEMPLATE:case J.AFTER_BODY:case J.AFTER_AFTER_BODY:case J.AFTER_AFTER_FRAMESET:{ZA(this,t);break}case J.IN_TABLE:case J.IN_TABLE_BODY:case J.IN_ROW:{mg(this,t);break}case J.IN_TABLE_TEXT:{s_(this,t);break}}}}function OU(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):n_(e,t),n}function IU(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function LU(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let o=0,l=i;l!==n;o++,l=i){i=e.openElements.getCommonAncestor(l);const c=e.activeFormattingElements.getElementEntry(l),f=c&&o>=NU;!c||f?(f&&e.activeFormattingElements.removeEntry(c),e.openElements.remove(l)):(l=MU(e,c),r===t&&(e.activeFormattingElements.bookmark=c),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(l,r),r=l)}return r}function MU(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function DU(e,t,n){const r=e.treeAdapter.getTagName(t),i=kl(r);if(e._isElementCausesFosterParenting(i))e._fosterParentElement(n);else{const o=e.treeAdapter.getNamespaceURI(t);i===v.TEMPLATE&&o===Ne.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function PU(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,o=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,o),e.treeAdapter.appendChild(t,o),e.activeFormattingElements.insertElementAfterBookmark(o,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,o,i.tagID)}function H1(e,t){for(let n=0;n<_U;n++){const r=OU(e,t);if(!r)break;const i=IU(e,r);if(!i)break;e.activeFormattingElements.bookmark=r;const o=LU(e,i,r.element),l=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(o),l&&DU(e,l,o),PU(e,i,r)}}function gb(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function jU(e,t){e._appendCommentNode(t,e.openElements.items[0])}function BU(e,t){e._appendCommentNode(t,e.document)}function U1(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],i=e.treeAdapter.getNodeSourceCodeLocation(r);if(i&&!i.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const o=e.openElements.items[1],l=e.treeAdapter.getNodeSourceCodeLocation(o);l&&!l.endTag&&e._setEndLocation(o,t)}}}}function HU(e,t){e._setDocumentType(t);const n=t.forceQuirks?Wr.QUIRKS:mU(t);pU(t)||e._err(t,Ee.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=J.BEFORE_HTML}function Ru(e,t){e._err(t,Ee.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Wr.QUIRKS),e.insertionMode=J.BEFORE_HTML,e._processToken(t)}function UU(e,t){t.tagID===v.HTML?(e._insertElement(t,Ne.HTML),e.insertionMode=J.BEFORE_HEAD):Wu(e,t)}function zU(e,t){const n=t.tagID;(n===v.HTML||n===v.HEAD||n===v.BODY||n===v.BR)&&Wu(e,t)}function Wu(e,t){e._insertFakeRootElement(),e.insertionMode=J.BEFORE_HEAD,e._processToken(t)}function FU(e,t){switch(t.tagID){case v.HTML:{tr(e,t);break}case v.HEAD:{e._insertElement(t,Ne.HTML),e.headElement=e.openElements.current,e.insertionMode=J.IN_HEAD;break}default:Zu(e,t)}}function VU(e,t){const n=t.tagID;n===v.HEAD||n===v.BODY||n===v.HTML||n===v.BR?Zu(e,t):e._err(t,Ee.endTagWithoutMatchingOpenElement)}function Zu(e,t){e._insertFakeElement(pe.HEAD,v.HEAD),e.headElement=e.openElements.current,e.insertionMode=J.IN_HEAD,e._processToken(t)}function fs(e,t){switch(t.tagID){case v.HTML:{tr(e,t);break}case v.BASE:case v.BASEFONT:case v.BGSOUND:case v.LINK:case v.META:{e._appendElement(t,Ne.HTML),t.ackSelfClosing=!0;break}case v.TITLE:{e._switchToTextParsing(t,Sn.RCDATA);break}case v.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Sn.RAWTEXT):(e._insertElement(t,Ne.HTML),e.insertionMode=J.IN_HEAD_NO_SCRIPT);break}case v.NOFRAMES:case v.STYLE:{e._switchToTextParsing(t,Sn.RAWTEXT);break}case v.SCRIPT:{e._switchToTextParsing(t,Sn.SCRIPT_DATA);break}case v.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=J.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(J.IN_TEMPLATE);break}case v.HEAD:{e._err(t,Ee.misplacedStartTagForHeadElement);break}default:Ju(e,t)}}function $U(e,t){switch(t.tagID){case v.HEAD:{e.openElements.pop(),e.insertionMode=J.AFTER_HEAD;break}case v.BODY:case v.BR:case v.HTML:{Ju(e,t);break}case v.TEMPLATE:{ho(e,t);break}default:e._err(t,Ee.endTagWithoutMatchingOpenElement)}}function ho(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==v.TEMPLATE&&e._err(t,Ee.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(v.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,Ee.endTagWithoutMatchingOpenElement)}function Ju(e,t){e.openElements.pop(),e.insertionMode=J.AFTER_HEAD,e._processToken(t)}function qU(e,t){switch(t.tagID){case v.HTML:{tr(e,t);break}case v.BASEFONT:case v.BGSOUND:case v.HEAD:case v.LINK:case v.META:case v.NOFRAMES:case v.STYLE:{fs(e,t);break}case v.NOSCRIPT:{e._err(t,Ee.nestedNoscriptInHead);break}default:ec(e,t)}}function YU(e,t){switch(t.tagID){case v.NOSCRIPT:{e.openElements.pop(),e.insertionMode=J.IN_HEAD;break}case v.BR:{ec(e,t);break}default:e._err(t,Ee.endTagWithoutMatchingOpenElement)}}function ec(e,t){const n=t.type===Tt.EOF?Ee.openElementsLeftAfterEof:Ee.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=J.IN_HEAD,e._processToken(t)}function GU(e,t){switch(t.tagID){case v.HTML:{tr(e,t);break}case v.BODY:{e._insertElement(t,Ne.HTML),e.framesetOk=!1,e.insertionMode=J.IN_BODY;break}case v.FRAMESET:{e._insertElement(t,Ne.HTML),e.insertionMode=J.IN_FRAMESET;break}case v.BASE:case v.BASEFONT:case v.BGSOUND:case v.LINK:case v.META:case v.NOFRAMES:case v.SCRIPT:case v.STYLE:case v.TEMPLATE:case v.TITLE:{e._err(t,Ee.abandonedHeadElementChild),e.openElements.push(e.headElement,v.HEAD),fs(e,t),e.openElements.remove(e.headElement);break}case v.HEAD:{e._err(t,Ee.misplacedStartTagForHeadElement);break}default:tc(e,t)}}function XU(e,t){switch(t.tagID){case v.BODY:case v.HTML:case v.BR:{tc(e,t);break}case v.TEMPLATE:{ho(e,t);break}default:e._err(t,Ee.endTagWithoutMatchingOpenElement)}}function tc(e,t){e._insertFakeElement(pe.BODY,v.BODY),e.insertionMode=J.IN_BODY,ap(e,t)}function ap(e,t){switch(t.type){case Tt.CHARACTER:{JA(e,t);break}case Tt.WHITESPACE_CHARACTER:{ZA(e,t);break}case Tt.COMMENT:{gb(e,t);break}case Tt.START_TAG:{tr(e,t);break}case Tt.END_TAG:{op(e,t);break}case Tt.EOF:{r_(e,t);break}}}function ZA(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function JA(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function KU(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function QU(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function WU(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,Ne.HTML),e.insertionMode=J.IN_FRAMESET)}function ZU(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,Ne.HTML)}function JU(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&mb.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,Ne.HTML)}function ez(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,Ne.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function tz(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,Ne.HTML),n||(e.formElement=e.openElements.current))}function nz(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const i=e.openElements.tagIDs[r];if(n===v.LI&&i===v.LI||(n===v.DD||n===v.DT)&&(i===v.DD||i===v.DT)){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.popUntilTagNamePopped(i);break}if(i!==v.ADDRESS&&i!==v.DIV&&i!==v.P&&e._isSpecialElement(e.openElements.items[r],i))break}e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,Ne.HTML)}function rz(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,Ne.HTML),e.tokenizer.state=Sn.PLAINTEXT}function sz(e,t){e.openElements.hasInScope(v.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(v.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,Ne.HTML),e.framesetOk=!1}function iz(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(pe.A);n&&(H1(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,Ne.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function az(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ne.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function oz(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(v.NOBR)&&(H1(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,Ne.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function lz(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ne.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function uz(e,t){e.treeAdapter.getDocumentMode(e.document)!==Wr.QUIRKS&&e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,Ne.HTML),e.framesetOk=!1,e.insertionMode=J.IN_TABLE}function e_(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Ne.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function t_(e){const t=VA(e,Qa.TYPE);return t!=null&&t.toLowerCase()===AU}function cz(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Ne.HTML),t_(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function fz(e,t){e._appendElement(t,Ne.HTML),t.ackSelfClosing=!0}function dz(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._appendElement(t,Ne.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function hz(e,t){t.tagName=pe.IMG,t.tagID=v.IMG,e_(e,t)}function pz(e,t){e._insertElement(t,Ne.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Sn.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=J.TEXT}function mz(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Sn.RAWTEXT)}function gz(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Sn.RAWTEXT)}function PS(e,t){e._switchToTextParsing(t,Sn.RAWTEXT)}function bz(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ne.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===J.IN_TABLE||e.insertionMode===J.IN_CAPTION||e.insertionMode===J.IN_TABLE_BODY||e.insertionMode===J.IN_ROW||e.insertionMode===J.IN_CELL?J.IN_SELECT_IN_TABLE:J.IN_SELECT}function xz(e,t){e.openElements.currentTagId===v.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,Ne.HTML)}function yz(e,t){e.openElements.hasInScope(v.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,Ne.HTML)}function Ez(e,t){e.openElements.hasInScope(v.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(v.RTC),e._insertElement(t,Ne.HTML)}function Tz(e,t){e._reconstructActiveFormattingElements(),KA(t),B1(t),t.selfClosing?e._appendElement(t,Ne.MATHML):e._insertElement(t,Ne.MATHML),t.ackSelfClosing=!0}function vz(e,t){e._reconstructActiveFormattingElements(),QA(t),B1(t),t.selfClosing?e._appendElement(t,Ne.SVG):e._insertElement(t,Ne.SVG),t.ackSelfClosing=!0}function jS(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ne.HTML)}function tr(e,t){switch(t.tagID){case v.I:case v.S:case v.B:case v.U:case v.EM:case v.TT:case v.BIG:case v.CODE:case v.FONT:case v.SMALL:case v.STRIKE:case v.STRONG:{az(e,t);break}case v.A:{iz(e,t);break}case v.H1:case v.H2:case v.H3:case v.H4:case v.H5:case v.H6:{JU(e,t);break}case v.P:case v.DL:case v.OL:case v.UL:case v.DIV:case v.DIR:case v.NAV:case v.MAIN:case v.MENU:case v.ASIDE:case v.CENTER:case v.FIGURE:case v.FOOTER:case v.HEADER:case v.HGROUP:case v.DIALOG:case v.DETAILS:case v.ADDRESS:case v.ARTICLE:case v.SEARCH:case v.SECTION:case v.SUMMARY:case v.FIELDSET:case v.BLOCKQUOTE:case v.FIGCAPTION:{ZU(e,t);break}case v.LI:case v.DD:case v.DT:{nz(e,t);break}case v.BR:case v.IMG:case v.WBR:case v.AREA:case v.EMBED:case v.KEYGEN:{e_(e,t);break}case v.HR:{dz(e,t);break}case v.RB:case v.RTC:{yz(e,t);break}case v.RT:case v.RP:{Ez(e,t);break}case v.PRE:case v.LISTING:{ez(e,t);break}case v.XMP:{mz(e,t);break}case v.SVG:{vz(e,t);break}case v.HTML:{KU(e,t);break}case v.BASE:case v.LINK:case v.META:case v.STYLE:case v.TITLE:case v.SCRIPT:case v.BGSOUND:case v.BASEFONT:case v.TEMPLATE:{fs(e,t);break}case v.BODY:{QU(e,t);break}case v.FORM:{tz(e,t);break}case v.NOBR:{oz(e,t);break}case v.MATH:{Tz(e,t);break}case v.TABLE:{uz(e,t);break}case v.INPUT:{cz(e,t);break}case v.PARAM:case v.TRACK:case v.SOURCE:{fz(e,t);break}case v.IMAGE:{hz(e,t);break}case v.BUTTON:{sz(e,t);break}case v.APPLET:case v.OBJECT:case v.MARQUEE:{lz(e,t);break}case v.IFRAME:{gz(e,t);break}case v.SELECT:{bz(e,t);break}case v.OPTION:case v.OPTGROUP:{xz(e,t);break}case v.NOEMBED:case v.NOFRAMES:{PS(e,t);break}case v.FRAMESET:{WU(e,t);break}case v.TEXTAREA:{pz(e,t);break}case v.NOSCRIPT:{e.options.scriptingEnabled?PS(e,t):jS(e,t);break}case v.PLAINTEXT:{rz(e,t);break}case v.COL:case v.TH:case v.TD:case v.TR:case v.HEAD:case v.FRAME:case v.TBODY:case v.TFOOT:case v.THEAD:case v.CAPTION:case v.COLGROUP:break;default:jS(e,t)}}function Sz(e,t){if(e.openElements.hasInScope(v.BODY)&&(e.insertionMode=J.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function Cz(e,t){e.openElements.hasInScope(v.BODY)&&(e.insertionMode=J.AFTER_BODY,f_(e,t))}function wz(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function kz(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(v.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(v.FORM):n&&e.openElements.remove(n))}function Az(e){e.openElements.hasInButtonScope(v.P)||e._insertFakeElement(pe.P,v.P),e._closePElement()}function _z(e){e.openElements.hasInListItemScope(v.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(v.LI),e.openElements.popUntilTagNamePopped(v.LI))}function Nz(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function Rz(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function Oz(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function Iz(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(pe.BR,v.BR),e.openElements.pop(),e.framesetOk=!1}function n_(e,t){const n=t.tagName,r=t.tagID;for(let i=e.openElements.stackTop;i>0;i--){const o=e.openElements.items[i],l=e.openElements.tagIDs[i];if(r===l&&(r!==v.UNKNOWN||e.treeAdapter.getTagName(o)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=i&&e.openElements.shortenToLength(i);break}if(e._isSpecialElement(o,l))break}}function op(e,t){switch(t.tagID){case v.A:case v.B:case v.I:case v.S:case v.U:case v.EM:case v.TT:case v.BIG:case v.CODE:case v.FONT:case v.NOBR:case v.SMALL:case v.STRIKE:case v.STRONG:{H1(e,t);break}case v.P:{Az(e);break}case v.DL:case v.UL:case v.OL:case v.DIR:case v.DIV:case v.NAV:case v.PRE:case v.MAIN:case v.MENU:case v.ASIDE:case v.BUTTON:case v.CENTER:case v.FIGURE:case v.FOOTER:case v.HEADER:case v.HGROUP:case v.DIALOG:case v.ADDRESS:case v.ARTICLE:case v.DETAILS:case v.SEARCH:case v.SECTION:case v.SUMMARY:case v.LISTING:case v.FIELDSET:case v.BLOCKQUOTE:case v.FIGCAPTION:{wz(e,t);break}case v.LI:{_z(e);break}case v.DD:case v.DT:{Nz(e,t);break}case v.H1:case v.H2:case v.H3:case v.H4:case v.H5:case v.H6:{Rz(e);break}case v.BR:{Iz(e);break}case v.BODY:{Sz(e,t);break}case v.HTML:{Cz(e,t);break}case v.FORM:{kz(e);break}case v.APPLET:case v.OBJECT:case v.MARQUEE:{Oz(e,t);break}case v.TEMPLATE:{ho(e,t);break}default:n_(e,t)}}function r_(e,t){e.tmplInsertionModeStack.length>0?c_(e,t):U1(e,t)}function Lz(e,t){var n;t.tagID===v.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function Mz(e,t){e._err(t,Ee.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function mg(e,t){if(e.openElements.currentTagId!==void 0&&WA.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=J.IN_TABLE_TEXT,t.type){case Tt.CHARACTER:{i_(e,t);break}case Tt.WHITESPACE_CHARACTER:{s_(e,t);break}}else Lc(e,t)}function Dz(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,Ne.HTML),e.insertionMode=J.IN_CAPTION}function Pz(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Ne.HTML),e.insertionMode=J.IN_COLUMN_GROUP}function jz(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(pe.COLGROUP,v.COLGROUP),e.insertionMode=J.IN_COLUMN_GROUP,z1(e,t)}function Bz(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Ne.HTML),e.insertionMode=J.IN_TABLE_BODY}function Hz(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(pe.TBODY,v.TBODY),e.insertionMode=J.IN_TABLE_BODY,lp(e,t)}function Uz(e,t){e.openElements.hasInTableScope(v.TABLE)&&(e.openElements.popUntilTagNamePopped(v.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function zz(e,t){t_(t)?e._appendElement(t,Ne.HTML):Lc(e,t),t.ackSelfClosing=!0}function Fz(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,Ne.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function bl(e,t){switch(t.tagID){case v.TD:case v.TH:case v.TR:{Hz(e,t);break}case v.STYLE:case v.SCRIPT:case v.TEMPLATE:{fs(e,t);break}case v.COL:{jz(e,t);break}case v.FORM:{Fz(e,t);break}case v.TABLE:{Uz(e,t);break}case v.TBODY:case v.TFOOT:case v.THEAD:{Bz(e,t);break}case v.INPUT:{zz(e,t);break}case v.CAPTION:{Dz(e,t);break}case v.COLGROUP:{Pz(e,t);break}default:Lc(e,t)}}function yc(e,t){switch(t.tagID){case v.TABLE:{e.openElements.hasInTableScope(v.TABLE)&&(e.openElements.popUntilTagNamePopped(v.TABLE),e._resetInsertionMode());break}case v.TEMPLATE:{ho(e,t);break}case v.BODY:case v.CAPTION:case v.COL:case v.COLGROUP:case v.HTML:case v.TBODY:case v.TD:case v.TFOOT:case v.TH:case v.THEAD:case v.TR:break;default:Lc(e,t)}}function Lc(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,ap(e,t),e.fosterParentingEnabled=n}function s_(e,t){e.pendingCharacterTokens.push(t)}function i_(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Ou(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)Lc(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const a_=new Set([v.CAPTION,v.COL,v.COLGROUP,v.TBODY,v.TD,v.TFOOT,v.TH,v.THEAD,v.TR]);function Vz(e,t){const n=t.tagID;a_.has(n)?e.openElements.hasInTableScope(v.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(v.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=J.IN_TABLE,bl(e,t)):tr(e,t)}function $z(e,t){const n=t.tagID;switch(n){case v.CAPTION:case v.TABLE:{e.openElements.hasInTableScope(v.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(v.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=J.IN_TABLE,n===v.TABLE&&yc(e,t));break}case v.BODY:case v.COL:case v.COLGROUP:case v.HTML:case v.TBODY:case v.TD:case v.TFOOT:case v.TH:case v.THEAD:case v.TR:break;default:op(e,t)}}function z1(e,t){switch(t.tagID){case v.HTML:{tr(e,t);break}case v.COL:{e._appendElement(t,Ne.HTML),t.ackSelfClosing=!0;break}case v.TEMPLATE:{fs(e,t);break}default:Eh(e,t)}}function qz(e,t){switch(t.tagID){case v.COLGROUP:{e.openElements.currentTagId===v.COLGROUP&&(e.openElements.pop(),e.insertionMode=J.IN_TABLE);break}case v.TEMPLATE:{ho(e,t);break}case v.COL:break;default:Eh(e,t)}}function Eh(e,t){e.openElements.currentTagId===v.COLGROUP&&(e.openElements.pop(),e.insertionMode=J.IN_TABLE,e._processToken(t))}function lp(e,t){switch(t.tagID){case v.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,Ne.HTML),e.insertionMode=J.IN_ROW;break}case v.TH:case v.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(pe.TR,v.TR),e.insertionMode=J.IN_ROW,up(e,t);break}case v.CAPTION:case v.COL:case v.COLGROUP:case v.TBODY:case v.TFOOT:case v.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=J.IN_TABLE,bl(e,t));break}default:bl(e,t)}}function bb(e,t){const n=t.tagID;switch(t.tagID){case v.TBODY:case v.TFOOT:case v.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=J.IN_TABLE);break}case v.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=J.IN_TABLE,yc(e,t));break}case v.BODY:case v.CAPTION:case v.COL:case v.COLGROUP:case v.HTML:case v.TD:case v.TH:case v.TR:break;default:yc(e,t)}}function up(e,t){switch(t.tagID){case v.TH:case v.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,Ne.HTML),e.insertionMode=J.IN_CELL,e.activeFormattingElements.insertMarker();break}case v.CAPTION:case v.COL:case v.COLGROUP:case v.TBODY:case v.TFOOT:case v.THEAD:case v.TR:{e.openElements.hasInTableScope(v.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=J.IN_TABLE_BODY,lp(e,t));break}default:bl(e,t)}}function o_(e,t){switch(t.tagID){case v.TR:{e.openElements.hasInTableScope(v.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=J.IN_TABLE_BODY);break}case v.TABLE:{e.openElements.hasInTableScope(v.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=J.IN_TABLE_BODY,bb(e,t));break}case v.TBODY:case v.TFOOT:case v.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(v.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=J.IN_TABLE_BODY,bb(e,t));break}case v.BODY:case v.CAPTION:case v.COL:case v.COLGROUP:case v.HTML:case v.TD:case v.TH:break;default:yc(e,t)}}function Yz(e,t){const n=t.tagID;a_.has(n)?(e.openElements.hasInTableScope(v.TD)||e.openElements.hasInTableScope(v.TH))&&(e._closeTableCell(),up(e,t)):tr(e,t)}function Gz(e,t){const n=t.tagID;switch(n){case v.TD:case v.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=J.IN_ROW);break}case v.TABLE:case v.TBODY:case v.TFOOT:case v.THEAD:case v.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),o_(e,t));break}case v.BODY:case v.CAPTION:case v.COL:case v.COLGROUP:case v.HTML:break;default:op(e,t)}}function l_(e,t){switch(t.tagID){case v.HTML:{tr(e,t);break}case v.OPTION:{e.openElements.currentTagId===v.OPTION&&e.openElements.pop(),e._insertElement(t,Ne.HTML);break}case v.OPTGROUP:{e.openElements.currentTagId===v.OPTION&&e.openElements.pop(),e.openElements.currentTagId===v.OPTGROUP&&e.openElements.pop(),e._insertElement(t,Ne.HTML);break}case v.HR:{e.openElements.currentTagId===v.OPTION&&e.openElements.pop(),e.openElements.currentTagId===v.OPTGROUP&&e.openElements.pop(),e._appendElement(t,Ne.HTML),t.ackSelfClosing=!0;break}case v.INPUT:case v.KEYGEN:case v.TEXTAREA:case v.SELECT:{e.openElements.hasInSelectScope(v.SELECT)&&(e.openElements.popUntilTagNamePopped(v.SELECT),e._resetInsertionMode(),t.tagID!==v.SELECT&&e._processStartTag(t));break}case v.SCRIPT:case v.TEMPLATE:{fs(e,t);break}}}function u_(e,t){switch(t.tagID){case v.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===v.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===v.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===v.OPTGROUP&&e.openElements.pop();break}case v.OPTION:{e.openElements.currentTagId===v.OPTION&&e.openElements.pop();break}case v.SELECT:{e.openElements.hasInSelectScope(v.SELECT)&&(e.openElements.popUntilTagNamePopped(v.SELECT),e._resetInsertionMode());break}case v.TEMPLATE:{ho(e,t);break}}}function Xz(e,t){const n=t.tagID;n===v.CAPTION||n===v.TABLE||n===v.TBODY||n===v.TFOOT||n===v.THEAD||n===v.TR||n===v.TD||n===v.TH?(e.openElements.popUntilTagNamePopped(v.SELECT),e._resetInsertionMode(),e._processStartTag(t)):l_(e,t)}function Kz(e,t){const n=t.tagID;n===v.CAPTION||n===v.TABLE||n===v.TBODY||n===v.TFOOT||n===v.THEAD||n===v.TR||n===v.TD||n===v.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(v.SELECT),e._resetInsertionMode(),e.onEndTag(t)):u_(e,t)}function Qz(e,t){switch(t.tagID){case v.BASE:case v.BASEFONT:case v.BGSOUND:case v.LINK:case v.META:case v.NOFRAMES:case v.SCRIPT:case v.STYLE:case v.TEMPLATE:case v.TITLE:{fs(e,t);break}case v.CAPTION:case v.COLGROUP:case v.TBODY:case v.TFOOT:case v.THEAD:{e.tmplInsertionModeStack[0]=J.IN_TABLE,e.insertionMode=J.IN_TABLE,bl(e,t);break}case v.COL:{e.tmplInsertionModeStack[0]=J.IN_COLUMN_GROUP,e.insertionMode=J.IN_COLUMN_GROUP,z1(e,t);break}case v.TR:{e.tmplInsertionModeStack[0]=J.IN_TABLE_BODY,e.insertionMode=J.IN_TABLE_BODY,lp(e,t);break}case v.TD:case v.TH:{e.tmplInsertionModeStack[0]=J.IN_ROW,e.insertionMode=J.IN_ROW,up(e,t);break}default:e.tmplInsertionModeStack[0]=J.IN_BODY,e.insertionMode=J.IN_BODY,tr(e,t)}}function Wz(e,t){t.tagID===v.TEMPLATE&&ho(e,t)}function c_(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(v.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):U1(e,t)}function Zz(e,t){t.tagID===v.HTML?tr(e,t):Th(e,t)}function f_(e,t){var n;if(t.tagID===v.HTML){if(e.fragmentContext||(e.insertionMode=J.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===v.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else Th(e,t)}function Th(e,t){e.insertionMode=J.IN_BODY,ap(e,t)}function Jz(e,t){switch(t.tagID){case v.HTML:{tr(e,t);break}case v.FRAMESET:{e._insertElement(t,Ne.HTML);break}case v.FRAME:{e._appendElement(t,Ne.HTML),t.ackSelfClosing=!0;break}case v.NOFRAMES:{fs(e,t);break}}}function eF(e,t){t.tagID===v.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==v.FRAMESET&&(e.insertionMode=J.AFTER_FRAMESET))}function tF(e,t){switch(t.tagID){case v.HTML:{tr(e,t);break}case v.NOFRAMES:{fs(e,t);break}}}function nF(e,t){t.tagID===v.HTML&&(e.insertionMode=J.AFTER_AFTER_FRAMESET)}function rF(e,t){t.tagID===v.HTML?tr(e,t):qd(e,t)}function qd(e,t){e.insertionMode=J.IN_BODY,ap(e,t)}function sF(e,t){switch(t.tagID){case v.HTML:{tr(e,t);break}case v.NOFRAMES:{fs(e,t);break}}}function iF(e,t){t.chars=cn,e._insertCharacters(t)}function aF(e,t){e._insertCharacters(t),e.framesetOk=!1}function d_(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==Ne.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function oF(e,t){if(vU(t))d_(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===Ne.MATHML?KA(t):r===Ne.SVG&&(SU(t),QA(t)),B1(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function lF(e,t){if(t.tagID===v.P||t.tagID===v.BR){d_(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===Ne.HTML){e._endTagOutsideForeignContent(t);break}const i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}pe.AREA,pe.BASE,pe.BASEFONT,pe.BGSOUND,pe.BR,pe.COL,pe.EMBED,pe.FRAME,pe.HR,pe.IMG,pe.INPUT,pe.KEYGEN,pe.LINK,pe.META,pe.PARAM,pe.SOURCE,pe.TRACK,pe.WBR;const cp=h_("end"),Ls=h_("start");function h_(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 p_(e){const t=Ls(e),n=cp(e);if(t&&n)return{start:t,end:n}}const uF=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,cF=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),BS={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function m_(e,t){const n=EF(e),r=BA("type",{handlers:{root:fF,element:dF,text:hF,comment:b_,doctype:pF,raw:gF},unknown:bF}),i={parser:n?new DS(BS):DS.getFragmentParser(void 0,BS),handle(c){r(c,i)},stitches:!1,options:t||{}};r(e,i),Al(i,Ls());const o=n?i.parser.document:i.parser.getFragment(),l=TH(o,{file:i.options.file});return i.stitches&&Is(l,"comment",function(c,f,d){const m=c;if(m.value.stitch&&d&&f!==void 0){const p=d.children;return p[f]=m.value.stitch,f}}),l.type==="root"&&l.children.length===1&&l.children[0].type===e.type?l.children[0]:l}function g_(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function fF(e,t){g_(e.children,t)}function dF(e,t){xF(e,t),g_(e.children,t),yF(e,t)}function hF(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:Tt.CHARACTER,chars:e.value,location:Mc(e)};Al(t,Ls(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function pF(e,t){const n={type:Tt.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Mc(e)};Al(t,Ls(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function mF(e,t){t.stitches=!0;const n=TF(e);if("children"in e&&"children"in n){const r=m_({type:"root",children:e.children},t.options);n.children=r.children}b_({type:"comment",value:{stitch:n}},t)}function b_(e,t){const n=e.value,r={type:Tt.COMMENT,data:n,location:Mc(e)};Al(t,Ls(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function gF(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,x_(t,Ls(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(uF,"<$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function bF(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))mF(n,t);else{let r="";throw cF.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function Al(e,t){x_(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=Sn.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function x_(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function xF(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Sn.PLAINTEXT)return;Al(t,Ls(e));const r=t.parser.openElements.current;let i="namespaceURI"in r?r.namespaceURI:qa.html;i===qa.html&&n==="svg"&&(i=qa.svg);const o=kH({...e,children:[]},{space:i===qa.svg?"svg":"html"}),l={type:Tt.START_TAG,tagName:n,tagID:kl(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in o?o.attrs:[],location:Mc(e)};t.parser.currentToken=l,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function yF(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&MH.includes(n)||t.parser.tokenizer.state===Sn.PLAINTEXT)return;Al(t,cp(e));const r={type:Tt.END_TAG,tagName:n,tagID:kl(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Mc(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Sn.RCDATA||t.parser.tokenizer.state===Sn.RAWTEXT||t.parser.tokenizer.state===Sn.SCRIPT_DATA)&&(t.parser.tokenizer.state=Sn.DATA)}function EF(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function Mc(e){const t=Ls(e)||{line:void 0,column:void 0,offset:void 0},n=cp(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function TF(e){return"children"in e?so({...e,children:[]}):so(e)}function xb(e){return function(t,n){return m_(t,{...e,file:n})}}const Da=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],Ha={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...Da,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...Da],h2:[["className","sr-only"]],img:[...Da,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...Da,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...Da],table:[...Da],ul:[...Da,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},Yi={}.hasOwnProperty;function vF(e,t){let n={type:"root",children:[]};const r={schema:t?{...Ha,...t}:Ha,stack:[]},i=y_(r,e);return i&&(Array.isArray(i)?i.length===1?n=i[0]:n.children=i:n=i),n}function y_(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return SF(e,n);case"doctype":return CF(e,n);case"element":return wF(e,n);case"root":return kF(e,n);case"text":return AF(e,n)}}}function SF(e,t){if(e.schema.allowComments){const n=typeof t.value=="string"?t.value:"",r=n.indexOf("-->"),o={type:"comment",value:r<0?n:n.slice(0,r)};return Dc(o,t),o}}function CF(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return Dc(n,t),n}}function wF(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const r=E_(e,t.children),i=_F(e,t.properties);e.stack.pop();let o=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(o=!0,e.schema.ancestors&&Yi.call(e.schema.ancestors,n))){const c=e.schema.ancestors[n];let f=-1;for(o=!1;++f<c.length;)e.stack.includes(c[f])&&(o=!0)}if(!o)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;const l={type:"element",tagName:n,properties:i,children:r};return Dc(l,t),l}function kF(e,t){const r={type:"root",children:E_(e,t.children)};return Dc(r,t),r}function AF(e,t){const r={type:"text",value:typeof t.value=="string"?t.value:""};return Dc(r,t),r}function E_(e,t){const n=[];if(Array.isArray(t)){const r=t;let i=-1;for(;++i<r.length;){const o=y_(e,r[i]);o&&(Array.isArray(o)?n.push(...o):n.push(o))}}return n}function _F(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,o=r&&Yi.call(r,n)?r[n]:void 0,l=r&&Yi.call(r,"*")?r["*"]:void 0,c=t&&typeof t=="object"?t:{},f={};let d;for(d in c)if(Yi.call(c,d)){const m=c[d];let p=HS(e,US(o,d),d,m);p==null&&(p=HS(e,US(l,d),d,m)),p!=null&&(f[d]=p)}if(i&&Yi.call(i,n)){const m=i[n];for(d in m)Yi.call(m,d)&&!Yi.call(f,d)&&(f[d]=m[d])}return f}function HS(e,t,n,r){return t?Array.isArray(r)?NF(e,t,n,r):T_(e,t,n,r):void 0}function NF(e,t,n,r){let i=-1;const o=[];for(;++i<r.length;){const l=T_(e,t,n,r[i]);(typeof l=="number"||typeof l=="string")&&o.push(l)}return o}function T_(e,t,n,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&RF(e,n,r)){if(typeof t=="object"&&t.length>1){let i=!1,o=0;for(;++o<t.length;){const l=t[o];if(l&&typeof l=="object"&&"flags"in l){if(l.test(String(r))){i=!0;break}}else if(l===r){i=!0;break}}if(!i)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function RF(e,t,n){const r=e.schema.protocols&&Yi.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;const i=String(n),o=i.indexOf(":"),l=i.indexOf("?"),c=i.indexOf("#"),f=i.indexOf("/");if(o<0||f>-1&&o>f||l>-1&&o>l||c>-1&&o>c)return!0;let d=-1;for(;++d<r.length;){const m=r[d];if(o===m.length&&i.slice(0,m.length)===m)return!0}return!1}function Dc(e,t){const n=p_(t);t.data&&(e.data=so(t.data)),n&&(e.position=n)}function US(e,t){let n,r=-1;if(e)for(;++r<e.length;){const i=e[r],o=typeof i=="string"?i:i[0];if(o===t)return i;o==="data*"&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function v_(e){return function(t){return vF(t,e)}}function zS(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const ar=da(/[A-Za-z]/),Jn=da(/[\dA-Za-z]/),OF=da(/[#-'*+\--9=?A-Z^-~]/);function vh(e){return e!==null&&(e<32||e===127)}const yb=da(/\d/),IF=da(/[\dA-Fa-f]/),LF=da(/[!-/:-@[-`{-~]/);function st(e){return e!==null&&e<-2}function rn(e){return e!==null&&(e<0||e===32)}function kt(e){return e===-2||e===-1||e===32}const fp=da(/\p{P}|\p{S}/u),io=da(/\s/);function da(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function MF(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function DF(e,t,n){const i=np((n||{}).ignore||[]),o=PF(t);let l=-1;for(;++l<o.length;)R1(e,"text",c);function c(d,m){let p=-1,b;for(;++p<m.length;){const y=m[p],E=b?b.children:void 0;if(i(y,E?E.indexOf(y):void 0,b))return;b=y}if(b)return f(d,m)}function f(d,m){const p=m[m.length-1],b=o[l][0],y=o[l][1];let E=0;const k=p.children.indexOf(d);let C=!1,A=[];b.lastIndex=0;let _=b.exec(d.value);for(;_;){const N=_.index,D={index:_.index,input:_.input,stack:[...m,d]};let O=y(..._,D);if(typeof O=="string"&&(O=O.length>0?{type:"text",value:O}:void 0),O===!1?b.lastIndex=N+1:(E!==N&&A.push({type:"text",value:d.value.slice(E,N)}),Array.isArray(O)?A.push(...O):O&&A.push(O),E=N+_[0].length,C=!0),!b.global)break;_=b.exec(d.value)}return C?(E<d.value.length&&A.push({type:"text",value:d.value.slice(E)}),p.children.splice(k,1,...A)):A=[d],k+A.length}}function PF(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([jF(i[0]),BF(i[1])])}return t}function jF(e){return typeof e=="string"?new RegExp(MF(e),"g"):e}function BF(e){return typeof e=="function"?e:function(){return e}}const gg="phrasing",bg=["autolink","link","image","label"];function HF(){return{transforms:[YF],enter:{literalAutolink:zF,literalAutolinkEmail:xg,literalAutolinkHttp:xg,literalAutolinkWww:xg},exit:{literalAutolink:qF,literalAutolinkEmail:$F,literalAutolinkHttp:FF,literalAutolinkWww:VF}}}function UF(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:gg,notInConstruct:bg},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:gg,notInConstruct:bg},{character:":",before:"[ps]",after:"\\/",inConstruct:gg,notInConstruct:bg}]}}function zF(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function xg(e){this.config.enter.autolinkProtocol.call(this,e)}function FF(e){this.config.exit.autolinkProtocol.call(this,e)}function VF(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function $F(e){this.config.exit.autolinkEmail.call(this,e)}function qF(e){this.exit(e)}function YF(e){DF(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,GF],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,XF]],{ignore:["link","linkReference"]})}function GF(e,t,n,r,i){let o="";if(!S_(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!KF(n)))return!1;const l=QF(n+r);if(!l[0])return!1;const c={type:"link",title:null,url:o+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[c,{type:"text",value:l[1]}]:c}function XF(e,t,n,r){return!S_(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function KF(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function QF(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=zS(e,"(");let o=zS(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function S_(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||io(n)||fp(n))&&(!t||n!==47)}function ls(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}C_.peek=iV;function WF(){this.buffer()}function ZF(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function JF(){this.buffer()}function eV(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function tV(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ls(this.sliceSerialize(e)).toLowerCase(),n.label=t}function nV(e){this.exit(e)}function rV(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ls(this.sliceSerialize(e)).toLowerCase(),n.label=t}function sV(e){this.exit(e)}function iV(){return"["}function C_(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const l=n.enter("footnoteReference"),c=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),c(),l(),o+=i.move("]"),o}function aV(){return{enter:{gfmFootnoteCallString:WF,gfmFootnoteCall:ZF,gfmFootnoteDefinitionLabelString:JF,gfmFootnoteDefinition:eV},exit:{gfmFootnoteCallString:tV,gfmFootnoteCall:nV,gfmFootnoteDefinitionLabelString:rV,gfmFootnoteDefinition:sV}}}function oV(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:C_},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,l){const c=o.createTracker(l);let f=c.move("[^");const d=o.enter("footnoteDefinition"),m=o.enter("label");return f+=c.move(o.safe(o.associationId(r),{before:f,after:"]"})),m(),f+=c.move("]:"),r.children&&r.children.length>0&&(c.shift(4),f+=c.move((t?`
|
|
353
|
-
`:" ")+o.indentLines(o.containerFlow(r,c.current()),t?w_:lV))),d(),f}}function lV(e,t,n){return t===0?e:w_(e,t,n)}function w_(e,t,n){return(n?"":" ")+e}const uV=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];k_.peek=pV;function cV(){return{canContainEols:["delete"],enter:{strikethrough:dV},exit:{strikethrough:hV}}}function fV(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:uV}],handlers:{delete:k_}}}function dV(e){this.enter({type:"delete",children:[]},e)}function hV(e){this.exit(e)}function k_(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let l=i.move("~~");return l+=n.containerPhrasing(e,{...i.current(),before:l,after:"~"}),l+=i.move("~~"),o(),l}function pV(){return"~"}function mV(e){return e.length}function gV(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||mV,o=[],l=[],c=[],f=[];let d=0,m=-1;for(;++m<e.length;){const w=[],k=[];let C=-1;for(e[m].length>d&&(d=e[m].length);++C<e[m].length;){const A=bV(e[m][C]);if(n.alignDelimiters!==!1){const _=i(A);k[C]=_,(f[C]===void 0||_>f[C])&&(f[C]=_)}w.push(A)}l[m]=w,c[m]=k}let p=-1;if(typeof r=="object"&&"length"in r)for(;++p<d;)o[p]=FS(r[p]);else{const w=FS(r);for(;++p<d;)o[p]=w}p=-1;const b=[],y=[];for(;++p<d;){const w=o[p];let k="",C="";w===99?(k=":",C=":"):w===108?k=":":w===114&&(C=":");let A=n.alignDelimiters===!1?1:Math.max(1,f[p]-k.length-C.length);const _=k+"-".repeat(A)+C;n.alignDelimiters!==!1&&(A=k.length+A+C.length,A>f[p]&&(f[p]=A),y[p]=A),b[p]=_}l.splice(1,0,b),c.splice(1,0,y),m=-1;const E=[];for(;++m<l.length;){const w=l[m],k=c[m];p=-1;const C=[];for(;++p<d;){const A=w[p]||"";let _="",N="";if(n.alignDelimiters!==!1){const D=f[p]-(k[p]||0),O=o[p];O===114?_=" ".repeat(D):O===99?D%2?(_=" ".repeat(D/2+.5),N=" ".repeat(D/2-.5)):(_=" ".repeat(D/2),N=_):N=" ".repeat(D)}n.delimiterStart!==!1&&!p&&C.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&A==="")&&(n.delimiterStart!==!1||p)&&C.push(" "),n.alignDelimiters!==!1&&C.push(_),C.push(A),n.alignDelimiters!==!1&&C.push(N),n.padding!==!1&&C.push(" "),(n.delimiterEnd!==!1||p!==d-1)&&C.push("|")}E.push(n.delimiterEnd===!1?C.join("").replace(/ +$/,""):C.join(""))}return E.join(`
|
|
354
|
-
`)}function bV(e){return e==null?"":String(e)}function FS(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function xV(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const l=n.indentLines(n.containerFlow(e,o.current()),yV);return i(),l}function yV(e,t,n){return">"+(n?"":" ")+e}function EV(e,t){return VS(e,t.inConstruct,!0)&&!VS(e,t.notInConstruct,!1)}function VS(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function $S(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
355
|
-
`&&EV(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
356
|
-
`}function TV(e,t){const n=String(e);let r=n.indexOf(t),i=r,o=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>l&&(l=o):o=1,i=r+t.length,r=n.indexOf(t,i);return l}function vV(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function SV(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function CV(e,t,n,r){const i=SV(n),o=e.value||"",l=i==="`"?"GraveAccent":"Tilde";if(vV(e,n)){const p=n.enter("codeIndented"),b=n.indentLines(o,wV);return p(),b}const c=n.createTracker(r),f=i.repeat(Math.max(TV(o,i)+1,3)),d=n.enter("codeFenced");let m=c.move(f);if(e.lang){const p=n.enter(`codeFencedLang${l}`);m+=c.move(n.safe(e.lang,{before:m,after:" ",encode:["`"],...c.current()})),p()}if(e.lang&&e.meta){const p=n.enter(`codeFencedMeta${l}`);m+=c.move(" "),m+=c.move(n.safe(e.meta,{before:m,after:`
|
|
357
|
-
`,encode:["`"],...c.current()})),p()}return m+=c.move(`
|
|
358
|
-
`),o&&(m+=c.move(o+`
|
|
359
|
-
`)),m+=c.move(f),d(),m}function wV(e,t,n){return(n?"":" ")+e}function F1(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function kV(e,t,n,r){const i=F1(n),o=i==='"'?"Quote":"Apostrophe",l=n.enter("definition");let c=n.enter("label");const f=n.createTracker(r);let d=f.move("[");return d+=f.move(n.safe(n.associationId(e),{before:d,after:"]",...f.current()})),d+=f.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),d+=f.move("<"),d+=f.move(n.safe(e.url,{before:d,after:">",...f.current()})),d+=f.move(">")):(c=n.enter("destinationRaw"),d+=f.move(n.safe(e.url,{before:d,after:e.title?" ":`
|
|
360
|
-
`,...f.current()}))),c(),e.title&&(c=n.enter(`title${o}`),d+=f.move(" "+i),d+=f.move(n.safe(e.title,{before:d,after:i,...f.current()})),d+=f.move(i),c()),l(),d}function AV(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Ec(e){return"&#x"+e.toString(16).toUpperCase()+";"}function xl(e){if(e===null||rn(e)||io(e))return 1;if(fp(e))return 2}function Sh(e,t,n){const r=xl(e),i=xl(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}A_.peek=_V;function A_(e,t,n,r){const i=AV(n),o=n.enter("emphasis"),l=n.createTracker(r),c=l.move(i);let f=l.move(n.containerPhrasing(e,{after:i,before:c,...l.current()}));const d=f.charCodeAt(0),m=Sh(r.before.charCodeAt(r.before.length-1),d,i);m.inside&&(f=Ec(d)+f.slice(1));const p=f.charCodeAt(f.length-1),b=Sh(r.after.charCodeAt(0),p,i);b.inside&&(f=f.slice(0,-1)+Ec(p));const y=l.move(i);return o(),n.attentionEncodeSurroundingInfo={after:b.outside,before:m.outside},c+f+y}function _V(e,t,n){return n.options.emphasis||"*"}const NV={};function V1(e,t){const n=NV,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return __(e,r,i)}function __(e,t,n){if(RV(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 qS(e.children,t,n)}return Array.isArray(e)?qS(e,t,n):""}function qS(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=__(e[i],t,n);return r.join("")}function RV(e){return!!(e&&typeof e=="object")}function OV(e,t){let n=!1;return Is(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,cb}),!!((!e.depth||e.depth<3)&&V1(e)&&(t.options.setext||n))}function IV(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(OV(e,n)){const m=n.enter("headingSetext"),p=n.enter("phrasing"),b=n.containerPhrasing(e,{...o.current(),before:`
|
|
361
|
-
`,after:`
|
|
362
|
-
`});return p(),m(),b+`
|
|
363
|
-
`+(i===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
|
|
364
|
-
`))+1))}const l="#".repeat(i),c=n.enter("headingAtx"),f=n.enter("phrasing");o.move(l+" ");let d=n.containerPhrasing(e,{before:"# ",after:`
|
|
365
|
-
`,...o.current()});return/^[\t ]/.test(d)&&(d=Ec(d.charCodeAt(0))+d.slice(1)),d=d?l+" "+d:l,n.options.closeAtx&&(d+=" "+l),f(),c(),d}N_.peek=LV;function N_(e){return e.value||""}function LV(){return"<"}R_.peek=MV;function R_(e,t,n,r){const i=F1(n),o=i==='"'?"Quote":"Apostrophe",l=n.enter("image");let c=n.enter("label");const f=n.createTracker(r);let d=f.move("![");return d+=f.move(n.safe(e.alt,{before:d,after:"]",...f.current()})),d+=f.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),d+=f.move("<"),d+=f.move(n.safe(e.url,{before:d,after:">",...f.current()})),d+=f.move(">")):(c=n.enter("destinationRaw"),d+=f.move(n.safe(e.url,{before:d,after:e.title?" ":")",...f.current()}))),c(),e.title&&(c=n.enter(`title${o}`),d+=f.move(" "+i),d+=f.move(n.safe(e.title,{before:d,after:i,...f.current()})),d+=f.move(i),c()),d+=f.move(")"),l(),d}function MV(){return"!"}O_.peek=DV;function O_(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let l=n.enter("label");const c=n.createTracker(r);let f=c.move("![");const d=n.safe(e.alt,{before:f,after:"]",...c.current()});f+=c.move(d+"]["),l();const m=n.stack;n.stack=[],l=n.enter("reference");const p=n.safe(n.associationId(e),{before:f,after:"]",...c.current()});return l(),n.stack=m,o(),i==="full"||!d||d!==p?f+=c.move(p+"]"):i==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function DV(){return"!"}I_.peek=PV;function I_(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const l=n.unsafe[o],c=n.compilePattern(l);let f;if(l.atBreak)for(;f=c.exec(r);){let d=f.index;r.charCodeAt(d)===10&&r.charCodeAt(d-1)===13&&d--,r=r.slice(0,d)+" "+r.slice(f.index+1)}}return i+r+i}function PV(){return"`"}function L_(e,t){const n=V1(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}M_.peek=jV;function M_(e,t,n,r){const i=F1(n),o=i==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let c,f;if(L_(e,n)){const m=n.stack;n.stack=[],c=n.enter("autolink");let p=l.move("<");return p+=l.move(n.containerPhrasing(e,{before:p,after:">",...l.current()})),p+=l.move(">"),c(),n.stack=m,p}c=n.enter("link"),f=n.enter("label");let d=l.move("[");return d+=l.move(n.containerPhrasing(e,{before:d,after:"](",...l.current()})),d+=l.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),d+=l.move("<"),d+=l.move(n.safe(e.url,{before:d,after:">",...l.current()})),d+=l.move(">")):(f=n.enter("destinationRaw"),d+=l.move(n.safe(e.url,{before:d,after:e.title?" ":")",...l.current()}))),f(),e.title&&(f=n.enter(`title${o}`),d+=l.move(" "+i),d+=l.move(n.safe(e.title,{before:d,after:i,...l.current()})),d+=l.move(i),f()),d+=l.move(")"),c(),d}function jV(e,t,n){return L_(e,n)?"<":"["}D_.peek=BV;function D_(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let l=n.enter("label");const c=n.createTracker(r);let f=c.move("[");const d=n.containerPhrasing(e,{before:f,after:"]",...c.current()});f+=c.move(d+"]["),l();const m=n.stack;n.stack=[],l=n.enter("reference");const p=n.safe(n.associationId(e),{before:f,after:"]",...c.current()});return l(),n.stack=m,o(),i==="full"||!d||d!==p?f+=c.move(p+"]"):i==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function BV(){return"["}function $1(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function HV(e){const t=$1(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function UV(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function P_(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function zV(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let l=e.ordered?UV(n):$1(n);const c=e.ordered?l==="."?")":".":HV(n);let f=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const m=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&m&&(!m.children||!m.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(f=!0),P_(n)===l&&m){let p=-1;for(;++p<e.children.length;){const b=e.children[p];if(b&&b.type==="listItem"&&b.children&&b.children[0]&&b.children[0].type==="thematicBreak"){f=!0;break}}}}f&&(l=c),n.bulletCurrent=l;const d=n.containerFlow(e,r);return n.bulletLastUsed=l,n.bulletCurrent=o,i(),d}function FV(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function VV(e,t,n,r){const i=FV(n);let o=n.bulletCurrent||$1(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let l=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const c=n.createTracker(r);c.move(o+" ".repeat(l-o.length)),c.shift(l);const f=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,c.current()),m);return f(),d;function m(p,b,y){return b?(y?"":" ".repeat(l))+p:(y?o:o+" ".repeat(l-o.length))+p}}function $V(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),l=n.containerPhrasing(e,r);return o(),i(),l}const qV=np(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function YV(e,t,n,r){return(e.children.some(function(l){return qV(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function GV(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}j_.peek=XV;function j_(e,t,n,r){const i=GV(n),o=n.enter("strong"),l=n.createTracker(r),c=l.move(i+i);let f=l.move(n.containerPhrasing(e,{after:i,before:c,...l.current()}));const d=f.charCodeAt(0),m=Sh(r.before.charCodeAt(r.before.length-1),d,i);m.inside&&(f=Ec(d)+f.slice(1));const p=f.charCodeAt(f.length-1),b=Sh(r.after.charCodeAt(0),p,i);b.inside&&(f=f.slice(0,-1)+Ec(p));const y=l.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:b.outside,before:m.outside},c+f+y}function XV(e,t,n){return n.options.strong||"*"}function KV(e,t,n,r){return n.safe(e.value,r)}function QV(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function WV(e,t,n){const r=(P_(n)+(n.options.ruleSpaces?" ":"")).repeat(QV(n));return n.options.ruleSpaces?r.slice(0,-1):r}const B_={blockquote:xV,break:$S,code:CV,definition:kV,emphasis:A_,hardBreak:$S,heading:IV,html:N_,image:R_,imageReference:O_,inlineCode:I_,link:M_,linkReference:D_,list:zV,listItem:VV,paragraph:$V,root:YV,strong:j_,text:KV,thematicBreak:WV},YS=document.createElement("i");function q1(e){const t="&"+e+";";YS.innerHTML=t;const n=YS.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function H_(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)}const ZV=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function JV(e){return e.replace(ZV,e$)}function e$(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return H_(n.slice(o?2:1),o?16:10)}return q1(n)||e}function t$(){return{enter:{table:n$,tableData:GS,tableHeader:GS,tableRow:s$},exit:{codeText:i$,table:r$,tableData:yg,tableHeader:yg,tableRow:yg}}}function n$(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function r$(e){this.exit(e),this.data.inTable=void 0}function s$(e){this.enter({type:"tableRow",children:[]},e)}function yg(e){this.exit(e)}function GS(e){this.enter({type:"tableCell",children:[]},e)}function i$(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,a$));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function a$(e,t){return t==="|"?t:e}function o$(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
366
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:l,tableCell:f,tableRow:c}};function l(y,E,w,k){return d(m(y,w,k),y.align)}function c(y,E,w,k){const C=p(y,w,k),A=d([C]);return A.slice(0,A.indexOf(`
|
|
367
|
-
`))}function f(y,E,w,k){const C=w.enter("tableCell"),A=w.enter("phrasing"),_=w.containerPhrasing(y,{...k,before:o,after:o});return A(),C(),_}function d(y,E){return gV(y,{align:E,alignDelimiters:r,padding:n,stringLength:i})}function m(y,E,w){const k=y.children;let C=-1;const A=[],_=E.enter("table");for(;++C<k.length;)A[C]=p(k[C],E,w);return _(),A}function p(y,E,w){const k=y.children;let C=-1;const A=[],_=E.enter("tableRow");for(;++C<k.length;)A[C]=f(k[C],y,E,w);return _(),A}function b(y,E,w){let k=B_.inlineCode(y,E,w);return w.stack.includes("tableCell")&&(k=k.replace(/\|/g,"\\$&")),k}}function l$(){return{exit:{taskListCheckValueChecked:XS,taskListCheckValueUnchecked:XS,paragraph:c$}}}function u$(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:f$}}}function XS(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function c$(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,l;for(;++o<i.length;){const c=i[o];if(c.type==="paragraph"){l=c;break}}l===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function f$(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",c=n.createTracker(r);o&&c.move(l);let f=B_.listItem(e,t,n,{...r,...c.current()});return o&&(f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),f;function d(m){return m+l}}function d$(){return[HF(),aV(),cV(),t$(),l$()]}function h$(e){return{extensions:[UF(),oV(e),fV(),o$(e),u$()]}}function Pr(e,t,n,r){const i=e.length;let o=0,l;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);o<r.length;)l=r.slice(o,o+1e4),l.unshift(t,0),e.splice(...l),o+=1e4,t+=1e4}function Zr(e,t){return e.length>0?(Pr(e,e.length,0,t),e):t}const KS={}.hasOwnProperty;function U_(e){const t={};let n=-1;for(;++n<e.length;)p$(t,e[n]);return t}function p$(e,t){let n;for(n in t){const i=(KS.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let l;if(o)for(l in o){KS.call(i,l)||(i[l]=[]);const c=o[l];m$(i[l],Array.isArray(c)?c:c?[c]:[])}}}function m$(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Pr(e,0,0,r)}const g$={tokenize:v$,partial:!0},z_={tokenize:S$,partial:!0},F_={tokenize:C$,partial:!0},V_={tokenize:w$,partial:!0},b$={tokenize:k$,partial:!0},$_={name:"wwwAutolink",tokenize:E$,previous:Y_},q_={name:"protocolAutolink",tokenize:T$,previous:G_},hi={name:"emailAutolink",tokenize:y$,previous:X_},Ms={};function x$(){return{text:Ms}}let Pa=48;for(;Pa<123;)Ms[Pa]=hi,Pa++,Pa===58?Pa=65:Pa===91&&(Pa=97);Ms[43]=hi;Ms[45]=hi;Ms[46]=hi;Ms[95]=hi;Ms[72]=[hi,q_];Ms[104]=[hi,q_];Ms[87]=[hi,$_];Ms[119]=[hi,$_];function y$(e,t,n){const r=this;let i,o;return l;function l(p){return!Eb(p)||!X_.call(r,r.previous)||Y1(r.events)?n(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(p))}function c(p){return Eb(p)?(e.consume(p),c):p===64?(e.consume(p),f):n(p)}function f(p){return p===46?e.check(b$,m,d)(p):p===45||p===95||Jn(p)?(o=!0,e.consume(p),f):m(p)}function d(p){return e.consume(p),i=!0,f}function m(p){return o&&i&&ar(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):n(p)}}function E$(e,t,n){const r=this;return i;function i(l){return l!==87&&l!==119||!Y_.call(r,r.previous)||Y1(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(g$,e.attempt(z_,e.attempt(F_,o),n),n)(l))}function o(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function T$(e,t,n){const r=this;let i="",o=!1;return l;function l(p){return(p===72||p===104)&&G_.call(r,r.previous)&&!Y1(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(p),e.consume(p),c):n(p)}function c(p){if(ar(p)&&i.length<5)return i+=String.fromCodePoint(p),e.consume(p),c;if(p===58){const b=i.toLowerCase();if(b==="http"||b==="https")return e.consume(p),f}return n(p)}function f(p){return p===47?(e.consume(p),o?d:(o=!0,f)):n(p)}function d(p){return p===null||vh(p)||rn(p)||io(p)||fp(p)?n(p):e.attempt(z_,e.attempt(F_,m),n)(p)}function m(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function v$(e,t,n){let r=0;return i;function i(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),i):l===46&&r===3?(e.consume(l),o):n(l)}function o(l){return l===null?n(l):t(l)}}function S$(e,t,n){let r,i,o;return l;function l(d){return d===46||d===95?e.check(V_,f,c)(d):d===null||rn(d)||io(d)||d!==45&&fp(d)?f(d):(o=!0,e.consume(d),l)}function c(d){return d===95?r=!0:(i=r,r=void 0),e.consume(d),l}function f(d){return i||r||!o?n(d):t(d)}}function C$(e,t){let n=0,r=0;return i;function i(l){return l===40?(n++,e.consume(l),i):l===41&&r<n?o(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(V_,t,o)(l):l===null||rn(l)||io(l)?t(l):(e.consume(l),i)}function o(l){return l===41&&r++,e.consume(l),i}}function w$(e,t,n){return r;function r(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),r):c===38?(e.consume(c),o):c===93?(e.consume(c),i):c===60||c===null||rn(c)||io(c)?t(c):n(c)}function i(c){return c===null||c===40||c===91||rn(c)||io(c)?t(c):r(c)}function o(c){return ar(c)?l(c):n(c)}function l(c){return c===59?(e.consume(c),r):ar(c)?(e.consume(c),l):n(c)}}function k$(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return Jn(o)?n(o):t(o)}}function Y_(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||rn(e)}function G_(e){return!ar(e)}function X_(e){return!(e===47||Eb(e))}function Eb(e){return e===43||e===45||e===46||e===95||Jn(e)}function Y1(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}function _l(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let l="";if(o===37&&Jn(e.charCodeAt(n+1))&&Jn(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(l=String.fromCharCode(o));else if(o>55295&&o<57344){const c=e.charCodeAt(n+1);o<56320&&c>56319&&c<57344?(l=String.fromCharCode(o,c),i=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function dp(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const Tb={name:"attention",resolveAll:A$,tokenize:_$};function A$(e,t){let n=-1,r,i,o,l,c,f,d,m;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;f=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 p={...e[r][1].end},b={...e[n][1].start};QS(p,-f),QS(b,f),l={type:f>1?"strongSequence":"emphasisSequence",start:p,end:{...e[r][1].end}},c={type:f>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:b},o={type:f>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:f>1?"strong":"emphasis",start:{...l.start},end:{...c.end}},e[r][1].end={...l.start},e[n][1].start={...c.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=Zr(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=Zr(d,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",o,t]]),d=Zr(d,dp(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=Zr(d,[["exit",o,t],["enter",c,t],["exit",c,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(m=2,d=Zr(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,Pr(e,r-1,n-r+3,d),n=r+d.length-m-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function _$(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=xl(r);let o;return l;function l(f){return o=f,e.enter("attentionSequence"),c(f)}function c(f){if(f===o)return e.consume(f),c;const d=e.exit("attentionSequence"),m=xl(f),p=!m||m===2&&i||n.includes(f),b=!i||i===2&&m||n.includes(r);return d._open=!!(o===42?p:p&&(i||!b)),d._close=!!(o===42?b:b&&(m||!p)),t(f)}}function QS(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const N$={name:"autolink",tokenize:R$};function R$(e,t,n){let r=0;return i;function i(y){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(y){return ar(y)?(e.consume(y),l):y===64?n(y):d(y)}function l(y){return y===43||y===45||y===46||Jn(y)?(r=1,c(y)):d(y)}function c(y){return y===58?(e.consume(y),r=0,f):(y===43||y===45||y===46||Jn(y))&&r++<32?(e.consume(y),c):(r=0,d(y))}function f(y){return y===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):y===null||y===32||y===60||vh(y)?n(y):(e.consume(y),f)}function d(y){return y===64?(e.consume(y),m):OF(y)?(e.consume(y),d):n(y)}function m(y){return Jn(y)?p(y):n(y)}function p(y){return y===46?(e.consume(y),r=0,m):y===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):b(y)}function b(y){if((y===45||Jn(y))&&r++<63){const E=y===45?b:p;return e.consume(y),E}return n(y)}}function Lt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(f){return kt(f)?(e.enter(n),c(f)):t(f)}function c(f){return kt(f)&&o++<i?(e.consume(f),c):(e.exit(n),t(f))}}const Pc={partial:!0,tokenize:O$};function O$(e,t,n){return r;function r(o){return kt(o)?Lt(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||st(o)?t(o):n(o)}}const K_={continuation:{tokenize:L$},exit:M$,name:"blockQuote",tokenize:I$};function I$(e,t,n){const r=this;return i;function i(l){if(l===62){const c=r.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),o}return n(l)}function o(l){return kt(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function L$(e,t,n){const r=this;return i;function i(l){return kt(l)?Lt(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):o(l)}function o(l){return e.attempt(K_,t,n)(l)}}function M$(e){e.exit("blockQuote")}const Q_={name:"characterEscape",tokenize:D$};function D$(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return LF(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const W_={name:"characterReference",tokenize:P$};function P$(e,t,n){const r=this;let i=0,o,l;return c;function c(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),f}function f(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),o=31,l=Jn,m(p))}function d(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,l=IF,m):(e.enter("characterReferenceValue"),o=7,l=yb,m(p))}function m(p){if(p===59&&i){const b=e.exit("characterReferenceValue");return l===Jn&&!q1(r.sliceSerialize(b))?n(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(p)&&i++<o?(e.consume(p),m):n(p)}}const WS={partial:!0,tokenize:B$},ZS={concrete:!0,name:"codeFenced",tokenize:j$};function j$(e,t,n){const r=this,i={partial:!0,tokenize:D};let o=0,l=0,c;return f;function f(O){return d(O)}function d(O){const j=r.events[r.events.length-1];return o=j&&j[1].type==="linePrefix"?j[2].sliceSerialize(j[1],!0).length:0,c=O,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(O)}function m(O){return O===c?(l++,e.consume(O),m):l<3?n(O):(e.exit("codeFencedFenceSequence"),kt(O)?Lt(e,p,"whitespace")(O):p(O))}function p(O){return O===null||st(O)?(e.exit("codeFencedFence"),r.interrupt?t(O):e.check(WS,w,N)(O)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(O))}function b(O){return O===null||st(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(O)):kt(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Lt(e,y,"whitespace")(O)):O===96&&O===c?n(O):(e.consume(O),b)}function y(O){return O===null||st(O)?p(O):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),E(O))}function E(O){return O===null||st(O)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(O)):O===96&&O===c?n(O):(e.consume(O),E)}function w(O){return e.attempt(i,N,k)(O)}function k(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),C}function C(O){return o>0&&kt(O)?Lt(e,A,"linePrefix",o+1)(O):A(O)}function A(O){return O===null||st(O)?e.check(WS,w,N)(O):(e.enter("codeFlowValue"),_(O))}function _(O){return O===null||st(O)?(e.exit("codeFlowValue"),A(O)):(e.consume(O),_)}function N(O){return e.exit("codeFenced"),t(O)}function D(O,j,M){let q=0;return U;function U(Y){return O.enter("lineEnding"),O.consume(Y),O.exit("lineEnding"),Q}function Q(Y){return O.enter("codeFencedFence"),kt(Y)?Lt(O,Z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):Z(Y)}function Z(Y){return Y===c?(O.enter("codeFencedFenceSequence"),G(Y)):M(Y)}function G(Y){return Y===c?(q++,O.consume(Y),G):q>=l?(O.exit("codeFencedFenceSequence"),kt(Y)?Lt(O,ee,"whitespace")(Y):ee(Y)):M(Y)}function ee(Y){return Y===null||st(Y)?(O.exit("codeFencedFence"),j(Y)):M(Y)}}}function B$(e,t,n){const r=this;return i;function i(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const Eg={name:"codeIndented",tokenize:U$},H$={partial:!0,tokenize:z$};function U$(e,t,n){const r=this;return i;function i(d){return e.enter("codeIndented"),Lt(e,o,"linePrefix",5)(d)}function o(d){const m=r.events[r.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?l(d):n(d)}function l(d){return d===null?f(d):st(d)?e.attempt(H$,l,f)(d):(e.enter("codeFlowValue"),c(d))}function c(d){return d===null||st(d)?(e.exit("codeFlowValue"),l(d)):(e.consume(d),c)}function f(d){return e.exit("codeIndented"),t(d)}}function z$(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):st(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):Lt(e,o,"linePrefix",5)(l)}function o(l){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):st(l)?i(l):n(l)}}const F$={name:"codeText",previous:$$,resolve:V$,tokenize:q$};function V$(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 $$(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function q$(e,t,n){let r=0,i,o;return l;function l(p){return e.enter("codeText"),e.enter("codeTextSequence"),c(p)}function c(p){return p===96?(e.consume(p),r++,c):(e.exit("codeTextSequence"),f(p))}function f(p){return p===null?n(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),f):p===96?(o=e.enter("codeTextSequence"),i=0,m(p)):st(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),f):(e.enter("codeTextData"),d(p))}function d(p){return p===null||p===32||p===96||st(p)?(e.exit("codeTextData"),f(p)):(e.consume(p),d)}function m(p){return p===96?(e.consume(p),i++,m):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(o.type="codeTextData",d(p))}}class Y${constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Iu(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Iu(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Iu(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Iu(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Iu(this.left,n.reverse())}}}function Iu(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Z_(e){const t={};let n=-1,r,i,o,l,c,f,d;const m=new Y$(e);for(;++n<m.length;){for(;n in t;)n=t[n];if(r=m.get(n),n&&r[1].type==="chunkFlow"&&m.get(n-1)[1].type==="listItemPrefix"&&(f=r[1]._tokenizer.events,o=0,o<f.length&&f[o][1].type==="lineEndingBlank"&&(o+=2),o<f.length&&f[o][1].type==="content"))for(;++o<f.length&&f[o][1].type!=="content";)f[o][1].type==="chunkText"&&(f[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,G$(m,n)),n=t[n],d=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(l=m.get(o),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(i&&(m.get(i)[1].type="lineEndingBlank"),l[1].type="lineEnding",i=o);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;i&&(r[1].end={...m.get(i)[1].start},c=m.slice(i,n),c.unshift(r),m.splice(i,n-i+1,c))}}return Pr(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!d}function G$(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const c=l.events,f=[],d={};let m,p,b=-1,y=n,E=0,w=0;const k=[w];for(;y;){for(;e.get(++i)[1]!==y;);o.push(i),y._tokenizer||(m=r.sliceStream(y),y.next||m.push(null),p&&l.defineSkip(y.start),y._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(m),y._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),p=y,y=y.next}for(y=n;++b<c.length;)c[b][0]==="exit"&&c[b-1][0]==="enter"&&c[b][1].type===c[b-1][1].type&&c[b][1].start.line!==c[b][1].end.line&&(w=b+1,k.push(w),y._tokenizer=void 0,y.previous=void 0,y=y.next);for(l.events=[],y?(y._tokenizer=void 0,y.previous=void 0):k.pop(),b=k.length;b--;){const C=c.slice(k[b],k[b+1]),A=o.pop();f.push([A,A+C.length-1]),e.splice(A,2,C)}for(f.reverse(),b=-1;++b<f.length;)d[E+f[b][0]]=E+f[b][1],E+=f[b][1]-f[b][0]-1;return d}const X$={resolve:Q$,tokenize:W$},K$={partial:!0,tokenize:Z$};function Q$(e){return Z_(e),e}function W$(e,t){let n;return r;function r(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(c)}function i(c){return c===null?o(c):st(c)?e.check(K$,l,o)(c):(e.consume(c),i)}function o(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function l(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function Z$(e,t,n){const r=this;return i;function i(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Lt(e,o,"linePrefix")}function o(l){if(l===null||st(l))return n(l);const c=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function J_(e,t,n,r,i,o,l,c,f){const d=f||Number.POSITIVE_INFINITY;let m=0;return p;function p(C){return C===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(C),e.exit(o),b):C===null||C===32||C===41||vh(C)?n(C):(e.enter(r),e.enter(l),e.enter(c),e.enter("chunkString",{contentType:"string"}),w(C))}function b(C){return C===62?(e.enter(o),e.consume(C),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),y(C))}function y(C){return C===62?(e.exit("chunkString"),e.exit(c),b(C)):C===null||C===60||st(C)?n(C):(e.consume(C),C===92?E:y)}function E(C){return C===60||C===62||C===92?(e.consume(C),y):y(C)}function w(C){return!m&&(C===null||C===41||rn(C))?(e.exit("chunkString"),e.exit(c),e.exit(l),e.exit(r),t(C)):m<d&&C===40?(e.consume(C),m++,w):C===41?(e.consume(C),m--,w):C===null||C===32||C===40||vh(C)?n(C):(e.consume(C),C===92?k:w)}function k(C){return C===40||C===41||C===92?(e.consume(C),w):w(C)}}function eN(e,t,n,r,i,o){const l=this;let c=0,f;return d;function d(y){return e.enter(r),e.enter(i),e.consume(y),e.exit(i),e.enter(o),m}function m(y){return c>999||y===null||y===91||y===93&&!f||y===94&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs?n(y):y===93?(e.exit(o),e.enter(i),e.consume(y),e.exit(i),e.exit(r),t):st(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===null||y===91||y===93||st(y)||c++>999?(e.exit("chunkString"),m(y)):(e.consume(y),f||(f=!kt(y)),y===92?b:p)}function b(y){return y===91||y===92||y===93?(e.consume(y),c++,p):p(y)}}function tN(e,t,n,r,i,o){let l;return c;function c(b){return b===34||b===39||b===40?(e.enter(r),e.enter(i),e.consume(b),e.exit(i),l=b===40?41:b,f):n(b)}function f(b){return b===l?(e.enter(i),e.consume(b),e.exit(i),e.exit(r),t):(e.enter(o),d(b))}function d(b){return b===l?(e.exit(o),f(l)):b===null?n(b):st(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),Lt(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===l||b===null||st(b)?(e.exit("chunkString"),d(b)):(e.consume(b),b===92?p:m)}function p(b){return b===l||b===92?(e.consume(b),m):m(b)}}function nc(e,t){let n;return r;function r(i){return st(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):kt(i)?Lt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const J$={name:"definition",tokenize:tq},eq={partial:!0,tokenize:nq};function tq(e,t,n){const r=this;let i;return o;function o(y){return e.enter("definition"),l(y)}function l(y){return eN.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function c(y){return i=ls(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),f):n(y)}function f(y){return rn(y)?nc(e,d)(y):d(y)}function d(y){return J_(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function m(y){return e.attempt(eq,p,p)(y)}function p(y){return kt(y)?Lt(e,b,"whitespace")(y):b(y)}function b(y){return y===null||st(y)?(e.exit("definition"),r.parser.defined.push(i),t(y)):n(y)}}function nq(e,t,n){return r;function r(c){return rn(c)?nc(e,i)(c):n(c)}function i(c){return tN(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function o(c){return kt(c)?Lt(e,l,"whitespace")(c):l(c)}function l(c){return c===null||st(c)?t(c):n(c)}}const rq={name:"hardBreakEscape",tokenize:sq};function sq(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return st(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const iq={name:"headingAtx",resolve:aq,tokenize:oq};function aq(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Pr(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function oq(e,t,n){let r=0;return i;function i(m){return e.enter("atxHeading"),o(m)}function o(m){return e.enter("atxHeadingSequence"),l(m)}function l(m){return m===35&&r++<6?(e.consume(m),l):m===null||rn(m)?(e.exit("atxHeadingSequence"),c(m)):n(m)}function c(m){return m===35?(e.enter("atxHeadingSequence"),f(m)):m===null||st(m)?(e.exit("atxHeading"),t(m)):kt(m)?Lt(e,c,"whitespace")(m):(e.enter("atxHeadingText"),d(m))}function f(m){return m===35?(e.consume(m),f):(e.exit("atxHeadingSequence"),c(m))}function d(m){return m===null||m===35||rn(m)?(e.exit("atxHeadingText"),c(m)):(e.consume(m),d)}}const lq=["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"],JS=["pre","script","style","textarea"],uq={concrete:!0,name:"htmlFlow",resolveTo:dq,tokenize:hq},cq={partial:!0,tokenize:mq},fq={partial:!0,tokenize:pq};function dq(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 hq(e,t,n){const r=this;let i,o,l,c,f;return d;function d(L){return m(L)}function m(L){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(L),p}function p(L){return L===33?(e.consume(L),b):L===47?(e.consume(L),o=!0,w):L===63?(e.consume(L),i=3,r.interrupt?t:I):ar(L)?(e.consume(L),l=String.fromCharCode(L),k):n(L)}function b(L){return L===45?(e.consume(L),i=2,y):L===91?(e.consume(L),i=5,c=0,E):ar(L)?(e.consume(L),i=4,r.interrupt?t:I):n(L)}function y(L){return L===45?(e.consume(L),r.interrupt?t:I):n(L)}function E(L){const ae="CDATA[";return L===ae.charCodeAt(c++)?(e.consume(L),c===ae.length?r.interrupt?t:Z:E):n(L)}function w(L){return ar(L)?(e.consume(L),l=String.fromCharCode(L),k):n(L)}function k(L){if(L===null||L===47||L===62||rn(L)){const ae=L===47,ie=l.toLowerCase();return!ae&&!o&&JS.includes(ie)?(i=1,r.interrupt?t(L):Z(L)):lq.includes(l.toLowerCase())?(i=6,ae?(e.consume(L),C):r.interrupt?t(L):Z(L)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(L):o?A(L):_(L))}return L===45||Jn(L)?(e.consume(L),l+=String.fromCharCode(L),k):n(L)}function C(L){return L===62?(e.consume(L),r.interrupt?t:Z):n(L)}function A(L){return kt(L)?(e.consume(L),A):U(L)}function _(L){return L===47?(e.consume(L),U):L===58||L===95||ar(L)?(e.consume(L),N):kt(L)?(e.consume(L),_):U(L)}function N(L){return L===45||L===46||L===58||L===95||Jn(L)?(e.consume(L),N):D(L)}function D(L){return L===61?(e.consume(L),O):kt(L)?(e.consume(L),D):_(L)}function O(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(e.consume(L),f=L,j):kt(L)?(e.consume(L),O):M(L)}function j(L){return L===f?(e.consume(L),f=null,q):L===null||st(L)?n(L):(e.consume(L),j)}function M(L){return L===null||L===34||L===39||L===47||L===60||L===61||L===62||L===96||rn(L)?D(L):(e.consume(L),M)}function q(L){return L===47||L===62||kt(L)?_(L):n(L)}function U(L){return L===62?(e.consume(L),Q):n(L)}function Q(L){return L===null||st(L)?Z(L):kt(L)?(e.consume(L),Q):n(L)}function Z(L){return L===45&&i===2?(e.consume(L),H):L===60&&i===1?(e.consume(L),K):L===62&&i===4?(e.consume(L),P):L===63&&i===3?(e.consume(L),I):L===93&&i===5?(e.consume(L),le):st(L)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(cq,$,G)(L)):L===null||st(L)?(e.exit("htmlFlowData"),G(L)):(e.consume(L),Z)}function G(L){return e.check(fq,ee,$)(L)}function ee(L){return e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),Y}function Y(L){return L===null||st(L)?G(L):(e.enter("htmlFlowData"),Z(L))}function H(L){return L===45?(e.consume(L),I):Z(L)}function K(L){return L===47?(e.consume(L),l="",te):Z(L)}function te(L){if(L===62){const ae=l.toLowerCase();return JS.includes(ae)?(e.consume(L),P):Z(L)}return ar(L)&&l.length<8?(e.consume(L),l+=String.fromCharCode(L),te):Z(L)}function le(L){return L===93?(e.consume(L),I):Z(L)}function I(L){return L===62?(e.consume(L),P):L===45&&i===2?(e.consume(L),I):Z(L)}function P(L){return L===null||st(L)?(e.exit("htmlFlowData"),$(L)):(e.consume(L),P)}function $(L){return e.exit("htmlFlow"),t(L)}}function pq(e,t,n){const r=this;return i;function i(l){return st(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):n(l)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function mq(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Pc,t,n)}}const gq={name:"htmlText",tokenize:bq};function bq(e,t,n){const r=this;let i,o,l;return c;function c(I){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(I),f}function f(I){return I===33?(e.consume(I),d):I===47?(e.consume(I),D):I===63?(e.consume(I),_):ar(I)?(e.consume(I),M):n(I)}function d(I){return I===45?(e.consume(I),m):I===91?(e.consume(I),o=0,E):ar(I)?(e.consume(I),A):n(I)}function m(I){return I===45?(e.consume(I),y):n(I)}function p(I){return I===null?n(I):I===45?(e.consume(I),b):st(I)?(l=p,K(I)):(e.consume(I),p)}function b(I){return I===45?(e.consume(I),y):p(I)}function y(I){return I===62?H(I):I===45?b(I):p(I)}function E(I){const P="CDATA[";return I===P.charCodeAt(o++)?(e.consume(I),o===P.length?w:E):n(I)}function w(I){return I===null?n(I):I===93?(e.consume(I),k):st(I)?(l=w,K(I)):(e.consume(I),w)}function k(I){return I===93?(e.consume(I),C):w(I)}function C(I){return I===62?H(I):I===93?(e.consume(I),C):w(I)}function A(I){return I===null||I===62?H(I):st(I)?(l=A,K(I)):(e.consume(I),A)}function _(I){return I===null?n(I):I===63?(e.consume(I),N):st(I)?(l=_,K(I)):(e.consume(I),_)}function N(I){return I===62?H(I):_(I)}function D(I){return ar(I)?(e.consume(I),O):n(I)}function O(I){return I===45||Jn(I)?(e.consume(I),O):j(I)}function j(I){return st(I)?(l=j,K(I)):kt(I)?(e.consume(I),j):H(I)}function M(I){return I===45||Jn(I)?(e.consume(I),M):I===47||I===62||rn(I)?q(I):n(I)}function q(I){return I===47?(e.consume(I),H):I===58||I===95||ar(I)?(e.consume(I),U):st(I)?(l=q,K(I)):kt(I)?(e.consume(I),q):H(I)}function U(I){return I===45||I===46||I===58||I===95||Jn(I)?(e.consume(I),U):Q(I)}function Q(I){return I===61?(e.consume(I),Z):st(I)?(l=Q,K(I)):kt(I)?(e.consume(I),Q):q(I)}function Z(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),i=I,G):st(I)?(l=Z,K(I)):kt(I)?(e.consume(I),Z):(e.consume(I),ee)}function G(I){return I===i?(e.consume(I),i=void 0,Y):I===null?n(I):st(I)?(l=G,K(I)):(e.consume(I),G)}function ee(I){return I===null||I===34||I===39||I===60||I===61||I===96?n(I):I===47||I===62||rn(I)?q(I):(e.consume(I),ee)}function Y(I){return I===47||I===62||rn(I)?q(I):n(I)}function H(I){return I===62?(e.consume(I),e.exit("htmlTextData"),e.exit("htmlText"),t):n(I)}function K(I){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),te}function te(I){return kt(I)?Lt(e,le,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):le(I)}function le(I){return e.enter("htmlTextData"),l(I)}}const G1={name:"labelEnd",resolveAll:Tq,resolveTo:vq,tokenize:Sq},xq={tokenize:Cq},yq={tokenize:wq},Eq={tokenize:kq};function Tq(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Pr(e,0,e.length,n),e}function vq(e,t){let n=e.length,r=0,i,o,l,c;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(l=n);const f={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[o][1].start},end:{...e[l][1].end}},m={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[l-2][1].start}};return c=[["enter",f,t],["enter",d,t]],c=Zr(c,e.slice(o+1,o+r+3)),c=Zr(c,[["enter",m,t]]),c=Zr(c,dp(t.parser.constructs.insideSpan.null,e.slice(o+r+4,l-3),t)),c=Zr(c,[["exit",m,t],e[l-2],e[l-1],["exit",d,t]]),c=Zr(c,e.slice(l+1)),c=Zr(c,[["exit",f,t]]),Pr(e,o,e.length,c),e}function Sq(e,t,n){const r=this;let i=r.events.length,o,l;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return c;function c(b){return o?o._inactive?p(b):(l=r.parser.defined.includes(ls(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(b),e.exit("labelMarker"),e.exit("labelEnd"),f):n(b)}function f(b){return b===40?e.attempt(xq,m,l?m:p)(b):b===91?e.attempt(yq,m,l?d:p)(b):l?m(b):p(b)}function d(b){return e.attempt(Eq,m,p)(b)}function m(b){return t(b)}function p(b){return o._balanced=!0,n(b)}}function Cq(e,t,n){return r;function r(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),i}function i(p){return rn(p)?nc(e,o)(p):o(p)}function o(p){return p===41?m(p):J_(e,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function l(p){return rn(p)?nc(e,f)(p):m(p)}function c(p){return n(p)}function f(p){return p===34||p===39||p===40?tN(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):m(p)}function d(p){return rn(p)?nc(e,m)(p):m(p)}function m(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):n(p)}}function wq(e,t,n){const r=this;return i;function i(c){return eN.call(r,e,o,l,"reference","referenceMarker","referenceString")(c)}function o(c){return r.parser.defined.includes(ls(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function l(c){return n(c)}}function kq(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const Aq={name:"labelStartImage",resolveAll:G1.resolveAll,tokenize:_q};function _q(e,t,n){const r=this;return i;function i(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),o}function o(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),l):n(c)}function l(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):t(c)}}const Nq={name:"labelStartLink",resolveAll:G1.resolveAll,tokenize:Rq};function Rq(e,t,n){const r=this;return i;function i(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),o}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const Tg={name:"lineEnding",tokenize:Oq};function Oq(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Lt(e,t,"linePrefix")}}const Yd={name:"thematicBreak",tokenize:Iq};function Iq(e,t,n){let r=0,i;return o;function o(d){return e.enter("thematicBreak"),l(d)}function l(d){return i=d,c(d)}function c(d){return d===i?(e.enter("thematicBreakSequence"),f(d)):r>=3&&(d===null||st(d))?(e.exit("thematicBreak"),t(d)):n(d)}function f(d){return d===i?(e.consume(d),r++,f):(e.exit("thematicBreakSequence"),kt(d)?Lt(e,c,"whitespace")(d):c(d))}}const Tr={continuation:{tokenize:Pq},exit:Bq,name:"list",tokenize:Dq},Lq={partial:!0,tokenize:Hq},Mq={partial:!0,tokenize:jq};function Dq(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return c;function c(y){const E=r.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(E==="listUnordered"?!r.containerState.marker||y===r.containerState.marker:yb(y)){if(r.containerState.type||(r.containerState.type=E,e.enter(E,{_container:!0})),E==="listUnordered")return e.enter("listItemPrefix"),y===42||y===45?e.check(Yd,n,d)(y):d(y);if(!r.interrupt||y===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(y)}return n(y)}function f(y){return yb(y)&&++l<10?(e.consume(y),f):(!r.interrupt||l<2)&&(r.containerState.marker?y===r.containerState.marker:y===41||y===46)?(e.exit("listItemValue"),d(y)):n(y)}function d(y){return e.enter("listItemMarker"),e.consume(y),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||y,e.check(Pc,r.interrupt?n:m,e.attempt(Lq,b,p))}function m(y){return r.containerState.initialBlankLine=!0,o++,b(y)}function p(y){return kt(y)?(e.enter("listItemPrefixWhitespace"),e.consume(y),e.exit("listItemPrefixWhitespace"),b):n(y)}function b(y){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(y)}}function Pq(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Pc,i,o);function i(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Lt(e,t,"listItemIndent",r.containerState.size+1)(c)}function o(c){return r.containerState.furtherBlankLines||!kt(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Mq,t,l)(c))}function l(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,Lt(e,e.attempt(Tr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function jq(e,t,n){const r=this;return Lt(e,i,"listItemIndent",r.containerState.size+1);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(o):n(o)}}function Bq(e){e.exit(this.containerState.type)}function Hq(e,t,n){const r=this;return Lt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const l=r.events[r.events.length-1];return!kt(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const eC={name:"setextUnderline",resolveTo:Uq,tokenize:zq};function Uq(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",l,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function zq(e,t,n){const r=this;let i;return o;function o(d){let m=r.events.length,p;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){p=r.events[m][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),i=d,l(d)):n(d)}function l(d){return e.enter("setextHeadingLineSequence"),c(d)}function c(d){return d===i?(e.consume(d),c):(e.exit("setextHeadingLineSequence"),kt(d)?Lt(e,f,"lineSuffix")(d):f(d))}function f(d){return d===null||st(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const Fq={tokenize:Qq,partial:!0};function Vq(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Gq,continuation:{tokenize:Xq},exit:Kq}},text:{91:{name:"gfmFootnoteCall",tokenize:Yq},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:$q,resolveTo:qq}}}}function $q(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;i--;){const f=r.events[i][1];if(f.type==="labelImage"){l=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return c;function c(f){if(!l||!l._balanced)return n(f);const d=ls(r.sliceSerialize({start:l.end,end:r.now()}));return d.codePointAt(0)!==94||!o.includes(d.slice(1))?n(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function qq(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},c=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",l,t],["exit",l,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...c),e}function Yq(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,l;return c;function c(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),f}function f(p){return p!==94?n(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(p){if(o>999||p===93&&!l||p===null||p===91||rn(p))return n(p);if(p===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return i.includes(ls(r.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(p)}return rn(p)||(l=!0),o++,e.consume(p),p===92?m:d}function m(p){return p===91||p===92||p===93?(e.consume(p),o++,d):d(p)}}function Gq(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,l=0,c;return f;function f(E){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(E),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(E){return E===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(E),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",m):n(E)}function m(E){if(l>999||E===93&&!c||E===null||E===91||rn(E))return n(E);if(E===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return o=ls(r.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(E),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return rn(E)||(c=!0),l++,e.consume(E),E===92?p:m}function p(E){return E===91||E===92||E===93?(e.consume(E),l++,m):m(E)}function b(E){return E===58?(e.enter("definitionMarker"),e.consume(E),e.exit("definitionMarker"),i.includes(o)||i.push(o),Lt(e,y,"gfmFootnoteDefinitionWhitespace")):n(E)}function y(E){return t(E)}}function Xq(e,t,n){return e.check(Pc,t,e.attempt(Fq,t,n))}function Kq(e){e.exit("gfmFootnoteDefinition")}function Qq(e,t,n){const r=this;return Lt(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(o):n(o)}}function Wq(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(l,c){let f=-1;for(;++f<l.length;)if(l[f][0]==="enter"&&l[f][1].type==="strikethroughSequenceTemporary"&&l[f][1]._close){let d=f;for(;d--;)if(l[d][0]==="exit"&&l[d][1].type==="strikethroughSequenceTemporary"&&l[d][1]._open&&l[f][1].end.offset-l[f][1].start.offset===l[d][1].end.offset-l[d][1].start.offset){l[f][1].type="strikethroughSequence",l[d][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},l[d][1].start),end:Object.assign({},l[f][1].end)},p={type:"strikethroughText",start:Object.assign({},l[d][1].end),end:Object.assign({},l[f][1].start)},b=[["enter",m,c],["enter",l[d][1],c],["exit",l[d][1],c],["enter",p,c]],y=c.parser.constructs.insideSpan.null;y&&Pr(b,b.length,0,dp(y,l.slice(d+1,f),c)),Pr(b,b.length,0,[["exit",p,c],["enter",l[f][1],c],["exit",l[f][1],c],["exit",m,c]]),Pr(l,d-1,f-d+3,b),f=d+b.length-2;break}}for(f=-1;++f<l.length;)l[f][1].type==="strikethroughSequenceTemporary"&&(l[f][1].type="data");return l}function o(l,c,f){const d=this.previous,m=this.events;let p=0;return b;function b(E){return d===126&&m[m.length-1][1].type!=="characterEscape"?f(E):(l.enter("strikethroughSequenceTemporary"),y(E))}function y(E){const w=xl(d);if(E===126)return p>1?f(E):(l.consume(E),p++,y);if(p<2&&!n)return f(E);const k=l.exit("strikethroughSequenceTemporary"),C=xl(E);return k._open=!C||C===2&&!!w,k._close=!w||w===2&&!!C,c(E)}}}class Zq{constructor(){this.map=[]}add(t,n,r){Jq(this,t,n,r)}consume(t){if(this.map.sort(function(o,l){return o[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function Jq(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function eY(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function tY(){return{flow:{null:{name:"table",tokenize:nY,resolveAll:rY}}}}function nY(e,t,n){const r=this;let i=0,o=0,l;return c;function c(U){let Q=r.events.length-1;for(;Q>-1;){const ee=r.events[Q][1].type;if(ee==="lineEnding"||ee==="linePrefix")Q--;else break}const Z=Q>-1?r.events[Q][1].type:null,G=Z==="tableHead"||Z==="tableRow"?O:f;return G===O&&r.parser.lazy[r.now().line]?n(U):G(U)}function f(U){return e.enter("tableHead"),e.enter("tableRow"),d(U)}function d(U){return U===124||(l=!0,o+=1),m(U)}function m(U){return U===null?n(U):st(U)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),y):n(U):kt(U)?Lt(e,m,"whitespace")(U):(o+=1,l&&(l=!1,i+=1),U===124?(e.enter("tableCellDivider"),e.consume(U),e.exit("tableCellDivider"),l=!0,m):(e.enter("data"),p(U)))}function p(U){return U===null||U===124||rn(U)?(e.exit("data"),m(U)):(e.consume(U),U===92?b:p)}function b(U){return U===92||U===124?(e.consume(U),p):p(U)}function y(U){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(U):(e.enter("tableDelimiterRow"),l=!1,kt(U)?Lt(e,E,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):E(U))}function E(U){return U===45||U===58?k(U):U===124?(l=!0,e.enter("tableCellDivider"),e.consume(U),e.exit("tableCellDivider"),w):D(U)}function w(U){return kt(U)?Lt(e,k,"whitespace")(U):k(U)}function k(U){return U===58?(o+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(U),e.exit("tableDelimiterMarker"),C):U===45?(o+=1,C(U)):U===null||st(U)?N(U):D(U)}function C(U){return U===45?(e.enter("tableDelimiterFiller"),A(U)):D(U)}function A(U){return U===45?(e.consume(U),A):U===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(U),e.exit("tableDelimiterMarker"),_):(e.exit("tableDelimiterFiller"),_(U))}function _(U){return kt(U)?Lt(e,N,"whitespace")(U):N(U)}function N(U){return U===124?E(U):U===null||st(U)?!l||i!==o?D(U):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(U)):D(U)}function D(U){return n(U)}function O(U){return e.enter("tableRow"),j(U)}function j(U){return U===124?(e.enter("tableCellDivider"),e.consume(U),e.exit("tableCellDivider"),j):U===null||st(U)?(e.exit("tableRow"),t(U)):kt(U)?Lt(e,j,"whitespace")(U):(e.enter("data"),M(U))}function M(U){return U===null||U===124||rn(U)?(e.exit("data"),j(U)):(e.consume(U),U===92?q:M)}function q(U){return U===92||U===124?(e.consume(U),M):M(U)}}function rY(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],l=[0,0,0,0],c=!1,f=0,d,m,p;const b=new Zq;for(;++n<e.length;){const y=e[n],E=y[1];y[0]==="enter"?E.type==="tableHead"?(c=!1,f!==0&&(tC(b,t,f,d,m),m=void 0,f=0),d={type:"table",start:Object.assign({},E.start),end:Object.assign({},E.end)},b.add(n,0,[["enter",d,t]])):E.type==="tableRow"||E.type==="tableDelimiterRow"?(r=!0,p=void 0,o=[0,0,0,0],l=[0,n+1,0,0],c&&(c=!1,m={type:"tableBody",start:Object.assign({},E.start),end:Object.assign({},E.end)},b.add(n,0,[["enter",m,t]])),i=E.type==="tableDelimiterRow"?2:m?3:1):i&&(E.type==="data"||E.type==="tableDelimiterMarker"||E.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(o[1]!==0&&(l[0]=l[1],p=wd(b,t,o,i,void 0,p),o=[0,0,0,0]),l[2]=n)):E.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(l[0]=l[1],p=wd(b,t,o,i,void 0,p)),o=l,l=[o[1],n,0,0])):E.type==="tableHead"?(c=!0,f=n):E.type==="tableRow"||E.type==="tableDelimiterRow"?(f=n,o[1]!==0?(l[0]=l[1],p=wd(b,t,o,i,n,p)):l[1]!==0&&(p=wd(b,t,l,i,n,p)),i=0):i&&(E.type==="data"||E.type==="tableDelimiterMarker"||E.type==="tableDelimiterFiller")&&(l[3]=n)}for(f!==0&&tC(b,t,f,d,m),b.consume(t.events),n=-1;++n<t.events.length;){const y=t.events[n];y[0]==="enter"&&y[1].type==="table"&&(y[1]._align=eY(t.events,n))}return e}function wd(e,t,n,r,i,o){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(o.end=Object.assign({},sl(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const f=sl(t.events,n[1]);if(o={type:l,start:Object.assign({},f),end:Object.assign({},f)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const d=sl(t.events,n[2]),m=sl(t.events,n[3]),p={type:c,start:Object.assign({},d),end:Object.assign({},m)};if(e.add(n[2],0,[["enter",p,t]]),r!==2){const b=t.events[n[2]],y=t.events[n[3]];if(b[1].end=Object.assign({},y[1].end),b[1].type="chunkText",b[1].contentType="text",n[3]>n[2]+1){const E=n[2]+1,w=n[3]-n[2]-1;e.add(E,w,[])}}e.add(n[3]+1,0,[["exit",p,t]])}return i!==void 0&&(o.end=Object.assign({},sl(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function tC(e,t,n,r,i){const o=[],l=sl(t.events,n);i&&(i.end=Object.assign({},l),o.push(["exit",i,t])),r.end=Object.assign({},l),o.push(["exit",r,t]),e.add(n+1,0,o)}function sl(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const sY={name:"tasklistCheck",tokenize:aY};function iY(){return{text:{91:sY}}}function aY(e,t,n){const r=this;return i;function i(f){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(f):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),o)}function o(f){return rn(f)?(e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),l):f===88||f===120?(e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),l):n(f)}function l(f){return f===93?(e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):n(f)}function c(f){return st(f)?t(f):kt(f)?e.check({tokenize:oY},t,n)(f):n(f)}}function oY(e,t,n){return Lt(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function lY(e){return U_([x$(),Vq(),Wq(e),tY(),iY()])}const uY={};function cY(e){const t=this,n=e||uY,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(lY(n)),o.push(d$()),l.push(h$(n))}var fY=Object.defineProperty,dY=Object.defineProperties,hY=Object.getOwnPropertyDescriptors,nC=Object.getOwnPropertySymbols,pY=Object.prototype.hasOwnProperty,mY=Object.prototype.propertyIsEnumerable,rC=(e,t,n)=>t in e?fY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nN=(e,t)=>{for(var n in t||(t={}))pY.call(t,n)&&rC(e,n,t[n]);if(nC)for(var n of nC(t))mY.call(t,n)&&rC(e,n,t[n]);return e},rN=(e,t)=>dY(e,hY(t)),fr=(e,t)=>{let n=!1,r=!1;for(let i=0;i<t;i+=1){if(e[i]==="\\"&&i+1<e.length&&e[i+1]==="`"){i+=1;continue}if(e.substring(i,i+3)==="```"){r=!r,i+=2;continue}!r&&e[i]==="`"&&(n=!n)}return n||r},gY=(e,t)=>{let n=e.substring(t,t+3)==="```",r=t>0&&e.substring(t-1,t+2)==="```",i=t>1&&e.substring(t-2,t+1)==="```";return n||r||i},bY=e=>{let t=0;for(let n=0;n<e.length;n+=1){if(e[n]==="\\"&&n+1<e.length&&e[n+1]==="`"){n+=1;continue}e[n]==="`"&&!gY(e,n)&&(t+=1)}return t},sa=(e,t)=>{let n=!1,r=!1,i=-1;for(let o=0;o<e.length;o+=1){if(e[o]==="\\"&&o+1<e.length&&e[o+1]==="`"){o+=1;continue}if(e.substring(o,o+3)==="```"){r=!r,o+=2;continue}if(!r&&e[o]==="`")if(n){if(i<t&&t<o)return!0;n=!1,i=-1}else n=!0,i=o}return!1},xY=/^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm,yY=e=>!e||typeof e!="string"||!e.includes(">")?e:e.replace(xY,(t,n,r,i)=>fr(e,i)?t:`${n}\\>${r}`),EY=/(\*\*)([^*]*\*?)$/,TY=/(__)([^_]*?)$/,vY=/(\*\*\*)([^*]*?)$/,SY=/(\*)([^*]*?)$/,CY=/(_)([^_]*?)$/,wY=/(`)([^`]*?)$/,kY=/(~~)([^~]*?)$/,po=/^[\s_~*`]*$/,sN=/^[\s]*[-*+][\s]+$/,AY=/[\p{L}\p{N}_]/u,_Y=/^```[^`\n]*```?$/,NY=/^\*{4,}$/,RY=/(__)([^_]+)_$/,OY=/(~~)([^~]+)~$/,sC=/~~/g,ia=e=>{if(!e)return!1;let t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t===95?!0:AY.test(e)},IY=(e,t)=>{let n=1;for(let r=t-1;r>=0;r-=1)if(e[r]==="]")n+=1;else if(e[r]==="["&&(n-=1,n===0))return r;return-1},iN=(e,t)=>{let n=1;for(let r=t+1;r<e.length;r+=1)if(e[r]==="[")n+=1;else if(e[r]==="]"&&(n-=1,n===0))return r;return-1},hp=(e,t)=>{let n=!1,r=!1;for(let i=0;i<e.length&&i<t;i+=1){if(e[i]==="\\"&&e[i+1]==="$"){i+=1;continue}e[i]==="$"&&(e[i+1]==="$"?(r=!r,i+=1,n=!1):r||(n=!n))}return n||r},LY=(e,t)=>{for(let n=t;n<e.length;n+=1){if(e[n]===")")return!0;if(e[n]===`
|
|
368
|
-
`)return!1}return!1},aN=(e,t)=>{for(let n=t-1;n>=0;n-=1){if(e[n]===")")return!1;if(e[n]==="(")return n>0&&e[n-1]==="]"?LY(e,t):!1;if(e[n]===`
|
|
369
|
-
`)return!1}return!1},MY=(e,t)=>{for(let n=t-1;n>=0;n-=1){if(e[n]===">")return!1;if(e[n]==="<"){let r=n+1<e.length?e[n+1]:"";return r>="a"&&r<="z"||r>="A"&&r<="Z"||r==="/"}if(e[n]===`
|
|
370
|
-
`)return!1}return!1},X1=(e,t,n)=>{let r=0;for(let f=t-1;f>=0;f-=1)if(e[f]===`
|
|
371
|
-
`){r=f+1;break}let i=e.length;for(let f=t;f<e.length;f+=1)if(e[f]===`
|
|
372
|
-
`){i=f;break}let o=e.substring(r,i),l=0,c=!1;for(let f of o)if(f===n)l+=1;else if(f!==" "&&f!==" "){c=!0;break}return l>=3&&!c},DY=(e,t,n,r)=>n==="\\"||e.includes("$")&&hp(e,t)?!0:n!=="*"&&r==="*"?(t<e.length-2?e[t+2]:"")!=="*":!!(n==="*"||n&&r&&ia(n)&&ia(r)||(!n||n===" "||n===" "||n===`
|
|
373
|
-
`)&&(!r||r===" "||r===" "||r===`
|
|
374
|
-
`)),oN=e=>{let t=0,n=!1,r=e.length;for(let i=0;i<r;i+=1){if(e[i]==="`"&&i+2<r&&e[i+1]==="`"&&e[i+2]==="`"){n=!n,i+=2;continue}if(n||e[i]!=="*")continue;let o=i>0?e[i-1]:"",l=i<r-1?e[i+1]:"";DY(e,i,o,l)||(t+=1)}return t},PY=(e,t,n,r)=>!!(n==="\\"||e.includes("$")&&hp(e,t)||aN(e,t)||MY(e,t)||n==="_"||r==="_"||n&&r&&ia(n)&&ia(r)),jY=e=>{let t=0,n=!1,r=e.length;for(let i=0;i<r;i+=1){if(e[i]==="`"&&i+2<r&&e[i+1]==="`"&&e[i+2]==="`"){n=!n,i+=2;continue}if(n||e[i]!=="_")continue;let o=i>0?e[i-1]:"",l=i<r-1?e[i+1]:"";PY(e,i,o,l)||(t+=1)}return t},BY=e=>{let t=0,n=0,r=!1;for(let i=0;i<e.length;i+=1){if(e[i]==="`"&&i+2<e.length&&e[i+1]==="`"&&e[i+2]==="`"){n>=3&&(t+=Math.floor(n/3)),n=0,r=!r,i+=2;continue}r||(e[i]==="*"?n+=1:(n>=3&&(t+=Math.floor(n/3)),n=0))}return n>=3&&(t+=Math.floor(n/3)),t},K1=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="`"&&r+2<e.length&&e[r+1]==="`"&&e[r+2]==="`"){n=!n,r+=2;continue}n||e[r]==="*"&&r+1<e.length&&e[r+1]==="*"&&(t+=1,r+=1)}return t},iC=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="`"&&r+2<e.length&&e[r+1]==="`"&&e[r+2]==="`"){n=!n,r+=2;continue}n||e[r]==="_"&&r+1<e.length&&e[r+1]==="_"&&(t+=1,r+=1)}return t},HY=(e,t,n)=>{if(!t||po.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
|
|
375
|
-
`),i=r===-1?0:r+1,o=e.substring(i,n);return sN.test(o)&&t.includes(`
|
|
376
|
-
`)?!0:X1(e,n,"*")},UY=e=>{let t=e.match(EY);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return fr(e,r)||sa(e,r)||HY(e,n,r)?e:K1(e)%2===1?n.endsWith("*")?`${e}*`:`${e}**`:e},zY=(e,t,n)=>{if(!t||po.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
|
|
377
|
-
`),i=r===-1?0:r+1,o=e.substring(i,n);return sN.test(o)&&t.includes(`
|
|
378
|
-
`)?!0:X1(e,n,"_")},FY=e=>{let t=e.match(TY);if(!t){let i=e.match(RY);if(i){let o=e.lastIndexOf(i[1]);if(!(fr(e,o)||sa(e,o))&&iC(e)%2===1)return`${e}_`}return e}let n=t[2],r=e.lastIndexOf(t[1]);return fr(e,r)||sa(e,r)||zY(e,n,r)?e:iC(e)%2===1?`${e}__`:e},VY=e=>{let t=!1;for(let n=0;n<e.length;n+=1){if(e[n]==="`"&&n+2<e.length&&e[n+1]==="`"&&e[n+2]==="`"){t=!t,n+=2;continue}if(!t&&e[n]==="*"&&e[n-1]!=="*"&&e[n+1]!=="*"&&e[n-1]!=="\\"&&!hp(e,n)){let r=n>0?e[n-1]:"",i=n<e.length-1?e[n+1]:"";if((!r||r===" "||r===" "||r===`
|
|
379
|
-
`)&&(!i||i===" "||i===" "||i===`
|
|
380
|
-
`)||r&&i&&ia(r)&&ia(i))continue;return n}}return-1},$Y=e=>{if(!e.match(SY))return e;let t=VY(e);if(t===-1||fr(e,t)||sa(e,t))return e;let n=e.substring(t+1);return!n||po.test(n)?e:oN(e)%2===1?`${e}*`:e},lN=e=>{let t=!1;for(let n=0;n<e.length;n+=1){if(e[n]==="`"&&n+2<e.length&&e[n+1]==="`"&&e[n+2]==="`"){t=!t,n+=2;continue}if(!t&&e[n]==="_"&&e[n-1]!=="_"&&e[n+1]!=="_"&&e[n-1]!=="\\"&&!hp(e,n)&&!aN(e,n)){let r=n>0?e[n-1]:"",i=n<e.length-1?e[n+1]:"";if(r&&i&&ia(r)&&ia(i))continue;return n}}return-1},qY=e=>{let t=e.length;for(;t>0&&e[t-1]===`
|
|
381
|
-
`;)t-=1;if(t<e.length){let n=e.slice(0,t),r=e.slice(t);return`${n}_${r}`}return`${e}_`},YY=e=>{if(!e.endsWith("**"))return null;let t=e.slice(0,-2);if(K1(t)%2!==1)return null;let n=t.indexOf("**"),r=lN(t);return n!==-1&&r!==-1&&n<r?`${t}_**`:null},GY=e=>{if(!e.match(CY))return e;let t=lN(e);if(t===-1)return e;let n=e.substring(t+1);if(!n||po.test(n)||fr(e,t)||sa(e,t))return e;if(jY(e)%2===1){let r=YY(e);return r!==null?r:qY(e)}return e},XY=e=>{let t=K1(e),n=oN(e);return t%2===0&&n%2===0},KY=(e,t,n)=>!t||po.test(t)||fr(e,n)||sa(e,n)?!0:X1(e,n,"*"),QY=e=>{if(NY.test(e))return e;let t=e.match(vY);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return KY(e,n,r)?e:BY(e)%2===1?XY(e)?e:`${e}***`:e},WY=/<[a-zA-Z/][^>]*$/,ZY=e=>{let t=e.match(WY);return!t||t.index===void 0||fr(e,t.index)?e:e.substring(0,t.index).trimEnd()},JY=e=>!e.match(_Y)||e.includes(`
|
|
382
|
-
`)?null:e.endsWith("``")&&!e.endsWith("```")?`${e}\``:e,eG=e=>(e.match(/```/g)||[]).length%2===1,tG=e=>{let t=JY(e);if(t!==null)return t;let n=e.match(wY);if(n&&!eG(e)){let r=n[2];if(!r||po.test(r))return e;if(bY(e)%2===1)return`${e}\``}return e},uN=(e,t)=>t>=2&&e.substring(t-2,t+1)==="```"||t>=1&&e.substring(t-1,t+2)==="```"||t<=e.length-3&&e.substring(t,t+3)==="```",nG=e=>{let t=0,n=!1;for(let r=0;r<e.length-1;r+=1)e[r]==="`"&&!uN(e,r)&&(n=!n),!n&&e[r]==="$"&&e[r+1]==="$"&&(t+=1,r+=1);return t},rG=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="\\"){r+=1;continue}if(e[r]==="`"&&!uN(e,r)){n=!n;continue}!n&&e[r]==="$"&&(r+1<e.length&&e[r+1]==="$"?r+=1:t+=1)}return t},sG=e=>{if(e.endsWith("$")&&!e.endsWith("$$"))return`${e}$`;let t=e.indexOf("$$");return t!==-1&&e.indexOf(`
|
|
383
|
-
`,t)!==-1&&!e.endsWith(`
|
|
384
|
-
`)?`${e}
|
|
385
|
-
$$`:`${e}$$`},iG=e=>nG(e)%2===0?e:sG(e),aG=e=>rG(e)%2===1?`${e}$`:e,oG=(e,t,n)=>{if(e.substring(t+2).includes(")"))return null;let r=IY(e,t);if(r===-1||fr(e,r))return null;let i=r>0&&e[r-1]==="!",o=i?r-1:r,l=e.substring(0,o);if(i)return l;let c=e.substring(r+1,t);return n==="text-only"?`${l}${c}`:`${l}[${c}](streamdown:incomplete-link)`},aC=(e,t)=>{for(let n=0;n<t;n++)if(e[n]==="["&&!fr(e,n)){if(n>0&&e[n-1]==="!")continue;let r=iN(e,n);if(r===-1)return n;if(r+1<e.length&&e[r+1]==="("){let i=e.indexOf(")",r+2);i!==-1&&(n=i)}}return t},lG=(e,t,n)=>{let r=t>0&&e[t-1]==="!",i=r?t-1:t;if(!e.substring(t+1).includes("]")){let o=e.substring(0,i);if(r)return o;if(n==="text-only"){let l=aC(e,t);return e.substring(0,l)+e.substring(l+1)}return`${e}](streamdown:incomplete-link)`}if(iN(e,t)===-1){let o=e.substring(0,i);if(r)return o;if(n==="text-only"){let l=aC(e,t);return e.substring(0,l)+e.substring(l+1)}return`${e}](streamdown:incomplete-link)`}return null},cN=(e,t="protocol")=>{let n=e.lastIndexOf("](");if(n!==-1&&!fr(e,n)){let r=oG(e,n,t);if(r!==null)return r}for(let r=e.length-1;r>=0;r-=1)if(e[r]==="["&&!fr(e,r)){let i=lG(e,r,t);if(i!==null)return i}return e},uG=/^-{1,2}$/,cG=/^[\s]*-{1,2}[\s]+$/,fG=/^={1,2}$/,dG=/^[\s]*={1,2}[\s]+$/,hG=e=>{if(!e||typeof e!="string")return e;let t=e.lastIndexOf(`
|
|
386
|
-
`);if(t===-1)return e;let n=e.substring(t+1),r=e.substring(0,t),i=n.trim();if(uG.test(i)&&!n.match(cG)){let o=r.split(`
|
|
387
|
-
`).at(-1);if(o&&o.trim().length>0)return`${e}`}if(fG.test(i)&&!n.match(dG)){let o=r.split(`
|
|
388
|
-
`).at(-1);if(o&&o.trim().length>0)return`${e}`}return e},pG=new RegExp("(?<=[\\p{L}\\p{N}_])~(?!~)(?=[\\p{L}\\p{N}_])","gu"),mG=e=>!e||typeof e!="string"||!e.includes("~")?e:e.replace(pG,(t,n)=>fr(e,n)?t:"\\~"),gG=e=>{var t,n;let r=e.match(kY);if(r){let i=r[2];if(!i||po.test(i))return e;let o=e.lastIndexOf(r[1]);if(fr(e,o)||sa(e,o))return e;if(((t=e.match(sC))==null?void 0:t.length)%2===1)return`${e}~~`}else{let i=e.match(OY);if(i){let o=e.lastIndexOf(i[0].slice(0,2));if(fr(e,o)||sa(e,o))return e;if(((n=e.match(sC))==null?void 0:n.length)%2===1)return`${e}~`}}return e},vg=e=>e!==!1,bG=e=>e===!0,ir={SINGLE_TILDE:0,COMPARISON_OPERATORS:5,HTML_TAGS:10,SETEXT_HEADINGS:15,LINKS:20,BOLD_ITALIC:30,BOLD:35,ITALIC_DOUBLE_UNDERSCORE:40,ITALIC_SINGLE_ASTERISK:41,ITALIC_SINGLE_UNDERSCORE:42,INLINE_CODE:50,STRIKETHROUGH:60,KATEX:70,INLINE_KATEX:75,DEFAULT:100},xG=[{handler:{name:"singleTilde",handle:mG,priority:ir.SINGLE_TILDE},optionKey:"singleTilde"},{handler:{name:"comparisonOperators",handle:yY,priority:ir.COMPARISON_OPERATORS},optionKey:"comparisonOperators"},{handler:{name:"htmlTags",handle:ZY,priority:ir.HTML_TAGS},optionKey:"htmlTags"},{handler:{name:"setextHeadings",handle:hG,priority:ir.SETEXT_HEADINGS},optionKey:"setextHeadings"},{handler:{name:"links",handle:cN,priority:ir.LINKS},optionKey:"links",earlyReturn:e=>e.endsWith("](streamdown:incomplete-link)")},{handler:{name:"boldItalic",handle:QY,priority:ir.BOLD_ITALIC},optionKey:"boldItalic"},{handler:{name:"bold",handle:UY,priority:ir.BOLD},optionKey:"bold"},{handler:{name:"italicDoubleUnderscore",handle:FY,priority:ir.ITALIC_DOUBLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"italicSingleAsterisk",handle:$Y,priority:ir.ITALIC_SINGLE_ASTERISK},optionKey:"italic"},{handler:{name:"italicSingleUnderscore",handle:GY,priority:ir.ITALIC_SINGLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"inlineCode",handle:tG,priority:ir.INLINE_CODE},optionKey:"inlineCode"},{handler:{name:"strikethrough",handle:gG,priority:ir.STRIKETHROUGH},optionKey:"strikethrough"},{handler:{name:"katex",handle:iG,priority:ir.KATEX},optionKey:"katex"},{handler:{name:"inlineKatex",handle:aG,priority:ir.INLINE_KATEX},optionKey:"inlineKatex"}],yG=e=>{var t;let n=(t=e?.linkMode)!=null?t:"protocol";return xG.filter(({handler:r,optionKey:i})=>r.name==="links"?vg(e?.links)||vg(e?.images):r.name==="inlineKatex"?bG(e?.inlineKatex):vg(e?.[i])).map(({handler:r,earlyReturn:i})=>r.name==="links"?{handler:rN(nN({},r),{handle:o=>cN(o,n)}),earlyReturn:n==="protocol"?i:void 0}:{handler:r,earlyReturn:i})},EG=(e,t)=>{var n;if(!e||typeof e!="string")return e;let r=e.endsWith(" ")&&!e.endsWith(" ")?e.slice(0,-1):e,i=yG(t),o=((n=t?.handlers)!=null?n:[]).map(c=>{var f;return{handler:rN(nN({},c),{priority:(f=c.priority)!=null?f:ir.DEFAULT}),earlyReturn:void 0}}),l=[...i,...o].sort((c,f)=>{var d,m;return((d=c.handler.priority)!=null?d:0)-((m=f.handler.priority)!=null?m:0)});for(let{handler:c,earlyReturn:f}of l)if(r=c.handle(r),f!=null&&f(r))return r;return r},TG=EG;const vG=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,SG=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,CG={};function oC(e,t){return(CG.jsx?SG:vG).test(e)}const wG=/[ \t\n\f\r]/g;function kG(e){return typeof e=="object"?e.type==="text"?lC(e.value):!1:lC(e)}function lC(e){return e.replace(wG,"")===""}var el={},Sg,uC;function AG(){if(uC)return Sg;uC=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,c=/^\s+|\s+$/g,f=`
|
|
389
|
-
`,d="/",m="*",p="",b="comment",y="declaration";function E(k,C){if(typeof k!="string")throw new TypeError("First argument must be a string");if(!k)return[];C=C||{};var A=1,_=1;function N(ee){var Y=ee.match(t);Y&&(A+=Y.length);var H=ee.lastIndexOf(f);_=~H?ee.length-H:_+ee.length}function D(){var ee={line:A,column:_};return function(Y){return Y.position=new O(ee),q(),Y}}function O(ee){this.start=ee,this.end={line:A,column:_},this.source=C.source}O.prototype.content=k;function j(ee){var Y=new Error(C.source+":"+A+":"+_+": "+ee);if(Y.reason=ee,Y.filename=C.source,Y.line=A,Y.column=_,Y.source=k,!C.silent)throw Y}function M(ee){var Y=ee.exec(k);if(Y){var H=Y[0];return N(H),k=k.slice(H.length),Y}}function q(){M(n)}function U(ee){var Y;for(ee=ee||[];Y=Q();)Y!==!1&&ee.push(Y);return ee}function Q(){var ee=D();if(!(d!=k.charAt(0)||m!=k.charAt(1))){for(var Y=2;p!=k.charAt(Y)&&(m!=k.charAt(Y)||d!=k.charAt(Y+1));)++Y;if(Y+=2,p===k.charAt(Y-1))return j("End of comment missing");var H=k.slice(2,Y-2);return _+=2,N(H),k=k.slice(Y),_+=2,ee({type:b,comment:H})}}function Z(){var ee=D(),Y=M(r);if(Y){if(Q(),!M(i))return j("property missing ':'");var H=M(o),K=ee({type:y,property:w(Y[0].replace(e,p)),value:H?w(H[0].replace(e,p)):p});return M(l),K}}function G(){var ee=[];U(ee);for(var Y;Y=Z();)Y!==!1&&(ee.push(Y),U(ee));return ee}return q(),G()}function w(k){return k?k.replace(c,p):p}return Sg=E,Sg}var cC;function _G(){if(cC)return el;cC=1;var e=el&&el.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(el,"__esModule",{value:!0}),el.default=n;const t=e(AG());function n(r,i){let o=null;if(!r||typeof r!="string")return o;const l=(0,t.default)(r),c=typeof i=="function";return l.forEach(f=>{if(f.type!=="declaration")return;const{property:d,value:m}=f;c?i(d,m,f):m&&(o=o||{},o[d]=m)}),o}return el}var Lu={},fC;function NG(){if(fC)return Lu;fC=1,Object.defineProperty(Lu,"__esModule",{value:!0}),Lu.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(d){return!d||n.test(d)||e.test(d)},l=function(d,m){return m.toUpperCase()},c=function(d,m){return"".concat(m,"-")},f=function(d,m){return m===void 0&&(m={}),o(d)?d:(d=d.toLowerCase(),m.reactCompat?d=d.replace(i,c):d=d.replace(r,c),d.replace(t,l))};return Lu.camelCase=f,Lu}var Mu,dC;function RG(){if(dC)return Mu;dC=1;var e=Mu&&Mu.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(_G()),n=NG();function r(i,o){var l={};return!i||typeof i!="string"||(0,t.default)(i,function(c,f){c&&f&&(l[(0,n.camelCase)(c,o)]=f)}),l}return r.default=r,Mu=r,Mu}var OG=RG();const IG=Ah(OG);function rc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?hC(e.position):"start"in e||"end"in e?hC(e):"line"in e||"column"in e?vb(e):""}function vb(e){return pC(e&&e.line)+":"+pC(e&&e.column)}function hC(e){return vb(e&&e.start)+"-"+vb(e&&e.end)}function pC(e){return e&&typeof e=="number"?e:1}class nr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(l=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const f=r.indexOf(":");f===-1?o.ruleId=r:(o.source=r.slice(0,f),o.ruleId=r.slice(f+1))}if(!o.place&&o.ancestors&&o.ancestors){const f=o.ancestors[o.ancestors.length-1];f&&(o.place=f.position)}const c=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=c?c.line:void 0,this.name=rc(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}nr.prototype.file="";nr.prototype.name="";nr.prototype.reason="";nr.prototype.message="";nr.prototype.stack="";nr.prototype.column=void 0;nr.prototype.line=void 0;nr.prototype.ancestors=void 0;nr.prototype.cause=void 0;nr.prototype.fatal=void 0;nr.prototype.place=void 0;nr.prototype.ruleId=void 0;nr.prototype.source=void 0;const Q1={}.hasOwnProperty,LG=new Map,MG=/[A-Z]/g,DG=new Set(["table","tbody","thead","tfoot","tr"]),PG=new Set(["td","th"]),fN="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function jG(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=qG(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=$G(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"?fa:Ic,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=dN(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function dN(e,t,n){if(t.type==="element")return BG(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return HG(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return zG(e,t,n);if(t.type==="mdxjsEsm")return UG(e,t);if(t.type==="root")return FG(e,t,n);if(t.type==="text")return VG(e,t)}function BG(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=fa,e.schema=i),e.ancestors.push(t);const o=pN(e,t.tagName,!1),l=YG(e,t);let c=Z1(e,t);return DG.has(t.tagName)&&(c=c.filter(function(f){return typeof f=="string"?!kG(f):!0})),hN(e,l,o,t),W1(l,c),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function HG(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)}Tc(e,t.position)}function UG(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Tc(e,t.position)}function zG(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=fa,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:pN(e,t.name,!0),l=GG(e,t),c=Z1(e,t);return hN(e,l,o,t),W1(l,c),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function FG(e,t,n){const r={};return W1(r,Z1(e,t)),e.create(t,e.Fragment,r,n)}function VG(e,t){return t.value}function hN(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function W1(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function $G(e,t,n){return r;function r(i,o,l,c){const d=Array.isArray(l.children)?n:t;return c?d(o,l,c):d(o,l)}}function qG(e,t){return n;function n(r,i,o,l){const c=Array.isArray(o.children),f=Ls(r);return t(i,o,l,c,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function YG(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Q1.call(t.properties,i)){const o=XG(e,i,t.properties[i]);if(o){const[l,c]=o;e.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&PG.has(t.tagName)?r=c:n[l]=c}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function GG(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const c=l.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else Tc(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const c=r.value.data.estree.body[0];c.type,o=e.evaluater.evaluateExpression(c.expression)}else Tc(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Z1(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:LG;for(;++r<t.children.length;){const o=t.children[r];let l;if(e.passKeys){const f=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(f){const d=i.get(f)||0;l=f+"-"+d,i.set(f,d+1)}}const c=dN(e,o,l);c!==void 0&&n.push(c)}return n}function XG(e,t,n){const r=ip(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?LA(n):MA(n)),r.property==="style"){let i=typeof n=="object"?n:KG(e,String(n));return e.stylePropertyNameCase==="css"&&(i=QG(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?aH[r.property]||r.property:r.attribute,n]}}function KG(e,t){try{return IG(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new nr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=fN+"#cannot-parse-style-attribute",i}}function pN(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,l;for(;++o<i.length;){const c=oC(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};l=l?{type:"MemberExpression",object:l,property:c,computed:!!(o&&c.type==="Literal"),optional:!1}:c}r=l}else r=oC(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Q1.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Tc(e)}function Tc(e,t){const n=new nr("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=fN+"#cannot-handle-mdx-estrees-without-createevaluater",n}function QG(e){const t={};let n;for(n in e)Q1.call(e,n)&&(t[WG(n)]=e[n]);return t}function WG(e){let t=e.replace(MG,ZG);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function ZG(e){return"-"+e.toLowerCase()}const Cg={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"]},JG={tokenize:eX};function eX(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),Lt(e,t,"linePrefix")}function i(c){return e.enter("paragraph"),o(c)}function o(c){const f=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=f),n=f,l(c)}function l(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return st(c)?(e.consume(c),e.exit("chunkText"),o):(e.consume(c),l)}}const tX={tokenize:nX},mC={tokenize:rX};function nX(e){const t=this,n=[];let r=0,i,o,l;return c;function c(_){if(r<n.length){const N=n[r];return t.containerState=N[1],e.attempt(N[0].continuation,f,d)(_)}return d(_)}function f(_){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&A();const N=t.events.length;let D=N,O;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){O=t.events[D][1].end;break}C(r);let j=N;for(;j<t.events.length;)t.events[j][1].end={...O},j++;return Pr(t.events,D+1,0,t.events.slice(N)),t.events.length=j,d(_)}return c(_)}function d(_){if(r===n.length){if(!i)return b(_);if(i.currentConstruct&&i.currentConstruct.concrete)return E(_);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(mC,m,p)(_)}function m(_){return i&&A(),C(r),b(_)}function p(_){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,E(_)}function b(_){return t.containerState={},e.attempt(mC,y,E)(_)}function y(_){return r++,n.push([t.currentConstruct,t.containerState]),b(_)}function E(_){if(_===null){i&&A(),C(0),e.consume(_);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),w(_)}function w(_){if(_===null){k(e.exit("chunkFlow"),!0),C(0),e.consume(_);return}return st(_)?(e.consume(_),k(e.exit("chunkFlow")),r=0,t.interrupt=void 0,c):(e.consume(_),w)}function k(_,N){const D=t.sliceStream(_);if(N&&D.push(null),_.previous=o,o&&(o.next=_),o=_,i.defineSkip(_.start),i.write(D),t.parser.lazy[_.start.line]){let O=i.events.length;for(;O--;)if(i.events[O][1].start.offset<l&&(!i.events[O][1].end||i.events[O][1].end.offset>l))return;const j=t.events.length;let M=j,q,U;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){if(q){U=t.events[M][1].end;break}q=!0}for(C(r),O=j;O<t.events.length;)t.events[O][1].end={...U},O++;Pr(t.events,M+1,0,t.events.slice(j)),t.events.length=O}}function C(_){let N=n.length;for(;N-- >_;){const D=n[N];t.containerState=D[1],D[0].exit.call(t,e)}n.length=_}function A(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function rX(e,t,n){return Lt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}const sX={tokenize:iX};function iX(e){const t=this,n=e.attempt(Pc,r,e.attempt(this.parser.constructs.flowInitial,i,Lt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(X$,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const aX={resolveAll:gN()},oX=mN("string"),lX=mN("text");function mN(e){return{resolveAll:gN(e==="text"?uX:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,l,c);return l;function l(m){return d(m)?o(m):c(m)}function c(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),f}function f(m){return d(m)?(n.exit("data"),o(m)):(n.consume(m),f)}function d(m){if(m===null)return!0;const p=i[m];let b=-1;if(p)for(;++b<p.length;){const y=p[b];if(!y.previous||y.previous.call(r,r.previous))return!0}return!1}}}function gN(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function uX(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,l=-1,c=0,f;for(;o--;){const d=i[o];if(typeof d=="string"){for(l=d.length;d.charCodeAt(l-1)===32;)c++,l--;if(l)break;l=-1}else if(d===-2)f=!0,c++;else if(d!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const d={type:n===e.length||f||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?l:r.start._bufferIndex+l,_index:r.start._index+o,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):(e.splice(n,0,["enter",d,t],["exit",d,t]),n+=2)}n++}return e}const cX={42:Tr,43:Tr,45:Tr,48:Tr,49:Tr,50:Tr,51:Tr,52:Tr,53:Tr,54:Tr,55:Tr,56:Tr,57:Tr,62:K_},fX={91:J$},dX={[-2]:Eg,[-1]:Eg,32:Eg},hX={35:iq,42:Yd,45:[eC,Yd],60:uq,61:eC,95:Yd,96:ZS,126:ZS},pX={38:W_,92:Q_},mX={[-5]:Tg,[-4]:Tg,[-3]:Tg,33:Aq,38:W_,42:Tb,60:[N$,gq],91:Nq,92:[rq,Q_],93:G1,95:Tb,96:F$},gX={null:[Tb,aX]},bX={null:[42,95]},xX={null:[]},yX=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:bX,contentInitial:fX,disable:xX,document:cX,flow:hX,flowInitial:dX,insideSpan:gX,string:pX,text:mX},Symbol.toStringTag,{value:"Module"}));function EX(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let l=[],c=[];const f={attempt:j(D),check:j(O),consume:A,enter:_,exit:N,interrupt:j(O,{interrupt:!0})},d={code:null,containerState:{},defineSkip:w,events:[],now:E,parser:e,previous:null,sliceSerialize:b,sliceStream:y,write:p};let m=t.tokenize.call(d,f);return t.resolveAll&&o.push(t),d;function p(Q){return l=Zr(l,Q),k(),l[l.length-1]!==null?[]:(M(t,0),d.events=dp(o,d.events,d),d.events)}function b(Q,Z){return vX(y(Q),Z)}function y(Q){return TX(l,Q)}function E(){const{_bufferIndex:Q,_index:Z,line:G,column:ee,offset:Y}=r;return{_bufferIndex:Q,_index:Z,line:G,column:ee,offset:Y}}function w(Q){i[Q.line]=Q.column,U()}function k(){let Q;for(;r._index<l.length;){const Z=l[r._index];if(typeof Z=="string")for(Q=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===Q&&r._bufferIndex<Z.length;)C(Z.charCodeAt(r._bufferIndex));else C(Z)}}function C(Q){m=m(Q)}function A(Q){st(Q)?(r.line++,r.column=1,r.offset+=Q===-3?2:1,U()):Q!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=Q}function _(Q,Z){const G=Z||{};return G.type=Q,G.start=E(),d.events.push(["enter",G,d]),c.push(G),G}function N(Q){const Z=c.pop();return Z.end=E(),d.events.push(["exit",Z,d]),Z}function D(Q,Z){M(Q,Z.from)}function O(Q,Z){Z.restore()}function j(Q,Z){return G;function G(ee,Y,H){let K,te,le,I;return Array.isArray(ee)?$(ee):"tokenize"in ee?$([ee]):P(ee);function P(fe){return de;function de(he){const ve=he!==null&&fe[he],Ue=he!==null&&fe.null,Pe=[...Array.isArray(ve)?ve:ve?[ve]:[],...Array.isArray(Ue)?Ue:Ue?[Ue]:[]];return $(Pe)(he)}}function $(fe){return K=fe,te=0,fe.length===0?H:L(fe[te])}function L(fe){return de;function de(he){return I=q(),le=fe,fe.partial||(d.currentConstruct=fe),fe.name&&d.parser.constructs.disable.null.includes(fe.name)?ie():fe.tokenize.call(Z?Object.assign(Object.create(d),Z):d,f,ae,ie)(he)}}function ae(fe){return Q(le,I),Y}function ie(fe){return I.restore(),++te<K.length?L(K[te]):H}}}function M(Q,Z){Q.resolveAll&&!o.includes(Q)&&o.push(Q),Q.resolve&&Pr(d.events,Z,d.events.length-Z,Q.resolve(d.events.slice(Z),d)),Q.resolveTo&&(d.events=Q.resolveTo(d.events,d))}function q(){const Q=E(),Z=d.previous,G=d.currentConstruct,ee=d.events.length,Y=Array.from(c);return{from:ee,restore:H};function H(){r=Q,d.previous=Z,d.currentConstruct=G,d.events.length=ee,c=Y,U()}}function U(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function TX(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let l;if(n===i)l=[e[n].slice(r,o)];else{if(l=e.slice(n,i),r>-1){const c=l[0];typeof c=="string"?l[0]=c.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function vX(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let l;if(typeof o=="string")l=o;else switch(o){case-5:{l="\r";break}case-4:{l=`
|
|
390
|
-
`;break}case-3:{l=`\r
|
|
391
|
-
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&i)continue;l=" ";break}default:l=String.fromCharCode(o)}i=o===-2,r.push(l)}return r.join("")}function SX(e){const r={constructs:U_([yX,...(e||{}).extensions||[]]),content:i(JG),defined:[],document:i(tX),flow:i(sX),lazy:{},string:i(oX),text:i(lX)};return r;function i(o){return l;function l(c){return EX(r,o,c)}}}function CX(e){for(;!Z_(e););return e}const gC=/[\0\t\n\r]/g;function wX(){let e=1,t="",n=!0,r;return i;function i(o,l,c){const f=[];let d,m,p,b,y;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(l||void 0).decode(o)),p=0,t="",n&&(o.charCodeAt(0)===65279&&p++,n=void 0);p<o.length;){if(gC.lastIndex=p,d=gC.exec(o),b=d&&d.index!==void 0?d.index:o.length,y=o.charCodeAt(b),!d){t=o.slice(p);break}if(y===10&&p===b&&r)f.push(-3),r=void 0;else switch(r&&(f.push(-5),r=void 0),p<b&&(f.push(o.slice(p,b)),e+=b-p),y){case 0:{f.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,f.push(-2);e++<m;)f.push(-1);break}case 10:{f.push(-4),e=1;break}default:r=!0,e=1}p=b+1}return c&&(r&&f.push(-5),t&&f.push(t),f.push(null)),f}}const bN={}.hasOwnProperty;function kX(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),AX(n)(CX(SX(n).document().write(wX()(e,t,!0))))}function AX(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(we),autolinkProtocol:q,autolinkEmail:q,atxHeading:o(We),blockQuote:o(Ue),characterEscape:q,characterReference:q,codeFenced:o(Pe),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:o(Pe,l),codeText:o(Te,l),codeTextData:q,data:q,codeFlowValue:q,definition:o(Ie),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:o(je),hardBreakEscape:o(Xe),hardBreakTrailing:o(Xe),htmlFlow:o(Me,l),htmlFlowData:q,htmlText:o(Me,l),htmlTextData:q,image:o(Ce),label:l,link:o(we),listItem:o($e),listItemValue:b,listOrdered:o(Be,p),listUnordered:o(Be),paragraph:o(W),reference:L,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:o(We),strong:o(me),thematicBreak:o(re)},exit:{atxHeading:f(),atxHeadingSequence:D,autolink:f(),autolinkEmail:ve,autolinkProtocol:he,blockQuote:f(),characterEscapeValue:U,characterReferenceMarkerHexadecimal:ie,characterReferenceMarkerNumeric:ie,characterReferenceValue:fe,characterReference:de,codeFenced:f(k),codeFencedFence:w,codeFencedFenceInfo:y,codeFencedFenceMeta:E,codeFlowValue:U,codeIndented:f(C),codeText:f(Y),codeTextData:U,data:U,definition:f(),definitionDestinationString:N,definitionLabelString:A,definitionTitleString:_,emphasis:f(),hardBreakEscape:f(Z),hardBreakTrailing:f(Z),htmlFlow:f(G),htmlFlowData:U,htmlText:f(ee),htmlTextData:U,image:f(K),label:le,labelText:te,lineEnding:Q,link:f(H),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:ae,resourceDestinationString:I,resourceTitleString:P,resource:$,setextHeading:f(M),setextHeadingLineSequence:j,setextHeadingText:O,strong:f(),thematicBreak:f()}};xN(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(V){let z={type:"root",children:[]};const ue={stack:[z],tokenStack:[],config:t,enter:c,exit:d,buffer:l,resume:m,data:n},ke=[];let Re=-1;for(;++Re<V.length;)if(V[Re][1].type==="listOrdered"||V[Re][1].type==="listUnordered")if(V[Re][0]==="enter")ke.push(Re);else{const qe=ke.pop();Re=i(V,qe,Re)}for(Re=-1;++Re<V.length;){const qe=t[V[Re][0]];bN.call(qe,V[Re][1].type)&&qe[V[Re][1].type].call(Object.assign({sliceSerialize:V[Re][2].sliceSerialize},ue),V[Re][1])}if(ue.tokenStack.length>0){const qe=ue.tokenStack[ue.tokenStack.length-1];(qe[1]||bC).call(ue,void 0,qe[0])}for(z.position={start:Ui(V.length>0?V[0][1].start:{line:1,column:1,offset:0}),end:Ui(V.length>0?V[V.length-2][1].end:{line:1,column:1,offset:0})},Re=-1;++Re<t.transforms.length;)z=t.transforms[Re](z)||z;return z}function i(V,z,ue){let ke=z-1,Re=-1,qe=!1,rt,et,ot,ut;for(;++ke<=ue;){const Fe=V[ke];switch(Fe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Fe[0]==="enter"?Re++:Re--,ut=void 0;break}case"lineEndingBlank":{Fe[0]==="enter"&&(rt&&!ut&&!Re&&!ot&&(ot=ke),ut=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ut=void 0}if(!Re&&Fe[0]==="enter"&&Fe[1].type==="listItemPrefix"||Re===-1&&Fe[0]==="exit"&&(Fe[1].type==="listUnordered"||Fe[1].type==="listOrdered")){if(rt){let Dt=ke;for(et=void 0;Dt--;){const jt=V[Dt];if(jt[1].type==="lineEnding"||jt[1].type==="lineEndingBlank"){if(jt[0]==="exit")continue;et&&(V[et][1].type="lineEndingBlank",qe=!0),jt[1].type="lineEnding",et=Dt}else if(!(jt[1].type==="linePrefix"||jt[1].type==="blockQuotePrefix"||jt[1].type==="blockQuotePrefixWhitespace"||jt[1].type==="blockQuoteMarker"||jt[1].type==="listItemIndent"))break}ot&&(!et||ot<et)&&(rt._spread=!0),rt.end=Object.assign({},et?V[et][1].start:Fe[1].end),V.splice(et||ke,0,["exit",rt,Fe[2]]),ke++,ue++}if(Fe[1].type==="listItemPrefix"){const Dt={type:"listItem",_spread:!1,start:Object.assign({},Fe[1].start),end:void 0};rt=Dt,V.splice(ke,0,["enter",Dt,Fe[2]]),ke++,ue++,ot=void 0,ut=!0}}}return V[z][1]._spread=qe,ue}function o(V,z){return ue;function ue(ke){c.call(this,V(ke),ke),z&&z.call(this,ke)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(V,z,ue){this.stack[this.stack.length-1].children.push(V),this.stack.push(V),this.tokenStack.push([z,ue||void 0]),V.position={start:Ui(z.start),end:void 0}}function f(V){return z;function z(ue){V&&V.call(this,ue),d.call(this,ue)}}function d(V,z){const ue=this.stack.pop(),ke=this.tokenStack.pop();if(ke)ke[0].type!==V.type&&(z?z.call(this,V,ke[0]):(ke[1]||bC).call(this,V,ke[0]));else throw new Error("Cannot close `"+V.type+"` ("+rc({start:V.start,end:V.end})+"): it’s not open");ue.position.end=Ui(V.end)}function m(){return V1(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function b(V){if(this.data.expectingFirstListItemValue){const z=this.stack[this.stack.length-2];z.start=Number.parseInt(this.sliceSerialize(V),10),this.data.expectingFirstListItemValue=void 0}}function y(){const V=this.resume(),z=this.stack[this.stack.length-1];z.lang=V}function E(){const V=this.resume(),z=this.stack[this.stack.length-1];z.meta=V}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function k(){const V=this.resume(),z=this.stack[this.stack.length-1];z.value=V.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function C(){const V=this.resume(),z=this.stack[this.stack.length-1];z.value=V.replace(/(\r?\n|\r)$/g,"")}function A(V){const z=this.resume(),ue=this.stack[this.stack.length-1];ue.label=z,ue.identifier=ls(this.sliceSerialize(V)).toLowerCase()}function _(){const V=this.resume(),z=this.stack[this.stack.length-1];z.title=V}function N(){const V=this.resume(),z=this.stack[this.stack.length-1];z.url=V}function D(V){const z=this.stack[this.stack.length-1];if(!z.depth){const ue=this.sliceSerialize(V).length;z.depth=ue}}function O(){this.data.setextHeadingSlurpLineEnding=!0}function j(V){const z=this.stack[this.stack.length-1];z.depth=this.sliceSerialize(V).codePointAt(0)===61?1:2}function M(){this.data.setextHeadingSlurpLineEnding=void 0}function q(V){const ue=this.stack[this.stack.length-1].children;let ke=ue[ue.length-1];(!ke||ke.type!=="text")&&(ke=se(),ke.position={start:Ui(V.start),end:void 0},ue.push(ke)),this.stack.push(ke)}function U(V){const z=this.stack.pop();z.value+=this.sliceSerialize(V),z.position.end=Ui(V.end)}function Q(V){const z=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ue=z.children[z.children.length-1];ue.position.end=Ui(V.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(z.type)&&(q.call(this,V),U.call(this,V))}function Z(){this.data.atHardBreak=!0}function G(){const V=this.resume(),z=this.stack[this.stack.length-1];z.value=V}function ee(){const V=this.resume(),z=this.stack[this.stack.length-1];z.value=V}function Y(){const V=this.resume(),z=this.stack[this.stack.length-1];z.value=V}function H(){const V=this.stack[this.stack.length-1];if(this.data.inReference){const z=this.data.referenceType||"shortcut";V.type+="Reference",V.referenceType=z,delete V.url,delete V.title}else delete V.identifier,delete V.label;this.data.referenceType=void 0}function K(){const V=this.stack[this.stack.length-1];if(this.data.inReference){const z=this.data.referenceType||"shortcut";V.type+="Reference",V.referenceType=z,delete V.url,delete V.title}else delete V.identifier,delete V.label;this.data.referenceType=void 0}function te(V){const z=this.sliceSerialize(V),ue=this.stack[this.stack.length-2];ue.label=JV(z),ue.identifier=ls(z).toLowerCase()}function le(){const V=this.stack[this.stack.length-1],z=this.resume(),ue=this.stack[this.stack.length-1];if(this.data.inReference=!0,ue.type==="link"){const ke=V.children;ue.children=ke}else ue.alt=z}function I(){const V=this.resume(),z=this.stack[this.stack.length-1];z.url=V}function P(){const V=this.resume(),z=this.stack[this.stack.length-1];z.title=V}function $(){this.data.inReference=void 0}function L(){this.data.referenceType="collapsed"}function ae(V){const z=this.resume(),ue=this.stack[this.stack.length-1];ue.label=z,ue.identifier=ls(this.sliceSerialize(V)).toLowerCase(),this.data.referenceType="full"}function ie(V){this.data.characterReferenceType=V.type}function fe(V){const z=this.sliceSerialize(V),ue=this.data.characterReferenceType;let ke;ue?(ke=H_(z,ue==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ke=q1(z);const Re=this.stack[this.stack.length-1];Re.value+=ke}function de(V){const z=this.stack.pop();z.position.end=Ui(V.end)}function he(V){U.call(this,V);const z=this.stack[this.stack.length-1];z.url=this.sliceSerialize(V)}function ve(V){U.call(this,V);const z=this.stack[this.stack.length-1];z.url="mailto:"+this.sliceSerialize(V)}function Ue(){return{type:"blockquote",children:[]}}function Pe(){return{type:"code",lang:null,meta:null,value:""}}function Te(){return{type:"inlineCode",value:""}}function Ie(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function je(){return{type:"emphasis",children:[]}}function We(){return{type:"heading",depth:0,children:[]}}function Xe(){return{type:"break"}}function Me(){return{type:"html",value:""}}function Ce(){return{type:"image",title:null,url:"",alt:null}}function we(){return{type:"link",title:null,url:"",children:[]}}function Be(V){return{type:"list",ordered:V.type==="listOrdered",start:null,spread:V._spread,children:[]}}function $e(V){return{type:"listItem",spread:V._spread,checked:null,children:[]}}function W(){return{type:"paragraph",children:[]}}function me(){return{type:"strong",children:[]}}function se(){return{type:"text",value:""}}function re(){return{type:"thematicBreak"}}}function Ui(e){return{line:e.line,column:e.column,offset:e.offset}}function xN(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?xN(e,r):_X(e,r)}}function _X(e,t){let n;for(n in t)if(bN.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 bC(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+rc({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+rc({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+rc({start:t.start,end:t.end})+") is still open")}function NX(e){const t=this;t.parser=n;function n(r){return kX(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function RX(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 OX(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
392
|
-
`}]}function IX(e,t){const n=t.value?t.value+`
|
|
393
|
-
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function LX(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function MX(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function DX(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=_l(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let l,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=o+1,c+=1,e.footnoteCounts.set(r,c);const f={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,f);const d={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,d),e.applyData(t,d)}function PX(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function jX(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function yN(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const l=i[i.length-1];return l&&l.type==="text"?l.value+=r:i.push({type:"text",value:r}),i}function BX(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return yN(e,t);const i={src:_l(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function HX(e,t){const n={src:_l(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function UX(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function zX(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return yN(e,t);const i={href:_l(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function FX(e,t){const n={href:_l(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function VX(e,t,n){const r=e.all(t),i=n?$X(n):EN(t),o={},l=[];if(typeof t.checked=="boolean"){const m=r[0];let p;m&&m.type==="element"&&m.tagName==="p"?p=m:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let c=-1;for(;++c<r.length;){const m=r[c];(i||c!==0||m.type!=="element"||m.tagName!=="p")&&l.push({type:"text",value:`
|
|
394
|
-
`}),m.type==="element"&&m.tagName==="p"&&!i?l.push(...m.children):l.push(m)}const f=r[r.length-1];f&&(i||f.type!=="element"||f.tagName!=="p")&&l.push({type:"text",value:`
|
|
395
|
-
`});const d={type:"element",tagName:"li",properties:o,children:l};return e.patch(t,d),e.applyData(t,d)}function $X(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=EN(n[r])}return t}function EN(e){const t=e.spread;return t??e.children.length>1}function qX(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const l=r[i];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function YX(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function GX(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function XX(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function KX(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),i.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=Ls(t.children[1]),f=cp(t.children[t.children.length-1]);c&&f&&(l.position={start:c,end:f}),i.push(l)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function QX(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,c=l?l.length:t.children.length;let f=-1;const d=[];for(;++f<c;){const p=t.children[f],b={},y=l?l[f]:void 0;y&&(b.align=y);let E={type:"element",tagName:o,properties:b,children:[]};p&&(E.children=e.all(p),e.patch(p,E),E=e.applyData(p,E)),d.push(E)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,m),e.applyData(t,m)}function WX(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const xC=9,yC=32;function ZX(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(EC(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(EC(t.slice(i),i>0,!1)),o.join("")}function EC(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===xC||o===yC;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===xC||o===yC;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function JX(e,t){const n={type:"text",value:ZX(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function eK(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const tK={blockquote:RX,break:OX,code:IX,delete:LX,emphasis:MX,footnoteReference:DX,heading:PX,html:jX,imageReference:BX,image:HX,inlineCode:UX,linkReference:zX,link:FX,listItem:VX,list:qX,paragraph:YX,root:GX,strong:XX,table:KX,tableCell:WX,tableRow:QX,text:JX,thematicBreak:eK,toml:kd,yaml:kd,definition:kd,footnoteDefinition:kd};function kd(){}function nK(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function rK(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function sK(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||nK,r=e.options.footnoteBackLabel||rK,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let f=-1;for(;++f<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[f]);if(!d)continue;const m=e.all(d),p=String(d.identifier).toUpperCase(),b=_l(p.toLowerCase());let y=0;const E=[],w=e.footnoteCounts.get(p);for(;w!==void 0&&++y<=w;){E.length>0&&E.push({type:"text",value:" "});let A=typeof n=="string"?n:n(f,y);typeof A=="string"&&(A={type:"text",value:A}),E.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+b+(y>1?"-"+y:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(f,y),className:["data-footnote-backref"]},children:Array.isArray(A)?A:[A]})}const k=m[m.length-1];if(k&&k.type==="element"&&k.tagName==="p"){const A=k.children[k.children.length-1];A&&A.type==="text"?A.value+=" ":k.children.push({type:"text",value:" "}),k.children.push(...E)}else m.push(...E);const C={type:"element",tagName:"li",properties:{id:t+"fn-"+b},children:e.wrap(m,!0)};e.patch(d,C),c.push(C)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...so(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
396
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
|
|
397
|
-
`}]}}const Sb={}.hasOwnProperty,iK={};function aK(e,t){const n=t||iK,r=new Map,i=new Map,o=new Map,l={...tK,...n.handlers},c={all:d,applyData:lK,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:l,one:f,options:n,patch:oK,wrap:cK};return Is(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const p=m.type==="definition"?r:i,b=String(m.identifier).toUpperCase();p.has(b)||p.set(b,m)}}),c;function f(m,p){const b=m.type,y=c.handlers[b];if(Sb.call(c.handlers,b)&&y)return y(c,m,p);if(c.options.passThrough&&c.options.passThrough.includes(b)){if("children"in m){const{children:w,...k}=m,C=so(k);return C.children=c.all(m),C}return so(m)}return(c.options.unknownHandler||uK)(c,m,p)}function d(m){const p=[];if("children"in m){const b=m.children;let y=-1;for(;++y<b.length;){const E=c.one(b[y],m);if(E){if(y&&b[y-1].type==="break"&&(!Array.isArray(E)&&E.type==="text"&&(E.value=TC(E.value)),!Array.isArray(E)&&E.type==="element")){const w=E.children[0];w&&w.type==="text"&&(w.value=TC(w.value))}Array.isArray(E)?p.push(...E):p.push(E)}}}return p}}function oK(e,t){e.position&&(t.position=p_(e))}function lK(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const l="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:l}}n.type==="element"&&o&&Object.assign(n.properties,so(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function uK(e,t){const n=t.data||{},r="value"in t&&!(Sb.call(n,"hProperties")||Sb.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function cK(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
398
|
-
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
399
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
400
|
-
`}),n}function TC(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function vC(e,t){const n=aK(e,t),r=n.one(e,void 0),i=sK(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
|
|
401
|
-
`},i),o}function fK(e,t){return e&&"run"in e?async function(n,r){const i=vC(n,{file:r,...t});await e.run(i,r)}:function(n,r){return vC(n,{file:r,...e||t})}}function SC(e){if(e)throw e}var wg,CC;function dK(){if(CC)return wg;CC=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},o=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var m=e.call(d,"constructor"),p=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!m&&!p)return!1;var b;for(b in d);return typeof b>"u"||e.call(d,b)},l=function(d,m){n&&m.name==="__proto__"?n(d,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):d[m.name]=m.newValue},c=function(d,m){if(m==="__proto__")if(e.call(d,m)){if(r)return r(d,m).value}else return;return d[m]};return wg=function f(){var d,m,p,b,y,E,w=arguments[0],k=1,C=arguments.length,A=!1;for(typeof w=="boolean"&&(A=w,w=arguments[1]||{},k=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});k<C;++k)if(d=arguments[k],d!=null)for(m in d)p=c(w,m),b=c(d,m),w!==b&&(A&&b&&(o(b)||(y=i(b)))?(y?(y=!1,E=p&&i(p)?p:[]):E=p&&o(p)?p:{},l(w,{name:m,newValue:f(A,E,b)})):typeof b<"u"&&l(w,{name:m,newValue:b}));return w},wg}var hK=dK();const kg=Ah(hK);function Cb(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function pK(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const l=i.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);c(null,...i);function c(f,...d){const m=e[++o];let p=-1;if(f){l(f);return}for(;++p<i.length;)(d[p]===null||d[p]===void 0)&&(d[p]=i[p]);i=d,m?mK(m,c)(...d):l(null,...d)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function mK(e,t){let n;return r;function r(...l){const c=e.length>l.length;let f;c&&l.push(i);try{f=e.apply(this,l)}catch(d){const m=d;if(c&&n)throw m;return i(m)}c||(f&&f.then&&typeof f.then=="function"?f.then(o,i):f instanceof Error?i(f):o(f))}function i(l,...c){n||(n=!0,t(l,...c))}function o(l){i(null,l)}}const Ts={basename:gK,dirname:bK,extname:xK,join:yK,sep:"/"};function gK(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');jc(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,c=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else l<0&&(o=!0,l=i+1),c>-1&&(e.codePointAt(i)===t.codePointAt(c--)?c<0&&(r=i):(c=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function bK(e){if(jc(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function xK(e){jc(e);let t=e.length,n=-1,r=0,i=-1,o=0,l;for(;t--;){const c=e.codePointAt(t);if(c===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),c===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function yK(...e){let t=-1,n;for(;++t<e.length;)jc(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":EK(n)}function EK(e){jc(e);const t=e.codePointAt(0)===47;let n=TK(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function TK(e,t){let n="",r=0,i=-1,o=0,l=-1,c,f;for(;++l<=e.length;){if(l<e.length)c=e.codePointAt(l);else{if(c===47)break;c=47}if(c===47){if(!(i===l-1||o===1))if(i!==l-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(f=n.lastIndexOf("/"),f!==n.length-1){f<0?(n="",r=0):(n=n.slice(0,f),r=n.length-1-n.lastIndexOf("/")),i=l,o=0;continue}}else if(n.length>0){n="",r=0,i=l,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,l):n=e.slice(i+1,l),r=l-i-1;i=l,o=0}else c===46&&o>-1?o++:o=-1}return n}function jc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const vK={cwd:SK};function SK(){return"/"}function wb(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function CK(e){if(typeof e=="string")e=new URL(e);else if(!wb(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return wK(e)}function wK(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Ag=["history","path","basename","stem","extname","dirname"];class kK{constructor(t){let n;t?wb(t)?n={path:t}:typeof t=="string"||AK(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":vK.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Ag.length;){const o=Ag[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)Ag.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Ts.basename(this.path):void 0}set basename(t){Ng(t,"basename"),_g(t,"basename"),this.path=Ts.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Ts.dirname(this.path):void 0}set dirname(t){wC(this.basename,"dirname"),this.path=Ts.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Ts.extname(this.path):void 0}set extname(t){if(_g(t,"extname"),wC(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ts.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){wb(t)&&(t=CK(t)),Ng(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Ts.basename(this.path,this.extname):void 0}set stem(t){Ng(t,"stem"),_g(t,"stem"),this.path=Ts.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new nr(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function _g(e,t){if(e&&e.includes(Ts.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ts.sep+"`")}function Ng(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function wC(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function AK(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const _K=(function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),NK={}.hasOwnProperty;class J1 extends _K{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=pK()}copy(){const t=new J1;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(kg(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Ig("data",this.frozen),this.namespace[t]=n,this):NK.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Ig("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Ad(t),r=this.parser||this.Parser;return Rg("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Rg("process",this.parser||this.Parser),Og("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,l){const c=Ad(t),f=r.parse(c);r.run(f,c,function(m,p,b){if(m||!p||!b)return d(m);const y=p,E=r.stringify(y,b);IK(E)?b.value=E:b.result=E,d(m,b)});function d(m,p){m||!p?l(m):o?o(p):n(void 0,p)}}}processSync(t){let n=!1,r;return this.freeze(),Rg("processSync",this.parser||this.Parser),Og("processSync",this.compiler||this.Compiler),this.process(t,i),AC("processSync","process",n),r;function i(o,l){n=!0,SC(o),r=l}}run(t,n,r){kC(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(l,c){const f=Ad(n);i.run(t,f,d);function d(m,p,b){const y=p||t;m?c(m):l?l(y):r(void 0,y,b)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),AC("runSync","run",r),i;function o(l,c){SC(l),i=c,r=!0}}stringify(t,n){this.freeze();const r=Ad(n),i=this.compiler||this.Compiler;return Og("stringify",i),kC(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Ig("use",this.frozen),t!=null)if(typeof t=="function")f(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(d){if(typeof d=="function")f(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[m,...p]=d;f(m,p)}else l(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function l(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");c(d.plugins),d.settings&&(i.settings=kg(!0,i.settings,d.settings))}function c(d){let m=-1;if(d!=null)if(Array.isArray(d))for(;++m<d.length;){const p=d[m];o(p)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function f(d,m){let p=-1,b=-1;for(;++p<r.length;)if(r[p][0]===d){b=p;break}if(b===-1)r.push([d,...m]);else if(m.length>0){let[y,...E]=m;const w=r[b][1];Cb(w)&&Cb(y)&&(y=kg(!0,w,y)),r[b]=[d,y,...E]}}}}const RK=new J1().freeze();function Rg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Og(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Ig(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function kC(e){if(!Cb(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function AC(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Ad(e){return OK(e)?e:new kK(e)}function OK(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function IK(e){return typeof e=="string"||LK(e)}function LK(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}function ex(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var mo=ex();function TN(e){mo=e}var Ua={exec:()=>null};function Mt(e,t=""){let n=typeof e=="string"?e:e.source,r={replace:(i,o)=>{let l=typeof o=="string"?o:o.source;return l=l.replace(lr.caret,"$1"),n=n.replace(i,l),r},getRegex:()=>new RegExp(n,t)};return r}var MK=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),lr={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},DK=/^(?:[ \t]*(?:\n|$))+/,PK=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,jK=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Bc=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,BK=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,tx=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,vN=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,SN=Mt(vN).replace(/bull/g,tx).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),HK=Mt(vN).replace(/bull/g,tx).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),nx=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,UK=/^[^\n]+/,rx=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,zK=Mt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",rx).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),FK=Mt(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,tx).getRegex(),pp="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",sx=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,VK=Mt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",sx).replace("tag",pp).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),CN=Mt(nx).replace("hr",Bc).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",pp).getRegex(),$K=Mt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",CN).getRegex(),ix={blockquote:$K,code:PK,def:zK,fences:jK,heading:BK,hr:Bc,html:VK,lheading:SN,list:FK,newline:DK,paragraph:CN,table:Ua,text:UK},_C=Mt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Bc).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",pp).getRegex(),qK={...ix,lheading:HK,table:_C,paragraph:Mt(nx).replace("hr",Bc).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",_C).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",pp).getRegex()},YK={...ix,html:Mt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",sx).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ua,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Mt(nx).replace("hr",Bc).replace("heading",` *#{1,6} *[^
|
|
402
|
-
]`).replace("lheading",SN).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},GK=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,XK=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,wN=/^( {2,}|\\)\n(?!\s*$)/,KK=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Nl=/[\p{P}\p{S}]/u,mp=/[\s\p{P}\p{S}]/u,ax=/[^\s\p{P}\p{S}]/u,QK=Mt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,mp).getRegex(),kN=/(?!~)[\p{P}\p{S}]/u,WK=/(?!~)[\s\p{P}\p{S}]/u,ZK=/(?:[^\s\p{P}\p{S}]|~)/u,JK=Mt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",MK?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),AN=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,eQ=Mt(AN,"u").replace(/punct/g,Nl).getRegex(),tQ=Mt(AN,"u").replace(/punct/g,kN).getRegex(),_N="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",nQ=Mt(_N,"gu").replace(/notPunctSpace/g,ax).replace(/punctSpace/g,mp).replace(/punct/g,Nl).getRegex(),rQ=Mt(_N,"gu").replace(/notPunctSpace/g,ZK).replace(/punctSpace/g,WK).replace(/punct/g,kN).getRegex(),sQ=Mt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ax).replace(/punctSpace/g,mp).replace(/punct/g,Nl).getRegex(),iQ=Mt(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Nl).getRegex(),aQ="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",oQ=Mt(aQ,"gu").replace(/notPunctSpace/g,ax).replace(/punctSpace/g,mp).replace(/punct/g,Nl).getRegex(),lQ=Mt(/\\(punct)/,"gu").replace(/punct/g,Nl).getRegex(),uQ=Mt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),cQ=Mt(sx).replace("(?:-->|$)","-->").getRegex(),fQ=Mt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",cQ).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ch=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,dQ=Mt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Ch).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),NN=Mt(/^!?\[(label)\]\[(ref)\]/).replace("label",Ch).replace("ref",rx).getRegex(),RN=Mt(/^!?\[(ref)\](?:\[\])?/).replace("ref",rx).getRegex(),hQ=Mt("reflink|nolink(?!\\()","g").replace("reflink",NN).replace("nolink",RN).getRegex(),NC=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,ox={_backpedal:Ua,anyPunctuation:lQ,autolink:uQ,blockSkip:JK,br:wN,code:XK,del:Ua,delLDelim:Ua,delRDelim:Ua,emStrongLDelim:eQ,emStrongRDelimAst:nQ,emStrongRDelimUnd:sQ,escape:GK,link:dQ,nolink:RN,punctuation:QK,reflink:NN,reflinkSearch:hQ,tag:fQ,text:KK,url:Ua},pQ={...ox,link:Mt(/^!?\[(label)\]\((.*?)\)/).replace("label",Ch).getRegex(),reflink:Mt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ch).getRegex()},kb={...ox,emStrongRDelimAst:rQ,emStrongLDelim:tQ,delLDelim:iQ,delRDelim:oQ,url:Mt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",NC).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Mt(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",NC).getRegex()},mQ={...kb,br:Mt(wN).replace("{2,}","*").getRegex(),text:Mt(kb.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},_d={normal:ix,gfm:qK,pedantic:YK},Du={normal:ox,gfm:kb,breaks:mQ,pedantic:pQ},gQ={"&":"&","<":"<",">":">",'"':""","'":"'"},RC=e=>gQ[e];function Es(e,t){if(t){if(lr.escapeTest.test(e))return e.replace(lr.escapeReplace,RC)}else if(lr.escapeTestNoEncode.test(e))return e.replace(lr.escapeReplaceNoEncode,RC);return e}function OC(e){try{e=encodeURI(e).replace(lr.percentDecode,"%")}catch{return null}return e}function IC(e,t){let n=e.replace(lr.findPipe,(o,l,c)=>{let f=!1,d=l;for(;--d>=0&&c[d]==="\\";)f=!f;return f?"|":" |"}),r=n.split(lr.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(lr.slashPipe,"|");return r}function Pu(e,t,n){let r=e.length;if(r===0)return"";let i=0;for(;i<r&&e.charAt(r-i-1)===t;)i++;return e.slice(0,r-i)}function bQ(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function xQ(e,t=0){let n=t,r="";for(let i of e)if(i===" "){let o=4-n%4;r+=" ".repeat(o),n+=o}else r+=i,n++;return r}function LC(e,t,n,r,i){let o=t.href,l=t.title||null,c=e[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let f={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:o,title:l,text:c,tokens:r.inlineTokens(c)};return r.state.inLink=!1,f}function yQ(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
403
|
-
`).map(o=>{let l=o.match(n.other.beginningSpace);if(l===null)return o;let[c]=l;return c.length>=i.length?o.slice(i.length):o}).join(`
|
|
404
|
-
`)}var wh=class{options;rules;lexer;constructor(e){this.options=e||mo}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Pu(n,`
|
|
405
|
-
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],r=yQ(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let r=Pu(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Pu(t[0],`
|
|
406
|
-
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=Pu(t[0],`
|
|
407
|
-
`).split(`
|
|
408
|
-
`),r="",i="",o=[];for(;n.length>0;){let l=!1,c=[],f;for(f=0;f<n.length;f++)if(this.rules.other.blockquoteStart.test(n[f]))c.push(n[f]),l=!0;else if(!l)c.push(n[f]);else break;n=n.slice(f);let d=c.join(`
|
|
409
|
-
`),m=d.replace(this.rules.other.blockquoteSetextReplace,`
|
|
410
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
411
|
-
${d}`:d,i=i?`${i}
|
|
412
|
-
${m}`:m;let p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(m,o,!0),this.lexer.state.top=p,n.length===0)break;let b=o.at(-1);if(b?.type==="code")break;if(b?.type==="blockquote"){let y=b,E=y.raw+`
|
|
413
|
-
`+n.join(`
|
|
414
|
-
`),w=this.blockquote(E);o[o.length-1]=w,r=r.substring(0,r.length-y.raw.length)+w.raw,i=i.substring(0,i.length-y.text.length)+w.text;break}else if(b?.type==="list"){let y=b,E=y.raw+`
|
|
415
|
-
`+n.join(`
|
|
416
|
-
`),w=this.list(E);o[o.length-1]=w,r=r.substring(0,r.length-b.raw.length)+w.raw,i=i.substring(0,i.length-y.raw.length)+w.raw,n=E.substring(o.at(-1).raw.length).split(`
|
|
417
|
-
`);continue}}return{type:"blockquote",raw:r,tokens:o,text:i}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let o=this.rules.other.listItemRegex(n),l=!1;for(;e;){let f=!1,d="",m="";if(!(t=o.exec(e))||this.rules.block.hr.test(e))break;d=t[0],e=e.substring(d.length);let p=xQ(t[2].split(`
|
|
418
|
-
`,1)[0],t[1].length),b=e.split(`
|
|
419
|
-
`,1)[0],y=!p.trim(),E=0;if(this.options.pedantic?(E=2,m=p.trimStart()):y?E=t[1].length+1:(E=p.search(this.rules.other.nonSpaceChar),E=E>4?1:E,m=p.slice(E),E+=t[1].length),y&&this.rules.other.blankLine.test(b)&&(d+=b+`
|
|
420
|
-
`,e=e.substring(b.length+1),f=!0),!f){let w=this.rules.other.nextBulletRegex(E),k=this.rules.other.hrRegex(E),C=this.rules.other.fencesBeginRegex(E),A=this.rules.other.headingBeginRegex(E),_=this.rules.other.htmlBeginRegex(E),N=this.rules.other.blockquoteBeginRegex(E);for(;e;){let D=e.split(`
|
|
421
|
-
`,1)[0],O;if(b=D,this.options.pedantic?(b=b.replace(this.rules.other.listReplaceNesting," "),O=b):O=b.replace(this.rules.other.tabCharGlobal," "),C.test(b)||A.test(b)||_.test(b)||N.test(b)||w.test(b)||k.test(b))break;if(O.search(this.rules.other.nonSpaceChar)>=E||!b.trim())m+=`
|
|
422
|
-
`+O.slice(E);else{if(y||p.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||C.test(p)||A.test(p)||k.test(p))break;m+=`
|
|
423
|
-
`+b}y=!b.trim(),d+=D+`
|
|
424
|
-
`,e=e.substring(D.length+1),p=O.slice(E)}}i.loose||(l?i.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(l=!0)),i.items.push({type:"list_item",raw:d,task:!!this.options.gfm&&this.rules.other.listIsTask.test(m),loose:!1,text:m,tokens:[]}),i.raw+=d}let c=i.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let f of i.items){if(this.lexer.state.top=!1,f.tokens=this.lexer.blockTokens(f.text,[]),f.task){if(f.text=f.text.replace(this.rules.other.listReplaceTask,""),f.tokens[0]?.type==="text"||f.tokens[0]?.type==="paragraph"){f.tokens[0].raw=f.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),f.tokens[0].text=f.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let m=this.lexer.inlineQueue.length-1;m>=0;m--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[m].src)){this.lexer.inlineQueue[m].src=this.lexer.inlineQueue[m].src.replace(this.rules.other.listReplaceTask,"");break}}let d=this.rules.other.listTaskCheckbox.exec(f.raw);if(d){let m={type:"checkbox",raw:d[0]+" ",checked:d[0]!=="[ ]"};f.checked=m.checked,i.loose?f.tokens[0]&&["paragraph","text"].includes(f.tokens[0].type)&&"tokens"in f.tokens[0]&&f.tokens[0].tokens?(f.tokens[0].raw=m.raw+f.tokens[0].raw,f.tokens[0].text=m.raw+f.tokens[0].text,f.tokens[0].tokens.unshift(m)):f.tokens.unshift({type:"paragraph",raw:m.raw,text:m.raw,tokens:[m]}):f.tokens.unshift(m)}}if(!i.loose){let d=f.tokens.filter(p=>p.type==="space"),m=d.length>0&&d.some(p=>this.rules.other.anyLine.test(p.raw));i.loose=m}}if(i.loose)for(let f of i.items){f.loose=!0;for(let d of f.tokens)d.type==="text"&&(d.type="paragraph")}return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:r,title:i}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=IC(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
425
|
-
`):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let l of r)this.rules.other.tableAlignRight.test(l)?o.align.push("right"):this.rules.other.tableAlignCenter.test(l)?o.align.push("center"):this.rules.other.tableAlignLeft.test(l)?o.align.push("left"):o.align.push(null);for(let l=0;l<n.length;l++)o.header.push({text:n[l],tokens:this.lexer.inline(n[l]),header:!0,align:o.align[l]});for(let l of i)o.rows.push(IC(l,o.header.length).map((c,f)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:o.align[f]})));return o}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let n=t[1].trim();return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===`
|
|
426
|
-
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let o=Pu(n.slice(0,-1),"\\");if((n.length-o.length)%2===0)return}else{let o=bQ(t[2],"()");if(o===-2)return;if(o>-1){let l=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let r=t[2],i="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(r);o&&(r=o[1],i=o[3])}else i=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),LC(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=t[r.toLowerCase()];if(!i){let o=n[0].charAt(0);return{type:"text",raw:o,text:o}}return LC(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,o,l,c=i,f=0,d=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o)continue;if(l=[...o].length,r[3]||r[4]){c+=l;continue}else if((r[5]||r[6])&&i%3&&!((i+l)%3)){f+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+f);let m=[...r[0]][0].length,p=e.slice(0,i+r.index+m+l);if(Math.min(i,l)%2){let y=p.slice(1,-1);return{type:"em",raw:p,text:y,tokens:this.lexer.inlineTokens(y)}}let b=p.slice(2,-2);return{type:"strong",raw:p,text:b,tokens:this.lexer.inlineTokens(b)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,n=""){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,o,l,c=i,f=this.rules.inline.delRDelim;for(f.lastIndex=0,t=t.slice(-1*e.length+i);(r=f.exec(t))!==null;){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o||(l=[...o].length,l!==i))continue;if(r[3]||r[4]){c+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c);let d=[...r[0]][0].length,m=e.slice(0,i+r.index+d+l),p=m.slice(i,-i);return{type:"del",raw:m,text:p,tokens:this.lexer.inlineTokens(p)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let n,r;return t[2]==="@"?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let n,r;if(t[2]==="@")n=t[0],r="mailto:"+n;else{let i;do i=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(i!==t[0]);n=t[0],t[1]==="www."?r="http://"+t[0]:r=t[0]}return{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},Jr=class Ab{tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||mo,this.options.tokenizer=this.options.tokenizer||new wh,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:lr,block:_d.normal,inline:Du.normal};this.options.pedantic?(n.block=_d.pedantic,n.inline=Du.pedantic):this.options.gfm&&(n.block=_d.gfm,this.options.breaks?n.inline=Du.breaks:n.inline=Du.gfm),this.tokenizer.rules=n}static get rules(){return{block:_d,inline:Du}}static lex(t,n){return new Ab(n).lex(t)}static lexInline(t,n){return new Ab(n).inlineTokens(t)}lex(t){t=t.replace(lr.carriageReturn,`
|
|
427
|
-
`),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],r=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(lr.tabCharGlobal," ").replace(lr.spaceLine,""));t;){let i;if(this.options.extensions?.block?.some(l=>(i=l.call({lexer:this},t,n))?(t=t.substring(i.raw.length),n.push(i),!0):!1))continue;if(i=this.tokenizer.space(t)){t=t.substring(i.raw.length);let l=n.at(-1);i.raw.length===1&&l!==void 0?l.raw+=`
|
|
428
|
-
`:n.push(i);continue}if(i=this.tokenizer.code(t)){t=t.substring(i.raw.length);let l=n.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
|
|
429
|
-
`)?"":`
|
|
430
|
-
`)+i.raw,l.text+=`
|
|
431
|
-
`+i.text,this.inlineQueue.at(-1).src=l.text):n.push(i);continue}if(i=this.tokenizer.fences(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.heading(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.hr(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.blockquote(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.list(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.html(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.def(t)){t=t.substring(i.raw.length);let l=n.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
|
|
432
|
-
`)?"":`
|
|
433
|
-
`)+i.raw,l.text+=`
|
|
434
|
-
`+i.raw,this.inlineQueue.at(-1).src=l.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},n.push(i));continue}if(i=this.tokenizer.table(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.lheading(t)){t=t.substring(i.raw.length),n.push(i);continue}let o=t;if(this.options.extensions?.startBlock){let l=1/0,c=t.slice(1),f;this.options.extensions.startBlock.forEach(d=>{f=d.call({lexer:this},c),typeof f=="number"&&f>=0&&(l=Math.min(l,f))}),l<1/0&&l>=0&&(o=t.substring(0,l+1))}if(this.state.top&&(i=this.tokenizer.paragraph(o))){let l=n.at(-1);r&&l?.type==="paragraph"?(l.raw+=(l.raw.endsWith(`
|
|
435
|
-
`)?"":`
|
|
436
|
-
`)+i.raw,l.text+=`
|
|
437
|
-
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):n.push(i),r=o.length!==t.length,t=t.substring(i.raw.length);continue}if(i=this.tokenizer.text(t)){t=t.substring(i.raw.length);let l=n.at(-1);l?.type==="text"?(l.raw+=(l.raw.endsWith(`
|
|
438
|
-
`)?"":`
|
|
439
|
-
`)+i.raw,l.text+=`
|
|
440
|
-
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):n.push(i);continue}if(t){let l="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){this.tokenizer.lexer=this;let r=t,i=null;if(this.tokens.links){let f=Object.keys(this.tokens.links);if(f.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)f.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,i.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let o;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)o=i[2]?i[2].length:0,r=r.slice(0,i.index+o)+"["+"a".repeat(i[0].length-o-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let l=!1,c="";for(;t;){l||(c=""),l=!1;let f;if(this.options.extensions?.inline?.some(m=>(f=m.call({lexer:this},t,n))?(t=t.substring(f.raw.length),n.push(f),!0):!1))continue;if(f=this.tokenizer.escape(t)){t=t.substring(f.raw.length),n.push(f);continue}if(f=this.tokenizer.tag(t)){t=t.substring(f.raw.length),n.push(f);continue}if(f=this.tokenizer.link(t)){t=t.substring(f.raw.length),n.push(f);continue}if(f=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(f.raw.length);let m=n.at(-1);f.type==="text"&&m?.type==="text"?(m.raw+=f.raw,m.text+=f.text):n.push(f);continue}if(f=this.tokenizer.emStrong(t,r,c)){t=t.substring(f.raw.length),n.push(f);continue}if(f=this.tokenizer.codespan(t)){t=t.substring(f.raw.length),n.push(f);continue}if(f=this.tokenizer.br(t)){t=t.substring(f.raw.length),n.push(f);continue}if(f=this.tokenizer.del(t,r,c)){t=t.substring(f.raw.length),n.push(f);continue}if(f=this.tokenizer.autolink(t)){t=t.substring(f.raw.length),n.push(f);continue}if(!this.state.inLink&&(f=this.tokenizer.url(t))){t=t.substring(f.raw.length),n.push(f);continue}let d=t;if(this.options.extensions?.startInline){let m=1/0,p=t.slice(1),b;this.options.extensions.startInline.forEach(y=>{b=y.call({lexer:this},p),typeof b=="number"&&b>=0&&(m=Math.min(m,b))}),m<1/0&&m>=0&&(d=t.substring(0,m+1))}if(f=this.tokenizer.inlineText(d)){t=t.substring(f.raw.length),f.raw.slice(-1)!=="_"&&(c=f.raw.slice(-1)),l=!0;let m=n.at(-1);m?.type==="text"?(m.raw+=f.raw,m.text+=f.text):n.push(f);continue}if(t){let m="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return n}},kh=class{options;parser;constructor(t){this.options=t||mo}space(t){return""}code({text:t,lang:n,escaped:r}){let i=(n||"").match(lr.notSpaceStart)?.[0],o=t.replace(lr.endingNewline,"")+`
|
|
441
|
-
`;return i?'<pre><code class="language-'+Es(i)+'">'+(r?o:Es(o,!0))+`</code></pre>
|
|
442
|
-
`:"<pre><code>"+(r?o:Es(o,!0))+`</code></pre>
|
|
443
|
-
`}blockquote({tokens:t}){return`<blockquote>
|
|
444
|
-
${this.parser.parse(t)}</blockquote>
|
|
445
|
-
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:n}){return`<h${n}>${this.parser.parseInline(t)}</h${n}>
|
|
446
|
-
`}hr(t){return`<hr>
|
|
447
|
-
`}list(t){let n=t.ordered,r=t.start,i="";for(let c=0;c<t.items.length;c++){let f=t.items[c];i+=this.listitem(f)}let o=n?"ol":"ul",l=n&&r!==1?' start="'+r+'"':"";return"<"+o+l+`>
|
|
448
|
-
`+i+"</"+o+`>
|
|
449
|
-
`}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
|
|
450
|
-
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|
451
|
-
`}table(t){let n="",r="";for(let o=0;o<t.header.length;o++)r+=this.tablecell(t.header[o]);n+=this.tablerow({text:r});let i="";for(let o=0;o<t.rows.length;o++){let l=t.rows[o];r="";for(let c=0;c<l.length;c++)r+=this.tablecell(l[c]);i+=this.tablerow({text:r})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
|
|
452
|
-
<thead>
|
|
453
|
-
`+n+`</thead>
|
|
454
|
-
`+i+`</table>
|
|
455
|
-
`}tablerow({text:t}){return`<tr>
|
|
456
|
-
${t}</tr>
|
|
457
|
-
`}tablecell(t){let n=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+n+`</${r}>
|
|
458
|
-
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Es(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:n,tokens:r}){let i=this.parser.parseInline(r),o=OC(t);if(o===null)return i;t=o;let l='<a href="'+t+'"';return n&&(l+=' title="'+Es(n)+'"'),l+=">"+i+"</a>",l}image({href:t,title:n,text:r,tokens:i}){i&&(r=this.parser.parseInline(i,this.parser.textRenderer));let o=OC(t);if(o===null)return Es(r);t=o;let l=`<img src="${t}" alt="${Es(r)}"`;return n&&(l+=` title="${Es(n)}"`),l+=">",l}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Es(t.text)}},lx=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},os=class _b{options;renderer;textRenderer;constructor(t){this.options=t||mo,this.options.renderer=this.options.renderer||new kh,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new lx}static parse(t,n){return new _b(n).parse(t)}static parseInline(t,n){return new _b(n).parseInline(t)}parse(t){this.renderer.parser=this;let n="";for(let r=0;r<t.length;r++){let i=t[r];if(this.options.extensions?.renderers?.[i.type]){let l=i,c=this.options.extensions.renderers[l.type].call({parser:this},l);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){n+=c||"";continue}}let o=i;switch(o.type){case"space":{n+=this.renderer.space(o);break}case"hr":{n+=this.renderer.hr(o);break}case"heading":{n+=this.renderer.heading(o);break}case"code":{n+=this.renderer.code(o);break}case"table":{n+=this.renderer.table(o);break}case"blockquote":{n+=this.renderer.blockquote(o);break}case"list":{n+=this.renderer.list(o);break}case"checkbox":{n+=this.renderer.checkbox(o);break}case"html":{n+=this.renderer.html(o);break}case"def":{n+=this.renderer.def(o);break}case"paragraph":{n+=this.renderer.paragraph(o);break}case"text":{n+=this.renderer.text(o);break}default:{let l='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return n}parseInline(t,n=this.renderer){this.renderer.parser=this;let r="";for(let i=0;i<t.length;i++){let o=t[i];if(this.options.extensions?.renderers?.[o.type]){let c=this.options.extensions.renderers[o.type].call({parser:this},o);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){r+=c||"";continue}}let l=o;switch(l.type){case"escape":{r+=n.text(l);break}case"html":{r+=n.html(l);break}case"link":{r+=n.link(l);break}case"image":{r+=n.image(l);break}case"checkbox":{r+=n.checkbox(l);break}case"strong":{r+=n.strong(l);break}case"em":{r+=n.em(l);break}case"codespan":{r+=n.codespan(l);break}case"br":{r+=n.br(l);break}case"del":{r+=n.del(l);break}case"text":{r+=n.text(l);break}default:{let c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return r}},$u=class{options;block;constructor(e){this.options=e||mo}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?Jr.lex:Jr.lexInline}provideParser(e=this.block){return e?os.parse:os.parseInline}},EQ=class{defaults=ex();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=os;Renderer=kh;TextRenderer=lx;Lexer=Jr;Tokenizer=wh;Hooks=$u;constructor(...t){this.use(...t)}walkTokens(t,n){let r=[];for(let i of t)switch(r=r.concat(n.call(this,i)),i.type){case"table":{let o=i;for(let l of o.header)r=r.concat(this.walkTokens(l.tokens,n));for(let l of o.rows)for(let c of l)r=r.concat(this.walkTokens(c.tokens,n));break}case"list":{let o=i;r=r.concat(this.walkTokens(o.items,n));break}default:{let o=i;this.defaults.extensions?.childTokens?.[o.type]?this.defaults.extensions.childTokens[o.type].forEach(l=>{let c=o[l].flat(1/0);r=r.concat(this.walkTokens(c,n))}):o.tokens&&(r=r.concat(this.walkTokens(o.tokens,n)))}}return r}use(...t){let n=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{let i={...r};if(i.async=this.defaults.async||i.async||!1,r.extensions&&(r.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let l=n.renderers[o.name];l?n.renderers[o.name]=function(...c){let f=o.renderer.apply(this,c);return f===!1&&(f=l.apply(this,c)),f}:n.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let l=n[o.level];l?l.unshift(o.tokenizer):n[o.level]=[o.tokenizer],o.start&&(o.level==="block"?n.startBlock?n.startBlock.push(o.start):n.startBlock=[o.start]:o.level==="inline"&&(n.startInline?n.startInline.push(o.start):n.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(n.childTokens[o.name]=o.childTokens)}),i.extensions=n),r.renderer){let o=this.defaults.renderer||new kh(this.defaults);for(let l in r.renderer){if(!(l in o))throw new Error(`renderer '${l}' does not exist`);if(["options","parser"].includes(l))continue;let c=l,f=r.renderer[c],d=o[c];o[c]=(...m)=>{let p=f.apply(o,m);return p===!1&&(p=d.apply(o,m)),p||""}}i.renderer=o}if(r.tokenizer){let o=this.defaults.tokenizer||new wh(this.defaults);for(let l in r.tokenizer){if(!(l in o))throw new Error(`tokenizer '${l}' does not exist`);if(["options","rules","lexer"].includes(l))continue;let c=l,f=r.tokenizer[c],d=o[c];o[c]=(...m)=>{let p=f.apply(o,m);return p===!1&&(p=d.apply(o,m)),p}}i.tokenizer=o}if(r.hooks){let o=this.defaults.hooks||new $u;for(let l in r.hooks){if(!(l in o))throw new Error(`hook '${l}' does not exist`);if(["options","block"].includes(l))continue;let c=l,f=r.hooks[c],d=o[c];$u.passThroughHooks.has(l)?o[c]=m=>{if(this.defaults.async&&$u.passThroughHooksRespectAsync.has(l))return(async()=>{let b=await f.call(o,m);return d.call(o,b)})();let p=f.call(o,m);return d.call(o,p)}:o[c]=(...m)=>{if(this.defaults.async)return(async()=>{let b=await f.apply(o,m);return b===!1&&(b=await d.apply(o,m)),b})();let p=f.apply(o,m);return p===!1&&(p=d.apply(o,m)),p}}i.hooks=o}if(r.walkTokens){let o=this.defaults.walkTokens,l=r.walkTokens;i.walkTokens=function(c){let f=[];return f.push(l.call(this,c)),o&&(f=f.concat(o.call(this,c))),f}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,n){return Jr.lex(t,n??this.defaults)}parser(t,n){return os.parse(t,n??this.defaults)}parseMarkdown(t){return(n,r)=>{let i={...r},o={...this.defaults,...i},l=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&i.async===!1)return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=t),o.async)return(async()=>{let c=o.hooks?await o.hooks.preprocess(n):n,f=await(o.hooks?await o.hooks.provideLexer(t):t?Jr.lex:Jr.lexInline)(c,o),d=o.hooks?await o.hooks.processAllTokens(f):f;o.walkTokens&&await Promise.all(this.walkTokens(d,o.walkTokens));let m=await(o.hooks?await o.hooks.provideParser(t):t?os.parse:os.parseInline)(d,o);return o.hooks?await o.hooks.postprocess(m):m})().catch(l);try{o.hooks&&(n=o.hooks.preprocess(n));let c=(o.hooks?o.hooks.provideLexer(t):t?Jr.lex:Jr.lexInline)(n,o);o.hooks&&(c=o.hooks.processAllTokens(c)),o.walkTokens&&this.walkTokens(c,o.walkTokens);let f=(o.hooks?o.hooks.provideParser(t):t?os.parse:os.parseInline)(c,o);return o.hooks&&(f=o.hooks.postprocess(f)),f}catch(c){return l(c)}}}onError(t,n){return r=>{if(r.message+=`
|
|
459
|
-
Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+Es(r.message+"",!0)+"</pre>";return n?Promise.resolve(i):i}if(n)return Promise.reject(r);throw r}}},ao=new EQ;function Kt(e,t){return ao.parse(e,t)}Kt.options=Kt.setOptions=function(e){return ao.setOptions(e),Kt.defaults=ao.defaults,TN(Kt.defaults),Kt};Kt.getDefaults=ex;Kt.defaults=mo;Kt.use=function(...e){return ao.use(...e),Kt.defaults=ao.defaults,TN(Kt.defaults),Kt};Kt.walkTokens=function(e,t){return ao.walkTokens(e,t)};Kt.parseInline=ao.parseInline;Kt.Parser=os;Kt.parser=os.parse;Kt.Renderer=kh;Kt.TextRenderer=lx;Kt.Lexer=Jr;Kt.lexer=Jr.lex;Kt.Tokenizer=wh;Kt.Hooks=$u;Kt.parse=Kt;Kt.options;Kt.setOptions;Kt.use;Kt.walkTokens;Kt.parseInline;os.parse;Jr.lex;var TQ=300,vQ="300px",SQ=500;function CQ(e={}){let{immediate:t=!1,debounceDelay:n=TQ,rootMargin:r=vQ,idleTimeout:i=SQ}=e,[o,l]=S.useState(!1),c=S.useRef(null),f=S.useRef(null),d=S.useRef(null),m=S.useMemo(()=>y=>{let E=Date.now();return window.setTimeout(()=>{y({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-E))})},1)},[]),p=S.useMemo(()=>typeof window<"u"&&window.requestIdleCallback?(y,E)=>window.requestIdleCallback(y,E):m,[m]),b=S.useMemo(()=>typeof window<"u"&&window.cancelIdleCallback?y=>window.cancelIdleCallback(y):y=>{clearTimeout(y)},[]);return S.useEffect(()=>{if(t){l(!0);return}let y=c.current;if(!y)return;f.current&&(clearTimeout(f.current),f.current=null),d.current&&(b(d.current),d.current=null);let E=()=>{f.current&&(clearTimeout(f.current),f.current=null),d.current&&(b(d.current),d.current=null)},w=_=>{d.current=p(N=>{N.timeRemaining()>0||N.didTimeout?(l(!0),_.disconnect()):d.current=p(()=>{l(!0),_.disconnect()},{timeout:i/2})},{timeout:i})},k=_=>{E(),f.current=window.setTimeout(()=>{var N,D;let O=_.takeRecords();(O.length===0||(D=(N=O.at(-1))==null?void 0:N.isIntersecting)!=null&&D)&&w(_)},n)},C=(_,N)=>{_.isIntersecting?k(N):E()},A=new IntersectionObserver(_=>{for(let N of _)C(N,A)},{rootMargin:r,threshold:0});return A.observe(y),()=>{f.current&&clearTimeout(f.current),d.current&&b(d.current),A.disconnect()}},[t,n,r,i,b,p]),{shouldRender:o,containerRef:c}}var ON=/\s/,wQ=/^\s+$/,kQ=new Set(["code","pre","svg","math","annotation"]),AQ=e=>typeof e=="object"&&e!==null&&"type"in e&&e.type==="element",_Q=e=>e.some(t=>AQ(t)&&kQ.has(t.tagName)),NQ=e=>{let t=[],n="",r=!1;for(let i of e){let o=ON.test(i);o!==r&&n&&(t.push(n),n=""),n+=i,r=o}return n&&t.push(n),t},RQ=e=>{let t=[],n="";for(let r of e)ON.test(r)?n+=r:(n&&(t.push(n),n=""),t.push(r));return n&&t.push(n),t},OQ=(e,t,n,r,i,o)=>{let l=`--sd-animation:sd-${t};--sd-duration:${i?0:n}ms;--sd-easing:${r}`;return o&&(l+=`;--sd-delay:${o}ms`),{type:"element",tagName:"span",properties:{"data-sd-animate":!0,style:l},children:[{type:"text",value:e}]}},IQ=(e,t,n,r,i)=>{let o=t.at(-1);if(!(o&&"children"in o))return;if(_Q(t))return al;let l=o,c=l.children.indexOf(e);if(c===-1)return;let f=e.value;if(!f.trim()){i.count+=f.length;return}let d=n.sep==="char"?RQ(f):NQ(f),m=r.prevContentLength,p=d.map(b=>{let y=i.count;if(i.count+=b.length,wQ.test(b))return{type:"text",value:b};let E=m>0&&y<m,w=E?0:i.newIndex++*n.stagger;return OQ(b,n.animation,n.duration,n.easing,E,w)});return l.children.splice(c,1,...p),c+p.length},LQ=0;function Nb(e){var t,n,r,i,o;let l={animation:(t=e?.animation)!=null?t:"fadeIn",duration:(n=e?.duration)!=null?n:150,easing:(r=e?.easing)!=null?r:"ease",sep:(i=e?.sep)!=null?i:"word",stagger:(o=e?.stagger)!=null?o:40},c={prevContentLength:0,lastRenderCharCount:0},f=LQ++,d=()=>m=>{let p={count:0,newIndex:0};R1(m,"text",(b,y)=>IQ(b,y,l,c,p)),c.lastRenderCharCount=p.count,c.prevContentLength=0};return Object.defineProperty(d,"name",{value:`rehypeAnimate$${f}`}),{name:"animate",type:"animate",rehypePlugin:d,setPrevContentLength(m){c.prevContentLength=m},getLastRenderCharCount(){let m=c.lastRenderCharCount;return c.lastRenderCharCount=0,m}}}Nb();var IN=S.createContext(!1),MQ=()=>S.useContext(IN),ux=(...e)=>sk(Ih(e)),DQ=(e,t)=>{if(!e||!t)return t;let n=`${e}:`;return t.split(/\s+/).filter(Boolean).map(r=>r.startsWith(n)?r:`${e}:${r}`).join(" ")},PQ=e=>e?(...t)=>DQ(e,sk(Ih(t))):ux,cl=(e,t,n)=>{let r=typeof t=="string"&&n.startsWith("text/csv")?"\uFEFF":"",i=typeof t=="string"?new Blob([r+t],{type:n}):t,o=URL.createObjectURL(i),l=document.createElement("a");l.href=o,l.download=e,document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(o)},Rb=S.createContext(ux),St=()=>S.useContext(Rb),jQ=ux("block","before:content-[counter(line)]","before:inline-block","before:[counter-increment:line]","before:w-6","before:mr-4","before:text-[13px]","before:text-right","before:text-muted-foreground/50","before:font-mono","before:select-none"),BQ=e=>{let t={};for(let n of e.split(";")){let r=n.indexOf(":");if(r>0){let i=n.slice(0,r).trim(),o=n.slice(r+1).trim();i&&o&&(t[i]=o)}}return t},HQ=S.memo(({children:e,result:t,language:n,className:r,startLine:i,lineNumbers:o=!0,...l})=>{let c=St(),f=S.useMemo(()=>c(jQ),[c]),d=S.useMemo(()=>{let m={};return t.bg&&(m["--sdm-bg"]=t.bg),t.fg&&(m["--sdm-fg"]=t.fg),t.rootStyle&&Object.assign(m,BQ(t.rootStyle)),m},[t.bg,t.fg,t.rootStyle]);return g.jsx("div",{className:c(r,"overflow-x-auto rounded-md border border-border bg-background p-4 text-sm"),"data-language":n,"data-streamdown":"code-block-body",...l,children:g.jsx("pre",{className:c(r,"bg-[var(--sdm-bg,inherit]","dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,inherit)]"),style:d,children:g.jsx("code",{className:o?c("[counter-increment:line_0] [counter-reset:line]"):void 0,style:o&&i&&i>1?{counterReset:`line ${i-1}`}:void 0,children:t.tokens.map((m,p)=>g.jsx("span",{className:o?f:void 0,children:m.length===0||m.length===1&&m[0].content===""?`
|
|
460
|
-
`:m.map((b,y)=>{let E={},w=!!b.bgColor;if(b.color&&(E["--sdm-c"]=b.color),b.bgColor&&(E["--sdm-tbg"]=b.bgColor),b.htmlStyle)for(let[k,C]of Object.entries(b.htmlStyle))k==="color"?E["--sdm-c"]=C:k==="background-color"?(E["--sdm-tbg"]=C,w=!0):E[k]=C;return g.jsx("span",{className:c("text-[var(--sdm-c,inherit)]","dark:text-[var(--shiki-dark,var(--sdm-c,inherit))]",w&&"bg-[var(--sdm-tbg)]",w&&"dark:bg-[var(--shiki-dark-bg,var(--sdm-tbg))]"),style:E,...b.htmlAttrs,children:b.content},y)})},p))})})})},(e,t)=>e.result===t.result&&e.language===t.language&&e.className===t.className&&e.startLine===t.startLine&&e.lineNumbers===t.lineNumbers),UQ=({className:e,language:t,style:n,isIncomplete:r,...i})=>{let o=St();return g.jsx("div",{className:o("my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2",e),"data-incomplete":r||void 0,"data-language":t,"data-streamdown":"code-block",style:{contentVisibility:"auto",containIntrinsicSize:"auto 200px",...n},...i})},LN=S.createContext({code:""}),MN=()=>S.useContext(LN),zQ=({language:e})=>{let t=St();return g.jsx("div",{className:t("flex h-8 items-center text-muted-foreground text-xs"),"data-language":e,"data-streamdown":"code-block-header",children:g.jsx("span",{className:t("ml-1 font-mono lowercase"),children:e})})},FQ=e=>{let t=e.length;for(;t>0&&e[t-1]===`
|
|
461
|
-
`;)t--;return e.slice(0,t)},VQ=S.lazy(()=>bc(()=>import("./highlighted-body-OFNGDK62-CZjhGmx1.js"),[]).then(e=>({default:e.HighlightedCodeBlockBody}))),$Q=({code:e,language:t,className:n,children:r,isIncomplete:i=!1,startLine:o,lineNumbers:l,...c})=>{let f=St(),d=S.useMemo(()=>FQ(e),[e]),m=S.useMemo(()=>({bg:"transparent",fg:"inherit",tokens:d.split(`
|
|
462
|
-
`).map(p=>[{content:p,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[d]);return g.jsx(LN.Provider,{value:{code:e},children:g.jsxs(UQ,{isIncomplete:i,language:t,children:[g.jsx(zQ,{language:t}),r?g.jsx("div",{className:f("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"),children:g.jsx("div",{className:f("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"),"data-streamdown":"code-block-actions",children:r})}):null,g.jsx(S.Suspense,{fallback:g.jsx(HQ,{className:n,language:t,lineNumbers:l,result:m,startLine:o,...c}),children:g.jsx(VQ,{className:n,code:d,language:t,lineNumbers:l,raw:m,startLine:o,...c})})]})})},qQ=e=>g.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:g.jsx("path",{clipRule:"evenodd",d:"M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z",fill:"currentColor",fillRule:"evenodd"})}),YQ=e=>g.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:g.jsx("path",{clipRule:"evenodd",d:"M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z",fill:"currentColor",fillRule:"evenodd"})}),GQ=e=>g.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:g.jsx("path",{clipRule:"evenodd",d:"M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z",fill:"currentColor",fillRule:"evenodd"})}),XQ=e=>g.jsxs("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:[g.jsx("path",{d:"M8 0V4",stroke:"currentColor",strokeWidth:"1.5"}),g.jsx("path",{d:"M8 16V12",opacity:"0.5",stroke:"currentColor",strokeWidth:"1.5"}),g.jsx("path",{d:"M3.29773 1.52783L5.64887 4.7639",opacity:"0.9",stroke:"currentColor",strokeWidth:"1.5"}),g.jsx("path",{d:"M12.7023 1.52783L10.3511 4.7639",opacity:"0.1",stroke:"currentColor",strokeWidth:"1.5"}),g.jsx("path",{d:"M12.7023 14.472L10.3511 11.236",opacity:"0.4",stroke:"currentColor",strokeWidth:"1.5"}),g.jsx("path",{d:"M3.29773 14.472L5.64887 11.236",opacity:"0.6",stroke:"currentColor",strokeWidth:"1.5"}),g.jsx("path",{d:"M15.6085 5.52783L11.8043 6.7639",opacity:"0.2",stroke:"currentColor",strokeWidth:"1.5"}),g.jsx("path",{d:"M0.391602 10.472L4.19583 9.23598",opacity:"0.7",stroke:"currentColor",strokeWidth:"1.5"}),g.jsx("path",{d:"M15.6085 10.4722L11.8043 9.2361",opacity:"0.3",stroke:"currentColor",strokeWidth:"1.5"}),g.jsx("path",{d:"M0.391602 5.52783L4.19583 6.7639",opacity:"0.8",stroke:"currentColor",strokeWidth:"1.5"})]}),KQ=e=>g.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:g.jsx("path",{clipRule:"evenodd",d:"M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z",fill:"currentColor",fillRule:"evenodd"})}),QQ=e=>g.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:g.jsx("path",{clipRule:"evenodd",d:"M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z",fill:"currentColor",fillRule:"evenodd"})}),WQ=e=>g.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:g.jsx("path",{clipRule:"evenodd",d:"M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z",fill:"currentColor",fillRule:"evenodd"})}),ZQ=e=>g.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:g.jsx("path",{clipRule:"evenodd",d:"M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z",fill:"currentColor",fillRule:"evenodd"})}),JQ=e=>g.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:g.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),eW=e=>g.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:g.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H8.25H8.875V7.125H8.25H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),qu={CheckIcon:qQ,CopyIcon:YQ,DownloadIcon:GQ,ExternalLinkIcon:ZQ,Loader2Icon:XQ,Maximize2Icon:KQ,RotateCcwIcon:QQ,XIcon:WQ,ZoomInIcon:JQ,ZoomOutIcon:eW},DN=S.createContext(qu),tW=(e,t)=>{if(e===t)return!0;if(!(e&&t))return e===t;let n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(i=>e[i]===t[i])},MC=({icons:e,children:t})=>{let n=S.useRef(e),r=S.useRef(e?{...qu,...e}:qu);tW(n.current,e)||(n.current=e,r.current=e?{...qu,...e}:qu);let i=r.current;return g.jsx(DN.Provider,{value:i,children:t})},ds=()=>S.useContext(DN),PN={copyCode:"Copy Code",downloadFile:"Download file",downloadDiagram:"Download diagram",downloadDiagramAsSvg:"Download diagram as SVG",downloadDiagramAsPng:"Download diagram as PNG",downloadDiagramAsMmd:"Download diagram as MMD",viewFullscreen:"View fullscreen",exitFullscreen:"Exit fullscreen",mermaidFormatSvg:"SVG",mermaidFormatPng:"PNG",mermaidFormatMmd:"MMD",copyTable:"Copy table",copyTableAsMarkdown:"Copy table as Markdown",copyTableAsCsv:"Copy table as CSV",copyTableAsTsv:"Copy table as TSV",downloadTable:"Download table",downloadTableAsCsv:"Download table as CSV",downloadTableAsMarkdown:"Download table as Markdown",tableFormatMarkdown:"Markdown",tableFormatCsv:"CSV",tableFormatTsv:"TSV",imageNotAvailable:"Image not available",downloadImage:"Download image",openExternalLink:"Open external link?",externalLinkWarning:"You're about to visit an external website.",close:"Close",copyLink:"Copy link",copied:"Copied",openLink:"Open link"},Ob=S.createContext(PN),pi=()=>S.useContext(Ob),DC=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:i,code:o,...l})=>{let c=St(),[f,d]=S.useState(!1),m=S.useRef(0),{code:p}=MN(),{isAnimating:b}=S.useContext(Hr),y=pi(),E=o??p,w=async()=>{var A;if(typeof window>"u"||!((A=navigator?.clipboard)!=null&&A.writeText)){t?.(new Error("Clipboard API not available"));return}try{f||(await navigator.clipboard.writeText(E),d(!0),e?.(),m.current=window.setTimeout(()=>d(!1),n))}catch(_){t?.(_)}};S.useEffect(()=>()=>{window.clearTimeout(m.current)},[]);let k=ds(),C=f?k.CheckIcon:k.CopyIcon;return g.jsx("button",{className:c("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),"data-streamdown":"code-block-copy-button",disabled:b,onClick:w,title:y.copyCode,type:"button",...l,children:r??g.jsx(C,{size:14})})},PC={"1c":"1c","1c-query":"1cq",abap:"abap","actionscript-3":"as",ada:"ada",adoc:"adoc","angular-html":"html","angular-ts":"ts",apache:"conf",apex:"cls",apl:"apl",applescript:"applescript",ara:"ara",asciidoc:"adoc",asm:"asm",astro:"astro",awk:"awk",ballerina:"bal",bash:"sh",bat:"bat",batch:"bat",be:"be",beancount:"beancount",berry:"berry",bibtex:"bib",bicep:"bicep",blade:"blade.php",bsl:"bsl",c:"c","c#":"cs","c++":"cpp",cadence:"cdc",cairo:"cairo",cdc:"cdc",clarity:"clar",clj:"clj",clojure:"clj","closure-templates":"soy",cmake:"cmake",cmd:"cmd",cobol:"cob",codeowners:"CODEOWNERS",codeql:"ql",coffee:"coffee",coffeescript:"coffee","common-lisp":"lisp",console:"sh",coq:"v",cpp:"cpp",cql:"cql",crystal:"cr",cs:"cs",csharp:"cs",css:"css",csv:"csv",cue:"cue",cypher:"cql",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",docker:"dockerfile",dockerfile:"dockerfile",dotenv:"env","dream-maker":"dm",edge:"edge",elisp:"el",elixir:"ex",elm:"elm","emacs-lisp":"el",erb:"erb",erl:"erl",erlang:"erl",f:"f","f#":"fs",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"f90",f95:"f95",fennel:"fnl",fish:"fish",fluent:"ftl",for:"for","fortran-fixed-form":"f","fortran-free-form":"f90",fs:"fs",fsharp:"fs",fsl:"fsl",ftl:"ftl",gdresource:"tres",gdscript:"gd",gdshader:"gdshader",genie:"gs",gherkin:"feature","git-commit":"gitcommit","git-rebase":"gitrebase",gjs:"js",gleam:"gleam","glimmer-js":"js","glimmer-ts":"ts",glsl:"glsl",gnuplot:"plt",go:"go",gql:"gql",graphql:"graphql",groovy:"groovy",gts:"gts",hack:"hack",haml:"haml",handlebars:"hbs",haskell:"hs",haxe:"hx",hbs:"hbs",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",hs:"hs",html:"html","html-derivative":"html",http:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",jade:"jade",java:"java",javascript:"js",jinja:"jinja",jison:"jison",jl:"jl",js:"js",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",julia:"jl",kotlin:"kt",kql:"kql",kt:"kt",kts:"kts",kusto:"kql",latex:"tex",lean:"lean",lean4:"lean",less:"less",liquid:"liquid",lisp:"lisp",lit:"lit",llvm:"ll",log:"log",logo:"logo",lua:"lua",luau:"luau",make:"mak",makefile:"mak",markdown:"md",marko:"marko",matlab:"m",md:"md",mdc:"mdc",mdx:"mdx",mediawiki:"wiki",mermaid:"mmd",mips:"s",mipsasm:"s",mmd:"mmd",mojo:"mojo",move:"move",nar:"nar",narrat:"narrat",nextflow:"nf",nf:"nf",nginx:"conf",nim:"nim",nix:"nix",nu:"nu",nushell:"nu",objc:"m","objective-c":"m","objective-cpp":"mm",ocaml:"ml",pascal:"pas",perl:"pl",perl6:"p6",php:"php",plsql:"pls",po:"po",polar:"polar",postcss:"pcss",pot:"pot",potx:"potx",powerquery:"pq",powershell:"ps1",prisma:"prisma",prolog:"pl",properties:"properties",proto:"proto",protobuf:"proto",ps:"ps",ps1:"ps1",pug:"pug",puppet:"pp",purescript:"purs",py:"py",python:"py",ql:"ql",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",racket:"rkt",raku:"raku",razor:"cshtml",rb:"rb",reg:"reg",regex:"regex",regexp:"regexp",rel:"rel",riscv:"s",rs:"rs",rst:"rst",ruby:"rb",rust:"rs",sas:"sas",sass:"sass",scala:"scala",scheme:"scm",scss:"scss",sdbl:"sdbl",sh:"sh",shader:"shader",shaderlab:"shader",shell:"sh",shellscript:"sh",shellsession:"sh",smalltalk:"st",solidity:"sol",soy:"soy",sparql:"rq",spl:"spl",splunk:"spl",sql:"sql","ssh-config":"config",stata:"do",styl:"styl",stylus:"styl",svelte:"svelte",swift:"swift","system-verilog":"sv",systemd:"service",talon:"talon",talonscript:"talon",tasl:"tasl",tcl:"tcl",templ:"templ",terraform:"tf",tex:"tex",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"ts","ts-tags":"ts",tsp:"tsp",tsv:"tsv",tsx:"tsx",turtle:"ttl",twig:"twig",typ:"typ",typescript:"ts",typespec:"tsp",typst:"typ",v:"v",vala:"vala",vb:"vb",verilog:"v",vhdl:"vhdl",vim:"vim",viml:"vim",vimscript:"vim",vue:"vue","vue-html":"html","vue-vine":"vine",vy:"vy",vyper:"vy",wasm:"wasm",wenyan:"wy",wgsl:"wgsl",wiki:"wiki",wikitext:"wiki",wit:"wit",wl:"wl",wolfram:"wl",xml:"xml",xsl:"xsl",yaml:"yaml",yml:"yml",zenscript:"zs",zig:"zig",zsh:"zsh",文言:"wy"},nW=({onDownload:e,onError:t,language:n,children:r,className:i,code:o,...l})=>{let c=St(),{code:f}=MN(),{isAnimating:d}=S.useContext(Hr),m=pi(),p=ds(),b=o??f,y=`file.${n&&n in PC?PC[n]:"txt"}`,E="text/plain",w=()=>{try{cl(y,b,E),e?.()}catch(k){t?.(k)}};return g.jsx("button",{className:c("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),"data-streamdown":"code-block-download-button",disabled:d,onClick:w,title:m.downloadFile,type:"button",...l,children:r??g.jsx(p.DownloadIcon,{size:14})})},jC=()=>{let{Loader2Icon:e}=ds(),t=St();return g.jsxs("div",{className:t("w-full divide-y divide-border overflow-hidden rounded-xl border border-border"),children:[g.jsx("div",{className:t("h-[46px] w-full bg-muted/80")}),g.jsx("div",{className:t("flex w-full items-center justify-center p-4"),children:g.jsx(e,{className:t("size-4 animate-spin")})})]})},rW=/\.[^/.]+$/,sW=({node:e,className:t,src:n,alt:r,onLoad:i,onError:o,...l})=>{let{DownloadIcon:c}=ds(),f=St(),d=S.useRef(null),[m,p]=S.useState(!1),[b,y]=S.useState(!1),E=pi(),w=l.width!=null||l.height!=null,k=(m||w)&&!b,C=b&&!w;S.useEffect(()=>{let D=d.current;if(D!=null&&D.complete){let O=D.naturalWidth>0;p(O),y(!O)}},[]);let A=S.useCallback(D=>{p(!0),y(!1),i?.(D)},[i]),_=S.useCallback(D=>{p(!1),y(!0),o?.(D)},[o]),N=async()=>{if(n)try{let D=await(await fetch(n)).blob(),O=new URL(n,window.location.origin).pathname.split("/").pop()||"",j=O.split(".").pop(),M=O.includes(".")&&j!==void 0&&j.length<=4,q="";if(M)q=O;else{let U=D.type,Q="png";U.includes("jpeg")||U.includes("jpg")?Q="jpg":U.includes("png")?Q="png":U.includes("svg")?Q="svg":U.includes("gif")?Q="gif":U.includes("webp")&&(Q="webp"),q=`${(r||O||"image").replace(rW,"")}.${Q}`}cl(q,D,D.type)}catch{window.open(n,"_blank")}};return n?g.jsxs("div",{className:f("group relative my-4 inline-block"),"data-streamdown":"image-wrapper",children:[g.jsx("img",{alt:r,className:f("max-w-full rounded-lg",C&&"hidden",t),"data-streamdown":"image",onError:_,onLoad:A,ref:d,src:n,...l}),C&&g.jsx("span",{className:f("text-muted-foreground text-xs italic"),"data-streamdown":"image-fallback",children:E.imageNotAvailable}),g.jsx("div",{className:f("pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block")}),k&&g.jsx("button",{className:f("absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background","opacity-0 group-hover:opacity-100"),onClick:N,title:E.downloadImage,type:"button",children:g.jsx(c,{size:14})})]}):null},sc=0,cx=()=>{sc+=1,sc===1&&(document.body.style.overflow="hidden")},fx=()=>{sc=Math.max(0,sc-1),sc===0&&(document.body.style.overflow="")},iW=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let{CheckIcon:i,CopyIcon:o,ExternalLinkIcon:l,XIcon:c}=ds(),f=St(),[d,m]=S.useState(!1),p=pi(),b=S.useCallback(async()=>{try{await navigator.clipboard.writeText(e),m(!0),setTimeout(()=>m(!1),2e3)}catch{}},[e]),y=S.useCallback(()=>{r(),n()},[r,n]);return S.useEffect(()=>{if(t){cx();let E=w=>{w.key==="Escape"&&n()};return document.addEventListener("keydown",E),()=>{document.removeEventListener("keydown",E),fx()}}},[t,n]),t?g.jsx("div",{className:f("fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm"),"data-streamdown":"link-safety-modal",onClick:n,onKeyDown:E=>{E.key==="Escape"&&n()},role:"button",tabIndex:0,children:g.jsxs("div",{className:f("relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg"),onClick:E=>E.stopPropagation(),onKeyDown:E=>E.stopPropagation(),role:"presentation",children:[g.jsx("button",{className:f("absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:n,title:p.close,type:"button",children:g.jsx(c,{size:16})}),g.jsxs("div",{className:f("flex flex-col gap-2"),children:[g.jsxs("div",{className:f("flex items-center gap-2 font-semibold text-lg"),children:[g.jsx(l,{size:20}),g.jsx("span",{children:p.openExternalLink})]}),g.jsx("p",{className:f("text-muted-foreground text-sm"),children:p.externalLinkWarning})]}),g.jsx("div",{className:f("break-all rounded-md bg-muted p-3 font-mono text-sm",e.length>100&&"max-h-32 overflow-y-auto"),children:e}),g.jsxs("div",{className:f("flex gap-2"),children:[g.jsx("button",{className:f("flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted"),onClick:b,type:"button",children:d?g.jsxs(g.Fragment,{children:[g.jsx(i,{size:14}),g.jsx("span",{children:p.copied})]}):g.jsxs(g.Fragment,{children:[g.jsx(o,{size:14}),g.jsx("span",{children:p.copyLink})]})}),g.jsxs("button",{className:f("flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90"),onClick:y,type:"button",children:[g.jsx(l,{size:14}),g.jsx("span",{children:p.openLink})]})]})]})}):null},Ib=S.createContext(null),dx=()=>S.useContext(Ib),JZ=()=>{var e;let t=dx();return(e=t?.code)!=null?e:null},hx=()=>{var e;let t=dx();return(e=t?.mermaid)!=null?e:null},aW=e=>{var t;let n=dx();return n!=null&&n.renderers&&e&&(t=n.renderers.find(r=>Array.isArray(r.language)?r.language.includes(e):r.language===e))!=null?t:null},oW=(e,t)=>{var n;let r=(n=void 0)!=null?n:5;return new Promise((i,o)=>{let l="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(e))),c=new Image;c.crossOrigin="anonymous",c.onload=()=>{let f=document.createElement("canvas"),d=c.width*r,m=c.height*r;f.width=d,f.height=m;let p=f.getContext("2d");if(!p){o(new Error("Failed to create 2D canvas context for PNG export"));return}p.drawImage(c,0,0,d,m),f.toBlob(b=>{if(!b){o(new Error("Failed to create PNG blob"));return}i(b)},"image/png")},c.onerror=()=>o(new Error("Failed to load SVG image")),c.src=l})},lW=({chart:e,children:t,className:n,onDownload:r,config:i,onError:o})=>{let l=St(),[c,f]=S.useState(!1),d=S.useRef(null),{isAnimating:m}=S.useContext(Hr),p=ds(),b=hx(),y=pi(),E=async w=>{try{if(w==="mmd"){cl("diagram.mmd",e,"text/plain"),f(!1),r?.(w);return}if(!b){o?.(new Error("Mermaid plugin not available"));return}let k=b.getMermaid(i),C=e.split("").reduce((N,D)=>(N<<5)-N+D.charCodeAt(0)|0,0),A=`mermaid-${Math.abs(C)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:_}=await k.render(A,e);if(!_){o?.(new Error("SVG not found. Please wait for the diagram to render."));return}if(w==="svg"){cl("diagram.svg",_,"image/svg+xml"),f(!1),r?.(w);return}if(w==="png"){let N=await oW(_);cl("diagram.png",N,"image/png"),r?.(w),f(!1);return}}catch(k){o?.(k)}};return S.useEffect(()=>{let w=k=>{let C=k.composedPath();d.current&&!C.includes(d.current)&&f(!1)};return document.addEventListener("mousedown",w),()=>{document.removeEventListener("mousedown",w)}},[]),g.jsxs("div",{className:l("relative"),ref:d,children:[g.jsx("button",{className:l("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",n),disabled:m,onClick:()=>f(!c),title:y.downloadDiagram,type:"button",children:t??g.jsx(p.DownloadIcon,{size:14})}),c?g.jsxs("div",{className:l("absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[g.jsx("button",{className:l("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>E("svg"),title:y.downloadDiagramAsSvg,type:"button",children:y.mermaidFormatSvg}),g.jsx("button",{className:l("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>E("png"),title:y.downloadDiagramAsPng,type:"button",children:y.mermaidFormatPng}),g.jsx("button",{className:l("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>E("mmd"),title:y.downloadDiagramAsMmd,type:"button",children:y.mermaidFormatMmd})]}):null]})},uW=({chart:e,config:t,onFullscreen:n,onExit:r,className:i,...o})=>{let{Maximize2Icon:l,XIcon:c}=ds(),f=St(),[d,m]=S.useState(!1),{isAnimating:p,controls:b}=S.useContext(Hr),y=pi(),E=(()=>{if(typeof b=="boolean")return b;let k=b.mermaid;return k===!1?!1:k===!0||k===void 0?!0:k.panZoom!==!1})(),w=()=>{m(!d)};return S.useEffect(()=>{if(d){cx();let k=C=>{C.key==="Escape"&&m(!1)};return document.addEventListener("keydown",k),()=>{document.removeEventListener("keydown",k),fx()}}},[d]),S.useEffect(()=>{d?n?.():r&&r()},[d,n,r]),g.jsxs(g.Fragment,{children:[g.jsx("button",{className:f("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),disabled:p,onClick:w,title:y.viewFullscreen,type:"button",...o,children:g.jsx(l,{size:14})}),d?cs.createPortal(g.jsxs("div",{className:f("fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm"),onClick:w,onKeyDown:k=>{k.key==="Escape"&&w()},role:"button",tabIndex:0,children:[g.jsx("button",{className:f("absolute top-4 right-4 z-10 rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:w,title:y.exitFullscreen,type:"button",children:g.jsx(c,{size:20})}),g.jsx("div",{className:f("flex size-full items-center justify-center p-4"),onClick:k=>k.stopPropagation(),onKeyDown:k=>k.stopPropagation(),role:"presentation",children:g.jsx(bR,{chart:e,className:f("size-full [&_svg]:h-auto [&_svg]:w-auto"),config:t,fullscreen:!0,showControls:E})})]}),document.body):null]})},jN=e=>{var t,n;let r=[],i=[],o=e.querySelectorAll("thead th");for(let c of o)r.push(((t=c.textContent)==null?void 0:t.trim())||"");let l=e.querySelectorAll("tbody tr");for(let c of l){let f=[],d=c.querySelectorAll("td");for(let m of d)f.push(((n=m.textContent)==null?void 0:n.trim())||"");i.push(f)}return{headers:r,rows:i}},BN=e=>{let{headers:t,rows:n}=e,r=c=>{let f=!1,d=!1;for(let m of c){if(m==='"'){f=!0,d=!0;break}(m===","||m===`
|
|
463
|
-
`)&&(f=!0)}return f?d?`"${c.replace(/"/g,'""')}"`:`"${c}"`:c},i=t.length>0?n.length+1:n.length,o=new Array(i),l=0;t.length>0&&(o[l]=t.map(r).join(","),l+=1);for(let c of n)o[l]=c.map(r).join(","),l+=1;return o.join(`
|
|
464
|
-
`)},cW=e=>{let{headers:t,rows:n}=e,r=c=>{let f=!1;for(let m of c)if(m===" "||m===`
|
|
465
|
-
`||m==="\r"){f=!0;break}if(!f)return c;let d=[];for(let m of c)m===" "?d.push("\\t"):m===`
|
|
466
|
-
`?d.push("\\n"):m==="\r"?d.push("\\r"):d.push(m);return d.join("")},i=t.length>0?n.length+1:n.length,o=new Array(i),l=0;t.length>0&&(o[l]=t.map(r).join(" "),l+=1);for(let c of n)o[l]=c.map(r).join(" "),l+=1;return o.join(`
|
|
467
|
-
`)},Lg=e=>{let t=!1;for(let r of e)if(r==="\\"||r==="|"){t=!0;break}if(!t)return e;let n=[];for(let r of e)r==="\\"?n.push("\\\\"):r==="|"?n.push("\\|"):n.push(r);return n.join("")},Lb=e=>{let{headers:t,rows:n}=e;if(t.length===0)return"";let r=new Array(n.length+2),i=0,o=t.map(c=>Lg(c));r[i]=`| ${o.join(" | ")} |`,i+=1;let l=new Array(t.length);for(let c=0;c<t.length;c+=1)l[c]="---";r[i]=`| ${l.join(" | ")} |`,i+=1;for(let c of n)if(c.length<t.length){let f=new Array(t.length);for(let d=0;d<t.length;d+=1)f[d]=d<c.length?Lg(c[d]):"";r[i]=`| ${f.join(" | ")} |`,i+=1}else{let f=c.map(d=>Lg(d));r[i]=`| ${f.join(" | ")} |`,i+=1}return r.join(`
|
|
468
|
-
`)},HN=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let o=St(),[l,c]=S.useState(!1),[f,d]=S.useState(!1),m=S.useRef(null),p=S.useRef(0),{isAnimating:b}=S.useContext(Hr),y=pi(),E=async C=>{var A,_;if(typeof window>"u"||!((A=navigator?.clipboard)!=null&&A.write)){r?.(new Error("Clipboard API not available"));return}try{let N=(_=m.current)==null?void 0:_.closest('[data-streamdown="table-wrapper"]'),D=N?.querySelector("table");if(!D){r?.(new Error("Table not found"));return}let O=jN(D),j=({csv:BN,tsv:cW,md:Lb}[C]||Lb)(O),M=new ClipboardItem({"text/plain":new Blob([j],{type:"text/plain"}),"text/html":new Blob([D.outerHTML],{type:"text/html"})});await navigator.clipboard.write([M]),d(!0),c(!1),n?.(C),p.current=window.setTimeout(()=>d(!1),i)}catch(N){r?.(N)}};S.useEffect(()=>{let C=A=>{let _=A.composedPath();m.current&&!_.includes(m.current)&&c(!1)};return document.addEventListener("mousedown",C),()=>{document.removeEventListener("mousedown",C),window.clearTimeout(p.current)}},[]);let w=ds(),k=f?w.CheckIcon:w.CopyIcon;return g.jsxs("div",{className:o("relative"),ref:m,children:[g.jsx("button",{className:o("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:b,onClick:()=>c(!l),title:y.copyTable,type:"button",children:e??g.jsx(k,{height:14,width:14})}),l?g.jsxs("div",{className:o("absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[g.jsx("button",{className:o("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>E("md"),title:y.copyTableAsMarkdown,type:"button",children:y.tableFormatMarkdown}),g.jsx("button",{className:o("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>E("csv"),title:y.copyTableAsCsv,type:"button",children:y.tableFormatCsv}),g.jsx("button",{className:o("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>E("tsv"),title:y.copyTableAsTsv,type:"button",children:y.tableFormatTsv})]}):null]})},UN=({children:e,className:t,onDownload:n,onError:r})=>{let i=St(),[o,l]=S.useState(!1),c=S.useRef(null),{isAnimating:f}=S.useContext(Hr),d=pi(),m=ds(),p=b=>{var y;try{let E=(y=c.current)==null?void 0:y.closest('[data-streamdown="table-wrapper"]'),w=E?.querySelector("table");if(!w){r?.(new Error("Table not found"));return}let k=jN(w),C=b==="csv"?BN(k):Lb(k);cl(`table.${b==="csv"?"csv":"md"}`,C,b==="csv"?"text/csv":"text/markdown"),l(!1),n?.(b)}catch(E){r?.(E)}};return S.useEffect(()=>{let b=y=>{let E=y.composedPath();c.current&&!E.includes(c.current)&&l(!1)};return document.addEventListener("mousedown",b),()=>{document.removeEventListener("mousedown",b)}},[]),g.jsxs("div",{className:i("relative"),ref:c,children:[g.jsx("button",{className:i("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:f,onClick:()=>l(!o),title:d.downloadTable,type:"button",children:e??g.jsx(m.DownloadIcon,{size:14})}),o?g.jsxs("div",{className:i("absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[g.jsx("button",{className:i("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>p("csv"),title:d.downloadTableAsCsv,type:"button",children:d.tableFormatCsv}),g.jsx("button",{className:i("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>p("markdown"),title:d.downloadTableAsMarkdown,type:"button",children:d.tableFormatMarkdown})]}):null]})},fW=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:i,XIcon:o}=ds(),l=St(),[c,f]=S.useState(!1),{isAnimating:d}=S.useContext(Hr),m=pi(),p=()=>{f(!0)},b=()=>{f(!1)};return S.useEffect(()=>{if(c){cx();let y=E=>{E.key==="Escape"&&f(!1)};return document.addEventListener("keydown",y),()=>{document.removeEventListener("keydown",y),fx()}}},[c]),g.jsxs(g.Fragment,{children:[g.jsx("button",{className:l("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:d,onClick:p,title:m.viewFullscreen,type:"button",children:g.jsx(i,{size:14})}),c?cs.createPortal(g.jsx("div",{"aria-label":m.viewFullscreen,"aria-modal":"true",className:l("fixed inset-0 z-50 flex flex-col bg-background"),"data-streamdown":"table-fullscreen",onClick:b,onKeyDown:y=>{y.key==="Escape"&&b()},role:"dialog",children:g.jsxs("div",{className:l("flex h-full flex-col"),onClick:y=>y.stopPropagation(),onKeyDown:y=>y.stopPropagation(),role:"presentation",children:[g.jsxs("div",{className:l("flex items-center justify-end gap-1 p-4"),children:[n?g.jsx(HN,{}):null,r?g.jsx(UN,{}):null,g.jsx("button",{className:l("rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:b,title:m.exitFullscreen,type:"button",children:g.jsx(o,{size:20})})]}),g.jsx("div",{className:l("flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10"),children:g.jsx("table",{className:l("w-full border-collapse border border-border"),"data-streamdown":"table",children:e})})]})}),document.body):null]})},dW=({children:e,className:t,showControls:n,showCopy:r=!0,showDownload:i=!0,showFullscreen:o=!0,...l})=>{let c=St(),f=n&&r,d=n&&i,m=n&&o,p=f||d||m;return g.jsxs("div",{className:c("my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2"),"data-streamdown":"table-wrapper",children:[p?g.jsxs("div",{className:c("flex items-center justify-end gap-1"),children:[f?g.jsx(HN,{}):null,d?g.jsx(UN,{}):null,m?g.jsx(fW,{showCopy:f,showDownload:d,children:e}):null]}):null,g.jsx("div",{className:c("border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background"),children:g.jsx("table",{className:c("w-full divide-y divide-border",t),"data-streamdown":"table",...l,children:e})})]})},hW=/startLine=(\d+)/,pW=/\bnoLineNumbers\b/,mW=S.lazy(()=>bc(()=>Promise.resolve().then(()=>QZ),void 0).then(e=>({default:e.Mermaid}))),gW=/language-([^\s]+)/;function gp(e,t){if(!(e!=null&&e.position||t!=null&&t.position))return!0;if(!(e!=null&&e.position&&t!=null&&t.position))return!1;let n=e.position.start,r=t.position.start,i=e.position.end,o=t.position.end;return n?.line===r?.line&&n?.column===r?.column&&i?.line===o?.line&&i?.column===o?.column}function yn(e,t){return e.className===t.className&&gp(e.node,t.node)}var Mb=(e,t)=>typeof e=="boolean"?e:e[t]!==!1,Mg=(e,t)=>{if(typeof e=="boolean")return e;let n=e.table;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},BC=(e,t)=>{if(typeof e=="boolean")return e;let n=e.code;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},Nd=(e,t)=>{if(typeof e=="boolean")return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},px=S.memo(({children:e,className:t,node:n,...r})=>{let i=St();return g.jsx("ol",{className:i("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...r,children:e})},(e,t)=>yn(e,t));px.displayName="MarkdownOl";var zN=S.memo(({children:e,className:t,node:n,...r})=>{let i=St();return g.jsx("li",{className:i("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...r,children:e})},(e,t)=>e.className===t.className&&gp(e.node,t.node));zN.displayName="MarkdownLi";var FN=S.memo(({children:e,className:t,node:n,...r})=>{let i=St();return g.jsx("ul",{className:i("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...r,children:e})},(e,t)=>yn(e,t));FN.displayName="MarkdownUl";var VN=S.memo(({className:e,node:t,...n})=>{let r=St();return g.jsx("hr",{className:r("my-6 border-border",e),"data-streamdown":"horizontal-rule",...n})},(e,t)=>yn(e,t));VN.displayName="MarkdownHr";var $N=S.memo(({children:e,className:t,node:n,...r})=>{let i=St();return g.jsx("span",{className:i("font-semibold",t),"data-streamdown":"strong",...r,children:e})},(e,t)=>yn(e,t));$N.displayName="MarkdownStrong";var bW=({children:e,className:t,href:n,node:r,...i})=>{let o=St(),{linkSafety:l}=S.useContext(Hr),[c,f]=S.useState(!1),d=n==="streamdown:incomplete-link",m=S.useCallback(async E=>{if(!(!(l!=null&&l.enabled&&n)||d)){if(E.preventDefault(),l.onLinkCheck&&await l.onLinkCheck(n)){window.open(n,"_blank","noreferrer");return}f(!0)}},[l,n,d]),p=S.useCallback(()=>{n&&window.open(n,"_blank","noreferrer")},[n]),b=S.useCallback(()=>{f(!1)},[]),y={url:n??"",isOpen:c,onClose:b,onConfirm:p};return l!=null&&l.enabled&&n?g.jsxs(g.Fragment,{children:[g.jsx("button",{className:o("wrap-anywhere appearance-none text-left font-medium text-primary underline",t),"data-incomplete":d,"data-streamdown":"link",onClick:m,type:"button",children:e}),l.renderModal?l.renderModal(y):g.jsx(iW,{...y})]}):g.jsx("a",{className:o("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":d,"data-streamdown":"link",href:n,rel:"noreferrer",target:"_blank",...i,children:e})},qN=S.memo(bW,(e,t)=>yn(e,t)&&e.href===t.href);qN.displayName="MarkdownA";var YN=S.memo(({children:e,className:t,node:n,...r})=>{let i=St();return g.jsx("h1",{className:i("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...r,children:e})},(e,t)=>yn(e,t));YN.displayName="MarkdownH1";var GN=S.memo(({children:e,className:t,node:n,...r})=>{let i=St();return g.jsx("h2",{className:i("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...r,children:e})},(e,t)=>yn(e,t));GN.displayName="MarkdownH2";var XN=S.memo(({children:e,className:t,node:n,...r})=>{let i=St();return g.jsx("h3",{className:i("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...r,children:e})},(e,t)=>yn(e,t));XN.displayName="MarkdownH3";var KN=S.memo(({children:e,className:t,node:n,...r})=>{let i=St();return g.jsx("h4",{className:i("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...r,children:e})},(e,t)=>yn(e,t));KN.displayName="MarkdownH4";var QN=S.memo(({children:e,className:t,node:n,...r})=>{let i=St();return g.jsx("h5",{className:i("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...r,children:e})},(e,t)=>yn(e,t));QN.displayName="MarkdownH5";var WN=S.memo(({children:e,className:t,node:n,...r})=>{let i=St();return g.jsx("h6",{className:i("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...r,children:e})},(e,t)=>yn(e,t));WN.displayName="MarkdownH6";var ZN=S.memo(({children:e,className:t,node:n,...r})=>{let{controls:i}=S.useContext(Hr),o=Mb(i,"table"),l=Mg(i,"copy"),c=Mg(i,"download"),f=Mg(i,"fullscreen");return g.jsx(dW,{className:t,showControls:o,showCopy:l,showDownload:c,showFullscreen:f,...r,children:e})},(e,t)=>yn(e,t));ZN.displayName="MarkdownTable";var JN=S.memo(({children:e,className:t,node:n,...r})=>{let i=St();return g.jsx("thead",{className:i("bg-muted/80",t),"data-streamdown":"table-header",...r,children:e})},(e,t)=>yn(e,t));JN.displayName="MarkdownThead";var eR=S.memo(({children:e,className:t,node:n,...r})=>{let i=St();return g.jsx("tbody",{className:i("divide-y divide-border",t),"data-streamdown":"table-body",...r,children:e})},(e,t)=>yn(e,t));eR.displayName="MarkdownTbody";var tR=S.memo(({children:e,className:t,node:n,...r})=>{let i=St();return g.jsx("tr",{className:i("border-border",t),"data-streamdown":"table-row",...r,children:e})},(e,t)=>yn(e,t));tR.displayName="MarkdownTr";var nR=S.memo(({children:e,className:t,node:n,...r})=>{let i=St();return g.jsx("th",{className:i("whitespace-nowrap px-4 py-2 text-left font-semibold text-sm",t),"data-streamdown":"table-header-cell",...r,children:e})},(e,t)=>yn(e,t));nR.displayName="MarkdownTh";var rR=S.memo(({children:e,className:t,node:n,...r})=>{let i=St();return g.jsx("td",{className:i("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...r,children:e})},(e,t)=>yn(e,t));rR.displayName="MarkdownTd";var sR=S.memo(({children:e,className:t,node:n,...r})=>{let i=St();return g.jsx("blockquote",{className:i("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),"data-streamdown":"blockquote",...r,children:e})},(e,t)=>yn(e,t));sR.displayName="MarkdownBlockquote";var iR=S.memo(({children:e,className:t,node:n,...r})=>{let i=St();return g.jsx("sup",{className:i("text-sm",t),"data-streamdown":"superscript",...r,children:e})},(e,t)=>yn(e,t));iR.displayName="MarkdownSup";var aR=S.memo(({children:e,className:t,node:n,...r})=>{let i=St();return g.jsx("sub",{className:i("text-sm",t),"data-streamdown":"subscript",...r,children:e})},(e,t)=>yn(e,t));aR.displayName="MarkdownSub";var oR=S.memo(({children:e,className:t,node:n,...r})=>{if("data-footnotes"in r){let i=l=>{var c,f;if(!S.isValidElement(l))return!1;let d=Array.isArray(l.props.children)?l.props.children:[l.props.children],m=!1,p=!1;for(let b of d)if(b){if(typeof b=="string")b.trim()!==""&&(m=!0);else if(S.isValidElement(b))if(((c=b.props)==null?void 0:c["data-footnote-backref"])!==void 0)p=!0;else{let y=Array.isArray(b.props.children)?b.props.children:[b.props.children];for(let E of y){if(typeof E=="string"&&E.trim()!==""){m=!0;break}if(S.isValidElement(E)&&((f=E.props)==null?void 0:f["data-footnote-backref"])===void 0){m=!0;break}}}}return p&&!m},o=Array.isArray(e)?e.map(l=>{if(!S.isValidElement(l))return l;if(l.type===px){let c=(Array.isArray(l.props.children)?l.props.children:[l.props.children]).filter(f=>!i(f));return c.length===0?null:{...l,props:{...l.props,children:c}}}return l}):e;return(Array.isArray(o)?o.some(l=>l!==null):o!==null)?g.jsx("section",{className:t,...r,children:o}):null}return g.jsx("section",{className:t,...r,children:e})},(e,t)=>yn(e,t));oR.displayName="MarkdownSection";var xW=({node:e,className:t,children:n,...r})=>{var i,o;let l=St(),c=!("data-block"in r),{mermaid:f,controls:d,lineNumbers:m}=S.useContext(Hr),p=hx(),b=MQ(),y=t?.match(gW),E=(i=y?.at(1))!=null?i:"",w=aW(E);if(c)return g.jsx("code",{className:l("rounded bg-muted px-1.5 py-0.5 font-mono text-sm",t),"data-streamdown":"inline-code",...r,children:n});let k=(o=e?.properties)==null?void 0:o.metastring,C=k?.match(hW),A=C?Number.parseInt(C[1],10):void 0,_=A!==void 0&&A>=1?A:void 0,N=!(k&&pW.test(k))&&m!==!1,D="";if(S.isValidElement(n)&&n.props&&typeof n.props=="object"&&"children"in n.props&&typeof n.props.children=="string"?D=n.props.children:typeof n=="string"&&(D=n),w){let q=w.component;return g.jsx(S.Suspense,{fallback:g.jsx(jC,{}),children:g.jsx(q,{code:D,isIncomplete:b,language:E,meta:k})})}if(E==="mermaid"&&p){let q=Mb(d,"mermaid"),U=Nd(d,"download"),Q=Nd(d,"copy"),Z=Nd(d,"fullscreen"),G=Nd(d,"panZoom"),ee=q&&(U||Q||Z);return g.jsx(S.Suspense,{fallback:g.jsx(jC,{}),children:g.jsxs("div",{className:l("group relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2",t),"data-streamdown":"mermaid-block",children:[g.jsx("div",{className:l("flex h-8 items-center text-muted-foreground text-xs"),children:g.jsx("span",{className:l("ml-1 font-mono lowercase"),children:"mermaid"})}),ee?g.jsx("div",{className:l("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"),children:g.jsxs("div",{className:l("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"),"data-streamdown":"mermaid-block-actions",children:[U?g.jsx(lW,{chart:D,config:f?.config}):null,Q?g.jsx(DC,{code:D}):null,Z?g.jsx(uW,{chart:D,config:f?.config}):null]})}):null,g.jsx("div",{className:l("rounded-md border border-border bg-background"),children:g.jsx(mW,{chart:D,config:f?.config,showControls:G})})]})})}let O=Mb(d,"code"),j=BC(d,"download"),M=BC(d,"copy");return g.jsx($Q,{className:t,code:D,isIncomplete:b,language:E,lineNumbers:N,startLine:_,children:O?g.jsxs(g.Fragment,{children:[j?g.jsx(nW,{code:D,language:E}):null,M?g.jsx(DC,{}):null]}):null})},lR=S.memo(xW,(e,t)=>e.className===t.className&&gp(e.node,t.node));lR.displayName="MarkdownCode";var uR=S.memo(sW,(e,t)=>e.className===t.className&&gp(e.node,t.node));uR.displayName="MarkdownImg";var cR=S.memo(({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter(i=>i!=null&&i!=="");if(r.length===1&&S.isValidElement(r[0])){let i=r[0].props.node,o=i?.tagName;if(o==="img")return g.jsx(g.Fragment,{children:e});if(o==="code"&&"data-block"in r[0].props)return g.jsx(g.Fragment,{children:e})}return g.jsx("p",{...n,children:e})},(e,t)=>yn(e,t));cR.displayName="MarkdownParagraph";var yW={ol:px,li:zN,ul:FN,hr:VN,strong:$N,a:qN,h1:YN,h2:GN,h3:XN,h4:KN,h5:QN,h6:WN,table:ZN,thead:JN,tbody:eR,tr:tR,th:nR,td:rR,blockquote:sR,code:lR,img:uR,pre:({children:e})=>S.isValidElement(e)?S.cloneElement(e,{"data-block":"true"}):e,sup:iR,sub:aR,p:cR,section:oR},EW=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,TW=/\p{L}/u;function HC(e){let t=e.replace(/^#{1,6}\s+/gm,"").replace(/(\*{1,3}|_{1,3})/g,"").replace(/`[^`]*`/g,"").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/^[\s>*\-+\d.]+/gm,"");for(let n of t){if(EW.test(n))return"rtl";if(TW.test(n))return"ltr"}return"ltr"}var vW=/^[ \t]{0,3}(`{3,}|~{3,})/,SW=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,UC=e=>{let t=e.split(`
|
|
469
|
-
`),n=null,r=0;for(let i of t){let o=vW.exec(i);if(n===null){if(o){let l=o[1];n=l[0],r=l.length}}else if(o){let l=o[1],c=l[0],f=l.length;c===n&&f>=r&&(n=null,r=0)}}return n!==null},CW=e=>{let t=e.split(`
|
|
470
|
-
`);for(let n of t){let r=n.trim();if(r.length>0&&r.includes("|")&&SW.test(r))return!0}return!1},wW=()=>e=>{Is(e,"html",(t,n,r)=>{!r||typeof n!="number"||(r.children[n]={type:"text",value:t.value})})},zC=[],FC={allowDangerousHtml:!0},Rd=new WeakMap,kW=class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let n=e.rehypePlugins,r=e.remarkPlugins,i=e.remarkRehypeOptions;if(!(n||r||i)){let m="default";return this.keyCache.set(e,m),m}let o=m=>{if(!m||m.length===0)return"";let p="";for(let b=0;b<m.length;b+=1){let y=m[b];if(b>0&&(p+=","),Array.isArray(y)){let[E,w]=y;if(typeof E=="function"){let k=Rd.get(E);k||(k=E.name,Rd.set(E,k)),p+=k}else p+=String(E);p+=":",p+=JSON.stringify(w)}else if(typeof y=="function"){let E=Rd.get(y);E||(E=y.name,Rd.set(y,E)),p+=E}else p+=String(y)}return p},l=o(n),c=o(r),f=i?JSON.stringify(i):"",d=`${c}::${l}::${f}`;return this.keyCache.set(e,d),d}get(e){let t=this.generateCacheKey(e),n=this.cache.get(t);return n&&(this.cache.delete(t),this.cache.set(t,n)),n}set(e,t){let n=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let r=this.cache.keys().next().value;r&&this.cache.delete(r)}this.cache.set(n,t)}clear(){this.cache.clear()}},VC=new kW,fR=e=>{let t=AW(e),n=e.children||"",r=t.runSync(t.parse(n),n);return MW(r,e)},AW=e=>{let t=VC.get(e);if(t)return t;let n=NW(e);return VC.set(e,n),n},_W=e=>e.some(t=>Array.isArray(t)?t[0]===xb:t===xb),NW=e=>{let t=e.rehypePlugins||zC,n=e.remarkPlugins||zC,r=_W(t)?n:[...n,wW],i=e.remarkRehypeOptions?{...FC,...e.remarkRehypeOptions}:FC;return RK().use(NX).use(r).use(fK,i).use(t)},RW=e=>e,OW=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:"text",value:r}},IW=(e,t)=>{var n;for(let r in Cg)if(Object.hasOwn(Cg,r)&&Object.hasOwn(e.properties,r)){let i=e.properties[r],o=Cg[r];(o===null||o.includes(e.tagName))&&(e.properties[r]=(n=t(String(i||""),r,e))!=null?n:void 0)}},LW=(e,t,n,r,i,o)=>{let l=!1;return r?l=!r.includes(e.tagName):i&&(l=i.includes(e.tagName)),!l&&o&&typeof t=="number"&&(l=!o(e,t,n)),l},MW=(e,t)=>{let{allowElement:n,allowedElements:r,disallowedElements:i,skipHtml:o,unwrapDisallowed:l,urlTransform:c}=t;if(n||r||i||o||c){let f=c||RW;Is(e,(d,m,p)=>{if(d.type==="raw"&&p&&typeof m=="number")return OW(p,m,o,d.value),m;if(d.type==="element"&&(IW(d,f),LW(d,m,p,r,i,n)&&p&&typeof m=="number"))return l&&d.children?p.children.splice(m,1,...d.children):p.children.splice(m,1),m})}return jG(e,{Fragment:g.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:g.jsx,jsxs:g.jsxs,passKeys:!0,passNode:!0})},DW=/\[\^[\w-]{1,200}\](?!:)/,PW=/\[\^[\w-]{1,200}\]:/,jW=/<(\w+)[\s>]/,BW=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),$C=new Map,qC=new Map,HW=e=>{let t=e.toLowerCase(),n=$C.get(t);if(n)return n;let r=new RegExp(`<${t}(?=[\\s>/])[^>]*>`,"gi");return $C.set(t,r),r},UW=e=>{let t=e.toLowerCase(),n=qC.get(t);if(n)return n;let r=new RegExp(`</${t}(?=[\\s>])[^>]*>`,"gi");return qC.set(t,r),r},YC=(e,t)=>{if(BW.has(t.toLowerCase()))return 0;let n=e.match(HW(t));if(!n)return 0;let r=0;for(let i of n)i.trimEnd().endsWith("/>")||(r+=1);return r},GC=(e,t)=>{let n=e.match(UW(t));return n?n.length:0},zW=e=>{let t=0;for(let n=0;n<e.length-1;n+=1)e[n]==="$"&&e[n+1]==="$"&&(t+=1,n+=1);return t},FW=e=>{let t=DW.test(e),n=PW.test(e);if(t||n)return[e];let r=Jr.lex(e,{gfm:!0}),i=[],o=[],l=!1;for(let c of r){let f=c.raw,d=i.length;if(o.length>0){i[d-1]+=f;let m=o.at(-1),p=YC(f,m),b=GC(f,m);for(let y=0;y<p;y+=1)o.push(m);for(let y=0;y<b;y+=1)o.length>0&&o.at(-1)===m&&o.pop();continue}if(c.type==="html"&&c.block){let m=f.match(jW);if(m){let p=m[1],b=YC(f,p),y=GC(f,p);b>y&&o.push(p)}}if(d>0&&!l){let m=i[d-1];if(zW(m)%2===1){i[d-1]=m+f;continue}}i.push(f),c.type!=="space"&&(l=c.type==="code")}return i},VW=(e,t)=>{if(!t.length)return e;let n=e;for(let r of t){let i=new RegExp(`(<${r}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${r}\\s*>)`,"gi");n=n.replace(i,(o,l,c,f)=>{if(!c.includes(`
|
|
471
|
-
|
|
472
|
-
`))return l+c+f;let d=c.replace(/\n\n/g,`
|
|
473
|
-
<!---->
|
|
474
|
-
`),m=(d.startsWith(`
|
|
475
|
-
`)?"":`
|
|
476
|
-
`)+d+(d.endsWith(`
|
|
477
|
-
`)?"":`
|
|
478
|
-
`);return`${l}${m}${f}
|
|
479
|
-
|
|
480
|
-
`})}return n},$W=/([\\`*_~[\]|])/g,qW=e=>e.replace($W,"\\$1"),YW=(e,t)=>{if(!t.length)return e;let n=e;for(let r of t){let i=new RegExp(`(<${r}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${r}\\s*>)`,"gi");n=n.replace(i,(o,l,c,f)=>{let d=qW(c).replace(/\n\n/g," ");return l+d+f})}return n},dR=e=>e.type==="text"?e.value:"children"in e&&Array.isArray(e.children)?e.children.map(dR).join(""):"",GW=e=>t=>{if(!e||e.length===0)return;let n=new Set(e.map(r=>r.toLowerCase()));Is(t,"element",r=>{if(n.has(r.tagName.toLowerCase())){let i=dR(r);r.children=i?[{type:"text",value:i}]:[]}})},XW=()=>e=>{Is(e,"code",t=>{var n,r;t.meta&&(t.data=(n=t.data)!=null?n:{},t.data.hProperties={...(r=t.data.hProperties)!=null?r:{},metastring:t.meta})})},KW=/^[ \t]*<[\w!/?-]/,QW=/(^|\n)[ \t]{4,}(?=<[\w!/?-])/g,WW=e=>typeof e!="string"||e.length===0||!KW.test(e)?e:e.replace(QW,"$1"),XC,KC,QC,WC,Gd={...Ha,protocols:{...Ha.protocols,href:[...(KC=(XC=Ha.protocols)==null?void 0:XC.href)!=null?KC:[],"tel"]},attributes:{...Ha.attributes,code:[...(WC=(QC=Ha.attributes)==null?void 0:QC.code)!=null?WC:[],"metastring"]}},Db={raw:xb,sanitize:[v_,Gd],harden:[YB,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},ZW={gfm:[cY,{}],codeMeta:XW},ZC=Object.values(Db),JW=Object.values(ZW),eZ={block:" ▋",circle:" ●"},hR=["github-light","github-dark"],pR={enabled:!0},tZ={shikiTheme:hR,controls:!0,isAnimating:!1,lineNumbers:!0,mode:"streaming",mermaid:void 0,linkSafety:pR},Hr=S.createContext(tZ),mR=S.memo(({content:e,shouldParseIncompleteMarkdown:t,shouldNormalizeHtmlIndentation:n,index:r,isIncomplete:i,dir:o,animatePlugin:l,...c})=>{if(l){let m=l.getLastRenderCharCount();l.setPrevContentLength(m)}let f=typeof e=="string"&&n?WW(e):e,d=g.jsx(fR,{...c,children:f});return g.jsx(IN.Provider,{value:i,children:o?g.jsx("div",{dir:o,style:{display:"contents"},children:d}):d})},(e,t)=>{if(e.content!==t.content||e.shouldNormalizeHtmlIndentation!==t.shouldNormalizeHtmlIndentation||e.index!==t.index||e.isIncomplete!==t.isIncomplete||e.dir!==t.dir)return!1;if(e.components!==t.components){let n=Object.keys(e.components||{}),r=Object.keys(t.components||{});if(n.length!==r.length||n.some(i=>{var o,l;return((o=e.components)==null?void 0:o[i])!==((l=t.components)==null?void 0:l[i])}))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins)});mR.displayName="Block";var gR=S.memo(({children:e,mode:t="streaming",dir:n,parseIncompleteMarkdown:r=!0,normalizeHtmlIndentation:i=!1,components:o,rehypePlugins:l=ZC,remarkPlugins:c=JW,className:f,shikiTheme:d=hR,mermaid:m,controls:p=!0,isAnimating:b=!1,animated:y,BlockComponent:E=mR,parseMarkdownIntoBlocksFn:w=FW,caret:k,plugins:C,remend:A,linkSafety:_=pR,lineNumbers:N=!0,allowedTags:D,literalTagContent:O,translations:j,icons:M,prefix:q,onAnimationStart:U,onAnimationEnd:Q,...Z})=>{let G=S.useId(),[ee,Y]=S.useTransition(),H=S.useMemo(()=>PQ(q),[q]),K=S.useRef(null),te=S.useRef(U),le=S.useRef(Q);te.current=U,le.current=Q,S.useEffect(()=>{var Ce,we,Be;if(t==="static")return;let $e=K.current;if(K.current=b,$e===null){b&&((Ce=te.current)==null||Ce.call(te));return}b&&!$e?(we=te.current)==null||we.call(te):!b&&$e&&((Be=le.current)==null||Be.call(le))},[b,t]);let I=S.useMemo(()=>D?Object.keys(D):[],[D]),P=S.useMemo(()=>{if(typeof e!="string")return"";let Ce=t==="streaming"&&r?TG(e,A):e;return O&&O.length>0&&(Ce=YW(Ce,O)),I.length>0&&(Ce=VW(Ce,I)),Ce},[e,t,r,A,I,O]),$=S.useMemo(()=>w(P),[P,w]),[L,ae]=S.useState($);S.useEffect(()=>{t==="streaming"&&!ve?Y(()=>{ae($)}):ae($)},[$,t]);let ie=t==="streaming"?L:$,fe=S.useMemo(()=>n==="auto"?ie.map(HC):void 0,[ie,n]),de=S.useMemo(()=>ie.map((Ce,we)=>`${G}-${we}`),[ie.length,G]),he=S.useMemo(()=>y===!0?"true":y?JSON.stringify(y):"",[y]),ve=S.useMemo(()=>he?he==="true"?Nb():Nb(y):null,[he]),Ue=S.useMemo(()=>{var Ce,we;return{shikiTheme:(we=(Ce=C?.code)==null?void 0:Ce.getThemes())!=null?we:d,controls:p,isAnimating:b,lineNumbers:N,mode:t,mermaid:m,linkSafety:_}},[d,p,b,N,t,m,_,C?.code]),Pe=S.useMemo(()=>j?JSON.stringify(j):"",[j]),Te=S.useMemo(()=>({...PN,...j}),[Pe]),Ie=S.useMemo(()=>{let{inlineCode:Ce,...we}=o??{},Be={...yW,...we};if(Ce){let $e=Be.code;Be.code=W=>"data-block"in W?$e?S.createElement($e,W):null:S.createElement(Ce,W)}return Be},[o]),je=S.useMemo(()=>{let Ce=[];return C!=null&&C.cjk&&(Ce=[...Ce,...C.cjk.remarkPluginsBefore]),Ce=[...Ce,...c],C!=null&&C.cjk&&(Ce=[...Ce,...C.cjk.remarkPluginsAfter]),C!=null&&C.math&&(Ce=[...Ce,C.math.remarkPlugin]),Ce},[c,C?.math,C?.cjk]),We=S.useMemo(()=>{var Ce;let we=l;if(D&&Object.keys(D).length>0&&l===ZC){let Be={...Gd,tagNames:[...(Ce=Gd.tagNames)!=null?Ce:[],...Object.keys(D)],attributes:{...Gd.attributes,...D}};we=[Db.raw,[v_,Be],Db.harden]}return O&&O.length>0&&(we=[...we,[GW,O]]),C!=null&&C.math&&(we=[...we,C.math.rehypePlugin]),ve&&b&&(we=[...we,ve.rehypePlugin]),we},[l,C?.math,ve,b,D,O]),Xe=S.useMemo(()=>{if(!b||ie.length===0)return!1;let Ce=ie.at(-1);return UC(Ce)||CW(Ce)},[b,ie]),Me=S.useMemo(()=>k&&b&&!Xe?{"--streamdown-caret":`"${eZ[k]}"`}:void 0,[k,b,Xe]);return t==="static"?g.jsx(Ob.Provider,{value:Te,children:g.jsx(Ib.Provider,{value:C??null,children:g.jsx(Hr.Provider,{value:Ue,children:g.jsx(MC,{icons:M,children:g.jsx(Rb.Provider,{value:H,children:g.jsx("div",{className:H("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",f),dir:n==="auto"?HC(P):n,children:g.jsx(fR,{components:Ie,rehypePlugins:We,remarkPlugins:je,...Z,children:P})})})})})})}):g.jsx(Ob.Provider,{value:Te,children:g.jsx(Ib.Provider,{value:C??null,children:g.jsx(Hr.Provider,{value:Ue,children:g.jsx(MC,{icons:M,children:g.jsx(Rb.Provider,{value:H,children:g.jsxs("div",{className:H("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",k&&!Xe?"[&>*:last-child]:after:inline [&>*:last-child]:after:align-baseline [&>*:last-child]:after:content-[var(--streamdown-caret)]":null,f),style:Me,children:[ie.length===0&&k&&b&&g.jsx("span",{}),ie.map((Ce,we)=>{var Be;let $e=we===ie.length-1,W=b&&$e&&UC(Ce);return g.jsx(E,{animatePlugin:ve,components:Ie,content:Ce,dir:(Be=fe?.[we])!=null?Be:n!=="auto"?n:void 0,index:we,isIncomplete:W,rehypePlugins:We,remarkPlugins:je,shouldNormalizeHtmlIndentation:i,shouldParseIncompleteMarkdown:r,...Z},de[we])})]})})})})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.animated===t.animated&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety&&e.lineNumbers===t.lineNumbers&&e.normalizeHtmlIndentation===t.normalizeHtmlIndentation&&e.literalTagContent===t.literalTagContent&&JSON.stringify(e.translations)===JSON.stringify(t.translations)&&e.prefix===t.prefix&&e.dir===t.dir);gR.displayName="Streamdown";var nZ=({children:e,className:t,minZoom:n=.5,maxZoom:r=3,zoomStep:i=.1,showControls:o=!0,initialZoom:l=1,fullscreen:c=!1})=>{let{RotateCcwIcon:f,ZoomInIcon:d,ZoomOutIcon:m}=ds(),p=St(),b=S.useRef(null),y=S.useRef(null),[E,w]=S.useState(l),[k,C]=S.useState({x:0,y:0}),[A,_]=S.useState(!1),[N,D]=S.useState({x:0,y:0}),[O,j]=S.useState({x:0,y:0}),M=S.useCallback(H=>{w(K=>Math.max(n,Math.min(r,K+H)))},[n,r]),q=S.useCallback(()=>{M(i)},[M,i]),U=S.useCallback(()=>{M(-i)},[M,i]),Q=S.useCallback(()=>{w(l),C({x:0,y:0})},[l]),Z=S.useCallback(H=>{H.preventDefault();let K=H.deltaY>0?-i:i;M(K)},[M,i]),G=S.useCallback(H=>{if(H.button!==0||H.isPrimary===!1)return;_(!0),D({x:H.clientX,y:H.clientY}),j(k);let K=H.currentTarget;K instanceof HTMLElement&&K.setPointerCapture(H.pointerId)},[k]),ee=S.useCallback(H=>{if(!A)return;H.preventDefault();let K=H.clientX-N.x,te=H.clientY-N.y;C({x:O.x+K,y:O.y+te})},[A,N,O]),Y=S.useCallback(H=>{_(!1);let K=H.currentTarget;K instanceof HTMLElement&&K.releasePointerCapture(H.pointerId)},[]);return S.useEffect(()=>{let H=b.current;if(H)return H.addEventListener("wheel",Z,{passive:!1}),()=>{H.removeEventListener("wheel",Z)}},[Z]),S.useEffect(()=>{let H=y.current;if(H&&A)return document.body.style.userSelect="none",H.addEventListener("pointermove",ee,{passive:!1}),H.addEventListener("pointerup",Y),H.addEventListener("pointercancel",Y),()=>{document.body.style.userSelect="",H.removeEventListener("pointermove",ee),H.removeEventListener("pointerup",Y),H.removeEventListener("pointercancel",Y)}},[A,ee,Y]),g.jsxs("div",{className:p("relative flex flex-col",c?"h-full w-full":"min-h-28 w-full",t),ref:b,style:{cursor:A?"grabbing":"grab"},children:[o?g.jsxs("div",{className:p("absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/80 p-1 supports-[backdrop-filter]:bg-background/70 supports-[backdrop-filter]:backdrop-blur-sm",c?"bottom-4 left-4":"bottom-2 left-2"),children:[g.jsx("button",{className:p("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50"),disabled:E>=r,onClick:q,title:"Zoom in",type:"button",children:g.jsx(d,{size:16})}),g.jsx("button",{className:p("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50"),disabled:E<=n,onClick:U,title:"Zoom out",type:"button",children:g.jsx(m,{size:16})}),g.jsx("button",{className:p("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground"),onClick:Q,title:"Reset zoom and pan",type:"button",children:g.jsx(f,{size:16})})]}):null,g.jsx("div",{className:p("flex-1 origin-center transition-transform duration-150 ease-out",c?"flex h-full w-full items-center justify-center":"flex w-full items-center justify-center"),onPointerDown:G,ref:y,role:"application",style:{transform:`translate(${k.x}px, ${k.y}px) scale(${E})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},bR=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:i=!0})=>{let o=St(),[l,c]=S.useState(null),[f,d]=S.useState(!1),[m,p]=S.useState(""),[b,y]=S.useState(""),[E,w]=S.useState(0),{mermaid:k}=S.useContext(Hr),C=hx(),A=k?.errorComponent,{shouldRender:_,containerRef:N}=CQ({immediate:r});if(S.useEffect(()=>{if(_){if(!C){c("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}(async()=>{try{c(null),d(!0);let O=C.getMermaid(n),j=e.split("").reduce((U,Q)=>(U<<5)-U+Q.charCodeAt(0)|0,0),M=`mermaid-${Math.abs(j)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:q}=await O.render(M,e);p(q),y(q)}catch(O){if(!(b||m)){let j=O instanceof Error?O.message:"Failed to render Mermaid chart";c(j)}}finally{d(!1)}})()}},[e,n,E,_,C]),!(_||m||b))return g.jsx("div",{className:o("my-4 min-h-[200px]",t),ref:N});if(f&&!m&&!b)return g.jsx("div",{className:o("my-4 flex justify-center p-4",t),ref:N,children:g.jsxs("div",{className:o("flex items-center space-x-2 text-muted-foreground"),children:[g.jsx("div",{className:o("h-4 w-4 animate-spin rounded-full border-current border-b-2")}),g.jsx("span",{className:o("text-sm"),children:"Loading diagram..."})]})});if(l&&!m&&!b){let O=()=>w(j=>j+1);return A?g.jsx("div",{ref:N,children:g.jsx(A,{chart:e,error:l,retry:O})}):g.jsxs("div",{className:o("rounded-md bg-red-50 p-4",t),ref:N,children:[g.jsxs("p",{className:o("font-mono text-red-700 text-sm"),children:["Mermaid Error: ",l]}),g.jsxs("details",{className:o("mt-2"),children:[g.jsx("summary",{className:o("cursor-pointer text-red-600 text-xs"),children:"Show Code"}),g.jsx("pre",{className:o("mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs"),children:e})]})]})}let D=m||b;return g.jsx("div",{className:o("size-full",t),"data-streamdown":"mermaid",ref:N,children:g.jsx(nZ,{className:o(r?"size-full overflow-hidden":"overflow-hidden",t),fullscreen:r,maxZoom:3,minZoom:.5,showControls:i,zoomStep:.1,children:g.jsx("div",{"aria-label":"Mermaid chart",className:o("flex justify-center",r?"size-full items-center":null),dangerouslySetInnerHTML:{__html:D},role:"img"})})})};const xR=S.memo(function({children:t,streaming:n,className:r}){return g.jsx(gR,{mode:n?"streaming":"static",parseIncompleteMarkdown:n,shikiTheme:["github-light","github-dark"],className:He("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",r),children:t})},(e,t)=>e.children===t.children&&e.streaming===t.streaming&&e.className===t.className);function rZ({children:e,isStreaming:t=!1,defaultOpen:n,className:r}){const[i,o]=S.useState(n??t),l=S.useRef(!1);S.useEffect(()=>{if(!l.current)if(t)o(!0);else{const f=setTimeout(()=>o(!1),600);return()=>clearTimeout(f)}},[t]);const c=e.trim()!=="";return!c&&!t?null:g.jsxs("div",{"data-slot":"reasoning","data-streaming":t||void 0,className:He("w-full",r),children:[g.jsxs("button",{type:"button",disabled:!c,onClick:()=>{l.current=!0,o(f=>!f)},className:"flex items-center gap-1.5 text-label text-fg-3 transition-colors outline-none disabled:cursor-default hover:text-fg-1 disabled:hover:text-fg-3",children:[g.jsx(SP,{className:"size-3.5"}),g.jsx("span",{children:t?"Thinking…":"Thought process"}),c?g.jsx(j3,{className:He("size-3.5 transition-transform",i&&"rotate-180")}):null]}),i&&c?g.jsx("div",{className:"mt-2 border-l-2 border-border pl-3 text-body-sm text-fg-3 [&_*]:text-fg-3",children:g.jsx(xR,{streaming:t,children:e})}):null]})}const JC=2e3,sZ={running:{label:"Running",variant:"info",busy:!0},pending:{label:"Executing",variant:"info",busy:!0},deferred:{label:"Deferred",variant:"accent",busy:!1},settled:{label:"Done",variant:"success",busy:!1},failed:{label:"Error",variant:"danger",busy:!1}};function iZ({item:e,className:t}){const[n,r]=S.useState(!1),[i,o]=S.useState(!1),l=e.status??(e.result===void 0?"running":"settled"),c=sZ[l],f=l==="failed"||e.result?.isError===!0,d=e.result?.text??"",m=!i&&d.length>JC,p=m?d.slice(0,JC):d;return g.jsxs("div",{"data-slot":"tool-call","data-state":l,className:He("w-full overflow-hidden rounded-lg border border-border bg-surface",t),children:[g.jsxs("button",{type:"button",onClick:()=>r(b=>!b),className:He("flex w-full items-center gap-2 px-3 py-2 text-left transition-colors outline-none","hover:bg-surface-hover focus-visible:bg-surface-hover"),children:[g.jsx(S9,{className:"size-3.5 shrink-0 text-fg-3"}),g.jsx("span",{className:"shrink-0 font-mono text-body-sm font-medium text-fg-1",children:e.name}),g.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-label text-fg-4",children:CB(e.input)}),g.jsxs(ts,{variant:c.variant,dot:!c.busy,className:"shrink-0 gap-1",children:[c.busy?g.jsx(ci,{className:"size-3 text-current"}):null,l==="deferred"?g.jsx(OP,{className:"size-3 text-current"}):null,c.label]}),g.jsx(j3,{className:He("size-3.5 shrink-0 text-fg-4 transition-transform",n&&"rotate-180")})]}),n?g.jsxs("div",{className:"flex flex-col gap-2 border-t border-border p-2.5",children:[g.jsx(ig,{code:JSON.stringify(e.input,null,2),label:"Parameters"}),e.logs?.length?g.jsx(ig,{code:e.logs.join(`
|
|
481
|
-
`),label:"Logs"}):null,e.result!==void 0?g.jsxs("div",{children:[g.jsx(ig,{code:p||"(empty result)",label:f?"Error":"Result",className:He(f&&"border-danger/40 [&_pre]:text-danger")}),m?g.jsxs("button",{type:"button",className:"mt-1 text-label text-fg-3 underline-offset-2 hover:underline",onClick:()=>o(!0),children:["Show all ",d.length.toLocaleString()," chars"]}):null]}):null]}):null]})}function aZ({item:e}){return g.jsxs("div",{"data-slot":"turn-result",className:"flex items-center gap-2 py-1",children:[g.jsx("div",{className:"h-px flex-1 bg-border"}),g.jsxs("span",{className:He("font-mono text-label",e.isError?"text-danger":"text-fg-4"),children:[e.isError?e.subtype:"turn done"," · ",vB(e.durationMs)," ·"," ",ep(e.totalCostUsd)]}),g.jsx("div",{className:"h-px flex-1 bg-border"})]})}function oZ({item:e}){return g.jsx("div",{"data-slot":"notice",className:He("rounded-md border px-3 py-2 text-body-sm",e.level==="error"?"border-transparent bg-danger-bg text-danger":"border-border bg-surface text-fg-3"),children:e.text})}function lZ({item:e,fileUrl:t,attachmentUrl:n}){switch(e.kind){case"user":return g.jsxs(cS,{from:"user",children:[e.attachments?.length?g.jsx(cZ,{attachments:e.attachments,attachmentUrl:n}):null,e.text?g.jsx(fS,{children:e.text}):null]});case"assistant_text":return g.jsx(cS,{from:"assistant",children:g.jsx(fS,{children:g.jsx(xR,{streaming:e.streaming,children:e.text})})});case"thinking":return g.jsx(rZ,{isStreaming:e.id==="streaming-thinking",children:e.text});case"tool_call":return g.jsx(iZ,{item:e});case"turn_result":return g.jsx(aZ,{item:e});case"notice":return g.jsx(oZ,{item:e});case"file_delivered":return g.jsx(BB,{item:e,href:t?.(e.path)});default:return null}}function uZ(e){if(e.status!=="running"&&e.status!=="starting")return!1;const t=e.items.at(-1);return t?t.kind==="assistant_text"&&t.streaming||t.kind==="thinking"&&t.id==="streaming-thinking"?!1:t.kind!=="turn_result"||e.status==="running":!0}function cZ({attachments:e,attachmentUrl:t}){return g.jsx("div",{className:"mb-1 flex flex-wrap justify-end gap-1.5",children:e.map(n=>{const r=t?.(n.id);return n.mediaType.startsWith("image/")&&r?g.jsx("img",{src:r,alt:n.name,className:"size-20 rounded-md border border-border object-cover"},n.id):g.jsx("span",{className:"rounded-full border border-border bg-surface px-2.5 py-1 text-body-xs text-fg-3",children:n.name},n.id)})})}function fZ({state:e,fileUrl:t,attachmentUrl:n,className:r}){return g.jsxs(DB,{className:r,children:[g.jsxs(PB,{children:[e.items.length===0&&e.status!=="starting"?g.jsx("div",{className:"py-12 text-center text-body-sm text-fg-4",children:"No messages yet."}):e.items.map(i=>g.jsx(lZ,{item:i,fileUrl:t,attachmentUrl:n},`${i.kind}:${i.id}`)),uZ(e)?g.jsx(HB,{label:e.status==="starting"?"Starting session…":void 0}):null]}),g.jsx(jB,{})]})}function dZ({client:e,sessionId:t,header:n,className:r}){const[i,o]=S.useState(void 0),{state:l,connected:c,handle:f,send:d,approve:m,deny:p,interrupt:b,setModel:y,setPermissionMode:E}=fB(e,t,{onProtocolError:o});S.useEffect(()=>o(void 0),[t]),gB(f);const w=l.status==="running"||l.status==="awaiting_approval",k=l.status==="failed"||l.status==="closed",C=S.useMemo(()=>{if(l.commands)return l.commands.some(_=>_.name==="model")?l.commands:[{name:"model",description:"Switch the model for this session",argumentHint:"<model>"},...l.commands]},[l.commands]),A=_=>{const N=/^\/model\s+(\S+)$/.exec(_);if(N){y(N[1]);return}d(_)};return g.jsxs("div",{"data-slot":"session-panel",className:He("flex h-full min-h-0 flex-col overflow-hidden bg-bg",r),children:[n,g.jsx(_B,{state:l,connected:c}),i?g.jsx("div",{className:"px-3 pt-2",children:g.jsxs("div",{role:"alert",className:"mx-auto flex w-full max-w-3xl items-start gap-2 rounded-md border border-danger/40 bg-danger-bg px-3 py-2 text-body-sm text-danger",children:[g.jsx("span",{className:"min-w-0 flex-1 break-words",children:i}),g.jsx("button",{type:"button",onClick:()=>o(void 0),"aria-label":"Dismiss error",className:"shrink-0 opacity-70 transition-opacity hover:opacity-100",children:"✕"})]})}):null,g.jsx(fZ,{state:l,fileUrl:t?_=>e.sessionFileUrl(t,_):void 0,attachmentUrl:t?_=>e.attachmentUrl(t,_):void 0}),l.pendingApprovals.length>0?g.jsx("div",{className:"px-3 pb-2",children:g.jsx("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-2",children:l.pendingApprovals.map(_=>_.toolName==="AskUserQuestion"&&mA(_.input).length>0?g.jsx(TB,{request:_,onAnswer:m,onDismiss:p},_.id):g.jsx(EB,{request:_,onApprove:m,onDeny:p},_.id))})}):null,g.jsx(xB,{onSend:A,onInterrupt:b,busy:w,disabled:k||!t,commands:C,toolbar:g.jsxs(g.Fragment,{children:[l.models?.length?g.jsx(pA,{models:l.models,model:l.model,onModelChange:y,disabled:k}):null,l.permissionMode?g.jsx(Rc,{mode:l.permissionMode,onModeChange:E,modes:l.engine==="provider"?hA:void 0,disabled:k}):null]})})]})}function hZ({session:e,active:t,onSelect:n,onDelete:r}){const i=gA[e.status];return g.jsxs("div",{"data-slot":"session-list-item","data-active":t||void 0,className:He("group flex w-full items-center gap-2 rounded-md border border-transparent px-2.5 py-2 text-left transition-colors",t?"border-border bg-surface":"hover:bg-surface-hover"),children:[g.jsxs("button",{type:"button",onClick:()=>n?.(e.id),className:"min-w-0 flex-1 text-left outline-none",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"truncate text-body-sm font-medium text-fg-1",children:e.title??e.id.slice(0,8)}),g.jsx(ts,{variant:i.variant,dot:!0,className:"shrink-0",children:i.label})]}),g.jsxs("div",{className:"mt-0.5 flex items-center gap-2 font-mono text-label text-fg-4",children:[g.jsx("span",{className:"truncate",children:e.cwd}),e.profile?g.jsxs("span",{className:"shrink-0",children:["@",e.profile]}):null,g.jsx("span",{className:"shrink-0",children:ep(e.totalCostUsd)}),g.jsx("span",{className:"shrink-0",children:N1(e.lastActivityAt??e.createdAt)})]})]}),r?g.jsx($t,{variant:"ghost",size:"icon-sm","aria-label":"Close session",className:"opacity-0 transition-opacity group-hover:opacity-100",onClick:()=>r(e.id),children:g.jsx(k1,{className:"size-3.5 text-fg-3"})}):null]})}function pZ({sessions:e,activeId:t,onSelect:n,onDelete:r,emptyText:i="No sessions yet.",className:o}){return g.jsx("div",{"data-slot":"session-list",className:He("flex flex-col gap-1",o),children:e.length===0?g.jsx("div",{className:"px-2.5 py-6 text-center text-body-sm text-fg-4",children:i}):e.map(l=>g.jsx(hZ,{session:l,active:l.id===t,onSelect:n,onDelete:r},l.id))})}function mZ({className:e}){return g.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e,children:[g.jsx("path",{d:"M8 3.5h9A3.5 3.5 0 0 1 20.5 7v9"}),g.jsx("rect",{width:"13.5",height:"13.5",x:"3.5",y:"7",rx:"3.5"}),g.jsx("path",{d:"m7 16.5 2.5-2.5L7 11.5"}),g.jsx("circle",{cx:"13.2",cy:"14",r:"1.7",fill:"#2fbf71",stroke:"none"})]})}function yR(){const[e,t]=S.useState(Hb());return g.jsx($t,{variant:"ghost",size:"icon-sm","aria-label":"Toggle theme",onClick:()=>t(ZO()),children:e==="dark"?g.jsx(p9,{className:"size-4"}):g.jsx(QP,{className:"size-4"})})}const gZ=[{id:"sessions",label:"Sessions",icon:c9,path:"/sessions"},{id:"jobs",label:"Jobs",icon:U3,path:"/jobs"},{id:"profiles",label:"Profiles",icon:y9,path:"/profiles"},{id:"settings",label:"Settings",icon:a9,path:"/settings"}],ew="workerdeck.sidebar-collapsed";function bZ({children:e}){const t=VI({select:o=>o.location.pathname}),[n,r]=S.useState(()=>{try{return localStorage.getItem(ew)==="1"}catch{return!1}}),i=()=>{r(o=>{try{localStorage.setItem(ew,o?"0":"1")}catch{}return!o})};return g.jsxs("div",{className:"flex h-dvh bg-sidebar",children:[g.jsxs("aside",{className:He("flex shrink-0 flex-col gap-1 p-3 transition-[width] duration-150",n?"w-14 items-center":"w-52"),children:[g.jsxs("div",{className:He("flex items-center py-2",n?"justify-center":"gap-2 px-2"),children:[g.jsx(mZ,{className:"size-4 shrink-0 text-fg-1"}),!n&&g.jsx("span",{className:"text-body-sm font-semibold tracking-tight text-fg-1",children:"workerdeck"})]}),g.jsx("nav",{className:He("mt-1 flex flex-1 flex-col gap-0.5",n&&"items-center"),children:gZ.map(o=>{const l=t.startsWith(o.path);return g.jsxs(Sc,{to:o.path,title:n?o.label:void 0,"aria-label":o.label,className:He("flex items-center rounded-md text-body-sm transition-colors outline-none",n?"justify-center p-2":"gap-2 px-2 py-1.5",l?"bg-surface font-medium text-fg-1 shadow-(--shadow-xs)":"text-fg-3 hover:bg-surface-hover hover:text-fg-1"),children:[g.jsx(o.icon,{className:"size-4 shrink-0"}),!n&&o.label]},o.id)})}),g.jsxs("div",{className:He("flex items-center",n?"flex-col gap-1":"justify-between px-1"),children:[!n&&g.jsx("span",{className:"font-mono text-label text-fg-4",children:"v0.1"}),g.jsx(yR,{}),g.jsx("button",{type:"button",onClick:i,title:n?"Expand sidebar":"Collapse sidebar","aria-label":n?"Expand sidebar":"Collapse sidebar",className:"flex size-7 items-center justify-center rounded-md text-fg-3 transition-colors outline-none hover:bg-surface-hover hover:text-fg-1",children:n?g.jsx(e9,{className:"size-4"}):g.jsx(ZP,{className:"size-4"})})]})]}),g.jsx("main",{className:"frame-shine m-2 ml-0 flex min-w-0 flex-1 flex-col overflow-hidden rounded-xl",children:e??g.jsx(zw,{})})]})}const ER=[{value:"default",displayName:"Default (recommended)",description:"The CLI's configured default model"},{value:"fable",displayName:"Fable",description:"Fable 5 · Most capable for your hardest and longest-running tasks"},{value:"opus",displayName:"Opus",description:"Opus 5 with 1M context · Best for everyday, complex tasks"},{value:"sonnet",displayName:"Sonnet",description:"Sonnet 5 · Efficient for routine tasks"},{value:"haiku",displayName:"Haiku",description:"Haiku 4.5 · Fastest for quick answers"}],Pb={session:"workerdeck.default-session-model",job:"workerdeck.default-job-model"};function mx(e){return localStorage.getItem(Pb[e])??""}function xZ(e,t){const n=t.trim();n?localStorage.setItem(Pb[e],n):localStorage.removeItem(Pb[e])}const TR={session:"workerdeck.default-session-permission-mode",job:"workerdeck.default-job-permission-mode"},yZ={session:"default",job:"acceptEdits"};function gx(e){const t=localStorage.getItem(TR[e]);return ub.some(r=>r.value===t)?t:yZ[e]}function EZ(e,t){localStorage.setItem(TR[e],t)}function bx({value:e,onChange:t,models:n=ER,className:r}){return g.jsx(pA,{variant:"form",models:n,model:e||void 0,onModelChange:i=>t(i??""),className:r})}function vR({profiles:e,value:t,onChange:n,className:r}){return e.length===0?null:g.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[g.jsx("span",{className:"text-label font-medium text-fg-3",children:"Profile"}),g.jsxs(eo,{items:e.map(i=>({value:i.name,label:i.name})),value:t,onValueChange:i=>n(i),children:[g.jsx(no,{className:r,children:g.jsx(to,{})}),g.jsx(ro,{children:e.map(i=>g.jsx(ra,{value:i.name,children:g.jsx(na,{children:g.jsxs("span",{className:i.available===!1?"text-fg-4":void 0,title:i.unavailableReason,children:[i.description?`${i.name} — ${i.description}`:i.name,i.available===!1?" (unavailable)":""]})})},i.name))})]})]})}class TZ{sessionId;#t;#r;#n;#e=new Map;#s;#l=!1;#u=0;#i=[];#c;constructor(t,n,r={}){this.#t=t,this.sessionId=n,this.#r={reconnect:!0,...r},this.#s=r.afterSeq??0,this.#c=setTimeout(()=>this.#f(),0)}get lastSeq(){return this.#s}on(t,n){let r=this.#e.get(t);return r||(r=new Set,this.#e.set(t,r)),r.add(n),()=>r.delete(n)}send(t,n){this.#a({type:"user_message",text:t,attachmentIds:n?.length?n:void 0})}approve(t,n){this.#a({type:"permission_decision",requestId:t,behavior:"allow",updatedInput:n})}deny(t,n,r){this.#a({type:"permission_decision",requestId:t,behavior:"deny",message:n,interrupt:r})}interrupt(){this.#a({type:"interrupt"})}setPermissionMode(t){this.#a({type:"set_permission_mode",mode:t})}setModel(t){this.#a({type:"set_model",model:t})}sendToolCallResult(t,n,r){this.#a({type:"tool_call_result",executionId:t,output:n,logs:r})}sendToolCallError(t,n,r,i){this.#a({type:"tool_call_error",executionId:t,reason:n,error:r,logs:i})}closeSession(){this.#a({type:"close"}),this.detach()}detach(){this.#l=!0,clearTimeout(this.#c),this.#n?.close(),this.#n=void 0}#o(t,n){const r=this.#e.get(t);if(r)for(const i of r)try{i(n)}catch{}}#a(t){const n=JSON.stringify(t);this.#n&&this.#n.readyState===1?this.#n.send(n):this.#i.push(n)}#f(){if(this.#l)return;const t=this.#t.openSocket(this.sessionId,this.#s);this.#n=t,t.onopen=()=>{this.#u=0,this.#o("connectionChange",!0);for(const n of this.#i.splice(0))t.send(n)},t.onmessage=n=>{const r=JSON.parse(String(n.data));if(r.type==="attached")this.#o("attached",r);else if(r.type==="event"){if(r.event.seq<=this.#s)return;this.#s=r.event.seq,this.#o("event",r.event)}else r.type==="tool_call_request"?this.#o("toolCallRequest",r):r.type==="tool_call_canceled"?this.#o("toolCallCanceled",{executionId:r.executionId,reason:r.reason}):r.type==="protocol_error"&&this.#o("protocolError",r.message)},t.onclose=()=>{if(this.#o("connectionChange",!1),this.#l||!this.#r.reconnect)return;const n=Math.min(500*2**this.#u++,1e4);this.#c=setTimeout(()=>this.#f(),n)},t.onerror=()=>{}}}class vZ{#t;#r;#n;#e=new Map;#s=!1;#l=0;#u;constructor(t,n={}){this.#t=t,this.#r=n.reconnect??!0,this.#u=setTimeout(()=>this.#c(),0)}on(t,n){let r=this.#e.get(t);return r||(r=new Set,this.#e.set(t,r)),r.add(n),()=>r.delete(n)}detach(){this.#s=!0,clearTimeout(this.#u),this.#n?.close(),this.#n=void 0}#i(t,n){const r=this.#e.get(t);if(r)for(const i of r)try{i(n)}catch{}}#c(){if(this.#s)return;const t=this.#t.openQueueSocket();this.#n=t,t.onopen=()=>{this.#l=0,this.#i("connectionChange",!0)},t.onmessage=n=>{const r=JSON.parse(String(n.data));r.type==="queue_attached"?(this.#i("attached",r.stats),this.#i("stats",r.stats)):r.type==="job_event"?this.#i("event",r.event):r.type==="queue_stats"&&this.#i("stats",r.stats)},t.onclose=()=>{if(this.#i("connectionChange",!1),this.#s||!this.#r)return;const n=Math.min(500*2**this.#l++,1e4);this.#u=setTimeout(()=>this.#c(),n)},t.onerror=()=>{}}}class SZ{#t;#r;#n;constructor(t){this.#t=t,this.#r=t.fetchImpl??fetch.bind(globalThis),this.#n=t.WebSocketImpl??WebSocket}async createSession(t){return(await this.#e("POST","/sessions",t)).session}async listSessions(){return(await this.#e("GET","/sessions")).sessions}async getSession(t){return(await this.#e("GET",`/sessions/${encodeURIComponent(t)}`)).session}async deleteSession(t){return(await this.#e("DELETE",`/sessions/${encodeURIComponent(t)}`)).session}async listSessionFiles(t){return(await this.#e("GET",`/sessions/${encodeURIComponent(t)}/files`)).files}async fetchSessionFile(t,n){const r=await this.#r(this.sessionFileUrl(t,n),{headers:this.#t.headers});if(!r.ok){const i=await r.json().catch(()=>({}));throw new Error(i.error??`GET file failed with ${r.status}`)}return await r.text()}async uploadAttachment(t,n){const r=`${this.#t.baseUrl}/sessions/${encodeURIComponent(t)}/attachments?name=${encodeURIComponent(n.name)}`,i=await this.#r(r,{method:"POST",headers:{...this.#t.headers,"content-type":n.mediaType},body:n.data});if(!i.ok){const o=await i.json().catch(()=>({}));throw new Error(o.error??`upload failed with ${i.status}`)}return(await i.json()).attachment}attachmentUrl(t,n){return`${this.#t.baseUrl}/sessions/${encodeURIComponent(t)}/attachments/${encodeURIComponent(n)}`}async listMcpServers(t){return(await this.#e("GET",`/sessions/${encodeURIComponent(t)}/mcp`)).servers}async mcpServerAction(t,n,r){return(await this.#e("POST",`/sessions/${encodeURIComponent(t)}/mcp/${encodeURIComponent(n)}`,{action:r})).servers}sessionFileUrl(t,n){const r=n.split("/").filter(Boolean).map(encodeURIComponent).join("/");return`${this.#t.baseUrl}/sessions/${encodeURIComponent(t)}/files/${r}`}async resolvePermission(t,n,r){await this.#e("POST",`/sessions/${encodeURIComponent(t)}/permissions/${encodeURIComponent(n)}`,r)}async submitExecutionResult(t,n){return await this.#e("POST",`/executions/${encodeURIComponent(t)}/result`,n)}async listProfiles(){return await this.#e("GET","/profiles")}async getProfile(t){return await this.#e("GET",`/profiles/${encodeURIComponent(t)}`)}async createProfile(t){return(await this.#e("POST","/profiles",t)).profile}async updateProfile(t,n){return(await this.#e("PATCH",`/profiles/${encodeURIComponent(t)}`,n)).profile}async deleteProfile(t){await this.#e("DELETE",`/profiles/${encodeURIComponent(t)}`)}async listSdkSessions(t){const n=new URLSearchParams;t?.dir&&n.set("dir",t.dir),t?.limit!==void 0&&n.set("limit",String(t.limit)),t?.offset!==void 0&&n.set("offset",String(t.offset)),t?.profile&&n.set("profile",t.profile);const r=n.size>0?`?${n.toString()}`:"";return(await this.#e("GET",`/sdk-sessions${r}`)).sdkSessions}async listHostRoots(){return await this.#e("GET","/fs/roots")}async listHostDir(t){const n=`?path=${encodeURIComponent(t)}`;return await this.#e("GET",`/fs/list${n}`)}async findHostFiles(t,n="",r){const i=new URLSearchParams({path:t,q:n});return r!==void 0&&i.set("limit",String(r)),await this.#e("GET",`/fs/find?${i.toString()}`)}async readHostFile(t){const n=`?path=${encodeURIComponent(t)}`;return await this.#e("GET",`/fs/read${n}`)}async writeHostFile(t){return await this.#e("PUT","/fs/write",t)}async createJob(t){return(await this.#e("POST","/jobs",t)).job}async listJobs(){return(await this.#e("GET","/jobs")).jobs}async getJob(t){return(await this.#e("GET",`/jobs/${encodeURIComponent(t)}`)).job}async cancelJob(t){return(await this.#e("DELETE",`/jobs/${encodeURIComponent(t)}`)).job}async queueStats(){return(await this.#e("GET","/queue")).stats}attach(t,n){return new TZ(this,t,n)}attachQueue(t){return new vZ(this,t)}openSocket(t,n){const r=this.#t.buildWsUrl?.(t,n)??`${this.#t.baseUrl.replace(/^http/,"ws")}/sessions/${encodeURIComponent(t)}/ws?afterSeq=${n}`;return new this.#n(r)}openQueueSocket(){const t=this.#t.buildQueueWsUrl?.()??`${this.#t.baseUrl.replace(/^http/,"ws")}/queue/ws`;return new this.#n(t)}async#e(t,n,r){const i=await this.#r(`${this.#t.baseUrl}${n}`,{method:t,headers:{...r!==void 0?{"content-type":"application/json"}:{},...this.#t.headers},body:r!==void 0?JSON.stringify(r):void 0}),o=await i.json().catch(()=>({}));if(!i.ok)throw new Error(o.error??`${t} ${n} failed with ${i.status}`);return o}}const Kn=new SZ({baseUrl:`${location.origin}/v1`});function SR(e,t,n){const r=e?.capabilities??dA[e?.engine??"claude"],i=r.permissionModes.includes(t)?t:r.defaultPermissionMode;let o,l;if(e?.models?.length)o=e.models,l=e.defaultModel;else if(e?.engine==="provider"){const d=e.provider;o=(d?.models?.length?d.models:d?.model?[d.model]:[]).map(p=>({value:p,displayName:p})),l=d?.model}else o=ER.filter(d=>d.value!=="default");const c=o.find(d=>d.value===n||d.resolvedModel===n),f=c||n===""?n:"";return{capabilities:r,modes:r.permissionModes,models:[{value:"default",displayName:"Profile default",description:l??"the profile's configured model"},...o],mode:i,model:f,reasoningEfforts:(c?c.reasoningEfforts:void 0)??r.reasoningEfforts??[]}}function CZ(e=15e3){const[t,n]=S.useState([]),[r,i]=S.useState(),[o,l]=S.useState(!0),[c,f]=S.useState(!1),[d,m]=S.useState(),p=S.useRef(void 0),b=S.useCallback(async()=>{try{const[E,w]=await Promise.all([Kn.listJobs(),Kn.queueStats()]);n(E),i(w),l(!0),m(void 0)}catch(E){const w=E instanceof Error?E.message:String(E);/not configured/i.test(w)?(l(!1),m(void 0)):m(w)}},[]);S.useEffect(()=>(b(),p.current=setInterval(()=>void b(),e),()=>clearInterval(p.current)),[b,e]);const y=o&&r!==void 0;return S.useEffect(()=>{if(!y)return;const E=Kn.attachQueue(),w=[E.on("attached",()=>void b()),E.on("stats",i),E.on("connectionChange",f),E.on("event",k=>{n(C=>C.some(_=>_.id===k.job.id)?C.map(_=>_.id===k.job.id?k.job:_):[...C,k.job])})];return()=>{for(const k of w)k();E.detach()}},[y,b]),{jobs:t,stats:r,enabled:o,live:c,error:d,refresh:b}}const CR={profiles:[]};let jb,Dg;const Bb=new Set;async function tw(){const e=await Kn.listProfiles().catch(()=>CR);jb=e;for(const t of Bb)t(e);return e}function wR(){const[e,t]=S.useState(jb??CR);S.useEffect(()=>(Bb.add(t),jb||(Dg??=tw()),()=>{Bb.delete(t)}),[]);const n=S.useCallback(async()=>{Dg=tw(),await Dg},[]);return{...e,refresh:n}}function wZ(){return wR().profiles}const nw="workerdeck.last-profile";function kR(){const e=wZ(),[t,n]=S.useState(()=>localStorage.getItem(nw)??""),r=e.some(l=>l.name===t)?t:e[0]?.name??"",i=e.find(l=>l.name===r);return{profiles:e,profile:r,selected:i,select:l=>{n(l),localStorage.setItem(nw,l)}}}function AR(e=5e3){const[t,n]=S.useState([]),[r,i]=S.useState(),o=S.useRef(void 0),l=S.useCallback(async()=>{try{n(await Kn.listSessions()),i(void 0)}catch(c){i(c instanceof Error?c.message:String(c))}},[]);return S.useEffect(()=>(l(),o.current=setInterval(()=>void l(),e),()=>clearInterval(o.current)),[l,e]),{sessions:t,error:r,refresh:l}}const rw="workerdeck.last-cwd",kZ={queued:{label:"Queued",variant:"neutral"},running:{label:"Running",variant:"info",busy:!0},parked:{label:"Parked",variant:"accent"},succeeded:{label:"Succeeded",variant:"success"},failed:{label:"Failed",variant:"danger"},canceled:{label:"Canceled",variant:"warning"}};function AZ({stats:e}){const t=e.dailyTokenLimit!==void 0&&e.dailyTokenLimit>0?e.dailyTokensUsed/e.dailyTokenLimit*100:void 0;return g.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-2 rounded-md border border-border bg-surface px-3 py-2 text-body-sm text-fg-2",children:[g.jsxs("span",{children:["Running ",g.jsxs("span",{className:"font-mono text-fg-1",children:[e.running,"/",e.maxConcurrency]})]}),g.jsxs("span",{children:["Queued ",g.jsx("span",{className:"font-mono text-fg-1",children:e.queued})]}),e.parked>0?g.jsxs("span",{children:["Parked ",g.jsx("span",{className:"font-mono text-fg-1",children:e.parked})]}):null,g.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[t!==void 0?g.jsx(W3,{value:t,className:t>=95?"text-danger":t>=80?"text-warning":"text-fg-3"}):null,"Daily tokens"," ",g.jsxs("span",{className:"font-mono text-fg-1",children:[Qi(e.dailyTokensUsed),e.dailyTokenLimit!==void 0?` / ${Qi(e.dailyTokenLimit)}`:""]})]}),e.sessionTokenLimit!==void 0?g.jsxs("span",{children:["Per-job cap ",g.jsx("span",{className:"font-mono text-fg-1",children:Qi(e.sessionTokenLimit)})]}):null,e.paused?g.jsx(ts,{variant:"warning",dot:!0,children:"Paused — daily budget exhausted"}):null]})}function _Z({onScheduled:e}){const[t,n]=S.useState(()=>localStorage.getItem(rw)??""),[r,i]=S.useState(""),[o,l]=S.useState(()=>gx("job")),[c,f]=S.useState("auto"),[d,m]=S.useState(()=>mx("job")),[p,b]=S.useState(""),{profiles:y,profile:E,selected:w,select:k}=kR(),C=SR(w,o,d),[A,_]=S.useState(!1),[N,D]=S.useState(""),[O,j]=S.useState(""),[M,q]=S.useState(""),[U,Q]=S.useState(!1),Z=async()=>{if(!t.trim()||!r.trim()){Mn.error("Working directory and prompt are required");return}const G=N.trim()?Number(N.trim()):void 0;if(G!==void 0&&(!Number.isFinite(G)||G<=0)){Mn.error("Max tokens must be a positive number");return}const ee=O.trim()?Number(O.trim()):void 0;if(ee!==void 0&&(!Number.isInteger(ee)||ee<1)){Mn.error("Attempts must be a whole number of at least 1");return}Q(!0);try{localStorage.setItem(rw,t.trim()),await Kn.createJob({session:{cwd:t.trim(),profile:E||void 0,prompt:r.trim(),permissionMode:C.mode,questionBehavior:C.capabilities.interactiveApprovals?c:void 0,model:C.model.trim()||void 0,reasoningEffort:p&&C.reasoningEfforts.includes(p)?p:void 0,...C.capabilities.settingSources?{settingSources:["user","project"],allowDangerouslySkipPermissions:A||void 0}:{}},maxTokens:G,attempts:ee,webhook:M.trim()?{url:M.trim()}:void 0}),i(""),Mn.success("Job scheduled"),e()}catch(Y){Mn.error(Y instanceof Error?Y.message:"Failed to schedule job")}finally{Q(!1)}};return g.jsxs(As,{children:[g.jsx(_s,{children:g.jsx(Ns,{children:"Schedule a job"})}),g.jsxs(Rs,{className:"flex flex-col gap-3",children:[g.jsxs("label",{className:"flex flex-col gap-1",children:[g.jsx("span",{className:"text-label font-medium text-fg-3",children:"Working directory"}),g.jsx(bn,{value:t,onChange:G=>n(G.target.value),placeholder:"/path/to/project",spellCheck:!1,className:"font-mono"})]}),g.jsxs("label",{className:"flex flex-col gap-1",children:[g.jsx("span",{className:"text-label font-medium text-fg-3",children:"Prompt (the task — runs unattended)"}),g.jsx(Gb,{value:r,onChange:G=>i(G.target.value),rows:2,placeholder:"e.g. /verify-content 42, or a task description"})]}),g.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[g.jsx(vR,{profiles:y,value:E,onChange:k,className:"min-w-32"}),g.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[g.jsx("span",{className:"text-label font-medium text-fg-3",children:"Permission mode"}),g.jsx(Rc,{variant:"form",mode:C.mode,onModeChange:l,modes:C.modes,className:"min-w-44"})]}),C.capabilities.interactiveApprovals?g.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[g.jsx("span",{className:"text-label font-medium text-fg-3",children:"Questions"}),g.jsxs(eo,{items:iS.map(G=>({value:G.value,label:G.label})),value:c,onValueChange:G=>f(G),children:[g.jsx(no,{className:"min-w-36",children:g.jsx(to,{})}),g.jsx(ro,{children:iS.map(G=>g.jsx(ra,{value:G.value,children:g.jsx(na,{children:`${G.label} — ${G.description}`})},G.value))})]})]}):null,g.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[g.jsx("span",{className:"text-label font-medium text-fg-3",children:"Model"}),g.jsx(bx,{value:C.model,onChange:m,models:C.models,className:"min-w-40"})]}),C.reasoningEfforts.length>0?g.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[g.jsx("span",{className:"text-label font-medium text-fg-3",children:"Effort"}),g.jsxs(eo,{items:[{value:"default",label:"Default"},...C.reasoningEfforts.map(G=>({value:G,label:G}))],value:p||"default",onValueChange:G=>b(G==="default"?"":String(G)),children:[g.jsx(no,{className:"min-w-28",children:g.jsx(to,{})}),g.jsx(ro,{children:["default",...C.reasoningEfforts].map(G=>g.jsx(ra,{value:G,children:g.jsx(na,{children:G})},G))})]})]}):null,g.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[g.jsx("span",{className:"text-label font-medium text-fg-3",children:"Max tokens (optional)"}),g.jsx(bn,{value:N,onChange:G=>D(G.target.value),placeholder:"per-job cap",inputMode:"numeric",className:"min-w-28 font-mono"})]}),g.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[g.jsx("span",{className:"text-label font-medium text-fg-3",children:"Attempts (optional)"}),g.jsx(bn,{value:O,onChange:G=>j(G.target.value),placeholder:"1",inputMode:"numeric",className:"min-w-20 font-mono"})]}),g.jsxs("label",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[g.jsx("span",{className:"text-label font-medium text-fg-3",children:"Webhook URL (optional)"}),g.jsx(bn,{value:M,onChange:G=>q(G.target.value),placeholder:"https://…/hook",spellCheck:!1,className:"min-w-44 font-mono"})]}),g.jsxs($t,{onClick:()=>void Z(),disabled:U,children:[U?g.jsx(ci,{className:"size-3.5 text-current"}):g.jsx(w1,{className:"size-4"}),"Schedule"]})]}),C.capabilities.settingSources?g.jsxs("label",{className:"flex w-fit cursor-pointer items-center gap-2 text-body-sm text-fg-2",title:"Spawns the CLI with --dangerously-skip-permissions available, so the mode can be switched on while watching the run. The job still starts in the mode selected above.",children:[g.jsx("input",{type:"checkbox",checked:A,onChange:G=>_(G.target.checked),className:"size-3.5 accent-(--color-fg-1)"}),"Allow switching to ",g.jsx("code",{className:"font-mono",children:"bypassPermissions"})," mid-run",g.jsx("span",{className:"text-label text-fg-4",children:"(dangerous)"})]}):null,g.jsxs("p",{className:"text-label text-fg-4",children:["Unattended runs still surface permission prompts — watch the job's session to approve, or pick a mode that doesn't ask. Unanswered prompts deny after the server's timeout. With Questions set to Ask, webhook deliveries carry the full question so a controller can answer via"," ",g.jsx("code",{className:"font-mono",children:"POST /sessions/:id/permissions/:requestId"}),"."]})]})]})}function NZ({job:e,watchable:t,onChanged:n}){const r=yl(),i=kZ[e.status],o=e.status==="queued"||e.status==="running"||e.status==="parked",l=async()=>{try{await Kn.cancelJob(e.id),n()}catch(c){Mn.error(c instanceof Error?c.message:"Cancel failed")}};return g.jsxs("li",{className:"flex items-center gap-3 rounded-md px-2 py-2 hover:bg-surface-hover",children:[g.jsxs(ts,{variant:i.variant,dot:!i.busy,children:[i.busy?g.jsx(ci,{className:"size-3 text-current"}):null,i.label]}),g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsx("div",{className:"truncate text-body-sm text-fg-1",children:e.prompt}),g.jsxs("div",{className:"flex flex-wrap gap-x-3 font-mono text-label text-fg-4",children:[g.jsx("span",{className:"truncate",children:e.cwd}),e.profile?g.jsxs("span",{className:"shrink-0",children:["@",e.profile]}):null,g.jsx("span",{className:"shrink-0",children:N1(e.finishedAt??e.startedAt??e.createdAt)}),e.maxAttempts!==void 0&&e.maxAttempts>1?g.jsxs("span",{className:"shrink-0",children:["attempt ",e.attempt??1,"/",e.maxAttempts,e.status==="queued"&&e.nextRunAt!==void 0&&e.nextRunAt>Date.now()?" — retry pending":""]}):null,e.usage.tokens>0?g.jsxs("span",{className:"shrink-0",children:[Qi(e.usage.tokens)," tok"]}):null,e.usage.totalCostUsd>0?g.jsx("span",{className:"shrink-0",children:ep(e.usage.totalCostUsd)}):null,e.error?g.jsx("span",{className:"truncate text-danger",children:e.error}):null]})]}),e.sessionId&&t?g.jsxs($t,{variant:"ghost",size:"xs",onClick:()=>void r({to:"/sessions/$sessionId",params:{sessionId:e.sessionId}}),children:[g.jsx(H3,{className:"size-3"}),"Watch"]}):null,o?g.jsxs($t,{variant:"outline",size:"xs",onClick:()=>void l(),children:[g.jsx(F3,{className:"size-3"}),"Cancel"]}):null]})}function RZ(){const{jobs:e,stats:t,enabled:n,live:r,error:i,refresh:o}=CZ(),{sessions:l}=AR(),c=new Set(l.map(d=>d.id)),f=[...e].sort((d,m)=>m.createdAt-d.createdAt);return g.jsx("div",{className:"flex-1 overflow-y-auto",children:g.jsxs("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-5 px-6 py-6",children:[g.jsxs("header",{className:"flex items-end justify-between",children:[g.jsxs("div",{children:[g.jsx("h1",{className:"text-display-sm font-semibold tracking-tight text-text",children:"Jobs"}),g.jsx("p",{className:"mt-0.5 text-body-sm text-muted-foreground",children:"Scheduled one-shot runs with concurrency and token budgets."})]}),g.jsxs("div",{className:"flex items-center gap-2",children:[n?g.jsx(ts,{variant:r?"success":"neutral",dot:!0,children:r?"Live":"Polling"}):null,g.jsx($t,{variant:"ghost",size:"icon-sm","aria-label":"Refresh",onClick:()=>void o(),children:g.jsx(z3,{className:"size-4"})})]})]}),i?g.jsxs("div",{className:"rounded-md bg-danger-bg px-3 py-2 text-body-sm text-danger",children:["Can't reach the worker server: ",i,". Start it with"," ",g.jsx("code",{className:"font-mono",children:"pnpm server"}),"."]}):null,n?g.jsxs(g.Fragment,{children:[t?g.jsx(AZ,{stats:t}):null,f.length===0?g.jsxs("div",{className:"flex flex-col items-center gap-2 rounded-md border border-border bg-surface px-4 py-8 text-center",children:[g.jsx(U3,{className:"size-6 text-fg-4"}),g.jsx("p",{className:"text-body-sm text-fg-2",children:"No jobs yet. Schedule one below."})]}):g.jsx("ul",{className:"flex flex-col gap-1 rounded-md border border-border bg-surface p-1",children:f.map(d=>g.jsx(NZ,{job:d,watchable:d.sessionId!==void 0&&c.has(d.sessionId),onChanged:()=>void o()},d.id))}),g.jsx(_Z,{onScheduled:()=>void o()})]}):g.jsxs("div",{className:"flex flex-col items-center gap-2 rounded-md border border-border bg-surface px-4 py-8 text-center",children:[g.jsx(wP,{className:"size-6 text-fg-4"}),g.jsx("p",{className:"text-body-sm text-fg-2",children:"The server has no job queue configured."}),g.jsxs("p",{className:"text-label text-fg-4",children:["Pass ",g.jsxs("code",{className:"font-mono",children:["queue: ","{ maxConcurrency, … }"]})," to"," ",g.jsx("code",{className:"font-mono",children:"createWorkerServer"})," — the dev server enables it by default."]})]})]})})}const OZ=["web_search","download","web_fetch","deliver_file"],Od=e=>e.split(",").map(t=>t.trim()).filter(Boolean);function zi({label:e,children:t}){return g.jsxs("label",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[g.jsx("span",{className:"text-label font-medium text-fg-3",children:e}),t]})}function IZ({profile:e,onSaved:t}){const n=e.engine==="provider",[r,i]=S.useState(e.description??""),[o,l]=S.useState(e.defaults?.model??""),[c,f]=S.useState(e.defaults?.permissionMode),[d,m]=S.useState(e.provider?.model??""),[p,b]=S.useState((e.provider?.models??[]).join(", ")),[y,E]=S.useState(e.session?.capabilities),[w,k]=S.useState((e.session?.mcpServers??[]).join(", ")),[C,A]=S.useState(e.session?.instructions??""),[_,N]=S.useState(!1),D=async()=>{const O={description:r.trim()||void 0,defaults:{model:o.trim()||void 0,permissionMode:c}};n&&(O.provider={...e.provider,id:e.provider?.id??"",model:d.trim()||void 0,models:Od(p).length>0?Od(p):void 0},O.session={capabilities:y,mcpServers:Od(w).length>0?Od(w):void 0,instructions:C.trim()||void 0}),N(!0);try{t(await Kn.updateProfile(e.name,O)),Mn.success("Profile saved")}catch(j){Mn.error(j instanceof Error?j.message:"Failed to save profile")}finally{N(!1)}};return g.jsxs(As,{children:[g.jsx(_s,{children:g.jsx(Ns,{children:"Edit profile"})}),g.jsxs(Rs,{className:"flex flex-col gap-3",children:[g.jsx(zi,{label:"Description",children:g.jsx(bn,{value:r,onChange:O=>i(O.target.value)})}),g.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[g.jsx(zi,{label:"Default model",children:g.jsx(bn,{value:o,onChange:O=>l(O.target.value),placeholder:"unset — request / engine default",className:"font-mono"})}),g.jsx(zi,{label:"Default permission mode",children:g.jsx(Rc,{variant:"form",mode:c,onModeChange:f,modes:n?hA:void 0})})]}),n?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[g.jsx(zi,{label:"Default model id",children:g.jsx(bn,{value:d,onChange:O=>m(O.target.value),className:"font-mono"})}),g.jsx(zi,{label:"Models offered (comma-separated)",children:g.jsx(bn,{value:p,onChange:O=>b(O.target.value),className:"font-mono"})})]}),g.jsx(zi,{label:"Capabilities granted",children:g.jsxs("div",{className:"flex flex-wrap items-center gap-3 py-1.5",children:[g.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 text-body-sm text-fg-2",children:[g.jsx("input",{type:"checkbox",checked:y===void 0,onChange:O=>E(O.target.checked?void 0:[]),className:"size-3.5 accent-(--color-fg-1)"}),"not declared"]}),OZ.map(O=>g.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 text-body-sm text-fg-2",children:[g.jsx("input",{type:"checkbox",disabled:y===void 0,checked:y?.includes(O)??!1,onChange:j=>E(M=>j.target.checked?[...M??[],O]:(M??[]).filter(q=>q!==O)),className:"size-3.5 accent-(--color-fg-1) disabled:opacity-40"}),g.jsx("code",{className:"font-mono text-label",children:O})]},O))]})}),g.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[g.jsx(zi,{label:"MCP servers (names, comma-separated)",children:g.jsx(bn,{value:w,onChange:O=>k(O.target.value),className:"font-mono"})}),g.jsx(zi,{label:"Instructions",children:g.jsx(bn,{value:C,onChange:O=>A(O.target.value)})})]})]}):null,g.jsxs("div",{className:"flex items-center justify-between gap-3",children:[g.jsx("p",{className:"text-label text-fg-4",children:"Name and engine are fixed — sessions and jobs are pinned to the name, and the engine decides what the rest of these fields mean."}),g.jsxs($t,{onClick:()=>void D(),disabled:_,children:[_?g.jsx(ci,{className:"size-3.5 text-current"}):g.jsx(s9,{className:"size-4"}),"Save"]})]})]})]})}const LZ=["web_search","download","web_fetch","deliver_file"],Id=e=>e.split(",").map(t=>t.trim()).filter(Boolean);function as({label:e,children:t}){return g.jsxs("label",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[g.jsx("span",{className:"text-label font-medium text-fg-3",children:e}),t]})}function MZ({onCreated:e}){const[t,n]=S.useState("provider"),[r,i]=S.useState(""),[o,l]=S.useState(""),[c,f]=S.useState(""),[d,m]=S.useState(""),[p,b]=S.useState(""),[y,E]=S.useState(""),[w,k]=S.useState(""),[C,A]=S.useState([]),[_,N]=S.useState(""),[D,O]=S.useState(""),[j,M]=S.useState(!1),q=t==="provider",U=async()=>{if(!r.trim()){Mn.error("Name is required");return}const Q={name:r.trim(),engine:t};if(o.trim()&&(Q.description=o.trim()),q){Q.provider={id:c.trim(),model:d.trim()||void 0,models:Id(p).length>0?Id(p):void 0,apiKeyEnv:y.trim()||void 0};const Z={};C.length>0&&(Z.capabilities=C),Id(_).length>0&&(Z.mcpServers=Id(_)),D.trim()&&(Z.instructions=D.trim()),Object.keys(Z).length>0&&(Q.session=Z)}else Q.configDir=w.trim();M(!0);try{await Kn.createProfile(Q),await e(),i(""),l(""),O(""),Mn.success(`Profile '${Q.name}' created`)}catch(Z){Mn.error(Z instanceof Error?Z.message:"Failed to create profile")}finally{M(!1)}};return g.jsxs(As,{children:[g.jsx(_s,{children:g.jsx(Ns,{children:"New profile"})}),g.jsxs(Rs,{className:"flex flex-col gap-3",children:[g.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[g.jsx(as,{label:"Engine",children:g.jsxs(eo,{items:[{value:"provider",label:"provider"},{value:"claude",label:"claude"}],value:t,onValueChange:Q=>n(Q),children:[g.jsx(no,{className:"min-w-32",children:g.jsx(to,{})}),g.jsxs(ro,{children:[g.jsx(ra,{value:"provider",children:g.jsx(na,{children:"provider — model-agnostic engine"})}),g.jsx(ra,{value:"claude",children:g.jsx(na,{children:"claude — Agent SDK + config dir"})})]})]})}),g.jsx(as,{label:"Name",children:g.jsx(bn,{value:r,onChange:Q=>i(Q.target.value),placeholder:"kimi"})}),g.jsx(as,{label:"Description (optional)",children:g.jsx(bn,{value:o,onChange:Q=>l(Q.target.value),placeholder:"what this profile is for"})})]}),q?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[g.jsx(as,{label:"Provider id",children:g.jsx(bn,{value:c,onChange:Q=>f(Q.target.value),placeholder:"anthropic / openai / moonshotai",className:"font-mono"})}),g.jsx(as,{label:"Default model",children:g.jsx(bn,{value:d,onChange:Q=>m(Q.target.value),placeholder:"kimi-k3",className:"font-mono"})}),g.jsx(as,{label:"Models offered (comma-separated)",children:g.jsx(bn,{value:p,onChange:Q=>b(Q.target.value),placeholder:"kimi-k3, kimi-k2",className:"font-mono"})}),g.jsx(as,{label:"API key variable",children:g.jsx(bn,{value:y,onChange:Q=>E(Q.target.value),placeholder:"MOONSHOT_API_KEY",className:"font-mono"})})]}),g.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[g.jsx(as,{label:"Capabilities granted",children:g.jsx("div",{className:"flex flex-wrap gap-3 py-1.5",children:LZ.map(Q=>g.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 text-body-sm text-fg-2",children:[g.jsx("input",{type:"checkbox",checked:C.includes(Q),onChange:Z=>A(G=>Z.target.checked?[...G,Q]:G.filter(ee=>ee!==Q)),className:"size-3.5 accent-(--color-fg-1)"}),g.jsx("code",{className:"font-mono text-label",children:Q})]},Q))})}),g.jsx(as,{label:"MCP servers (names, comma-separated)",children:g.jsx(bn,{value:_,onChange:Q=>N(Q.target.value),placeholder:"deepwiki",className:"font-mono"})})]}),g.jsx(as,{label:"Instructions (optional)",children:g.jsx(bn,{value:D,onChange:Q=>O(Q.target.value),placeholder:"prepended to the session's system prompt"})}),g.jsx("p",{className:"text-label text-fg-4",children:"Leave capabilities and MCP servers empty to inherit whatever the server's engine factory wired — that factory is the ceiling either way, so a grant here can never exceed it. MCP servers are named, never configured: their transport config (and any credentials in it) stays on the server."})]}):g.jsxs(g.Fragment,{children:[g.jsx(as,{label:"Config directory",children:g.jsx(bn,{value:w,onChange:Q=>k(Q.target.value),placeholder:"/Users/you/.claude",spellCheck:!1,className:"font-mono"})}),g.jsxs("p",{className:"text-label text-fg-4",children:["Must resolve inside the server's"," ",g.jsx("code",{className:"font-mono",children:"allowedConfigDirRoots"})," — a config directory is a credential store, so the server bounds which ones a managed profile may point at."]})]}),g.jsx("div",{className:"flex justify-end",children:g.jsxs($t,{onClick:()=>void U(),disabled:j,children:[j?g.jsx(ci,{className:"size-3.5 text-current"}):g.jsx(w1,{className:"size-4"}),"Create profile"]})})]})]})}function _R(e){window.location.href=`vscode://file${e}`}function DZ(){const{profiles:e,canManage:t,refresh:n}=wR(),r=yl(),i=o=>{Kn.deleteProfile(o).then(()=>n()).then(()=>Mn.success(`Profile '${o}' deleted`)).catch(l=>Mn.error(l instanceof Error?l.message:"Delete failed"))};return g.jsx("div",{className:"flex-1 overflow-y-auto",children:g.jsxs("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-5 px-6 py-6",children:[g.jsxs("header",{children:[g.jsx("h1",{className:"text-display-sm font-semibold tracking-tight text-text",children:"Profiles"}),g.jsx("p",{className:"mt-0.5 text-body-sm text-muted-foreground",children:"What a session runs as: a named Claude Code config directory — its own settings, memory, skills, and credentials — or a model provider for the model-agnostic engine."})]}),e.length===0?g.jsxs("div",{className:"flex flex-col items-center gap-2 rounded-md border border-border bg-surface px-4 py-8 text-center",children:[g.jsx(zP,{className:"size-6 text-fg-4"}),g.jsx("p",{className:"text-body-sm text-fg-2",children:"The server declares no profiles."}),g.jsxs("p",{className:"text-label text-fg-4",children:["Pass ",g.jsxs("code",{className:"font-mono",children:["profiles: [","{ name, configDir, … }","]"]})," to"," ",g.jsx("code",{className:"font-mono",children:"createWorkerServer"})," — without the option, a"," ",g.jsx("code",{className:"font-mono",children:"default"})," profile is auto-created from"," ",g.jsx("code",{className:"font-mono",children:"~/.claude"})," when it exists."]})]}):g.jsx("ul",{className:"divide-y divide-border rounded-md border border-border bg-surface",children:e.map(o=>g.jsxs("li",{className:"flex items-center gap-3 px-3 py-2.5",children:[g.jsx(b9,{className:"size-4 shrink-0 text-fg-3"}),g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"truncate text-body-sm font-medium text-fg-1",children:o.name}),o.description?g.jsx("span",{className:"truncate text-body-sm text-fg-3",children:o.description}):null]}),g.jsx("div",{className:"mt-0.5 truncate font-mono text-label text-fg-4",children:o.configDir??(o.provider?`${o.provider.id}${o.provider.model?` · ${o.provider.model}`:""}`:"")})]}),g.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[g.jsx(ts,{variant:"neutral",children:o.engine??"claude"}),o.defaults?.model?g.jsx(ts,{variant:"neutral",children:o.defaults.model}):null,o.defaults?.permissionMode?g.jsx(ts,{variant:"neutral",children:o.defaults.permissionMode}):null,o.configDir?g.jsx($t,{variant:"ghost",size:"icon-sm","aria-label":`Open ${o.name} in VSCode`,title:"Open config dir in VSCode",onClick:()=>_R(o.configDir),children:g.jsx(B3,{className:"size-4"})}):null,g.jsx($t,{variant:"ghost",size:"icon-sm","aria-label":`View ${o.name}`,title:"View profile",onClick:()=>void r({to:"/profiles/$profileName",params:{profileName:o.name}}),children:g.jsx(H3,{className:"size-4"})}),o.managed?g.jsx($t,{variant:"ghost",size:"icon-sm","aria-label":`Delete ${o.name}`,title:"Delete profile",onClick:()=>i(o.name),children:g.jsx(k1,{className:"size-4"})}):null]})]},o.name))}),t?g.jsx(MZ,{onCreated:n}):null,g.jsxs("p",{className:"text-label text-fg-4",children:["Session and job creates run under the selected profile; when the server declares more than one, picking a profile is required."," ",t?"Profiles created here are stored by the server; the ones declared in its options are code and stay read-only.":"Profiles are declared in server configuration and read-only here."]})]})})}function _n({label:e,children:t}){return g.jsxs("div",{className:"flex items-baseline justify-between gap-4 py-1.5",children:[g.jsx("span",{className:"shrink-0 text-label font-medium text-fg-3",children:e}),g.jsx("span",{className:"min-w-0 text-right text-body-sm text-fg-1",children:t})]})}function Fi({items:e,empty:t}){return e.length===0?g.jsx("span",{className:"text-fg-4",children:t}):g.jsx("span",{className:"flex flex-wrap justify-end gap-1",children:e.map(n=>g.jsx(ts,{variant:"neutral",children:n},n))})}function PZ(){const{profileName:e}=Oh({from:"/profiles/$profileName"}),[t,n]=S.useState(),[r,i]=S.useState();S.useEffect(()=>{let c=!0;return Kn.getProfile(e).then(f=>{c&&n(f)}).catch(f=>{c&&i(f instanceof Error?f.message:"Failed to load profile")}),()=>{c=!1}},[e]);const o=t?.profile,l=t?.config;return g.jsx("div",{className:"flex-1 overflow-y-auto",children:g.jsxs("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-5 px-6 py-6",children:[g.jsxs("header",{className:"flex items-end justify-between gap-3",children:[g.jsxs("div",{className:"min-w-0",children:[g.jsxs(Sc,{to:"/profiles",className:"mb-1 inline-flex items-center gap-1 text-label text-fg-3 hover:text-fg-1",children:[g.jsx(D3,{className:"size-3"}),"Profiles"]}),g.jsx("h1",{className:"truncate text-display-sm font-semibold tracking-tight text-text",children:e}),o?.description?g.jsx("p",{className:"mt-0.5 text-body-sm text-muted-foreground",children:o.description}):null]}),o?.configDir?g.jsxs($t,{variant:"outline",size:"xs",onClick:()=>_R(o.configDir),children:[g.jsx(B3,{className:"size-3"}),"Open in VSCode"]}):null]}),r?g.jsx("div",{className:"rounded-md bg-danger-bg px-3 py-2 text-body-sm text-danger",children:r}):null,!t&&!r?g.jsx(ci,{className:"mx-auto size-5 text-fg-4"}):null,o&&l?g.jsxs(g.Fragment,{children:[g.jsxs(As,{children:[g.jsx(_s,{children:g.jsx(Ns,{children:"Worker defaults"})}),g.jsxs(Rs,{className:"flex flex-col divide-y divide-border",children:[g.jsx(_n,{label:"Engine",children:g.jsx(ts,{variant:"neutral",children:o.engine??"claude"})}),o.engine==="provider"?g.jsx(_n,{label:"Provider",children:g.jsx("span",{className:"font-mono text-label",children:o.provider?.id})}):g.jsx(_n,{label:"Config directory",children:g.jsx("span",{className:"font-mono text-label",children:o.configDir})}),g.jsx(_n,{label:"Default model",children:o.defaults?.model??o.provider?.model??g.jsx("span",{className:"text-fg-4",children:"request / engine default"})}),g.jsx(_n,{label:"Default permission mode",children:o.defaults?.permissionMode??g.jsx("span",{className:"text-fg-4",children:"request / engine default"})}),o.engine==="provider"?g.jsxs(g.Fragment,{children:[g.jsx(_n,{label:"Models offered",children:g.jsx(Fi,{items:o.provider?.models??[],empty:"the default model only"})}),g.jsx(_n,{label:"API key variable",children:o.provider?.apiKeyEnv?g.jsx("span",{className:"font-mono text-label",children:o.provider.apiKeyEnv}):g.jsx("span",{className:"text-fg-4",children:"provider SDK default"})})]}):null]})]}),o.engine==="provider"?g.jsxs(As,{children:[g.jsx(_s,{children:g.jsx(Ns,{children:"Session grants"})}),g.jsxs(Rs,{className:"flex flex-col divide-y divide-border",children:[g.jsx(_n,{label:"Capabilities",children:g.jsx(Fi,{items:o.session?.capabilities??[],empty:"not declared — whatever the server wired"})}),g.jsx(_n,{label:"MCP servers",children:g.jsx(Fi,{items:o.session?.mcpServers??[],empty:"not declared — every connected server"})}),g.jsx(_n,{label:"Instructions",children:o.session?.instructions?`${o.session.instructions.length} characters`:g.jsx("span",{className:"text-fg-4",children:"none"})})]})]}):null,o.engine==="provider"?null:g.jsxs(As,{children:[g.jsx(_s,{children:g.jsx(Ns,{children:"Claude Code configuration"})}),g.jsxs(Rs,{className:"flex flex-col divide-y divide-border",children:[l.settings?g.jsxs(g.Fragment,{children:[g.jsx(_n,{label:"Model (settings.json)",children:l.settings.model??g.jsx("span",{className:"text-fg-4",children:"not set"})}),g.jsx(_n,{label:"Default permission mode",children:l.settings.defaultPermissionMode??g.jsx("span",{className:"text-fg-4",children:"not set"})}),g.jsx(_n,{label:"Permission rules",children:g.jsx("span",{className:"font-mono text-label",children:l.settings.permissionRules?`${l.settings.permissionRules.allow} allow · ${l.settings.permissionRules.ask} ask · ${l.settings.permissionRules.deny} deny`:"—"})}),g.jsx(_n,{label:"Env vars (names only)",children:g.jsx(Fi,{items:l.settings.envKeys??[],empty:"none"})}),g.jsx(_n,{label:"Hooks",children:g.jsx(Fi,{items:l.settings.hooks??[],empty:"none"})})]}):g.jsx(_n,{label:"settings.json",children:g.jsx("span",{className:"text-fg-4",children:"not found"})}),g.jsx(_n,{label:"User memory (CLAUDE.md)",children:l.hasUserMemory?"present":g.jsx("span",{className:"text-fg-4",children:"none"})}),g.jsx(_n,{label:"Skills",children:g.jsx(Fi,{items:l.skills,empty:"none"})}),g.jsx(_n,{label:"Agents",children:g.jsx(Fi,{items:l.agents,empty:"none"})}),g.jsx(_n,{label:"Commands",children:g.jsx(Fi,{items:l.commands,empty:"none"})})]})]}),o.managed?g.jsx(IZ,{profile:o,onSaved:c=>n({...t,profile:c})}):null,g.jsxs("p",{className:"text-label text-fg-4",children:[o.managed?"Stored on the server and editable here. ":"View only — this profile is declared in the server options. ","Other profile configuration lives on the server (the"," ",g.jsx("code",{className:"font-mono",children:"profiles"})," option; for Claude profiles, the config directory itself, e.g. via VSCode). Provider credentials are resolved from the server's environment and never leave it."]})]}):null]})})}function jZ(){const{sessionId:e}=Oh({from:"/sessions/$sessionId"}),t=yl(),[n,r]=S.useState();S.useEffect(()=>{let o=!1;return Kn.getSession(e).then(l=>{o||r(l)}).catch(()=>{Mn.error("Session not found"),t({to:"/sessions"})}),()=>{o=!0}},[e,t]);const i=async()=>{try{await Kn.deleteSession(e)}catch{}t({to:"/sessions"})};return g.jsx(dZ,{client:Kn,sessionId:e,header:g.jsxs("div",{className:"flex items-center gap-2 border-b border-border bg-surface px-3 py-2",children:[g.jsx(Sc,{to:"/sessions","aria-label":"Back to sessions",children:g.jsx($t,{variant:"ghost",size:"icon-sm",children:g.jsx(D3,{className:"size-4"})})}),g.jsx("span",{className:"truncate text-body-sm font-medium text-fg-1",children:n?.title??e.slice(0,8)}),n?.cwd?g.jsx("span",{className:"truncate font-mono text-label text-fg-4",children:n.cwd}):null,g.jsx("span",{className:"flex-1"}),g.jsx(Q3,{value:e,"aria-label":"Copy session id"}),g.jsxs(q9,{children:[g.jsx(Y9,{render:g.jsx($t,{variant:"ghost",size:"icon-sm","aria-label":"Close session",children:g.jsx(k1,{className:"size-4 text-fg-3"})})}),g.jsxs(X9,{children:[g.jsx(K9,{children:"Close this session?"}),g.jsx(Q9,{children:"The Claude Code subprocess is terminated. You can resume it later from “Resume a previous session” (the transcript is kept on disk by the SDK)."}),g.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[g.jsx(G9,{render:g.jsx($t,{variant:"outline",children:"Cancel"})}),g.jsx($t,{variant:"destructive",onClick:()=>void i(),children:"Close session"})]})]})]})]})},e)}const sw="workerdeck.last-cwd";function BZ({onCreated:e}){const[t,n]=S.useState(()=>localStorage.getItem(sw)??""),[r,i]=S.useState(""),[o,l]=S.useState(()=>gx("session")),[c,f]=S.useState(()=>mx("session")),[d,m]=S.useState(""),{profiles:p,profile:b,selected:y,select:E}=kR(),w=SR(y,o,c),[k,C]=S.useState(!1),[A,_]=S.useState(),[N,D]=S.useState(!1),O=async M=>{const q=M?.cwd??t.trim();if(!q){Mn.error("Working directory is required");return}C(!0);try{localStorage.setItem(sw,t.trim()||q);const U=await Kn.createSession({cwd:q,profile:b||void 0,prompt:M?void 0:r.trim()||void 0,permissionMode:w.mode,model:w.model.trim()||void 0,resume:M?.sessionId,reasoningEffort:d&&w.reasoningEfforts.includes(d)?d:void 0,...w.capabilities.settingSources?{settingSources:["user","project"],allowDangerouslySkipPermissions:!0}:{}});e(U.id)}catch(U){Mn.error(U instanceof Error?U.message:"Failed to create session")}finally{C(!1)}},j=async()=>{if(!t.trim()){Mn.error("Set a working directory first — resumable sessions are listed per project");return}D(!0);try{_(await Kn.listSdkSessions({dir:t.trim(),limit:20,profile:b||void 0}))}catch(M){Mn.error(M instanceof Error?M.message:"Failed to list resumable sessions")}finally{D(!1)}};return g.jsxs(As,{children:[g.jsx(_s,{children:g.jsx(Ns,{children:"New session"})}),g.jsxs(Rs,{className:"flex flex-col gap-3",children:[g.jsxs("label",{className:"flex flex-col gap-1",children:[g.jsx("span",{className:"text-label font-medium text-fg-3",children:"Working directory"}),g.jsx(bn,{value:t,onChange:M=>n(M.target.value),placeholder:"/path/to/project",spellCheck:!1,className:"font-mono"})]}),g.jsxs("label",{className:"flex flex-col gap-1",children:[g.jsx("span",{className:"text-label font-medium text-fg-3",children:"Initial prompt (optional)"}),g.jsx(Gb,{value:r,onChange:M=>i(M.target.value),rows:2,placeholder:"e.g. /verify-content 42, or a task description"})]}),g.jsxs("div",{className:"flex items-end justify-between gap-3",children:[g.jsx(vR,{profiles:p,value:b,onChange:M=>{E(M),_(void 0)},className:"min-w-32"}),g.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[g.jsx("span",{className:"text-label font-medium text-fg-3",children:"Permission mode"}),g.jsx(Rc,{variant:"form",mode:w.mode,onModeChange:l,modes:w.modes,className:"min-w-44"})]}),g.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[g.jsx("span",{className:"text-label font-medium text-fg-3",children:"Model"}),g.jsx(bx,{value:w.model,onChange:f,models:w.models,className:"min-w-44"})]}),w.reasoningEfforts.length>0?g.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[g.jsx("span",{className:"text-label font-medium text-fg-3",children:"Effort"}),g.jsxs(eo,{items:[{value:"default",label:"Default"},...w.reasoningEfforts.map(M=>({value:M,label:M}))],value:d||"default",onValueChange:M=>m(M==="default"?"":String(M)),children:[g.jsx(no,{className:"min-w-28",children:g.jsx(to,{})}),g.jsx(ro,{children:["default",...w.reasoningEfforts].map(M=>g.jsx(ra,{value:M,children:g.jsx(na,{children:M})},M))})]})]}):null,g.jsxs($t,{onClick:()=>void O(),disabled:k,children:[k?g.jsx(ci,{className:"size-3.5 text-current"}):g.jsx(w1,{className:"size-4"}),"Create"]})]}),w.capabilities.listSessions?g.jsxs("div",{className:"mt-1 border-t border-border pt-3",children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsx("span",{className:"text-label font-medium text-fg-3",children:"Resume a previous session"}),g.jsxs($t,{variant:"ghost",size:"xs",onClick:()=>void j(),disabled:N,children:[N?g.jsx(ci,{className:"size-3 text-current"}):g.jsx(VP,{className:"size-3"}),A?"Reload":"Browse"]})]}),A!==void 0?A.length===0?g.jsx("div",{className:"py-3 text-center text-body-sm text-fg-4",children:"No stored sessions for this directory."}):g.jsx("ul",{className:"mt-2 flex flex-col gap-1",children:A.map(M=>g.jsxs("li",{className:"flex items-center gap-2 rounded-md px-2 py-1.5 hover:bg-surface-hover",children:[g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsx("div",{className:"truncate text-body-sm text-fg-1",children:M.customTitle??M.summary}),g.jsxs("div",{className:"flex gap-2 font-mono text-label text-fg-4",children:[M.gitBranch?g.jsx("span",{className:"truncate",children:M.gitBranch}):null,g.jsx("span",{className:"shrink-0",children:N1(M.lastModified)})]})]}),g.jsx($t,{variant:"outline",size:"xs",onClick:()=>void O(M),disabled:k,children:"Resume"})]},M.sessionId))}):null]}):null]})]})}function HZ(){const e=yl(),{sessions:t,error:n,refresh:r}=AR(),i=o=>void e({to:"/sessions/$sessionId",params:{sessionId:o}});return g.jsx("div",{className:"flex-1 overflow-y-auto",children:g.jsxs("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-5 px-6 py-6",children:[g.jsxs("header",{className:"flex items-end justify-between",children:[g.jsxs("div",{children:[g.jsx("h1",{className:"text-display-sm font-semibold tracking-tight text-text",children:"Sessions"}),g.jsx("p",{className:"mt-0.5 text-body-sm text-muted-foreground",children:"Live Agent SDK sessions on this worker."})]}),g.jsx($t,{variant:"ghost",size:"icon-sm","aria-label":"Refresh",onClick:()=>void r(),children:g.jsx(z3,{className:"size-4"})})]}),n?g.jsxs("div",{className:"rounded-md bg-danger-bg px-3 py-2 text-body-sm text-danger",children:["Can’t reach the worker server: ",n,". Start it with ",g.jsx("code",{className:"font-mono",children:"pnpm server"}),"."]}):null,g.jsx(pZ,{sessions:[...t].sort((o,l)=>(l.lastActivityAt??l.createdAt)-(o.lastActivityAt??o.createdAt)),onSelect:i,onDelete:o=>{Kn.deleteSession(o).then(()=>r()).catch(l=>Mn.error(l instanceof Error?l.message:"Delete failed"))},emptyText:"No live sessions. Create one below."}),g.jsx(BZ,{onCreated:i})]})})}function iw({kind:e,label:t}){const[n,r]=S.useState(()=>mx(e)),[i,o]=S.useState(()=>gx(e));return g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-2",children:[g.jsx("span",{className:"text-body-sm text-fg-2",children:t}),g.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[g.jsx(Rc,{variant:"form",mode:i,onModeChange:l=>{o(l),EZ(e,l)},className:"min-w-40"}),g.jsx(bx,{value:n,onChange:l=>{r(l),xZ(e,l)},className:"min-w-44"})]})]})}function UZ(){return g.jsx("div",{className:"flex-1 overflow-y-auto",children:g.jsxs("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-4 px-6 py-6",children:[g.jsxs("header",{children:[g.jsx("h1",{className:"text-display-sm font-semibold tracking-tight text-text",children:"Settings"}),g.jsx("p",{className:"mt-0.5 text-body-sm text-muted-foreground",children:"Client-side preferences. Server policy (auth, cwd roots, API-key requirements) is configured where the worker runs."})]}),g.jsxs(As,{children:[g.jsx(_s,{children:g.jsx(Ns,{children:"Appearance"})}),g.jsxs(Rs,{className:"flex items-center justify-between",children:[g.jsx("span",{className:"text-body-sm text-fg-2",children:"Theme"}),g.jsx(yR,{})]})]}),g.jsxs(As,{children:[g.jsx(_s,{children:g.jsx(Ns,{children:"Defaults"})}),g.jsxs(Rs,{className:"flex flex-col gap-3",children:[g.jsx(iw,{kind:"session",label:"New session"}),g.jsx(iw,{kind:"job",label:"Queue job"}),g.jsx("p",{className:"text-label text-fg-4",children:'Pre-fills the permission mode and model on the new-session and schedule-job forms (still editable per run). "Default (recommended)" leaves the model to the CLI.'})]})]}),g.jsxs(As,{children:[g.jsx(_s,{children:g.jsx(Ns,{children:"Worker server"})}),g.jsxs(Rs,{className:"flex flex-col gap-1 text-body-sm text-fg-2",children:[g.jsxs("div",{children:["Endpoint: ",g.jsxs("code",{className:"font-mono text-code",children:[location.origin,"/v1"]})," (dev proxy → ",g.jsx("code",{className:"font-mono text-code",children:"WORKER_URL"}),", default"," ",g.jsx("code",{className:"font-mono text-code",children:"http://127.0.0.1:8787"}),")"]}),g.jsx("div",{className:"text-label text-fg-4",children:"Anthropic credentials are resolved by the SDK from the server operator’s environment — this app never handles them."})]})]})]})})}const ha=kI({component:bZ}),zZ=lo({getParentRoute:()=>ha,path:"/",beforeLoad:()=>{throw yw({to:"/sessions"})}}),FZ=lo({getParentRoute:()=>ha,path:"/sessions",component:HZ}),VZ=lo({getParentRoute:()=>ha,path:"/sessions/$sessionId",component:jZ}),$Z=lo({getParentRoute:()=>ha,path:"/jobs",component:RZ}),qZ=lo({getParentRoute:()=>ha,path:"/profiles",component:DZ}),YZ=lo({getParentRoute:()=>ha,path:"/profiles/$profileName",component:PZ}),GZ=lo({getParentRoute:()=>ha,path:"/settings",component:UZ}),XZ=HI({routeTree:ha.addChildren([zZ,FZ,VZ,$Z,qZ,YZ,GZ]),history:$4()});function KZ(){return g.jsxs(g.Fragment,{children:[g.jsx(FI,{router:XZ}),g.jsx(F7,{})]})}lw();const NR=document.getElementById("root");if(!NR)throw new Error("Root element #root not found");QO.createRoot(NR).render(g.jsx(S.StrictMode,{children:g.jsx(KZ,{})}));const QZ=Object.freeze(Object.defineProperty({__proto__:null,Mermaid:bR},Symbol.toStringTag,{value:"Module"}));export{HQ as A,JZ as L,Hr as R,bc as _,g as j,S as r};
|