@waniwani/sdk 0.17.2 → 0.18.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/dist/chat/embed.js +93 -93
- package/dist/chat/embed.js.map +1 -1
- package/dist/chat/index.d.ts +1 -100
- package/dist/chat/index.js +7 -7
- package/dist/chat/index.js.map +1 -1
- package/dist/legacy/index.d.ts +0 -38
- package/dist/legacy/index.js +13 -13
- package/dist/legacy/index.js.map +1 -1
- package/dist/mcp/index.d.ts +0 -15
- package/dist/mcp/index.js +5 -5
- package/dist/mcp/index.js.map +1 -1
- package/package.json +1 -1
package/dist/chat/embed.js
CHANGED
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
"use strict";var WaniWaniChatEmbed=(()=>{var zD=Object.create;var Cu=Object.defineProperty;var qD=Object.getOwnPropertyDescriptor;var HD=Object.getOwnPropertyNames;var jD=Object.getPrototypeOf,VD=Object.prototype.hasOwnProperty;var GD=(e,t,a)=>t in e?Cu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a;var C=(e,t)=>()=>(e&&(t=e(e=0)),t);var Kt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ku=(e,t)=>{for(var a in t)Cu(e,a,{get:t[a],enumerable:!0})},WD=(e,t,a,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of HD(t))!VD.call(e,r)&&r!==a&&Cu(e,r,{get:()=>t[r],enumerable:!(n=qD(t,r))||n.enumerable});return e};var z=(e,t,a)=>(a=e!=null?zD(jD(e)):{},WD(t||!e||!e.__esModule?Cu(a,"default",{value:e,enumerable:!0}):a,e));var Y=(e,t,a)=>GD(e,typeof t!="symbol"?t+"":t,a);var Ax=Kt(de=>{"use strict";var ip=Symbol.for("react.transitional.element"),$D=Symbol.for("react.portal"),XD=Symbol.for("react.fragment"),KD=Symbol.for("react.strict_mode"),ZD=Symbol.for("react.profiler"),QD=Symbol.for("react.consumer"),YD=Symbol.for("react.context"),JD=Symbol.for("react.forward_ref"),e_=Symbol.for("react.suspense"),t_=Symbol.for("react.memo"),Cx=Symbol.for("react.lazy"),a_=Symbol.for("react.activity"),vx=Symbol.iterator;function n_(e){return e===null||typeof e!="object"?null:(e=vx&&e[vx]||e["@@iterator"],typeof e=="function"?e:null)}var kx={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Lx=Object.assign,Tx={};function $o(e,t,a){this.props=e,this.context=t,this.refs=Tx,this.updater=a||kx}$o.prototype.isReactComponent={};$o.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};$o.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Ex(){}Ex.prototype=$o.prototype;function lp(e,t,a){this.props=e,this.context=t,this.refs=Tx,this.updater=a||kx}var sp=lp.prototype=new Ex;sp.constructor=lp;Lx(sp,$o.prototype);sp.isPureReactComponent=!0;var bx=Array.isArray;function op(){}var ot={H:null,A:null,T:null,S:null},Mx=Object.prototype.hasOwnProperty;function up(e,t,a){var n=a.ref;return{$$typeof:ip,type:e,key:t,ref:n!==void 0?n:null,props:a}}function r_(e,t){return up(e.type,t,e.props)}function cp(e){return typeof e=="object"&&e!==null&&e.$$typeof===ip}function o_(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(a){return t[a]})}var Sx=/\/+/g;function rp(e,t){return typeof e=="object"&&e!==null&&e.key!=null?o_(""+e.key):t.toString(36)}function i_(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(op,op):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function Wo(e,t,a,n,r){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(o){case"bigint":case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case ip:case $D:i=!0;break;case Cx:return i=e._init,Wo(i(e._payload),t,a,n,r)}}if(i)return r=r(e),i=n===""?"."+rp(e,0):n,bx(r)?(a="",i!=null&&(a=i.replace(Sx,"$&/")+"/"),Wo(r,t,a,"",function(u){return u})):r!=null&&(cp(r)&&(r=r_(r,a+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(Sx,"$&/")+"/")+i)),t.push(r)),1;i=0;var l=n===""?".":n+":";if(bx(e))for(var s=0;s<e.length;s++)n=e[s],o=l+rp(n,s),i+=Wo(n,t,a,o,r);else if(s=n_(e),typeof s=="function")for(e=s.call(e),s=0;!(n=e.next()).done;)n=n.value,o=l+rp(n,s++),i+=Wo(n,t,a,o,r);else if(o==="object"){if(typeof e.then=="function")return Wo(i_(e),t,a,n,r);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return i}function Lu(e,t,a){if(e==null)return e;var n=[],r=0;return Wo(e,n,"","",function(o){return t.call(a,o,r++)}),n}function l_(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(a){(e._status===0||e._status===-1)&&(e._status=1,e._result=a)},function(a){(e._status===0||e._status===-1)&&(e._status=2,e._result=a)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Ix=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},s_={map:Lu,forEach:function(e,t,a){Lu(e,function(){t.apply(this,arguments)},a)},count:function(e){var t=0;return Lu(e,function(){t++}),t},toArray:function(e){return Lu(e,function(t){return t})||[]},only:function(e){if(!cp(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};de.Activity=a_;de.Children=s_;de.Component=$o;de.Fragment=XD;de.Profiler=ZD;de.PureComponent=lp;de.StrictMode=KD;de.Suspense=e_;de.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ot;de.__COMPILER_RUNTIME={__proto__:null,c:function(e){return ot.H.useMemoCache(e)}};de.cache=function(e){return function(){return e.apply(null,arguments)}};de.cacheSignal=function(){return null};de.cloneElement=function(e,t,a){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var n=Lx({},e.props),r=e.key;if(t!=null)for(o in t.key!==void 0&&(r=""+t.key),t)!Mx.call(t,o)||o==="key"||o==="__self"||o==="__source"||o==="ref"&&t.ref===void 0||(n[o]=t[o]);var o=arguments.length-2;if(o===1)n.children=a;else if(1<o){for(var i=Array(o),l=0;l<o;l++)i[l]=arguments[l+2];n.children=i}return up(e.type,r,n)};de.createContext=function(e){return e={$$typeof:YD,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:QD,_context:e},e};de.createElement=function(e,t,a){var n,r={},o=null;if(t!=null)for(n in t.key!==void 0&&(o=""+t.key),t)Mx.call(t,n)&&n!=="key"&&n!=="__self"&&n!=="__source"&&(r[n]=t[n]);var i=arguments.length-2;if(i===1)r.children=a;else if(1<i){for(var l=Array(i),s=0;s<i;s++)l[s]=arguments[s+2];r.children=l}if(e&&e.defaultProps)for(n in i=e.defaultProps,i)r[n]===void 0&&(r[n]=i[n]);return up(e,o,r)};de.createRef=function(){return{current:null}};de.forwardRef=function(e){return{$$typeof:JD,render:e}};de.isValidElement=cp;de.lazy=function(e){return{$$typeof:Cx,_payload:{_status:-1,_result:e},_init:l_}};de.memo=function(e,t){return{$$typeof:t_,type:e,compare:t===void 0?null:t}};de.startTransition=function(e){var t=ot.T,a={};ot.T=a;try{var n=e(),r=ot.S;r!==null&&r(a,n),typeof n=="object"&&n!==null&&typeof n.then=="function"&&n.then(op,Ix)}catch(o){Ix(o)}finally{t!==null&&a.types!==null&&(t.types=a.types),ot.T=t}};de.unstable_useCacheRefresh=function(){return ot.H.useCacheRefresh()};de.use=function(e){return ot.H.use(e)};de.useActionState=function(e,t,a){return ot.H.useActionState(e,t,a)};de.useCallback=function(e,t){return ot.H.useCallback(e,t)};de.useContext=function(e){return ot.H.useContext(e)};de.useDebugValue=function(){};de.useDeferredValue=function(e,t){return ot.H.useDeferredValue(e,t)};de.useEffect=function(e,t){return ot.H.useEffect(e,t)};de.useEffectEvent=function(e){return ot.H.useEffectEvent(e)};de.useId=function(){return ot.H.useId()};de.useImperativeHandle=function(e,t,a){return ot.H.useImperativeHandle(e,t,a)};de.useInsertionEffect=function(e,t){return ot.H.useInsertionEffect(e,t)};de.useLayoutEffect=function(e,t){return ot.H.useLayoutEffect(e,t)};de.useMemo=function(e,t){return ot.H.useMemo(e,t)};de.useOptimistic=function(e,t){return ot.H.useOptimistic(e,t)};de.useReducer=function(e,t,a){return ot.H.useReducer(e,t,a)};de.useRef=function(e){return ot.H.useRef(e)};de.useState=function(e){return ot.H.useState(e)};de.useSyncExternalStore=function(e,t,a){return ot.H.useSyncExternalStore(e,t,a)};de.useTransition=function(){return ot.H.useTransition()};de.version="19.2.4"});var Le=Kt((Xj,Rx)=>{"use strict";Rx.exports=Ax()});var qx=Kt(pt=>{"use strict";function mp(e,t){var a=e.length;e.push(t);e:for(;0<a;){var n=a-1>>>1,r=e[n];if(0<Tu(r,t))e[n]=t,e[a]=r,a=n;else break e}}function mn(e){return e.length===0?null:e[0]}function Mu(e){if(e.length===0)return null;var t=e[0],a=e.pop();if(a!==t){e[0]=a;e:for(var n=0,r=e.length,o=r>>>1;n<o;){var i=2*(n+1)-1,l=e[i],s=i+1,u=e[s];if(0>Tu(l,a))s<r&&0>Tu(u,l)?(e[n]=u,e[s]=a,n=s):(e[n]=l,e[i]=a,n=i);else if(s<r&&0>Tu(u,a))e[n]=u,e[s]=a,n=s;else break e}}return t}function Tu(e,t){var a=e.sortIndex-t.sortIndex;return a!==0?a:e.id-t.id}pt.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(Dx=performance,pt.unstable_now=function(){return Dx.now()}):(dp=Date,_x=dp.now(),pt.unstable_now=function(){return dp.now()-_x});var Dx,dp,_x,Mn=[],ur=[],u_=1,Ua=null,Zt=3,hp=!1,fl=!1,pl=!1,gp=!1,Nx=typeof setTimeout=="function"?setTimeout:null,Bx=typeof clearTimeout=="function"?clearTimeout:null,Ox=typeof setImmediate<"u"?setImmediate:null;function Eu(e){for(var t=mn(ur);t!==null;){if(t.callback===null)Mu(ur);else if(t.startTime<=e)Mu(ur),t.sortIndex=t.expirationTime,mp(Mn,t);else break;t=mn(ur)}}function yp(e){if(pl=!1,Eu(e),!fl)if(mn(Mn)!==null)fl=!0,Ko||(Ko=!0,Xo());else{var t=mn(ur);t!==null&&wp(yp,t.startTime-e)}}var Ko=!1,ml=-1,Ux=5,Fx=-1;function zx(){return gp?!0:!(pt.unstable_now()-Fx<Ux)}function fp(){if(gp=!1,Ko){var e=pt.unstable_now();Fx=e;var t=!0;try{e:{fl=!1,pl&&(pl=!1,Bx(ml),ml=-1),hp=!0;var a=Zt;try{t:{for(Eu(e),Ua=mn(Mn);Ua!==null&&!(Ua.expirationTime>e&&zx());){var n=Ua.callback;if(typeof n=="function"){Ua.callback=null,Zt=Ua.priorityLevel;var r=n(Ua.expirationTime<=e);if(e=pt.unstable_now(),typeof r=="function"){Ua.callback=r,Eu(e),t=!0;break t}Ua===mn(Mn)&&Mu(Mn),Eu(e)}else Mu(Mn);Ua=mn(Mn)}if(Ua!==null)t=!0;else{var o=mn(ur);o!==null&&wp(yp,o.startTime-e),t=!1}}break e}finally{Ua=null,Zt=a,hp=!1}t=void 0}}finally{t?Xo():Ko=!1}}}var Xo;typeof Ox=="function"?Xo=function(){Ox(fp)}:typeof MessageChannel<"u"?(pp=new MessageChannel,Px=pp.port2,pp.port1.onmessage=fp,Xo=function(){Px.postMessage(null)}):Xo=function(){Nx(fp,0)};var pp,Px;function wp(e,t){ml=Nx(function(){e(pt.unstable_now())},t)}pt.unstable_IdlePriority=5;pt.unstable_ImmediatePriority=1;pt.unstable_LowPriority=4;pt.unstable_NormalPriority=3;pt.unstable_Profiling=null;pt.unstable_UserBlockingPriority=2;pt.unstable_cancelCallback=function(e){e.callback=null};pt.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Ux=0<e?Math.floor(1e3/e):5};pt.unstable_getCurrentPriorityLevel=function(){return Zt};pt.unstable_next=function(e){switch(Zt){case 1:case 2:case 3:var t=3;break;default:t=Zt}var a=Zt;Zt=t;try{return e()}finally{Zt=a}};pt.unstable_requestPaint=function(){gp=!0};pt.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var a=Zt;Zt=e;try{return t()}finally{Zt=a}};pt.unstable_scheduleCallback=function(e,t,a){var n=pt.unstable_now();switch(typeof a=="object"&&a!==null?(a=a.delay,a=typeof a=="number"&&0<a?n+a:n):a=n,e){case 1:var r=-1;break;case 2:r=250;break;case 5:r=1073741823;break;case 4:r=1e4;break;default:r=5e3}return r=a+r,e={id:u_++,callback:t,priorityLevel:e,startTime:a,expirationTime:r,sortIndex:-1},a>n?(e.sortIndex=a,mp(ur,e),mn(Mn)===null&&e===mn(ur)&&(pl?(Bx(ml),ml=-1):pl=!0,wp(yp,a-n))):(e.sortIndex=r,mp(Mn,e),fl||hp||(fl=!0,Ko||(Ko=!0,Xo()))),e};pt.unstable_shouldYield=zx;pt.unstable_wrapCallback=function(e){var t=Zt;return function(){var a=Zt;Zt=t;try{return e.apply(this,arguments)}finally{Zt=a}}}});var jx=Kt((Zj,Hx)=>{"use strict";Hx.exports=qx()});var Gx=Kt(ta=>{"use strict";var c_=Le();function Vx(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function cr(){}var ea={d:{f:cr,r:function(){throw Error(Vx(522))},D:cr,C:cr,L:cr,m:cr,X:cr,S:cr,M:cr},p:0,findDOMNode:null},d_=Symbol.for("react.portal");function f_(e,t,a){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d_,key:n==null?null:""+n,children:e,containerInfo:t,implementation:a}}var hl=c_.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Au(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}ta.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ea;ta.createPortal=function(e,t){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(Vx(299));return f_(e,t,null,a)};ta.flushSync=function(e){var t=hl.T,a=ea.p;try{if(hl.T=null,ea.p=2,e)return e()}finally{hl.T=t,ea.p=a,ea.d.f()}};ta.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,ea.d.C(e,t))};ta.prefetchDNS=function(e){typeof e=="string"&&ea.d.D(e)};ta.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var a=t.as,n=Au(a,t.crossOrigin),r=typeof t.integrity=="string"?t.integrity:void 0,o=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;a==="style"?ea.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:n,integrity:r,fetchPriority:o}):a==="script"&&ea.d.X(e,{crossOrigin:n,integrity:r,fetchPriority:o,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};ta.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var a=Au(t.as,t.crossOrigin);ea.d.M(e,{crossOrigin:a,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&ea.d.M(e)};ta.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var a=t.as,n=Au(a,t.crossOrigin);ea.d.L(e,a,{crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};ta.preloadModule=function(e,t){if(typeof e=="string")if(t){var a=Au(t.as,t.crossOrigin);ea.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:a,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else ea.d.m(e)};ta.requestFormReset=function(e){ea.d.r(e)};ta.unstable_batchedUpdates=function(e,t){return e(t)};ta.useFormState=function(e,t,a){return hl.H.useFormState(e,t,a)};ta.useFormStatus=function(){return hl.H.useHostTransitionStatus()};ta.version="19.2.4"});var Xx=Kt((Yj,$x)=>{"use strict";function Wx(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Wx)}catch(e){console.error(e)}}Wx(),$x.exports=Gx()});var iI=Kt(td=>{"use strict";var Pt=jx(),vb=Le(),p_=Xx();function N(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function bb(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ts(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function Sb(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Ib(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Kx(e){if(ts(e)!==e)throw Error(N(188))}function m_(e){var t=e.alternate;if(!t){if(t=ts(e),t===null)throw Error(N(188));return t!==e?null:e}for(var a=e,n=t;;){var r=a.return;if(r===null)break;var o=r.alternate;if(o===null){if(n=r.return,n!==null){a=n;continue}break}if(r.child===o.child){for(o=r.child;o;){if(o===a)return Kx(r),e;if(o===n)return Kx(r),t;o=o.sibling}throw Error(N(188))}if(a.return!==n.return)a=r,n=o;else{for(var i=!1,l=r.child;l;){if(l===a){i=!0,a=r,n=o;break}if(l===n){i=!0,n=r,a=o;break}l=l.sibling}if(!i){for(l=o.child;l;){if(l===a){i=!0,a=o,n=r;break}if(l===n){i=!0,n=o,a=r;break}l=l.sibling}if(!i)throw Error(N(189))}}if(a.alternate!==n)throw Error(N(190))}if(a.tag!==3)throw Error(N(188));return a.stateNode.current===a?e:t}function Cb(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=Cb(e),t!==null)return t;e=e.sibling}return null}var st=Object.assign,h_=Symbol.for("react.element"),Ru=Symbol.for("react.transitional.element"),Il=Symbol.for("react.portal"),ti=Symbol.for("react.fragment"),kb=Symbol.for("react.strict_mode"),Yp=Symbol.for("react.profiler"),Lb=Symbol.for("react.consumer"),Bn=Symbol.for("react.context"),$m=Symbol.for("react.forward_ref"),Jp=Symbol.for("react.suspense"),em=Symbol.for("react.suspense_list"),Xm=Symbol.for("react.memo"),dr=Symbol.for("react.lazy"),tm=Symbol.for("react.activity"),g_=Symbol.for("react.memo_cache_sentinel"),Zx=Symbol.iterator;function gl(e){return e===null||typeof e!="object"?null:(e=Zx&&e[Zx]||e["@@iterator"],typeof e=="function"?e:null)}var y_=Symbol.for("react.client.reference");function am(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===y_?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ti:return"Fragment";case Yp:return"Profiler";case kb:return"StrictMode";case Jp:return"Suspense";case em:return"SuspenseList";case tm:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case Il:return"Portal";case Bn:return e.displayName||"Context";case Lb:return(e._context.displayName||"Context")+".Consumer";case $m:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Xm:return t=e.displayName||null,t!==null?t:am(e.type)||"Memo";case dr:t=e._payload,e=e._init;try{return am(e(t))}catch{}}return null}var Cl=Array.isArray,ie=vb.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ue=p_.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,lo={pending:!1,data:null,method:null,action:null},nm=[],ai=-1;function xn(e){return{current:e}}function Ht(e){0>ai||(e.current=nm[ai],nm[ai]=null,ai--)}function rt(e,t){ai++,nm[ai]=e.current,e.current=t}var wn=xn(null),ql=xn(null),Sr=xn(null),cc=xn(null);function dc(e,t){switch(rt(Sr,t),rt(ql,e),rt(wn,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?nb(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=nb(t),e=W0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Ht(wn),rt(wn,e)}function vi(){Ht(wn),Ht(ql),Ht(Sr)}function rm(e){e.memoizedState!==null&&rt(cc,e);var t=wn.current,a=W0(t,e.type);t!==a&&(rt(ql,e),rt(wn,a))}function fc(e){ql.current===e&&(Ht(wn),Ht(ql)),cc.current===e&&(Ht(cc),Yl._currentValue=lo)}var xp,Qx;function no(e){if(xp===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);xp=t&&t[1]||"",Qx=-1<a.stack.indexOf(`
|
|
1
|
+
"use strict";var WaniWaniChatEmbed=(()=>{var LD=Object.create;var bu=Object.defineProperty;var TD=Object.getOwnPropertyDescriptor;var AD=Object.getOwnPropertyNames;var MD=Object.getPrototypeOf,ED=Object.prototype.hasOwnProperty;var RD=(e,t,a)=>t in e?bu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a;var I=(e,t)=>()=>(e&&(t=e(e=0)),t);var Kt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Su=(e,t)=>{for(var a in t)bu(e,a,{get:t[a],enumerable:!0})},DD=(e,t,a,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of AD(t))!ED.call(e,r)&&r!==a&&bu(e,r,{get:()=>t[r],enumerable:!(n=TD(t,r))||n.enumerable});return e};var z=(e,t,a)=>(a=e!=null?LD(MD(e)):{},DD(t||!e||!e.__esModule?bu(a,"default",{value:e,enumerable:!0}):a,e));var Z=(e,t,a)=>RD(e,typeof t!="symbol"?t+"":t,a);var gx=Kt(se=>{"use strict";var Qf=Symbol.for("react.transitional.element"),_D=Symbol.for("react.portal"),OD=Symbol.for("react.fragment"),PD=Symbol.for("react.strict_mode"),ND=Symbol.for("react.profiler"),BD=Symbol.for("react.consumer"),UD=Symbol.for("react.context"),FD=Symbol.for("react.forward_ref"),zD=Symbol.for("react.suspense"),qD=Symbol.for("react.memo"),cx=Symbol.for("react.lazy"),HD=Symbol.for("react.activity"),lx=Symbol.iterator;function jD(e){return e===null||typeof e!="object"?null:(e=lx&&e[lx]||e["@@iterator"],typeof e=="function"?e:null)}var dx={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},fx=Object.assign,px={};function Wo(e,t,a){this.props=e,this.context=t,this.refs=px,this.updater=a||dx}Wo.prototype.isReactComponent={};Wo.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};Wo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function mx(){}mx.prototype=Wo.prototype;function Yf(e,t,a){this.props=e,this.context=t,this.refs=px,this.updater=a||dx}var Jf=Yf.prototype=new mx;Jf.constructor=Yf;fx(Jf,Wo.prototype);Jf.isPureReactComponent=!0;var ix=Array.isArray;function Zf(){}var it={H:null,A:null,T:null,S:null},hx=Object.prototype.hasOwnProperty;function ep(e,t,a){var n=a.ref;return{$$typeof:Qf,type:e,key:t,ref:n!==void 0?n:null,props:a}}function VD(e,t){return ep(e.type,t,e.props)}function tp(e){return typeof e=="object"&&e!==null&&e.$$typeof===Qf}function GD(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(a){return t[a]})}var sx=/\/+/g;function Kf(e,t){return typeof e=="object"&&e!==null&&e.key!=null?GD(""+e.key):t.toString(36)}function $D(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(Zf,Zf):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function $o(e,t,a,n,r){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var l=!1;if(e===null)l=!0;else switch(o){case"bigint":case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case Qf:case _D:l=!0;break;case cx:return l=e._init,$o(l(e._payload),t,a,n,r)}}if(l)return r=r(e),l=n===""?"."+Kf(e,0):n,ix(r)?(a="",l!=null&&(a=l.replace(sx,"$&/")+"/"),$o(r,t,a,"",function(u){return u})):r!=null&&(tp(r)&&(r=VD(r,a+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(sx,"$&/")+"/")+l)),t.push(r)),1;l=0;var i=n===""?".":n+":";if(ix(e))for(var s=0;s<e.length;s++)n=e[s],o=i+Kf(n,s),l+=$o(n,t,a,o,r);else if(s=jD(e),typeof s=="function")for(e=s.call(e),s=0;!(n=e.next()).done;)n=n.value,o=i+Kf(n,s++),l+=$o(n,t,a,o,r);else if(o==="object"){if(typeof e.then=="function")return $o($D(e),t,a,n,r);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return l}function Cu(e,t,a){if(e==null)return e;var n=[],r=0;return $o(e,n,"","",function(o){return t.call(a,o,r++)}),n}function WD(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(a){(e._status===0||e._status===-1)&&(e._status=1,e._result=a)},function(a){(e._status===0||e._status===-1)&&(e._status=2,e._result=a)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var ux=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},XD={map:Cu,forEach:function(e,t,a){Cu(e,function(){t.apply(this,arguments)},a)},count:function(e){var t=0;return Cu(e,function(){t++}),t},toArray:function(e){return Cu(e,function(t){return t})||[]},only:function(e){if(!tp(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};se.Activity=HD;se.Children=XD;se.Component=Wo;se.Fragment=OD;se.Profiler=ND;se.PureComponent=Yf;se.StrictMode=PD;se.Suspense=zD;se.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=it;se.__COMPILER_RUNTIME={__proto__:null,c:function(e){return it.H.useMemoCache(e)}};se.cache=function(e){return function(){return e.apply(null,arguments)}};se.cacheSignal=function(){return null};se.cloneElement=function(e,t,a){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var n=fx({},e.props),r=e.key;if(t!=null)for(o in t.key!==void 0&&(r=""+t.key),t)!hx.call(t,o)||o==="key"||o==="__self"||o==="__source"||o==="ref"&&t.ref===void 0||(n[o]=t[o]);var o=arguments.length-2;if(o===1)n.children=a;else if(1<o){for(var l=Array(o),i=0;i<o;i++)l[i]=arguments[i+2];n.children=l}return ep(e.type,r,n)};se.createContext=function(e){return e={$$typeof:UD,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:BD,_context:e},e};se.createElement=function(e,t,a){var n,r={},o=null;if(t!=null)for(n in t.key!==void 0&&(o=""+t.key),t)hx.call(t,n)&&n!=="key"&&n!=="__self"&&n!=="__source"&&(r[n]=t[n]);var l=arguments.length-2;if(l===1)r.children=a;else if(1<l){for(var i=Array(l),s=0;s<l;s++)i[s]=arguments[s+2];r.children=i}if(e&&e.defaultProps)for(n in l=e.defaultProps,l)r[n]===void 0&&(r[n]=l[n]);return ep(e,o,r)};se.createRef=function(){return{current:null}};se.forwardRef=function(e){return{$$typeof:FD,render:e}};se.isValidElement=tp;se.lazy=function(e){return{$$typeof:cx,_payload:{_status:-1,_result:e},_init:WD}};se.memo=function(e,t){return{$$typeof:qD,type:e,compare:t===void 0?null:t}};se.startTransition=function(e){var t=it.T,a={};it.T=a;try{var n=e(),r=it.S;r!==null&&r(a,n),typeof n=="object"&&n!==null&&typeof n.then=="function"&&n.then(Zf,ux)}catch(o){ux(o)}finally{t!==null&&a.types!==null&&(t.types=a.types),it.T=t}};se.unstable_useCacheRefresh=function(){return it.H.useCacheRefresh()};se.use=function(e){return it.H.use(e)};se.useActionState=function(e,t,a){return it.H.useActionState(e,t,a)};se.useCallback=function(e,t){return it.H.useCallback(e,t)};se.useContext=function(e){return it.H.useContext(e)};se.useDebugValue=function(){};se.useDeferredValue=function(e,t){return it.H.useDeferredValue(e,t)};se.useEffect=function(e,t){return it.H.useEffect(e,t)};se.useEffectEvent=function(e){return it.H.useEffectEvent(e)};se.useId=function(){return it.H.useId()};se.useImperativeHandle=function(e,t,a){return it.H.useImperativeHandle(e,t,a)};se.useInsertionEffect=function(e,t){return it.H.useInsertionEffect(e,t)};se.useLayoutEffect=function(e,t){return it.H.useLayoutEffect(e,t)};se.useMemo=function(e,t){return it.H.useMemo(e,t)};se.useOptimistic=function(e,t){return it.H.useOptimistic(e,t)};se.useReducer=function(e,t,a){return it.H.useReducer(e,t,a)};se.useRef=function(e){return it.H.useRef(e)};se.useState=function(e){return it.H.useState(e)};se.useSyncExternalStore=function(e,t,a){return it.H.useSyncExternalStore(e,t,a)};se.useTransition=function(){return it.H.useTransition()};se.version="19.2.4"});var De=Kt((_j,yx)=>{"use strict";yx.exports=gx()});var Tx=Kt(ft=>{"use strict";function op(e,t){var a=e.length;e.push(t);e:for(;0<a;){var n=a-1>>>1,r=e[n];if(0<Iu(r,t))e[n]=t,e[a]=r,a=n;else break e}}function dn(e){return e.length===0?null:e[0]}function Lu(e){if(e.length===0)return null;var t=e[0],a=e.pop();if(a!==t){e[0]=a;e:for(var n=0,r=e.length,o=r>>>1;n<o;){var l=2*(n+1)-1,i=e[l],s=l+1,u=e[s];if(0>Iu(i,a))s<r&&0>Iu(u,i)?(e[n]=u,e[s]=a,n=s):(e[n]=i,e[l]=a,n=l);else if(s<r&&0>Iu(u,a))e[n]=u,e[s]=a,n=s;else break e}}return t}function Iu(e,t){var a=e.sortIndex-t.sortIndex;return a!==0?a:e.id-t.id}ft.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(wx=performance,ft.unstable_now=function(){return wx.now()}):(ap=Date,xx=ap.now(),ft.unstable_now=function(){return ap.now()-xx});var wx,ap,xx,An=[],ur=[],KD=1,Na=null,Zt=3,lp=!1,di=!1,fi=!1,ip=!1,Sx=typeof setTimeout=="function"?setTimeout:null,Cx=typeof clearTimeout=="function"?clearTimeout:null,vx=typeof setImmediate<"u"?setImmediate:null;function ku(e){for(var t=dn(ur);t!==null;){if(t.callback===null)Lu(ur);else if(t.startTime<=e)Lu(ur),t.sortIndex=t.expirationTime,op(An,t);else break;t=dn(ur)}}function sp(e){if(fi=!1,ku(e),!di)if(dn(An)!==null)di=!0,Ko||(Ko=!0,Xo());else{var t=dn(ur);t!==null&&up(sp,t.startTime-e)}}var Ko=!1,pi=-1,Ix=5,kx=-1;function Lx(){return ip?!0:!(ft.unstable_now()-kx<Ix)}function np(){if(ip=!1,Ko){var e=ft.unstable_now();kx=e;var t=!0;try{e:{di=!1,fi&&(fi=!1,Cx(pi),pi=-1),lp=!0;var a=Zt;try{t:{for(ku(e),Na=dn(An);Na!==null&&!(Na.expirationTime>e&&Lx());){var n=Na.callback;if(typeof n=="function"){Na.callback=null,Zt=Na.priorityLevel;var r=n(Na.expirationTime<=e);if(e=ft.unstable_now(),typeof r=="function"){Na.callback=r,ku(e),t=!0;break t}Na===dn(An)&&Lu(An),ku(e)}else Lu(An);Na=dn(An)}if(Na!==null)t=!0;else{var o=dn(ur);o!==null&&up(sp,o.startTime-e),t=!1}}break e}finally{Na=null,Zt=a,lp=!1}t=void 0}}finally{t?Xo():Ko=!1}}}var Xo;typeof vx=="function"?Xo=function(){vx(np)}:typeof MessageChannel<"u"?(rp=new MessageChannel,bx=rp.port2,rp.port1.onmessage=np,Xo=function(){bx.postMessage(null)}):Xo=function(){Sx(np,0)};var rp,bx;function up(e,t){pi=Sx(function(){e(ft.unstable_now())},t)}ft.unstable_IdlePriority=5;ft.unstable_ImmediatePriority=1;ft.unstable_LowPriority=4;ft.unstable_NormalPriority=3;ft.unstable_Profiling=null;ft.unstable_UserBlockingPriority=2;ft.unstable_cancelCallback=function(e){e.callback=null};ft.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Ix=0<e?Math.floor(1e3/e):5};ft.unstable_getCurrentPriorityLevel=function(){return Zt};ft.unstable_next=function(e){switch(Zt){case 1:case 2:case 3:var t=3;break;default:t=Zt}var a=Zt;Zt=t;try{return e()}finally{Zt=a}};ft.unstable_requestPaint=function(){ip=!0};ft.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var a=Zt;Zt=e;try{return t()}finally{Zt=a}};ft.unstable_scheduleCallback=function(e,t,a){var n=ft.unstable_now();switch(typeof a=="object"&&a!==null?(a=a.delay,a=typeof a=="number"&&0<a?n+a:n):a=n,e){case 1:var r=-1;break;case 2:r=250;break;case 5:r=1073741823;break;case 4:r=1e4;break;default:r=5e3}return r=a+r,e={id:KD++,callback:t,priorityLevel:e,startTime:a,expirationTime:r,sortIndex:-1},a>n?(e.sortIndex=a,op(ur,e),dn(An)===null&&e===dn(ur)&&(fi?(Cx(pi),pi=-1):fi=!0,up(sp,a-n))):(e.sortIndex=r,op(An,e),di||lp||(di=!0,Ko||(Ko=!0,Xo()))),e};ft.unstable_shouldYield=Lx;ft.unstable_wrapCallback=function(e){var t=Zt;return function(){var a=Zt;Zt=t;try{return e.apply(this,arguments)}finally{Zt=a}}}});var Mx=Kt((Pj,Ax)=>{"use strict";Ax.exports=Tx()});var Rx=Kt(ta=>{"use strict";var ZD=De();function Ex(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function cr(){}var ea={d:{f:cr,r:function(){throw Error(Ex(522))},D:cr,C:cr,L:cr,m:cr,X:cr,S:cr,M:cr},p:0,findDOMNode:null},QD=Symbol.for("react.portal");function YD(e,t,a){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:QD,key:n==null?null:""+n,children:e,containerInfo:t,implementation:a}}var mi=ZD.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Tu(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}ta.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ea;ta.createPortal=function(e,t){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(Ex(299));return YD(e,t,null,a)};ta.flushSync=function(e){var t=mi.T,a=ea.p;try{if(mi.T=null,ea.p=2,e)return e()}finally{mi.T=t,ea.p=a,ea.d.f()}};ta.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,ea.d.C(e,t))};ta.prefetchDNS=function(e){typeof e=="string"&&ea.d.D(e)};ta.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var a=t.as,n=Tu(a,t.crossOrigin),r=typeof t.integrity=="string"?t.integrity:void 0,o=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;a==="style"?ea.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:n,integrity:r,fetchPriority:o}):a==="script"&&ea.d.X(e,{crossOrigin:n,integrity:r,fetchPriority:o,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};ta.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var a=Tu(t.as,t.crossOrigin);ea.d.M(e,{crossOrigin:a,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&ea.d.M(e)};ta.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var a=t.as,n=Tu(a,t.crossOrigin);ea.d.L(e,a,{crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};ta.preloadModule=function(e,t){if(typeof e=="string")if(t){var a=Tu(t.as,t.crossOrigin);ea.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:a,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else ea.d.m(e)};ta.requestFormReset=function(e){ea.d.r(e)};ta.unstable_batchedUpdates=function(e,t){return e(t)};ta.useFormState=function(e,t,a){return mi.H.useFormState(e,t,a)};ta.useFormStatus=function(){return mi.H.useHostTransitionStatus()};ta.version="19.2.4"});var Ox=Kt((Bj,_x)=>{"use strict";function Dx(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Dx)}catch(e){console.error(e)}}Dx(),_x.exports=Rx()});var $0=Kt(Yc=>{"use strict";var Nt=Mx(),lb=De(),JD=Ox();function P(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function ib(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function es(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function sb(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function ub(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Px(e){if(es(e)!==e)throw Error(P(188))}function e_(e){var t=e.alternate;if(!t){if(t=es(e),t===null)throw Error(P(188));return t!==e?null:e}for(var a=e,n=t;;){var r=a.return;if(r===null)break;var o=r.alternate;if(o===null){if(n=r.return,n!==null){a=n;continue}break}if(r.child===o.child){for(o=r.child;o;){if(o===a)return Px(r),e;if(o===n)return Px(r),t;o=o.sibling}throw Error(P(188))}if(a.return!==n.return)a=r,n=o;else{for(var l=!1,i=r.child;i;){if(i===a){l=!0,a=r,n=o;break}if(i===n){l=!0,n=r,a=o;break}i=i.sibling}if(!l){for(i=o.child;i;){if(i===a){l=!0,a=o,n=r;break}if(i===n){l=!0,n=o,a=r;break}i=i.sibling}if(!l)throw Error(P(189))}}if(a.alternate!==n)throw Error(P(190))}if(a.tag!==3)throw Error(P(188));return a.stateNode.current===a?e:t}function cb(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=cb(e),t!==null)return t;e=e.sibling}return null}var ct=Object.assign,t_=Symbol.for("react.element"),Au=Symbol.for("react.transitional.element"),Si=Symbol.for("react.portal"),tl=Symbol.for("react.fragment"),db=Symbol.for("react.strict_mode"),jp=Symbol.for("react.profiler"),fb=Symbol.for("react.consumer"),Nn=Symbol.for("react.context"),Um=Symbol.for("react.forward_ref"),Vp=Symbol.for("react.suspense"),Gp=Symbol.for("react.suspense_list"),Fm=Symbol.for("react.memo"),dr=Symbol.for("react.lazy"),$p=Symbol.for("react.activity"),a_=Symbol.for("react.memo_cache_sentinel"),Nx=Symbol.iterator;function hi(e){return e===null||typeof e!="object"?null:(e=Nx&&e[Nx]||e["@@iterator"],typeof e=="function"?e:null)}var n_=Symbol.for("react.client.reference");function Wp(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===n_?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case tl:return"Fragment";case jp:return"Profiler";case db:return"StrictMode";case Vp:return"Suspense";case Gp:return"SuspenseList";case $p:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case Si:return"Portal";case Nn:return e.displayName||"Context";case fb:return(e._context.displayName||"Context")+".Consumer";case Um:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Fm:return t=e.displayName||null,t!==null?t:Wp(e.type)||"Memo";case dr:t=e._payload,e=e._init;try{return Wp(e(t))}catch{}}return null}var Ci=Array.isArray,re=lb.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ze=JD.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,lo={pending:!1,data:null,method:null,action:null},Xp=[],al=-1;function gn(e){return{current:e}}function qt(e){0>al||(e.current=Xp[al],Xp[al]=null,al--)}function lt(e,t){al++,Xp[al]=e.current,e.current=t}var hn=gn(null),zi=gn(null),Sr=gn(null),ic=gn(null);function sc(e,t){switch(lt(Sr,t),lt(zi,e),lt(hn,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?jv(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=jv(t),e=D0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}qt(hn),lt(hn,e)}function vl(){qt(hn),qt(zi),qt(Sr)}function Kp(e){e.memoizedState!==null&<(ic,e);var t=hn.current,a=D0(t,e.type);t!==a&&(lt(zi,e),lt(hn,a))}function uc(e){zi.current===e&&(qt(hn),qt(zi)),ic.current===e&&(qt(ic),Qi._currentValue=lo)}var cp,Bx;function ao(e){if(cp===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);cp=t&&t[1]||"",Bx=-1<a.stack.indexOf(`
|
|
2
2
|
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+
|
|
4
|
-
`),u=
|
|
3
|
+
`+cp+e+Bx}var dp=!1;function fp(e,t){if(!e||dp)return"";dp=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var d=function(){throw Error()};if(Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(p){var f=p}Reflect.construct(e,[],d)}else{try{d.call()}catch(p){f=p}e.call(d.prototype)}}else{try{throw Error()}catch(p){f=p}(d=e())&&typeof d.catch=="function"&&d.catch(function(){})}}catch(p){if(p&&f&&typeof p.stack=="string")return[p.stack,f.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=n.DetermineComponentFrameRoot(),l=o[0],i=o[1];if(l&&i){var s=l.split(`
|
|
4
|
+
`),u=i.split(`
|
|
5
5
|
`);for(r=n=0;n<s.length&&!s[n].includes("DetermineComponentFrameRoot");)n++;for(;r<u.length&&!u[r].includes("DetermineComponentFrameRoot");)r++;if(n===s.length||r===u.length)for(n=s.length-1,r=u.length-1;1<=n&&0<=r&&s[n]!==u[r];)r--;for(;1<=n&&0<=r;n--,r--)if(s[n]!==u[r]){if(n!==1||r!==1)do if(n--,r--,0>r||s[n]!==u[r]){var c=`
|
|
6
|
-
`+s[n].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=n&&0<=r);break}}}finally{
|
|
6
|
+
`+s[n].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=n&&0<=r);break}}}finally{dp=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?ao(a):""}function r_(e,t){switch(e.tag){case 26:case 27:case 5:return ao(e.type);case 16:return ao("Lazy");case 13:return e.child!==t&&t!==null?ao("Suspense Fallback"):ao("Suspense");case 19:return ao("SuspenseList");case 0:case 15:return fp(e.type,!1);case 11:return fp(e.type.render,!1);case 1:return fp(e.type,!0);case 31:return ao("Activity");default:return""}}function Ux(e){try{var t="",a=null;do t+=r_(e,a),a=e,e=e.return;while(e);return t}catch(n){return`
|
|
7
7
|
Error generating stack: `+n.message+`
|
|
8
|
-
`+n.stack}}var om=Object.prototype.hasOwnProperty,Km=Pt.unstable_scheduleCallback,Sp=Pt.unstable_cancelCallback,x_=Pt.unstable_shouldYield,v_=Pt.unstable_requestPaint,ka=Pt.unstable_now,b_=Pt.unstable_getCurrentPriorityLevel,Tb=Pt.unstable_ImmediatePriority,Eb=Pt.unstable_UserBlockingPriority,pc=Pt.unstable_NormalPriority,S_=Pt.unstable_LowPriority,Mb=Pt.unstable_IdlePriority,I_=Pt.log,C_=Pt.unstable_setDisableYieldValue,as=null,La=null;function yr(e){if(typeof I_=="function"&&C_(e),La&&typeof La.setStrictMode=="function")try{La.setStrictMode(as,e)}catch{}}var Ta=Math.clz32?Math.clz32:T_,k_=Math.log,L_=Math.LN2;function T_(e){return e>>>=0,e===0?32:31-(k_(e)/L_|0)|0}var Du=256,_u=262144,Ou=4194304;function ro(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Fc(e,t,a){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes;e=e.warmLanes;var l=n&134217727;return l!==0?(n=l&~o,n!==0?r=ro(n):(i&=l,i!==0?r=ro(i):a||(a=l&~e,a!==0&&(r=ro(a))))):(l=n&~o,l!==0?r=ro(l):i!==0?r=ro(i):a||(a=n&~e,a!==0&&(r=ro(a)))),r===0?0:t!==0&&t!==r&&(t&o)===0&&(o=r&-r,a=t&-t,o>=a||o===32&&(a&4194048)!==0)?t:r}function ns(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function E_(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 Ab(){var e=Ou;return Ou<<=1,(Ou&62914560)===0&&(Ou=4194304),e}function Ip(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function rs(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function M_(e,t,a,n,r,o){var i=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var l=e.entanglements,s=e.expirationTimes,u=e.hiddenUpdates;for(a=i&~a;0<a;){var c=31-Ta(a),d=1<<c;l[c]=0,s[c]=-1;var f=u[c];if(f!==null)for(u[c]=null,c=0;c<f.length;c++){var p=f[c];p!==null&&(p.lane&=-536870913)}a&=~d}n!==0&&Rb(e,n,0),o!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=o&~(i&~t))}function Rb(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-Ta(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|a&261930}function Db(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var n=31-Ta(a),r=1<<n;r&t|e[n]&t&&(e[n]|=t),a&=~r}}function _b(e,t){var a=t&-t;return a=(a&42)!==0?1:Zm(a),(a&(e.suspendedLanes|t))!==0?0:a}function Zm(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Qm(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Ob(){var e=Ue.p;return e!==0?e:(e=window.event,e===void 0?32:nI(e.type))}function Jx(e,t){var a=Ue.p;try{return Ue.p=e,t()}finally{Ue.p=a}}var Pr=Math.random().toString(36).slice(2),Gt="__reactFiber$"+Pr,ma="__reactProps$"+Pr,Ri="__reactContainer$"+Pr,im="__reactEvents$"+Pr,A_="__reactListeners$"+Pr,R_="__reactHandles$"+Pr,ev="__reactResources$"+Pr,os="__reactMarker$"+Pr;function Ym(e){delete e[Gt],delete e[ma],delete e[im],delete e[A_],delete e[R_]}function ni(e){var t=e[Gt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[Ri]||a[Gt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=sb(e);e!==null;){if(a=e[Gt])return a;e=sb(e)}return t}e=a,a=e.parentNode}return null}function Di(e){if(e=e[Gt]||e[Ri]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function kl(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(N(33))}function pi(e){var t=e[ev];return t||(t=e[ev]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function qt(e){e[os]=!0}var Pb=new Set,Nb={};function wo(e,t){bi(e,t),bi(e+"Capture",t)}function bi(e,t){for(Nb[e]=t,e=0;e<t.length;e++)Pb.add(t[e])}var D_=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]*$"),tv={},av={};function __(e){return om.call(av,e)?!0:om.call(tv,e)?!1:D_.test(e)?av[e]=!0:(tv[e]=!0,!1)}function Ku(e,t,a){if(__(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var n=t.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function Pu(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function An(e,t,a,n){if(n===null)e.removeAttribute(a);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+n)}}function za(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Bb(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function O_(e,t,a){var n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(i){a=""+i,o.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return a},setValue:function(i){a=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function lm(e){if(!e._valueTracker){var t=Bb(e)?"checked":"value";e._valueTracker=O_(e,t,""+e[t])}}function Ub(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),n="";return e&&(n=Bb(e)?e.checked?"true":"false":e.value),e=n,e!==a?(t.setValue(e),!0):!1}function mc(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var P_=/[\n"\\]/g;function ja(e){return e.replace(P_,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function sm(e,t,a,n,r,o,i,l){e.name="",i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?e.type=i:e.removeAttribute("type"),t!=null?i==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+za(t)):e.value!==""+za(t)&&(e.value=""+za(t)):i!=="submit"&&i!=="reset"||e.removeAttribute("value"),t!=null?um(e,i,za(t)):a!=null?um(e,i,za(a)):n!=null&&e.removeAttribute("value"),r==null&&o!=null&&(e.defaultChecked=!!o),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.name=""+za(l):e.removeAttribute("name")}function Fb(e,t,a,n,r,o,i,l){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.type=o),t!=null||a!=null){if(!(o!=="submit"&&o!=="reset"||t!=null)){lm(e);return}a=a!=null?""+za(a):"",t=t!=null?""+za(t):a,l||t===e.value||(e.value=t),e.defaultValue=t}n=n??r,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=l?e.checked:!!n,e.defaultChecked=!!n,i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.name=i),lm(e)}function um(e,t,a){t==="number"&&mc(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function mi(e,t,a,n){if(e=e.options,t){t={};for(var r=0;r<a.length;r++)t["$"+a[r]]=!0;for(a=0;a<e.length;a++)r=t.hasOwnProperty("$"+e[a].value),e[a].selected!==r&&(e[a].selected=r),r&&n&&(e[a].defaultSelected=!0)}else{for(a=""+za(a),t=null,r=0;r<e.length;r++){if(e[r].value===a){e[r].selected=!0,n&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function zb(e,t,a){if(t!=null&&(t=""+za(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+za(a):""}function qb(e,t,a,n){if(t==null){if(n!=null){if(a!=null)throw Error(N(92));if(Cl(n)){if(1<n.length)throw Error(N(93));n=n[0]}a=n}a==null&&(a=""),t=a}a=za(t),e.defaultValue=a,n=e.textContent,n===a&&n!==""&&n!==null&&(e.value=n),lm(e)}function Si(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var N_=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 nv(e,t,a){var n=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?n?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":n?e.setProperty(t,a):typeof a!="number"||a===0||N_.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Hb(e,t,a){if(t!=null&&typeof t!="object")throw Error(N(62));if(e=e.style,a!=null){for(var n in a)!a.hasOwnProperty(n)||t!=null&&t.hasOwnProperty(n)||(n.indexOf("--")===0?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="");for(var r in t)n=t[r],t.hasOwnProperty(r)&&a[r]!==n&&nv(e,r,n)}else for(var o in t)t.hasOwnProperty(o)&&nv(e,o,t[o])}function Jm(e){if(e.indexOf("-")===-1)return!1;switch(e){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 B_=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"]]),U_=/^[\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 Zu(e){return U_.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Un(){}var cm=null;function eh(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ri=null,hi=null;function rv(e){var t=Di(e);if(t&&(e=t.stateNode)){var a=e[ma]||null;e:switch(e=t.stateNode,t.type){case"input":if(sm(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+ja(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var n=a[t];if(n!==e&&n.form===e.form){var r=n[ma]||null;if(!r)throw Error(N(90));sm(n,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<a.length;t++)n=a[t],n.form===e.form&&Ub(n)}break e;case"textarea":zb(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&mi(e,!!a.multiple,t,!1)}}}var Cp=!1;function jb(e,t,a){if(Cp)return e(t,a);Cp=!0;try{var n=e(t);return n}finally{if(Cp=!1,(ri!==null||hi!==null)&&(Qc(),ri&&(t=ri,e=hi,hi=ri=null,rv(t),e)))for(t=0;t<e.length;t++)rv(e[t])}}function Hl(e,t){var a=e.stateNode;if(a===null)return null;var n=a[ma]||null;if(n===null)return null;a=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(N(231,t,typeof a));return a}var jn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),dm=!1;if(jn)try{Zo={},Object.defineProperty(Zo,"passive",{get:function(){dm=!0}}),window.addEventListener("test",Zo,Zo),window.removeEventListener("test",Zo,Zo)}catch{dm=!1}var Zo,wr=null,th=null,Qu=null;function Vb(){if(Qu)return Qu;var e,t=th,a=t.length,n,r="value"in wr?wr.value:wr.textContent,o=r.length;for(e=0;e<a&&t[e]===r[e];e++);var i=a-e;for(n=1;n<=i&&t[a-n]===r[o-n];n++);return Qu=r.slice(e,1<n?1-n:void 0)}function Yu(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Nu(){return!0}function ov(){return!1}function ha(e){function t(a,n,r,o,i){this._reactName=a,this._targetInst=r,this.type=n,this.nativeEvent=o,this.target=i,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(a=e[l],this[l]=a?a(o):o[l]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Nu:ov,this.isPropagationStopped=ov,this}return st(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Nu)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Nu)},persist:function(){},isPersistent:Nu}),t}var xo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zc=ha(xo),is=st({},xo,{view:0,detail:0}),F_=ha(is),kp,Lp,yl,qc=st({},is,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ah,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==yl&&(yl&&e.type==="mousemove"?(kp=e.screenX-yl.screenX,Lp=e.screenY-yl.screenY):Lp=kp=0,yl=e),kp)},movementY:function(e){return"movementY"in e?e.movementY:Lp}}),iv=ha(qc),z_=st({},qc,{dataTransfer:0}),q_=ha(z_),H_=st({},is,{relatedTarget:0}),Tp=ha(H_),j_=st({},xo,{animationName:0,elapsedTime:0,pseudoElement:0}),V_=ha(j_),G_=st({},xo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),W_=ha(G_),$_=st({},xo,{data:0}),lv=ha($_),X_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},K_={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"},Z_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Q_(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Z_[e])?!!t[e]:!1}function ah(){return Q_}var Y_=st({},is,{key:function(e){if(e.key){var t=X_[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Yu(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?K_[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ah,charCode:function(e){return e.type==="keypress"?Yu(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Yu(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),J_=ha(Y_),eO=st({},qc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),sv=ha(eO),tO=st({},is,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ah}),aO=ha(tO),nO=st({},xo,{propertyName:0,elapsedTime:0,pseudoElement:0}),rO=ha(nO),oO=st({},qc,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),iO=ha(oO),lO=st({},xo,{newState:0,oldState:0}),sO=ha(lO),uO=[9,13,27,32],nh=jn&&"CompositionEvent"in window,El=null;jn&&"documentMode"in document&&(El=document.documentMode);var cO=jn&&"TextEvent"in window&&!El,Gb=jn&&(!nh||El&&8<El&&11>=El),uv=" ",cv=!1;function Wb(e,t){switch(e){case"keyup":return uO.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $b(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var oi=!1;function dO(e,t){switch(e){case"compositionend":return $b(t);case"keypress":return t.which!==32?null:(cv=!0,uv);case"textInput":return e=t.data,e===uv&&cv?null:e;default:return null}}function fO(e,t){if(oi)return e==="compositionend"||!nh&&Wb(e,t)?(e=Vb(),Qu=th=wr=null,oi=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Gb&&t.locale!=="ko"?null:t.data;default:return null}}var pO={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 dv(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!pO[e.type]:t==="textarea"}function Xb(e,t,a,n){ri?hi?hi.push(n):hi=[n]:ri=n,t=Dc(t,"onChange"),0<t.length&&(a=new zc("onChange","change",null,a,n),e.push({event:a,listeners:t}))}var Ml=null,jl=null;function mO(e){j0(e,0)}function Hc(e){var t=kl(e);if(Ub(t))return e}function fv(e,t){if(e==="change")return t}var Kb=!1;jn&&(jn?(Uu="oninput"in document,Uu||(Ep=document.createElement("div"),Ep.setAttribute("oninput","return;"),Uu=typeof Ep.oninput=="function"),Bu=Uu):Bu=!1,Kb=Bu&&(!document.documentMode||9<document.documentMode));var Bu,Uu,Ep;function pv(){Ml&&(Ml.detachEvent("onpropertychange",Zb),jl=Ml=null)}function Zb(e){if(e.propertyName==="value"&&Hc(jl)){var t=[];Xb(t,jl,e,eh(e)),jb(mO,t)}}function hO(e,t,a){e==="focusin"?(pv(),Ml=t,jl=a,Ml.attachEvent("onpropertychange",Zb)):e==="focusout"&&pv()}function gO(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Hc(jl)}function yO(e,t){if(e==="click")return Hc(t)}function wO(e,t){if(e==="input"||e==="change")return Hc(t)}function xO(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ma=typeof Object.is=="function"?Object.is:xO;function Vl(e,t){if(Ma(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),n=Object.keys(t);if(a.length!==n.length)return!1;for(n=0;n<a.length;n++){var r=a[n];if(!om.call(t,r)||!Ma(e[r],t[r]))return!1}return!0}function mv(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function hv(e,t){var a=mv(e);e=0;for(var n;a;){if(a.nodeType===3){if(n=e+a.textContent.length,e<=t&&n>=t)return{node:a,offset:t-e};e=n}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=mv(a)}}function Qb(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Qb(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Yb(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=mc(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=mc(e.document)}return t}function rh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var vO=jn&&"documentMode"in document&&11>=document.documentMode,ii=null,fm=null,Al=null,pm=!1;function gv(e,t,a){var n=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;pm||ii==null||ii!==mc(n)||(n=ii,"selectionStart"in n&&rh(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Al&&Vl(Al,n)||(Al=n,n=Dc(fm,"onSelect"),0<n.length&&(t=new zc("onSelect","select",null,t,a),e.push({event:t,listeners:n}),t.target=ii)))}function ao(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var li={animationend:ao("Animation","AnimationEnd"),animationiteration:ao("Animation","AnimationIteration"),animationstart:ao("Animation","AnimationStart"),transitionrun:ao("Transition","TransitionRun"),transitionstart:ao("Transition","TransitionStart"),transitioncancel:ao("Transition","TransitionCancel"),transitionend:ao("Transition","TransitionEnd")},Mp={},Jb={};jn&&(Jb=document.createElement("div").style,"AnimationEvent"in window||(delete li.animationend.animation,delete li.animationiteration.animation,delete li.animationstart.animation),"TransitionEvent"in window||delete li.transitionend.transition);function vo(e){if(Mp[e])return Mp[e];if(!li[e])return e;var t=li[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Jb)return Mp[e]=t[a];return e}var eS=vo("animationend"),tS=vo("animationiteration"),aS=vo("animationstart"),bO=vo("transitionrun"),SO=vo("transitionstart"),IO=vo("transitioncancel"),nS=vo("transitionend"),rS=new Map,mm="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(" ");mm.push("scrollEnd");function nn(e,t){rS.set(e,t),wo(t,[e])}var hc=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Fa=[],si=0,oh=0;function jc(){for(var e=si,t=oh=si=0;t<e;){var a=Fa[t];Fa[t++]=null;var n=Fa[t];Fa[t++]=null;var r=Fa[t];Fa[t++]=null;var o=Fa[t];if(Fa[t++]=null,n!==null&&r!==null){var i=n.pending;i===null?r.next=r:(r.next=i.next,i.next=r),n.pending=r}o!==0&&oS(a,r,o)}}function Vc(e,t,a,n){Fa[si++]=e,Fa[si++]=t,Fa[si++]=a,Fa[si++]=n,oh|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function ih(e,t,a,n){return Vc(e,t,a,n),gc(e)}function bo(e,t){return Vc(e,null,null,t),gc(e)}function oS(e,t,a){e.lanes|=a;var n=e.alternate;n!==null&&(n.lanes|=a);for(var r=!1,o=e.return;o!==null;)o.childLanes|=a,n=o.alternate,n!==null&&(n.childLanes|=a),o.tag===22&&(e=o.stateNode,e===null||e._visibility&1||(r=!0)),e=o,o=o.return;return e.tag===3?(o=e.stateNode,r&&t!==null&&(r=31-Ta(a),e=o.hiddenUpdates,n=e[r],n===null?e[r]=[t]:n.push(t),t.lane=a|536870912),o):null}function gc(e){if(50<Fl)throw Fl=0,Pm=null,Error(N(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ui={};function CO(e,t,a,n){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ia(e,t,a,n){return new CO(e,t,a,n)}function lh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function zn(e,t){var a=e.alternate;return a===null?(a=Ia(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function iS(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ju(e,t,a,n,r,o){var i=0;if(n=e,typeof e=="function")lh(e)&&(i=1);else if(typeof e=="string")i=TP(e,a,wn.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case tm:return e=Ia(31,a,t,r),e.elementType=tm,e.lanes=o,e;case ti:return so(a.children,r,o,t);case kb:i=8,r|=24;break;case Yp:return e=Ia(12,a,t,r|2),e.elementType=Yp,e.lanes=o,e;case Jp:return e=Ia(13,a,t,r),e.elementType=Jp,e.lanes=o,e;case em:return e=Ia(19,a,t,r),e.elementType=em,e.lanes=o,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Bn:i=10;break e;case Lb:i=9;break e;case $m:i=11;break e;case Xm:i=14;break e;case dr:i=16,n=null;break e}i=29,a=Error(N(130,e===null?"null":typeof e,"")),n=null}return t=Ia(i,a,t,r),t.elementType=e,t.type=n,t.lanes=o,t}function so(e,t,a,n){return e=Ia(7,e,n,t),e.lanes=a,e}function Ap(e,t,a){return e=Ia(6,e,null,t),e.lanes=a,e}function lS(e){var t=Ia(18,null,null,0);return t.stateNode=e,t}function Rp(e,t,a){return t=Ia(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var yv=new WeakMap;function Va(e,t){if(typeof e=="object"&&e!==null){var a=yv.get(e);return a!==void 0?a:(t={value:e,source:t,stack:Yx(t)},yv.set(e,t),t)}return{value:e,source:t,stack:Yx(t)}}var ci=[],di=0,yc=null,Gl=0,qa=[],Ha=0,Rr=null,hn=1,gn="";function Pn(e,t){ci[di++]=Gl,ci[di++]=yc,yc=e,Gl=t}function sS(e,t,a){qa[Ha++]=hn,qa[Ha++]=gn,qa[Ha++]=Rr,Rr=e;var n=hn;e=gn;var r=32-Ta(n)-1;n&=~(1<<r),a+=1;var o=32-Ta(t)+r;if(30<o){var i=r-r%5;o=(n&(1<<i)-1).toString(32),n>>=i,r-=i,hn=1<<32-Ta(t)+r|a<<r|n,gn=o+e}else hn=1<<o|a<<r|n,gn=e}function sh(e){e.return!==null&&(Pn(e,1),sS(e,1,0))}function uh(e){for(;e===yc;)yc=ci[--di],ci[di]=null,Gl=ci[--di],ci[di]=null;for(;e===Rr;)Rr=qa[--Ha],qa[Ha]=null,gn=qa[--Ha],qa[Ha]=null,hn=qa[--Ha],qa[Ha]=null}function uS(e,t){qa[Ha++]=hn,qa[Ha++]=gn,qa[Ha++]=Rr,hn=t.id,gn=t.overflow,Rr=e}var Wt=null,lt=null,Te=!1,Ir=null,Ga=!1,hm=Error(N(519));function Dr(e){var t=Error(N(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Wl(Va(t,e)),hm}function wv(e){var t=e.stateNode,a=e.type,n=e.memoizedProps;switch(t[Gt]=e,t[ma]=n,a){case"dialog":be("cancel",t),be("close",t);break;case"iframe":case"object":case"embed":be("load",t);break;case"video":case"audio":for(a=0;a<Zl.length;a++)be(Zl[a],t);break;case"source":be("error",t);break;case"img":case"image":case"link":be("error",t),be("load",t);break;case"details":be("toggle",t);break;case"input":be("invalid",t),Fb(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":be("invalid",t);break;case"textarea":be("invalid",t),qb(t,n.value,n.defaultValue,n.children)}a=n.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||n.suppressHydrationWarning===!0||G0(t.textContent,a)?(n.popover!=null&&(be("beforetoggle",t),be("toggle",t)),n.onScroll!=null&&be("scroll",t),n.onScrollEnd!=null&&be("scrollend",t),n.onClick!=null&&(t.onclick=Un),t=!0):t=!1,t||Dr(e,!0)}function xv(e){for(Wt=e.return;Wt;)switch(Wt.tag){case 5:case 31:case 13:Ga=!1;return;case 27:case 3:Ga=!0;return;default:Wt=Wt.return}}function Qo(e){if(e!==Wt)return!1;if(!Te)return xv(e),Te=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||zm(e.type,e.memoizedProps)),a=!a),a&<&&Dr(e),xv(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(N(317));lt=lb(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(N(317));lt=lb(e)}else t===27?(t=lt,Nr(e.type)?(e=Vm,Vm=null,lt=e):lt=t):lt=Wt?$a(e.stateNode.nextSibling):null;return!0}function po(){lt=Wt=null,Te=!1}function Dp(){var e=Ir;return e!==null&&(fa===null?fa=e:fa.push.apply(fa,e),Ir=null),e}function Wl(e){Ir===null?Ir=[e]:Ir.push(e)}var gm=xn(null),So=null,Fn=null;function pr(e,t,a){rt(gm,t._currentValue),t._currentValue=a}function qn(e){e._currentValue=gm.current,Ht(gm)}function ym(e,t,a){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===a)break;e=e.return}}function wm(e,t,a,n){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var o=r.dependencies;if(o!==null){var i=r.child;o=o.firstContext;e:for(;o!==null;){var l=o;o=r;for(var s=0;s<t.length;s++)if(l.context===t[s]){o.lanes|=a,l=o.alternate,l!==null&&(l.lanes|=a),ym(o.return,a,e),n||(i=null);break e}o=l.next}}else if(r.tag===18){if(i=r.return,i===null)throw Error(N(341));i.lanes|=a,o=i.alternate,o!==null&&(o.lanes|=a),ym(i,a,e),i=null}else i=r.child;if(i!==null)i.return=r;else for(i=r;i!==null;){if(i===e){i=null;break}if(r=i.sibling,r!==null){r.return=i.return,i=r;break}i=i.return}r=i}}function _i(e,t,a,n){e=null;for(var r=t,o=!1;r!==null;){if(!o){if((r.flags&524288)!==0)o=!0;else if((r.flags&262144)!==0)break}if(r.tag===10){var i=r.alternate;if(i===null)throw Error(N(387));if(i=i.memoizedProps,i!==null){var l=r.type;Ma(r.pendingProps.value,i.value)||(e!==null?e.push(l):e=[l])}}else if(r===cc.current){if(i=r.alternate,i===null)throw Error(N(387));i.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(Yl):e=[Yl])}r=r.return}e!==null&&wm(t,e,a,n),t.flags|=262144}function wc(e){for(e=e.firstContext;e!==null;){if(!Ma(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function mo(e){So=e,Fn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function $t(e){return cS(So,e)}function Fu(e,t){return So===null&&mo(e),cS(e,t)}function cS(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},Fn===null){if(e===null)throw Error(N(308));Fn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Fn=Fn.next=t;return a}var kO=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},LO=Pt.unstable_scheduleCallback,TO=Pt.unstable_NormalPriority,Dt={$$typeof:Bn,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ch(){return{controller:new kO,data:new Map,refCount:0}}function ls(e){e.refCount--,e.refCount===0&&LO(TO,function(){e.controller.abort()})}var Rl=null,xm=0,Ii=0,gi=null;function EO(e,t){if(Rl===null){var a=Rl=[];xm=0,Ii=Ph(),gi={status:"pending",value:void 0,then:function(n){a.push(n)}}}return xm++,t.then(vv,vv),t}function vv(){if(--xm===0&&Rl!==null){gi!==null&&(gi.status="fulfilled");var e=Rl;Rl=null,Ii=0,gi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function MO(e,t){var a=[],n={status:"pending",value:null,reason:null,then:function(r){a.push(r)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var r=0;r<a.length;r++)(0,a[r])(t)},function(r){for(n.status="rejected",n.reason=r,r=0;r<a.length;r++)(0,a[r])(void 0)}),n}var bv=ie.S;ie.S=function(e,t){C0=ka(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&EO(e,t),bv!==null&&bv(e,t)};var uo=xn(null);function dh(){var e=uo.current;return e!==null?e:tt.pooledCache}function ec(e,t){t===null?rt(uo,uo.current):rt(uo,t.pool)}function dS(){var e=dh();return e===null?null:{parent:Dt._currentValue,pool:e}}var Oi=Error(N(460)),fh=Error(N(474)),Gc=Error(N(542)),xc={then:function(){}};function Sv(e){return e=e.status,e==="fulfilled"||e==="rejected"}function fS(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(Un,Un),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Cv(e),e;default:if(typeof t.status=="string")t.then(Un,Un);else{if(e=tt,e!==null&&100<e.shellSuspendCounter)throw Error(N(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=n}},function(n){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Cv(e),e}throw co=t,Oi}}function oo(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(co=a,Oi):a}}var co=null;function Iv(){if(co===null)throw Error(N(459));var e=co;return co=null,e}function Cv(e){if(e===Oi||e===Gc)throw Error(N(483))}var yi=null,$l=0;function zu(e){var t=$l;return $l+=1,yi===null&&(yi=[]),fS(yi,e,t)}function wl(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function qu(e,t){throw t.$$typeof===h_?Error(N(525)):(e=Object.prototype.toString.call(t),Error(N(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function pS(e){function t(y,w){if(e){var g=y.deletions;g===null?(y.deletions=[w],y.flags|=16):g.push(w)}}function a(y,w){if(!e)return null;for(;w!==null;)t(y,w),w=w.sibling;return null}function n(y){for(var w=new Map;y!==null;)y.key!==null?w.set(y.key,y):w.set(y.index,y),y=y.sibling;return w}function r(y,w){return y=zn(y,w),y.index=0,y.sibling=null,y}function o(y,w,g){return y.index=g,e?(g=y.alternate,g!==null?(g=g.index,g<w?(y.flags|=67108866,w):g):(y.flags|=67108866,w)):(y.flags|=1048576,w)}function i(y){return e&&y.alternate===null&&(y.flags|=67108866),y}function l(y,w,g,b){return w===null||w.tag!==6?(w=Ap(g,y.mode,b),w.return=y,w):(w=r(w,g),w.return=y,w)}function s(y,w,g,b){var T=g.type;return T===ti?c(y,w,g.props.children,b,g.key):w!==null&&(w.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===dr&&oo(T)===w.type)?(w=r(w,g.props),wl(w,g),w.return=y,w):(w=Ju(g.type,g.key,g.props,null,y.mode,b),wl(w,g),w.return=y,w)}function u(y,w,g,b){return w===null||w.tag!==4||w.stateNode.containerInfo!==g.containerInfo||w.stateNode.implementation!==g.implementation?(w=Rp(g,y.mode,b),w.return=y,w):(w=r(w,g.children||[]),w.return=y,w)}function c(y,w,g,b,T){return w===null||w.tag!==7?(w=so(g,y.mode,b,T),w.return=y,w):(w=r(w,g),w.return=y,w)}function d(y,w,g){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return w=Ap(""+w,y.mode,g),w.return=y,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Ru:return g=Ju(w.type,w.key,w.props,null,y.mode,g),wl(g,w),g.return=y,g;case Il:return w=Rp(w,y.mode,g),w.return=y,w;case dr:return w=oo(w),d(y,w,g)}if(Cl(w)||gl(w))return w=so(w,y.mode,g,null),w.return=y,w;if(typeof w.then=="function")return d(y,zu(w),g);if(w.$$typeof===Bn)return d(y,Fu(y,w),g);qu(y,w)}return null}function f(y,w,g,b){var T=w!==null?w.key:null;if(typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint")return T!==null?null:l(y,w,""+g,b);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Ru:return g.key===T?s(y,w,g,b):null;case Il:return g.key===T?u(y,w,g,b):null;case dr:return g=oo(g),f(y,w,g,b)}if(Cl(g)||gl(g))return T!==null?null:c(y,w,g,b,null);if(typeof g.then=="function")return f(y,w,zu(g),b);if(g.$$typeof===Bn)return f(y,w,Fu(y,g),b);qu(y,g)}return null}function p(y,w,g,b,T){if(typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint")return y=y.get(g)||null,l(w,y,""+b,T);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Ru:return y=y.get(b.key===null?g:b.key)||null,s(w,y,b,T);case Il:return y=y.get(b.key===null?g:b.key)||null,u(w,y,b,T);case dr:return b=oo(b),p(y,w,g,b,T)}if(Cl(b)||gl(b))return y=y.get(g)||null,c(w,y,b,T,null);if(typeof b.then=="function")return p(y,w,g,zu(b),T);if(b.$$typeof===Bn)return p(y,w,g,Fu(w,b),T);qu(w,b)}return null}function m(y,w,g,b){for(var T=null,S=null,M=w,R=w=0,_=null;M!==null&&R<g.length;R++){M.index>R?(_=M,M=null):_=M.sibling;var k=f(y,M,g[R],b);if(k===null){M===null&&(M=_);break}e&&M&&k.alternate===null&&t(y,M),w=o(k,w,R),S===null?T=k:S.sibling=k,S=k,M=_}if(R===g.length)return a(y,M),Te&&Pn(y,R),T;if(M===null){for(;R<g.length;R++)M=d(y,g[R],b),M!==null&&(w=o(M,w,R),S===null?T=M:S.sibling=M,S=M);return Te&&Pn(y,R),T}for(M=n(M);R<g.length;R++)_=p(M,y,R,g[R],b),_!==null&&(e&&_.alternate!==null&&M.delete(_.key===null?R:_.key),w=o(_,w,R),S===null?T=_:S.sibling=_,S=_);return e&&M.forEach(function(G){return t(y,G)}),Te&&Pn(y,R),T}function x(y,w,g,b){if(g==null)throw Error(N(151));for(var T=null,S=null,M=w,R=w=0,_=null,k=g.next();M!==null&&!k.done;R++,k=g.next()){M.index>R?(_=M,M=null):_=M.sibling;var G=f(y,M,k.value,b);if(G===null){M===null&&(M=_);break}e&&M&&G.alternate===null&&t(y,M),w=o(G,w,R),S===null?T=G:S.sibling=G,S=G,M=_}if(k.done)return a(y,M),Te&&Pn(y,R),T;if(M===null){for(;!k.done;R++,k=g.next())k=d(y,k.value,b),k!==null&&(w=o(k,w,R),S===null?T=k:S.sibling=k,S=k);return Te&&Pn(y,R),T}for(M=n(M);!k.done;R++,k=g.next())k=p(M,y,R,k.value,b),k!==null&&(e&&k.alternate!==null&&M.delete(k.key===null?R:k.key),w=o(k,w,R),S===null?T=k:S.sibling=k,S=k);return e&&M.forEach(function(B){return t(y,B)}),Te&&Pn(y,R),T}function I(y,w,g,b){if(typeof g=="object"&&g!==null&&g.type===ti&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case Ru:e:{for(var T=g.key;w!==null;){if(w.key===T){if(T=g.type,T===ti){if(w.tag===7){a(y,w.sibling),b=r(w,g.props.children),b.return=y,y=b;break e}}else if(w.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===dr&&oo(T)===w.type){a(y,w.sibling),b=r(w,g.props),wl(b,g),b.return=y,y=b;break e}a(y,w);break}else t(y,w);w=w.sibling}g.type===ti?(b=so(g.props.children,y.mode,b,g.key),b.return=y,y=b):(b=Ju(g.type,g.key,g.props,null,y.mode,b),wl(b,g),b.return=y,y=b)}return i(y);case Il:e:{for(T=g.key;w!==null;){if(w.key===T)if(w.tag===4&&w.stateNode.containerInfo===g.containerInfo&&w.stateNode.implementation===g.implementation){a(y,w.sibling),b=r(w,g.children||[]),b.return=y,y=b;break e}else{a(y,w);break}else t(y,w);w=w.sibling}b=Rp(g,y.mode,b),b.return=y,y=b}return i(y);case dr:return g=oo(g),I(y,w,g,b)}if(Cl(g))return m(y,w,g,b);if(gl(g)){if(T=gl(g),typeof T!="function")throw Error(N(150));return g=T.call(g),x(y,w,g,b)}if(typeof g.then=="function")return I(y,w,zu(g),b);if(g.$$typeof===Bn)return I(y,w,Fu(y,g),b);qu(y,g)}return typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint"?(g=""+g,w!==null&&w.tag===6?(a(y,w.sibling),b=r(w,g),b.return=y,y=b):(a(y,w),b=Ap(g,y.mode,b),b.return=y,y=b),i(y)):a(y,w)}return function(y,w,g,b){try{$l=0;var T=I(y,w,g,b);return yi=null,T}catch(M){if(M===Oi||M===Gc)throw M;var S=Ia(29,M,null,y.mode);return S.lanes=b,S.return=y,S}}}var ho=pS(!0),mS=pS(!1),fr=!1;function ph(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function vm(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Cr(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function kr(e,t,a){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(Be&2)!==0){var r=n.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),n.pending=t,t=gc(e),oS(e,null,a),t}return Vc(e,n,t,a),gc(e)}function Dl(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,Db(e,a)}}function _p(e,t){var a=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,a===n)){var r=null,o=null;if(a=a.firstBaseUpdate,a!==null){do{var i={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};o===null?r=o=i:o=o.next=i,a=a.next}while(a!==null);o===null?r=o=t:o=o.next=t}else r=o=t;a={baseState:n.baseState,firstBaseUpdate:r,lastBaseUpdate:o,shared:n.shared,callbacks:n.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var bm=!1;function _l(){if(bm){var e=gi;if(e!==null)throw e}}function Ol(e,t,a,n){bm=!1;var r=e.updateQueue;fr=!1;var o=r.firstBaseUpdate,i=r.lastBaseUpdate,l=r.shared.pending;if(l!==null){r.shared.pending=null;var s=l,u=s.next;s.next=null,i===null?o=u:i.next=u,i=s;var c=e.alternate;c!==null&&(c=c.updateQueue,l=c.lastBaseUpdate,l!==i&&(l===null?c.firstBaseUpdate=u:l.next=u,c.lastBaseUpdate=s))}if(o!==null){var d=r.baseState;i=0,c=u=s=null,l=o;do{var f=l.lane&-536870913,p=f!==l.lane;if(p?(Ie&f)===f:(n&f)===f){f!==0&&f===Ii&&(bm=!0),c!==null&&(c=c.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var m=e,x=l;f=t;var I=a;switch(x.tag){case 1:if(m=x.payload,typeof m=="function"){d=m.call(I,d,f);break e}d=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=x.payload,f=typeof m=="function"?m.call(I,d,f):m,f==null)break e;d=st({},d,f);break e;case 2:fr=!0}}f=l.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=r.callbacks,p===null?r.callbacks=[f]:p.push(f))}else p={lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},c===null?(u=c=p,s=d):c=c.next=p,i|=f;if(l=l.next,l===null){if(l=r.shared.pending,l===null)break;p=l,l=p.next,p.next=null,r.lastBaseUpdate=p,r.shared.pending=null}}while(!0);c===null&&(s=d),r.baseState=s,r.firstBaseUpdate=u,r.lastBaseUpdate=c,o===null&&(r.shared.lanes=0),Or|=i,e.lanes=i,e.memoizedState=d}}function hS(e,t){if(typeof e!="function")throw Error(N(191,e));e.call(t)}function gS(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)hS(a[e],t)}var Ci=xn(null),vc=xn(0);function kv(e,t){e=$n,rt(vc,e),rt(Ci,t),$n=e|t.baseLanes}function Sm(){rt(vc,$n),rt(Ci,Ci.current)}function mh(){$n=vc.current,Ht(Ci),Ht(vc)}var Aa=xn(null),Wa=null;function mr(e){var t=e.alternate;rt(Ct,Ct.current&1),rt(Aa,e),Wa===null&&(t===null||Ci.current!==null||t.memoizedState!==null)&&(Wa=e)}function Im(e){rt(Ct,Ct.current),rt(Aa,e),Wa===null&&(Wa=e)}function yS(e){e.tag===22?(rt(Ct,Ct.current),rt(Aa,e),Wa===null&&(Wa=e)):hr(e)}function hr(){rt(Ct,Ct.current),rt(Aa,Aa.current)}function Sa(e){Ht(Aa),Wa===e&&(Wa=null),Ht(Ct)}var Ct=xn(0);function bc(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Hm(a)||jm(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Vn=0,me=null,Qe=null,At=null,Sc=!1,wi=!1,go=!1,Ic=0,Xl=0,xi=null,AO=0;function gt(){throw Error(N(321))}function hh(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!Ma(e[a],t[a]))return!1;return!0}function gh(e,t,a,n,r,o){return Vn=o,me=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ie.H=e===null||e.memoizedState===null?XS:Th,go=!1,o=a(n,r),go=!1,wi&&(o=xS(t,a,n,r)),wS(e),o}function wS(e){ie.H=Kl;var t=Qe!==null&&Qe.next!==null;if(Vn=0,At=Qe=me=null,Sc=!1,Xl=0,xi=null,t)throw Error(N(300));e===null||_t||(e=e.dependencies,e!==null&&wc(e)&&(_t=!0))}function xS(e,t,a,n){me=e;var r=0;do{if(wi&&(xi=null),Xl=0,wi=!1,25<=r)throw Error(N(301));if(r+=1,At=Qe=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}ie.H=KS,o=t(a,n)}while(wi);return o}function RO(){var e=ie.H,t=e.useState()[0];return t=typeof t.then=="function"?ss(t):t,e=e.useState()[0],(Qe!==null?Qe.memoizedState:null)!==e&&(me.flags|=1024),t}function yh(){var e=Ic!==0;return Ic=0,e}function wh(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function xh(e){if(Sc){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Sc=!1}Vn=0,At=Qe=me=null,wi=!1,Xl=Ic=0,xi=null}function aa(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return At===null?me.memoizedState=At=e:At=At.next=e,At}function kt(){if(Qe===null){var e=me.alternate;e=e!==null?e.memoizedState:null}else e=Qe.next;var t=At===null?me.memoizedState:At.next;if(t!==null)At=t,Qe=e;else{if(e===null)throw me.alternate===null?Error(N(467)):Error(N(310));Qe=e,e={memoizedState:Qe.memoizedState,baseState:Qe.baseState,baseQueue:Qe.baseQueue,queue:Qe.queue,next:null},At===null?me.memoizedState=At=e:At=At.next=e}return At}function Wc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ss(e){var t=Xl;return Xl+=1,xi===null&&(xi=[]),e=fS(xi,e,t),t=me,(At===null?t.memoizedState:At.next)===null&&(t=t.alternate,ie.H=t===null||t.memoizedState===null?XS:Th),e}function $c(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ss(e);if(e.$$typeof===Bn)return $t(e)}throw Error(N(438,String(e)))}function vh(e){var t=null,a=me.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var n=me.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=Wc(),me.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),n=0;n<e;n++)a[n]=g_;return t.index++,a}function Gn(e,t){return typeof t=="function"?t(e):t}function tc(e){var t=kt();return bh(t,Qe,e)}function bh(e,t,a){var n=e.queue;if(n===null)throw Error(N(311));n.lastRenderedReducer=a;var r=e.baseQueue,o=n.pending;if(o!==null){if(r!==null){var i=r.next;r.next=o.next,o.next=i}t.baseQueue=r=o,n.pending=null}if(o=e.baseState,r===null)e.memoizedState=o;else{t=r.next;var l=i=null,s=null,u=t,c=!1;do{var d=u.lane&-536870913;if(d!==u.lane?(Ie&d)===d:(Vn&d)===d){var f=u.revertLane;if(f===0)s!==null&&(s=s.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),d===Ii&&(c=!0);else if((Vn&f)===f){u=u.next,f===Ii&&(c=!0);continue}else d={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},s===null?(l=s=d,i=o):s=s.next=d,me.lanes|=f,Or|=f;d=u.action,go&&a(o,d),o=u.hasEagerState?u.eagerState:a(o,d)}else f={lane:d,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},s===null?(l=s=f,i=o):s=s.next=f,me.lanes|=d,Or|=d;u=u.next}while(u!==null&&u!==t);if(s===null?i=o:s.next=l,!Ma(o,e.memoizedState)&&(_t=!0,c&&(a=gi,a!==null)))throw a;e.memoizedState=o,e.baseState=i,e.baseQueue=s,n.lastRenderedState=o}return r===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function Op(e){var t=kt(),a=t.queue;if(a===null)throw Error(N(311));a.lastRenderedReducer=e;var n=a.dispatch,r=a.pending,o=t.memoizedState;if(r!==null){a.pending=null;var i=r=r.next;do o=e(o,i.action),i=i.next;while(i!==r);Ma(o,t.memoizedState)||(_t=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),a.lastRenderedState=o}return[o,n]}function vS(e,t,a){var n=me,r=kt(),o=Te;if(o){if(a===void 0)throw Error(N(407));a=a()}else a=t();var i=!Ma((Qe||r).memoizedState,a);if(i&&(r.memoizedState=a,_t=!0),r=r.queue,Sh(IS.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||At!==null&&At.memoizedState.tag&1){if(n.flags|=2048,ki(9,{destroy:void 0},SS.bind(null,n,r,a,t),null),tt===null)throw Error(N(349));o||(Vn&127)!==0||bS(n,t,a)}return a}function bS(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=me.updateQueue,t===null?(t=Wc(),me.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function SS(e,t,a,n){t.value=a,t.getSnapshot=n,CS(t)&&kS(e)}function IS(e,t,a){return a(function(){CS(t)&&kS(e)})}function CS(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Ma(e,a)}catch{return!0}}function kS(e){var t=bo(e,2);t!==null&&pa(t,e,2)}function Cm(e){var t=aa();if(typeof e=="function"){var a=e;if(e=a(),go){yr(!0);try{a()}finally{yr(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gn,lastRenderedState:e},t}function LS(e,t,a,n){return e.baseState=a,bh(e,Qe,typeof n=="function"?n:Gn)}function DO(e,t,a,n,r){if(Kc(e))throw Error(N(485));if(e=t.action,e!==null){var o={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(i){o.listeners.push(i)}};ie.T!==null?a(!0):o.isTransition=!1,n(o),a=t.pending,a===null?(o.next=t.pending=o,TS(t,o)):(o.next=a.next,t.pending=a.next=o)}}function TS(e,t){var a=t.action,n=t.payload,r=e.state;if(t.isTransition){var o=ie.T,i={};ie.T=i;try{var l=a(r,n),s=ie.S;s!==null&&s(i,l),Lv(e,t,l)}catch(u){km(e,t,u)}finally{o!==null&&i.types!==null&&(o.types=i.types),ie.T=o}}else try{o=a(r,n),Lv(e,t,o)}catch(u){km(e,t,u)}}function Lv(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(n){Tv(e,t,n)},function(n){return km(e,t,n)}):Tv(e,t,a)}function Tv(e,t,a){t.status="fulfilled",t.value=a,ES(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,TS(e,a)))}function km(e,t,a){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=a,ES(t),t=t.next;while(t!==n)}e.action=null}function ES(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function MS(e,t){return t}function Ev(e,t){if(Te){var a=tt.formState;if(a!==null){e:{var n=me;if(Te){if(lt){t:{for(var r=lt,o=Ga;r.nodeType!==8;){if(!o){r=null;break t}if(r=$a(r.nextSibling),r===null){r=null;break t}}o=r.data,r=o==="F!"||o==="F"?r:null}if(r){lt=$a(r.nextSibling),n=r.data==="F!";break e}}Dr(n)}n=!1}n&&(t=a[0])}}return a=aa(),a.memoizedState=a.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:MS,lastRenderedState:t},a.queue=n,a=GS.bind(null,me,n),n.dispatch=a,n=Cm(!1),o=Lh.bind(null,me,!1,n.queue),n=aa(),r={state:t,dispatch:null,action:e,pending:null},n.queue=r,a=DO.bind(null,me,r,o,a),r.dispatch=a,n.memoizedState=e,[t,a,!1]}function Mv(e){var t=kt();return AS(t,Qe,e)}function AS(e,t,a){if(t=bh(e,t,MS)[0],e=tc(Gn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=ss(t)}catch(i){throw i===Oi?Gc:i}else n=t;t=kt();var r=t.queue,o=r.dispatch;return a!==t.memoizedState&&(me.flags|=2048,ki(9,{destroy:void 0},_O.bind(null,r,a),null)),[n,o,e]}function _O(e,t){e.action=t}function Av(e){var t=kt(),a=Qe;if(a!==null)return AS(t,a,e);kt(),t=t.memoizedState,a=kt();var n=a.queue.dispatch;return a.memoizedState=e,[t,n,!1]}function ki(e,t,a,n){return e={tag:e,create:a,deps:n,inst:t,next:null},t=me.updateQueue,t===null&&(t=Wc(),me.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(n=a.next,a.next=e,e.next=n,t.lastEffect=e),e}function RS(){return kt().memoizedState}function ac(e,t,a,n){var r=aa();me.flags|=e,r.memoizedState=ki(1|t,{destroy:void 0},a,n===void 0?null:n)}function Xc(e,t,a,n){var r=kt();n=n===void 0?null:n;var o=r.memoizedState.inst;Qe!==null&&n!==null&&hh(n,Qe.memoizedState.deps)?r.memoizedState=ki(t,o,a,n):(me.flags|=e,r.memoizedState=ki(1|t,o,a,n))}function Rv(e,t){ac(8390656,8,e,t)}function Sh(e,t){Xc(2048,8,e,t)}function OO(e){me.flags|=4;var t=me.updateQueue;if(t===null)t=Wc(),me.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function DS(e){var t=kt().memoizedState;return OO({ref:t,nextImpl:e}),function(){if((Be&2)!==0)throw Error(N(440));return t.impl.apply(void 0,arguments)}}function _S(e,t){return Xc(4,2,e,t)}function OS(e,t){return Xc(4,4,e,t)}function PS(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function NS(e,t,a){a=a!=null?a.concat([e]):null,Xc(4,4,PS.bind(null,t,e),a)}function Ih(){}function BS(e,t){var a=kt();t=t===void 0?null:t;var n=a.memoizedState;return t!==null&&hh(t,n[1])?n[0]:(a.memoizedState=[e,t],e)}function US(e,t){var a=kt();t=t===void 0?null:t;var n=a.memoizedState;if(t!==null&&hh(t,n[1]))return n[0];if(n=e(),go){yr(!0);try{e()}finally{yr(!1)}}return a.memoizedState=[n,t],n}function Ch(e,t,a){return a===void 0||(Vn&1073741824)!==0&&(Ie&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=L0(),me.lanes|=e,Or|=e,a)}function FS(e,t,a,n){return Ma(a,t)?a:Ci.current!==null?(e=Ch(e,a,n),Ma(e,t)||(_t=!0),e):(Vn&42)===0||(Vn&1073741824)!==0&&(Ie&261930)===0?(_t=!0,e.memoizedState=a):(e=L0(),me.lanes|=e,Or|=e,t)}function zS(e,t,a,n,r){var o=Ue.p;Ue.p=o!==0&&8>o?o:8;var i=ie.T,l={};ie.T=l,Lh(e,!1,t,a);try{var s=r(),u=ie.S;if(u!==null&&u(l,s),s!==null&&typeof s=="object"&&typeof s.then=="function"){var c=MO(s,n);Pl(e,t,c,Ea(e))}else Pl(e,t,n,Ea(e))}catch(d){Pl(e,t,{then:function(){},status:"rejected",reason:d},Ea())}finally{Ue.p=o,i!==null&&l.types!==null&&(i.types=l.types),ie.T=i}}function PO(){}function Lm(e,t,a,n){if(e.tag!==5)throw Error(N(476));var r=qS(e).queue;zS(e,r,t,lo,a===null?PO:function(){return HS(e),a(n)})}function qS(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:lo,baseState:lo,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gn,lastRenderedState:lo},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gn,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function HS(e){var t=qS(e);t.next===null&&(t=e.alternate.memoizedState),Pl(e,t.next.queue,{},Ea())}function kh(){return $t(Yl)}function jS(){return kt().memoizedState}function VS(){return kt().memoizedState}function NO(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Ea();e=Cr(a);var n=kr(t,e,a);n!==null&&(pa(n,t,a),Dl(n,t,a)),t={cache:ch()},e.payload=t;return}t=t.return}}function BO(e,t,a){var n=Ea();a={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Kc(e)?WS(t,a):(a=ih(e,t,a,n),a!==null&&(pa(a,e,n),$S(a,t,n)))}function GS(e,t,a){var n=Ea();Pl(e,t,a,n)}function Pl(e,t,a,n){var r={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Kc(e))WS(t,r);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var i=t.lastRenderedState,l=o(i,a);if(r.hasEagerState=!0,r.eagerState=l,Ma(l,i))return Vc(e,t,r,0),tt===null&&jc(),!1}catch{}if(a=ih(e,t,r,n),a!==null)return pa(a,e,n),$S(a,t,n),!0}return!1}function Lh(e,t,a,n){if(n={lane:2,revertLane:Ph(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Kc(e)){if(t)throw Error(N(479))}else t=ih(e,a,n,2),t!==null&&pa(t,e,2)}function Kc(e){var t=e.alternate;return e===me||t!==null&&t===me}function WS(e,t){wi=Sc=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function $S(e,t,a){if((a&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,Db(e,a)}}var Kl={readContext:$t,use:$c,useCallback:gt,useContext:gt,useEffect:gt,useImperativeHandle:gt,useLayoutEffect:gt,useInsertionEffect:gt,useMemo:gt,useReducer:gt,useRef:gt,useState:gt,useDebugValue:gt,useDeferredValue:gt,useTransition:gt,useSyncExternalStore:gt,useId:gt,useHostTransitionStatus:gt,useFormState:gt,useActionState:gt,useOptimistic:gt,useMemoCache:gt,useCacheRefresh:gt};Kl.useEffectEvent=gt;var XS={readContext:$t,use:$c,useCallback:function(e,t){return aa().memoizedState=[e,t===void 0?null:t],e},useContext:$t,useEffect:Rv,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,ac(4194308,4,PS.bind(null,t,e),a)},useLayoutEffect:function(e,t){return ac(4194308,4,e,t)},useInsertionEffect:function(e,t){ac(4,2,e,t)},useMemo:function(e,t){var a=aa();t=t===void 0?null:t;var n=e();if(go){yr(!0);try{e()}finally{yr(!1)}}return a.memoizedState=[n,t],n},useReducer:function(e,t,a){var n=aa();if(a!==void 0){var r=a(t);if(go){yr(!0);try{a(t)}finally{yr(!1)}}}else r=t;return n.memoizedState=n.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},n.queue=e,e=e.dispatch=BO.bind(null,me,e),[n.memoizedState,e]},useRef:function(e){var t=aa();return e={current:e},t.memoizedState=e},useState:function(e){e=Cm(e);var t=e.queue,a=GS.bind(null,me,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Ih,useDeferredValue:function(e,t){var a=aa();return Ch(a,e,t)},useTransition:function(){var e=Cm(!1);return e=zS.bind(null,me,e.queue,!0,!1),aa().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var n=me,r=aa();if(Te){if(a===void 0)throw Error(N(407));a=a()}else{if(a=t(),tt===null)throw Error(N(349));(Ie&127)!==0||bS(n,t,a)}r.memoizedState=a;var o={value:a,getSnapshot:t};return r.queue=o,Rv(IS.bind(null,n,o,e),[e]),n.flags|=2048,ki(9,{destroy:void 0},SS.bind(null,n,o,a,t),null),a},useId:function(){var e=aa(),t=tt.identifierPrefix;if(Te){var a=gn,n=hn;a=(n&~(1<<32-Ta(n)-1)).toString(32)+a,t="_"+t+"R_"+a,a=Ic++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=AO++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:kh,useFormState:Ev,useActionState:Ev,useOptimistic:function(e){var t=aa();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Lh.bind(null,me,!0,a),a.dispatch=t,[e,t]},useMemoCache:vh,useCacheRefresh:function(){return aa().memoizedState=NO.bind(null,me)},useEffectEvent:function(e){var t=aa(),a={impl:e};return t.memoizedState=a,function(){if((Be&2)!==0)throw Error(N(440));return a.impl.apply(void 0,arguments)}}},Th={readContext:$t,use:$c,useCallback:BS,useContext:$t,useEffect:Sh,useImperativeHandle:NS,useInsertionEffect:_S,useLayoutEffect:OS,useMemo:US,useReducer:tc,useRef:RS,useState:function(){return tc(Gn)},useDebugValue:Ih,useDeferredValue:function(e,t){var a=kt();return FS(a,Qe.memoizedState,e,t)},useTransition:function(){var e=tc(Gn)[0],t=kt().memoizedState;return[typeof e=="boolean"?e:ss(e),t]},useSyncExternalStore:vS,useId:jS,useHostTransitionStatus:kh,useFormState:Mv,useActionState:Mv,useOptimistic:function(e,t){var a=kt();return LS(a,Qe,e,t)},useMemoCache:vh,useCacheRefresh:VS};Th.useEffectEvent=DS;var KS={readContext:$t,use:$c,useCallback:BS,useContext:$t,useEffect:Sh,useImperativeHandle:NS,useInsertionEffect:_S,useLayoutEffect:OS,useMemo:US,useReducer:Op,useRef:RS,useState:function(){return Op(Gn)},useDebugValue:Ih,useDeferredValue:function(e,t){var a=kt();return Qe===null?Ch(a,e,t):FS(a,Qe.memoizedState,e,t)},useTransition:function(){var e=Op(Gn)[0],t=kt().memoizedState;return[typeof e=="boolean"?e:ss(e),t]},useSyncExternalStore:vS,useId:jS,useHostTransitionStatus:kh,useFormState:Av,useActionState:Av,useOptimistic:function(e,t){var a=kt();return Qe!==null?LS(a,Qe,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:vh,useCacheRefresh:VS};KS.useEffectEvent=DS;function Pp(e,t,a,n){t=e.memoizedState,a=a(n,t),a=a==null?t:st({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Tm={enqueueSetState:function(e,t,a){e=e._reactInternals;var n=Ea(),r=Cr(n);r.payload=t,a!=null&&(r.callback=a),t=kr(e,r,n),t!==null&&(pa(t,e,n),Dl(t,e,n))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var n=Ea(),r=Cr(n);r.tag=1,r.payload=t,a!=null&&(r.callback=a),t=kr(e,r,n),t!==null&&(pa(t,e,n),Dl(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Ea(),n=Cr(a);n.tag=2,t!=null&&(n.callback=t),t=kr(e,n,a),t!==null&&(pa(t,e,a),Dl(t,e,a))}};function Dv(e,t,a,n,r,o,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,o,i):t.prototype&&t.prototype.isPureReactComponent?!Vl(a,n)||!Vl(r,o):!0}function _v(e,t,a,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,n),t.state!==e&&Tm.enqueueReplaceState(t,t.state,null)}function yo(e,t){var a=t;if("ref"in t){a={};for(var n in t)n!=="ref"&&(a[n]=t[n])}if(e=e.defaultProps){a===t&&(a=st({},a));for(var r in e)a[r]===void 0&&(a[r]=e[r])}return a}function ZS(e){hc(e)}function QS(e){console.error(e)}function YS(e){hc(e)}function Cc(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function Ov(e,t,a){try{var n=e.onCaughtError;n(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function Em(e,t,a){return a=Cr(a),a.tag=3,a.payload={element:null},a.callback=function(){Cc(e,t)},a}function JS(e){return e=Cr(e),e.tag=3,e}function e0(e,t,a,n){var r=a.type.getDerivedStateFromError;if(typeof r=="function"){var o=n.value;e.payload=function(){return r(o)},e.callback=function(){Ov(t,a,n)}}var i=a.stateNode;i!==null&&typeof i.componentDidCatch=="function"&&(e.callback=function(){Ov(t,a,n),typeof r!="function"&&(Lr===null?Lr=new Set([this]):Lr.add(this));var l=n.stack;this.componentDidCatch(n.value,{componentStack:l!==null?l:""})})}function UO(e,t,a,n,r){if(a.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=a.alternate,t!==null&&_i(t,a,r,!0),a=Aa.current,a!==null){switch(a.tag){case 31:case 13:return Wa===null?Mc():a.alternate===null&&yt===0&&(yt=3),a.flags&=-257,a.flags|=65536,a.lanes=r,n===xc?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([n]):t.add(n),Wp(e,n,r)),!1;case 22:return a.flags|=65536,n===xc?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([n]):a.add(n)),Wp(e,n,r)),!1}throw Error(N(435,a.tag))}return Wp(e,n,r),Mc(),!1}if(Te)return t=Aa.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=r,n!==hm&&(e=Error(N(422),{cause:n}),Wl(Va(e,a)))):(n!==hm&&(t=Error(N(423),{cause:n}),Wl(Va(t,a))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,n=Va(n,a),r=Em(e.stateNode,n,r),_p(e,r),yt!==4&&(yt=2)),!1;var o=Error(N(520),{cause:n});if(o=Va(o,a),Ul===null?Ul=[o]:Ul.push(o),yt!==4&&(yt=2),t===null)return!0;n=Va(n,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=r&-r,a.lanes|=e,e=Em(a.stateNode,n,e),_p(a,e),!1;case 1:if(t=a.type,o=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||o!==null&&typeof o.componentDidCatch=="function"&&(Lr===null||!Lr.has(o))))return a.flags|=65536,r&=-r,a.lanes|=r,r=JS(r),e0(r,e,a,n),_p(a,r),!1}a=a.return}while(a!==null);return!1}var Eh=Error(N(461)),_t=!1;function Vt(e,t,a,n){t.child=e===null?mS(t,null,a,n):ho(t,e.child,a,n)}function Pv(e,t,a,n,r){a=a.render;var o=t.ref;if("ref"in n){var i={};for(var l in n)l!=="ref"&&(i[l]=n[l])}else i=n;return mo(t),n=gh(e,t,a,i,o,r),l=yh(),e!==null&&!_t?(wh(e,t,r),Wn(e,t,r)):(Te&&l&&sh(t),t.flags|=1,Vt(e,t,n,r),t.child)}function Nv(e,t,a,n,r){if(e===null){var o=a.type;return typeof o=="function"&&!lh(o)&&o.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=o,t0(e,t,o,n,r)):(e=Ju(a.type,null,n,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!Mh(e,r)){var i=o.memoizedProps;if(a=a.compare,a=a!==null?a:Vl,a(i,n)&&e.ref===t.ref)return Wn(e,t,r)}return t.flags|=1,e=zn(o,n),e.ref=t.ref,e.return=t,t.child=e}function t0(e,t,a,n,r){if(e!==null){var o=e.memoizedProps;if(Vl(o,n)&&e.ref===t.ref)if(_t=!1,t.pendingProps=n=o,Mh(e,r))(e.flags&131072)!==0&&(_t=!0);else return t.lanes=e.lanes,Wn(e,t,r)}return Mm(e,t,a,n,r)}function a0(e,t,a,n){var r=n.children,o=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.mode==="hidden"){if((t.flags&128)!==0){if(o=o!==null?o.baseLanes|a:a,e!==null){for(n=t.child=e.child,r=0;n!==null;)r=r|n.lanes|n.childLanes,n=n.sibling;n=r&~o}else n=0,t.child=null;return Bv(e,t,o,a,n)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ec(t,o!==null?o.cachePool:null),o!==null?kv(t,o):Sm(),yS(t);else return n=t.lanes=536870912,Bv(e,t,o!==null?o.baseLanes|a:a,a,n)}else o!==null?(ec(t,o.cachePool),kv(t,o),hr(t),t.memoizedState=null):(e!==null&&ec(t,null),Sm(),hr(t));return Vt(e,t,r,a),t.child}function Ll(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Bv(e,t,a,n,r){var o=dh();return o=o===null?null:{parent:Dt._currentValue,pool:o},t.memoizedState={baseLanes:a,cachePool:o},e!==null&&ec(t,null),Sm(),yS(t),e!==null&&_i(e,t,n,!0),t.childLanes=r,null}function nc(e,t){return t=kc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Uv(e,t,a){return ho(t,e.child,null,a),e=nc(t,t.pendingProps),e.flags|=2,Sa(t),t.memoizedState=null,e}function FO(e,t,a){var n=t.pendingProps,r=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Te){if(n.mode==="hidden")return e=nc(t,n),t.lanes=536870912,Ll(null,e);if(Im(t),(e=lt)?(e=X0(e,Ga),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Rr!==null?{id:hn,overflow:gn}:null,retryLane:536870912,hydrationErrors:null},a=lS(e),a.return=t,t.child=a,Wt=t,lt=null)):e=null,e===null)throw Dr(t);return t.lanes=536870912,null}return nc(t,n)}var o=e.memoizedState;if(o!==null){var i=o.dehydrated;if(Im(t),r)if(t.flags&256)t.flags&=-257,t=Uv(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(N(558));else if(_t||_i(e,t,a,!1),r=(a&e.childLanes)!==0,_t||r){if(n=tt,n!==null&&(i=_b(n,a),i!==0&&i!==o.retryLane))throw o.retryLane=i,bo(e,i),pa(n,e,i),Eh;Mc(),t=Uv(e,t,a)}else e=o.treeContext,lt=$a(i.nextSibling),Wt=t,Te=!0,Ir=null,Ga=!1,e!==null&&uS(t,e),t=nc(t,n),t.flags|=4096;return t}return e=zn(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function rc(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(N(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function Mm(e,t,a,n,r){return mo(t),a=gh(e,t,a,n,void 0,r),n=yh(),e!==null&&!_t?(wh(e,t,r),Wn(e,t,r)):(Te&&n&&sh(t),t.flags|=1,Vt(e,t,a,r),t.child)}function Fv(e,t,a,n,r,o){return mo(t),t.updateQueue=null,a=xS(t,n,a,r),wS(e),n=yh(),e!==null&&!_t?(wh(e,t,o),Wn(e,t,o)):(Te&&n&&sh(t),t.flags|=1,Vt(e,t,a,o),t.child)}function zv(e,t,a,n,r){if(mo(t),t.stateNode===null){var o=ui,i=a.contextType;typeof i=="object"&&i!==null&&(o=$t(i)),o=new a(n,o),t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=Tm,t.stateNode=o,o._reactInternals=t,o=t.stateNode,o.props=n,o.state=t.memoizedState,o.refs={},ph(t),i=a.contextType,o.context=typeof i=="object"&&i!==null?$t(i):ui,o.state=t.memoizedState,i=a.getDerivedStateFromProps,typeof i=="function"&&(Pp(t,a,i,n),o.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(i=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),i!==o.state&&Tm.enqueueReplaceState(o,o.state,null),Ol(t,n,o,r),_l(),o.state=t.memoizedState),typeof o.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){o=t.stateNode;var l=t.memoizedProps,s=yo(a,l);o.props=s;var u=o.context,c=a.contextType;i=ui,typeof c=="object"&&c!==null&&(i=$t(c));var d=a.getDerivedStateFromProps;c=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function",l=t.pendingProps!==l,c||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l||u!==i)&&_v(t,o,n,i),fr=!1;var f=t.memoizedState;o.state=f,Ol(t,n,o,r),_l(),u=t.memoizedState,l||f!==u||fr?(typeof d=="function"&&(Pp(t,a,d,n),u=t.memoizedState),(s=fr||Dv(t,a,s,n,f,u,i))?(c||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=u),o.props=n,o.state=u,o.context=i,n=s):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{o=t.stateNode,vm(e,t),i=t.memoizedProps,c=yo(a,i),o.props=c,d=t.pendingProps,f=o.context,u=a.contextType,s=ui,typeof u=="object"&&u!==null&&(s=$t(u)),l=a.getDerivedStateFromProps,(u=typeof l=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(i!==d||f!==s)&&_v(t,o,n,s),fr=!1,f=t.memoizedState,o.state=f,Ol(t,n,o,r),_l();var p=t.memoizedState;i!==d||f!==p||fr||e!==null&&e.dependencies!==null&&wc(e.dependencies)?(typeof l=="function"&&(Pp(t,a,l,n),p=t.memoizedState),(c=fr||Dv(t,a,c,n,f,p,s)||e!==null&&e.dependencies!==null&&wc(e.dependencies))?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,p,s),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,p,s)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=p),o.props=n,o.state=p,o.context=s,n=c):(typeof o.componentDidUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),n=!1)}return o=n,rc(e,t),n=(t.flags&128)!==0,o||n?(o=t.stateNode,a=n&&typeof a.getDerivedStateFromError!="function"?null:o.render(),t.flags|=1,e!==null&&n?(t.child=ho(t,e.child,null,r),t.child=ho(t,null,a,r)):Vt(e,t,a,r),t.memoizedState=o.state,e=t.child):e=Wn(e,t,r),e}function qv(e,t,a,n){return po(),t.flags|=256,Vt(e,t,a,n),t.child}var Np={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Bp(e){return{baseLanes:e,cachePool:dS()}}function Up(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Ca),e}function n0(e,t,a){var n=t.pendingProps,r=!1,o=(t.flags&128)!==0,i;if((i=o)||(i=e!==null&&e.memoizedState===null?!1:(Ct.current&2)!==0),i&&(r=!0,t.flags&=-129),i=(t.flags&32)!==0,t.flags&=-33,e===null){if(Te){if(r?mr(t):hr(t),(e=lt)?(e=X0(e,Ga),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Rr!==null?{id:hn,overflow:gn}:null,retryLane:536870912,hydrationErrors:null},a=lS(e),a.return=t,t.child=a,Wt=t,lt=null)):e=null,e===null)throw Dr(t);return jm(e)?t.lanes=32:t.lanes=536870912,null}var l=n.children;return n=n.fallback,r?(hr(t),r=t.mode,l=kc({mode:"hidden",children:l},r),n=so(n,r,a,null),l.return=t,n.return=t,l.sibling=n,t.child=l,n=t.child,n.memoizedState=Bp(a),n.childLanes=Up(e,i,a),t.memoizedState=Np,Ll(null,n)):(mr(t),Am(t,l))}var s=e.memoizedState;if(s!==null&&(l=s.dehydrated,l!==null)){if(o)t.flags&256?(mr(t),t.flags&=-257,t=Fp(e,t,a)):t.memoizedState!==null?(hr(t),t.child=e.child,t.flags|=128,t=null):(hr(t),l=n.fallback,r=t.mode,n=kc({mode:"visible",children:n.children},r),l=so(l,r,a,null),l.flags|=2,n.return=t,l.return=t,n.sibling=l,t.child=n,ho(t,e.child,null,a),n=t.child,n.memoizedState=Bp(a),n.childLanes=Up(e,i,a),t.memoizedState=Np,t=Ll(null,n));else if(mr(t),jm(l)){if(i=l.nextSibling&&l.nextSibling.dataset,i)var u=i.dgst;i=u,n=Error(N(419)),n.stack="",n.digest=i,Wl({value:n,source:null,stack:null}),t=Fp(e,t,a)}else if(_t||_i(e,t,a,!1),i=(a&e.childLanes)!==0,_t||i){if(i=tt,i!==null&&(n=_b(i,a),n!==0&&n!==s.retryLane))throw s.retryLane=n,bo(e,n),pa(i,e,n),Eh;Hm(l)||Mc(),t=Fp(e,t,a)}else Hm(l)?(t.flags|=192,t.child=e.child,t=null):(e=s.treeContext,lt=$a(l.nextSibling),Wt=t,Te=!0,Ir=null,Ga=!1,e!==null&&uS(t,e),t=Am(t,n.children),t.flags|=4096);return t}return r?(hr(t),l=n.fallback,r=t.mode,s=e.child,u=s.sibling,n=zn(s,{mode:"hidden",children:n.children}),n.subtreeFlags=s.subtreeFlags&65011712,u!==null?l=zn(u,l):(l=so(l,r,a,null),l.flags|=2),l.return=t,n.return=t,n.sibling=l,t.child=n,Ll(null,n),n=t.child,l=e.child.memoizedState,l===null?l=Bp(a):(r=l.cachePool,r!==null?(s=Dt._currentValue,r=r.parent!==s?{parent:s,pool:s}:r):r=dS(),l={baseLanes:l.baseLanes|a,cachePool:r}),n.memoizedState=l,n.childLanes=Up(e,i,a),t.memoizedState=Np,Ll(e.child,n)):(mr(t),a=e.child,e=a.sibling,a=zn(a,{mode:"visible",children:n.children}),a.return=t,a.sibling=null,e!==null&&(i=t.deletions,i===null?(t.deletions=[e],t.flags|=16):i.push(e)),t.child=a,t.memoizedState=null,a)}function Am(e,t){return t=kc({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function kc(e,t){return e=Ia(22,e,null,t),e.lanes=0,e}function Fp(e,t,a){return ho(t,e.child,null,a),e=Am(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Hv(e,t,a){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),ym(e.return,t,a)}function zp(e,t,a,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:a,tailMode:r,treeForkCount:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=n,i.tail=a,i.tailMode=r,i.treeForkCount=o)}function r0(e,t,a){var n=t.pendingProps,r=n.revealOrder,o=n.tail;n=n.children;var i=Ct.current,l=(i&2)!==0;if(l?(i=i&1|2,t.flags|=128):i&=1,rt(Ct,i),Vt(e,t,n,a),n=Te?Gl:0,!l&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Hv(e,a,t);else if(e.tag===19)Hv(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(r){case"forwards":for(a=t.child,r=null;a!==null;)e=a.alternate,e!==null&&bc(e)===null&&(r=a),a=a.sibling;a=r,a===null?(r=t.child,t.child=null):(r=a.sibling,a.sibling=null),zp(t,!1,r,a,o,n);break;case"backwards":case"unstable_legacy-backwards":for(a=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&bc(e)===null){t.child=r;break}e=r.sibling,r.sibling=a,a=r,r=e}zp(t,!0,a,null,o,n);break;case"together":zp(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function Wn(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Or|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(_i(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(N(153));if(t.child!==null){for(e=t.child,a=zn(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=zn(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Mh(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&wc(e)))}function zO(e,t,a){switch(t.tag){case 3:dc(t,t.stateNode.containerInfo),pr(t,Dt,e.memoizedState.cache),po();break;case 27:case 5:rm(t);break;case 4:dc(t,t.stateNode.containerInfo);break;case 10:pr(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Im(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(mr(t),t.flags|=128,null):(a&t.child.childLanes)!==0?n0(e,t,a):(mr(t),e=Wn(e,t,a),e!==null?e.sibling:null);mr(t);break;case 19:var r=(e.flags&128)!==0;if(n=(a&t.childLanes)!==0,n||(_i(e,t,a,!1),n=(a&t.childLanes)!==0),r){if(n)return r0(e,t,a);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),rt(Ct,Ct.current),n)break;return null;case 22:return t.lanes=0,a0(e,t,a,t.pendingProps);case 24:pr(t,Dt,e.memoizedState.cache)}return Wn(e,t,a)}function o0(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)_t=!0;else{if(!Mh(e,a)&&(t.flags&128)===0)return _t=!1,zO(e,t,a);_t=(e.flags&131072)!==0}else _t=!1,Te&&(t.flags&1048576)!==0&&sS(t,Gl,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=oo(t.elementType),t.type=e,typeof e=="function")lh(e)?(n=yo(e,n),t.tag=1,t=zv(null,t,e,n,a)):(t.tag=0,t=Mm(null,t,e,n,a));else{if(e!=null){var r=e.$$typeof;if(r===$m){t.tag=11,t=Pv(null,t,e,n,a);break e}else if(r===Xm){t.tag=14,t=Nv(null,t,e,n,a);break e}}throw t=am(e)||e,Error(N(306,t,""))}}return t;case 0:return Mm(e,t,t.type,t.pendingProps,a);case 1:return n=t.type,r=yo(n,t.pendingProps),zv(e,t,n,r,a);case 3:e:{if(dc(t,t.stateNode.containerInfo),e===null)throw Error(N(387));n=t.pendingProps;var o=t.memoizedState;r=o.element,vm(e,t),Ol(t,n,null,a);var i=t.memoizedState;if(n=i.cache,pr(t,Dt,n),n!==o.cache&&wm(t,[Dt],a,!0),_l(),n=i.element,o.isDehydrated)if(o={element:n,isDehydrated:!1,cache:i.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=qv(e,t,n,a);break e}else if(n!==r){r=Va(Error(N(424)),t),Wl(r),t=qv(e,t,n,a);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,lt=$a(e.firstChild),Wt=t,Te=!0,Ir=null,Ga=!0,a=mS(t,null,n,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(po(),n===r){t=Wn(e,t,a);break e}Vt(e,t,n,a)}t=t.child}return t;case 26:return rc(e,t),e===null?(a=cb(t.type,null,t.pendingProps,null))?t.memoizedState=a:Te||(a=t.type,e=t.pendingProps,n=_c(Sr.current).createElement(a),n[Gt]=t,n[ma]=e,Xt(n,a,e),qt(n),t.stateNode=n):t.memoizedState=cb(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return rm(t),e===null&&Te&&(n=t.stateNode=K0(t.type,t.pendingProps,Sr.current),Wt=t,Ga=!0,r=lt,Nr(t.type)?(Vm=r,lt=$a(n.firstChild)):lt=r),Vt(e,t,t.pendingProps.children,a),rc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Te&&((r=n=lt)&&(n=mP(n,t.type,t.pendingProps,Ga),n!==null?(t.stateNode=n,Wt=t,lt=$a(n.firstChild),Ga=!1,r=!0):r=!1),r||Dr(t)),rm(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,n=o.children,zm(r,o)?n=null:i!==null&&zm(r,i)&&(t.flags|=32),t.memoizedState!==null&&(r=gh(e,t,RO,null,null,a),Yl._currentValue=r),rc(e,t),Vt(e,t,n,a),t.child;case 6:return e===null&&Te&&((e=a=lt)&&(a=hP(a,t.pendingProps,Ga),a!==null?(t.stateNode=a,Wt=t,lt=null,e=!0):e=!1),e||Dr(t)),null;case 13:return n0(e,t,a);case 4:return dc(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=ho(t,null,n,a):Vt(e,t,n,a),t.child;case 11:return Pv(e,t,t.type,t.pendingProps,a);case 7:return Vt(e,t,t.pendingProps,a),t.child;case 8:return Vt(e,t,t.pendingProps.children,a),t.child;case 12:return Vt(e,t,t.pendingProps.children,a),t.child;case 10:return n=t.pendingProps,pr(t,t.type,n.value),Vt(e,t,n.children,a),t.child;case 9:return r=t.type._context,n=t.pendingProps.children,mo(t),r=$t(r),n=n(r),t.flags|=1,Vt(e,t,n,a),t.child;case 14:return Nv(e,t,t.type,t.pendingProps,a);case 15:return t0(e,t,t.type,t.pendingProps,a);case 19:return r0(e,t,a);case 31:return FO(e,t,a);case 22:return a0(e,t,a,t.pendingProps);case 24:return mo(t),n=$t(Dt),e===null?(r=dh(),r===null&&(r=tt,o=ch(),r.pooledCache=o,o.refCount++,o!==null&&(r.pooledCacheLanes|=a),r=o),t.memoizedState={parent:n,cache:r},ph(t),pr(t,Dt,r)):((e.lanes&a)!==0&&(vm(e,t),Ol(t,null,null,a),_l()),r=e.memoizedState,o=t.memoizedState,r.parent!==n?(r={parent:n,cache:n},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),pr(t,Dt,n)):(n=o.cache,pr(t,Dt,n),n!==r.cache&&wm(t,[Dt],a,!0))),Vt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(N(156,t.tag))}function Rn(e){e.flags|=4}function qp(e,t,a,n,r){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(r&335544128)===r)if(e.stateNode.complete)e.flags|=8192;else if(M0())e.flags|=8192;else throw co=xc,fh}else e.flags&=-16777217}function jv(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Y0(t))if(M0())e.flags|=8192;else throw co=xc,fh}function Hu(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ab():536870912,e.lanes|=t,Li|=t)}function xl(e,t){if(!Te)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var n=null;a!==null;)a.alternate!==null&&(n=a),a=a.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function it(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,n=0;if(t)for(var r=e.child;r!==null;)a|=r.lanes|r.childLanes,n|=r.subtreeFlags&65011712,n|=r.flags&65011712,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)a|=r.lanes|r.childLanes,n|=r.subtreeFlags,n|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=n,e.childLanes=a,t}function qO(e,t,a){var n=t.pendingProps;switch(uh(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return it(t),null;case 1:return it(t),null;case 3:return a=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),qn(Dt),vi(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Qo(t)?Rn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Dp())),it(t),null;case 26:var r=t.type,o=t.memoizedState;return e===null?(Rn(t),o!==null?(it(t),jv(t,o)):(it(t),qp(t,r,null,n,a))):o?o!==e.memoizedState?(Rn(t),it(t),jv(t,o)):(it(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&Rn(t),it(t),qp(t,r,e,n,a)),null;case 27:if(fc(t),a=Sr.current,r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Rn(t);else{if(!n){if(t.stateNode===null)throw Error(N(166));return it(t),null}e=wn.current,Qo(t)?wv(t,e):(e=K0(r,n,a),t.stateNode=e,Rn(t))}return it(t),null;case 5:if(fc(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Rn(t);else{if(!n){if(t.stateNode===null)throw Error(N(166));return it(t),null}if(o=wn.current,Qo(t))wv(t,o);else{var i=_c(Sr.current);switch(o){case 1:o=i.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:o=i.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":o=i.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":o=i.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":o=i.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof n.is=="string"?i.createElement("select",{is:n.is}):i.createElement("select"),n.multiple?o.multiple=!0:n.size&&(o.size=n.size);break;default:o=typeof n.is=="string"?i.createElement(r,{is:n.is}):i.createElement(r)}}o[Gt]=t,o[ma]=n;e:for(i=t.child;i!==null;){if(i.tag===5||i.tag===6)o.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}t.stateNode=o;e:switch(Xt(o,r,n),r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&Rn(t)}}return it(t),qp(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&Rn(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(N(166));if(e=Sr.current,Qo(t)){if(e=t.stateNode,a=t.memoizedProps,n=null,r=Wt,r!==null)switch(r.tag){case 27:case 5:n=r.memoizedProps}e[Gt]=t,e=!!(e.nodeValue===a||n!==null&&n.suppressHydrationWarning===!0||G0(e.nodeValue,a)),e||Dr(t,!0)}else e=_c(e).createTextNode(n),e[Gt]=t,t.stateNode=e}return it(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(n=Qo(t),a!==null){if(e===null){if(!n)throw Error(N(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(N(557));e[Gt]=t}else po(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;it(t),e=!1}else a=Dp(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(Sa(t),t):(Sa(t),null);if((t.flags&128)!==0)throw Error(N(558))}return it(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=Qo(t),n!==null&&n.dehydrated!==null){if(e===null){if(!r)throw Error(N(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(N(317));r[Gt]=t}else po(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;it(t),r=!1}else r=Dp(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(Sa(t),t):(Sa(t),null)}return Sa(t),(t.flags&128)!==0?(t.lanes=a,t):(a=n!==null,e=e!==null&&e.memoizedState!==null,a&&(n=t.child,r=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(r=n.alternate.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==r&&(n.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Hu(t,t.updateQueue),it(t),null);case 4:return vi(),e===null&&Nh(t.stateNode.containerInfo),it(t),null;case 10:return qn(t.type),it(t),null;case 19:if(Ht(Ct),n=t.memoizedState,n===null)return it(t),null;if(r=(t.flags&128)!==0,o=n.rendering,o===null)if(r)xl(n,!1);else{if(yt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=bc(e),o!==null){for(t.flags|=128,xl(n,!1),e=o.updateQueue,t.updateQueue=e,Hu(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)iS(a,e),a=a.sibling;return rt(Ct,Ct.current&1|2),Te&&Pn(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&ka()>Tc&&(t.flags|=128,r=!0,xl(n,!1),t.lanes=4194304)}else{if(!r)if(e=bc(o),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,Hu(t,e),xl(n,!0),n.tail===null&&n.tailMode==="hidden"&&!o.alternate&&!Te)return it(t),null}else 2*ka()-n.renderingStartTime>Tc&&a!==536870912&&(t.flags|=128,r=!0,xl(n,!1),t.lanes=4194304);n.isBackwards?(o.sibling=t.child,t.child=o):(e=n.last,e!==null?e.sibling=o:t.child=o,n.last=o)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=ka(),e.sibling=null,a=Ct.current,rt(Ct,r?a&1|2:a&1),Te&&Pn(t,n.treeForkCount),e):(it(t),null);case 22:case 23:return Sa(t),mh(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?(a&536870912)!==0&&(t.flags&128)===0&&(it(t),t.subtreeFlags&6&&(t.flags|=8192)):it(t),a=t.updateQueue,a!==null&&Hu(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==a&&(t.flags|=2048),e!==null&&Ht(uo),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),qn(Dt),it(t),null;case 25:return null;case 30:return null}throw Error(N(156,t.tag))}function HO(e,t){switch(uh(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return qn(Dt),vi(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return fc(t),null;case 31:if(t.memoizedState!==null){if(Sa(t),t.alternate===null)throw Error(N(340));po()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Sa(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(N(340));po()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ht(Ct),null;case 4:return vi(),null;case 10:return qn(t.type),null;case 22:case 23:return Sa(t),mh(),e!==null&&Ht(uo),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return qn(Dt),null;case 25:return null;default:return null}}function i0(e,t){switch(uh(t),t.tag){case 3:qn(Dt),vi();break;case 26:case 27:case 5:fc(t);break;case 4:vi();break;case 31:t.memoizedState!==null&&Sa(t);break;case 13:Sa(t);break;case 19:Ht(Ct);break;case 10:qn(t.type);break;case 22:case 23:Sa(t),mh(),e!==null&&Ht(uo);break;case 24:qn(Dt)}}function us(e,t){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var r=n.next;a=r;do{if((a.tag&e)===e){n=void 0;var o=a.create,i=a.inst;n=o(),i.destroy=n}a=a.next}while(a!==r)}}catch(l){qe(t,t.return,l)}}function _r(e,t,a){try{var n=t.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var o=r.next;n=o;do{if((n.tag&e)===e){var i=n.inst,l=i.destroy;if(l!==void 0){i.destroy=void 0,r=t;var s=a,u=l;try{u()}catch(c){qe(r,s,c)}}}n=n.next}while(n!==o)}}catch(c){qe(t,t.return,c)}}function l0(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{gS(t,a)}catch(n){qe(e,e.return,n)}}}function s0(e,t,a){a.props=yo(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(n){qe(e,t,n)}}function Nl(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;case 30:n=e.stateNode;break;default:n=e.stateNode}typeof a=="function"?e.refCleanup=a(n):a.current=n}}catch(r){qe(e,t,r)}}function yn(e,t){var a=e.ref,n=e.refCleanup;if(a!==null)if(typeof n=="function")try{n()}catch(r){qe(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(r){qe(e,t,r)}else a.current=null}function u0(e){var t=e.type,a=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break e;case"img":a.src?n.src=a.src:a.srcSet&&(n.srcset=a.srcSet)}}catch(r){qe(e,e.return,r)}}function Hp(e,t,a){try{var n=e.stateNode;sP(n,e.type,a,t),n[ma]=t}catch(r){qe(e,e.return,r)}}function c0(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Nr(e.type)||e.tag===4}function jp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||c0(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Nr(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Rm(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Un));else if(n!==4&&(n===27&&Nr(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Rm(e,t,a),e=e.sibling;e!==null;)Rm(e,t,a),e=e.sibling}function Lc(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(n!==4&&(n===27&&Nr(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Lc(e,t,a),e=e.sibling;e!==null;)Lc(e,t,a),e=e.sibling}function d0(e){var t=e.stateNode,a=e.memoizedProps;try{for(var n=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);Xt(t,n,a),t[Gt]=e,t[ma]=a}catch(o){qe(e,e.return,o)}}var Nn=!1,Rt=!1,Vp=!1,Vv=typeof WeakSet=="function"?WeakSet:Set,zt=null;function jO(e,t){if(e=e.containerInfo,Um=Bc,e=Yb(e),rh(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var n=a.getSelection&&a.getSelection();if(n&&n.rangeCount!==0){a=n.anchorNode;var r=n.anchorOffset,o=n.focusNode;n=n.focusOffset;try{a.nodeType,o.nodeType}catch{a=null;break e}var i=0,l=-1,s=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var p;d!==a||r!==0&&d.nodeType!==3||(l=i+r),d!==o||n!==0&&d.nodeType!==3||(s=i+n),d.nodeType===3&&(i+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===a&&++u===r&&(l=i),f===o&&++c===n&&(s=i),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}a=l===-1||s===-1?null:{start:l,end:s}}else a=null}a=a||{start:0,end:0}}else a=null;for(Fm={focusedElem:e,selectionRange:a},Bc=!1,zt=t;zt!==null;)if(t=zt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,zt=e;else for(;zt!==null;){switch(t=zt,o=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)r=e[a],r.ref.impl=r.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&o!==null){e=void 0,a=t,r=o.memoizedProps,o=o.memoizedState,n=a.stateNode;try{var m=yo(a.type,r);e=n.getSnapshotBeforeUpdate(m,o),n.__reactInternalSnapshotBeforeUpdate=e}catch(x){qe(a,a.return,x)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)qm(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":qm(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(N(163))}if(e=t.sibling,e!==null){e.return=t.return,zt=e;break}zt=t.return}}function f0(e,t,a){var n=a.flags;switch(a.tag){case 0:case 11:case 15:_n(e,a),n&4&&us(5,a);break;case 1:if(_n(e,a),n&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(i){qe(a,a.return,i)}else{var r=yo(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(i){qe(a,a.return,i)}}n&64&&l0(a),n&512&&Nl(a,a.return);break;case 3:if(_n(e,a),n&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{gS(e,t)}catch(i){qe(a,a.return,i)}}break;case 27:t===null&&n&4&&d0(a);case 26:case 5:_n(e,a),t===null&&n&4&&u0(a),n&512&&Nl(a,a.return);break;case 12:_n(e,a);break;case 31:_n(e,a),n&4&&h0(e,a);break;case 13:_n(e,a),n&4&&g0(e,a),n&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=YO.bind(null,a),gP(e,a))));break;case 22:if(n=a.memoizedState!==null||Nn,!n){t=t!==null&&t.memoizedState!==null||Rt,r=Nn;var o=Rt;Nn=n,(Rt=t)&&!o?On(e,a,(a.subtreeFlags&8772)!==0):_n(e,a),Nn=r,Rt=o}break;case 30:break;default:_n(e,a)}}function p0(e){var t=e.alternate;t!==null&&(e.alternate=null,p0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ym(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var mt=null,da=!1;function Dn(e,t,a){for(a=a.child;a!==null;)m0(e,t,a),a=a.sibling}function m0(e,t,a){if(La&&typeof La.onCommitFiberUnmount=="function")try{La.onCommitFiberUnmount(as,a)}catch{}switch(a.tag){case 26:Rt||yn(a,t),Dn(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Rt||yn(a,t);var n=mt,r=da;Nr(a.type)&&(mt=a.stateNode,da=!1),Dn(e,t,a),zl(a.stateNode),mt=n,da=r;break;case 5:Rt||yn(a,t);case 6:if(n=mt,r=da,mt=null,Dn(e,t,a),mt=n,da=r,mt!==null)if(da)try{(mt.nodeType===9?mt.body:mt.nodeName==="HTML"?mt.ownerDocument.body:mt).removeChild(a.stateNode)}catch(o){qe(a,t,o)}else try{mt.removeChild(a.stateNode)}catch(o){qe(a,t,o)}break;case 18:mt!==null&&(da?(e=mt,ob(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Ai(e)):ob(mt,a.stateNode));break;case 4:n=mt,r=da,mt=a.stateNode.containerInfo,da=!0,Dn(e,t,a),mt=n,da=r;break;case 0:case 11:case 14:case 15:_r(2,a,t),Rt||_r(4,a,t),Dn(e,t,a);break;case 1:Rt||(yn(a,t),n=a.stateNode,typeof n.componentWillUnmount=="function"&&s0(a,t,n)),Dn(e,t,a);break;case 21:Dn(e,t,a);break;case 22:Rt=(n=Rt)||a.memoizedState!==null,Dn(e,t,a),Rt=n;break;default:Dn(e,t,a)}}function h0(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ai(e)}catch(a){qe(t,t.return,a)}}}function g0(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ai(e)}catch(a){qe(t,t.return,a)}}function VO(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Vv),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Vv),t;default:throw Error(N(435,e.tag))}}function ju(e,t){var a=VO(e);t.forEach(function(n){if(!a.has(n)){a.add(n);var r=JO.bind(null,e,n);n.then(r,r)}})}function ua(e,t){var a=t.deletions;if(a!==null)for(var n=0;n<a.length;n++){var r=a[n],o=e,i=t,l=i;e:for(;l!==null;){switch(l.tag){case 27:if(Nr(l.type)){mt=l.stateNode,da=!1;break e}break;case 5:mt=l.stateNode,da=!1;break e;case 3:case 4:mt=l.stateNode.containerInfo,da=!0;break e}l=l.return}if(mt===null)throw Error(N(160));m0(o,i,r),mt=null,da=!1,o=r.alternate,o!==null&&(o.return=null),r.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)y0(t,e),t=t.sibling}var an=null;function y0(e,t){var a=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ua(t,e),ca(e),n&4&&(_r(3,e,e.return),us(3,e),_r(5,e,e.return));break;case 1:ua(t,e),ca(e),n&512&&(Rt||a===null||yn(a,a.return)),n&64&&Nn&&(e=e.updateQueue,e!==null&&(n=e.callbacks,n!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?n:a.concat(n))));break;case 26:var r=an;if(ua(t,e),ca(e),n&512&&(Rt||a===null||yn(a,a.return)),n&4){var o=a!==null?a.memoizedState:null;if(n=e.memoizedState,a===null)if(n===null)if(e.stateNode===null){e:{n=e.type,a=e.memoizedProps,r=r.ownerDocument||r;t:switch(n){case"title":o=r.getElementsByTagName("title")[0],(!o||o[os]||o[Gt]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=r.createElement(n),r.head.insertBefore(o,r.querySelector("head > title"))),Xt(o,n,a),o[Gt]=e,qt(o),n=o;break e;case"link":var i=fb("link","href",r).get(n+(a.href||""));if(i){for(var l=0;l<i.length;l++)if(o=i[l],o.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&o.getAttribute("rel")===(a.rel==null?null:a.rel)&&o.getAttribute("title")===(a.title==null?null:a.title)&&o.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){i.splice(l,1);break t}}o=r.createElement(n),Xt(o,n,a),r.head.appendChild(o);break;case"meta":if(i=fb("meta","content",r).get(n+(a.content||""))){for(l=0;l<i.length;l++)if(o=i[l],o.getAttribute("content")===(a.content==null?null:""+a.content)&&o.getAttribute("name")===(a.name==null?null:a.name)&&o.getAttribute("property")===(a.property==null?null:a.property)&&o.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&o.getAttribute("charset")===(a.charSet==null?null:a.charSet)){i.splice(l,1);break t}}o=r.createElement(n),Xt(o,n,a),r.head.appendChild(o);break;default:throw Error(N(468,n))}o[Gt]=e,qt(o),n=o}e.stateNode=n}else pb(r,e.type,e.stateNode);else e.stateNode=db(r,n,e.memoizedProps);else o!==n?(o===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):o.count--,n===null?pb(r,e.type,e.stateNode):db(r,n,e.memoizedProps)):n===null&&e.stateNode!==null&&Hp(e,e.memoizedProps,a.memoizedProps)}break;case 27:ua(t,e),ca(e),n&512&&(Rt||a===null||yn(a,a.return)),a!==null&&n&4&&Hp(e,e.memoizedProps,a.memoizedProps);break;case 5:if(ua(t,e),ca(e),n&512&&(Rt||a===null||yn(a,a.return)),e.flags&32){r=e.stateNode;try{Si(r,"")}catch(m){qe(e,e.return,m)}}n&4&&e.stateNode!=null&&(r=e.memoizedProps,Hp(e,r,a!==null?a.memoizedProps:r)),n&1024&&(Vp=!0);break;case 6:if(ua(t,e),ca(e),n&4){if(e.stateNode===null)throw Error(N(162));n=e.memoizedProps,a=e.stateNode;try{a.nodeValue=n}catch(m){qe(e,e.return,m)}}break;case 3:if(lc=null,r=an,an=Oc(t.containerInfo),ua(t,e),an=r,ca(e),n&4&&a!==null&&a.memoizedState.isDehydrated)try{Ai(t.containerInfo)}catch(m){qe(e,e.return,m)}Vp&&(Vp=!1,w0(e));break;case 4:n=an,an=Oc(e.stateNode.containerInfo),ua(t,e),ca(e),an=n;break;case 12:ua(t,e),ca(e);break;case 31:ua(t,e),ca(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,ju(e,n)));break;case 13:ua(t,e),ca(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Zc=ka()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,ju(e,n)));break;case 22:r=e.memoizedState!==null;var s=a!==null&&a.memoizedState!==null,u=Nn,c=Rt;if(Nn=u||r,Rt=c||s,ua(t,e),Rt=c,Nn=u,ca(e),n&8192)e:for(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,r&&(a===null||s||Nn||Rt||io(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){s=a=t;try{if(o=s.stateNode,r)i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none";else{l=s.stateNode;var d=s.memoizedProps.style,f=d!=null&&d.hasOwnProperty("display")?d.display:null;l.style.display=f==null||typeof f=="boolean"?"":(""+f).trim()}}catch(m){qe(s,s.return,m)}}}else if(t.tag===6){if(a===null){s=t;try{s.stateNode.nodeValue=r?"":s.memoizedProps}catch(m){qe(s,s.return,m)}}}else if(t.tag===18){if(a===null){s=t;try{var p=s.stateNode;r?ib(p,!0):ib(s.stateNode,!1)}catch(m){qe(s,s.return,m)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}n&4&&(n=e.updateQueue,n!==null&&(a=n.retryQueue,a!==null&&(n.retryQueue=null,ju(e,a))));break;case 19:ua(t,e),ca(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,ju(e,n)));break;case 30:break;case 21:break;default:ua(t,e),ca(e)}}function ca(e){var t=e.flags;if(t&2){try{for(var a,n=e.return;n!==null;){if(c0(n)){a=n;break}n=n.return}if(a==null)throw Error(N(160));switch(a.tag){case 27:var r=a.stateNode,o=jp(e);Lc(e,o,r);break;case 5:var i=a.stateNode;a.flags&32&&(Si(i,""),a.flags&=-33);var l=jp(e);Lc(e,l,i);break;case 3:case 4:var s=a.stateNode.containerInfo,u=jp(e);Rm(e,u,s);break;default:throw Error(N(161))}}catch(c){qe(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function w0(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;w0(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function _n(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)f0(e,t.alternate,t),t=t.sibling}function io(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:_r(4,t,t.return),io(t);break;case 1:yn(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&s0(t,t.return,a),io(t);break;case 27:zl(t.stateNode);case 26:case 5:yn(t,t.return),io(t);break;case 22:t.memoizedState===null&&io(t);break;case 30:io(t);break;default:io(t)}e=e.sibling}}function On(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,r=e,o=t,i=o.flags;switch(o.tag){case 0:case 11:case 15:On(r,o,a),us(4,o);break;case 1:if(On(r,o,a),n=o,r=n.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(u){qe(n,n.return,u)}if(n=o,r=n.updateQueue,r!==null){var l=n.stateNode;try{var s=r.shared.hiddenCallbacks;if(s!==null)for(r.shared.hiddenCallbacks=null,r=0;r<s.length;r++)hS(s[r],l)}catch(u){qe(n,n.return,u)}}a&&i&64&&l0(o),Nl(o,o.return);break;case 27:d0(o);case 26:case 5:On(r,o,a),a&&n===null&&i&4&&u0(o),Nl(o,o.return);break;case 12:On(r,o,a);break;case 31:On(r,o,a),a&&i&4&&h0(r,o);break;case 13:On(r,o,a),a&&i&4&&g0(r,o);break;case 22:o.memoizedState===null&&On(r,o,a),Nl(o,o.return);break;case 30:break;default:On(r,o,a)}t=t.sibling}}function Ah(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&ls(a))}function Rh(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ls(e))}function tn(e,t,a,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)x0(e,t,a,n),t=t.sibling}function x0(e,t,a,n){var r=t.flags;switch(t.tag){case 0:case 11:case 15:tn(e,t,a,n),r&2048&&us(9,t);break;case 1:tn(e,t,a,n);break;case 3:tn(e,t,a,n),r&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ls(e)));break;case 12:if(r&2048){tn(e,t,a,n),e=t.stateNode;try{var o=t.memoizedProps,i=o.id,l=o.onPostCommit;typeof l=="function"&&l(i,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(s){qe(t,t.return,s)}}else tn(e,t,a,n);break;case 31:tn(e,t,a,n);break;case 13:tn(e,t,a,n);break;case 23:break;case 22:o=t.stateNode,i=t.alternate,t.memoizedState!==null?o._visibility&2?tn(e,t,a,n):Bl(e,t):o._visibility&2?tn(e,t,a,n):(o._visibility|=2,Jo(e,t,a,n,(t.subtreeFlags&10256)!==0||!1)),r&2048&&Ah(i,t);break;case 24:tn(e,t,a,n),r&2048&&Rh(t.alternate,t);break;default:tn(e,t,a,n)}}function Jo(e,t,a,n,r){for(r=r&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var o=e,i=t,l=a,s=n,u=i.flags;switch(i.tag){case 0:case 11:case 15:Jo(o,i,l,s,r),us(8,i);break;case 23:break;case 22:var c=i.stateNode;i.memoizedState!==null?c._visibility&2?Jo(o,i,l,s,r):Bl(o,i):(c._visibility|=2,Jo(o,i,l,s,r)),r&&u&2048&&Ah(i.alternate,i);break;case 24:Jo(o,i,l,s,r),r&&u&2048&&Rh(i.alternate,i);break;default:Jo(o,i,l,s,r)}t=t.sibling}}function Bl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,n=t,r=n.flags;switch(n.tag){case 22:Bl(a,n),r&2048&&Ah(n.alternate,n);break;case 24:Bl(a,n),r&2048&&Rh(n.alternate,n);break;default:Bl(a,n)}t=t.sibling}}var Tl=8192;function Yo(e,t,a){if(e.subtreeFlags&Tl)for(e=e.child;e!==null;)v0(e,t,a),e=e.sibling}function v0(e,t,a){switch(e.tag){case 26:Yo(e,t,a),e.flags&Tl&&e.memoizedState!==null&&EP(a,an,e.memoizedState,e.memoizedProps);break;case 5:Yo(e,t,a);break;case 3:case 4:var n=an;an=Oc(e.stateNode.containerInfo),Yo(e,t,a),an=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=Tl,Tl=16777216,Yo(e,t,a),Tl=n):Yo(e,t,a));break;default:Yo(e,t,a)}}function b0(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function vl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var n=t[a];zt=n,I0(n,e)}b0(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)S0(e),e=e.sibling}function S0(e){switch(e.tag){case 0:case 11:case 15:vl(e),e.flags&2048&&_r(9,e,e.return);break;case 3:vl(e);break;case 12:vl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,oc(e)):vl(e);break;default:vl(e)}}function oc(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var n=t[a];zt=n,I0(n,e)}b0(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:_r(8,t,t.return),oc(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,oc(t));break;default:oc(t)}e=e.sibling}}function I0(e,t){for(;zt!==null;){var a=zt;switch(a.tag){case 0:case 11:case 15:_r(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var n=a.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:ls(a.memoizedState.cache)}if(n=a.child,n!==null)n.return=a,zt=n;else e:for(a=e;zt!==null;){n=zt;var r=n.sibling,o=n.return;if(p0(n),n===a){zt=null;break e}if(r!==null){r.return=o,zt=r;break e}zt=o}}}var GO={getCacheForType:function(e){var t=$t(Dt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return $t(Dt).controller.signal}},WO=typeof WeakMap=="function"?WeakMap:Map,Be=0,tt=null,Se=null,Ie=0,ze=0,ba=null,xr=!1,Pi=!1,Dh=!1,$n=0,yt=0,Or=0,fo=0,_h=0,Ca=0,Li=0,Ul=null,fa=null,Dm=!1,Zc=0,C0=0,Tc=1/0,Ec=null,Lr=null,Ot=0,Tr=null,Ti=null,Hn=0,_m=0,Om=null,k0=null,Fl=0,Pm=null;function Ea(){return(Be&2)!==0&&Ie!==0?Ie&-Ie:ie.T!==null?Ph():Ob()}function L0(){if(Ca===0)if((Ie&536870912)===0||Te){var e=_u;_u<<=1,(_u&3932160)===0&&(_u=262144),Ca=e}else Ca=536870912;return e=Aa.current,e!==null&&(e.flags|=32),Ca}function pa(e,t,a){(e===tt&&(ze===2||ze===9)||e.cancelPendingCommit!==null)&&(Ei(e,0),vr(e,Ie,Ca,!1)),rs(e,a),((Be&2)===0||e!==tt)&&(e===tt&&((Be&2)===0&&(fo|=a),yt===4&&vr(e,Ie,Ca,!1)),vn(e))}function T0(e,t,a){if((Be&6)!==0)throw Error(N(327));var n=!a&&(t&127)===0&&(t&e.expiredLanes)===0||ns(e,t),r=n?KO(e,t):Gp(e,t,!0),o=n;do{if(r===0){Pi&&!n&&vr(e,t,0,!1);break}else{if(a=e.current.alternate,o&&!$O(a)){r=Gp(e,t,!1),o=!1;continue}if(r===2){if(o=t,e.errorRecoveryDisabledLanes&o)var i=0;else i=e.pendingLanes&-536870913,i=i!==0?i:i&536870912?536870912:0;if(i!==0){t=i;e:{var l=e;r=Ul;var s=l.current.memoizedState.isDehydrated;if(s&&(Ei(l,i).flags|=256),i=Gp(l,i,!1),i!==2){if(Dh&&!s){l.errorRecoveryDisabledLanes|=o,fo|=o,r=4;break e}o=fa,fa=r,o!==null&&(fa===null?fa=o:fa.push.apply(fa,o))}r=i}if(o=!1,r!==2)continue}}if(r===1){Ei(e,0),vr(e,t,0,!0);break}e:{switch(n=e,o=r,o){case 0:case 1:throw Error(N(345));case 4:if((t&4194048)!==t)break;case 6:vr(n,t,Ca,!xr);break e;case 2:fa=null;break;case 3:case 5:break;default:throw Error(N(329))}if((t&62914560)===t&&(r=Zc+300-ka(),10<r)){if(vr(n,t,Ca,!xr),Fc(n,0,!0)!==0)break e;Hn=t,n.timeoutHandle=$0(Gv.bind(null,n,a,fa,Ec,Dm,t,Ca,fo,Li,xr,o,"Throttled",-0,0),r);break e}Gv(n,a,fa,Ec,Dm,t,Ca,fo,Li,xr,o,null,-0,0)}}break}while(!0);vn(e)}function Gv(e,t,a,n,r,o,i,l,s,u,c,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)===16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Un},v0(t,o,d);var m=(o&62914560)===o?Zc-ka():(o&4194048)===o?C0-ka():0;if(m=MP(d,m),m!==null){Hn=o,e.cancelPendingCommit=m($v.bind(null,e,t,o,a,n,r,i,l,s,c,d,null,f,p)),vr(e,o,i,!u);return}}$v(e,t,o,a,n,r,i,l,s)}function $O(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var n=0;n<a.length;n++){var r=a[n],o=r.getSnapshot;r=r.value;try{if(!Ma(o(),r))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function vr(e,t,a,n){t&=~_h,t&=~fo,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var r=t;0<r;){var o=31-Ta(r),i=1<<o;n[o]=-1,r&=~i}a!==0&&Rb(e,a,t)}function Qc(){return(Be&6)===0?(cs(0,!1),!1):!0}function Oh(){if(Se!==null){if(ze===0)var e=Se.return;else e=Se,Fn=So=null,xh(e),yi=null,$l=0,e=Se;for(;e!==null;)i0(e.alternate,e),e=e.return;Se=null}}function Ei(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,dP(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Hn=0,Oh(),tt=e,Se=a=zn(e.current,null),Ie=t,ze=0,ba=null,xr=!1,Pi=ns(e,t),Dh=!1,Li=Ca=_h=fo=Or=yt=0,fa=Ul=null,Dm=!1,(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-Ta(n),o=1<<r;t|=e[r],n&=~o}return $n=t,jc(),a}function E0(e,t){me=null,ie.H=Kl,t===Oi||t===Gc?(t=Iv(),ze=3):t===fh?(t=Iv(),ze=4):ze=t===Eh?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,ba=t,Se===null&&(yt=1,Cc(e,Va(t,e.current)))}function M0(){var e=Aa.current;return e===null?!0:(Ie&4194048)===Ie?Wa===null:(Ie&62914560)===Ie||(Ie&536870912)!==0?e===Wa:!1}function A0(){var e=ie.H;return ie.H=Kl,e===null?Kl:e}function R0(){var e=ie.A;return ie.A=GO,e}function Mc(){yt=4,xr||(Ie&4194048)!==Ie&&Aa.current!==null||(Pi=!0),(Or&134217727)===0&&(fo&134217727)===0||tt===null||vr(tt,Ie,Ca,!1)}function Gp(e,t,a){var n=Be;Be|=2;var r=A0(),o=R0();(tt!==e||Ie!==t)&&(Ec=null,Ei(e,t)),t=!1;var i=yt;e:do try{if(ze!==0&&Se!==null){var l=Se,s=ba;switch(ze){case 8:Oh(),i=6;break e;case 3:case 2:case 9:case 6:Aa.current===null&&(t=!0);var u=ze;if(ze=0,ba=null,fi(e,l,s,u),a&&Pi){i=0;break e}break;default:u=ze,ze=0,ba=null,fi(e,l,s,u)}}XO(),i=yt;break}catch(c){E0(e,c)}while(!0);return t&&e.shellSuspendCounter++,Fn=So=null,Be=n,ie.H=r,ie.A=o,Se===null&&(tt=null,Ie=0,jc()),i}function XO(){for(;Se!==null;)D0(Se)}function KO(e,t){var a=Be;Be|=2;var n=A0(),r=R0();tt!==e||Ie!==t?(Ec=null,Tc=ka()+500,Ei(e,t)):Pi=ns(e,t);e:do try{if(ze!==0&&Se!==null){t=Se;var o=ba;t:switch(ze){case 1:ze=0,ba=null,fi(e,t,o,1);break;case 2:case 9:if(Sv(o)){ze=0,ba=null,Wv(t);break}t=function(){ze!==2&&ze!==9||tt!==e||(ze=7),vn(e)},o.then(t,t);break e;case 3:ze=7;break e;case 4:ze=5;break e;case 7:Sv(o)?(ze=0,ba=null,Wv(t)):(ze=0,ba=null,fi(e,t,o,7));break;case 5:var i=null;switch(Se.tag){case 26:i=Se.memoizedState;case 5:case 27:var l=Se;if(i?Y0(i):l.stateNode.complete){ze=0,ba=null;var s=l.sibling;if(s!==null)Se=s;else{var u=l.return;u!==null?(Se=u,Yc(u)):Se=null}break t}}ze=0,ba=null,fi(e,t,o,5);break;case 6:ze=0,ba=null,fi(e,t,o,6);break;case 8:Oh(),yt=6;break e;default:throw Error(N(462))}}ZO();break}catch(c){E0(e,c)}while(!0);return Fn=So=null,ie.H=n,ie.A=r,Be=a,Se!==null?0:(tt=null,Ie=0,jc(),yt)}function ZO(){for(;Se!==null&&!x_();)D0(Se)}function D0(e){var t=o0(e.alternate,e,$n);e.memoizedProps=e.pendingProps,t===null?Yc(e):Se=t}function Wv(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Fv(a,t,t.pendingProps,t.type,void 0,Ie);break;case 11:t=Fv(a,t,t.pendingProps,t.type.render,t.ref,Ie);break;case 5:xh(t);default:i0(a,t),t=Se=iS(t,$n),t=o0(a,t,$n)}e.memoizedProps=e.pendingProps,t===null?Yc(e):Se=t}function fi(e,t,a,n){Fn=So=null,xh(t),yi=null,$l=0;var r=t.return;try{if(UO(e,r,t,a,Ie)){yt=1,Cc(e,Va(a,e.current)),Se=null;return}}catch(o){if(r!==null)throw Se=r,o;yt=1,Cc(e,Va(a,e.current)),Se=null;return}t.flags&32768?(Te||n===1?e=!0:Pi||(Ie&536870912)!==0?e=!1:(xr=e=!0,(n===2||n===9||n===3||n===6)&&(n=Aa.current,n!==null&&n.tag===13&&(n.flags|=16384))),_0(t,e)):Yc(t)}function Yc(e){var t=e;do{if((t.flags&32768)!==0){_0(t,xr);return}e=t.return;var a=qO(t.alternate,t,$n);if(a!==null){Se=a;return}if(t=t.sibling,t!==null){Se=t;return}Se=t=e}while(t!==null);yt===0&&(yt=5)}function _0(e,t){do{var a=HO(e.alternate,e);if(a!==null){a.flags&=32767,Se=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Se=e;return}Se=e=a}while(e!==null);yt=6,Se=null}function $v(e,t,a,n,r,o,i,l,s){e.cancelPendingCommit=null;do Jc();while(Ot!==0);if((Be&6)!==0)throw Error(N(327));if(t!==null){if(t===e.current)throw Error(N(177));if(o=t.lanes|t.childLanes,o|=oh,M_(e,a,o,i,l,s),e===tt&&(Se=tt=null,Ie=0),Ti=t,Tr=e,Hn=a,_m=o,Om=r,k0=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,eP(pc,function(){return U0(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=ie.T,ie.T=null,r=Ue.p,Ue.p=2,i=Be,Be|=4;try{jO(e,t,a)}finally{Be=i,Ue.p=r,ie.T=n}}Ot=1,O0(),P0(),N0()}}function O0(){if(Ot===1){Ot=0;var e=Tr,t=Ti,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=ie.T,ie.T=null;var n=Ue.p;Ue.p=2;var r=Be;Be|=4;try{y0(t,e);var o=Fm,i=Yb(e.containerInfo),l=o.focusedElem,s=o.selectionRange;if(i!==l&&l&&l.ownerDocument&&Qb(l.ownerDocument.documentElement,l)){if(s!==null&&rh(l)){var u=s.start,c=s.end;if(c===void 0&&(c=u),"selectionStart"in l)l.selectionStart=u,l.selectionEnd=Math.min(c,l.value.length);else{var d=l.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=l.textContent.length,x=Math.min(s.start,m),I=s.end===void 0?x:Math.min(s.end,m);!p.extend&&x>I&&(i=I,I=x,x=i);var y=hv(l,x),w=hv(l,I);if(y&&w&&(p.rangeCount!==1||p.anchorNode!==y.node||p.anchorOffset!==y.offset||p.focusNode!==w.node||p.focusOffset!==w.offset)){var g=d.createRange();g.setStart(y.node,y.offset),p.removeAllRanges(),x>I?(p.addRange(g),p.extend(w.node,w.offset)):(g.setEnd(w.node,w.offset),p.addRange(g))}}}}for(d=[],p=l;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<d.length;l++){var b=d[l];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}Bc=!!Um,Fm=Um=null}finally{Be=r,Ue.p=n,ie.T=a}}e.current=t,Ot=2}}function P0(){if(Ot===2){Ot=0;var e=Tr,t=Ti,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=ie.T,ie.T=null;var n=Ue.p;Ue.p=2;var r=Be;Be|=4;try{f0(e,t.alternate,t)}finally{Be=r,Ue.p=n,ie.T=a}}Ot=3}}function N0(){if(Ot===4||Ot===3){Ot=0,v_();var e=Tr,t=Ti,a=Hn,n=k0;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Ot=5:(Ot=0,Ti=Tr=null,B0(e,e.pendingLanes));var r=e.pendingLanes;if(r===0&&(Lr=null),Qm(a),t=t.stateNode,La&&typeof La.onCommitFiberRoot=="function")try{La.onCommitFiberRoot(as,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=ie.T,r=Ue.p,Ue.p=2,ie.T=null;try{for(var o=e.onRecoverableError,i=0;i<n.length;i++){var l=n[i];o(l.value,{componentStack:l.stack})}}finally{ie.T=t,Ue.p=r}}(Hn&3)!==0&&Jc(),vn(e),r=e.pendingLanes,(a&261930)!==0&&(r&42)!==0?e===Pm?Fl++:(Fl=0,Pm=e):Fl=0,cs(0,!1)}}function B0(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ls(t)))}function Jc(){return O0(),P0(),N0(),U0()}function U0(){if(Ot!==5)return!1;var e=Tr,t=_m;_m=0;var a=Qm(Hn),n=ie.T,r=Ue.p;try{Ue.p=32>a?32:a,ie.T=null,a=Om,Om=null;var o=Tr,i=Hn;if(Ot=0,Ti=Tr=null,Hn=0,(Be&6)!==0)throw Error(N(331));var l=Be;if(Be|=4,S0(o.current),x0(o,o.current,i,a),Be=l,cs(0,!1),La&&typeof La.onPostCommitFiberRoot=="function")try{La.onPostCommitFiberRoot(as,o)}catch{}return!0}finally{Ue.p=r,ie.T=n,B0(e,t)}}function Xv(e,t,a){t=Va(a,t),t=Em(e.stateNode,t,2),e=kr(e,t,2),e!==null&&(rs(e,2),vn(e))}function qe(e,t,a){if(e.tag===3)Xv(e,e,a);else for(;t!==null;){if(t.tag===3){Xv(t,e,a);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Lr===null||!Lr.has(n))){e=Va(a,e),a=JS(2),n=kr(t,a,2),n!==null&&(e0(a,n,t,e),rs(n,2),vn(n));break}}t=t.return}}function Wp(e,t,a){var n=e.pingCache;if(n===null){n=e.pingCache=new WO;var r=new Set;n.set(t,r)}else r=n.get(t),r===void 0&&(r=new Set,n.set(t,r));r.has(a)||(Dh=!0,r.add(a),e=QO.bind(null,e,t,a),t.then(e,e))}function QO(e,t,a){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,tt===e&&(Ie&a)===a&&(yt===4||yt===3&&(Ie&62914560)===Ie&&300>ka()-Zc?(Be&2)===0&&Ei(e,0):_h|=a,Li===Ie&&(Li=0)),vn(e)}function F0(e,t){t===0&&(t=Ab()),e=bo(e,t),e!==null&&(rs(e,t),vn(e))}function YO(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),F0(e,a)}function JO(e,t){var a=0;switch(e.tag){case 31:case 13:var n=e.stateNode,r=e.memoizedState;r!==null&&(a=r.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(N(314))}n!==null&&n.delete(t),F0(e,a)}function eP(e,t){return Km(e,t)}var Ac=null,ei=null,Nm=!1,Rc=!1,$p=!1,br=0;function vn(e){e!==ei&&e.next===null&&(ei===null?Ac=ei=e:ei=ei.next=e),Rc=!0,Nm||(Nm=!0,aP())}function cs(e,t){if(!$p&&Rc){$p=!0;do for(var a=!1,n=Ac;n!==null;){if(!t)if(e!==0){var r=n.pendingLanes;if(r===0)var o=0;else{var i=n.suspendedLanes,l=n.pingedLanes;o=(1<<31-Ta(42|e)+1)-1,o&=r&~(i&~l),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(a=!0,Kv(n,o))}else o=Ie,o=Fc(n,n===tt?o:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(o&3)===0||ns(n,o)||(a=!0,Kv(n,o));n=n.next}while(a);$p=!1}}function tP(){z0()}function z0(){Rc=Nm=!1;var e=0;br!==0&&cP()&&(e=br);for(var t=ka(),a=null,n=Ac;n!==null;){var r=n.next,o=q0(n,t);o===0?(n.next=null,a===null?Ac=r:a.next=r,r===null&&(ei=a)):(a=n,(e!==0||(o&3)!==0)&&(Rc=!0)),n=r}Ot!==0&&Ot!==5||cs(e,!1),br!==0&&(br=0)}function q0(e,t){for(var a=e.suspendedLanes,n=e.pingedLanes,r=e.expirationTimes,o=e.pendingLanes&-62914561;0<o;){var i=31-Ta(o),l=1<<i,s=r[i];s===-1?((l&a)===0||(l&n)!==0)&&(r[i]=E_(l,t)):s<=t&&(e.expiredLanes|=l),o&=~l}if(t=tt,a=Ie,a=Fc(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,a===0||e===t&&(ze===2||ze===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&Sp(n),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||ns(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(n!==null&&Sp(n),Qm(a)){case 2:case 8:a=Eb;break;case 32:a=pc;break;case 268435456:a=Mb;break;default:a=pc}return n=H0.bind(null,e),a=Km(a,n),e.callbackPriority=t,e.callbackNode=a,t}return n!==null&&n!==null&&Sp(n),e.callbackPriority=2,e.callbackNode=null,2}function H0(e,t){if(Ot!==0&&Ot!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Jc()&&e.callbackNode!==a)return null;var n=Ie;return n=Fc(e,e===tt?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(T0(e,n,t),q0(e,ka()),e.callbackNode!=null&&e.callbackNode===a?H0.bind(null,e):null)}function Kv(e,t){if(Jc())return null;T0(e,t,!0)}function aP(){fP(function(){(Be&6)!==0?Km(Tb,tP):z0()})}function Ph(){if(br===0){var e=Ii;e===0&&(e=Du,Du<<=1,(Du&261888)===0&&(Du=256)),br=e}return br}function Zv(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Zu(""+e)}function Qv(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function nP(e,t,a,n,r){if(t==="submit"&&a&&a.stateNode===r){var o=Zv((r[ma]||null).action),i=n.submitter;i&&(t=(t=i[ma]||null)?Zv(t.formAction):i.getAttribute("formAction"),t!==null&&(o=t,i=null));var l=new zc("action","action",null,n,r);e.push({event:l,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(br!==0){var s=i?Qv(r,i):new FormData(r);Lm(a,{pending:!0,data:s,method:r.method,action:o},null,s)}}else typeof o=="function"&&(l.preventDefault(),s=i?Qv(r,i):new FormData(r),Lm(a,{pending:!0,data:s,method:r.method,action:o},o,s))},currentTarget:r}]})}}for(Vu=0;Vu<mm.length;Vu++)Gu=mm[Vu],Yv=Gu.toLowerCase(),Jv=Gu[0].toUpperCase()+Gu.slice(1),nn(Yv,"on"+Jv);var Gu,Yv,Jv,Vu;nn(eS,"onAnimationEnd");nn(tS,"onAnimationIteration");nn(aS,"onAnimationStart");nn("dblclick","onDoubleClick");nn("focusin","onFocus");nn("focusout","onBlur");nn(bO,"onTransitionRun");nn(SO,"onTransitionStart");nn(IO,"onTransitionCancel");nn(nS,"onTransitionEnd");bi("onMouseEnter",["mouseout","mouseover"]);bi("onMouseLeave",["mouseout","mouseover"]);bi("onPointerEnter",["pointerout","pointerover"]);bi("onPointerLeave",["pointerout","pointerover"]);wo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));wo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));wo("onBeforeInput",["compositionend","keypress","textInput","paste"]);wo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));wo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));wo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Zl="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(" "),rP=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Zl));function j0(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var n=e[a],r=n.event;n=n.listeners;e:{var o=void 0;if(t)for(var i=n.length-1;0<=i;i--){var l=n[i],s=l.instance,u=l.currentTarget;if(l=l.listener,s!==o&&r.isPropagationStopped())break e;o=l,r.currentTarget=u;try{o(r)}catch(c){hc(c)}r.currentTarget=null,o=s}else for(i=0;i<n.length;i++){if(l=n[i],s=l.instance,u=l.currentTarget,l=l.listener,s!==o&&r.isPropagationStopped())break e;o=l,r.currentTarget=u;try{o(r)}catch(c){hc(c)}r.currentTarget=null,o=s}}}}function be(e,t){var a=t[im];a===void 0&&(a=t[im]=new Set);var n=e+"__bubble";a.has(n)||(V0(t,e,2,!1),a.add(n))}function Xp(e,t,a){var n=0;t&&(n|=4),V0(a,e,n,t)}var Wu="_reactListening"+Math.random().toString(36).slice(2);function Nh(e){if(!e[Wu]){e[Wu]=!0,Pb.forEach(function(a){a!=="selectionchange"&&(rP.has(a)||Xp(a,!1,e),Xp(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Wu]||(t[Wu]=!0,Xp("selectionchange",!1,t))}}function V0(e,t,a,n){switch(nI(t)){case 2:var r=DP;break;case 8:r=_P;break;default:r=zh}a=r.bind(null,t,a,e),r=void 0,!dm||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),n?r!==void 0?e.addEventListener(t,a,{capture:!0,passive:r}):e.addEventListener(t,a,!0):r!==void 0?e.addEventListener(t,a,{passive:r}):e.addEventListener(t,a,!1)}function Kp(e,t,a,n,r){var o=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var i=n.tag;if(i===3||i===4){var l=n.stateNode.containerInfo;if(l===r)break;if(i===4)for(i=n.return;i!==null;){var s=i.tag;if((s===3||s===4)&&i.stateNode.containerInfo===r)return;i=i.return}for(;l!==null;){if(i=ni(l),i===null)return;if(s=i.tag,s===5||s===6||s===26||s===27){n=o=i;continue e}l=l.parentNode}}n=n.return}jb(function(){var u=o,c=eh(a),d=[];e:{var f=rS.get(e);if(f!==void 0){var p=zc,m=e;switch(e){case"keypress":if(Yu(a)===0)break e;case"keydown":case"keyup":p=J_;break;case"focusin":m="focus",p=Tp;break;case"focusout":m="blur",p=Tp;break;case"beforeblur":case"afterblur":p=Tp;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=iv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=q_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=aO;break;case eS:case tS:case aS:p=V_;break;case nS:p=rO;break;case"scroll":case"scrollend":p=F_;break;case"wheel":p=iO;break;case"copy":case"cut":case"paste":p=W_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=sv;break;case"toggle":case"beforetoggle":p=sO}var x=(t&4)!==0,I=!x&&(e==="scroll"||e==="scrollend"),y=x?f!==null?f+"Capture":null:f;x=[];for(var w=u,g;w!==null;){var b=w;if(g=b.stateNode,b=b.tag,b!==5&&b!==26&&b!==27||g===null||y===null||(b=Hl(w,y),b!=null&&x.push(Ql(w,b,g))),I)break;w=w.return}0<x.length&&(f=new p(f,m,null,a,c),d.push({event:f,listeners:x}))}}if((t&7)===0){e:{if(f=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",f&&a!==cm&&(m=a.relatedTarget||a.fromElement)&&(ni(m)||m[Ri]))break e;if((p||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,p?(m=a.relatedTarget||a.toElement,p=u,m=m?ni(m):null,m!==null&&(I=ts(m),x=m.tag,m!==I||x!==5&&x!==27&&x!==6)&&(m=null)):(p=null,m=u),p!==m)){if(x=iv,b="onMouseLeave",y="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(x=sv,b="onPointerLeave",y="onPointerEnter",w="pointer"),I=p==null?f:kl(p),g=m==null?f:kl(m),f=new x(b,w+"leave",p,a,c),f.target=I,f.relatedTarget=g,b=null,ni(c)===u&&(x=new x(y,w+"enter",m,a,c),x.target=g,x.relatedTarget=I,b=x),I=b,p&&m)t:{for(x=oP,y=p,w=m,g=0,b=y;b;b=x(b))g++;b=0;for(var T=w;T;T=x(T))b++;for(;0<g-b;)y=x(y),g--;for(;0<b-g;)w=x(w),b--;for(;g--;){if(y===w||w!==null&&y===w.alternate){x=y;break t}y=x(y),w=x(w)}x=null}else x=null;p!==null&&eb(d,f,p,x,!1),m!==null&&I!==null&&eb(d,I,m,x,!0)}}e:{if(f=u?kl(u):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var S=fv;else if(dv(f))if(Kb)S=wO;else{S=gO;var M=hO}else p=f.nodeName,!p||p.toLowerCase()!=="input"||f.type!=="checkbox"&&f.type!=="radio"?u&&Jm(u.elementType)&&(S=fv):S=yO;if(S&&(S=S(e,u))){Xb(d,S,a,c);break e}M&&M(e,f,u),e==="focusout"&&u&&f.type==="number"&&u.memoizedProps.value!=null&&um(f,"number",f.value)}switch(M=u?kl(u):window,e){case"focusin":(dv(M)||M.contentEditable==="true")&&(ii=M,fm=u,Al=null);break;case"focusout":Al=fm=ii=null;break;case"mousedown":pm=!0;break;case"contextmenu":case"mouseup":case"dragend":pm=!1,gv(d,a,c);break;case"selectionchange":if(vO)break;case"keydown":case"keyup":gv(d,a,c)}var R;if(nh)e:{switch(e){case"compositionstart":var _="onCompositionStart";break e;case"compositionend":_="onCompositionEnd";break e;case"compositionupdate":_="onCompositionUpdate";break e}_=void 0}else oi?Wb(e,a)&&(_="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(_="onCompositionStart");_&&(Gb&&a.locale!=="ko"&&(oi||_!=="onCompositionStart"?_==="onCompositionEnd"&&oi&&(R=Vb()):(wr=c,th="value"in wr?wr.value:wr.textContent,oi=!0)),M=Dc(u,_),0<M.length&&(_=new lv(_,e,null,a,c),d.push({event:_,listeners:M}),R?_.data=R:(R=$b(a),R!==null&&(_.data=R)))),(R=cO?dO(e,a):fO(e,a))&&(_=Dc(u,"onBeforeInput"),0<_.length&&(M=new lv("onBeforeInput","beforeinput",null,a,c),d.push({event:M,listeners:_}),M.data=R)),nP(d,e,u,a,c)}j0(d,t)})}function Ql(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Dc(e,t){for(var a=t+"Capture",n=[];e!==null;){var r=e,o=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||o===null||(r=Hl(e,a),r!=null&&n.unshift(Ql(e,r,o)),r=Hl(e,t),r!=null&&n.push(Ql(e,r,o))),e.tag===3)return n;e=e.return}return[]}function oP(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function eb(e,t,a,n,r){for(var o=t._reactName,i=[];a!==null&&a!==n;){var l=a,s=l.alternate,u=l.stateNode;if(l=l.tag,s!==null&&s===n)break;l!==5&&l!==26&&l!==27||u===null||(s=u,r?(u=Hl(a,o),u!=null&&i.unshift(Ql(a,u,s))):r||(u=Hl(a,o),u!=null&&i.push(Ql(a,u,s)))),a=a.return}i.length!==0&&e.push({event:t,listeners:i})}var iP=/\r\n?/g,lP=/\u0000|\uFFFD/g;function tb(e){return(typeof e=="string"?e:""+e).replace(iP,`
|
|
9
|
-
`).replace(lP,"")}function G0(e,t){return t=tb(t),tb(e)===t}function Ze(e,t,a,n,r,o){switch(a){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||Si(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&Si(e,""+n);break;case"className":Pu(e,"class",n);break;case"tabIndex":Pu(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":Pu(e,a,n);break;case"style":Hb(e,n,o);break;case"data":if(t!=="object"){Pu(e,"data",n);break}case"src":case"href":if(n===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=Zu(""+n),e.setAttribute(a,n);break;case"action":case"formAction":if(typeof n=="function"){e.setAttribute(a,"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 o=="function"&&(a==="formAction"?(t!=="input"&&Ze(e,t,"name",r.name,r,null),Ze(e,t,"formEncType",r.formEncType,r,null),Ze(e,t,"formMethod",r.formMethod,r,null),Ze(e,t,"formTarget",r.formTarget,r,null)):(Ze(e,t,"encType",r.encType,r,null),Ze(e,t,"method",r.method,r,null),Ze(e,t,"target",r.target,r,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=Zu(""+n),e.setAttribute(a,n);break;case"onClick":n!=null&&(e.onclick=Un);break;case"onScroll":n!=null&&be("scroll",e);break;case"onScrollEnd":n!=null&&be("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(N(61));if(a=n.__html,a!=null){if(r.children!=null)throw Error(N(60));e.innerHTML=a}}break;case"multiple":e.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":e.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){e.removeAttribute("xlink:href");break}a=Zu(""+n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""+n):e.removeAttribute(a);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":n&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":n===!0?e.setAttribute(a,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,n):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(a,n):e.removeAttribute(a);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?e.removeAttribute(a):e.setAttribute(a,n);break;case"popover":be("beforetoggle",e),be("toggle",e),Ku(e,"popover",n);break;case"xlinkActuate":An(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":An(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":An(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":An(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":An(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":An(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":An(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":An(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":An(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":Ku(e,"is",n);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=B_.get(a)||a,Ku(e,a,n))}}function Bm(e,t,a,n,r,o){switch(a){case"style":Hb(e,n,o);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(N(61));if(a=n.__html,a!=null){if(r.children!=null)throw Error(N(60));e.innerHTML=a}}break;case"children":typeof n=="string"?Si(e,n):(typeof n=="number"||typeof n=="bigint")&&Si(e,""+n);break;case"onScroll":n!=null&&be("scroll",e);break;case"onScrollEnd":n!=null&&be("scrollend",e);break;case"onClick":n!=null&&(e.onclick=Un);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Nb.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(r=a.endsWith("Capture"),t=a.slice(2,r?a.length-7:void 0),o=e[ma]||null,o=o!=null?o[a]:null,typeof o=="function"&&e.removeEventListener(t,o,r),typeof n=="function")){typeof o!="function"&&o!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,n,r);break e}a in e?e[a]=n:n===!0?e.setAttribute(a,""):Ku(e,a,n)}}}function Xt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":be("error",e),be("load",e);var n=!1,r=!1,o;for(o in a)if(a.hasOwnProperty(o)){var i=a[o];if(i!=null)switch(o){case"src":n=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(N(137,t));default:Ze(e,t,o,i,a,null)}}r&&Ze(e,t,"srcSet",a.srcSet,a,null),n&&Ze(e,t,"src",a.src,a,null);return;case"input":be("invalid",e);var l=o=i=r=null,s=null,u=null;for(n in a)if(a.hasOwnProperty(n)){var c=a[n];if(c!=null)switch(n){case"name":r=c;break;case"type":i=c;break;case"checked":s=c;break;case"defaultChecked":u=c;break;case"value":o=c;break;case"defaultValue":l=c;break;case"children":case"dangerouslySetInnerHTML":if(c!=null)throw Error(N(137,t));break;default:Ze(e,t,n,c,a,null)}}Fb(e,o,l,s,u,i,r,!1);return;case"select":be("invalid",e),n=i=o=null;for(r in a)if(a.hasOwnProperty(r)&&(l=a[r],l!=null))switch(r){case"value":o=l;break;case"defaultValue":i=l;break;case"multiple":n=l;default:Ze(e,t,r,l,a,null)}t=o,a=i,e.multiple=!!n,t!=null?mi(e,!!n,t,!1):a!=null&&mi(e,!!n,a,!0);return;case"textarea":be("invalid",e),o=r=n=null;for(i in a)if(a.hasOwnProperty(i)&&(l=a[i],l!=null))switch(i){case"value":n=l;break;case"defaultValue":r=l;break;case"children":o=l;break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(N(91));break;default:Ze(e,t,i,l,a,null)}qb(e,n,r,o);return;case"option":for(s in a)a.hasOwnProperty(s)&&(n=a[s],n!=null)&&(s==="selected"?e.selected=n&&typeof n!="function"&&typeof n!="symbol":Ze(e,t,s,n,a,null));return;case"dialog":be("beforetoggle",e),be("toggle",e),be("cancel",e),be("close",e);break;case"iframe":case"object":be("load",e);break;case"video":case"audio":for(n=0;n<Zl.length;n++)be(Zl[n],e);break;case"image":be("error",e),be("load",e);break;case"details":be("toggle",e);break;case"embed":case"source":case"link":be("error",e),be("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(u in a)if(a.hasOwnProperty(u)&&(n=a[u],n!=null))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(N(137,t));default:Ze(e,t,u,n,a,null)}return;default:if(Jm(t)){for(c in a)a.hasOwnProperty(c)&&(n=a[c],n!==void 0&&Bm(e,t,c,n,a,void 0));return}}for(l in a)a.hasOwnProperty(l)&&(n=a[l],n!=null&&Ze(e,t,l,n,a,null))}function sP(e,t,a,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,o=null,i=null,l=null,s=null,u=null,c=null;for(p in a){var d=a[p];if(a.hasOwnProperty(p)&&d!=null)switch(p){case"checked":break;case"value":break;case"defaultValue":s=d;default:n.hasOwnProperty(p)||Ze(e,t,p,null,n,d)}}for(var f in n){var p=n[f];if(d=a[f],n.hasOwnProperty(f)&&(p!=null||d!=null))switch(f){case"type":o=p;break;case"name":r=p;break;case"checked":u=p;break;case"defaultChecked":c=p;break;case"value":i=p;break;case"defaultValue":l=p;break;case"children":case"dangerouslySetInnerHTML":if(p!=null)throw Error(N(137,t));break;default:p!==d&&Ze(e,t,f,p,n,d)}}sm(e,i,l,s,u,c,o,r);return;case"select":p=i=l=f=null;for(o in a)if(s=a[o],a.hasOwnProperty(o)&&s!=null)switch(o){case"value":break;case"multiple":p=s;default:n.hasOwnProperty(o)||Ze(e,t,o,null,n,s)}for(r in n)if(o=n[r],s=a[r],n.hasOwnProperty(r)&&(o!=null||s!=null))switch(r){case"value":f=o;break;case"defaultValue":l=o;break;case"multiple":i=o;default:o!==s&&Ze(e,t,r,o,n,s)}t=l,a=i,n=p,f!=null?mi(e,!!a,f,!1):!!n!=!!a&&(t!=null?mi(e,!!a,t,!0):mi(e,!!a,a?[]:"",!1));return;case"textarea":p=f=null;for(l in a)if(r=a[l],a.hasOwnProperty(l)&&r!=null&&!n.hasOwnProperty(l))switch(l){case"value":break;case"children":break;default:Ze(e,t,l,null,n,r)}for(i in n)if(r=n[i],o=a[i],n.hasOwnProperty(i)&&(r!=null||o!=null))switch(i){case"value":f=r;break;case"defaultValue":p=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(N(91));break;default:r!==o&&Ze(e,t,i,r,n,o)}zb(e,f,p);return;case"option":for(var m in a)f=a[m],a.hasOwnProperty(m)&&f!=null&&!n.hasOwnProperty(m)&&(m==="selected"?e.selected=!1:Ze(e,t,m,null,n,f));for(s in n)f=n[s],p=a[s],n.hasOwnProperty(s)&&f!==p&&(f!=null||p!=null)&&(s==="selected"?e.selected=f&&typeof f!="function"&&typeof f!="symbol":Ze(e,t,s,f,n,p));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 x in a)f=a[x],a.hasOwnProperty(x)&&f!=null&&!n.hasOwnProperty(x)&&Ze(e,t,x,null,n,f);for(u in n)if(f=n[u],p=a[u],n.hasOwnProperty(u)&&f!==p&&(f!=null||p!=null))switch(u){case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(N(137,t));break;default:Ze(e,t,u,f,n,p)}return;default:if(Jm(t)){for(var I in a)f=a[I],a.hasOwnProperty(I)&&f!==void 0&&!n.hasOwnProperty(I)&&Bm(e,t,I,void 0,n,f);for(c in n)f=n[c],p=a[c],!n.hasOwnProperty(c)||f===p||f===void 0&&p===void 0||Bm(e,t,c,f,n,p);return}}for(var y in a)f=a[y],a.hasOwnProperty(y)&&f!=null&&!n.hasOwnProperty(y)&&Ze(e,t,y,null,n,f);for(d in n)f=n[d],p=a[d],!n.hasOwnProperty(d)||f===p||f==null&&p==null||Ze(e,t,d,f,n,p)}function ab(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function uP(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),n=0;n<a.length;n++){var r=a[n],o=r.transferSize,i=r.initiatorType,l=r.duration;if(o&&l&&ab(i)){for(i=0,l=r.responseEnd,n+=1;n<a.length;n++){var s=a[n],u=s.startTime;if(u>l)break;var c=s.transferSize,d=s.initiatorType;c&&ab(d)&&(s=s.responseEnd,i+=c*(s<l?1:(l-u)/(s-u)))}if(--n,t+=8*(o+i)/(r.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Um=null,Fm=null;function _c(e){return e.nodeType===9?e:e.ownerDocument}function nb(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function W0(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function zm(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Zp=null;function cP(){var e=window.event;return e&&e.type==="popstate"?e===Zp?!1:(Zp=e,!0):(Zp=null,!1)}var $0=typeof setTimeout=="function"?setTimeout:void 0,dP=typeof clearTimeout=="function"?clearTimeout:void 0,rb=typeof Promise=="function"?Promise:void 0,fP=typeof queueMicrotask=="function"?queueMicrotask:typeof rb<"u"?function(e){return rb.resolve(null).then(e).catch(pP)}:$0;function pP(e){setTimeout(function(){throw e})}function Nr(e){return e==="head"}function ob(e,t){var a=t,n=0;do{var r=a.nextSibling;if(e.removeChild(a),r&&r.nodeType===8)if(a=r.data,a==="/$"||a==="/&"){if(n===0){e.removeChild(r),Ai(t);return}n--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")n++;else if(a==="html")zl(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,zl(a);for(var o=a.firstChild;o;){var i=o.nextSibling,l=o.nodeName;o[os]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&o.rel.toLowerCase()==="stylesheet"||a.removeChild(o),o=i}}else a==="body"&&zl(e.ownerDocument.body);a=r}while(a);Ai(t)}function ib(e,t){var a=e;e=0;do{var n=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),n&&n.nodeType===8)if(a=n.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=n}while(a)}function qm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":qm(a),Ym(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function mP(e,t,a,n){for(;e.nodeType===1;){var r=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[os])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(o=e.getAttribute("rel"),o==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(o!==r.rel||e.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(o=e.getAttribute("src"),(o!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&o&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var o=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===o)return e}else return e;if(e=$a(e.nextSibling),e===null)break}return null}function hP(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=$a(e.nextSibling),e===null))return null;return e}function X0(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=$a(e.nextSibling),e===null))return null;return e}function Hm(e){return e.data==="$?"||e.data==="$~"}function jm(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function gP(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var n=function(){t(),a.removeEventListener("DOMContentLoaded",n)};a.addEventListener("DOMContentLoaded",n),e._reactRetry=n}}function $a(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Vm=null;function lb(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return $a(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function sb(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function K0(e,t,a){switch(t=_c(a),e){case"html":if(e=t.documentElement,!e)throw Error(N(452));return e;case"head":if(e=t.head,!e)throw Error(N(453));return e;case"body":if(e=t.body,!e)throw Error(N(454));return e;default:throw Error(N(451))}}function zl(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ym(e)}var Xa=new Map,ub=new Set;function Oc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Xn=Ue.d;Ue.d={f:yP,r:wP,D:xP,C:vP,L:bP,m:SP,X:CP,S:IP,M:kP};function yP(){var e=Xn.f(),t=Qc();return e||t}function wP(e){var t=Di(e);t!==null&&t.tag===5&&t.type==="form"?HS(t):Xn.r(e)}var Ni=typeof document>"u"?null:document;function Z0(e,t,a){var n=Ni;if(n&&typeof t=="string"&&t){var r=ja(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof a=="string"&&(r+='[crossorigin="'+a+'"]'),ub.has(r)||(ub.add(r),e={rel:e,crossOrigin:a,href:t},n.querySelector(r)===null&&(t=n.createElement("link"),Xt(t,"link",e),qt(t),n.head.appendChild(t)))}}function xP(e){Xn.D(e),Z0("dns-prefetch",e,null)}function vP(e,t){Xn.C(e,t),Z0("preconnect",e,t)}function bP(e,t,a){Xn.L(e,t,a);var n=Ni;if(n&&e&&t){var r='link[rel="preload"][as="'+ja(t)+'"]';t==="image"&&a&&a.imageSrcSet?(r+='[imagesrcset="'+ja(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(r+='[imagesizes="'+ja(a.imageSizes)+'"]')):r+='[href="'+ja(e)+'"]';var o=r;switch(t){case"style":o=Mi(e);break;case"script":o=Bi(e)}Xa.has(o)||(e=st({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),Xa.set(o,e),n.querySelector(r)!==null||t==="style"&&n.querySelector(ds(o))||t==="script"&&n.querySelector(fs(o))||(t=n.createElement("link"),Xt(t,"link",e),qt(t),n.head.appendChild(t)))}}function SP(e,t){Xn.m(e,t);var a=Ni;if(a&&e){var n=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+ja(n)+'"][href="'+ja(e)+'"]',o=r;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=Bi(e)}if(!Xa.has(o)&&(e=st({rel:"modulepreload",href:e},t),Xa.set(o,e),a.querySelector(r)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(fs(o)))return}n=a.createElement("link"),Xt(n,"link",e),qt(n),a.head.appendChild(n)}}}function IP(e,t,a){Xn.S(e,t,a);var n=Ni;if(n&&e){var r=pi(n).hoistableStyles,o=Mi(e);t=t||"default";var i=r.get(o);if(!i){var l={loading:0,preload:null};if(i=n.querySelector(ds(o)))l.loading=5;else{e=st({rel:"stylesheet",href:e,"data-precedence":t},a),(a=Xa.get(o))&&Bh(e,a);var s=i=n.createElement("link");qt(s),Xt(s,"link",e),s._p=new Promise(function(u,c){s.onload=u,s.onerror=c}),s.addEventListener("load",function(){l.loading|=1}),s.addEventListener("error",function(){l.loading|=2}),l.loading|=4,ic(i,t,n)}i={type:"stylesheet",instance:i,count:1,state:l},r.set(o,i)}}}function CP(e,t){Xn.X(e,t);var a=Ni;if(a&&e){var n=pi(a).hoistableScripts,r=Bi(e),o=n.get(r);o||(o=a.querySelector(fs(r)),o||(e=st({src:e,async:!0},t),(t=Xa.get(r))&&Uh(e,t),o=a.createElement("script"),qt(o),Xt(o,"link",e),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},n.set(r,o))}}function kP(e,t){Xn.M(e,t);var a=Ni;if(a&&e){var n=pi(a).hoistableScripts,r=Bi(e),o=n.get(r);o||(o=a.querySelector(fs(r)),o||(e=st({src:e,async:!0,type:"module"},t),(t=Xa.get(r))&&Uh(e,t),o=a.createElement("script"),qt(o),Xt(o,"link",e),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},n.set(r,o))}}function cb(e,t,a,n){var r=(r=Sr.current)?Oc(r):null;if(!r)throw Error(N(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Mi(a.href),a=pi(r).hoistableStyles,n=a.get(t),n||(n={type:"style",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Mi(a.href);var o=pi(r).hoistableStyles,i=o.get(e);if(i||(r=r.ownerDocument||r,i={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(e,i),(o=r.querySelector(ds(e)))&&!o._p&&(i.instance=o,i.state.loading=5),Xa.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Xa.set(e,a),o||LP(r,e,a,i.state))),t&&n===null)throw Error(N(528,""));return i}if(t&&n!==null)throw Error(N(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Bi(a),a=pi(r).hoistableScripts,n=a.get(t),n||(n={type:"script",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(N(444,e))}}function Mi(e){return'href="'+ja(e)+'"'}function ds(e){return'link[rel="stylesheet"]['+e+"]"}function Q0(e){return st({},e,{"data-precedence":e.precedence,precedence:null})}function LP(e,t,a,n){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?n.loading=1:(t=e.createElement("link"),n.preload=t,t.addEventListener("load",function(){return n.loading|=1}),t.addEventListener("error",function(){return n.loading|=2}),Xt(t,"link",a),qt(t),e.head.appendChild(t))}function Bi(e){return'[src="'+ja(e)+'"]'}function fs(e){return"script[async]"+e}function db(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+ja(a.href)+'"]');if(n)return t.instance=n,qt(n),n;var r=st({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),qt(n),Xt(n,"style",r),ic(n,a.precedence,e),t.instance=n;case"stylesheet":r=Mi(a.href);var o=e.querySelector(ds(r));if(o)return t.state.loading|=4,t.instance=o,qt(o),o;n=Q0(a),(r=Xa.get(r))&&Bh(n,r),o=(e.ownerDocument||e).createElement("link"),qt(o);var i=o;return i._p=new Promise(function(l,s){i.onload=l,i.onerror=s}),Xt(o,"link",n),t.state.loading|=4,ic(o,a.precedence,e),t.instance=o;case"script":return o=Bi(a.src),(r=e.querySelector(fs(o)))?(t.instance=r,qt(r),r):(n=a,(r=Xa.get(o))&&(n=st({},a),Uh(n,r)),e=e.ownerDocument||e,r=e.createElement("script"),qt(r),Xt(r,"link",n),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(N(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,ic(n,a.precedence,e));return t.instance}function ic(e,t,a){for(var n=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=n.length?n[n.length-1]:null,o=r,i=0;i<n.length;i++){var l=n[i];if(l.dataset.precedence===t)o=l;else if(o!==r)break}o?o.parentNode.insertBefore(e,o.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Bh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Uh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var lc=null;function fb(e,t,a){if(lc===null){var n=new Map,r=lc=new Map;r.set(a,n)}else r=lc,n=r.get(a),n||(n=new Map,r.set(a,n));if(n.has(e))return n;for(n.set(e,null),a=a.getElementsByTagName(e),r=0;r<a.length;r++){var o=a[r];if(!(o[os]||o[Gt]||e==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var i=o.getAttribute(t)||"";i=e+i;var l=n.get(i);l?l.push(o):n.set(i,[o])}}return n}function pb(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function TP(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Y0(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function EP(e,t,a,n){if(a.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var r=Mi(n.href),o=t.querySelector(ds(r));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Pc.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=o,qt(o);return}o=t.ownerDocument||t,n=Q0(n),(r=Xa.get(r))&&Bh(n,r),o=o.createElement("link"),qt(o);var i=o;i._p=new Promise(function(l,s){i.onload=l,i.onerror=s}),Xt(o,"link",n),a.instance=o}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Pc.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Qp=0;function MP(e,t){return e.stylesheets&&e.count===0&&sc(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var n=setTimeout(function(){if(e.stylesheets&&sc(e,e.stylesheets),e.unsuspend){var o=e.unsuspend;e.unsuspend=null,o()}},6e4+t);0<e.imgBytes&&Qp===0&&(Qp=62500*uP());var r=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&sc(e,e.stylesheets),e.unsuspend)){var o=e.unsuspend;e.unsuspend=null,o()}},(e.imgBytes>Qp?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(r)}}:null}function Pc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)sc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Nc=null;function sc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Nc=new Map,t.forEach(AP,e),Nc=null,Pc.call(e))}function AP(e,t){if(!(t.state.loading&4)){var a=Nc.get(e);if(a)var n=a.get(null);else{a=new Map,Nc.set(e,a);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<r.length;o++){var i=r[o];(i.nodeName==="LINK"||i.getAttribute("media")!=="not all")&&(a.set(i.dataset.precedence,i),n=i)}n&&a.set(null,n)}r=t.instance,i=r.getAttribute("data-precedence"),o=a.get(i)||n,o===n&&a.set(null,r),a.set(i,r),this.count++,n=Pc.bind(this),r.addEventListener("load",n),r.addEventListener("error",n),o?o.parentNode.insertBefore(r,o.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var Yl={$$typeof:Bn,Provider:null,Consumer:null,_currentValue:lo,_currentValue2:lo,_threadCount:0};function RP(e,t,a,n,r,o,i,l,s){this.tag=1,this.containerInfo=e,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=Ip(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ip(0),this.hiddenUpdates=Ip(null),this.identifierPrefix=n,this.onUncaughtError=r,this.onCaughtError=o,this.onRecoverableError=i,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=s,this.incompleteTransitions=new Map}function J0(e,t,a,n,r,o,i,l,s,u,c,d){return e=new RP(e,t,a,i,s,u,c,d,l),t=1,o===!0&&(t|=24),o=Ia(3,null,null,t),e.current=o,o.stateNode=e,t=ch(),t.refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:n,isDehydrated:a,cache:t},ph(o),e}function eI(e){return e?(e=ui,e):ui}function tI(e,t,a,n,r,o){r=eI(r),n.context===null?n.context=r:n.pendingContext=r,n=Cr(t),n.payload={element:a},o=o===void 0?null:o,o!==null&&(n.callback=o),a=kr(e,n,t),a!==null&&(pa(a,e,t),Dl(a,e,t))}function mb(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Fh(e,t){mb(e,t),(e=e.alternate)&&mb(e,t)}function aI(e){if(e.tag===13||e.tag===31){var t=bo(e,67108864);t!==null&&pa(t,e,67108864),Fh(e,67108864)}}function hb(e){if(e.tag===13||e.tag===31){var t=Ea();t=Zm(t);var a=bo(e,t);a!==null&&pa(a,e,t),Fh(e,t)}}var Bc=!0;function DP(e,t,a,n){var r=ie.T;ie.T=null;var o=Ue.p;try{Ue.p=2,zh(e,t,a,n)}finally{Ue.p=o,ie.T=r}}function _P(e,t,a,n){var r=ie.T;ie.T=null;var o=Ue.p;try{Ue.p=8,zh(e,t,a,n)}finally{Ue.p=o,ie.T=r}}function zh(e,t,a,n){if(Bc){var r=Gm(n);if(r===null)Kp(e,t,n,Uc,a),gb(e,n);else if(PP(r,e,t,a,n))n.stopPropagation();else if(gb(e,n),t&4&&-1<OP.indexOf(e)){for(;r!==null;){var o=Di(r);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var i=ro(o.pendingLanes);if(i!==0){var l=o;for(l.pendingLanes|=2,l.entangledLanes|=2;i;){var s=1<<31-Ta(i);l.entanglements[1]|=s,i&=~s}vn(o),(Be&6)===0&&(Tc=ka()+500,cs(0,!1))}}break;case 31:case 13:l=bo(o,2),l!==null&&pa(l,o,2),Qc(),Fh(o,2)}if(o=Gm(n),o===null&&Kp(e,t,n,Uc,a),o===r)break;r=o}r!==null&&n.stopPropagation()}else Kp(e,t,n,null,a)}}function Gm(e){return e=eh(e),qh(e)}var Uc=null;function qh(e){if(Uc=null,e=ni(e),e!==null){var t=ts(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=Sb(t),e!==null)return e;e=null}else if(a===31){if(e=Ib(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Uc=e,null}function nI(e){switch(e){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(b_()){case Tb:return 2;case Eb:return 8;case pc:case S_:return 32;case Mb:return 268435456;default:return 32}default:return 32}}var Wm=!1,Er=null,Mr=null,Ar=null,Jl=new Map,es=new Map,gr=[],OP="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 gb(e,t){switch(e){case"focusin":case"focusout":Er=null;break;case"dragenter":case"dragleave":Mr=null;break;case"mouseover":case"mouseout":Ar=null;break;case"pointerover":case"pointerout":Jl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":es.delete(t.pointerId)}}function bl(e,t,a,n,r,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:a,eventSystemFlags:n,nativeEvent:o,targetContainers:[r]},t!==null&&(t=Di(t),t!==null&&aI(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function PP(e,t,a,n,r){switch(t){case"focusin":return Er=bl(Er,e,t,a,n,r),!0;case"dragenter":return Mr=bl(Mr,e,t,a,n,r),!0;case"mouseover":return Ar=bl(Ar,e,t,a,n,r),!0;case"pointerover":var o=r.pointerId;return Jl.set(o,bl(Jl.get(o)||null,e,t,a,n,r)),!0;case"gotpointercapture":return o=r.pointerId,es.set(o,bl(es.get(o)||null,e,t,a,n,r)),!0}return!1}function rI(e){var t=ni(e.target);if(t!==null){var a=ts(t);if(a!==null){if(t=a.tag,t===13){if(t=Sb(a),t!==null){e.blockedOn=t,Jx(e.priority,function(){hb(a)});return}}else if(t===31){if(t=Ib(a),t!==null){e.blockedOn=t,Jx(e.priority,function(){hb(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function uc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Gm(e.nativeEvent);if(a===null){a=e.nativeEvent;var n=new a.constructor(a.type,a);cm=n,a.target.dispatchEvent(n),cm=null}else return t=Di(a),t!==null&&aI(t),e.blockedOn=a,!1;t.shift()}return!0}function yb(e,t,a){uc(e)&&a.delete(t)}function NP(){Wm=!1,Er!==null&&uc(Er)&&(Er=null),Mr!==null&&uc(Mr)&&(Mr=null),Ar!==null&&uc(Ar)&&(Ar=null),Jl.forEach(yb),es.forEach(yb)}function $u(e,t){e.blockedOn===t&&(e.blockedOn=null,Wm||(Wm=!0,Pt.unstable_scheduleCallback(Pt.unstable_NormalPriority,NP)))}var Xu=null;function wb(e){Xu!==e&&(Xu=e,Pt.unstable_scheduleCallback(Pt.unstable_NormalPriority,function(){Xu===e&&(Xu=null);for(var t=0;t<e.length;t+=3){var a=e[t],n=e[t+1],r=e[t+2];if(typeof n!="function"){if(qh(n||a)===null)continue;break}var o=Di(a);o!==null&&(e.splice(t,3),t-=3,Lm(o,{pending:!0,data:r,method:a.method,action:n},n,r))}}))}function Ai(e){function t(s){return $u(s,e)}Er!==null&&$u(Er,e),Mr!==null&&$u(Mr,e),Ar!==null&&$u(Ar,e),Jl.forEach(t),es.forEach(t);for(var a=0;a<gr.length;a++){var n=gr[a];n.blockedOn===e&&(n.blockedOn=null)}for(;0<gr.length&&(a=gr[0],a.blockedOn===null);)rI(a),a.blockedOn===null&&gr.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(n=0;n<a.length;n+=3){var r=a[n],o=a[n+1],i=r[ma]||null;if(typeof o=="function")i||wb(a);else if(i){var l=null;if(o&&o.hasAttribute("formAction")){if(r=o,i=o[ma]||null)l=i.formAction;else if(qh(r)!==null)continue}else l=i.action;typeof l=="function"?a[n+1]=l:(a.splice(n,3),n-=3),wb(a)}}}function oI(){function e(o){o.canIntercept&&o.info==="react-transition"&&o.intercept({handler:function(){return new Promise(function(i){return r=i})},focusReset:"manual",scroll:"manual"})}function t(){r!==null&&(r(),r=null),n||setTimeout(a,20)}function a(){if(!n&&!navigation.transition){var o=navigation.currentEntry;o&&o.url!=null&&navigation.navigate(o.url,{state:o.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var n=!1,r=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){n=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),r!==null&&(r(),r=null)}}}function Hh(e){this._internalRoot=e}ed.prototype.render=Hh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(N(409));var a=t.current,n=Ea();tI(a,n,e,t,null,null)};ed.prototype.unmount=Hh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;tI(e.current,2,null,e,null,null),Qc(),t[Ri]=null}};function ed(e){this._internalRoot=e}ed.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ob();e={blockedOn:null,target:e,priority:t};for(var a=0;a<gr.length&&t!==0&&t<gr[a].priority;a++);gr.splice(a,0,e),a===0&&rI(e)}};var xb=vb.version;if(xb!=="19.2.4")throw Error(N(527,xb,"19.2.4"));Ue.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(N(188)):(e=Object.keys(e).join(","),Error(N(268,e)));return e=m_(t),e=e!==null?Cb(e):null,e=e===null?null:e.stateNode,e};var BP={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:ie,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Sl=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Sl.isDisabled&&Sl.supportsFiber))try{as=Sl.inject(BP),La=Sl}catch{}var Sl;td.createRoot=function(e,t){if(!bb(e))throw Error(N(299));var a=!1,n="",r=ZS,o=QS,i=YS;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=J0(e,1,!1,null,null,a,n,null,r,o,i,oI),e[Ri]=t.current,Nh(e),new Hh(t)};td.hydrateRoot=function(e,t,a){if(!bb(e))throw Error(N(299));var n=!1,r="",o=ZS,i=QS,l=YS,s=null;return a!=null&&(a.unstable_strictMode===!0&&(n=!0),a.identifierPrefix!==void 0&&(r=a.identifierPrefix),a.onUncaughtError!==void 0&&(o=a.onUncaughtError),a.onCaughtError!==void 0&&(i=a.onCaughtError),a.onRecoverableError!==void 0&&(l=a.onRecoverableError),a.formState!==void 0&&(s=a.formState)),t=J0(e,1,!0,t,a??null,n,r,s,o,i,l,oI),t.context=eI(null),a=t.current,n=Ea(),n=Zm(n),r=Cr(n),r.callback=null,kr(a,r,n),a=n,t.current.lanes=a,rs(t,a),vn(t),e[Ri]=t.current,Nh(e),new ed(t)};td.version="19.2.4"});var uI=Kt((e8,sI)=>{"use strict";function lI(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(lI)}catch(e){console.error(e)}}lI(),sI.exports=iI()});var PI=Kt(sd=>{"use strict";var zN=Symbol.for("react.transitional.element"),qN=Symbol.for("react.fragment");function OI(e,t,a){var n=null;if(a!==void 0&&(n=""+a),t.key!==void 0&&(n=""+t.key),"key"in t){a={};for(var r in t)r!=="key"&&(a[r]=t[r])}else a=t;return t=a.ref,{$$typeof:zN,type:e,key:n,ref:t!==void 0?t:null,props:a}}sd.Fragment=qN;sd.jsx=OI;sd.jsxs=OI});var ne=Kt((_V,NI)=>{"use strict";NI.exports=PI()});function UI(e){var t,a,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(a=UI(e[t]))&&(n&&(n+=" "),n+=a)}else for(a in e)e[a]&&(n&&(n+=" "),n+=a);return n}function ud(){for(var e,t,a=0,n="",r=arguments.length;a<r;a++)(e=arguments[a])&&(t=UI(e))&&(n&&(n+=" "),n+=t);return n}var tg=C(()=>{"use strict"});function ag(...e){return e.filter(Boolean).join(" ")}function FI(){return ag}var ng=C(()=>{"use strict"});function aB(e){let t=[],a=-1;for(;++a<e.length;)t[a]=Fr(e[a]);return md(n);function n(...r){let o=-1;for(;++o<t.length;)if(t[o].apply(this,r))return!0;return!1}}function nB(e){let t=e;return md(a);function a(n){let r=n,o;for(o in e)if(r[o]!==t[o])return!1;return!0}}function rB(e){return md(t);function t(a){return a&&a.type===e}}function md(e){return t;function t(a,n,r){return!!(iB(a)&&e.call(this,a,typeof n=="number"?n:void 0,r||void 0))}}function oB(){return!0}function iB(e){return e!==null&&typeof e=="object"&&"type"in e}var Fr,cC=C(()=>{"use strict";Fr=(function(e){if(e==null)return oB;if(typeof e=="function")return md(e);if(typeof e=="object")return Array.isArray(e)?aB(e):nB(e);if(typeof e=="string")return rB(e);throw new Error("Expected function, string, or object as test")})});var hd=C(()=>{"use strict";cC()});function Ds(e,t,a,n){let r;typeof t=="function"&&typeof a!="function"?(n=a,a=t):r=t;let o=Fr(r),i=n?-1:1;l(e,void 0,[])();function l(s,u,c){let d=s&&typeof s=="object"?s:{};if(typeof d.type=="string"){let p=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(s.type+(p?"<"+p+">":""))+")"})}return f;function f(){let p=dC,m,x,I;if((!t||o(s,u,c[c.length-1]||void 0))&&(p=lB(a(s,c)),p[0]===Lo))return p;if("children"in s&&s.children){let y=s;if(y.children&&p[0]!==To)for(x=(n?y.children.length:-1)+i,I=c.concat(y);x>-1&&x<y.children.length;){let w=y.children[x];if(m=l(w,x,I)(),m[0]===Lo)return m;x=typeof m[1]=="number"?m[1]:x+i}}return p}}}function lB(e){return Array.isArray(e)?e:typeof e=="number"?[Yn,e]:e==null?dC:[e]}var dC,Yn,Lo,To,fC=C(()=>{"use strict";hd();dC=[],Yn=!0,Lo=!1,To="skip"});var gd=C(()=>{"use strict";fC()});function Jn(e,t,a,n){let r,o,i;typeof t=="function"&&typeof a!="function"?(o=void 0,i=t,r=a):(o=t,i=a,r=n),Ds(e,o,l,r);function l(s,u){let c=u[u.length-1],d=c?c.children.indexOf(s):void 0;return i(s,d,c)}}var pC=C(()=>{"use strict";gd();gd()});var yd=C(()=>{"use strict";pC()});function gC({defaultOrigin:e="",allowedLinkPrefixes:t=[],allowedImagePrefixes:a=[],allowDataImages:n=!1,allowedProtocols:r=[],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:i="text-gray-500"}){let l=t.length&&!t.every(u=>u==="*"),s=a.length&&!a.every(u=>u==="*");if(!e&&(l||s))throw new Error("defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided");return u=>{let c=dB(e,t,a,n,r,o,i);Jn(u,c)}}function mC(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 sB(e){return typeof e!="string"?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")}function hC(e,t,a,n=!1,r=!1,o=[]){if(!e)return null;if(typeof e=="string"&&e.startsWith("#")&&!r)try{if(new URL(e,"http://example.com").hash===e)return e}catch{}if(typeof e=="string"&&e.startsWith("data:"))return r&&n&&e.startsWith("data:image/")?e:null;if(typeof e=="string"&&e.startsWith("blob:")){try{if(new URL(e).protocol==="blob:"&&e.length>5){let c=e.substring(5);if(c&&c.length>0&&c!=="invalid")return e}}catch{return null}return null}let i=mC(e,a);if(!i||cB.has(i.protocol)||!(uB.has(i.protocol)||o.includes(i.protocol)||o.includes("*")))return null;if(i.protocol==="mailto:"||!i.protocol.match(/^https?:$/))return i.href;let s=sB(e);return i&&t.some(u=>{let c=mC(u,a);return!c||c.origin!==i.origin?!1:i.href.startsWith(c.href)})?s?i.pathname+i.search+i.hash:i.href:t.includes("*")?i.protocol!=="https:"&&i.protocol!=="http:"?null:s?i.pathname+i.search+i.hash:i.href:null}var uB,cB,lg,dB,yC=C(()=>{"use strict";yd();uB=new Set(["https:","http:","irc:","ircs:","mailto:","xmpp:","blob:"]),cB=new Set(["javascript:","data:","file:","vbscript:"]);lg=Symbol("node-seen"),dB=(e,t,a,n,r,o,i)=>{let l=(s,u,c)=>{if(s.type!=="element"||s[lg])return Yn;if(s.tagName==="a"){let d=hC(s.properties.href,t,e,!1,!1,r);return d===null?(s[lg]=!0,Jn(s,l),c&&typeof u=="number"&&(c.children[u]={type:"element",tagName:"span",properties:{title:"Blocked URL: "+String(s.properties.href),class:i},children:[...s.children,{type:"text",value:" [blocked]"}]}),To):(s.properties.href=d,s.properties.target="_blank",s.properties.rel="noopener noreferrer",Yn)}if(s.tagName==="img"){let d=hC(s.properties.src,a,e,n,!0,r);return d===null?(s[lg]=!0,Jn(s,l),c&&typeof u=="number"&&(c.children[u]={type:"element",tagName:"span",properties:{class:o},children:[{type:"text",value:"[Image blocked: "+String(s.properties.alt||"No description")+"]"}]}),To):(s.properties.src=d,Yn)}return Yn};return l}});function fB(){return e=>e}var wC,xC=C(()=>{"use strict";wC=fB});var vC,gB,cg,kC=C(()=>{"use strict";vC=typeof self=="object"?self:globalThis,gB=(e,t)=>{let a=(r,o)=>(e.set(o,r),r),n=r=>{if(e.has(r))return e.get(r);let[o,i]=t[r];switch(o){case 0:case-1:return a(i,r);case 1:{let l=a([],r);for(let s of i)l.push(n(s));return l}case 2:{let l=a({},r);for(let[s,u]of i)l[n(s)]=n(u);return l}case 3:return a(new Date(i),r);case 4:{let{source:l,flags:s}=i;return a(new RegExp(l,s),r)}case 5:{let l=a(new Map,r);for(let[s,u]of i)l.set(n(s),n(u));return l}case 6:{let l=a(new Set,r);for(let s of i)l.add(n(s));return l}case 7:{let{name:l,message:s}=i;return a(new vC[l](s),r)}case 8:return a(BigInt(i),r);case"BigInt":return a(Object(BigInt(i)),r);case"ArrayBuffer":return a(new Uint8Array(i).buffer,i);case"DataView":{let{buffer:l}=new Uint8Array(i);return a(new DataView(l),i)}}return a(new vC[o](i),r)};return n},cg=e=>gB(new Map,e)(0)});var ji,yB,wB,_s,xd,xB,dg,LC=C(()=>{"use strict";ji="",{toString:yB}={},{keys:wB}=Object,_s=e=>{let t=typeof e;if(t!=="object"||!e)return[0,t];let a=yB.call(e).slice(8,-1);switch(a){case"Array":return[1,ji];case"Object":return[2,ji];case"Date":return[3,ji];case"RegExp":return[4,ji];case"Map":return[5,ji];case"Set":return[6,ji];case"DataView":return[1,a]}return a.includes("Array")?[1,a]:a.includes("Error")?[7,a]:[2,a]},xd=([e,t])=>e===0&&(t==="function"||t==="symbol"),xB=(e,t,a,n)=>{let r=(i,l)=>{let s=n.push(i)-1;return a.set(l,s),s},o=i=>{if(a.has(i))return a.get(i);let[l,s]=_s(i);switch(l){case 0:{let c=i;switch(s){case"bigint":l=8,c=i.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+s);c=null;break;case"undefined":return r([-1],i)}return r([l,c],i)}case 1:{if(s){let f=i;return s==="DataView"?f=new Uint8Array(i.buffer):s==="ArrayBuffer"&&(f=new Uint8Array(i)),r([s,[...f]],i)}let c=[],d=r([l,c],i);for(let f of i)c.push(o(f));return d}case 2:{if(s)switch(s){case"BigInt":return r([s,i.toString()],i);case"Boolean":case"Number":case"String":return r([s,i.valueOf()],i)}if(t&&"toJSON"in i)return o(i.toJSON());let c=[],d=r([l,c],i);for(let f of wB(i))(e||!xd(_s(i[f])))&&c.push([o(f),o(i[f])]);return d}case 3:return r([l,i.toISOString()],i);case 4:{let{source:c,flags:d}=i;return r([l,{source:c,flags:d}],i)}case 5:{let c=[],d=r([l,c],i);for(let[f,p]of i)(e||!(xd(_s(f))||xd(_s(p))))&&c.push([o(f),o(p)]);return d}case 6:{let c=[],d=r([l,c],i);for(let f of i)(e||!xd(_s(f)))&&c.push(o(f));return d}}let{message:u}=i;return r([l,{name:s,message:u}],i)};return o},dg=(e,{json:t,lossy:a}={})=>{let n=[];return xB(!(t||a),!!t,new Map,n)(e),n}});var zr,vd=C(()=>{"use strict";kC();LC();zr=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?cg(dg(e,t)):structuredClone(e):(e,t)=>cg(dg(e,t))});function TC(e){return t;function t(a){let n=a&&a.position&&a.position[e]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function Os(e){let t=Vi(e),a=bd(e);if(t&&a)return{start:t,end:a}}var bd,Vi,EC=C(()=>{"use strict";bd=TC("end"),Vi=TC("start")});var Ps=C(()=>{"use strict";EC()});var Eo,fg,MC=C(()=>{"use strict";Eo=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],fg={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...Eo,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...Eo],h2:[["className","sr-only"]],img:[...Eo,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...Eo,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...Eo],table:[...Eo],ul:[...Eo,["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"]}});function pg(e,t){let a={type:"root",children:[]},n={schema:t?{...fg,...t}:fg,stack:[]},r=DC(n,e);return r&&(Array.isArray(r)?r.length===1?a=r[0]:a.children=r:a=r),a}function DC(e,t){if(t&&typeof t=="object"){let a=t;switch(typeof a.type=="string"?a.type:""){case"comment":return vB(e,a);case"doctype":return bB(e,a);case"element":return SB(e,a);case"root":return IB(e,a);case"text":return CB(e,a);default:}}}function vB(e,t){if(e.schema.allowComments){let a=typeof t.value=="string"?t.value:"",n=a.indexOf("-->"),o={type:"comment",value:n<0?a:a.slice(0,n)};return Ns(o,t),o}}function bB(e,t){if(e.schema.allowDoctypes){let a={type:"doctype"};return Ns(a,t),a}}function SB(e,t){let a=typeof t.tagName=="string"?t.tagName:"";e.stack.push(a);let n=_C(e,t.children),r=kB(e,t.properties);e.stack.pop();let o=!1;if(a&&a!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(a))&&(o=!0,e.schema.ancestors&&qr.call(e.schema.ancestors,a))){let l=e.schema.ancestors[a],s=-1;for(o=!1;++s<l.length;)e.stack.includes(l[s])&&(o=!0)}if(!o)return e.schema.strip&&!e.schema.strip.includes(a)?n:void 0;let i={type:"element",tagName:a,properties:r,children:n};return Ns(i,t),i}function IB(e,t){let n={type:"root",children:_C(e,t.children)};return Ns(n,t),n}function CB(e,t){let n={type:"text",value:typeof t.value=="string"?t.value:""};return Ns(n,t),n}function _C(e,t){let a=[];if(Array.isArray(t)){let n=t,r=-1;for(;++r<n.length;){let o=DC(e,n[r]);o&&(Array.isArray(o)?a.push(...o):a.push(o))}}return a}function kB(e,t){let a=e.stack[e.stack.length-1],n=e.schema.attributes,r=e.schema.required,o=n&&qr.call(n,a)?n[a]:void 0,i=n&&qr.call(n,"*")?n["*"]:void 0,l=t&&typeof t=="object"?t:{},s={},u;for(u in l)if(qr.call(l,u)){let c=l[u],d=AC(e,RC(o,u),u,c);d==null&&(d=AC(e,RC(i,u),u,c)),d!=null&&(s[u]=d)}if(r&&qr.call(r,a)){let c=r[a];for(u in c)qr.call(c,u)&&!qr.call(s,u)&&(s[u]=c[u])}return s}function AC(e,t,a,n){return t?Array.isArray(n)?LB(e,t,a,n):OC(e,t,a,n):void 0}function LB(e,t,a,n){let r=-1,o=[];for(;++r<n.length;){let i=OC(e,t,a,n[r]);(typeof i=="number"||typeof i=="string")&&o.push(i)}return o}function OC(e,t,a,n){if(!(typeof n!="boolean"&&typeof n!="number"&&typeof n!="string")&&TB(e,a,n)){if(typeof t=="object"&&t.length>1){let r=!1,o=0;for(;++o<t.length;){let i=t[o];if(i&&typeof i=="object"&&"flags"in i){if(i.test(String(n))){r=!0;break}}else if(i===n){r=!0;break}}if(!r)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(a)?e.schema.clobberPrefix+n:n}}function TB(e,t,a){let n=e.schema.protocols&&qr.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!n||n.length===0)return!0;let r=String(a),o=r.indexOf(":"),i=r.indexOf("?"),l=r.indexOf("#"),s=r.indexOf("/");if(o<0||s>-1&&o>s||i>-1&&o>i||l>-1&&o>l)return!0;let u=-1;for(;++u<n.length;){let c=n[u];if(o===c.length&&r.slice(0,c.length)===c)return!0}return!1}function Ns(e,t){let a=Os(t);t.data&&(e.data=zr(t.data)),a&&(e.position=a)}function RC(e,t){let a,n=-1;if(e)for(;++n<e.length;){let r=e[n],o=typeof r=="string"?r:r[0];if(o===t)return r;o==="data*"&&(a=r)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return a}var qr,PC=C(()=>{"use strict";vd();Ps();MC();qr={}.hasOwnProperty});var NC=C(()=>{"use strict";PC()});function Sd(e){return function(t){return pg(t,e)}}var BC=C(()=>{"use strict";NC()});var UC=C(()=>{"use strict";BC()});function mg(e,t){let a=String(e);if(typeof t!="string")throw new TypeError("Expected character");let n=0,r=a.indexOf(t);for(;r!==-1;)n++,r=a.indexOf(t,r+t.length);return n}var FC=C(()=>{"use strict"});function Mo(e){return e!==null&&(e<32||e===127)}function V(e){return e!==null&&e<-2}function we(e){return e!==null&&(e<0||e===32)}function te(e){return e===-2||e===-1||e===32}function Hr(e){return t;function t(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}var Nt,wt,zC,Bs,qC,HC,Ao,Sn,Ae=C(()=>{"use strict";Nt=Hr(/[A-Za-z]/),wt=Hr(/[\dA-Za-z]/),zC=Hr(/[#-'*+\--9=?A-Z^-~]/);Bs=Hr(/\d/),qC=Hr(/[\dA-Fa-f]/),HC=Hr(/[!-/:-@[-`{-~]/);Ao=Hr(/\p{P}|\p{S}/u),Sn=Hr(/\s/)});function hg(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var jC=C(()=>{"use strict"});function gg(e,t,a){let r=Fr((a||{}).ignore||[]),o=EB(t),i=-1;for(;++i<o.length;)Ds(e,"text",l);function l(u,c){let d=-1,f;for(;++d<c.length;){let p=c[d],m=f?f.children:void 0;if(r(p,m?m.indexOf(p):void 0,f))return;f=p}if(f)return s(u,c)}function s(u,c){let d=c[c.length-1],f=o[i][0],p=o[i][1],m=0,I=d.children.indexOf(u),y=!1,w=[];f.lastIndex=0;let g=f.exec(u.value);for(;g;){let b=g.index,T={index:g.index,input:g.input,stack:[...c,u]},S=p(...g,T);if(typeof S=="string"&&(S=S.length>0?{type:"text",value:S}:void 0),S===!1?f.lastIndex=b+1:(m!==b&&w.push({type:"text",value:u.value.slice(m,b)}),Array.isArray(S)?w.push(...S):S&&w.push(S),m=b+g[0].length,y=!0),!f.global)break;g=f.exec(u.value)}return y?(m<u.value.length&&w.push({type:"text",value:u.value.slice(m)}),d.children.splice(I,1,...w)):w=[u],I+w.length}}function EB(e){let t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");let a=!e[0]||Array.isArray(e[0])?e:[e],n=-1;for(;++n<a.length;){let r=a[n];t.push([MB(r[0]),AB(r[1])])}return t}function MB(e){return typeof e=="string"?new RegExp(hg(e),"g"):e}function AB(e){return typeof e=="function"?e:function(){return e}}var VC=C(()=>{"use strict";jC();gd();hd()});var GC=C(()=>{"use strict";VC()});function vg(){return{transforms:[NB],enter:{literalAutolink:RB,literalAutolinkEmail:xg,literalAutolinkHttp:xg,literalAutolinkWww:xg},exit:{literalAutolink:PB,literalAutolinkEmail:OB,literalAutolinkHttp:DB,literalAutolinkWww:_B}}}function bg(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:yg,notInConstruct:wg},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:yg,notInConstruct:wg},{character:":",before:"[ps]",after:"\\/",inConstruct:yg,notInConstruct:wg}]}}function RB(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function xg(e){this.config.enter.autolinkProtocol.call(this,e)}function DB(e){this.config.exit.autolinkProtocol.call(this,e)}function _B(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function OB(e){this.config.exit.autolinkEmail.call(this,e)}function PB(e){this.exit(e)}function NB(e){gg(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,BB],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,UB]],{ignore:["link","linkReference"]})}function BB(e,t,a,n,r){let o="";if(!WC(r)||(/^w/i.test(t)&&(a=t+a,t="",o="http://"),!FB(a)))return!1;let i=zB(a+n);if(!i[0])return!1;let l={type:"link",title:null,url:o+t+i[0],children:[{type:"text",value:t+i[0]}]};return i[1]?[l,{type:"text",value:i[1]}]:l}function UB(e,t,a,n){return!WC(n,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+a,children:[{type:"text",value:t+"@"+a}]}}function FB(e){let 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 zB(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let a=t[0],n=a.indexOf(")"),r=mg(e,"("),o=mg(e,")");for(;n!==-1&&r>o;)e+=a.slice(0,n+1),a=a.slice(n+1),n=a.indexOf(")"),o++;return[e,a]}function WC(e,t){let a=e.input.charCodeAt(e.index-1);return(e.index===0||Sn(a)||Ao(a))&&(!t||a!==47)}var yg,wg,$C=C(()=>{"use strict";FC();Ae();GC();yg="phrasing",wg=["autolink","link","image","label"]});var XC=C(()=>{"use strict";$C()});function Qt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var Gi=C(()=>{"use strict"});function qB(){this.buffer()}function HB(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function jB(){this.buffer()}function VB(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function GB(e){let t=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Qt(this.sliceSerialize(e)).toLowerCase(),a.label=t}function WB(e){this.exit(e)}function $B(e){let t=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Qt(this.sliceSerialize(e)).toLowerCase(),a.label=t}function XB(e){this.exit(e)}function KB(){return"["}function KC(e,t,a,n){let r=a.createTracker(n),o=r.move("[^"),i=a.enter("footnoteReference"),l=a.enter("reference");return o+=r.move(a.safe(a.associationId(e),{after:"]",before:o})),l(),i(),o+=r.move("]"),o}function Sg(){return{enter:{gfmFootnoteCallString:qB,gfmFootnoteCall:HB,gfmFootnoteDefinitionLabelString:jB,gfmFootnoteDefinition:VB},exit:{gfmFootnoteCallString:GB,gfmFootnoteCall:WB,gfmFootnoteDefinitionLabelString:$B,gfmFootnoteDefinition:XB}}}function Ig(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:a,footnoteReference:KC},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(n,r,o,i){let l=o.createTracker(i),s=l.move("[^"),u=o.enter("footnoteDefinition"),c=o.enter("label");return s+=l.move(o.safe(o.associationId(n),{before:s,after:"]"})),c(),s+=l.move("]:"),n.children&&n.children.length>0&&(l.shift(4),s+=l.move((t?`
|
|
10
|
-
`:" ")+o.indentLines(o.containerFlow(n,
|
|
11
|
-
`)}function
|
|
12
|
-
`&&
|
|
13
|
-
`}var
|
|
14
|
-
`,encode:["`"],...
|
|
15
|
-
`),o&&(c+=
|
|
16
|
-
`)),c+=
|
|
17
|
-
`,...s.current()}))),
|
|
8
|
+
`+n.stack}}var Zp=Object.prototype.hasOwnProperty,zm=Nt.unstable_scheduleCallback,pp=Nt.unstable_cancelCallback,o_=Nt.unstable_shouldYield,l_=Nt.unstable_requestPaint,Ia=Nt.unstable_now,i_=Nt.unstable_getCurrentPriorityLevel,pb=Nt.unstable_ImmediatePriority,mb=Nt.unstable_UserBlockingPriority,cc=Nt.unstable_NormalPriority,s_=Nt.unstable_LowPriority,hb=Nt.unstable_IdlePriority,u_=Nt.log,c_=Nt.unstable_setDisableYieldValue,ts=null,ka=null;function yr(e){if(typeof u_=="function"&&c_(e),ka&&typeof ka.setStrictMode=="function")try{ka.setStrictMode(ts,e)}catch{}}var La=Math.clz32?Math.clz32:p_,d_=Math.log,f_=Math.LN2;function p_(e){return e>>>=0,e===0?32:31-(d_(e)/f_|0)|0}var Mu=256,Eu=262144,Ru=4194304;function no(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Nc(e,t,a){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,l=e.pingedLanes;e=e.warmLanes;var i=n&134217727;return i!==0?(n=i&~o,n!==0?r=no(n):(l&=i,l!==0?r=no(l):a||(a=i&~e,a!==0&&(r=no(a))))):(i=n&~o,i!==0?r=no(i):l!==0?r=no(l):a||(a=n&~e,a!==0&&(r=no(a)))),r===0?0:t!==0&&t!==r&&(t&o)===0&&(o=r&-r,a=t&-t,o>=a||o===32&&(a&4194048)!==0)?t:r}function as(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function m_(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 gb(){var e=Ru;return Ru<<=1,(Ru&62914560)===0&&(Ru=4194304),e}function mp(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function ns(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function h_(e,t,a,n,r,o){var l=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var i=e.entanglements,s=e.expirationTimes,u=e.hiddenUpdates;for(a=l&~a;0<a;){var c=31-La(a),d=1<<c;i[c]=0,s[c]=-1;var f=u[c];if(f!==null)for(u[c]=null,c=0;c<f.length;c++){var p=f[c];p!==null&&(p.lane&=-536870913)}a&=~d}n!==0&&yb(e,n,0),o!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=o&~(l&~t))}function yb(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-La(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|a&261930}function wb(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var n=31-La(a),r=1<<n;r&t|e[n]&t&&(e[n]|=t),a&=~r}}function xb(e,t){var a=t&-t;return a=(a&42)!==0?1:qm(a),(a&(e.suspendedLanes|t))!==0?0:a}function qm(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Hm(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function vb(){var e=ze.p;return e!==0?e:(e=window.event,e===void 0?32:j0(e.type))}function Fx(e,t){var a=ze.p;try{return ze.p=e,t()}finally{ze.p=a}}var Pr=Math.random().toString(36).slice(2),Gt="__reactFiber$"+Pr,ha="__reactProps$"+Pr,Rl="__reactContainer$"+Pr,Qp="__reactEvents$"+Pr,g_="__reactListeners$"+Pr,y_="__reactHandles$"+Pr,zx="__reactResources$"+Pr,rs="__reactMarker$"+Pr;function jm(e){delete e[Gt],delete e[ha],delete e[Qp],delete e[g_],delete e[y_]}function nl(e){var t=e[Gt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[Rl]||a[Gt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=Xv(e);e!==null;){if(a=e[Gt])return a;e=Xv(e)}return t}e=a,a=e.parentNode}return null}function Dl(e){if(e=e[Gt]||e[Rl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ii(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(P(33))}function pl(e){var t=e[zx];return t||(t=e[zx]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function zt(e){e[rs]=!0}var bb=new Set,Sb={};function yo(e,t){bl(e,t),bl(e+"Capture",t)}function bl(e,t){for(Sb[e]=t,e=0;e<t.length;e++)bb.add(t[e])}var w_=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]*$"),qx={},Hx={};function x_(e){return Zp.call(Hx,e)?!0:Zp.call(qx,e)?!1:w_.test(e)?Hx[e]=!0:(qx[e]=!0,!1)}function $u(e,t,a){if(x_(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var n=t.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function Du(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function Mn(e,t,a,n){if(n===null)e.removeAttribute(a);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+n)}}function Ua(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Cb(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function v_(e,t,a){var n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(l){a=""+l,o.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return a},setValue:function(l){a=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Yp(e){if(!e._valueTracker){var t=Cb(e)?"checked":"value";e._valueTracker=v_(e,t,""+e[t])}}function Ib(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),n="";return e&&(n=Cb(e)?e.checked?"true":"false":e.value),e=n,e!==a?(t.setValue(e),!0):!1}function dc(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var b_=/[\n"\\]/g;function qa(e){return e.replace(b_,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Jp(e,t,a,n,r,o,l,i){e.name="",l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.type=l:e.removeAttribute("type"),t!=null?l==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Ua(t)):e.value!==""+Ua(t)&&(e.value=""+Ua(t)):l!=="submit"&&l!=="reset"||e.removeAttribute("value"),t!=null?em(e,l,Ua(t)):a!=null?em(e,l,Ua(a)):n!=null&&e.removeAttribute("value"),r==null&&o!=null&&(e.defaultChecked=!!o),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?e.name=""+Ua(i):e.removeAttribute("name")}function kb(e,t,a,n,r,o,l,i){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.type=o),t!=null||a!=null){if(!(o!=="submit"&&o!=="reset"||t!=null)){Yp(e);return}a=a!=null?""+Ua(a):"",t=t!=null?""+Ua(t):a,i||t===e.value||(e.value=t),e.defaultValue=t}n=n??r,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=i?e.checked:!!n,e.defaultChecked=!!n,l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"&&(e.name=l),Yp(e)}function em(e,t,a){t==="number"&&dc(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function ml(e,t,a,n){if(e=e.options,t){t={};for(var r=0;r<a.length;r++)t["$"+a[r]]=!0;for(a=0;a<e.length;a++)r=t.hasOwnProperty("$"+e[a].value),e[a].selected!==r&&(e[a].selected=r),r&&n&&(e[a].defaultSelected=!0)}else{for(a=""+Ua(a),t=null,r=0;r<e.length;r++){if(e[r].value===a){e[r].selected=!0,n&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function Lb(e,t,a){if(t!=null&&(t=""+Ua(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+Ua(a):""}function Tb(e,t,a,n){if(t==null){if(n!=null){if(a!=null)throw Error(P(92));if(Ci(n)){if(1<n.length)throw Error(P(93));n=n[0]}a=n}a==null&&(a=""),t=a}a=Ua(t),e.defaultValue=a,n=e.textContent,n===a&&n!==""&&n!==null&&(e.value=n),Yp(e)}function Sl(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var S_=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 jx(e,t,a){var n=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?n?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":n?e.setProperty(t,a):typeof a!="number"||a===0||S_.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Ab(e,t,a){if(t!=null&&typeof t!="object")throw Error(P(62));if(e=e.style,a!=null){for(var n in a)!a.hasOwnProperty(n)||t!=null&&t.hasOwnProperty(n)||(n.indexOf("--")===0?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="");for(var r in t)n=t[r],t.hasOwnProperty(r)&&a[r]!==n&&jx(e,r,n)}else for(var o in t)t.hasOwnProperty(o)&&jx(e,o,t[o])}function Vm(e){if(e.indexOf("-")===-1)return!1;switch(e){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 C_=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"]]),I_=/^[\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 Wu(e){return I_.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Bn(){}var tm=null;function Gm(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var rl=null,hl=null;function Vx(e){var t=Dl(e);if(t&&(e=t.stateNode)){var a=e[ha]||null;e:switch(e=t.stateNode,t.type){case"input":if(Jp(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+qa(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var n=a[t];if(n!==e&&n.form===e.form){var r=n[ha]||null;if(!r)throw Error(P(90));Jp(n,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<a.length;t++)n=a[t],n.form===e.form&&Ib(n)}break e;case"textarea":Lb(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&ml(e,!!a.multiple,t,!1)}}}var hp=!1;function Mb(e,t,a){if(hp)return e(t,a);hp=!0;try{var n=e(t);return n}finally{if(hp=!1,(rl!==null||hl!==null)&&(Xc(),rl&&(t=rl,e=hl,hl=rl=null,Vx(t),e)))for(t=0;t<e.length;t++)Vx(e[t])}}function qi(e,t){var a=e.stateNode;if(a===null)return null;var n=a[ha]||null;if(n===null)return null;a=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(P(231,t,typeof a));return a}var Hn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),am=!1;if(Hn)try{Zo={},Object.defineProperty(Zo,"passive",{get:function(){am=!0}}),window.addEventListener("test",Zo,Zo),window.removeEventListener("test",Zo,Zo)}catch{am=!1}var Zo,wr=null,$m=null,Xu=null;function Eb(){if(Xu)return Xu;var e,t=$m,a=t.length,n,r="value"in wr?wr.value:wr.textContent,o=r.length;for(e=0;e<a&&t[e]===r[e];e++);var l=a-e;for(n=1;n<=l&&t[a-n]===r[o-n];n++);return Xu=r.slice(e,1<n?1-n:void 0)}function Ku(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function _u(){return!0}function Gx(){return!1}function ga(e){function t(a,n,r,o,l){this._reactName=a,this._targetInst=r,this.type=n,this.nativeEvent=o,this.target=l,this.currentTarget=null;for(var i in e)e.hasOwnProperty(i)&&(a=e[i],this[i]=a?a(o):o[i]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?_u:Gx,this.isPropagationStopped=Gx,this}return ct(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=_u)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=_u)},persist:function(){},isPersistent:_u}),t}var wo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bc=ga(wo),os=ct({},wo,{view:0,detail:0}),k_=ga(os),gp,yp,gi,Uc=ct({},os,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Wm,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==gi&&(gi&&e.type==="mousemove"?(gp=e.screenX-gi.screenX,yp=e.screenY-gi.screenY):yp=gp=0,gi=e),gp)},movementY:function(e){return"movementY"in e?e.movementY:yp}}),$x=ga(Uc),L_=ct({},Uc,{dataTransfer:0}),T_=ga(L_),A_=ct({},os,{relatedTarget:0}),wp=ga(A_),M_=ct({},wo,{animationName:0,elapsedTime:0,pseudoElement:0}),E_=ga(M_),R_=ct({},wo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),D_=ga(R_),__=ct({},wo,{data:0}),Wx=ga(__),O_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},P_={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"},N_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function B_(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=N_[e])?!!t[e]:!1}function Wm(){return B_}var U_=ct({},os,{key:function(e){if(e.key){var t=O_[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ku(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?P_[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Wm,charCode:function(e){return e.type==="keypress"?Ku(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ku(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),F_=ga(U_),z_=ct({},Uc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Xx=ga(z_),q_=ct({},os,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Wm}),H_=ga(q_),j_=ct({},wo,{propertyName:0,elapsedTime:0,pseudoElement:0}),V_=ga(j_),G_=ct({},Uc,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),$_=ga(G_),W_=ct({},wo,{newState:0,oldState:0}),X_=ga(W_),K_=[9,13,27,32],Xm=Hn&&"CompositionEvent"in window,Ti=null;Hn&&"documentMode"in document&&(Ti=document.documentMode);var Z_=Hn&&"TextEvent"in window&&!Ti,Rb=Hn&&(!Xm||Ti&&8<Ti&&11>=Ti),Kx=" ",Zx=!1;function Db(e,t){switch(e){case"keyup":return K_.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _b(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ol=!1;function Q_(e,t){switch(e){case"compositionend":return _b(t);case"keypress":return t.which!==32?null:(Zx=!0,Kx);case"textInput":return e=t.data,e===Kx&&Zx?null:e;default:return null}}function Y_(e,t){if(ol)return e==="compositionend"||!Xm&&Db(e,t)?(e=Eb(),Xu=$m=wr=null,ol=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Rb&&t.locale!=="ko"?null:t.data;default:return null}}var J_={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 Qx(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!J_[e.type]:t==="textarea"}function Ob(e,t,a,n){rl?hl?hl.push(n):hl=[n]:rl=n,t=Mc(t,"onChange"),0<t.length&&(a=new Bc("onChange","change",null,a,n),e.push({event:a,listeners:t}))}var Ai=null,Hi=null;function eO(e){M0(e,0)}function Fc(e){var t=Ii(e);if(Ib(t))return e}function Yx(e,t){if(e==="change")return t}var Pb=!1;Hn&&(Hn?(Pu="oninput"in document,Pu||(xp=document.createElement("div"),xp.setAttribute("oninput","return;"),Pu=typeof xp.oninput=="function"),Ou=Pu):Ou=!1,Pb=Ou&&(!document.documentMode||9<document.documentMode));var Ou,Pu,xp;function Jx(){Ai&&(Ai.detachEvent("onpropertychange",Nb),Hi=Ai=null)}function Nb(e){if(e.propertyName==="value"&&Fc(Hi)){var t=[];Ob(t,Hi,e,Gm(e)),Mb(eO,t)}}function tO(e,t,a){e==="focusin"?(Jx(),Ai=t,Hi=a,Ai.attachEvent("onpropertychange",Nb)):e==="focusout"&&Jx()}function aO(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Fc(Hi)}function nO(e,t){if(e==="click")return Fc(t)}function rO(e,t){if(e==="input"||e==="change")return Fc(t)}function oO(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Aa=typeof Object.is=="function"?Object.is:oO;function ji(e,t){if(Aa(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),n=Object.keys(t);if(a.length!==n.length)return!1;for(n=0;n<a.length;n++){var r=a[n];if(!Zp.call(t,r)||!Aa(e[r],t[r]))return!1}return!0}function ev(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function tv(e,t){var a=ev(e);e=0;for(var n;a;){if(a.nodeType===3){if(n=e+a.textContent.length,e<=t&&n>=t)return{node:a,offset:t-e};e=n}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=ev(a)}}function Bb(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Bb(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ub(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=dc(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=dc(e.document)}return t}function Km(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var lO=Hn&&"documentMode"in document&&11>=document.documentMode,ll=null,nm=null,Mi=null,rm=!1;function av(e,t,a){var n=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;rm||ll==null||ll!==dc(n)||(n=ll,"selectionStart"in n&&Km(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Mi&&ji(Mi,n)||(Mi=n,n=Mc(nm,"onSelect"),0<n.length&&(t=new Bc("onSelect","select",null,t,a),e.push({event:t,listeners:n}),t.target=ll)))}function to(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var il={animationend:to("Animation","AnimationEnd"),animationiteration:to("Animation","AnimationIteration"),animationstart:to("Animation","AnimationStart"),transitionrun:to("Transition","TransitionRun"),transitionstart:to("Transition","TransitionStart"),transitioncancel:to("Transition","TransitionCancel"),transitionend:to("Transition","TransitionEnd")},vp={},Fb={};Hn&&(Fb=document.createElement("div").style,"AnimationEvent"in window||(delete il.animationend.animation,delete il.animationiteration.animation,delete il.animationstart.animation),"TransitionEvent"in window||delete il.transitionend.transition);function xo(e){if(vp[e])return vp[e];if(!il[e])return e;var t=il[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Fb)return vp[e]=t[a];return e}var zb=xo("animationend"),qb=xo("animationiteration"),Hb=xo("animationstart"),iO=xo("transitionrun"),sO=xo("transitionstart"),uO=xo("transitioncancel"),jb=xo("transitionend"),Vb=new Map,om="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(" ");om.push("scrollEnd");function an(e,t){Vb.set(e,t),yo(t,[e])}var fc=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Ba=[],sl=0,Zm=0;function zc(){for(var e=sl,t=Zm=sl=0;t<e;){var a=Ba[t];Ba[t++]=null;var n=Ba[t];Ba[t++]=null;var r=Ba[t];Ba[t++]=null;var o=Ba[t];if(Ba[t++]=null,n!==null&&r!==null){var l=n.pending;l===null?r.next=r:(r.next=l.next,l.next=r),n.pending=r}o!==0&&Gb(a,r,o)}}function qc(e,t,a,n){Ba[sl++]=e,Ba[sl++]=t,Ba[sl++]=a,Ba[sl++]=n,Zm|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function Qm(e,t,a,n){return qc(e,t,a,n),pc(e)}function vo(e,t){return qc(e,null,null,t),pc(e)}function Gb(e,t,a){e.lanes|=a;var n=e.alternate;n!==null&&(n.lanes|=a);for(var r=!1,o=e.return;o!==null;)o.childLanes|=a,n=o.alternate,n!==null&&(n.childLanes|=a),o.tag===22&&(e=o.stateNode,e===null||e._visibility&1||(r=!0)),e=o,o=o.return;return e.tag===3?(o=e.stateNode,r&&t!==null&&(r=31-La(a),e=o.hiddenUpdates,n=e[r],n===null?e[r]=[t]:n.push(t),t.lane=a|536870912),o):null}function pc(e){if(50<Ui)throw Ui=0,Lm=null,Error(P(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ul={};function cO(e,t,a,n){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Sa(e,t,a,n){return new cO(e,t,a,n)}function Ym(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Fn(e,t){var a=e.alternate;return a===null?(a=Sa(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function $b(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Zu(e,t,a,n,r,o){var l=0;if(n=e,typeof e=="function")Ym(e)&&(l=1);else if(typeof e=="string")l=pP(e,a,hn.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case $p:return e=Sa(31,a,t,r),e.elementType=$p,e.lanes=o,e;case tl:return io(a.children,r,o,t);case db:l=8,r|=24;break;case jp:return e=Sa(12,a,t,r|2),e.elementType=jp,e.lanes=o,e;case Vp:return e=Sa(13,a,t,r),e.elementType=Vp,e.lanes=o,e;case Gp:return e=Sa(19,a,t,r),e.elementType=Gp,e.lanes=o,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Nn:l=10;break e;case fb:l=9;break e;case Um:l=11;break e;case Fm:l=14;break e;case dr:l=16,n=null;break e}l=29,a=Error(P(130,e===null?"null":typeof e,"")),n=null}return t=Sa(l,a,t,r),t.elementType=e,t.type=n,t.lanes=o,t}function io(e,t,a,n){return e=Sa(7,e,n,t),e.lanes=a,e}function bp(e,t,a){return e=Sa(6,e,null,t),e.lanes=a,e}function Wb(e){var t=Sa(18,null,null,0);return t.stateNode=e,t}function Sp(e,t,a){return t=Sa(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var nv=new WeakMap;function Ha(e,t){if(typeof e=="object"&&e!==null){var a=nv.get(e);return a!==void 0?a:(t={value:e,source:t,stack:Ux(t)},nv.set(e,t),t)}return{value:e,source:t,stack:Ux(t)}}var cl=[],dl=0,mc=null,Vi=0,Fa=[],za=0,Rr=null,fn=1,pn="";function On(e,t){cl[dl++]=Vi,cl[dl++]=mc,mc=e,Vi=t}function Xb(e,t,a){Fa[za++]=fn,Fa[za++]=pn,Fa[za++]=Rr,Rr=e;var n=fn;e=pn;var r=32-La(n)-1;n&=~(1<<r),a+=1;var o=32-La(t)+r;if(30<o){var l=r-r%5;o=(n&(1<<l)-1).toString(32),n>>=l,r-=l,fn=1<<32-La(t)+r|a<<r|n,pn=o+e}else fn=1<<o|a<<r|n,pn=e}function Jm(e){e.return!==null&&(On(e,1),Xb(e,1,0))}function eh(e){for(;e===mc;)mc=cl[--dl],cl[dl]=null,Vi=cl[--dl],cl[dl]=null;for(;e===Rr;)Rr=Fa[--za],Fa[za]=null,pn=Fa[--za],Fa[za]=null,fn=Fa[--za],Fa[za]=null}function Kb(e,t){Fa[za++]=fn,Fa[za++]=pn,Fa[za++]=Rr,fn=t.id,pn=t.overflow,Rr=e}var $t=null,ut=null,Ae=!1,Cr=null,ja=!1,lm=Error(P(519));function Dr(e){var t=Error(P(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Gi(Ha(t,e)),lm}function rv(e){var t=e.stateNode,a=e.type,n=e.memoizedProps;switch(t[Gt]=e,t[ha]=n,a){case"dialog":ve("cancel",t),ve("close",t);break;case"iframe":case"object":case"embed":ve("load",t);break;case"video":case"audio":for(a=0;a<Ki.length;a++)ve(Ki[a],t);break;case"source":ve("error",t);break;case"img":case"image":case"link":ve("error",t),ve("load",t);break;case"details":ve("toggle",t);break;case"input":ve("invalid",t),kb(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":ve("invalid",t);break;case"textarea":ve("invalid",t),Tb(t,n.value,n.defaultValue,n.children)}a=n.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||n.suppressHydrationWarning===!0||R0(t.textContent,a)?(n.popover!=null&&(ve("beforetoggle",t),ve("toggle",t)),n.onScroll!=null&&ve("scroll",t),n.onScrollEnd!=null&&ve("scrollend",t),n.onClick!=null&&(t.onclick=Bn),t=!0):t=!1,t||Dr(e,!0)}function ov(e){for($t=e.return;$t;)switch($t.tag){case 5:case 31:case 13:ja=!1;return;case 27:case 3:ja=!0;return;default:$t=$t.return}}function Qo(e){if(e!==$t)return!1;if(!Ae)return ov(e),Ae=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Rm(e.type,e.memoizedProps)),a=!a),a&&ut&&Dr(e),ov(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(P(317));ut=Wv(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(P(317));ut=Wv(e)}else t===27?(t=ut,Nr(e.type)?(e=Pm,Pm=null,ut=e):ut=t):ut=$t?Ga(e.stateNode.nextSibling):null;return!0}function fo(){ut=$t=null,Ae=!1}function Cp(){var e=Cr;return e!==null&&(pa===null?pa=e:pa.push.apply(pa,e),Cr=null),e}function Gi(e){Cr===null?Cr=[e]:Cr.push(e)}var im=gn(null),bo=null,Un=null;function pr(e,t,a){lt(im,t._currentValue),t._currentValue=a}function zn(e){e._currentValue=im.current,qt(im)}function sm(e,t,a){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===a)break;e=e.return}}function um(e,t,a,n){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var o=r.dependencies;if(o!==null){var l=r.child;o=o.firstContext;e:for(;o!==null;){var i=o;o=r;for(var s=0;s<t.length;s++)if(i.context===t[s]){o.lanes|=a,i=o.alternate,i!==null&&(i.lanes|=a),sm(o.return,a,e),n||(l=null);break e}o=i.next}}else if(r.tag===18){if(l=r.return,l===null)throw Error(P(341));l.lanes|=a,o=l.alternate,o!==null&&(o.lanes|=a),sm(l,a,e),l=null}else l=r.child;if(l!==null)l.return=r;else for(l=r;l!==null;){if(l===e){l=null;break}if(r=l.sibling,r!==null){r.return=l.return,l=r;break}l=l.return}r=l}}function _l(e,t,a,n){e=null;for(var r=t,o=!1;r!==null;){if(!o){if((r.flags&524288)!==0)o=!0;else if((r.flags&262144)!==0)break}if(r.tag===10){var l=r.alternate;if(l===null)throw Error(P(387));if(l=l.memoizedProps,l!==null){var i=r.type;Aa(r.pendingProps.value,l.value)||(e!==null?e.push(i):e=[i])}}else if(r===ic.current){if(l=r.alternate,l===null)throw Error(P(387));l.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(Qi):e=[Qi])}r=r.return}e!==null&&um(t,e,a,n),t.flags|=262144}function hc(e){for(e=e.firstContext;e!==null;){if(!Aa(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function po(e){bo=e,Un=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Wt(e){return Zb(bo,e)}function Nu(e,t){return bo===null&&po(e),Zb(e,t)}function Zb(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},Un===null){if(e===null)throw Error(P(308));Un=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Un=Un.next=t;return a}var dO=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},fO=Nt.unstable_scheduleCallback,pO=Nt.unstable_NormalPriority,Dt={$$typeof:Nn,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function th(){return{controller:new dO,data:new Map,refCount:0}}function ls(e){e.refCount--,e.refCount===0&&fO(pO,function(){e.controller.abort()})}var Ei=null,cm=0,Cl=0,gl=null;function mO(e,t){if(Ei===null){var a=Ei=[];cm=0,Cl=Lh(),gl={status:"pending",value:void 0,then:function(n){a.push(n)}}}return cm++,t.then(lv,lv),t}function lv(){if(--cm===0&&Ei!==null){gl!==null&&(gl.status="fulfilled");var e=Ei;Ei=null,Cl=0,gl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function hO(e,t){var a=[],n={status:"pending",value:null,reason:null,then:function(r){a.push(r)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var r=0;r<a.length;r++)(0,a[r])(t)},function(r){for(n.status="rejected",n.reason=r,r=0;r<a.length;r++)(0,a[r])(void 0)}),n}var iv=re.S;re.S=function(e,t){c0=Ia(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&mO(e,t),iv!==null&&iv(e,t)};var so=gn(null);function ah(){var e=so.current;return e!==null?e:at.pooledCache}function Qu(e,t){t===null?lt(so,so.current):lt(so,t.pool)}function Qb(){var e=ah();return e===null?null:{parent:Dt._currentValue,pool:e}}var Ol=Error(P(460)),nh=Error(P(474)),Hc=Error(P(542)),gc={then:function(){}};function sv(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Yb(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(Bn,Bn),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,cv(e),e;default:if(typeof t.status=="string")t.then(Bn,Bn);else{if(e=at,e!==null&&100<e.shellSuspendCounter)throw Error(P(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=n}},function(n){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,cv(e),e}throw uo=t,Ol}}function ro(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(uo=a,Ol):a}}var uo=null;function uv(){if(uo===null)throw Error(P(459));var e=uo;return uo=null,e}function cv(e){if(e===Ol||e===Hc)throw Error(P(483))}var yl=null,$i=0;function Bu(e){var t=$i;return $i+=1,yl===null&&(yl=[]),Yb(yl,e,t)}function yi(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Uu(e,t){throw t.$$typeof===t_?Error(P(525)):(e=Object.prototype.toString.call(t),Error(P(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Jb(e){function t(y,w){if(e){var g=y.deletions;g===null?(y.deletions=[w],y.flags|=16):g.push(w)}}function a(y,w){if(!e)return null;for(;w!==null;)t(y,w),w=w.sibling;return null}function n(y){for(var w=new Map;y!==null;)y.key!==null?w.set(y.key,y):w.set(y.index,y),y=y.sibling;return w}function r(y,w){return y=Fn(y,w),y.index=0,y.sibling=null,y}function o(y,w,g){return y.index=g,e?(g=y.alternate,g!==null?(g=g.index,g<w?(y.flags|=67108866,w):g):(y.flags|=67108866,w)):(y.flags|=1048576,w)}function l(y){return e&&y.alternate===null&&(y.flags|=67108866),y}function i(y,w,g,C){return w===null||w.tag!==6?(w=bp(g,y.mode,C),w.return=y,w):(w=r(w,g),w.return=y,w)}function s(y,w,g,C){var A=g.type;return A===tl?c(y,w,g.props.children,C,g.key):w!==null&&(w.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===dr&&ro(A)===w.type)?(w=r(w,g.props),yi(w,g),w.return=y,w):(w=Zu(g.type,g.key,g.props,null,y.mode,C),yi(w,g),w.return=y,w)}function u(y,w,g,C){return w===null||w.tag!==4||w.stateNode.containerInfo!==g.containerInfo||w.stateNode.implementation!==g.implementation?(w=Sp(g,y.mode,C),w.return=y,w):(w=r(w,g.children||[]),w.return=y,w)}function c(y,w,g,C,A){return w===null||w.tag!==7?(w=io(g,y.mode,C,A),w.return=y,w):(w=r(w,g),w.return=y,w)}function d(y,w,g){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return w=bp(""+w,y.mode,g),w.return=y,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Au:return g=Zu(w.type,w.key,w.props,null,y.mode,g),yi(g,w),g.return=y,g;case Si:return w=Sp(w,y.mode,g),w.return=y,w;case dr:return w=ro(w),d(y,w,g)}if(Ci(w)||hi(w))return w=io(w,y.mode,g,null),w.return=y,w;if(typeof w.then=="function")return d(y,Bu(w),g);if(w.$$typeof===Nn)return d(y,Nu(y,w),g);Uu(y,w)}return null}function f(y,w,g,C){var A=w!==null?w.key:null;if(typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint")return A!==null?null:i(y,w,""+g,C);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Au:return g.key===A?s(y,w,g,C):null;case Si:return g.key===A?u(y,w,g,C):null;case dr:return g=ro(g),f(y,w,g,C)}if(Ci(g)||hi(g))return A!==null?null:c(y,w,g,C,null);if(typeof g.then=="function")return f(y,w,Bu(g),C);if(g.$$typeof===Nn)return f(y,w,Nu(y,g),C);Uu(y,g)}return null}function p(y,w,g,C,A){if(typeof C=="string"&&C!==""||typeof C=="number"||typeof C=="bigint")return y=y.get(g)||null,i(w,y,""+C,A);if(typeof C=="object"&&C!==null){switch(C.$$typeof){case Au:return y=y.get(C.key===null?g:C.key)||null,s(w,y,C,A);case Si:return y=y.get(C.key===null?g:C.key)||null,u(w,y,C,A);case dr:return C=ro(C),p(y,w,g,C,A)}if(Ci(C)||hi(C))return y=y.get(g)||null,c(w,y,C,A,null);if(typeof C.then=="function")return p(y,w,g,Bu(C),A);if(C.$$typeof===Nn)return p(y,w,g,Nu(w,C),A);Uu(w,C)}return null}function m(y,w,g,C){for(var A=null,S=null,M=w,R=w=0,D=null;M!==null&&R<g.length;R++){M.index>R?(D=M,M=null):D=M.sibling;var L=f(y,M,g[R],C);if(L===null){M===null&&(M=D);break}e&&M&&L.alternate===null&&t(y,M),w=o(L,w,R),S===null?A=L:S.sibling=L,S=L,M=D}if(R===g.length)return a(y,M),Ae&&On(y,R),A;if(M===null){for(;R<g.length;R++)M=d(y,g[R],C),M!==null&&(w=o(M,w,R),S===null?A=M:S.sibling=M,S=M);return Ae&&On(y,R),A}for(M=n(M);R<g.length;R++)D=p(M,y,R,g[R],C),D!==null&&(e&&D.alternate!==null&&M.delete(D.key===null?R:D.key),w=o(D,w,R),S===null?A=D:S.sibling=D,S=D);return e&&M.forEach(function(G){return t(y,G)}),Ae&&On(y,R),A}function x(y,w,g,C){if(g==null)throw Error(P(151));for(var A=null,S=null,M=w,R=w=0,D=null,L=g.next();M!==null&&!L.done;R++,L=g.next()){M.index>R?(D=M,M=null):D=M.sibling;var G=f(y,M,L.value,C);if(G===null){M===null&&(M=D);break}e&&M&&G.alternate===null&&t(y,M),w=o(G,w,R),S===null?A=G:S.sibling=G,S=G,M=D}if(L.done)return a(y,M),Ae&&On(y,R),A;if(M===null){for(;!L.done;R++,L=g.next())L=d(y,L.value,C),L!==null&&(w=o(L,w,R),S===null?A=L:S.sibling=L,S=L);return Ae&&On(y,R),A}for(M=n(M);!L.done;R++,L=g.next())L=p(M,y,R,L.value,C),L!==null&&(e&&L.alternate!==null&&M.delete(L.key===null?R:L.key),w=o(L,w,R),S===null?A=L:S.sibling=L,S=L);return e&&M.forEach(function(B){return t(y,B)}),Ae&&On(y,R),A}function v(y,w,g,C){if(typeof g=="object"&&g!==null&&g.type===tl&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case Au:e:{for(var A=g.key;w!==null;){if(w.key===A){if(A=g.type,A===tl){if(w.tag===7){a(y,w.sibling),C=r(w,g.props.children),C.return=y,y=C;break e}}else if(w.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===dr&&ro(A)===w.type){a(y,w.sibling),C=r(w,g.props),yi(C,g),C.return=y,y=C;break e}a(y,w);break}else t(y,w);w=w.sibling}g.type===tl?(C=io(g.props.children,y.mode,C,g.key),C.return=y,y=C):(C=Zu(g.type,g.key,g.props,null,y.mode,C),yi(C,g),C.return=y,y=C)}return l(y);case Si:e:{for(A=g.key;w!==null;){if(w.key===A)if(w.tag===4&&w.stateNode.containerInfo===g.containerInfo&&w.stateNode.implementation===g.implementation){a(y,w.sibling),C=r(w,g.children||[]),C.return=y,y=C;break e}else{a(y,w);break}else t(y,w);w=w.sibling}C=Sp(g,y.mode,C),C.return=y,y=C}return l(y);case dr:return g=ro(g),v(y,w,g,C)}if(Ci(g))return m(y,w,g,C);if(hi(g)){if(A=hi(g),typeof A!="function")throw Error(P(150));return g=A.call(g),x(y,w,g,C)}if(typeof g.then=="function")return v(y,w,Bu(g),C);if(g.$$typeof===Nn)return v(y,w,Nu(y,g),C);Uu(y,g)}return typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint"?(g=""+g,w!==null&&w.tag===6?(a(y,w.sibling),C=r(w,g),C.return=y,y=C):(a(y,w),C=bp(g,y.mode,C),C.return=y,y=C),l(y)):a(y,w)}return function(y,w,g,C){try{$i=0;var A=v(y,w,g,C);return yl=null,A}catch(M){if(M===Ol||M===Hc)throw M;var S=Sa(29,M,null,y.mode);return S.lanes=C,S.return=y,S}}}var mo=Jb(!0),eS=Jb(!1),fr=!1;function rh(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function dm(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ir(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function kr(e,t,a){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(Fe&2)!==0){var r=n.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),n.pending=t,t=pc(e),Gb(e,null,a),t}return qc(e,n,t,a),pc(e)}function Ri(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,wb(e,a)}}function Ip(e,t){var a=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,a===n)){var r=null,o=null;if(a=a.firstBaseUpdate,a!==null){do{var l={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};o===null?r=o=l:o=o.next=l,a=a.next}while(a!==null);o===null?r=o=t:o=o.next=t}else r=o=t;a={baseState:n.baseState,firstBaseUpdate:r,lastBaseUpdate:o,shared:n.shared,callbacks:n.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var fm=!1;function Di(){if(fm){var e=gl;if(e!==null)throw e}}function _i(e,t,a,n){fm=!1;var r=e.updateQueue;fr=!1;var o=r.firstBaseUpdate,l=r.lastBaseUpdate,i=r.shared.pending;if(i!==null){r.shared.pending=null;var s=i,u=s.next;s.next=null,l===null?o=u:l.next=u,l=s;var c=e.alternate;c!==null&&(c=c.updateQueue,i=c.lastBaseUpdate,i!==l&&(i===null?c.firstBaseUpdate=u:i.next=u,c.lastBaseUpdate=s))}if(o!==null){var d=r.baseState;l=0,c=u=s=null,i=o;do{var f=i.lane&-536870913,p=f!==i.lane;if(p?(Se&f)===f:(n&f)===f){f!==0&&f===Cl&&(fm=!0),c!==null&&(c=c.next={lane:0,tag:i.tag,payload:i.payload,callback:null,next:null});e:{var m=e,x=i;f=t;var v=a;switch(x.tag){case 1:if(m=x.payload,typeof m=="function"){d=m.call(v,d,f);break e}d=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=x.payload,f=typeof m=="function"?m.call(v,d,f):m,f==null)break e;d=ct({},d,f);break e;case 2:fr=!0}}f=i.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=r.callbacks,p===null?r.callbacks=[f]:p.push(f))}else p={lane:f,tag:i.tag,payload:i.payload,callback:i.callback,next:null},c===null?(u=c=p,s=d):c=c.next=p,l|=f;if(i=i.next,i===null){if(i=r.shared.pending,i===null)break;p=i,i=p.next,p.next=null,r.lastBaseUpdate=p,r.shared.pending=null}}while(!0);c===null&&(s=d),r.baseState=s,r.firstBaseUpdate=u,r.lastBaseUpdate=c,o===null&&(r.shared.lanes=0),Or|=l,e.lanes=l,e.memoizedState=d}}function tS(e,t){if(typeof e!="function")throw Error(P(191,e));e.call(t)}function aS(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)tS(a[e],t)}var Il=gn(null),yc=gn(0);function dv(e,t){e=$n,lt(yc,e),lt(Il,t),$n=e|t.baseLanes}function pm(){lt(yc,$n),lt(Il,Il.current)}function oh(){$n=yc.current,qt(Il),qt(yc)}var Ma=gn(null),Va=null;function mr(e){var t=e.alternate;lt(kt,kt.current&1),lt(Ma,e),Va===null&&(t===null||Il.current!==null||t.memoizedState!==null)&&(Va=e)}function mm(e){lt(kt,kt.current),lt(Ma,e),Va===null&&(Va=e)}function nS(e){e.tag===22?(lt(kt,kt.current),lt(Ma,e),Va===null&&(Va=e)):hr(e)}function hr(){lt(kt,kt.current),lt(Ma,Ma.current)}function ba(e){qt(Ma),Va===e&&(Va=null),qt(kt)}var kt=gn(0);function wc(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||_m(a)||Om(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var jn=0,ce=null,Ye=null,Et=null,xc=!1,wl=!1,ho=!1,vc=0,Wi=0,xl=null,gO=0;function wt(){throw Error(P(321))}function lh(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!Aa(e[a],t[a]))return!1;return!0}function ih(e,t,a,n,r,o){return jn=o,ce=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,re.H=e===null||e.memoizedState===null?OS:wh,ho=!1,o=a(n,r),ho=!1,wl&&(o=oS(t,a,n,r)),rS(e),o}function rS(e){re.H=Xi;var t=Ye!==null&&Ye.next!==null;if(jn=0,Et=Ye=ce=null,xc=!1,Wi=0,xl=null,t)throw Error(P(300));e===null||_t||(e=e.dependencies,e!==null&&hc(e)&&(_t=!0))}function oS(e,t,a,n){ce=e;var r=0;do{if(wl&&(xl=null),Wi=0,wl=!1,25<=r)throw Error(P(301));if(r+=1,Et=Ye=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}re.H=PS,o=t(a,n)}while(wl);return o}function yO(){var e=re.H,t=e.useState()[0];return t=typeof t.then=="function"?is(t):t,e=e.useState()[0],(Ye!==null?Ye.memoizedState:null)!==e&&(ce.flags|=1024),t}function sh(){var e=vc!==0;return vc=0,e}function uh(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function ch(e){if(xc){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}xc=!1}jn=0,Et=Ye=ce=null,wl=!1,Wi=vc=0,xl=null}function aa(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Et===null?ce.memoizedState=Et=e:Et=Et.next=e,Et}function Lt(){if(Ye===null){var e=ce.alternate;e=e!==null?e.memoizedState:null}else e=Ye.next;var t=Et===null?ce.memoizedState:Et.next;if(t!==null)Et=t,Ye=e;else{if(e===null)throw ce.alternate===null?Error(P(467)):Error(P(310));Ye=e,e={memoizedState:Ye.memoizedState,baseState:Ye.baseState,baseQueue:Ye.baseQueue,queue:Ye.queue,next:null},Et===null?ce.memoizedState=Et=e:Et=Et.next=e}return Et}function jc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function is(e){var t=Wi;return Wi+=1,xl===null&&(xl=[]),e=Yb(xl,e,t),t=ce,(Et===null?t.memoizedState:Et.next)===null&&(t=t.alternate,re.H=t===null||t.memoizedState===null?OS:wh),e}function Vc(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return is(e);if(e.$$typeof===Nn)return Wt(e)}throw Error(P(438,String(e)))}function dh(e){var t=null,a=ce.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var n=ce.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=jc(),ce.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),n=0;n<e;n++)a[n]=a_;return t.index++,a}function Vn(e,t){return typeof t=="function"?t(e):t}function Yu(e){var t=Lt();return fh(t,Ye,e)}function fh(e,t,a){var n=e.queue;if(n===null)throw Error(P(311));n.lastRenderedReducer=a;var r=e.baseQueue,o=n.pending;if(o!==null){if(r!==null){var l=r.next;r.next=o.next,o.next=l}t.baseQueue=r=o,n.pending=null}if(o=e.baseState,r===null)e.memoizedState=o;else{t=r.next;var i=l=null,s=null,u=t,c=!1;do{var d=u.lane&-536870913;if(d!==u.lane?(Se&d)===d:(jn&d)===d){var f=u.revertLane;if(f===0)s!==null&&(s=s.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),d===Cl&&(c=!0);else if((jn&f)===f){u=u.next,f===Cl&&(c=!0);continue}else d={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},s===null?(i=s=d,l=o):s=s.next=d,ce.lanes|=f,Or|=f;d=u.action,ho&&a(o,d),o=u.hasEagerState?u.eagerState:a(o,d)}else f={lane:d,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},s===null?(i=s=f,l=o):s=s.next=f,ce.lanes|=d,Or|=d;u=u.next}while(u!==null&&u!==t);if(s===null?l=o:s.next=i,!Aa(o,e.memoizedState)&&(_t=!0,c&&(a=gl,a!==null)))throw a;e.memoizedState=o,e.baseState=l,e.baseQueue=s,n.lastRenderedState=o}return r===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function kp(e){var t=Lt(),a=t.queue;if(a===null)throw Error(P(311));a.lastRenderedReducer=e;var n=a.dispatch,r=a.pending,o=t.memoizedState;if(r!==null){a.pending=null;var l=r=r.next;do o=e(o,l.action),l=l.next;while(l!==r);Aa(o,t.memoizedState)||(_t=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),a.lastRenderedState=o}return[o,n]}function lS(e,t,a){var n=ce,r=Lt(),o=Ae;if(o){if(a===void 0)throw Error(P(407));a=a()}else a=t();var l=!Aa((Ye||r).memoizedState,a);if(l&&(r.memoizedState=a,_t=!0),r=r.queue,ph(uS.bind(null,n,r,e),[e]),r.getSnapshot!==t||l||Et!==null&&Et.memoizedState.tag&1){if(n.flags|=2048,kl(9,{destroy:void 0},sS.bind(null,n,r,a,t),null),at===null)throw Error(P(349));o||(jn&127)!==0||iS(n,t,a)}return a}function iS(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=ce.updateQueue,t===null?(t=jc(),ce.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function sS(e,t,a,n){t.value=a,t.getSnapshot=n,cS(t)&&dS(e)}function uS(e,t,a){return a(function(){cS(t)&&dS(e)})}function cS(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Aa(e,a)}catch{return!0}}function dS(e){var t=vo(e,2);t!==null&&ma(t,e,2)}function hm(e){var t=aa();if(typeof e=="function"){var a=e;if(e=a(),ho){yr(!0);try{a()}finally{yr(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vn,lastRenderedState:e},t}function fS(e,t,a,n){return e.baseState=a,fh(e,Ye,typeof n=="function"?n:Vn)}function wO(e,t,a,n,r){if($c(e))throw Error(P(485));if(e=t.action,e!==null){var o={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(l){o.listeners.push(l)}};re.T!==null?a(!0):o.isTransition=!1,n(o),a=t.pending,a===null?(o.next=t.pending=o,pS(t,o)):(o.next=a.next,t.pending=a.next=o)}}function pS(e,t){var a=t.action,n=t.payload,r=e.state;if(t.isTransition){var o=re.T,l={};re.T=l;try{var i=a(r,n),s=re.S;s!==null&&s(l,i),fv(e,t,i)}catch(u){gm(e,t,u)}finally{o!==null&&l.types!==null&&(o.types=l.types),re.T=o}}else try{o=a(r,n),fv(e,t,o)}catch(u){gm(e,t,u)}}function fv(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(n){pv(e,t,n)},function(n){return gm(e,t,n)}):pv(e,t,a)}function pv(e,t,a){t.status="fulfilled",t.value=a,mS(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,pS(e,a)))}function gm(e,t,a){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=a,mS(t),t=t.next;while(t!==n)}e.action=null}function mS(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function hS(e,t){return t}function mv(e,t){if(Ae){var a=at.formState;if(a!==null){e:{var n=ce;if(Ae){if(ut){t:{for(var r=ut,o=ja;r.nodeType!==8;){if(!o){r=null;break t}if(r=Ga(r.nextSibling),r===null){r=null;break t}}o=r.data,r=o==="F!"||o==="F"?r:null}if(r){ut=Ga(r.nextSibling),n=r.data==="F!";break e}}Dr(n)}n=!1}n&&(t=a[0])}}return a=aa(),a.memoizedState=a.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hS,lastRenderedState:t},a.queue=n,a=RS.bind(null,ce,n),n.dispatch=a,n=hm(!1),o=yh.bind(null,ce,!1,n.queue),n=aa(),r={state:t,dispatch:null,action:e,pending:null},n.queue=r,a=wO.bind(null,ce,r,o,a),r.dispatch=a,n.memoizedState=e,[t,a,!1]}function hv(e){var t=Lt();return gS(t,Ye,e)}function gS(e,t,a){if(t=fh(e,t,hS)[0],e=Yu(Vn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=is(t)}catch(l){throw l===Ol?Hc:l}else n=t;t=Lt();var r=t.queue,o=r.dispatch;return a!==t.memoizedState&&(ce.flags|=2048,kl(9,{destroy:void 0},xO.bind(null,r,a),null)),[n,o,e]}function xO(e,t){e.action=t}function gv(e){var t=Lt(),a=Ye;if(a!==null)return gS(t,a,e);Lt(),t=t.memoizedState,a=Lt();var n=a.queue.dispatch;return a.memoizedState=e,[t,n,!1]}function kl(e,t,a,n){return e={tag:e,create:a,deps:n,inst:t,next:null},t=ce.updateQueue,t===null&&(t=jc(),ce.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(n=a.next,a.next=e,e.next=n,t.lastEffect=e),e}function yS(){return Lt().memoizedState}function Ju(e,t,a,n){var r=aa();ce.flags|=e,r.memoizedState=kl(1|t,{destroy:void 0},a,n===void 0?null:n)}function Gc(e,t,a,n){var r=Lt();n=n===void 0?null:n;var o=r.memoizedState.inst;Ye!==null&&n!==null&&lh(n,Ye.memoizedState.deps)?r.memoizedState=kl(t,o,a,n):(ce.flags|=e,r.memoizedState=kl(1|t,o,a,n))}function yv(e,t){Ju(8390656,8,e,t)}function ph(e,t){Gc(2048,8,e,t)}function vO(e){ce.flags|=4;var t=ce.updateQueue;if(t===null)t=jc(),ce.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function wS(e){var t=Lt().memoizedState;return vO({ref:t,nextImpl:e}),function(){if((Fe&2)!==0)throw Error(P(440));return t.impl.apply(void 0,arguments)}}function xS(e,t){return Gc(4,2,e,t)}function vS(e,t){return Gc(4,4,e,t)}function bS(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function SS(e,t,a){a=a!=null?a.concat([e]):null,Gc(4,4,bS.bind(null,t,e),a)}function mh(){}function CS(e,t){var a=Lt();t=t===void 0?null:t;var n=a.memoizedState;return t!==null&&lh(t,n[1])?n[0]:(a.memoizedState=[e,t],e)}function IS(e,t){var a=Lt();t=t===void 0?null:t;var n=a.memoizedState;if(t!==null&&lh(t,n[1]))return n[0];if(n=e(),ho){yr(!0);try{e()}finally{yr(!1)}}return a.memoizedState=[n,t],n}function hh(e,t,a){return a===void 0||(jn&1073741824)!==0&&(Se&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=f0(),ce.lanes|=e,Or|=e,a)}function kS(e,t,a,n){return Aa(a,t)?a:Il.current!==null?(e=hh(e,a,n),Aa(e,t)||(_t=!0),e):(jn&42)===0||(jn&1073741824)!==0&&(Se&261930)===0?(_t=!0,e.memoizedState=a):(e=f0(),ce.lanes|=e,Or|=e,t)}function LS(e,t,a,n,r){var o=ze.p;ze.p=o!==0&&8>o?o:8;var l=re.T,i={};re.T=i,yh(e,!1,t,a);try{var s=r(),u=re.S;if(u!==null&&u(i,s),s!==null&&typeof s=="object"&&typeof s.then=="function"){var c=hO(s,n);Oi(e,t,c,Ta(e))}else Oi(e,t,n,Ta(e))}catch(d){Oi(e,t,{then:function(){},status:"rejected",reason:d},Ta())}finally{ze.p=o,l!==null&&i.types!==null&&(l.types=i.types),re.T=l}}function bO(){}function ym(e,t,a,n){if(e.tag!==5)throw Error(P(476));var r=TS(e).queue;LS(e,r,t,lo,a===null?bO:function(){return AS(e),a(n)})}function TS(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:lo,baseState:lo,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vn,lastRenderedState:lo},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vn,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function AS(e){var t=TS(e);t.next===null&&(t=e.alternate.memoizedState),Oi(e,t.next.queue,{},Ta())}function gh(){return Wt(Qi)}function MS(){return Lt().memoizedState}function ES(){return Lt().memoizedState}function SO(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Ta();e=Ir(a);var n=kr(t,e,a);n!==null&&(ma(n,t,a),Ri(n,t,a)),t={cache:th()},e.payload=t;return}t=t.return}}function CO(e,t,a){var n=Ta();a={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},$c(e)?DS(t,a):(a=Qm(e,t,a,n),a!==null&&(ma(a,e,n),_S(a,t,n)))}function RS(e,t,a){var n=Ta();Oi(e,t,a,n)}function Oi(e,t,a,n){var r={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if($c(e))DS(t,r);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var l=t.lastRenderedState,i=o(l,a);if(r.hasEagerState=!0,r.eagerState=i,Aa(i,l))return qc(e,t,r,0),at===null&&zc(),!1}catch{}if(a=Qm(e,t,r,n),a!==null)return ma(a,e,n),_S(a,t,n),!0}return!1}function yh(e,t,a,n){if(n={lane:2,revertLane:Lh(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},$c(e)){if(t)throw Error(P(479))}else t=Qm(e,a,n,2),t!==null&&ma(t,e,2)}function $c(e){var t=e.alternate;return e===ce||t!==null&&t===ce}function DS(e,t){wl=xc=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function _S(e,t,a){if((a&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,wb(e,a)}}var Xi={readContext:Wt,use:Vc,useCallback:wt,useContext:wt,useEffect:wt,useImperativeHandle:wt,useLayoutEffect:wt,useInsertionEffect:wt,useMemo:wt,useReducer:wt,useRef:wt,useState:wt,useDebugValue:wt,useDeferredValue:wt,useTransition:wt,useSyncExternalStore:wt,useId:wt,useHostTransitionStatus:wt,useFormState:wt,useActionState:wt,useOptimistic:wt,useMemoCache:wt,useCacheRefresh:wt};Xi.useEffectEvent=wt;var OS={readContext:Wt,use:Vc,useCallback:function(e,t){return aa().memoizedState=[e,t===void 0?null:t],e},useContext:Wt,useEffect:yv,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Ju(4194308,4,bS.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Ju(4194308,4,e,t)},useInsertionEffect:function(e,t){Ju(4,2,e,t)},useMemo:function(e,t){var a=aa();t=t===void 0?null:t;var n=e();if(ho){yr(!0);try{e()}finally{yr(!1)}}return a.memoizedState=[n,t],n},useReducer:function(e,t,a){var n=aa();if(a!==void 0){var r=a(t);if(ho){yr(!0);try{a(t)}finally{yr(!1)}}}else r=t;return n.memoizedState=n.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},n.queue=e,e=e.dispatch=CO.bind(null,ce,e),[n.memoizedState,e]},useRef:function(e){var t=aa();return e={current:e},t.memoizedState=e},useState:function(e){e=hm(e);var t=e.queue,a=RS.bind(null,ce,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:mh,useDeferredValue:function(e,t){var a=aa();return hh(a,e,t)},useTransition:function(){var e=hm(!1);return e=LS.bind(null,ce,e.queue,!0,!1),aa().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var n=ce,r=aa();if(Ae){if(a===void 0)throw Error(P(407));a=a()}else{if(a=t(),at===null)throw Error(P(349));(Se&127)!==0||iS(n,t,a)}r.memoizedState=a;var o={value:a,getSnapshot:t};return r.queue=o,yv(uS.bind(null,n,o,e),[e]),n.flags|=2048,kl(9,{destroy:void 0},sS.bind(null,n,o,a,t),null),a},useId:function(){var e=aa(),t=at.identifierPrefix;if(Ae){var a=pn,n=fn;a=(n&~(1<<32-La(n)-1)).toString(32)+a,t="_"+t+"R_"+a,a=vc++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=gO++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:gh,useFormState:mv,useActionState:mv,useOptimistic:function(e){var t=aa();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=yh.bind(null,ce,!0,a),a.dispatch=t,[e,t]},useMemoCache:dh,useCacheRefresh:function(){return aa().memoizedState=SO.bind(null,ce)},useEffectEvent:function(e){var t=aa(),a={impl:e};return t.memoizedState=a,function(){if((Fe&2)!==0)throw Error(P(440));return a.impl.apply(void 0,arguments)}}},wh={readContext:Wt,use:Vc,useCallback:CS,useContext:Wt,useEffect:ph,useImperativeHandle:SS,useInsertionEffect:xS,useLayoutEffect:vS,useMemo:IS,useReducer:Yu,useRef:yS,useState:function(){return Yu(Vn)},useDebugValue:mh,useDeferredValue:function(e,t){var a=Lt();return kS(a,Ye.memoizedState,e,t)},useTransition:function(){var e=Yu(Vn)[0],t=Lt().memoizedState;return[typeof e=="boolean"?e:is(e),t]},useSyncExternalStore:lS,useId:MS,useHostTransitionStatus:gh,useFormState:hv,useActionState:hv,useOptimistic:function(e,t){var a=Lt();return fS(a,Ye,e,t)},useMemoCache:dh,useCacheRefresh:ES};wh.useEffectEvent=wS;var PS={readContext:Wt,use:Vc,useCallback:CS,useContext:Wt,useEffect:ph,useImperativeHandle:SS,useInsertionEffect:xS,useLayoutEffect:vS,useMemo:IS,useReducer:kp,useRef:yS,useState:function(){return kp(Vn)},useDebugValue:mh,useDeferredValue:function(e,t){var a=Lt();return Ye===null?hh(a,e,t):kS(a,Ye.memoizedState,e,t)},useTransition:function(){var e=kp(Vn)[0],t=Lt().memoizedState;return[typeof e=="boolean"?e:is(e),t]},useSyncExternalStore:lS,useId:MS,useHostTransitionStatus:gh,useFormState:gv,useActionState:gv,useOptimistic:function(e,t){var a=Lt();return Ye!==null?fS(a,Ye,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:dh,useCacheRefresh:ES};PS.useEffectEvent=wS;function Lp(e,t,a,n){t=e.memoizedState,a=a(n,t),a=a==null?t:ct({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var wm={enqueueSetState:function(e,t,a){e=e._reactInternals;var n=Ta(),r=Ir(n);r.payload=t,a!=null&&(r.callback=a),t=kr(e,r,n),t!==null&&(ma(t,e,n),Ri(t,e,n))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var n=Ta(),r=Ir(n);r.tag=1,r.payload=t,a!=null&&(r.callback=a),t=kr(e,r,n),t!==null&&(ma(t,e,n),Ri(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Ta(),n=Ir(a);n.tag=2,t!=null&&(n.callback=t),t=kr(e,n,a),t!==null&&(ma(t,e,a),Ri(t,e,a))}};function wv(e,t,a,n,r,o,l){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,o,l):t.prototype&&t.prototype.isPureReactComponent?!ji(a,n)||!ji(r,o):!0}function xv(e,t,a,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,n),t.state!==e&&wm.enqueueReplaceState(t,t.state,null)}function go(e,t){var a=t;if("ref"in t){a={};for(var n in t)n!=="ref"&&(a[n]=t[n])}if(e=e.defaultProps){a===t&&(a=ct({},a));for(var r in e)a[r]===void 0&&(a[r]=e[r])}return a}function NS(e){fc(e)}function BS(e){console.error(e)}function US(e){fc(e)}function bc(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function vv(e,t,a){try{var n=e.onCaughtError;n(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function xm(e,t,a){return a=Ir(a),a.tag=3,a.payload={element:null},a.callback=function(){bc(e,t)},a}function FS(e){return e=Ir(e),e.tag=3,e}function zS(e,t,a,n){var r=a.type.getDerivedStateFromError;if(typeof r=="function"){var o=n.value;e.payload=function(){return r(o)},e.callback=function(){vv(t,a,n)}}var l=a.stateNode;l!==null&&typeof l.componentDidCatch=="function"&&(e.callback=function(){vv(t,a,n),typeof r!="function"&&(Lr===null?Lr=new Set([this]):Lr.add(this));var i=n.stack;this.componentDidCatch(n.value,{componentStack:i!==null?i:""})})}function IO(e,t,a,n,r){if(a.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=a.alternate,t!==null&&_l(t,a,r,!0),a=Ma.current,a!==null){switch(a.tag){case 31:case 13:return Va===null?Lc():a.alternate===null&&xt===0&&(xt=3),a.flags&=-257,a.flags|=65536,a.lanes=r,n===gc?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([n]):t.add(n),Bp(e,n,r)),!1;case 22:return a.flags|=65536,n===gc?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([n]):a.add(n)),Bp(e,n,r)),!1}throw Error(P(435,a.tag))}return Bp(e,n,r),Lc(),!1}if(Ae)return t=Ma.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=r,n!==lm&&(e=Error(P(422),{cause:n}),Gi(Ha(e,a)))):(n!==lm&&(t=Error(P(423),{cause:n}),Gi(Ha(t,a))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,n=Ha(n,a),r=xm(e.stateNode,n,r),Ip(e,r),xt!==4&&(xt=2)),!1;var o=Error(P(520),{cause:n});if(o=Ha(o,a),Bi===null?Bi=[o]:Bi.push(o),xt!==4&&(xt=2),t===null)return!0;n=Ha(n,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=r&-r,a.lanes|=e,e=xm(a.stateNode,n,e),Ip(a,e),!1;case 1:if(t=a.type,o=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||o!==null&&typeof o.componentDidCatch=="function"&&(Lr===null||!Lr.has(o))))return a.flags|=65536,r&=-r,a.lanes|=r,r=FS(r),zS(r,e,a,n),Ip(a,r),!1}a=a.return}while(a!==null);return!1}var xh=Error(P(461)),_t=!1;function Vt(e,t,a,n){t.child=e===null?eS(t,null,a,n):mo(t,e.child,a,n)}function bv(e,t,a,n,r){a=a.render;var o=t.ref;if("ref"in n){var l={};for(var i in n)i!=="ref"&&(l[i]=n[i])}else l=n;return po(t),n=ih(e,t,a,l,o,r),i=sh(),e!==null&&!_t?(uh(e,t,r),Gn(e,t,r)):(Ae&&i&&Jm(t),t.flags|=1,Vt(e,t,n,r),t.child)}function Sv(e,t,a,n,r){if(e===null){var o=a.type;return typeof o=="function"&&!Ym(o)&&o.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=o,qS(e,t,o,n,r)):(e=Zu(a.type,null,n,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!vh(e,r)){var l=o.memoizedProps;if(a=a.compare,a=a!==null?a:ji,a(l,n)&&e.ref===t.ref)return Gn(e,t,r)}return t.flags|=1,e=Fn(o,n),e.ref=t.ref,e.return=t,t.child=e}function qS(e,t,a,n,r){if(e!==null){var o=e.memoizedProps;if(ji(o,n)&&e.ref===t.ref)if(_t=!1,t.pendingProps=n=o,vh(e,r))(e.flags&131072)!==0&&(_t=!0);else return t.lanes=e.lanes,Gn(e,t,r)}return vm(e,t,a,n,r)}function HS(e,t,a,n){var r=n.children,o=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.mode==="hidden"){if((t.flags&128)!==0){if(o=o!==null?o.baseLanes|a:a,e!==null){for(n=t.child=e.child,r=0;n!==null;)r=r|n.lanes|n.childLanes,n=n.sibling;n=r&~o}else n=0,t.child=null;return Cv(e,t,o,a,n)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Qu(t,o!==null?o.cachePool:null),o!==null?dv(t,o):pm(),nS(t);else return n=t.lanes=536870912,Cv(e,t,o!==null?o.baseLanes|a:a,a,n)}else o!==null?(Qu(t,o.cachePool),dv(t,o),hr(t),t.memoizedState=null):(e!==null&&Qu(t,null),pm(),hr(t));return Vt(e,t,r,a),t.child}function ki(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Cv(e,t,a,n,r){var o=ah();return o=o===null?null:{parent:Dt._currentValue,pool:o},t.memoizedState={baseLanes:a,cachePool:o},e!==null&&Qu(t,null),pm(),nS(t),e!==null&&_l(e,t,n,!0),t.childLanes=r,null}function ec(e,t){return t=Sc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Iv(e,t,a){return mo(t,e.child,null,a),e=ec(t,t.pendingProps),e.flags|=2,ba(t),t.memoizedState=null,e}function kO(e,t,a){var n=t.pendingProps,r=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ae){if(n.mode==="hidden")return e=ec(t,n),t.lanes=536870912,ki(null,e);if(mm(t),(e=ut)?(e=O0(e,ja),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Rr!==null?{id:fn,overflow:pn}:null,retryLane:536870912,hydrationErrors:null},a=Wb(e),a.return=t,t.child=a,$t=t,ut=null)):e=null,e===null)throw Dr(t);return t.lanes=536870912,null}return ec(t,n)}var o=e.memoizedState;if(o!==null){var l=o.dehydrated;if(mm(t),r)if(t.flags&256)t.flags&=-257,t=Iv(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(P(558));else if(_t||_l(e,t,a,!1),r=(a&e.childLanes)!==0,_t||r){if(n=at,n!==null&&(l=xb(n,a),l!==0&&l!==o.retryLane))throw o.retryLane=l,vo(e,l),ma(n,e,l),xh;Lc(),t=Iv(e,t,a)}else e=o.treeContext,ut=Ga(l.nextSibling),$t=t,Ae=!0,Cr=null,ja=!1,e!==null&&Kb(t,e),t=ec(t,n),t.flags|=4096;return t}return e=Fn(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function tc(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(P(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function vm(e,t,a,n,r){return po(t),a=ih(e,t,a,n,void 0,r),n=sh(),e!==null&&!_t?(uh(e,t,r),Gn(e,t,r)):(Ae&&n&&Jm(t),t.flags|=1,Vt(e,t,a,r),t.child)}function kv(e,t,a,n,r,o){return po(t),t.updateQueue=null,a=oS(t,n,a,r),rS(e),n=sh(),e!==null&&!_t?(uh(e,t,o),Gn(e,t,o)):(Ae&&n&&Jm(t),t.flags|=1,Vt(e,t,a,o),t.child)}function Lv(e,t,a,n,r){if(po(t),t.stateNode===null){var o=ul,l=a.contextType;typeof l=="object"&&l!==null&&(o=Wt(l)),o=new a(n,o),t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=wm,t.stateNode=o,o._reactInternals=t,o=t.stateNode,o.props=n,o.state=t.memoizedState,o.refs={},rh(t),l=a.contextType,o.context=typeof l=="object"&&l!==null?Wt(l):ul,o.state=t.memoizedState,l=a.getDerivedStateFromProps,typeof l=="function"&&(Lp(t,a,l,n),o.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(l=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),l!==o.state&&wm.enqueueReplaceState(o,o.state,null),_i(t,n,o,r),Di(),o.state=t.memoizedState),typeof o.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){o=t.stateNode;var i=t.memoizedProps,s=go(a,i);o.props=s;var u=o.context,c=a.contextType;l=ul,typeof c=="object"&&c!==null&&(l=Wt(c));var d=a.getDerivedStateFromProps;c=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function",i=t.pendingProps!==i,c||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(i||u!==l)&&xv(t,o,n,l),fr=!1;var f=t.memoizedState;o.state=f,_i(t,n,o,r),Di(),u=t.memoizedState,i||f!==u||fr?(typeof d=="function"&&(Lp(t,a,d,n),u=t.memoizedState),(s=fr||wv(t,a,s,n,f,u,l))?(c||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=u),o.props=n,o.state=u,o.context=l,n=s):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{o=t.stateNode,dm(e,t),l=t.memoizedProps,c=go(a,l),o.props=c,d=t.pendingProps,f=o.context,u=a.contextType,s=ul,typeof u=="object"&&u!==null&&(s=Wt(u)),i=a.getDerivedStateFromProps,(u=typeof i=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==d||f!==s)&&xv(t,o,n,s),fr=!1,f=t.memoizedState,o.state=f,_i(t,n,o,r),Di();var p=t.memoizedState;l!==d||f!==p||fr||e!==null&&e.dependencies!==null&&hc(e.dependencies)?(typeof i=="function"&&(Lp(t,a,i,n),p=t.memoizedState),(c=fr||wv(t,a,c,n,f,p,s)||e!==null&&e.dependencies!==null&&hc(e.dependencies))?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,p,s),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,p,s)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=p),o.props=n,o.state=p,o.context=s,n=c):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),n=!1)}return o=n,tc(e,t),n=(t.flags&128)!==0,o||n?(o=t.stateNode,a=n&&typeof a.getDerivedStateFromError!="function"?null:o.render(),t.flags|=1,e!==null&&n?(t.child=mo(t,e.child,null,r),t.child=mo(t,null,a,r)):Vt(e,t,a,r),t.memoizedState=o.state,e=t.child):e=Gn(e,t,r),e}function Tv(e,t,a,n){return fo(),t.flags|=256,Vt(e,t,a,n),t.child}var Tp={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ap(e){return{baseLanes:e,cachePool:Qb()}}function Mp(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Ca),e}function jS(e,t,a){var n=t.pendingProps,r=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(kt.current&2)!==0),l&&(r=!0,t.flags&=-129),l=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ae){if(r?mr(t):hr(t),(e=ut)?(e=O0(e,ja),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Rr!==null?{id:fn,overflow:pn}:null,retryLane:536870912,hydrationErrors:null},a=Wb(e),a.return=t,t.child=a,$t=t,ut=null)):e=null,e===null)throw Dr(t);return Om(e)?t.lanes=32:t.lanes=536870912,null}var i=n.children;return n=n.fallback,r?(hr(t),r=t.mode,i=Sc({mode:"hidden",children:i},r),n=io(n,r,a,null),i.return=t,n.return=t,i.sibling=n,t.child=i,n=t.child,n.memoizedState=Ap(a),n.childLanes=Mp(e,l,a),t.memoizedState=Tp,ki(null,n)):(mr(t),bm(t,i))}var s=e.memoizedState;if(s!==null&&(i=s.dehydrated,i!==null)){if(o)t.flags&256?(mr(t),t.flags&=-257,t=Ep(e,t,a)):t.memoizedState!==null?(hr(t),t.child=e.child,t.flags|=128,t=null):(hr(t),i=n.fallback,r=t.mode,n=Sc({mode:"visible",children:n.children},r),i=io(i,r,a,null),i.flags|=2,n.return=t,i.return=t,n.sibling=i,t.child=n,mo(t,e.child,null,a),n=t.child,n.memoizedState=Ap(a),n.childLanes=Mp(e,l,a),t.memoizedState=Tp,t=ki(null,n));else if(mr(t),Om(i)){if(l=i.nextSibling&&i.nextSibling.dataset,l)var u=l.dgst;l=u,n=Error(P(419)),n.stack="",n.digest=l,Gi({value:n,source:null,stack:null}),t=Ep(e,t,a)}else if(_t||_l(e,t,a,!1),l=(a&e.childLanes)!==0,_t||l){if(l=at,l!==null&&(n=xb(l,a),n!==0&&n!==s.retryLane))throw s.retryLane=n,vo(e,n),ma(l,e,n),xh;_m(i)||Lc(),t=Ep(e,t,a)}else _m(i)?(t.flags|=192,t.child=e.child,t=null):(e=s.treeContext,ut=Ga(i.nextSibling),$t=t,Ae=!0,Cr=null,ja=!1,e!==null&&Kb(t,e),t=bm(t,n.children),t.flags|=4096);return t}return r?(hr(t),i=n.fallback,r=t.mode,s=e.child,u=s.sibling,n=Fn(s,{mode:"hidden",children:n.children}),n.subtreeFlags=s.subtreeFlags&65011712,u!==null?i=Fn(u,i):(i=io(i,r,a,null),i.flags|=2),i.return=t,n.return=t,n.sibling=i,t.child=n,ki(null,n),n=t.child,i=e.child.memoizedState,i===null?i=Ap(a):(r=i.cachePool,r!==null?(s=Dt._currentValue,r=r.parent!==s?{parent:s,pool:s}:r):r=Qb(),i={baseLanes:i.baseLanes|a,cachePool:r}),n.memoizedState=i,n.childLanes=Mp(e,l,a),t.memoizedState=Tp,ki(e.child,n)):(mr(t),a=e.child,e=a.sibling,a=Fn(a,{mode:"visible",children:n.children}),a.return=t,a.sibling=null,e!==null&&(l=t.deletions,l===null?(t.deletions=[e],t.flags|=16):l.push(e)),t.child=a,t.memoizedState=null,a)}function bm(e,t){return t=Sc({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Sc(e,t){return e=Sa(22,e,null,t),e.lanes=0,e}function Ep(e,t,a){return mo(t,e.child,null,a),e=bm(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Av(e,t,a){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),sm(e.return,t,a)}function Rp(e,t,a,n,r,o){var l=e.memoizedState;l===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:a,tailMode:r,treeForkCount:o}:(l.isBackwards=t,l.rendering=null,l.renderingStartTime=0,l.last=n,l.tail=a,l.tailMode=r,l.treeForkCount=o)}function VS(e,t,a){var n=t.pendingProps,r=n.revealOrder,o=n.tail;n=n.children;var l=kt.current,i=(l&2)!==0;if(i?(l=l&1|2,t.flags|=128):l&=1,lt(kt,l),Vt(e,t,n,a),n=Ae?Vi:0,!i&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Av(e,a,t);else if(e.tag===19)Av(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(r){case"forwards":for(a=t.child,r=null;a!==null;)e=a.alternate,e!==null&&wc(e)===null&&(r=a),a=a.sibling;a=r,a===null?(r=t.child,t.child=null):(r=a.sibling,a.sibling=null),Rp(t,!1,r,a,o,n);break;case"backwards":case"unstable_legacy-backwards":for(a=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&wc(e)===null){t.child=r;break}e=r.sibling,r.sibling=a,a=r,r=e}Rp(t,!0,a,null,o,n);break;case"together":Rp(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function Gn(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Or|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(_l(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(P(153));if(t.child!==null){for(e=t.child,a=Fn(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Fn(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function vh(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&hc(e)))}function LO(e,t,a){switch(t.tag){case 3:sc(t,t.stateNode.containerInfo),pr(t,Dt,e.memoizedState.cache),fo();break;case 27:case 5:Kp(t);break;case 4:sc(t,t.stateNode.containerInfo);break;case 10:pr(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,mm(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(mr(t),t.flags|=128,null):(a&t.child.childLanes)!==0?jS(e,t,a):(mr(t),e=Gn(e,t,a),e!==null?e.sibling:null);mr(t);break;case 19:var r=(e.flags&128)!==0;if(n=(a&t.childLanes)!==0,n||(_l(e,t,a,!1),n=(a&t.childLanes)!==0),r){if(n)return VS(e,t,a);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),lt(kt,kt.current),n)break;return null;case 22:return t.lanes=0,HS(e,t,a,t.pendingProps);case 24:pr(t,Dt,e.memoizedState.cache)}return Gn(e,t,a)}function GS(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)_t=!0;else{if(!vh(e,a)&&(t.flags&128)===0)return _t=!1,LO(e,t,a);_t=(e.flags&131072)!==0}else _t=!1,Ae&&(t.flags&1048576)!==0&&Xb(t,Vi,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=ro(t.elementType),t.type=e,typeof e=="function")Ym(e)?(n=go(e,n),t.tag=1,t=Lv(null,t,e,n,a)):(t.tag=0,t=vm(null,t,e,n,a));else{if(e!=null){var r=e.$$typeof;if(r===Um){t.tag=11,t=bv(null,t,e,n,a);break e}else if(r===Fm){t.tag=14,t=Sv(null,t,e,n,a);break e}}throw t=Wp(e)||e,Error(P(306,t,""))}}return t;case 0:return vm(e,t,t.type,t.pendingProps,a);case 1:return n=t.type,r=go(n,t.pendingProps),Lv(e,t,n,r,a);case 3:e:{if(sc(t,t.stateNode.containerInfo),e===null)throw Error(P(387));n=t.pendingProps;var o=t.memoizedState;r=o.element,dm(e,t),_i(t,n,null,a);var l=t.memoizedState;if(n=l.cache,pr(t,Dt,n),n!==o.cache&&um(t,[Dt],a,!0),Di(),n=l.element,o.isDehydrated)if(o={element:n,isDehydrated:!1,cache:l.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Tv(e,t,n,a);break e}else if(n!==r){r=Ha(Error(P(424)),t),Gi(r),t=Tv(e,t,n,a);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,ut=Ga(e.firstChild),$t=t,Ae=!0,Cr=null,ja=!0,a=eS(t,null,n,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(fo(),n===r){t=Gn(e,t,a);break e}Vt(e,t,n,a)}t=t.child}return t;case 26:return tc(e,t),e===null?(a=Zv(t.type,null,t.pendingProps,null))?t.memoizedState=a:Ae||(a=t.type,e=t.pendingProps,n=Ec(Sr.current).createElement(a),n[Gt]=t,n[ha]=e,Xt(n,a,e),zt(n),t.stateNode=n):t.memoizedState=Zv(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Kp(t),e===null&&Ae&&(n=t.stateNode=P0(t.type,t.pendingProps,Sr.current),$t=t,ja=!0,r=ut,Nr(t.type)?(Pm=r,ut=Ga(n.firstChild)):ut=r),Vt(e,t,t.pendingProps.children,a),tc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ae&&((r=n=ut)&&(n=eP(n,t.type,t.pendingProps,ja),n!==null?(t.stateNode=n,$t=t,ut=Ga(n.firstChild),ja=!1,r=!0):r=!1),r||Dr(t)),Kp(t),r=t.type,o=t.pendingProps,l=e!==null?e.memoizedProps:null,n=o.children,Rm(r,o)?n=null:l!==null&&Rm(r,l)&&(t.flags|=32),t.memoizedState!==null&&(r=ih(e,t,yO,null,null,a),Qi._currentValue=r),tc(e,t),Vt(e,t,n,a),t.child;case 6:return e===null&&Ae&&((e=a=ut)&&(a=tP(a,t.pendingProps,ja),a!==null?(t.stateNode=a,$t=t,ut=null,e=!0):e=!1),e||Dr(t)),null;case 13:return jS(e,t,a);case 4:return sc(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=mo(t,null,n,a):Vt(e,t,n,a),t.child;case 11:return bv(e,t,t.type,t.pendingProps,a);case 7:return Vt(e,t,t.pendingProps,a),t.child;case 8:return Vt(e,t,t.pendingProps.children,a),t.child;case 12:return Vt(e,t,t.pendingProps.children,a),t.child;case 10:return n=t.pendingProps,pr(t,t.type,n.value),Vt(e,t,n.children,a),t.child;case 9:return r=t.type._context,n=t.pendingProps.children,po(t),r=Wt(r),n=n(r),t.flags|=1,Vt(e,t,n,a),t.child;case 14:return Sv(e,t,t.type,t.pendingProps,a);case 15:return qS(e,t,t.type,t.pendingProps,a);case 19:return VS(e,t,a);case 31:return kO(e,t,a);case 22:return HS(e,t,a,t.pendingProps);case 24:return po(t),n=Wt(Dt),e===null?(r=ah(),r===null&&(r=at,o=th(),r.pooledCache=o,o.refCount++,o!==null&&(r.pooledCacheLanes|=a),r=o),t.memoizedState={parent:n,cache:r},rh(t),pr(t,Dt,r)):((e.lanes&a)!==0&&(dm(e,t),_i(t,null,null,a),Di()),r=e.memoizedState,o=t.memoizedState,r.parent!==n?(r={parent:n,cache:n},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),pr(t,Dt,n)):(n=o.cache,pr(t,Dt,n),n!==r.cache&&um(t,[Dt],a,!0))),Vt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(P(156,t.tag))}function En(e){e.flags|=4}function Dp(e,t,a,n,r){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(r&335544128)===r)if(e.stateNode.complete)e.flags|=8192;else if(h0())e.flags|=8192;else throw uo=gc,nh}else e.flags&=-16777217}function Mv(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!U0(t))if(h0())e.flags|=8192;else throw uo=gc,nh}function Fu(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?gb():536870912,e.lanes|=t,Ll|=t)}function wi(e,t){if(!Ae)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var n=null;a!==null;)a.alternate!==null&&(n=a),a=a.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function st(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,n=0;if(t)for(var r=e.child;r!==null;)a|=r.lanes|r.childLanes,n|=r.subtreeFlags&65011712,n|=r.flags&65011712,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)a|=r.lanes|r.childLanes,n|=r.subtreeFlags,n|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=n,e.childLanes=a,t}function TO(e,t,a){var n=t.pendingProps;switch(eh(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return st(t),null;case 1:return st(t),null;case 3:return a=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),zn(Dt),vl(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Qo(t)?En(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Cp())),st(t),null;case 26:var r=t.type,o=t.memoizedState;return e===null?(En(t),o!==null?(st(t),Mv(t,o)):(st(t),Dp(t,r,null,n,a))):o?o!==e.memoizedState?(En(t),st(t),Mv(t,o)):(st(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&En(t),st(t),Dp(t,r,e,n,a)),null;case 27:if(uc(t),a=Sr.current,r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&En(t);else{if(!n){if(t.stateNode===null)throw Error(P(166));return st(t),null}e=hn.current,Qo(t)?rv(t,e):(e=P0(r,n,a),t.stateNode=e,En(t))}return st(t),null;case 5:if(uc(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&En(t);else{if(!n){if(t.stateNode===null)throw Error(P(166));return st(t),null}if(o=hn.current,Qo(t))rv(t,o);else{var l=Ec(Sr.current);switch(o){case 1:o=l.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:o=l.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":o=l.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":o=l.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":o=l.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof n.is=="string"?l.createElement("select",{is:n.is}):l.createElement("select"),n.multiple?o.multiple=!0:n.size&&(o.size=n.size);break;default:o=typeof n.is=="string"?l.createElement(r,{is:n.is}):l.createElement(r)}}o[Gt]=t,o[ha]=n;e:for(l=t.child;l!==null;){if(l.tag===5||l.tag===6)o.appendChild(l.stateNode);else if(l.tag!==4&&l.tag!==27&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===t)break e;for(;l.sibling===null;){if(l.return===null||l.return===t)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}t.stateNode=o;e:switch(Xt(o,r,n),r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&En(t)}}return st(t),Dp(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&En(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(P(166));if(e=Sr.current,Qo(t)){if(e=t.stateNode,a=t.memoizedProps,n=null,r=$t,r!==null)switch(r.tag){case 27:case 5:n=r.memoizedProps}e[Gt]=t,e=!!(e.nodeValue===a||n!==null&&n.suppressHydrationWarning===!0||R0(e.nodeValue,a)),e||Dr(t,!0)}else e=Ec(e).createTextNode(n),e[Gt]=t,t.stateNode=e}return st(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(n=Qo(t),a!==null){if(e===null){if(!n)throw Error(P(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(P(557));e[Gt]=t}else fo(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;st(t),e=!1}else a=Cp(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(ba(t),t):(ba(t),null);if((t.flags&128)!==0)throw Error(P(558))}return st(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=Qo(t),n!==null&&n.dehydrated!==null){if(e===null){if(!r)throw Error(P(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(P(317));r[Gt]=t}else fo(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;st(t),r=!1}else r=Cp(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(ba(t),t):(ba(t),null)}return ba(t),(t.flags&128)!==0?(t.lanes=a,t):(a=n!==null,e=e!==null&&e.memoizedState!==null,a&&(n=t.child,r=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(r=n.alternate.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==r&&(n.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Fu(t,t.updateQueue),st(t),null);case 4:return vl(),e===null&&Th(t.stateNode.containerInfo),st(t),null;case 10:return zn(t.type),st(t),null;case 19:if(qt(kt),n=t.memoizedState,n===null)return st(t),null;if(r=(t.flags&128)!==0,o=n.rendering,o===null)if(r)wi(n,!1);else{if(xt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=wc(e),o!==null){for(t.flags|=128,wi(n,!1),e=o.updateQueue,t.updateQueue=e,Fu(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)$b(a,e),a=a.sibling;return lt(kt,kt.current&1|2),Ae&&On(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&Ia()>Ic&&(t.flags|=128,r=!0,wi(n,!1),t.lanes=4194304)}else{if(!r)if(e=wc(o),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,Fu(t,e),wi(n,!0),n.tail===null&&n.tailMode==="hidden"&&!o.alternate&&!Ae)return st(t),null}else 2*Ia()-n.renderingStartTime>Ic&&a!==536870912&&(t.flags|=128,r=!0,wi(n,!1),t.lanes=4194304);n.isBackwards?(o.sibling=t.child,t.child=o):(e=n.last,e!==null?e.sibling=o:t.child=o,n.last=o)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=Ia(),e.sibling=null,a=kt.current,lt(kt,r?a&1|2:a&1),Ae&&On(t,n.treeForkCount),e):(st(t),null);case 22:case 23:return ba(t),oh(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?(a&536870912)!==0&&(t.flags&128)===0&&(st(t),t.subtreeFlags&6&&(t.flags|=8192)):st(t),a=t.updateQueue,a!==null&&Fu(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==a&&(t.flags|=2048),e!==null&&qt(so),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),zn(Dt),st(t),null;case 25:return null;case 30:return null}throw Error(P(156,t.tag))}function AO(e,t){switch(eh(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return zn(Dt),vl(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return uc(t),null;case 31:if(t.memoizedState!==null){if(ba(t),t.alternate===null)throw Error(P(340));fo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ba(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(P(340));fo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return qt(kt),null;case 4:return vl(),null;case 10:return zn(t.type),null;case 22:case 23:return ba(t),oh(),e!==null&&qt(so),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return zn(Dt),null;case 25:return null;default:return null}}function $S(e,t){switch(eh(t),t.tag){case 3:zn(Dt),vl();break;case 26:case 27:case 5:uc(t);break;case 4:vl();break;case 31:t.memoizedState!==null&&ba(t);break;case 13:ba(t);break;case 19:qt(kt);break;case 10:zn(t.type);break;case 22:case 23:ba(t),oh(),e!==null&&qt(so);break;case 24:zn(Dt)}}function ss(e,t){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var r=n.next;a=r;do{if((a.tag&e)===e){n=void 0;var o=a.create,l=a.inst;n=o(),l.destroy=n}a=a.next}while(a!==r)}}catch(i){Ge(t,t.return,i)}}function _r(e,t,a){try{var n=t.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var o=r.next;n=o;do{if((n.tag&e)===e){var l=n.inst,i=l.destroy;if(i!==void 0){l.destroy=void 0,r=t;var s=a,u=i;try{u()}catch(c){Ge(r,s,c)}}}n=n.next}while(n!==o)}}catch(c){Ge(t,t.return,c)}}function WS(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{aS(t,a)}catch(n){Ge(e,e.return,n)}}}function XS(e,t,a){a.props=go(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(n){Ge(e,t,n)}}function Pi(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;case 30:n=e.stateNode;break;default:n=e.stateNode}typeof a=="function"?e.refCleanup=a(n):a.current=n}}catch(r){Ge(e,t,r)}}function mn(e,t){var a=e.ref,n=e.refCleanup;if(a!==null)if(typeof n=="function")try{n()}catch(r){Ge(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(r){Ge(e,t,r)}else a.current=null}function KS(e){var t=e.type,a=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break e;case"img":a.src?n.src=a.src:a.srcSet&&(n.srcset=a.srcSet)}}catch(r){Ge(e,e.return,r)}}function _p(e,t,a){try{var n=e.stateNode;XO(n,e.type,a,t),n[ha]=t}catch(r){Ge(e,e.return,r)}}function ZS(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Nr(e.type)||e.tag===4}function Op(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ZS(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Nr(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Sm(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Bn));else if(n!==4&&(n===27&&Nr(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Sm(e,t,a),e=e.sibling;e!==null;)Sm(e,t,a),e=e.sibling}function Cc(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(n!==4&&(n===27&&Nr(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Cc(e,t,a),e=e.sibling;e!==null;)Cc(e,t,a),e=e.sibling}function QS(e){var t=e.stateNode,a=e.memoizedProps;try{for(var n=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);Xt(t,n,a),t[Gt]=e,t[ha]=a}catch(o){Ge(e,e.return,o)}}var Pn=!1,Rt=!1,Pp=!1,Ev=typeof WeakSet=="function"?WeakSet:Set,Ft=null;function MO(e,t){if(e=e.containerInfo,Mm=Oc,e=Ub(e),Km(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var n=a.getSelection&&a.getSelection();if(n&&n.rangeCount!==0){a=n.anchorNode;var r=n.anchorOffset,o=n.focusNode;n=n.focusOffset;try{a.nodeType,o.nodeType}catch{a=null;break e}var l=0,i=-1,s=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var p;d!==a||r!==0&&d.nodeType!==3||(i=l+r),d!==o||n!==0&&d.nodeType!==3||(s=l+n),d.nodeType===3&&(l+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===a&&++u===r&&(i=l),f===o&&++c===n&&(s=l),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}a=i===-1||s===-1?null:{start:i,end:s}}else a=null}a=a||{start:0,end:0}}else a=null;for(Em={focusedElem:e,selectionRange:a},Oc=!1,Ft=t;Ft!==null;)if(t=Ft,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ft=e;else for(;Ft!==null;){switch(t=Ft,o=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)r=e[a],r.ref.impl=r.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&o!==null){e=void 0,a=t,r=o.memoizedProps,o=o.memoizedState,n=a.stateNode;try{var m=go(a.type,r);e=n.getSnapshotBeforeUpdate(m,o),n.__reactInternalSnapshotBeforeUpdate=e}catch(x){Ge(a,a.return,x)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Dm(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Dm(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(P(163))}if(e=t.sibling,e!==null){e.return=t.return,Ft=e;break}Ft=t.return}}function YS(e,t,a){var n=a.flags;switch(a.tag){case 0:case 11:case 15:Dn(e,a),n&4&&ss(5,a);break;case 1:if(Dn(e,a),n&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(l){Ge(a,a.return,l)}else{var r=go(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(l){Ge(a,a.return,l)}}n&64&&WS(a),n&512&&Pi(a,a.return);break;case 3:if(Dn(e,a),n&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{aS(e,t)}catch(l){Ge(a,a.return,l)}}break;case 27:t===null&&n&4&&QS(a);case 26:case 5:Dn(e,a),t===null&&n&4&&KS(a),n&512&&Pi(a,a.return);break;case 12:Dn(e,a);break;case 31:Dn(e,a),n&4&&t0(e,a);break;case 13:Dn(e,a),n&4&&a0(e,a),n&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=UO.bind(null,a),aP(e,a))));break;case 22:if(n=a.memoizedState!==null||Pn,!n){t=t!==null&&t.memoizedState!==null||Rt,r=Pn;var o=Rt;Pn=n,(Rt=t)&&!o?_n(e,a,(a.subtreeFlags&8772)!==0):Dn(e,a),Pn=r,Rt=o}break;case 30:break;default:Dn(e,a)}}function JS(e){var t=e.alternate;t!==null&&(e.alternate=null,JS(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&jm(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var pt=null,fa=!1;function Rn(e,t,a){for(a=a.child;a!==null;)e0(e,t,a),a=a.sibling}function e0(e,t,a){if(ka&&typeof ka.onCommitFiberUnmount=="function")try{ka.onCommitFiberUnmount(ts,a)}catch{}switch(a.tag){case 26:Rt||mn(a,t),Rn(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Rt||mn(a,t);var n=pt,r=fa;Nr(a.type)&&(pt=a.stateNode,fa=!1),Rn(e,t,a),Fi(a.stateNode),pt=n,fa=r;break;case 5:Rt||mn(a,t);case 6:if(n=pt,r=fa,pt=null,Rn(e,t,a),pt=n,fa=r,pt!==null)if(fa)try{(pt.nodeType===9?pt.body:pt.nodeName==="HTML"?pt.ownerDocument.body:pt).removeChild(a.stateNode)}catch(o){Ge(a,t,o)}else try{pt.removeChild(a.stateNode)}catch(o){Ge(a,t,o)}break;case 18:pt!==null&&(fa?(e=pt,Gv(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),El(e)):Gv(pt,a.stateNode));break;case 4:n=pt,r=fa,pt=a.stateNode.containerInfo,fa=!0,Rn(e,t,a),pt=n,fa=r;break;case 0:case 11:case 14:case 15:_r(2,a,t),Rt||_r(4,a,t),Rn(e,t,a);break;case 1:Rt||(mn(a,t),n=a.stateNode,typeof n.componentWillUnmount=="function"&&XS(a,t,n)),Rn(e,t,a);break;case 21:Rn(e,t,a);break;case 22:Rt=(n=Rt)||a.memoizedState!==null,Rn(e,t,a),Rt=n;break;default:Rn(e,t,a)}}function t0(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{El(e)}catch(a){Ge(t,t.return,a)}}}function a0(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{El(e)}catch(a){Ge(t,t.return,a)}}function EO(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Ev),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Ev),t;default:throw Error(P(435,e.tag))}}function zu(e,t){var a=EO(e);t.forEach(function(n){if(!a.has(n)){a.add(n);var r=FO.bind(null,e,n);n.then(r,r)}})}function ca(e,t){var a=t.deletions;if(a!==null)for(var n=0;n<a.length;n++){var r=a[n],o=e,l=t,i=l;e:for(;i!==null;){switch(i.tag){case 27:if(Nr(i.type)){pt=i.stateNode,fa=!1;break e}break;case 5:pt=i.stateNode,fa=!1;break e;case 3:case 4:pt=i.stateNode.containerInfo,fa=!0;break e}i=i.return}if(pt===null)throw Error(P(160));e0(o,l,r),pt=null,fa=!1,o=r.alternate,o!==null&&(o.return=null),r.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)n0(t,e),t=t.sibling}var tn=null;function n0(e,t){var a=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ca(t,e),da(e),n&4&&(_r(3,e,e.return),ss(3,e),_r(5,e,e.return));break;case 1:ca(t,e),da(e),n&512&&(Rt||a===null||mn(a,a.return)),n&64&&Pn&&(e=e.updateQueue,e!==null&&(n=e.callbacks,n!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?n:a.concat(n))));break;case 26:var r=tn;if(ca(t,e),da(e),n&512&&(Rt||a===null||mn(a,a.return)),n&4){var o=a!==null?a.memoizedState:null;if(n=e.memoizedState,a===null)if(n===null)if(e.stateNode===null){e:{n=e.type,a=e.memoizedProps,r=r.ownerDocument||r;t:switch(n){case"title":o=r.getElementsByTagName("title")[0],(!o||o[rs]||o[Gt]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=r.createElement(n),r.head.insertBefore(o,r.querySelector("head > title"))),Xt(o,n,a),o[Gt]=e,zt(o),n=o;break e;case"link":var l=Yv("link","href",r).get(n+(a.href||""));if(l){for(var i=0;i<l.length;i++)if(o=l[i],o.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&o.getAttribute("rel")===(a.rel==null?null:a.rel)&&o.getAttribute("title")===(a.title==null?null:a.title)&&o.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){l.splice(i,1);break t}}o=r.createElement(n),Xt(o,n,a),r.head.appendChild(o);break;case"meta":if(l=Yv("meta","content",r).get(n+(a.content||""))){for(i=0;i<l.length;i++)if(o=l[i],o.getAttribute("content")===(a.content==null?null:""+a.content)&&o.getAttribute("name")===(a.name==null?null:a.name)&&o.getAttribute("property")===(a.property==null?null:a.property)&&o.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&o.getAttribute("charset")===(a.charSet==null?null:a.charSet)){l.splice(i,1);break t}}o=r.createElement(n),Xt(o,n,a),r.head.appendChild(o);break;default:throw Error(P(468,n))}o[Gt]=e,zt(o),n=o}e.stateNode=n}else Jv(r,e.type,e.stateNode);else e.stateNode=Qv(r,n,e.memoizedProps);else o!==n?(o===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):o.count--,n===null?Jv(r,e.type,e.stateNode):Qv(r,n,e.memoizedProps)):n===null&&e.stateNode!==null&&_p(e,e.memoizedProps,a.memoizedProps)}break;case 27:ca(t,e),da(e),n&512&&(Rt||a===null||mn(a,a.return)),a!==null&&n&4&&_p(e,e.memoizedProps,a.memoizedProps);break;case 5:if(ca(t,e),da(e),n&512&&(Rt||a===null||mn(a,a.return)),e.flags&32){r=e.stateNode;try{Sl(r,"")}catch(m){Ge(e,e.return,m)}}n&4&&e.stateNode!=null&&(r=e.memoizedProps,_p(e,r,a!==null?a.memoizedProps:r)),n&1024&&(Pp=!0);break;case 6:if(ca(t,e),da(e),n&4){if(e.stateNode===null)throw Error(P(162));n=e.memoizedProps,a=e.stateNode;try{a.nodeValue=n}catch(m){Ge(e,e.return,m)}}break;case 3:if(rc=null,r=tn,tn=Rc(t.containerInfo),ca(t,e),tn=r,da(e),n&4&&a!==null&&a.memoizedState.isDehydrated)try{El(t.containerInfo)}catch(m){Ge(e,e.return,m)}Pp&&(Pp=!1,r0(e));break;case 4:n=tn,tn=Rc(e.stateNode.containerInfo),ca(t,e),da(e),tn=n;break;case 12:ca(t,e),da(e);break;case 31:ca(t,e),da(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,zu(e,n)));break;case 13:ca(t,e),da(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Wc=Ia()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,zu(e,n)));break;case 22:r=e.memoizedState!==null;var s=a!==null&&a.memoizedState!==null,u=Pn,c=Rt;if(Pn=u||r,Rt=c||s,ca(t,e),Rt=c,Pn=u,da(e),n&8192)e:for(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,r&&(a===null||s||Pn||Rt||oo(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){s=a=t;try{if(o=s.stateNode,r)l=o.style,typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none";else{i=s.stateNode;var d=s.memoizedProps.style,f=d!=null&&d.hasOwnProperty("display")?d.display:null;i.style.display=f==null||typeof f=="boolean"?"":(""+f).trim()}}catch(m){Ge(s,s.return,m)}}}else if(t.tag===6){if(a===null){s=t;try{s.stateNode.nodeValue=r?"":s.memoizedProps}catch(m){Ge(s,s.return,m)}}}else if(t.tag===18){if(a===null){s=t;try{var p=s.stateNode;r?$v(p,!0):$v(s.stateNode,!1)}catch(m){Ge(s,s.return,m)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}n&4&&(n=e.updateQueue,n!==null&&(a=n.retryQueue,a!==null&&(n.retryQueue=null,zu(e,a))));break;case 19:ca(t,e),da(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,zu(e,n)));break;case 30:break;case 21:break;default:ca(t,e),da(e)}}function da(e){var t=e.flags;if(t&2){try{for(var a,n=e.return;n!==null;){if(ZS(n)){a=n;break}n=n.return}if(a==null)throw Error(P(160));switch(a.tag){case 27:var r=a.stateNode,o=Op(e);Cc(e,o,r);break;case 5:var l=a.stateNode;a.flags&32&&(Sl(l,""),a.flags&=-33);var i=Op(e);Cc(e,i,l);break;case 3:case 4:var s=a.stateNode.containerInfo,u=Op(e);Sm(e,u,s);break;default:throw Error(P(161))}}catch(c){Ge(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function r0(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;r0(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Dn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)YS(e,t.alternate,t),t=t.sibling}function oo(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:_r(4,t,t.return),oo(t);break;case 1:mn(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&XS(t,t.return,a),oo(t);break;case 27:Fi(t.stateNode);case 26:case 5:mn(t,t.return),oo(t);break;case 22:t.memoizedState===null&&oo(t);break;case 30:oo(t);break;default:oo(t)}e=e.sibling}}function _n(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,r=e,o=t,l=o.flags;switch(o.tag){case 0:case 11:case 15:_n(r,o,a),ss(4,o);break;case 1:if(_n(r,o,a),n=o,r=n.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(u){Ge(n,n.return,u)}if(n=o,r=n.updateQueue,r!==null){var i=n.stateNode;try{var s=r.shared.hiddenCallbacks;if(s!==null)for(r.shared.hiddenCallbacks=null,r=0;r<s.length;r++)tS(s[r],i)}catch(u){Ge(n,n.return,u)}}a&&l&64&&WS(o),Pi(o,o.return);break;case 27:QS(o);case 26:case 5:_n(r,o,a),a&&n===null&&l&4&&KS(o),Pi(o,o.return);break;case 12:_n(r,o,a);break;case 31:_n(r,o,a),a&&l&4&&t0(r,o);break;case 13:_n(r,o,a),a&&l&4&&a0(r,o);break;case 22:o.memoizedState===null&&_n(r,o,a),Pi(o,o.return);break;case 30:break;default:_n(r,o,a)}t=t.sibling}}function bh(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&ls(a))}function Sh(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ls(e))}function en(e,t,a,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)o0(e,t,a,n),t=t.sibling}function o0(e,t,a,n){var r=t.flags;switch(t.tag){case 0:case 11:case 15:en(e,t,a,n),r&2048&&ss(9,t);break;case 1:en(e,t,a,n);break;case 3:en(e,t,a,n),r&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ls(e)));break;case 12:if(r&2048){en(e,t,a,n),e=t.stateNode;try{var o=t.memoizedProps,l=o.id,i=o.onPostCommit;typeof i=="function"&&i(l,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(s){Ge(t,t.return,s)}}else en(e,t,a,n);break;case 31:en(e,t,a,n);break;case 13:en(e,t,a,n);break;case 23:break;case 22:o=t.stateNode,l=t.alternate,t.memoizedState!==null?o._visibility&2?en(e,t,a,n):Ni(e,t):o._visibility&2?en(e,t,a,n):(o._visibility|=2,Jo(e,t,a,n,(t.subtreeFlags&10256)!==0||!1)),r&2048&&bh(l,t);break;case 24:en(e,t,a,n),r&2048&&Sh(t.alternate,t);break;default:en(e,t,a,n)}}function Jo(e,t,a,n,r){for(r=r&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var o=e,l=t,i=a,s=n,u=l.flags;switch(l.tag){case 0:case 11:case 15:Jo(o,l,i,s,r),ss(8,l);break;case 23:break;case 22:var c=l.stateNode;l.memoizedState!==null?c._visibility&2?Jo(o,l,i,s,r):Ni(o,l):(c._visibility|=2,Jo(o,l,i,s,r)),r&&u&2048&&bh(l.alternate,l);break;case 24:Jo(o,l,i,s,r),r&&u&2048&&Sh(l.alternate,l);break;default:Jo(o,l,i,s,r)}t=t.sibling}}function Ni(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,n=t,r=n.flags;switch(n.tag){case 22:Ni(a,n),r&2048&&bh(n.alternate,n);break;case 24:Ni(a,n),r&2048&&Sh(n.alternate,n);break;default:Ni(a,n)}t=t.sibling}}var Li=8192;function Yo(e,t,a){if(e.subtreeFlags&Li)for(e=e.child;e!==null;)l0(e,t,a),e=e.sibling}function l0(e,t,a){switch(e.tag){case 26:Yo(e,t,a),e.flags&Li&&e.memoizedState!==null&&mP(a,tn,e.memoizedState,e.memoizedProps);break;case 5:Yo(e,t,a);break;case 3:case 4:var n=tn;tn=Rc(e.stateNode.containerInfo),Yo(e,t,a),tn=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=Li,Li=16777216,Yo(e,t,a),Li=n):Yo(e,t,a));break;default:Yo(e,t,a)}}function i0(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function xi(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var n=t[a];Ft=n,u0(n,e)}i0(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)s0(e),e=e.sibling}function s0(e){switch(e.tag){case 0:case 11:case 15:xi(e),e.flags&2048&&_r(9,e,e.return);break;case 3:xi(e);break;case 12:xi(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ac(e)):xi(e);break;default:xi(e)}}function ac(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var n=t[a];Ft=n,u0(n,e)}i0(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:_r(8,t,t.return),ac(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,ac(t));break;default:ac(t)}e=e.sibling}}function u0(e,t){for(;Ft!==null;){var a=Ft;switch(a.tag){case 0:case 11:case 15:_r(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var n=a.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:ls(a.memoizedState.cache)}if(n=a.child,n!==null)n.return=a,Ft=n;else e:for(a=e;Ft!==null;){n=Ft;var r=n.sibling,o=n.return;if(JS(n),n===a){Ft=null;break e}if(r!==null){r.return=o,Ft=r;break e}Ft=o}}}var RO={getCacheForType:function(e){var t=Wt(Dt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Wt(Dt).controller.signal}},DO=typeof WeakMap=="function"?WeakMap:Map,Fe=0,at=null,be=null,Se=0,Ve=0,va=null,xr=!1,Pl=!1,Ch=!1,$n=0,xt=0,Or=0,co=0,Ih=0,Ca=0,Ll=0,Bi=null,pa=null,Cm=!1,Wc=0,c0=0,Ic=1/0,kc=null,Lr=null,Pt=0,Tr=null,Tl=null,qn=0,Im=0,km=null,d0=null,Ui=0,Lm=null;function Ta(){return(Fe&2)!==0&&Se!==0?Se&-Se:re.T!==null?Lh():vb()}function f0(){if(Ca===0)if((Se&536870912)===0||Ae){var e=Eu;Eu<<=1,(Eu&3932160)===0&&(Eu=262144),Ca=e}else Ca=536870912;return e=Ma.current,e!==null&&(e.flags|=32),Ca}function ma(e,t,a){(e===at&&(Ve===2||Ve===9)||e.cancelPendingCommit!==null)&&(Al(e,0),vr(e,Se,Ca,!1)),ns(e,a),((Fe&2)===0||e!==at)&&(e===at&&((Fe&2)===0&&(co|=a),xt===4&&vr(e,Se,Ca,!1)),yn(e))}function p0(e,t,a){if((Fe&6)!==0)throw Error(P(327));var n=!a&&(t&127)===0&&(t&e.expiredLanes)===0||as(e,t),r=n?PO(e,t):Np(e,t,!0),o=n;do{if(r===0){Pl&&!n&&vr(e,t,0,!1);break}else{if(a=e.current.alternate,o&&!_O(a)){r=Np(e,t,!1),o=!1;continue}if(r===2){if(o=t,e.errorRecoveryDisabledLanes&o)var l=0;else l=e.pendingLanes&-536870913,l=l!==0?l:l&536870912?536870912:0;if(l!==0){t=l;e:{var i=e;r=Bi;var s=i.current.memoizedState.isDehydrated;if(s&&(Al(i,l).flags|=256),l=Np(i,l,!1),l!==2){if(Ch&&!s){i.errorRecoveryDisabledLanes|=o,co|=o,r=4;break e}o=pa,pa=r,o!==null&&(pa===null?pa=o:pa.push.apply(pa,o))}r=l}if(o=!1,r!==2)continue}}if(r===1){Al(e,0),vr(e,t,0,!0);break}e:{switch(n=e,o=r,o){case 0:case 1:throw Error(P(345));case 4:if((t&4194048)!==t)break;case 6:vr(n,t,Ca,!xr);break e;case 2:pa=null;break;case 3:case 5:break;default:throw Error(P(329))}if((t&62914560)===t&&(r=Wc+300-Ia(),10<r)){if(vr(n,t,Ca,!xr),Nc(n,0,!0)!==0)break e;qn=t,n.timeoutHandle=_0(Rv.bind(null,n,a,pa,kc,Cm,t,Ca,co,Ll,xr,o,"Throttled",-0,0),r);break e}Rv(n,a,pa,kc,Cm,t,Ca,co,Ll,xr,o,null,-0,0)}}break}while(!0);yn(e)}function Rv(e,t,a,n,r,o,l,i,s,u,c,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)===16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Bn},l0(t,o,d);var m=(o&62914560)===o?Wc-Ia():(o&4194048)===o?c0-Ia():0;if(m=hP(d,m),m!==null){qn=o,e.cancelPendingCommit=m(_v.bind(null,e,t,o,a,n,r,l,i,s,c,d,null,f,p)),vr(e,o,l,!u);return}}_v(e,t,o,a,n,r,l,i,s)}function _O(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var n=0;n<a.length;n++){var r=a[n],o=r.getSnapshot;r=r.value;try{if(!Aa(o(),r))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function vr(e,t,a,n){t&=~Ih,t&=~co,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var r=t;0<r;){var o=31-La(r),l=1<<o;n[o]=-1,r&=~l}a!==0&&yb(e,a,t)}function Xc(){return(Fe&6)===0?(us(0,!1),!1):!0}function kh(){if(be!==null){if(Ve===0)var e=be.return;else e=be,Un=bo=null,ch(e),yl=null,$i=0,e=be;for(;e!==null;)$S(e.alternate,e),e=e.return;be=null}}function Al(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,QO(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),qn=0,kh(),at=e,be=a=Fn(e.current,null),Se=t,Ve=0,va=null,xr=!1,Pl=as(e,t),Ch=!1,Ll=Ca=Ih=co=Or=xt=0,pa=Bi=null,Cm=!1,(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-La(n),o=1<<r;t|=e[r],n&=~o}return $n=t,zc(),a}function m0(e,t){ce=null,re.H=Xi,t===Ol||t===Hc?(t=uv(),Ve=3):t===nh?(t=uv(),Ve=4):Ve=t===xh?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,va=t,be===null&&(xt=1,bc(e,Ha(t,e.current)))}function h0(){var e=Ma.current;return e===null?!0:(Se&4194048)===Se?Va===null:(Se&62914560)===Se||(Se&536870912)!==0?e===Va:!1}function g0(){var e=re.H;return re.H=Xi,e===null?Xi:e}function y0(){var e=re.A;return re.A=RO,e}function Lc(){xt=4,xr||(Se&4194048)!==Se&&Ma.current!==null||(Pl=!0),(Or&134217727)===0&&(co&134217727)===0||at===null||vr(at,Se,Ca,!1)}function Np(e,t,a){var n=Fe;Fe|=2;var r=g0(),o=y0();(at!==e||Se!==t)&&(kc=null,Al(e,t)),t=!1;var l=xt;e:do try{if(Ve!==0&&be!==null){var i=be,s=va;switch(Ve){case 8:kh(),l=6;break e;case 3:case 2:case 9:case 6:Ma.current===null&&(t=!0);var u=Ve;if(Ve=0,va=null,fl(e,i,s,u),a&&Pl){l=0;break e}break;default:u=Ve,Ve=0,va=null,fl(e,i,s,u)}}OO(),l=xt;break}catch(c){m0(e,c)}while(!0);return t&&e.shellSuspendCounter++,Un=bo=null,Fe=n,re.H=r,re.A=o,be===null&&(at=null,Se=0,zc()),l}function OO(){for(;be!==null;)w0(be)}function PO(e,t){var a=Fe;Fe|=2;var n=g0(),r=y0();at!==e||Se!==t?(kc=null,Ic=Ia()+500,Al(e,t)):Pl=as(e,t);e:do try{if(Ve!==0&&be!==null){t=be;var o=va;t:switch(Ve){case 1:Ve=0,va=null,fl(e,t,o,1);break;case 2:case 9:if(sv(o)){Ve=0,va=null,Dv(t);break}t=function(){Ve!==2&&Ve!==9||at!==e||(Ve=7),yn(e)},o.then(t,t);break e;case 3:Ve=7;break e;case 4:Ve=5;break e;case 7:sv(o)?(Ve=0,va=null,Dv(t)):(Ve=0,va=null,fl(e,t,o,7));break;case 5:var l=null;switch(be.tag){case 26:l=be.memoizedState;case 5:case 27:var i=be;if(l?U0(l):i.stateNode.complete){Ve=0,va=null;var s=i.sibling;if(s!==null)be=s;else{var u=i.return;u!==null?(be=u,Kc(u)):be=null}break t}}Ve=0,va=null,fl(e,t,o,5);break;case 6:Ve=0,va=null,fl(e,t,o,6);break;case 8:kh(),xt=6;break e;default:throw Error(P(462))}}NO();break}catch(c){m0(e,c)}while(!0);return Un=bo=null,re.H=n,re.A=r,Fe=a,be!==null?0:(at=null,Se=0,zc(),xt)}function NO(){for(;be!==null&&!o_();)w0(be)}function w0(e){var t=GS(e.alternate,e,$n);e.memoizedProps=e.pendingProps,t===null?Kc(e):be=t}function Dv(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=kv(a,t,t.pendingProps,t.type,void 0,Se);break;case 11:t=kv(a,t,t.pendingProps,t.type.render,t.ref,Se);break;case 5:ch(t);default:$S(a,t),t=be=$b(t,$n),t=GS(a,t,$n)}e.memoizedProps=e.pendingProps,t===null?Kc(e):be=t}function fl(e,t,a,n){Un=bo=null,ch(t),yl=null,$i=0;var r=t.return;try{if(IO(e,r,t,a,Se)){xt=1,bc(e,Ha(a,e.current)),be=null;return}}catch(o){if(r!==null)throw be=r,o;xt=1,bc(e,Ha(a,e.current)),be=null;return}t.flags&32768?(Ae||n===1?e=!0:Pl||(Se&536870912)!==0?e=!1:(xr=e=!0,(n===2||n===9||n===3||n===6)&&(n=Ma.current,n!==null&&n.tag===13&&(n.flags|=16384))),x0(t,e)):Kc(t)}function Kc(e){var t=e;do{if((t.flags&32768)!==0){x0(t,xr);return}e=t.return;var a=TO(t.alternate,t,$n);if(a!==null){be=a;return}if(t=t.sibling,t!==null){be=t;return}be=t=e}while(t!==null);xt===0&&(xt=5)}function x0(e,t){do{var a=AO(e.alternate,e);if(a!==null){a.flags&=32767,be=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){be=e;return}be=e=a}while(e!==null);xt=6,be=null}function _v(e,t,a,n,r,o,l,i,s){e.cancelPendingCommit=null;do Zc();while(Pt!==0);if((Fe&6)!==0)throw Error(P(327));if(t!==null){if(t===e.current)throw Error(P(177));if(o=t.lanes|t.childLanes,o|=Zm,h_(e,a,o,l,i,s),e===at&&(be=at=null,Se=0),Tl=t,Tr=e,qn=a,Im=o,km=r,d0=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,zO(cc,function(){return I0(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=re.T,re.T=null,r=ze.p,ze.p=2,l=Fe,Fe|=4;try{MO(e,t,a)}finally{Fe=l,ze.p=r,re.T=n}}Pt=1,v0(),b0(),S0()}}function v0(){if(Pt===1){Pt=0;var e=Tr,t=Tl,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=re.T,re.T=null;var n=ze.p;ze.p=2;var r=Fe;Fe|=4;try{n0(t,e);var o=Em,l=Ub(e.containerInfo),i=o.focusedElem,s=o.selectionRange;if(l!==i&&i&&i.ownerDocument&&Bb(i.ownerDocument.documentElement,i)){if(s!==null&&Km(i)){var u=s.start,c=s.end;if(c===void 0&&(c=u),"selectionStart"in i)i.selectionStart=u,i.selectionEnd=Math.min(c,i.value.length);else{var d=i.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=i.textContent.length,x=Math.min(s.start,m),v=s.end===void 0?x:Math.min(s.end,m);!p.extend&&x>v&&(l=v,v=x,x=l);var y=tv(i,x),w=tv(i,v);if(y&&w&&(p.rangeCount!==1||p.anchorNode!==y.node||p.anchorOffset!==y.offset||p.focusNode!==w.node||p.focusOffset!==w.offset)){var g=d.createRange();g.setStart(y.node,y.offset),p.removeAllRanges(),x>v?(p.addRange(g),p.extend(w.node,w.offset)):(g.setEnd(w.node,w.offset),p.addRange(g))}}}}for(d=[],p=i;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;i<d.length;i++){var C=d[i];C.element.scrollLeft=C.left,C.element.scrollTop=C.top}}Oc=!!Mm,Em=Mm=null}finally{Fe=r,ze.p=n,re.T=a}}e.current=t,Pt=2}}function b0(){if(Pt===2){Pt=0;var e=Tr,t=Tl,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=re.T,re.T=null;var n=ze.p;ze.p=2;var r=Fe;Fe|=4;try{YS(e,t.alternate,t)}finally{Fe=r,ze.p=n,re.T=a}}Pt=3}}function S0(){if(Pt===4||Pt===3){Pt=0,l_();var e=Tr,t=Tl,a=qn,n=d0;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Pt=5:(Pt=0,Tl=Tr=null,C0(e,e.pendingLanes));var r=e.pendingLanes;if(r===0&&(Lr=null),Hm(a),t=t.stateNode,ka&&typeof ka.onCommitFiberRoot=="function")try{ka.onCommitFiberRoot(ts,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=re.T,r=ze.p,ze.p=2,re.T=null;try{for(var o=e.onRecoverableError,l=0;l<n.length;l++){var i=n[l];o(i.value,{componentStack:i.stack})}}finally{re.T=t,ze.p=r}}(qn&3)!==0&&Zc(),yn(e),r=e.pendingLanes,(a&261930)!==0&&(r&42)!==0?e===Lm?Ui++:(Ui=0,Lm=e):Ui=0,us(0,!1)}}function C0(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ls(t)))}function Zc(){return v0(),b0(),S0(),I0()}function I0(){if(Pt!==5)return!1;var e=Tr,t=Im;Im=0;var a=Hm(qn),n=re.T,r=ze.p;try{ze.p=32>a?32:a,re.T=null,a=km,km=null;var o=Tr,l=qn;if(Pt=0,Tl=Tr=null,qn=0,(Fe&6)!==0)throw Error(P(331));var i=Fe;if(Fe|=4,s0(o.current),o0(o,o.current,l,a),Fe=i,us(0,!1),ka&&typeof ka.onPostCommitFiberRoot=="function")try{ka.onPostCommitFiberRoot(ts,o)}catch{}return!0}finally{ze.p=r,re.T=n,C0(e,t)}}function Ov(e,t,a){t=Ha(a,t),t=xm(e.stateNode,t,2),e=kr(e,t,2),e!==null&&(ns(e,2),yn(e))}function Ge(e,t,a){if(e.tag===3)Ov(e,e,a);else for(;t!==null;){if(t.tag===3){Ov(t,e,a);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Lr===null||!Lr.has(n))){e=Ha(a,e),a=FS(2),n=kr(t,a,2),n!==null&&(zS(a,n,t,e),ns(n,2),yn(n));break}}t=t.return}}function Bp(e,t,a){var n=e.pingCache;if(n===null){n=e.pingCache=new DO;var r=new Set;n.set(t,r)}else r=n.get(t),r===void 0&&(r=new Set,n.set(t,r));r.has(a)||(Ch=!0,r.add(a),e=BO.bind(null,e,t,a),t.then(e,e))}function BO(e,t,a){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,at===e&&(Se&a)===a&&(xt===4||xt===3&&(Se&62914560)===Se&&300>Ia()-Wc?(Fe&2)===0&&Al(e,0):Ih|=a,Ll===Se&&(Ll=0)),yn(e)}function k0(e,t){t===0&&(t=gb()),e=vo(e,t),e!==null&&(ns(e,t),yn(e))}function UO(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),k0(e,a)}function FO(e,t){var a=0;switch(e.tag){case 31:case 13:var n=e.stateNode,r=e.memoizedState;r!==null&&(a=r.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(P(314))}n!==null&&n.delete(t),k0(e,a)}function zO(e,t){return zm(e,t)}var Tc=null,el=null,Tm=!1,Ac=!1,Up=!1,br=0;function yn(e){e!==el&&e.next===null&&(el===null?Tc=el=e:el=el.next=e),Ac=!0,Tm||(Tm=!0,HO())}function us(e,t){if(!Up&&Ac){Up=!0;do for(var a=!1,n=Tc;n!==null;){if(!t)if(e!==0){var r=n.pendingLanes;if(r===0)var o=0;else{var l=n.suspendedLanes,i=n.pingedLanes;o=(1<<31-La(42|e)+1)-1,o&=r&~(l&~i),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(a=!0,Pv(n,o))}else o=Se,o=Nc(n,n===at?o:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(o&3)===0||as(n,o)||(a=!0,Pv(n,o));n=n.next}while(a);Up=!1}}function qO(){L0()}function L0(){Ac=Tm=!1;var e=0;br!==0&&ZO()&&(e=br);for(var t=Ia(),a=null,n=Tc;n!==null;){var r=n.next,o=T0(n,t);o===0?(n.next=null,a===null?Tc=r:a.next=r,r===null&&(el=a)):(a=n,(e!==0||(o&3)!==0)&&(Ac=!0)),n=r}Pt!==0&&Pt!==5||us(e,!1),br!==0&&(br=0)}function T0(e,t){for(var a=e.suspendedLanes,n=e.pingedLanes,r=e.expirationTimes,o=e.pendingLanes&-62914561;0<o;){var l=31-La(o),i=1<<l,s=r[l];s===-1?((i&a)===0||(i&n)!==0)&&(r[l]=m_(i,t)):s<=t&&(e.expiredLanes|=i),o&=~i}if(t=at,a=Se,a=Nc(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,a===0||e===t&&(Ve===2||Ve===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&pp(n),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||as(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(n!==null&&pp(n),Hm(a)){case 2:case 8:a=mb;break;case 32:a=cc;break;case 268435456:a=hb;break;default:a=cc}return n=A0.bind(null,e),a=zm(a,n),e.callbackPriority=t,e.callbackNode=a,t}return n!==null&&n!==null&&pp(n),e.callbackPriority=2,e.callbackNode=null,2}function A0(e,t){if(Pt!==0&&Pt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Zc()&&e.callbackNode!==a)return null;var n=Se;return n=Nc(e,e===at?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(p0(e,n,t),T0(e,Ia()),e.callbackNode!=null&&e.callbackNode===a?A0.bind(null,e):null)}function Pv(e,t){if(Zc())return null;p0(e,t,!0)}function HO(){YO(function(){(Fe&6)!==0?zm(pb,qO):L0()})}function Lh(){if(br===0){var e=Cl;e===0&&(e=Mu,Mu<<=1,(Mu&261888)===0&&(Mu=256)),br=e}return br}function Nv(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Wu(""+e)}function Bv(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function jO(e,t,a,n,r){if(t==="submit"&&a&&a.stateNode===r){var o=Nv((r[ha]||null).action),l=n.submitter;l&&(t=(t=l[ha]||null)?Nv(t.formAction):l.getAttribute("formAction"),t!==null&&(o=t,l=null));var i=new Bc("action","action",null,n,r);e.push({event:i,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(br!==0){var s=l?Bv(r,l):new FormData(r);ym(a,{pending:!0,data:s,method:r.method,action:o},null,s)}}else typeof o=="function"&&(i.preventDefault(),s=l?Bv(r,l):new FormData(r),ym(a,{pending:!0,data:s,method:r.method,action:o},o,s))},currentTarget:r}]})}}for(qu=0;qu<om.length;qu++)Hu=om[qu],Uv=Hu.toLowerCase(),Fv=Hu[0].toUpperCase()+Hu.slice(1),an(Uv,"on"+Fv);var Hu,Uv,Fv,qu;an(zb,"onAnimationEnd");an(qb,"onAnimationIteration");an(Hb,"onAnimationStart");an("dblclick","onDoubleClick");an("focusin","onFocus");an("focusout","onBlur");an(iO,"onTransitionRun");an(sO,"onTransitionStart");an(uO,"onTransitionCancel");an(jb,"onTransitionEnd");bl("onMouseEnter",["mouseout","mouseover"]);bl("onMouseLeave",["mouseout","mouseover"]);bl("onPointerEnter",["pointerout","pointerover"]);bl("onPointerLeave",["pointerout","pointerover"]);yo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));yo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));yo("onBeforeInput",["compositionend","keypress","textInput","paste"]);yo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));yo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));yo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ki="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(" "),VO=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ki));function M0(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var n=e[a],r=n.event;n=n.listeners;e:{var o=void 0;if(t)for(var l=n.length-1;0<=l;l--){var i=n[l],s=i.instance,u=i.currentTarget;if(i=i.listener,s!==o&&r.isPropagationStopped())break e;o=i,r.currentTarget=u;try{o(r)}catch(c){fc(c)}r.currentTarget=null,o=s}else for(l=0;l<n.length;l++){if(i=n[l],s=i.instance,u=i.currentTarget,i=i.listener,s!==o&&r.isPropagationStopped())break e;o=i,r.currentTarget=u;try{o(r)}catch(c){fc(c)}r.currentTarget=null,o=s}}}}function ve(e,t){var a=t[Qp];a===void 0&&(a=t[Qp]=new Set);var n=e+"__bubble";a.has(n)||(E0(t,e,2,!1),a.add(n))}function Fp(e,t,a){var n=0;t&&(n|=4),E0(a,e,n,t)}var ju="_reactListening"+Math.random().toString(36).slice(2);function Th(e){if(!e[ju]){e[ju]=!0,bb.forEach(function(a){a!=="selectionchange"&&(VO.has(a)||Fp(a,!1,e),Fp(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ju]||(t[ju]=!0,Fp("selectionchange",!1,t))}}function E0(e,t,a,n){switch(j0(t)){case 2:var r=wP;break;case 8:r=xP;break;default:r=Rh}a=r.bind(null,t,a,e),r=void 0,!am||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),n?r!==void 0?e.addEventListener(t,a,{capture:!0,passive:r}):e.addEventListener(t,a,!0):r!==void 0?e.addEventListener(t,a,{passive:r}):e.addEventListener(t,a,!1)}function zp(e,t,a,n,r){var o=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var l=n.tag;if(l===3||l===4){var i=n.stateNode.containerInfo;if(i===r)break;if(l===4)for(l=n.return;l!==null;){var s=l.tag;if((s===3||s===4)&&l.stateNode.containerInfo===r)return;l=l.return}for(;i!==null;){if(l=nl(i),l===null)return;if(s=l.tag,s===5||s===6||s===26||s===27){n=o=l;continue e}i=i.parentNode}}n=n.return}Mb(function(){var u=o,c=Gm(a),d=[];e:{var f=Vb.get(e);if(f!==void 0){var p=Bc,m=e;switch(e){case"keypress":if(Ku(a)===0)break e;case"keydown":case"keyup":p=F_;break;case"focusin":m="focus",p=wp;break;case"focusout":m="blur",p=wp;break;case"beforeblur":case"afterblur":p=wp;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=$x;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=T_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=H_;break;case zb:case qb:case Hb:p=E_;break;case jb:p=V_;break;case"scroll":case"scrollend":p=k_;break;case"wheel":p=$_;break;case"copy":case"cut":case"paste":p=D_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=Xx;break;case"toggle":case"beforetoggle":p=X_}var x=(t&4)!==0,v=!x&&(e==="scroll"||e==="scrollend"),y=x?f!==null?f+"Capture":null:f;x=[];for(var w=u,g;w!==null;){var C=w;if(g=C.stateNode,C=C.tag,C!==5&&C!==26&&C!==27||g===null||y===null||(C=qi(w,y),C!=null&&x.push(Zi(w,C,g))),v)break;w=w.return}0<x.length&&(f=new p(f,m,null,a,c),d.push({event:f,listeners:x}))}}if((t&7)===0){e:{if(f=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",f&&a!==tm&&(m=a.relatedTarget||a.fromElement)&&(nl(m)||m[Rl]))break e;if((p||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,p?(m=a.relatedTarget||a.toElement,p=u,m=m?nl(m):null,m!==null&&(v=es(m),x=m.tag,m!==v||x!==5&&x!==27&&x!==6)&&(m=null)):(p=null,m=u),p!==m)){if(x=$x,C="onMouseLeave",y="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(x=Xx,C="onPointerLeave",y="onPointerEnter",w="pointer"),v=p==null?f:Ii(p),g=m==null?f:Ii(m),f=new x(C,w+"leave",p,a,c),f.target=v,f.relatedTarget=g,C=null,nl(c)===u&&(x=new x(y,w+"enter",m,a,c),x.target=g,x.relatedTarget=v,C=x),v=C,p&&m)t:{for(x=GO,y=p,w=m,g=0,C=y;C;C=x(C))g++;C=0;for(var A=w;A;A=x(A))C++;for(;0<g-C;)y=x(y),g--;for(;0<C-g;)w=x(w),C--;for(;g--;){if(y===w||w!==null&&y===w.alternate){x=y;break t}y=x(y),w=x(w)}x=null}else x=null;p!==null&&zv(d,f,p,x,!1),m!==null&&v!==null&&zv(d,v,m,x,!0)}}e:{if(f=u?Ii(u):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var S=Yx;else if(Qx(f))if(Pb)S=rO;else{S=aO;var M=tO}else p=f.nodeName,!p||p.toLowerCase()!=="input"||f.type!=="checkbox"&&f.type!=="radio"?u&&Vm(u.elementType)&&(S=Yx):S=nO;if(S&&(S=S(e,u))){Ob(d,S,a,c);break e}M&&M(e,f,u),e==="focusout"&&u&&f.type==="number"&&u.memoizedProps.value!=null&&em(f,"number",f.value)}switch(M=u?Ii(u):window,e){case"focusin":(Qx(M)||M.contentEditable==="true")&&(ll=M,nm=u,Mi=null);break;case"focusout":Mi=nm=ll=null;break;case"mousedown":rm=!0;break;case"contextmenu":case"mouseup":case"dragend":rm=!1,av(d,a,c);break;case"selectionchange":if(lO)break;case"keydown":case"keyup":av(d,a,c)}var R;if(Xm)e:{switch(e){case"compositionstart":var D="onCompositionStart";break e;case"compositionend":D="onCompositionEnd";break e;case"compositionupdate":D="onCompositionUpdate";break e}D=void 0}else ol?Db(e,a)&&(D="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(D="onCompositionStart");D&&(Rb&&a.locale!=="ko"&&(ol||D!=="onCompositionStart"?D==="onCompositionEnd"&&ol&&(R=Eb()):(wr=c,$m="value"in wr?wr.value:wr.textContent,ol=!0)),M=Mc(u,D),0<M.length&&(D=new Wx(D,e,null,a,c),d.push({event:D,listeners:M}),R?D.data=R:(R=_b(a),R!==null&&(D.data=R)))),(R=Z_?Q_(e,a):Y_(e,a))&&(D=Mc(u,"onBeforeInput"),0<D.length&&(M=new Wx("onBeforeInput","beforeinput",null,a,c),d.push({event:M,listeners:D}),M.data=R)),jO(d,e,u,a,c)}M0(d,t)})}function Zi(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Mc(e,t){for(var a=t+"Capture",n=[];e!==null;){var r=e,o=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||o===null||(r=qi(e,a),r!=null&&n.unshift(Zi(e,r,o)),r=qi(e,t),r!=null&&n.push(Zi(e,r,o))),e.tag===3)return n;e=e.return}return[]}function GO(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function zv(e,t,a,n,r){for(var o=t._reactName,l=[];a!==null&&a!==n;){var i=a,s=i.alternate,u=i.stateNode;if(i=i.tag,s!==null&&s===n)break;i!==5&&i!==26&&i!==27||u===null||(s=u,r?(u=qi(a,o),u!=null&&l.unshift(Zi(a,u,s))):r||(u=qi(a,o),u!=null&&l.push(Zi(a,u,s)))),a=a.return}l.length!==0&&e.push({event:t,listeners:l})}var $O=/\r\n?/g,WO=/\u0000|\uFFFD/g;function qv(e){return(typeof e=="string"?e:""+e).replace($O,`
|
|
9
|
+
`).replace(WO,"")}function R0(e,t){return t=qv(t),qv(e)===t}function Qe(e,t,a,n,r,o){switch(a){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||Sl(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&Sl(e,""+n);break;case"className":Du(e,"class",n);break;case"tabIndex":Du(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":Du(e,a,n);break;case"style":Ab(e,n,o);break;case"data":if(t!=="object"){Du(e,"data",n);break}case"src":case"href":if(n===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=Wu(""+n),e.setAttribute(a,n);break;case"action":case"formAction":if(typeof n=="function"){e.setAttribute(a,"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 o=="function"&&(a==="formAction"?(t!=="input"&&Qe(e,t,"name",r.name,r,null),Qe(e,t,"formEncType",r.formEncType,r,null),Qe(e,t,"formMethod",r.formMethod,r,null),Qe(e,t,"formTarget",r.formTarget,r,null)):(Qe(e,t,"encType",r.encType,r,null),Qe(e,t,"method",r.method,r,null),Qe(e,t,"target",r.target,r,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=Wu(""+n),e.setAttribute(a,n);break;case"onClick":n!=null&&(e.onclick=Bn);break;case"onScroll":n!=null&&ve("scroll",e);break;case"onScrollEnd":n!=null&&ve("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(P(61));if(a=n.__html,a!=null){if(r.children!=null)throw Error(P(60));e.innerHTML=a}}break;case"multiple":e.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":e.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){e.removeAttribute("xlink:href");break}a=Wu(""+n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""+n):e.removeAttribute(a);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":n&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":n===!0?e.setAttribute(a,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,n):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(a,n):e.removeAttribute(a);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?e.removeAttribute(a):e.setAttribute(a,n);break;case"popover":ve("beforetoggle",e),ve("toggle",e),$u(e,"popover",n);break;case"xlinkActuate":Mn(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":Mn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":Mn(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":Mn(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":Mn(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":Mn(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":Mn(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":Mn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":Mn(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":$u(e,"is",n);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=C_.get(a)||a,$u(e,a,n))}}function Am(e,t,a,n,r,o){switch(a){case"style":Ab(e,n,o);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(P(61));if(a=n.__html,a!=null){if(r.children!=null)throw Error(P(60));e.innerHTML=a}}break;case"children":typeof n=="string"?Sl(e,n):(typeof n=="number"||typeof n=="bigint")&&Sl(e,""+n);break;case"onScroll":n!=null&&ve("scroll",e);break;case"onScrollEnd":n!=null&&ve("scrollend",e);break;case"onClick":n!=null&&(e.onclick=Bn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Sb.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(r=a.endsWith("Capture"),t=a.slice(2,r?a.length-7:void 0),o=e[ha]||null,o=o!=null?o[a]:null,typeof o=="function"&&e.removeEventListener(t,o,r),typeof n=="function")){typeof o!="function"&&o!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,n,r);break e}a in e?e[a]=n:n===!0?e.setAttribute(a,""):$u(e,a,n)}}}function Xt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ve("error",e),ve("load",e);var n=!1,r=!1,o;for(o in a)if(a.hasOwnProperty(o)){var l=a[o];if(l!=null)switch(o){case"src":n=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(P(137,t));default:Qe(e,t,o,l,a,null)}}r&&Qe(e,t,"srcSet",a.srcSet,a,null),n&&Qe(e,t,"src",a.src,a,null);return;case"input":ve("invalid",e);var i=o=l=r=null,s=null,u=null;for(n in a)if(a.hasOwnProperty(n)){var c=a[n];if(c!=null)switch(n){case"name":r=c;break;case"type":l=c;break;case"checked":s=c;break;case"defaultChecked":u=c;break;case"value":o=c;break;case"defaultValue":i=c;break;case"children":case"dangerouslySetInnerHTML":if(c!=null)throw Error(P(137,t));break;default:Qe(e,t,n,c,a,null)}}kb(e,o,i,s,u,l,r,!1);return;case"select":ve("invalid",e),n=l=o=null;for(r in a)if(a.hasOwnProperty(r)&&(i=a[r],i!=null))switch(r){case"value":o=i;break;case"defaultValue":l=i;break;case"multiple":n=i;default:Qe(e,t,r,i,a,null)}t=o,a=l,e.multiple=!!n,t!=null?ml(e,!!n,t,!1):a!=null&&ml(e,!!n,a,!0);return;case"textarea":ve("invalid",e),o=r=n=null;for(l in a)if(a.hasOwnProperty(l)&&(i=a[l],i!=null))switch(l){case"value":n=i;break;case"defaultValue":r=i;break;case"children":o=i;break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(P(91));break;default:Qe(e,t,l,i,a,null)}Tb(e,n,r,o);return;case"option":for(s in a)a.hasOwnProperty(s)&&(n=a[s],n!=null)&&(s==="selected"?e.selected=n&&typeof n!="function"&&typeof n!="symbol":Qe(e,t,s,n,a,null));return;case"dialog":ve("beforetoggle",e),ve("toggle",e),ve("cancel",e),ve("close",e);break;case"iframe":case"object":ve("load",e);break;case"video":case"audio":for(n=0;n<Ki.length;n++)ve(Ki[n],e);break;case"image":ve("error",e),ve("load",e);break;case"details":ve("toggle",e);break;case"embed":case"source":case"link":ve("error",e),ve("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(u in a)if(a.hasOwnProperty(u)&&(n=a[u],n!=null))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(P(137,t));default:Qe(e,t,u,n,a,null)}return;default:if(Vm(t)){for(c in a)a.hasOwnProperty(c)&&(n=a[c],n!==void 0&&Am(e,t,c,n,a,void 0));return}}for(i in a)a.hasOwnProperty(i)&&(n=a[i],n!=null&&Qe(e,t,i,n,a,null))}function XO(e,t,a,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,o=null,l=null,i=null,s=null,u=null,c=null;for(p in a){var d=a[p];if(a.hasOwnProperty(p)&&d!=null)switch(p){case"checked":break;case"value":break;case"defaultValue":s=d;default:n.hasOwnProperty(p)||Qe(e,t,p,null,n,d)}}for(var f in n){var p=n[f];if(d=a[f],n.hasOwnProperty(f)&&(p!=null||d!=null))switch(f){case"type":o=p;break;case"name":r=p;break;case"checked":u=p;break;case"defaultChecked":c=p;break;case"value":l=p;break;case"defaultValue":i=p;break;case"children":case"dangerouslySetInnerHTML":if(p!=null)throw Error(P(137,t));break;default:p!==d&&Qe(e,t,f,p,n,d)}}Jp(e,l,i,s,u,c,o,r);return;case"select":p=l=i=f=null;for(o in a)if(s=a[o],a.hasOwnProperty(o)&&s!=null)switch(o){case"value":break;case"multiple":p=s;default:n.hasOwnProperty(o)||Qe(e,t,o,null,n,s)}for(r in n)if(o=n[r],s=a[r],n.hasOwnProperty(r)&&(o!=null||s!=null))switch(r){case"value":f=o;break;case"defaultValue":i=o;break;case"multiple":l=o;default:o!==s&&Qe(e,t,r,o,n,s)}t=i,a=l,n=p,f!=null?ml(e,!!a,f,!1):!!n!=!!a&&(t!=null?ml(e,!!a,t,!0):ml(e,!!a,a?[]:"",!1));return;case"textarea":p=f=null;for(i in a)if(r=a[i],a.hasOwnProperty(i)&&r!=null&&!n.hasOwnProperty(i))switch(i){case"value":break;case"children":break;default:Qe(e,t,i,null,n,r)}for(l in n)if(r=n[l],o=a[l],n.hasOwnProperty(l)&&(r!=null||o!=null))switch(l){case"value":f=r;break;case"defaultValue":p=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(P(91));break;default:r!==o&&Qe(e,t,l,r,n,o)}Lb(e,f,p);return;case"option":for(var m in a)f=a[m],a.hasOwnProperty(m)&&f!=null&&!n.hasOwnProperty(m)&&(m==="selected"?e.selected=!1:Qe(e,t,m,null,n,f));for(s in n)f=n[s],p=a[s],n.hasOwnProperty(s)&&f!==p&&(f!=null||p!=null)&&(s==="selected"?e.selected=f&&typeof f!="function"&&typeof f!="symbol":Qe(e,t,s,f,n,p));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 x in a)f=a[x],a.hasOwnProperty(x)&&f!=null&&!n.hasOwnProperty(x)&&Qe(e,t,x,null,n,f);for(u in n)if(f=n[u],p=a[u],n.hasOwnProperty(u)&&f!==p&&(f!=null||p!=null))switch(u){case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(P(137,t));break;default:Qe(e,t,u,f,n,p)}return;default:if(Vm(t)){for(var v in a)f=a[v],a.hasOwnProperty(v)&&f!==void 0&&!n.hasOwnProperty(v)&&Am(e,t,v,void 0,n,f);for(c in n)f=n[c],p=a[c],!n.hasOwnProperty(c)||f===p||f===void 0&&p===void 0||Am(e,t,c,f,n,p);return}}for(var y in a)f=a[y],a.hasOwnProperty(y)&&f!=null&&!n.hasOwnProperty(y)&&Qe(e,t,y,null,n,f);for(d in n)f=n[d],p=a[d],!n.hasOwnProperty(d)||f===p||f==null&&p==null||Qe(e,t,d,f,n,p)}function Hv(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function KO(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),n=0;n<a.length;n++){var r=a[n],o=r.transferSize,l=r.initiatorType,i=r.duration;if(o&&i&&Hv(l)){for(l=0,i=r.responseEnd,n+=1;n<a.length;n++){var s=a[n],u=s.startTime;if(u>i)break;var c=s.transferSize,d=s.initiatorType;c&&Hv(d)&&(s=s.responseEnd,l+=c*(s<i?1:(i-u)/(s-u)))}if(--n,t+=8*(o+l)/(r.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Mm=null,Em=null;function Ec(e){return e.nodeType===9?e:e.ownerDocument}function jv(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function D0(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Rm(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var qp=null;function ZO(){var e=window.event;return e&&e.type==="popstate"?e===qp?!1:(qp=e,!0):(qp=null,!1)}var _0=typeof setTimeout=="function"?setTimeout:void 0,QO=typeof clearTimeout=="function"?clearTimeout:void 0,Vv=typeof Promise=="function"?Promise:void 0,YO=typeof queueMicrotask=="function"?queueMicrotask:typeof Vv<"u"?function(e){return Vv.resolve(null).then(e).catch(JO)}:_0;function JO(e){setTimeout(function(){throw e})}function Nr(e){return e==="head"}function Gv(e,t){var a=t,n=0;do{var r=a.nextSibling;if(e.removeChild(a),r&&r.nodeType===8)if(a=r.data,a==="/$"||a==="/&"){if(n===0){e.removeChild(r),El(t);return}n--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")n++;else if(a==="html")Fi(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,Fi(a);for(var o=a.firstChild;o;){var l=o.nextSibling,i=o.nodeName;o[rs]||i==="SCRIPT"||i==="STYLE"||i==="LINK"&&o.rel.toLowerCase()==="stylesheet"||a.removeChild(o),o=l}}else a==="body"&&Fi(e.ownerDocument.body);a=r}while(a);El(t)}function $v(e,t){var a=e;e=0;do{var n=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),n&&n.nodeType===8)if(a=n.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=n}while(a)}function Dm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Dm(a),jm(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function eP(e,t,a,n){for(;e.nodeType===1;){var r=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[rs])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(o=e.getAttribute("rel"),o==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(o!==r.rel||e.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(o=e.getAttribute("src"),(o!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&o&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var o=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===o)return e}else return e;if(e=Ga(e.nextSibling),e===null)break}return null}function tP(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=Ga(e.nextSibling),e===null))return null;return e}function O0(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Ga(e.nextSibling),e===null))return null;return e}function _m(e){return e.data==="$?"||e.data==="$~"}function Om(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function aP(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var n=function(){t(),a.removeEventListener("DOMContentLoaded",n)};a.addEventListener("DOMContentLoaded",n),e._reactRetry=n}}function Ga(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Pm=null;function Wv(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return Ga(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function Xv(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function P0(e,t,a){switch(t=Ec(a),e){case"html":if(e=t.documentElement,!e)throw Error(P(452));return e;case"head":if(e=t.head,!e)throw Error(P(453));return e;case"body":if(e=t.body,!e)throw Error(P(454));return e;default:throw Error(P(451))}}function Fi(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);jm(e)}var $a=new Map,Kv=new Set;function Rc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Wn=ze.d;ze.d={f:nP,r:rP,D:oP,C:lP,L:iP,m:sP,X:cP,S:uP,M:dP};function nP(){var e=Wn.f(),t=Xc();return e||t}function rP(e){var t=Dl(e);t!==null&&t.tag===5&&t.type==="form"?AS(t):Wn.r(e)}var Nl=typeof document>"u"?null:document;function N0(e,t,a){var n=Nl;if(n&&typeof t=="string"&&t){var r=qa(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof a=="string"&&(r+='[crossorigin="'+a+'"]'),Kv.has(r)||(Kv.add(r),e={rel:e,crossOrigin:a,href:t},n.querySelector(r)===null&&(t=n.createElement("link"),Xt(t,"link",e),zt(t),n.head.appendChild(t)))}}function oP(e){Wn.D(e),N0("dns-prefetch",e,null)}function lP(e,t){Wn.C(e,t),N0("preconnect",e,t)}function iP(e,t,a){Wn.L(e,t,a);var n=Nl;if(n&&e&&t){var r='link[rel="preload"][as="'+qa(t)+'"]';t==="image"&&a&&a.imageSrcSet?(r+='[imagesrcset="'+qa(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(r+='[imagesizes="'+qa(a.imageSizes)+'"]')):r+='[href="'+qa(e)+'"]';var o=r;switch(t){case"style":o=Ml(e);break;case"script":o=Bl(e)}$a.has(o)||(e=ct({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),$a.set(o,e),n.querySelector(r)!==null||t==="style"&&n.querySelector(cs(o))||t==="script"&&n.querySelector(ds(o))||(t=n.createElement("link"),Xt(t,"link",e),zt(t),n.head.appendChild(t)))}}function sP(e,t){Wn.m(e,t);var a=Nl;if(a&&e){var n=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+qa(n)+'"][href="'+qa(e)+'"]',o=r;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=Bl(e)}if(!$a.has(o)&&(e=ct({rel:"modulepreload",href:e},t),$a.set(o,e),a.querySelector(r)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(ds(o)))return}n=a.createElement("link"),Xt(n,"link",e),zt(n),a.head.appendChild(n)}}}function uP(e,t,a){Wn.S(e,t,a);var n=Nl;if(n&&e){var r=pl(n).hoistableStyles,o=Ml(e);t=t||"default";var l=r.get(o);if(!l){var i={loading:0,preload:null};if(l=n.querySelector(cs(o)))i.loading=5;else{e=ct({rel:"stylesheet",href:e,"data-precedence":t},a),(a=$a.get(o))&&Ah(e,a);var s=l=n.createElement("link");zt(s),Xt(s,"link",e),s._p=new Promise(function(u,c){s.onload=u,s.onerror=c}),s.addEventListener("load",function(){i.loading|=1}),s.addEventListener("error",function(){i.loading|=2}),i.loading|=4,nc(l,t,n)}l={type:"stylesheet",instance:l,count:1,state:i},r.set(o,l)}}}function cP(e,t){Wn.X(e,t);var a=Nl;if(a&&e){var n=pl(a).hoistableScripts,r=Bl(e),o=n.get(r);o||(o=a.querySelector(ds(r)),o||(e=ct({src:e,async:!0},t),(t=$a.get(r))&&Mh(e,t),o=a.createElement("script"),zt(o),Xt(o,"link",e),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},n.set(r,o))}}function dP(e,t){Wn.M(e,t);var a=Nl;if(a&&e){var n=pl(a).hoistableScripts,r=Bl(e),o=n.get(r);o||(o=a.querySelector(ds(r)),o||(e=ct({src:e,async:!0,type:"module"},t),(t=$a.get(r))&&Mh(e,t),o=a.createElement("script"),zt(o),Xt(o,"link",e),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},n.set(r,o))}}function Zv(e,t,a,n){var r=(r=Sr.current)?Rc(r):null;if(!r)throw Error(P(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Ml(a.href),a=pl(r).hoistableStyles,n=a.get(t),n||(n={type:"style",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Ml(a.href);var o=pl(r).hoistableStyles,l=o.get(e);if(l||(r=r.ownerDocument||r,l={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(e,l),(o=r.querySelector(cs(e)))&&!o._p&&(l.instance=o,l.state.loading=5),$a.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},$a.set(e,a),o||fP(r,e,a,l.state))),t&&n===null)throw Error(P(528,""));return l}if(t&&n!==null)throw Error(P(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Bl(a),a=pl(r).hoistableScripts,n=a.get(t),n||(n={type:"script",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(P(444,e))}}function Ml(e){return'href="'+qa(e)+'"'}function cs(e){return'link[rel="stylesheet"]['+e+"]"}function B0(e){return ct({},e,{"data-precedence":e.precedence,precedence:null})}function fP(e,t,a,n){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?n.loading=1:(t=e.createElement("link"),n.preload=t,t.addEventListener("load",function(){return n.loading|=1}),t.addEventListener("error",function(){return n.loading|=2}),Xt(t,"link",a),zt(t),e.head.appendChild(t))}function Bl(e){return'[src="'+qa(e)+'"]'}function ds(e){return"script[async]"+e}function Qv(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+qa(a.href)+'"]');if(n)return t.instance=n,zt(n),n;var r=ct({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),zt(n),Xt(n,"style",r),nc(n,a.precedence,e),t.instance=n;case"stylesheet":r=Ml(a.href);var o=e.querySelector(cs(r));if(o)return t.state.loading|=4,t.instance=o,zt(o),o;n=B0(a),(r=$a.get(r))&&Ah(n,r),o=(e.ownerDocument||e).createElement("link"),zt(o);var l=o;return l._p=new Promise(function(i,s){l.onload=i,l.onerror=s}),Xt(o,"link",n),t.state.loading|=4,nc(o,a.precedence,e),t.instance=o;case"script":return o=Bl(a.src),(r=e.querySelector(ds(o)))?(t.instance=r,zt(r),r):(n=a,(r=$a.get(o))&&(n=ct({},a),Mh(n,r)),e=e.ownerDocument||e,r=e.createElement("script"),zt(r),Xt(r,"link",n),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(P(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,nc(n,a.precedence,e));return t.instance}function nc(e,t,a){for(var n=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=n.length?n[n.length-1]:null,o=r,l=0;l<n.length;l++){var i=n[l];if(i.dataset.precedence===t)o=i;else if(o!==r)break}o?o.parentNode.insertBefore(e,o.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Ah(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Mh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var rc=null;function Yv(e,t,a){if(rc===null){var n=new Map,r=rc=new Map;r.set(a,n)}else r=rc,n=r.get(a),n||(n=new Map,r.set(a,n));if(n.has(e))return n;for(n.set(e,null),a=a.getElementsByTagName(e),r=0;r<a.length;r++){var o=a[r];if(!(o[rs]||o[Gt]||e==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var l=o.getAttribute(t)||"";l=e+l;var i=n.get(l);i?i.push(o):n.set(l,[o])}}return n}function Jv(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function pP(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function U0(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function mP(e,t,a,n){if(a.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var r=Ml(n.href),o=t.querySelector(cs(r));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Dc.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=o,zt(o);return}o=t.ownerDocument||t,n=B0(n),(r=$a.get(r))&&Ah(n,r),o=o.createElement("link"),zt(o);var l=o;l._p=new Promise(function(i,s){l.onload=i,l.onerror=s}),Xt(o,"link",n),a.instance=o}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Dc.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Hp=0;function hP(e,t){return e.stylesheets&&e.count===0&&oc(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var n=setTimeout(function(){if(e.stylesheets&&oc(e,e.stylesheets),e.unsuspend){var o=e.unsuspend;e.unsuspend=null,o()}},6e4+t);0<e.imgBytes&&Hp===0&&(Hp=62500*KO());var r=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&oc(e,e.stylesheets),e.unsuspend)){var o=e.unsuspend;e.unsuspend=null,o()}},(e.imgBytes>Hp?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(r)}}:null}function Dc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)oc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var _c=null;function oc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,_c=new Map,t.forEach(gP,e),_c=null,Dc.call(e))}function gP(e,t){if(!(t.state.loading&4)){var a=_c.get(e);if(a)var n=a.get(null);else{a=new Map,_c.set(e,a);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<r.length;o++){var l=r[o];(l.nodeName==="LINK"||l.getAttribute("media")!=="not all")&&(a.set(l.dataset.precedence,l),n=l)}n&&a.set(null,n)}r=t.instance,l=r.getAttribute("data-precedence"),o=a.get(l)||n,o===n&&a.set(null,r),a.set(l,r),this.count++,n=Dc.bind(this),r.addEventListener("load",n),r.addEventListener("error",n),o?o.parentNode.insertBefore(r,o.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var Qi={$$typeof:Nn,Provider:null,Consumer:null,_currentValue:lo,_currentValue2:lo,_threadCount:0};function yP(e,t,a,n,r,o,l,i,s){this.tag=1,this.containerInfo=e,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=mp(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mp(0),this.hiddenUpdates=mp(null),this.identifierPrefix=n,this.onUncaughtError=r,this.onCaughtError=o,this.onRecoverableError=l,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=s,this.incompleteTransitions=new Map}function F0(e,t,a,n,r,o,l,i,s,u,c,d){return e=new yP(e,t,a,l,s,u,c,d,i),t=1,o===!0&&(t|=24),o=Sa(3,null,null,t),e.current=o,o.stateNode=e,t=th(),t.refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:n,isDehydrated:a,cache:t},rh(o),e}function z0(e){return e?(e=ul,e):ul}function q0(e,t,a,n,r,o){r=z0(r),n.context===null?n.context=r:n.pendingContext=r,n=Ir(t),n.payload={element:a},o=o===void 0?null:o,o!==null&&(n.callback=o),a=kr(e,n,t),a!==null&&(ma(a,e,t),Ri(a,e,t))}function eb(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Eh(e,t){eb(e,t),(e=e.alternate)&&eb(e,t)}function H0(e){if(e.tag===13||e.tag===31){var t=vo(e,67108864);t!==null&&ma(t,e,67108864),Eh(e,67108864)}}function tb(e){if(e.tag===13||e.tag===31){var t=Ta();t=qm(t);var a=vo(e,t);a!==null&&ma(a,e,t),Eh(e,t)}}var Oc=!0;function wP(e,t,a,n){var r=re.T;re.T=null;var o=ze.p;try{ze.p=2,Rh(e,t,a,n)}finally{ze.p=o,re.T=r}}function xP(e,t,a,n){var r=re.T;re.T=null;var o=ze.p;try{ze.p=8,Rh(e,t,a,n)}finally{ze.p=o,re.T=r}}function Rh(e,t,a,n){if(Oc){var r=Nm(n);if(r===null)zp(e,t,n,Pc,a),ab(e,n);else if(bP(r,e,t,a,n))n.stopPropagation();else if(ab(e,n),t&4&&-1<vP.indexOf(e)){for(;r!==null;){var o=Dl(r);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var l=no(o.pendingLanes);if(l!==0){var i=o;for(i.pendingLanes|=2,i.entangledLanes|=2;l;){var s=1<<31-La(l);i.entanglements[1]|=s,l&=~s}yn(o),(Fe&6)===0&&(Ic=Ia()+500,us(0,!1))}}break;case 31:case 13:i=vo(o,2),i!==null&&ma(i,o,2),Xc(),Eh(o,2)}if(o=Nm(n),o===null&&zp(e,t,n,Pc,a),o===r)break;r=o}r!==null&&n.stopPropagation()}else zp(e,t,n,null,a)}}function Nm(e){return e=Gm(e),Dh(e)}var Pc=null;function Dh(e){if(Pc=null,e=nl(e),e!==null){var t=es(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=sb(t),e!==null)return e;e=null}else if(a===31){if(e=ub(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Pc=e,null}function j0(e){switch(e){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(i_()){case pb:return 2;case mb:return 8;case cc:case s_:return 32;case hb:return 268435456;default:return 32}default:return 32}}var Bm=!1,Ar=null,Mr=null,Er=null,Yi=new Map,Ji=new Map,gr=[],vP="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 ab(e,t){switch(e){case"focusin":case"focusout":Ar=null;break;case"dragenter":case"dragleave":Mr=null;break;case"mouseover":case"mouseout":Er=null;break;case"pointerover":case"pointerout":Yi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ji.delete(t.pointerId)}}function vi(e,t,a,n,r,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:a,eventSystemFlags:n,nativeEvent:o,targetContainers:[r]},t!==null&&(t=Dl(t),t!==null&&H0(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function bP(e,t,a,n,r){switch(t){case"focusin":return Ar=vi(Ar,e,t,a,n,r),!0;case"dragenter":return Mr=vi(Mr,e,t,a,n,r),!0;case"mouseover":return Er=vi(Er,e,t,a,n,r),!0;case"pointerover":var o=r.pointerId;return Yi.set(o,vi(Yi.get(o)||null,e,t,a,n,r)),!0;case"gotpointercapture":return o=r.pointerId,Ji.set(o,vi(Ji.get(o)||null,e,t,a,n,r)),!0}return!1}function V0(e){var t=nl(e.target);if(t!==null){var a=es(t);if(a!==null){if(t=a.tag,t===13){if(t=sb(a),t!==null){e.blockedOn=t,Fx(e.priority,function(){tb(a)});return}}else if(t===31){if(t=ub(a),t!==null){e.blockedOn=t,Fx(e.priority,function(){tb(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function lc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Nm(e.nativeEvent);if(a===null){a=e.nativeEvent;var n=new a.constructor(a.type,a);tm=n,a.target.dispatchEvent(n),tm=null}else return t=Dl(a),t!==null&&H0(t),e.blockedOn=a,!1;t.shift()}return!0}function nb(e,t,a){lc(e)&&a.delete(t)}function SP(){Bm=!1,Ar!==null&&lc(Ar)&&(Ar=null),Mr!==null&&lc(Mr)&&(Mr=null),Er!==null&&lc(Er)&&(Er=null),Yi.forEach(nb),Ji.forEach(nb)}function Vu(e,t){e.blockedOn===t&&(e.blockedOn=null,Bm||(Bm=!0,Nt.unstable_scheduleCallback(Nt.unstable_NormalPriority,SP)))}var Gu=null;function rb(e){Gu!==e&&(Gu=e,Nt.unstable_scheduleCallback(Nt.unstable_NormalPriority,function(){Gu===e&&(Gu=null);for(var t=0;t<e.length;t+=3){var a=e[t],n=e[t+1],r=e[t+2];if(typeof n!="function"){if(Dh(n||a)===null)continue;break}var o=Dl(a);o!==null&&(e.splice(t,3),t-=3,ym(o,{pending:!0,data:r,method:a.method,action:n},n,r))}}))}function El(e){function t(s){return Vu(s,e)}Ar!==null&&Vu(Ar,e),Mr!==null&&Vu(Mr,e),Er!==null&&Vu(Er,e),Yi.forEach(t),Ji.forEach(t);for(var a=0;a<gr.length;a++){var n=gr[a];n.blockedOn===e&&(n.blockedOn=null)}for(;0<gr.length&&(a=gr[0],a.blockedOn===null);)V0(a),a.blockedOn===null&&gr.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(n=0;n<a.length;n+=3){var r=a[n],o=a[n+1],l=r[ha]||null;if(typeof o=="function")l||rb(a);else if(l){var i=null;if(o&&o.hasAttribute("formAction")){if(r=o,l=o[ha]||null)i=l.formAction;else if(Dh(r)!==null)continue}else i=l.action;typeof i=="function"?a[n+1]=i:(a.splice(n,3),n-=3),rb(a)}}}function G0(){function e(o){o.canIntercept&&o.info==="react-transition"&&o.intercept({handler:function(){return new Promise(function(l){return r=l})},focusReset:"manual",scroll:"manual"})}function t(){r!==null&&(r(),r=null),n||setTimeout(a,20)}function a(){if(!n&&!navigation.transition){var o=navigation.currentEntry;o&&o.url!=null&&navigation.navigate(o.url,{state:o.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var n=!1,r=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){n=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),r!==null&&(r(),r=null)}}}function _h(e){this._internalRoot=e}Qc.prototype.render=_h.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(P(409));var a=t.current,n=Ta();q0(a,n,e,t,null,null)};Qc.prototype.unmount=_h.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;q0(e.current,2,null,e,null,null),Xc(),t[Rl]=null}};function Qc(e){this._internalRoot=e}Qc.prototype.unstable_scheduleHydration=function(e){if(e){var t=vb();e={blockedOn:null,target:e,priority:t};for(var a=0;a<gr.length&&t!==0&&t<gr[a].priority;a++);gr.splice(a,0,e),a===0&&V0(e)}};var ob=lb.version;if(ob!=="19.2.4")throw Error(P(527,ob,"19.2.4"));ze.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(P(188)):(e=Object.keys(e).join(","),Error(P(268,e)));return e=e_(t),e=e!==null?cb(e):null,e=e===null?null:e.stateNode,e};var CP={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:re,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(bi=__REACT_DEVTOOLS_GLOBAL_HOOK__,!bi.isDisabled&&bi.supportsFiber))try{ts=bi.inject(CP),ka=bi}catch{}var bi;Yc.createRoot=function(e,t){if(!ib(e))throw Error(P(299));var a=!1,n="",r=NS,o=BS,l=US;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(l=t.onRecoverableError)),t=F0(e,1,!1,null,null,a,n,null,r,o,l,G0),e[Rl]=t.current,Th(e),new _h(t)};Yc.hydrateRoot=function(e,t,a){if(!ib(e))throw Error(P(299));var n=!1,r="",o=NS,l=BS,i=US,s=null;return a!=null&&(a.unstable_strictMode===!0&&(n=!0),a.identifierPrefix!==void 0&&(r=a.identifierPrefix),a.onUncaughtError!==void 0&&(o=a.onUncaughtError),a.onCaughtError!==void 0&&(l=a.onCaughtError),a.onRecoverableError!==void 0&&(i=a.onRecoverableError),a.formState!==void 0&&(s=a.formState)),t=F0(e,1,!0,t,a??null,n,r,s,o,l,i,G0),t.context=z0(null),a=t.current,n=Ta(),n=qm(n),r=Ir(n),r.callback=null,kr(a,r,n),a=n,t.current.lanes=a,ns(t,a),yn(t),e[Rl]=t.current,Th(e),new Qc(t)};Yc.version="19.2.4"});var K0=Kt((Fj,X0)=>{"use strict";function W0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(W0)}catch(e){console.error(e)}}W0(),X0.exports=$0()});var SC=Kt(rd=>{"use strict";var LN=Symbol.for("react.transitional.element"),TN=Symbol.for("react.fragment");function bC(e,t,a){var n=null;if(a!==void 0&&(n=""+a),t.key!==void 0&&(n=""+t.key),"key"in t){a={};for(var r in t)r!=="key"&&(a[r]=t[r])}else a=t;return t=a.ref,{$$typeof:LN,type:e,key:n,ref:t!==void 0?t:null,props:a}}rd.Fragment=TN;rd.jsx=bC;rd.jsxs=bC});var te=Kt((wV,CC)=>{"use strict";CC.exports=SC()});function kC(e){var t,a,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(a=kC(e[t]))&&(n&&(n+=" "),n+=a)}else for(a in e)e[a]&&(n&&(n+=" "),n+=a);return n}function od(){for(var e,t,a=0,n="",r=arguments.length;a<r;a++)(e=arguments[a])&&(t=kC(e))&&(n&&(n+=" "),n+=t);return n}var Gh=I(()=>{"use strict"});function $h(...e){return e.filter(Boolean).join(" ")}function LC(){return $h}var Wh=I(()=>{"use strict"});function HN(e){let t=[],a=-1;for(;++a<e.length;)t[a]=Fr(e[a]);return cd(n);function n(...r){let o=-1;for(;++o<t.length;)if(t[o].apply(this,r))return!0;return!1}}function jN(e){let t=e;return cd(a);function a(n){let r=n,o;for(o in e)if(r[o]!==t[o])return!1;return!0}}function VN(e){return cd(t);function t(a){return a&&a.type===e}}function cd(e){return t;function t(a,n,r){return!!($N(a)&&e.call(this,a,typeof n=="number"?n:void 0,r||void 0))}}function GN(){return!0}function $N(e){return e!==null&&typeof e=="object"&&"type"in e}var Fr,QC=I(()=>{"use strict";Fr=(function(e){if(e==null)return GN;if(typeof e=="function")return cd(e);if(typeof e=="object")return Array.isArray(e)?HN(e):jN(e);if(typeof e=="string")return VN(e);throw new Error("Expected function, string, or object as test")})});var dd=I(()=>{"use strict";QC()});function Ms(e,t,a,n){let r;typeof t=="function"&&typeof a!="function"?(n=a,a=t):r=t;let o=Fr(r),l=n?-1:1;i(e,void 0,[])();function i(s,u,c){let d=s&&typeof s=="object"?s:{};if(typeof d.type=="string"){let p=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(s.type+(p?"<"+p+">":""))+")"})}return f;function f(){let p=YC,m,x,v;if((!t||o(s,u,c[c.length-1]||void 0))&&(p=WN(a(s,c)),p[0]===Lo))return p;if("children"in s&&s.children){let y=s;if(y.children&&p[0]!==To)for(x=(n?y.children.length:-1)+l,v=c.concat(y);x>-1&&x<y.children.length;){let w=y.children[x];if(m=i(w,x,v)(),m[0]===Lo)return m;x=typeof m[1]=="number"?m[1]:x+l}}return p}}}function WN(e){return Array.isArray(e)?e:typeof e=="number"?[Zn,e]:e==null?YC:[e]}var YC,Zn,Lo,To,JC=I(()=>{"use strict";dd();YC=[],Zn=!0,Lo=!1,To="skip"});var fd=I(()=>{"use strict";JC()});function Qn(e,t,a,n){let r,o,l;typeof t=="function"&&typeof a!="function"?(o=void 0,l=t,r=a):(o=t,l=a,r=n),Ms(e,o,i,r);function i(s,u){let c=u[u.length-1],d=c?c.children.indexOf(s):void 0;return l(s,d,c)}}var eI=I(()=>{"use strict";fd();fd()});var pd=I(()=>{"use strict";eI()});function nI({defaultOrigin:e="",allowedLinkPrefixes:t=[],allowedImagePrefixes:a=[],allowDataImages:n=!1,allowedProtocols:r=[],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"}){let i=t.length&&!t.every(u=>u==="*"),s=a.length&&!a.every(u=>u==="*");if(!e&&(i||s))throw new Error("defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided");return u=>{let c=QN(e,t,a,n,r,o,l);Qn(u,c)}}function tI(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 XN(e){return typeof e!="string"?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")}function aI(e,t,a,n=!1,r=!1,o=[]){if(!e)return null;if(typeof e=="string"&&e.startsWith("#")&&!r)try{if(new URL(e,"http://example.com").hash===e)return e}catch{}if(typeof e=="string"&&e.startsWith("data:"))return r&&n&&e.startsWith("data:image/")?e:null;if(typeof e=="string"&&e.startsWith("blob:")){try{if(new URL(e).protocol==="blob:"&&e.length>5){let c=e.substring(5);if(c&&c.length>0&&c!=="invalid")return e}}catch{return null}return null}let l=tI(e,a);if(!l||ZN.has(l.protocol)||!(KN.has(l.protocol)||o.includes(l.protocol)||o.includes("*")))return null;if(l.protocol==="mailto:"||!l.protocol.match(/^https?:$/))return l.href;let s=XN(e);return l&&t.some(u=>{let c=tI(u,a);return!c||c.origin!==l.origin?!1:l.href.startsWith(c.href)})?s?l.pathname+l.search+l.hash:l.href:t.includes("*")?l.protocol!=="https:"&&l.protocol!=="http:"?null:s?l.pathname+l.search+l.hash:l.href:null}var KN,ZN,Qh,QN,rI=I(()=>{"use strict";pd();KN=new Set(["https:","http:","irc:","ircs:","mailto:","xmpp:","blob:"]),ZN=new Set(["javascript:","data:","file:","vbscript:"]);Qh=Symbol("node-seen"),QN=(e,t,a,n,r,o,l)=>{let i=(s,u,c)=>{if(s.type!=="element"||s[Qh])return Zn;if(s.tagName==="a"){let d=aI(s.properties.href,t,e,!1,!1,r);return d===null?(s[Qh]=!0,Qn(s,i),c&&typeof u=="number"&&(c.children[u]={type:"element",tagName:"span",properties:{title:"Blocked URL: "+String(s.properties.href),class:l},children:[...s.children,{type:"text",value:" [blocked]"}]}),To):(s.properties.href=d,s.properties.target="_blank",s.properties.rel="noopener noreferrer",Zn)}if(s.tagName==="img"){let d=aI(s.properties.src,a,e,n,!0,r);return d===null?(s[Qh]=!0,Qn(s,i),c&&typeof u=="number"&&(c.children[u]={type:"element",tagName:"span",properties:{class:o},children:[{type:"text",value:"[Image blocked: "+String(s.properties.alt||"No description")+"]"}]}),To):(s.properties.src=d,Zn)}return Zn};return i}});function YN(){return e=>e}var oI,lI=I(()=>{"use strict";oI=YN});var iI,aB,eg,fI=I(()=>{"use strict";iI=typeof self=="object"?self:globalThis,aB=(e,t)=>{let a=(r,o)=>(e.set(o,r),r),n=r=>{if(e.has(r))return e.get(r);let[o,l]=t[r];switch(o){case 0:case-1:return a(l,r);case 1:{let i=a([],r);for(let s of l)i.push(n(s));return i}case 2:{let i=a({},r);for(let[s,u]of l)i[n(s)]=n(u);return i}case 3:return a(new Date(l),r);case 4:{let{source:i,flags:s}=l;return a(new RegExp(i,s),r)}case 5:{let i=a(new Map,r);for(let[s,u]of l)i.set(n(s),n(u));return i}case 6:{let i=a(new Set,r);for(let s of l)i.add(n(s));return i}case 7:{let{name:i,message:s}=l;return a(new iI[i](s),r)}case 8:return a(BigInt(l),r);case"BigInt":return a(Object(BigInt(l)),r);case"ArrayBuffer":return a(new Uint8Array(l).buffer,l);case"DataView":{let{buffer:i}=new Uint8Array(l);return a(new DataView(i),l)}}return a(new iI[o](l),r)};return n},eg=e=>aB(new Map,e)(0)});var jl,nB,rB,Es,hd,oB,tg,pI=I(()=>{"use strict";jl="",{toString:nB}={},{keys:rB}=Object,Es=e=>{let t=typeof e;if(t!=="object"||!e)return[0,t];let a=nB.call(e).slice(8,-1);switch(a){case"Array":return[1,jl];case"Object":return[2,jl];case"Date":return[3,jl];case"RegExp":return[4,jl];case"Map":return[5,jl];case"Set":return[6,jl];case"DataView":return[1,a]}return a.includes("Array")?[1,a]:a.includes("Error")?[7,a]:[2,a]},hd=([e,t])=>e===0&&(t==="function"||t==="symbol"),oB=(e,t,a,n)=>{let r=(l,i)=>{let s=n.push(l)-1;return a.set(i,s),s},o=l=>{if(a.has(l))return a.get(l);let[i,s]=Es(l);switch(i){case 0:{let c=l;switch(s){case"bigint":i=8,c=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+s);c=null;break;case"undefined":return r([-1],l)}return r([i,c],l)}case 1:{if(s){let f=l;return s==="DataView"?f=new Uint8Array(l.buffer):s==="ArrayBuffer"&&(f=new Uint8Array(l)),r([s,[...f]],l)}let c=[],d=r([i,c],l);for(let f of l)c.push(o(f));return d}case 2:{if(s)switch(s){case"BigInt":return r([s,l.toString()],l);case"Boolean":case"Number":case"String":return r([s,l.valueOf()],l)}if(t&&"toJSON"in l)return o(l.toJSON());let c=[],d=r([i,c],l);for(let f of rB(l))(e||!hd(Es(l[f])))&&c.push([o(f),o(l[f])]);return d}case 3:return r([i,l.toISOString()],l);case 4:{let{source:c,flags:d}=l;return r([i,{source:c,flags:d}],l)}case 5:{let c=[],d=r([i,c],l);for(let[f,p]of l)(e||!(hd(Es(f))||hd(Es(p))))&&c.push([o(f),o(p)]);return d}case 6:{let c=[],d=r([i,c],l);for(let f of l)(e||!hd(Es(f)))&&c.push(o(f));return d}}let{message:u}=l;return r([i,{name:s,message:u}],l)};return o},tg=(e,{json:t,lossy:a}={})=>{let n=[];return oB(!(t||a),!!t,new Map,n)(e),n}});var zr,gd=I(()=>{"use strict";fI();pI();zr=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?eg(tg(e,t)):structuredClone(e):(e,t)=>eg(tg(e,t))});function mI(e){return t;function t(a){let n=a&&a.position&&a.position[e]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function Rs(e){let t=Vl(e),a=yd(e);if(t&&a)return{start:t,end:a}}var yd,Vl,hI=I(()=>{"use strict";yd=mI("end"),Vl=mI("start")});var Ds=I(()=>{"use strict";hI()});var Ao,ag,gI=I(()=>{"use strict";Ao=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],ag={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...Ao,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...Ao],h2:[["className","sr-only"]],img:[...Ao,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...Ao,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...Ao],table:[...Ao],ul:[...Ao,["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"]}});function ng(e,t){let a={type:"root",children:[]},n={schema:t?{...ag,...t}:ag,stack:[]},r=xI(n,e);return r&&(Array.isArray(r)?r.length===1?a=r[0]:a.children=r:a=r),a}function xI(e,t){if(t&&typeof t=="object"){let a=t;switch(typeof a.type=="string"?a.type:""){case"comment":return lB(e,a);case"doctype":return iB(e,a);case"element":return sB(e,a);case"root":return uB(e,a);case"text":return cB(e,a);default:}}}function lB(e,t){if(e.schema.allowComments){let a=typeof t.value=="string"?t.value:"",n=a.indexOf("-->"),o={type:"comment",value:n<0?a:a.slice(0,n)};return _s(o,t),o}}function iB(e,t){if(e.schema.allowDoctypes){let a={type:"doctype"};return _s(a,t),a}}function sB(e,t){let a=typeof t.tagName=="string"?t.tagName:"";e.stack.push(a);let n=vI(e,t.children),r=dB(e,t.properties);e.stack.pop();let o=!1;if(a&&a!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(a))&&(o=!0,e.schema.ancestors&&qr.call(e.schema.ancestors,a))){let i=e.schema.ancestors[a],s=-1;for(o=!1;++s<i.length;)e.stack.includes(i[s])&&(o=!0)}if(!o)return e.schema.strip&&!e.schema.strip.includes(a)?n:void 0;let l={type:"element",tagName:a,properties:r,children:n};return _s(l,t),l}function uB(e,t){let n={type:"root",children:vI(e,t.children)};return _s(n,t),n}function cB(e,t){let n={type:"text",value:typeof t.value=="string"?t.value:""};return _s(n,t),n}function vI(e,t){let a=[];if(Array.isArray(t)){let n=t,r=-1;for(;++r<n.length;){let o=xI(e,n[r]);o&&(Array.isArray(o)?a.push(...o):a.push(o))}}return a}function dB(e,t){let a=e.stack[e.stack.length-1],n=e.schema.attributes,r=e.schema.required,o=n&&qr.call(n,a)?n[a]:void 0,l=n&&qr.call(n,"*")?n["*"]:void 0,i=t&&typeof t=="object"?t:{},s={},u;for(u in i)if(qr.call(i,u)){let c=i[u],d=yI(e,wI(o,u),u,c);d==null&&(d=yI(e,wI(l,u),u,c)),d!=null&&(s[u]=d)}if(r&&qr.call(r,a)){let c=r[a];for(u in c)qr.call(c,u)&&!qr.call(s,u)&&(s[u]=c[u])}return s}function yI(e,t,a,n){return t?Array.isArray(n)?fB(e,t,a,n):bI(e,t,a,n):void 0}function fB(e,t,a,n){let r=-1,o=[];for(;++r<n.length;){let l=bI(e,t,a,n[r]);(typeof l=="number"||typeof l=="string")&&o.push(l)}return o}function bI(e,t,a,n){if(!(typeof n!="boolean"&&typeof n!="number"&&typeof n!="string")&&pB(e,a,n)){if(typeof t=="object"&&t.length>1){let r=!1,o=0;for(;++o<t.length;){let l=t[o];if(l&&typeof l=="object"&&"flags"in l){if(l.test(String(n))){r=!0;break}}else if(l===n){r=!0;break}}if(!r)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(a)?e.schema.clobberPrefix+n:n}}function pB(e,t,a){let n=e.schema.protocols&&qr.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!n||n.length===0)return!0;let r=String(a),o=r.indexOf(":"),l=r.indexOf("?"),i=r.indexOf("#"),s=r.indexOf("/");if(o<0||s>-1&&o>s||l>-1&&o>l||i>-1&&o>i)return!0;let u=-1;for(;++u<n.length;){let c=n[u];if(o===c.length&&r.slice(0,c.length)===c)return!0}return!1}function _s(e,t){let a=Rs(t);t.data&&(e.data=zr(t.data)),a&&(e.position=a)}function wI(e,t){let a,n=-1;if(e)for(;++n<e.length;){let r=e[n],o=typeof r=="string"?r:r[0];if(o===t)return r;o==="data*"&&(a=r)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return a}var qr,SI=I(()=>{"use strict";gd();Ds();gI();qr={}.hasOwnProperty});var CI=I(()=>{"use strict";SI()});function wd(e){return function(t){return ng(t,e)}}var II=I(()=>{"use strict";CI()});var kI=I(()=>{"use strict";II()});function rg(e,t){let a=String(e);if(typeof t!="string")throw new TypeError("Expected character");let n=0,r=a.indexOf(t);for(;r!==-1;)n++,r=a.indexOf(t,r+t.length);return n}var LI=I(()=>{"use strict"});function Mo(e){return e!==null&&(e<32||e===127)}function V(e){return e!==null&&e<-2}function pe(e){return e!==null&&(e<0||e===32)}function J(e){return e===-2||e===-1||e===32}function Hr(e){return t;function t(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}var Bt,vt,TI,Os,AI,MI,Eo,xn,_e=I(()=>{"use strict";Bt=Hr(/[A-Za-z]/),vt=Hr(/[\dA-Za-z]/),TI=Hr(/[#-'*+\--9=?A-Z^-~]/);Os=Hr(/\d/),AI=Hr(/[\dA-Fa-f]/),MI=Hr(/[!-/:-@[-`{-~]/);Eo=Hr(/\p{P}|\p{S}/u),xn=Hr(/\s/)});function og(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var EI=I(()=>{"use strict"});function lg(e,t,a){let r=Fr((a||{}).ignore||[]),o=mB(t),l=-1;for(;++l<o.length;)Ms(e,"text",i);function i(u,c){let d=-1,f;for(;++d<c.length;){let p=c[d],m=f?f.children:void 0;if(r(p,m?m.indexOf(p):void 0,f))return;f=p}if(f)return s(u,c)}function s(u,c){let d=c[c.length-1],f=o[l][0],p=o[l][1],m=0,v=d.children.indexOf(u),y=!1,w=[];f.lastIndex=0;let g=f.exec(u.value);for(;g;){let C=g.index,A={index:g.index,input:g.input,stack:[...c,u]},S=p(...g,A);if(typeof S=="string"&&(S=S.length>0?{type:"text",value:S}:void 0),S===!1?f.lastIndex=C+1:(m!==C&&w.push({type:"text",value:u.value.slice(m,C)}),Array.isArray(S)?w.push(...S):S&&w.push(S),m=C+g[0].length,y=!0),!f.global)break;g=f.exec(u.value)}return y?(m<u.value.length&&w.push({type:"text",value:u.value.slice(m)}),d.children.splice(v,1,...w)):w=[u],v+w.length}}function mB(e){let t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");let a=!e[0]||Array.isArray(e[0])?e:[e],n=-1;for(;++n<a.length;){let r=a[n];t.push([hB(r[0]),gB(r[1])])}return t}function hB(e){return typeof e=="string"?new RegExp(og(e),"g"):e}function gB(e){return typeof e=="function"?e:function(){return e}}var RI=I(()=>{"use strict";EI();fd();dd()});var DI=I(()=>{"use strict";RI()});function cg(){return{transforms:[SB],enter:{literalAutolink:yB,literalAutolinkEmail:ug,literalAutolinkHttp:ug,literalAutolinkWww:ug},exit:{literalAutolink:bB,literalAutolinkEmail:vB,literalAutolinkHttp:wB,literalAutolinkWww:xB}}}function dg(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:ig,notInConstruct:sg},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:ig,notInConstruct:sg},{character:":",before:"[ps]",after:"\\/",inConstruct:ig,notInConstruct:sg}]}}function yB(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function ug(e){this.config.enter.autolinkProtocol.call(this,e)}function wB(e){this.config.exit.autolinkProtocol.call(this,e)}function xB(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function vB(e){this.config.exit.autolinkEmail.call(this,e)}function bB(e){this.exit(e)}function SB(e){lg(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,CB],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,IB]],{ignore:["link","linkReference"]})}function CB(e,t,a,n,r){let o="";if(!_I(r)||(/^w/i.test(t)&&(a=t+a,t="",o="http://"),!kB(a)))return!1;let l=LB(a+n);if(!l[0])return!1;let i={type:"link",title:null,url:o+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[i,{type:"text",value:l[1]}]:i}function IB(e,t,a,n){return!_I(n,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+a,children:[{type:"text",value:t+"@"+a}]}}function kB(e){let 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 LB(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let a=t[0],n=a.indexOf(")"),r=rg(e,"("),o=rg(e,")");for(;n!==-1&&r>o;)e+=a.slice(0,n+1),a=a.slice(n+1),n=a.indexOf(")"),o++;return[e,a]}function _I(e,t){let a=e.input.charCodeAt(e.index-1);return(e.index===0||xn(a)||Eo(a))&&(!t||a!==47)}var ig,sg,OI=I(()=>{"use strict";LI();_e();DI();ig="phrasing",sg=["autolink","link","image","label"]});var PI=I(()=>{"use strict";OI()});function Qt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var Gl=I(()=>{"use strict"});function TB(){this.buffer()}function AB(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function MB(){this.buffer()}function EB(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function RB(e){let t=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Qt(this.sliceSerialize(e)).toLowerCase(),a.label=t}function DB(e){this.exit(e)}function _B(e){let t=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Qt(this.sliceSerialize(e)).toLowerCase(),a.label=t}function OB(e){this.exit(e)}function PB(){return"["}function NI(e,t,a,n){let r=a.createTracker(n),o=r.move("[^"),l=a.enter("footnoteReference"),i=a.enter("reference");return o+=r.move(a.safe(a.associationId(e),{after:"]",before:o})),i(),l(),o+=r.move("]"),o}function fg(){return{enter:{gfmFootnoteCallString:TB,gfmFootnoteCall:AB,gfmFootnoteDefinitionLabelString:MB,gfmFootnoteDefinition:EB},exit:{gfmFootnoteCallString:RB,gfmFootnoteCall:DB,gfmFootnoteDefinitionLabelString:_B,gfmFootnoteDefinition:OB}}}function pg(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:a,footnoteReference:NI},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(n,r,o,l){let i=o.createTracker(l),s=i.move("[^"),u=o.enter("footnoteDefinition"),c=o.enter("label");return s+=i.move(o.safe(o.associationId(n),{before:s,after:"]"})),c(),s+=i.move("]:"),n.children&&n.children.length>0&&(i.shift(4),s+=i.move((t?`
|
|
10
|
+
`:" ")+o.indentLines(o.containerFlow(n,i.current()),t?BI:NB))),u(),s}}function NB(e,t,a){return t===0?e:BI(e,t,a)}function BI(e,t,a){return(a?"":" ")+e}var UI=I(()=>{"use strict";Gl();NI.peek=PB});var FI=I(()=>{"use strict";UI()});function mg(){return{canContainEols:["delete"],enter:{strikethrough:UB},exit:{strikethrough:FB}}}function hg(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:BB}],handlers:{delete:zI}}}function UB(e){this.enter({type:"delete",children:[]},e)}function FB(e){this.exit(e)}function zI(e,t,a,n){let r=a.createTracker(n),o=a.enter("strikethrough"),l=r.move("~~");return l+=a.containerPhrasing(e,{...r.current(),before:l,after:"~"}),l+=r.move("~~"),o(),l}function zB(){return"~"}var BB,qI=I(()=>{"use strict";BB=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];zI.peek=zB});var HI=I(()=>{"use strict";qI()});function qB(e){return e.length}function VI(e,t){let a=t||{},n=(a.align||[]).concat(),r=a.stringLength||qB,o=[],l=[],i=[],s=[],u=0,c=-1;for(;++c<e.length;){let x=[],v=[],y=-1;for(e[c].length>u&&(u=e[c].length);++y<e[c].length;){let w=HB(e[c][y]);if(a.alignDelimiters!==!1){let g=r(w);v[y]=g,(s[y]===void 0||g>s[y])&&(s[y]=g)}x.push(w)}l[c]=x,i[c]=v}let d=-1;if(typeof n=="object"&&"length"in n)for(;++d<u;)o[d]=jI(n[d]);else{let x=jI(n);for(;++d<u;)o[d]=x}d=-1;let f=[],p=[];for(;++d<u;){let x=o[d],v="",y="";x===99?(v=":",y=":"):x===108?v=":":x===114&&(y=":");let w=a.alignDelimiters===!1?1:Math.max(1,s[d]-v.length-y.length),g=v+"-".repeat(w)+y;a.alignDelimiters!==!1&&(w=v.length+w+y.length,w>s[d]&&(s[d]=w),p[d]=w),f[d]=g}l.splice(1,0,f),i.splice(1,0,p),c=-1;let m=[];for(;++c<l.length;){let x=l[c],v=i[c];d=-1;let y=[];for(;++d<u;){let w=x[d]||"",g="",C="";if(a.alignDelimiters!==!1){let A=s[d]-(v[d]||0),S=o[d];S===114?g=" ".repeat(A):S===99?A%2?(g=" ".repeat(A/2+.5),C=" ".repeat(A/2-.5)):(g=" ".repeat(A/2),C=g):C=" ".repeat(A)}a.delimiterStart!==!1&&!d&&y.push("|"),a.padding!==!1&&!(a.alignDelimiters===!1&&w==="")&&(a.delimiterStart!==!1||d)&&y.push(" "),a.alignDelimiters!==!1&&y.push(g),y.push(w),a.alignDelimiters!==!1&&y.push(C),a.padding!==!1&&y.push(" "),(a.delimiterEnd!==!1||d!==u-1)&&y.push("|")}m.push(a.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return m.join(`
|
|
11
|
+
`)}function HB(e){return e==null?"":String(e)}function jI(e){let 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}var GI=I(()=>{"use strict"});function $I(e,t,a,n){let r=a.enter("blockquote"),o=a.createTracker(n);o.move("> "),o.shift(2);let l=a.indentLines(a.containerFlow(e,o.current()),jB);return r(),l}function jB(e,t,a){return">"+(a?"":" ")+e}var WI=I(()=>{"use strict"});function KI(e,t){return XI(e,t.inConstruct,!0)&&!XI(e,t.notInConstruct,!1)}function XI(e,t,a){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return a;let n=-1;for(;++n<t.length;)if(e.includes(t[n]))return!0;return!1}var ZI=I(()=>{"use strict"});function gg(e,t,a,n){let r=-1;for(;++r<a.unsafe.length;)if(a.unsafe[r].character===`
|
|
12
|
+
`&&KI(a.stack,a.unsafe[r]))return/[ \t]/.test(n.before)?"":" ";return`\\
|
|
13
|
+
`}var QI=I(()=>{"use strict";ZI()});function YI(e,t){let a=String(e),n=a.indexOf(t),r=n,o=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;n!==-1;)n===r?++o>l&&(l=o):o=1,r=n+t.length,n=a.indexOf(t,r);return l}var JI=I(()=>{"use strict"});function ek(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))}var tk=I(()=>{"use strict"});function ak(e){let t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}var nk=I(()=>{"use strict"});function rk(e,t,a,n){let r=ak(a),o=e.value||"",l=r==="`"?"GraveAccent":"Tilde";if(ek(e,a)){let d=a.enter("codeIndented"),f=a.indentLines(o,VB);return d(),f}let i=a.createTracker(n),s=r.repeat(Math.max(YI(o,r)+1,3)),u=a.enter("codeFenced"),c=i.move(s);if(e.lang){let d=a.enter(`codeFencedLang${l}`);c+=i.move(a.safe(e.lang,{before:c,after:" ",encode:["`"],...i.current()})),d()}if(e.lang&&e.meta){let d=a.enter(`codeFencedMeta${l}`);c+=i.move(" "),c+=i.move(a.safe(e.meta,{before:c,after:`
|
|
14
|
+
`,encode:["`"],...i.current()})),d()}return c+=i.move(`
|
|
15
|
+
`),o&&(c+=i.move(o+`
|
|
16
|
+
`)),c+=i.move(s),u(),c}function VB(e,t,a){return(a?"":" ")+e}var ok=I(()=>{"use strict";JI();tk();nk()});function $l(e){let t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}var xd=I(()=>{"use strict"});function lk(e,t,a,n){let r=$l(a),o=r==='"'?"Quote":"Apostrophe",l=a.enter("definition"),i=a.enter("label"),s=a.createTracker(n),u=s.move("[");return u+=s.move(a.safe(a.associationId(e),{before:u,after:"]",...s.current()})),u+=s.move("]: "),i(),!e.url||/[\0- \u007F]/.test(e.url)?(i=a.enter("destinationLiteral"),u+=s.move("<"),u+=s.move(a.safe(e.url,{before:u,after:">",...s.current()})),u+=s.move(">")):(i=a.enter("destinationRaw"),u+=s.move(a.safe(e.url,{before:u,after:e.title?" ":`
|
|
17
|
+
`,...s.current()}))),i(),e.title&&(i=a.enter(`title${o}`),u+=s.move(" "+r),u+=s.move(a.safe(e.title,{before:u,after:r,...s.current()})),u+=s.move(r),i()),l(),u}var ik=I(()=>{"use strict";xd()});function sk(e){let t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}var uk=I(()=>{"use strict"});function jr(e){return"&#x"+e.toString(16).toUpperCase()+";"}var vd=I(()=>{"use strict"});function Yn(e){if(e===null||pe(e)||xn(e))return 1;if(Eo(e))return 2}var bd=I(()=>{"use strict";_e()});function Wl(e,t,a){let n=Yn(e),r=Yn(t);return n===void 0?r===void 0?a==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:n===1?r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}var yg=I(()=>{"use strict";bd()});function wg(e,t,a,n){let r=sk(a),o=a.enter("emphasis"),l=a.createTracker(n),i=l.move(r),s=l.move(a.containerPhrasing(e,{after:r,before:i,...l.current()})),u=s.charCodeAt(0),c=Wl(n.before.charCodeAt(n.before.length-1),u,r);c.inside&&(s=jr(u)+s.slice(1));let d=s.charCodeAt(s.length-1),f=Wl(n.after.charCodeAt(0),d,r);f.inside&&(s=s.slice(0,-1)+jr(d));let p=l.move(r);return o(),a.attentionEncodeSurroundingInfo={after:f.outside,before:c.outside},i+s+p}function GB(e,t,a){return a.options.emphasis||"*"}var ck=I(()=>{"use strict";uk();vd();yg();wg.peek=GB});function Ro(e,t){let a=t||$B,n=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,r=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return fk(e,n,r)}function fk(e,t,a){if(WB(e)){if("value"in e)return e.type==="html"&&!a?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return dk(e.children,t,a)}return Array.isArray(e)?dk(e,t,a):""}function dk(e,t,a){let n=[],r=-1;for(;++r<e.length;)n[r]=fk(e[r],t,a);return n.join("")}function WB(e){return!!(e&&typeof e=="object")}var $B,pk=I(()=>{"use strict";$B={}});var Sd=I(()=>{"use strict";pk()});function mk(e,t){let a=!1;return Qn(e,function(n){if("value"in n&&/\r?\n|\r/.test(n.value)||n.type==="break")return a=!0,Lo}),!!((!e.depth||e.depth<3)&&Ro(e)&&(t.options.setext||a))}var hk=I(()=>{"use strict";pd();Sd()});function gk(e,t,a,n){let r=Math.max(Math.min(6,e.depth||1),1),o=a.createTracker(n);if(mk(e,a)){let c=a.enter("headingSetext"),d=a.enter("phrasing"),f=a.containerPhrasing(e,{...o.current(),before:`
|
|
18
18
|
`,after:`
|
|
19
19
|
`});return d(),c(),f+`
|
|
20
20
|
`+(r===1?"=":"-").repeat(f.length-(Math.max(f.lastIndexOf("\r"),f.lastIndexOf(`
|
|
21
|
-
`))+1))}let
|
|
22
|
-
`,...o.current()});return/^[\t ]/.test(u)&&(u=jr(u.charCodeAt(0))+u.slice(1)),u=u?i+" "+u:i,a.options.closeAtx&&(u+=" "+i),s(),l(),u}var Ak=C(()=>{"use strict";Cd();Ek()});function Mg(e){return e.value||""}function s3(){return"<"}var Rk=C(()=>{"use strict";Mg.peek=s3});function Ag(e,t,a,n){let r=Wi(a),o=r==='"'?"Quote":"Apostrophe",i=a.enter("image"),l=a.enter("label"),s=a.createTracker(n),u=s.move("![");return u+=s.move(a.safe(e.alt,{before:u,after:"]",...s.current()})),u+=s.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=a.enter("destinationLiteral"),u+=s.move("<"),u+=s.move(a.safe(e.url,{before:u,after:">",...s.current()})),u+=s.move(">")):(l=a.enter("destinationRaw"),u+=s.move(a.safe(e.url,{before:u,after:e.title?" ":")",...s.current()}))),l(),e.title&&(l=a.enter(`title${o}`),u+=s.move(" "+r),u+=s.move(a.safe(e.title,{before:u,after:r,...s.current()})),u+=s.move(r),l()),u+=s.move(")"),i(),u}function u3(){return"!"}var Dk=C(()=>{"use strict";Id();Ag.peek=u3});function Rg(e,t,a,n){let r=e.referenceType,o=a.enter("imageReference"),i=a.enter("label"),l=a.createTracker(n),s=l.move("!["),u=a.safe(e.alt,{before:s,after:"]",...l.current()});s+=l.move(u+"]["),i();let c=a.stack;a.stack=[],i=a.enter("reference");let d=a.safe(a.associationId(e),{before:s,after:"]",...l.current()});return i(),a.stack=c,o(),r==="full"||!u||u!==d?s+=l.move(d+"]"):r==="shortcut"?s=s.slice(0,-1):s+=l.move("]"),s}function c3(){return"!"}var _k=C(()=>{"use strict";Rg.peek=c3});function Dg(e,t,a){let n=e.value||"",r="`",o=-1;for(;new RegExp("(^|[^`])"+r+"([^`]|$)").test(n);)r+="`";for(/[^ \r\n]/.test(n)&&(/^[ \r\n]/.test(n)&&/[ \r\n]$/.test(n)||/^`|`$/.test(n))&&(n=" "+n+" ");++o<a.unsafe.length;){let i=a.unsafe[o],l=a.compilePattern(i),s;if(i.atBreak)for(;s=l.exec(n);){let u=s.index;n.charCodeAt(u)===10&&n.charCodeAt(u-1)===13&&u--,n=n.slice(0,u)+" "+n.slice(s.index+1)}}return r+n+r}function d3(){return"`"}var Ok=C(()=>{"use strict";Dg.peek=d3});function _g(e,t){let a=Ro(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(a===e.url||"mailto:"+a===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}var Pk=C(()=>{"use strict";Ld()});function Og(e,t,a,n){let r=Wi(a),o=r==='"'?"Quote":"Apostrophe",i=a.createTracker(n),l,s;if(_g(e,a)){let c=a.stack;a.stack=[],l=a.enter("autolink");let d=i.move("<");return d+=i.move(a.containerPhrasing(e,{before:d,after:">",...i.current()})),d+=i.move(">"),l(),a.stack=c,d}l=a.enter("link"),s=a.enter("label");let u=i.move("[");return u+=i.move(a.containerPhrasing(e,{before:u,after:"](",...i.current()})),u+=i.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=a.enter("destinationLiteral"),u+=i.move("<"),u+=i.move(a.safe(e.url,{before:u,after:">",...i.current()})),u+=i.move(">")):(s=a.enter("destinationRaw"),u+=i.move(a.safe(e.url,{before:u,after:e.title?" ":")",...i.current()}))),s(),e.title&&(s=a.enter(`title${o}`),u+=i.move(" "+r),u+=i.move(a.safe(e.title,{before:u,after:r,...i.current()})),u+=i.move(r),s()),u+=i.move(")"),l(),u}function f3(e,t,a){return _g(e,a)?"<":"["}var Nk=C(()=>{"use strict";Id();Pk();Og.peek=f3});function Pg(e,t,a,n){let r=e.referenceType,o=a.enter("linkReference"),i=a.enter("label"),l=a.createTracker(n),s=l.move("["),u=a.containerPhrasing(e,{before:s,after:"]",...l.current()});s+=l.move(u+"]["),i();let c=a.stack;a.stack=[],i=a.enter("reference");let d=a.safe(a.associationId(e),{before:s,after:"]",...l.current()});return i(),a.stack=c,o(),r==="full"||!u||u!==d?s+=l.move(d+"]"):r==="shortcut"?s=s.slice(0,-1):s+=l.move("]"),s}function p3(){return"["}var Bk=C(()=>{"use strict";Pg.peek=p3});function Xi(e){let t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}var Td=C(()=>{"use strict"});function Uk(e){let t=Xi(e),a=e.options.bulletOther;if(!a)return t==="*"?"-":"*";if(a!=="*"&&a!=="+"&&a!=="-")throw new Error("Cannot serialize items with `"+a+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(a===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+a+"`) to be different");return a}var Fk=C(()=>{"use strict";Td()});function zk(e){let t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}var qk=C(()=>{"use strict"});function Ed(e){let t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}var Ng=C(()=>{"use strict"});function Hk(e,t,a,n){let r=a.enter("list"),o=a.bulletCurrent,i=e.ordered?zk(a):Xi(a),l=e.ordered?i==="."?")":".":Uk(a),s=t&&a.bulletLastUsed?i===a.bulletLastUsed:!1;if(!e.ordered){let c=e.children?e.children[0]:void 0;if((i==="*"||i==="-")&&c&&(!c.children||!c.children[0])&&a.stack[a.stack.length-1]==="list"&&a.stack[a.stack.length-2]==="listItem"&&a.stack[a.stack.length-3]==="list"&&a.stack[a.stack.length-4]==="listItem"&&a.indexStack[a.indexStack.length-1]===0&&a.indexStack[a.indexStack.length-2]===0&&a.indexStack[a.indexStack.length-3]===0&&(s=!0),Ed(a)===i&&c){let d=-1;for(;++d<e.children.length;){let f=e.children[d];if(f&&f.type==="listItem"&&f.children&&f.children[0]&&f.children[0].type==="thematicBreak"){s=!0;break}}}}s&&(i=l),a.bulletCurrent=i;let u=a.containerFlow(e,n);return a.bulletLastUsed=i,a.bulletCurrent=o,r(),u}var jk=C(()=>{"use strict";Td();Fk();qk();Ng()});function Vk(e){let 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}var Gk=C(()=>{"use strict"});function Wk(e,t,a,n){let r=Vk(a),o=a.bulletCurrent||Xi(a);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(a.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let i=o.length+1;(r==="tab"||r==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(i=Math.ceil(i/4)*4);let l=a.createTracker(n);l.move(o+" ".repeat(i-o.length)),l.shift(i);let s=a.enter("listItem"),u=a.indentLines(a.containerFlow(e,l.current()),c);return s(),u;function c(d,f,p){return f?(p?"":" ".repeat(i))+d:(p?o:o+" ".repeat(i-o.length))+d}}var $k=C(()=>{"use strict";Td();Gk()});function Xk(e,t,a,n){let r=a.enter("paragraph"),o=a.enter("phrasing"),i=a.containerPhrasing(e,n);return o(),r(),i}var Kk=C(()=>{"use strict"});var Bg,Zk=C(()=>{"use strict";hd();Bg=Fr(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"])});var Qk=C(()=>{"use strict";Zk()});function Yk(e,t,a,n){return(e.children.some(function(i){return Bg(i)})?a.containerPhrasing:a.containerFlow).call(a,e,n)}var Jk=C(()=>{"use strict";Qk()});function e1(e){let t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}var t1=C(()=>{"use strict"});function Ug(e,t,a,n){let r=e1(a),o=a.enter("strong"),i=a.createTracker(n),l=i.move(r+r),s=i.move(a.containerPhrasing(e,{after:r,before:l,...i.current()})),u=s.charCodeAt(0),c=$i(n.before.charCodeAt(n.before.length-1),u,r);c.inside&&(s=jr(u)+s.slice(1));let d=s.charCodeAt(s.length-1),f=$i(n.after.charCodeAt(0),d,r);f.inside&&(s=s.slice(0,-1)+jr(d));let p=i.move(r+r);return o(),a.attentionEncodeSurroundingInfo={after:f.outside,before:c.outside},l+s+p}function m3(e,t,a){return a.options.strong||"*"}var a1=C(()=>{"use strict";t1();Cd();Tg();Ug.peek=m3});function n1(e,t,a,n){return a.safe(e.value,n)}var r1=C(()=>{"use strict"});function o1(e){let 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}var i1=C(()=>{"use strict"});function l1(e,t,a){let n=(Ed(a)+(a.options.ruleSpaces?" ":"")).repeat(o1(a));return a.options.ruleSpaces?n.slice(0,-1):n}var s1=C(()=>{"use strict";i1();Ng()});var Us,u1=C(()=>{"use strict";ik();ck();wk();vk();Ik();Ak();Rk();Dk();_k();Ok();Nk();Bk();jk();$k();Kk();Jk();a1();r1();s1();Us={blockquote:ok,break:Lg,code:yk,definition:xk,emphasis:Eg,hardBreak:Lg,heading:Mk,html:Mg,image:Ag,imageReference:Rg,inlineCode:Dg,link:Og,linkReference:Pg,list:Hk,listItem:Wk,paragraph:Xk,root:Yk,strong:Ug,text:n1,thematicBreak:l1}});function Ki(e){let t="&"+e+";";c1.innerHTML=t;let a=c1.textContent;return a.charCodeAt(a.length-1)===59&&e!=="semi"||a===t?!1:a}var c1,Md=C(()=>{"use strict";c1=document.createElement("i")});function Ad(e,t){let a=Number.parseInt(e,t);return a<9||a===11||a>13&&a<32||a>126&&a<160||a>55295&&a<57344||a>64975&&a<65008||(a&65535)===65535||(a&65535)===65534||a>1114111?"\uFFFD":String.fromCodePoint(a)}var Fg=C(()=>{"use strict"});function d1(e){return e.replace(h3,g3)}function g3(e,t,a){if(t)return t;if(a.charCodeAt(0)===35){let r=a.charCodeAt(1),o=r===120||r===88;return Ad(a.slice(o?2:1),o?16:10)}return Ki(a)||e}var h3,f1=C(()=>{"use strict";Md();Fg();h3=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi});var zg=C(()=>{"use strict";u1()});function Hg(){return{enter:{table:y3,tableData:p1,tableHeader:p1,tableRow:x3},exit:{codeText:v3,table:w3,tableData:qg,tableHeader:qg,tableRow:qg}}}function y3(e){let t=e._align;this.enter({type:"table",align:t.map(function(a){return a==="none"?null:a}),children:[]},e),this.data.inTable=!0}function w3(e){this.exit(e),this.data.inTable=void 0}function x3(e){this.enter({type:"tableRow",children:[]},e)}function qg(e){this.exit(e)}function p1(e){this.enter({type:"tableCell",children:[]},e)}function v3(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,b3));let a=this.stack[this.stack.length-1];a.type,a.value=t,this.exit(e)}function b3(e,t){return t==="|"?t:e}function jg(e){let t=e||{},a=t.tableCellPadding,n=t.tablePipeAlign,r=t.stringLength,o=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
23
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:f,table:
|
|
24
|
-
`))}function s(p,m,x,I){let y=x.enter("tableCell"),w=x.enter("phrasing"),g=x.containerPhrasing(p,{...I,before:o,after:o});return w(),y(),g}function u(p,m){return nk(p,{align:m,alignDelimiters:n,padding:a,stringLength:r})}function c(p,m,x){let I=p.children,y=-1,w=[],g=m.enter("table");for(;++y<I.length;)w[y]=d(I[y],m,x);return g(),w}function d(p,m,x){let I=p.children,y=-1,w=[],g=m.enter("tableRow");for(;++y<I.length;)w[y]=s(I[y],p,m,x);return g(),w}function f(p,m,x){let I=Us.inlineCode(p,m,x);return x.stack.includes("tableCell")&&(I=I.replace(/\|/g,"\\$&")),I}}var m1=C(()=>{"use strict";rk();zg()});var h1=C(()=>{"use strict";m1()});function Vg(){return{exit:{taskListCheckValueChecked:g1,taskListCheckValueUnchecked:g1,paragraph:S3}}}function Gg(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:I3}}}function g1(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function S3(e){let t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){let a=this.stack[this.stack.length-1];a.type;let n=a.children[0];if(n&&n.type==="text"){let r=t.children,o=-1,i;for(;++o<r.length;){let l=r[o];if(l.type==="paragraph"){i=l;break}}i===a&&(n.value=n.value.slice(1),n.value.length===0?a.children.shift():a.position&&n.position&&typeof n.position.start.offset=="number"&&(n.position.start.column++,n.position.start.offset++,a.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function I3(e,t,a,n){let r=e.children[0],o=typeof e.checked=="boolean"&&r&&r.type==="paragraph",i="["+(e.checked?"x":" ")+"] ",l=a.createTracker(n);o&&l.move(i);let s=Us.listItem(e,t,a,{...n,...l.current()});return o&&(s=s.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),s;function u(c){return c+i}}var y1=C(()=>{"use strict";zg()});var w1=C(()=>{"use strict";y1()});function Wg(){return[vg(),Sg(),Cg(),Hg(),Vg()]}function $g(e){return{extensions:[bg(),Ig(e),kg(),jg(e),Gg()]}}var x1=C(()=>{"use strict";XC();YC();tk();h1();w1()});var v1=C(()=>{"use strict";x1()});function Lt(e,t,a,n){let r=e.length,o=0,i;if(t<0?t=-t>r?0:r+t:t=t>r?r:t,a=a>0?a:0,n.length<1e4)i=Array.from(n),i.unshift(t,a),e.splice(...i);else for(a&&e.splice(t,a);o<n.length;)i=n.slice(o,o+1e4),i.unshift(t,0),e.splice(...i),o+=1e4,t+=1e4}function ra(e,t){return e.length>0?(Lt(e,e.length,0,t),e):t}var tr=C(()=>{"use strict"});function Rd(e){let t={},a=-1;for(;++a<e.length;)C3(t,e[a]);return t}function C3(e,t){let a;for(a in t){let r=(b1.call(e,a)?e[a]:void 0)||(e[a]={}),o=t[a],i;if(o)for(i in o){b1.call(r,i)||(r[i]=[]);let l=o[i];k3(r[i],Array.isArray(l)?l:l?[l]:[])}}}function k3(e,t){let a=-1,n=[];for(;++a<t.length;)(t[a].add==="after"?e:n).push(t[a]);Lt(e,0,0,n)}var b1,Xg=C(()=>{"use strict";tr();b1={}.hasOwnProperty});function Zg(){return{text:In}}function E3(e,t,a){let n=this,r,o;return i;function i(d){return!Kg(d)||!M1.call(n,n.previous)||Qg(n.events)?a(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(d))}function l(d){return Kg(d)?(e.consume(d),l):d===64?(e.consume(d),s):a(d)}function s(d){return d===46?e.check(T3,c,u)(d):d===45||d===95||wt(d)?(o=!0,e.consume(d),s):c(d)}function u(d){return e.consume(d),r=!0,s}function c(d){return o&&r&&Nt(n.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):a(d)}}function M3(e,t,a){let n=this;return r;function r(i){return i!==87&&i!==119||!T1.call(n,n.previous)||Qg(n.events)?a(i):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(L3,e.attempt(S1,e.attempt(I1,o),a),a)(i))}function o(i){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(i)}}function A3(e,t,a){let n=this,r="",o=!1;return i;function i(d){return(d===72||d===104)&&E1.call(n,n.previous)&&!Qg(n.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),r+=String.fromCodePoint(d),e.consume(d),l):a(d)}function l(d){if(Nt(d)&&r.length<5)return r+=String.fromCodePoint(d),e.consume(d),l;if(d===58){let f=r.toLowerCase();if(f==="http"||f==="https")return e.consume(d),s}return a(d)}function s(d){return d===47?(e.consume(d),o?u:(o=!0,s)):a(d)}function u(d){return d===null||Mo(d)||we(d)||Sn(d)||Ao(d)?a(d):e.attempt(S1,e.attempt(I1,c),a)(d)}function c(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function R3(e,t,a){let n=0;return r;function r(i){return(i===87||i===119)&&n<3?(n++,e.consume(i),r):i===46&&n===3?(e.consume(i),o):a(i)}function o(i){return i===null?a(i):t(i)}}function D3(e,t,a){let n,r,o;return i;function i(u){return u===46||u===95?e.check(C1,s,l)(u):u===null||we(u)||Sn(u)||u!==45&&Ao(u)?s(u):(o=!0,e.consume(u),i)}function l(u){return u===95?n=!0:(r=n,n=void 0),e.consume(u),i}function s(u){return r||n||!o?a(u):t(u)}}function _3(e,t){let a=0,n=0;return r;function r(i){return i===40?(a++,e.consume(i),r):i===41&&n<a?o(i):i===33||i===34||i===38||i===39||i===41||i===42||i===44||i===46||i===58||i===59||i===60||i===63||i===93||i===95||i===126?e.check(C1,t,o)(i):i===null||we(i)||Sn(i)?t(i):(e.consume(i),r)}function o(i){return i===41&&n++,e.consume(i),r}}function O3(e,t,a){return n;function n(l){return l===33||l===34||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===63||l===95||l===126?(e.consume(l),n):l===38?(e.consume(l),o):l===93?(e.consume(l),r):l===60||l===null||we(l)||Sn(l)?t(l):a(l)}function r(l){return l===null||l===40||l===91||we(l)||Sn(l)?t(l):n(l)}function o(l){return Nt(l)?i(l):a(l)}function i(l){return l===59?(e.consume(l),n):Nt(l)?(e.consume(l),i):a(l)}}function P3(e,t,a){return n;function n(o){return e.consume(o),r}function r(o){return wt(o)?a(o):t(o)}}function T1(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||we(e)}function E1(e){return!Nt(e)}function M1(e){return!(e===47||Kg(e))}function Kg(e){return e===43||e===45||e===46||e===95||wt(e)}function Qg(e){let t=e.length,a=!1;for(;t--;){let n=e[t][1];if((n.type==="labelLink"||n.type==="labelImage")&&!n._balanced){a=!0;break}if(n._gfmAutolinkLiteralWalkedInto){a=!1;break}}return e.length>0&&!a&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}var L3,S1,I1,C1,T3,k1,L1,ar,In,Do,A1=C(()=>{"use strict";Ae();L3={tokenize:R3,partial:!0},S1={tokenize:D3,partial:!0},I1={tokenize:_3,partial:!0},C1={tokenize:O3,partial:!0},T3={tokenize:P3,partial:!0},k1={name:"wwwAutolink",tokenize:M3,previous:T1},L1={name:"protocolAutolink",tokenize:A3,previous:E1},ar={name:"emailAutolink",tokenize:E3,previous:M1},In={};Do=48;for(;Do<123;)In[Do]=ar,Do++,Do===58?Do=65:Do===91&&(Do=97);In[43]=ar;In[45]=ar;In[46]=ar;In[95]=ar;In[72]=[ar,L1];In[104]=[ar,L1];In[87]=[ar,k1];In[119]=[ar,k1]});function Za(e){let t=[],a=-1,n=0,r=0;for(;++a<e.length;){let o=e.charCodeAt(a),i="";if(o===37&&wt(e.charCodeAt(a+1))&&wt(e.charCodeAt(a+2)))r=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(i=String.fromCharCode(o));else if(o>55295&&o<57344){let l=e.charCodeAt(a+1);o<56320&&l>56319&&l<57344?(i=String.fromCharCode(o,l),r=1):i="\uFFFD"}else i=String.fromCharCode(o);i&&(t.push(e.slice(n,a),encodeURIComponent(i)),n=a+r+1,i=""),r&&(a+=r,r=0)}return t.join("")+e.slice(n)}var _o=C(()=>{"use strict";Ae()});var R1=C(()=>{"use strict";A1()});function Vr(e,t,a){let n=[],r=-1;for(;++r<e.length;){let o=e[r].resolveAll;o&&!n.includes(o)&&(t=o(t,a),n.push(o))}return t}var Fs=C(()=>{"use strict"});function N3(e,t){let a=-1,n,r,o,i,l,s,u,c;for(;++a<e.length;)if(e[a][0]==="enter"&&e[a][1].type==="attentionSequence"&&e[a][1]._close){for(n=a;n--;)if(e[n][0]==="exit"&&e[n][1].type==="attentionSequence"&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[a][1]).charCodeAt(0)){if((e[n][1]._close||e[a][1]._open)&&(e[a][1].end.offset-e[a][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[a][1].end.offset-e[a][1].start.offset)%3))continue;s=e[n][1].end.offset-e[n][1].start.offset>1&&e[a][1].end.offset-e[a][1].start.offset>1?2:1;let d={...e[n][1].end},f={...e[a][1].start};D1(d,-s),D1(f,s),i={type:s>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},l={type:s>1?"strongSequence":"emphasisSequence",start:{...e[a][1].start},end:f},o={type:s>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[a][1].start}},r={type:s>1?"strong":"emphasis",start:{...i.start},end:{...l.end}},e[n][1].end={...i.start},e[a][1].start={...l.end},u=[],e[n][1].end.offset-e[n][1].start.offset&&(u=ra(u,[["enter",e[n][1],t],["exit",e[n][1],t]])),u=ra(u,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",o,t]]),u=ra(u,Vr(t.parser.constructs.insideSpan.null,e.slice(n+1,a),t)),u=ra(u,[["exit",o,t],["enter",l,t],["exit",l,t],["exit",r,t]]),e[a][1].end.offset-e[a][1].start.offset?(c=2,u=ra(u,[["enter",e[a][1],t],["exit",e[a][1],t]])):c=0,Lt(e,n-1,a-n+3,u),a=n+u.length-c-2;break}}for(a=-1;++a<e.length;)e[a][1].type==="attentionSequence"&&(e[a][1].type="data");return e}function B3(e,t){let a=this.parser.constructs.attentionMarkers.null,n=this.previous,r=er(n),o;return i;function i(s){return o=s,e.enter("attentionSequence"),l(s)}function l(s){if(s===o)return e.consume(s),l;let u=e.exit("attentionSequence"),c=er(s),d=!c||c===2&&r||a.includes(s),f=!r||r===2&&c||a.includes(n);return u._open=!!(o===42?d:d&&(r||!f)),u._close=!!(o===42?f:f&&(c||!d)),t(s)}}function D1(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var zs,_1=C(()=>{"use strict";tr();kd();Fs();zs={name:"attention",resolveAll:N3,tokenize:B3}});function U3(e,t,a){let n=0;return r;function r(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(p){return Nt(p)?(e.consume(p),i):p===64?a(p):u(p)}function i(p){return p===43||p===45||p===46||wt(p)?(n=1,l(p)):u(p)}function l(p){return p===58?(e.consume(p),n=0,s):(p===43||p===45||p===46||wt(p))&&n++<32?(e.consume(p),l):(n=0,u(p))}function s(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||Mo(p)?a(p):(e.consume(p),s)}function u(p){return p===64?(e.consume(p),c):zC(p)?(e.consume(p),u):a(p)}function c(p){return wt(p)?d(p):a(p)}function d(p){return p===46?(e.consume(p),n=0,c):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):f(p)}function f(p){if((p===45||wt(p))&&n++<63){let m=p===45?f:d;return e.consume(p),m}return a(p)}}var Yg,O1=C(()=>{"use strict";Ae();Yg={name:"autolink",tokenize:U3}});function J(e,t,a,n){let r=n?n-1:Number.POSITIVE_INFINITY,o=0;return i;function i(s){return te(s)?(e.enter(a),l(s)):t(s)}function l(s){return te(s)&&o++<r?(e.consume(s),l):(e.exit(a),t(s))}}var Tt=C(()=>{"use strict";Ae()});function F3(e,t,a){return n;function n(o){return te(o)?J(e,r,"linePrefix")(o):r(o)}function r(o){return o===null||V(o)?t(o):a(o)}}var Cn,Dd=C(()=>{"use strict";Tt();Ae();Cn={partial:!0,tokenize:F3}});function z3(e,t,a){let n=this;return r;function r(i){if(i===62){let l=n.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(i),e.exit("blockQuoteMarker"),o}return a(i)}function o(i){return te(i)?(e.enter("blockQuotePrefixWhitespace"),e.consume(i),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(i))}}function q3(e,t,a){let n=this;return r;function r(i){return te(i)?J(e,o,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):o(i)}function o(i){return e.attempt(_d,t,a)(i)}}function H3(e){e.exit("blockQuote")}var _d,P1=C(()=>{"use strict";Tt();Ae();_d={continuation:{tokenize:q3},exit:H3,name:"blockQuote",tokenize:z3}});function j3(e,t,a){return n;function n(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),r}function r(o){return HC(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):a(o)}}var Od,N1=C(()=>{"use strict";Ae();Od={name:"characterEscape",tokenize:j3}});function V3(e,t,a){let n=this,r=0,o,i;return l;function l(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),s}function s(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),o=31,i=wt,c(d))}function u(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,i=qC,c):(e.enter("characterReferenceValue"),o=7,i=Bs,c(d))}function c(d){if(d===59&&r){let f=e.exit("characterReferenceValue");return i===wt&&!Ki(n.sliceSerialize(f))?a(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return i(d)&&r++<o?(e.consume(d),c):a(d)}}var Pd,B1=C(()=>{"use strict";Md();Ae();Pd={name:"characterReference",tokenize:V3}});function G3(e,t,a){let n=this,r={partial:!0,tokenize:T},o=0,i=0,l;return s;function s(S){return u(S)}function u(S){let M=n.events[n.events.length-1];return o=M&&M[1].type==="linePrefix"?M[2].sliceSerialize(M[1],!0).length:0,l=S,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(S)}function c(S){return S===l?(i++,e.consume(S),c):i<3?a(S):(e.exit("codeFencedFenceSequence"),te(S)?J(e,d,"whitespace")(S):d(S))}function d(S){return S===null||V(S)?(e.exit("codeFencedFence"),n.interrupt?t(S):e.check(U1,x,b)(S)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(S))}function f(S){return S===null||V(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(S)):te(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),J(e,p,"whitespace")(S)):S===96&&S===l?a(S):(e.consume(S),f)}function p(S){return S===null||V(S)?d(S):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(S))}function m(S){return S===null||V(S)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(S)):S===96&&S===l?a(S):(e.consume(S),m)}function x(S){return e.attempt(r,b,I)(S)}function I(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),y}function y(S){return o>0&&te(S)?J(e,w,"linePrefix",o+1)(S):w(S)}function w(S){return S===null||V(S)?e.check(U1,x,b)(S):(e.enter("codeFlowValue"),g(S))}function g(S){return S===null||V(S)?(e.exit("codeFlowValue"),w(S)):(e.consume(S),g)}function b(S){return e.exit("codeFenced"),t(S)}function T(S,M,R){let _=0;return k;function k(A){return S.enter("lineEnding"),S.consume(A),S.exit("lineEnding"),G}function G(A){return S.enter("codeFencedFence"),te(A)?J(S,B,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):B(A)}function B(A){return A===l?(S.enter("codeFencedFenceSequence"),U(A)):R(A)}function U(A){return A===l?(_++,S.consume(A),U):_>=i?(S.exit("codeFencedFenceSequence"),te(A)?J(S,W,"whitespace")(A):W(A)):R(A)}function W(A){return A===null||V(A)?(S.exit("codeFencedFence"),M(A)):R(A)}}}function W3(e,t,a){let n=this;return r;function r(i){return i===null?a(i):(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),o)}function o(i){return n.parser.lazy[n.now().line]?a(i):t(i)}}var U1,Nd,F1=C(()=>{"use strict";Tt();Ae();U1={partial:!0,tokenize:W3},Nd={concrete:!0,name:"codeFenced",tokenize:G3}});function X3(e,t,a){let n=this;return r;function r(u){return e.enter("codeIndented"),J(e,o,"linePrefix",5)(u)}function o(u){let c=n.events[n.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?i(u):a(u)}function i(u){return u===null?s(u):V(u)?e.attempt($3,i,s)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||V(u)?(e.exit("codeFlowValue"),i(u)):(e.consume(u),l)}function s(u){return e.exit("codeIndented"),t(u)}}function K3(e,t,a){let n=this;return r;function r(i){return n.parser.lazy[n.now().line]?a(i):V(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),r):J(e,o,"linePrefix",5)(i)}function o(i){let l=n.events[n.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(i):V(i)?r(i):a(i)}}var qs,$3,z1=C(()=>{"use strict";Tt();Ae();qs={name:"codeIndented",tokenize:X3},$3={partial:!0,tokenize:K3}});function Z3(e){let t=e.length-4,a=3,n,r;if((e[a][1].type==="lineEnding"||e[a][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(n=a;++n<t;)if(e[n][1].type==="codeTextData"){e[a][1].type="codeTextPadding",e[t][1].type="codeTextPadding",a+=2,t-=2;break}}for(n=a-1,t++;++n<=t;)r===void 0?n!==t&&e[n][1].type!=="lineEnding"&&(r=n):(n===t||e[n][1].type==="lineEnding")&&(e[r][1].type="codeTextData",n!==r+2&&(e[r][1].end=e[n-1][1].end,e.splice(r+2,n-r-2),t-=n-r-2,n=r+2),r=void 0);return e}function Q3(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Y3(e,t,a){let n=this,r=0,o,i;return l;function l(f){return e.enter("codeText"),e.enter("codeTextSequence"),s(f)}function s(f){return f===96?(e.consume(f),r++,s):(e.exit("codeTextSequence"),u(f))}function u(f){return f===null?a(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),u):f===96?(i=e.enter("codeTextSequence"),o=0,d(f)):V(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),u):(e.enter("codeTextData"),c(f))}function c(f){return f===null||f===32||f===96||V(f)?(e.exit("codeTextData"),u(f)):(e.consume(f),c)}function d(f){return f===96?(e.consume(f),o++,d):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(i.type="codeTextData",c(f))}}var Jg,q1=C(()=>{"use strict";Ae();Jg={name:"codeText",previous:Q3,resolve:Z3,tokenize:Y3}});function Hs(e,t){let a=0;if(t.length<1e4)e.push(...t);else for(;a<t.length;)e.push(...t.slice(a,a+1e4)),a+=1e4}var Bd,H1=C(()=>{"use strict";Bd=class{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,a){let n=a??Number.POSITIVE_INFINITY;return n<this.left.length?this.left.slice(t,n):t>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(t,a,n){let r=a||0;this.setCursor(Math.trunc(t));let o=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return n&&Hs(this.left,n),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),Hs(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Hs(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){let a=this.left.splice(t,Number.POSITIVE_INFINITY);Hs(this.right,a.reverse())}else{let a=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Hs(this.left,a.reverse())}}}});function Ud(e){let t={},a=-1,n,r,o,i,l,s,u,c=new Bd(e);for(;++a<c.length;){for(;a in t;)a=t[a];if(n=c.get(a),a&&n[1].type==="chunkFlow"&&c.get(a-1)[1].type==="listItemPrefix"&&(s=n[1]._tokenizer.events,o=0,o<s.length&&s[o][1].type==="lineEndingBlank"&&(o+=2),o<s.length&&s[o][1].type==="content"))for(;++o<s.length&&s[o][1].type!=="content";)s[o][1].type==="chunkText"&&(s[o][1]._isInFirstContentOfListItem=!0,o++);if(n[0]==="enter")n[1].contentType&&(Object.assign(t,J3(c,a)),a=t[a],u=!0);else if(n[1]._container){for(o=a,r=void 0;o--;)if(i=c.get(o),i[1].type==="lineEnding"||i[1].type==="lineEndingBlank")i[0]==="enter"&&(r&&(c.get(r)[1].type="lineEndingBlank"),i[1].type="lineEnding",r=o);else if(!(i[1].type==="linePrefix"||i[1].type==="listItemIndent"))break;r&&(n[1].end={...c.get(r)[1].start},l=c.slice(r,a),l.unshift(n),c.splice(r,a-r+1,l))}}return Lt(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!u}function J3(e,t){let a=e.get(t)[1],n=e.get(t)[2],r=t-1,o=[],i=a._tokenizer;i||(i=n.parser[a.contentType](a.start),a._contentTypeTextTrailing&&(i._contentTypeTextTrailing=!0));let l=i.events,s=[],u={},c,d,f=-1,p=a,m=0,x=0,I=[x];for(;p;){for(;e.get(++r)[1]!==p;);o.push(r),p._tokenizer||(c=n.sliceStream(p),p.next||c.push(null),d&&i.defineSkip(p.start),p._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(c),p._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=a;++f<l.length;)l[f][0]==="exit"&&l[f-1][0]==="enter"&&l[f][1].type===l[f-1][1].type&&l[f][1].start.line!==l[f][1].end.line&&(x=f+1,I.push(x),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(i.events=[],p?(p._tokenizer=void 0,p.previous=void 0):I.pop(),f=I.length;f--;){let y=l.slice(I[f],I[f+1]),w=o.pop();s.push([w,w+y.length-1]),e.splice(w,2,y)}for(s.reverse(),f=-1;++f<s.length;)u[m+s[f][0]]=m+s[f][1],m+=s[f][1]-s[f][0]-1;return u}var ey=C(()=>{"use strict";tr();H1()});function tU(e){return Ud(e),e}function aU(e,t){let a;return n;function n(l){return e.enter("content"),a=e.enter("chunkContent",{contentType:"content"}),r(l)}function r(l){return l===null?o(l):V(l)?e.check(eU,i,o)(l):(e.consume(l),r)}function o(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function i(l){return e.consume(l),e.exit("chunkContent"),a.next=e.enter("chunkContent",{contentType:"content",previous:a}),a=a.next,r}}function nU(e,t,a){let n=this;return r;function r(i){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),J(e,o,"linePrefix")}function o(i){if(i===null||V(i))return a(i);let l=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(i):e.interrupt(n.parser.constructs.flow,a,t)(i)}}var ty,eU,j1=C(()=>{"use strict";Tt();Ae();ey();ty={resolve:tU,tokenize:aU},eU={partial:!0,tokenize:nU}});function Fd(e,t,a,n,r,o,i,l,s){let u=s||Number.POSITIVE_INFINITY,c=0;return d;function d(y){return y===60?(e.enter(n),e.enter(r),e.enter(o),e.consume(y),e.exit(o),f):y===null||y===32||y===41||Mo(y)?a(y):(e.enter(n),e.enter(i),e.enter(l),e.enter("chunkString",{contentType:"string"}),x(y))}function f(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(r),e.exit(n),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===62?(e.exit("chunkString"),e.exit(l),f(y)):y===null||y===60||V(y)?a(y):(e.consume(y),y===92?m:p)}function m(y){return y===60||y===62||y===92?(e.consume(y),p):p(y)}function x(y){return!c&&(y===null||y===41||we(y))?(e.exit("chunkString"),e.exit(l),e.exit(i),e.exit(n),t(y)):c<u&&y===40?(e.consume(y),c++,x):y===41?(e.consume(y),c--,x):y===null||y===32||y===40||Mo(y)?a(y):(e.consume(y),y===92?I:x)}function I(y){return y===40||y===41||y===92?(e.consume(y),x):x(y)}}var ay=C(()=>{"use strict";Ae()});function zd(e,t,a,n,r,o){let i=this,l=0,s;return u;function u(p){return e.enter(n),e.enter(r),e.consume(p),e.exit(r),e.enter(o),c}function c(p){return l>999||p===null||p===91||p===93&&!s||p===94&&!l&&"_hiddenFootnoteSupport"in i.parser.constructs?a(p):p===93?(e.exit(o),e.enter(r),e.consume(p),e.exit(r),e.exit(n),t):V(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===null||p===91||p===93||V(p)||l++>999?(e.exit("chunkString"),c(p)):(e.consume(p),s||(s=!te(p)),p===92?f:d)}function f(p){return p===91||p===92||p===93?(e.consume(p),l++,d):d(p)}}var ny=C(()=>{"use strict";Ae()});function qd(e,t,a,n,r,o){let i;return l;function l(f){return f===34||f===39||f===40?(e.enter(n),e.enter(r),e.consume(f),e.exit(r),i=f===40?41:f,s):a(f)}function s(f){return f===i?(e.enter(r),e.consume(f),e.exit(r),e.exit(n),t):(e.enter(o),u(f))}function u(f){return f===i?(e.exit(o),s(i)):f===null?a(f):V(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),J(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===i||f===null||V(f)?(e.exit("chunkString"),u(f)):(e.consume(f),f===92?d:c)}function d(f){return f===i||f===92?(e.consume(f),c):c(f)}}var ry=C(()=>{"use strict";Tt();Ae()});function Oo(e,t){let a;return n;function n(r){return V(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),a=!0,n):te(r)?J(e,n,a?"linePrefix":"lineSuffix")(r):t(r)}}var oy=C(()=>{"use strict";Tt();Ae()});function oU(e,t,a){let n=this,r;return o;function o(p){return e.enter("definition"),i(p)}function i(p){return zd.call(n,e,l,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return r=Qt(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),s):a(p)}function s(p){return we(p)?Oo(e,u)(p):u(p)}function u(p){return Fd(e,c,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function c(p){return e.attempt(rU,d,d)(p)}function d(p){return te(p)?J(e,f,"whitespace")(p):f(p)}function f(p){return p===null||V(p)?(e.exit("definition"),n.parser.defined.push(r),t(p)):a(p)}}function iU(e,t,a){return n;function n(l){return we(l)?Oo(e,r)(l):a(l)}function r(l){return qd(e,o,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function o(l){return te(l)?J(e,i,"whitespace")(l):i(l)}function i(l){return l===null||V(l)?t(l):a(l)}}var iy,rU,V1=C(()=>{"use strict";ay();ny();Tt();ry();oy();Ae();Gi();iy={name:"definition",tokenize:oU},rU={partial:!0,tokenize:iU}});function lU(e,t,a){return n;function n(o){return e.enter("hardBreakEscape"),e.consume(o),r}function r(o){return V(o)?(e.exit("hardBreakEscape"),t(o)):a(o)}}var ly,G1=C(()=>{"use strict";Ae();ly={name:"hardBreakEscape",tokenize:lU}});function sU(e,t){let a=e.length-2,n=3,r,o;return e[n][1].type==="whitespace"&&(n+=2),a-2>n&&e[a][1].type==="whitespace"&&(a-=2),e[a][1].type==="atxHeadingSequence"&&(n===a-1||a-4>n&&e[a-2][1].type==="whitespace")&&(a-=n+1===a?2:4),a>n&&(r={type:"atxHeadingText",start:e[n][1].start,end:e[a][1].end},o={type:"chunkText",start:e[n][1].start,end:e[a][1].end,contentType:"text"},Lt(e,n,a-n+1,[["enter",r,t],["enter",o,t],["exit",o,t],["exit",r,t]])),e}function uU(e,t,a){let n=0;return r;function r(c){return e.enter("atxHeading"),o(c)}function o(c){return e.enter("atxHeadingSequence"),i(c)}function i(c){return c===35&&n++<6?(e.consume(c),i):c===null||we(c)?(e.exit("atxHeadingSequence"),l(c)):a(c)}function l(c){return c===35?(e.enter("atxHeadingSequence"),s(c)):c===null||V(c)?(e.exit("atxHeading"),t(c)):te(c)?J(e,l,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function s(c){return c===35?(e.consume(c),s):(e.exit("atxHeadingSequence"),l(c))}function u(c){return c===null||c===35||we(c)?(e.exit("atxHeadingText"),l(c)):(e.consume(c),u)}}var sy,W1=C(()=>{"use strict";Tt();Ae();tr();sy={name:"headingAtx",resolve:sU,tokenize:uU}});var $1,uy,X1=C(()=>{"use strict";$1=["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"],uy=["pre","script","style","textarea"]});function fU(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 pU(e,t,a){let n=this,r,o,i,l,s;return u;function u(L){return c(L)}function c(L){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(L),d}function d(L){return L===33?(e.consume(L),f):L===47?(e.consume(L),o=!0,x):L===63?(e.consume(L),r=3,n.interrupt?t:v):Nt(L)?(e.consume(L),i=String.fromCharCode(L),I):a(L)}function f(L){return L===45?(e.consume(L),r=2,p):L===91?(e.consume(L),r=5,l=0,m):Nt(L)?(e.consume(L),r=4,n.interrupt?t:v):a(L)}function p(L){return L===45?(e.consume(L),n.interrupt?t:v):a(L)}function m(L){let ke="CDATA[";return L===ke.charCodeAt(l++)?(e.consume(L),l===ke.length?n.interrupt?t:B:m):a(L)}function x(L){return Nt(L)?(e.consume(L),i=String.fromCharCode(L),I):a(L)}function I(L){if(L===null||L===47||L===62||we(L)){let ke=L===47,St=i.toLowerCase();return!ke&&!o&&uy.includes(St)?(r=1,n.interrupt?t(L):B(L)):$1.includes(i.toLowerCase())?(r=6,ke?(e.consume(L),y):n.interrupt?t(L):B(L)):(r=7,n.interrupt&&!n.parser.lazy[n.now().line]?a(L):o?w(L):g(L))}return L===45||wt(L)?(e.consume(L),i+=String.fromCharCode(L),I):a(L)}function y(L){return L===62?(e.consume(L),n.interrupt?t:B):a(L)}function w(L){return te(L)?(e.consume(L),w):k(L)}function g(L){return L===47?(e.consume(L),k):L===58||L===95||Nt(L)?(e.consume(L),b):te(L)?(e.consume(L),g):k(L)}function b(L){return L===45||L===46||L===58||L===95||wt(L)?(e.consume(L),b):T(L)}function T(L){return L===61?(e.consume(L),S):te(L)?(e.consume(L),T):g(L)}function S(L){return L===null||L===60||L===61||L===62||L===96?a(L):L===34||L===39?(e.consume(L),s=L,M):te(L)?(e.consume(L),S):R(L)}function M(L){return L===s?(e.consume(L),s=null,_):L===null||V(L)?a(L):(e.consume(L),M)}function R(L){return L===null||L===34||L===39||L===47||L===60||L===61||L===62||L===96||we(L)?T(L):(e.consume(L),R)}function _(L){return L===47||L===62||te(L)?g(L):a(L)}function k(L){return L===62?(e.consume(L),G):a(L)}function G(L){return L===null||V(L)?B(L):te(L)?(e.consume(L),G):a(L)}function B(L){return L===45&&r===2?(e.consume(L),H):L===60&&r===1?(e.consume(L),$):L===62&&r===4?(e.consume(L),De):L===63&&r===3?(e.consume(L),v):L===93&&r===5?(e.consume(L),$e):V(L)&&(r===6||r===7)?(e.exit("htmlFlowData"),e.check(cU,_e,U)(L)):L===null||V(L)?(e.exit("htmlFlowData"),U(L)):(e.consume(L),B)}function U(L){return e.check(dU,W,_e)(L)}function W(L){return e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),A}function A(L){return L===null||V(L)?U(L):(e.enter("htmlFlowData"),B(L))}function H(L){return L===45?(e.consume(L),v):B(L)}function $(L){return L===47?(e.consume(L),i="",We):B(L)}function We(L){if(L===62){let ke=i.toLowerCase();return uy.includes(ke)?(e.consume(L),De):B(L)}return Nt(L)&&i.length<8?(e.consume(L),i+=String.fromCharCode(L),We):B(L)}function $e(L){return L===93?(e.consume(L),v):B(L)}function v(L){return L===62?(e.consume(L),De):L===45&&r===2?(e.consume(L),v):B(L)}function De(L){return L===null||V(L)?(e.exit("htmlFlowData"),_e(L)):(e.consume(L),De)}function _e(L){return e.exit("htmlFlow"),t(L)}}function mU(e,t,a){let n=this;return r;function r(i){return V(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),o):a(i)}function o(i){return n.parser.lazy[n.now().line]?a(i):t(i)}}function hU(e,t,a){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(Cn,t,a)}}var cy,cU,dU,K1=C(()=>{"use strict";Ae();X1();Dd();cy={concrete:!0,name:"htmlFlow",resolveTo:fU,tokenize:pU},cU={partial:!0,tokenize:hU},dU={partial:!0,tokenize:mU}});function gU(e,t,a){let n=this,r,o,i;return l;function l(v){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(v),s}function s(v){return v===33?(e.consume(v),u):v===47?(e.consume(v),T):v===63?(e.consume(v),g):Nt(v)?(e.consume(v),R):a(v)}function u(v){return v===45?(e.consume(v),c):v===91?(e.consume(v),o=0,m):Nt(v)?(e.consume(v),w):a(v)}function c(v){return v===45?(e.consume(v),p):a(v)}function d(v){return v===null?a(v):v===45?(e.consume(v),f):V(v)?(i=d,$(v)):(e.consume(v),d)}function f(v){return v===45?(e.consume(v),p):d(v)}function p(v){return v===62?H(v):v===45?f(v):d(v)}function m(v){let De="CDATA[";return v===De.charCodeAt(o++)?(e.consume(v),o===De.length?x:m):a(v)}function x(v){return v===null?a(v):v===93?(e.consume(v),I):V(v)?(i=x,$(v)):(e.consume(v),x)}function I(v){return v===93?(e.consume(v),y):x(v)}function y(v){return v===62?H(v):v===93?(e.consume(v),y):x(v)}function w(v){return v===null||v===62?H(v):V(v)?(i=w,$(v)):(e.consume(v),w)}function g(v){return v===null?a(v):v===63?(e.consume(v),b):V(v)?(i=g,$(v)):(e.consume(v),g)}function b(v){return v===62?H(v):g(v)}function T(v){return Nt(v)?(e.consume(v),S):a(v)}function S(v){return v===45||wt(v)?(e.consume(v),S):M(v)}function M(v){return V(v)?(i=M,$(v)):te(v)?(e.consume(v),M):H(v)}function R(v){return v===45||wt(v)?(e.consume(v),R):v===47||v===62||we(v)?_(v):a(v)}function _(v){return v===47?(e.consume(v),H):v===58||v===95||Nt(v)?(e.consume(v),k):V(v)?(i=_,$(v)):te(v)?(e.consume(v),_):H(v)}function k(v){return v===45||v===46||v===58||v===95||wt(v)?(e.consume(v),k):G(v)}function G(v){return v===61?(e.consume(v),B):V(v)?(i=G,$(v)):te(v)?(e.consume(v),G):_(v)}function B(v){return v===null||v===60||v===61||v===62||v===96?a(v):v===34||v===39?(e.consume(v),r=v,U):V(v)?(i=B,$(v)):te(v)?(e.consume(v),B):(e.consume(v),W)}function U(v){return v===r?(e.consume(v),r=void 0,A):v===null?a(v):V(v)?(i=U,$(v)):(e.consume(v),U)}function W(v){return v===null||v===34||v===39||v===60||v===61||v===96?a(v):v===47||v===62||we(v)?_(v):(e.consume(v),W)}function A(v){return v===47||v===62||we(v)?_(v):a(v)}function H(v){return v===62?(e.consume(v),e.exit("htmlTextData"),e.exit("htmlText"),t):a(v)}function $(v){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),We}function We(v){return te(v)?J(e,$e,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(v):$e(v)}function $e(v){return e.enter("htmlTextData"),i(v)}}var dy,Z1=C(()=>{"use strict";Tt();Ae();dy={name:"htmlText",tokenize:gU}});function vU(e){let t=-1,a=[];for(;++t<e.length;){let n=e[t][1];if(a.push(e[t]),n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd"){let r=n.type==="labelImage"?4:2;n.type="data",t+=r}}return e.length!==a.length&&Lt(e,0,e.length,a),e}function bU(e,t){let a=e.length,n=0,r,o,i,l;for(;a--;)if(r=e[a][1],o){if(r.type==="link"||r.type==="labelLink"&&r._inactive)break;e[a][0]==="enter"&&r.type==="labelLink"&&(r._inactive=!0)}else if(i){if(e[a][0]==="enter"&&(r.type==="labelImage"||r.type==="labelLink")&&!r._balanced&&(o=a,r.type!=="labelLink")){n=2;break}}else r.type==="labelEnd"&&(i=a);let s={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[o][1].start},end:{...e[i][1].end}},c={type:"labelText",start:{...e[o+n+2][1].end},end:{...e[i-2][1].start}};return l=[["enter",s,t],["enter",u,t]],l=ra(l,e.slice(o+1,o+n+3)),l=ra(l,[["enter",c,t]]),l=ra(l,Vr(t.parser.constructs.insideSpan.null,e.slice(o+n+4,i-3),t)),l=ra(l,[["exit",c,t],e[i-2],e[i-1],["exit",u,t]]),l=ra(l,e.slice(i+1)),l=ra(l,[["exit",s,t]]),Lt(e,o,e.length,l),e}function SU(e,t,a){let n=this,r=n.events.length,o,i;for(;r--;)if((n.events[r][1].type==="labelImage"||n.events[r][1].type==="labelLink")&&!n.events[r][1]._balanced){o=n.events[r][1];break}return l;function l(f){return o?o._inactive?d(f):(i=n.parser.defined.includes(Qt(n.sliceSerialize({start:o.end,end:n.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),s):a(f)}function s(f){return f===40?e.attempt(yU,c,i?c:d)(f):f===91?e.attempt(wU,c,i?u:d)(f):i?c(f):d(f)}function u(f){return e.attempt(xU,c,d)(f)}function c(f){return t(f)}function d(f){return o._balanced=!0,a(f)}}function IU(e,t,a){return n;function n(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),r}function r(d){return we(d)?Oo(e,o)(d):o(d)}function o(d){return d===41?c(d):Fd(e,i,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function i(d){return we(d)?Oo(e,s)(d):c(d)}function l(d){return a(d)}function s(d){return d===34||d===39||d===40?qd(e,u,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):c(d)}function u(d){return we(d)?Oo(e,c)(d):c(d)}function c(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):a(d)}}function CU(e,t,a){let n=this;return r;function r(l){return zd.call(n,e,o,i,"reference","referenceMarker","referenceString")(l)}function o(l){return n.parser.defined.includes(Qt(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?t(l):a(l)}function i(l){return a(l)}}function kU(e,t,a){return n;function n(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),r}function r(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):a(o)}}var Po,yU,wU,xU,Hd=C(()=>{"use strict";ay();ny();ry();oy();Ae();tr();Gi();Fs();Po={name:"labelEnd",resolveAll:vU,resolveTo:bU,tokenize:SU},yU={tokenize:IU},wU={tokenize:CU},xU={tokenize:kU}});function LU(e,t,a){let n=this;return r;function r(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),o}function o(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),i):a(l)}function i(l){return l===94&&"_hiddenFootnoteSupport"in n.parser.constructs?a(l):t(l)}}var fy,Q1=C(()=>{"use strict";Hd();fy={name:"labelStartImage",resolveAll:Po.resolveAll,tokenize:LU}});function TU(e,t,a){let n=this;return r;function r(i){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(i),e.exit("labelMarker"),e.exit("labelLink"),o}function o(i){return i===94&&"_hiddenFootnoteSupport"in n.parser.constructs?a(i):t(i)}}var py,Y1=C(()=>{"use strict";Hd();py={name:"labelStartLink",resolveAll:Po.resolveAll,tokenize:TU}});function EU(e,t){return a;function a(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),J(e,t,"linePrefix")}}var js,J1=C(()=>{"use strict";Tt();js={name:"lineEnding",tokenize:EU}});function MU(e,t,a){let n=0,r;return o;function o(u){return e.enter("thematicBreak"),i(u)}function i(u){return r=u,l(u)}function l(u){return u===r?(e.enter("thematicBreakSequence"),s(u)):n>=3&&(u===null||V(u))?(e.exit("thematicBreak"),t(u)):a(u)}function s(u){return u===r?(e.consume(u),n++,s):(e.exit("thematicBreakSequence"),te(u)?J(e,l,"whitespace")(u):l(u))}}var No,my=C(()=>{"use strict";Tt();Ae();No={name:"thematicBreak",tokenize:MU}});function DU(e,t,a){let n=this,r=n.events[n.events.length-1],o=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,i=0;return l;function l(p){let m=n.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!n.containerState.marker||p===n.containerState.marker:Bs(p)){if(n.containerState.type||(n.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(No,a,u)(p):u(p);if(!n.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(p)}return a(p)}function s(p){return Bs(p)&&++i<10?(e.consume(p),s):(!n.interrupt||i<2)&&(n.containerState.marker?p===n.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):a(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||p,e.check(Cn,n.interrupt?a:c,e.attempt(AU,f,d))}function c(p){return n.containerState.initialBlankLine=!0,o++,f(p)}function d(p){return te(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),f):a(p)}function f(p){return n.containerState.size=o+n.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function _U(e,t,a){let n=this;return n.containerState._closeFlow=void 0,e.check(Cn,r,o);function r(l){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,J(e,t,"listItemIndent",n.containerState.size+1)(l)}function o(l){return n.containerState.furtherBlankLines||!te(l)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,i(l)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,e.attempt(RU,t,i)(l))}function i(l){return n.containerState._closeFlow=!0,n.interrupt=void 0,J(e,e.attempt(Yt,t,a),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function OU(e,t,a){let n=this;return J(e,r,"listItemIndent",n.containerState.size+1);function r(o){let i=n.events[n.events.length-1];return i&&i[1].type==="listItemIndent"&&i[2].sliceSerialize(i[1],!0).length===n.containerState.size?t(o):a(o)}}function PU(e){e.exit(this.containerState.type)}function NU(e,t,a){let n=this;return J(e,r,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(o){let i=n.events[n.events.length-1];return!te(o)&&i&&i[1].type==="listItemPrefixWhitespace"?t(o):a(o)}}var Yt,AU,RU,eL=C(()=>{"use strict";Tt();Ae();Dd();my();Yt={continuation:{tokenize:_U},exit:PU,name:"list",tokenize:DU},AU={partial:!0,tokenize:NU},RU={partial:!0,tokenize:OU}});function BU(e,t){let a=e.length,n,r,o;for(;a--;)if(e[a][0]==="enter"){if(e[a][1].type==="content"){n=a;break}e[a][1].type==="paragraph"&&(r=a)}else e[a][1].type==="content"&&e.splice(a,1),!o&&e[a][1].type==="definition"&&(o=a);let i={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",o?(e.splice(r,0,["enter",i,t]),e.splice(o+1,0,["exit",e[n][1],t]),e[n][1].end={...e[o][1].end}):e[n][1]=i,e.push(["exit",i,t]),e}function UU(e,t,a){let n=this,r;return o;function o(u){let c=n.events.length,d;for(;c--;)if(n.events[c][1].type!=="lineEnding"&&n.events[c][1].type!=="linePrefix"&&n.events[c][1].type!=="content"){d=n.events[c][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||d)?(e.enter("setextHeadingLine"),r=u,i(u)):a(u)}function i(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===r?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),te(u)?J(e,s,"lineSuffix")(u):s(u))}function s(u){return u===null||V(u)?(e.exit("setextHeadingLine"),t(u)):a(u)}}var jd,tL=C(()=>{"use strict";Tt();Ae();jd={name:"setextUnderline",resolveTo:BU,tokenize:UU}});var Vd=C(()=>{"use strict";_1();O1();Dd();P1();N1();B1();F1();z1();q1();j1();V1();G1();W1();K1();Z1();Hd();Q1();Y1();J1();eL();tL();my()});function hy(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:jU,continuation:{tokenize:VU},exit:GU}},text:{91:{name:"gfmFootnoteCall",tokenize:HU},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:zU,resolveTo:qU}}}}function zU(e,t,a){let n=this,r=n.events.length,o=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]),i;for(;r--;){let s=n.events[r][1];if(s.type==="labelImage"){i=s;break}if(s.type==="gfmFootnoteCall"||s.type==="labelLink"||s.type==="label"||s.type==="image"||s.type==="link")break}return l;function l(s){if(!i||!i._balanced)return a(s);let u=Qt(n.sliceSerialize({start:i.end,end:n.now()}));return u.codePointAt(0)!==94||!o.includes(u.slice(1))?a(s):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(s),e.exit("gfmFootnoteCallLabelMarker"),t(s))}}function qU(e,t){let a=e.length,n;for(;a--;)if(e[a][1].type==="labelImage"&&e[a][0]==="enter"){n=e[a][1];break}e[a+1][1].type="data",e[a+3][1].type="gfmFootnoteCallLabelMarker";let r={type:"gfmFootnoteCall",start:Object.assign({},e[a+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[a+3][1].end),end:Object.assign({},e[a+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;let i={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},s=[e[a+1],e[a+2],["enter",r,t],e[a+3],e[a+4],["enter",o,t],["exit",o,t],["enter",i,t],["enter",l,t],["exit",l,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(a,e.length-a+1,...s),e}function HU(e,t,a){let n=this,r=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]),o=0,i;return l;function l(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),s}function s(d){return d!==94?a(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(d){if(o>999||d===93&&!i||d===null||d===91||we(d))return a(d);if(d===93){e.exit("chunkString");let f=e.exit("gfmFootnoteCallString");return r.includes(Qt(n.sliceSerialize(f)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):a(d)}return we(d)||(i=!0),o++,e.consume(d),d===92?c:u}function c(d){return d===91||d===92||d===93?(e.consume(d),o++,u):u(d)}}function jU(e,t,a){let n=this,r=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]),o,i=0,l;return s;function s(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):a(m)}function c(m){if(i>999||m===93&&!l||m===null||m===91||we(m))return a(m);if(m===93){e.exit("chunkString");let x=e.exit("gfmFootnoteDefinitionLabelString");return o=Qt(n.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),f}return we(m)||(l=!0),i++,e.consume(m),m===92?d:c}function d(m){return m===91||m===92||m===93?(e.consume(m),i++,c):c(m)}function f(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),r.includes(o)||r.push(o),J(e,p,"gfmFootnoteDefinitionWhitespace")):a(m)}function p(m){return t(m)}}function VU(e,t,a){return e.check(Cn,t,e.attempt(FU,t,a))}function GU(e){e.exit("gfmFootnoteDefinition")}function WU(e,t,a){let n=this;return J(e,r,"gfmFootnoteDefinitionIndent",5);function r(o){let i=n.events[n.events.length-1];return i&&i[1].type==="gfmFootnoteDefinitionIndent"&&i[2].sliceSerialize(i[1],!0).length===4?t(o):a(o)}}var FU,aL=C(()=>{"use strict";Vd();Tt();Ae();Gi();FU={tokenize:WU,partial:!0}});var nL=C(()=>{"use strict";aL()});function gy(e){let a=(e||{}).singleTilde,n={name:"strikethrough",tokenize:o,resolveAll:r};return a==null&&(a=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(i,l){let s=-1;for(;++s<i.length;)if(i[s][0]==="enter"&&i[s][1].type==="strikethroughSequenceTemporary"&&i[s][1]._close){let u=s;for(;u--;)if(i[u][0]==="exit"&&i[u][1].type==="strikethroughSequenceTemporary"&&i[u][1]._open&&i[s][1].end.offset-i[s][1].start.offset===i[u][1].end.offset-i[u][1].start.offset){i[s][1].type="strikethroughSequence",i[u][1].type="strikethroughSequence";let c={type:"strikethrough",start:Object.assign({},i[u][1].start),end:Object.assign({},i[s][1].end)},d={type:"strikethroughText",start:Object.assign({},i[u][1].end),end:Object.assign({},i[s][1].start)},f=[["enter",c,l],["enter",i[u][1],l],["exit",i[u][1],l],["enter",d,l]],p=l.parser.constructs.insideSpan.null;p&&Lt(f,f.length,0,Vr(p,i.slice(u+1,s),l)),Lt(f,f.length,0,[["exit",d,l],["enter",i[s][1],l],["exit",i[s][1],l],["exit",c,l]]),Lt(i,u-1,s-u+3,f),s=u+f.length-2;break}}for(s=-1;++s<i.length;)i[s][1].type==="strikethroughSequenceTemporary"&&(i[s][1].type="data");return i}function o(i,l,s){let u=this.previous,c=this.events,d=0;return f;function f(m){return u===126&&c[c.length-1][1].type!=="characterEscape"?s(m):(i.enter("strikethroughSequenceTemporary"),p(m))}function p(m){let x=er(u);if(m===126)return d>1?s(m):(i.consume(m),d++,p);if(d<2&&!a)return s(m);let I=i.exit("strikethroughSequenceTemporary"),y=er(m);return I._open=!y||y===2&&!!x,I._close=!x||x===2&&!!y,l(m)}}}var rL=C(()=>{"use strict";tr();kd();Fs()});var oL=C(()=>{"use strict";rL()});function $U(e,t,a,n){let r=0;if(!(a===0&&n.length===0)){for(;r<e.map.length;){if(e.map[r][0]===t){e.map[r][1]+=a,e.map[r][2].push(...n);return}r+=1}e.map.push([t,a,n])}}var Gd,iL=C(()=>{"use strict";Gd=class{constructor(){this.map=[]}add(t,a,n){$U(this,t,a,n)}consume(t){if(this.map.sort(function(o,i){return o[0]-i[0]}),this.map.length===0)return;let a=this.map.length,n=[];for(;a>0;)a-=1,n.push(t.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),t.length=this.map[a][0];n.push(t.slice()),t.length=0;let r=n.pop();for(;r;){for(let o of r)t.push(o);r=n.pop()}this.map.length=0}}});function lL(e,t){let a=!1,n=[];for(;t<e.length;){let r=e[t];if(a){if(r[0]==="enter")r[1].type==="tableContent"&&n.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(r[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){let o=n.length-1;n[o]=n[o]==="left"?"center":"right"}}else if(r[1].type==="tableDelimiterRow")break}else r[0]==="enter"&&r[1].type==="tableDelimiterRow"&&(a=!0);t+=1}return n}var sL=C(()=>{"use strict"});function yy(){return{flow:{null:{name:"table",tokenize:XU,resolveAll:KU}}}}function XU(e,t,a){let n=this,r=0,o=0,i;return l;function l(k){let G=n.events.length-1;for(;G>-1;){let W=n.events[G][1].type;if(W==="lineEnding"||W==="linePrefix")G--;else break}let B=G>-1?n.events[G][1].type:null,U=B==="tableHead"||B==="tableRow"?S:s;return U===S&&n.parser.lazy[n.now().line]?a(k):U(k)}function s(k){return e.enter("tableHead"),e.enter("tableRow"),u(k)}function u(k){return k===124||(i=!0,o+=1),c(k)}function c(k){return k===null?a(k):V(k)?o>1?(o=0,n.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),p):a(k):te(k)?J(e,c,"whitespace")(k):(o+=1,i&&(i=!1,r+=1),k===124?(e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),i=!0,c):(e.enter("data"),d(k)))}function d(k){return k===null||k===124||we(k)?(e.exit("data"),c(k)):(e.consume(k),k===92?f:d)}function f(k){return k===92||k===124?(e.consume(k),d):d(k)}function p(k){return n.interrupt=!1,n.parser.lazy[n.now().line]?a(k):(e.enter("tableDelimiterRow"),i=!1,te(k)?J(e,m,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):m(k))}function m(k){return k===45||k===58?I(k):k===124?(i=!0,e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),x):T(k)}function x(k){return te(k)?J(e,I,"whitespace")(k):I(k)}function I(k){return k===58?(o+=1,i=!0,e.enter("tableDelimiterMarker"),e.consume(k),e.exit("tableDelimiterMarker"),y):k===45?(o+=1,y(k)):k===null||V(k)?b(k):T(k)}function y(k){return k===45?(e.enter("tableDelimiterFiller"),w(k)):T(k)}function w(k){return k===45?(e.consume(k),w):k===58?(i=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(k),e.exit("tableDelimiterMarker"),g):(e.exit("tableDelimiterFiller"),g(k))}function g(k){return te(k)?J(e,b,"whitespace")(k):b(k)}function b(k){return k===124?m(k):k===null||V(k)?!i||r!==o?T(k):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(k)):T(k)}function T(k){return a(k)}function S(k){return e.enter("tableRow"),M(k)}function M(k){return k===124?(e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),M):k===null||V(k)?(e.exit("tableRow"),t(k)):te(k)?J(e,M,"whitespace")(k):(e.enter("data"),R(k))}function R(k){return k===null||k===124||we(k)?(e.exit("data"),M(k)):(e.consume(k),k===92?_:R)}function _(k){return k===92||k===124?(e.consume(k),R):R(k)}}function KU(e,t){let a=-1,n=!0,r=0,o=[0,0,0,0],i=[0,0,0,0],l=!1,s=0,u,c,d,f=new Gd;for(;++a<e.length;){let p=e[a],m=p[1];p[0]==="enter"?m.type==="tableHead"?(l=!1,s!==0&&(uL(f,t,s,u,c),c=void 0,s=0),u={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(a,0,[["enter",u,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(n=!0,d=void 0,o=[0,0,0,0],i=[0,a+1,0,0],l&&(l=!1,c={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(a,0,[["enter",c,t]])),r=m.type==="tableDelimiterRow"?2:c?3:1):r&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(n=!1,i[2]===0&&(o[1]!==0&&(i[0]=i[1],d=Wd(f,t,o,r,void 0,d),o=[0,0,0,0]),i[2]=a)):m.type==="tableCellDivider"&&(n?n=!1:(o[1]!==0&&(i[0]=i[1],d=Wd(f,t,o,r,void 0,d)),o=i,i=[o[1],a,0,0])):m.type==="tableHead"?(l=!0,s=a):m.type==="tableRow"||m.type==="tableDelimiterRow"?(s=a,o[1]!==0?(i[0]=i[1],d=Wd(f,t,o,r,a,d)):i[1]!==0&&(d=Wd(f,t,i,r,a,d)),r=0):r&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(i[3]=a)}for(s!==0&&uL(f,t,s,u,c),f.consume(t.events),a=-1;++a<t.events.length;){let p=t.events[a];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=lL(t.events,a))}return e}function Wd(e,t,a,n,r,o){let i=n===1?"tableHeader":n===2?"tableDelimiter":"tableData",l="tableContent";a[0]!==0&&(o.end=Object.assign({},Zi(t.events,a[0])),e.add(a[0],0,[["exit",o,t]]));let s=Zi(t.events,a[1]);if(o={type:i,start:Object.assign({},s),end:Object.assign({},s)},e.add(a[1],0,[["enter",o,t]]),a[2]!==0){let u=Zi(t.events,a[2]),c=Zi(t.events,a[3]),d={type:l,start:Object.assign({},u),end:Object.assign({},c)};if(e.add(a[2],0,[["enter",d,t]]),n!==2){let f=t.events[a[2]],p=t.events[a[3]];if(f[1].end=Object.assign({},p[1].end),f[1].type="chunkText",f[1].contentType="text",a[3]>a[2]+1){let m=a[2]+1,x=a[3]-a[2]-1;e.add(m,x,[])}}e.add(a[3]+1,0,[["exit",d,t]])}return r!==void 0&&(o.end=Object.assign({},Zi(t.events,r)),e.add(r,0,[["exit",o,t]]),o=void 0),o}function uL(e,t,a,n,r){let o=[],i=Zi(t.events,a);r&&(r.end=Object.assign({},i),o.push(["exit",r,t])),n.end=Object.assign({},i),o.push(["exit",n,t]),e.add(a+1,0,o)}function Zi(e,t){let a=e[t],n=a[0]==="enter"?"start":"end";return a[1][n]}var cL=C(()=>{"use strict";Tt();Ae();iL();sL()});var dL=C(()=>{"use strict";cL()});function wy(){return{text:{91:ZU}}}function QU(e,t,a){let n=this;return r;function r(s){return n.previous!==null||!n._gfmTasklistFirstContentOfListItem?a(s):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(s),e.exit("taskListCheckMarker"),o)}function o(s){return we(s)?(e.enter("taskListCheckValueUnchecked"),e.consume(s),e.exit("taskListCheckValueUnchecked"),i):s===88||s===120?(e.enter("taskListCheckValueChecked"),e.consume(s),e.exit("taskListCheckValueChecked"),i):a(s)}function i(s){return s===93?(e.enter("taskListCheckMarker"),e.consume(s),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):a(s)}function l(s){return V(s)?t(s):te(s)?e.check({tokenize:YU},t,a)(s):a(s)}}function YU(e,t,a){return J(e,n,"whitespace");function n(r){return r===null?a(r):t(r)}}var ZU,fL=C(()=>{"use strict";Tt();Ae();ZU={name:"tasklistCheck",tokenize:QU}});var pL=C(()=>{"use strict";fL()});function mL(e){return Rd([Zg(),hy(),gy(e),yy(),wy()])}var hL=C(()=>{"use strict";Xg();R1();nL();oL();dL();pL()});function $d(e){let t=this,a=e||JU,n=t.data(),r=n.micromarkExtensions||(n.micromarkExtensions=[]),o=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),i=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);r.push(mL(a)),o.push(Wg()),i.push($g(a))}var JU,gL=C(()=>{"use strict";v1();hL();JU={}});var yL=C(()=>{"use strict";gL()});var e4,t4,a4,wL,n4,r4,xL,SL,IL,o4,i4,l4,s4,u4,c4,d4,Bo,CL,f4,p4,m4,h4,g4,y4,vL,Gr,Qi,w4,kL,Kd,x4,LL,vy,v4,b4,TL,S4,I4,C4,k4,L4,T4,E4,M4,A4,EL,R4,D4,_4,O4,P4,N4,Xd,B4,U4,F4,z4,q4,H4,j4,V4,G4,W4,bL,$4,ML,X4,K4,Z4,Q4,Y4,J4,xy,_a,eF,tF,aF,AL,RL=C(()=>{"use strict";e4=Object.defineProperty,t4=Object.defineProperties,a4=Object.getOwnPropertyDescriptors,wL=Object.getOwnPropertySymbols,n4=Object.prototype.hasOwnProperty,r4=Object.prototype.propertyIsEnumerable,xL=(e,t,a)=>t in e?e4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,SL=(e,t)=>{for(var a in t||(t={}))n4.call(t,a)&&xL(e,a,t[a]);if(wL)for(var a of wL(t))r4.call(t,a)&&xL(e,a,t[a]);return e},IL=(e,t)=>t4(e,a4(t)),o4=/(\*\*)([^*]*\*?)$/,i4=/(__)([^_]*?)$/,l4=/(\*\*\*)([^*]*?)$/,s4=/(\*)([^*]*?)$/,u4=/(_)([^_]*?)$/,c4=/(`)([^`]*?)$/,d4=/(~~)([^~]*?)$/,Bo=/^[\s_~*`]*$/,CL=/^[\s]*[-*+][\s]+$/,f4=/[\p{L}\p{N}_]/u,p4=/^```[^`\n]*```?$/,m4=/^\*{4,}$/,h4=/(__)([^_]+)_$/,g4=/(~~)([^~]+)~$/,y4=/__/g,vL=/~~/g,Gr=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:f4.test(e)},Qi=(e,t)=>{let a=!1;for(let n=0;n<t;n+=1)e[n]==="`"&&e[n+1]==="`"&&e[n+2]==="`"&&(a=!a,n+=2);return a},w4=(e,t)=>{let a=1;for(let n=t-1;n>=0;n-=1)if(e[n]==="]")a+=1;else if(e[n]==="["&&(a-=1,a===0))return n;return-1},kL=(e,t)=>{let a=1;for(let n=t+1;n<e.length;n+=1)if(e[n]==="[")a+=1;else if(e[n]==="]"&&(a-=1,a===0))return n;return-1},Kd=(e,t)=>{let a=!1,n=!1;for(let r=0;r<e.length&&r<t;r+=1){if(e[r]==="\\"&&e[r+1]==="$"){r+=1;continue}e[r]==="$"&&(e[r+1]==="$"?(n=!n,r+=1,a=!1):n||(a=!a))}return a||n},x4=(e,t)=>{for(let a=t;a<e.length;a+=1){if(e[a]===")")return!0;if(e[a]===`
|
|
25
|
-
`)return!1}return!1},
|
|
26
|
-
`)return!1}return!1},
|
|
21
|
+
`))+1))}let l="#".repeat(r),i=a.enter("headingAtx"),s=a.enter("phrasing");o.move(l+" ");let u=a.containerPhrasing(e,{before:"# ",after:`
|
|
22
|
+
`,...o.current()});return/^[\t ]/.test(u)&&(u=jr(u.charCodeAt(0))+u.slice(1)),u=u?l+" "+u:l,a.options.closeAtx&&(u+=" "+l),s(),i(),u}var yk=I(()=>{"use strict";vd();hk()});function xg(e){return e.value||""}function XB(){return"<"}var wk=I(()=>{"use strict";xg.peek=XB});function vg(e,t,a,n){let r=$l(a),o=r==='"'?"Quote":"Apostrophe",l=a.enter("image"),i=a.enter("label"),s=a.createTracker(n),u=s.move("![");return u+=s.move(a.safe(e.alt,{before:u,after:"]",...s.current()})),u+=s.move("]("),i(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(i=a.enter("destinationLiteral"),u+=s.move("<"),u+=s.move(a.safe(e.url,{before:u,after:">",...s.current()})),u+=s.move(">")):(i=a.enter("destinationRaw"),u+=s.move(a.safe(e.url,{before:u,after:e.title?" ":")",...s.current()}))),i(),e.title&&(i=a.enter(`title${o}`),u+=s.move(" "+r),u+=s.move(a.safe(e.title,{before:u,after:r,...s.current()})),u+=s.move(r),i()),u+=s.move(")"),l(),u}function KB(){return"!"}var xk=I(()=>{"use strict";xd();vg.peek=KB});function bg(e,t,a,n){let r=e.referenceType,o=a.enter("imageReference"),l=a.enter("label"),i=a.createTracker(n),s=i.move("!["),u=a.safe(e.alt,{before:s,after:"]",...i.current()});s+=i.move(u+"]["),l();let c=a.stack;a.stack=[],l=a.enter("reference");let d=a.safe(a.associationId(e),{before:s,after:"]",...i.current()});return l(),a.stack=c,o(),r==="full"||!u||u!==d?s+=i.move(d+"]"):r==="shortcut"?s=s.slice(0,-1):s+=i.move("]"),s}function ZB(){return"!"}var vk=I(()=>{"use strict";bg.peek=ZB});function Sg(e,t,a){let n=e.value||"",r="`",o=-1;for(;new RegExp("(^|[^`])"+r+"([^`]|$)").test(n);)r+="`";for(/[^ \r\n]/.test(n)&&(/^[ \r\n]/.test(n)&&/[ \r\n]$/.test(n)||/^`|`$/.test(n))&&(n=" "+n+" ");++o<a.unsafe.length;){let l=a.unsafe[o],i=a.compilePattern(l),s;if(l.atBreak)for(;s=i.exec(n);){let u=s.index;n.charCodeAt(u)===10&&n.charCodeAt(u-1)===13&&u--,n=n.slice(0,u)+" "+n.slice(s.index+1)}}return r+n+r}function QB(){return"`"}var bk=I(()=>{"use strict";Sg.peek=QB});function Cg(e,t){let a=Ro(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(a===e.url||"mailto:"+a===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}var Sk=I(()=>{"use strict";Sd()});function Ig(e,t,a,n){let r=$l(a),o=r==='"'?"Quote":"Apostrophe",l=a.createTracker(n),i,s;if(Cg(e,a)){let c=a.stack;a.stack=[],i=a.enter("autolink");let d=l.move("<");return d+=l.move(a.containerPhrasing(e,{before:d,after:">",...l.current()})),d+=l.move(">"),i(),a.stack=c,d}i=a.enter("link"),s=a.enter("label");let u=l.move("[");return u+=l.move(a.containerPhrasing(e,{before:u,after:"](",...l.current()})),u+=l.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=a.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(a.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(s=a.enter("destinationRaw"),u+=l.move(a.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),s(),e.title&&(s=a.enter(`title${o}`),u+=l.move(" "+r),u+=l.move(a.safe(e.title,{before:u,after:r,...l.current()})),u+=l.move(r),s()),u+=l.move(")"),i(),u}function YB(e,t,a){return Cg(e,a)?"<":"["}var Ck=I(()=>{"use strict";xd();Sk();Ig.peek=YB});function kg(e,t,a,n){let r=e.referenceType,o=a.enter("linkReference"),l=a.enter("label"),i=a.createTracker(n),s=i.move("["),u=a.containerPhrasing(e,{before:s,after:"]",...i.current()});s+=i.move(u+"]["),l();let c=a.stack;a.stack=[],l=a.enter("reference");let d=a.safe(a.associationId(e),{before:s,after:"]",...i.current()});return l(),a.stack=c,o(),r==="full"||!u||u!==d?s+=i.move(d+"]"):r==="shortcut"?s=s.slice(0,-1):s+=i.move("]"),s}function JB(){return"["}var Ik=I(()=>{"use strict";kg.peek=JB});function Xl(e){let t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}var Cd=I(()=>{"use strict"});function kk(e){let t=Xl(e),a=e.options.bulletOther;if(!a)return t==="*"?"-":"*";if(a!=="*"&&a!=="+"&&a!=="-")throw new Error("Cannot serialize items with `"+a+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(a===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+a+"`) to be different");return a}var Lk=I(()=>{"use strict";Cd()});function Tk(e){let t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}var Ak=I(()=>{"use strict"});function Id(e){let t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}var Lg=I(()=>{"use strict"});function Mk(e,t,a,n){let r=a.enter("list"),o=a.bulletCurrent,l=e.ordered?Tk(a):Xl(a),i=e.ordered?l==="."?")":".":kk(a),s=t&&a.bulletLastUsed?l===a.bulletLastUsed:!1;if(!e.ordered){let c=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&c&&(!c.children||!c.children[0])&&a.stack[a.stack.length-1]==="list"&&a.stack[a.stack.length-2]==="listItem"&&a.stack[a.stack.length-3]==="list"&&a.stack[a.stack.length-4]==="listItem"&&a.indexStack[a.indexStack.length-1]===0&&a.indexStack[a.indexStack.length-2]===0&&a.indexStack[a.indexStack.length-3]===0&&(s=!0),Id(a)===l&&c){let d=-1;for(;++d<e.children.length;){let f=e.children[d];if(f&&f.type==="listItem"&&f.children&&f.children[0]&&f.children[0].type==="thematicBreak"){s=!0;break}}}}s&&(l=i),a.bulletCurrent=l;let u=a.containerFlow(e,n);return a.bulletLastUsed=l,a.bulletCurrent=o,r(),u}var Ek=I(()=>{"use strict";Cd();Lk();Ak();Lg()});function Rk(e){let 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}var Dk=I(()=>{"use strict"});function _k(e,t,a,n){let r=Rk(a),o=a.bulletCurrent||Xl(a);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(a.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let l=o.length+1;(r==="tab"||r==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);let i=a.createTracker(n);i.move(o+" ".repeat(l-o.length)),i.shift(l);let s=a.enter("listItem"),u=a.indentLines(a.containerFlow(e,i.current()),c);return s(),u;function c(d,f,p){return f?(p?"":" ".repeat(l))+d:(p?o:o+" ".repeat(l-o.length))+d}}var Ok=I(()=>{"use strict";Cd();Dk()});function Pk(e,t,a,n){let r=a.enter("paragraph"),o=a.enter("phrasing"),l=a.containerPhrasing(e,n);return o(),r(),l}var Nk=I(()=>{"use strict"});var Tg,Bk=I(()=>{"use strict";dd();Tg=Fr(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"])});var Uk=I(()=>{"use strict";Bk()});function Fk(e,t,a,n){return(e.children.some(function(l){return Tg(l)})?a.containerPhrasing:a.containerFlow).call(a,e,n)}var zk=I(()=>{"use strict";Uk()});function qk(e){let t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}var Hk=I(()=>{"use strict"});function Ag(e,t,a,n){let r=qk(a),o=a.enter("strong"),l=a.createTracker(n),i=l.move(r+r),s=l.move(a.containerPhrasing(e,{after:r,before:i,...l.current()})),u=s.charCodeAt(0),c=Wl(n.before.charCodeAt(n.before.length-1),u,r);c.inside&&(s=jr(u)+s.slice(1));let d=s.charCodeAt(s.length-1),f=Wl(n.after.charCodeAt(0),d,r);f.inside&&(s=s.slice(0,-1)+jr(d));let p=l.move(r+r);return o(),a.attentionEncodeSurroundingInfo={after:f.outside,before:c.outside},i+s+p}function e3(e,t,a){return a.options.strong||"*"}var jk=I(()=>{"use strict";Hk();vd();yg();Ag.peek=e3});function Vk(e,t,a,n){return a.safe(e.value,n)}var Gk=I(()=>{"use strict"});function $k(e){let 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}var Wk=I(()=>{"use strict"});function Xk(e,t,a){let n=(Id(a)+(a.options.ruleSpaces?" ":"")).repeat($k(a));return a.options.ruleSpaces?n.slice(0,-1):n}var Kk=I(()=>{"use strict";Wk();Lg()});var Ps,Zk=I(()=>{"use strict";WI();QI();ok();ik();ck();yk();wk();xk();vk();bk();Ck();Ik();Ek();Ok();Nk();zk();jk();Gk();Kk();Ps={blockquote:$I,break:gg,code:rk,definition:lk,emphasis:wg,hardBreak:gg,heading:gk,html:xg,image:vg,imageReference:bg,inlineCode:Sg,link:Ig,linkReference:kg,list:Mk,listItem:_k,paragraph:Pk,root:Fk,strong:Ag,text:Vk,thematicBreak:Xk}});function Kl(e){let t="&"+e+";";Qk.innerHTML=t;let a=Qk.textContent;return a.charCodeAt(a.length-1)===59&&e!=="semi"||a===t?!1:a}var Qk,kd=I(()=>{"use strict";Qk=document.createElement("i")});function Ld(e,t){let a=Number.parseInt(e,t);return a<9||a===11||a>13&&a<32||a>126&&a<160||a>55295&&a<57344||a>64975&&a<65008||(a&65535)===65535||(a&65535)===65534||a>1114111?"\uFFFD":String.fromCodePoint(a)}var Mg=I(()=>{"use strict"});function Yk(e){return e.replace(t3,a3)}function a3(e,t,a){if(t)return t;if(a.charCodeAt(0)===35){let r=a.charCodeAt(1),o=r===120||r===88;return Ld(a.slice(o?2:1),o?16:10)}return Kl(a)||e}var t3,Jk=I(()=>{"use strict";kd();Mg();t3=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi});var Eg=I(()=>{"use strict";Zk()});function Dg(){return{enter:{table:n3,tableData:e1,tableHeader:e1,tableRow:o3},exit:{codeText:l3,table:r3,tableData:Rg,tableHeader:Rg,tableRow:Rg}}}function n3(e){let t=e._align;this.enter({type:"table",align:t.map(function(a){return a==="none"?null:a}),children:[]},e),this.data.inTable=!0}function r3(e){this.exit(e),this.data.inTable=void 0}function o3(e){this.enter({type:"tableRow",children:[]},e)}function Rg(e){this.exit(e)}function e1(e){this.enter({type:"tableCell",children:[]},e)}function l3(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,i3));let a=this.stack[this.stack.length-1];a.type,a.value=t,this.exit(e)}function i3(e,t){return t==="|"?t:e}function _g(e){let t=e||{},a=t.tableCellPadding,n=t.tablePipeAlign,r=t.stringLength,o=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
23
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:f,table:l,tableCell:s,tableRow:i}};function l(p,m,x,v){return u(c(p,x,v),p.align)}function i(p,m,x,v){let y=d(p,x,v),w=u([y]);return w.slice(0,w.indexOf(`
|
|
24
|
+
`))}function s(p,m,x,v){let y=x.enter("tableCell"),w=x.enter("phrasing"),g=x.containerPhrasing(p,{...v,before:o,after:o});return w(),y(),g}function u(p,m){return VI(p,{align:m,alignDelimiters:n,padding:a,stringLength:r})}function c(p,m,x){let v=p.children,y=-1,w=[],g=m.enter("table");for(;++y<v.length;)w[y]=d(v[y],m,x);return g(),w}function d(p,m,x){let v=p.children,y=-1,w=[],g=m.enter("tableRow");for(;++y<v.length;)w[y]=s(v[y],p,m,x);return g(),w}function f(p,m,x){let v=Ps.inlineCode(p,m,x);return x.stack.includes("tableCell")&&(v=v.replace(/\|/g,"\\$&")),v}}var t1=I(()=>{"use strict";GI();Eg()});var a1=I(()=>{"use strict";t1()});function Og(){return{exit:{taskListCheckValueChecked:n1,taskListCheckValueUnchecked:n1,paragraph:s3}}}function Pg(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:u3}}}function n1(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function s3(e){let t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){let a=this.stack[this.stack.length-1];a.type;let n=a.children[0];if(n&&n.type==="text"){let r=t.children,o=-1,l;for(;++o<r.length;){let i=r[o];if(i.type==="paragraph"){l=i;break}}l===a&&(n.value=n.value.slice(1),n.value.length===0?a.children.shift():a.position&&n.position&&typeof n.position.start.offset=="number"&&(n.position.start.column++,n.position.start.offset++,a.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function u3(e,t,a,n){let r=e.children[0],o=typeof e.checked=="boolean"&&r&&r.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",i=a.createTracker(n);o&&i.move(l);let s=Ps.listItem(e,t,a,{...n,...i.current()});return o&&(s=s.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),s;function u(c){return c+l}}var r1=I(()=>{"use strict";Eg()});var o1=I(()=>{"use strict";r1()});function Ng(){return[cg(),fg(),mg(),Dg(),Og()]}function Bg(e){return{extensions:[dg(),pg(e),hg(),_g(e),Pg()]}}var l1=I(()=>{"use strict";PI();FI();HI();a1();o1()});var i1=I(()=>{"use strict";l1()});function Tt(e,t,a,n){let r=e.length,o=0,l;if(t<0?t=-t>r?0:r+t:t=t>r?r:t,a=a>0?a:0,n.length<1e4)l=Array.from(n),l.unshift(t,a),e.splice(...l);else for(a&&e.splice(t,a);o<n.length;)l=n.slice(o,o+1e4),l.unshift(t,0),e.splice(...l),o+=1e4,t+=1e4}function ra(e,t){return e.length>0?(Tt(e,e.length,0,t),e):t}var Jn=I(()=>{"use strict"});function Td(e){let t={},a=-1;for(;++a<e.length;)c3(t,e[a]);return t}function c3(e,t){let a;for(a in t){let r=(s1.call(e,a)?e[a]:void 0)||(e[a]={}),o=t[a],l;if(o)for(l in o){s1.call(r,l)||(r[l]=[]);let i=o[l];d3(r[l],Array.isArray(i)?i:i?[i]:[])}}}function d3(e,t){let a=-1,n=[];for(;++a<t.length;)(t[a].add==="after"?e:n).push(t[a]);Tt(e,0,0,n)}var s1,Ug=I(()=>{"use strict";Jn();s1={}.hasOwnProperty});function zg(){return{text:vn}}function m3(e,t,a){let n=this,r,o;return l;function l(d){return!Fg(d)||!g1.call(n,n.previous)||qg(n.events)?a(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),i(d))}function i(d){return Fg(d)?(e.consume(d),i):d===64?(e.consume(d),s):a(d)}function s(d){return d===46?e.check(p3,c,u)(d):d===45||d===95||vt(d)?(o=!0,e.consume(d),s):c(d)}function u(d){return e.consume(d),r=!0,s}function c(d){return o&&r&&Bt(n.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):a(d)}}function h3(e,t,a){let n=this;return r;function r(l){return l!==87&&l!==119||!m1.call(n,n.previous)||qg(n.events)?a(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(f3,e.attempt(u1,e.attempt(c1,o),a),a)(l))}function o(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function g3(e,t,a){let n=this,r="",o=!1;return l;function l(d){return(d===72||d===104)&&h1.call(n,n.previous)&&!qg(n.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),r+=String.fromCodePoint(d),e.consume(d),i):a(d)}function i(d){if(Bt(d)&&r.length<5)return r+=String.fromCodePoint(d),e.consume(d),i;if(d===58){let f=r.toLowerCase();if(f==="http"||f==="https")return e.consume(d),s}return a(d)}function s(d){return d===47?(e.consume(d),o?u:(o=!0,s)):a(d)}function u(d){return d===null||Mo(d)||pe(d)||xn(d)||Eo(d)?a(d):e.attempt(u1,e.attempt(c1,c),a)(d)}function c(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function y3(e,t,a){let n=0;return r;function r(l){return(l===87||l===119)&&n<3?(n++,e.consume(l),r):l===46&&n===3?(e.consume(l),o):a(l)}function o(l){return l===null?a(l):t(l)}}function w3(e,t,a){let n,r,o;return l;function l(u){return u===46||u===95?e.check(d1,s,i)(u):u===null||pe(u)||xn(u)||u!==45&&Eo(u)?s(u):(o=!0,e.consume(u),l)}function i(u){return u===95?n=!0:(r=n,n=void 0),e.consume(u),l}function s(u){return r||n||!o?a(u):t(u)}}function x3(e,t){let a=0,n=0;return r;function r(l){return l===40?(a++,e.consume(l),r):l===41&&n<a?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(d1,t,o)(l):l===null||pe(l)||xn(l)?t(l):(e.consume(l),r)}function o(l){return l===41&&n++,e.consume(l),r}}function v3(e,t,a){return n;function n(i){return i===33||i===34||i===39||i===41||i===42||i===44||i===46||i===58||i===59||i===63||i===95||i===126?(e.consume(i),n):i===38?(e.consume(i),o):i===93?(e.consume(i),r):i===60||i===null||pe(i)||xn(i)?t(i):a(i)}function r(i){return i===null||i===40||i===91||pe(i)||xn(i)?t(i):n(i)}function o(i){return Bt(i)?l(i):a(i)}function l(i){return i===59?(e.consume(i),n):Bt(i)?(e.consume(i),l):a(i)}}function b3(e,t,a){return n;function n(o){return e.consume(o),r}function r(o){return vt(o)?a(o):t(o)}}function m1(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||pe(e)}function h1(e){return!Bt(e)}function g1(e){return!(e===47||Fg(e))}function Fg(e){return e===43||e===45||e===46||e===95||vt(e)}function qg(e){let t=e.length,a=!1;for(;t--;){let n=e[t][1];if((n.type==="labelLink"||n.type==="labelImage")&&!n._balanced){a=!0;break}if(n._gfmAutolinkLiteralWalkedInto){a=!1;break}}return e.length>0&&!a&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}var f3,u1,c1,d1,p3,f1,p1,er,vn,Do,y1=I(()=>{"use strict";_e();f3={tokenize:y3,partial:!0},u1={tokenize:w3,partial:!0},c1={tokenize:x3,partial:!0},d1={tokenize:v3,partial:!0},p3={tokenize:b3,partial:!0},f1={name:"wwwAutolink",tokenize:h3,previous:m1},p1={name:"protocolAutolink",tokenize:g3,previous:h1},er={name:"emailAutolink",tokenize:m3,previous:g1},vn={};Do=48;for(;Do<123;)vn[Do]=er,Do++,Do===58?Do=65:Do===91&&(Do=97);vn[43]=er;vn[45]=er;vn[46]=er;vn[95]=er;vn[72]=[er,p1];vn[104]=[er,p1];vn[87]=[er,f1];vn[119]=[er,f1]});function Xa(e){let t=[],a=-1,n=0,r=0;for(;++a<e.length;){let o=e.charCodeAt(a),l="";if(o===37&&vt(e.charCodeAt(a+1))&&vt(e.charCodeAt(a+2)))r=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(l=String.fromCharCode(o));else if(o>55295&&o<57344){let i=e.charCodeAt(a+1);o<56320&&i>56319&&i<57344?(l=String.fromCharCode(o,i),r=1):l="\uFFFD"}else l=String.fromCharCode(o);l&&(t.push(e.slice(n,a),encodeURIComponent(l)),n=a+r+1,l=""),r&&(a+=r,r=0)}return t.join("")+e.slice(n)}var _o=I(()=>{"use strict";_e()});var w1=I(()=>{"use strict";y1()});function Vr(e,t,a){let n=[],r=-1;for(;++r<e.length;){let o=e[r].resolveAll;o&&!n.includes(o)&&(t=o(t,a),n.push(o))}return t}var Ns=I(()=>{"use strict"});function S3(e,t){let a=-1,n,r,o,l,i,s,u,c;for(;++a<e.length;)if(e[a][0]==="enter"&&e[a][1].type==="attentionSequence"&&e[a][1]._close){for(n=a;n--;)if(e[n][0]==="exit"&&e[n][1].type==="attentionSequence"&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[a][1]).charCodeAt(0)){if((e[n][1]._close||e[a][1]._open)&&(e[a][1].end.offset-e[a][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[a][1].end.offset-e[a][1].start.offset)%3))continue;s=e[n][1].end.offset-e[n][1].start.offset>1&&e[a][1].end.offset-e[a][1].start.offset>1?2:1;let d={...e[n][1].end},f={...e[a][1].start};x1(d,-s),x1(f,s),l={type:s>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},i={type:s>1?"strongSequence":"emphasisSequence",start:{...e[a][1].start},end:f},o={type:s>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[a][1].start}},r={type:s>1?"strong":"emphasis",start:{...l.start},end:{...i.end}},e[n][1].end={...l.start},e[a][1].start={...i.end},u=[],e[n][1].end.offset-e[n][1].start.offset&&(u=ra(u,[["enter",e[n][1],t],["exit",e[n][1],t]])),u=ra(u,[["enter",r,t],["enter",l,t],["exit",l,t],["enter",o,t]]),u=ra(u,Vr(t.parser.constructs.insideSpan.null,e.slice(n+1,a),t)),u=ra(u,[["exit",o,t],["enter",i,t],["exit",i,t],["exit",r,t]]),e[a][1].end.offset-e[a][1].start.offset?(c=2,u=ra(u,[["enter",e[a][1],t],["exit",e[a][1],t]])):c=0,Tt(e,n-1,a-n+3,u),a=n+u.length-c-2;break}}for(a=-1;++a<e.length;)e[a][1].type==="attentionSequence"&&(e[a][1].type="data");return e}function C3(e,t){let a=this.parser.constructs.attentionMarkers.null,n=this.previous,r=Yn(n),o;return l;function l(s){return o=s,e.enter("attentionSequence"),i(s)}function i(s){if(s===o)return e.consume(s),i;let u=e.exit("attentionSequence"),c=Yn(s),d=!c||c===2&&r||a.includes(s),f=!r||r===2&&c||a.includes(n);return u._open=!!(o===42?d:d&&(r||!f)),u._close=!!(o===42?f:f&&(c||!d)),t(s)}}function x1(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var Bs,v1=I(()=>{"use strict";Jn();bd();Ns();Bs={name:"attention",resolveAll:S3,tokenize:C3}});function I3(e,t,a){let n=0;return r;function r(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(p){return Bt(p)?(e.consume(p),l):p===64?a(p):u(p)}function l(p){return p===43||p===45||p===46||vt(p)?(n=1,i(p)):u(p)}function i(p){return p===58?(e.consume(p),n=0,s):(p===43||p===45||p===46||vt(p))&&n++<32?(e.consume(p),i):(n=0,u(p))}function s(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||Mo(p)?a(p):(e.consume(p),s)}function u(p){return p===64?(e.consume(p),c):TI(p)?(e.consume(p),u):a(p)}function c(p){return vt(p)?d(p):a(p)}function d(p){return p===46?(e.consume(p),n=0,c):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):f(p)}function f(p){if((p===45||vt(p))&&n++<63){let m=p===45?f:d;return e.consume(p),m}return a(p)}}var Hg,b1=I(()=>{"use strict";_e();Hg={name:"autolink",tokenize:I3}});function Q(e,t,a,n){let r=n?n-1:Number.POSITIVE_INFINITY,o=0;return l;function l(s){return J(s)?(e.enter(a),i(s)):t(s)}function i(s){return J(s)&&o++<r?(e.consume(s),i):(e.exit(a),t(s))}}var At=I(()=>{"use strict";_e()});function k3(e,t,a){return n;function n(o){return J(o)?Q(e,r,"linePrefix")(o):r(o)}function r(o){return o===null||V(o)?t(o):a(o)}}var bn,Ad=I(()=>{"use strict";At();_e();bn={partial:!0,tokenize:k3}});function L3(e,t,a){let n=this;return r;function r(l){if(l===62){let i=n.containerState;return i.open||(e.enter("blockQuote",{_container:!0}),i.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),o}return a(l)}function o(l){return J(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function T3(e,t,a){let n=this;return r;function r(l){return J(l)?Q(e,o,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):o(l)}function o(l){return e.attempt(Md,t,a)(l)}}function A3(e){e.exit("blockQuote")}var Md,S1=I(()=>{"use strict";At();_e();Md={continuation:{tokenize:T3},exit:A3,name:"blockQuote",tokenize:L3}});function M3(e,t,a){return n;function n(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),r}function r(o){return MI(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):a(o)}}var Ed,C1=I(()=>{"use strict";_e();Ed={name:"characterEscape",tokenize:M3}});function E3(e,t,a){let n=this,r=0,o,l;return i;function i(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),s}function s(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),o=31,l=vt,c(d))}function u(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,l=AI,c):(e.enter("characterReferenceValue"),o=7,l=Os,c(d))}function c(d){if(d===59&&r){let f=e.exit("characterReferenceValue");return l===vt&&!Kl(n.sliceSerialize(f))?a(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(d)&&r++<o?(e.consume(d),c):a(d)}}var Rd,I1=I(()=>{"use strict";kd();_e();Rd={name:"characterReference",tokenize:E3}});function R3(e,t,a){let n=this,r={partial:!0,tokenize:A},o=0,l=0,i;return s;function s(S){return u(S)}function u(S){let M=n.events[n.events.length-1];return o=M&&M[1].type==="linePrefix"?M[2].sliceSerialize(M[1],!0).length:0,i=S,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(S)}function c(S){return S===i?(l++,e.consume(S),c):l<3?a(S):(e.exit("codeFencedFenceSequence"),J(S)?Q(e,d,"whitespace")(S):d(S))}function d(S){return S===null||V(S)?(e.exit("codeFencedFence"),n.interrupt?t(S):e.check(k1,x,C)(S)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(S))}function f(S){return S===null||V(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(S)):J(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Q(e,p,"whitespace")(S)):S===96&&S===i?a(S):(e.consume(S),f)}function p(S){return S===null||V(S)?d(S):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(S))}function m(S){return S===null||V(S)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(S)):S===96&&S===i?a(S):(e.consume(S),m)}function x(S){return e.attempt(r,C,v)(S)}function v(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),y}function y(S){return o>0&&J(S)?Q(e,w,"linePrefix",o+1)(S):w(S)}function w(S){return S===null||V(S)?e.check(k1,x,C)(S):(e.enter("codeFlowValue"),g(S))}function g(S){return S===null||V(S)?(e.exit("codeFlowValue"),w(S)):(e.consume(S),g)}function C(S){return e.exit("codeFenced"),t(S)}function A(S,M,R){let D=0;return L;function L(E){return S.enter("lineEnding"),S.consume(E),S.exit("lineEnding"),G}function G(E){return S.enter("codeFencedFence"),J(E)?Q(S,B,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):B(E)}function B(E){return E===i?(S.enter("codeFencedFenceSequence"),U(E)):R(E)}function U(E){return E===i?(D++,S.consume(E),U):D>=l?(S.exit("codeFencedFenceSequence"),J(E)?Q(S,W,"whitespace")(E):W(E)):R(E)}function W(E){return E===null||V(E)?(S.exit("codeFencedFence"),M(E)):R(E)}}}function D3(e,t,a){let n=this;return r;function r(l){return l===null?a(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return n.parser.lazy[n.now().line]?a(l):t(l)}}var k1,Dd,L1=I(()=>{"use strict";At();_e();k1={partial:!0,tokenize:D3},Dd={concrete:!0,name:"codeFenced",tokenize:R3}});function O3(e,t,a){let n=this;return r;function r(u){return e.enter("codeIndented"),Q(e,o,"linePrefix",5)(u)}function o(u){let c=n.events[n.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?l(u):a(u)}function l(u){return u===null?s(u):V(u)?e.attempt(_3,l,s)(u):(e.enter("codeFlowValue"),i(u))}function i(u){return u===null||V(u)?(e.exit("codeFlowValue"),l(u)):(e.consume(u),i)}function s(u){return e.exit("codeIndented"),t(u)}}function P3(e,t,a){let n=this;return r;function r(l){return n.parser.lazy[n.now().line]?a(l):V(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),r):Q(e,o,"linePrefix",5)(l)}function o(l){let i=n.events[n.events.length-1];return i&&i[1].type==="linePrefix"&&i[2].sliceSerialize(i[1],!0).length>=4?t(l):V(l)?r(l):a(l)}}var Us,_3,T1=I(()=>{"use strict";At();_e();Us={name:"codeIndented",tokenize:O3},_3={partial:!0,tokenize:P3}});function N3(e){let t=e.length-4,a=3,n,r;if((e[a][1].type==="lineEnding"||e[a][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(n=a;++n<t;)if(e[n][1].type==="codeTextData"){e[a][1].type="codeTextPadding",e[t][1].type="codeTextPadding",a+=2,t-=2;break}}for(n=a-1,t++;++n<=t;)r===void 0?n!==t&&e[n][1].type!=="lineEnding"&&(r=n):(n===t||e[n][1].type==="lineEnding")&&(e[r][1].type="codeTextData",n!==r+2&&(e[r][1].end=e[n-1][1].end,e.splice(r+2,n-r-2),t-=n-r-2,n=r+2),r=void 0);return e}function B3(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function U3(e,t,a){let n=this,r=0,o,l;return i;function i(f){return e.enter("codeText"),e.enter("codeTextSequence"),s(f)}function s(f){return f===96?(e.consume(f),r++,s):(e.exit("codeTextSequence"),u(f))}function u(f){return f===null?a(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),u):f===96?(l=e.enter("codeTextSequence"),o=0,d(f)):V(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),u):(e.enter("codeTextData"),c(f))}function c(f){return f===null||f===32||f===96||V(f)?(e.exit("codeTextData"),u(f)):(e.consume(f),c)}function d(f){return f===96?(e.consume(f),o++,d):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(l.type="codeTextData",c(f))}}var jg,A1=I(()=>{"use strict";_e();jg={name:"codeText",previous:B3,resolve:N3,tokenize:U3}});function Fs(e,t){let a=0;if(t.length<1e4)e.push(...t);else for(;a<t.length;)e.push(...t.slice(a,a+1e4)),a+=1e4}var _d,M1=I(()=>{"use strict";_d=class{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,a){let n=a??Number.POSITIVE_INFINITY;return n<this.left.length?this.left.slice(t,n):t>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(t,a,n){let r=a||0;this.setCursor(Math.trunc(t));let o=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return n&&Fs(this.left,n),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),Fs(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Fs(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){let a=this.left.splice(t,Number.POSITIVE_INFINITY);Fs(this.right,a.reverse())}else{let a=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Fs(this.left,a.reverse())}}}});function Od(e){let t={},a=-1,n,r,o,l,i,s,u,c=new _d(e);for(;++a<c.length;){for(;a in t;)a=t[a];if(n=c.get(a),a&&n[1].type==="chunkFlow"&&c.get(a-1)[1].type==="listItemPrefix"&&(s=n[1]._tokenizer.events,o=0,o<s.length&&s[o][1].type==="lineEndingBlank"&&(o+=2),o<s.length&&s[o][1].type==="content"))for(;++o<s.length&&s[o][1].type!=="content";)s[o][1].type==="chunkText"&&(s[o][1]._isInFirstContentOfListItem=!0,o++);if(n[0]==="enter")n[1].contentType&&(Object.assign(t,F3(c,a)),a=t[a],u=!0);else if(n[1]._container){for(o=a,r=void 0;o--;)if(l=c.get(o),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(r&&(c.get(r)[1].type="lineEndingBlank"),l[1].type="lineEnding",r=o);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;r&&(n[1].end={...c.get(r)[1].start},i=c.slice(r,a),i.unshift(n),c.splice(r,a-r+1,i))}}return Tt(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!u}function F3(e,t){let a=e.get(t)[1],n=e.get(t)[2],r=t-1,o=[],l=a._tokenizer;l||(l=n.parser[a.contentType](a.start),a._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));let i=l.events,s=[],u={},c,d,f=-1,p=a,m=0,x=0,v=[x];for(;p;){for(;e.get(++r)[1]!==p;);o.push(r),p._tokenizer||(c=n.sliceStream(p),p.next||c.push(null),d&&l.defineSkip(p.start),p._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(c),p._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=a;++f<i.length;)i[f][0]==="exit"&&i[f-1][0]==="enter"&&i[f][1].type===i[f-1][1].type&&i[f][1].start.line!==i[f][1].end.line&&(x=f+1,v.push(x),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(l.events=[],p?(p._tokenizer=void 0,p.previous=void 0):v.pop(),f=v.length;f--;){let y=i.slice(v[f],v[f+1]),w=o.pop();s.push([w,w+y.length-1]),e.splice(w,2,y)}for(s.reverse(),f=-1;++f<s.length;)u[m+s[f][0]]=m+s[f][1],m+=s[f][1]-s[f][0]-1;return u}var Vg=I(()=>{"use strict";Jn();M1()});function q3(e){return Od(e),e}function H3(e,t){let a;return n;function n(i){return e.enter("content"),a=e.enter("chunkContent",{contentType:"content"}),r(i)}function r(i){return i===null?o(i):V(i)?e.check(z3,l,o)(i):(e.consume(i),r)}function o(i){return e.exit("chunkContent"),e.exit("content"),t(i)}function l(i){return e.consume(i),e.exit("chunkContent"),a.next=e.enter("chunkContent",{contentType:"content",previous:a}),a=a.next,r}}function j3(e,t,a){let n=this;return r;function r(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Q(e,o,"linePrefix")}function o(l){if(l===null||V(l))return a(l);let i=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&i&&i[1].type==="linePrefix"&&i[2].sliceSerialize(i[1],!0).length>=4?t(l):e.interrupt(n.parser.constructs.flow,a,t)(l)}}var Gg,z3,E1=I(()=>{"use strict";At();_e();Vg();Gg={resolve:q3,tokenize:H3},z3={partial:!0,tokenize:j3}});function Pd(e,t,a,n,r,o,l,i,s){let u=s||Number.POSITIVE_INFINITY,c=0;return d;function d(y){return y===60?(e.enter(n),e.enter(r),e.enter(o),e.consume(y),e.exit(o),f):y===null||y===32||y===41||Mo(y)?a(y):(e.enter(n),e.enter(l),e.enter(i),e.enter("chunkString",{contentType:"string"}),x(y))}function f(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(r),e.exit(n),t):(e.enter(i),e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===62?(e.exit("chunkString"),e.exit(i),f(y)):y===null||y===60||V(y)?a(y):(e.consume(y),y===92?m:p)}function m(y){return y===60||y===62||y===92?(e.consume(y),p):p(y)}function x(y){return!c&&(y===null||y===41||pe(y))?(e.exit("chunkString"),e.exit(i),e.exit(l),e.exit(n),t(y)):c<u&&y===40?(e.consume(y),c++,x):y===41?(e.consume(y),c--,x):y===null||y===32||y===40||Mo(y)?a(y):(e.consume(y),y===92?v:x)}function v(y){return y===40||y===41||y===92?(e.consume(y),x):x(y)}}var $g=I(()=>{"use strict";_e()});function Nd(e,t,a,n,r,o){let l=this,i=0,s;return u;function u(p){return e.enter(n),e.enter(r),e.consume(p),e.exit(r),e.enter(o),c}function c(p){return i>999||p===null||p===91||p===93&&!s||p===94&&!i&&"_hiddenFootnoteSupport"in l.parser.constructs?a(p):p===93?(e.exit(o),e.enter(r),e.consume(p),e.exit(r),e.exit(n),t):V(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===null||p===91||p===93||V(p)||i++>999?(e.exit("chunkString"),c(p)):(e.consume(p),s||(s=!J(p)),p===92?f:d)}function f(p){return p===91||p===92||p===93?(e.consume(p),i++,d):d(p)}}var Wg=I(()=>{"use strict";_e()});function Bd(e,t,a,n,r,o){let l;return i;function i(f){return f===34||f===39||f===40?(e.enter(n),e.enter(r),e.consume(f),e.exit(r),l=f===40?41:f,s):a(f)}function s(f){return f===l?(e.enter(r),e.consume(f),e.exit(r),e.exit(n),t):(e.enter(o),u(f))}function u(f){return f===l?(e.exit(o),s(l)):f===null?a(f):V(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Q(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===l||f===null||V(f)?(e.exit("chunkString"),u(f)):(e.consume(f),f===92?d:c)}function d(f){return f===l||f===92?(e.consume(f),c):c(f)}}var Xg=I(()=>{"use strict";At();_e()});function Oo(e,t){let a;return n;function n(r){return V(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),a=!0,n):J(r)?Q(e,n,a?"linePrefix":"lineSuffix")(r):t(r)}}var Kg=I(()=>{"use strict";At();_e()});function G3(e,t,a){let n=this,r;return o;function o(p){return e.enter("definition"),l(p)}function l(p){return Nd.call(n,e,i,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function i(p){return r=Qt(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),s):a(p)}function s(p){return pe(p)?Oo(e,u)(p):u(p)}function u(p){return Pd(e,c,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function c(p){return e.attempt(V3,d,d)(p)}function d(p){return J(p)?Q(e,f,"whitespace")(p):f(p)}function f(p){return p===null||V(p)?(e.exit("definition"),n.parser.defined.push(r),t(p)):a(p)}}function $3(e,t,a){return n;function n(i){return pe(i)?Oo(e,r)(i):a(i)}function r(i){return Bd(e,o,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(i)}function o(i){return J(i)?Q(e,l,"whitespace")(i):l(i)}function l(i){return i===null||V(i)?t(i):a(i)}}var Zg,V3,R1=I(()=>{"use strict";$g();Wg();At();Xg();Kg();_e();Gl();Zg={name:"definition",tokenize:G3},V3={partial:!0,tokenize:$3}});function W3(e,t,a){return n;function n(o){return e.enter("hardBreakEscape"),e.consume(o),r}function r(o){return V(o)?(e.exit("hardBreakEscape"),t(o)):a(o)}}var Qg,D1=I(()=>{"use strict";_e();Qg={name:"hardBreakEscape",tokenize:W3}});function X3(e,t){let a=e.length-2,n=3,r,o;return e[n][1].type==="whitespace"&&(n+=2),a-2>n&&e[a][1].type==="whitespace"&&(a-=2),e[a][1].type==="atxHeadingSequence"&&(n===a-1||a-4>n&&e[a-2][1].type==="whitespace")&&(a-=n+1===a?2:4),a>n&&(r={type:"atxHeadingText",start:e[n][1].start,end:e[a][1].end},o={type:"chunkText",start:e[n][1].start,end:e[a][1].end,contentType:"text"},Tt(e,n,a-n+1,[["enter",r,t],["enter",o,t],["exit",o,t],["exit",r,t]])),e}function K3(e,t,a){let n=0;return r;function r(c){return e.enter("atxHeading"),o(c)}function o(c){return e.enter("atxHeadingSequence"),l(c)}function l(c){return c===35&&n++<6?(e.consume(c),l):c===null||pe(c)?(e.exit("atxHeadingSequence"),i(c)):a(c)}function i(c){return c===35?(e.enter("atxHeadingSequence"),s(c)):c===null||V(c)?(e.exit("atxHeading"),t(c)):J(c)?Q(e,i,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function s(c){return c===35?(e.consume(c),s):(e.exit("atxHeadingSequence"),i(c))}function u(c){return c===null||c===35||pe(c)?(e.exit("atxHeadingText"),i(c)):(e.consume(c),u)}}var Yg,_1=I(()=>{"use strict";At();_e();Jn();Yg={name:"headingAtx",resolve:X3,tokenize:K3}});var O1,Jg,P1=I(()=>{"use strict";O1=["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"],Jg=["pre","script","style","textarea"]});function Y3(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 J3(e,t,a){let n=this,r,o,l,i,s;return u;function u(k){return c(k)}function c(k){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(k),d}function d(k){return k===33?(e.consume(k),f):k===47?(e.consume(k),o=!0,x):k===63?(e.consume(k),r=3,n.interrupt?t:b):Bt(k)?(e.consume(k),l=String.fromCharCode(k),v):a(k)}function f(k){return k===45?(e.consume(k),r=2,p):k===91?(e.consume(k),r=5,i=0,m):Bt(k)?(e.consume(k),r=4,n.interrupt?t:b):a(k)}function p(k){return k===45?(e.consume(k),n.interrupt?t:b):a(k)}function m(k){let ke="CDATA[";return k===ke.charCodeAt(i++)?(e.consume(k),i===ke.length?n.interrupt?t:B:m):a(k)}function x(k){return Bt(k)?(e.consume(k),l=String.fromCharCode(k),v):a(k)}function v(k){if(k===null||k===47||k===62||pe(k)){let ke=k===47,ie=l.toLowerCase();return!ke&&!o&&Jg.includes(ie)?(r=1,n.interrupt?t(k):B(k)):O1.includes(l.toLowerCase())?(r=6,ke?(e.consume(k),y):n.interrupt?t(k):B(k)):(r=7,n.interrupt&&!n.parser.lazy[n.now().line]?a(k):o?w(k):g(k))}return k===45||vt(k)?(e.consume(k),l+=String.fromCharCode(k),v):a(k)}function y(k){return k===62?(e.consume(k),n.interrupt?t:B):a(k)}function w(k){return J(k)?(e.consume(k),w):L(k)}function g(k){return k===47?(e.consume(k),L):k===58||k===95||Bt(k)?(e.consume(k),C):J(k)?(e.consume(k),g):L(k)}function C(k){return k===45||k===46||k===58||k===95||vt(k)?(e.consume(k),C):A(k)}function A(k){return k===61?(e.consume(k),S):J(k)?(e.consume(k),A):g(k)}function S(k){return k===null||k===60||k===61||k===62||k===96?a(k):k===34||k===39?(e.consume(k),s=k,M):J(k)?(e.consume(k),S):R(k)}function M(k){return k===s?(e.consume(k),s=null,D):k===null||V(k)?a(k):(e.consume(k),M)}function R(k){return k===null||k===34||k===39||k===47||k===60||k===61||k===62||k===96||pe(k)?A(k):(e.consume(k),R)}function D(k){return k===47||k===62||J(k)?g(k):a(k)}function L(k){return k===62?(e.consume(k),G):a(k)}function G(k){return k===null||V(k)?B(k):J(k)?(e.consume(k),G):a(k)}function B(k){return k===45&&r===2?(e.consume(k),j):k===60&&r===1?(e.consume(k),$):k===62&&r===4?(e.consume(k),qe):k===63&&r===3?(e.consume(k),b):k===93&&r===5?(e.consume(k),Ie):V(k)&&(r===6||r===7)?(e.exit("htmlFlowData"),e.check(Z3,rt,U)(k)):k===null||V(k)?(e.exit("htmlFlowData"),U(k)):(e.consume(k),B)}function U(k){return e.check(Q3,W,rt)(k)}function W(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),E}function E(k){return k===null||V(k)?U(k):(e.enter("htmlFlowData"),B(k))}function j(k){return k===45?(e.consume(k),b):B(k)}function $(k){return k===47?(e.consume(k),l="",he):B(k)}function he(k){if(k===62){let ke=l.toLowerCase();return Jg.includes(ke)?(e.consume(k),qe):B(k)}return Bt(k)&&l.length<8?(e.consume(k),l+=String.fromCharCode(k),he):B(k)}function Ie(k){return k===93?(e.consume(k),b):B(k)}function b(k){return k===62?(e.consume(k),qe):k===45&&r===2?(e.consume(k),b):B(k)}function qe(k){return k===null||V(k)?(e.exit("htmlFlowData"),rt(k)):(e.consume(k),qe)}function rt(k){return e.exit("htmlFlow"),t(k)}}function eU(e,t,a){let n=this;return r;function r(l){return V(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):a(l)}function o(l){return n.parser.lazy[n.now().line]?a(l):t(l)}}function tU(e,t,a){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(bn,t,a)}}var ey,Z3,Q3,N1=I(()=>{"use strict";_e();P1();Ad();ey={concrete:!0,name:"htmlFlow",resolveTo:Y3,tokenize:J3},Z3={partial:!0,tokenize:tU},Q3={partial:!0,tokenize:eU}});function aU(e,t,a){let n=this,r,o,l;return i;function i(b){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(b),s}function s(b){return b===33?(e.consume(b),u):b===47?(e.consume(b),A):b===63?(e.consume(b),g):Bt(b)?(e.consume(b),R):a(b)}function u(b){return b===45?(e.consume(b),c):b===91?(e.consume(b),o=0,m):Bt(b)?(e.consume(b),w):a(b)}function c(b){return b===45?(e.consume(b),p):a(b)}function d(b){return b===null?a(b):b===45?(e.consume(b),f):V(b)?(l=d,$(b)):(e.consume(b),d)}function f(b){return b===45?(e.consume(b),p):d(b)}function p(b){return b===62?j(b):b===45?f(b):d(b)}function m(b){let qe="CDATA[";return b===qe.charCodeAt(o++)?(e.consume(b),o===qe.length?x:m):a(b)}function x(b){return b===null?a(b):b===93?(e.consume(b),v):V(b)?(l=x,$(b)):(e.consume(b),x)}function v(b){return b===93?(e.consume(b),y):x(b)}function y(b){return b===62?j(b):b===93?(e.consume(b),y):x(b)}function w(b){return b===null||b===62?j(b):V(b)?(l=w,$(b)):(e.consume(b),w)}function g(b){return b===null?a(b):b===63?(e.consume(b),C):V(b)?(l=g,$(b)):(e.consume(b),g)}function C(b){return b===62?j(b):g(b)}function A(b){return Bt(b)?(e.consume(b),S):a(b)}function S(b){return b===45||vt(b)?(e.consume(b),S):M(b)}function M(b){return V(b)?(l=M,$(b)):J(b)?(e.consume(b),M):j(b)}function R(b){return b===45||vt(b)?(e.consume(b),R):b===47||b===62||pe(b)?D(b):a(b)}function D(b){return b===47?(e.consume(b),j):b===58||b===95||Bt(b)?(e.consume(b),L):V(b)?(l=D,$(b)):J(b)?(e.consume(b),D):j(b)}function L(b){return b===45||b===46||b===58||b===95||vt(b)?(e.consume(b),L):G(b)}function G(b){return b===61?(e.consume(b),B):V(b)?(l=G,$(b)):J(b)?(e.consume(b),G):D(b)}function B(b){return b===null||b===60||b===61||b===62||b===96?a(b):b===34||b===39?(e.consume(b),r=b,U):V(b)?(l=B,$(b)):J(b)?(e.consume(b),B):(e.consume(b),W)}function U(b){return b===r?(e.consume(b),r=void 0,E):b===null?a(b):V(b)?(l=U,$(b)):(e.consume(b),U)}function W(b){return b===null||b===34||b===39||b===60||b===61||b===96?a(b):b===47||b===62||pe(b)?D(b):(e.consume(b),W)}function E(b){return b===47||b===62||pe(b)?D(b):a(b)}function j(b){return b===62?(e.consume(b),e.exit("htmlTextData"),e.exit("htmlText"),t):a(b)}function $(b){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),he}function he(b){return J(b)?Q(e,Ie,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):Ie(b)}function Ie(b){return e.enter("htmlTextData"),l(b)}}var ty,B1=I(()=>{"use strict";At();_e();ty={name:"htmlText",tokenize:aU}});function lU(e){let t=-1,a=[];for(;++t<e.length;){let n=e[t][1];if(a.push(e[t]),n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd"){let r=n.type==="labelImage"?4:2;n.type="data",t+=r}}return e.length!==a.length&&Tt(e,0,e.length,a),e}function iU(e,t){let a=e.length,n=0,r,o,l,i;for(;a--;)if(r=e[a][1],o){if(r.type==="link"||r.type==="labelLink"&&r._inactive)break;e[a][0]==="enter"&&r.type==="labelLink"&&(r._inactive=!0)}else if(l){if(e[a][0]==="enter"&&(r.type==="labelImage"||r.type==="labelLink")&&!r._balanced&&(o=a,r.type!=="labelLink")){n=2;break}}else r.type==="labelEnd"&&(l=a);let s={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[o][1].start},end:{...e[l][1].end}},c={type:"labelText",start:{...e[o+n+2][1].end},end:{...e[l-2][1].start}};return i=[["enter",s,t],["enter",u,t]],i=ra(i,e.slice(o+1,o+n+3)),i=ra(i,[["enter",c,t]]),i=ra(i,Vr(t.parser.constructs.insideSpan.null,e.slice(o+n+4,l-3),t)),i=ra(i,[["exit",c,t],e[l-2],e[l-1],["exit",u,t]]),i=ra(i,e.slice(l+1)),i=ra(i,[["exit",s,t]]),Tt(e,o,e.length,i),e}function sU(e,t,a){let n=this,r=n.events.length,o,l;for(;r--;)if((n.events[r][1].type==="labelImage"||n.events[r][1].type==="labelLink")&&!n.events[r][1]._balanced){o=n.events[r][1];break}return i;function i(f){return o?o._inactive?d(f):(l=n.parser.defined.includes(Qt(n.sliceSerialize({start:o.end,end:n.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),s):a(f)}function s(f){return f===40?e.attempt(nU,c,l?c:d)(f):f===91?e.attempt(rU,c,l?u:d)(f):l?c(f):d(f)}function u(f){return e.attempt(oU,c,d)(f)}function c(f){return t(f)}function d(f){return o._balanced=!0,a(f)}}function uU(e,t,a){return n;function n(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),r}function r(d){return pe(d)?Oo(e,o)(d):o(d)}function o(d){return d===41?c(d):Pd(e,l,i,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function l(d){return pe(d)?Oo(e,s)(d):c(d)}function i(d){return a(d)}function s(d){return d===34||d===39||d===40?Bd(e,u,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):c(d)}function u(d){return pe(d)?Oo(e,c)(d):c(d)}function c(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):a(d)}}function cU(e,t,a){let n=this;return r;function r(i){return Nd.call(n,e,o,l,"reference","referenceMarker","referenceString")(i)}function o(i){return n.parser.defined.includes(Qt(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?t(i):a(i)}function l(i){return a(i)}}function dU(e,t,a){return n;function n(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),r}function r(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):a(o)}}var Po,nU,rU,oU,Ud=I(()=>{"use strict";$g();Wg();Xg();Kg();_e();Jn();Gl();Ns();Po={name:"labelEnd",resolveAll:lU,resolveTo:iU,tokenize:sU},nU={tokenize:uU},rU={tokenize:cU},oU={tokenize:dU}});function fU(e,t,a){let n=this;return r;function r(i){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(i),e.exit("labelImageMarker"),o}function o(i){return i===91?(e.enter("labelMarker"),e.consume(i),e.exit("labelMarker"),e.exit("labelImage"),l):a(i)}function l(i){return i===94&&"_hiddenFootnoteSupport"in n.parser.constructs?a(i):t(i)}}var ay,U1=I(()=>{"use strict";Ud();ay={name:"labelStartImage",resolveAll:Po.resolveAll,tokenize:fU}});function pU(e,t,a){let n=this;return r;function r(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 n.parser.constructs?a(l):t(l)}}var ny,F1=I(()=>{"use strict";Ud();ny={name:"labelStartLink",resolveAll:Po.resolveAll,tokenize:pU}});function mU(e,t){return a;function a(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),Q(e,t,"linePrefix")}}var zs,z1=I(()=>{"use strict";At();zs={name:"lineEnding",tokenize:mU}});function hU(e,t,a){let n=0,r;return o;function o(u){return e.enter("thematicBreak"),l(u)}function l(u){return r=u,i(u)}function i(u){return u===r?(e.enter("thematicBreakSequence"),s(u)):n>=3&&(u===null||V(u))?(e.exit("thematicBreak"),t(u)):a(u)}function s(u){return u===r?(e.consume(u),n++,s):(e.exit("thematicBreakSequence"),J(u)?Q(e,i,"whitespace")(u):i(u))}}var No,ry=I(()=>{"use strict";At();_e();No={name:"thematicBreak",tokenize:hU}});function wU(e,t,a){let n=this,r=n.events[n.events.length-1],o=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,l=0;return i;function i(p){let m=n.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!n.containerState.marker||p===n.containerState.marker:Os(p)){if(n.containerState.type||(n.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(No,a,u)(p):u(p);if(!n.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(p)}return a(p)}function s(p){return Os(p)&&++l<10?(e.consume(p),s):(!n.interrupt||l<2)&&(n.containerState.marker?p===n.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):a(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||p,e.check(bn,n.interrupt?a:c,e.attempt(gU,f,d))}function c(p){return n.containerState.initialBlankLine=!0,o++,f(p)}function d(p){return J(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),f):a(p)}function f(p){return n.containerState.size=o+n.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function xU(e,t,a){let n=this;return n.containerState._closeFlow=void 0,e.check(bn,r,o);function r(i){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,Q(e,t,"listItemIndent",n.containerState.size+1)(i)}function o(i){return n.containerState.furtherBlankLines||!J(i)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,l(i)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,e.attempt(yU,t,l)(i))}function l(i){return n.containerState._closeFlow=!0,n.interrupt=void 0,Q(e,e.attempt(Yt,t,a),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i)}}function vU(e,t,a){let n=this;return Q(e,r,"listItemIndent",n.containerState.size+1);function r(o){let l=n.events[n.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===n.containerState.size?t(o):a(o)}}function bU(e){e.exit(this.containerState.type)}function SU(e,t,a){let n=this;return Q(e,r,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(o){let l=n.events[n.events.length-1];return!J(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):a(o)}}var Yt,gU,yU,q1=I(()=>{"use strict";At();_e();Ad();ry();Yt={continuation:{tokenize:xU},exit:bU,name:"list",tokenize:wU},gU={partial:!0,tokenize:SU},yU={partial:!0,tokenize:vU}});function CU(e,t){let a=e.length,n,r,o;for(;a--;)if(e[a][0]==="enter"){if(e[a][1].type==="content"){n=a;break}e[a][1].type==="paragraph"&&(r=a)}else e[a][1].type==="content"&&e.splice(a,1),!o&&e[a][1].type==="definition"&&(o=a);let l={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",o?(e.splice(r,0,["enter",l,t]),e.splice(o+1,0,["exit",e[n][1],t]),e[n][1].end={...e[o][1].end}):e[n][1]=l,e.push(["exit",l,t]),e}function IU(e,t,a){let n=this,r;return o;function o(u){let c=n.events.length,d;for(;c--;)if(n.events[c][1].type!=="lineEnding"&&n.events[c][1].type!=="linePrefix"&&n.events[c][1].type!=="content"){d=n.events[c][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||d)?(e.enter("setextHeadingLine"),r=u,l(u)):a(u)}function l(u){return e.enter("setextHeadingLineSequence"),i(u)}function i(u){return u===r?(e.consume(u),i):(e.exit("setextHeadingLineSequence"),J(u)?Q(e,s,"lineSuffix")(u):s(u))}function s(u){return u===null||V(u)?(e.exit("setextHeadingLine"),t(u)):a(u)}}var Fd,H1=I(()=>{"use strict";At();_e();Fd={name:"setextUnderline",resolveTo:CU,tokenize:IU}});var zd=I(()=>{"use strict";v1();b1();Ad();S1();C1();I1();L1();T1();A1();E1();R1();D1();_1();N1();B1();Ud();U1();F1();z1();q1();H1();ry()});function oy(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:MU,continuation:{tokenize:EU},exit:RU}},text:{91:{name:"gfmFootnoteCall",tokenize:AU},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:LU,resolveTo:TU}}}}function LU(e,t,a){let n=this,r=n.events.length,o=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]),l;for(;r--;){let s=n.events[r][1];if(s.type==="labelImage"){l=s;break}if(s.type==="gfmFootnoteCall"||s.type==="labelLink"||s.type==="label"||s.type==="image"||s.type==="link")break}return i;function i(s){if(!l||!l._balanced)return a(s);let u=Qt(n.sliceSerialize({start:l.end,end:n.now()}));return u.codePointAt(0)!==94||!o.includes(u.slice(1))?a(s):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(s),e.exit("gfmFootnoteCallLabelMarker"),t(s))}}function TU(e,t){let a=e.length,n;for(;a--;)if(e[a][1].type==="labelImage"&&e[a][0]==="enter"){n=e[a][1];break}e[a+1][1].type="data",e[a+3][1].type="gfmFootnoteCallLabelMarker";let r={type:"gfmFootnoteCall",start:Object.assign({},e[a+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[a+3][1].end),end:Object.assign({},e[a+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;let l={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},i={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},s=[e[a+1],e[a+2],["enter",r,t],e[a+3],e[a+4],["enter",o,t],["exit",o,t],["enter",l,t],["enter",i,t],["exit",i,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(a,e.length-a+1,...s),e}function AU(e,t,a){let n=this,r=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]),o=0,l;return i;function i(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),s}function s(d){return d!==94?a(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(d){if(o>999||d===93&&!l||d===null||d===91||pe(d))return a(d);if(d===93){e.exit("chunkString");let f=e.exit("gfmFootnoteCallString");return r.includes(Qt(n.sliceSerialize(f)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):a(d)}return pe(d)||(l=!0),o++,e.consume(d),d===92?c:u}function c(d){return d===91||d===92||d===93?(e.consume(d),o++,u):u(d)}}function MU(e,t,a){let n=this,r=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]),o,l=0,i;return s;function s(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):a(m)}function c(m){if(l>999||m===93&&!i||m===null||m===91||pe(m))return a(m);if(m===93){e.exit("chunkString");let x=e.exit("gfmFootnoteDefinitionLabelString");return o=Qt(n.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),f}return pe(m)||(i=!0),l++,e.consume(m),m===92?d:c}function d(m){return m===91||m===92||m===93?(e.consume(m),l++,c):c(m)}function f(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),r.includes(o)||r.push(o),Q(e,p,"gfmFootnoteDefinitionWhitespace")):a(m)}function p(m){return t(m)}}function EU(e,t,a){return e.check(bn,t,e.attempt(kU,t,a))}function RU(e){e.exit("gfmFootnoteDefinition")}function DU(e,t,a){let n=this;return Q(e,r,"gfmFootnoteDefinitionIndent",5);function r(o){let l=n.events[n.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(o):a(o)}}var kU,j1=I(()=>{"use strict";zd();At();_e();Gl();kU={tokenize:DU,partial:!0}});var V1=I(()=>{"use strict";j1()});function ly(e){let a=(e||{}).singleTilde,n={name:"strikethrough",tokenize:o,resolveAll:r};return a==null&&(a=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(l,i){let s=-1;for(;++s<l.length;)if(l[s][0]==="enter"&&l[s][1].type==="strikethroughSequenceTemporary"&&l[s][1]._close){let u=s;for(;u--;)if(l[u][0]==="exit"&&l[u][1].type==="strikethroughSequenceTemporary"&&l[u][1]._open&&l[s][1].end.offset-l[s][1].start.offset===l[u][1].end.offset-l[u][1].start.offset){l[s][1].type="strikethroughSequence",l[u][1].type="strikethroughSequence";let c={type:"strikethrough",start:Object.assign({},l[u][1].start),end:Object.assign({},l[s][1].end)},d={type:"strikethroughText",start:Object.assign({},l[u][1].end),end:Object.assign({},l[s][1].start)},f=[["enter",c,i],["enter",l[u][1],i],["exit",l[u][1],i],["enter",d,i]],p=i.parser.constructs.insideSpan.null;p&&Tt(f,f.length,0,Vr(p,l.slice(u+1,s),i)),Tt(f,f.length,0,[["exit",d,i],["enter",l[s][1],i],["exit",l[s][1],i],["exit",c,i]]),Tt(l,u-1,s-u+3,f),s=u+f.length-2;break}}for(s=-1;++s<l.length;)l[s][1].type==="strikethroughSequenceTemporary"&&(l[s][1].type="data");return l}function o(l,i,s){let u=this.previous,c=this.events,d=0;return f;function f(m){return u===126&&c[c.length-1][1].type!=="characterEscape"?s(m):(l.enter("strikethroughSequenceTemporary"),p(m))}function p(m){let x=Yn(u);if(m===126)return d>1?s(m):(l.consume(m),d++,p);if(d<2&&!a)return s(m);let v=l.exit("strikethroughSequenceTemporary"),y=Yn(m);return v._open=!y||y===2&&!!x,v._close=!x||x===2&&!!y,i(m)}}}var G1=I(()=>{"use strict";Jn();bd();Ns()});var $1=I(()=>{"use strict";G1()});function _U(e,t,a,n){let r=0;if(!(a===0&&n.length===0)){for(;r<e.map.length;){if(e.map[r][0]===t){e.map[r][1]+=a,e.map[r][2].push(...n);return}r+=1}e.map.push([t,a,n])}}var qd,W1=I(()=>{"use strict";qd=class{constructor(){this.map=[]}add(t,a,n){_U(this,t,a,n)}consume(t){if(this.map.sort(function(o,l){return o[0]-l[0]}),this.map.length===0)return;let a=this.map.length,n=[];for(;a>0;)a-=1,n.push(t.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),t.length=this.map[a][0];n.push(t.slice()),t.length=0;let r=n.pop();for(;r;){for(let o of r)t.push(o);r=n.pop()}this.map.length=0}}});function X1(e,t){let a=!1,n=[];for(;t<e.length;){let r=e[t];if(a){if(r[0]==="enter")r[1].type==="tableContent"&&n.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(r[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){let o=n.length-1;n[o]=n[o]==="left"?"center":"right"}}else if(r[1].type==="tableDelimiterRow")break}else r[0]==="enter"&&r[1].type==="tableDelimiterRow"&&(a=!0);t+=1}return n}var K1=I(()=>{"use strict"});function iy(){return{flow:{null:{name:"table",tokenize:OU,resolveAll:PU}}}}function OU(e,t,a){let n=this,r=0,o=0,l;return i;function i(L){let G=n.events.length-1;for(;G>-1;){let W=n.events[G][1].type;if(W==="lineEnding"||W==="linePrefix")G--;else break}let B=G>-1?n.events[G][1].type:null,U=B==="tableHead"||B==="tableRow"?S:s;return U===S&&n.parser.lazy[n.now().line]?a(L):U(L)}function s(L){return e.enter("tableHead"),e.enter("tableRow"),u(L)}function u(L){return L===124||(l=!0,o+=1),c(L)}function c(L){return L===null?a(L):V(L)?o>1?(o=0,n.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),p):a(L):J(L)?Q(e,c,"whitespace")(L):(o+=1,l&&(l=!1,r+=1),L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),l=!0,c):(e.enter("data"),d(L)))}function d(L){return L===null||L===124||pe(L)?(e.exit("data"),c(L)):(e.consume(L),L===92?f:d)}function f(L){return L===92||L===124?(e.consume(L),d):d(L)}function p(L){return n.interrupt=!1,n.parser.lazy[n.now().line]?a(L):(e.enter("tableDelimiterRow"),l=!1,J(L)?Q(e,m,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):m(L))}function m(L){return L===45||L===58?v(L):L===124?(l=!0,e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),x):A(L)}function x(L){return J(L)?Q(e,v,"whitespace")(L):v(L)}function v(L){return L===58?(o+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),y):L===45?(o+=1,y(L)):L===null||V(L)?C(L):A(L)}function y(L){return L===45?(e.enter("tableDelimiterFiller"),w(L)):A(L)}function w(L){return L===45?(e.consume(L),w):L===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),g):(e.exit("tableDelimiterFiller"),g(L))}function g(L){return J(L)?Q(e,C,"whitespace")(L):C(L)}function C(L){return L===124?m(L):L===null||V(L)?!l||r!==o?A(L):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(L)):A(L)}function A(L){return a(L)}function S(L){return e.enter("tableRow"),M(L)}function M(L){return L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),M):L===null||V(L)?(e.exit("tableRow"),t(L)):J(L)?Q(e,M,"whitespace")(L):(e.enter("data"),R(L))}function R(L){return L===null||L===124||pe(L)?(e.exit("data"),M(L)):(e.consume(L),L===92?D:R)}function D(L){return L===92||L===124?(e.consume(L),R):R(L)}}function PU(e,t){let a=-1,n=!0,r=0,o=[0,0,0,0],l=[0,0,0,0],i=!1,s=0,u,c,d,f=new qd;for(;++a<e.length;){let p=e[a],m=p[1];p[0]==="enter"?m.type==="tableHead"?(i=!1,s!==0&&(Z1(f,t,s,u,c),c=void 0,s=0),u={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(a,0,[["enter",u,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(n=!0,d=void 0,o=[0,0,0,0],l=[0,a+1,0,0],i&&(i=!1,c={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(a,0,[["enter",c,t]])),r=m.type==="tableDelimiterRow"?2:c?3:1):r&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(n=!1,l[2]===0&&(o[1]!==0&&(l[0]=l[1],d=Hd(f,t,o,r,void 0,d),o=[0,0,0,0]),l[2]=a)):m.type==="tableCellDivider"&&(n?n=!1:(o[1]!==0&&(l[0]=l[1],d=Hd(f,t,o,r,void 0,d)),o=l,l=[o[1],a,0,0])):m.type==="tableHead"?(i=!0,s=a):m.type==="tableRow"||m.type==="tableDelimiterRow"?(s=a,o[1]!==0?(l[0]=l[1],d=Hd(f,t,o,r,a,d)):l[1]!==0&&(d=Hd(f,t,l,r,a,d)),r=0):r&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(l[3]=a)}for(s!==0&&Z1(f,t,s,u,c),f.consume(t.events),a=-1;++a<t.events.length;){let p=t.events[a];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=X1(t.events,a))}return e}function Hd(e,t,a,n,r,o){let l=n===1?"tableHeader":n===2?"tableDelimiter":"tableData",i="tableContent";a[0]!==0&&(o.end=Object.assign({},Zl(t.events,a[0])),e.add(a[0],0,[["exit",o,t]]));let s=Zl(t.events,a[1]);if(o={type:l,start:Object.assign({},s),end:Object.assign({},s)},e.add(a[1],0,[["enter",o,t]]),a[2]!==0){let u=Zl(t.events,a[2]),c=Zl(t.events,a[3]),d={type:i,start:Object.assign({},u),end:Object.assign({},c)};if(e.add(a[2],0,[["enter",d,t]]),n!==2){let f=t.events[a[2]],p=t.events[a[3]];if(f[1].end=Object.assign({},p[1].end),f[1].type="chunkText",f[1].contentType="text",a[3]>a[2]+1){let m=a[2]+1,x=a[3]-a[2]-1;e.add(m,x,[])}}e.add(a[3]+1,0,[["exit",d,t]])}return r!==void 0&&(o.end=Object.assign({},Zl(t.events,r)),e.add(r,0,[["exit",o,t]]),o=void 0),o}function Z1(e,t,a,n,r){let o=[],l=Zl(t.events,a);r&&(r.end=Object.assign({},l),o.push(["exit",r,t])),n.end=Object.assign({},l),o.push(["exit",n,t]),e.add(a+1,0,o)}function Zl(e,t){let a=e[t],n=a[0]==="enter"?"start":"end";return a[1][n]}var Q1=I(()=>{"use strict";At();_e();W1();K1()});var Y1=I(()=>{"use strict";Q1()});function sy(){return{text:{91:NU}}}function BU(e,t,a){let n=this;return r;function r(s){return n.previous!==null||!n._gfmTasklistFirstContentOfListItem?a(s):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(s),e.exit("taskListCheckMarker"),o)}function o(s){return pe(s)?(e.enter("taskListCheckValueUnchecked"),e.consume(s),e.exit("taskListCheckValueUnchecked"),l):s===88||s===120?(e.enter("taskListCheckValueChecked"),e.consume(s),e.exit("taskListCheckValueChecked"),l):a(s)}function l(s){return s===93?(e.enter("taskListCheckMarker"),e.consume(s),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),i):a(s)}function i(s){return V(s)?t(s):J(s)?e.check({tokenize:UU},t,a)(s):a(s)}}function UU(e,t,a){return Q(e,n,"whitespace");function n(r){return r===null?a(r):t(r)}}var NU,J1=I(()=>{"use strict";At();_e();NU={name:"tasklistCheck",tokenize:BU}});var eL=I(()=>{"use strict";J1()});function tL(e){return Td([zg(),oy(),ly(e),iy(),sy()])}var aL=I(()=>{"use strict";Ug();w1();V1();$1();Y1();eL()});function jd(e){let t=this,a=e||FU,n=t.data(),r=n.micromarkExtensions||(n.micromarkExtensions=[]),o=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),l=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);r.push(tL(a)),o.push(Ng()),l.push(Bg(a))}var FU,nL=I(()=>{"use strict";i1();aL();FU={}});var rL=I(()=>{"use strict";nL()});var zU,qU,HU,oL,jU,VU,lL,uL,cL,GU,$U,WU,XU,KU,ZU,QU,Bo,dL,YU,JU,e4,t4,a4,n4,iL,Gr,Ql,r4,fL,Gd,o4,pL,cy,l4,i4,mL,s4,u4,c4,d4,f4,p4,m4,h4,g4,hL,y4,w4,x4,v4,b4,S4,Vd,C4,I4,k4,L4,T4,A4,M4,E4,R4,D4,sL,_4,gL,O4,P4,N4,B4,U4,F4,uy,Da,z4,q4,H4,yL,wL=I(()=>{"use strict";zU=Object.defineProperty,qU=Object.defineProperties,HU=Object.getOwnPropertyDescriptors,oL=Object.getOwnPropertySymbols,jU=Object.prototype.hasOwnProperty,VU=Object.prototype.propertyIsEnumerable,lL=(e,t,a)=>t in e?zU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,uL=(e,t)=>{for(var a in t||(t={}))jU.call(t,a)&&lL(e,a,t[a]);if(oL)for(var a of oL(t))VU.call(t,a)&&lL(e,a,t[a]);return e},cL=(e,t)=>qU(e,HU(t)),GU=/(\*\*)([^*]*\*?)$/,$U=/(__)([^_]*?)$/,WU=/(\*\*\*)([^*]*?)$/,XU=/(\*)([^*]*?)$/,KU=/(_)([^_]*?)$/,ZU=/(`)([^`]*?)$/,QU=/(~~)([^~]*?)$/,Bo=/^[\s_~*`]*$/,dL=/^[\s]*[-*+][\s]+$/,YU=/[\p{L}\p{N}_]/u,JU=/^```[^`\n]*```?$/,e4=/^\*{4,}$/,t4=/(__)([^_]+)_$/,a4=/(~~)([^~]+)~$/,n4=/__/g,iL=/~~/g,Gr=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:YU.test(e)},Ql=(e,t)=>{let a=!1;for(let n=0;n<t;n+=1)e[n]==="`"&&e[n+1]==="`"&&e[n+2]==="`"&&(a=!a,n+=2);return a},r4=(e,t)=>{let a=1;for(let n=t-1;n>=0;n-=1)if(e[n]==="]")a+=1;else if(e[n]==="["&&(a-=1,a===0))return n;return-1},fL=(e,t)=>{let a=1;for(let n=t+1;n<e.length;n+=1)if(e[n]==="[")a+=1;else if(e[n]==="]"&&(a-=1,a===0))return n;return-1},Gd=(e,t)=>{let a=!1,n=!1;for(let r=0;r<e.length&&r<t;r+=1){if(e[r]==="\\"&&e[r+1]==="$"){r+=1;continue}e[r]==="$"&&(e[r+1]==="$"?(n=!n,r+=1,a=!1):n||(a=!a))}return a||n},o4=(e,t)=>{for(let a=t;a<e.length;a+=1){if(e[a]===")")return!0;if(e[a]===`
|
|
25
|
+
`)return!1}return!1},pL=(e,t)=>{for(let a=t-1;a>=0;a-=1){if(e[a]===")")return!1;if(e[a]==="(")return a>0&&e[a-1]==="]"?o4(e,t):!1;if(e[a]===`
|
|
26
|
+
`)return!1}return!1},cy=(e,t,a)=>{let n=0;for(let s=t-1;s>=0;s-=1)if(e[s]===`
|
|
27
27
|
`){n=s+1;break}let r=e.length;for(let s=t;s<e.length;s+=1)if(e[s]===`
|
|
28
|
-
`){r=s;break}let o=e.substring(n,r),
|
|
29
|
-
`){n=r+1;break}for(let r=n;r<t;r+=1)if(e[r]!==" "&&e[r]!==" ")return!1;return!0},
|
|
30
|
-
`),r=n===-1?0:n+1,o=e.substring(r,a);return
|
|
31
|
-
`)?!0:
|
|
32
|
-
`),r=n===-1?0:n+1,o=e.substring(r,a);return
|
|
33
|
-
`)?!0:
|
|
34
|
-
`;)t-=1;if(t<e.length){let a=e.slice(0,t),n=e.slice(t);return`${a}_${n}`}return`${e}_`},
|
|
35
|
-
`)?null:e.endsWith("``")&&!e.endsWith("```")?`${e}\``:e,
|
|
28
|
+
`){r=s;break}let o=e.substring(n,r),l=0,i=!1;for(let s of o)if(s===a)l+=1;else if(s!==" "&&s!==" "){i=!0;break}return l>=3&&!i},l4=(e,t,a)=>{if(a!==" "&&a!==" ")return!1;let n=0;for(let r=t-1;r>=0;r-=1)if(e[r]===`
|
|
29
|
+
`){n=r+1;break}for(let r=n;r<t;r+=1)if(e[r]!==" "&&e[r]!==" ")return!1;return!0},i4=(e,t,a,n)=>a==="\\"||e.includes("$")&&Gd(e,t)?!0:a!=="*"&&n==="*"?(t<e.length-2?e[t+2]:"")!=="*":!!(a==="*"||a&&n&&Gr(a)&&Gr(n)||l4(e,t,n)),mL=e=>{let t=0,a=e.length;for(let n=0;n<a;n+=1){if(e[n]!=="*")continue;let r=n>0?e[n-1]:"",o=n<a-1?e[n+1]:"";i4(e,n,r,o)||(t+=1)}return t},s4=(e,t,a,n)=>!!(a==="\\"||e.includes("$")&&Gd(e,t)||pL(e,t)||a==="_"||n==="_"||a&&n&&Gr(a)&&Gr(n)),u4=e=>{let t=0,a=e.length;for(let n=0;n<a;n+=1){if(e[n]!=="_")continue;let r=n>0?e[n-1]:"",o=n<a-1?e[n+1]:"";s4(e,n,r,o)||(t+=1)}return t},c4=e=>{let t=0,a=0;for(let n=0;n<e.length;n+=1)e[n]==="*"?a+=1:(a>=3&&(t+=Math.floor(a/3)),a=0);return a>=3&&(t+=Math.floor(a/3)),t},d4=(e,t,a)=>{if(!t||Bo.test(t))return!0;let n=e.substring(0,a).lastIndexOf(`
|
|
30
|
+
`),r=n===-1?0:n+1,o=e.substring(r,a);return dL.test(o)&&t.includes(`
|
|
31
|
+
`)?!0:cy(e,a,"*")},f4=e=>{let t=e.match(GU);if(!t)return e;let a=t[2],n=e.lastIndexOf(t[1]);return Ql(e,n)||d4(e,a,n)?e:(e.match(/\*\*/g)||[]).length%2===1?a.endsWith("*")?`${e}*`:`${e}**`:e},p4=(e,t,a)=>{if(!t||Bo.test(t))return!0;let n=e.substring(0,a).lastIndexOf(`
|
|
32
|
+
`),r=n===-1?0:n+1,o=e.substring(r,a);return dL.test(o)&&t.includes(`
|
|
33
|
+
`)?!0:cy(e,a,"_")},m4=e=>{let t=e.match($U);if(!t){let r=e.match(t4);if(r){let o=e.lastIndexOf(r[1]);if(!Ql(e,o)&&(e.match(n4)||[]).length%2===1)return`${e}_`}return e}let a=t[2],n=e.lastIndexOf(t[1]);return Ql(e,n)||p4(e,a,n)?e:(e.match(/__/g)||[]).length%2===1?`${e}__`:e},h4=e=>{for(let t=0;t<e.length;t+=1)if(e[t]==="*"&&e[t-1]!=="*"&&e[t+1]!=="*"&&e[t-1]!=="\\"&&!Gd(e,t)){let a=t>0?e[t-1]:"",n=t<e.length-1?e[t+1]:"";if(a&&n&&Gr(a)&&Gr(n))continue;return t}return-1},g4=e=>{if(!e.match(XU))return e;let t=h4(e);if(t===-1||Ql(e,t))return e;let a=e.substring(t+1);return!a||Bo.test(a)?e:mL(e)%2===1?`${e}*`:e},hL=e=>{for(let t=0;t<e.length;t+=1)if(e[t]==="_"&&e[t-1]!=="_"&&e[t+1]!=="_"&&e[t-1]!=="\\"&&!Gd(e,t)&&!pL(e,t)){let a=t>0?e[t-1]:"",n=t<e.length-1?e[t+1]:"";if(a&&n&&Gr(a)&&Gr(n))continue;return t}return-1},y4=e=>{let t=e.length;for(;t>0&&e[t-1]===`
|
|
34
|
+
`;)t-=1;if(t<e.length){let a=e.slice(0,t),n=e.slice(t);return`${a}_${n}`}return`${e}_`},w4=e=>{if(!e.endsWith("**"))return null;let t=e.slice(0,-2);if((t.match(/\*\*/g)||[]).length%2!==1)return null;let a=t.indexOf("**"),n=hL(t);return a!==-1&&n!==-1&&a<n?`${t}_**`:null},x4=e=>{if(!e.match(KU))return e;let t=hL(e);if(t===-1||Ql(e,t))return e;let a=e.substring(t+1);if(!a||Bo.test(a))return e;if(u4(e)%2===1){let n=w4(e);return n!==null?n:y4(e)}return e},v4=e=>{let t=(e.match(/\*\*/g)||[]).length,a=mL(e);return t%2===0&&a%2===0},b4=(e,t,a)=>!t||Bo.test(t)||Ql(e,a)?!0:cy(e,a,"*"),S4=e=>{if(e4.test(e))return e;let t=e.match(WU);if(!t)return e;let a=t[2],n=e.lastIndexOf(t[1]);return b4(e,a,n)?e:c4(e)%2===1?v4(e)?e:`${e}***`:e},Vd=(e,t)=>{let a=!1,n=!1;for(let r=0;r<t;r+=1){if(e.substring(r,r+3)==="```"){n=!n,r+=2;continue}!n&&e[r]==="`"&&(a=!a)}return a||n},C4=(e,t)=>{let a=e.substring(t,t+3)==="```",n=t>0&&e.substring(t-1,t+2)==="```",r=t>1&&e.substring(t-2,t+1)==="```";return a||n||r},I4=e=>{let t=0;for(let a=0;a<e.length;a+=1)e[a]==="`"&&!C4(e,a)&&(t+=1);return t},k4=e=>!e.match(JU)||e.includes(`
|
|
35
|
+
`)?null:e.endsWith("``")&&!e.endsWith("```")?`${e}\``:e,L4=e=>(e.match(/```/g)||[]).length%2===1,T4=e=>{let t=k4(e);if(t!==null)return t;let a=e.match(ZU);if(a&&!L4(e)){let n=a[2];if(!n||Bo.test(n))return e;if(I4(e)%2===1)return`${e}\``}return e},A4=(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)==="```",M4=e=>{let t=0,a=!1;for(let n=0;n<e.length-1;n+=1)e[n]==="`"&&!A4(e,n)&&(a=!a),!a&&e[n]==="$"&&e[n+1]==="$"&&(t+=1,n+=1);return t},E4=e=>{let t=e.indexOf("$$");return t!==-1&&e.indexOf(`
|
|
36
36
|
`,t)!==-1&&!e.endsWith(`
|
|
37
37
|
`)?`${e}
|
|
38
|
-
$$`:`${e}$$`},
|
|
39
|
-
`);if(t===-1)return e;let a=e.substring(t+1),n=e.substring(0,t),r=a.trim();if(
|
|
40
|
-
`).at(-1);if(o&&o.trim().length>0)return`${e}\u200B`}if(
|
|
41
|
-
`).at(-1);if(o&&o.trim().length>0)return`${e}\u200B`}return e},J4=e=>{let t=e.match(d4);if(t){let a=t[2];if(!a||Bo.test(a))return e;if((e.match(vL)||[]).length%2===1)return`${e}~~`}else if(e.match(g4)&&(e.match(vL)||[]).length%2===1)return`${e}~`;return e},xy=e=>e!==!1,_a={SETEXT_HEADINGS:0,LINKS:10,BOLD_ITALIC:20,BOLD:30,ITALIC_DOUBLE_UNDERSCORE:40,ITALIC_SINGLE_ASTERISK:41,ITALIC_SINGLE_UNDERSCORE:42,INLINE_CODE:50,STRIKETHROUGH:60,KATEX:70,DEFAULT:100},eF=[{handler:{name:"setextHeadings",handle:Y4,priority:_a.SETEXT_HEADINGS},optionKey:"setextHeadings"},{handler:{name:"links",handle:ML,priority:_a.LINKS},optionKey:"links",earlyReturn:e=>e.endsWith("](streamdown:incomplete-link)")},{handler:{name:"boldItalic",handle:N4,priority:_a.BOLD_ITALIC},optionKey:"boldItalic"},{handler:{name:"bold",handle:L4,priority:_a.BOLD},optionKey:"bold"},{handler:{name:"italicDoubleUnderscore",handle:E4,priority:_a.ITALIC_DOUBLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"italicSingleAsterisk",handle:A4,priority:_a.ITALIC_SINGLE_ASTERISK},optionKey:"italic"},{handler:{name:"italicSingleUnderscore",handle:_4,priority:_a.ITALIC_SINGLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"inlineCode",handle:q4,priority:_a.INLINE_CODE},optionKey:"inlineCode"},{handler:{name:"strikethrough",handle:J4,priority:_a.STRIKETHROUGH},optionKey:"strikethrough"},{handler:{name:"katex",handle:G4,priority:_a.KATEX},optionKey:"katex"}],tF=e=>{var t;let a=(t=e?.linkMode)!=null?t:"protocol";return eF.filter(({handler:n,optionKey:r})=>n.name==="links"?xy(e?.links)||xy(e?.images):xy(e?.[r])).map(({handler:n,earlyReturn:r})=>n.name==="links"?{handler:IL(SL({},n),{handle:o=>ML(o,a)}),earlyReturn:a==="protocol"?r:void 0}:{handler:n,earlyReturn:r})},aF=(e,t)=>{var a;if(!e||typeof e!="string")return e;let n=e.endsWith(" ")&&!e.endsWith(" ")?e.slice(0,-1):e,r=tF(t),o=((a=t?.handlers)!=null?a:[]).map(l=>{var s;return{handler:IL(SL({},l),{priority:(s=l.priority)!=null?s:_a.DEFAULT}),earlyReturn:void 0}}),i=[...r,...o].sort((l,s)=>{var u,c;return((u=l.handler.priority)!=null?u:_a.DEFAULT)-((c=s.handler.priority)!=null?c:_a.DEFAULT)});for(let{handler:l,earlyReturn:s}of i)if(n=l.handle(n),s!=null&&s(n))return n;return n},AL=aF});function DL(e,t){let a=t||{};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}var _L=C(()=>{"use strict"});function Zd(e,t){return((t||oF).jsx?rF:nF).test(e)}var nF,rF,oF,OL=C(()=>{"use strict";nF=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,rF=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,oF={}});var PL=C(()=>{"use strict";OL()});function by(e){return typeof e=="object"?e.type==="text"?NL(e.value):!1:NL(e)}function NL(e){return e.replace(iF,"")===""}var iF,BL=C(()=>{"use strict";iF=/[ \t\n\f\r]/g});var UL=C(()=>{"use strict";BL()});var nr,Sy=C(()=>{"use strict";nr=class{constructor(t,a,n){this.normal=a,this.property=t,n&&(this.space=n)}};nr.prototype.normal={};nr.prototype.property={};nr.prototype.space=void 0});function Iy(e,t){let a={},n={};for(let r of e)Object.assign(a,r.property),Object.assign(n,r.normal);return new nr(a,n,t)}var FL=C(()=>{"use strict";Sy()});function Vs(e){return e.toLowerCase()}var Cy=C(()=>{"use strict"});var jt,ky=C(()=>{"use strict";jt=class{constructor(t,a){this.attribute=a,this.property=t}};jt.prototype.attribute="";jt.prototype.booleanish=!1;jt.prototype.boolean=!1;jt.prototype.commaOrSpaceSeparated=!1;jt.prototype.commaSeparated=!1;jt.prototype.defined=!1;jt.prototype.mustUseProperty=!1;jt.prototype.number=!1;jt.prototype.overloadedBoolean=!1;jt.prototype.property="";jt.prototype.spaceSeparated=!1;jt.prototype.space=void 0});var Gs={};ku(Gs,{boolean:()=>fe,booleanish:()=>xt,commaOrSpaceSeparated:()=>ga,commaSeparated:()=>Wr,number:()=>F,overloadedBoolean:()=>Qd,spaceSeparated:()=>He});function Uo(){return 2**++lF}var lF,fe,xt,Qd,F,He,Wr,ga,Ws=C(()=>{"use strict";lF=0,fe=Uo(),xt=Uo(),Qd=Uo(),F=Uo(),He=Uo(),Wr=Uo(),ga=Uo()});function zL(e,t,a){a&&(e[t]=a)}var Ly,Fo,Ty=C(()=>{"use strict";ky();Ws();Ly=Object.keys(Gs),Fo=class extends jt{constructor(t,a,n,r){let o=-1;if(super(t,a),zL(this,"space",r),typeof n=="number")for(;++o<Ly.length;){let i=Ly[o];zL(this,Ly[o],(n&Gs[i])===Gs[i])}}};Fo.prototype.defined=!0});function Qa(e){let t={},a={};for(let[n,r]of Object.entries(e.properties)){let o=new Fo(n,e.transform(e.attributes||{},n),r,e.space);e.mustUseProperty&&e.mustUseProperty.includes(n)&&(o.mustUseProperty=!0),t[n]=o,a[Vs(n)]=n,a[Vs(o.attribute)]=n}return new nr(t,a,e.space)}var zo=C(()=>{"use strict";Cy();Ty();Sy()});var Ey,qL=C(()=>{"use strict";zo();Ws();Ey=Qa({properties:{ariaActiveDescendant:null,ariaAtomic:xt,ariaAutoComplete:null,ariaBusy:xt,ariaChecked:xt,ariaColCount:F,ariaColIndex:F,ariaColSpan:F,ariaControls:He,ariaCurrent:null,ariaDescribedBy:He,ariaDetails:null,ariaDisabled:xt,ariaDropEffect:He,ariaErrorMessage:null,ariaExpanded:xt,ariaFlowTo:He,ariaGrabbed:xt,ariaHasPopup:null,ariaHidden:xt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:He,ariaLevel:F,ariaLive:null,ariaModal:xt,ariaMultiLine:xt,ariaMultiSelectable:xt,ariaOrientation:null,ariaOwns:He,ariaPlaceholder:null,ariaPosInSet:F,ariaPressed:xt,ariaReadOnly:xt,ariaRelevant:null,ariaRequired:xt,ariaRoleDescription:He,ariaRowCount:F,ariaRowIndex:F,ariaRowSpan:F,ariaSelected:xt,ariaSetSize:F,ariaSort:null,ariaValueMax:F,ariaValueMin:F,ariaValueNow:F,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}})});function Yd(e,t){return t in e?e[t]:t}var My=C(()=>{"use strict"});function Jd(e,t){return Yd(e,t.toLowerCase())}var Ay=C(()=>{"use strict";My()});var HL,jL=C(()=>{"use strict";Ay();zo();Ws();HL=Qa({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Wr,acceptCharset:He,accessKey:He,action:null,allow:null,allowFullScreen:fe,allowPaymentRequest:fe,allowUserMedia:fe,alt:null,as:null,async:fe,autoCapitalize:null,autoComplete:He,autoFocus:fe,autoPlay:fe,blocking:He,capture:null,charSet:null,checked:fe,cite:null,className:He,cols:F,colSpan:null,content:null,contentEditable:xt,controls:fe,controlsList:He,coords:F|Wr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:fe,defer:fe,dir:null,dirName:null,disabled:fe,download:Qd,draggable:xt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:fe,formTarget:null,headers:He,height:F,hidden:Qd,high:F,href:null,hrefLang:null,htmlFor:He,httpEquiv:He,id:null,imageSizes:null,imageSrcSet:null,inert:fe,inputMode:null,integrity:null,is:null,isMap:fe,itemId:null,itemProp:He,itemRef:He,itemScope:fe,itemType:He,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:fe,low:F,manifest:null,max:null,maxLength:F,media:null,method:null,min:null,minLength:F,multiple:fe,muted:fe,name:null,nonce:null,noModule:fe,noValidate:fe,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:fe,optimum:F,pattern:null,ping:He,placeholder:null,playsInline:fe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:fe,referrerPolicy:null,rel:He,required:fe,reversed:fe,rows:F,rowSpan:F,sandbox:He,scope:null,scoped:fe,seamless:fe,selected:fe,shadowRootClonable:fe,shadowRootDelegatesFocus:fe,shadowRootMode:null,shape:null,size:F,sizes:null,slot:null,span:F,spellCheck:xt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:F,step:null,style:null,tabIndex:F,target:null,title:null,translate:null,type:null,typeMustMatch:fe,useMap:null,value:xt,width:F,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:He,axis:null,background:null,bgColor:null,border:F,borderColor:null,bottomMargin:F,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:fe,declare:fe,event:null,face:null,frame:null,frameBorder:null,hSpace:F,leftMargin:F,link:null,longDesc:null,lowSrc:null,marginHeight:F,marginWidth:F,noResize:fe,noHref:fe,noShade:fe,noWrap:fe,object:null,profile:null,prompt:null,rev:null,rightMargin:F,rules:null,scheme:null,scrolling:xt,standby:null,summary:null,text:null,topMargin:F,valueType:null,version:null,vAlign:null,vLink:null,vSpace:F,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:fe,disableRemotePlayback:fe,prefix:null,property:null,results:F,security:null,unselectable:null},space:"html",transform:Jd})});var VL,GL=C(()=>{"use strict";My();zo();Ws();VL=Qa({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ga,accentHeight:F,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:F,amplitude:F,arabicForm:null,ascent:F,attributeName:null,attributeType:null,azimuth:F,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:F,by:null,calcMode:null,capHeight:F,className:He,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:F,diffuseConstant:F,direction:null,display:null,dur:null,divisor:F,dominantBaseline:null,download:fe,dx:null,dy:null,edgeMode:null,editable:null,elevation:F,enableBackground:null,end:null,event:null,exponent:F,externalResourcesRequired:null,fill:null,fillOpacity:F,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:Wr,g2:Wr,glyphName:Wr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:F,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:F,horizOriginX:F,horizOriginY:F,id:null,ideographic:F,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:F,k:F,k1:F,k2:F,k3:F,k4:F,kernelMatrix:ga,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:F,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:F,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:F,overlineThickness:F,paintOrder:null,panose1:null,path:null,pathLength:F,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:He,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:F,pointsAtY:F,pointsAtZ:F,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ga,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ga,rev:ga,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ga,requiredFeatures:ga,requiredFonts:ga,requiredFormats:ga,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:F,specularExponent:F,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:F,strikethroughThickness:F,string:null,stroke:null,strokeDashArray:ga,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:F,strokeOpacity:F,strokeWidth:null,style:null,surfaceScale:F,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ga,tabIndex:F,tableValues:null,target:null,targetX:F,targetY:F,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ga,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:F,underlineThickness:F,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:F,values:null,vAlphabetic:F,vMathematical:F,vectorEffect:null,vHanging:F,vIdeographic:F,version:null,vertAdvY:F,vertOriginX:F,vertOriginY:F,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:F,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Yd})});var Ry,WL=C(()=>{"use strict";zo();Ry=Qa({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()}})});var Dy,$L=C(()=>{"use strict";zo();Ay();Dy=Qa({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Jd})});var _y,XL=C(()=>{"use strict";zo();_y=Qa({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}})});var Oy,KL=C(()=>{"use strict";Oy={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"}});function Py(e,t){let a=Vs(t),n=t,r=jt;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&uF.test(t)){if(t.charAt(4)==="-"){let o=t.slice(5).replace(ZL,dF);n="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{let o=t.slice(4);if(!ZL.test(o)){let i=o.replace(sF,cF);i.charAt(0)!=="-"&&(i="-"+i),t="data"+i}}r=Fo}return new r(n,t)}function cF(e){return"-"+e.toLowerCase()}function dF(e){return e.charAt(1).toUpperCase()}var sF,ZL,uF,QL=C(()=>{"use strict";Ty();ky();Cy();sF=/[A-Z]/g,ZL=/-[a-z]/g,uF=/^data[-\w.:]+$/i});var YL,ef,JL=C(()=>{"use strict";FL();qL();jL();GL();WL();$L();XL();KL();QL();YL=Iy([Ey,HL,Ry,Dy,_y],"html"),ef=Iy([Ey,VL,Ry,Dy,_y],"svg")});function eT(e){return e.join(" ").trim()}var tT=C(()=>{"use strict"});var lT=Kt((fY,iT)=>{"use strict";var aT=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,fF=/\n/g,pF=/^\s*/,mF=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,hF=/^:\s*/,gF=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,yF=/^[;\s]*/,wF=/^\s+|\s+$/g,xF=`
|
|
42
|
-
`,nT="/",rT="*",qo="",vF="comment",bF="declaration";function SF(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var a=1,n=1;function r(m){var x=m.match(fF);x&&(a+=x.length);var I=m.lastIndexOf(xF);n=~I?m.length-I:n+m.length}function o(){var m={line:a,column:n};return function(x){return x.position=new i(m),u(),x}}function i(m){this.start=m,this.end={line:a,column:n},this.source=t.source}i.prototype.content=e;function l(m){var x=new Error(t.source+":"+a+":"+n+": "+m);if(x.reason=m,x.filename=t.source,x.line=a,x.column=n,x.source=e,!t.silent)throw x}function s(m){var x=m.exec(e);if(x){var I=x[0];return r(I),e=e.slice(I.length),x}}function u(){s(pF)}function c(m){var x;for(m=m||[];x=d();)x!==!1&&m.push(x);return m}function d(){var m=o();if(!(nT!=e.charAt(0)||rT!=e.charAt(1))){for(var x=2;qo!=e.charAt(x)&&(rT!=e.charAt(x)||nT!=e.charAt(x+1));)++x;if(x+=2,qo===e.charAt(x-1))return l("End of comment missing");var I=e.slice(2,x-2);return n+=2,r(I),e=e.slice(x),n+=2,m({type:vF,comment:I})}}function f(){var m=o(),x=s(mF);if(x){if(d(),!s(hF))return l("property missing ':'");var I=s(gF),y=m({type:bF,property:oT(x[0].replace(aT,qo)),value:I?oT(I[0].replace(aT,qo)):qo});return s(yF),y}}function p(){var m=[];c(m);for(var x;x=f();)x!==!1&&(m.push(x),c(m));return m}return u(),p()}function oT(e){return e?e.replace(wF,qo):qo}iT.exports=SF});var sT=Kt($s=>{"use strict";var IF=$s&&$s.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty($s,"__esModule",{value:!0});$s.default=kF;var CF=IF(lT());function kF(e,t){let a=null;if(!e||typeof e!="string")return a;let n=(0,CF.default)(e),r=typeof t=="function";return n.forEach(o=>{if(o.type!=="declaration")return;let{property:i,value:l}=o;r?t(i,l,o):l&&(a=a||{},a[i]=l)}),a}});var cT=Kt(tf=>{"use strict";Object.defineProperty(tf,"__esModule",{value:!0});tf.camelCase=void 0;var LF=/^--[a-zA-Z0-9_-]+$/,TF=/-([a-z])/g,EF=/^[^-]+$/,MF=/^-(webkit|moz|ms|o|khtml)-/,AF=/^-(ms)-/,RF=function(e){return!e||EF.test(e)||LF.test(e)},DF=function(e,t){return t.toUpperCase()},uT=function(e,t){return"".concat(t,"-")},_F=function(e,t){return t===void 0&&(t={}),RF(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(AF,uT):e=e.replace(MF,uT),e.replace(TF,DF))};tf.camelCase=_F});var fT=Kt((By,dT)=>{"use strict";var OF=By&&By.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},PF=OF(sT()),NF=cT();function Ny(e,t){var a={};return!e||typeof e!="string"||(0,PF.default)(e,function(n,r){n&&r&&(a[(0,NF.camelCase)(n,t)]=r)}),a}Ny.default=Ny;dT.exports=Ny});function $r(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?pT(e.position):"start"in e||"end"in e?pT(e):"line"in e||"column"in e?Uy(e):""}function Uy(e){return mT(e&&e.line)+":"+mT(e&&e.column)}function pT(e){return Uy(e&&e.start)+"-"+Uy(e&&e.end)}function mT(e){return e&&typeof e=="number"?e:1}var hT=C(()=>{"use strict"});var Fy=C(()=>{"use strict";hT()});var Et,gT=C(()=>{"use strict";Fy();Et=class extends Error{constructor(t,a,n){super(),typeof a=="string"&&(n=a,a=void 0);let r="",o={},i=!1;if(a&&("line"in a&&"column"in a?o={place:a}:"start"in a&&"end"in a?o={place:a}:"type"in a?o={ancestors:[a],place:a.position}:o={...a}),typeof t=="string"?r=t:!o.cause&&t&&(i=!0,r=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof n=="string"){let s=n.indexOf(":");s===-1?o.ruleId=n:(o.source=n.slice(0,s),o.ruleId=n.slice(s+1))}if(!o.place&&o.ancestors&&o.ancestors){let s=o.ancestors[o.ancestors.length-1];s&&(o.place=s.position)}let l=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=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=l?l.line:void 0,this.name=$r(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=i&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Et.prototype.file="";Et.prototype.name="";Et.prototype.reason="";Et.prototype.message="";Et.prototype.stack="";Et.prototype.column=void 0;Et.prototype.line=void 0;Et.prototype.ancestors=void 0;Et.prototype.cause=void 0;Et.prototype.fatal=void 0;Et.prototype.place=void 0;Et.prototype.ruleId=void 0;Et.prototype.source=void 0});var zy=C(()=>{"use strict";gT()});function Hy(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");let a=t.filePath||void 0,n;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");n=XF(a,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");n=$F(a,t.jsx,t.jsxs)}let r={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:n,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?ef:YL,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=xT(r,e,void 0);return o&&typeof o!="string"?o:r.create(e,r.Fragment,{children:o||void 0},void 0)}function xT(e,t,a){if(t.type==="element")return qF(e,t,a);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return HF(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return VF(e,t,a);if(t.type==="mdxjsEsm")return jF(e,t);if(t.type==="root")return GF(e,t,a);if(t.type==="text")return WF(e,t)}function qF(e,t,a){let n=e.schema,r=n;t.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=ef,e.schema=r),e.ancestors.push(t);let o=bT(e,t.tagName,!1),i=KF(e,t),l=Vy(e,t);return FF.has(t.tagName)&&(l=l.filter(function(s){return typeof s=="string"?!by(s):!0})),vT(e,i,o,t),jy(i,l),e.ancestors.pop(),e.schema=n,e.create(t,o,i,a)}function HF(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Xs(e,t.position)}function jF(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Xs(e,t.position)}function VF(e,t,a){let n=e.schema,r=n;t.name==="svg"&&n.space==="html"&&(r=ef,e.schema=r),e.ancestors.push(t);let o=t.name===null?e.Fragment:bT(e,t.name,!0),i=ZF(e,t),l=Vy(e,t);return vT(e,i,o,t),jy(i,l),e.ancestors.pop(),e.schema=n,e.create(t,o,i,a)}function GF(e,t,a){let n={};return jy(n,Vy(e,t)),e.create(t,e.Fragment,n,a)}function WF(e,t){return t.value}function vT(e,t,a,n){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(t.node=n)}function jy(e,t){if(t.length>0){let a=t.length>1?t:t[0];a&&(e.children=a)}}function $F(e,t,a){return n;function n(r,o,i,l){let u=Array.isArray(i.children)?a:t;return l?u(o,i,l):u(o,i)}}function XF(e,t){return a;function a(n,r,o,i){let l=Array.isArray(o.children),s=Vi(n);return t(r,o,i,l,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function KF(e,t){let a={},n,r;for(r in t.properties)if(r!=="children"&&qy.call(t.properties,r)){let o=QF(e,r,t.properties[r]);if(o){let[i,l]=o;e.tableCellAlignToStyle&&i==="align"&&typeof l=="string"&&zF.has(t.tagName)?n=l:a[i]=l}}if(n){let o=a.style||(a.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=n}return a}function ZF(e,t){let a={};for(let n of t.attributes)if(n.type==="mdxJsxExpressionAttribute")if(n.data&&n.data.estree&&e.evaluater){let o=n.data.estree.body[0];o.type;let i=o.expression;i.type;let l=i.properties[0];l.type,Object.assign(a,e.evaluater.evaluateExpression(l.argument))}else Xs(e,t.position);else{let r=n.name,o;if(n.value&&typeof n.value=="object")if(n.value.data&&n.value.data.estree&&e.evaluater){let l=n.value.data.estree.body[0];l.type,o=e.evaluater.evaluateExpression(l.expression)}else Xs(e,t.position);else o=n.value===null?!0:n.value;a[r]=o}return a}function Vy(e,t){let a=[],n=-1,r=e.passKeys?new Map:BF;for(;++n<t.children.length;){let o=t.children[n],i;if(e.passKeys){let s=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(s){let u=r.get(s)||0;i=s+"-"+u,r.set(s,u+1)}}let l=xT(e,o,i);l!==void 0&&a.push(l)}return a}function QF(e,t,a){let n=Py(e.schema,t);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=n.commaSeparated?DL(a):eT(a)),n.property==="style"){let r=typeof a=="object"?a:YF(e,String(a));return e.stylePropertyNameCase==="css"&&(r=JF(r)),["style",r]}return[e.elementAttributeNameCase==="react"&&n.space?Oy[n.property]||n.property:n.attribute,a]}}function YF(e,t){try{return(0,yT.default)(t,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};let n=a,r=new Et("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=wT+"#cannot-parse-style-attribute",r}}function bT(e,t,a){let n;if(!a)n={type:"Literal",value:t};else if(t.includes(".")){let r=t.split("."),o=-1,i;for(;++o<r.length;){let l=Zd(r[o])?{type:"Identifier",name:r[o]}:{type:"Literal",value:r[o]};i=i?{type:"MemberExpression",object:i,property:l,computed:!!(o&&l.type==="Literal"),optional:!1}:l}n=i}else n=Zd(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(n.type==="Literal"){let r=n.value;return qy.call(e.components,r)?e.components[r]:r}if(e.evaluater)return e.evaluater.evaluateExpression(n);Xs(e)}function Xs(e,t){let a=new Et("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=wT+"#cannot-handle-mdx-estrees-without-createevaluater",a}function JF(e){let t={},a;for(a in e)qy.call(e,a)&&(t[ez(a)]=e[a]);return t}function ez(e){let t=e.replace(UF,tz);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function tz(e){return"-"+e.toLowerCase()}var yT,qy,BF,UF,FF,zF,wT,ST=C(()=>{"use strict";_L();PL();UL();JL();tT();yT=z(fT(),1);Ps();zy();qy={}.hasOwnProperty,BF=new Map,UF=/[A-Z]/g,FF=new Set(["table","tbody","thead","tfoot","tr"]),zF=new Set(["td","th"]),wT="https://github.com/syntax-tree/hast-util-to-jsx-runtime"});var IT=C(()=>{"use strict";ST()});function az(e){let t=e.attempt(this.parser.constructs.contentInitial,n,r),a;return t;function n(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),J(e,t,"linePrefix")}function r(l){return e.enter("paragraph"),o(l)}function o(l){let s=e.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=s),a=s,i(l)}function i(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return V(l)?(e.consume(l),e.exit("chunkText"),o):(e.consume(l),i)}}var CT,kT=C(()=>{"use strict";Tt();Ae();CT={tokenize:az}});function nz(e){let t=this,a=[],n=0,r,o,i;return l;function l(g){if(n<a.length){let b=a[n];return t.containerState=b[1],e.attempt(b[0].continuation,s,u)(g)}return u(g)}function s(g){if(n++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&w();let b=t.events.length,T=b,S;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){S=t.events[T][1].end;break}y(n);let M=b;for(;M<t.events.length;)t.events[M][1].end={...S},M++;return Lt(t.events,T+1,0,t.events.slice(b)),t.events.length=M,u(g)}return l(g)}function u(g){if(n===a.length){if(!r)return f(g);if(r.currentConstruct&&r.currentConstruct.concrete)return m(g);t.interrupt=!!(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(LT,c,d)(g)}function c(g){return r&&w(),y(n),f(g)}function d(g){return t.parser.lazy[t.now().line]=n!==a.length,i=t.now().offset,m(g)}function f(g){return t.containerState={},e.attempt(LT,p,m)(g)}function p(g){return n++,a.push([t.currentConstruct,t.containerState]),f(g)}function m(g){if(g===null){r&&w(),y(0),e.consume(g);return}return r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:o}),x(g)}function x(g){if(g===null){I(e.exit("chunkFlow"),!0),y(0),e.consume(g);return}return V(g)?(e.consume(g),I(e.exit("chunkFlow")),n=0,t.interrupt=void 0,l):(e.consume(g),x)}function I(g,b){let T=t.sliceStream(g);if(b&&T.push(null),g.previous=o,o&&(o.next=g),o=g,r.defineSkip(g.start),r.write(T),t.parser.lazy[g.start.line]){let S=r.events.length;for(;S--;)if(r.events[S][1].start.offset<i&&(!r.events[S][1].end||r.events[S][1].end.offset>i))return;let M=t.events.length,R=M,_,k;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){if(_){k=t.events[R][1].end;break}_=!0}for(y(n),S=M;S<t.events.length;)t.events[S][1].end={...k},S++;Lt(t.events,R+1,0,t.events.slice(M)),t.events.length=S}}function y(g){let b=a.length;for(;b-- >g;){let T=a[b];t.containerState=T[1],T[0].exit.call(t,e)}a.length=g}function w(){r.write([null]),o=void 0,r=void 0,t.containerState._closeFlow=void 0}}function rz(e,t,a){return J(e,e.attempt(this.parser.constructs.document,t,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}var TT,LT,ET=C(()=>{"use strict";Tt();Ae();tr();TT={tokenize:nz},LT={tokenize:rz}});function oz(e){let t=this,a=e.attempt(Cn,n,e.attempt(this.parser.constructs.flowInitial,r,J(e,e.attempt(this.parser.constructs.flow,r,e.attempt(ty,r)),"linePrefix")));return a;function n(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,a}function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,a}}var MT,AT=C(()=>{"use strict";Vd();Tt();MT={tokenize:oz}});function OT(e){return{resolveAll:PT(e==="text"?iz:void 0),tokenize:t};function t(a){let n=this,r=this.parser.constructs[e],o=a.attempt(r,i,l);return i;function i(c){return u(c)?o(c):l(c)}function l(c){if(c===null){a.consume(c);return}return a.enter("data"),a.consume(c),s}function s(c){return u(c)?(a.exit("data"),o(c)):(a.consume(c),s)}function u(c){if(c===null)return!0;let d=r[c],f=-1;if(d)for(;++f<d.length;){let p=d[f];if(!p.previous||p.previous.call(n,n.previous))return!0}return!1}}}function PT(e){return t;function t(a,n){let r=-1,o;for(;++r<=a.length;)o===void 0?a[r]&&a[r][1].type==="data"&&(o=r,r++):(!a[r]||a[r][1].type!=="data")&&(r!==o+2&&(a[o][1].end=a[r-1][1].end,a.splice(o+2,r-o-2),r=o+2),o=void 0);return e?e(a,n):a}}function iz(e,t){let a=0;for(;++a<=e.length;)if((a===e.length||e[a][1].type==="lineEnding")&&e[a-1][1].type==="data"){let n=e[a-1][1],r=t.sliceStream(n),o=r.length,i=-1,l=0,s;for(;o--;){let u=r[o];if(typeof u=="string"){for(i=u.length;u.charCodeAt(i-1)===32;)l++,i--;if(i)break;i=-1}else if(u===-2)s=!0,l++;else if(u!==-1){o++;break}}if(t._contentTypeTextTrailing&&a===e.length&&(l=0),l){let u={type:a===e.length||s||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?i:n.start._bufferIndex+i,_index:n.start._index+o,line:n.end.line,column:n.end.column-l,offset:n.end.offset-l},end:{...n.end}};n.end={...u.start},n.start.offset===n.end.offset?Object.assign(n,u):(e.splice(a,0,["enter",u,t],["exit",u,t]),a+=2)}a++}return e}var RT,DT,_T,Gy=C(()=>{"use strict";RT={resolveAll:PT()},DT=OT("string"),_T=OT("text")});var Wy={};ku(Wy,{attentionMarkers:()=>mz,contentInitial:()=>sz,disable:()=>hz,document:()=>lz,flow:()=>cz,flowInitial:()=>uz,insideSpan:()=>pz,string:()=>dz,text:()=>fz});var lz,sz,uz,cz,dz,fz,pz,mz,hz,NT=C(()=>{"use strict";Vd();Gy();lz={42:Yt,43:Yt,45:Yt,48:Yt,49:Yt,50:Yt,51:Yt,52:Yt,53:Yt,54:Yt,55:Yt,56:Yt,57:Yt,62:_d},sz={91:iy},uz={[-2]:qs,[-1]:qs,32:qs},cz={35:sy,42:No,45:[jd,No],60:cy,61:jd,95:No,96:Nd,126:Nd},dz={38:Pd,92:Od},fz={[-5]:js,[-4]:js,[-3]:js,33:fy,38:Pd,42:zs,60:[Yg,dy],91:py,92:[ly,Od],93:Po,95:zs,96:Jg},pz={null:[zs,RT]},mz={null:[42,95]},hz={null:[]}});function BT(e,t,a){let n={_bufferIndex:-1,_index:0,line:a&&a.line||1,column:a&&a.column||1,offset:a&&a.offset||0},r={},o=[],i=[],l=[],s=!0,u={attempt:_(M),check:_(R),consume:b,enter:T,exit:S,interrupt:_(R,{interrupt:!0})},c={code:null,containerState:{},defineSkip:y,events:[],now:I,parser:e,previous:null,sliceSerialize:m,sliceStream:x,write:p},d=t.tokenize.call(c,u),f;return t.resolveAll&&o.push(t),c;function p(U){return i=ra(i,U),w(),i[i.length-1]!==null?[]:(k(t,0),c.events=Vr(o,c.events,c),c.events)}function m(U,W){return yz(x(U),W)}function x(U){return gz(i,U)}function I(){let{_bufferIndex:U,_index:W,line:A,column:H,offset:$}=n;return{_bufferIndex:U,_index:W,line:A,column:H,offset:$}}function y(U){r[U.line]=U.column,B()}function w(){let U;for(;n._index<i.length;){let W=i[n._index];if(typeof W=="string")for(U=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===U&&n._bufferIndex<W.length;)g(W.charCodeAt(n._bufferIndex));else g(W)}}function g(U){s=void 0,f=U,d=d(U)}function b(U){V(U)?(n.line++,n.column=1,n.offset+=U===-3?2:1,B()):U!==-1&&(n.column++,n.offset++),n._bufferIndex<0?n._index++:(n._bufferIndex++,n._bufferIndex===i[n._index].length&&(n._bufferIndex=-1,n._index++)),c.previous=U,s=!0}function T(U,W){let A=W||{};return A.type=U,A.start=I(),c.events.push(["enter",A,c]),l.push(A),A}function S(U){let W=l.pop();return W.end=I(),c.events.push(["exit",W,c]),W}function M(U,W){k(U,W.from)}function R(U,W){W.restore()}function _(U,W){return A;function A(H,$,We){let $e,v,De,_e;return Array.isArray(H)?ke(H):"tokenize"in H?ke([H]):L(H);function L(ve){return X;function X(pe){let ue=pe!==null&&ve[pe],oe=pe!==null&&ve.null,ye=[...Array.isArray(ue)?ue:ue?[ue]:[],...Array.isArray(oe)?oe:oe?[oe]:[]];return ke(ye)(pe)}}function ke(ve){return $e=ve,v=0,ve.length===0?We:St(ve[v])}function St(ve){return X;function X(pe){return _e=G(),De=ve,ve.partial||(c.currentConstruct=ve),ve.name&&c.parser.constructs.disable.null.includes(ve.name)?Ut(pe):ve.tokenize.call(W?Object.assign(Object.create(c),W):c,u,et,Ut)(pe)}}function et(ve){return s=!0,U(De,_e),$}function Ut(ve){return s=!0,_e.restore(),++v<$e.length?St($e[v]):We}}}function k(U,W){U.resolveAll&&!o.includes(U)&&o.push(U),U.resolve&&Lt(c.events,W,c.events.length-W,U.resolve(c.events.slice(W),c)),U.resolveTo&&(c.events=U.resolveTo(c.events,c))}function G(){let U=I(),W=c.previous,A=c.currentConstruct,H=c.events.length,$=Array.from(l);return{from:H,restore:We};function We(){n=U,c.previous=W,c.currentConstruct=A,c.events.length=H,l=$,B()}}function B(){n.line in r&&n.column<2&&(n.column=r[n.line],n.offset+=r[n.line]-1)}}function gz(e,t){let a=t.start._index,n=t.start._bufferIndex,r=t.end._index,o=t.end._bufferIndex,i;if(a===r)i=[e[a].slice(n,o)];else{if(i=e.slice(a,r),n>-1){let l=i[0];typeof l=="string"?i[0]=l.slice(n):i.shift()}o>0&&i.push(e[r].slice(0,o))}return i}function yz(e,t){let a=-1,n=[],r;for(;++a<e.length;){let o=e[a],i;if(typeof o=="string")i=o;else switch(o){case-5:{i="\r";break}case-4:{i=`
|
|
43
|
-
`;break}case-3:{
|
|
44
|
-
`;break}case-2:{i=t?" ":" ";break}case-1:{if(!t&&r)continue;i=" ";break}default:i=String.fromCharCode(o)}r=o===-2,n.push(i)}return n.join("")}var UT=C(()=>{"use strict";Ae();tr();Fs()});function $y(e){let n={constructs:Rd([Wy,...(e||{}).extensions||[]]),content:r(CT),defined:[],document:r(TT),flow:r(MT),lazy:{},string:r(DT),text:r(_T)};return n;function r(o){return i;function i(l){return BT(n,o,l)}}}var FT=C(()=>{"use strict";Xg();kT();ET();AT();Gy();NT();UT()});function Xy(e){for(;!Ud(e););return e}var zT=C(()=>{"use strict";ey()});function Ky(){let e=1,t="",a=!0,n;return r;function r(o,i,l){let s=[],u,c,d,f,p;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(i||void 0).decode(o)),d=0,t="",a&&(o.charCodeAt(0)===65279&&d++,a=void 0);d<o.length;){if(qT.lastIndex=d,u=qT.exec(o),f=u&&u.index!==void 0?u.index:o.length,p=o.charCodeAt(f),!u){t=o.slice(d);break}if(p===10&&d===f&&n)s.push(-3),n=void 0;else switch(n&&(s.push(-5),n=void 0),d<f&&(s.push(o.slice(d,f)),e+=f-d),p){case 0:{s.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,s.push(-2);e++<c;)s.push(-1);break}case 10:{s.push(-4),e=1;break}default:n=!0,e=1}d=f+1}return l&&(n&&s.push(-5),t&&s.push(t),s.push(null)),s}}var qT,HT=C(()=>{"use strict";qT=/[\0\t\n\r]/g});var jT=C(()=>{"use strict";FT();zT();HT()});function Zy(e,t,a){return typeof t!="string"&&(a=t,t=void 0),wz(a)(Xy($y(a).document().write(Ky()(e,t,!0))))}function wz(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(ce),autolinkProtocol:_,autolinkEmail:_,atxHeading:o(dt),blockQuote:o(pe),characterEscape:_,characterReference:_,codeFenced:o(ue),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:o(ue,i),codeText:o(oe,i),codeTextData:_,data:_,codeFlowValue:_,definition:o(ye),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:o(Xe),hardBreakEscape:o(nt),hardBreakTrailing:o(nt),htmlFlow:o(Mt,i),htmlFlowData:_,htmlText:o(Mt,i),htmlTextData:_,image:o(K),label:i,link:o(ce),listItem:o(Na),listItemValue:f,listOrdered:o(Ke,d),listUnordered:o(Ke),paragraph:o(fn),reference:L,referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:o(dt),strong:o(sr),thematicBreak:o(Go)},exit:{atxHeading:s(),atxHeadingSequence:T,autolink:s(),autolinkEmail:X,autolinkProtocol:ve,blockQuote:s(),characterEscapeValue:k,characterReferenceMarkerHexadecimal:St,characterReferenceMarkerNumeric:St,characterReferenceValue:et,characterReference:Ut,codeFenced:s(I),codeFencedFence:x,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:k,codeIndented:s(y),codeText:s(A),codeTextData:k,data:k,definition:s(),definitionDestinationString:b,definitionLabelString:w,definitionTitleString:g,emphasis:s(),hardBreakEscape:s(B),hardBreakTrailing:s(B),htmlFlow:s(U),htmlFlowData:k,htmlText:s(W),htmlTextData:k,image:s($),label:$e,labelText:We,lineEnding:G,link:s(H),listItem:s(),listOrdered:s(),listUnordered:s(),paragraph:s(),referenceString:ke,resourceDestinationString:v,resourceTitleString:De,resource:_e,setextHeading:s(R),setextHeadingLineSequence:M,setextHeadingText:S,strong:s(),thematicBreak:s()}};WT(t,(e||{}).mdastExtensions||[]);let a={};return n;function n(P){let q={type:"root",children:[]},le={stack:[q],tokenStack:[],config:t,enter:l,exit:u,buffer:i,resume:c,data:a},he=[],Fe=-1;for(;++Fe<P.length;)if(P[Fe][1].type==="listOrdered"||P[Fe][1].type==="listUnordered")if(P[Fe][0]==="enter")he.push(Fe);else{let va=he.pop();Fe=r(P,va,Fe)}for(Fe=-1;++Fe<P.length;){let va=t[P[Fe][0]];GT.call(va,P[Fe][1].type)&&va[P[Fe][1].type].call(Object.assign({sliceSerialize:P[Fe][2].sliceSerialize},le),P[Fe][1])}if(le.tokenStack.length>0){let va=le.tokenStack[le.tokenStack.length-1];(va[1]||VT).call(le,void 0,va[0])}for(q.position={start:Xr(P.length>0?P[0][1].start:{line:1,column:1,offset:0}),end:Xr(P.length>0?P[P.length-2][1].end:{line:1,column:1,offset:0})},Fe=-1;++Fe<t.transforms.length;)q=t.transforms[Fe](q)||q;return q}function r(P,q,le){let he=q-1,Fe=-1,va=!1,pn,Ba,eo,to;for(;++he<=le;){let O=P[he];switch(O[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{O[0]==="enter"?Fe++:Fe--,to=void 0;break}case"lineEndingBlank":{O[0]==="enter"&&(pn&&!to&&!Fe&&!eo&&(eo=he),to=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:to=void 0}if(!Fe&&O[0]==="enter"&&O[1].type==="listItemPrefix"||Fe===-1&&O[0]==="exit"&&(O[1].type==="listUnordered"||O[1].type==="listOrdered")){if(pn){let ee=he;for(Ba=void 0;ee--;){let ae=P[ee];if(ae[1].type==="lineEnding"||ae[1].type==="lineEndingBlank"){if(ae[0]==="exit")continue;Ba&&(P[Ba][1].type="lineEndingBlank",va=!0),ae[1].type="lineEnding",Ba=ee}else if(!(ae[1].type==="linePrefix"||ae[1].type==="blockQuotePrefix"||ae[1].type==="blockQuotePrefixWhitespace"||ae[1].type==="blockQuoteMarker"||ae[1].type==="listItemIndent"))break}eo&&(!Ba||eo<Ba)&&(pn._spread=!0),pn.end=Object.assign({},Ba?P[Ba][1].start:O[1].end),P.splice(Ba||he,0,["exit",pn,O[2]]),he++,le++}if(O[1].type==="listItemPrefix"){let ee={type:"listItem",_spread:!1,start:Object.assign({},O[1].start),end:void 0};pn=ee,P.splice(he,0,["enter",ee,O[2]]),he++,le++,eo=void 0,to=!0}}}return P[q][1]._spread=va,le}function o(P,q){return le;function le(he){l.call(this,P(he),he),q&&q.call(this,he)}}function i(){this.stack.push({type:"fragment",children:[]})}function l(P,q,le){this.stack[this.stack.length-1].children.push(P),this.stack.push(P),this.tokenStack.push([q,le||void 0]),P.position={start:Xr(q.start),end:void 0}}function s(P){return q;function q(le){P&&P.call(this,le),u.call(this,le)}}function u(P,q){let le=this.stack.pop(),he=this.tokenStack.pop();if(he)he[0].type!==P.type&&(q?q.call(this,P,he[0]):(he[1]||VT).call(this,P,he[0]));else throw new Error("Cannot close `"+P.type+"` ("+$r({start:P.start,end:P.end})+"): it\u2019s not open");le.position.end=Xr(P.end)}function c(){return Ro(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(P){if(this.data.expectingFirstListItemValue){let q=this.stack[this.stack.length-2];q.start=Number.parseInt(this.sliceSerialize(P),10),this.data.expectingFirstListItemValue=void 0}}function p(){let P=this.resume(),q=this.stack[this.stack.length-1];q.lang=P}function m(){let P=this.resume(),q=this.stack[this.stack.length-1];q.meta=P}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function I(){let P=this.resume(),q=this.stack[this.stack.length-1];q.value=P.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){let P=this.resume(),q=this.stack[this.stack.length-1];q.value=P.replace(/(\r?\n|\r)$/g,"")}function w(P){let q=this.resume(),le=this.stack[this.stack.length-1];le.label=q,le.identifier=Qt(this.sliceSerialize(P)).toLowerCase()}function g(){let P=this.resume(),q=this.stack[this.stack.length-1];q.title=P}function b(){let P=this.resume(),q=this.stack[this.stack.length-1];q.url=P}function T(P){let q=this.stack[this.stack.length-1];if(!q.depth){let le=this.sliceSerialize(P).length;q.depth=le}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function M(P){let q=this.stack[this.stack.length-1];q.depth=this.sliceSerialize(P).codePointAt(0)===61?1:2}function R(){this.data.setextHeadingSlurpLineEnding=void 0}function _(P){let le=this.stack[this.stack.length-1].children,he=le[le.length-1];(!he||he.type!=="text")&&(he=dl(),he.position={start:Xr(P.start),end:void 0},le.push(he)),this.stack.push(he)}function k(P){let q=this.stack.pop();q.value+=this.sliceSerialize(P),q.position.end=Xr(P.end)}function G(P){let q=this.stack[this.stack.length-1];if(this.data.atHardBreak){let le=q.children[q.children.length-1];le.position.end=Xr(P.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(q.type)&&(_.call(this,P),k.call(this,P))}function B(){this.data.atHardBreak=!0}function U(){let P=this.resume(),q=this.stack[this.stack.length-1];q.value=P}function W(){let P=this.resume(),q=this.stack[this.stack.length-1];q.value=P}function A(){let P=this.resume(),q=this.stack[this.stack.length-1];q.value=P}function H(){let P=this.stack[this.stack.length-1];if(this.data.inReference){let q=this.data.referenceType||"shortcut";P.type+="Reference",P.referenceType=q,delete P.url,delete P.title}else delete P.identifier,delete P.label;this.data.referenceType=void 0}function $(){let P=this.stack[this.stack.length-1];if(this.data.inReference){let q=this.data.referenceType||"shortcut";P.type+="Reference",P.referenceType=q,delete P.url,delete P.title}else delete P.identifier,delete P.label;this.data.referenceType=void 0}function We(P){let q=this.sliceSerialize(P),le=this.stack[this.stack.length-2];le.label=d1(q),le.identifier=Qt(q).toLowerCase()}function $e(){let P=this.stack[this.stack.length-1],q=this.resume(),le=this.stack[this.stack.length-1];if(this.data.inReference=!0,le.type==="link"){let he=P.children;le.children=he}else le.alt=q}function v(){let P=this.resume(),q=this.stack[this.stack.length-1];q.url=P}function De(){let P=this.resume(),q=this.stack[this.stack.length-1];q.title=P}function _e(){this.data.inReference=void 0}function L(){this.data.referenceType="collapsed"}function ke(P){let q=this.resume(),le=this.stack[this.stack.length-1];le.label=q,le.identifier=Qt(this.sliceSerialize(P)).toLowerCase(),this.data.referenceType="full"}function St(P){this.data.characterReferenceType=P.type}function et(P){let q=this.sliceSerialize(P),le=this.data.characterReferenceType,he;le?(he=Ad(q,le==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):he=Ki(q);let Fe=this.stack[this.stack.length-1];Fe.value+=he}function Ut(P){let q=this.stack.pop();q.position.end=Xr(P.end)}function ve(P){k.call(this,P);let q=this.stack[this.stack.length-1];q.url=this.sliceSerialize(P)}function X(P){k.call(this,P);let q=this.stack[this.stack.length-1];q.url="mailto:"+this.sliceSerialize(P)}function pe(){return{type:"blockquote",children:[]}}function ue(){return{type:"code",lang:null,meta:null,value:""}}function oe(){return{type:"inlineCode",value:""}}function ye(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Xe(){return{type:"emphasis",children:[]}}function dt(){return{type:"heading",depth:0,children:[]}}function nt(){return{type:"break"}}function Mt(){return{type:"html",value:""}}function K(){return{type:"image",title:null,url:"",alt:null}}function ce(){return{type:"link",title:null,url:"",children:[]}}function Ke(P){return{type:"list",ordered:P.type==="listOrdered",start:null,spread:P._spread,children:[]}}function Na(P){return{type:"listItem",spread:P._spread,checked:null,children:[]}}function fn(){return{type:"paragraph",children:[]}}function sr(){return{type:"strong",children:[]}}function dl(){return{type:"text",value:""}}function Go(){return{type:"thematicBreak"}}}function Xr(e){return{line:e.line,column:e.column,offset:e.offset}}function WT(e,t){let a=-1;for(;++a<t.length;){let n=t[a];Array.isArray(n)?WT(e,n):xz(e,n)}}function xz(e,t){let a;for(a in t)if(GT.call(t,a))switch(a){case"canContainEols":{let n=t[a];n&&e[a].push(...n);break}case"transforms":{let n=t[a];n&&e[a].push(...n);break}case"enter":case"exit":{let n=t[a];n&&Object.assign(e[a],n);break}}}function VT(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+$r({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+$r({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+$r({start:t.start,end:t.end})+") is still open")}var GT,$T=C(()=>{"use strict";Ld();jT();Fg();f1();Gi();Md();Fy();GT={}.hasOwnProperty});var XT=C(()=>{"use strict";$T()});function af(e){let t=this;t.parser=a;function a(n){return Zy(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}var KT=C(()=>{"use strict";XT()});var ZT=C(()=>{"use strict";KT()});function QT(e,t){let a={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,a),e.applyData(t,a)}var YT=C(()=>{"use strict"});function JT(e,t){let a={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,a),[e.applyData(t,a),{type:"text",value:`
|
|
45
|
-
`}]}var
|
|
46
|
-
`:"",n={},r=t.lang?t.lang.split(/\s+/):[];r.length>0&&(n.className=["language-"+r[0]]);let o={type:"element",tagName:"code",properties:n,children:[{type:"text",value:a}]};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}var
|
|
47
|
-
`}),c.type==="element"&&c.tagName==="p"&&!r?
|
|
48
|
-
`});let u={type:"element",tagName:"li",properties:o,children:
|
|
49
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(
|
|
50
|
-
`}]}}var
|
|
38
|
+
$$`:`${e}$$`},R4=e=>M4(e)%2===0?e:E4(e),D4=(e,t,a)=>{if(e.substring(t+2).includes(")"))return null;let n=r4(e,t);if(n===-1||Vd(e,n))return null;let r=n>0&&e[n-1]==="!",o=r?n-1:n,l=e.substring(0,o);if(r)return l;let i=e.substring(n+1,t);return a==="text-only"?`${l}${i}`:`${l}[${i}](streamdown:incomplete-link)`},sL=(e,t)=>{for(let a=0;a<=t;a++)if(e[a]==="["&&!Vd(e,a)){if(a>0&&e[a-1]==="!")continue;let n=fL(e,a);if(n===-1)return a;if(n+1<e.length&&e[n+1]==="("){let r=e.indexOf(")",n+2);r!==-1&&(a=r)}}return-1},_4=(e,t,a)=>{let n=t>0&&e[t-1]==="!",r=n?t-1:t,o=e.substring(t+1);if(!o.includes("]")){let l=e.substring(0,r);if(n)return l;if(a==="text-only"){let i=sL(e,t);return i!==-1?e.substring(0,i)+e.substring(i+1):`${l}${o}`}return`${e}](streamdown:incomplete-link)`}if(fL(e,t)===-1){let l=e.substring(0,r);if(n)return l;if(a==="text-only"){let i=sL(e,t);if(i!==-1)return e.substring(0,i)+e.substring(i+1);let s=e.substring(t+1);return`${l}${s}`}return`${e}](streamdown:incomplete-link)`}return null},gL=(e,t="protocol")=>{let a=e.lastIndexOf("](");if(a!==-1&&!Vd(e,a)){let n=D4(e,a,t);if(n!==null)return n}for(let n=e.length-1;n>=0;n-=1)if(e[n]==="["&&!Vd(e,n)){let r=_4(e,n,t);if(r!==null)return r}return e},O4=/^-{1,2}$/,P4=/^[\s]*-{1,2}[\s]+$/,N4=/^={1,2}$/,B4=/^[\s]*={1,2}[\s]+$/,U4=e=>{if(!e||typeof e!="string")return e;let t=e.lastIndexOf(`
|
|
39
|
+
`);if(t===-1)return e;let a=e.substring(t+1),n=e.substring(0,t),r=a.trim();if(O4.test(r)&&!a.match(P4)){let o=n.split(`
|
|
40
|
+
`).at(-1);if(o&&o.trim().length>0)return`${e}\u200B`}if(N4.test(r)&&!a.match(B4)){let o=n.split(`
|
|
41
|
+
`).at(-1);if(o&&o.trim().length>0)return`${e}\u200B`}return e},F4=e=>{let t=e.match(QU);if(t){let a=t[2];if(!a||Bo.test(a))return e;if((e.match(iL)||[]).length%2===1)return`${e}~~`}else if(e.match(a4)&&(e.match(iL)||[]).length%2===1)return`${e}~`;return e},uy=e=>e!==!1,Da={SETEXT_HEADINGS:0,LINKS:10,BOLD_ITALIC:20,BOLD:30,ITALIC_DOUBLE_UNDERSCORE:40,ITALIC_SINGLE_ASTERISK:41,ITALIC_SINGLE_UNDERSCORE:42,INLINE_CODE:50,STRIKETHROUGH:60,KATEX:70,DEFAULT:100},z4=[{handler:{name:"setextHeadings",handle:U4,priority:Da.SETEXT_HEADINGS},optionKey:"setextHeadings"},{handler:{name:"links",handle:gL,priority:Da.LINKS},optionKey:"links",earlyReturn:e=>e.endsWith("](streamdown:incomplete-link)")},{handler:{name:"boldItalic",handle:S4,priority:Da.BOLD_ITALIC},optionKey:"boldItalic"},{handler:{name:"bold",handle:f4,priority:Da.BOLD},optionKey:"bold"},{handler:{name:"italicDoubleUnderscore",handle:m4,priority:Da.ITALIC_DOUBLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"italicSingleAsterisk",handle:g4,priority:Da.ITALIC_SINGLE_ASTERISK},optionKey:"italic"},{handler:{name:"italicSingleUnderscore",handle:x4,priority:Da.ITALIC_SINGLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"inlineCode",handle:T4,priority:Da.INLINE_CODE},optionKey:"inlineCode"},{handler:{name:"strikethrough",handle:F4,priority:Da.STRIKETHROUGH},optionKey:"strikethrough"},{handler:{name:"katex",handle:R4,priority:Da.KATEX},optionKey:"katex"}],q4=e=>{var t;let a=(t=e?.linkMode)!=null?t:"protocol";return z4.filter(({handler:n,optionKey:r})=>n.name==="links"?uy(e?.links)||uy(e?.images):uy(e?.[r])).map(({handler:n,earlyReturn:r})=>n.name==="links"?{handler:cL(uL({},n),{handle:o=>gL(o,a)}),earlyReturn:a==="protocol"?r:void 0}:{handler:n,earlyReturn:r})},H4=(e,t)=>{var a;if(!e||typeof e!="string")return e;let n=e.endsWith(" ")&&!e.endsWith(" ")?e.slice(0,-1):e,r=q4(t),o=((a=t?.handlers)!=null?a:[]).map(i=>{var s;return{handler:cL(uL({},i),{priority:(s=i.priority)!=null?s:Da.DEFAULT}),earlyReturn:void 0}}),l=[...r,...o].sort((i,s)=>{var u,c;return((u=i.handler.priority)!=null?u:Da.DEFAULT)-((c=s.handler.priority)!=null?c:Da.DEFAULT)});for(let{handler:i,earlyReturn:s}of l)if(n=i.handle(n),s!=null&&s(n))return n;return n},yL=H4});function xL(e,t){let a=t||{};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}var vL=I(()=>{"use strict"});function $d(e,t){return((t||G4).jsx?V4:j4).test(e)}var j4,V4,G4,bL=I(()=>{"use strict";j4=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,V4=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,G4={}});var SL=I(()=>{"use strict";bL()});function dy(e){return typeof e=="object"?e.type==="text"?CL(e.value):!1:CL(e)}function CL(e){return e.replace($4,"")===""}var $4,IL=I(()=>{"use strict";$4=/[ \t\n\f\r]/g});var kL=I(()=>{"use strict";IL()});var tr,fy=I(()=>{"use strict";tr=class{constructor(t,a,n){this.normal=a,this.property=t,n&&(this.space=n)}};tr.prototype.normal={};tr.prototype.property={};tr.prototype.space=void 0});function py(e,t){let a={},n={};for(let r of e)Object.assign(a,r.property),Object.assign(n,r.normal);return new tr(a,n,t)}var LL=I(()=>{"use strict";fy()});function qs(e){return e.toLowerCase()}var my=I(()=>{"use strict"});var Ht,hy=I(()=>{"use strict";Ht=class{constructor(t,a){this.attribute=a,this.property=t}};Ht.prototype.attribute="";Ht.prototype.booleanish=!1;Ht.prototype.boolean=!1;Ht.prototype.commaOrSpaceSeparated=!1;Ht.prototype.commaSeparated=!1;Ht.prototype.defined=!1;Ht.prototype.mustUseProperty=!1;Ht.prototype.number=!1;Ht.prototype.overloadedBoolean=!1;Ht.prototype.property="";Ht.prototype.spaceSeparated=!1;Ht.prototype.space=void 0});var Hs={};Su(Hs,{boolean:()=>ue,booleanish:()=>bt,commaOrSpaceSeparated:()=>ya,commaSeparated:()=>$r,number:()=>F,overloadedBoolean:()=>Wd,spaceSeparated:()=>$e});function Uo(){return 2**++W4}var W4,ue,bt,Wd,F,$e,$r,ya,js=I(()=>{"use strict";W4=0,ue=Uo(),bt=Uo(),Wd=Uo(),F=Uo(),$e=Uo(),$r=Uo(),ya=Uo()});function TL(e,t,a){a&&(e[t]=a)}var gy,Fo,yy=I(()=>{"use strict";hy();js();gy=Object.keys(Hs),Fo=class extends Ht{constructor(t,a,n,r){let o=-1;if(super(t,a),TL(this,"space",r),typeof n=="number")for(;++o<gy.length;){let l=gy[o];TL(this,gy[o],(n&Hs[l])===Hs[l])}}};Fo.prototype.defined=!0});function Ka(e){let t={},a={};for(let[n,r]of Object.entries(e.properties)){let o=new Fo(n,e.transform(e.attributes||{},n),r,e.space);e.mustUseProperty&&e.mustUseProperty.includes(n)&&(o.mustUseProperty=!0),t[n]=o,a[qs(n)]=n,a[qs(o.attribute)]=n}return new tr(t,a,e.space)}var zo=I(()=>{"use strict";my();yy();fy()});var wy,AL=I(()=>{"use strict";zo();js();wy=Ka({properties:{ariaActiveDescendant:null,ariaAtomic:bt,ariaAutoComplete:null,ariaBusy:bt,ariaChecked:bt,ariaColCount:F,ariaColIndex:F,ariaColSpan:F,ariaControls:$e,ariaCurrent:null,ariaDescribedBy:$e,ariaDetails:null,ariaDisabled:bt,ariaDropEffect:$e,ariaErrorMessage:null,ariaExpanded:bt,ariaFlowTo:$e,ariaGrabbed:bt,ariaHasPopup:null,ariaHidden:bt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:$e,ariaLevel:F,ariaLive:null,ariaModal:bt,ariaMultiLine:bt,ariaMultiSelectable:bt,ariaOrientation:null,ariaOwns:$e,ariaPlaceholder:null,ariaPosInSet:F,ariaPressed:bt,ariaReadOnly:bt,ariaRelevant:null,ariaRequired:bt,ariaRoleDescription:$e,ariaRowCount:F,ariaRowIndex:F,ariaRowSpan:F,ariaSelected:bt,ariaSetSize:F,ariaSort:null,ariaValueMax:F,ariaValueMin:F,ariaValueNow:F,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}})});function Xd(e,t){return t in e?e[t]:t}var xy=I(()=>{"use strict"});function Kd(e,t){return Xd(e,t.toLowerCase())}var vy=I(()=>{"use strict";xy()});var ML,EL=I(()=>{"use strict";vy();zo();js();ML=Ka({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:$r,acceptCharset:$e,accessKey:$e,action:null,allow:null,allowFullScreen:ue,allowPaymentRequest:ue,allowUserMedia:ue,alt:null,as:null,async:ue,autoCapitalize:null,autoComplete:$e,autoFocus:ue,autoPlay:ue,blocking:$e,capture:null,charSet:null,checked:ue,cite:null,className:$e,cols:F,colSpan:null,content:null,contentEditable:bt,controls:ue,controlsList:$e,coords:F|$r,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ue,defer:ue,dir:null,dirName:null,disabled:ue,download:Wd,draggable:bt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ue,formTarget:null,headers:$e,height:F,hidden:Wd,high:F,href:null,hrefLang:null,htmlFor:$e,httpEquiv:$e,id:null,imageSizes:null,imageSrcSet:null,inert:ue,inputMode:null,integrity:null,is:null,isMap:ue,itemId:null,itemProp:$e,itemRef:$e,itemScope:ue,itemType:$e,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ue,low:F,manifest:null,max:null,maxLength:F,media:null,method:null,min:null,minLength:F,multiple:ue,muted:ue,name:null,nonce:null,noModule:ue,noValidate:ue,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:ue,optimum:F,pattern:null,ping:$e,placeholder:null,playsInline:ue,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ue,referrerPolicy:null,rel:$e,required:ue,reversed:ue,rows:F,rowSpan:F,sandbox:$e,scope:null,scoped:ue,seamless:ue,selected:ue,shadowRootClonable:ue,shadowRootDelegatesFocus:ue,shadowRootMode:null,shape:null,size:F,sizes:null,slot:null,span:F,spellCheck:bt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:F,step:null,style:null,tabIndex:F,target:null,title:null,translate:null,type:null,typeMustMatch:ue,useMap:null,value:bt,width:F,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:$e,axis:null,background:null,bgColor:null,border:F,borderColor:null,bottomMargin:F,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ue,declare:ue,event:null,face:null,frame:null,frameBorder:null,hSpace:F,leftMargin:F,link:null,longDesc:null,lowSrc:null,marginHeight:F,marginWidth:F,noResize:ue,noHref:ue,noShade:ue,noWrap:ue,object:null,profile:null,prompt:null,rev:null,rightMargin:F,rules:null,scheme:null,scrolling:bt,standby:null,summary:null,text:null,topMargin:F,valueType:null,version:null,vAlign:null,vLink:null,vSpace:F,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ue,disableRemotePlayback:ue,prefix:null,property:null,results:F,security:null,unselectable:null},space:"html",transform:Kd})});var RL,DL=I(()=>{"use strict";xy();zo();js();RL=Ka({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ya,accentHeight:F,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:F,amplitude:F,arabicForm:null,ascent:F,attributeName:null,attributeType:null,azimuth:F,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:F,by:null,calcMode:null,capHeight:F,className:$e,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:F,diffuseConstant:F,direction:null,display:null,dur:null,divisor:F,dominantBaseline:null,download:ue,dx:null,dy:null,edgeMode:null,editable:null,elevation:F,enableBackground:null,end:null,event:null,exponent:F,externalResourcesRequired:null,fill:null,fillOpacity:F,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:$r,g2:$r,glyphName:$r,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:F,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:F,horizOriginX:F,horizOriginY:F,id:null,ideographic:F,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:F,k:F,k1:F,k2:F,k3:F,k4:F,kernelMatrix:ya,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:F,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:F,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:F,overlineThickness:F,paintOrder:null,panose1:null,path:null,pathLength:F,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:$e,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:F,pointsAtY:F,pointsAtZ:F,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ya,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ya,rev:ya,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ya,requiredFeatures:ya,requiredFonts:ya,requiredFormats:ya,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:F,specularExponent:F,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:F,strikethroughThickness:F,string:null,stroke:null,strokeDashArray:ya,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:F,strokeOpacity:F,strokeWidth:null,style:null,surfaceScale:F,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ya,tabIndex:F,tableValues:null,target:null,targetX:F,targetY:F,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ya,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:F,underlineThickness:F,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:F,values:null,vAlphabetic:F,vMathematical:F,vectorEffect:null,vHanging:F,vIdeographic:F,version:null,vertAdvY:F,vertOriginX:F,vertOriginY:F,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:F,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Xd})});var by,_L=I(()=>{"use strict";zo();by=Ka({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()}})});var Sy,OL=I(()=>{"use strict";zo();vy();Sy=Ka({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Kd})});var Cy,PL=I(()=>{"use strict";zo();Cy=Ka({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}})});var Iy,NL=I(()=>{"use strict";Iy={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"}});function ky(e,t){let a=qs(t),n=t,r=Ht;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&K4.test(t)){if(t.charAt(4)==="-"){let o=t.slice(5).replace(BL,Q4);n="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{let o=t.slice(4);if(!BL.test(o)){let l=o.replace(X4,Z4);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}r=Fo}return new r(n,t)}function Z4(e){return"-"+e.toLowerCase()}function Q4(e){return e.charAt(1).toUpperCase()}var X4,BL,K4,UL=I(()=>{"use strict";yy();hy();my();X4=/[A-Z]/g,BL=/-[a-z]/g,K4=/^data[-\w.:]+$/i});var FL,Zd,zL=I(()=>{"use strict";LL();AL();EL();DL();_L();OL();PL();NL();UL();FL=py([wy,ML,by,Sy,Cy],"html"),Zd=py([wy,RL,by,Sy,Cy],"svg")});function qL(e){return e.join(" ").trim()}var HL=I(()=>{"use strict"});var XL=Kt((QQ,WL)=>{"use strict";var jL=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Y4=/\n/g,J4=/^\s*/,eF=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,tF=/^:\s*/,aF=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,nF=/^[;\s]*/,rF=/^\s+|\s+$/g,oF=`
|
|
42
|
+
`,VL="/",GL="*",qo="",lF="comment",iF="declaration";function sF(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var a=1,n=1;function r(m){var x=m.match(Y4);x&&(a+=x.length);var v=m.lastIndexOf(oF);n=~v?m.length-v:n+m.length}function o(){var m={line:a,column:n};return function(x){return x.position=new l(m),u(),x}}function l(m){this.start=m,this.end={line:a,column:n},this.source=t.source}l.prototype.content=e;function i(m){var x=new Error(t.source+":"+a+":"+n+": "+m);if(x.reason=m,x.filename=t.source,x.line=a,x.column=n,x.source=e,!t.silent)throw x}function s(m){var x=m.exec(e);if(x){var v=x[0];return r(v),e=e.slice(v.length),x}}function u(){s(J4)}function c(m){var x;for(m=m||[];x=d();)x!==!1&&m.push(x);return m}function d(){var m=o();if(!(VL!=e.charAt(0)||GL!=e.charAt(1))){for(var x=2;qo!=e.charAt(x)&&(GL!=e.charAt(x)||VL!=e.charAt(x+1));)++x;if(x+=2,qo===e.charAt(x-1))return i("End of comment missing");var v=e.slice(2,x-2);return n+=2,r(v),e=e.slice(x),n+=2,m({type:lF,comment:v})}}function f(){var m=o(),x=s(eF);if(x){if(d(),!s(tF))return i("property missing ':'");var v=s(aF),y=m({type:iF,property:$L(x[0].replace(jL,qo)),value:v?$L(v[0].replace(jL,qo)):qo});return s(nF),y}}function p(){var m=[];c(m);for(var x;x=f();)x!==!1&&(m.push(x),c(m));return m}return u(),p()}function $L(e){return e?e.replace(rF,qo):qo}WL.exports=sF});var KL=Kt(Vs=>{"use strict";var uF=Vs&&Vs.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Vs,"__esModule",{value:!0});Vs.default=dF;var cF=uF(XL());function dF(e,t){let a=null;if(!e||typeof e!="string")return a;let n=(0,cF.default)(e),r=typeof t=="function";return n.forEach(o=>{if(o.type!=="declaration")return;let{property:l,value:i}=o;r?t(l,i,o):i&&(a=a||{},a[l]=i)}),a}});var QL=Kt(Qd=>{"use strict";Object.defineProperty(Qd,"__esModule",{value:!0});Qd.camelCase=void 0;var fF=/^--[a-zA-Z0-9_-]+$/,pF=/-([a-z])/g,mF=/^[^-]+$/,hF=/^-(webkit|moz|ms|o|khtml)-/,gF=/^-(ms)-/,yF=function(e){return!e||mF.test(e)||fF.test(e)},wF=function(e,t){return t.toUpperCase()},ZL=function(e,t){return"".concat(t,"-")},xF=function(e,t){return t===void 0&&(t={}),yF(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(gF,ZL):e=e.replace(hF,ZL),e.replace(pF,wF))};Qd.camelCase=xF});var JL=Kt((Ty,YL)=>{"use strict";var vF=Ty&&Ty.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},bF=vF(KL()),SF=QL();function Ly(e,t){var a={};return!e||typeof e!="string"||(0,bF.default)(e,function(n,r){n&&r&&(a[(0,SF.camelCase)(n,t)]=r)}),a}Ly.default=Ly;YL.exports=Ly});function Wr(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?eT(e.position):"start"in e||"end"in e?eT(e):"line"in e||"column"in e?Ay(e):""}function Ay(e){return tT(e&&e.line)+":"+tT(e&&e.column)}function eT(e){return Ay(e&&e.start)+"-"+Ay(e&&e.end)}function tT(e){return e&&typeof e=="number"?e:1}var aT=I(()=>{"use strict"});var My=I(()=>{"use strict";aT()});var Mt,nT=I(()=>{"use strict";My();Mt=class extends Error{constructor(t,a,n){super(),typeof a=="string"&&(n=a,a=void 0);let r="",o={},l=!1;if(a&&("line"in a&&"column"in a?o={place:a}:"start"in a&&"end"in a?o={place:a}:"type"in a?o={ancestors:[a],place:a.position}:o={...a}),typeof t=="string"?r=t:!o.cause&&t&&(l=!0,r=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof n=="string"){let s=n.indexOf(":");s===-1?o.ruleId=n:(o.source=n.slice(0,s),o.ruleId=n.slice(s+1))}if(!o.place&&o.ancestors&&o.ancestors){let s=o.ancestors[o.ancestors.length-1];s&&(o.place=s.position)}let i=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=i?i.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=i?i.line:void 0,this.name=Wr(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}};Mt.prototype.file="";Mt.prototype.name="";Mt.prototype.reason="";Mt.prototype.message="";Mt.prototype.stack="";Mt.prototype.column=void 0;Mt.prototype.line=void 0;Mt.prototype.ancestors=void 0;Mt.prototype.cause=void 0;Mt.prototype.fatal=void 0;Mt.prototype.place=void 0;Mt.prototype.ruleId=void 0;Mt.prototype.source=void 0});var Ey=I(()=>{"use strict";nT()});function Dy(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");let a=t.filePath||void 0,n;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");n=OF(a,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");n=_F(a,t.jsx,t.jsxs)}let r={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:n,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Zd:FL,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=lT(r,e,void 0);return o&&typeof o!="string"?o:r.create(e,r.Fragment,{children:o||void 0},void 0)}function lT(e,t,a){if(t.type==="element")return TF(e,t,a);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return AF(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return EF(e,t,a);if(t.type==="mdxjsEsm")return MF(e,t);if(t.type==="root")return RF(e,t,a);if(t.type==="text")return DF(e,t)}function TF(e,t,a){let n=e.schema,r=n;t.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=Zd,e.schema=r),e.ancestors.push(t);let o=sT(e,t.tagName,!1),l=PF(e,t),i=Oy(e,t);return kF.has(t.tagName)&&(i=i.filter(function(s){return typeof s=="string"?!dy(s):!0})),iT(e,l,o,t),_y(l,i),e.ancestors.pop(),e.schema=n,e.create(t,o,l,a)}function AF(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Gs(e,t.position)}function MF(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Gs(e,t.position)}function EF(e,t,a){let n=e.schema,r=n;t.name==="svg"&&n.space==="html"&&(r=Zd,e.schema=r),e.ancestors.push(t);let o=t.name===null?e.Fragment:sT(e,t.name,!0),l=NF(e,t),i=Oy(e,t);return iT(e,l,o,t),_y(l,i),e.ancestors.pop(),e.schema=n,e.create(t,o,l,a)}function RF(e,t,a){let n={};return _y(n,Oy(e,t)),e.create(t,e.Fragment,n,a)}function DF(e,t){return t.value}function iT(e,t,a,n){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(t.node=n)}function _y(e,t){if(t.length>0){let a=t.length>1?t:t[0];a&&(e.children=a)}}function _F(e,t,a){return n;function n(r,o,l,i){let u=Array.isArray(l.children)?a:t;return i?u(o,l,i):u(o,l)}}function OF(e,t){return a;function a(n,r,o,l){let i=Array.isArray(o.children),s=Vl(n);return t(r,o,l,i,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function PF(e,t){let a={},n,r;for(r in t.properties)if(r!=="children"&&Ry.call(t.properties,r)){let o=BF(e,r,t.properties[r]);if(o){let[l,i]=o;e.tableCellAlignToStyle&&l==="align"&&typeof i=="string"&&LF.has(t.tagName)?n=i:a[l]=i}}if(n){let o=a.style||(a.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=n}return a}function NF(e,t){let a={};for(let n of t.attributes)if(n.type==="mdxJsxExpressionAttribute")if(n.data&&n.data.estree&&e.evaluater){let o=n.data.estree.body[0];o.type;let l=o.expression;l.type;let i=l.properties[0];i.type,Object.assign(a,e.evaluater.evaluateExpression(i.argument))}else Gs(e,t.position);else{let r=n.name,o;if(n.value&&typeof n.value=="object")if(n.value.data&&n.value.data.estree&&e.evaluater){let i=n.value.data.estree.body[0];i.type,o=e.evaluater.evaluateExpression(i.expression)}else Gs(e,t.position);else o=n.value===null?!0:n.value;a[r]=o}return a}function Oy(e,t){let a=[],n=-1,r=e.passKeys?new Map:CF;for(;++n<t.children.length;){let o=t.children[n],l;if(e.passKeys){let s=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(s){let u=r.get(s)||0;l=s+"-"+u,r.set(s,u+1)}}let i=lT(e,o,l);i!==void 0&&a.push(i)}return a}function BF(e,t,a){let n=ky(e.schema,t);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=n.commaSeparated?xL(a):qL(a)),n.property==="style"){let r=typeof a=="object"?a:UF(e,String(a));return e.stylePropertyNameCase==="css"&&(r=FF(r)),["style",r]}return[e.elementAttributeNameCase==="react"&&n.space?Iy[n.property]||n.property:n.attribute,a]}}function UF(e,t){try{return(0,rT.default)(t,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};let n=a,r=new Mt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=oT+"#cannot-parse-style-attribute",r}}function sT(e,t,a){let n;if(!a)n={type:"Literal",value:t};else if(t.includes(".")){let r=t.split("."),o=-1,l;for(;++o<r.length;){let i=$d(r[o])?{type:"Identifier",name:r[o]}:{type:"Literal",value:r[o]};l=l?{type:"MemberExpression",object:l,property:i,computed:!!(o&&i.type==="Literal"),optional:!1}:i}n=l}else n=$d(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(n.type==="Literal"){let r=n.value;return Ry.call(e.components,r)?e.components[r]:r}if(e.evaluater)return e.evaluater.evaluateExpression(n);Gs(e)}function Gs(e,t){let a=new Mt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=oT+"#cannot-handle-mdx-estrees-without-createevaluater",a}function FF(e){let t={},a;for(a in e)Ry.call(e,a)&&(t[zF(a)]=e[a]);return t}function zF(e){let t=e.replace(IF,qF);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function qF(e){return"-"+e.toLowerCase()}var rT,Ry,CF,IF,kF,LF,oT,uT=I(()=>{"use strict";vL();SL();kL();zL();HL();rT=z(JL(),1);Ds();Ey();Ry={}.hasOwnProperty,CF=new Map,IF=/[A-Z]/g,kF=new Set(["table","tbody","thead","tfoot","tr"]),LF=new Set(["td","th"]),oT="https://github.com/syntax-tree/hast-util-to-jsx-runtime"});var cT=I(()=>{"use strict";uT()});function HF(e){let t=e.attempt(this.parser.constructs.contentInitial,n,r),a;return t;function n(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),Q(e,t,"linePrefix")}function r(i){return e.enter("paragraph"),o(i)}function o(i){let s=e.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=s),a=s,l(i)}function l(i){if(i===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(i);return}return V(i)?(e.consume(i),e.exit("chunkText"),o):(e.consume(i),l)}}var dT,fT=I(()=>{"use strict";At();_e();dT={tokenize:HF}});function jF(e){let t=this,a=[],n=0,r,o,l;return i;function i(g){if(n<a.length){let C=a[n];return t.containerState=C[1],e.attempt(C[0].continuation,s,u)(g)}return u(g)}function s(g){if(n++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&w();let C=t.events.length,A=C,S;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){S=t.events[A][1].end;break}y(n);let M=C;for(;M<t.events.length;)t.events[M][1].end={...S},M++;return Tt(t.events,A+1,0,t.events.slice(C)),t.events.length=M,u(g)}return i(g)}function u(g){if(n===a.length){if(!r)return f(g);if(r.currentConstruct&&r.currentConstruct.concrete)return m(g);t.interrupt=!!(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(pT,c,d)(g)}function c(g){return r&&w(),y(n),f(g)}function d(g){return t.parser.lazy[t.now().line]=n!==a.length,l=t.now().offset,m(g)}function f(g){return t.containerState={},e.attempt(pT,p,m)(g)}function p(g){return n++,a.push([t.currentConstruct,t.containerState]),f(g)}function m(g){if(g===null){r&&w(),y(0),e.consume(g);return}return r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:o}),x(g)}function x(g){if(g===null){v(e.exit("chunkFlow"),!0),y(0),e.consume(g);return}return V(g)?(e.consume(g),v(e.exit("chunkFlow")),n=0,t.interrupt=void 0,i):(e.consume(g),x)}function v(g,C){let A=t.sliceStream(g);if(C&&A.push(null),g.previous=o,o&&(o.next=g),o=g,r.defineSkip(g.start),r.write(A),t.parser.lazy[g.start.line]){let S=r.events.length;for(;S--;)if(r.events[S][1].start.offset<l&&(!r.events[S][1].end||r.events[S][1].end.offset>l))return;let M=t.events.length,R=M,D,L;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){if(D){L=t.events[R][1].end;break}D=!0}for(y(n),S=M;S<t.events.length;)t.events[S][1].end={...L},S++;Tt(t.events,R+1,0,t.events.slice(M)),t.events.length=S}}function y(g){let C=a.length;for(;C-- >g;){let A=a[C];t.containerState=A[1],A[0].exit.call(t,e)}a.length=g}function w(){r.write([null]),o=void 0,r=void 0,t.containerState._closeFlow=void 0}}function VF(e,t,a){return Q(e,e.attempt(this.parser.constructs.document,t,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}var mT,pT,hT=I(()=>{"use strict";At();_e();Jn();mT={tokenize:jF},pT={tokenize:VF}});function GF(e){let t=this,a=e.attempt(bn,n,e.attempt(this.parser.constructs.flowInitial,r,Q(e,e.attempt(this.parser.constructs.flow,r,e.attempt(Gg,r)),"linePrefix")));return a;function n(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,a}function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,a}}var gT,yT=I(()=>{"use strict";zd();At();gT={tokenize:GF}});function bT(e){return{resolveAll:ST(e==="text"?$F:void 0),tokenize:t};function t(a){let n=this,r=this.parser.constructs[e],o=a.attempt(r,l,i);return l;function l(c){return u(c)?o(c):i(c)}function i(c){if(c===null){a.consume(c);return}return a.enter("data"),a.consume(c),s}function s(c){return u(c)?(a.exit("data"),o(c)):(a.consume(c),s)}function u(c){if(c===null)return!0;let d=r[c],f=-1;if(d)for(;++f<d.length;){let p=d[f];if(!p.previous||p.previous.call(n,n.previous))return!0}return!1}}}function ST(e){return t;function t(a,n){let r=-1,o;for(;++r<=a.length;)o===void 0?a[r]&&a[r][1].type==="data"&&(o=r,r++):(!a[r]||a[r][1].type!=="data")&&(r!==o+2&&(a[o][1].end=a[r-1][1].end,a.splice(o+2,r-o-2),r=o+2),o=void 0);return e?e(a,n):a}}function $F(e,t){let a=0;for(;++a<=e.length;)if((a===e.length||e[a][1].type==="lineEnding")&&e[a-1][1].type==="data"){let n=e[a-1][1],r=t.sliceStream(n),o=r.length,l=-1,i=0,s;for(;o--;){let u=r[o];if(typeof u=="string"){for(l=u.length;u.charCodeAt(l-1)===32;)i++,l--;if(l)break;l=-1}else if(u===-2)s=!0,i++;else if(u!==-1){o++;break}}if(t._contentTypeTextTrailing&&a===e.length&&(i=0),i){let u={type:a===e.length||s||i<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?l:n.start._bufferIndex+l,_index:n.start._index+o,line:n.end.line,column:n.end.column-i,offset:n.end.offset-i},end:{...n.end}};n.end={...u.start},n.start.offset===n.end.offset?Object.assign(n,u):(e.splice(a,0,["enter",u,t],["exit",u,t]),a+=2)}a++}return e}var wT,xT,vT,Py=I(()=>{"use strict";wT={resolveAll:ST()},xT=bT("string"),vT=bT("text")});var Ny={};Su(Ny,{attentionMarkers:()=>ez,contentInitial:()=>XF,disable:()=>tz,document:()=>WF,flow:()=>ZF,flowInitial:()=>KF,insideSpan:()=>JF,string:()=>QF,text:()=>YF});var WF,XF,KF,ZF,QF,YF,JF,ez,tz,CT=I(()=>{"use strict";zd();Py();WF={42:Yt,43:Yt,45:Yt,48:Yt,49:Yt,50:Yt,51:Yt,52:Yt,53:Yt,54:Yt,55:Yt,56:Yt,57:Yt,62:Md},XF={91:Zg},KF={[-2]:Us,[-1]:Us,32:Us},ZF={35:Yg,42:No,45:[Fd,No],60:ey,61:Fd,95:No,96:Dd,126:Dd},QF={38:Rd,92:Ed},YF={[-5]:zs,[-4]:zs,[-3]:zs,33:ay,38:Rd,42:Bs,60:[Hg,ty],91:ny,92:[Qg,Ed],93:Po,95:Bs,96:jg},JF={null:[Bs,wT]},ez={null:[42,95]},tz={null:[]}});function IT(e,t,a){let n={_bufferIndex:-1,_index:0,line:a&&a.line||1,column:a&&a.column||1,offset:a&&a.offset||0},r={},o=[],l=[],i=[],s=!0,u={attempt:D(M),check:D(R),consume:C,enter:A,exit:S,interrupt:D(R,{interrupt:!0})},c={code:null,containerState:{},defineSkip:y,events:[],now:v,parser:e,previous:null,sliceSerialize:m,sliceStream:x,write:p},d=t.tokenize.call(c,u),f;return t.resolveAll&&o.push(t),c;function p(U){return l=ra(l,U),w(),l[l.length-1]!==null?[]:(L(t,0),c.events=Vr(o,c.events,c),c.events)}function m(U,W){return nz(x(U),W)}function x(U){return az(l,U)}function v(){let{_bufferIndex:U,_index:W,line:E,column:j,offset:$}=n;return{_bufferIndex:U,_index:W,line:E,column:j,offset:$}}function y(U){r[U.line]=U.column,B()}function w(){let U;for(;n._index<l.length;){let W=l[n._index];if(typeof W=="string")for(U=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===U&&n._bufferIndex<W.length;)g(W.charCodeAt(n._bufferIndex));else g(W)}}function g(U){s=void 0,f=U,d=d(U)}function C(U){V(U)?(n.line++,n.column=1,n.offset+=U===-3?2:1,B()):U!==-1&&(n.column++,n.offset++),n._bufferIndex<0?n._index++:(n._bufferIndex++,n._bufferIndex===l[n._index].length&&(n._bufferIndex=-1,n._index++)),c.previous=U,s=!0}function A(U,W){let E=W||{};return E.type=U,E.start=v(),c.events.push(["enter",E,c]),i.push(E),E}function S(U){let W=i.pop();return W.end=v(),c.events.push(["exit",W,c]),W}function M(U,W){L(U,W.from)}function R(U,W){W.restore()}function D(U,W){return E;function E(j,$,he){let Ie,b,qe,rt;return Array.isArray(j)?ke(j):"tokenize"in j?ke([j]):k(j);function k(Le){return Ee;function Ee(ye){let we=ye!==null&&Le[ye],fe=ye!==null&&Le.null,Ue=[...Array.isArray(we)?we:we?[we]:[],...Array.isArray(fe)?fe:fe?[fe]:[]];return ke(Ue)(ye)}}function ke(Le){return Ie=Le,b=0,Le.length===0?he:ie(Le[b])}function ie(Le){return Ee;function Ee(ye){return rt=G(),qe=Le,Le.partial||(c.currentConstruct=Le),Le.name&&c.parser.constructs.disable.null.includes(Le.name)?It(ye):Le.tokenize.call(W?Object.assign(Object.create(c),W):c,u,ge,It)(ye)}}function ge(Le){return s=!0,U(qe,rt),$}function It(Le){return s=!0,rt.restore(),++b<Ie.length?ie(Ie[b]):he}}}function L(U,W){U.resolveAll&&!o.includes(U)&&o.push(U),U.resolve&&Tt(c.events,W,c.events.length-W,U.resolve(c.events.slice(W),c)),U.resolveTo&&(c.events=U.resolveTo(c.events,c))}function G(){let U=v(),W=c.previous,E=c.currentConstruct,j=c.events.length,$=Array.from(i);return{from:j,restore:he};function he(){n=U,c.previous=W,c.currentConstruct=E,c.events.length=j,i=$,B()}}function B(){n.line in r&&n.column<2&&(n.column=r[n.line],n.offset+=r[n.line]-1)}}function az(e,t){let a=t.start._index,n=t.start._bufferIndex,r=t.end._index,o=t.end._bufferIndex,l;if(a===r)l=[e[a].slice(n,o)];else{if(l=e.slice(a,r),n>-1){let i=l[0];typeof i=="string"?l[0]=i.slice(n):l.shift()}o>0&&l.push(e[r].slice(0,o))}return l}function nz(e,t){let a=-1,n=[],r;for(;++a<e.length;){let o=e[a],l;if(typeof o=="string")l=o;else switch(o){case-5:{l="\r";break}case-4:{l=`
|
|
43
|
+
`;break}case-3:{l=`\r
|
|
44
|
+
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&r)continue;l=" ";break}default:l=String.fromCharCode(o)}r=o===-2,n.push(l)}return n.join("")}var kT=I(()=>{"use strict";_e();Jn();Ns()});function By(e){let n={constructs:Td([Ny,...(e||{}).extensions||[]]),content:r(dT),defined:[],document:r(mT),flow:r(gT),lazy:{},string:r(xT),text:r(vT)};return n;function r(o){return l;function l(i){return IT(n,o,i)}}}var LT=I(()=>{"use strict";Ug();fT();hT();yT();Py();CT();kT()});function Uy(e){for(;!Od(e););return e}var TT=I(()=>{"use strict";Vg()});function Fy(){let e=1,t="",a=!0,n;return r;function r(o,l,i){let s=[],u,c,d,f,p;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(l||void 0).decode(o)),d=0,t="",a&&(o.charCodeAt(0)===65279&&d++,a=void 0);d<o.length;){if(AT.lastIndex=d,u=AT.exec(o),f=u&&u.index!==void 0?u.index:o.length,p=o.charCodeAt(f),!u){t=o.slice(d);break}if(p===10&&d===f&&n)s.push(-3),n=void 0;else switch(n&&(s.push(-5),n=void 0),d<f&&(s.push(o.slice(d,f)),e+=f-d),p){case 0:{s.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,s.push(-2);e++<c;)s.push(-1);break}case 10:{s.push(-4),e=1;break}default:n=!0,e=1}d=f+1}return i&&(n&&s.push(-5),t&&s.push(t),s.push(null)),s}}var AT,MT=I(()=>{"use strict";AT=/[\0\t\n\r]/g});var ET=I(()=>{"use strict";LT();TT();MT()});function zy(e,t,a){return typeof t!="string"&&(a=t,t=void 0),rz(a)(Uy(By(a).document().write(Fy()(e,t,!0))))}function rz(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(ht),autolinkProtocol:D,autolinkEmail:D,atxHeading:o(je),blockQuote:o(ye),characterEscape:D,characterReference:D,codeFenced:o(we),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:o(we,l),codeText:o(fe,l),codeTextData:D,data:D,codeFlowValue:D,definition:o(Ue),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:o(Te),hardBreakEscape:o(ot),hardBreakTrailing:o(ot),htmlFlow:o(Y,l),htmlFlowData:D,htmlText:o(Y,l),htmlTextData:D,image:o(Re),label:l,link:o(ht),listItem:o(eo),listItemValue:f,listOrdered:o(jt,d),listUnordered:o(jt),paragraph:o(ir),reference:k,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:o(je),strong:o(sr),thematicBreak:o(Go)},exit:{atxHeading:s(),atxHeadingSequence:A,autolink:s(),autolinkEmail:Ee,autolinkProtocol:Le,blockQuote:s(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:ie,characterReferenceMarkerNumeric:ie,characterReferenceValue:ge,characterReference:It,codeFenced:s(v),codeFencedFence:x,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:L,codeIndented:s(y),codeText:s(E),codeTextData:L,data:L,definition:s(),definitionDestinationString:C,definitionLabelString:w,definitionTitleString:g,emphasis:s(),hardBreakEscape:s(B),hardBreakTrailing:s(B),htmlFlow:s(U),htmlFlowData:L,htmlText:s(W),htmlTextData:L,image:s($),label:Ie,labelText:he,lineEnding:G,link:s(j),listItem:s(),listOrdered:s(),listUnordered:s(),paragraph:s(),referenceString:ke,resourceDestinationString:b,resourceTitleString:qe,resource:rt,setextHeading:s(R),setextHeadingLineSequence:M,setextHeadingText:S,strong:s(),thematicBreak:s()}};_T(t,(e||{}).mdastExtensions||[]);let a={};return n;function n(O){let q={type:"root",children:[]},oe={stack:[q],tokenStack:[],config:t,enter:i,exit:u,buffer:l,resume:c,data:a},xe=[],He=-1;for(;++He<O.length;)if(O[He][1].type==="listOrdered"||O[He][1].type==="listUnordered")if(O[He][0]==="enter")xe.push(He);else{let ua=xe.pop();He=r(O,ua,He)}for(He=-1;++He<O.length;){let ua=t[O[He][0]];DT.call(ua,O[He][1].type)&&ua[O[He][1].type].call(Object.assign({sliceSerialize:O[He][2].sliceSerialize},oe),O[He][1])}if(oe.tokenStack.length>0){let ua=oe.tokenStack[oe.tokenStack.length-1];(ua[1]||RT).call(oe,void 0,ua[0])}for(q.position={start:Xr(O.length>0?O[0][1].start:{line:1,column:1,offset:0}),end:Xr(O.length>0?O[O.length-2][1].end:{line:1,column:1,offset:0})},He=-1;++He<t.transforms.length;)q=t.transforms[He](q)||q;return q}function r(O,q,oe){let xe=q-1,He=-1,ua=!1,Ln,Ja,N,ne;for(;++xe<=oe;){let ee=O[xe];switch(ee[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ee[0]==="enter"?He++:He--,ne=void 0;break}case"lineEndingBlank":{ee[0]==="enter"&&(Ln&&!ne&&!He&&!N&&(N=xe),ne=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ne=void 0}if(!He&&ee[0]==="enter"&&ee[1].type==="listItemPrefix"||He===-1&&ee[0]==="exit"&&(ee[1].type==="listUnordered"||ee[1].type==="listOrdered")){if(Ln){let gt=xe;for(Ja=void 0;gt--;){let Ze=O[gt];if(Ze[1].type==="lineEnding"||Ze[1].type==="lineEndingBlank"){if(Ze[0]==="exit")continue;Ja&&(O[Ja][1].type="lineEndingBlank",ua=!0),Ze[1].type="lineEnding",Ja=gt}else if(!(Ze[1].type==="linePrefix"||Ze[1].type==="blockQuotePrefix"||Ze[1].type==="blockQuotePrefixWhitespace"||Ze[1].type==="blockQuoteMarker"||Ze[1].type==="listItemIndent"))break}N&&(!Ja||N<Ja)&&(Ln._spread=!0),Ln.end=Object.assign({},Ja?O[Ja][1].start:ee[1].end),O.splice(Ja||xe,0,["exit",Ln,ee[2]]),xe++,oe++}if(ee[1].type==="listItemPrefix"){let gt={type:"listItem",_spread:!1,start:Object.assign({},ee[1].start),end:void 0};Ln=gt,O.splice(xe,0,["enter",gt,ee[2]]),xe++,oe++,N=void 0,ne=!0}}}return O[q][1]._spread=ua,oe}function o(O,q){return oe;function oe(xe){i.call(this,O(xe),xe),q&&q.call(this,xe)}}function l(){this.stack.push({type:"fragment",children:[]})}function i(O,q,oe){this.stack[this.stack.length-1].children.push(O),this.stack.push(O),this.tokenStack.push([q,oe||void 0]),O.position={start:Xr(q.start),end:void 0}}function s(O){return q;function q(oe){O&&O.call(this,oe),u.call(this,oe)}}function u(O,q){let oe=this.stack.pop(),xe=this.tokenStack.pop();if(xe)xe[0].type!==O.type&&(q?q.call(this,O,xe[0]):(xe[1]||RT).call(this,O,xe[0]));else throw new Error("Cannot close `"+O.type+"` ("+Wr({start:O.start,end:O.end})+"): it\u2019s not open");oe.position.end=Xr(O.end)}function c(){return Ro(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(O){if(this.data.expectingFirstListItemValue){let q=this.stack[this.stack.length-2];q.start=Number.parseInt(this.sliceSerialize(O),10),this.data.expectingFirstListItemValue=void 0}}function p(){let O=this.resume(),q=this.stack[this.stack.length-1];q.lang=O}function m(){let O=this.resume(),q=this.stack[this.stack.length-1];q.meta=O}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){let O=this.resume(),q=this.stack[this.stack.length-1];q.value=O.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){let O=this.resume(),q=this.stack[this.stack.length-1];q.value=O.replace(/(\r?\n|\r)$/g,"")}function w(O){let q=this.resume(),oe=this.stack[this.stack.length-1];oe.label=q,oe.identifier=Qt(this.sliceSerialize(O)).toLowerCase()}function g(){let O=this.resume(),q=this.stack[this.stack.length-1];q.title=O}function C(){let O=this.resume(),q=this.stack[this.stack.length-1];q.url=O}function A(O){let q=this.stack[this.stack.length-1];if(!q.depth){let oe=this.sliceSerialize(O).length;q.depth=oe}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function M(O){let q=this.stack[this.stack.length-1];q.depth=this.sliceSerialize(O).codePointAt(0)===61?1:2}function R(){this.data.setextHeadingSlurpLineEnding=void 0}function D(O){let oe=this.stack[this.stack.length-1].children,xe=oe[oe.length-1];(!xe||xe.type!=="text")&&(xe=xu(),xe.position={start:Xr(O.start),end:void 0},oe.push(xe)),this.stack.push(xe)}function L(O){let q=this.stack.pop();q.value+=this.sliceSerialize(O),q.position.end=Xr(O.end)}function G(O){let q=this.stack[this.stack.length-1];if(this.data.atHardBreak){let oe=q.children[q.children.length-1];oe.position.end=Xr(O.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(q.type)&&(D.call(this,O),L.call(this,O))}function B(){this.data.atHardBreak=!0}function U(){let O=this.resume(),q=this.stack[this.stack.length-1];q.value=O}function W(){let O=this.resume(),q=this.stack[this.stack.length-1];q.value=O}function E(){let O=this.resume(),q=this.stack[this.stack.length-1];q.value=O}function j(){let O=this.stack[this.stack.length-1];if(this.data.inReference){let q=this.data.referenceType||"shortcut";O.type+="Reference",O.referenceType=q,delete O.url,delete O.title}else delete O.identifier,delete O.label;this.data.referenceType=void 0}function $(){let O=this.stack[this.stack.length-1];if(this.data.inReference){let q=this.data.referenceType||"shortcut";O.type+="Reference",O.referenceType=q,delete O.url,delete O.title}else delete O.identifier,delete O.label;this.data.referenceType=void 0}function he(O){let q=this.sliceSerialize(O),oe=this.stack[this.stack.length-2];oe.label=Yk(q),oe.identifier=Qt(q).toLowerCase()}function Ie(){let O=this.stack[this.stack.length-1],q=this.resume(),oe=this.stack[this.stack.length-1];if(this.data.inReference=!0,oe.type==="link"){let xe=O.children;oe.children=xe}else oe.alt=q}function b(){let O=this.resume(),q=this.stack[this.stack.length-1];q.url=O}function qe(){let O=this.resume(),q=this.stack[this.stack.length-1];q.title=O}function rt(){this.data.inReference=void 0}function k(){this.data.referenceType="collapsed"}function ke(O){let q=this.resume(),oe=this.stack[this.stack.length-1];oe.label=q,oe.identifier=Qt(this.sliceSerialize(O)).toLowerCase(),this.data.referenceType="full"}function ie(O){this.data.characterReferenceType=O.type}function ge(O){let q=this.sliceSerialize(O),oe=this.data.characterReferenceType,xe;oe?(xe=Ld(q,oe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):xe=Kl(q);let He=this.stack[this.stack.length-1];He.value+=xe}function It(O){let q=this.stack.pop();q.position.end=Xr(O.end)}function Le(O){L.call(this,O);let q=this.stack[this.stack.length-1];q.url=this.sliceSerialize(O)}function Ee(O){L.call(this,O);let q=this.stack[this.stack.length-1];q.url="mailto:"+this.sliceSerialize(O)}function ye(){return{type:"blockquote",children:[]}}function we(){return{type:"code",lang:null,meta:null,value:""}}function fe(){return{type:"inlineCode",value:""}}function Ue(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Te(){return{type:"emphasis",children:[]}}function je(){return{type:"heading",depth:0,children:[]}}function ot(){return{type:"break"}}function Y(){return{type:"html",value:""}}function Re(){return{type:"image",title:null,url:"",alt:null}}function ht(){return{type:"link",title:null,url:"",children:[]}}function jt(O){return{type:"list",ordered:O.type==="listOrdered",start:null,spread:O._spread,children:[]}}function eo(O){return{type:"listItem",spread:O._spread,checked:null,children:[]}}function ir(){return{type:"paragraph",children:[]}}function sr(){return{type:"strong",children:[]}}function xu(){return{type:"text",value:""}}function Go(){return{type:"thematicBreak"}}}function Xr(e){return{line:e.line,column:e.column,offset:e.offset}}function _T(e,t){let a=-1;for(;++a<t.length;){let n=t[a];Array.isArray(n)?_T(e,n):oz(e,n)}}function oz(e,t){let a;for(a in t)if(DT.call(t,a))switch(a){case"canContainEols":{let n=t[a];n&&e[a].push(...n);break}case"transforms":{let n=t[a];n&&e[a].push(...n);break}case"enter":case"exit":{let n=t[a];n&&Object.assign(e[a],n);break}}}function RT(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Wr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Wr({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Wr({start:t.start,end:t.end})+") is still open")}var DT,OT=I(()=>{"use strict";Sd();ET();Mg();Jk();Gl();kd();My();DT={}.hasOwnProperty});var PT=I(()=>{"use strict";OT()});function Yd(e){let t=this;t.parser=a;function a(n){return zy(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}var NT=I(()=>{"use strict";PT()});var BT=I(()=>{"use strict";NT()});function UT(e,t){let a={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,a),e.applyData(t,a)}var FT=I(()=>{"use strict"});function zT(e,t){let a={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,a),[e.applyData(t,a),{type:"text",value:`
|
|
45
|
+
`}]}var qT=I(()=>{"use strict"});function HT(e,t){let a=t.value?t.value+`
|
|
46
|
+
`:"",n={},r=t.lang?t.lang.split(/\s+/):[];r.length>0&&(n.className=["language-"+r[0]]);let o={type:"element",tagName:"code",properties:n,children:[{type:"text",value:a}]};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}var jT=I(()=>{"use strict"});function VT(e,t){let a={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}var GT=I(()=>{"use strict"});function $T(e,t){let a={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}var WT=I(()=>{"use strict"});function XT(e,t){let a=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=String(t.identifier).toUpperCase(),r=Xa(n.toLowerCase()),o=e.footnoteOrder.indexOf(n),l,i=e.footnoteCounts.get(n);i===void 0?(i=0,e.footnoteOrder.push(n),l=e.footnoteOrder.length):l=o+1,i+=1,e.footnoteCounts.set(n,i);let s={type:"element",tagName:"a",properties:{href:"#"+a+"fn-"+r,id:a+"fnref-"+r+(i>1?"-"+i:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,s);let u={type:"element",tagName:"sup",properties:{},children:[s]};return e.patch(t,u),e.applyData(t,u)}var KT=I(()=>{"use strict";_o()});function ZT(e,t){let a={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}var QT=I(()=>{"use strict"});function YT(e,t){if(e.options.allowDangerousHtml){let a={type:"raw",value:t.value};return e.patch(t,a),e.applyData(t,a)}}var JT=I(()=>{"use strict"});function Jd(e,t){let a=t.referenceType,n="]";if(a==="collapsed"?n+="[]":a==="full"&&(n+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+n}];let r=e.all(t),o=r[0];o&&o.type==="text"?o.value="["+o.value:r.unshift({type:"text",value:"["});let l=r[r.length-1];return l&&l.type==="text"?l.value+=n:r.push({type:"text",value:n}),r}var qy=I(()=>{"use strict"});function eA(e,t){let a=String(t.identifier).toUpperCase(),n=e.definitionById.get(a);if(!n)return Jd(e,t);let r={src:Xa(n.url||""),alt:t.alt};n.title!==null&&n.title!==void 0&&(r.title=n.title);let o={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,o),e.applyData(t,o)}var tA=I(()=>{"use strict";_o();qy()});function aA(e,t){let a={src:Xa(t.url)};t.alt!==null&&t.alt!==void 0&&(a.alt=t.alt),t.title!==null&&t.title!==void 0&&(a.title=t.title);let n={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,n),e.applyData(t,n)}var nA=I(()=>{"use strict";_o()});function rA(e,t){let a={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,a);let n={type:"element",tagName:"code",properties:{},children:[a]};return e.patch(t,n),e.applyData(t,n)}var oA=I(()=>{"use strict"});function lA(e,t){let a=String(t.identifier).toUpperCase(),n=e.definitionById.get(a);if(!n)return Jd(e,t);let r={href:Xa(n.url||"")};n.title!==null&&n.title!==void 0&&(r.title=n.title);let o={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}var iA=I(()=>{"use strict";_o();qy()});function sA(e,t){let a={href:Xa(t.url)};t.title!==null&&t.title!==void 0&&(a.title=t.title);let n={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var uA=I(()=>{"use strict";_o()});function cA(e,t,a){let n=e.all(t),r=a?lz(a):dA(t),o={},l=[];if(typeof t.checked=="boolean"){let c=n[0],d;c&&c.type==="element"&&c.tagName==="p"?d=c:(d={type:"element",tagName:"p",properties:{},children:[]},n.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let i=-1;for(;++i<n.length;){let c=n[i];(r||i!==0||c.type!=="element"||c.tagName!=="p")&&l.push({type:"text",value:`
|
|
47
|
+
`}),c.type==="element"&&c.tagName==="p"&&!r?l.push(...c.children):l.push(c)}let s=n[n.length-1];s&&(r||s.type!=="element"||s.tagName!=="p")&&l.push({type:"text",value:`
|
|
48
|
+
`});let u={type:"element",tagName:"li",properties:o,children:l};return e.patch(t,u),e.applyData(t,u)}function lz(e){let t=!1;if(e.type==="list"){t=e.spread||!1;let a=e.children,n=-1;for(;!t&&++n<a.length;)t=dA(a[n])}return t}function dA(e){let t=e.spread;return t??e.children.length>1}var fA=I(()=>{"use strict"});function pA(e,t){let a={},n=e.all(t),r=-1;for(typeof t.start=="number"&&t.start!==1&&(a.start=t.start);++r<n.length;){let l=n[r];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){a.className=["contains-task-list"];break}}let o={type:"element",tagName:t.ordered?"ol":"ul",properties:a,children:e.wrap(n,!0)};return e.patch(t,o),e.applyData(t,o)}var mA=I(()=>{"use strict"});function hA(e,t){let a={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}var gA=I(()=>{"use strict"});function yA(e,t){let a={type:"root",children:e.wrap(e.all(t))};return e.patch(t,a),e.applyData(t,a)}var wA=I(()=>{"use strict"});function xA(e,t){let a={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}var vA=I(()=>{"use strict"});function bA(e,t){let a=e.all(t),n=a.shift(),r=[];if(n){let l={type:"element",tagName:"thead",properties:{},children:e.wrap([n],!0)};e.patch(t.children[0],l),r.push(l)}if(a.length>0){let l={type:"element",tagName:"tbody",properties:{},children:e.wrap(a,!0)},i=Vl(t.children[1]),s=yd(t.children[t.children.length-1]);i&&s&&(l.position={start:i,end:s}),r.push(l)}let o={type:"element",tagName:"table",properties:{},children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}var SA=I(()=>{"use strict";Ds()});function CA(e,t,a){let n=a?a.children:void 0,o=(n?n.indexOf(t):1)===0?"th":"td",l=a&&a.type==="table"?a.align:void 0,i=l?l.length:t.children.length,s=-1,u=[];for(;++s<i;){let d=t.children[s],f={},p=l?l[s]:void 0;p&&(f.align=p);let m={type:"element",tagName:o,properties:f,children:[]};d&&(m.children=e.all(d),e.patch(d,m),m=e.applyData(d,m)),u.push(m)}let c={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,c),e.applyData(t,c)}var IA=I(()=>{"use strict"});function kA(e,t){let a={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}var LA=I(()=>{"use strict"});function AA(e){let t=String(e),a=/\r?\n|\r/g,n=a.exec(t),r=0,o=[];for(;n;)o.push(TA(t.slice(r,n.index),r>0,!0),n[0]),r=n.index+n[0].length,n=a.exec(t);return o.push(TA(t.slice(r),r>0,!1)),o.join("")}function TA(e,t,a){let n=0,r=e.length;if(t){let o=e.codePointAt(n);for(;o===9||o===32;)n++,o=e.codePointAt(n)}if(a){let o=e.codePointAt(r-1);for(;o===9||o===32;)r--,o=e.codePointAt(r-1)}return r>n?e.slice(n,r):""}var MA=I(()=>{"use strict"});function EA(e,t){let a={type:"text",value:AA(String(t.value))};return e.patch(t,a),e.applyData(t,a)}var RA=I(()=>{"use strict";MA()});function DA(e,t){let a={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,a),e.applyData(t,a)}var _A=I(()=>{"use strict"});function ef(){}var OA,PA=I(()=>{"use strict";FT();qT();jT();GT();WT();KT();QT();JT();tA();nA();oA();iA();uA();fA();mA();gA();wA();vA();SA();IA();LA();RA();_A();OA={blockquote:UT,break:zT,code:HT,delete:VT,emphasis:$T,footnoteReference:XT,heading:ZT,html:YT,imageReference:eA,image:aA,inlineCode:rA,linkReference:lA,link:sA,listItem:cA,list:pA,paragraph:hA,root:yA,strong:xA,table:bA,tableCell:kA,tableRow:CA,text:EA,thematicBreak:DA,toml:ef,yaml:ef,definition:ef,footnoteDefinition:ef}});function iz(e,t){let a=[{type:"text",value:"\u21A9"}];return t>1&&a.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),a}function sz(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function NA(e){let t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=e.options.footnoteBackContent||iz,n=e.options.footnoteBackLabel||sz,r=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},i=[],s=-1;for(;++s<e.footnoteOrder.length;){let u=e.footnoteById.get(e.footnoteOrder[s]);if(!u)continue;let c=e.all(u),d=String(u.identifier).toUpperCase(),f=Xa(d.toLowerCase()),p=0,m=[],x=e.footnoteCounts.get(d);for(;x!==void 0&&++p<=x;){m.length>0&&m.push({type:"text",value:" "});let w=typeof a=="string"?a:a(s,p);typeof w=="string"&&(w={type:"text",value:w}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+f+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof n=="string"?n:n(s,p),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}let v=c[c.length-1];if(v&&v.type==="element"&&v.tagName==="p"){let w=v.children[v.children.length-1];w&&w.type==="text"?w.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...m)}else c.push(...m);let y={type:"element",tagName:"li",properties:{id:t+"fn-"+f},children:e.wrap(c,!0)};e.patch(u,y),i.push(y)}if(i.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...zr(l),id:"footnote-label"},children:[{type:"text",value:r}]},{type:"text",value:`
|
|
49
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(i,!0)},{type:"text",value:`
|
|
50
|
+
`}]}}var BA=I(()=>{"use strict";gd();_o()});function FA(e,t){let a=t||uz,n=new Map,r=new Map,o=new Map,l={...OA,...a.handlers},i={all:u,applyData:dz,definitionById:n,footnoteById:r,footnoteCounts:o,footnoteOrder:[],handlers:l,one:s,options:a,patch:cz,wrap:pz};return Qn(e,function(c){if(c.type==="definition"||c.type==="footnoteDefinition"){let d=c.type==="definition"?n:r,f=String(c.identifier).toUpperCase();d.has(f)||d.set(f,c)}}),i;function s(c,d){let f=c.type,p=i.handlers[f];if(Hy.call(i.handlers,f)&&p)return p(i,c,d);if(i.options.passThrough&&i.options.passThrough.includes(f)){if("children"in c){let{children:x,...v}=c,y=zr(v);return y.children=i.all(c),y}return zr(c)}return(i.options.unknownHandler||fz)(i,c,d)}function u(c){let d=[];if("children"in c){let f=c.children,p=-1;for(;++p<f.length;){let m=i.one(f[p],c);if(m){if(p&&f[p-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=UA(m.value)),!Array.isArray(m)&&m.type==="element")){let x=m.children[0];x&&x.type==="text"&&(x.value=UA(x.value))}Array.isArray(m)?d.push(...m):d.push(m)}}}return d}}function cz(e,t){e.position&&(t.position=Rs(e))}function dz(e,t){let a=t;if(e&&e.data){let n=e.data.hName,r=e.data.hChildren,o=e.data.hProperties;if(typeof n=="string")if(a.type==="element")a.tagName=n;else{let l="children"in a?a.children:[a];a={type:"element",tagName:n,properties:{},children:l}}a.type==="element"&&o&&Object.assign(a.properties,zr(o)),"children"in a&&a.children&&r!==null&&r!==void 0&&(a.children=r)}return a}function fz(e,t){let a=t.data||{},n="value"in t&&!(Hy.call(a,"hProperties")||Hy.call(a,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function pz(e,t){let a=[],n=-1;for(t&&a.push({type:"text",value:`
|
|
51
51
|
`});++n<e.length;)n&&a.push({type:"text",value:`
|
|
52
52
|
`}),a.push(e[n]);return t&&e.length>0&&a.push({type:"text",value:`
|
|
53
|
-
`}),a}function
|
|
54
|
-
`},r)),o}var eM=C(()=>{"use strict";ZE();JE()});var tM=C(()=>{"use strict";eM()});function lf(e,t){return e&&"run"in e?async function(a,n){let r=of(a,{file:n,...t});await e.run(r,n)}:function(a,n){return of(a,{file:n,...e||t})}}var aM=C(()=>{"use strict";tM()});var nM=C(()=>{"use strict";aM()});function Jy(e){if(e)throw e}var rM=C(()=>{"use strict"});var pM=Kt((Gee,fM)=>{"use strict";var sf=Object.prototype.hasOwnProperty,dM=Object.prototype.toString,oM=Object.defineProperty,iM=Object.getOwnPropertyDescriptor,lM=function(t){return typeof Array.isArray=="function"?Array.isArray(t):dM.call(t)==="[object Array]"},sM=function(t){if(!t||dM.call(t)!=="[object Object]")return!1;var a=sf.call(t,"constructor"),n=t.constructor&&t.constructor.prototype&&sf.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!a&&!n)return!1;var r;for(r in t);return typeof r>"u"||sf.call(t,r)},uM=function(t,a){oM&&a.name==="__proto__"?oM(t,a.name,{enumerable:!0,configurable:!0,value:a.newValue,writable:!0}):t[a.name]=a.newValue},cM=function(t,a){if(a==="__proto__")if(sf.call(t,a)){if(iM)return iM(t,a).value}else return;return t[a]};fM.exports=function e(){var t,a,n,r,o,i,l=arguments[0],s=1,u=arguments.length,c=!1;for(typeof l=="boolean"&&(c=l,l=arguments[1]||{},s=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});s<u;++s)if(t=arguments[s],t!=null)for(a in t)n=cM(l,a),r=cM(t,a),l!==r&&(c&&r&&(sM(r)||(o=lM(r)))?(o?(o=!1,i=n&&lM(n)?n:[]):i=n&&sM(n)?n:{},uM(l,{name:a,newValue:e(c,i,r)})):typeof r<"u"&&uM(l,{name:a,newValue:r}));return l}});function Ks(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}var mM=C(()=>{"use strict"});function ew(){let e=[],t={run:a,use:n};return t;function a(...r){let o=-1,i=r.pop();if(typeof i!="function")throw new TypeError("Expected function as last argument, not "+i);l(null,...r);function l(s,...u){let c=e[++o],d=-1;if(s){i(s);return}for(;++d<r.length;)(u[d]===null||u[d]===void 0)&&(u[d]=r[d]);r=u,c?hM(c,l)(...u):i(null,...u)}}function n(r){if(typeof r!="function")throw new TypeError("Expected `middelware` to be a function, not "+r);return e.push(r),t}}function hM(e,t){let a;return n;function n(...i){let l=e.length>i.length,s;l&&i.push(r);try{s=e.apply(this,i)}catch(u){let c=u;if(l&&a)throw c;return r(c)}l||(s&&s.then&&typeof s.then=="function"?s.then(o,r):s instanceof Error?r(s):o(s))}function r(i,...l){a||(a=!0,t(i,...l))}function o(i){r(null,i)}}var gM=C(()=>{"use strict"});var yM=C(()=>{"use strict";gM()});function Ez(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Zs(e);let a=0,n=-1,r=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;r--;)if(e.codePointAt(r)===47){if(o){a=r+1;break}}else n<0&&(o=!0,n=r+1);return n<0?"":e.slice(a,n)}if(t===e)return"";let i=-1,l=t.length-1;for(;r--;)if(e.codePointAt(r)===47){if(o){a=r+1;break}}else i<0&&(o=!0,i=r+1),l>-1&&(e.codePointAt(r)===t.codePointAt(l--)?l<0&&(n=r):(l=-1,n=i));return a===n?n=i:n<0&&(n=e.length),e.slice(a,n)}function Mz(e){if(Zs(e),e.length===0)return".";let t=-1,a=e.length,n;for(;--a;)if(e.codePointAt(a)===47){if(n){t=a;break}}else n||(n=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Az(e){Zs(e);let t=e.length,a=-1,n=0,r=-1,o=0,i;for(;t--;){let l=e.codePointAt(t);if(l===47){if(i){n=t+1;break}continue}a<0&&(i=!0,a=t+1),l===46?r<0?r=t:o!==1&&(o=1):r>-1&&(o=-1)}return r<0||a<0||o===0||o===1&&r===a-1&&r===n+1?"":e.slice(r,a)}function Rz(...e){let t=-1,a;for(;++t<e.length;)Zs(e[t]),e[t]&&(a=a===void 0?e[t]:a+"/"+e[t]);return a===void 0?".":Dz(a)}function Dz(e){Zs(e);let t=e.codePointAt(0)===47,a=_z(e,!t);return a.length===0&&!t&&(a="."),a.length>0&&e.codePointAt(e.length-1)===47&&(a+="/"),t?"/"+a:a}function _z(e,t){let a="",n=0,r=-1,o=0,i=-1,l,s;for(;++i<=e.length;){if(i<e.length)l=e.codePointAt(i);else{if(l===47)break;l=47}if(l===47){if(!(r===i-1||o===1))if(r!==i-1&&o===2){if(a.length<2||n!==2||a.codePointAt(a.length-1)!==46||a.codePointAt(a.length-2)!==46){if(a.length>2){if(s=a.lastIndexOf("/"),s!==a.length-1){s<0?(a="",n=0):(a=a.slice(0,s),n=a.length-1-a.lastIndexOf("/")),r=i,o=0;continue}}else if(a.length>0){a="",n=0,r=i,o=0;continue}}t&&(a=a.length>0?a+"/..":"..",n=2)}else a.length>0?a+="/"+e.slice(r+1,i):a=e.slice(r+1,i),n=i-r-1;r=i,o=0}else l===46&&o>-1?o++:o=-1}return a}function Zs(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}var on,wM=C(()=>{"use strict";on={basename:Ez,dirname:Mz,extname:Az,join:Rz,sep:"/"}});function Oz(){return"/"}var xM,vM=C(()=>{"use strict";xM={cwd:Oz}});function Yi(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}var tw=C(()=>{"use strict"});function bM(e){if(typeof e=="string")e=new URL(e);else if(!Yi(e)){let 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:"){let t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Pz(e)}function Pz(e){if(e.hostname!==""){let n=new TypeError('File URL host must be "localhost" or empty on darwin');throw n.code="ERR_INVALID_FILE_URL_HOST",n}let t=e.pathname,a=-1;for(;++a<t.length;)if(t.codePointAt(a)===37&&t.codePointAt(a+1)===50){let n=t.codePointAt(a+2);if(n===70||n===102){let r=new TypeError("File URL path must not include encoded / characters");throw r.code="ERR_INVALID_FILE_URL_PATH",r}}return decodeURIComponent(t)}var SM=C(()=>{"use strict";tw();tw()});function nw(e,t){if(e&&e.includes(on.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+on.sep+"`")}function rw(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function IM(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Nz(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var aw,Qs,CM=C(()=>{"use strict";zy();wM();vM();SM();aw=["history","path","basename","stem","extname","dirname"],Qs=class{constructor(t){let a;t?Yi(t)?a={path:t}:typeof t=="string"||Nz(t)?a={value:t}:a=t:a={},this.cwd="cwd"in a?"":xM.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<aw.length;){let o=aw[n];o in a&&a[o]!==void 0&&a[o]!==null&&(this[o]=o==="history"?[...a[o]]:a[o])}let r;for(r in a)aw.includes(r)||(this[r]=a[r])}get basename(){return typeof this.path=="string"?on.basename(this.path):void 0}set basename(t){rw(t,"basename"),nw(t,"basename"),this.path=on.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?on.dirname(this.path):void 0}set dirname(t){IM(this.basename,"dirname"),this.path=on.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?on.extname(this.path):void 0}set extname(t){if(nw(t,"extname"),IM(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=on.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Yi(t)&&(t=bM(t)),rw(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?on.basename(this.path,this.extname):void 0}set stem(t){rw(t,"stem"),nw(t,"stem"),this.path=on.join(this.dirname||"",t+(this.extname||""))}fail(t,a,n){let r=this.message(t,a,n);throw r.fatal=!0,r}info(t,a,n){let r=this.message(t,a,n);return r.fatal=void 0,r}message(t,a,n){let r=new Et(t,a,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}});var kM=C(()=>{"use strict";CM()});var LM,TM=C(()=>{"use strict";LM=(function(e){let n=this.constructor.prototype,r=n[e],o=function(){return r.apply(o,arguments)};return Object.setPrototypeOf(o,n),o})});function ow(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function iw(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function lw(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 EM(e){if(!Ks(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function MM(e,t,a){if(!a)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function uf(e){return Uz(e)?e:new Qs(e)}function Uz(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Fz(e){return typeof e=="string"||zz(e)}function zz(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var cf,Bz,sw,uw,AM=C(()=>{"use strict";rM();cf=z(pM(),1);mM();yM();kM();TM();Bz={}.hasOwnProperty,sw=class e extends LM{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=ew()}copy(){let t=new e,a=-1;for(;++a<this.attachers.length;){let n=this.attachers[a];t.use(...n)}return t.data((0,cf.default)(!0,{},this.namespace)),t}data(t,a){return typeof t=="string"?arguments.length===2?(lw("data",this.frozen),this.namespace[t]=a,this):Bz.call(this.namespace,t)&&this.namespace[t]||void 0:t?(lw("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;let t=this;for(;++this.freezeIndex<this.attachers.length;){let[a,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=a.call(t,...n);typeof r=="function"&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();let a=uf(t),n=this.parser||this.Parser;return ow("parse",n),n(String(a),a)}process(t,a){let n=this;return this.freeze(),ow("process",this.parser||this.Parser),iw("process",this.compiler||this.Compiler),a?r(void 0,a):new Promise(r);function r(o,i){let l=uf(t),s=n.parse(l);n.run(s,l,function(c,d,f){if(c||!d||!f)return u(c);let p=d,m=n.stringify(p,f);Fz(m)?f.value=m:f.result=m,u(c,f)});function u(c,d){c||!d?i(c):o?o(d):a(void 0,d)}}}processSync(t){let a=!1,n;return this.freeze(),ow("processSync",this.parser||this.Parser),iw("processSync",this.compiler||this.Compiler),this.process(t,r),MM("processSync","process",a),n;function r(o,i){a=!0,Jy(o),n=i}}run(t,a,n){EM(t),this.freeze();let r=this.transformers;return!n&&typeof a=="function"&&(n=a,a=void 0),n?o(void 0,n):new Promise(o);function o(i,l){let s=uf(a);r.run(t,s,u);function u(c,d,f){let p=d||t;c?l(c):i?i(p):n(void 0,p,f)}}}runSync(t,a){let n=!1,r;return this.run(t,a,o),MM("runSync","run",n),r;function o(i,l){Jy(i),r=l,n=!0}}stringify(t,a){this.freeze();let n=uf(a),r=this.compiler||this.Compiler;return iw("stringify",r),EM(t),r(t,n)}use(t,...a){let n=this.attachers,r=this.namespace;if(lw("use",this.frozen),t!=null)if(typeof t=="function")s(t,a);else if(typeof t=="object")Array.isArray(t)?l(t):i(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(u){if(typeof u=="function")s(u,[]);else if(typeof u=="object")if(Array.isArray(u)){let[c,...d]=u;s(c,d)}else i(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function i(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(u.plugins),u.settings&&(r.settings=(0,cf.default)(!0,r.settings,u.settings))}function l(u){let c=-1;if(u!=null)if(Array.isArray(u))for(;++c<u.length;){let d=u[c];o(d)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function s(u,c){let d=-1,f=-1;for(;++d<n.length;)if(n[d][0]===u){f=d;break}if(f===-1)n.push([u,...c]);else if(c.length>0){let[p,...m]=c,x=n[f][1];Ks(x)&&Ks(p)&&(p=(0,cf.default)(!0,x,p)),n[f]=[u,p,...m]}}}},uw=new sw().freeze()});var RM=C(()=>{"use strict";AM()});function pw(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function UM(e){jo=e}function Pe(e,t=""){let a=typeof e=="string"?e:e.source,n={replace:(r,o)=>{let i=typeof o=="string"?o:o.source;return i=i.replace(oa.caret,"$1"),a=a.replace(r,i),n},getRegex:()=>new RegExp(a,t)};return n}function rr(e,t){if(t){if(oa.escapeTest.test(e))return e.replace(oa.escapeReplace,OM)}else if(oa.escapeTestNoEncode.test(e))return e.replace(oa.escapeReplaceNoEncode,OM);return e}function PM(e){try{e=encodeURI(e).replace(oa.percentDecode,"%")}catch{return null}return e}function NM(e,t){let a=e.replace(oa.findPipe,(o,i,l)=>{let s=!1,u=i;for(;--u>=0&&l[u]==="\\";)s=!s;return s?"|":" |"}),n=a.split(oa.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(oa.slashPipe,"|");return n}function Js(e,t,a){let n=e.length;if(n===0)return"";let r=0;for(;r<n;){let o=e.charAt(n-r-1);if(o===t&&!a)r++;else if(o!==t&&a)r++;else break}return e.slice(0,n-r)}function bq(e,t){if(e.indexOf(t[1])===-1)return-1;let a=0;for(let n=0;n<e.length;n++)if(e[n]==="\\")n++;else if(e[n]===t[0])a++;else if(e[n]===t[1]&&(a--,a<0))return n;return a>0?-2:-1}function BM(e,t,a,n,r){let o=t.href,i=t.title||null,l=e[1].replace(r.other.outputLinkReplace,"$1");n.state.inLink=!0;let s={type:e[0].charAt(0)==="!"?"image":"link",raw:a,href:o,title:i,text:l,tokens:n.inlineTokens(l)};return n.state.inLink=!1,s}function Sq(e,t,a){let n=e.match(a.other.indentCodeCompensation);if(n===null)return t;let r=n[1];return t.split(`
|
|
55
|
-
`).map(o=>{let
|
|
56
|
-
`)}function
|
|
57
|
-
]`).replace("lheading",
|
|
58
|
-
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let a=t[0],n=
|
|
59
|
-
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let a=
|
|
53
|
+
`}),a}function UA(e){let t=0,a=e.charCodeAt(t);for(;a===9||a===32;)t++,a=e.charCodeAt(t);return e.slice(t)}var Hy,uz,zA=I(()=>{"use strict";gd();pd();Ds();PA();Hy={}.hasOwnProperty,uz={}});function tf(e,t){let a=FA(e,t),n=a.one(e,void 0),r=NA(a),o=Array.isArray(n)?{type:"root",children:n}:n||{type:"root",children:[]};return r&&("children"in o,o.children.push({type:"text",value:`
|
|
54
|
+
`},r)),o}var qA=I(()=>{"use strict";BA();zA()});var HA=I(()=>{"use strict";qA()});function af(e,t){return e&&"run"in e?async function(a,n){let r=tf(a,{file:n,...t});await e.run(r,n)}:function(a,n){return tf(a,{file:n,...e||t})}}var jA=I(()=>{"use strict";HA()});var VA=I(()=>{"use strict";jA()});function jy(e){if(e)throw e}var GA=I(()=>{"use strict"});var eM=Kt((Eee,JA)=>{"use strict";var nf=Object.prototype.hasOwnProperty,YA=Object.prototype.toString,$A=Object.defineProperty,WA=Object.getOwnPropertyDescriptor,XA=function(t){return typeof Array.isArray=="function"?Array.isArray(t):YA.call(t)==="[object Array]"},KA=function(t){if(!t||YA.call(t)!=="[object Object]")return!1;var a=nf.call(t,"constructor"),n=t.constructor&&t.constructor.prototype&&nf.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!a&&!n)return!1;var r;for(r in t);return typeof r>"u"||nf.call(t,r)},ZA=function(t,a){$A&&a.name==="__proto__"?$A(t,a.name,{enumerable:!0,configurable:!0,value:a.newValue,writable:!0}):t[a.name]=a.newValue},QA=function(t,a){if(a==="__proto__")if(nf.call(t,a)){if(WA)return WA(t,a).value}else return;return t[a]};JA.exports=function e(){var t,a,n,r,o,l,i=arguments[0],s=1,u=arguments.length,c=!1;for(typeof i=="boolean"&&(c=i,i=arguments[1]||{},s=2),(i==null||typeof i!="object"&&typeof i!="function")&&(i={});s<u;++s)if(t=arguments[s],t!=null)for(a in t)n=QA(i,a),r=QA(t,a),i!==r&&(c&&r&&(KA(r)||(o=XA(r)))?(o?(o=!1,l=n&&XA(n)?n:[]):l=n&&KA(n)?n:{},ZA(i,{name:a,newValue:e(c,l,r)})):typeof r<"u"&&ZA(i,{name:a,newValue:r}));return i}});function $s(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}var tM=I(()=>{"use strict"});function Vy(){let e=[],t={run:a,use:n};return t;function a(...r){let o=-1,l=r.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);i(null,...r);function i(s,...u){let c=e[++o],d=-1;if(s){l(s);return}for(;++d<r.length;)(u[d]===null||u[d]===void 0)&&(u[d]=r[d]);r=u,c?aM(c,i)(...u):l(null,...u)}}function n(r){if(typeof r!="function")throw new TypeError("Expected `middelware` to be a function, not "+r);return e.push(r),t}}function aM(e,t){let a;return n;function n(...l){let i=e.length>l.length,s;i&&l.push(r);try{s=e.apply(this,l)}catch(u){let c=u;if(i&&a)throw c;return r(c)}i||(s&&s.then&&typeof s.then=="function"?s.then(o,r):s instanceof Error?r(s):o(s))}function r(l,...i){a||(a=!0,t(l,...i))}function o(l){r(null,l)}}var nM=I(()=>{"use strict"});var rM=I(()=>{"use strict";nM()});function mz(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Ws(e);let a=0,n=-1,r=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;r--;)if(e.codePointAt(r)===47){if(o){a=r+1;break}}else n<0&&(o=!0,n=r+1);return n<0?"":e.slice(a,n)}if(t===e)return"";let l=-1,i=t.length-1;for(;r--;)if(e.codePointAt(r)===47){if(o){a=r+1;break}}else l<0&&(o=!0,l=r+1),i>-1&&(e.codePointAt(r)===t.codePointAt(i--)?i<0&&(n=r):(i=-1,n=l));return a===n?n=l:n<0&&(n=e.length),e.slice(a,n)}function hz(e){if(Ws(e),e.length===0)return".";let t=-1,a=e.length,n;for(;--a;)if(e.codePointAt(a)===47){if(n){t=a;break}}else n||(n=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function gz(e){Ws(e);let t=e.length,a=-1,n=0,r=-1,o=0,l;for(;t--;){let i=e.codePointAt(t);if(i===47){if(l){n=t+1;break}continue}a<0&&(l=!0,a=t+1),i===46?r<0?r=t:o!==1&&(o=1):r>-1&&(o=-1)}return r<0||a<0||o===0||o===1&&r===a-1&&r===n+1?"":e.slice(r,a)}function yz(...e){let t=-1,a;for(;++t<e.length;)Ws(e[t]),e[t]&&(a=a===void 0?e[t]:a+"/"+e[t]);return a===void 0?".":wz(a)}function wz(e){Ws(e);let t=e.codePointAt(0)===47,a=xz(e,!t);return a.length===0&&!t&&(a="."),a.length>0&&e.codePointAt(e.length-1)===47&&(a+="/"),t?"/"+a:a}function xz(e,t){let a="",n=0,r=-1,o=0,l=-1,i,s;for(;++l<=e.length;){if(l<e.length)i=e.codePointAt(l);else{if(i===47)break;i=47}if(i===47){if(!(r===l-1||o===1))if(r!==l-1&&o===2){if(a.length<2||n!==2||a.codePointAt(a.length-1)!==46||a.codePointAt(a.length-2)!==46){if(a.length>2){if(s=a.lastIndexOf("/"),s!==a.length-1){s<0?(a="",n=0):(a=a.slice(0,s),n=a.length-1-a.lastIndexOf("/")),r=l,o=0;continue}}else if(a.length>0){a="",n=0,r=l,o=0;continue}}t&&(a=a.length>0?a+"/..":"..",n=2)}else a.length>0?a+="/"+e.slice(r+1,l):a=e.slice(r+1,l),n=l-r-1;r=l,o=0}else i===46&&o>-1?o++:o=-1}return a}function Ws(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}var rn,oM=I(()=>{"use strict";rn={basename:mz,dirname:hz,extname:gz,join:yz,sep:"/"}});function vz(){return"/"}var lM,iM=I(()=>{"use strict";lM={cwd:vz}});function Yl(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}var Gy=I(()=>{"use strict"});function sM(e){if(typeof e=="string")e=new URL(e);else if(!Yl(e)){let 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:"){let t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return bz(e)}function bz(e){if(e.hostname!==""){let n=new TypeError('File URL host must be "localhost" or empty on darwin');throw n.code="ERR_INVALID_FILE_URL_HOST",n}let t=e.pathname,a=-1;for(;++a<t.length;)if(t.codePointAt(a)===37&&t.codePointAt(a+1)===50){let n=t.codePointAt(a+2);if(n===70||n===102){let r=new TypeError("File URL path must not include encoded / characters");throw r.code="ERR_INVALID_FILE_URL_PATH",r}}return decodeURIComponent(t)}var uM=I(()=>{"use strict";Gy();Gy()});function Wy(e,t){if(e&&e.includes(rn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+rn.sep+"`")}function Xy(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function cM(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Sz(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var $y,Xs,dM=I(()=>{"use strict";Ey();oM();iM();uM();$y=["history","path","basename","stem","extname","dirname"],Xs=class{constructor(t){let a;t?Yl(t)?a={path:t}:typeof t=="string"||Sz(t)?a={value:t}:a=t:a={},this.cwd="cwd"in a?"":lM.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<$y.length;){let o=$y[n];o in a&&a[o]!==void 0&&a[o]!==null&&(this[o]=o==="history"?[...a[o]]:a[o])}let r;for(r in a)$y.includes(r)||(this[r]=a[r])}get basename(){return typeof this.path=="string"?rn.basename(this.path):void 0}set basename(t){Xy(t,"basename"),Wy(t,"basename"),this.path=rn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?rn.dirname(this.path):void 0}set dirname(t){cM(this.basename,"dirname"),this.path=rn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?rn.extname(this.path):void 0}set extname(t){if(Wy(t,"extname"),cM(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=rn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Yl(t)&&(t=sM(t)),Xy(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?rn.basename(this.path,this.extname):void 0}set stem(t){Xy(t,"stem"),Wy(t,"stem"),this.path=rn.join(this.dirname||"",t+(this.extname||""))}fail(t,a,n){let r=this.message(t,a,n);throw r.fatal=!0,r}info(t,a,n){let r=this.message(t,a,n);return r.fatal=void 0,r}message(t,a,n){let r=new Mt(t,a,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}});var fM=I(()=>{"use strict";dM()});var pM,mM=I(()=>{"use strict";pM=(function(e){let n=this.constructor.prototype,r=n[e],o=function(){return r.apply(o,arguments)};return Object.setPrototypeOf(o,n),o})});function Ky(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Zy(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Qy(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 hM(e){if(!$s(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function gM(e,t,a){if(!a)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function rf(e){return Iz(e)?e:new Xs(e)}function Iz(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function kz(e){return typeof e=="string"||Lz(e)}function Lz(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var of,Cz,Yy,Jy,yM=I(()=>{"use strict";GA();of=z(eM(),1);tM();rM();fM();mM();Cz={}.hasOwnProperty,Yy=class e extends pM{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=Vy()}copy(){let t=new e,a=-1;for(;++a<this.attachers.length;){let n=this.attachers[a];t.use(...n)}return t.data((0,of.default)(!0,{},this.namespace)),t}data(t,a){return typeof t=="string"?arguments.length===2?(Qy("data",this.frozen),this.namespace[t]=a,this):Cz.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Qy("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;let t=this;for(;++this.freezeIndex<this.attachers.length;){let[a,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=a.call(t,...n);typeof r=="function"&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();let a=rf(t),n=this.parser||this.Parser;return Ky("parse",n),n(String(a),a)}process(t,a){let n=this;return this.freeze(),Ky("process",this.parser||this.Parser),Zy("process",this.compiler||this.Compiler),a?r(void 0,a):new Promise(r);function r(o,l){let i=rf(t),s=n.parse(i);n.run(s,i,function(c,d,f){if(c||!d||!f)return u(c);let p=d,m=n.stringify(p,f);kz(m)?f.value=m:f.result=m,u(c,f)});function u(c,d){c||!d?l(c):o?o(d):a(void 0,d)}}}processSync(t){let a=!1,n;return this.freeze(),Ky("processSync",this.parser||this.Parser),Zy("processSync",this.compiler||this.Compiler),this.process(t,r),gM("processSync","process",a),n;function r(o,l){a=!0,jy(o),n=l}}run(t,a,n){hM(t),this.freeze();let r=this.transformers;return!n&&typeof a=="function"&&(n=a,a=void 0),n?o(void 0,n):new Promise(o);function o(l,i){let s=rf(a);r.run(t,s,u);function u(c,d,f){let p=d||t;c?i(c):l?l(p):n(void 0,p,f)}}}runSync(t,a){let n=!1,r;return this.run(t,a,o),gM("runSync","run",n),r;function o(l,i){jy(l),r=i,n=!0}}stringify(t,a){this.freeze();let n=rf(a),r=this.compiler||this.Compiler;return Zy("stringify",r),hM(t),r(t,n)}use(t,...a){let n=this.attachers,r=this.namespace;if(Qy("use",this.frozen),t!=null)if(typeof t=="function")s(t,a);else if(typeof t=="object")Array.isArray(t)?i(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(u){if(typeof u=="function")s(u,[]);else if(typeof u=="object")if(Array.isArray(u)){let[c,...d]=u;s(c,d)}else l(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function l(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");i(u.plugins),u.settings&&(r.settings=(0,of.default)(!0,r.settings,u.settings))}function i(u){let c=-1;if(u!=null)if(Array.isArray(u))for(;++c<u.length;){let d=u[c];o(d)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function s(u,c){let d=-1,f=-1;for(;++d<n.length;)if(n[d][0]===u){f=d;break}if(f===-1)n.push([u,...c]);else if(c.length>0){let[p,...m]=c,x=n[f][1];$s(x)&&$s(p)&&(p=(0,of.default)(!0,x,p)),n[f]=[u,p,...m]}}}},Jy=new Yy().freeze()});var wM=I(()=>{"use strict";yM()});function nw(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function kM(e){jo=e}function Ne(e,t=""){let a=typeof e=="string"?e:e.source,n={replace:(r,o)=>{let l=typeof o=="string"?o:o.source;return l=l.replace(oa.caret,"$1"),a=a.replace(r,l),n},getRegex:()=>new RegExp(a,t)};return n}function ar(e,t){if(t){if(oa.escapeTest.test(e))return e.replace(oa.escapeReplace,bM)}else if(oa.escapeTestNoEncode.test(e))return e.replace(oa.escapeReplaceNoEncode,bM);return e}function SM(e){try{e=encodeURI(e).replace(oa.percentDecode,"%")}catch{return null}return e}function CM(e,t){let a=e.replace(oa.findPipe,(o,l,i)=>{let s=!1,u=l;for(;--u>=0&&i[u]==="\\";)s=!s;return s?"|":" |"}),n=a.split(oa.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(oa.slashPipe,"|");return n}function Zs(e,t,a){let n=e.length;if(n===0)return"";let r=0;for(;r<n;){let o=e.charAt(n-r-1);if(o===t&&!a)r++;else if(o!==t&&a)r++;else break}return e.slice(0,n-r)}function iq(e,t){if(e.indexOf(t[1])===-1)return-1;let a=0;for(let n=0;n<e.length;n++)if(e[n]==="\\")n++;else if(e[n]===t[0])a++;else if(e[n]===t[1]&&(a--,a<0))return n;return a>0?-2:-1}function IM(e,t,a,n,r){let o=t.href,l=t.title||null,i=e[1].replace(r.other.outputLinkReplace,"$1");n.state.inLink=!0;let s={type:e[0].charAt(0)==="!"?"image":"link",raw:a,href:o,title:l,text:i,tokens:n.inlineTokens(i)};return n.state.inLink=!1,s}function sq(e,t,a){let n=e.match(a.other.indentCodeCompensation);if(n===null)return t;let r=n[1];return t.split(`
|
|
55
|
+
`).map(o=>{let l=o.match(a.other.beginningSpace);if(l===null)return o;let[i]=l;return i.length>=r.length?o.slice(r.length):o}).join(`
|
|
56
|
+
`)}function Je(e,t){return Ho.parse(e,t)}var jo,Ys,Tz,oa,Az,Mz,Ez,Js,Rz,rw,LM,TM,Dz,ow,_z,lw,Oz,Pz,ff,iw,Nz,AM,Bz,sw,xM,Uz,Fz,zz,qz,MM,Hz,pf,uw,EM,jz,RM,Vz,Gz,$z,DM,Wz,Xz,_M,Kz,Zz,Qz,Yz,Jz,eq,tq,uf,aq,OM,PM,nq,vM,cw,rq,ew,oq,lf,Ks,lq,bM,cf,_a,df,dw,on,sf,Qs,uq,Ho,nte,rte,ote,lte,ite,ste,ute,NM=I(()=>{"use strict";jo=nw();Ys={exec:()=>null};Tz=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),oa={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,listReplaceTabs:/^\t+/,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,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,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")},Az=/^(?:[ \t]*(?:\n|$))+/,Mz=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ez=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Js=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Rz=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,rw=/(?:[*+-]|\d{1,9}[.)])/,LM=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,TM=Ne(LM).replace(/bull/g,rw).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(),Dz=Ne(LM).replace(/bull/g,rw).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(),ow=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,_z=/^[^\n]+/,lw=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Oz=Ne(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",lw).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Pz=Ne(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,rw).getRegex(),ff="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",iw=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Nz=Ne("^ {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",iw).replace("tag",ff).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),AM=Ne(ow).replace("hr",Js).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[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ff).getRegex(),Bz=Ne(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",AM).getRegex(),sw={blockquote:Bz,code:Mz,def:Oz,fences:Ez,heading:Rz,hr:Js,html:Nz,lheading:TM,list:Pz,newline:Az,paragraph:AM,table:Ys,text:_z},xM=Ne("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Js).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[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ff).getRegex(),Uz={...sw,lheading:Dz,table:xM,paragraph:Ne(ow).replace("hr",Js).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",xM).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ff).getRegex()},Fz={...sw,html:Ne(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",iw).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:Ys,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ne(ow).replace("hr",Js).replace("heading",` *#{1,6} *[^
|
|
57
|
+
]`).replace("lheading",TM).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},zz=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,qz=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,MM=/^( {2,}|\\)\n(?!\s*$)/,Hz=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,pf=/[\p{P}\p{S}]/u,uw=/[\s\p{P}\p{S}]/u,EM=/[^\s\p{P}\p{S}]/u,jz=Ne(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,uw).getRegex(),RM=/(?!~)[\p{P}\p{S}]/u,Vz=/(?!~)[\s\p{P}\p{S}]/u,Gz=/(?:[^\s\p{P}\p{S}]|~)/u,$z=Ne(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Tz?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),DM=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Wz=Ne(DM,"u").replace(/punct/g,pf).getRegex(),Xz=Ne(DM,"u").replace(/punct/g,RM).getRegex(),_M="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Kz=Ne(_M,"gu").replace(/notPunctSpace/g,EM).replace(/punctSpace/g,uw).replace(/punct/g,pf).getRegex(),Zz=Ne(_M,"gu").replace(/notPunctSpace/g,Gz).replace(/punctSpace/g,Vz).replace(/punct/g,RM).getRegex(),Qz=Ne("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,EM).replace(/punctSpace/g,uw).replace(/punct/g,pf).getRegex(),Yz=Ne(/\\(punct)/,"gu").replace(/punct/g,pf).getRegex(),Jz=Ne(/^<(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(),eq=Ne(iw).replace("(?:-->|$)","-->").getRegex(),tq=Ne("^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",eq).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),uf=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,aq=Ne(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",uf).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),OM=Ne(/^!?\[(label)\]\[(ref)\]/).replace("label",uf).replace("ref",lw).getRegex(),PM=Ne(/^!?\[(ref)\](?:\[\])?/).replace("ref",lw).getRegex(),nq=Ne("reflink|nolink(?!\\()","g").replace("reflink",OM).replace("nolink",PM).getRegex(),vM=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,cw={_backpedal:Ys,anyPunctuation:Yz,autolink:Jz,blockSkip:$z,br:MM,code:qz,del:Ys,emStrongLDelim:Wz,emStrongRDelimAst:Kz,emStrongRDelimUnd:Qz,escape:zz,link:aq,nolink:PM,punctuation:jz,reflink:OM,reflinkSearch:nq,tag:tq,text:Hz,url:Ys},rq={...cw,link:Ne(/^!?\[(label)\]\((.*?)\)/).replace("label",uf).getRegex(),reflink:Ne(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",uf).getRegex()},ew={...cw,emStrongRDelimAst:Zz,emStrongLDelim:Xz,url:Ne(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",vM).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:Ne(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",vM).getRegex()},oq={...ew,br:Ne(MM).replace("{2,}","*").getRegex(),text:Ne(ew.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},lf={normal:sw,gfm:Uz,pedantic:Fz},Ks={normal:cw,gfm:ew,breaks:oq,pedantic:rq},lq={"&":"&","<":"<",">":">",'"':""","'":"'"},bM=e=>lq[e];cf=class{constructor(e){Z(this,"options");Z(this,"rules");Z(this,"lexer");this.options=e||jo}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 a=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?a:Zs(a,`
|
|
58
|
+
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let a=t[0],n=sq(a,t[3]||"",this.rules);return{type:"code",raw:a,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let a=t[2].trim();if(this.rules.other.endingHash.test(a)){let n=Zs(a,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(a=n.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:a,tokens:this.lexer.inline(a)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Zs(t[0],`
|
|
59
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let a=Zs(t[0],`
|
|
60
60
|
`).split(`
|
|
61
|
-
`),n="",r="",o=[];for(;a.length>0;){let
|
|
61
|
+
`),n="",r="",o=[];for(;a.length>0;){let l=!1,i=[],s;for(s=0;s<a.length;s++)if(this.rules.other.blockquoteStart.test(a[s]))i.push(a[s]),l=!0;else if(!l)i.push(a[s]);else break;a=a.slice(s);let u=i.join(`
|
|
62
62
|
`),c=u.replace(this.rules.other.blockquoteSetextReplace,`
|
|
63
63
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}
|
|
64
64
|
${u}`:u,r=r?`${r}
|
|
@@ -67,75 +67,75 @@ ${c}`:c;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
67
67
|
`),x=this.blockquote(m);o[o.length-1]=x,n=n.substring(0,n.length-p.raw.length)+x.raw,r=r.substring(0,r.length-p.text.length)+x.text;break}else if(f?.type==="list"){let p=f,m=p.raw+`
|
|
68
68
|
`+a.join(`
|
|
69
69
|
`),x=this.list(m);o[o.length-1]=x,n=n.substring(0,n.length-f.raw.length)+x.raw,r=r.substring(0,r.length-p.raw.length)+x.raw,a=m.substring(o.at(-1).raw.length).split(`
|
|
70
|
-
`);continue}}return{type:"blockquote",raw:n,tokens:o,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let a=t[1].trim(),n=a.length>1,r={type:"list",raw:"",ordered:n,start:n?+a.slice(0,-1):"",loose:!1,items:[]};a=n?`\\d{1,9}\\${a.slice(-1)}`:`\\${a}`,this.options.pedantic&&(a=n?a:"[*+-]");let o=this.rules.other.listItemRegex(a),
|
|
70
|
+
`);continue}}return{type:"blockquote",raw:n,tokens:o,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let a=t[1].trim(),n=a.length>1,r={type:"list",raw:"",ordered:n,start:n?+a.slice(0,-1):"",loose:!1,items:[]};a=n?`\\d{1,9}\\${a.slice(-1)}`:`\\${a}`,this.options.pedantic&&(a=n?a:"[*+-]");let o=this.rules.other.listItemRegex(a),l=!1;for(;e;){let s=!1,u="",c="";if(!(t=o.exec(e))||this.rules.block.hr.test(e))break;u=t[0],e=e.substring(u.length);let d=t[2].split(`
|
|
71
71
|
`,1)[0].replace(this.rules.other.listReplaceTabs,x=>" ".repeat(3*x.length)),f=e.split(`
|
|
72
72
|
`,1)[0],p=!d.trim(),m=0;if(this.options.pedantic?(m=2,c=d.trimStart()):p?m=t[1].length+1:(m=t[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,c=d.slice(m),m+=t[1].length),p&&this.rules.other.blankLine.test(f)&&(u+=f+`
|
|
73
|
-
`,e=e.substring(f.length+1),s=!0),!s){let x=this.rules.other.nextBulletRegex(m),
|
|
74
|
-
`,1)[0],
|
|
75
|
-
`+
|
|
76
|
-
`+f}!p&&!f.trim()&&(p=!0),u+=
|
|
77
|
-
`,e=e.substring(
|
|
78
|
-
`):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(a.length===n.length){for(let
|
|
79
|
-
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:a,tokens:this.lexer.inline(a)}}}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 a=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(a)){if(!this.rules.other.endAngleBracket.test(a))return;let o=
|
|
80
|
-
`),this.blockTokens(t,this.tokens);for(let a=0;a<this.inlineQueue.length;a++){let n=this.inlineQueue[a];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,a=[],n=!1){for(this.options.pedantic&&(t=t.replace(oa.tabCharGlobal," ").replace(oa.spaceLine,""));t;){let r;if(this.options.extensions?.block?.some(
|
|
81
|
-
`:a.push(r);continue}if(r=this.tokenizer.code(t)){t=t.substring(r.raw.length);let
|
|
73
|
+
`,e=e.substring(f.length+1),s=!0),!s){let x=this.rules.other.nextBulletRegex(m),v=this.rules.other.hrRegex(m),y=this.rules.other.fencesBeginRegex(m),w=this.rules.other.headingBeginRegex(m),g=this.rules.other.htmlBeginRegex(m);for(;e;){let C=e.split(`
|
|
74
|
+
`,1)[0],A;if(f=C,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),A=f):A=f.replace(this.rules.other.tabCharGlobal," "),y.test(f)||w.test(f)||g.test(f)||x.test(f)||v.test(f))break;if(A.search(this.rules.other.nonSpaceChar)>=m||!f.trim())c+=`
|
|
75
|
+
`+A.slice(m);else{if(p||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||y.test(d)||w.test(d)||v.test(d))break;c+=`
|
|
76
|
+
`+f}!p&&!f.trim()&&(p=!0),u+=C+`
|
|
77
|
+
`,e=e.substring(C.length+1),d=A.slice(m)}}r.loose||(l?r.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(l=!0)),r.items.push({type:"list_item",raw:u,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]}),r.raw+=u}let i=r.items.at(-1);if(i)i.raw=i.raw.trimEnd(),i.text=i.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let s of r.items){if(this.lexer.state.top=!1,s.tokens=this.lexer.blockTokens(s.text,[]),s.task){if(s.text=s.text.replace(this.rules.other.listReplaceTask,""),s.tokens[0]?.type==="text"||s.tokens[0]?.type==="paragraph"){s.tokens[0].raw=s.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),s.tokens[0].text=s.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let c=this.lexer.inlineQueue.length-1;c>=0;c--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[c].src)){this.lexer.inlineQueue[c].src=this.lexer.inlineQueue[c].src.replace(this.rules.other.listReplaceTask,"");break}}let u=this.rules.other.listTaskCheckbox.exec(s.raw);if(u){let c={type:"checkbox",raw:u[0]+" ",checked:u[0]!=="[ ]"};s.checked=c.checked,r.loose?s.tokens[0]&&["paragraph","text"].includes(s.tokens[0].type)&&"tokens"in s.tokens[0]&&s.tokens[0].tokens?(s.tokens[0].raw=c.raw+s.tokens[0].raw,s.tokens[0].text=c.raw+s.tokens[0].text,s.tokens[0].tokens.unshift(c)):s.tokens.unshift({type:"paragraph",raw:c.raw,text:c.raw,tokens:[c]}):s.tokens.unshift(c)}}if(!r.loose){let u=s.tokens.filter(d=>d.type==="space"),c=u.length>0&&u.some(d=>this.rules.other.anyLine.test(d.raw));r.loose=c}}if(r.loose)for(let s of r.items){s.loose=!0;for(let u of s.tokens)u.type==="text"&&(u.type="paragraph")}return r}}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 a=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:a,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let a=CM(t[1]),n=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
78
|
+
`):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(a.length===n.length){for(let l of n)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<a.length;l++)o.header.push({text:a[l],tokens:this.lexer.inline(a[l]),header:!0,align:o.align[l]});for(let l of r)o.rows.push(CM(l,o.header.length).map((i,s)=>({text:i,tokens:this.lexer.inline(i),header:!1,align:o.align[s]})));return o}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let a=t[1].charAt(t[1].length-1)===`
|
|
79
|
+
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:a,tokens:this.lexer.inline(a)}}}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 a=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(a)){if(!this.rules.other.endAngleBracket.test(a))return;let o=Zs(a.slice(0,-1),"\\");if((a.length-o.length)%2===0)return}else{let o=iq(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 n=t[2],r="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(n);o&&(n=o[1],r=o[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(a)?n=n.slice(1):n=n.slice(1,-1)),IM(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let a;if((a=this.rules.inline.reflink.exec(e))||(a=this.rules.inline.nolink.exec(e))){let n=(a[2]||a[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=t[n.toLowerCase()];if(!r){let o=a[0].charAt(0);return{type:"text",raw:o,text:o}}return IM(a,r,a[0],this.lexer,this.rules)}}emStrong(e,t,a=""){let n=this.rules.inline.emStrongLDelim.exec(e);if(!(!n||n[3]&&a.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[2])||!a||this.rules.inline.punctuation.exec(a))){let r=[...n[0]].length-1,o,l,i=r,s=0,u=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,t=t.slice(-1*e.length+r);(n=u.exec(t))!=null;){if(o=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!o)continue;if(l=[...o].length,n[3]||n[4]){i+=l;continue}else if((n[5]||n[6])&&r%3&&!((r+l)%3)){s+=l;continue}if(i-=l,i>0)continue;l=Math.min(l,l+i+s);let c=[...n[0]][0].length,d=e.slice(0,r+n.index+c+l);if(Math.min(r,l)%2){let p=d.slice(1,-1);return{type:"em",raw:d,text:p,tokens:this.lexer.inlineTokens(p)}}let f=d.slice(2,-2);return{type:"strong",raw:d,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let a=t[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(a),r=this.rules.other.startingSpaceChar.test(a)&&this.rules.other.endingSpaceChar.test(a);return n&&r&&(a=a.substring(1,a.length-1)),{type:"codespan",raw:t[0],text:a}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let a,n;return t[2]==="@"?(a=t[1],n="mailto:"+a):(a=t[1],n=a),{type:"link",raw:t[0],text:a,href:n,tokens:[{type:"text",raw:a,text:a}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let a,n;if(t[2]==="@")a=t[0],n="mailto:"+a;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(r!==t[0]);a=t[0],t[1]==="www."?n="http://"+t[0]:n=t[0]}return{type:"link",raw:t[0],text:a,href:n,tokens:[{type:"text",raw:a,text:a}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let a=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:a}}}},_a=class tw{constructor(t){Z(this,"tokens");Z(this,"options");Z(this,"state");Z(this,"inlineQueue");Z(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||jo,this.options.tokenizer=this.options.tokenizer||new cf,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 a={other:oa,block:lf.normal,inline:Ks.normal};this.options.pedantic?(a.block=lf.pedantic,a.inline=Ks.pedantic):this.options.gfm&&(a.block=lf.gfm,this.options.breaks?a.inline=Ks.breaks:a.inline=Ks.gfm),this.tokenizer.rules=a}static get rules(){return{block:lf,inline:Ks}}static lex(t,a){return new tw(a).lex(t)}static lexInline(t,a){return new tw(a).inlineTokens(t)}lex(t){t=t.replace(oa.carriageReturn,`
|
|
80
|
+
`),this.blockTokens(t,this.tokens);for(let a=0;a<this.inlineQueue.length;a++){let n=this.inlineQueue[a];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,a=[],n=!1){for(this.options.pedantic&&(t=t.replace(oa.tabCharGlobal," ").replace(oa.spaceLine,""));t;){let r;if(this.options.extensions?.block?.some(l=>(r=l.call({lexer:this},t,a))?(t=t.substring(r.raw.length),a.push(r),!0):!1))continue;if(r=this.tokenizer.space(t)){t=t.substring(r.raw.length);let l=a.at(-1);r.raw.length===1&&l!==void 0?l.raw+=`
|
|
81
|
+
`:a.push(r);continue}if(r=this.tokenizer.code(t)){t=t.substring(r.raw.length);let l=a.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
|
|
82
82
|
`)?"":`
|
|
83
|
-
`)+r.raw,
|
|
84
|
-
`+r.text,this.inlineQueue.at(-1).src=
|
|
83
|
+
`)+r.raw,l.text+=`
|
|
84
|
+
`+r.text,this.inlineQueue.at(-1).src=l.text):a.push(r);continue}if(r=this.tokenizer.fences(t)){t=t.substring(r.raw.length),a.push(r);continue}if(r=this.tokenizer.heading(t)){t=t.substring(r.raw.length),a.push(r);continue}if(r=this.tokenizer.hr(t)){t=t.substring(r.raw.length),a.push(r);continue}if(r=this.tokenizer.blockquote(t)){t=t.substring(r.raw.length),a.push(r);continue}if(r=this.tokenizer.list(t)){t=t.substring(r.raw.length),a.push(r);continue}if(r=this.tokenizer.html(t)){t=t.substring(r.raw.length),a.push(r);continue}if(r=this.tokenizer.def(t)){t=t.substring(r.raw.length);let l=a.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
|
|
85
85
|
`)?"":`
|
|
86
|
-
`)+r.raw,
|
|
87
|
-
`+r.raw,this.inlineQueue.at(-1).src=
|
|
86
|
+
`)+r.raw,l.text+=`
|
|
87
|
+
`+r.raw,this.inlineQueue.at(-1).src=l.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},a.push(r));continue}if(r=this.tokenizer.table(t)){t=t.substring(r.raw.length),a.push(r);continue}if(r=this.tokenizer.lheading(t)){t=t.substring(r.raw.length),a.push(r);continue}let o=t;if(this.options.extensions?.startBlock){let l=1/0,i=t.slice(1),s;this.options.extensions.startBlock.forEach(u=>{s=u.call({lexer:this},i),typeof s=="number"&&s>=0&&(l=Math.min(l,s))}),l<1/0&&l>=0&&(o=t.substring(0,l+1))}if(this.state.top&&(r=this.tokenizer.paragraph(o))){let l=a.at(-1);n&&l?.type==="paragraph"?(l.raw+=(l.raw.endsWith(`
|
|
88
88
|
`)?"":`
|
|
89
|
-
`)+r.raw,
|
|
90
|
-
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=
|
|
89
|
+
`)+r.raw,l.text+=`
|
|
90
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):a.push(r),n=o.length!==t.length,t=t.substring(r.raw.length);continue}if(r=this.tokenizer.text(t)){t=t.substring(r.raw.length);let l=a.at(-1);l?.type==="text"?(l.raw+=(l.raw.endsWith(`
|
|
91
91
|
`)?"":`
|
|
92
|
-
`)+r.raw,
|
|
93
|
-
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=
|
|
94
|
-
`;return n?'<pre><code class="language-'+
|
|
95
|
-
`:"<pre><code>"+(a?r:
|
|
92
|
+
`)+r.raw,l.text+=`
|
|
93
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):a.push(r);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,a}inline(t,a=[]){return this.inlineQueue.push({src:t,tokens:a}),a}inlineTokens(t,a=[]){let n=t,r=null;if(this.tokens.links){let s=Object.keys(this.tokens.links);if(s.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)s.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,r.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let o;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)o=r[2]?r[2].length:0,n=n.slice(0,r.index+o)+"["+"a".repeat(r[0].length-o-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let l=!1,i="";for(;t;){l||(i=""),l=!1;let s;if(this.options.extensions?.inline?.some(c=>(s=c.call({lexer:this},t,a))?(t=t.substring(s.raw.length),a.push(s),!0):!1))continue;if(s=this.tokenizer.escape(t)){t=t.substring(s.raw.length),a.push(s);continue}if(s=this.tokenizer.tag(t)){t=t.substring(s.raw.length),a.push(s);continue}if(s=this.tokenizer.link(t)){t=t.substring(s.raw.length),a.push(s);continue}if(s=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(s.raw.length);let c=a.at(-1);s.type==="text"&&c?.type==="text"?(c.raw+=s.raw,c.text+=s.text):a.push(s);continue}if(s=this.tokenizer.emStrong(t,n,i)){t=t.substring(s.raw.length),a.push(s);continue}if(s=this.tokenizer.codespan(t)){t=t.substring(s.raw.length),a.push(s);continue}if(s=this.tokenizer.br(t)){t=t.substring(s.raw.length),a.push(s);continue}if(s=this.tokenizer.del(t)){t=t.substring(s.raw.length),a.push(s);continue}if(s=this.tokenizer.autolink(t)){t=t.substring(s.raw.length),a.push(s);continue}if(!this.state.inLink&&(s=this.tokenizer.url(t))){t=t.substring(s.raw.length),a.push(s);continue}let u=t;if(this.options.extensions?.startInline){let c=1/0,d=t.slice(1),f;this.options.extensions.startInline.forEach(p=>{f=p.call({lexer:this},d),typeof f=="number"&&f>=0&&(c=Math.min(c,f))}),c<1/0&&c>=0&&(u=t.substring(0,c+1))}if(s=this.tokenizer.inlineText(u)){t=t.substring(s.raw.length),s.raw.slice(-1)!=="_"&&(i=s.raw.slice(-1)),l=!0;let c=a.at(-1);c?.type==="text"?(c.raw+=s.raw,c.text+=s.text):a.push(s);continue}if(t){let c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return a}},df=class{constructor(e){Z(this,"options");Z(this,"parser");this.options=e||jo}space(e){return""}code({text:e,lang:t,escaped:a}){let n=(t||"").match(oa.notSpaceStart)?.[0],r=e.replace(oa.endingNewline,"")+`
|
|
94
|
+
`;return n?'<pre><code class="language-'+ar(n)+'">'+(a?r:ar(r,!0))+`</code></pre>
|
|
95
|
+
`:"<pre><code>"+(a?r:ar(r,!0))+`</code></pre>
|
|
96
96
|
`}blockquote({tokens:e}){return`<blockquote>
|
|
97
97
|
${this.parser.parse(e)}</blockquote>
|
|
98
98
|
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
99
99
|
`}hr(e){return`<hr>
|
|
100
|
-
`}list(e){let t=e.ordered,a=e.start,n="";for(let
|
|
100
|
+
`}list(e){let t=e.ordered,a=e.start,n="";for(let l=0;l<e.items.length;l++){let i=e.items[l];n+=this.listitem(i)}let r=t?"ol":"ul",o=t&&a!==1?' start="'+a+'"':"";return"<"+r+o+`>
|
|
101
101
|
`+n+"</"+r+`>
|
|
102
102
|
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
103
103
|
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
104
|
-
`}table(e){let t="",a="";for(let r=0;r<e.header.length;r++)a+=this.tablecell(e.header[r]);t+=this.tablerow({text:a});let n="";for(let r=0;r<e.rows.length;r++){let o=e.rows[r];a="";for(let
|
|
104
|
+
`}table(e){let t="",a="";for(let r=0;r<e.header.length;r++)a+=this.tablecell(e.header[r]);t+=this.tablerow({text:a});let n="";for(let r=0;r<e.rows.length;r++){let o=e.rows[r];a="";for(let l=0;l<o.length;l++)a+=this.tablecell(o[l]);n+=this.tablerow({text:a})}return n&&(n=`<tbody>${n}</tbody>`),`<table>
|
|
105
105
|
<thead>
|
|
106
106
|
`+t+`</thead>
|
|
107
107
|
`+n+`</table>
|
|
108
108
|
`}tablerow({text:e}){return`<tr>
|
|
109
109
|
${e}</tr>
|
|
110
110
|
`}tablecell(e){let t=this.parser.parseInline(e.tokens),a=e.header?"th":"td";return(e.align?`<${a} align="${e.align}">`:`<${a}>`)+t+`</${a}>
|
|
111
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${
|
|
112
|
-
Please report this to https://github.com/markedjs/marked.`,e){let n="<p>An error occurred:</p><pre>"+
|
|
113
|
-
`).map(c=>[{content:c,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[e]),[s,u]=(0,sn.useState)(l);return(0,sn.useEffect)(()=>{if(!i){u(l);return}let c=i.highlight({code:e,language:t,themes:o},d=>{u(d)});if(c){u(c);return}u(l)},[e,t,o,i,l]),(0,ya.jsx)(Sw.Provider,{value:{code:e},children:(0,ya.jsxs)(Lq,{language:t,children:[(0,ya.jsx)(Tq,{language:t,children:n}),(0,ya.jsx)(kq,{className:a,language:t,result:s,...r})]})})}});var JM={};ku(JM,{Mermaid:()=>Iw});var eA=C(()=>{"use strict";"use client";wf()});function Dq(e={}){let{immediate:t=!1,debounceDelay:a=Mq,rootMargin:n=Aq,idleTimeout:r=Rq}=e,[o,i]=(0,D.useState)(!1),l=(0,D.useRef)(null),s=(0,D.useRef)(null),u=(0,D.useRef)(null),c=(0,D.useMemo)(()=>p=>{let m=Date.now();return window.setTimeout(()=>{p({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-m))})},1)},[]),d=(0,D.useMemo)(()=>typeof window<"u"&&window.requestIdleCallback?(p,m)=>window.requestIdleCallback(p,m):c,[c]),f=(0,D.useMemo)(()=>typeof window<"u"&&window.cancelIdleCallback?p=>window.cancelIdleCallback(p):p=>{clearTimeout(p)},[]);return(0,D.useEffect)(()=>{if(t){i(!0);return}let p=l.current;if(!p)return;s.current&&(clearTimeout(s.current),s.current=null),u.current&&(f(u.current),u.current=null);let m=()=>{s.current&&(clearTimeout(s.current),s.current=null),u.current&&(f(u.current),u.current=null)},x=g=>{u.current=d(b=>{b.timeRemaining()>0||b.didTimeout?(i(!0),g.disconnect()):u.current=d(()=>{i(!0),g.disconnect()},{timeout:r/2})},{timeout:r})},I=g=>{m(),s.current=window.setTimeout(()=>{var b,T;let S=g.takeRecords();(S.length===0||(T=(b=S.at(-1))==null?void 0:b.isIntersecting)!=null&&T)&&x(g)},a)},y=(g,b)=>{g.isIntersecting?I(b):m()},w=new IntersectionObserver(g=>{for(let b of g)y(b,w)},{rootMargin:n,threshold:0});return w.observe(p),()=>{s.current&&clearTimeout(s.current),u.current&&f(u.current),w.disconnect()}},[t,a,n,r,f,d]),{shouldRender:o,containerRef:l}}function Sf(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 a=e.position.start,n=t.position.start,r=e.position.end,o=t.position.end;return a?.line===n?.line&&a?.column===n?.column&&r?.line===o?.line&&r?.column===o?.column}function vt(e,t){return e.className===t.className&&Sf(e.node,t.node)}var D,E,Mq,Aq,Rq,Mw,Aw,bf,_q,Oq,Pq,sA,tA,Nq,Bq,re,Ji,Sw,uA,aA,nA,Uq,rA,Fq,zq,nu,qq,Hq,jq,Tw,cA,YM,Rw,Vq,Gq,ru,Wq,$q,Xq,dA,fA,Kq,Cw,Zq,Qq,Yq,Jq,e5,t5,a5,Ew,xf,Dw,pA,mA,hA,gA,n5,yA,wA,xA,vA,bA,SA,IA,CA,kA,LA,TA,EA,MA,AA,RA,DA,_A,r5,OA,PA,NA,o5,oA,iA,vf,i5,lA,BA,l5,s5,u5,c5,d5,f5,p5,kw,m5,Lw,UA,FA,zA,h5,g5,y5,w5,ia,_w,x5,el,v5,Iw,wf=C(()=>{"use strict";"use client";D=z(Le(),1);yC();xC();UC();yL();RL();E=z(ne(),1);tg();ng();IT();ZT();nM();RM();KM();Mq=300,Aq="300px",Rq=500;Mw=e=>(0,E.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,E.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"})}),Aw=e=>(0,E.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,E.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"})}),bf=e=>(0,E.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,E.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"})}),_q=e=>(0,E.jsxs)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:[(0,E.jsx)("path",{d:"M8 0V4",stroke:"currentColor",strokeWidth:"1.5"}),(0,E.jsx)("path",{d:"M8 16V12",opacity:"0.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,E.jsx)("path",{d:"M3.29773 1.52783L5.64887 4.7639",opacity:"0.9",stroke:"currentColor",strokeWidth:"1.5"}),(0,E.jsx)("path",{d:"M12.7023 1.52783L10.3511 4.7639",opacity:"0.1",stroke:"currentColor",strokeWidth:"1.5"}),(0,E.jsx)("path",{d:"M12.7023 14.472L10.3511 11.236",opacity:"0.4",stroke:"currentColor",strokeWidth:"1.5"}),(0,E.jsx)("path",{d:"M3.29773 14.472L5.64887 11.236",opacity:"0.6",stroke:"currentColor",strokeWidth:"1.5"}),(0,E.jsx)("path",{d:"M15.6085 5.52783L11.8043 6.7639",opacity:"0.2",stroke:"currentColor",strokeWidth:"1.5"}),(0,E.jsx)("path",{d:"M0.391602 10.472L4.19583 9.23598",opacity:"0.7",stroke:"currentColor",strokeWidth:"1.5"}),(0,E.jsx)("path",{d:"M15.6085 10.4722L11.8043 9.2361",opacity:"0.3",stroke:"currentColor",strokeWidth:"1.5"}),(0,E.jsx)("path",{d:"M0.391602 5.52783L4.19583 6.7639",opacity:"0.8",stroke:"currentColor",strokeWidth:"1.5"})]}),Oq=e=>(0,E.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,E.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"})}),Pq=e=>(0,E.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,E.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"})}),sA=e=>(0,E.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,E.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"})}),tA=e=>(0,E.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,E.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"})}),Nq=e=>(0,E.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,E.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"})}),Bq=e=>(0,E.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,E.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"})}),re=(...e)=>ag(ud(e)),Ji=(e,t,a)=>{let n=typeof t=="string"?new Blob([t],{type:a}):t,r=URL.createObjectURL(n),o=document.createElement("a");o.href=r,o.download=e,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(r)},Sw=(0,D.createContext)({code:""}),uA=()=>(0,D.useContext)(Sw),aA=({onCopy:e,onError:t,timeout:a=2e3,children:n,className:r,code:o,...i})=>{let[l,s]=(0,D.useState)(!1),u=(0,D.useRef)(0),{code:c}=uA(),{isAnimating:d}=(0,D.useContext)(ia),f=o??c,p=async()=>{var x;if(typeof window>"u"||!((x=navigator?.clipboard)!=null&&x.writeText)){t?.(new Error("Clipboard API not available"));return}try{l||(await navigator.clipboard.writeText(f),s(!0),e?.(),u.current=window.setTimeout(()=>s(!1),a))}catch(I){t?.(I)}};(0,D.useEffect)(()=>()=>{window.clearTimeout(u.current)},[]);let m=l?Mw:Aw;return(0,E.jsx)("button",{className:re("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",r),"data-streamdown":"code-block-copy-button",disabled:d,onClick:p,title:"Copy Code",type:"button",...i,children:n??(0,E.jsx)(m,{size:14})})},nA={"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",\u6587\u8A00:"wy"},Uq=({onDownload:e,onError:t,language:a,children:n,className:r,code:o,...i})=>{let{code:l}=uA(),{isAnimating:s}=(0,D.useContext)(ia),u=o??l,c=`file.${a&&a in nA?nA[a]:"txt"}`,d="text/plain",f=()=>{try{Ji(c,u,d),e?.()}catch(p){t?.(p)}};return(0,E.jsx)("button",{className:re("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",r),"data-streamdown":"code-block-download-button",disabled:s,onClick:f,title:"Download file",type:"button",...i,children:n??(0,E.jsx)(bf,{size:14})})},rA=()=>(0,E.jsxs)("div",{className:"w-full divide-y divide-border overflow-hidden rounded-xl border border-border",children:[(0,E.jsx)("div",{className:"h-[46px] w-full bg-muted/80"}),(0,E.jsx)("div",{className:"flex w-full items-center justify-center p-4",children:(0,E.jsx)(_q,{className:"size-4 animate-spin"})})]}),Fq=/\.[^/.]+$/,zq=({node:e,className:t,src:a,alt:n,...r})=>{let o=async()=>{if(a)try{let i=await(await fetch(a)).blob(),l=new URL(a,window.location.origin).pathname.split("/").pop()||"",s=l.split(".").pop(),u=l.includes(".")&&s!==void 0&&s.length<=4,c="";if(u)c=l;else{let d=i.type,f="png";d.includes("jpeg")||d.includes("jpg")?f="jpg":d.includes("png")?f="png":d.includes("svg")?f="svg":d.includes("gif")?f="gif":d.includes("webp")&&(f="webp"),c=`${(n||l||"image").replace(Fq,"")}.${f}`}Ji(c,i,i.type)}catch{window.open(a,"_blank")}};return a?(0,E.jsxs)("div",{className:"group relative my-4 inline-block","data-streamdown":"image-wrapper",children:[(0,E.jsx)("img",{alt:n,className:re("max-w-full rounded-lg",t),"data-streamdown":"image",src:a,...r}),(0,E.jsx)("div",{className:"pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block"}),(0,E.jsx)("button",{className:re("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:o,title:"Download image",type:"button",children:(0,E.jsx)(bf,{size:14})})]}):null},nu=0,qq=()=>{nu+=1,nu===1&&(document.body.style.overflow="hidden")},Hq=()=>{nu=Math.max(0,nu-1),nu===0&&(document.body.style.overflow="")},jq=({url:e,isOpen:t,onClose:a,onConfirm:n})=>{let[r,o]=(0,D.useState)(!1),i=(0,D.useCallback)(async()=>{try{await navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!1),2e3)}catch{}},[e]),l=(0,D.useCallback)(()=>{n(),a()},[n,a]);return(0,D.useEffect)(()=>{if(t){qq();let s=u=>{u.key==="Escape"&&a()};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s),Hq()}}},[t,a]),t?(0,E.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm","data-streamdown":"link-safety-modal",onClick:a,onKeyDown:s=>{s.key==="Escape"&&a()},role:"button",tabIndex:0,children:(0,E.jsxs)("div",{className:"relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg",onClick:s=>s.stopPropagation(),onKeyDown:s=>s.stopPropagation(),role:"presentation",children:[(0,E.jsx)("button",{className:"absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground",onClick:a,title:"Close",type:"button",children:(0,E.jsx)(sA,{size:16})}),(0,E.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,E.jsxs)("div",{className:"flex items-center gap-2 font-semibold text-lg",children:[(0,E.jsx)(tA,{size:20}),(0,E.jsx)("span",{children:"Open external link?"})]}),(0,E.jsx)("p",{className:"text-muted-foreground text-sm",children:"You're about to visit an external website."})]}),(0,E.jsx)("div",{className:re("break-all rounded-md bg-muted p-3 font-mono text-sm",e.length>100&&"max-h-32 overflow-y-auto"),children:e}),(0,E.jsxs)("div",{className:"flex gap-2",children:[(0,E.jsx)("button",{className:"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:i,type:"button",children:r?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(Mw,{size:14}),(0,E.jsx)("span",{children:"Copied"})]}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(Aw,{size:14}),(0,E.jsx)("span",{children:"Copy link"})]})}),(0,E.jsxs)("button",{className:"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:l,type:"button",children:[(0,E.jsx)(tA,{size:14}),(0,E.jsx)("span",{children:"Open link"})]})]})]})}):null},Tw=(0,D.createContext)(null),cA=()=>(0,D.useContext)(Tw),YM=()=>{var e;let t=cA();return(e=t?.code)!=null?e:null},Rw=()=>{var e;let t=cA();return(e=t?.mermaid)!=null?e:null},Vq=(e,t)=>{var a;let n=(a=void 0)!=null?a:5;return new Promise((r,o)=>{let i="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(e))),l=new Image;l.crossOrigin="anonymous",l.onload=()=>{let s=document.createElement("canvas"),u=l.width*n,c=l.height*n;s.width=u,s.height=c;let d=s.getContext("2d");if(!d){o(new Error("Failed to create 2D canvas context for PNG export"));return}d.drawImage(l,0,0,u,c),s.toBlob(f=>{if(!f){o(new Error("Failed to create PNG blob"));return}r(f)},"image/png")},l.onerror=()=>o(new Error("Failed to load SVG image")),l.src=i})},Gq=({chart:e,children:t,className:a,onDownload:n,config:r,onError:o})=>{let[i,l]=(0,D.useState)(!1),s=(0,D.useRef)(null),{isAnimating:u}=(0,D.useContext)(ia),c=Rw(),d=async f=>{try{if(f==="mmd"){Ji("diagram.mmd",e,"text/plain"),l(!1),n?.(f);return}if(!c){o?.(new Error("Mermaid plugin not available"));return}let p=c.getMermaid(r),m=e.split("").reduce((y,w)=>(y<<5)-y+w.charCodeAt(0)|0,0),x=`mermaid-${Math.abs(m)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:I}=await p.render(x,e);if(!I){o?.(new Error("SVG not found. Please wait for the diagram to render."));return}if(f==="svg"){Ji("diagram.svg",I,"image/svg+xml"),l(!1),n?.(f);return}if(f==="png"){let y=await Vq(I);Ji("diagram.png",y,"image/png"),n?.(f),l(!1);return}}catch(p){o?.(p)}};return(0,D.useEffect)(()=>{let f=p=>{let m=p.composedPath();s.current&&!m.includes(s.current)&&l(!1)};return document.addEventListener("mousedown",f),()=>{document.removeEventListener("mousedown",f)}},[]),(0,E.jsxs)("div",{className:"relative",ref:s,children:[(0,E.jsx)("button",{className:re("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",a),disabled:u,onClick:()=>l(!i),title:"Download diagram",type:"button",children:t??(0,E.jsx)(bf,{size:14})}),i?(0,E.jsxs)("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[(0,E.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>d("svg"),title:"Download diagram as SVG",type:"button",children:"SVG"}),(0,E.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>d("png"),title:"Download diagram as PNG",type:"button",children:"PNG"}),(0,E.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>d("mmd"),title:"Download diagram as MMD",type:"button",children:"MMD"})]}):null]})},ru=0,Wq=()=>{ru+=1,ru===1&&(document.body.style.overflow="hidden")},$q=()=>{ru=Math.max(0,ru-1),ru===0&&(document.body.style.overflow="")},Xq=({chart:e,config:t,onFullscreen:a,onExit:n,className:r,...o})=>{let[i,l]=(0,D.useState)(!1),{isAnimating:s,controls:u}=(0,D.useContext)(ia),c=(()=>{if(typeof u=="boolean")return u;let f=u.mermaid;return f===!1?!1:f===!0||f===void 0?!0:f.panZoom!==!1})(),d=()=>{l(!i)};return(0,D.useEffect)(()=>{if(i){Wq();let f=p=>{p.key==="Escape"&&l(!1)};return document.addEventListener("keydown",f),()=>{document.removeEventListener("keydown",f),$q()}}},[i]),(0,D.useEffect)(()=>{i?a?.():n&&n()},[i,a,n]),(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("button",{className:re("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",r),disabled:s,onClick:d,title:"View fullscreen",type:"button",...o,children:(0,E.jsx)(Oq,{size:14})}),i?(0,E.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm",onClick:d,onKeyDown:f=>{f.key==="Escape"&&d()},role:"button",tabIndex:0,children:[(0,E.jsx)("button",{className:"absolute top-4 right-4 z-10 rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground",onClick:d,title:"Exit fullscreen",type:"button",children:(0,E.jsx)(sA,{size:20})}),(0,E.jsx)("div",{className:"flex size-full items-center justify-center p-4",onClick:f=>f.stopPropagation(),onKeyDown:f=>f.stopPropagation(),role:"presentation",children:(0,E.jsx)(Iw,{chart:e,className:"size-full [&_svg]:h-auto [&_svg]:w-auto",config:t,fullscreen:!0,showControls:c})})]}):null]})},dA=e=>{var t,a;let n=[],r=[],o=e.querySelectorAll("thead th");for(let l of o)n.push(((t=l.textContent)==null?void 0:t.trim())||"");let i=e.querySelectorAll("tbody tr");for(let l of i){let s=[],u=l.querySelectorAll("td");for(let c of u)s.push(((a=c.textContent)==null?void 0:a.trim())||"");r.push(s)}return{headers:n,rows:r}},fA=e=>{let{headers:t,rows:a}=e,n=l=>{let s=!1,u=!1;for(let c of l){if(c==='"'){s=!0,u=!0;break}(c===","||c===`
|
|
114
|
-
`)&&(s=!0)}return s?u?`"${
|
|
115
|
-
`)},
|
|
116
|
-
`||c==="\r"){s=!0;break}if(!s)return
|
|
117
|
-
`?u.push("\\n"):c==="\r"?u.push("\\r"):u.push(c);return u.join("")},r=t.length>0?a.length+1:a.length,o=new Array(r),
|
|
118
|
-
`)},
|
|
119
|
-
`)},Qq=({children:e,className:t,onCopy:a,onError:n,timeout:r=2e3})=>{let[o,i]=(0,D.useState)(!1),[l,s]=(0,D.useState)(!1),u=(0,D.useRef)(null),c=(0,D.useRef)(0),{isAnimating:d}=(0,D.useContext)(ia),f=async m=>{var x,I;if(typeof window>"u"||!((x=navigator?.clipboard)!=null&&x.write)){n?.(new Error("Clipboard API not available"));return}try{let y=(I=u.current)==null?void 0:I.closest('[data-streamdown="table-wrapper"]'),w=y?.querySelector("table");if(!w){n?.(new Error("Table not found"));return}let g=dA(w),b=m==="csv"?fA(g):Kq(g),T=new ClipboardItem({"text/plain":new Blob([b],{type:"text/plain"}),"text/html":new Blob([w.outerHTML],{type:"text/html"})});await navigator.clipboard.write([T]),s(!0),i(!1),a?.(m),c.current=window.setTimeout(()=>s(!1),r)}catch(y){n?.(y)}};(0,D.useEffect)(()=>{let m=x=>{let I=x.composedPath();u.current&&!I.includes(u.current)&&i(!1)};return document.addEventListener("mousedown",m),()=>{document.removeEventListener("mousedown",m),window.clearTimeout(c.current)}},[]);let p=l?Mw:Aw;return(0,E.jsxs)("div",{className:"relative",ref:u,children:[(0,E.jsx)("button",{className:re("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:d,onClick:()=>i(!o),title:"Copy table",type:"button",children:e??(0,E.jsx)(p,{size:14})}),o?(0,E.jsxs)("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[(0,E.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>f("csv"),title:"Copy table as CSV",type:"button",children:"CSV"}),(0,E.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>f("tsv"),title:"Copy table as TSV",type:"button",children:"TSV"})]}):null]})},Yq=({children:e,className:t,onDownload:a,onError:n})=>{let[r,o]=(0,D.useState)(!1),i=(0,D.useRef)(null),{isAnimating:l}=(0,D.useContext)(ia),s=u=>{var c;try{let d=(c=i.current)==null?void 0:c.closest('[data-streamdown="table-wrapper"]'),f=d?.querySelector("table");if(!f){n?.(new Error("Table not found"));return}let p=dA(f),m=u==="csv"?fA(p):Zq(p);Ji(`table.${u==="csv"?"csv":"md"}`,m,u==="csv"?"text/csv":"text/markdown"),o(!1),a?.(u)}catch(d){n?.(d)}};return(0,D.useEffect)(()=>{let u=c=>{let d=c.composedPath();i.current&&!d.includes(i.current)&&o(!1)};return document.addEventListener("mousedown",u),()=>{document.removeEventListener("mousedown",u)}},[]),(0,E.jsxs)("div",{className:"relative",ref:i,children:[(0,E.jsx)("button",{className:re("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:l,onClick:()=>o(!r),title:"Download table",type:"button",children:e??(0,E.jsx)(bf,{size:14})}),r?(0,E.jsxs)("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[(0,E.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>s("csv"),title:"Download table as CSV",type:"button",children:"CSV"}),(0,E.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>s("markdown"),title:"Download table as Markdown",type:"button",children:"Markdown"})]}):null]})},Jq=({children:e,className:t,showControls:a,...n})=>(0,E.jsxs)("div",{className:"my-4 flex flex-col space-y-2","data-streamdown":"table-wrapper",children:[a?(0,E.jsxs)("div",{className:"flex items-center justify-end gap-1",children:[(0,E.jsx)(Qq,{}),(0,E.jsx)(Yq,{})]}):null,(0,E.jsx)("div",{className:"overflow-x-auto",children:(0,E.jsx)("table",{className:re("w-full border-collapse border border-border",t),"data-streamdown":"table",...n,children:e})})]}),e5=(0,D.lazy)(()=>Promise.resolve().then(()=>(QM(),ZM)).then(e=>({default:e.CodeBlock}))),t5=(0,D.lazy)(()=>Promise.resolve().then(()=>(eA(),JM)).then(e=>({default:e.Mermaid}))),a5=/language-([^\s]+)/;Ew=(e,t)=>typeof e=="boolean"?e:e[t]!==!1,xf=(e,t)=>{if(typeof e=="boolean")return e;let a=e.mermaid;return a===!1?!1:a===!0||a===void 0?!0:a[t]!==!1},Dw=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("ol",{className:re("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...n,children:e}),(e,t)=>vt(e,t));Dw.displayName="MarkdownOl";pA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("li",{className:re("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...n,children:e}),(e,t)=>e.className===t.className&&Sf(e.node,t.node));pA.displayName="MarkdownLi";mA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("ul",{className:re("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...n,children:e}),(e,t)=>vt(e,t));mA.displayName="MarkdownUl";hA=(0,D.memo)(({className:e,node:t,...a})=>(0,E.jsx)("hr",{className:re("my-6 border-border",e),"data-streamdown":"horizontal-rule",...a}),(e,t)=>vt(e,t));hA.displayName="MarkdownHr";gA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("span",{className:re("font-semibold",t),"data-streamdown":"strong",...n,children:e}),(e,t)=>vt(e,t));gA.displayName="MarkdownStrong";n5=({children:e,className:t,href:a,node:n,...r})=>{let{linkSafety:o}=(0,D.useContext)(ia),[i,l]=(0,D.useState)(!1),s=a==="streamdown:incomplete-link",u=(0,D.useCallback)(async p=>{if(!(!(o!=null&&o.enabled&&a)||s)){if(p.preventDefault(),o.onLinkCheck&&await o.onLinkCheck(a)){window.open(a,"_blank","noreferrer");return}l(!0)}},[o,a,s]),c=(0,D.useCallback)(()=>{a&&window.open(a,"_blank","noreferrer")},[a]),d=(0,D.useCallback)(()=>{l(!1)},[]),f={url:a??"",isOpen:i,onClose:d,onConfirm:c};return o!=null&&o.enabled&&a?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("button",{className:re("wrap-anywhere appearance-none text-left font-medium text-primary underline",t),"data-incomplete":s,"data-streamdown":"link",onClick:u,type:"button",children:e}),o.renderModal?o.renderModal(f):(0,E.jsx)(jq,{...f})]}):(0,E.jsx)("a",{className:re("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":s,"data-streamdown":"link",href:a,rel:"noreferrer",target:"_blank",...r,children:e})},yA=(0,D.memo)(n5,(e,t)=>vt(e,t)&&e.href===t.href);yA.displayName="MarkdownA";wA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("h1",{className:re("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...n,children:e}),(e,t)=>vt(e,t));wA.displayName="MarkdownH1";xA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("h2",{className:re("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...n,children:e}),(e,t)=>vt(e,t));xA.displayName="MarkdownH2";vA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("h3",{className:re("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...n,children:e}),(e,t)=>vt(e,t));vA.displayName="MarkdownH3";bA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("h4",{className:re("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...n,children:e}),(e,t)=>vt(e,t));bA.displayName="MarkdownH4";SA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("h5",{className:re("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...n,children:e}),(e,t)=>vt(e,t));SA.displayName="MarkdownH5";IA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("h6",{className:re("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...n,children:e}),(e,t)=>vt(e,t));IA.displayName="MarkdownH6";CA=(0,D.memo)(({children:e,className:t,node:a,...n})=>{let{controls:r}=(0,D.useContext)(ia),o=Ew(r,"table");return(0,E.jsx)(Jq,{className:t,showControls:o,...n,children:e})},(e,t)=>vt(e,t));CA.displayName="MarkdownTable";kA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("thead",{className:re("bg-muted/80",t),"data-streamdown":"table-header",...n,children:e}),(e,t)=>vt(e,t));kA.displayName="MarkdownThead";LA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("tbody",{className:re("divide-y divide-border bg-muted/40",t),"data-streamdown":"table-body",...n,children:e}),(e,t)=>vt(e,t));LA.displayName="MarkdownTbody";TA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("tr",{className:re("border-border border-b",t),"data-streamdown":"table-row",...n,children:e}),(e,t)=>vt(e,t));TA.displayName="MarkdownTr";EA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("th",{className:re("whitespace-nowrap px-4 py-2 text-left font-semibold text-sm",t),"data-streamdown":"table-header-cell",...n,children:e}),(e,t)=>vt(e,t));EA.displayName="MarkdownTh";MA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("td",{className:re("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...n,children:e}),(e,t)=>vt(e,t));MA.displayName="MarkdownTd";AA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("blockquote",{className:re("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),"data-streamdown":"blockquote",...n,children:e}),(e,t)=>vt(e,t));AA.displayName="MarkdownBlockquote";RA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("sup",{className:re("text-sm",t),"data-streamdown":"superscript",...n,children:e}),(e,t)=>vt(e,t));RA.displayName="MarkdownSup";DA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("sub",{className:re("text-sm",t),"data-streamdown":"subscript",...n,children:e}),(e,t)=>vt(e,t));DA.displayName="MarkdownSub";_A=(0,D.memo)(({children:e,className:t,node:a,...n})=>{if("data-footnotes"in n){let r=i=>{var l,s;if(!(0,D.isValidElement)(i))return!1;let u=Array.isArray(i.props.children)?i.props.children:[i.props.children],c=!1,d=!1;for(let f of u)if(f){if(typeof f=="string")f.trim()!==""&&(c=!0);else if((0,D.isValidElement)(f))if(((l=f.props)==null?void 0:l["data-footnote-backref"])!==void 0)d=!0;else{let p=Array.isArray(f.props.children)?f.props.children:[f.props.children];for(let m of p){if(typeof m=="string"&&m.trim()!==""){c=!0;break}if((0,D.isValidElement)(m)&&((s=m.props)==null?void 0:s["data-footnote-backref"])===void 0){c=!0;break}}}}return d&&!c},o=Array.isArray(e)?e.map(i=>{if(!(0,D.isValidElement)(i))return i;if(i.type===Dw){let l=(Array.isArray(i.props.children)?i.props.children:[i.props.children]).filter(s=>!r(s));return l.length===0?null:{...i,props:{...i.props,children:l}}}return i}):e;return(Array.isArray(o)?o.some(i=>i!==null):o!==null)?(0,E.jsx)("section",{className:t,...n,children:o}):null}return(0,E.jsx)("section",{className:t,...n,children:e})},(e,t)=>vt(e,t));_A.displayName="MarkdownSection";r5=({node:e,className:t,children:a,...n})=>{var r,o,i;let l=((r=e?.position)==null?void 0:r.start.line)===((o=e?.position)==null?void 0:o.end.line),{mermaid:s,controls:u}=(0,D.useContext)(ia),c=Rw();if(l)return(0,E.jsx)("code",{className:re("rounded bg-muted px-1.5 py-0.5 font-mono text-sm",t),"data-streamdown":"inline-code",...n,children:a});let d=t?.match(a5),f=(i=d?.at(1))!=null?i:"",p="";if((0,D.isValidElement)(a)&&a.props&&typeof a.props=="object"&&"children"in a.props&&typeof a.props.children=="string"?p=a.props.children:typeof a=="string"&&(p=a),f==="mermaid"&&c){let x=Ew(u,"mermaid"),I=xf(u,"download"),y=xf(u,"copy"),w=xf(u,"fullscreen"),g=xf(u,"panZoom"),b=x&&(I||y||w);return(0,E.jsx)(D.Suspense,{fallback:(0,E.jsx)(rA,{}),children:(0,E.jsxs)("div",{className:re("group relative my-4 h-auto rounded-xl border p-4",t),"data-streamdown":"mermaid-block",children:[b?(0,E.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[I?(0,E.jsx)(Gq,{chart:p,config:s?.config}):null,y?(0,E.jsx)(aA,{code:p}):null,w?(0,E.jsx)(Xq,{chart:p,config:s?.config}):null]}):null,(0,E.jsx)(t5,{chart:p,config:s?.config,showControls:g})]})})}let m=Ew(u,"code");return(0,E.jsx)(D.Suspense,{fallback:(0,E.jsx)(rA,{}),children:(0,E.jsx)(e5,{className:re("overflow-x-auto border-border border-t",t),code:p,language:f,children:m?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(Uq,{code:p,language:f}),(0,E.jsx)(aA,{})]}):null})})},OA=(0,D.memo)(r5,(e,t)=>e.className===t.className&&Sf(e.node,t.node));OA.displayName="MarkdownCode";PA=(0,D.memo)(zq,(e,t)=>e.className===t.className&&Sf(e.node,t.node));PA.displayName="MarkdownImg";NA=(0,D.memo)(({children:e,className:t,node:a,...n})=>{var r,o;let i=(Array.isArray(e)?e:[e]).filter(l=>l!=null&&l!=="");if(i.length===1&&(0,D.isValidElement)(i[0])){let l=i[0].props.node,s=l?.tagName;if(s==="img")return(0,E.jsx)(E.Fragment,{children:e});if(s==="code"&&((r=l?.position)==null?void 0:r.start.line)!==((o=l?.position)==null?void 0:o.end.line))return(0,E.jsx)(E.Fragment,{children:e})}return(0,E.jsx)("p",{className:t,...n,children:e})},(e,t)=>vt(e,t));NA.displayName="MarkdownParagraph";o5={ol:Dw,li:pA,ul:mA,hr:hA,strong:gA,a:yA,h1:wA,h2:xA,h3:vA,h4:bA,h5:SA,h6:IA,table:CA,thead:kA,tbody:LA,tr:TA,th:EA,td:MA,blockquote:AA,code:OA,img:PA,pre:({children:e})=>e,sup:RA,sub:DA,p:NA,section:_A},oA=[],iA={allowDangerousHtml:!0},vf=new WeakMap,i5=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 a=e.rehypePlugins,n=e.remarkPlugins,r=e.remarkRehypeOptions;if(!(a||n||r)){let c="default";return this.keyCache.set(e,c),c}let o=c=>{if(!c||c.length===0)return"";let d="";for(let f=0;f<c.length;f+=1){let p=c[f];if(f>0&&(d+=","),Array.isArray(p)){let[m,x]=p;if(typeof m=="function"){let I=vf.get(m);I||(I=m.name,vf.set(m,I)),d+=I}else d+=String(m);d+=":",d+=JSON.stringify(x)}else if(typeof p=="function"){let m=vf.get(p);m||(m=p.name,vf.set(p,m)),d+=m}else d+=String(p)}return d},i=o(a),l=o(n),s=r?JSON.stringify(r):"",u=`${l}::${i}::${s}`;return this.keyCache.set(e,u),u}get(e){let t=this.generateCacheKey(e),a=this.cache.get(t);return a&&(this.cache.delete(t),this.cache.set(t,a)),a}set(e,t){let a=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let n=this.cache.keys().next().value;n&&this.cache.delete(n)}this.cache.set(a,t)}clear(){this.cache.clear()}},lA=new i5,BA=e=>{let t=l5(e),a=e.children||"";return u5(t.runSync(t.parse(a),a),e)},l5=e=>{let t=lA.get(e);if(t)return t;let a=s5(e);return lA.set(e,a),a},s5=e=>{let t=e.rehypePlugins||oA,a=e.remarkPlugins||oA,n=e.remarkRehypeOptions?{...iA,...e.remarkRehypeOptions}:iA;return uw().use(af).use(a).use(lf,n).use(t)},u5=(e,t)=>Hy(e,{Fragment:E.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:E.jsx,jsxs:E.jsxs,passKeys:!0,passNode:!0}),c5=/\[\^[^\]\s]{1,200}\](?!:)/,d5=/\[\^[^\]\s]{1,200}\]:/,f5=/<\/(\w+)>/,p5=/<(\w+)[\s>]/,kw=e=>{let t=0;for(;t<e.length&&(e[t]===" "||e[t]===" "||e[t]===`
|
|
120
|
-
`||e[t]==="\r");)t+=1;return t+1<e.length&&e[t]==="$"&&e[t+1]==="$"},
|
|
121
|
-
`||e[t]==="\r");)t-=1;return t>=1&&e[t]==="$"&&e[t-1]==="$"},Lw=e=>{let t=0;for(let a=0;a<e.length-1;a+=1)e[a]==="$"&&e[a+1]==="$"&&(t+=1,a+=1);return t},UA=e=>{let t=c5.test(e),a=d5.test(e);if(t||a)return[e];let n=Oa.lex(e,{gfm:!0}),r=[],o=[];for(let i of n){let l=i.raw,s=r.length;if(o.length>0){if(r[s-1]+=l,i.type==="html"){let u=l.match(f5);if(u){let c=u[1];o.at(-1)===c&&o.pop()}}continue}if(i.type==="html"&&i.block){let u=l.match(p5);if(u){let c=u[1];l.includes(`</${c}>`)||o.push(c)}}if(l.trim()==="$$"&&s>0){let u=r[s-1],c=kw(u),d=Lw(u);if(c&&d%2===1){r[s-1]=u+l;continue}}if(s>0&&m5(l)){let u=r[s-1],c=kw(u),d=Lw(u),f=Lw(l);if(c&&d%2===1&&!kw(l)&&f===1){r[s-1]=u+l;continue}}r.push(l)}return r},FA={raw:wC,sanitize:[Sd,{}],harden:[gC,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},zA={gfm:[$d,{}]},h5=Object.values(FA),g5=Object.values(zA),y5={block:" \u258B",circle:" \u25CF"},w5={shikiTheme:["github-light","github-dark"],controls:!0,isAnimating:!1,mode:"streaming",mermaid:void 0,linkSafety:{enabled:!0}},ia=(0,D.createContext)(w5),_w=(0,D.memo)(({content:e,shouldParseIncompleteMarkdown:t,index:a,...n})=>(0,E.jsx)(BA,{...n,children:e}),(e,t)=>{if(e.content!==t.content||e.index!==t.index)return!1;if(e.components!==t.components){let a=Object.keys(e.components||{}),n=Object.keys(t.components||{});if(a.length!==n.length||a.some(r=>{var o,i;return((o=e.components)==null?void 0:o[r])!==((i=t.components)==null?void 0:i[r])}))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins)});_w.displayName="Block";x5=["github-light","github-dark"],el=(0,D.memo)(({children:e,mode:t="streaming",parseIncompleteMarkdown:a=!0,components:n,rehypePlugins:r=h5,remarkPlugins:o=g5,className:i,shikiTheme:l=x5,mermaid:s,controls:u=!0,isAnimating:c=!1,BlockComponent:d=_w,parseMarkdownIntoBlocksFn:f=UA,caret:p,plugins:m,remend:x,linkSafety:I={enabled:!0},...y})=>{let w=(0,D.useId)(),[g,b]=(0,D.useTransition)(),T=(0,D.useMemo)(()=>typeof e!="string"?"":t==="streaming"&&a?AL(e,x):e,[e,t,a,x]),S=(0,D.useMemo)(()=>f(T),[T,f]),[M,R]=(0,D.useState)(S);(0,D.useEffect)(()=>{t==="streaming"?b(()=>{R(S)}):R(S)},[S,t]);let _=t==="streaming"?M:S,k=(0,D.useMemo)(()=>_.map((H,$)=>`${w}-${$}`),[_.length,w]),G=(0,D.useMemo)(()=>{var H,$;return{shikiTheme:($=(H=m?.code)==null?void 0:H.getThemes())!=null?$:l,controls:u,isAnimating:c,mode:t,mermaid:s,linkSafety:I}},[l,u,c,t,s,I,m?.code]),B=(0,D.useMemo)(()=>({...o5,...n}),[n]),U=(0,D.useMemo)(()=>{let H=[];return m!=null&&m.cjk&&(H=[...H,...m.cjk.remarkPluginsBefore]),H=[...H,...o],m!=null&&m.cjk&&(H=[...H,...m.cjk.remarkPluginsAfter]),m!=null&&m.math&&(H=[...H,m.math.remarkPlugin]),H},[o,m?.math,m?.cjk]),W=(0,D.useMemo)(()=>m!=null&&m.math?[...r,m.math.rehypePlugin]:r,[r,m?.math]),A=(0,D.useMemo)(()=>p&&c?{"--streamdown-caret":`"${y5[p]}"`}:void 0,[p,c]);return t==="static"?(0,E.jsx)(Tw.Provider,{value:m??null,children:(0,E.jsx)(ia.Provider,{value:G,children:(0,E.jsx)("div",{className:re("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",i),children:(0,E.jsx)(BA,{components:B,rehypePlugins:W,remarkPlugins:U,...y,children:e})})})}):(0,E.jsx)(Tw.Provider,{value:m??null,children:(0,E.jsx)(ia.Provider,{value:G,children:(0,E.jsxs)("div",{className:re("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",p?"*:last:after:inline *:last:after:align-baseline *:last:after:content-(--streamdown-caret)":null,i),style:A,children:[_.length===0&&p&&c&&(0,E.jsx)("span",{}),_.map((H,$)=>(0,E.jsx)(d,{components:B,content:H,index:$,rehypePlugins:W,remarkPlugins:U,shouldParseIncompleteMarkdown:a,...y},k[$]))]})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety);el.displayName="Streamdown";v5=({children:e,className:t,minZoom:a=.5,maxZoom:n=3,zoomStep:r=.1,showControls:o=!0,initialZoom:i=1,fullscreen:l=!1})=>{let s=(0,D.useRef)(null),u=(0,D.useRef)(null),[c,d]=(0,D.useState)(i),[f,p]=(0,D.useState)({x:0,y:0}),[m,x]=(0,D.useState)(!1),[I,y]=(0,D.useState)({x:0,y:0}),[w,g]=(0,D.useState)({x:0,y:0}),b=(0,D.useCallback)(B=>{d(U=>Math.max(a,Math.min(n,U+B)))},[a,n]),T=(0,D.useCallback)(()=>{b(r)},[b,r]),S=(0,D.useCallback)(()=>{b(-r)},[b,r]),M=(0,D.useCallback)(()=>{d(i),p({x:0,y:0})},[i]),R=(0,D.useCallback)(B=>{B.preventDefault();let U=B.deltaY>0?-r:r;b(U)},[b,r]),_=(0,D.useCallback)(B=>{if(B.button!==0||B.isPrimary===!1)return;x(!0),y({x:B.clientX,y:B.clientY}),g(f);let U=B.currentTarget;U instanceof HTMLElement&&U.setPointerCapture(B.pointerId)},[f]),k=(0,D.useCallback)(B=>{if(!m)return;B.preventDefault();let U=B.clientX-I.x,W=B.clientY-I.y;p({x:w.x+U,y:w.y+W})},[m,I,w]),G=(0,D.useCallback)(B=>{x(!1);let U=B.currentTarget;U instanceof HTMLElement&&U.releasePointerCapture(B.pointerId)},[]);return(0,D.useEffect)(()=>{let B=s.current;if(B)return B.addEventListener("wheel",R,{passive:!1}),()=>{B.removeEventListener("wheel",R)}},[R]),(0,D.useEffect)(()=>{let B=u.current;if(B&&m)return document.body.style.userSelect="none",B.addEventListener("pointermove",k,{passive:!1}),B.addEventListener("pointerup",G),B.addEventListener("pointercancel",G),()=>{document.body.style.userSelect="",B.removeEventListener("pointermove",k),B.removeEventListener("pointerup",G),B.removeEventListener("pointercancel",G)}},[m,k,G]),(0,E.jsxs)("div",{className:re("relative flex flex-col",l?"h-full w-full":"min-h-28 w-full",t),ref:s,style:{cursor:m?"grabbing":"grab"},children:[o?(0,E.jsxs)("div",{className:re("absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/90 p-1 shadow-sm backdrop-blur-sm",l?"bottom-4 left-4":"bottom-2 left-2"),children:[(0,E.jsx)("button",{className:"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:c>=n,onClick:T,title:"Zoom in",type:"button",children:(0,E.jsx)(Nq,{size:16})}),(0,E.jsx)("button",{className:"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:c<=a,onClick:S,title:"Zoom out",type:"button",children:(0,E.jsx)(Bq,{size:16})}),(0,E.jsx)("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",onClick:M,title:"Reset zoom and pan",type:"button",children:(0,E.jsx)(Pq,{size:16})})]}):null,(0,E.jsx)("div",{className:re("flex-1 origin-center transition-transform duration-150 ease-out",l?"flex h-full w-full items-center justify-center":"flex w-full items-center justify-center"),onPointerDown:_,ref:u,role:"application",style:{transform:`translate(${f.x}px, ${f.y}px) scale(${c})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},Iw=({chart:e,className:t,config:a,fullscreen:n=!1,showControls:r=!0})=>{let[o,i]=(0,D.useState)(null),[l,s]=(0,D.useState)(!1),[u,c]=(0,D.useState)(""),[d,f]=(0,D.useState)(""),[p,m]=(0,D.useState)(0),{mermaid:x}=(0,D.useContext)(ia),I=Rw(),y=x?.errorComponent,{shouldRender:w,containerRef:g}=Dq({immediate:n});if((0,D.useEffect)(()=>{if(w){if(!I){i("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}(async()=>{try{i(null),s(!0);let T=I.getMermaid(a),S=e.split("").reduce((_,k)=>(_<<5)-_+k.charCodeAt(0)|0,0),M=`mermaid-${Math.abs(S)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:R}=await T.render(M,e);c(R),f(R)}catch(T){if(!(d||u)){let S=T instanceof Error?T.message:"Failed to render Mermaid chart";i(S)}}finally{s(!1)}})()}},[e,a,p,w,I]),!(w||u||d))return(0,E.jsx)("div",{className:re("my-4 min-h-[200px]",t),ref:g});if(l&&!u&&!d)return(0,E.jsx)("div",{className:re("my-4 flex justify-center p-4",t),ref:g,children:(0,E.jsxs)("div",{className:"flex items-center space-x-2 text-muted-foreground",children:[(0,E.jsx)("div",{className:"h-4 w-4 animate-spin rounded-full border-current border-b-2"}),(0,E.jsx)("span",{className:"text-sm",children:"Loading diagram..."})]})});if(o&&!u&&!d)return y?(0,E.jsx)("div",{ref:g,children:(0,E.jsx)(y,{chart:e,error:o,retry:()=>m(S=>S+1)})}):(0,E.jsxs)("div",{className:re("rounded-lg border border-red-200 bg-red-50 p-4",t),ref:g,children:[(0,E.jsxs)("p",{className:"font-mono text-red-700 text-sm",children:["Mermaid Error: ",o]}),(0,E.jsxs)("details",{className:"mt-2",children:[(0,E.jsx)("summary",{className:"cursor-pointer text-red-600 text-xs",children:"Show Code"}),(0,E.jsx)("pre",{className:"mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs",children:e})]})]});let b=u||d;return(0,E.jsx)("div",{className:re("size-full",t),"data-streamdown":"mermaid",ref:g,children:(0,E.jsx)(v5,{className:re(n?"size-full overflow-hidden":"my-4 overflow-hidden",t),fullscreen:n,maxZoom:3,minZoom:.5,showControls:r,zoomStep:.1,children:(0,E.jsx)("div",{"aria-label":"Mermaid chart",className:re("flex justify-center",n?"size-full items-center":null),dangerouslySetInnerHTML:{__html:b},role:"img"})})})}});var dD=Kt((Bre,cD)=>{"use strict";function aj(e,t){if(typeof e!="function")throw new TypeError(`Expected the first argument to be a \`function\`, got \`${typeof e}\`.`);let a,n=0;return function(...o){clearTimeout(a);let i=Date.now(),l=i-n,s=t-l;s<=0?(n=i,e.apply(this,o)):a=setTimeout(()=>{n=Date.now(),e.apply(this,o)},s)}}cD.exports=aj});var bu=z(Le(),1),gx=z(uI(),1);function Ui(e,t){for(let a of t){let n=e[a];if(typeof n=="string"&&n.length>0)return n}}var UP=["waniwani/sessionId","openai/sessionId","openai/session","sessionId","conversationId","mcp-session-id"],FP=["waniwani/requestId","openai/requestId","requestId","mcp/requestId"],zP=["waniwani/traceId","openai/traceId","traceId","mcp/traceId","openai/requestId","requestId"],qP=["waniwani/userId","openai/userId","externalUserId","userId","actorId"],HP=["waniwani/visitorId","visitorId"],jP=["correlationId","openai/requestId"];function cI(e){return e?Ui(e,UP):void 0}function dI(e){return e?Ui(e,FP):void 0}function fI(e){return e?Ui(e,zP):void 0}function pI(e){return e?Ui(e,qP):void 0}function mI(e){return e?Ui(e,HP):void 0}function hI(e){return e?Ui(e,jP):void 0}var VP=[{key:"openai/sessionId",source:"chatgpt"},{key:"openai/session",source:"chatgpt"}],GP=[{needle:"claude",source:"claude"},{needle:"chatgpt",source:"chatgpt"},{needle:"openai",source:"chatgpt"},{needle:"gemini",source:"gemini"}];function gI(e,t){if(e){let n=e["waniwani/source"];if(typeof n=="string"&&n.length>0)return n;for(let{key:r,source:o}of VP){let i=e[r];if(typeof i=="string"&&i.length>0)return o}}let a=t?.name;if(typeof a=="string"&&a.length>0){let n=a.toLowerCase();for(let{needle:r,source:o}of GP)if(n.includes(r))return o}}var WP="@waniwani/sdk";function yI(e,t={}){let a=t.now??(()=>new Date),n=t.generateId??$P,r=ZP(e),o=ad(e.meta),i=ad(e.metadata),l=QP(e,o),s=Ra(e.eventId)??n(),u=YP(e.timestamp,a),c=Ra(e.source)??gI(o)??t.source??WP,d=jh(e)?{...e}:void 0,f={...i};return Object.keys(o).length>0&&(f.meta=o),d&&(f.rawLegacy=d),{id:s,type:"mcp.event",name:r,source:c,timestamp:u,correlation:l,properties:XP(e,r),metadata:f,rawLegacy:d}}function $P(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`evt_${crypto.randomUUID()}`:`evt_${Math.random().toString(36).slice(2,10)}_${Date.now().toString(36)}`}function XP(e,t){if(!jh(e))return ad(e.properties);let a=KP(e,t),n=ad(e.properties);return{...a,...n}}function KP(e,t){switch(t){case"tool.called":{let a={};return Ra(e.toolName)&&(a.name=e.toolName),Ra(e.toolType)&&(a.type=e.toolType),a}case"quote.succeeded":{let a={};return typeof e.quoteAmount=="number"&&(a.amount=e.quoteAmount),Ra(e.quoteCurrency)&&(a.currency=e.quoteCurrency),a}case"link.clicked":{let a={};return Ra(e.linkUrl)&&(a.url=e.linkUrl),a}case"purchase.completed":{let a={};return typeof e.purchaseAmount=="number"&&(a.amount=e.purchaseAmount),Ra(e.purchaseCurrency)&&(a.currency=e.purchaseCurrency),a}default:return{}}}function ZP(e){return jh(e)?e.eventType:e.event}function QP(e,t){let a=Ra(e.requestId)??dI(t),n=Ra(e.sessionId)??cI(t),r=Ra(e.traceId)??fI(t),o=Ra(e.externalUserId)??pI(t),i=Ra(e.visitorId)??mI(t),l=Ra(e.correlationId)??hI(t)??a,s={};return n&&(s.sessionId=n),r&&(s.traceId=r),a&&(s.requestId=a),l&&(s.correlationId=l),o&&(s.externalUserId=o),i&&(s.visitorId=i),s}function YP(e,t){if(e instanceof Date)return e.toISOString();if(typeof e=="string"){let a=new Date(e);if(!Number.isNaN(a.getTime()))return a.toISOString()}return t().toISOString()}function ad(e){return!e||typeof e!="object"||Array.isArray(e)?{}:e}function Ra(e){if(typeof e=="string"&&e.trim().length!==0)return e}function jh(e){return"eventType"in e}function wI(e){return{priceShown:({amount:t,currency:a,itemId:n,label:r,...o})=>e({event:"price_shown",properties:{amount:t,currency:a,itemId:n,label:r},...o}),pricesCompared:({options:t,...a})=>e({event:"prices_compared",properties:{options:t},...a}),optionSelected:({id:t,amount:a,currency:n,...r})=>e({event:"option_selected",properties:{id:t,amount:a,currency:n},...r}),leadQualified:t=>{let{externalId:a,email:n,name:r,...o}=t??{};return e({event:"lead_qualified",properties:{externalId:a,email:n,name:r},...o})},converted:({amount:t,currency:a,occurredAt:n,...r})=>e({event:"converted",properties:{amount:t,currency:a,occurredAt:n},...r})}}var JP="/api/mcp/events/v2/batch";var xI="@waniwani/sdk";var eN=new Set([401,403]),tN=new Set([408,425,429,500,502,503,504]);function vI(e){return new Vh(e)}var Vh=class{constructor(t){Y(this,"endpointUrl");Y(this,"flushIntervalMs");Y(this,"maxBatchSize");Y(this,"maxBufferSize");Y(this,"maxRetries");Y(this,"retryBaseDelayMs");Y(this,"retryMaxDelayMs");Y(this,"shutdownTimeoutMs");Y(this,"sdkVersion");Y(this,"fetchFn");Y(this,"logger");Y(this,"now");Y(this,"sleep");Y(this,"apiKey");Y(this,"buffer",[]);Y(this,"flushTimer");Y(this,"flushScheduled",!1);Y(this,"flushScheduledTimer");Y(this,"flushInFlight");Y(this,"inFlightCount",0);Y(this,"isStopped",!1);Y(this,"isShuttingDown",!1);this.endpointUrl=rN(t.apiUrl,t.endpointPath??JP),this.flushIntervalMs=t.flushIntervalMs??1e3,this.maxBatchSize=t.maxBatchSize??20,this.maxBufferSize=t.maxBufferSize??1e3,this.maxRetries=t.maxRetries??3,this.retryBaseDelayMs=t.retryBaseDelayMs??200,this.retryMaxDelayMs=t.retryMaxDelayMs??2e3,this.shutdownTimeoutMs=t.shutdownTimeoutMs??2e3,this.fetchFn=t.fetchFn??fetch,this.logger=t.logger??console,this.now=t.now??(()=>new Date),this.sleep=t.sleep??(a=>new Promise(n=>setTimeout(n,a))),this.apiKey=t.apiKey,this.sdkVersion=t.sdkVersion,this.flushIntervalMs>0&&(this.flushTimer=setInterval(()=>{this.flush()},this.flushIntervalMs)),this.registerBrowserTeardown()}enqueue(t){if(this.isStopped||this.isShuttingDown){this.logger.warn("[Waniwani] Tracking transport is stopped, dropping event %s",t.id);return}if(this.buffer.length>=this.maxBufferSize){let a=this.buffer.length-this.maxBufferSize+1;this.buffer.splice(0,a),this.logger.warn("[Waniwani] Tracking buffer overflow, dropped %d oldest event(s)",a)}if(this.buffer.push(t),this.buffer.length>=this.maxBatchSize){this.flush();return}this.scheduleMicroFlush()}pendingEvents(){return this.buffer.length+this.inFlightCount}async flush(){return this.flushInFlight?this.flushInFlight:(this.flushInFlight=this.flushLoop().finally(()=>{this.flushInFlight=void 0}),this.flushInFlight)}async shutdown(t){this.isShuttingDown=!0,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=void 0),this.flushScheduledTimer&&(clearTimeout(this.flushScheduledTimer),this.flushScheduledTimer=void 0,this.flushScheduled=!1);let a=t?.timeoutMs??this.shutdownTimeoutMs,n=this.flush();if(!Number.isFinite(a)||a<=0)return await n,this.isStopped=!0,{timedOut:!1,pendingEvents:this.pendingEvents()};let r=Symbol("shutdown-timeout");return await Promise.race([n.then(()=>"flushed"),this.sleep(a).then(()=>r)])===r?(this.isStopped=!0,{timedOut:!0,pendingEvents:this.pendingEvents()}):(this.isStopped=!0,{timedOut:!1,pendingEvents:this.pendingEvents()})}registerBrowserTeardown(){if(typeof document>"u"||typeof window>"u")return;let t=()=>{document.visibilityState==="hidden"&&this.keepaliveFlush()};document.addEventListener("visibilitychange",t),window.addEventListener("pagehide",()=>this.keepaliveFlush())}keepaliveFlush(){if(this.isStopped||this.buffer.length===0)return;let t=this.buffer.splice(0,this.buffer.length);this.sendKeepaliveChunk(t)}sendKeepaliveChunk(t){let a=JSON.stringify(this.makeBatchRequest(t));if(a.length>6e4&&t.length>1){let n=Math.ceil(t.length/2);this.sendKeepaliveChunk(t.slice(0,n)),this.sendKeepaliveChunk(t.slice(n));return}try{this.fetchFn(this.endpointUrl,{method:"POST",headers:this.requestHeaders(),body:a,keepalive:!0}).catch(()=>{})}catch{}}requestHeaders(){let t={"Content-Type":"application/json","X-WaniWani-SDK":xI};return this.apiKey&&(t.Authorization=`Bearer ${this.apiKey}`),t}scheduleMicroFlush(){this.flushScheduled||(this.flushScheduled=!0,this.flushScheduledTimer=setTimeout(()=>{this.flushScheduledTimer=void 0,this.flushScheduled=!1,this.flush()},0))}async flushLoop(){for(;this.buffer.length>0&&!this.isStopped;){let t=this.buffer.splice(0,this.maxBatchSize);await this.sendBatchWithRetry(t)}}async sendBatchWithRetry(t){let a=0,n=t;for(;n.length>0&&!this.isStopped;){this.inFlightCount=n.length;let r=await this.sendBatchOnce(n);switch(this.inFlightCount=0,r.kind){case"success":return;case"auth":this.stopTransportForAuthFailure(r.status,n.length);return;case"permanent":this.logger.error("[Waniwani] Dropping %d event(s) after permanent failure: %s",n.length,r.reason);return;case"retryable":if(a>=this.maxRetries){this.logger.error("[Waniwani] Dropping %d event(s) after retry exhaustion: %s",n.length,r.reason);return}await this.sleep(this.backoffDelayMs(a)),a+=1;continue;case"partial":if(r.permanent.length>0&&this.logger.error("[Waniwani] Dropping %d event(s) rejected as permanent",r.permanent.length),r.retryable.length===0)return;if(a>=this.maxRetries){this.logger.error("[Waniwani] Dropping %d retryable event(s) after retry exhaustion",r.retryable.length);return}n=r.retryable,await this.sleep(this.backoffDelayMs(a)),a+=1;continue}}}async sendBatchOnce(t){let a;try{a=await this.fetchFn(this.endpointUrl,{method:"POST",headers:this.requestHeaders(),body:JSON.stringify(this.makeBatchRequest(t))})}catch(o){return{kind:"retryable",reason:oN(o)}}if(eN.has(a.status))return{kind:"auth",status:a.status};if(tN.has(a.status))return{kind:"retryable",reason:`HTTP ${a.status}`};if(!a.ok)return{kind:"permanent",reason:`HTTP ${a.status}`};let n=await nN(a);if(!n?.rejected||n.rejected.length===0)return{kind:"success"};let r=this.classifyRejectedEvents(t,n.rejected);return r.retryable.length===0&&r.permanent.length===0?{kind:"success"}:{kind:"partial",retryable:r.retryable,permanent:r.permanent}}makeBatchRequest(t){return{sentAt:this.now().toISOString(),source:{sdk:xI,version:this.sdkVersion??"0.0.0"},events:t}}classifyRejectedEvents(t,a){let n=new Map(t.map(i=>[i.id,i])),r=[],o=[];for(let i of a){let l=n.get(i.eventId);if(l){if(aN(i)){r.push(l);continue}o.push(l)}}return{retryable:r,permanent:o}}backoffDelayMs(t){let a=this.retryBaseDelayMs*2**t;return Math.min(a,this.retryMaxDelayMs)}stopTransportForAuthFailure(t,a){this.isStopped=!0;let n=this.buffer.length;this.buffer.splice(0,n),this.logger.error("[Waniwani] Auth failure (HTTP %d). Stopping tracking transport and dropping %d queued event(s)",t,a+n)}};function aN(e){if(e.retryable===!0)return!0;let t=e.code.toLowerCase();return t.includes("timeout")||t.includes("temporary")||t.includes("unavailable")||t.includes("rate_limit")||t.includes("transient")||t.includes("server")}async function nN(e){let t=await e.text();if(t)try{return JSON.parse(t)}catch{return}}function rN(e,t){let a=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${a}${n}`}function oN(e){return e instanceof Error?e.message:String(e)}function bI(e){let{apiUrl:t,endpointPath:a}=iN(e.endpoint),n=vI({apiUrl:t,apiKey:e.token,endpointPath:a,flushIntervalMs:e.flushIntervalMs}),r,o=l=>typeof l=="function"?l():l,i=async l=>{let s=e.identity?.()??{},u=o(e.channelId),c=u===void 0?l.properties:{channelId:u,...l.properties},d=yI({sessionId:s.sessionId,visitorId:s.visitorId,externalUserId:s.externalUserId??r,traceId:s.traceId,...l,properties:c,metadata:{...e.metadata,...l.metadata}},{source:o(e.source)});return n.enqueue(d),{eventId:d.id}};return{track:Object.assign(i,wI(i)),identify(l,s){return r=l,i({event:"user.identified",externalUserId:l,properties:s})},flush:()=>n.flush(),shutdown:l=>n.shutdown(l)}}function iN(e){let t=new URL(e);return{apiUrl:t.origin,endpointPath:`${t.pathname}${t.search}`}}var lN="waniwani-memory";var Da="threads",nd="by_memoryUserId",sN="by_updatedAt";var II="memoryUserId",SI="waniwani-memory-user-id",Gh=null;function Wh(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function uN(e,t){if(t<1&&(e.objectStoreNames.contains("ids")||e.createObjectStore("ids")),t<2&&!e.objectStoreNames.contains(Da)){let a=e.createObjectStore(Da,{keyPath:"threadId"});a.createIndex(nd,"memoryUserId",{unique:!1}),a.createIndex(sN,"updatedAt",{unique:!1})}}async function $h(){return new Promise((e,t)=>{let a=indexedDB.open(lN,2);a.onupgradeneeded=n=>{uN(a.result,n.oldVersion)},a.onsuccess=()=>e(a.result),a.onerror=()=>t(a.error)})}async function cN(){return $h()}async function dN(e){return new Promise((t,a)=>{let o=e.transaction("ids","readonly").objectStore("ids").get(II);o.onsuccess=()=>t(typeof o.result=="string"?o.result:null),o.onerror=()=>a(o.error)})}async function fN(e,t){return new Promise((a,n)=>{let i=e.transaction("ids","readwrite").objectStore("ids").put(t,II);i.onsuccess=()=>a(),i.onerror=()=>n(i.error)})}async function pN(){if(typeof indexedDB>"u")return null;try{let e=await cN();try{let t=await dN(e);if(t)return t;let a=Wh();return await fN(e,a),a}finally{e.close()}}catch{return null}}function mN(){try{let e=localStorage.getItem(SI);if(e)return e;let t=Wh();return localStorage.setItem(SI,t),t}catch{return null}}async function CI(){let e=await pN();if(e)return e;let t=mN();return t||(Gh||(Gh=Wh()),Gh)}var Xh="waniwani-visitor-id";function kI(e,t){return e.match(t)?.[1]??null}function hN(e){let t=[["Edge",/Edg(?:e|A|iOS)?\/(\S+)/],["Opera",/(?:OPR|Opera)\/(\S+)/],["Samsung Internet",/SamsungBrowser\/(\S+)/],["Firefox",/Firefox\/(\S+)/],["Chrome",/Chrome\/(\S+)/],["Safari",/Version\/(\S+).*Safari/]];for(let[a,n]of t){let r=kI(e,n);if(r)return{name:a,version:r}}return null}function gN(e){let t=[["iOS",/(?:iPhone|iPad|iPod).+?OS (\d+[_.\d]*)/],["Android",/Android (\d+[.\d]*)/],["macOS",/Mac OS X (\d+[_.\d]*)/],["Windows",/Windows NT (\d+[.\d]*)/],["ChromeOS",/CrOS \S+ (\d+[.\d]*)/],["Linux",/Linux/]];for(let[a,n]of t){let r=kI(e,n);if(r)return{name:a,version:r.replace(/_/g,".")};if(a==="Linux"&&n.test(e))return{name:a,version:""}}return null}function yN(e){return typeof navigator<"u"&&"userAgentData"in navigator&&navigator.userAgentData?.mobile?"mobile":/iPad|tablet|PlayBook/i.test(e)?"tablet":/Mobi|Android.*Mobile|iPhone|iPod/i.test(e)?"mobile":"desktop"}function wN(){try{if(typeof crypto<"u"){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();if(typeof crypto.getRandomValues=="function"){let e=crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=Array.from(e,a=>a.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}}}catch{}return`v-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}function Kn(){try{let t=localStorage.getItem(Xh);if(t)return t}catch{}let e=wN();try{localStorage.setItem(Xh,e)}catch{}return e}function ps(e){let t=typeof e=="string"?e.trim():"";if(!t)return Kn();try{localStorage.setItem(Xh,t)}catch{}return t}function xN(e){return e!=null&&typeof e.then=="function"}function rd(e){let t=!1,a=()=>{t=!0};if(e==null)return a;let n;try{n=typeof e=="function"?e():e}catch{return a}return xN(n)?n.then(r=>{t||ps(r??"")},()=>{}):ps(n??""),a}async function ms(){let e=navigator.userAgent,t=Kn(),a=await CI();return{userAgent:e,browser:hN(e),os:gN(e),deviceType:yN(e),language:navigator.language,languages:[...navigator.languages],timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,screenWidth:screen.width,screenHeight:screen.height,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,colorDepth:screen.colorDepth,devicePixelRatio:window.devicePixelRatio??1,touchSupport:"ontouchstart"in window||navigator.maxTouchPoints>0,connectionType:navigator.connection?.effectiveType??"unknown",referrer:document.referrer,visitorId:t,memoryUserId:a}}var Kh=new Set;function vN(e,t,a){return`${e}|${t}|${a??""}`}function Zh(e){try{return`${new URL(e).origin}/api/mcp/events/v2/batch`}catch{return e.replace(/\/$/,"").replace(/\/chat$/,"/events/v2/batch")}}async function LI(e){let{api:t,token:a,channelId:n,mode:r,source:o}=e;if(typeof window>"u"||!t||!a)return;let i=vN(t,a,n);if(!Kh.has(i)){Kh.add(i);try{let l=await ms(),s=new Date().toISOString(),u=JSON.stringify({sentAt:s,source:{sdk:"@waniwani/sdk",version:"0.1.0"},events:[{id:crypto.randomUUID(),type:"mcp.event",name:"page.viewed",source:o,timestamp:s,correlation:{visitorId:l.visitorId},properties:{channelId:n,mode:r,url:window.location.href,referrer:l.referrer,deviceType:l.deviceType,language:l.language,timezone:l.timezone},metadata:{}}]});await fetch(Zh(t),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:u,keepalive:!0})}catch{Kh.delete(i)}}}function TI(e){return bI({endpoint:Zh(e.api),token:e.token,channelId:e.channelId,source:e.getSource,identity:()=>({sessionId:e.getSessionId(),visitorId:Kn()})})}function Qh(e){let t=!1,a=async()=>(t||(t=!0,console.warn(`[Waniwani] track() is disabled: ${e}`)),{eventId:""});return{track:Object.assign(a,{priceShown:a,pricesCompared:a,optionSelected:a,leadQualified:a,converted:a}),identify:a,flush:async()=>{},shutdown:async()=>({timedOut:!1,pendingEvents:0})}}var EI="500px",bN="https://app.waniwani.ai/api/mcp/chat",SN={api:bN};function Jh(){if(typeof document>"u")return null;if(document.currentScript instanceof HTMLScriptElement)return document.currentScript;let e=document.querySelector("script[src][data-token]");if(e instanceof HTMLScriptElement)return e;let t=document.querySelectorAll("script[src]");for(let a of t)if(a instanceof HTMLScriptElement&&/embed/i.test(a.src))return a;return null}function od(){let e=Jh();if(!e)return{};let t=k=>e.getAttribute(k)??void 0,a=k=>{let G=e.getAttribute(k);if(G==null)return;let B=G.trim().toLowerCase();if(B==="true"||B==="1"||B==="")return!0;if(B==="false"||B==="0")return!1},n={},r=t("data-api");r&&(n.api=r);let o=t("data-token");o&&(n.token=o);let i=t("data-visitor-id");i&&(n.visitorId=i);let l=t("data-title");l&&(n.title=l);let s=t("data-welcome-message");s&&(n.welcomeMessage=s);let u=t("data-placeholder");u&&(n.placeholder=u);let c=t("data-mcp-server-url");c&&(n.mcpServerUrl=c);let d=t("data-channel-id");if(d&&(n.channelId=d),t("data-show-tool-calls")?.trim().toLowerCase()==="titles-only")n.showToolCalls="titles-only";else{let k=a("data-show-tool-calls");k!==void 0&&(n.showToolCalls=k)}let p=t("data-css");p&&(n.css=p);let m=t("data-suggestions");m&&(n.suggestions=m.split(",").map(k=>k.trim()).filter(Boolean));let x=a("data-enable-thread-history");x!==void 0&&(n.enableThreadHistory=x);let I=a("data-disable-page-view");I!==void 0&&(n.disablePageView=I);let y=a("data-hide-header");y!==void 0&&(n.hideHeader=y);let w=t("data-theme");(w==="light"||w==="dark"||w==="auto")&&(n.appearance={...n.appearance,theme:w});let g=a("data-assistant-bubble");g!==void 0&&(n.appearance={...n.appearance,assistantBubble:g});let b=t("data-locale");(b==="en"||b==="fr"||b==="es")&&(n.locale=b);let T=t("data-mode");(T==="inline"||T==="floating")&&(n.mode=T);let S=t("data-height");S&&(n.height=S);let M=t("data-launcher-text");M&&(n.launcherText=M);let R=t("data-appear-delay");if(R!==void 0){let k=Number.parseInt(R.trim(),10);Number.isFinite(k)&&k>=0&&(n.appearDelay=k)}let _=t("data-disclaimer");if(_!==void 0){let k=_.trim(),G=k.toLowerCase();G==="false"||G==="0"?n.disclaimer=!1:k&&(n.disclaimer=k)}return n}function Yh(e){if(!e)return{};let t={};for(let a in e)e[a]!==void 0&&(t[a]=e[a]);return t}function hs(e,t,a){let n=a??od(),r=IN(t,n,e),o={token:"",...SN,...Yh(t),...Yh(n),...Yh(e),...r?{appearance:r}:{}};if(!o.token)throw new Error("[Waniwani] Missing required config: `token`. Set data-token on the script tag or pass it to Waniwani.chat.init().");return o}function IN(e,t,a){let n=a?.appearance?.theme??t.appearance?.theme??e?.appearance?.theme,r={...e?.appearance?.variables??{},...t.appearance?.variables??{},...a?.appearance?.variables??{}},o=Object.keys(r).length>0,i=a?.appearance?.assistantBubble??t.appearance?.assistantBubble??e?.appearance?.assistantBubble;if(!n&&!o&&i===void 0)return;let l={};return n&&(l.theme=n),o&&(l.variables=r),i!==void 0&&(l.assistantBubble=i),l}var ld=z(Le());var id=(...e)=>e.filter((t,a,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===a).join(" ").trim();var MI=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var AI=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,n)=>n?n.toUpperCase():a.toLowerCase());var eg=e=>{let t=AI(e);return t.charAt(0).toUpperCase()+t.slice(1)};var gs=z(Le());var RI={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"};var DI=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var _I=(0,gs.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:n,className:r="",children:o,iconNode:i,...l},s)=>(0,gs.createElement)("svg",{ref:s,...RI,width:t,height:t,stroke:e,strokeWidth:n?Number(a)*24/Number(t):a,className:id("lucide",r),...!o&&!DI(l)&&{"aria-hidden":"true"},...l},[...i.map(([u,c])=>(0,gs.createElement)(u,c)),...Array.isArray(o)?o:[o]]));var Oe=(e,t)=>{let a=(0,ld.forwardRef)(({className:n,...r},o)=>(0,ld.createElement)(_I,{ref:o,iconNode:t,className:id(`lucide-${MI(eg(e))}`,`lucide-${e}`,n),...r}));return a.displayName=eg(e),a};var CN=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],ys=Oe("arrow-down",CN);var kN=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Io=Oe("arrow-up",kN);var LN=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ws=Oe("check",LN);var TN=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Br=Oe("chevron-down",TN);var EN=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],xs=Oe("chevron-right",EN);var MN=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]],vs=Oe("clipboard-copy",MN);var AN=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Zn=Oe("clock",AN);var RN=[["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"}]],bs=Oe("file",RN);var DN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Ss=Oe("globe",DN);var _N=[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]],Is=Oe("loader",_N);var ON=[["path",{d:"M5 12h14",key:"1ays0h"}]],Cs=Oe("minus",ON);var PN=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],ks=Oe("paperclip",PN);var NN=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Ls=Oe("square",NN);var BN=[["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"}]],Co=Oe("wrench",BN);var UN=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Qn=Oe("x",UN);var FN=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Ts=Oe("zap",FN);var Me=z(Le(),1);var Fi=z(Le(),1),Es=z(ne(),1);function HN(e){return 1-(1-e)**3}function jN({start:e=0,end:t=100,duration:a=1e3,delay:n=0,ease:r=HN,onUpdate:o,onEnd:i}){let l=performance.now()+n;function s(){let u=performance.now()-l,c=Math.min(u/a,1);o(e+(t-e)*r(c)),c<1?requestAnimationFrame(s):i&&i()}setTimeout(()=>requestAnimationFrame(s),n)}var VN=["80% 55%","69% 34%","8% 6%","41% 38%","86% 85%","82% 18%","51% 4%"],GN=[0,1,2,0,1,2,1];function WN(e){let t=[];for(let a=0;a<7;a++){let n=e[Math.min(GN[a],e.length-1)];t.push(`radial-gradient(at ${VN[a]}, ${n} 0px, transparent 50%)`)}return t.push(`linear-gradient(${e[0]} 0 100%)`),t}var $N=({children:e,className:t="",style:a,edgeSensitivity:n=30,backgroundColor:r="#120F17",borderRadius:o=28,coneSpread:i=25,animated:l=!1,colors:s=["#c084fc","#f472b6","#38bdf8"]})=>{let[u,c]=(0,Fi.useState)(110),[d,f]=(0,Fi.useState)(0),[p,m]=(0,Fi.useState)(!1);(0,Fi.useEffect)(()=>{if(!l)return;let T=110;m(!0),c(T),jN({ease:S=>S,duration:2e3,onUpdate:S=>{let M=S/100;c(T+360*M);let R=Math.min(M/.1,1),_=M>.85?(1-M)/.15:1;f(Math.min(R,_))},onEnd:()=>m(!1)})},[l]);let x=n+20,I=p?Math.max(0,(d*100-x)/(100-x)):0,w=WN(s).map(T=>`${T} border-box`),b=`conic-gradient(from ${`${u.toFixed(3)}deg`} at center, black ${i}%, transparent ${i+15}%, transparent ${100-i-15}%, black ${100-i}%)`;return(0,Es.jsxs)("div",{className:`ww:relative ww:grid ww:isolate ww:border ${t}`,style:{background:r,borderRadius:`${o}px`,transform:"translate3d(0, 0, 0.01px)",...a},children:[(0,Es.jsx)("div",{className:"ww:absolute ww:inset-0 ww:rounded-[inherit] ww:-z-[1]",style:{border:"1px solid transparent",background:[`linear-gradient(${r} 0 100%) padding-box`,"linear-gradient(rgb(255 255 255 / 0%) 0% 100%) border-box",...w].join(", "),opacity:I,maskImage:b,WebkitMaskImage:b,transition:p?"opacity 0.25s ease-out":"opacity 0.75s ease-in-out"}}),(0,Es.jsx)("div",{className:"ww:flex ww:flex-col ww:relative ww:overflow-auto ww:z-[1]",children:e})]})},BI=$N;tg();ng();var XN=FI({prefix:"ww"});function j(...e){return XN(ud(e))}var Ms=z(ne(),1);function cd({suggestions:e,isLoading:t,onSelect:a,className:n,...r}){return e.length===0&&!t?null:(0,Ms.jsx)("div",{className:j("ww:px-4 ww:py-2",n),...r,children:(0,Ms.jsx)("div",{className:"ww:mx-auto ww:w-full ww:max-w-3xl ww:flex ww:flex-wrap ww:gap-2",children:t?[0,1,2].map(o=>(0,Ms.jsx)("div",{className:"ww:h-8 ww:rounded-full ww:bg-accent ww:animate-pulse",style:{width:`${60+o*20}px`}},o)):e.map((o,i)=>(0,Ms.jsx)("button",{type:"button",onClick:()=>a(o),className:j("ww:rounded-full ww:border ww:border-border ww:bg-background ww:px-3.5 ww:py-1.5 ww:text-sm","ww:text-foreground ww:hover:bg-accent ww:hover:border-primary/30","ww:transition-all ww:duration-200 ww:ease-out ww:cursor-pointer","ww:animate-[ww-fade-in_0.2s_ease-out_both]"),style:{animationDelay:`${i*50}ms`},children:o},o))})})}var zi=z(Le(),1),KN=80,ZN=50,QN=15e3,zI=500;function dd(e,t=!0){let[a,n]=(0,zi.useState)(""),r=(0,zi.useRef)(void 0);return(0,zi.useEffect)(()=>{if(!t){n("");return}let o=0,i=!1,l=!1,s=()=>{l||(i?(o--,n(e.slice(0,o)),o<=0?(i=!1,r.current=setTimeout(s,zI)):r.current=setTimeout(s,ZN)):(o++,n(e.slice(0,o)),o>=e.length?(i=!0,r.current=setTimeout(s,QN)):r.current=setTimeout(s,KN)))};return r.current=setTimeout(s,zI),()=>{l=!0,clearTimeout(r.current)}},[e,t]),a}var rn=z(Le(),1);var qI=["en","fr","es"];function qi(e){return qI.includes(e)}function rg(e){if(e&&qi(e))return e;if(e){let a=e.split("-")[0]?.toLowerCase();if(a&&qi(a))return a}let t=[];if(typeof navigator<"u"&&(navigator.language&&t.push(navigator.language),navigator.languages&&t.push(...navigator.languages)),typeof document<"u"){let a=document.documentElement.getAttribute("lang");a&&t.push(a)}for(let a of t){let n=a.toLowerCase();if(qi(n))return n;let r=n.split("-")[0];if(r&&qi(r))return r}return"en"}var fd={promptInput:{placeholder:"What would you like to know?",uploadFiles:"Upload files",stop:"Stop",submit:"Submit",removeAttachments:"Remove all attachments"},workingIndicator:{default:"On it\u2026"},reasoning:{thinking:"Thinking\u2026",thoughtBrief:"Thought for a few seconds",thoughtForSeconds:e=>`Thought for ${e} second${e===1?"":"s"}`},chainOfThought:{working:"Working on it\u2026",done:"Thought process"},tool:{copy:"Copy",copied:"Copied",request:"Request",response:"Response",error:"Error"},attachments:{attachmentFallback:"attachment",fileFallback:"file"},threadMenu:{newChat:"New chat",threadHistory:"Thread history",deleteThread:"Delete thread",noPreviousChats:"No previous chats yet.",hiddenThreads:e=>`${e} older thread${e===1?"":"s"} hidden`},chatQueue:{attachmentFallback:"(attachment)",removeFromQueue:"Remove from queue",queued:e=>`${e} queued`},poweredBy:{label:"AI agent powered by"},aiDisclaimer:{default:"can make mistakes"},exportSession:{saving:"saving...",saved:"saved",error:"error",export:"export",tooltip:"Save scenario to Waniwani"},widgetErrorBoundary:{failedToLoad:"Widget failed to load",retry:"Retry"},launcher:{prompt:"Ask anything\u2026",open:"Open chat",close:"Close chat",minimize:"Minimize"}};var HI={promptInput:{placeholder:"\xBFQu\xE9 te gustar\xEDa saber?",uploadFiles:"Subir archivos",stop:"Detener",submit:"Enviar",removeAttachments:"Eliminar todos los archivos adjuntos"},workingIndicator:{default:"Un momento\u2026"},reasoning:{thinking:"Pensando\u2026",thoughtBrief:"Pensado durante unos segundos",thoughtForSeconds:e=>`Pensado durante ${e} segundo${e===1?"":"s"}`},chainOfThought:{working:"Estoy en ello\u2026",done:"Razonamiento"},tool:{copy:"Copiar",copied:"Copiado",request:"Solicitud",response:"Respuesta",error:"Error"},attachments:{attachmentFallback:"adjunto",fileFallback:"archivo"},threadMenu:{newChat:"Nueva conversaci\xF3n",threadHistory:"Historial",deleteThread:"Eliminar conversaci\xF3n",noPreviousChats:"A\xFAn no hay conversaciones anteriores.",hiddenThreads:e=>`${e} conversaci\xF3n${e===1?"":"es"} anterior${e===1?"":"es"} oculta${e===1?"":"s"}`},chatQueue:{attachmentFallback:"(adjunto)",removeFromQueue:"Quitar de la cola",queued:e=>`${e} en cola`},poweredBy:{label:"Agente IA con tecnolog\xEDa de"},aiDisclaimer:{default:"puede cometer errores"},exportSession:{saving:"guardando...",saved:"guardado",error:"error",export:"exportar",tooltip:"Guardar escenario en Waniwani"},widgetErrorBoundary:{failedToLoad:"No se pudo cargar el widget",retry:"Reintentar"},launcher:{prompt:"Pregunta lo que quieras\u2026",open:"Abrir chat",close:"Cerrar chat",minimize:"Minimizar"}};var jI={promptInput:{placeholder:"Que souhaitez-vous savoir ?",uploadFiles:"Importer des fichiers",stop:"Arr\xEAter",submit:"Envoyer",removeAttachments:"Supprimer toutes les pi\xE8ces jointes"},workingIndicator:{default:"Un instant\u2026"},reasoning:{thinking:"R\xE9flexion\u2026",thoughtBrief:"R\xE9flexion pendant quelques secondes",thoughtForSeconds:e=>`R\xE9flexion pendant ${e} seconde${e===1?"":"s"}`},chainOfThought:{working:"Je m'en occupe\u2026",done:"Raisonnement"},tool:{copy:"Copier",copied:"Copi\xE9",request:"Requ\xEAte",response:"R\xE9ponse",error:"Erreur"},attachments:{attachmentFallback:"pi\xE8ce jointe",fileFallback:"fichier"},threadMenu:{newChat:"Nouvelle conversation",threadHistory:"Historique",deleteThread:"Supprimer la conversation",noPreviousChats:"Aucune conversation pr\xE9c\xE9dente.",hiddenThreads:e=>`${e} conversation${e===1?"":"s"} plus ancienne${e===1?"":"s"} masqu\xE9e${e===1?"":"s"}`},chatQueue:{attachmentFallback:"(pi\xE8ce jointe)",removeFromQueue:"Retirer de la file",queued:e=>`${e} en attente`},poweredBy:{label:"Agent IA propuls\xE9 par"},aiDisclaimer:{default:"peut faire des erreurs"},exportSession:{saving:"enregistrement...",saved:"enregistr\xE9",error:"erreur",export:"exporter",tooltip:"Enregistrer le sc\xE9nario dans Waniwani"},widgetErrorBoundary:{failedToLoad:"\xC9chec du chargement du widget",retry:"R\xE9essayer"},launcher:{prompt:"Posez votre question\u2026",open:"Ouvrir le chat",close:"Fermer le chat",minimize:"R\xE9duire"}};var og={en:fd,fr:jI,es:HI};var GI=z(ne(),1),VI=(0,rn.createContext)(null);function YN(e,t){if(!t)return e;let a={...e};for(let n of Object.keys(e)){let r=e[n],o=t[n];o&&typeof r=="object"&&(a[n]={...r,...o})}return a}function As({children:e,locale:t,messages:a}){let n=!!(t&&JN(t)),r=n?t:"en",[o,i]=(0,rn.useState)(r),[l,s]=(0,rn.useState)(n);(0,rn.useEffect)(()=>{i(rg(t)),s(!0)},[t]);let u=(0,rn.useMemo)(()=>{let c=og[o]??og["en"];return{locale:o,t:YN(c,a),ready:l}},[o,a,l]);return(0,GI.jsx)(VI.Provider,{value:u,children:e})}function JN(e){return e==="en"||e==="fr"||e==="es"}function Re(){let e=(0,rn.useContext)(VI);return e||{locale:"en",t:fd,ready:!0}}function ig(e,t){let a=Date.now()-e;if(a<6e4)try{return new Intl.RelativeTimeFormat(t,{numeric:"auto",style:"narrow"}).format(0,"second")}catch{return"just now"}let n,r;a<60*6e4?(n=-Math.floor(a/6e4),r="minute"):a<1440*6e4?(n=-Math.floor(a/(60*6e4)),r="hour"):(n=-Math.floor(a/(1440*6e4)),r="day");try{return new Intl.RelativeTimeFormat(t,{numeric:"auto",style:"short"}).format(n,r)}catch{return`${Math.abs(n)}${r==="minute"?"m":r==="hour"?"h":"d"} ago`}}var Ge=z(Le(),1);var Rs=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,a)=>(a&=63,a<36?t+=a.toString(36):a<62?t+=(a-26).toString(36).toUpperCase():a>62?t+="-":t+="_",t),"");var at=z(Le(),1);var WI=z(ne(),1),bn=({className:e,variant:t="default",size:a="default",type:n="button",...r})=>(0,WI.jsx)("button",{type:n,className:j("ww:inline-flex ww:cursor-pointer ww:items-center ww:justify-center ww:rounded-md ww:font-medium ww:transition-colors ww:disabled:pointer-events-none ww:disabled:opacity-50",t==="default"&&"ww:bg-primary ww:text-primary-foreground ww:hover:bg-primary/90",t==="outline"&&"ww:border ww:border-border ww:bg-background ww:hover:bg-accent ww:hover:text-accent-foreground",t==="ghost"&&"ww:hover:bg-accent ww:hover:text-accent-foreground",a==="default"&&"ww:h-9 ww:px-4 ww:py-2 ww:text-sm",a==="sm"&&"ww:h-8 ww:px-3 ww:text-xs",a==="icon"&&"ww:size-9 ww:!rounded-full",a==="icon-sm"&&"ww:size-7 ww:!rounded-full",e),...r});var na=z(ne(),1),eB=async e=>{try{let a=await(await fetch(e)).blob();return new Promise(n=>{let r=new FileReader;r.onloadend=()=>n(r.result),r.onerror=()=>n(null),r.readAsDataURL(a)})}catch{return null}},$I=(0,at.createContext)(null),XI=()=>{let e=(0,at.useContext)($I);if(!e)throw new Error("usePromptInputAttachments must be used within a PromptInput");return e},KI=({className:e,accept:t,multiple:a,globalDrop:n,maxFiles:r,maxFileSize:o,onSubmit:i,children:l,...s})=>{let{t:u}=Re(),c=(0,at.useRef)(null),d=(0,at.useRef)(null),[f,p]=(0,at.useState)([]),m=(0,at.useRef)(f);(0,at.useEffect)(()=>{m.current=f},[f]);let x=(0,at.useCallback)(()=>{c.current?.click()},[]),I=(0,at.useCallback)(S=>{let M=[...S];if(M.length===0)return;let R=k=>o?k.size<=o:!0,_=M.filter(R);p(k=>{let G=typeof r=="number"?Math.max(0,r-k.length):void 0,B=typeof G=="number"?_.slice(0,G):_;return[...k,...B.map(U=>({filename:U.name,id:Rs(),mediaType:U.type,type:"file",url:URL.createObjectURL(U)}))]})},[r,o]),y=(0,at.useCallback)(S=>{p(M=>{let R=M.find(_=>_.id===S);return R?.url&&URL.revokeObjectURL(R.url),M.filter(_=>_.id!==S)})},[]),w=(0,at.useCallback)(()=>{p(S=>{for(let M of S)M.url&&URL.revokeObjectURL(M.url);return[]})},[]);(0,at.useEffect)(()=>()=>{for(let S of m.current)S.url&&URL.revokeObjectURL(S.url)},[]);let g=(0,at.useCallback)(S=>{S.currentTarget.files&&I(S.currentTarget.files),S.currentTarget.value=""},[I]);(0,at.useEffect)(()=>{if(!n)return;let S=R=>{R.dataTransfer?.types?.includes("Files")&&R.preventDefault()},M=R=>{R.dataTransfer?.types?.includes("Files")&&R.preventDefault(),R.dataTransfer?.files&&R.dataTransfer.files.length>0&&I(R.dataTransfer.files)};return document.addEventListener("dragover",S),document.addEventListener("drop",M),()=>{document.removeEventListener("dragover",S),document.removeEventListener("drop",M)}},[I,n]);let b=(0,at.useCallback)(async S=>{S.preventDefault();let M=S.currentTarget,_=new FormData(M).get("message")||"";M.reset();let k=await Promise.all(f.map(async({id:G,...B})=>{if(B.url?.startsWith("blob:")){let U=await eB(B.url);return{...B,url:U??B.url}}return B}));try{let G=i({files:k,text:_},S);G instanceof Promise&&await G,w()}catch{}},[f,i,w]),T=(0,at.useMemo)(()=>({add:I,clear:w,files:f,openFileDialog:x,remove:y}),[f,I,y,w,x]);return(0,na.jsxs)($I.Provider,{value:T,children:[(0,na.jsx)("input",{accept:t,"aria-label":u.promptInput.uploadFiles,className:"ww:hidden",multiple:a,onChange:g,ref:c,title:u.promptInput.uploadFiles,type:"file"}),(0,na.jsx)("form",{className:j("ww:flex ww:w-full ww:flex-col ww:rounded-lg ww:border ww:border-border ww:bg-background",e),onSubmit:b,ref:d,...s,children:l})]})};var ZI=({onChange:e,onKeyDown:t,className:a,placeholder:n,...r})=>{let{t:o}=Re(),i=XI(),[l,s]=(0,at.useState)(!1),u=n??o.promptInput.placeholder,c=(0,at.useCallback)(f=>{if(t?.(f),!f.defaultPrevented){if(f.key==="Enter"){if(l||f.nativeEvent.isComposing||f.shiftKey)return;f.preventDefault();let{form:p}=f.currentTarget;if(p?.querySelector('button[type="submit"]')?.disabled)return;p?.requestSubmit()}if(f.key==="Backspace"&&f.currentTarget.value===""&&i.files.length>0){f.preventDefault();let p=i.files.at(-1);p&&i.remove(p.id)}}},[t,l,i]),d=(0,at.useCallback)(f=>{let p=f.clipboardData?.items;if(!p)return;let m=[];for(let x of p)if(x.kind==="file"){let I=x.getAsFile();I&&m.push(I)}m.length>0&&(f.preventDefault(),i.add(m))},[i]);return(0,na.jsx)("textarea",{className:j("ww:field-sizing-content ww:max-h-48 ww:min-h-0 ww:w-full ww:resize-none ww:border-0 ww:bg-transparent ww:px-3 ww:py-2 ww:text-base ww:sm:text-sm ww:outline-none ww:placeholder:text-muted-foreground",a),name:"message",onCompositionEnd:()=>s(!1),onCompositionStart:()=>s(!0),onKeyDown:c,onPaste:d,placeholder:u,onChange:e,...r})},QI=({className:e,status:t,onStop:a,onClick:n,children:r,...o})=>{let{t:i}=Re(),l=t==="submitted"||t==="streaming",s=(0,na.jsx)(Io,{className:"ww:size-4"});t==="submitted"?s=(0,na.jsx)(Is,{className:"ww:size-4 ww:animate-spin"}):t==="streaming"&&(s=(0,na.jsx)(Ls,{className:"ww:size-4"}));let u=(0,at.useCallback)(c=>{if(l&&a){c.preventDefault(),a();return}n?.(c)},[l,a,n]);return(0,na.jsx)(bn,{"aria-label":l?i.promptInput.stop:i.promptInput.submit,className:j("ww:bg-foreground ww:text-background ww:hover:bg-foreground ww:rounded-full",e),onClick:u,size:"icon-sm",type:l&&a?"button":"submit",variant:"ghost",...o,children:r??s})},YI=({className:e,children:t,...a})=>{let{t:n}=Re(),r=XI();return r.files.length>0?(0,na.jsxs)(bn,{className:j("ww:group ww:relative",e),onClick:()=>r.clear(),size:"icon-sm",type:"button",variant:"ghost","aria-label":n.promptInput.removeAttachments,...a,children:[(0,na.jsx)("span",{className:"ww:flex ww:size-5 ww:items-center ww:justify-center ww:rounded-full ww:bg-primary ww:text-[10px] ww:font-medium ww:text-primary-foreground ww:transition-opacity ww:group-hover:opacity-0",children:r.files.length}),(0,na.jsx)(Qn,{className:"ww:absolute ww:size-4 ww:opacity-0 ww:transition-opacity ww:group-hover:opacity-100"})]}):(0,na.jsx)(bn,{className:j(e),onClick:()=>r.openFileDialog(),size:"icon-sm",type:"button",variant:"ghost",...a,children:t??(0,na.jsx)(ks,{className:"ww:size-4"})})};var eC=z(ne(),1);function JI({text:e}){let{t}=Re();return e===!1?null:(0,eC.jsx)("span",{className:"ww:whitespace-nowrap ww:text-[10px] ww:sm:text-[11px] ww:text-muted-foreground ww:opacity-70",children:e||t.aiDisclaimer.default})}var pd=z(Le(),1);var ko=z(ne(),1),tC=({className:e,...t})=>(0,ko.jsx)("div",{className:j("ww:flex ww:flex-col ww:gap-1 ww:px-3 ww:py-2",e),...t}),aC=({className:e,...t})=>(0,ko.jsx)("li",{className:j("ww:group ww:flex ww:items-center ww:gap-2 ww:rounded-md ww:px-2 ww:py-1 ww:text-sm ww:transition-colors ww:hover:bg-muted",e),...t}),nC=({className:e,...t})=>(0,ko.jsx)("span",{className:j("ww:inline-block ww:size-2 ww:shrink-0 ww:rounded-full ww:border ww:border-muted-foreground/50",e),...t}),rC=({className:e,...t})=>(0,ko.jsx)("span",{className:j("ww:line-clamp-1 ww:grow ww:break-words ww:text-muted-foreground",e),...t}),oC=({className:e,...t})=>(0,ko.jsx)("div",{className:j("ww:flex ww:shrink-0 ww:gap-1 ww:opacity-0 ww:transition-opacity ww:group-hover:opacity-100",e),...t}),iC=({className:e,...t})=>(0,ko.jsx)(bn,{className:j("ww:size-auto ww:rounded ww:p-1 ww:text-muted-foreground ww:hover:bg-muted-foreground/10 ww:hover:text-foreground",e),size:"icon",type:"button",variant:"ghost",...t});var Ka=z(ne(),1),lC=(0,pd.memo)(({message:e,onRemove:t})=>{let{t:a}=Re(),n=(0,pd.useCallback)(()=>t(e.id),[t,e.id]);return(0,Ka.jsxs)(aC,{children:[(0,Ka.jsx)(nC,{}),(0,Ka.jsx)(rC,{children:e.text||a.chatQueue.attachmentFallback}),(0,Ka.jsx)(oC,{children:(0,Ka.jsx)(iC,{"aria-label":a.chatQueue.removeFromQueue,onClick:n,children:(0,Ka.jsx)(Qn,{className:"ww:size-3"})})})]})});lC.displayName="ChatQueueItem";function sC({queuedMessages:e,onRemove:t,className:a}){let{t:n}=Re();return e.length===0?null:(0,Ka.jsxs)(tC,{className:j("ww:border-t ww:border-border",a),children:[(0,Ka.jsx)("div",{className:"ww:text-[11px] ww:font-medium ww:text-muted-foreground ww:px-2",children:n.chatQueue.queued(e.length)}),(0,Ka.jsx)("ul",{children:e.map(r=>(0,Ka.jsx)(lC,{message:r,onRemove:t},r.id))})]})}var Ur=z(ne(),1),uC=({files:e,className:t,...a})=>e.length===0?null:(0,Ur.jsx)("div",{className:j("ww:flex ww:flex-wrap ww:gap-1.5",t),...a,children:e.map((n,r)=>(0,Ur.jsx)(tB,{file:n},r))});function tB({file:e}){let{t}=Re();return e.mediaType?.startsWith("image/")&&e.url?(0,Ur.jsx)("img",{src:e.url,alt:e.filename??t.attachments.attachmentFallback,className:"ww:h-16 ww:max-w-32 ww:rounded ww:object-cover"}):(0,Ur.jsxs)("span",{className:"ww:inline-flex ww:items-center ww:gap-1.5 ww:rounded ww:bg-background/20 ww:px-2 ww:py-1 ww:text-xs",children:[(0,Ur.jsx)(bs,{className:"ww:size-3 ww:shrink-0"}),(0,Ur.jsx)("span",{className:"ww:max-w-24 ww:truncate",children:e.filename??t.attachments.fileFallback})]})}var wa=z(Le(),1);var ht=z(Le(),1);wf();var qA=z(Le(),1);var HA=z(ne(),1),b5=({as:e="span",className:t,duration:a=2,style:n,children:r,...o})=>{let i={backgroundImage:"linear-gradient(90deg, var(--ww-color-muted-foreground) 0%, var(--ww-color-muted-foreground) 40%, var(--ww-color-foreground) 50%, var(--ww-color-muted-foreground) 60%, var(--ww-color-muted-foreground) 100%)",backgroundSize:"250% 100%",WebkitBackgroundClip:"text",backgroundClip:"text",color:"transparent",animation:`ww-shimmer ${a}s linear infinite`,...n};return(0,HA.jsx)(e,{"data-waniwani-shimmer":"",className:j("ww:inline-block",t),style:i,...o,children:r})},un=(0,qA.memo)(b5);un.displayName="Shimmer";var Jt=z(ne(),1),jA=(0,ht.createContext)(null);function VA(){let e=(0,ht.useContext)(jA);if(!e)throw new Error("Reasoning components must be used within <Reasoning>");return e}var S5=1e3,I5=1e3,ou=(0,ht.memo)(({className:e,isStreaming:t=!1,open:a,defaultOpen:n,onOpenChange:r,duration:o,children:i,...l})=>{let s=n??t,u=n===!1,c=a!==void 0,[d,f]=(0,ht.useState)(s),p=c?a:d,m=(0,ht.useCallback)(M=>{c||f(M),r?.(M)},[c,r]),[x,I]=(0,ht.useState)(void 0),y=o??x,w=(0,ht.useRef)(t),[g,b]=(0,ht.useState)(!1),T=(0,ht.useRef)(null);(0,ht.useEffect)(()=>{t?(w.current=!0,T.current===null&&(T.current=Date.now())):T.current!==null&&(I(Math.ceil((Date.now()-T.current)/I5)),T.current=null)},[t]),(0,ht.useEffect)(()=>{t&&!p&&!u&&m(!0)},[t,p,u,m]),(0,ht.useEffect)(()=>{if(w.current&&!t&&p&&!g){let M=setTimeout(()=>{m(!1),b(!0)},S5);return()=>clearTimeout(M)}},[t,p,g,m]);let S=(0,ht.useMemo)(()=>({isStreaming:t,isOpen:p,setIsOpen:m,duration:y}),[t,p,m,y]);return(0,Jt.jsx)(jA.Provider,{value:S,children:(0,Jt.jsx)("div",{className:j("ww:mb-4 ww:flex ww:flex-col ww:gap-2",e),"data-state":p?"open":"closed",style:{animation:"ww-fade-in 0.2s ease-out"},...l,children:i})})});ou.displayName="Reasoning";var iu=(0,ht.memo)(({className:e,children:t,getThinkingMessage:a,hideIcon:n=!1,onClick:r,...o})=>{let{t:i}=Re(),{isStreaming:l,isOpen:s,duration:u,setIsOpen:c}=VA(),f=a??((p,m)=>p||m===0?(0,Jt.jsx)(un,{duration:1.6,children:i.reasoning.thinking}):m===void 0?(0,Jt.jsx)("span",{children:i.reasoning.thoughtBrief}):(0,Jt.jsx)("span",{children:i.reasoning.thoughtForSeconds(m)}));return(0,Jt.jsx)("button",{type:"button","aria-expanded":s,onClick:p=>{c(!s),r?.(p)},className:j("ww:flex ww:w-full ww:items-center ww:gap-2 ww:text-sm ww:text-muted-foreground ww:transition-colors ww:hover:text-foreground",e),...o,children:t??(0,Jt.jsxs)(Jt.Fragment,{children:[!n&&(0,Jt.jsx)(Zn,{className:"ww:size-4 ww:shrink-0"}),f(l,u)]})})});iu.displayName="ReasoningTrigger";var lu=(0,ht.memo)(({className:e,children:t,...a})=>{let{isOpen:n}=VA();return(0,Jt.jsx)("div",{className:j("ww:grid ww:transition-[grid-template-rows,opacity] ww:duration-200 ww:ease-out",n?"ww:grid-rows-[1fr] ww:opacity-100":"ww:grid-rows-[0fr] ww:opacity-0"),children:(0,Jt.jsx)("div",{className:"ww:min-h-0 ww:overflow-hidden",children:(0,Jt.jsx)("div",{className:j("ww:text-sm ww:text-muted-foreground",e),...a,children:(0,Jt.jsx)(el,{children:t})})})})});lu.displayName="ReasoningContent";var Ce=z(ne(),1),C5=500,GA=(0,wa.createContext)(null);function WA(){let e=(0,wa.useContext)(GA);if(!e)throw new Error("ChainOfThought components must be used within <ChainOfThought>");return e}function $A({className:e,isWorking:t=!1,activeStep:a,open:n,defaultOpen:r=!1,onOpenChange:o,children:i,...l}){let s=n!==void 0,[u,c]=(0,wa.useState)(r),d=s?n:u,f=(0,wa.useCallback)(I=>{s||c(I),o?.(I)},[s,o]),[p,m]=(0,wa.useState)(!t);(0,wa.useEffect)(()=>{if(t){m(!1);return}let I=setTimeout(()=>m(!0),C5);return()=>clearTimeout(I)},[t]);let x=(0,wa.useMemo)(()=>({open:d,setOpen:f,isWorking:t,settled:p,activeStep:a}),[d,f,t,p,a]);return(0,Ce.jsx)(GA.Provider,{value:x,children:(0,Ce.jsx)("div",{className:j("ww:mb-4 ww:flex ww:flex-col ww:gap-2",e),"data-state":d?"open":"closed",style:{animation:"ww-fade-in 0.2s ease-out"},...l,children:i})})}function XA({className:e,label:t,workingLabel:a,children:n,...r}){let{open:o,setOpen:i,isWorking:l,settled:s,activeStep:u}=WA();if(!s){let c=u?.icon,d=u?.label??a??t??"";return(0,Ce.jsx)("div",{className:j("ww:flex ww:min-h-5 ww:w-full ww:items-center ww:gap-1.5 ww:text-sm ww:text-muted-foreground",e),children:(0,Ce.jsxs)("span",{className:"ww:flex ww:min-w-0 ww:items-center ww:gap-1.5",style:{animation:"ww-fade-in 0.25s ease-out"},children:[c&&(0,Ce.jsx)(c,{className:j("ww:size-4 ww:shrink-0",l&&"ww:animate-pulse")}),(0,Ce.jsx)("span",{className:"ww:truncate",children:l?(0,Ce.jsx)(un,{duration:2.6,children:d}):d})]},d)})}return(0,Ce.jsxs)("button",{type:"button",onClick:()=>i(!o),"aria-expanded":o,className:j("ww:flex ww:min-h-5 ww:w-full ww:items-center ww:gap-1.5 ww:text-sm ww:text-muted-foreground ww:transition-colors ww:hover:text-foreground",e),style:{animation:"ww-fade-in 0.25s ease-out"},...r,children:[(0,Ce.jsx)("span",{className:"ww:truncate",children:n??t}),(0,Ce.jsx)(Br,{className:j("ww:size-4 ww:shrink-0 ww:transition-transform ww:duration-200",o&&"ww:rotate-180")})]})}function KA({className:e,children:t,...a}){let{open:n}=WA();return(0,Ce.jsx)("div",{className:j("ww:grid ww:transition-[grid-template-rows,opacity] ww:duration-200 ww:ease-out",n?"ww:grid-rows-[1fr] ww:opacity-100":"ww:grid-rows-[0fr] ww:opacity-0"),children:(0,Ce.jsx)("div",{className:"ww:min-h-0 ww:overflow-hidden",children:(0,Ce.jsx)("div",{className:j("ww:flex ww:flex-col",e),...a,children:t})})})}function ZA({icon:e,isLast:t,running:a,error:n}){return(0,Ce.jsxs)("div",{className:"ww:flex ww:flex-col ww:items-center ww:self-stretch",children:[(0,Ce.jsx)("span",{className:"ww:flex ww:h-5 ww:items-center",children:(0,Ce.jsx)(e,{className:j("ww:size-4 ww:shrink-0",n?"ww:text-destructive":a?"ww:animate-pulse ww:text-foreground":"ww:text-muted-foreground")})}),!t&&(0,Ce.jsx)("span",{className:"ww:w-px ww:flex-1 ww:bg-border"})]})}function Ow({className:e,icon:t,title:a,state:n,isLast:r=!1,children:o,...i}){let l=n==="input-available"||n==="input-streaming",s=n==="output-error",u=o!=null,[c,d]=(0,wa.useState)(!1),f=a??"",p=l?(0,Ce.jsx)(un,{duration:1.6,children:f}):(0,Ce.jsx)("span",{className:"ww:truncate",children:f});return(0,Ce.jsxs)("div",{className:j("ww:flex ww:gap-2",e),...i,children:[(0,Ce.jsx)(ZA,{icon:t,isLast:r,running:l,error:s}),(0,Ce.jsxs)("div",{className:j("ww:min-w-0 ww:flex-1",!r&&"ww:pb-3"),children:[u?(0,Ce.jsxs)("button",{type:"button",onClick:()=>d(m=>!m),"aria-expanded":c,className:"ww:flex ww:w-full ww:items-center ww:gap-1.5 ww:text-left ww:text-sm ww:text-muted-foreground ww:transition-colors ww:hover:text-foreground",children:[p,(0,Ce.jsx)(Br,{className:j("ww:size-3.5 ww:shrink-0 ww:transition-transform ww:duration-200",c&&"ww:rotate-180")})]}):(0,Ce.jsx)("div",{className:"ww:flex ww:items-center ww:text-sm ww:text-muted-foreground",children:p}),u&&(0,Ce.jsx)("div",{className:j("ww:grid ww:transition-[grid-template-rows,opacity] ww:duration-200 ww:ease-out",c?"ww:grid-rows-[1fr] ww:opacity-100":"ww:grid-rows-[0fr] ww:opacity-0"),children:(0,Ce.jsx)("div",{className:"ww:min-h-0 ww:overflow-hidden",children:(0,Ce.jsx)("div",{className:"ww:mt-2 ww:space-y-3 ww:rounded-lg ww:border ww:border-border ww:bg-background ww:p-3",children:o})})})]})]})}function QA({isStreaming:e=!1,isLast:t=!1,children:a}){return(0,Ce.jsxs)("div",{className:"ww:flex ww:gap-2",children:[(0,Ce.jsx)(ZA,{icon:Zn,isLast:t,running:e}),(0,Ce.jsx)("div",{className:j("ww:min-w-0 ww:flex-1",!t&&"ww:pb-3"),children:(0,Ce.jsxs)(ou,{isStreaming:e,className:"ww:mb-0",children:[(0,Ce.jsx)(iu,{hideIcon:!0}),(0,Ce.jsx)(lu,{children:a})]})})]})}var Pw={name:"cjk-noop",type:"cjk",remarkPluginsBefore:[],remarkPluginsAfter:[],remarkPlugins:[]};var YA={name:"shiki-noop",type:"code-highlighter",supportsLanguage:()=>!1,getSupportedLanguages:()=>[],getThemes:()=>["github-light","github-dark"],highlight:()=>null};var tR=z(Le(),1);var or=z(Le(),1),k5=5,JA=400;function eR(e,t,a={}){let{msPerChar:n=k5}=a,[r,o]=(0,or.useState)(t?"":e),i=(0,or.useRef)(e),l=(0,or.useRef)(t?0:e.length),s=(0,or.useRef)(0),u=(0,or.useRef)(null);return(e.length<l.current||!e.startsWith(r.slice(0,l.current)))&&(l.current=t?0:e.length),i.current=e,(0,or.useEffect)(()=>{if(!t){u.current!==null&&(cancelAnimationFrame(u.current),u.current=null),l.current=e.length,o(e);return}if(i.current.length-l.current>JA&&(l.current=i.current.length-JA),u.current!==null)return;let d=f=>{let p=i.current;if(l.current>=p.length){u.current=null;return}s.current===0&&(s.current=f);let m=f-s.current;if(m>=n){let x=Math.min(Math.floor(m/n),p.length-l.current);l.current+=x,o(p.slice(0,l.current)),s.current=f}u.current=requestAnimationFrame(d)};return u.current=requestAnimationFrame(d),()=>{u.current!==null&&(cancelAnimationFrame(u.current),u.current=null)}},[e,t,n]),r}var su=z(ne(),1),Nw=({className:e,from:t,children:a,...n})=>(0,su.jsx)("div",{className:j("ww-message ww:group ww:flex ww:w-full",t==="user"?"ww-message-user is-user ww:ml-auto ww:flex-col ww:items-end ww:[max-width:var(--ww-msg-max-width,80%)]":"ww-message-assistant is-assistant ww:flex-col",e),...n,children:(0,su.jsx)("div",{className:j("ww:flex ww:min-w-0 ww:flex-col ww:gap-2","ww:w-full"),children:a})}),Bw=({children:e,className:t,...a})=>(0,su.jsx)("div",{className:j("ww-bubble ww:flex ww:w-fit ww:min-w-0 ww:max-w-full ww:flex-col ww:gap-2 ww:overflow-hidden","ww:[font-size:var(--ww-font-size,1rem)] ww:[line-height:var(--ww-line-height,1.5)]","ww:group-[.is-user]:ml-auto ww:group-[.is-user]:bg-user-bubble ww:group-[.is-user]:[color:var(--ww-color-user-bubble-text)] ww:group-[.is-user]:[border-radius:var(--ww-msg-radius,8px)] ww:group-[.is-user]:[padding:var(--ww-msg-pad-y,12px)_var(--ww-msg-pad-x,16px)]","ww:group-[.is-assistant]:text-foreground",t),...a,children:e}),L5={cjk:Pw,code:YA},T5={cjk:Pw},E5={enabled:!1};function M5({className:e,linkSafety:t,isStreaming:a,children:n,...r}){let i=eR(typeof n=="string"?n:"",!!a),l=typeof n=="string"?i:n;return(0,su.jsx)(el,{className:j("ww:size-full ww:[&>*:first-child]:mt-0 ww:[&>*:last-child]:mb-0",e),linkSafety:t??E5,plugins:a?T5:L5,...r,children:l})}var If=(0,tR.memo)(M5,(e,t)=>e.children===t.children&&e.isStreaming===t.isStreaming);If.displayName="MessageResponse";var Bt=z(Le(),1);var ge=z(ne(),1);function A5(e,t=80){if(e==null)return String(e);if(typeof e!="object")return String(e).slice(0,t);if(Array.isArray(e))return`Array(${e.length})`;let a=JSON.stringify(e);if(a.length<=t)return a;let n=Object.entries(e),r=[],o=t-2;for(let[i,l]of n){if(o<=8)break;let s=i.length>4?`${i.slice(0,4)}\u2026`:i,u;typeof l=="string"?u=l.length>2?`'${l.slice(0,1)}\u2026`:`'${l}'`:Array.isArray(l)?u=`Array(${l.length})`:typeof l=="object"&&l!==null?u="{\u2026}":u=String(l);let c=`${s}\u2009${u}`;r.push(c),o-=c.length+3}return`{${r.join(", ")}}`}function R5({text:e,className:t}){let{t:a}=Re(),[n,r]=(0,Bt.useState)(!1),o=(0,Bt.useRef)(null);(0,Bt.useEffect)(()=>()=>{o.current&&clearTimeout(o.current)},[]);let i=(0,Bt.useCallback)(async l=>{l.stopPropagation();try{await navigator.clipboard.writeText(e),r(!0),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>r(!1),2e3)}catch{}},[e]);return(0,ge.jsx)(bn,{variant:"ghost",size:"sm",onClick:i,className:j("ww:h-auto ww:gap-1 ww:px-1.5 ww:py-0.5 ww:text-xs ww:text-muted-foreground ww:hover:text-foreground",t),children:n?(0,ge.jsxs)(ge.Fragment,{children:[(0,ge.jsx)(ws,{className:"ww:size-3.5"}),(0,ge.jsx)("span",{children:a.tool.copied})]}):(0,ge.jsxs)(ge.Fragment,{children:[(0,ge.jsx)(vs,{className:"ww:size-3.5"}),(0,ge.jsx)("span",{children:a.tool.copy})]})})}function rR({data:e,label:t,className:a,...n}){let[r,o]=(0,Bt.useState)(!1),i=(0,Bt.useMemo)(()=>JSON.stringify(e,null,2),[e]),l=A5(e);return(0,ge.jsxs)("div",{className:j("ww:rounded-lg ww:bg-tool-card",a),...n,children:[(0,ge.jsxs)("div",{className:"ww:flex ww:items-center ww:justify-between ww:px-3 ww:pt-2.5 ww:pb-1.5",children:[(0,ge.jsx)("span",{className:"ww:text-xs ww:font-medium ww:text-muted-foreground",children:t}),(0,ge.jsx)(R5,{text:i})]}),(0,ge.jsxs)("button",{type:"button",onClick:()=>o(s=>!s),className:"ww:flex ww:w-full ww:items-start ww:gap-2 ww:px-3 ww:pb-3 ww:text-left",children:[(0,ge.jsx)(xs,{className:j("ww:mt-0.5 ww:size-3.5 ww:shrink-0 ww:text-muted-foreground ww:transition-transform ww:duration-150",r&&"ww:rotate-90")}),r?(0,ge.jsx)("pre",{className:"ww:overflow-x-auto ww:text-xs ww:font-mono ww:text-foreground ww:whitespace-pre-wrap ww:break-all",children:(0,ge.jsx)("code",{children:i})}):(0,ge.jsx)("span",{className:"ww:truncate ww:text-xs ww:font-mono ww:text-foreground/80",children:l})]})]})}var Fw=(0,Bt.createContext)({open:!1,toggle:()=>{}});function oR({className:e,defaultOpen:t=!1,children:a,...n}){let[r,o]=(0,Bt.useState)(t);return(0,ge.jsx)(Fw.Provider,{value:{open:r,toggle:()=>o(i=>!i)},children:(0,ge.jsx)("div",{className:j("ww:mb-4 ww:w-full",e),"data-state":r?"open":"closed",style:{animation:"ww-fade-in 0.2s ease-out"},...n,children:a})})}function iR({className:e,title:t,state:a,...n}){let{open:r,toggle:o}=(0,Bt.useContext)(Fw),i=a==="input-available"||a==="input-streaming",l=t??"";return(0,ge.jsxs)("button",{type:"button",onClick:o,className:j("ww:flex ww:w-full ww:items-center ww:gap-2 ww:text-sm ww:text-muted-foreground ww:transition-colors ww:hover:text-foreground",e),"aria-expanded":r,...n,children:[(0,ge.jsx)(Co,{className:"ww:size-4 ww:shrink-0"}),(0,ge.jsx)("span",{className:"ww:truncate",children:i?(0,ge.jsx)(un,{duration:1.6,children:l}):l}),(0,ge.jsx)(Br,{className:j("ww:size-4 ww:shrink-0 ww:transition-transform ww:duration-200",r&&"ww:rotate-180")})]})}function lR({className:e,title:t,state:a,...n}){let r=a==="input-available"||a==="input-streaming",o=t??"";return(0,ge.jsx)("div",{className:j("ww:mb-4 ww:flex ww:items-center ww:gap-2 ww:text-sm ww:text-muted-foreground",e),style:{animation:"ww-fade-in 0.2s ease-out"},...n,children:(0,ge.jsx)("span",{className:"ww:truncate",children:r?(0,ge.jsx)(un,{duration:1.6,children:o}):o})})}function sR({className:e,children:t,...a}){let{open:n}=(0,Bt.useContext)(Fw);return(0,ge.jsx)("div",{className:j("ww:grid ww:transition-[grid-template-rows,opacity] ww:duration-200 ww:ease-out",n?"ww:grid-rows-[1fr] ww:opacity-100":"ww:grid-rows-[0fr] ww:opacity-0"),children:(0,ge.jsx)("div",{className:"ww:min-h-0 ww:overflow-hidden",children:(0,ge.jsx)("div",{className:j("ww:mt-2 ww:space-y-3 ww:rounded-lg ww:border ww:border-border ww:bg-background ww:p-3",e),...a,children:t})})})}function zw({className:e,input:t,debug:a,...n}){let{t:r}=Re(),o=(0,Bt.useMemo)(()=>{if(!a&&typeof t=="object"&&t!==null&&!Array.isArray(t)){let{_meta:i,...l}=t;return l}return t},[t,a]);return(0,ge.jsx)(rR,{data:o,label:r.tool.request,className:e,...n})}function Uw(e){if(!(typeof e!="object"||e===null))return e}function uR(e){return Uw(e?.ui)}function cR(e){return Uw(Uw(e)?._meta)}function aR(e){if(!e)return;let t=uR(e)?.resourceUri;if(typeof t=="string"&&t.length>0)return t;let a=e["ui/resourceUri"];if(typeof a=="string"&&a.length>0)return a;let n=e["openai/outputTemplate"];if(typeof n=="string"&&n.length>0)return n}function nR(e){return uR(e)?.autoHeight===!0}function uu(e,t,a){if(e){let n=aR(a?.[e]?._meta);if(n)return n}return aR(cR(t))}function dR(e,t,a){return e&&nR(a?.[e]?._meta)?!0:nR(cR(t))}function qw({className:e,output:t,errorText:a,debug:n,...r}){let{t:o}=Re(),i=(0,Bt.useMemo)(()=>{if(!n&&typeof t=="object"&&t!==null&&!Array.isArray(t)){let{_meta:l,...s}=t;return s}return t},[t,n]);return t||a?a?(0,ge.jsxs)("div",{className:j("ww:space-y-2",e),...r,children:[(0,ge.jsx)("h4",{className:"ww:text-xs ww:font-medium ww:uppercase ww:tracking-wide ww:text-muted-foreground",children:o.tool.error}),(0,ge.jsx)("div",{className:"ww:rounded-lg ww:bg-destructive/10 ww:p-3 ww:text-xs ww:text-destructive",children:a})]}):(0,ge.jsx)(rR,{data:i,label:o.tool.response,className:e,...r}):null}var cu=z(ne(),1);function fR(e){return e.type==="text"||e.type==="reasoning"||e.type==="file"||"toolCallId"in e}function pR(e){return e.parts.some(fR)}function mR(e,t,a){if(t!=="submitted"&&t!=="streaming")return!1;let n=e[e.length-1];return!n||n.role!=="assistant"?!0:!n.parts.some(o=>!(!fR(o)||a?.ignoreToolParts&&"toolCallId"in o||a?.ignoreReasoningParts&&o.type==="reasoning"))}function hR({className:e,...t}){let{t:a}=Re();return(0,cu.jsxs)("div",{"aria-live":"polite",className:j("ww:mb-4 ww:flex ww:w-full ww:items-center ww:gap-2 ww:text-sm ww:text-muted-foreground",e),style:{animation:"ww-fade-in 0.2s ease-out"},...t,children:[(0,cu.jsx)(Ts,{className:"ww:size-4 ww:shrink-0"}),(0,cu.jsx)(un,{duration:1.6,children:a.workingIndicator.default})]})}var Je=z(Le(),1);function tl(e){if(!e)return!1;let t=Array.isArray(e.content)&&e.content.length>0,a=typeof e.structuredContent=="object"&&e.structuredContent!==null&&Object.keys(e.structuredContent).length>0;return t||a}function gR(e,t){return!tl(e)&&!tl(t)?null:tl(e)?tl(t)?{...e.content||t.content?{content:[...e.content??[],...t.content??[]]}:{},...e.structuredContent||t.structuredContent?{structuredContent:{...e.structuredContent??{},...t.structuredContent??{}}}:{}}:{...e.content?{content:[...e.content]}:{},...e.structuredContent?{structuredContent:{...e.structuredContent}}:{}}:{...t?.content?{content:[...t.content]}:{},...t?.structuredContent?{structuredContent:{...t.structuredContent}}:{}}}var wR=z(ne(),1),D5="/api/mcp/resource",_5=500,O5=0,P5=16,N5="2026-01-26",B5=300,U5=3e3,F5=3;function z5(e){if(typeof e!="string")return;let t=e.trim();return t.length>0?t:void 0}function q5(e,t,a){return uu(e,t,a)?!1:t._meta?.["waniwani/autoInjectResultText"]!==!1}function yR({resourceUri:e,toolInput:t,toolResult:a,resourceEndpoint:n=D5,chatSessionId:r,isDark:o=!1,className:i,autoHeight:l=!1,onOpenLink:s,onFollowUp:u,onCallTool:c,onDisplayModeChange:d,isFullscreen:f=!1,toolDefinitions:p}){let m=(0,Je.useRef)(null),x=(0,Je.useRef)(t),I=(0,Je.useRef)(a),y=(0,Je.useRef)({width:0,height:0}),w=(0,Je.useRef)(null),g=(0,Je.useRef)(!1),b=(0,Je.useRef)(0),T=(0,Je.useRef)("inline"),[S,M]=(0,Je.useState)(O5),[R,_]=(0,Je.useState)(void 0),k=(0,Je.useRef)(s),G=(0,Je.useRef)(u),B=(0,Je.useRef)(c),U=(0,Je.useRef)(d),W=(0,Je.useRef)(r),A=(0,Je.useRef)(p);x.current=t,I.current=a,k.current=s,G.current=u,B.current=c,U.current=d,W.current=r,A.current=p;let H=(0,Je.useCallback)(v=>l?Math.max(v+P5,0):Math.min(Math.max(v,50),_5),[l]),$=(0,Je.useMemo)(()=>{let v=n.includes("?")?"&":"?";return`${n}${v}uri=${encodeURIComponent(e)}`},[n,e]),We=(0,Je.useRef)(o);We.current=o;let $e=(0,Je.useRef)(f);return(0,Je.useEffect)(()=>{$e.current=f,y.current.height=-1,w.current&&(w.current.cancel(),w.current=null)},[f]),(0,Je.useEffect)(()=>{if(!g.current)return;let v=m.current;v?.contentWindow&&v.contentWindow.postMessage({jsonrpc:"2.0",method:"ui/notifications/host-context-changed",params:{theme:o?"dark":"light"}},"*")},[o]),(0,Je.useEffect)(()=>{let v=m.current;if(!v)return;let De=!1,_e=!1,L=null,ke=null,St=setTimeout(()=>{if(De||_e||b.current>=F5)return;b.current+=1;let ve=new URL(v.src);ve.searchParams.set("_retry",String(b.current)),v.src=ve.toString()},U5),et=ve=>{v.contentWindow?.postMessage(ve,"*")},Ut=ve=>{if(De||ve.source!==v.contentWindow)return;let X=ve.data;if(!X||typeof X!="object"||X.jsonrpc!=="2.0")return;let pe=X.method,ue=X.id;if(pe==="ui/initialize"&&ue!=null){_e=!0,clearTimeout(St),et({jsonrpc:"2.0",id:ue,result:{protocolVersion:X.params?.protocolVersion??N5,hostInfo:{name:"Waniwani Chat",version:"1.0.0"},hostCapabilities:{openLinks:{},message:{text:{}},tools:{},updateModelContext:{text:{},structuredContent:{}}},hostContext:{theme:We.current?"dark":"light",displayMode:T.current}}});return}if(pe==="ui/notifications/initialized"){g.current=!0;let oe=x.current,ye=I.current,Xe=ye._meta&&typeof ye._meta=="object"?ye._meta:null,dt=z5(W.current),nt=Xe&&typeof Xe.waniwani=="object"&&Xe.waniwani!==null?Xe.waniwani:null,Mt=nt||dt?{...nt??{},...dt?{sessionId:dt}:{}}:void 0,K=Xe||Mt?{...Xe??{},...Mt?{waniwani:Mt}:{}}:void 0;et({jsonrpc:"2.0",method:"ui/notifications/tool-input",params:{arguments:oe}});let ce=ye.content??[{type:"text",text:JSON.stringify(ye)}];et({jsonrpc:"2.0",method:"ui/notifications/tool-result",params:{content:ce,structuredContent:ye.structuredContent,_meta:K,meta:K}});return}if(pe==="ui/notifications/size-changed"){let oe=X.params,ye=typeof oe?.height=="number"?oe.height:void 0,Xe=typeof oe?.width=="number"?oe.width:void 0,dt=y.current,nt=ye!==void 0&&ye!==dt.height,Mt=Xe!==void 0&&Xe!==dt.width;if(!nt&&!Mt)return;if(nt&&ye!==void 0){if(dt.height=ye,$e.current)return;let K=H(ye),ce=v.getBoundingClientRect().height;if(w.current&&(w.current.cancel(),w.current=null),M(K),v.animate&&Math.abs(ce-K)>2){let Ke=v.animate([{height:`${ce}px`},{height:`${K}px`}],{duration:B5,easing:"ease-out",fill:"forwards"});w.current=Ke,Ke.onfinish=()=>{w.current===Ke&&(Ke.cancel(),w.current=null)}}}Mt&&l&&Xe!==void 0&&(dt.width=Xe,_(Xe));return}if(pe==="ui/open-link"&&ue!=null){let oe=X.params?.url;typeof oe=="string"&&(k.current?k.current(oe):window.open(oe,"_blank","noopener,noreferrer")),et({jsonrpc:"2.0",id:ue,result:{}});return}if(pe==="ui/message"&&ue!=null){if(G.current&&X.params){let oe=X.params,ye=L;if(L=null,ke){clearTimeout(ke.timer);let Xe=ke.text;ke=null;let dt=(oe.content??[]).map(nt=>nt.text??"").join("").trim();oe={...oe,content:[{type:"text",text:`${dt}
|
|
111
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${ar(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:a}){let n=this.parser.parseInline(a),r=SM(e);if(r===null)return n;e=r;let o='<a href="'+e+'"';return t&&(o+=' title="'+ar(t)+'"'),o+=">"+n+"</a>",o}image({href:e,title:t,text:a,tokens:n}){n&&(a=this.parser.parseInline(n,this.parser.textRenderer));let r=SM(e);if(r===null)return ar(a);e=r;let o=`<img src="${e}" alt="${a}"`;return t&&(o+=` title="${ar(t)}"`),o+=">",o}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:ar(e.text)}},dw=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}},on=class aw{constructor(t){Z(this,"options");Z(this,"renderer");Z(this,"textRenderer");this.options=t||jo,this.options.renderer=this.options.renderer||new df,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new dw}static parse(t,a){return new aw(a).parse(t)}static parseInline(t,a){return new aw(a).parseInline(t)}parse(t){let a="";for(let n=0;n<t.length;n++){let r=t[n];if(this.options.extensions?.renderers?.[r.type]){let l=r,i=this.options.extensions.renderers[l.type].call({parser:this},l);if(i!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){a+=i||"";continue}}let o=r;switch(o.type){case"space":{a+=this.renderer.space(o);break}case"hr":{a+=this.renderer.hr(o);break}case"heading":{a+=this.renderer.heading(o);break}case"code":{a+=this.renderer.code(o);break}case"table":{a+=this.renderer.table(o);break}case"blockquote":{a+=this.renderer.blockquote(o);break}case"list":{a+=this.renderer.list(o);break}case"checkbox":{a+=this.renderer.checkbox(o);break}case"html":{a+=this.renderer.html(o);break}case"def":{a+=this.renderer.def(o);break}case"paragraph":{a+=this.renderer.paragraph(o);break}case"text":{a+=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 a}parseInline(t,a=this.renderer){let n="";for(let r=0;r<t.length;r++){let o=t[r];if(this.options.extensions?.renderers?.[o.type]){let i=this.options.extensions.renderers[o.type].call({parser:this},o);if(i!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){n+=i||"";continue}}let l=o;switch(l.type){case"escape":{n+=a.text(l);break}case"html":{n+=a.html(l);break}case"link":{n+=a.link(l);break}case"image":{n+=a.image(l);break}case"checkbox":{n+=a.checkbox(l);break}case"strong":{n+=a.strong(l);break}case"em":{n+=a.em(l);break}case"codespan":{n+=a.codespan(l);break}case"br":{n+=a.br(l);break}case"del":{n+=a.del(l);break}case"text":{n+=a.text(l);break}default:{let i='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(i),"";throw new Error(i)}}}return n}},Qs=(sf=class{constructor(e){Z(this,"options");Z(this,"block");this.options=e||jo}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?_a.lex:_a.lexInline}provideParser(){return this.block?on.parse:on.parseInline}},Z(sf,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Z(sf,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),sf),uq=class{constructor(...e){Z(this,"defaults",nw());Z(this,"options",this.setOptions);Z(this,"parse",this.parseMarkdown(!0));Z(this,"parseInline",this.parseMarkdown(!1));Z(this,"Parser",on);Z(this,"Renderer",df);Z(this,"TextRenderer",dw);Z(this,"Lexer",_a);Z(this,"Tokenizer",cf);Z(this,"Hooks",Qs);this.use(...e)}walkTokens(e,t){let a=[];for(let n of e)switch(a=a.concat(t.call(this,n)),n.type){case"table":{let r=n;for(let o of r.header)a=a.concat(this.walkTokens(o.tokens,t));for(let o of r.rows)for(let l of o)a=a.concat(this.walkTokens(l.tokens,t));break}case"list":{let r=n;a=a.concat(this.walkTokens(r.items,t));break}default:{let r=n;this.defaults.extensions?.childTokens?.[r.type]?this.defaults.extensions.childTokens[r.type].forEach(o=>{let l=r[o].flat(1/0);a=a.concat(this.walkTokens(l,t))}):r.tokens&&(a=a.concat(this.walkTokens(r.tokens,t)))}}return a}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(a=>{let n={...a};if(n.async=this.defaults.async||n.async||!1,a.extensions&&(a.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let o=t.renderers[r.name];o?t.renderers[r.name]=function(...l){let i=r.renderer.apply(this,l);return i===!1&&(i=o.apply(this,l)),i}:t.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=t[r.level];o?o.unshift(r.tokenizer):t[r.level]=[r.tokenizer],r.start&&(r.level==="block"?t.startBlock?t.startBlock.push(r.start):t.startBlock=[r.start]:r.level==="inline"&&(t.startInline?t.startInline.push(r.start):t.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(t.childTokens[r.name]=r.childTokens)}),n.extensions=t),a.renderer){let r=this.defaults.renderer||new df(this.defaults);for(let o in a.renderer){if(!(o in r))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let l=o,i=a.renderer[l],s=r[l];r[l]=(...u)=>{let c=i.apply(r,u);return c===!1&&(c=s.apply(r,u)),c||""}}n.renderer=r}if(a.tokenizer){let r=this.defaults.tokenizer||new cf(this.defaults);for(let o in a.tokenizer){if(!(o in r))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let l=o,i=a.tokenizer[l],s=r[l];r[l]=(...u)=>{let c=i.apply(r,u);return c===!1&&(c=s.apply(r,u)),c}}n.tokenizer=r}if(a.hooks){let r=this.defaults.hooks||new Qs;for(let o in a.hooks){if(!(o in r))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let l=o,i=a.hooks[l],s=r[l];Qs.passThroughHooks.has(o)?r[l]=u=>{if(this.defaults.async&&Qs.passThroughHooksRespectAsync.has(o))return(async()=>{let d=await i.call(r,u);return s.call(r,d)})();let c=i.call(r,u);return s.call(r,c)}:r[l]=(...u)=>{if(this.defaults.async)return(async()=>{let d=await i.apply(r,u);return d===!1&&(d=await s.apply(r,u)),d})();let c=i.apply(r,u);return c===!1&&(c=s.apply(r,u)),c}}n.hooks=r}if(a.walkTokens){let r=this.defaults.walkTokens,o=a.walkTokens;n.walkTokens=function(l){let i=[];return i.push(o.call(this,l)),r&&(i=i.concat(r.call(this,l))),i}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return _a.lex(e,t??this.defaults)}parser(e,t){return on.parse(e,t??this.defaults)}parseMarkdown(e){return(t,a)=>{let n={...a},r={...this.defaults,...n},o=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&n.async===!1)return o(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 t>"u"||t===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(r.hooks&&(r.hooks.options=r,r.hooks.block=e),r.async)return(async()=>{let l=r.hooks?await r.hooks.preprocess(t):t,i=await(r.hooks?await r.hooks.provideLexer():e?_a.lex:_a.lexInline)(l,r),s=r.hooks?await r.hooks.processAllTokens(i):i;r.walkTokens&&await Promise.all(this.walkTokens(s,r.walkTokens));let u=await(r.hooks?await r.hooks.provideParser():e?on.parse:on.parseInline)(s,r);return r.hooks?await r.hooks.postprocess(u):u})().catch(o);try{r.hooks&&(t=r.hooks.preprocess(t));let l=(r.hooks?r.hooks.provideLexer():e?_a.lex:_a.lexInline)(t,r);r.hooks&&(l=r.hooks.processAllTokens(l)),r.walkTokens&&this.walkTokens(l,r.walkTokens);let i=(r.hooks?r.hooks.provideParser():e?on.parse:on.parseInline)(l,r);return r.hooks&&(i=r.hooks.postprocess(i)),i}catch(l){return o(l)}}}onError(e,t){return a=>{if(a.message+=`
|
|
112
|
+
Please report this to https://github.com/markedjs/marked.`,e){let n="<p>An error occurred:</p><pre>"+ar(a.message+"",!0)+"</pre>";return t?Promise.resolve(n):n}if(t)return Promise.reject(a);throw a}}},Ho=new uq;Je.options=Je.setOptions=function(e){return Ho.setOptions(e),Je.defaults=Ho.defaults,kM(Je.defaults),Je};Je.getDefaults=nw;Je.defaults=jo;Je.use=function(...e){return Ho.use(...e),Je.defaults=Ho.defaults,kM(Je.defaults),Je};Je.walkTokens=function(e,t){return Ho.walkTokens(e,t)};Je.parseInline=Ho.parseInline;Je.Parser=on;Je.parser=on.parse;Je.Renderer=df;Je.TextRenderer=dw;Je.Lexer=_a;Je.lexer=_a.lex;Je.Tokenizer=cf;Je.Hooks=Qs;Je.parse=Je;nte=Je.options,rte=Je.setOptions,ote=Je.use,lte=Je.walkTokens,ite=Je.parseInline,ste=on.parse,ute=_a.lex});var BM={};Su(BM,{CodeBlock:()=>mq});var ln,wa,cq,dq,fq,pq,mq,UM=I(()=>{"use strict";"use client";mf();ln=z(De(),1),wa=z(te(),1),cq=ae("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"),dq=(0,ln.memo)(({children:e,result:t,language:a,className:n,...r})=>{let o=(0,ln.useMemo)(()=>({backgroundColor:t.bg,color:t.fg}),[t.bg,t.fg]);return(0,wa.jsx)("pre",{className:ae(n,"p-4 text-sm dark:bg-(--shiki-dark-bg)!"),"data-language":a,"data-streamdown":"code-block-body",style:o,...r,children:(0,wa.jsx)("code",{className:"[counter-increment:line_0] [counter-reset:line]",children:t.tokens.map((l,i)=>(0,wa.jsx)("span",{className:cq,children:l.map((s,u)=>(0,wa.jsx)("span",{className:"dark:bg-(--shiki-dark-bg)! dark:text-(--shiki-dark)!",style:{color:s.color,backgroundColor:s.bgColor,...s.htmlStyle},...s.htmlAttrs,children:s.content},u))},i))})})},(e,t)=>e.result===t.result&&e.language===t.language&&e.className===t.className),fq=({className:e,language:t,style:a,...n})=>(0,wa.jsx)("div",{className:ae("my-4 w-full overflow-hidden rounded-xl border border-border",e),"data-language":t,"data-streamdown":"code-block",style:{contentVisibility:"auto",containIntrinsicSize:"auto 200px",...a},...n}),pq=({language:e,children:t})=>(0,wa.jsxs)("div",{className:"flex items-center justify-between bg-muted/80 p-3 text-muted-foreground text-xs","data-language":e,"data-streamdown":"code-block-header",children:[(0,wa.jsx)("span",{className:"ml-1 font-mono lowercase",children:e}),(0,wa.jsx)("div",{className:"flex items-center gap-2",children:t})]}),mq=({code:e,language:t,className:a,children:n,...r})=>{let{shikiTheme:o}=(0,ln.useContext)(la),l=FM(),i=(0,ln.useMemo)(()=>({bg:"transparent",fg:"inherit",tokens:e.split(`
|
|
113
|
+
`).map(c=>[{content:c,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[e]),[s,u]=(0,ln.useState)(i);return(0,ln.useEffect)(()=>{if(!l){u(i);return}let c=l.highlight({code:e,language:t,themes:o},d=>{u(d)});if(c){u(c);return}u(i)},[e,t,o,l,i]),(0,wa.jsx)(fw.Provider,{value:{code:e},children:(0,wa.jsxs)(fq,{language:t,children:[(0,wa.jsx)(pq,{language:t,children:n}),(0,wa.jsx)(dq,{className:a,language:t,result:s,...r})]})})}});var zM={};Su(zM,{Mermaid:()=>pw});var qM=I(()=>{"use strict";"use client";mf()});function wq(e={}){let{immediate:t=!1,debounceDelay:a=hq,rootMargin:n=gq,idleTimeout:r=yq}=e,[o,l]=(0,_.useState)(!1),i=(0,_.useRef)(null),s=(0,_.useRef)(null),u=(0,_.useRef)(null),c=(0,_.useMemo)(()=>p=>{let m=Date.now();return window.setTimeout(()=>{p({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-m))})},1)},[]),d=(0,_.useMemo)(()=>typeof window<"u"&&window.requestIdleCallback?(p,m)=>window.requestIdleCallback(p,m):c,[c]),f=(0,_.useMemo)(()=>typeof window<"u"&&window.cancelIdleCallback?p=>window.cancelIdleCallback(p):p=>{clearTimeout(p)},[]);return(0,_.useEffect)(()=>{if(t){l(!0);return}let p=i.current;if(!p)return;s.current&&(clearTimeout(s.current),s.current=null),u.current&&(f(u.current),u.current=null);let m=()=>{s.current&&(clearTimeout(s.current),s.current=null),u.current&&(f(u.current),u.current=null)},x=g=>{u.current=d(C=>{C.timeRemaining()>0||C.didTimeout?(l(!0),g.disconnect()):u.current=d(()=>{l(!0),g.disconnect()},{timeout:r/2})},{timeout:r})},v=g=>{m(),s.current=window.setTimeout(()=>{var C,A;let S=g.takeRecords();(S.length===0||(A=(C=S.at(-1))==null?void 0:C.isIntersecting)!=null&&A)&&x(g)},a)},y=(g,C)=>{g.isIntersecting?v(C):m()},w=new IntersectionObserver(g=>{for(let C of g)y(C,w)},{rootMargin:n,threshold:0});return w.observe(p),()=>{s.current&&clearTimeout(s.current),u.current&&f(u.current),w.disconnect()}},[t,a,n,r,f,d]),{shouldRender:o,containerRef:i}}function wf(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 a=e.position.start,n=t.position.start,r=e.position.end,o=t.position.end;return a?.line===n?.line&&a?.column===n?.column&&r?.line===o?.line&&r?.column===o?.column}function St(e,t){return e.className===t.className&&wf(e.node,t.node)}var _,T,hq,gq,yq,xw,vw,yf,xq,vq,bq,KM,HM,Sq,Cq,ae,Jl,fw,ZM,jM,VM,Iq,GM,kq,Lq,eu,Tq,Aq,Mq,yw,QM,FM,bw,Eq,Rq,tu,Dq,_q,Oq,YM,JM,Pq,mw,Nq,Bq,Uq,Fq,zq,qq,Hq,ww,hf,Sw,eE,tE,aE,nE,jq,rE,oE,lE,iE,sE,uE,cE,dE,fE,pE,mE,hE,gE,yE,wE,xE,vE,Vq,bE,SE,CE,Gq,$M,WM,gf,$q,XM,IE,Wq,Xq,Kq,Zq,Qq,Yq,Jq,hw,e5,gw,kE,LE,TE,t5,a5,n5,r5,la,Cw,o5,ei,l5,pw,mf=I(()=>{"use strict";"use client";_=z(De(),1);rI();lI();kI();rL();wL();T=z(te(),1);Gh();Wh();cT();BT();VA();wM();NM();hq=300,gq="300px",yq=500;xw=e=>(0,T.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,T.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"})}),vw=e=>(0,T.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,T.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"})}),yf=e=>(0,T.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,T.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=>(0,T.jsxs)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:[(0,T.jsx)("path",{d:"M8 0V4",stroke:"currentColor",strokeWidth:"1.5"}),(0,T.jsx)("path",{d:"M8 16V12",opacity:"0.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,T.jsx)("path",{d:"M3.29773 1.52783L5.64887 4.7639",opacity:"0.9",stroke:"currentColor",strokeWidth:"1.5"}),(0,T.jsx)("path",{d:"M12.7023 1.52783L10.3511 4.7639",opacity:"0.1",stroke:"currentColor",strokeWidth:"1.5"}),(0,T.jsx)("path",{d:"M12.7023 14.472L10.3511 11.236",opacity:"0.4",stroke:"currentColor",strokeWidth:"1.5"}),(0,T.jsx)("path",{d:"M3.29773 14.472L5.64887 11.236",opacity:"0.6",stroke:"currentColor",strokeWidth:"1.5"}),(0,T.jsx)("path",{d:"M15.6085 5.52783L11.8043 6.7639",opacity:"0.2",stroke:"currentColor",strokeWidth:"1.5"}),(0,T.jsx)("path",{d:"M0.391602 10.472L4.19583 9.23598",opacity:"0.7",stroke:"currentColor",strokeWidth:"1.5"}),(0,T.jsx)("path",{d:"M15.6085 10.4722L11.8043 9.2361",opacity:"0.3",stroke:"currentColor",strokeWidth:"1.5"}),(0,T.jsx)("path",{d:"M0.391602 5.52783L4.19583 6.7639",opacity:"0.8",stroke:"currentColor",strokeWidth:"1.5"})]}),vq=e=>(0,T.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,T.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"})}),bq=e=>(0,T.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,T.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"})}),KM=e=>(0,T.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,T.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"})}),HM=e=>(0,T.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,T.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"})}),Sq=e=>(0,T.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,T.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"})}),Cq=e=>(0,T.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,T.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"})}),ae=(...e)=>$h(od(e)),Jl=(e,t,a)=>{let n=typeof t=="string"?new Blob([t],{type:a}):t,r=URL.createObjectURL(n),o=document.createElement("a");o.href=r,o.download=e,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(r)},fw=(0,_.createContext)({code:""}),ZM=()=>(0,_.useContext)(fw),jM=({onCopy:e,onError:t,timeout:a=2e3,children:n,className:r,code:o,...l})=>{let[i,s]=(0,_.useState)(!1),u=(0,_.useRef)(0),{code:c}=ZM(),{isAnimating:d}=(0,_.useContext)(la),f=o??c,p=async()=>{var x;if(typeof window>"u"||!((x=navigator?.clipboard)!=null&&x.writeText)){t?.(new Error("Clipboard API not available"));return}try{i||(await navigator.clipboard.writeText(f),s(!0),e?.(),u.current=window.setTimeout(()=>s(!1),a))}catch(v){t?.(v)}};(0,_.useEffect)(()=>()=>{window.clearTimeout(u.current)},[]);let m=i?xw:vw;return(0,T.jsx)("button",{className:ae("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",r),"data-streamdown":"code-block-copy-button",disabled:d,onClick:p,title:"Copy Code",type:"button",...l,children:n??(0,T.jsx)(m,{size:14})})},VM={"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",\u6587\u8A00:"wy"},Iq=({onDownload:e,onError:t,language:a,children:n,className:r,code:o,...l})=>{let{code:i}=ZM(),{isAnimating:s}=(0,_.useContext)(la),u=o??i,c=`file.${a&&a in VM?VM[a]:"txt"}`,d="text/plain",f=()=>{try{Jl(c,u,d),e?.()}catch(p){t?.(p)}};return(0,T.jsx)("button",{className:ae("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",r),"data-streamdown":"code-block-download-button",disabled:s,onClick:f,title:"Download file",type:"button",...l,children:n??(0,T.jsx)(yf,{size:14})})},GM=()=>(0,T.jsxs)("div",{className:"w-full divide-y divide-border overflow-hidden rounded-xl border border-border",children:[(0,T.jsx)("div",{className:"h-[46px] w-full bg-muted/80"}),(0,T.jsx)("div",{className:"flex w-full items-center justify-center p-4",children:(0,T.jsx)(xq,{className:"size-4 animate-spin"})})]}),kq=/\.[^/.]+$/,Lq=({node:e,className:t,src:a,alt:n,...r})=>{let o=async()=>{if(a)try{let l=await(await fetch(a)).blob(),i=new URL(a,window.location.origin).pathname.split("/").pop()||"",s=i.split(".").pop(),u=i.includes(".")&&s!==void 0&&s.length<=4,c="";if(u)c=i;else{let d=l.type,f="png";d.includes("jpeg")||d.includes("jpg")?f="jpg":d.includes("png")?f="png":d.includes("svg")?f="svg":d.includes("gif")?f="gif":d.includes("webp")&&(f="webp"),c=`${(n||i||"image").replace(kq,"")}.${f}`}Jl(c,l,l.type)}catch{window.open(a,"_blank")}};return a?(0,T.jsxs)("div",{className:"group relative my-4 inline-block","data-streamdown":"image-wrapper",children:[(0,T.jsx)("img",{alt:n,className:ae("max-w-full rounded-lg",t),"data-streamdown":"image",src:a,...r}),(0,T.jsx)("div",{className:"pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block"}),(0,T.jsx)("button",{className:ae("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:o,title:"Download image",type:"button",children:(0,T.jsx)(yf,{size:14})})]}):null},eu=0,Tq=()=>{eu+=1,eu===1&&(document.body.style.overflow="hidden")},Aq=()=>{eu=Math.max(0,eu-1),eu===0&&(document.body.style.overflow="")},Mq=({url:e,isOpen:t,onClose:a,onConfirm:n})=>{let[r,o]=(0,_.useState)(!1),l=(0,_.useCallback)(async()=>{try{await navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!1),2e3)}catch{}},[e]),i=(0,_.useCallback)(()=>{n(),a()},[n,a]);return(0,_.useEffect)(()=>{if(t){Tq();let s=u=>{u.key==="Escape"&&a()};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s),Aq()}}},[t,a]),t?(0,T.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm","data-streamdown":"link-safety-modal",onClick:a,onKeyDown:s=>{s.key==="Escape"&&a()},role:"button",tabIndex:0,children:(0,T.jsxs)("div",{className:"relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg",onClick:s=>s.stopPropagation(),onKeyDown:s=>s.stopPropagation(),role:"presentation",children:[(0,T.jsx)("button",{className:"absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground",onClick:a,title:"Close",type:"button",children:(0,T.jsx)(KM,{size:16})}),(0,T.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,T.jsxs)("div",{className:"flex items-center gap-2 font-semibold text-lg",children:[(0,T.jsx)(HM,{size:20}),(0,T.jsx)("span",{children:"Open external link?"})]}),(0,T.jsx)("p",{className:"text-muted-foreground text-sm",children:"You're about to visit an external website."})]}),(0,T.jsx)("div",{className:ae("break-all rounded-md bg-muted p-3 font-mono text-sm",e.length>100&&"max-h-32 overflow-y-auto"),children:e}),(0,T.jsxs)("div",{className:"flex gap-2",children:[(0,T.jsx)("button",{className:"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:l,type:"button",children:r?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(xw,{size:14}),(0,T.jsx)("span",{children:"Copied"})]}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(vw,{size:14}),(0,T.jsx)("span",{children:"Copy link"})]})}),(0,T.jsxs)("button",{className:"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:i,type:"button",children:[(0,T.jsx)(HM,{size:14}),(0,T.jsx)("span",{children:"Open link"})]})]})]})}):null},yw=(0,_.createContext)(null),QM=()=>(0,_.useContext)(yw),FM=()=>{var e;let t=QM();return(e=t?.code)!=null?e:null},bw=()=>{var e;let t=QM();return(e=t?.mermaid)!=null?e:null},Eq=(e,t)=>{var a;let n=(a=void 0)!=null?a:5;return new Promise((r,o)=>{let l="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(e))),i=new Image;i.crossOrigin="anonymous",i.onload=()=>{let s=document.createElement("canvas"),u=i.width*n,c=i.height*n;s.width=u,s.height=c;let d=s.getContext("2d");if(!d){o(new Error("Failed to create 2D canvas context for PNG export"));return}d.drawImage(i,0,0,u,c),s.toBlob(f=>{if(!f){o(new Error("Failed to create PNG blob"));return}r(f)},"image/png")},i.onerror=()=>o(new Error("Failed to load SVG image")),i.src=l})},Rq=({chart:e,children:t,className:a,onDownload:n,config:r,onError:o})=>{let[l,i]=(0,_.useState)(!1),s=(0,_.useRef)(null),{isAnimating:u}=(0,_.useContext)(la),c=bw(),d=async f=>{try{if(f==="mmd"){Jl("diagram.mmd",e,"text/plain"),i(!1),n?.(f);return}if(!c){o?.(new Error("Mermaid plugin not available"));return}let p=c.getMermaid(r),m=e.split("").reduce((y,w)=>(y<<5)-y+w.charCodeAt(0)|0,0),x=`mermaid-${Math.abs(m)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:v}=await p.render(x,e);if(!v){o?.(new Error("SVG not found. Please wait for the diagram to render."));return}if(f==="svg"){Jl("diagram.svg",v,"image/svg+xml"),i(!1),n?.(f);return}if(f==="png"){let y=await Eq(v);Jl("diagram.png",y,"image/png"),n?.(f),i(!1);return}}catch(p){o?.(p)}};return(0,_.useEffect)(()=>{let f=p=>{let m=p.composedPath();s.current&&!m.includes(s.current)&&i(!1)};return document.addEventListener("mousedown",f),()=>{document.removeEventListener("mousedown",f)}},[]),(0,T.jsxs)("div",{className:"relative",ref:s,children:[(0,T.jsx)("button",{className:ae("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",a),disabled:u,onClick:()=>i(!l),title:"Download diagram",type:"button",children:t??(0,T.jsx)(yf,{size:14})}),l?(0,T.jsxs)("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[(0,T.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>d("svg"),title:"Download diagram as SVG",type:"button",children:"SVG"}),(0,T.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>d("png"),title:"Download diagram as PNG",type:"button",children:"PNG"}),(0,T.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>d("mmd"),title:"Download diagram as MMD",type:"button",children:"MMD"})]}):null]})},tu=0,Dq=()=>{tu+=1,tu===1&&(document.body.style.overflow="hidden")},_q=()=>{tu=Math.max(0,tu-1),tu===0&&(document.body.style.overflow="")},Oq=({chart:e,config:t,onFullscreen:a,onExit:n,className:r,...o})=>{let[l,i]=(0,_.useState)(!1),{isAnimating:s,controls:u}=(0,_.useContext)(la),c=(()=>{if(typeof u=="boolean")return u;let f=u.mermaid;return f===!1?!1:f===!0||f===void 0?!0:f.panZoom!==!1})(),d=()=>{i(!l)};return(0,_.useEffect)(()=>{if(l){Dq();let f=p=>{p.key==="Escape"&&i(!1)};return document.addEventListener("keydown",f),()=>{document.removeEventListener("keydown",f),_q()}}},[l]),(0,_.useEffect)(()=>{l?a?.():n&&n()},[l,a,n]),(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("button",{className:ae("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",r),disabled:s,onClick:d,title:"View fullscreen",type:"button",...o,children:(0,T.jsx)(vq,{size:14})}),l?(0,T.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm",onClick:d,onKeyDown:f=>{f.key==="Escape"&&d()},role:"button",tabIndex:0,children:[(0,T.jsx)("button",{className:"absolute top-4 right-4 z-10 rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground",onClick:d,title:"Exit fullscreen",type:"button",children:(0,T.jsx)(KM,{size:20})}),(0,T.jsx)("div",{className:"flex size-full items-center justify-center p-4",onClick:f=>f.stopPropagation(),onKeyDown:f=>f.stopPropagation(),role:"presentation",children:(0,T.jsx)(pw,{chart:e,className:"size-full [&_svg]:h-auto [&_svg]:w-auto",config:t,fullscreen:!0,showControls:c})})]}):null]})},YM=e=>{var t,a;let n=[],r=[],o=e.querySelectorAll("thead th");for(let i of o)n.push(((t=i.textContent)==null?void 0:t.trim())||"");let l=e.querySelectorAll("tbody tr");for(let i of l){let s=[],u=i.querySelectorAll("td");for(let c of u)s.push(((a=c.textContent)==null?void 0:a.trim())||"");r.push(s)}return{headers:n,rows:r}},JM=e=>{let{headers:t,rows:a}=e,n=i=>{let s=!1,u=!1;for(let c of i){if(c==='"'){s=!0,u=!0;break}(c===","||c===`
|
|
114
|
+
`)&&(s=!0)}return s?u?`"${i.replace(/"/g,'""')}"`:`"${i}"`:i},r=t.length>0?a.length+1:a.length,o=new Array(r),l=0;t.length>0&&(o[l]=t.map(n).join(","),l+=1);for(let i of a)o[l]=i.map(n).join(","),l+=1;return o.join(`
|
|
115
|
+
`)},Pq=e=>{let{headers:t,rows:a}=e,n=i=>{let s=!1;for(let c of i)if(c===" "||c===`
|
|
116
|
+
`||c==="\r"){s=!0;break}if(!s)return i;let u=[];for(let c of i)c===" "?u.push("\\t"):c===`
|
|
117
|
+
`?u.push("\\n"):c==="\r"?u.push("\\r"):u.push(c);return u.join("")},r=t.length>0?a.length+1:a.length,o=new Array(r),l=0;t.length>0&&(o[l]=t.map(n).join(" "),l+=1);for(let i of a)o[l]=i.map(n).join(" "),l+=1;return o.join(`
|
|
118
|
+
`)},mw=e=>{let t=!1;for(let n of e)if(n==="\\"||n==="|"){t=!0;break}if(!t)return e;let a=[];for(let n of e)n==="\\"?a.push("\\\\"):n==="|"?a.push("\\|"):a.push(n);return a.join("")},Nq=e=>{let{headers:t,rows:a}=e;if(t.length===0)return"";let n=new Array(a.length+2),r=0,o=t.map(i=>mw(i));n[r]=`| ${o.join(" | ")} |`,r+=1;let l=new Array(t.length);for(let i=0;i<t.length;i+=1)l[i]="---";n[r]=`| ${l.join(" | ")} |`,r+=1;for(let i of a)if(i.length<t.length){let s=new Array(t.length);for(let u=0;u<t.length;u+=1)s[u]=u<i.length?mw(i[u]):"";n[r]=`| ${s.join(" | ")} |`,r+=1}else{let s=i.map(u=>mw(u));n[r]=`| ${s.join(" | ")} |`,r+=1}return n.join(`
|
|
119
|
+
`)},Bq=({children:e,className:t,onCopy:a,onError:n,timeout:r=2e3})=>{let[o,l]=(0,_.useState)(!1),[i,s]=(0,_.useState)(!1),u=(0,_.useRef)(null),c=(0,_.useRef)(0),{isAnimating:d}=(0,_.useContext)(la),f=async m=>{var x,v;if(typeof window>"u"||!((x=navigator?.clipboard)!=null&&x.write)){n?.(new Error("Clipboard API not available"));return}try{let y=(v=u.current)==null?void 0:v.closest('[data-streamdown="table-wrapper"]'),w=y?.querySelector("table");if(!w){n?.(new Error("Table not found"));return}let g=YM(w),C=m==="csv"?JM(g):Pq(g),A=new ClipboardItem({"text/plain":new Blob([C],{type:"text/plain"}),"text/html":new Blob([w.outerHTML],{type:"text/html"})});await navigator.clipboard.write([A]),s(!0),l(!1),a?.(m),c.current=window.setTimeout(()=>s(!1),r)}catch(y){n?.(y)}};(0,_.useEffect)(()=>{let m=x=>{let v=x.composedPath();u.current&&!v.includes(u.current)&&l(!1)};return document.addEventListener("mousedown",m),()=>{document.removeEventListener("mousedown",m),window.clearTimeout(c.current)}},[]);let p=i?xw:vw;return(0,T.jsxs)("div",{className:"relative",ref:u,children:[(0,T.jsx)("button",{className:ae("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:d,onClick:()=>l(!o),title:"Copy table",type:"button",children:e??(0,T.jsx)(p,{size:14})}),o?(0,T.jsxs)("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[(0,T.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>f("csv"),title:"Copy table as CSV",type:"button",children:"CSV"}),(0,T.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>f("tsv"),title:"Copy table as TSV",type:"button",children:"TSV"})]}):null]})},Uq=({children:e,className:t,onDownload:a,onError:n})=>{let[r,o]=(0,_.useState)(!1),l=(0,_.useRef)(null),{isAnimating:i}=(0,_.useContext)(la),s=u=>{var c;try{let d=(c=l.current)==null?void 0:c.closest('[data-streamdown="table-wrapper"]'),f=d?.querySelector("table");if(!f){n?.(new Error("Table not found"));return}let p=YM(f),m=u==="csv"?JM(p):Nq(p);Jl(`table.${u==="csv"?"csv":"md"}`,m,u==="csv"?"text/csv":"text/markdown"),o(!1),a?.(u)}catch(d){n?.(d)}};return(0,_.useEffect)(()=>{let u=c=>{let d=c.composedPath();l.current&&!d.includes(l.current)&&o(!1)};return document.addEventListener("mousedown",u),()=>{document.removeEventListener("mousedown",u)}},[]),(0,T.jsxs)("div",{className:"relative",ref:l,children:[(0,T.jsx)("button",{className:ae("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:i,onClick:()=>o(!r),title:"Download table",type:"button",children:e??(0,T.jsx)(yf,{size:14})}),r?(0,T.jsxs)("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[(0,T.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>s("csv"),title:"Download table as CSV",type:"button",children:"CSV"}),(0,T.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>s("markdown"),title:"Download table as Markdown",type:"button",children:"Markdown"})]}):null]})},Fq=({children:e,className:t,showControls:a,...n})=>(0,T.jsxs)("div",{className:"my-4 flex flex-col space-y-2","data-streamdown":"table-wrapper",children:[a?(0,T.jsxs)("div",{className:"flex items-center justify-end gap-1",children:[(0,T.jsx)(Bq,{}),(0,T.jsx)(Uq,{})]}):null,(0,T.jsx)("div",{className:"overflow-x-auto",children:(0,T.jsx)("table",{className:ae("w-full border-collapse border border-border",t),"data-streamdown":"table",...n,children:e})})]}),zq=(0,_.lazy)(()=>Promise.resolve().then(()=>(UM(),BM)).then(e=>({default:e.CodeBlock}))),qq=(0,_.lazy)(()=>Promise.resolve().then(()=>(qM(),zM)).then(e=>({default:e.Mermaid}))),Hq=/language-([^\s]+)/;ww=(e,t)=>typeof e=="boolean"?e:e[t]!==!1,hf=(e,t)=>{if(typeof e=="boolean")return e;let a=e.mermaid;return a===!1?!1:a===!0||a===void 0?!0:a[t]!==!1},Sw=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,T.jsx)("ol",{className:ae("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...n,children:e}),(e,t)=>St(e,t));Sw.displayName="MarkdownOl";eE=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,T.jsx)("li",{className:ae("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...n,children:e}),(e,t)=>e.className===t.className&&wf(e.node,t.node));eE.displayName="MarkdownLi";tE=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,T.jsx)("ul",{className:ae("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...n,children:e}),(e,t)=>St(e,t));tE.displayName="MarkdownUl";aE=(0,_.memo)(({className:e,node:t,...a})=>(0,T.jsx)("hr",{className:ae("my-6 border-border",e),"data-streamdown":"horizontal-rule",...a}),(e,t)=>St(e,t));aE.displayName="MarkdownHr";nE=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,T.jsx)("span",{className:ae("font-semibold",t),"data-streamdown":"strong",...n,children:e}),(e,t)=>St(e,t));nE.displayName="MarkdownStrong";jq=({children:e,className:t,href:a,node:n,...r})=>{let{linkSafety:o}=(0,_.useContext)(la),[l,i]=(0,_.useState)(!1),s=a==="streamdown:incomplete-link",u=(0,_.useCallback)(async p=>{if(!(!(o!=null&&o.enabled&&a)||s)){if(p.preventDefault(),o.onLinkCheck&&await o.onLinkCheck(a)){window.open(a,"_blank","noreferrer");return}i(!0)}},[o,a,s]),c=(0,_.useCallback)(()=>{a&&window.open(a,"_blank","noreferrer")},[a]),d=(0,_.useCallback)(()=>{i(!1)},[]),f={url:a??"",isOpen:l,onClose:d,onConfirm:c};return o!=null&&o.enabled&&a?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("button",{className:ae("wrap-anywhere appearance-none text-left font-medium text-primary underline",t),"data-incomplete":s,"data-streamdown":"link",onClick:u,type:"button",children:e}),o.renderModal?o.renderModal(f):(0,T.jsx)(Mq,{...f})]}):(0,T.jsx)("a",{className:ae("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":s,"data-streamdown":"link",href:a,rel:"noreferrer",target:"_blank",...r,children:e})},rE=(0,_.memo)(jq,(e,t)=>St(e,t)&&e.href===t.href);rE.displayName="MarkdownA";oE=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,T.jsx)("h1",{className:ae("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...n,children:e}),(e,t)=>St(e,t));oE.displayName="MarkdownH1";lE=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,T.jsx)("h2",{className:ae("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...n,children:e}),(e,t)=>St(e,t));lE.displayName="MarkdownH2";iE=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,T.jsx)("h3",{className:ae("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...n,children:e}),(e,t)=>St(e,t));iE.displayName="MarkdownH3";sE=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,T.jsx)("h4",{className:ae("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...n,children:e}),(e,t)=>St(e,t));sE.displayName="MarkdownH4";uE=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,T.jsx)("h5",{className:ae("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...n,children:e}),(e,t)=>St(e,t));uE.displayName="MarkdownH5";cE=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,T.jsx)("h6",{className:ae("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...n,children:e}),(e,t)=>St(e,t));cE.displayName="MarkdownH6";dE=(0,_.memo)(({children:e,className:t,node:a,...n})=>{let{controls:r}=(0,_.useContext)(la),o=ww(r,"table");return(0,T.jsx)(Fq,{className:t,showControls:o,...n,children:e})},(e,t)=>St(e,t));dE.displayName="MarkdownTable";fE=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,T.jsx)("thead",{className:ae("bg-muted/80",t),"data-streamdown":"table-header",...n,children:e}),(e,t)=>St(e,t));fE.displayName="MarkdownThead";pE=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,T.jsx)("tbody",{className:ae("divide-y divide-border bg-muted/40",t),"data-streamdown":"table-body",...n,children:e}),(e,t)=>St(e,t));pE.displayName="MarkdownTbody";mE=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,T.jsx)("tr",{className:ae("border-border border-b",t),"data-streamdown":"table-row",...n,children:e}),(e,t)=>St(e,t));mE.displayName="MarkdownTr";hE=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,T.jsx)("th",{className:ae("whitespace-nowrap px-4 py-2 text-left font-semibold text-sm",t),"data-streamdown":"table-header-cell",...n,children:e}),(e,t)=>St(e,t));hE.displayName="MarkdownTh";gE=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,T.jsx)("td",{className:ae("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...n,children:e}),(e,t)=>St(e,t));gE.displayName="MarkdownTd";yE=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,T.jsx)("blockquote",{className:ae("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),"data-streamdown":"blockquote",...n,children:e}),(e,t)=>St(e,t));yE.displayName="MarkdownBlockquote";wE=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,T.jsx)("sup",{className:ae("text-sm",t),"data-streamdown":"superscript",...n,children:e}),(e,t)=>St(e,t));wE.displayName="MarkdownSup";xE=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,T.jsx)("sub",{className:ae("text-sm",t),"data-streamdown":"subscript",...n,children:e}),(e,t)=>St(e,t));xE.displayName="MarkdownSub";vE=(0,_.memo)(({children:e,className:t,node:a,...n})=>{if("data-footnotes"in n){let r=l=>{var i,s;if(!(0,_.isValidElement)(l))return!1;let u=Array.isArray(l.props.children)?l.props.children:[l.props.children],c=!1,d=!1;for(let f of u)if(f){if(typeof f=="string")f.trim()!==""&&(c=!0);else if((0,_.isValidElement)(f))if(((i=f.props)==null?void 0:i["data-footnote-backref"])!==void 0)d=!0;else{let p=Array.isArray(f.props.children)?f.props.children:[f.props.children];for(let m of p){if(typeof m=="string"&&m.trim()!==""){c=!0;break}if((0,_.isValidElement)(m)&&((s=m.props)==null?void 0:s["data-footnote-backref"])===void 0){c=!0;break}}}}return d&&!c},o=Array.isArray(e)?e.map(l=>{if(!(0,_.isValidElement)(l))return l;if(l.type===Sw){let i=(Array.isArray(l.props.children)?l.props.children:[l.props.children]).filter(s=>!r(s));return i.length===0?null:{...l,props:{...l.props,children:i}}}return l}):e;return(Array.isArray(o)?o.some(l=>l!==null):o!==null)?(0,T.jsx)("section",{className:t,...n,children:o}):null}return(0,T.jsx)("section",{className:t,...n,children:e})},(e,t)=>St(e,t));vE.displayName="MarkdownSection";Vq=({node:e,className:t,children:a,...n})=>{var r,o,l;let i=((r=e?.position)==null?void 0:r.start.line)===((o=e?.position)==null?void 0:o.end.line),{mermaid:s,controls:u}=(0,_.useContext)(la),c=bw();if(i)return(0,T.jsx)("code",{className:ae("rounded bg-muted px-1.5 py-0.5 font-mono text-sm",t),"data-streamdown":"inline-code",...n,children:a});let d=t?.match(Hq),f=(l=d?.at(1))!=null?l:"",p="";if((0,_.isValidElement)(a)&&a.props&&typeof a.props=="object"&&"children"in a.props&&typeof a.props.children=="string"?p=a.props.children:typeof a=="string"&&(p=a),f==="mermaid"&&c){let x=ww(u,"mermaid"),v=hf(u,"download"),y=hf(u,"copy"),w=hf(u,"fullscreen"),g=hf(u,"panZoom"),C=x&&(v||y||w);return(0,T.jsx)(_.Suspense,{fallback:(0,T.jsx)(GM,{}),children:(0,T.jsxs)("div",{className:ae("group relative my-4 h-auto rounded-xl border p-4",t),"data-streamdown":"mermaid-block",children:[C?(0,T.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[v?(0,T.jsx)(Rq,{chart:p,config:s?.config}):null,y?(0,T.jsx)(jM,{code:p}):null,w?(0,T.jsx)(Oq,{chart:p,config:s?.config}):null]}):null,(0,T.jsx)(qq,{chart:p,config:s?.config,showControls:g})]})})}let m=ww(u,"code");return(0,T.jsx)(_.Suspense,{fallback:(0,T.jsx)(GM,{}),children:(0,T.jsx)(zq,{className:ae("overflow-x-auto border-border border-t",t),code:p,language:f,children:m?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(Iq,{code:p,language:f}),(0,T.jsx)(jM,{})]}):null})})},bE=(0,_.memo)(Vq,(e,t)=>e.className===t.className&&wf(e.node,t.node));bE.displayName="MarkdownCode";SE=(0,_.memo)(Lq,(e,t)=>e.className===t.className&&wf(e.node,t.node));SE.displayName="MarkdownImg";CE=(0,_.memo)(({children:e,className:t,node:a,...n})=>{var r,o;let l=(Array.isArray(e)?e:[e]).filter(i=>i!=null&&i!=="");if(l.length===1&&(0,_.isValidElement)(l[0])){let i=l[0].props.node,s=i?.tagName;if(s==="img")return(0,T.jsx)(T.Fragment,{children:e});if(s==="code"&&((r=i?.position)==null?void 0:r.start.line)!==((o=i?.position)==null?void 0:o.end.line))return(0,T.jsx)(T.Fragment,{children:e})}return(0,T.jsx)("p",{className:t,...n,children:e})},(e,t)=>St(e,t));CE.displayName="MarkdownParagraph";Gq={ol:Sw,li:eE,ul:tE,hr:aE,strong:nE,a:rE,h1:oE,h2:lE,h3:iE,h4:sE,h5:uE,h6:cE,table:dE,thead:fE,tbody:pE,tr:mE,th:hE,td:gE,blockquote:yE,code:bE,img:SE,pre:({children:e})=>e,sup:wE,sub:xE,p:CE,section:vE},$M=[],WM={allowDangerousHtml:!0},gf=new WeakMap,$q=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 a=e.rehypePlugins,n=e.remarkPlugins,r=e.remarkRehypeOptions;if(!(a||n||r)){let c="default";return this.keyCache.set(e,c),c}let o=c=>{if(!c||c.length===0)return"";let d="";for(let f=0;f<c.length;f+=1){let p=c[f];if(f>0&&(d+=","),Array.isArray(p)){let[m,x]=p;if(typeof m=="function"){let v=gf.get(m);v||(v=m.name,gf.set(m,v)),d+=v}else d+=String(m);d+=":",d+=JSON.stringify(x)}else if(typeof p=="function"){let m=gf.get(p);m||(m=p.name,gf.set(p,m)),d+=m}else d+=String(p)}return d},l=o(a),i=o(n),s=r?JSON.stringify(r):"",u=`${i}::${l}::${s}`;return this.keyCache.set(e,u),u}get(e){let t=this.generateCacheKey(e),a=this.cache.get(t);return a&&(this.cache.delete(t),this.cache.set(t,a)),a}set(e,t){let a=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let n=this.cache.keys().next().value;n&&this.cache.delete(n)}this.cache.set(a,t)}clear(){this.cache.clear()}},XM=new $q,IE=e=>{let t=Wq(e),a=e.children||"";return Kq(t.runSync(t.parse(a),a),e)},Wq=e=>{let t=XM.get(e);if(t)return t;let a=Xq(e);return XM.set(e,a),a},Xq=e=>{let t=e.rehypePlugins||$M,a=e.remarkPlugins||$M,n=e.remarkRehypeOptions?{...WM,...e.remarkRehypeOptions}:WM;return Jy().use(Yd).use(a).use(af,n).use(t)},Kq=(e,t)=>Dy(e,{Fragment:T.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:T.jsx,jsxs:T.jsxs,passKeys:!0,passNode:!0}),Zq=/\[\^[^\]\s]{1,200}\](?!:)/,Qq=/\[\^[^\]\s]{1,200}\]:/,Yq=/<\/(\w+)>/,Jq=/<(\w+)[\s>]/,hw=e=>{let t=0;for(;t<e.length&&(e[t]===" "||e[t]===" "||e[t]===`
|
|
120
|
+
`||e[t]==="\r");)t+=1;return t+1<e.length&&e[t]==="$"&&e[t+1]==="$"},e5=e=>{let t=e.length-1;for(;t>=0&&(e[t]===" "||e[t]===" "||e[t]===`
|
|
121
|
+
`||e[t]==="\r");)t-=1;return t>=1&&e[t]==="$"&&e[t-1]==="$"},gw=e=>{let t=0;for(let a=0;a<e.length-1;a+=1)e[a]==="$"&&e[a+1]==="$"&&(t+=1,a+=1);return t},kE=e=>{let t=Zq.test(e),a=Qq.test(e);if(t||a)return[e];let n=_a.lex(e,{gfm:!0}),r=[],o=[];for(let l of n){let i=l.raw,s=r.length;if(o.length>0){if(r[s-1]+=i,l.type==="html"){let u=i.match(Yq);if(u){let c=u[1];o.at(-1)===c&&o.pop()}}continue}if(l.type==="html"&&l.block){let u=i.match(Jq);if(u){let c=u[1];i.includes(`</${c}>`)||o.push(c)}}if(i.trim()==="$$"&&s>0){let u=r[s-1],c=hw(u),d=gw(u);if(c&&d%2===1){r[s-1]=u+i;continue}}if(s>0&&e5(i)){let u=r[s-1],c=hw(u),d=gw(u),f=gw(i);if(c&&d%2===1&&!hw(i)&&f===1){r[s-1]=u+i;continue}}r.push(i)}return r},LE={raw:oI,sanitize:[wd,{}],harden:[nI,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},TE={gfm:[jd,{}]},t5=Object.values(LE),a5=Object.values(TE),n5={block:" \u258B",circle:" \u25CF"},r5={shikiTheme:["github-light","github-dark"],controls:!0,isAnimating:!1,mode:"streaming",mermaid:void 0,linkSafety:{enabled:!0}},la=(0,_.createContext)(r5),Cw=(0,_.memo)(({content:e,shouldParseIncompleteMarkdown:t,index:a,...n})=>(0,T.jsx)(IE,{...n,children:e}),(e,t)=>{if(e.content!==t.content||e.index!==t.index)return!1;if(e.components!==t.components){let a=Object.keys(e.components||{}),n=Object.keys(t.components||{});if(a.length!==n.length||a.some(r=>{var o,l;return((o=e.components)==null?void 0:o[r])!==((l=t.components)==null?void 0:l[r])}))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins)});Cw.displayName="Block";o5=["github-light","github-dark"],ei=(0,_.memo)(({children:e,mode:t="streaming",parseIncompleteMarkdown:a=!0,components:n,rehypePlugins:r=t5,remarkPlugins:o=a5,className:l,shikiTheme:i=o5,mermaid:s,controls:u=!0,isAnimating:c=!1,BlockComponent:d=Cw,parseMarkdownIntoBlocksFn:f=kE,caret:p,plugins:m,remend:x,linkSafety:v={enabled:!0},...y})=>{let w=(0,_.useId)(),[g,C]=(0,_.useTransition)(),A=(0,_.useMemo)(()=>typeof e!="string"?"":t==="streaming"&&a?yL(e,x):e,[e,t,a,x]),S=(0,_.useMemo)(()=>f(A),[A,f]),[M,R]=(0,_.useState)(S);(0,_.useEffect)(()=>{t==="streaming"?C(()=>{R(S)}):R(S)},[S,t]);let D=t==="streaming"?M:S,L=(0,_.useMemo)(()=>D.map((j,$)=>`${w}-${$}`),[D.length,w]),G=(0,_.useMemo)(()=>{var j,$;return{shikiTheme:($=(j=m?.code)==null?void 0:j.getThemes())!=null?$:i,controls:u,isAnimating:c,mode:t,mermaid:s,linkSafety:v}},[i,u,c,t,s,v,m?.code]),B=(0,_.useMemo)(()=>({...Gq,...n}),[n]),U=(0,_.useMemo)(()=>{let j=[];return m!=null&&m.cjk&&(j=[...j,...m.cjk.remarkPluginsBefore]),j=[...j,...o],m!=null&&m.cjk&&(j=[...j,...m.cjk.remarkPluginsAfter]),m!=null&&m.math&&(j=[...j,m.math.remarkPlugin]),j},[o,m?.math,m?.cjk]),W=(0,_.useMemo)(()=>m!=null&&m.math?[...r,m.math.rehypePlugin]:r,[r,m?.math]),E=(0,_.useMemo)(()=>p&&c?{"--streamdown-caret":`"${n5[p]}"`}:void 0,[p,c]);return t==="static"?(0,T.jsx)(yw.Provider,{value:m??null,children:(0,T.jsx)(la.Provider,{value:G,children:(0,T.jsx)("div",{className:ae("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",l),children:(0,T.jsx)(IE,{components:B,rehypePlugins:W,remarkPlugins:U,...y,children:e})})})}):(0,T.jsx)(yw.Provider,{value:m??null,children:(0,T.jsx)(la.Provider,{value:G,children:(0,T.jsxs)("div",{className:ae("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",p?"*:last:after:inline *:last:after:align-baseline *:last:after:content-(--streamdown-caret)":null,l),style:E,children:[D.length===0&&p&&c&&(0,T.jsx)("span",{}),D.map((j,$)=>(0,T.jsx)(d,{components:B,content:j,index:$,rehypePlugins:W,remarkPlugins:U,shouldParseIncompleteMarkdown:a,...y},L[$]))]})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety);ei.displayName="Streamdown";l5=({children:e,className:t,minZoom:a=.5,maxZoom:n=3,zoomStep:r=.1,showControls:o=!0,initialZoom:l=1,fullscreen:i=!1})=>{let s=(0,_.useRef)(null),u=(0,_.useRef)(null),[c,d]=(0,_.useState)(l),[f,p]=(0,_.useState)({x:0,y:0}),[m,x]=(0,_.useState)(!1),[v,y]=(0,_.useState)({x:0,y:0}),[w,g]=(0,_.useState)({x:0,y:0}),C=(0,_.useCallback)(B=>{d(U=>Math.max(a,Math.min(n,U+B)))},[a,n]),A=(0,_.useCallback)(()=>{C(r)},[C,r]),S=(0,_.useCallback)(()=>{C(-r)},[C,r]),M=(0,_.useCallback)(()=>{d(l),p({x:0,y:0})},[l]),R=(0,_.useCallback)(B=>{B.preventDefault();let U=B.deltaY>0?-r:r;C(U)},[C,r]),D=(0,_.useCallback)(B=>{if(B.button!==0||B.isPrimary===!1)return;x(!0),y({x:B.clientX,y:B.clientY}),g(f);let U=B.currentTarget;U instanceof HTMLElement&&U.setPointerCapture(B.pointerId)},[f]),L=(0,_.useCallback)(B=>{if(!m)return;B.preventDefault();let U=B.clientX-v.x,W=B.clientY-v.y;p({x:w.x+U,y:w.y+W})},[m,v,w]),G=(0,_.useCallback)(B=>{x(!1);let U=B.currentTarget;U instanceof HTMLElement&&U.releasePointerCapture(B.pointerId)},[]);return(0,_.useEffect)(()=>{let B=s.current;if(B)return B.addEventListener("wheel",R,{passive:!1}),()=>{B.removeEventListener("wheel",R)}},[R]),(0,_.useEffect)(()=>{let B=u.current;if(B&&m)return document.body.style.userSelect="none",B.addEventListener("pointermove",L,{passive:!1}),B.addEventListener("pointerup",G),B.addEventListener("pointercancel",G),()=>{document.body.style.userSelect="",B.removeEventListener("pointermove",L),B.removeEventListener("pointerup",G),B.removeEventListener("pointercancel",G)}},[m,L,G]),(0,T.jsxs)("div",{className:ae("relative flex flex-col",i?"h-full w-full":"min-h-28 w-full",t),ref:s,style:{cursor:m?"grabbing":"grab"},children:[o?(0,T.jsxs)("div",{className:ae("absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/90 p-1 shadow-sm backdrop-blur-sm",i?"bottom-4 left-4":"bottom-2 left-2"),children:[(0,T.jsx)("button",{className:"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:c>=n,onClick:A,title:"Zoom in",type:"button",children:(0,T.jsx)(Sq,{size:16})}),(0,T.jsx)("button",{className:"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:c<=a,onClick:S,title:"Zoom out",type:"button",children:(0,T.jsx)(Cq,{size:16})}),(0,T.jsx)("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",onClick:M,title:"Reset zoom and pan",type:"button",children:(0,T.jsx)(bq,{size:16})})]}):null,(0,T.jsx)("div",{className:ae("flex-1 origin-center transition-transform duration-150 ease-out",i?"flex h-full w-full items-center justify-center":"flex w-full items-center justify-center"),onPointerDown:D,ref:u,role:"application",style:{transform:`translate(${f.x}px, ${f.y}px) scale(${c})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},pw=({chart:e,className:t,config:a,fullscreen:n=!1,showControls:r=!0})=>{let[o,l]=(0,_.useState)(null),[i,s]=(0,_.useState)(!1),[u,c]=(0,_.useState)(""),[d,f]=(0,_.useState)(""),[p,m]=(0,_.useState)(0),{mermaid:x}=(0,_.useContext)(la),v=bw(),y=x?.errorComponent,{shouldRender:w,containerRef:g}=wq({immediate:n});if((0,_.useEffect)(()=>{if(w){if(!v){l("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}(async()=>{try{l(null),s(!0);let A=v.getMermaid(a),S=e.split("").reduce((D,L)=>(D<<5)-D+L.charCodeAt(0)|0,0),M=`mermaid-${Math.abs(S)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:R}=await A.render(M,e);c(R),f(R)}catch(A){if(!(d||u)){let S=A instanceof Error?A.message:"Failed to render Mermaid chart";l(S)}}finally{s(!1)}})()}},[e,a,p,w,v]),!(w||u||d))return(0,T.jsx)("div",{className:ae("my-4 min-h-[200px]",t),ref:g});if(i&&!u&&!d)return(0,T.jsx)("div",{className:ae("my-4 flex justify-center p-4",t),ref:g,children:(0,T.jsxs)("div",{className:"flex items-center space-x-2 text-muted-foreground",children:[(0,T.jsx)("div",{className:"h-4 w-4 animate-spin rounded-full border-current border-b-2"}),(0,T.jsx)("span",{className:"text-sm",children:"Loading diagram..."})]})});if(o&&!u&&!d)return y?(0,T.jsx)("div",{ref:g,children:(0,T.jsx)(y,{chart:e,error:o,retry:()=>m(S=>S+1)})}):(0,T.jsxs)("div",{className:ae("rounded-lg border border-red-200 bg-red-50 p-4",t),ref:g,children:[(0,T.jsxs)("p",{className:"font-mono text-red-700 text-sm",children:["Mermaid Error: ",o]}),(0,T.jsxs)("details",{className:"mt-2",children:[(0,T.jsx)("summary",{className:"cursor-pointer text-red-600 text-xs",children:"Show Code"}),(0,T.jsx)("pre",{className:"mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs",children:e})]})]});let C=u||d;return(0,T.jsx)("div",{className:ae("size-full",t),"data-streamdown":"mermaid",ref:g,children:(0,T.jsx)(l5,{className:ae(n?"size-full overflow-hidden":"my-4 overflow-hidden",t),fullscreen:n,maxZoom:3,minZoom:.5,showControls:r,zoomStep:.1,children:(0,T.jsx)("div",{"aria-label":"Mermaid chart",className:ae("flex justify-center",n?"size-full items-center":null),dangerouslySetInnerHTML:{__html:C},role:"img"})})})}});var Z2=Kt((xre,K2)=>{"use strict";function H9(e,t){if(typeof e!="function")throw new TypeError(`Expected the first argument to be a \`function\`, got \`${typeof e}\`.`);let a,n=0;return function(...o){clearTimeout(a);let l=Date.now(),i=l-n,s=t-i;s<=0?(n=l,e.apply(this,o)):a=setTimeout(()=>{n=Date.now(),e.apply(this,o)},s)}}K2.exports=H9});var wu=z(De(),1),ox=z(K0(),1);function Ul(e,t){for(let a of t){let n=e[a];if(typeof n=="string"&&n.length>0)return n}}var IP=["waniwani/sessionId","openai/sessionId","openai/session","sessionId","conversationId","mcp-session-id"],kP=["waniwani/requestId","openai/requestId","requestId","mcp/requestId"],LP=["waniwani/traceId","openai/traceId","traceId","mcp/traceId","openai/requestId","requestId"],TP=["waniwani/userId","openai/userId","externalUserId","userId","actorId"],AP=["waniwani/visitorId","visitorId"],MP=["correlationId","openai/requestId"];function Z0(e){return e?Ul(e,IP):void 0}function Q0(e){return e?Ul(e,kP):void 0}function Y0(e){return e?Ul(e,LP):void 0}function J0(e){return e?Ul(e,TP):void 0}function eC(e){return e?Ul(e,AP):void 0}function tC(e){return e?Ul(e,MP):void 0}var EP=[{key:"openai/sessionId",source:"chatgpt"},{key:"openai/session",source:"chatgpt"}],RP=[{needle:"claude",source:"claude"},{needle:"chatgpt",source:"chatgpt"},{needle:"openai",source:"chatgpt"},{needle:"gemini",source:"gemini"}];function aC(e,t){if(e){let n=e["waniwani/source"];if(typeof n=="string"&&n.length>0)return n;for(let{key:r,source:o}of EP){let l=e[r];if(typeof l=="string"&&l.length>0)return o}}let a=t?.name;if(typeof a=="string"&&a.length>0){let n=a.toLowerCase();for(let{needle:r,source:o}of RP)if(n.includes(r))return o}}var DP="@waniwani/sdk";function nC(e,t={}){let a=t.now??(()=>new Date),n=t.generateId??_P,r=NP(e),o=Jc(e.meta),l=Jc(e.metadata),i=BP(e,o),s=Ea(e.eventId)??n(),u=UP(e.timestamp,a),c=Ea(e.source)??aC(o)??t.source??DP,d=Oh(e)?{...e}:void 0,f={...l};return Object.keys(o).length>0&&(f.meta=o),d&&(f.rawLegacy=d),{id:s,type:"mcp.event",name:r,source:c,timestamp:u,correlation:i,properties:OP(e,r),metadata:f,rawLegacy:d}}function _P(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`evt_${crypto.randomUUID()}`:`evt_${Math.random().toString(36).slice(2,10)}_${Date.now().toString(36)}`}function OP(e,t){if(!Oh(e))return Jc(e.properties);let a=PP(e,t),n=Jc(e.properties);return{...a,...n}}function PP(e,t){switch(t){case"tool.called":{let a={};return Ea(e.toolName)&&(a.name=e.toolName),Ea(e.toolType)&&(a.type=e.toolType),a}case"quote.succeeded":{let a={};return typeof e.quoteAmount=="number"&&(a.amount=e.quoteAmount),Ea(e.quoteCurrency)&&(a.currency=e.quoteCurrency),a}case"link.clicked":{let a={};return Ea(e.linkUrl)&&(a.url=e.linkUrl),a}case"purchase.completed":{let a={};return typeof e.purchaseAmount=="number"&&(a.amount=e.purchaseAmount),Ea(e.purchaseCurrency)&&(a.currency=e.purchaseCurrency),a}default:return{}}}function NP(e){return Oh(e)?e.eventType:e.event}function BP(e,t){let a=Ea(e.requestId)??Q0(t),n=Ea(e.sessionId)??Z0(t),r=Ea(e.traceId)??Y0(t),o=Ea(e.externalUserId)??J0(t),l=Ea(e.visitorId)??eC(t),i=Ea(e.correlationId)??tC(t)??a,s={};return n&&(s.sessionId=n),r&&(s.traceId=r),a&&(s.requestId=a),i&&(s.correlationId=i),o&&(s.externalUserId=o),l&&(s.visitorId=l),s}function UP(e,t){if(e instanceof Date)return e.toISOString();if(typeof e=="string"){let a=new Date(e);if(!Number.isNaN(a.getTime()))return a.toISOString()}return t().toISOString()}function Jc(e){return!e||typeof e!="object"||Array.isArray(e)?{}:e}function Ea(e){if(typeof e=="string"&&e.trim().length!==0)return e}function Oh(e){return"eventType"in e}function rC(e){return{priceShown:({amount:t,currency:a,itemId:n,label:r,...o})=>e({event:"price_shown",properties:{amount:t,currency:a,itemId:n,label:r},...o}),pricesCompared:({options:t,...a})=>e({event:"prices_compared",properties:{options:t},...a}),optionSelected:({id:t,amount:a,currency:n,...r})=>e({event:"option_selected",properties:{id:t,amount:a,currency:n},...r}),leadQualified:t=>{let{externalId:a,email:n,name:r,...o}=t??{};return e({event:"lead_qualified",properties:{externalId:a,email:n,name:r},...o})},converted:({amount:t,currency:a,occurredAt:n,...r})=>e({event:"converted",properties:{amount:t,currency:a,occurredAt:n},...r})}}var FP="/api/mcp/events/v2/batch";var oC="@waniwani/sdk";var zP=new Set([401,403]),qP=new Set([408,425,429,500,502,503,504]);function lC(e){return new Ph(e)}var Ph=class{constructor(t){Z(this,"endpointUrl");Z(this,"flushIntervalMs");Z(this,"maxBatchSize");Z(this,"maxBufferSize");Z(this,"maxRetries");Z(this,"retryBaseDelayMs");Z(this,"retryMaxDelayMs");Z(this,"shutdownTimeoutMs");Z(this,"sdkVersion");Z(this,"fetchFn");Z(this,"logger");Z(this,"now");Z(this,"sleep");Z(this,"apiKey");Z(this,"buffer",[]);Z(this,"flushTimer");Z(this,"flushScheduled",!1);Z(this,"flushScheduledTimer");Z(this,"flushInFlight");Z(this,"inFlightCount",0);Z(this,"isStopped",!1);Z(this,"isShuttingDown",!1);this.endpointUrl=VP(t.apiUrl,t.endpointPath??FP),this.flushIntervalMs=t.flushIntervalMs??1e3,this.maxBatchSize=t.maxBatchSize??20,this.maxBufferSize=t.maxBufferSize??1e3,this.maxRetries=t.maxRetries??3,this.retryBaseDelayMs=t.retryBaseDelayMs??200,this.retryMaxDelayMs=t.retryMaxDelayMs??2e3,this.shutdownTimeoutMs=t.shutdownTimeoutMs??2e3,this.fetchFn=t.fetchFn??fetch,this.logger=t.logger??console,this.now=t.now??(()=>new Date),this.sleep=t.sleep??(a=>new Promise(n=>setTimeout(n,a))),this.apiKey=t.apiKey,this.sdkVersion=t.sdkVersion,this.flushIntervalMs>0&&(this.flushTimer=setInterval(()=>{this.flush()},this.flushIntervalMs)),this.registerBrowserTeardown()}enqueue(t){if(this.isStopped||this.isShuttingDown){this.logger.warn("[Waniwani] Tracking transport is stopped, dropping event %s",t.id);return}if(this.buffer.length>=this.maxBufferSize){let a=this.buffer.length-this.maxBufferSize+1;this.buffer.splice(0,a),this.logger.warn("[Waniwani] Tracking buffer overflow, dropped %d oldest event(s)",a)}if(this.buffer.push(t),this.buffer.length>=this.maxBatchSize){this.flush();return}this.scheduleMicroFlush()}pendingEvents(){return this.buffer.length+this.inFlightCount}async flush(){return this.flushInFlight?this.flushInFlight:(this.flushInFlight=this.flushLoop().finally(()=>{this.flushInFlight=void 0}),this.flushInFlight)}async shutdown(t){this.isShuttingDown=!0,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=void 0),this.flushScheduledTimer&&(clearTimeout(this.flushScheduledTimer),this.flushScheduledTimer=void 0,this.flushScheduled=!1);let a=t?.timeoutMs??this.shutdownTimeoutMs,n=this.flush();if(!Number.isFinite(a)||a<=0)return await n,this.isStopped=!0,{timedOut:!1,pendingEvents:this.pendingEvents()};let r=Symbol("shutdown-timeout");return await Promise.race([n.then(()=>"flushed"),this.sleep(a).then(()=>r)])===r?(this.isStopped=!0,{timedOut:!0,pendingEvents:this.pendingEvents()}):(this.isStopped=!0,{timedOut:!1,pendingEvents:this.pendingEvents()})}registerBrowserTeardown(){if(typeof document>"u"||typeof window>"u")return;let t=()=>{document.visibilityState==="hidden"&&this.keepaliveFlush()};document.addEventListener("visibilitychange",t),window.addEventListener("pagehide",()=>this.keepaliveFlush())}keepaliveFlush(){if(this.isStopped||this.buffer.length===0)return;let t=this.buffer.splice(0,this.buffer.length);this.sendKeepaliveChunk(t)}sendKeepaliveChunk(t){let a=JSON.stringify(this.makeBatchRequest(t));if(a.length>6e4&&t.length>1){let n=Math.ceil(t.length/2);this.sendKeepaliveChunk(t.slice(0,n)),this.sendKeepaliveChunk(t.slice(n));return}try{this.fetchFn(this.endpointUrl,{method:"POST",headers:this.requestHeaders(),body:a,keepalive:!0}).catch(()=>{})}catch{}}requestHeaders(){let t={"Content-Type":"application/json","X-WaniWani-SDK":oC};return this.apiKey&&(t.Authorization=`Bearer ${this.apiKey}`),t}scheduleMicroFlush(){this.flushScheduled||(this.flushScheduled=!0,this.flushScheduledTimer=setTimeout(()=>{this.flushScheduledTimer=void 0,this.flushScheduled=!1,this.flush()},0))}async flushLoop(){for(;this.buffer.length>0&&!this.isStopped;){let t=this.buffer.splice(0,this.maxBatchSize);await this.sendBatchWithRetry(t)}}async sendBatchWithRetry(t){let a=0,n=t;for(;n.length>0&&!this.isStopped;){this.inFlightCount=n.length;let r=await this.sendBatchOnce(n);switch(this.inFlightCount=0,r.kind){case"success":return;case"auth":this.stopTransportForAuthFailure(r.status,n.length);return;case"permanent":this.logger.error("[Waniwani] Dropping %d event(s) after permanent failure: %s",n.length,r.reason);return;case"retryable":if(a>=this.maxRetries){this.logger.error("[Waniwani] Dropping %d event(s) after retry exhaustion: %s",n.length,r.reason);return}await this.sleep(this.backoffDelayMs(a)),a+=1;continue;case"partial":if(r.permanent.length>0&&this.logger.error("[Waniwani] Dropping %d event(s) rejected as permanent",r.permanent.length),r.retryable.length===0)return;if(a>=this.maxRetries){this.logger.error("[Waniwani] Dropping %d retryable event(s) after retry exhaustion",r.retryable.length);return}n=r.retryable,await this.sleep(this.backoffDelayMs(a)),a+=1;continue}}}async sendBatchOnce(t){let a;try{a=await this.fetchFn(this.endpointUrl,{method:"POST",headers:this.requestHeaders(),body:JSON.stringify(this.makeBatchRequest(t))})}catch(o){return{kind:"retryable",reason:GP(o)}}if(zP.has(a.status))return{kind:"auth",status:a.status};if(qP.has(a.status))return{kind:"retryable",reason:`HTTP ${a.status}`};if(!a.ok)return{kind:"permanent",reason:`HTTP ${a.status}`};let n=await jP(a);if(!n?.rejected||n.rejected.length===0)return{kind:"success"};let r=this.classifyRejectedEvents(t,n.rejected);return r.retryable.length===0&&r.permanent.length===0?{kind:"success"}:{kind:"partial",retryable:r.retryable,permanent:r.permanent}}makeBatchRequest(t){return{sentAt:this.now().toISOString(),source:{sdk:oC,version:this.sdkVersion??"0.0.0"},events:t}}classifyRejectedEvents(t,a){let n=new Map(t.map(l=>[l.id,l])),r=[],o=[];for(let l of a){let i=n.get(l.eventId);if(i){if(HP(l)){r.push(i);continue}o.push(i)}}return{retryable:r,permanent:o}}backoffDelayMs(t){let a=this.retryBaseDelayMs*2**t;return Math.min(a,this.retryMaxDelayMs)}stopTransportForAuthFailure(t,a){this.isStopped=!0;let n=this.buffer.length;this.buffer.splice(0,n),this.logger.error("[Waniwani] Auth failure (HTTP %d). Stopping tracking transport and dropping %d queued event(s)",t,a+n)}};function HP(e){if(e.retryable===!0)return!0;let t=e.code.toLowerCase();return t.includes("timeout")||t.includes("temporary")||t.includes("unavailable")||t.includes("rate_limit")||t.includes("transient")||t.includes("server")}async function jP(e){let t=await e.text();if(t)try{return JSON.parse(t)}catch{return}}function VP(e,t){let a=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${a}${n}`}function GP(e){return e instanceof Error?e.message:String(e)}function iC(e){let{apiUrl:t,endpointPath:a}=$P(e.endpoint),n=lC({apiUrl:t,apiKey:e.token,endpointPath:a,flushIntervalMs:e.flushIntervalMs}),r,o=i=>typeof i=="function"?i():i,l=async i=>{let s=e.identity?.()??{},u=o(e.channelId),c=u===void 0?i.properties:{channelId:u,...i.properties},d=nC({sessionId:s.sessionId,visitorId:s.visitorId,externalUserId:s.externalUserId??r,traceId:s.traceId,...i,properties:c,metadata:{...e.metadata,...i.metadata}},{source:o(e.source)});return n.enqueue(d),{eventId:d.id}};return{track:Object.assign(l,rC(l)),identify(i,s){return r=i,l({event:"user.identified",externalUserId:i,properties:s})},flush:()=>n.flush(),shutdown:i=>n.shutdown(i)}}function $P(e){let t=new URL(e);return{apiUrl:t.origin,endpointPath:`${t.pathname}${t.search}`}}var WP="waniwani-memory";var Ra="threads",ed="by_memoryUserId",XP="by_updatedAt";var uC="memoryUserId",sC="waniwani-memory-user-id",Nh=null;function Bh(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function KP(e,t){if(t<1&&(e.objectStoreNames.contains("ids")||e.createObjectStore("ids")),t<2&&!e.objectStoreNames.contains(Ra)){let a=e.createObjectStore(Ra,{keyPath:"threadId"});a.createIndex(ed,"memoryUserId",{unique:!1}),a.createIndex(XP,"updatedAt",{unique:!1})}}async function Uh(){return new Promise((e,t)=>{let a=indexedDB.open(WP,2);a.onupgradeneeded=n=>{KP(a.result,n.oldVersion)},a.onsuccess=()=>e(a.result),a.onerror=()=>t(a.error)})}async function ZP(){return Uh()}async function QP(e){return new Promise((t,a)=>{let o=e.transaction("ids","readonly").objectStore("ids").get(uC);o.onsuccess=()=>t(typeof o.result=="string"?o.result:null),o.onerror=()=>a(o.error)})}async function YP(e,t){return new Promise((a,n)=>{let l=e.transaction("ids","readwrite").objectStore("ids").put(t,uC);l.onsuccess=()=>a(),l.onerror=()=>n(l.error)})}async function JP(){if(typeof indexedDB>"u")return null;try{let e=await ZP();try{let t=await QP(e);if(t)return t;let a=Bh();return await YP(e,a),a}finally{e.close()}}catch{return null}}function eN(){try{let e=localStorage.getItem(sC);if(e)return e;let t=Bh();return localStorage.setItem(sC,t),t}catch{return null}}async function cC(){let e=await JP();if(e)return e;let t=eN();return t||(Nh||(Nh=Bh()),Nh)}var dC="waniwani-visitor-id";function fC(e,t){return e.match(t)?.[1]??null}function tN(e){let t=[["Edge",/Edg(?:e|A|iOS)?\/(\S+)/],["Opera",/(?:OPR|Opera)\/(\S+)/],["Samsung Internet",/SamsungBrowser\/(\S+)/],["Firefox",/Firefox\/(\S+)/],["Chrome",/Chrome\/(\S+)/],["Safari",/Version\/(\S+).*Safari/]];for(let[a,n]of t){let r=fC(e,n);if(r)return{name:a,version:r}}return null}function aN(e){let t=[["iOS",/(?:iPhone|iPad|iPod).+?OS (\d+[_.\d]*)/],["Android",/Android (\d+[.\d]*)/],["macOS",/Mac OS X (\d+[_.\d]*)/],["Windows",/Windows NT (\d+[.\d]*)/],["ChromeOS",/CrOS \S+ (\d+[.\d]*)/],["Linux",/Linux/]];for(let[a,n]of t){let r=fC(e,n);if(r)return{name:a,version:r.replace(/_/g,".")};if(a==="Linux"&&n.test(e))return{name:a,version:""}}return null}function nN(e){return typeof navigator<"u"&&"userAgentData"in navigator&&navigator.userAgentData?.mobile?"mobile":/iPad|tablet|PlayBook/i.test(e)?"tablet":/Mobi|Android.*Mobile|iPhone|iPod/i.test(e)?"mobile":"desktop"}async function rN(e){let t=new TextEncoder().encode(e),a=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(a)).map(n=>n.toString(16).padStart(2,"0")).join("")}async function oN(){try{let a=localStorage.getItem(dC);if(a)return a}catch{}let e=[navigator.userAgent,screen.width,screen.height,screen.colorDepth,Intl.DateTimeFormat().resolvedOptions().timeZone,navigator.language,navigator.hardwareConcurrency??"",navigator.platform??""].join("|"),t=await rN(e);try{localStorage.setItem(dC,t)}catch{}return t}async function So(){let e=navigator.userAgent,[t,a]=await Promise.all([oN(),cC()]);return{userAgent:e,browser:tN(e),os:aN(e),deviceType:nN(e),language:navigator.language,languages:[...navigator.languages],timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,screenWidth:screen.width,screenHeight:screen.height,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,colorDepth:screen.colorDepth,devicePixelRatio:window.devicePixelRatio??1,touchSupport:"ontouchstart"in window||navigator.maxTouchPoints>0,connectionType:navigator.connection?.effectiveType??"unknown",referrer:document.referrer,visitorId:t,memoryUserId:a}}var Fh=new Set;function lN(e,t,a){return`${e}|${t}|${a??""}`}function zh(e){try{return`${new URL(e).origin}/api/mcp/events/v2/batch`}catch{return e.replace(/\/$/,"").replace(/\/chat$/,"/events/v2/batch")}}async function pC(e){let{api:t,token:a,channelId:n,mode:r,source:o}=e;if(typeof window>"u"||!t||!a)return;let l=lN(t,a,n);if(!Fh.has(l)){Fh.add(l);try{let i=await So(),s=new Date().toISOString(),u=JSON.stringify({sentAt:s,source:{sdk:"@waniwani/sdk",version:"0.1.0"},events:[{id:crypto.randomUUID(),type:"mcp.event",name:"page.viewed",source:o,timestamp:s,correlation:{visitorId:i.visitorId},properties:{channelId:n,mode:r,url:window.location.href,referrer:i.referrer,deviceType:i.deviceType,language:i.language,timezone:i.timezone},metadata:{}}]});await fetch(zh(t),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:u,keepalive:!0})}catch{Fh.delete(l)}}}function mC(e){let t;return So().then(a=>{t=a.visitorId}).catch(()=>{}),iC({endpoint:zh(e.api),token:e.token,channelId:e.channelId,source:e.getSource,identity:()=>({sessionId:e.getSessionId(),visitorId:t})})}function qh(e){let t=!1,a=async()=>(t||(t=!0,console.warn(`[Waniwani] track() is disabled: ${e}`)),{eventId:""});return{track:Object.assign(a,{priceShown:a,pricesCompared:a,optionSelected:a,leadQualified:a,converted:a}),identify:a,flush:async()=>{},shutdown:async()=>({timedOut:!1,pendingEvents:0})}}var hC="500px",iN="https://app.waniwani.ai/api/mcp/chat",sN={api:iN};function jh(){if(typeof document>"u")return null;if(document.currentScript instanceof HTMLScriptElement)return document.currentScript;let e=document.querySelector("script[src][data-token]");if(e instanceof HTMLScriptElement)return e;let t=document.querySelectorAll("script[src]");for(let a of t)if(a instanceof HTMLScriptElement&&/embed/i.test(a.src))return a;return null}function td(){let e=jh();if(!e)return{};let t=D=>e.getAttribute(D)??void 0,a=D=>{let L=e.getAttribute(D);if(L==null)return;let G=L.trim().toLowerCase();if(G==="true"||G==="1"||G==="")return!0;if(G==="false"||G==="0")return!1},n={},r=t("data-api");r&&(n.api=r);let o=t("data-token");o&&(n.token=o);let l=t("data-title");l&&(n.title=l);let i=t("data-welcome-message");i&&(n.welcomeMessage=i);let s=t("data-placeholder");s&&(n.placeholder=s);let u=t("data-mcp-server-url");u&&(n.mcpServerUrl=u);let c=t("data-channel-id");if(c&&(n.channelId=c),t("data-show-tool-calls")?.trim().toLowerCase()==="titles-only")n.showToolCalls="titles-only";else{let D=a("data-show-tool-calls");D!==void 0&&(n.showToolCalls=D)}let f=t("data-css");f&&(n.css=f);let p=t("data-suggestions");p&&(n.suggestions=p.split(",").map(D=>D.trim()).filter(Boolean));let m=a("data-enable-thread-history");m!==void 0&&(n.enableThreadHistory=m);let x=a("data-disable-page-view");x!==void 0&&(n.disablePageView=x);let v=a("data-hide-header");v!==void 0&&(n.hideHeader=v);let y=t("data-theme");(y==="light"||y==="dark"||y==="auto")&&(n.appearance={...n.appearance,theme:y});let w=a("data-assistant-bubble");w!==void 0&&(n.appearance={...n.appearance,assistantBubble:w});let g=t("data-locale");(g==="en"||g==="fr"||g==="es")&&(n.locale=g);let C=t("data-mode");(C==="inline"||C==="floating")&&(n.mode=C);let A=t("data-height");A&&(n.height=A);let S=t("data-launcher-text");S&&(n.launcherText=S);let M=t("data-appear-delay");if(M!==void 0){let D=Number.parseInt(M.trim(),10);Number.isFinite(D)&&D>=0&&(n.appearDelay=D)}let R=t("data-disclaimer");if(R!==void 0){let D=R.trim(),L=D.toLowerCase();L==="false"||L==="0"?n.disclaimer=!1:D&&(n.disclaimer=D)}return n}function Hh(e){if(!e)return{};let t={};for(let a in e)e[a]!==void 0&&(t[a]=e[a]);return t}function fs(e,t,a){let n=a??td(),r=uN(t,n,e),o={token:"",...sN,...Hh(t),...Hh(n),...Hh(e),...r?{appearance:r}:{}};if(!o.token)throw new Error("[Waniwani] Missing required config: `token`. Set data-token on the script tag or pass it to Waniwani.chat.init().");return o}function uN(e,t,a){let n=a?.appearance?.theme??t.appearance?.theme??e?.appearance?.theme,r={...e?.appearance?.variables??{},...t.appearance?.variables??{},...a?.appearance?.variables??{}},o=Object.keys(r).length>0,l=a?.appearance?.assistantBubble??t.appearance?.assistantBubble??e?.appearance?.assistantBubble;if(!n&&!o&&l===void 0)return;let i={};return n&&(i.theme=n),o&&(i.variables=r),l!==void 0&&(i.assistantBubble=l),i}var nd=z(De());var ad=(...e)=>e.filter((t,a,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===a).join(" ").trim();var gC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var yC=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,n)=>n?n.toUpperCase():a.toLowerCase());var Vh=e=>{let t=yC(e);return t.charAt(0).toUpperCase()+t.slice(1)};var ps=z(De());var wC={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"};var xC=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var vC=(0,ps.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:n,className:r="",children:o,iconNode:l,...i},s)=>(0,ps.createElement)("svg",{ref:s,...wC,width:t,height:t,stroke:e,strokeWidth:n?Number(a)*24/Number(t):a,className:ad("lucide",r),...!o&&!xC(i)&&{"aria-hidden":"true"},...i},[...l.map(([u,c])=>(0,ps.createElement)(u,c)),...Array.isArray(o)?o:[o]]));var Pe=(e,t)=>{let a=(0,nd.forwardRef)(({className:n,...r},o)=>(0,nd.createElement)(vC,{ref:o,iconNode:t,className:ad(`lucide-${gC(Vh(e))}`,`lucide-${e}`,n),...r}));return a.displayName=Vh(e),a};var cN=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],ms=Pe("arrow-down",cN);var dN=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Co=Pe("arrow-up",dN);var fN=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],hs=Pe("check",fN);var pN=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Br=Pe("chevron-down",pN);var mN=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],gs=Pe("chevron-right",mN);var hN=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]],ys=Pe("clipboard-copy",hN);var gN=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Xn=Pe("clock",gN);var yN=[["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"}]],ws=Pe("file",yN);var wN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],xs=Pe("globe",wN);var xN=[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]],vs=Pe("loader",xN);var vN=[["path",{d:"M5 12h14",key:"1ays0h"}]],bs=Pe("minus",vN);var bN=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],Ss=Pe("paperclip",bN);var SN=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Cs=Pe("square",SN);var CN=[["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"}]],Io=Pe("wrench",CN);var IN=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Kn=Pe("x",IN);var kN=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Is=Pe("zap",kN);var Ke=z(De(),1);var Fl=z(De(),1),ks=z(te(),1);function AN(e){return 1-(1-e)**3}function MN({start:e=0,end:t=100,duration:a=1e3,delay:n=0,ease:r=AN,onUpdate:o,onEnd:l}){let i=performance.now()+n;function s(){let u=performance.now()-i,c=Math.min(u/a,1);o(e+(t-e)*r(c)),c<1?requestAnimationFrame(s):l&&l()}setTimeout(()=>requestAnimationFrame(s),n)}var EN=["80% 55%","69% 34%","8% 6%","41% 38%","86% 85%","82% 18%","51% 4%"],RN=[0,1,2,0,1,2,1];function DN(e){let t=[];for(let a=0;a<7;a++){let n=e[Math.min(RN[a],e.length-1)];t.push(`radial-gradient(at ${EN[a]}, ${n} 0px, transparent 50%)`)}return t.push(`linear-gradient(${e[0]} 0 100%)`),t}var _N=({children:e,className:t="",style:a,edgeSensitivity:n=30,backgroundColor:r="#120F17",borderRadius:o=28,coneSpread:l=25,animated:i=!1,colors:s=["#c084fc","#f472b6","#38bdf8"]})=>{let[u,c]=(0,Fl.useState)(110),[d,f]=(0,Fl.useState)(0),[p,m]=(0,Fl.useState)(!1);(0,Fl.useEffect)(()=>{if(!i)return;let A=110;m(!0),c(A),MN({ease:S=>S,duration:2e3,onUpdate:S=>{let M=S/100;c(A+360*M);let R=Math.min(M/.1,1),D=M>.85?(1-M)/.15:1;f(Math.min(R,D))},onEnd:()=>m(!1)})},[i]);let x=n+20,v=p?Math.max(0,(d*100-x)/(100-x)):0,w=DN(s).map(A=>`${A} border-box`),C=`conic-gradient(from ${`${u.toFixed(3)}deg`} at center, black ${l}%, transparent ${l+15}%, transparent ${100-l-15}%, black ${100-l}%)`;return(0,ks.jsxs)("div",{className:`ww:relative ww:grid ww:isolate ww:border ${t}`,style:{background:r,borderRadius:`${o}px`,transform:"translate3d(0, 0, 0.01px)",...a},children:[(0,ks.jsx)("div",{className:"ww:absolute ww:inset-0 ww:rounded-[inherit] ww:-z-[1]",style:{border:"1px solid transparent",background:[`linear-gradient(${r} 0 100%) padding-box`,"linear-gradient(rgb(255 255 255 / 0%) 0% 100%) border-box",...w].join(", "),opacity:v,maskImage:C,WebkitMaskImage:C,transition:p?"opacity 0.25s ease-out":"opacity 0.75s ease-in-out"}}),(0,ks.jsx)("div",{className:"ww:flex ww:flex-col ww:relative ww:overflow-auto ww:z-[1]",children:e})]})},IC=_N;Gh();Wh();var ON=LC({prefix:"ww"});function H(...e){return ON(od(e))}var Ls=z(te(),1);function ld({suggestions:e,isLoading:t,onSelect:a,className:n,...r}){return e.length===0&&!t?null:(0,Ls.jsx)("div",{className:H("ww:px-4 ww:py-2",n),...r,children:(0,Ls.jsx)("div",{className:"ww:mx-auto ww:w-full ww:max-w-3xl ww:flex ww:flex-wrap ww:gap-2",children:t?[0,1,2].map(o=>(0,Ls.jsx)("div",{className:"ww:h-8 ww:rounded-full ww:bg-accent ww:animate-pulse",style:{width:`${60+o*20}px`}},o)):e.map((o,l)=>(0,Ls.jsx)("button",{type:"button",onClick:()=>a(o),className:H("ww:rounded-full ww:border ww:border-border ww:bg-background ww:px-3.5 ww:py-1.5 ww:text-sm","ww:text-foreground ww:hover:bg-accent ww:hover:border-primary/30","ww:transition-all ww:duration-200 ww:ease-out ww:cursor-pointer","ww:animate-[ww-fade-in_0.2s_ease-out_both]"),style:{animationDelay:`${l*50}ms`},children:o},o))})})}var zl=z(De(),1),PN=80,NN=50,BN=15e3,TC=500;function id(e,t=!0){let[a,n]=(0,zl.useState)(""),r=(0,zl.useRef)(void 0);return(0,zl.useEffect)(()=>{if(!t){n("");return}let o=0,l=!1,i=!1,s=()=>{i||(l?(o--,n(e.slice(0,o)),o<=0?(l=!1,r.current=setTimeout(s,TC)):r.current=setTimeout(s,NN)):(o++,n(e.slice(0,o)),o>=e.length?(l=!0,r.current=setTimeout(s,BN)):r.current=setTimeout(s,PN)))};return r.current=setTimeout(s,TC),()=>{i=!0,clearTimeout(r.current)}},[e,t]),a}var nn=z(De(),1);var AC=["en","fr","es"];function ql(e){return AC.includes(e)}function Xh(e){if(e&&ql(e))return e;if(e){let a=e.split("-")[0]?.toLowerCase();if(a&&ql(a))return a}let t=[];if(typeof navigator<"u"&&(navigator.language&&t.push(navigator.language),navigator.languages&&t.push(...navigator.languages)),typeof document<"u"){let a=document.documentElement.getAttribute("lang");a&&t.push(a)}for(let a of t){let n=a.toLowerCase();if(ql(n))return n;let r=n.split("-")[0];if(r&&ql(r))return r}return"en"}var sd={promptInput:{placeholder:"What would you like to know?",uploadFiles:"Upload files",stop:"Stop",submit:"Submit",removeAttachments:"Remove all attachments"},workingIndicator:{default:"On it\u2026"},reasoning:{thinking:"Thinking\u2026",thoughtBrief:"Thought for a few seconds",thoughtForSeconds:e=>`Thought for ${e} second${e===1?"":"s"}`},chainOfThought:{working:"Working on it\u2026",done:"Thought process"},tool:{copy:"Copy",copied:"Copied",request:"Request",response:"Response",error:"Error"},attachments:{attachmentFallback:"attachment",fileFallback:"file"},threadMenu:{newChat:"New chat",threadHistory:"Thread history",deleteThread:"Delete thread",noPreviousChats:"No previous chats yet.",hiddenThreads:e=>`${e} older thread${e===1?"":"s"} hidden`},chatQueue:{attachmentFallback:"(attachment)",removeFromQueue:"Remove from queue",queued:e=>`${e} queued`},poweredBy:{label:"AI agent powered by"},aiDisclaimer:{default:"can make mistakes"},exportSession:{saving:"saving...",saved:"saved",error:"error",export:"export",tooltip:"Save scenario to Waniwani"},widgetErrorBoundary:{failedToLoad:"Widget failed to load",retry:"Retry"},launcher:{prompt:"Ask anything\u2026",open:"Open chat",close:"Close chat",minimize:"Minimize"}};var MC={promptInput:{placeholder:"\xBFQu\xE9 te gustar\xEDa saber?",uploadFiles:"Subir archivos",stop:"Detener",submit:"Enviar",removeAttachments:"Eliminar todos los archivos adjuntos"},workingIndicator:{default:"Un momento\u2026"},reasoning:{thinking:"Pensando\u2026",thoughtBrief:"Pensado durante unos segundos",thoughtForSeconds:e=>`Pensado durante ${e} segundo${e===1?"":"s"}`},chainOfThought:{working:"Estoy en ello\u2026",done:"Razonamiento"},tool:{copy:"Copiar",copied:"Copiado",request:"Solicitud",response:"Respuesta",error:"Error"},attachments:{attachmentFallback:"adjunto",fileFallback:"archivo"},threadMenu:{newChat:"Nueva conversaci\xF3n",threadHistory:"Historial",deleteThread:"Eliminar conversaci\xF3n",noPreviousChats:"A\xFAn no hay conversaciones anteriores.",hiddenThreads:e=>`${e} conversaci\xF3n${e===1?"":"es"} anterior${e===1?"":"es"} oculta${e===1?"":"s"}`},chatQueue:{attachmentFallback:"(adjunto)",removeFromQueue:"Quitar de la cola",queued:e=>`${e} en cola`},poweredBy:{label:"Agente IA con tecnolog\xEDa de"},aiDisclaimer:{default:"puede cometer errores"},exportSession:{saving:"guardando...",saved:"guardado",error:"error",export:"exportar",tooltip:"Guardar escenario en Waniwani"},widgetErrorBoundary:{failedToLoad:"No se pudo cargar el widget",retry:"Reintentar"},launcher:{prompt:"Pregunta lo que quieras\u2026",open:"Abrir chat",close:"Cerrar chat",minimize:"Minimizar"}};var EC={promptInput:{placeholder:"Que souhaitez-vous savoir ?",uploadFiles:"Importer des fichiers",stop:"Arr\xEAter",submit:"Envoyer",removeAttachments:"Supprimer toutes les pi\xE8ces jointes"},workingIndicator:{default:"Un instant\u2026"},reasoning:{thinking:"R\xE9flexion\u2026",thoughtBrief:"R\xE9flexion pendant quelques secondes",thoughtForSeconds:e=>`R\xE9flexion pendant ${e} seconde${e===1?"":"s"}`},chainOfThought:{working:"Je m'en occupe\u2026",done:"Raisonnement"},tool:{copy:"Copier",copied:"Copi\xE9",request:"Requ\xEAte",response:"R\xE9ponse",error:"Erreur"},attachments:{attachmentFallback:"pi\xE8ce jointe",fileFallback:"fichier"},threadMenu:{newChat:"Nouvelle conversation",threadHistory:"Historique",deleteThread:"Supprimer la conversation",noPreviousChats:"Aucune conversation pr\xE9c\xE9dente.",hiddenThreads:e=>`${e} conversation${e===1?"":"s"} plus ancienne${e===1?"":"s"} masqu\xE9e${e===1?"":"s"}`},chatQueue:{attachmentFallback:"(pi\xE8ce jointe)",removeFromQueue:"Retirer de la file",queued:e=>`${e} en attente`},poweredBy:{label:"Agent IA propuls\xE9 par"},aiDisclaimer:{default:"peut faire des erreurs"},exportSession:{saving:"enregistrement...",saved:"enregistr\xE9",error:"erreur",export:"exporter",tooltip:"Enregistrer le sc\xE9nario dans Waniwani"},widgetErrorBoundary:{failedToLoad:"\xC9chec du chargement du widget",retry:"R\xE9essayer"},launcher:{prompt:"Posez votre question\u2026",open:"Ouvrir le chat",close:"Fermer le chat",minimize:"R\xE9duire"}};var Kh={en:sd,fr:EC,es:MC};var DC=z(te(),1),RC=(0,nn.createContext)(null);function UN(e,t){if(!t)return e;let a={...e};for(let n of Object.keys(e)){let r=e[n],o=t[n];o&&typeof r=="object"&&(a[n]={...r,...o})}return a}function Ts({children:e,locale:t,messages:a}){let n=!!(t&&FN(t)),r=n?t:"en",[o,l]=(0,nn.useState)(r),[i,s]=(0,nn.useState)(n);(0,nn.useEffect)(()=>{l(Xh(t)),s(!0)},[t]);let u=(0,nn.useMemo)(()=>{let c=Kh[o]??Kh["en"];return{locale:o,t:UN(c,a),ready:i}},[o,a,i]);return(0,DC.jsx)(RC.Provider,{value:u,children:e})}function FN(e){return e==="en"||e==="fr"||e==="es"}function Oe(){let e=(0,nn.useContext)(RC);return e||{locale:"en",t:sd,ready:!0}}function Zh(e,t){let a=Date.now()-e;if(a<6e4)try{return new Intl.RelativeTimeFormat(t,{numeric:"auto",style:"narrow"}).format(0,"second")}catch{return"just now"}let n,r;a<60*6e4?(n=-Math.floor(a/6e4),r="minute"):a<1440*6e4?(n=-Math.floor(a/(60*6e4)),r="hour"):(n=-Math.floor(a/(1440*6e4)),r="day");try{return new Intl.RelativeTimeFormat(t,{numeric:"auto",style:"short"}).format(n,r)}catch{return`${Math.abs(n)}${r==="minute"?"m":r==="hour"?"h":"d"} ago`}}var tt=z(De(),1);var As=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,a)=>(a&=63,a<36?t+=a.toString(36):a<62?t+=(a-26).toString(36).toUpperCase():a>62?t+="-":t+="_",t),"");var nt=z(De(),1);var _C=z(te(),1),wn=({className:e,variant:t="default",size:a="default",type:n="button",...r})=>(0,_C.jsx)("button",{type:n,className:H("ww:inline-flex ww:cursor-pointer ww:items-center ww:justify-center ww:rounded-md ww:font-medium ww:transition-colors ww:disabled:pointer-events-none ww:disabled:opacity-50",t==="default"&&"ww:bg-primary ww:text-primary-foreground ww:hover:bg-primary/90",t==="outline"&&"ww:border ww:border-border ww:bg-background ww:hover:bg-accent ww:hover:text-accent-foreground",t==="ghost"&&"ww:hover:bg-accent ww:hover:text-accent-foreground",a==="default"&&"ww:h-9 ww:px-4 ww:py-2 ww:text-sm",a==="sm"&&"ww:h-8 ww:px-3 ww:text-xs",a==="icon"&&"ww:size-9 ww:!rounded-full",a==="icon-sm"&&"ww:size-7 ww:!rounded-full",e),...r});var na=z(te(),1),zN=async e=>{try{let a=await(await fetch(e)).blob();return new Promise(n=>{let r=new FileReader;r.onloadend=()=>n(r.result),r.onerror=()=>n(null),r.readAsDataURL(a)})}catch{return null}},OC=(0,nt.createContext)(null),PC=()=>{let e=(0,nt.useContext)(OC);if(!e)throw new Error("usePromptInputAttachments must be used within a PromptInput");return e},NC=({className:e,accept:t,multiple:a,globalDrop:n,maxFiles:r,maxFileSize:o,onSubmit:l,children:i,...s})=>{let{t:u}=Oe(),c=(0,nt.useRef)(null),d=(0,nt.useRef)(null),[f,p]=(0,nt.useState)([]),m=(0,nt.useRef)(f);(0,nt.useEffect)(()=>{m.current=f},[f]);let x=(0,nt.useCallback)(()=>{c.current?.click()},[]),v=(0,nt.useCallback)(S=>{let M=[...S];if(M.length===0)return;let R=L=>o?L.size<=o:!0,D=M.filter(R);p(L=>{let G=typeof r=="number"?Math.max(0,r-L.length):void 0,B=typeof G=="number"?D.slice(0,G):D;return[...L,...B.map(U=>({filename:U.name,id:As(),mediaType:U.type,type:"file",url:URL.createObjectURL(U)}))]})},[r,o]),y=(0,nt.useCallback)(S=>{p(M=>{let R=M.find(D=>D.id===S);return R?.url&&URL.revokeObjectURL(R.url),M.filter(D=>D.id!==S)})},[]),w=(0,nt.useCallback)(()=>{p(S=>{for(let M of S)M.url&&URL.revokeObjectURL(M.url);return[]})},[]);(0,nt.useEffect)(()=>()=>{for(let S of m.current)S.url&&URL.revokeObjectURL(S.url)},[]);let g=(0,nt.useCallback)(S=>{S.currentTarget.files&&v(S.currentTarget.files),S.currentTarget.value=""},[v]);(0,nt.useEffect)(()=>{if(!n)return;let S=R=>{R.dataTransfer?.types?.includes("Files")&&R.preventDefault()},M=R=>{R.dataTransfer?.types?.includes("Files")&&R.preventDefault(),R.dataTransfer?.files&&R.dataTransfer.files.length>0&&v(R.dataTransfer.files)};return document.addEventListener("dragover",S),document.addEventListener("drop",M),()=>{document.removeEventListener("dragover",S),document.removeEventListener("drop",M)}},[v,n]);let C=(0,nt.useCallback)(async S=>{S.preventDefault();let M=S.currentTarget,D=new FormData(M).get("message")||"";M.reset();let L=await Promise.all(f.map(async({id:G,...B})=>{if(B.url?.startsWith("blob:")){let U=await zN(B.url);return{...B,url:U??B.url}}return B}));try{let G=l({files:L,text:D},S);G instanceof Promise&&await G,w()}catch{}},[f,l,w]),A=(0,nt.useMemo)(()=>({add:v,clear:w,files:f,openFileDialog:x,remove:y}),[f,v,y,w,x]);return(0,na.jsxs)(OC.Provider,{value:A,children:[(0,na.jsx)("input",{accept:t,"aria-label":u.promptInput.uploadFiles,className:"ww:hidden",multiple:a,onChange:g,ref:c,title:u.promptInput.uploadFiles,type:"file"}),(0,na.jsx)("form",{className:H("ww:flex ww:w-full ww:flex-col ww:rounded-lg ww:border ww:border-border ww:bg-background",e),onSubmit:C,ref:d,...s,children:i})]})};var BC=({onChange:e,onKeyDown:t,className:a,placeholder:n,...r})=>{let{t:o}=Oe(),l=PC(),[i,s]=(0,nt.useState)(!1),u=n??o.promptInput.placeholder,c=(0,nt.useCallback)(f=>{if(t?.(f),!f.defaultPrevented){if(f.key==="Enter"){if(i||f.nativeEvent.isComposing||f.shiftKey)return;f.preventDefault();let{form:p}=f.currentTarget;if(p?.querySelector('button[type="submit"]')?.disabled)return;p?.requestSubmit()}if(f.key==="Backspace"&&f.currentTarget.value===""&&l.files.length>0){f.preventDefault();let p=l.files.at(-1);p&&l.remove(p.id)}}},[t,i,l]),d=(0,nt.useCallback)(f=>{let p=f.clipboardData?.items;if(!p)return;let m=[];for(let x of p)if(x.kind==="file"){let v=x.getAsFile();v&&m.push(v)}m.length>0&&(f.preventDefault(),l.add(m))},[l]);return(0,na.jsx)("textarea",{className:H("ww:field-sizing-content ww:max-h-48 ww:min-h-0 ww:w-full ww:resize-none ww:border-0 ww:bg-transparent ww:px-3 ww:py-2 ww:text-base ww:sm:text-sm ww:outline-none ww:placeholder:text-muted-foreground",a),name:"message",onCompositionEnd:()=>s(!1),onCompositionStart:()=>s(!0),onKeyDown:c,onPaste:d,placeholder:u,onChange:e,...r})},UC=({className:e,status:t,onStop:a,onClick:n,children:r,...o})=>{let{t:l}=Oe(),i=t==="submitted"||t==="streaming",s=(0,na.jsx)(Co,{className:"ww:size-4"});t==="submitted"?s=(0,na.jsx)(vs,{className:"ww:size-4 ww:animate-spin"}):t==="streaming"&&(s=(0,na.jsx)(Cs,{className:"ww:size-4"}));let u=(0,nt.useCallback)(c=>{if(i&&a){c.preventDefault(),a();return}n?.(c)},[i,a,n]);return(0,na.jsx)(wn,{"aria-label":i?l.promptInput.stop:l.promptInput.submit,className:H("ww:bg-foreground ww:text-background ww:hover:bg-foreground ww:rounded-full",e),onClick:u,size:"icon-sm",type:i&&a?"button":"submit",variant:"ghost",...o,children:r??s})},FC=({className:e,children:t,...a})=>{let{t:n}=Oe(),r=PC();return r.files.length>0?(0,na.jsxs)(wn,{className:H("ww:group ww:relative",e),onClick:()=>r.clear(),size:"icon-sm",type:"button",variant:"ghost","aria-label":n.promptInput.removeAttachments,...a,children:[(0,na.jsx)("span",{className:"ww:flex ww:size-5 ww:items-center ww:justify-center ww:rounded-full ww:bg-primary ww:text-[10px] ww:font-medium ww:text-primary-foreground ww:transition-opacity ww:group-hover:opacity-0",children:r.files.length}),(0,na.jsx)(Kn,{className:"ww:absolute ww:size-4 ww:opacity-0 ww:transition-opacity ww:group-hover:opacity-100"})]}):(0,na.jsx)(wn,{className:H(e),onClick:()=>r.openFileDialog(),size:"icon-sm",type:"button",variant:"ghost",...a,children:t??(0,na.jsx)(Ss,{className:"ww:size-4"})})};var qC=z(te(),1);function zC({text:e}){let{t}=Oe();return e===!1?null:(0,qC.jsx)("span",{className:"ww:whitespace-nowrap ww:text-[10px] ww:sm:text-[11px] ww:text-muted-foreground ww:opacity-70",children:e||t.aiDisclaimer.default})}var ud=z(De(),1);var ko=z(te(),1),HC=({className:e,...t})=>(0,ko.jsx)("div",{className:H("ww:flex ww:flex-col ww:gap-1 ww:px-3 ww:py-2",e),...t}),jC=({className:e,...t})=>(0,ko.jsx)("li",{className:H("ww:group ww:flex ww:items-center ww:gap-2 ww:rounded-md ww:px-2 ww:py-1 ww:text-sm ww:transition-colors ww:hover:bg-muted",e),...t}),VC=({className:e,...t})=>(0,ko.jsx)("span",{className:H("ww:inline-block ww:size-2 ww:shrink-0 ww:rounded-full ww:border ww:border-muted-foreground/50",e),...t}),GC=({className:e,...t})=>(0,ko.jsx)("span",{className:H("ww:line-clamp-1 ww:grow ww:break-words ww:text-muted-foreground",e),...t}),$C=({className:e,...t})=>(0,ko.jsx)("div",{className:H("ww:flex ww:shrink-0 ww:gap-1 ww:opacity-0 ww:transition-opacity ww:group-hover:opacity-100",e),...t}),WC=({className:e,...t})=>(0,ko.jsx)(wn,{className:H("ww:size-auto ww:rounded ww:p-1 ww:text-muted-foreground ww:hover:bg-muted-foreground/10 ww:hover:text-foreground",e),size:"icon",type:"button",variant:"ghost",...t});var Wa=z(te(),1),XC=(0,ud.memo)(({message:e,onRemove:t})=>{let{t:a}=Oe(),n=(0,ud.useCallback)(()=>t(e.id),[t,e.id]);return(0,Wa.jsxs)(jC,{children:[(0,Wa.jsx)(VC,{}),(0,Wa.jsx)(GC,{children:e.text||a.chatQueue.attachmentFallback}),(0,Wa.jsx)($C,{children:(0,Wa.jsx)(WC,{"aria-label":a.chatQueue.removeFromQueue,onClick:n,children:(0,Wa.jsx)(Kn,{className:"ww:size-3"})})})]})});XC.displayName="ChatQueueItem";function KC({queuedMessages:e,onRemove:t,className:a}){let{t:n}=Oe();return e.length===0?null:(0,Wa.jsxs)(HC,{className:H("ww:border-t ww:border-border",a),children:[(0,Wa.jsx)("div",{className:"ww:text-[11px] ww:font-medium ww:text-muted-foreground ww:px-2",children:n.chatQueue.queued(e.length)}),(0,Wa.jsx)("ul",{children:e.map(r=>(0,Wa.jsx)(XC,{message:r,onRemove:t},r.id))})]})}var Ur=z(te(),1),ZC=({files:e,className:t,...a})=>e.length===0?null:(0,Ur.jsx)("div",{className:H("ww:flex ww:flex-wrap ww:gap-1.5",t),...a,children:e.map((n,r)=>(0,Ur.jsx)(qN,{file:n},r))});function qN({file:e}){let{t}=Oe();return e.mediaType?.startsWith("image/")&&e.url?(0,Ur.jsx)("img",{src:e.url,alt:e.filename??t.attachments.attachmentFallback,className:"ww:h-16 ww:max-w-32 ww:rounded ww:object-cover"}):(0,Ur.jsxs)("span",{className:"ww:inline-flex ww:items-center ww:gap-1.5 ww:rounded ww:bg-background/20 ww:px-2 ww:py-1 ww:text-xs",children:[(0,Ur.jsx)(ws,{className:"ww:size-3 ww:shrink-0"}),(0,Ur.jsx)("span",{className:"ww:max-w-24 ww:truncate",children:e.filename??t.attachments.fileFallback})]})}var xa=z(De(),1);var yt=z(De(),1);mf();var AE=z(De(),1);var ME=z(te(),1),i5=({as:e="span",className:t,duration:a=2,style:n,children:r,...o})=>{let l={backgroundImage:"linear-gradient(90deg, var(--ww-color-muted-foreground) 0%, var(--ww-color-muted-foreground) 40%, var(--ww-color-foreground) 50%, var(--ww-color-muted-foreground) 60%, var(--ww-color-muted-foreground) 100%)",backgroundSize:"250% 100%",WebkitBackgroundClip:"text",backgroundClip:"text",color:"transparent",animation:`ww-shimmer ${a}s linear infinite`,...n};return(0,ME.jsx)(e,{"data-waniwani-shimmer":"",className:H("ww:inline-block",t),style:l,...o,children:r})},sn=(0,AE.memo)(i5);sn.displayName="Shimmer";var Jt=z(te(),1),EE=(0,yt.createContext)(null);function RE(){let e=(0,yt.useContext)(EE);if(!e)throw new Error("Reasoning components must be used within <Reasoning>");return e}var s5=1e3,u5=1e3,au=(0,yt.memo)(({className:e,isStreaming:t=!1,open:a,defaultOpen:n,onOpenChange:r,duration:o,children:l,...i})=>{let s=n??t,u=n===!1,c=a!==void 0,[d,f]=(0,yt.useState)(s),p=c?a:d,m=(0,yt.useCallback)(M=>{c||f(M),r?.(M)},[c,r]),[x,v]=(0,yt.useState)(void 0),y=o??x,w=(0,yt.useRef)(t),[g,C]=(0,yt.useState)(!1),A=(0,yt.useRef)(null);(0,yt.useEffect)(()=>{t?(w.current=!0,A.current===null&&(A.current=Date.now())):A.current!==null&&(v(Math.ceil((Date.now()-A.current)/u5)),A.current=null)},[t]),(0,yt.useEffect)(()=>{t&&!p&&!u&&m(!0)},[t,p,u,m]),(0,yt.useEffect)(()=>{if(w.current&&!t&&p&&!g){let M=setTimeout(()=>{m(!1),C(!0)},s5);return()=>clearTimeout(M)}},[t,p,g,m]);let S=(0,yt.useMemo)(()=>({isStreaming:t,isOpen:p,setIsOpen:m,duration:y}),[t,p,m,y]);return(0,Jt.jsx)(EE.Provider,{value:S,children:(0,Jt.jsx)("div",{className:H("ww:mb-4 ww:flex ww:flex-col ww:gap-2",e),"data-state":p?"open":"closed",style:{animation:"ww-fade-in 0.2s ease-out"},...i,children:l})})});au.displayName="Reasoning";var nu=(0,yt.memo)(({className:e,children:t,getThinkingMessage:a,hideIcon:n=!1,onClick:r,...o})=>{let{t:l}=Oe(),{isStreaming:i,isOpen:s,duration:u,setIsOpen:c}=RE(),f=a??((p,m)=>p||m===0?(0,Jt.jsx)(sn,{duration:1.6,children:l.reasoning.thinking}):m===void 0?(0,Jt.jsx)("span",{children:l.reasoning.thoughtBrief}):(0,Jt.jsx)("span",{children:l.reasoning.thoughtForSeconds(m)}));return(0,Jt.jsx)("button",{type:"button","aria-expanded":s,onClick:p=>{c(!s),r?.(p)},className:H("ww:flex ww:w-full ww:items-center ww:gap-2 ww:text-sm ww:text-muted-foreground ww:transition-colors ww:hover:text-foreground",e),...o,children:t??(0,Jt.jsxs)(Jt.Fragment,{children:[!n&&(0,Jt.jsx)(Xn,{className:"ww:size-4 ww:shrink-0"}),f(i,u)]})})});nu.displayName="ReasoningTrigger";var ru=(0,yt.memo)(({className:e,children:t,...a})=>{let{isOpen:n}=RE();return(0,Jt.jsx)("div",{className:H("ww:grid ww:transition-[grid-template-rows,opacity] ww:duration-200 ww:ease-out",n?"ww:grid-rows-[1fr] ww:opacity-100":"ww:grid-rows-[0fr] ww:opacity-0"),children:(0,Jt.jsx)("div",{className:"ww:min-h-0 ww:overflow-hidden",children:(0,Jt.jsx)("div",{className:H("ww:text-sm ww:text-muted-foreground",e),...a,children:(0,Jt.jsx)(ei,{children:t})})})})});ru.displayName="ReasoningContent";var Ce=z(te(),1),c5=500,DE=(0,xa.createContext)(null);function _E(){let e=(0,xa.useContext)(DE);if(!e)throw new Error("ChainOfThought components must be used within <ChainOfThought>");return e}function OE({className:e,isWorking:t=!1,activeStep:a,open:n,defaultOpen:r=!1,onOpenChange:o,children:l,...i}){let s=n!==void 0,[u,c]=(0,xa.useState)(r),d=s?n:u,f=(0,xa.useCallback)(v=>{s||c(v),o?.(v)},[s,o]),[p,m]=(0,xa.useState)(!t);(0,xa.useEffect)(()=>{if(t){m(!1);return}let v=setTimeout(()=>m(!0),c5);return()=>clearTimeout(v)},[t]);let x=(0,xa.useMemo)(()=>({open:d,setOpen:f,isWorking:t,settled:p,activeStep:a}),[d,f,t,p,a]);return(0,Ce.jsx)(DE.Provider,{value:x,children:(0,Ce.jsx)("div",{className:H("ww:mb-4 ww:flex ww:flex-col ww:gap-2",e),"data-state":d?"open":"closed",style:{animation:"ww-fade-in 0.2s ease-out"},...i,children:l})})}function PE({className:e,label:t,workingLabel:a,children:n,...r}){let{open:o,setOpen:l,isWorking:i,settled:s,activeStep:u}=_E();if(!s){let c=u?.icon,d=u?.label??a??t??"";return(0,Ce.jsx)("div",{className:H("ww:flex ww:min-h-5 ww:w-full ww:items-center ww:gap-1.5 ww:text-sm ww:text-muted-foreground",e),children:(0,Ce.jsxs)("span",{className:"ww:flex ww:min-w-0 ww:items-center ww:gap-1.5",style:{animation:"ww-fade-in 0.25s ease-out"},children:[c&&(0,Ce.jsx)(c,{className:H("ww:size-4 ww:shrink-0",i&&"ww:animate-pulse")}),(0,Ce.jsx)("span",{className:"ww:truncate",children:i?(0,Ce.jsx)(sn,{duration:2.6,children:d}):d})]},d)})}return(0,Ce.jsxs)("button",{type:"button",onClick:()=>l(!o),"aria-expanded":o,className:H("ww:flex ww:min-h-5 ww:w-full ww:items-center ww:gap-1.5 ww:text-sm ww:text-muted-foreground ww:transition-colors ww:hover:text-foreground",e),style:{animation:"ww-fade-in 0.25s ease-out"},...r,children:[(0,Ce.jsx)("span",{className:"ww:truncate",children:n??t}),(0,Ce.jsx)(Br,{className:H("ww:size-4 ww:shrink-0 ww:transition-transform ww:duration-200",o&&"ww:rotate-180")})]})}function NE({className:e,children:t,...a}){let{open:n}=_E();return(0,Ce.jsx)("div",{className:H("ww:grid ww:transition-[grid-template-rows,opacity] ww:duration-200 ww:ease-out",n?"ww:grid-rows-[1fr] ww:opacity-100":"ww:grid-rows-[0fr] ww:opacity-0"),children:(0,Ce.jsx)("div",{className:"ww:min-h-0 ww:overflow-hidden",children:(0,Ce.jsx)("div",{className:H("ww:flex ww:flex-col",e),...a,children:t})})})}function BE({icon:e,isLast:t,running:a,error:n}){return(0,Ce.jsxs)("div",{className:"ww:flex ww:flex-col ww:items-center ww:self-stretch",children:[(0,Ce.jsx)("span",{className:"ww:flex ww:h-5 ww:items-center",children:(0,Ce.jsx)(e,{className:H("ww:size-4 ww:shrink-0",n?"ww:text-destructive":a?"ww:animate-pulse ww:text-foreground":"ww:text-muted-foreground")})}),!t&&(0,Ce.jsx)("span",{className:"ww:w-px ww:flex-1 ww:bg-border"})]})}function Iw({className:e,icon:t,title:a,state:n,isLast:r=!1,children:o,...l}){let i=n==="input-available"||n==="input-streaming",s=n==="output-error",u=o!=null,[c,d]=(0,xa.useState)(!1),f=a??"",p=i?(0,Ce.jsx)(sn,{duration:1.6,children:f}):(0,Ce.jsx)("span",{className:"ww:truncate",children:f});return(0,Ce.jsxs)("div",{className:H("ww:flex ww:gap-2",e),...l,children:[(0,Ce.jsx)(BE,{icon:t,isLast:r,running:i,error:s}),(0,Ce.jsxs)("div",{className:H("ww:min-w-0 ww:flex-1",!r&&"ww:pb-3"),children:[u?(0,Ce.jsxs)("button",{type:"button",onClick:()=>d(m=>!m),"aria-expanded":c,className:"ww:flex ww:w-full ww:items-center ww:gap-1.5 ww:text-left ww:text-sm ww:text-muted-foreground ww:transition-colors ww:hover:text-foreground",children:[p,(0,Ce.jsx)(Br,{className:H("ww:size-3.5 ww:shrink-0 ww:transition-transform ww:duration-200",c&&"ww:rotate-180")})]}):(0,Ce.jsx)("div",{className:"ww:flex ww:items-center ww:text-sm ww:text-muted-foreground",children:p}),u&&(0,Ce.jsx)("div",{className:H("ww:grid ww:transition-[grid-template-rows,opacity] ww:duration-200 ww:ease-out",c?"ww:grid-rows-[1fr] ww:opacity-100":"ww:grid-rows-[0fr] ww:opacity-0"),children:(0,Ce.jsx)("div",{className:"ww:min-h-0 ww:overflow-hidden",children:(0,Ce.jsx)("div",{className:"ww:mt-2 ww:space-y-3 ww:rounded-lg ww:border ww:border-border ww:bg-background ww:p-3",children:o})})})]})]})}function UE({isStreaming:e=!1,isLast:t=!1,children:a}){return(0,Ce.jsxs)("div",{className:"ww:flex ww:gap-2",children:[(0,Ce.jsx)(BE,{icon:Xn,isLast:t,running:e}),(0,Ce.jsx)("div",{className:H("ww:min-w-0 ww:flex-1",!t&&"ww:pb-3"),children:(0,Ce.jsxs)(au,{isStreaming:e,className:"ww:mb-0",children:[(0,Ce.jsx)(nu,{hideIcon:!0}),(0,Ce.jsx)(ru,{children:a})]})})]})}var kw={name:"cjk-noop",type:"cjk",remarkPluginsBefore:[],remarkPluginsAfter:[],remarkPlugins:[]};var FE={name:"shiki-noop",type:"code-highlighter",supportsLanguage:()=>!1,getSupportedLanguages:()=>[],getThemes:()=>["github-light","github-dark"],highlight:()=>null};var HE=z(De(),1);var nr=z(De(),1),d5=5,zE=400;function qE(e,t,a={}){let{msPerChar:n=d5}=a,[r,o]=(0,nr.useState)(t?"":e),l=(0,nr.useRef)(e),i=(0,nr.useRef)(t?0:e.length),s=(0,nr.useRef)(0),u=(0,nr.useRef)(null);return(e.length<i.current||!e.startsWith(r.slice(0,i.current)))&&(i.current=t?0:e.length),l.current=e,(0,nr.useEffect)(()=>{if(!t){u.current!==null&&(cancelAnimationFrame(u.current),u.current=null),i.current=e.length,o(e);return}if(l.current.length-i.current>zE&&(i.current=l.current.length-zE),u.current!==null)return;let d=f=>{let p=l.current;if(i.current>=p.length){u.current=null;return}s.current===0&&(s.current=f);let m=f-s.current;if(m>=n){let x=Math.min(Math.floor(m/n),p.length-i.current);i.current+=x,o(p.slice(0,i.current)),s.current=f}u.current=requestAnimationFrame(d)};return u.current=requestAnimationFrame(d),()=>{u.current!==null&&(cancelAnimationFrame(u.current),u.current=null)}},[e,t,n]),r}var ou=z(te(),1),Lw=({className:e,from:t,children:a,...n})=>(0,ou.jsx)("div",{className:H("ww-message ww:group ww:flex ww:w-full",t==="user"?"ww-message-user is-user ww:ml-auto ww:flex-col ww:items-end ww:[max-width:var(--ww-msg-max-width,80%)]":"ww-message-assistant is-assistant ww:flex-col",e),...n,children:(0,ou.jsx)("div",{className:H("ww:flex ww:min-w-0 ww:flex-col ww:gap-2","ww:w-full"),children:a})}),Tw=({children:e,className:t,...a})=>(0,ou.jsx)("div",{className:H("ww-bubble ww:flex ww:w-fit ww:min-w-0 ww:max-w-full ww:flex-col ww:gap-2 ww:overflow-hidden","ww:[font-size:var(--ww-font-size,1rem)] ww:[line-height:var(--ww-line-height,1.5)]","ww:group-[.is-user]:ml-auto ww:group-[.is-user]:bg-user-bubble ww:group-[.is-user]:[color:var(--ww-color-user-bubble-text)] ww:group-[.is-user]:[border-radius:var(--ww-msg-radius,8px)] ww:group-[.is-user]:[padding:var(--ww-msg-pad-y,12px)_var(--ww-msg-pad-x,16px)]","ww:group-[.is-assistant]:text-foreground",t),...a,children:e}),f5={cjk:kw,code:FE},p5={cjk:kw},m5={enabled:!1};function h5({className:e,linkSafety:t,isStreaming:a,children:n,...r}){let l=qE(typeof n=="string"?n:"",!!a),i=typeof n=="string"?l:n;return(0,ou.jsx)(ei,{className:H("ww:size-full ww:[&>*:first-child]:mt-0 ww:[&>*:last-child]:mb-0",e),linkSafety:t??m5,plugins:a?p5:f5,...r,children:i})}var xf=(0,HE.memo)(h5,(e,t)=>e.children===t.children&&e.isStreaming===t.isStreaming);xf.displayName="MessageResponse";var Ut=z(De(),1);var de=z(te(),1);function g5(e,t=80){if(e==null)return String(e);if(typeof e!="object")return String(e).slice(0,t);if(Array.isArray(e))return`Array(${e.length})`;let a=JSON.stringify(e);if(a.length<=t)return a;let n=Object.entries(e),r=[],o=t-2;for(let[l,i]of n){if(o<=8)break;let s=l.length>4?`${l.slice(0,4)}\u2026`:l,u;typeof i=="string"?u=i.length>2?`'${i.slice(0,1)}\u2026`:`'${i}'`:Array.isArray(i)?u=`Array(${i.length})`:typeof i=="object"&&i!==null?u="{\u2026}":u=String(i);let c=`${s}\u2009${u}`;r.push(c),o-=c.length+3}return`{${r.join(", ")}}`}function y5({text:e,className:t}){let{t:a}=Oe(),[n,r]=(0,Ut.useState)(!1),o=(0,Ut.useRef)(null);(0,Ut.useEffect)(()=>()=>{o.current&&clearTimeout(o.current)},[]);let l=(0,Ut.useCallback)(async i=>{i.stopPropagation();try{await navigator.clipboard.writeText(e),r(!0),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>r(!1),2e3)}catch{}},[e]);return(0,de.jsx)(wn,{variant:"ghost",size:"sm",onClick:l,className:H("ww:h-auto ww:gap-1 ww:px-1.5 ww:py-0.5 ww:text-xs ww:text-muted-foreground ww:hover:text-foreground",t),children:n?(0,de.jsxs)(de.Fragment,{children:[(0,de.jsx)(hs,{className:"ww:size-3.5"}),(0,de.jsx)("span",{children:a.tool.copied})]}):(0,de.jsxs)(de.Fragment,{children:[(0,de.jsx)(ys,{className:"ww:size-3.5"}),(0,de.jsx)("span",{children:a.tool.copy})]})})}function GE({data:e,label:t,className:a,...n}){let[r,o]=(0,Ut.useState)(!1),l=(0,Ut.useMemo)(()=>JSON.stringify(e,null,2),[e]),i=g5(e);return(0,de.jsxs)("div",{className:H("ww:rounded-lg ww:bg-tool-card",a),...n,children:[(0,de.jsxs)("div",{className:"ww:flex ww:items-center ww:justify-between ww:px-3 ww:pt-2.5 ww:pb-1.5",children:[(0,de.jsx)("span",{className:"ww:text-xs ww:font-medium ww:text-muted-foreground",children:t}),(0,de.jsx)(y5,{text:l})]}),(0,de.jsxs)("button",{type:"button",onClick:()=>o(s=>!s),className:"ww:flex ww:w-full ww:items-start ww:gap-2 ww:px-3 ww:pb-3 ww:text-left",children:[(0,de.jsx)(gs,{className:H("ww:mt-0.5 ww:size-3.5 ww:shrink-0 ww:text-muted-foreground ww:transition-transform ww:duration-150",r&&"ww:rotate-90")}),r?(0,de.jsx)("pre",{className:"ww:overflow-x-auto ww:text-xs ww:font-mono ww:text-foreground ww:whitespace-pre-wrap ww:break-all",children:(0,de.jsx)("code",{children:l})}):(0,de.jsx)("span",{className:"ww:truncate ww:text-xs ww:font-mono ww:text-foreground/80",children:i})]})]})}var Mw=(0,Ut.createContext)({open:!1,toggle:()=>{}});function $E({className:e,defaultOpen:t=!1,children:a,...n}){let[r,o]=(0,Ut.useState)(t);return(0,de.jsx)(Mw.Provider,{value:{open:r,toggle:()=>o(l=>!l)},children:(0,de.jsx)("div",{className:H("ww:mb-4 ww:w-full",e),"data-state":r?"open":"closed",style:{animation:"ww-fade-in 0.2s ease-out"},...n,children:a})})}function WE({className:e,title:t,state:a,...n}){let{open:r,toggle:o}=(0,Ut.useContext)(Mw),l=a==="input-available"||a==="input-streaming",i=t??"";return(0,de.jsxs)("button",{type:"button",onClick:o,className:H("ww:flex ww:w-full ww:items-center ww:gap-2 ww:text-sm ww:text-muted-foreground ww:transition-colors ww:hover:text-foreground",e),"aria-expanded":r,...n,children:[(0,de.jsx)(Io,{className:"ww:size-4 ww:shrink-0"}),(0,de.jsx)("span",{className:"ww:truncate",children:l?(0,de.jsx)(sn,{duration:1.6,children:i}):i}),(0,de.jsx)(Br,{className:H("ww:size-4 ww:shrink-0 ww:transition-transform ww:duration-200",r&&"ww:rotate-180")})]})}function XE({className:e,title:t,state:a,...n}){let r=a==="input-available"||a==="input-streaming",o=t??"";return(0,de.jsx)("div",{className:H("ww:mb-4 ww:flex ww:items-center ww:gap-2 ww:text-sm ww:text-muted-foreground",e),style:{animation:"ww-fade-in 0.2s ease-out"},...n,children:(0,de.jsx)("span",{className:"ww:truncate",children:r?(0,de.jsx)(sn,{duration:1.6,children:o}):o})})}function KE({className:e,children:t,...a}){let{open:n}=(0,Ut.useContext)(Mw);return(0,de.jsx)("div",{className:H("ww:grid ww:transition-[grid-template-rows,opacity] ww:duration-200 ww:ease-out",n?"ww:grid-rows-[1fr] ww:opacity-100":"ww:grid-rows-[0fr] ww:opacity-0"),children:(0,de.jsx)("div",{className:"ww:min-h-0 ww:overflow-hidden",children:(0,de.jsx)("div",{className:H("ww:mt-2 ww:space-y-3 ww:rounded-lg ww:border ww:border-border ww:bg-background ww:p-3",e),...a,children:t})})})}function Ew({className:e,input:t,debug:a,...n}){let{t:r}=Oe(),o=(0,Ut.useMemo)(()=>{if(!a&&typeof t=="object"&&t!==null&&!Array.isArray(t)){let{_meta:l,...i}=t;return i}return t},[t,a]);return(0,de.jsx)(GE,{data:o,label:r.tool.request,className:e,...n})}function Aw(e){if(!(typeof e!="object"||e===null))return e}function ZE(e){return Aw(e?.ui)}function QE(e){return Aw(Aw(e)?._meta)}function jE(e){if(!e)return;let t=ZE(e)?.resourceUri;if(typeof t=="string"&&t.length>0)return t;let a=e["ui/resourceUri"];if(typeof a=="string"&&a.length>0)return a;let n=e["openai/outputTemplate"];if(typeof n=="string"&&n.length>0)return n}function VE(e){return ZE(e)?.autoHeight===!0}function lu(e,t,a){if(e){let n=jE(a?.[e]?._meta);if(n)return n}return jE(QE(t))}function YE(e,t,a){return e&&VE(a?.[e]?._meta)?!0:VE(QE(t))}function Rw({className:e,output:t,errorText:a,debug:n,...r}){let{t:o}=Oe(),l=(0,Ut.useMemo)(()=>{if(!n&&typeof t=="object"&&t!==null&&!Array.isArray(t)){let{_meta:i,...s}=t;return s}return t},[t,n]);return t||a?a?(0,de.jsxs)("div",{className:H("ww:space-y-2",e),...r,children:[(0,de.jsx)("h4",{className:"ww:text-xs ww:font-medium ww:uppercase ww:tracking-wide ww:text-muted-foreground",children:o.tool.error}),(0,de.jsx)("div",{className:"ww:rounded-lg ww:bg-destructive/10 ww:p-3 ww:text-xs ww:text-destructive",children:a})]}):(0,de.jsx)(GE,{data:l,label:o.tool.response,className:e,...r}):null}var iu=z(te(),1);function JE(e){return e.type==="text"||e.type==="reasoning"||e.type==="file"||"toolCallId"in e}function eR(e){return e.parts.some(JE)}function tR(e,t,a){if(t!=="submitted"&&t!=="streaming")return!1;let n=e[e.length-1];return!n||n.role!=="assistant"?!0:!n.parts.some(o=>!(!JE(o)||a?.ignoreToolParts&&"toolCallId"in o||a?.ignoreReasoningParts&&o.type==="reasoning"))}function aR({className:e,...t}){let{t:a}=Oe();return(0,iu.jsxs)("div",{"aria-live":"polite",className:H("ww:mb-4 ww:flex ww:w-full ww:items-center ww:gap-2 ww:text-sm ww:text-muted-foreground",e),style:{animation:"ww-fade-in 0.2s ease-out"},...t,children:[(0,iu.jsx)(Is,{className:"ww:size-4 ww:shrink-0"}),(0,iu.jsx)(sn,{duration:1.6,children:a.workingIndicator.default})]})}var et=z(De(),1);function ti(e){if(!e)return!1;let t=Array.isArray(e.content)&&e.content.length>0,a=typeof e.structuredContent=="object"&&e.structuredContent!==null&&Object.keys(e.structuredContent).length>0;return t||a}function nR(e,t){return!ti(e)&&!ti(t)?null:ti(e)?ti(t)?{...e.content||t.content?{content:[...e.content??[],...t.content??[]]}:{},...e.structuredContent||t.structuredContent?{structuredContent:{...e.structuredContent??{},...t.structuredContent??{}}}:{}}:{...e.content?{content:[...e.content]}:{},...e.structuredContent?{structuredContent:{...e.structuredContent}}:{}}:{...t?.content?{content:[...t.content]}:{},...t?.structuredContent?{structuredContent:{...t.structuredContent}}:{}}}var oR=z(te(),1),w5="/api/mcp/resource",x5=500,v5=0,b5=16,S5="2026-01-26",C5=300,I5=3e3,k5=3;function L5(e){if(typeof e!="string")return;let t=e.trim();return t.length>0?t:void 0}function T5(e,t,a){return lu(e,t,a)?!1:t._meta?.["waniwani/autoInjectResultText"]!==!1}function rR({resourceUri:e,toolInput:t,toolResult:a,resourceEndpoint:n=w5,chatSessionId:r,isDark:o=!1,className:l,autoHeight:i=!1,onOpenLink:s,onFollowUp:u,onCallTool:c,onDisplayModeChange:d,isFullscreen:f=!1,toolDefinitions:p}){let m=(0,et.useRef)(null),x=(0,et.useRef)(t),v=(0,et.useRef)(a),y=(0,et.useRef)({width:0,height:0}),w=(0,et.useRef)(null),g=(0,et.useRef)(!1),C=(0,et.useRef)(0),A=(0,et.useRef)("inline"),[S,M]=(0,et.useState)(v5),[R,D]=(0,et.useState)(void 0),L=(0,et.useRef)(s),G=(0,et.useRef)(u),B=(0,et.useRef)(c),U=(0,et.useRef)(d),W=(0,et.useRef)(r),E=(0,et.useRef)(p);x.current=t,v.current=a,L.current=s,G.current=u,B.current=c,U.current=d,W.current=r,E.current=p;let j=(0,et.useCallback)(b=>i?Math.max(b+b5,0):Math.min(Math.max(b,50),x5),[i]),$=(0,et.useMemo)(()=>{let b=n.includes("?")?"&":"?";return`${n}${b}uri=${encodeURIComponent(e)}`},[n,e]),he=(0,et.useRef)(o);he.current=o;let Ie=(0,et.useRef)(f);return(0,et.useEffect)(()=>{Ie.current=f,y.current.height=-1,w.current&&(w.current.cancel(),w.current=null)},[f]),(0,et.useEffect)(()=>{if(!g.current)return;let b=m.current;b?.contentWindow&&b.contentWindow.postMessage({jsonrpc:"2.0",method:"ui/notifications/host-context-changed",params:{theme:o?"dark":"light"}},"*")},[o]),(0,et.useEffect)(()=>{let b=m.current;if(!b)return;let qe=!1,rt=!1,k=null,ke=null,ie=setTimeout(()=>{if(qe||rt||C.current>=k5)return;C.current+=1;let Le=new URL(b.src);Le.searchParams.set("_retry",String(C.current)),b.src=Le.toString()},I5),ge=Le=>{b.contentWindow?.postMessage(Le,"*")},It=Le=>{if(qe||Le.source!==b.contentWindow)return;let Ee=Le.data;if(!Ee||typeof Ee!="object"||Ee.jsonrpc!=="2.0")return;let ye=Ee.method,we=Ee.id;if(ye==="ui/initialize"&&we!=null){rt=!0,clearTimeout(ie),ge({jsonrpc:"2.0",id:we,result:{protocolVersion:Ee.params?.protocolVersion??S5,hostInfo:{name:"Waniwani Chat",version:"1.0.0"},hostCapabilities:{openLinks:{},message:{text:{}},tools:{},updateModelContext:{text:{},structuredContent:{}}},hostContext:{theme:he.current?"dark":"light",displayMode:A.current}}});return}if(ye==="ui/notifications/initialized"){g.current=!0;let fe=x.current,Ue=v.current,Te=Ue._meta&&typeof Ue._meta=="object"?Ue._meta:null,je=L5(W.current),ot=Te&&typeof Te.waniwani=="object"&&Te.waniwani!==null?Te.waniwani:null,Y=ot||je?{...ot??{},...je?{sessionId:je}:{}}:void 0,Re=Te||Y?{...Te??{},...Y?{waniwani:Y}:{}}:void 0;ge({jsonrpc:"2.0",method:"ui/notifications/tool-input",params:{arguments:fe}});let ht=Ue.content??[{type:"text",text:JSON.stringify(Ue)}];ge({jsonrpc:"2.0",method:"ui/notifications/tool-result",params:{content:ht,structuredContent:Ue.structuredContent,_meta:Re,meta:Re}});return}if(ye==="ui/notifications/size-changed"){let fe=Ee.params,Ue=typeof fe?.height=="number"?fe.height:void 0,Te=typeof fe?.width=="number"?fe.width:void 0,je=y.current,ot=Ue!==void 0&&Ue!==je.height,Y=Te!==void 0&&Te!==je.width;if(!ot&&!Y)return;if(ot&&Ue!==void 0){if(je.height=Ue,Ie.current)return;let Re=j(Ue),ht=b.getBoundingClientRect().height;if(w.current&&(w.current.cancel(),w.current=null),M(Re),b.animate&&Math.abs(ht-Re)>2){let jt=b.animate([{height:`${ht}px`},{height:`${Re}px`}],{duration:C5,easing:"ease-out",fill:"forwards"});w.current=jt,jt.onfinish=()=>{w.current===jt&&(jt.cancel(),w.current=null)}}}Y&&i&&Te!==void 0&&(je.width=Te,D(Te));return}if(ye==="ui/open-link"&&we!=null){let fe=Ee.params?.url;typeof fe=="string"&&(L.current?L.current(fe):window.open(fe,"_blank","noopener,noreferrer")),ge({jsonrpc:"2.0",id:we,result:{}});return}if(ye==="ui/message"&&we!=null){if(G.current&&Ee.params){let fe=Ee.params,Ue=k;if(k=null,ke){clearTimeout(ke.timer);let Te=ke.text;ke=null;let je=(fe.content??[]).map(ot=>ot.text??"").join("").trim();fe={...fe,content:[{type:"text",text:`${je}
|
|
122
122
|
|
|
123
|
-
${Xe}`}]}}G.current({...oe,...ye?{modelContext:ye}:{}})}et({jsonrpc:"2.0",id:ue,result:{}});return}if(pe==="ui/update-model-context"&&ue!=null){L=gR(L,X.params),et({jsonrpc:"2.0",id:ue,result:{}});return}if(pe==="tools/call"&&ue!=null){let oe=B.current;if(!oe){et({jsonrpc:"2.0",id:ue,error:{code:-32601,message:"tools/call not supported"}});return}let ye=X.params?.name;oe({name:ye,arguments:X.params?.arguments??{}}).then(Xe=>{et({jsonrpc:"2.0",id:ue,result:Xe});let dt=Xe.content?.map(nt=>nt.text??"").join("").trim();dt&&q5(ye,Xe,A.current)&&(ke&&clearTimeout(ke.timer),ke={text:dt,timer:setTimeout(()=>{if(De)return;let nt=L;L=null,ke=null,G.current?.({role:"user",content:[{type:"text",text:dt}],...nt?{modelContext:nt}:{}})},500)})}).catch(Xe=>{let dt=Xe instanceof Error?Xe.message:"Tool call failed";et({jsonrpc:"2.0",id:ue,error:{code:-32e3,message:dt}})});return}if(pe==="ui/request-display-mode"&&ue!=null){let oe=X.params?.mode,ye=oe==="fullscreen"||oe==="inline"||oe==="pip"?oe:"inline";T.current=ye,et({jsonrpc:"2.0",id:ue,result:{mode:ye}}),et({jsonrpc:"2.0",method:"ui/notifications/host-context-changed",params:{displayMode:ye}}),U.current?.(ye);return}if(pe==="ui/resource-teardown"&&ue!=null){et({jsonrpc:"2.0",id:ue,result:{}});return}pe==="ping"&&ue!=null&&et({jsonrpc:"2.0",id:ue,result:{}})};return window.addEventListener("message",Ut),()=>{De=!0,clearTimeout(St),ke&&clearTimeout(ke.timer),window.removeEventListener("message",Ut)}},[l,H]),(0,wR.jsx)("iframe",{ref:m,src:$,sandbox:"allow-scripts allow-forms allow-same-origin allow-popups allow-popups-to-escape-sandbox",className:j(!f&&"ww:rounded-md ww:border ww:border-border",i),style:{height:f?"100%":S,minWidth:f||!R?void 0:`min(${R}px, 100%)`,width:"100%",border:"none",colorScheme:o?"dark":"auto"},title:"MCP App"})}var Kr=z(ne(),1);function xR({icon:e,title:t,description:a,suggestions:n,onSuggestionSelect:r}){return(0,Kr.jsxs)("div",{className:"ww:flex ww:flex-col ww:items-center ww:justify-center ww:py-12 ww:px-6 ww:text-center ww:min-h-full",children:[e&&(0,Kr.jsx)("div",{className:"ww:mb-4 ww:flex ww:items-center ww:justify-center ww:size-12 ww:rounded-xl ww:bg-foreground ww:text-background",children:e}),(0,Kr.jsx)("h2",{className:"ww:text-lg ww:font-semibold ww:text-foreground",children:t}),a&&(0,Kr.jsx)("p",{className:"ww:mt-1 ww:text-sm ww:text-muted-foreground ww:max-w-sm",children:a}),n&&n.length>0&&(0,Kr.jsx)("div",{className:"ww:mt-6 ww:w-full ww:max-w-md ww:flex ww:flex-col ww:gap-2",children:n.map((o,i)=>(0,Kr.jsx)("button",{type:"button",onClick:()=>r?.(o),className:j("ww:w-full ww:text-left ww:rounded-xl ww:border ww:border-border ww:bg-background ww:px-4 ww:py-3 ww:text-sm","ww:text-foreground ww:hover:bg-accent ww:hover:border-primary/30","ww:transition-all ww:duration-200 ww:ease-out ww:cursor-pointer","ww:animate-[ww-fade-in_0.2s_ease-out_both]"),style:{animationDelay:`${i*50}ms`},children:o},o))})]})}var vR=z(Le(),1);var al=z(ne(),1);function H5({onRetry:e}){let{t}=Re();return(0,al.jsxs)("div",{className:"ww:flex ww:items-center ww:justify-between ww:rounded-md ww:border ww:border-border ww:bg-muted/50 ww:px-4 ww:py-3 ww:text-sm ww:text-muted-foreground",children:[(0,al.jsx)("span",{children:t.widgetErrorBoundary.failedToLoad}),(0,al.jsx)("button",{type:"button",onClick:e,className:"ww:text-xs ww:font-medium ww:text-primary ww:hover:underline",children:t.widgetErrorBoundary.retry})]})}var Cf=class extends vR.Component{constructor(){super(...arguments);Y(this,"state",{hasError:!1})}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(a){console.warn("[Waniwani] Widget failed to render:",a.message)}render(){return this.state.hasError?(0,al.jsx)(H5,{onRetry:()=>this.setState({hasError:!1})}):this.props.children}};var xe=z(ne(),1);function Hw(e){return e?e.replace(/[-_]/g," ").replace(/^\w/,t=>t.toUpperCase()):"Tool"}function bR(e){return e&&/search|find|lookup|query|web|browse|google/i.test(e)?Ss:Co}function SR({messages:e,status:t,welcomeMessage:a,welcome:n,onSuggestionSelect:r,resourceEndpoint:o,chatSessionId:i,isDark:l,onFollowUp:s,onCallTool:u,onWidgetDisplayModeChange:c,fullscreenToolCallId:d,debug:f,showToolCalls:p=!0,toolDefinitions:m,messageClassNames:x}){let{t:I}=Re(),y=e[e.length-1],w=e.length>0,g=d!=null,b=!g&&mR(e,t,{ignoreToolParts:p===!1,ignoreReasoningParts:p===!1});return(0,xe.jsxs)(xe.Fragment,{children:[!g&&(!w&&n?(0,xe.jsx)(xR,{...n,onSuggestionSelect:r}):a&&(0,xe.jsx)(Nw,{from:"assistant",children:(0,xe.jsx)(Bw,{children:(0,xe.jsx)(If,{children:a})})})),e.map(T=>{let S=T.parts.filter(A=>A.type==="text"),M=T.parts.filter(A=>A.type==="reasoning"),R=T.parts.filter(A=>A.type==="file"),_=T.parts.filter(A=>"toolCallId"in A),k=T.parts.filter(A=>A.type==="reasoning"||"toolCallId"in A),G=T===y&&T.role==="assistant",B=S.length>0,U=g?_.some(A=>A.toolCallId===d):!1,W=p!==!1&&!U&&k.length>=2;return g&&!U?(0,xe.jsx)("div",{style:{display:"none"}},T.id):T.role==="assistant"&&!pR(T)?(0,xe.jsx)("div",{style:{display:"none"}},T.id):p===!1&&T.role==="assistant"&&!B&&R.length===0&&_.every(A=>{let H="output"in A?A.output:void 0;return H===void 0||!o||!uu(A.toolName,H,m)})?(0,xe.jsx)("div",{style:{display:"none"}},T.id):(0,xe.jsxs)(Nw,{from:T.role,className:x?.message,children:[p!==!1&&!U&&!W&&M.map((A,H)=>(0,xe.jsxs)(ou,{isStreaming:A.state==="streaming",children:[(0,xe.jsx)(iu,{}),(0,xe.jsx)(lu,{children:A.text})]},`reasoning-${T.id}-${H}`)),W&&(()=>{let A=k[k.length-1],H=A.type==="reasoning"?{icon:Zn,label:I.reasoning.thinking}:{icon:bR(A.toolName),label:A.title??Hw(A.toolName)};return(0,xe.jsxs)($A,{isWorking:G&&(t==="streaming"||t==="submitted"),activeStep:H,children:[(0,xe.jsx)(XA,{workingLabel:I.chainOfThought.working,label:I.chainOfThought.done}),(0,xe.jsx)(KA,{children:k.map(($,We)=>{let $e=We===k.length-1;if($.type==="reasoning")return(0,xe.jsx)(QA,{isStreaming:$.state==="streaming",isLast:$e,children:$.text},`reasoning-${T.id}-${We}`);let v=$.title??Hw($.toolName),De=bR($.toolName);if(p==="titles-only")return(0,xe.jsx)(Ow,{icon:De,title:v,state:$.state,isLast:$e},$.toolCallId);let _e="output"in $?$.output:void 0;return(0,xe.jsxs)(Ow,{icon:De,title:v,state:$.state,isLast:$e,children:[(0,xe.jsx)(zw,{input:$.input,debug:f}),_e!==void 0&&(0,xe.jsx)(qw,{output:_e,errorText:"errorText"in $?$.errorText:void 0,debug:f})]},$.toolCallId)})})]})})(),p!==!1&&!U&&!W&&_.length===1&&(()=>{let A=_[0],H=A.title??Hw(A.toolName);if(p==="titles-only")return(0,xe.jsx)(lR,{title:H,state:A.state});let $="output"in A?A.output:void 0;return(0,xe.jsxs)(oR,{children:[(0,xe.jsx)(iR,{title:H,state:A.state}),(0,xe.jsxs)(sR,{children:[(0,xe.jsx)(zw,{input:A.input,debug:f}),$!==void 0&&(0,xe.jsx)(qw,{output:$,errorText:"errorText"in A?A.errorText:void 0,debug:f})]})]})})(),_.map(A=>{let H="output"in A?A.output:void 0,$=uu(A.toolName,H,m),We=dR(A.toolName,H,m),$e=A.toolCallId===d;return $&&o&&H!==void 0?(0,xe.jsx)("div",{style:$e?{position:"absolute",inset:0,zIndex:10,display:"flex",flexDirection:"column",overflow:"hidden",background:"var(--ww-color-background)"}:void 0,children:$&&o&&H!==void 0&&(0,xe.jsx)(Cf,{children:(0,xe.jsx)(yR,{isFullscreen:$e,resourceUri:$,toolInput:A.input??{},toolResult:{content:H.content,structuredContent:H.structuredContent,_meta:H._meta},resourceEndpoint:o,chatSessionId:i,isDark:l,autoHeight:We,toolDefinitions:m,onFollowUp:s,onCallTool:u,onDisplayModeChange:c?v=>c(v,{toolCallId:A.toolCallId,resourceUri:$,toolInput:A.input??{},toolResult:{content:H.content,structuredContent:H.structuredContent,_meta:H._meta},autoHeight:We}):void 0})})},A.toolCallId):null}),!U&&(0,xe.jsx)("div",{children:(0,xe.jsxs)(Bw,{className:j(T.role==="user"?x?.userBubble:x?.assistantBubble),children:[R.length>0&&(0,xe.jsx)(uC,{files:R}),B?S.map((A,H)=>{let $=G&&t==="streaming"&&H===S.length-1;return(0,xe.jsx)(If,{isStreaming:$,children:A.type==="text"?A.text:""},`${T.id}-${H}`)}):null]})})]},T.id)}),b&&(0,xe.jsx)(hR,{})]})}var du=z(ne(),1),j5="https://app.waniwani.ai/assets/waniwani-logo.svg",V5="https://waniwani.ai";function IR(){let{t:e}=Re();return(0,du.jsxs)("a",{href:V5,target:"_blank",rel:"noopener noreferrer",className:"ww:flex ww:items-center ww:gap-1.5 ww:whitespace-nowrap ww:text-[10px] ww:sm:text-[11px] ww:text-muted-foreground ww:opacity-70 hover:ww:opacity-100 ww:transition-opacity",children:[(0,du.jsx)("span",{children:e.poweredBy.label}),(0,du.jsx)("img",{src:j5,alt:"Waniwani",width:72,height:10,"data-waniwani-logo":"",className:"ww:h-2.5 ww:w-auto"})]})}var nl=z(Le(),1);var Ne=z(ne(),1),CR=20;function G5({label:e}){return(0,Ne.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",role:"img","aria-label":e,children:[(0,Ne.jsx)("title",{children:e}),(0,Ne.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,Ne.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}function W5({label:e}){return(0,Ne.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",role:"img","aria-label":e,children:[(0,Ne.jsx)("title",{children:e}),(0,Ne.jsx)("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),(0,Ne.jsx)("polyline",{points:"3 4 3 9 8 9"}),(0,Ne.jsx)("line",{x1:"12",y1:"7",x2:"12",y2:"12"}),(0,Ne.jsx)("line",{x1:"12",y1:"12",x2:"15",y2:"14"})]})}function $5({label:e}){return(0,Ne.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",role:"img","aria-label":e,children:[(0,Ne.jsx)("title",{children:e}),(0,Ne.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,Ne.jsx)("path",{d:"M19 6l-2 14a2 2 0 0 1-2 2H9a2 2 0 0 1-2-2L5 6"}),(0,Ne.jsx)("path",{d:"M10 11v6"}),(0,Ne.jsx)("path",{d:"M14 11v6"})]})}function kR({threads:e,activeThreadId:t,onNewThread:a,onSelectThread:n,onDeleteThread:r}){let{locale:o,t:i}=Re(),[l,s]=(0,nl.useState)(!1),u=(0,nl.useRef)(null);(0,nl.useEffect)(()=>{if(!l)return;let f=p=>{let m=u.current;m&&(p.composedPath().includes(m)||s(!1))};return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[l]);let c=e.slice(0,CR),d=Math.max(0,e.length-CR);return(0,Ne.jsxs)("div",{ref:u,className:"ww:relative ww:flex ww:items-center ww:gap-1",children:[(0,Ne.jsx)("button",{type:"button",onClick:a,title:i.threadMenu.newChat,"aria-label":i.threadMenu.newChat,className:"ww:p-1.5 ww:rounded-md ww:text-muted-foreground hover:ww:text-foreground hover:ww:bg-foreground/5 ww:transition-colors ww:cursor-pointer",children:(0,Ne.jsx)(G5,{label:i.threadMenu.newChat})}),(0,Ne.jsx)("button",{type:"button",onClick:()=>s(f=>!f),title:i.threadMenu.threadHistory,"aria-label":i.threadMenu.threadHistory,"aria-expanded":l,className:"ww:p-1.5 ww:rounded-md ww:text-muted-foreground hover:ww:text-foreground hover:ww:bg-foreground/5 ww:transition-colors ww:cursor-pointer",children:(0,Ne.jsx)(W5,{label:i.threadMenu.threadHistory})}),l&&(0,Ne.jsxs)("div",{role:"menu",className:"ww:absolute ww:right-0 ww:top-full ww:mt-1 ww:w-72 ww:max-h-80 ww:overflow-y-auto ww:rounded-lg ww:border ww:border-border ww:bg-background ww:shadow-lg ww:z-50",children:[c.length===0&&(0,Ne.jsx)("div",{className:"ww:px-3 ww:py-3 ww:text-xs ww:text-muted-foreground",children:i.threadMenu.noPreviousChats}),c.map(f=>{let p=f.threadId===t,m=Date.parse(f.updatedAt);return(0,Ne.jsxs)("div",{className:`ww:flex ww:items-center ww:gap-2 ww:px-3 ww:py-2 ww:text-xs hover:ww:bg-foreground/5 ${p?"ww:bg-foreground/5":""}`,children:[(0,Ne.jsxs)("button",{type:"button",onClick:()=>{n(f.threadId),s(!1)},className:"ww:flex-1 ww:min-w-0 ww:text-left ww:cursor-pointer",children:[(0,Ne.jsx)("div",{className:"ww:truncate ww:text-foreground ww:font-medium",children:f.title}),(0,Ne.jsx)("div",{className:"ww:text-[10px] ww:text-muted-foreground",children:Number.isNaN(m)?"":ig(m,o)})]}),(0,Ne.jsx)("button",{type:"button",onClick:x=>{x.stopPropagation(),r(f.threadId)},title:i.threadMenu.deleteThread,"aria-label":i.threadMenu.deleteThread,className:"ww:p-1 ww:rounded ww:text-muted-foreground hover:ww:text-foreground hover:ww:bg-foreground/10 ww:transition-colors ww:cursor-pointer",children:(0,Ne.jsx)($5,{label:i.threadMenu.deleteThread})})]},f.threadId)}),d>0&&(0,Ne.jsx)("div",{className:"ww:px-3 ww:py-2 ww:text-[10px] ww:text-muted-foreground ww:border-t ww:border-border",children:i.threadMenu.hiddenThreads(d)})]})]})}var Lf=z(Le(),1);function kf(e){let t=new Set;return{subscribe(a){return t.add(a),()=>{t.delete(a)}},emit(a){let{sessionId:n,...r}=a,o=a.name==="session.started"?a.properties.sessionId:void 0,i={...r,mode:e.mode,sessionId:Object.hasOwn(a,"sessionId")?n:o??e.getSessionId?.(),timestamp:Date.now()};for(let l of[...t])try{l(i)}catch(s){console.warn("[Waniwani] onEvent subscriber threw:",s)}}}}function LR(){return{subscribe(){return()=>{}},emit(){}}}var TR=(0,Lf.createContext)(LR());function Tf(){return(0,Lf.useContext)(TR)}var Ef=TR.Provider;var Mf=z(Le(),1);function ER(e){let t=(0,Mf.useRef)(e);return t.current=e,(0,Mf.useCallback)(async a=>{let{api:n,headers:r,onCallTool:o,sessionId:i}=t.current;if(o)return o(a);let l=`${n??"/api/waniwani"}/tool`,s=typeof i=="string"&&i.trim().length>0?i.trim():void 0,u=await fetch(l,{method:"POST",headers:{"Content-Type":"application/json",...s?{"X-Session-Id":s}:{},...r},body:JSON.stringify(a)});if(!u.ok)throw new Error(`Tool call failed: ${u.status} ${u.statusText}`);return u.json()},[])}var en=z(Le(),1);var n2="vercel.ai.error",X5=Symbol.for(n2),MR,AR,Ee=class r2 extends(AR=Error,MR=X5,AR){constructor({name:t,message:a,cause:n}){super(a),this[MR]=!0,this.name=t,this.cause=n}static isInstance(t){return r2.hasMarker(t,n2)}static hasMarker(t,a){let n=Symbol.for(a);return t!=null&&typeof t=="object"&&n in t&&typeof t[n]=="boolean"&&t[n]===!0}},o2="AI_APICallError",i2=`vercel.ai.error.${o2}`,K5=Symbol.for(i2),RR,DR,lne=class extends(DR=Ee,RR=K5,DR){constructor({message:e,url:t,requestBodyValues:a,statusCode:n,responseHeaders:r,responseBody:o,cause:i,isRetryable:l=n!=null&&(n===408||n===409||n===429||n>=500),data:s}){super({name:o2,message:e,cause:i}),this[RR]=!0,this.url=t,this.requestBodyValues=a,this.statusCode=n,this.responseHeaders=r,this.responseBody=o,this.isRetryable=l,this.data=s}static isInstance(e){return Ee.hasMarker(e,i2)}},l2="AI_EmptyResponseBodyError",s2=`vercel.ai.error.${l2}`,Z5=Symbol.for(s2),_R,OR,sne=class extends(OR=Ee,_R=Z5,OR){constructor({message:e="Empty response body"}={}){super({name:l2,message:e}),this[_R]=!0}static isInstance(e){return Ee.hasMarker(e,s2)}};function u2(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var c2="AI_InvalidArgumentError",d2=`vercel.ai.error.${c2}`,Q5=Symbol.for(d2),PR,NR,f2=class extends(NR=Ee,PR=Q5,NR){constructor({message:e,cause:t,argument:a}){super({name:c2,message:e,cause:t}),this[PR]=!0,this.argument=a}static isInstance(e){return Ee.hasMarker(e,d2)}},p2="AI_InvalidPromptError",m2=`vercel.ai.error.${p2}`,Y5=Symbol.for(m2),BR,UR,une=class extends(UR=Ee,BR=Y5,UR){constructor({prompt:e,message:t,cause:a}){super({name:p2,message:`Invalid prompt: ${t}`,cause:a}),this[BR]=!0,this.prompt=e}static isInstance(e){return Ee.hasMarker(e,m2)}},h2="AI_InvalidResponseDataError",g2=`vercel.ai.error.${h2}`,J5=Symbol.for(g2),FR,zR,cne=class extends(zR=Ee,FR=J5,zR){constructor({data:e,message:t=`Invalid response data: ${JSON.stringify(e)}.`}){super({name:h2,message:t}),this[FR]=!0,this.data=e}static isInstance(e){return Ee.hasMarker(e,g2)}},y2="AI_JSONParseError",w2=`vercel.ai.error.${y2}`,e6=Symbol.for(w2),qR,HR,Vw=class extends(HR=Ee,qR=e6,HR){constructor({text:e,cause:t}){super({name:y2,message:`JSON parsing failed: Text: ${e}.
|
|
124
|
-
Error message: ${
|
|
125
|
-
Error message: ${
|
|
126
|
-
`;break;case"id":
|
|
127
|
-
`)?s.slice(0,-1):s}),
|
|
128
|
-
`,n),
|
|
129
|
-
`&&n++}}return[t,a]}var Df=class extends TransformStream{constructor({onError:t,onRetry:a,onComment:n}={}){let r;super({start(o){r=_2({onEvent:i=>{o.enqueue(i)},onError(i){t==="terminate"?o.error(i):typeof t=="function"&&t(i)},onRetry:a,onComment:n})},transform(o){r.feed(o)}})}};var{btoa:One,atob:Pne}=globalThis;var F2="AI_DownloadError",z2=`vercel.ai.error.${F2}`,u6=Symbol.for(z2),O2,P2,Ya=class extends(P2=Ee,O2=u6,P2){constructor({url:e,statusCode:t,statusText:a,cause:n,message:r=n==null?`Failed to download ${e}: ${t} ${a}`:`Failed to download ${e}: ${n}`}){super({name:F2,message:r,cause:n}),this[O2]=!0,this.url=e,this.statusCode=t,this.statusText=a}static isInstance(e){return Ee.hasMarker(e,z2)}},Jw=2*1024*1024*1024;async function q2({response:e,url:t,maxBytes:a=Jw}){let n=e.headers.get("content-length");if(n!=null){let c=parseInt(n,10);if(!isNaN(c)&&c>a)throw new Ya({url:t,message:`Download of ${t} exceeded maximum size of ${a} bytes (Content-Length: ${c}).`})}let r=e.body;if(r==null)return new Uint8Array(0);let o=r.getReader(),i=[],l=0;try{for(;;){let{done:c,value:d}=await o.read();if(c)break;if(l+=d.length,l>a)throw new Ya({url:t,message:`Download of ${t} exceeded maximum size of ${a} bytes.`});i.push(d)}}finally{try{await o.cancel()}finally{o.releaseLock()}}let s=new Uint8Array(l),u=0;for(let c of i)s.set(c,u),u+=c.length;return s}function ex(e){let t;try{t=new URL(e)}catch{throw new Ya({url:e,message:`Invalid URL: ${e}`})}if(t.protocol!=="http:"&&t.protocol!=="https:")throw new Ya({url:e,message:`URL scheme must be http or https, got ${t.protocol}`});let a=t.hostname;if(!a)throw new Ya({url:e,message:"URL must have a hostname"});if(a==="localhost"||a.endsWith(".local")||a.endsWith(".localhost"))throw new Ya({url:e,message:`URL with hostname ${a} is not allowed`});if(a.startsWith("[")&&a.endsWith("]")){let n=a.slice(1,-1);if(c6(n))throw new Ya({url:e,message:`URL with IPv6 address ${a} is not allowed`});return}if(H2(a)){if(Zw(a))throw new Ya({url:e,message:`URL with IP address ${a} is not allowed`});return}}function H2(e){let t=e.split(".");return t.length!==4?!1:t.every(a=>{let n=Number(a);return Number.isInteger(n)&&n>=0&&n<=255&&String(n)===a})}function Zw(e){let t=e.split(".").map(Number),[a,n]=t;return a===0||a===10||a===127||a===169&&n===254||a===172&&n>=16&&n<=31||a===192&&n===168}function c6(e){let t=e.toLowerCase();if(t==="::1"||t==="::")return!0;if(t.startsWith("::ffff:")){let a=t.slice(7);if(H2(a))return Zw(a);let n=a.split(":");if(n.length===2){let r=parseInt(n[0],16),o=parseInt(n[1],16);if(!isNaN(r)&&!isNaN(o)){let i=r>>8&255,l=r&255,s=o>>8&255,u=o&255;return Zw(`${i}.${l}.${s}.${u}`)}}}return!!(t.startsWith("fc")||t.startsWith("fd")||t.startsWith("fe80"))}var ir=({prefix:e,size:t=16,alphabet:a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:n="-"}={})=>{let r=()=>{let o=a.length,i=new Array(t);for(let l=0;l<t;l++)i[l]=a[Math.random()*o|0];return i.join("")};if(e==null)return r;if(a.includes(n))throw new f2({argument:"separator",message:`The separator "${n}" must not be part of the alphabet "${a}".`});return()=>`${e}${n}${r()}`},j2=ir();function V2(e=globalThis){var t,a,n;return e.window?"runtime/browser":(t=e.navigator)!=null&&t.userAgent?`runtime/${e.navigator.userAgent.toLowerCase()}`:(n=(a=e.process)==null?void 0:a.versions)!=null&&n.node?`runtime/node.js/${e.process.version.substring(0)}`:e.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function Zr(e){if(e==null)return{};let t={};if(e instanceof Headers)e.forEach((a,n)=>{t[n.toLowerCase()]=a});else{Array.isArray(e)||(e=Object.entries(e));for(let[a,n]of e)n!=null&&(t[a.toLowerCase()]=n)}return t}function _f(e,...t){let a=new Headers(Zr(e)),n=a.get("user-agent")||"";return a.set("user-agent",[n,...t].filter(Boolean).join(" ")),Object.fromEntries(a.entries())}var d6=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,f6=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function N2(e){let t=JSON.parse(e);return t===null||typeof t!="object"||d6.test(e)===!1&&f6.test(e)===!1?t:p6(t)}function p6(e){let t=[e];for(;t.length;){let a=t;t=[];for(let n of a){if(Object.prototype.hasOwnProperty.call(n,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(n,"constructor")&&n.constructor!==null&&typeof n.constructor=="object"&&Object.prototype.hasOwnProperty.call(n.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(let r in n){let o=n[r];o&&typeof o=="object"&&t.push(o)}}}return e}function m6(e){let{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch{return N2(e)}try{return N2(e)}finally{Error.stackTraceLimit=t}}function tx(e){if(e.type==="object"||Array.isArray(e.type)&&e.type.includes("object")){e.additionalProperties=!1;let{properties:a}=e;if(a!=null)for(let n of Object.keys(a))a[n]=Vo(a[n])}e.items!=null&&(e.items=Array.isArray(e.items)?e.items.map(Vo):Vo(e.items)),e.anyOf!=null&&(e.anyOf=e.anyOf.map(Vo)),e.allOf!=null&&(e.allOf=e.allOf.map(Vo)),e.oneOf!=null&&(e.oneOf=e.oneOf.map(Vo));let{definitions:t}=e;if(t!=null)for(let a of Object.keys(t))t[a]=Vo(t[a]);return e}function Vo(e){return typeof e=="boolean"?e:tx(e)}var h6=Symbol("Let zodToJsonSchema decide on which parser to use"),B2={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},g6=e=>typeof e=="string"?{...B2,name:e}:{...B2,...e};function Pa(){return{}}function y6(e,t){var a,n,r;let o={type:"array"};return(a=e.type)!=null&&a._def&&((r=(n=e.type)==null?void 0:n._def)==null?void 0:r.typeName)!==se.ZodAny&&(o.items=je(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&(o.minItems=e.minLength.value),e.maxLength&&(o.maxItems=e.maxLength.value),e.exactLength&&(o.minItems=e.exactLength.value,o.maxItems=e.exactLength.value),o}function w6(e){let t={type:"integer",format:"int64"};if(!e.checks)return t;for(let a of e.checks)switch(a.kind){case"min":a.inclusive?t.minimum=a.value:t.exclusiveMinimum=a.value;break;case"max":a.inclusive?t.maximum=a.value:t.exclusiveMaximum=a.value;break;case"multipleOf":t.multipleOf=a.value;break}return t}function x6(){return{type:"boolean"}}function G2(e,t){return je(e.type._def,t)}var v6=(e,t)=>je(e.innerType._def,t);function W2(e,t,a){let n=a??t.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((r,o)=>W2(e,t,r))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return b6(e)}}var b6=e=>{let t={type:"integer",format:"unix-time"};for(let a of e.checks)switch(a.kind){case"min":t.minimum=a.value;break;case"max":t.maximum=a.value;break}return t};function S6(e,t){return{...je(e.innerType._def,t),default:e.defaultValue()}}function I6(e,t){return t.effectStrategy==="input"?je(e.schema._def,t):Pa()}function C6(e){return{type:"string",enum:Array.from(e.values)}}var k6=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function L6(e,t){let a=[je(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),je(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(r=>!!r),n=[];return a.forEach(r=>{if(k6(r))n.push(...r.allOf);else{let o=r;if("additionalProperties"in r&&r.additionalProperties===!1){let{additionalProperties:i,...l}=r;o=l}n.push(o)}}),n.length?{allOf:n}:void 0}function T6(e){let t=typeof e.value;return t!=="bigint"&&t!=="number"&&t!=="boolean"&&t!=="string"?{type:Array.isArray(e.value)?"array":"object"}:{type:t==="bigint"?"integer":t,const:e.value}}var Xw=void 0,cn={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(Xw===void 0&&(Xw=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Xw),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function $2(e,t){let a={type:"string"};if(e.checks)for(let n of e.checks)switch(n.kind){case"min":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,n.value):n.value;break;case"max":a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,n.value):n.value;break;case"email":switch(t.emailStrategy){case"format:email":dn(a,"email",n.message,t);break;case"format:idn-email":dn(a,"idn-email",n.message,t);break;case"pattern:zod":la(a,cn.email,n.message,t);break}break;case"url":dn(a,"uri",n.message,t);break;case"uuid":dn(a,"uuid",n.message,t);break;case"regex":la(a,n.regex,n.message,t);break;case"cuid":la(a,cn.cuid,n.message,t);break;case"cuid2":la(a,cn.cuid2,n.message,t);break;case"startsWith":la(a,RegExp(`^${Kw(n.value,t)}`),n.message,t);break;case"endsWith":la(a,RegExp(`${Kw(n.value,t)}$`),n.message,t);break;case"datetime":dn(a,"date-time",n.message,t);break;case"date":dn(a,"date",n.message,t);break;case"time":dn(a,"time",n.message,t);break;case"duration":dn(a,"duration",n.message,t);break;case"length":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,n.value):n.value,a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,n.value):n.value;break;case"includes":{la(a,RegExp(Kw(n.value,t)),n.message,t);break}case"ip":{n.version!=="v6"&&dn(a,"ipv4",n.message,t),n.version!=="v4"&&dn(a,"ipv6",n.message,t);break}case"base64url":la(a,cn.base64url,n.message,t);break;case"jwt":la(a,cn.jwt,n.message,t);break;case"cidr":{n.version!=="v6"&&la(a,cn.ipv4Cidr,n.message,t),n.version!=="v4"&&la(a,cn.ipv6Cidr,n.message,t);break}case"emoji":la(a,cn.emoji(),n.message,t);break;case"ulid":{la(a,cn.ulid,n.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{dn(a,"binary",n.message,t);break}case"contentEncoding:base64":{a.contentEncoding="base64";break}case"pattern:zod":{la(a,cn.base64,n.message,t);break}}break}case"nanoid":la(a,cn.nanoid,n.message,t);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return a}function Kw(e,t){return t.patternStrategy==="escape"?M6(e):e}var E6=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function M6(e){let t="";for(let a=0;a<e.length;a++)E6.has(e[a])||(t+="\\"),t+=e[a];return t}function dn(e,t,a,n){var r;e.format||(r=e.anyOf)!=null&&r.some(o=>o.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format}),delete e.format),e.anyOf.push({format:t,...a&&n.errorMessages&&{errorMessage:{format:a}}})):e.format=t}function la(e,t,a,n){var r;e.pattern||(r=e.allOf)!=null&&r.some(o=>o.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push({pattern:U2(t,n),...a&&n.errorMessages&&{errorMessage:{pattern:a}}})):e.pattern=U2(t,n)}function U2(e,t){var a;if(!t.applyRegexFlags||!e.flags)return e.source;let n={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},r=n.i?e.source.toLowerCase():e.source,o="",i=!1,l=!1,s=!1;for(let u=0;u<r.length;u++){if(i){o+=r[u],i=!1;continue}if(n.i){if(l){if(r[u].match(/[a-z]/)){s?(o+=r[u],o+=`${r[u-2]}-${r[u]}`.toUpperCase(),s=!1):r[u+1]==="-"&&((a=r[u+2])!=null&&a.match(/[a-z]/))?(o+=r[u],s=!0):o+=`${r[u]}${r[u].toUpperCase()}`;continue}}else if(r[u].match(/[a-z]/)){o+=`[${r[u]}${r[u].toUpperCase()}]`;continue}}if(n.m){if(r[u]==="^"){o+=`(^|(?<=[\r
|
|
123
|
+
${Te}`}]}}G.current({...fe,...Ue?{modelContext:Ue}:{}})}ge({jsonrpc:"2.0",id:we,result:{}});return}if(ye==="ui/update-model-context"&&we!=null){k=nR(k,Ee.params),ge({jsonrpc:"2.0",id:we,result:{}});return}if(ye==="tools/call"&&we!=null){let fe=B.current;if(!fe){ge({jsonrpc:"2.0",id:we,error:{code:-32601,message:"tools/call not supported"}});return}let Ue=Ee.params?.name;fe({name:Ue,arguments:Ee.params?.arguments??{}}).then(Te=>{ge({jsonrpc:"2.0",id:we,result:Te});let je=Te.content?.map(ot=>ot.text??"").join("").trim();je&&T5(Ue,Te,E.current)&&(ke&&clearTimeout(ke.timer),ke={text:je,timer:setTimeout(()=>{if(qe)return;let ot=k;k=null,ke=null,G.current?.({role:"user",content:[{type:"text",text:je}],...ot?{modelContext:ot}:{}})},500)})}).catch(Te=>{let je=Te instanceof Error?Te.message:"Tool call failed";ge({jsonrpc:"2.0",id:we,error:{code:-32e3,message:je}})});return}if(ye==="ui/request-display-mode"&&we!=null){let fe=Ee.params?.mode,Ue=fe==="fullscreen"||fe==="inline"||fe==="pip"?fe:"inline";A.current=Ue,ge({jsonrpc:"2.0",id:we,result:{mode:Ue}}),ge({jsonrpc:"2.0",method:"ui/notifications/host-context-changed",params:{displayMode:Ue}}),U.current?.(Ue);return}if(ye==="ui/resource-teardown"&&we!=null){ge({jsonrpc:"2.0",id:we,result:{}});return}ye==="ping"&&we!=null&&ge({jsonrpc:"2.0",id:we,result:{}})};return window.addEventListener("message",It),()=>{qe=!0,clearTimeout(ie),ke&&clearTimeout(ke.timer),window.removeEventListener("message",It)}},[i,j]),(0,oR.jsx)("iframe",{ref:m,src:$,sandbox:"allow-scripts allow-forms allow-same-origin allow-popups allow-popups-to-escape-sandbox",className:H(!f&&"ww:rounded-md ww:border ww:border-border",l),style:{height:f?"100%":S,minWidth:f||!R?void 0:`min(${R}px, 100%)`,width:"100%",border:"none",colorScheme:o?"dark":"auto"},title:"MCP App"})}var Kr=z(te(),1);function lR({icon:e,title:t,description:a,suggestions:n,onSuggestionSelect:r}){return(0,Kr.jsxs)("div",{className:"ww:flex ww:flex-col ww:items-center ww:justify-center ww:py-12 ww:px-6 ww:text-center ww:min-h-full",children:[e&&(0,Kr.jsx)("div",{className:"ww:mb-4 ww:flex ww:items-center ww:justify-center ww:size-12 ww:rounded-xl ww:bg-foreground ww:text-background",children:e}),(0,Kr.jsx)("h2",{className:"ww:text-lg ww:font-semibold ww:text-foreground",children:t}),a&&(0,Kr.jsx)("p",{className:"ww:mt-1 ww:text-sm ww:text-muted-foreground ww:max-w-sm",children:a}),n&&n.length>0&&(0,Kr.jsx)("div",{className:"ww:mt-6 ww:w-full ww:max-w-md ww:flex ww:flex-col ww:gap-2",children:n.map((o,l)=>(0,Kr.jsx)("button",{type:"button",onClick:()=>r?.(o),className:H("ww:w-full ww:text-left ww:rounded-xl ww:border ww:border-border ww:bg-background ww:px-4 ww:py-3 ww:text-sm","ww:text-foreground ww:hover:bg-accent ww:hover:border-primary/30","ww:transition-all ww:duration-200 ww:ease-out ww:cursor-pointer","ww:animate-[ww-fade-in_0.2s_ease-out_both]"),style:{animationDelay:`${l*50}ms`},children:o},o))})]})}var iR=z(De(),1);var ai=z(te(),1);function A5({onRetry:e}){let{t}=Oe();return(0,ai.jsxs)("div",{className:"ww:flex ww:items-center ww:justify-between ww:rounded-md ww:border ww:border-border ww:bg-muted/50 ww:px-4 ww:py-3 ww:text-sm ww:text-muted-foreground",children:[(0,ai.jsx)("span",{children:t.widgetErrorBoundary.failedToLoad}),(0,ai.jsx)("button",{type:"button",onClick:e,className:"ww:text-xs ww:font-medium ww:text-primary ww:hover:underline",children:t.widgetErrorBoundary.retry})]})}var vf=class extends iR.Component{constructor(){super(...arguments);Z(this,"state",{hasError:!1})}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(a){console.warn("[Waniwani] Widget failed to render:",a.message)}render(){return this.state.hasError?(0,ai.jsx)(A5,{onRetry:()=>this.setState({hasError:!1})}):this.props.children}};var me=z(te(),1);function Dw(e){return e?e.replace(/[-_]/g," ").replace(/^\w/,t=>t.toUpperCase()):"Tool"}function sR(e){return e&&/search|find|lookup|query|web|browse|google/i.test(e)?xs:Io}function uR({messages:e,status:t,welcomeMessage:a,welcome:n,onSuggestionSelect:r,resourceEndpoint:o,chatSessionId:l,isDark:i,onFollowUp:s,onCallTool:u,onWidgetDisplayModeChange:c,fullscreenToolCallId:d,debug:f,showToolCalls:p=!0,toolDefinitions:m,messageClassNames:x}){let{t:v}=Oe(),y=e[e.length-1],w=e.length>0,g=d!=null,C=!g&&tR(e,t,{ignoreToolParts:p===!1,ignoreReasoningParts:p===!1});return(0,me.jsxs)(me.Fragment,{children:[!g&&(!w&&n?(0,me.jsx)(lR,{...n,onSuggestionSelect:r}):a&&(0,me.jsx)(Lw,{from:"assistant",children:(0,me.jsx)(Tw,{children:(0,me.jsx)(xf,{children:a})})})),e.map(A=>{let S=A.parts.filter(E=>E.type==="text"),M=A.parts.filter(E=>E.type==="reasoning"),R=A.parts.filter(E=>E.type==="file"),D=A.parts.filter(E=>"toolCallId"in E),L=A.parts.filter(E=>E.type==="reasoning"||"toolCallId"in E),G=A===y&&A.role==="assistant",B=S.length>0,U=g?D.some(E=>E.toolCallId===d):!1,W=p!==!1&&!U&&L.length>=2;return g&&!U?(0,me.jsx)("div",{style:{display:"none"}},A.id):A.role==="assistant"&&!eR(A)?(0,me.jsx)("div",{style:{display:"none"}},A.id):p===!1&&A.role==="assistant"&&!B&&R.length===0&&D.every(E=>{let j="output"in E?E.output:void 0;return j===void 0||!o||!lu(E.toolName,j,m)})?(0,me.jsx)("div",{style:{display:"none"}},A.id):(0,me.jsxs)(Lw,{from:A.role,className:x?.message,children:[p!==!1&&!U&&!W&&M.map((E,j)=>(0,me.jsxs)(au,{isStreaming:E.state==="streaming",children:[(0,me.jsx)(nu,{}),(0,me.jsx)(ru,{children:E.text})]},`reasoning-${A.id}-${j}`)),W&&(()=>{let E=L[L.length-1],j=E.type==="reasoning"?{icon:Xn,label:v.reasoning.thinking}:{icon:sR(E.toolName),label:E.title??Dw(E.toolName)};return(0,me.jsxs)(OE,{isWorking:G&&(t==="streaming"||t==="submitted"),activeStep:j,children:[(0,me.jsx)(PE,{workingLabel:v.chainOfThought.working,label:v.chainOfThought.done}),(0,me.jsx)(NE,{children:L.map(($,he)=>{let Ie=he===L.length-1;if($.type==="reasoning")return(0,me.jsx)(UE,{isStreaming:$.state==="streaming",isLast:Ie,children:$.text},`reasoning-${A.id}-${he}`);let b=$.title??Dw($.toolName),qe=sR($.toolName);if(p==="titles-only")return(0,me.jsx)(Iw,{icon:qe,title:b,state:$.state,isLast:Ie},$.toolCallId);let rt="output"in $?$.output:void 0;return(0,me.jsxs)(Iw,{icon:qe,title:b,state:$.state,isLast:Ie,children:[(0,me.jsx)(Ew,{input:$.input,debug:f}),rt!==void 0&&(0,me.jsx)(Rw,{output:rt,errorText:"errorText"in $?$.errorText:void 0,debug:f})]},$.toolCallId)})})]})})(),p!==!1&&!U&&!W&&D.length===1&&(()=>{let E=D[0],j=E.title??Dw(E.toolName);if(p==="titles-only")return(0,me.jsx)(XE,{title:j,state:E.state});let $="output"in E?E.output:void 0;return(0,me.jsxs)($E,{children:[(0,me.jsx)(WE,{title:j,state:E.state}),(0,me.jsxs)(KE,{children:[(0,me.jsx)(Ew,{input:E.input,debug:f}),$!==void 0&&(0,me.jsx)(Rw,{output:$,errorText:"errorText"in E?E.errorText:void 0,debug:f})]})]})})(),D.map(E=>{let j="output"in E?E.output:void 0,$=lu(E.toolName,j,m),he=YE(E.toolName,j,m),Ie=E.toolCallId===d;return $&&o&&j!==void 0?(0,me.jsx)("div",{style:Ie?{position:"absolute",inset:0,zIndex:10,display:"flex",flexDirection:"column",overflow:"hidden",background:"var(--ww-color-background)"}:void 0,children:$&&o&&j!==void 0&&(0,me.jsx)(vf,{children:(0,me.jsx)(rR,{isFullscreen:Ie,resourceUri:$,toolInput:E.input??{},toolResult:{content:j.content,structuredContent:j.structuredContent,_meta:j._meta},resourceEndpoint:o,chatSessionId:l,isDark:i,autoHeight:he,toolDefinitions:m,onFollowUp:s,onCallTool:u,onDisplayModeChange:c?b=>c(b,{toolCallId:E.toolCallId,resourceUri:$,toolInput:E.input??{},toolResult:{content:j.content,structuredContent:j.structuredContent,_meta:j._meta},autoHeight:he}):void 0})})},E.toolCallId):null}),!U&&(0,me.jsx)("div",{children:(0,me.jsxs)(Tw,{className:H(A.role==="user"?x?.userBubble:x?.assistantBubble),children:[R.length>0&&(0,me.jsx)(ZC,{files:R}),B?S.map((E,j)=>{let $=G&&t==="streaming"&&j===S.length-1;return(0,me.jsx)(xf,{isStreaming:$,children:E.type==="text"?E.text:""},`${A.id}-${j}`)}):null]})})]},A.id)}),C&&(0,me.jsx)(aR,{})]})}var su=z(te(),1),M5="https://app.waniwani.ai/assets/waniwani-logo.svg",E5="https://waniwani.ai";function cR(){let{t:e}=Oe();return(0,su.jsxs)("a",{href:E5,target:"_blank",rel:"noopener noreferrer",className:"ww:flex ww:items-center ww:gap-1.5 ww:whitespace-nowrap ww:text-[10px] ww:sm:text-[11px] ww:text-muted-foreground ww:opacity-70 hover:ww:opacity-100 ww:transition-opacity",children:[(0,su.jsx)("span",{children:e.poweredBy.label}),(0,su.jsx)("img",{src:M5,alt:"Waniwani",width:72,height:10,"data-waniwani-logo":"",className:"ww:h-2.5 ww:w-auto"})]})}var ni=z(De(),1);var Be=z(te(),1),dR=20;function R5({label:e}){return(0,Be.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",role:"img","aria-label":e,children:[(0,Be.jsx)("title",{children:e}),(0,Be.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,Be.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}function D5({label:e}){return(0,Be.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",role:"img","aria-label":e,children:[(0,Be.jsx)("title",{children:e}),(0,Be.jsx)("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),(0,Be.jsx)("polyline",{points:"3 4 3 9 8 9"}),(0,Be.jsx)("line",{x1:"12",y1:"7",x2:"12",y2:"12"}),(0,Be.jsx)("line",{x1:"12",y1:"12",x2:"15",y2:"14"})]})}function _5({label:e}){return(0,Be.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",role:"img","aria-label":e,children:[(0,Be.jsx)("title",{children:e}),(0,Be.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,Be.jsx)("path",{d:"M19 6l-2 14a2 2 0 0 1-2 2H9a2 2 0 0 1-2-2L5 6"}),(0,Be.jsx)("path",{d:"M10 11v6"}),(0,Be.jsx)("path",{d:"M14 11v6"})]})}function fR({threads:e,activeThreadId:t,onNewThread:a,onSelectThread:n,onDeleteThread:r}){let{locale:o,t:l}=Oe(),[i,s]=(0,ni.useState)(!1),u=(0,ni.useRef)(null);(0,ni.useEffect)(()=>{if(!i)return;let f=p=>{let m=u.current;m&&(p.composedPath().includes(m)||s(!1))};return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[i]);let c=e.slice(0,dR),d=Math.max(0,e.length-dR);return(0,Be.jsxs)("div",{ref:u,className:"ww:relative ww:flex ww:items-center ww:gap-1",children:[(0,Be.jsx)("button",{type:"button",onClick:a,title:l.threadMenu.newChat,"aria-label":l.threadMenu.newChat,className:"ww:p-1.5 ww:rounded-md ww:text-muted-foreground hover:ww:text-foreground hover:ww:bg-foreground/5 ww:transition-colors ww:cursor-pointer",children:(0,Be.jsx)(R5,{label:l.threadMenu.newChat})}),(0,Be.jsx)("button",{type:"button",onClick:()=>s(f=>!f),title:l.threadMenu.threadHistory,"aria-label":l.threadMenu.threadHistory,"aria-expanded":i,className:"ww:p-1.5 ww:rounded-md ww:text-muted-foreground hover:ww:text-foreground hover:ww:bg-foreground/5 ww:transition-colors ww:cursor-pointer",children:(0,Be.jsx)(D5,{label:l.threadMenu.threadHistory})}),i&&(0,Be.jsxs)("div",{role:"menu",className:"ww:absolute ww:right-0 ww:top-full ww:mt-1 ww:w-72 ww:max-h-80 ww:overflow-y-auto ww:rounded-lg ww:border ww:border-border ww:bg-background ww:shadow-lg ww:z-50",children:[c.length===0&&(0,Be.jsx)("div",{className:"ww:px-3 ww:py-3 ww:text-xs ww:text-muted-foreground",children:l.threadMenu.noPreviousChats}),c.map(f=>{let p=f.threadId===t,m=Date.parse(f.updatedAt);return(0,Be.jsxs)("div",{className:`ww:flex ww:items-center ww:gap-2 ww:px-3 ww:py-2 ww:text-xs hover:ww:bg-foreground/5 ${p?"ww:bg-foreground/5":""}`,children:[(0,Be.jsxs)("button",{type:"button",onClick:()=>{n(f.threadId),s(!1)},className:"ww:flex-1 ww:min-w-0 ww:text-left ww:cursor-pointer",children:[(0,Be.jsx)("div",{className:"ww:truncate ww:text-foreground ww:font-medium",children:f.title}),(0,Be.jsx)("div",{className:"ww:text-[10px] ww:text-muted-foreground",children:Number.isNaN(m)?"":Zh(m,o)})]}),(0,Be.jsx)("button",{type:"button",onClick:x=>{x.stopPropagation(),r(f.threadId)},title:l.threadMenu.deleteThread,"aria-label":l.threadMenu.deleteThread,className:"ww:p-1 ww:rounded ww:text-muted-foreground hover:ww:text-foreground hover:ww:bg-foreground/10 ww:transition-colors ww:cursor-pointer",children:(0,Be.jsx)(_5,{label:l.threadMenu.deleteThread})})]},f.threadId)}),d>0&&(0,Be.jsx)("div",{className:"ww:px-3 ww:py-2 ww:text-[10px] ww:text-muted-foreground ww:border-t ww:border-border",children:l.threadMenu.hiddenThreads(d)})]})]})}var bf=z(De(),1);function pR(e){let t=(0,bf.useRef)(e);return t.current=e,(0,bf.useCallback)(async a=>{let{api:n,headers:r,onCallTool:o,sessionId:l}=t.current;if(o)return o(a);let i=`${n??"/api/waniwani"}/tool`,s=typeof l=="string"&&l.trim().length>0?l.trim():void 0,u=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json",...s?{"X-Session-Id":s}:{},...r},body:JSON.stringify(a)});if(!u.ok)throw new Error(`Tool call failed: ${u.status} ${u.statusText}`);return u.json()},[])}var Ya=z(De(),1);var HR="vercel.ai.error",O5=Symbol.for(HR),mR,hR,Me=class jR extends(hR=Error,mR=O5,hR){constructor({name:t,message:a,cause:n}){super(a),this[mR]=!0,this.name=t,this.cause=n}static isInstance(t){return jR.hasMarker(t,HR)}static hasMarker(t,a){let n=Symbol.for(a);return t!=null&&typeof t=="object"&&n in t&&typeof t[n]=="boolean"&&t[n]===!0}},VR="AI_APICallError",GR=`vercel.ai.error.${VR}`,P5=Symbol.for(GR),gR,yR,jae=class extends(yR=Me,gR=P5,yR){constructor({message:e,url:t,requestBodyValues:a,statusCode:n,responseHeaders:r,responseBody:o,cause:l,isRetryable:i=n!=null&&(n===408||n===409||n===429||n>=500),data:s}){super({name:VR,message:e,cause:l}),this[gR]=!0,this.url=t,this.requestBodyValues=a,this.statusCode=n,this.responseHeaders=r,this.responseBody=o,this.isRetryable=i,this.data=s}static isInstance(e){return Me.hasMarker(e,GR)}},$R="AI_EmptyResponseBodyError",WR=`vercel.ai.error.${$R}`,N5=Symbol.for(WR),wR,xR,Vae=class extends(xR=Me,wR=N5,xR){constructor({message:e="Empty response body"}={}){super({name:$R,message:e}),this[wR]=!0}static isInstance(e){return Me.hasMarker(e,WR)}};function XR(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var KR="AI_InvalidArgumentError",ZR=`vercel.ai.error.${KR}`,B5=Symbol.for(ZR),vR,bR,QR=class extends(bR=Me,vR=B5,bR){constructor({message:e,cause:t,argument:a}){super({name:KR,message:e,cause:t}),this[vR]=!0,this.argument=a}static isInstance(e){return Me.hasMarker(e,ZR)}},YR="AI_InvalidPromptError",JR=`vercel.ai.error.${YR}`,U5=Symbol.for(JR),SR,CR,Gae=class extends(CR=Me,SR=U5,CR){constructor({prompt:e,message:t,cause:a}){super({name:YR,message:`Invalid prompt: ${t}`,cause:a}),this[SR]=!0,this.prompt=e}static isInstance(e){return Me.hasMarker(e,JR)}},e2="AI_InvalidResponseDataError",t2=`vercel.ai.error.${e2}`,F5=Symbol.for(t2),IR,kR,$ae=class extends(kR=Me,IR=F5,kR){constructor({data:e,message:t=`Invalid response data: ${JSON.stringify(e)}.`}){super({name:e2,message:t}),this[IR]=!0,this.data=e}static isInstance(e){return Me.hasMarker(e,t2)}},a2="AI_JSONParseError",n2=`vercel.ai.error.${a2}`,z5=Symbol.for(n2),LR,TR,Ow=class extends(TR=Me,LR=z5,TR){constructor({text:e,cause:t}){super({name:a2,message:`JSON parsing failed: Text: ${e}.
|
|
124
|
+
Error message: ${XR(t)}`,cause:t}),this[LR]=!0,this.text=e}static isInstance(e){return Me.hasMarker(e,n2)}},r2="AI_LoadAPIKeyError",o2=`vercel.ai.error.${r2}`,q5=Symbol.for(o2),AR,MR,Wae=class extends(MR=Me,AR=q5,MR){constructor({message:e}){super({name:r2,message:e}),this[AR]=!0}static isInstance(e){return Me.hasMarker(e,o2)}},l2="AI_LoadSettingError",i2=`vercel.ai.error.${l2}`,H5=Symbol.for(i2),ER,RR,Xae=class extends(RR=Me,ER=H5,RR){constructor({message:e}){super({name:l2,message:e}),this[ER]=!0}static isInstance(e){return Me.hasMarker(e,i2)}},s2="AI_NoContentGeneratedError",u2=`vercel.ai.error.${s2}`,j5=Symbol.for(u2),DR,_R,Kae=class extends(_R=Me,DR=j5,_R){constructor({message:e="No content generated."}={}){super({name:s2,message:e}),this[DR]=!0}static isInstance(e){return Me.hasMarker(e,u2)}},c2="AI_NoSuchModelError",d2=`vercel.ai.error.${c2}`,V5=Symbol.for(d2),OR,PR,Zae=class extends(PR=Me,OR=V5,PR){constructor({errorName:e=c2,modelId:t,modelType:a,message:n=`No such ${a}: ${t}`}){super({name:e,message:n}),this[OR]=!0,this.modelId=t,this.modelType=a}static isInstance(e){return Me.hasMarker(e,d2)}},f2="AI_TooManyEmbeddingValuesForCallError",p2=`vercel.ai.error.${f2}`,G5=Symbol.for(p2),NR,BR,Qae=class extends(BR=Me,NR=G5,BR){constructor(e){super({name:f2,message:`Too many values for a single embedding call. The ${e.provider} model "${e.modelId}" can only embed up to ${e.maxEmbeddingsPerCall} values per call, but ${e.values.length} values were provided.`}),this[NR]=!0,this.provider=e.provider,this.modelId=e.modelId,this.maxEmbeddingsPerCall=e.maxEmbeddingsPerCall,this.values=e.values}static isInstance(e){return Me.hasMarker(e,p2)}},m2="AI_TypeValidationError",h2=`vercel.ai.error.${m2}`,$5=Symbol.for(h2),UR,FR,Sn=class _w extends(FR=Me,UR=$5,FR){constructor({value:t,cause:a,context:n}){let r="Type validation failed";if(n?.field&&(r+=` for ${n.field}`),n?.entityName||n?.entityId){r+=" (";let o=[];n.entityName&&o.push(n.entityName),n.entityId&&o.push(`id: "${n.entityId}"`),r+=o.join(", "),r+=")"}super({name:m2,message:`${r}: Value: ${JSON.stringify(t)}.
|
|
125
|
+
Error message: ${XR(a)}`,cause:a}),this[UR]=!0,this.value=t,this.context=n}static isInstance(t){return Me.hasMarker(t,h2)}static wrap({value:t,cause:a,context:n}){var r,o,l;return _w.isInstance(a)&&a.value===t&&((r=a.context)==null?void 0:r.field)===n?.field&&((o=a.context)==null?void 0:o.entityName)===n?.entityName&&((l=a.context)==null?void 0:l.entityId)===n?.entityId?a:new _w({value:t,cause:a,context:n})}},g2="AI_UnsupportedFunctionalityError",y2=`vercel.ai.error.${g2}`,W5=Symbol.for(y2),zR,qR,Yae=class extends(qR=Me,zR=W5,qR){constructor({functionality:e,message:t=`'${e}' functionality not supported.`}){super({name:g2,message:t}),this[zR]=!0,this.functionality=e}static isInstance(e){return Me.hasMarker(e,y2)}};var Sf=()=>Nw,Nw=new Proxy(Sf,{get(e,t){return t==="parse"||t==="parseAsync"?a=>a:t==="safeParse"||t==="safeParseAsync"?a=>({success:!0,data:a}):t==="_def"?{}:t==="jsonSchema"?{}:Sf},apply(){return Nw}}),Pw=class extends Error{constructor(){super(...arguments);Z(this,"issues",[])}},h=new Proxy(Sf,{get(e,t){return t==="ZodError"?Pw:t==="NEVER"?Symbol("NEVER"):Sf},apply(){return Nw}});var le={};var Cf=class extends Error{constructor(t,a){super(t),this.name="ParseError",this.type=a.type,this.field=a.field,this.value=a.value,this.line=a.line}};function Bw(e){}function w2(e){if(typeof e=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:t=Bw,onError:a=Bw,onRetry:n=Bw,onComment:r}=e,o="",l=!0,i,s="",u="";function c(x){let v=l?x.replace(/^\xEF\xBB\xBF/,""):x,[y,w]=X5(`${o}${v}`);for(let g of y)d(g);o=w,l=!1}function d(x){if(x===""){p();return}if(x.startsWith(":")){r&&r(x.slice(x.startsWith(": ")?2:1));return}let v=x.indexOf(":");if(v!==-1){let y=x.slice(0,v),w=x[v+1]===" "?2:1,g=x.slice(v+w);f(y,g,x);return}f(x,"",x)}function f(x,v,y){switch(x){case"event":u=v;break;case"data":s=`${s}${v}
|
|
126
|
+
`;break;case"id":i=v.includes("\0")?void 0:v;break;case"retry":/^\d+$/.test(v)?n(parseInt(v,10)):a(new Cf(`Invalid \`retry\` value: "${v}"`,{type:"invalid-retry",value:v,line:y}));break;default:a(new Cf(`Unknown field "${x.length>20?`${x.slice(0,20)}\u2026`:x}"`,{type:"unknown-field",field:x,value:v,line:y}));break}}function p(){s.length>0&&t({id:i,event:u||void 0,data:s.endsWith(`
|
|
127
|
+
`)?s.slice(0,-1):s}),i=void 0,s="",u=""}function m(x={}){o&&x.consume&&d(o),l=!0,i=void 0,s="",u="",o=""}return{feed:c,reset:m}}function X5(e){let t=[],a="",n=0;for(;n<e.length;){let r=e.indexOf("\r",n),o=e.indexOf(`
|
|
128
|
+
`,n),l=-1;if(r!==-1&&o!==-1?l=Math.min(r,o):r!==-1?r===e.length-1?l=-1:l=r:o!==-1&&(l=o),l===-1){a=e.slice(n);break}else{let i=e.slice(n,l);t.push(i),n=l+1,e[n-1]==="\r"&&e[n]===`
|
|
129
|
+
`&&n++}}return[t,a]}var If=class extends TransformStream{constructor({onError:t,onRetry:a,onComment:n}={}){let r;super({start(o){r=w2({onEvent:l=>{o.enqueue(l)},onError(l){t==="terminate"?o.error(l):typeof t=="function"&&t(l)},onRetry:a,onComment:n})},transform(o){r.feed(o)}})}};var{btoa:gne,atob:yne}=globalThis;var I2="AI_DownloadError",k2=`vercel.ai.error.${I2}`,K5=Symbol.for(k2),x2,v2,Za=class extends(v2=Me,x2=K5,v2){constructor({url:e,statusCode:t,statusText:a,cause:n,message:r=n==null?`Failed to download ${e}: ${t} ${a}`:`Failed to download ${e}: ${n}`}){super({name:I2,message:r,cause:n}),this[x2]=!0,this.url=e,this.statusCode=t,this.statusText=a}static isInstance(e){return Me.hasMarker(e,k2)}},jw=2*1024*1024*1024;async function L2({response:e,url:t,maxBytes:a=jw}){let n=e.headers.get("content-length");if(n!=null){let c=parseInt(n,10);if(!isNaN(c)&&c>a)throw new Za({url:t,message:`Download of ${t} exceeded maximum size of ${a} bytes (Content-Length: ${c}).`})}let r=e.body;if(r==null)return new Uint8Array(0);let o=r.getReader(),l=[],i=0;try{for(;;){let{done:c,value:d}=await o.read();if(c)break;if(i+=d.length,i>a)throw new Za({url:t,message:`Download of ${t} exceeded maximum size of ${a} bytes.`});l.push(d)}}finally{try{await o.cancel()}finally{o.releaseLock()}}let s=new Uint8Array(i),u=0;for(let c of l)s.set(c,u),u+=c.length;return s}function Vw(e){let t;try{t=new URL(e)}catch{throw new Za({url:e,message:`Invalid URL: ${e}`})}if(t.protocol!=="http:"&&t.protocol!=="https:")throw new Za({url:e,message:`URL scheme must be http or https, got ${t.protocol}`});let a=t.hostname;if(!a)throw new Za({url:e,message:"URL must have a hostname"});if(a==="localhost"||a.endsWith(".local")||a.endsWith(".localhost"))throw new Za({url:e,message:`URL with hostname ${a} is not allowed`});if(a.startsWith("[")&&a.endsWith("]")){let n=a.slice(1,-1);if(Z5(n))throw new Za({url:e,message:`URL with IPv6 address ${a} is not allowed`});return}if(T2(a)){if(zw(a))throw new Za({url:e,message:`URL with IP address ${a} is not allowed`});return}}function T2(e){let t=e.split(".");return t.length!==4?!1:t.every(a=>{let n=Number(a);return Number.isInteger(n)&&n>=0&&n<=255&&String(n)===a})}function zw(e){let t=e.split(".").map(Number),[a,n]=t;return a===0||a===10||a===127||a===169&&n===254||a===172&&n>=16&&n<=31||a===192&&n===168}function Z5(e){let t=e.toLowerCase();if(t==="::1"||t==="::")return!0;if(t.startsWith("::ffff:")){let a=t.slice(7);if(T2(a))return zw(a);let n=a.split(":");if(n.length===2){let r=parseInt(n[0],16),o=parseInt(n[1],16);if(!isNaN(r)&&!isNaN(o)){let l=r>>8&255,i=r&255,s=o>>8&255,u=o&255;return zw(`${l}.${i}.${s}.${u}`)}}}return!!(t.startsWith("fc")||t.startsWith("fd")||t.startsWith("fe80"))}var rr=({prefix:e,size:t=16,alphabet:a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:n="-"}={})=>{let r=()=>{let o=a.length,l=new Array(t);for(let i=0;i<t;i++)l[i]=a[Math.random()*o|0];return l.join("")};if(e==null)return r;if(a.includes(n))throw new QR({argument:"separator",message:`The separator "${n}" must not be part of the alphabet "${a}".`});return()=>`${e}${n}${r()}`},A2=rr();function M2(e=globalThis){var t,a,n;return e.window?"runtime/browser":(t=e.navigator)!=null&&t.userAgent?`runtime/${e.navigator.userAgent.toLowerCase()}`:(n=(a=e.process)==null?void 0:a.versions)!=null&&n.node?`runtime/node.js/${e.process.version.substring(0)}`:e.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function Zr(e){if(e==null)return{};let t={};if(e instanceof Headers)e.forEach((a,n)=>{t[n.toLowerCase()]=a});else{Array.isArray(e)||(e=Object.entries(e));for(let[a,n]of e)n!=null&&(t[a.toLowerCase()]=n)}return t}function kf(e,...t){let a=new Headers(Zr(e)),n=a.get("user-agent")||"";return a.set("user-agent",[n,...t].filter(Boolean).join(" ")),Object.fromEntries(a.entries())}var Q5=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,Y5=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function b2(e){let t=JSON.parse(e);return t===null||typeof t!="object"||Q5.test(e)===!1&&Y5.test(e)===!1?t:J5(t)}function J5(e){let t=[e];for(;t.length;){let a=t;t=[];for(let n of a){if(Object.prototype.hasOwnProperty.call(n,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(n,"constructor")&&n.constructor!==null&&typeof n.constructor=="object"&&Object.prototype.hasOwnProperty.call(n.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(let r in n){let o=n[r];o&&typeof o=="object"&&t.push(o)}}}return e}function e6(e){let{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch{return b2(e)}try{return b2(e)}finally{Error.stackTraceLimit=t}}function Gw(e){if(e.type==="object"||Array.isArray(e.type)&&e.type.includes("object")){e.additionalProperties=!1;let{properties:a}=e;if(a!=null)for(let n of Object.keys(a))a[n]=Vo(a[n])}e.items!=null&&(e.items=Array.isArray(e.items)?e.items.map(Vo):Vo(e.items)),e.anyOf!=null&&(e.anyOf=e.anyOf.map(Vo)),e.allOf!=null&&(e.allOf=e.allOf.map(Vo)),e.oneOf!=null&&(e.oneOf=e.oneOf.map(Vo));let{definitions:t}=e;if(t!=null)for(let a of Object.keys(t))t[a]=Vo(t[a]);return e}function Vo(e){return typeof e=="boolean"?e:Gw(e)}var t6=Symbol("Let zodToJsonSchema decide on which parser to use"),S2={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},a6=e=>typeof e=="string"?{...S2,name:e}:{...S2,...e};function Oa(){return{}}function n6(e,t){var a,n,r;let o={type:"array"};return(a=e.type)!=null&&a._def&&((r=(n=e.type)==null?void 0:n._def)==null?void 0:r.typeName)!==le.ZodAny&&(o.items=We(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&(o.minItems=e.minLength.value),e.maxLength&&(o.maxItems=e.maxLength.value),e.exactLength&&(o.minItems=e.exactLength.value,o.maxItems=e.exactLength.value),o}function r6(e){let t={type:"integer",format:"int64"};if(!e.checks)return t;for(let a of e.checks)switch(a.kind){case"min":a.inclusive?t.minimum=a.value:t.exclusiveMinimum=a.value;break;case"max":a.inclusive?t.maximum=a.value:t.exclusiveMaximum=a.value;break;case"multipleOf":t.multipleOf=a.value;break}return t}function o6(){return{type:"boolean"}}function E2(e,t){return We(e.type._def,t)}var l6=(e,t)=>We(e.innerType._def,t);function R2(e,t,a){let n=a??t.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((r,o)=>R2(e,t,r))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return i6(e)}}var i6=e=>{let t={type:"integer",format:"unix-time"};for(let a of e.checks)switch(a.kind){case"min":t.minimum=a.value;break;case"max":t.maximum=a.value;break}return t};function s6(e,t){return{...We(e.innerType._def,t),default:e.defaultValue()}}function u6(e,t){return t.effectStrategy==="input"?We(e.schema._def,t):Oa()}function c6(e){return{type:"string",enum:Array.from(e.values)}}var d6=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function f6(e,t){let a=[We(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),We(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(r=>!!r),n=[];return a.forEach(r=>{if(d6(r))n.push(...r.allOf);else{let o=r;if("additionalProperties"in r&&r.additionalProperties===!1){let{additionalProperties:l,...i}=r;o=i}n.push(o)}}),n.length?{allOf:n}:void 0}function p6(e){let t=typeof e.value;return t!=="bigint"&&t!=="number"&&t!=="boolean"&&t!=="string"?{type:Array.isArray(e.value)?"array":"object"}:{type:t==="bigint"?"integer":t,const:e.value}}var Uw=void 0,un={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(Uw===void 0&&(Uw=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Uw),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function D2(e,t){let a={type:"string"};if(e.checks)for(let n of e.checks)switch(n.kind){case"min":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,n.value):n.value;break;case"max":a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,n.value):n.value;break;case"email":switch(t.emailStrategy){case"format:email":cn(a,"email",n.message,t);break;case"format:idn-email":cn(a,"idn-email",n.message,t);break;case"pattern:zod":ia(a,un.email,n.message,t);break}break;case"url":cn(a,"uri",n.message,t);break;case"uuid":cn(a,"uuid",n.message,t);break;case"regex":ia(a,n.regex,n.message,t);break;case"cuid":ia(a,un.cuid,n.message,t);break;case"cuid2":ia(a,un.cuid2,n.message,t);break;case"startsWith":ia(a,RegExp(`^${Fw(n.value,t)}`),n.message,t);break;case"endsWith":ia(a,RegExp(`${Fw(n.value,t)}$`),n.message,t);break;case"datetime":cn(a,"date-time",n.message,t);break;case"date":cn(a,"date",n.message,t);break;case"time":cn(a,"time",n.message,t);break;case"duration":cn(a,"duration",n.message,t);break;case"length":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,n.value):n.value,a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,n.value):n.value;break;case"includes":{ia(a,RegExp(Fw(n.value,t)),n.message,t);break}case"ip":{n.version!=="v6"&&cn(a,"ipv4",n.message,t),n.version!=="v4"&&cn(a,"ipv6",n.message,t);break}case"base64url":ia(a,un.base64url,n.message,t);break;case"jwt":ia(a,un.jwt,n.message,t);break;case"cidr":{n.version!=="v6"&&ia(a,un.ipv4Cidr,n.message,t),n.version!=="v4"&&ia(a,un.ipv6Cidr,n.message,t);break}case"emoji":ia(a,un.emoji(),n.message,t);break;case"ulid":{ia(a,un.ulid,n.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{cn(a,"binary",n.message,t);break}case"contentEncoding:base64":{a.contentEncoding="base64";break}case"pattern:zod":{ia(a,un.base64,n.message,t);break}}break}case"nanoid":ia(a,un.nanoid,n.message,t);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return a}function Fw(e,t){return t.patternStrategy==="escape"?h6(e):e}var m6=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function h6(e){let t="";for(let a=0;a<e.length;a++)m6.has(e[a])||(t+="\\"),t+=e[a];return t}function cn(e,t,a,n){var r;e.format||(r=e.anyOf)!=null&&r.some(o=>o.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format}),delete e.format),e.anyOf.push({format:t,...a&&n.errorMessages&&{errorMessage:{format:a}}})):e.format=t}function ia(e,t,a,n){var r;e.pattern||(r=e.allOf)!=null&&r.some(o=>o.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push({pattern:C2(t,n),...a&&n.errorMessages&&{errorMessage:{pattern:a}}})):e.pattern=C2(t,n)}function C2(e,t){var a;if(!t.applyRegexFlags||!e.flags)return e.source;let n={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},r=n.i?e.source.toLowerCase():e.source,o="",l=!1,i=!1,s=!1;for(let u=0;u<r.length;u++){if(l){o+=r[u],l=!1;continue}if(n.i){if(i){if(r[u].match(/[a-z]/)){s?(o+=r[u],o+=`${r[u-2]}-${r[u]}`.toUpperCase(),s=!1):r[u+1]==="-"&&((a=r[u+2])!=null&&a.match(/[a-z]/))?(o+=r[u],s=!0):o+=`${r[u]}${r[u].toUpperCase()}`;continue}}else if(r[u].match(/[a-z]/)){o+=`[${r[u]}${r[u].toUpperCase()}]`;continue}}if(n.m){if(r[u]==="^"){o+=`(^|(?<=[\r
|
|
130
130
|
]))`;continue}else if(r[u]==="$"){o+=`($|(?=[\r
|
|
131
|
-
]))`;continue}}if(n.s&&r[u]==="."){o+=
|
|
131
|
+
]))`;continue}}if(n.s&&r[u]==="."){o+=i?`${r[u]}\r
|
|
132
132
|
`:`[${r[u]}\r
|
|
133
|
-
]`;continue}o+=r[u],r[u]==="\\"?i=!0:l&&r[u]==="]"?l=!1:!l&&r[u]==="["&&(l=!0)}try{new RegExp(o)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return o}function X2(e,t){var a,n,r,o,i,l;let s={type:"object",additionalProperties:(a=je(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))!=null?a:t.allowedAdditionalProperties};if(((n=e.keyType)==null?void 0:n._def.typeName)===se.ZodString&&((r=e.keyType._def.checks)!=null&&r.length)){let{type:u,...c}=$2(e.keyType._def,t);return{...s,propertyNames:c}}else{if(((o=e.keyType)==null?void 0:o._def.typeName)===se.ZodEnum)return{...s,propertyNames:{enum:e.keyType._def.values}};if(((i=e.keyType)==null?void 0:i._def.typeName)===se.ZodBranded&&e.keyType._def.type._def.typeName===se.ZodString&&((l=e.keyType._def.type._def.checks)!=null&&l.length)){let{type:u,...c}=G2(e.keyType._def,t);return{...s,propertyNames:c}}}return s}function A6(e,t){if(t.mapStrategy==="record")return X2(e,t);let a=je(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||Pa(),n=je(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||Pa();return{type:"array",maxItems:125,items:{type:"array",items:[a,n],minItems:2,maxItems:2}}}function R6(e){let t=e.values,n=Object.keys(e.values).filter(o=>typeof t[t[o]]!="number").map(o=>t[o]),r=Array.from(new Set(n.map(o=>typeof o)));return{type:r.length===1?r[0]==="string"?"string":"number":["string","number"],enum:n}}function D6(){return{not:Pa()}}function _6(){return{type:"null"}}var Qw={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function O6(e,t){let a=e.options instanceof Map?Array.from(e.options.values()):e.options;if(a.every(n=>n._def.typeName in Qw&&(!n._def.checks||!n._def.checks.length))){let n=a.reduce((r,o)=>{let i=Qw[o._def.typeName];return i&&!r.includes(i)?[...r,i]:r},[]);return{type:n.length>1?n:n[0]}}else if(a.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){let n=a.reduce((r,o)=>{let i=typeof o._def.value;switch(i){case"string":case"number":case"boolean":return[...r,i];case"bigint":return[...r,"integer"];case"object":if(o._def.value===null)return[...r,"null"];default:return r}},[]);if(n.length===a.length){let r=n.filter((o,i,l)=>l.indexOf(o)===i);return{type:r.length>1?r:r[0],enum:a.reduce((o,i)=>o.includes(i._def.value)?o:[...o,i._def.value],[])}}}else if(a.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:a.reduce((n,r)=>[...n,...r._def.values.filter(o=>!n.includes(o))],[])};return P6(e,t)}var P6=(e,t)=>{let a=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((n,r)=>je(n._def,{...t,currentPath:[...t.currentPath,"anyOf",`${r}`]})).filter(n=>!!n&&(!t.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return a.length?{anyOf:a}:void 0};function N6(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[Qw[e.innerType._def.typeName],"null"]};let a=je(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return a&&{anyOf:[a,{type:"null"}]}}function B6(e){let t={type:"number"};if(!e.checks)return t;for(let a of e.checks)switch(a.kind){case"int":t.type="integer";break;case"min":a.inclusive?t.minimum=a.value:t.exclusiveMinimum=a.value;break;case"max":a.inclusive?t.maximum=a.value:t.exclusiveMaximum=a.value;break;case"multipleOf":t.multipleOf=a.value;break}return t}function U6(e,t){let a={type:"object",properties:{}},n=[],r=e.shape();for(let i in r){let l=r[i];if(l===void 0||l._def===void 0)continue;let s=z6(l),u=je(l._def,{...t,currentPath:[...t.currentPath,"properties",i],propertyPath:[...t.currentPath,"properties",i]});u!==void 0&&(a.properties[i]=u,s||n.push(i))}n.length&&(a.required=n);let o=F6(e,t);return o!==void 0&&(a.additionalProperties=o),a}function F6(e,t){if(e.catchall._def.typeName!=="ZodNever")return je(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function z6(e){try{return e.isOptional()}catch{return!0}}var q6=(e,t)=>{var a;if(t.currentPath.toString()===((a=t.propertyPath)==null?void 0:a.toString()))return je(e.innerType._def,t);let n=je(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return n?{anyOf:[{not:Pa()},n]}:Pa()},H6=(e,t)=>{if(t.pipeStrategy==="input")return je(e.in._def,t);if(t.pipeStrategy==="output")return je(e.out._def,t);let a=je(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),n=je(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",a?"1":"0"]});return{allOf:[a,n].filter(r=>r!==void 0)}};function j6(e,t){return je(e.type._def,t)}function V6(e,t){let n={type:"array",uniqueItems:!0,items:je(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&(n.minItems=e.minSize.value),e.maxSize&&(n.maxItems=e.maxSize.value),n}function G6(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((a,n)=>je(a._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((a,n)=>n===void 0?a:[...a,n],[]),additionalItems:je(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((a,n)=>je(a._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((a,n)=>n===void 0?a:[...a,n],[])}}function W6(){return{not:Pa()}}function $6(){return Pa()}var X6=(e,t)=>je(e.innerType._def,t),K6=(e,t,a)=>{switch(t){case se.ZodString:return $2(e,a);case se.ZodNumber:return B6(e);case se.ZodObject:return U6(e,a);case se.ZodBigInt:return w6(e);case se.ZodBoolean:return x6();case se.ZodDate:return W2(e,a);case se.ZodUndefined:return W6();case se.ZodNull:return _6();case se.ZodArray:return y6(e,a);case se.ZodUnion:case se.ZodDiscriminatedUnion:return O6(e,a);case se.ZodIntersection:return L6(e,a);case se.ZodTuple:return G6(e,a);case se.ZodRecord:return X2(e,a);case se.ZodLiteral:return T6(e);case se.ZodEnum:return C6(e);case se.ZodNativeEnum:return R6(e);case se.ZodNullable:return N6(e,a);case se.ZodOptional:return q6(e,a);case se.ZodMap:return A6(e,a);case se.ZodSet:return V6(e,a);case se.ZodLazy:return()=>e.getter()._def;case se.ZodPromise:return j6(e,a);case se.ZodNaN:case se.ZodNever:return D6();case se.ZodEffects:return I6(e,a);case se.ZodAny:return Pa();case se.ZodUnknown:return $6();case se.ZodDefault:return S6(e,a);case se.ZodBranded:return G2(e,a);case se.ZodReadonly:return X6(e,a);case se.ZodCatch:return v6(e,a);case se.ZodPipeline:return H6(e,a);case se.ZodFunction:case se.ZodVoid:case se.ZodSymbol:return;default:return(n=>{})(t)}},Z6=(e,t)=>{let a=0;for(;a<e.length&&a<t.length&&e[a]===t[a];a++);return[(e.length-a).toString(),...t.slice(a)].join("/")};function je(e,t,a=!1){var n;let r=t.seen.get(e);if(t.override){let s=(n=t.override)==null?void 0:n.call(t,e,t,r,a);if(s!==h6)return s}if(r&&!a){let s=Q6(r,t);if(s!==void 0)return s}let o={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,o);let i=K6(e,e.typeName,t),l=typeof i=="function"?je(i(),t):i;if(l&&Y6(e,t,l),t.postProcess){let s=t.postProcess(l,e,t);return o.jsonSchema=l,s}return o.jsonSchema=l,l}var Q6=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:Z6(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((a,n)=>t.currentPath[n]===a)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),Pa()):t.$refStrategy==="seen"?Pa():void 0}},Y6=(e,t,a)=>(e.description&&(a.description=e.description),a),J6=e=>{let t=g6(e),a=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,currentPath:a,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([n,r])=>[r._def,{def:r._def,path:[...t.basePath,t.definitionPath,n],jsonSchema:void 0}]))}},eH=(e,t)=>{var a;let n=J6(t),r=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((u,[c,d])=>{var f;return{...u,[c]:(f=je(d._def,{...n,currentPath:[...n.basePath,n.definitionPath,c]},!0))!=null?f:Pa()}},{}):void 0,o=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,i=(a=je(e._def,o===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,o]},!1))!=null?a:Pa(),l=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;l!==void 0&&(i.title=l);let s=o===void 0?r?{...i,[n.definitionPath]:r}:i:{$ref:[...n.$refStrategy==="relative"?[]:n.basePath,n.definitionPath,o].join("/"),[n.definitionPath]:{...r,[o]:i}};return s.$schema="http://json-schema.org/draft-07/schema#",s},Yw=Symbol.for("vercel.ai.schema");function Of(e){let t;return()=>(t==null&&(t=e()),t)}function Pf(e,{validate:t}={}){return{[Yw]:!0,_type:void 0,get jsonSchema(){return typeof e=="function"&&(e=e()),e},validate:t}}function tH(e){return typeof e=="object"&&e!==null&&Yw in e&&e[Yw]===!0&&"jsonSchema"in e&&"validate"in e}function Nf(e){return e==null?Pf({properties:{},additionalProperties:!1}):tH(e)?e:"~standard"in e?e["~standard"].vendor==="zod"?pu(e):aH(e):e()}function aH(e){return Pf(()=>tx(e["~standard"].jsonSchema.input({target:"draft-07"})),{validate:async t=>{let a=await e["~standard"].validate(t);return"value"in a?{success:!0,value:a.value}:{success:!1,error:new kn({value:t,cause:a.issues})}}})}function nH(e,t){var a;let n=(a=t?.useReferences)!=null?a:!1;return Pf(()=>eH(e,{$refStrategy:n?"root":"none"}),{validate:async r=>{let o=await e.safeParseAsync(r);return o.success?{success:!0,value:o.data}:{success:!1,error:o.error}}})}function rH(e,t){var a;let n=(a=t?.useReferences)!=null?a:!1;return Pf(()=>tx((void 0)(e,{target:"draft-7",io:"input",reused:n?"ref":"inline"})),{validate:async r=>{let o=await(void 0)(e,r);return o.success?{success:!0,value:o.data}:{success:!1,error:o.error}}})}function oH(e){return"_zod"in e}function pu(e,t){return oH(e)?rH(e,t):nH(e,t)}async function Bf({value:e,schema:t,context:a}){let n=await rl({value:e,schema:t,context:a});if(!n.success)throw kn.wrap({value:e,cause:n.error,context:a});return n.value}async function rl({value:e,schema:t,context:a}){let n=Nf(t);try{if(n.validate==null)return{success:!0,value:e,rawValue:e};let r=await n.validate(e);return r.success?{success:!0,value:r.value,rawValue:e}:{success:!1,error:kn.wrap({value:e,cause:r.error,context:a}),rawValue:e}}catch(r){return{success:!1,error:kn.wrap({value:e,cause:r,context:a}),rawValue:e}}}async function lr({text:e,schema:t}){try{let a=m6(e);return t==null?{success:!0,value:a,rawValue:a}:await rl({value:a,schema:t})}catch(a){return{success:!1,error:Vw.isInstance(a)?a:new Vw({text:e,cause:a}),rawValue:void 0}}}function K2({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new Df).pipeThrough(new TransformStream({async transform({data:a},n){a!=="[DONE]"&&n.enqueue(await lr({text:a,schema:t}))}}))}async function Ln(e){return typeof e=="function"&&(e=e()),Promise.resolve(e)}var lH=Object.defineProperty,sH=(e,t)=>{for(var a in t)lH(e,a,{get:t[a],enumerable:!0})},uH="AI_InvalidArgumentError",cH=`vercel.ai.error.${uH}`,dH=Symbol.for(cH),fH;fH=dH;var pH="AI_InvalidStreamPartError",mH=`vercel.ai.error.${pH}`,hH=Symbol.for(mH),gH;gH=hH;var yH="AI_InvalidToolApprovalError",wH=`vercel.ai.error.${yH}`,xH=Symbol.for(wH),vH;vH=xH;var bH="AI_InvalidToolInputError",SH=`vercel.ai.error.${bH}`,IH=Symbol.for(SH),CH;CH=IH;var kH="AI_ToolCallNotFoundForApprovalError",LH=`vercel.ai.error.${kH}`,TH=Symbol.for(LH),EH;EH=TH;var MH="AI_MissingToolResultsError",AH=`vercel.ai.error.${MH}`,RH=Symbol.for(AH),DH;DH=RH;var _H="AI_NoImageGeneratedError",OH=`vercel.ai.error.${_H}`,PH=Symbol.for(OH),NH;NH=PH;var Q2="AI_NoObjectGeneratedError",Y2=`vercel.ai.error.${Q2}`,BH=Symbol.for(Y2),J2,Qr=class extends Ee{constructor({message:e="No object generated.",cause:t,text:a,response:n,usage:r,finishReason:o}){super({name:Q2,message:e,cause:t}),this[J2]=!0,this.text=a,this.response=n,this.usage=r,this.finishReason=o}static isInstance(e){return Ee.hasMarker(e,Y2)}};J2=BH;var UH="AI_NoOutputGeneratedError",FH=`vercel.ai.error.${UH}`,zH=Symbol.for(FH),qH;qH=zH;var HH="AI_NoSpeechGeneratedError",jH=`vercel.ai.error.${HH}`,VH=Symbol.for(jH),GH;GH=VH;var WH="AI_NoTranscriptGeneratedError",$H=`vercel.ai.error.${WH}`,XH=Symbol.for($H),KH;KH=XH;var ZH="AI_NoVideoGeneratedError",QH=`vercel.ai.error.${ZH}`,YH=Symbol.for(QH),JH;JH=YH;var e9="AI_NoSuchToolError",t9=`vercel.ai.error.${e9}`,a9=Symbol.for(t9),n9;n9=a9;var r9="AI_ToolCallRepairError",o9=`vercel.ai.error.${r9}`,i9=Symbol.for(o9),l9;l9=i9;var eD="AI_UIMessageStreamError",tD=`vercel.ai.error.${eD}`,s9=Symbol.for(tD),aD,ol=class extends Ee{constructor({chunkType:e,chunkId:t,message:a}){super({name:eD,message:a}),this[aD]=!0,this.chunkType=e,this.chunkId=t}static isInstance(e){return Ee.hasMarker(e,tD)}};aD=s9;var u9="AI_InvalidDataContentError",c9=`vercel.ai.error.${u9}`,d9=Symbol.for(c9),f9;f9=d9;var p9="AI_InvalidMessageRoleError",m9=`vercel.ai.error.${p9}`,h9=Symbol.for(m9),g9;g9=h9;var y9="AI_MessageConversionError",w9=`vercel.ai.error.${y9}`,x9=Symbol.for(w9),v9;v9=x9;var b9="AI_RetryError",S9=`vercel.ai.error.${b9}`,I9=Symbol.for(S9),C9;C9=I9;var k9="6.0.141",L9=async({url:e,maxBytes:t,abortSignal:a})=>{var n;let r=e.toString();ex(r);try{let o=await fetch(r,{headers:_f({},`ai-sdk/${k9}`,V2()),signal:a});if(o.redirected&&ex(o.url),!o.ok)throw new Ya({url:r,statusCode:o.status,statusText:o.statusText});return{data:await q2({response:o,url:r,maxBytes:t??Jw}),mediaType:(n=o.headers.get("content-type"))!=null?n:void 0}}catch(o){throw Ya.isInstance(o)?o:new Ya({url:r,cause:o})}};var nD=h.union([h.string(),h.instanceof(Uint8Array),h.instanceof(ArrayBuffer),h.custom(e=>{var t,a;return(a=(t=globalThis.Buffer)==null?void 0:t.isBuffer(e))!=null?a:!1},{message:"Must be a Buffer"})]);var mu=h.lazy(()=>h.union([h.null(),h.string(),h.number(),h.boolean(),h.record(h.string(),mu.optional()),h.array(mu)])),Z=h.record(h.string(),h.record(h.string(),mu.optional())),rD=h.object({type:h.literal("text"),text:h.string(),providerOptions:Z.optional()}),T9=h.object({type:h.literal("image"),image:h.union([nD,h.instanceof(URL)]),mediaType:h.string().optional(),providerOptions:Z.optional()}),oD=h.object({type:h.literal("file"),data:h.union([nD,h.instanceof(URL)]),filename:h.string().optional(),mediaType:h.string(),providerOptions:Z.optional()}),E9=h.object({type:h.literal("reasoning"),text:h.string(),providerOptions:Z.optional()}),M9=h.object({type:h.literal("tool-call"),toolCallId:h.string(),toolName:h.string(),input:h.unknown(),providerOptions:Z.optional(),providerExecuted:h.boolean().optional()}),A9=h.discriminatedUnion("type",[h.object({type:h.literal("text"),value:h.string(),providerOptions:Z.optional()}),h.object({type:h.literal("json"),value:mu,providerOptions:Z.optional()}),h.object({type:h.literal("execution-denied"),reason:h.string().optional(),providerOptions:Z.optional()}),h.object({type:h.literal("error-text"),value:h.string(),providerOptions:Z.optional()}),h.object({type:h.literal("error-json"),value:mu,providerOptions:Z.optional()}),h.object({type:h.literal("content"),value:h.array(h.union([h.object({type:h.literal("text"),text:h.string(),providerOptions:Z.optional()}),h.object({type:h.literal("media"),data:h.string(),mediaType:h.string()}),h.object({type:h.literal("file-data"),data:h.string(),mediaType:h.string(),filename:h.string().optional(),providerOptions:Z.optional()}),h.object({type:h.literal("file-url"),url:h.string(),providerOptions:Z.optional()}),h.object({type:h.literal("file-id"),fileId:h.union([h.string(),h.record(h.string(),h.string())]),providerOptions:Z.optional()}),h.object({type:h.literal("image-data"),data:h.string(),mediaType:h.string(),providerOptions:Z.optional()}),h.object({type:h.literal("image-url"),url:h.string(),providerOptions:Z.optional()}),h.object({type:h.literal("image-file-id"),fileId:h.union([h.string(),h.record(h.string(),h.string())]),providerOptions:Z.optional()}),h.object({type:h.literal("custom"),providerOptions:Z.optional()})]))})]),iD=h.object({type:h.literal("tool-result"),toolCallId:h.string(),toolName:h.string(),output:A9,providerOptions:Z.optional()}),R9=h.object({type:h.literal("tool-approval-request"),approvalId:h.string(),toolCallId:h.string()}),D9=h.object({type:h.literal("tool-approval-response"),approvalId:h.string(),approved:h.boolean(),reason:h.string().optional()}),_9=h.object({role:h.literal("system"),content:h.string(),providerOptions:Z.optional()}),O9=h.object({role:h.literal("user"),content:h.union([h.string(),h.array(h.union([rD,T9,oD]))]),providerOptions:Z.optional()}),P9=h.object({role:h.literal("assistant"),content:h.union([h.string(),h.array(h.union([rD,oD,E9,M9,iD,R9]))]),providerOptions:Z.optional()}),N9=h.object({role:h.literal("tool"),content:h.array(h.union([iD,D9])),providerOptions:Z.optional()}),ire=h.union([_9,O9,P9,N9]);function lD(e,t){if(e===void 0&&t===void 0)return;if(e===void 0)return t;if(t===void 0)return e;let a={...e};for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let r=t[n];if(r===void 0)continue;let o=n in e?e[n]:void 0,i=r!==null&&typeof r=="object"&&!Array.isArray(r)&&!(r instanceof Date)&&!(r instanceof RegExp),l=o!=null&&typeof o=="object"&&!Array.isArray(o)&&!(o instanceof Date)&&!(o instanceof RegExp);i&&l?a[n]=lD(o,r):a[n]=r}return a}var B9={};sH(B9,{array:()=>q9,choice:()=>H9,json:()=>j9,object:()=>z9,text:()=>F9});function U9(e){let t=["ROOT"],a=-1,n=null;function r(s,u,c){switch(s){case'"':{a=u,t.pop(),t.push(c),t.push("INSIDE_STRING");break}case"f":case"t":case"n":{a=u,n=u,t.pop(),t.push(c),t.push("INSIDE_LITERAL");break}case"-":{t.pop(),t.push(c),t.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{a=u,t.pop(),t.push(c),t.push("INSIDE_NUMBER");break}case"{":{a=u,t.pop(),t.push(c),t.push("INSIDE_OBJECT_START");break}case"[":{a=u,t.pop(),t.push(c),t.push("INSIDE_ARRAY_START");break}}}function o(s,u){switch(s){case",":{t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{a=u,t.pop();break}}}function i(s,u){switch(s){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{a=u,t.pop();break}}}for(let s=0;s<e.length;s++){let u=e[s];switch(t[t.length-1]){case"ROOT":r(u,s,"FINISH");break;case"INSIDE_OBJECT_START":{switch(u){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}case"}":{a=s,t.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{u==='"'&&(t.pop(),t.push("INSIDE_OBJECT_KEY"));break}case"INSIDE_OBJECT_KEY":{u==='"'&&(t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY"));break}case"INSIDE_OBJECT_AFTER_KEY":{u===":"&&(t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE"));break}case"INSIDE_OBJECT_BEFORE_VALUE":{r(u,s,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{o(u,s);break}case"INSIDE_STRING":{switch(u){case'"':{t.pop(),a=s;break}case"\\":{t.push("INSIDE_STRING_ESCAPE");break}default:a=s}break}case"INSIDE_ARRAY_START":{u==="]"?(a=s,t.pop()):(a=s,r(u,s,"INSIDE_ARRAY_AFTER_VALUE"));break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(u){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{a=s,t.pop();break}default:{a=s;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{r(u,s,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{t.pop(),a=s;break}case"INSIDE_NUMBER":{switch(u){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{a=s;break}case"e":case"E":case"-":case".":break;case",":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(u,s),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&o(u,s);break}case"}":{t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&o(u,s);break}case"]":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(u,s);break}default:{t.pop();break}}break}case"INSIDE_LITERAL":{let d=e.substring(n,s+1);!"false".startsWith(d)&&!"true".startsWith(d)&&!"null".startsWith(d)?(t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?o(u,s):t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(u,s)):a=s;break}}}let l=e.slice(0,a+1);for(let s=t.length-1;s>=0;s--)switch(t[s]){case"INSIDE_STRING":{l+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{l+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{l+="]";break}case"INSIDE_LITERAL":{let c=e.substring(n,e.length);"true".startsWith(c)?l+="true".slice(c.length):"false".startsWith(c)?l+="false".slice(c.length):"null".startsWith(c)&&(l+="null".slice(c.length))}}return l}async function hu(e){if(e===void 0)return{value:void 0,state:"undefined-input"};let t=await lr({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=await lr({text:U9(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var F9=()=>({name:"text",responseFormat:Promise.resolve({type:"text"}),async parseCompleteOutput({text:e}){return e},async parsePartialOutput({text:e}){return{partial:e}},createElementStreamTransform(){}}),z9=({schema:e,name:t,description:a})=>{let n=Nf(e);return{name:"object",responseFormat:Ln(n.jsonSchema).then(r=>({type:"json",schema:r,...t!=null&&{name:t},...a!=null&&{description:a}})),async parseCompleteOutput({text:r},o){let i=await lr({text:r});if(!i.success)throw new Qr({message:"No object generated: could not parse the response.",cause:i.error,text:r,response:o.response,usage:o.usage,finishReason:o.finishReason});let l=await rl({value:i.value,schema:n});if(!l.success)throw new Qr({message:"No object generated: response did not match schema.",cause:l.error,text:r,response:o.response,usage:o.usage,finishReason:o.finishReason});return l.value},async parsePartialOutput({text:r}){let o=await hu(r);switch(o.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:o.value}}},createElementStreamTransform(){}}},q9=({element:e,name:t,description:a})=>{let n=Nf(e);return{name:"array",responseFormat:Ln(n.jsonSchema).then(r=>{let{$schema:o,...i}=r;return{type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{elements:{type:"array",items:i}},required:["elements"],additionalProperties:!1},...t!=null&&{name:t},...a!=null&&{description:a}}}),async parseCompleteOutput({text:r},o){let i=await lr({text:r});if(!i.success)throw new Qr({message:"No object generated: could not parse the response.",cause:i.error,text:r,response:o.response,usage:o.usage,finishReason:o.finishReason});let l=i.value;if(l==null||typeof l!="object"||!("elements"in l)||!Array.isArray(l.elements))throw new Qr({message:"No object generated: response did not match schema.",cause:new kn({value:l,cause:"response must be an object with an elements array"}),text:r,response:o.response,usage:o.usage,finishReason:o.finishReason});for(let s of l.elements){let u=await rl({value:s,schema:n});if(!u.success)throw new Qr({message:"No object generated: response did not match schema.",cause:u.error,text:r,response:o.response,usage:o.usage,finishReason:o.finishReason})}return l.elements},async parsePartialOutput({text:r}){let o=await hu(r);switch(o.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{let i=o.value;if(i==null||typeof i!="object"||!("elements"in i)||!Array.isArray(i.elements))return;let l=o.state==="repaired-parse"&&i.elements.length>0?i.elements.slice(0,-1):i.elements,s=[];for(let u of l){let c=await rl({value:u,schema:n});c.success&&s.push(c.value)}return{partial:s}}}},createElementStreamTransform(){let r=0;return new TransformStream({transform({partialOutput:o},i){if(o!=null)for(;r<o.length;r++)i.enqueue(o[r])}})}}},H9=({options:e,name:t,description:a})=>({name:"choice",responseFormat:Promise.resolve({type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{result:{type:"string",enum:e}},required:["result"],additionalProperties:!1},...t!=null&&{name:t},...a!=null&&{description:a}}),async parseCompleteOutput({text:n},r){let o=await lr({text:n});if(!o.success)throw new Qr({message:"No object generated: could not parse the response.",cause:o.error,text:n,response:r.response,usage:r.usage,finishReason:r.finishReason});let i=o.value;if(i==null||typeof i!="object"||!("result"in i)||typeof i.result!="string"||!e.includes(i.result))throw new Qr({message:"No object generated: response did not match schema.",cause:new kn({value:i,cause:"response must be an object that contains a choice value."}),text:n,response:r.response,usage:r.usage,finishReason:r.finishReason});return i.result},async parsePartialOutput({text:n}){let r=await hu(n);switch(r.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{let o=r.value;if(o==null||typeof o!="object"||!("result"in o)||typeof o.result!="string")return;let i=e.filter(l=>l.startsWith(o.result));return r.state==="successful-parse"?i.includes(o.result)?{partial:o.result}:void 0:i.length===1?{partial:i[0]}:void 0}}},createElementStreamTransform(){}}),j9=({name:e,description:t}={})=>({name:"json",responseFormat:Promise.resolve({type:"json",...e!=null&&{name:e},...t!=null&&{description:t}}),async parseCompleteOutput({text:a},n){let r=await lr({text:a});if(!r.success)throw new Qr({message:"No object generated: could not parse the response.",cause:r.error,text:a,response:n.response,usage:n.usage,finishReason:n.finishReason});return r.value},async parsePartialOutput({text:a}){let n=await hu(a);switch(n.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return n.value===void 0?void 0:{partial:n.value}}},createElementStreamTransform(){}});var cre=ir({prefix:"aitxt",size:24});var fre=class extends TransformStream{constructor(){super({transform(e,t){t.enqueue(`data: ${JSON.stringify(e)}
|
|
133
|
+
]`;continue}o+=r[u],r[u]==="\\"?l=!0:i&&r[u]==="]"?i=!1:!i&&r[u]==="["&&(i=!0)}try{new RegExp(o)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return o}function _2(e,t){var a,n,r,o,l,i;let s={type:"object",additionalProperties:(a=We(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))!=null?a:t.allowedAdditionalProperties};if(((n=e.keyType)==null?void 0:n._def.typeName)===le.ZodString&&((r=e.keyType._def.checks)!=null&&r.length)){let{type:u,...c}=D2(e.keyType._def,t);return{...s,propertyNames:c}}else{if(((o=e.keyType)==null?void 0:o._def.typeName)===le.ZodEnum)return{...s,propertyNames:{enum:e.keyType._def.values}};if(((l=e.keyType)==null?void 0:l._def.typeName)===le.ZodBranded&&e.keyType._def.type._def.typeName===le.ZodString&&((i=e.keyType._def.type._def.checks)!=null&&i.length)){let{type:u,...c}=E2(e.keyType._def,t);return{...s,propertyNames:c}}}return s}function g6(e,t){if(t.mapStrategy==="record")return _2(e,t);let a=We(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||Oa(),n=We(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||Oa();return{type:"array",maxItems:125,items:{type:"array",items:[a,n],minItems:2,maxItems:2}}}function y6(e){let t=e.values,n=Object.keys(e.values).filter(o=>typeof t[t[o]]!="number").map(o=>t[o]),r=Array.from(new Set(n.map(o=>typeof o)));return{type:r.length===1?r[0]==="string"?"string":"number":["string","number"],enum:n}}function w6(){return{not:Oa()}}function x6(){return{type:"null"}}var qw={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function v6(e,t){let a=e.options instanceof Map?Array.from(e.options.values()):e.options;if(a.every(n=>n._def.typeName in qw&&(!n._def.checks||!n._def.checks.length))){let n=a.reduce((r,o)=>{let l=qw[o._def.typeName];return l&&!r.includes(l)?[...r,l]:r},[]);return{type:n.length>1?n:n[0]}}else if(a.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){let n=a.reduce((r,o)=>{let l=typeof o._def.value;switch(l){case"string":case"number":case"boolean":return[...r,l];case"bigint":return[...r,"integer"];case"object":if(o._def.value===null)return[...r,"null"];default:return r}},[]);if(n.length===a.length){let r=n.filter((o,l,i)=>i.indexOf(o)===l);return{type:r.length>1?r:r[0],enum:a.reduce((o,l)=>o.includes(l._def.value)?o:[...o,l._def.value],[])}}}else if(a.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:a.reduce((n,r)=>[...n,...r._def.values.filter(o=>!n.includes(o))],[])};return b6(e,t)}var b6=(e,t)=>{let a=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((n,r)=>We(n._def,{...t,currentPath:[...t.currentPath,"anyOf",`${r}`]})).filter(n=>!!n&&(!t.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return a.length?{anyOf:a}:void 0};function S6(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[qw[e.innerType._def.typeName],"null"]};let a=We(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return a&&{anyOf:[a,{type:"null"}]}}function C6(e){let t={type:"number"};if(!e.checks)return t;for(let a of e.checks)switch(a.kind){case"int":t.type="integer";break;case"min":a.inclusive?t.minimum=a.value:t.exclusiveMinimum=a.value;break;case"max":a.inclusive?t.maximum=a.value:t.exclusiveMaximum=a.value;break;case"multipleOf":t.multipleOf=a.value;break}return t}function I6(e,t){let a={type:"object",properties:{}},n=[],r=e.shape();for(let l in r){let i=r[l];if(i===void 0||i._def===void 0)continue;let s=L6(i),u=We(i._def,{...t,currentPath:[...t.currentPath,"properties",l],propertyPath:[...t.currentPath,"properties",l]});u!==void 0&&(a.properties[l]=u,s||n.push(l))}n.length&&(a.required=n);let o=k6(e,t);return o!==void 0&&(a.additionalProperties=o),a}function k6(e,t){if(e.catchall._def.typeName!=="ZodNever")return We(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function L6(e){try{return e.isOptional()}catch{return!0}}var T6=(e,t)=>{var a;if(t.currentPath.toString()===((a=t.propertyPath)==null?void 0:a.toString()))return We(e.innerType._def,t);let n=We(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return n?{anyOf:[{not:Oa()},n]}:Oa()},A6=(e,t)=>{if(t.pipeStrategy==="input")return We(e.in._def,t);if(t.pipeStrategy==="output")return We(e.out._def,t);let a=We(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),n=We(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",a?"1":"0"]});return{allOf:[a,n].filter(r=>r!==void 0)}};function M6(e,t){return We(e.type._def,t)}function E6(e,t){let n={type:"array",uniqueItems:!0,items:We(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&(n.minItems=e.minSize.value),e.maxSize&&(n.maxItems=e.maxSize.value),n}function R6(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((a,n)=>We(a._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((a,n)=>n===void 0?a:[...a,n],[]),additionalItems:We(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((a,n)=>We(a._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((a,n)=>n===void 0?a:[...a,n],[])}}function D6(){return{not:Oa()}}function _6(){return Oa()}var O6=(e,t)=>We(e.innerType._def,t),P6=(e,t,a)=>{switch(t){case le.ZodString:return D2(e,a);case le.ZodNumber:return C6(e);case le.ZodObject:return I6(e,a);case le.ZodBigInt:return r6(e);case le.ZodBoolean:return o6();case le.ZodDate:return R2(e,a);case le.ZodUndefined:return D6();case le.ZodNull:return x6();case le.ZodArray:return n6(e,a);case le.ZodUnion:case le.ZodDiscriminatedUnion:return v6(e,a);case le.ZodIntersection:return f6(e,a);case le.ZodTuple:return R6(e,a);case le.ZodRecord:return _2(e,a);case le.ZodLiteral:return p6(e);case le.ZodEnum:return c6(e);case le.ZodNativeEnum:return y6(e);case le.ZodNullable:return S6(e,a);case le.ZodOptional:return T6(e,a);case le.ZodMap:return g6(e,a);case le.ZodSet:return E6(e,a);case le.ZodLazy:return()=>e.getter()._def;case le.ZodPromise:return M6(e,a);case le.ZodNaN:case le.ZodNever:return w6();case le.ZodEffects:return u6(e,a);case le.ZodAny:return Oa();case le.ZodUnknown:return _6();case le.ZodDefault:return s6(e,a);case le.ZodBranded:return E2(e,a);case le.ZodReadonly:return O6(e,a);case le.ZodCatch:return l6(e,a);case le.ZodPipeline:return A6(e,a);case le.ZodFunction:case le.ZodVoid:case le.ZodSymbol:return;default:return(n=>{})(t)}},N6=(e,t)=>{let a=0;for(;a<e.length&&a<t.length&&e[a]===t[a];a++);return[(e.length-a).toString(),...t.slice(a)].join("/")};function We(e,t,a=!1){var n;let r=t.seen.get(e);if(t.override){let s=(n=t.override)==null?void 0:n.call(t,e,t,r,a);if(s!==t6)return s}if(r&&!a){let s=B6(r,t);if(s!==void 0)return s}let o={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,o);let l=P6(e,e.typeName,t),i=typeof l=="function"?We(l(),t):l;if(i&&U6(e,t,i),t.postProcess){let s=t.postProcess(i,e,t);return o.jsonSchema=i,s}return o.jsonSchema=i,i}var B6=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:N6(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((a,n)=>t.currentPath[n]===a)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),Oa()):t.$refStrategy==="seen"?Oa():void 0}},U6=(e,t,a)=>(e.description&&(a.description=e.description),a),F6=e=>{let t=a6(e),a=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,currentPath:a,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([n,r])=>[r._def,{def:r._def,path:[...t.basePath,t.definitionPath,n],jsonSchema:void 0}]))}},z6=(e,t)=>{var a;let n=F6(t),r=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((u,[c,d])=>{var f;return{...u,[c]:(f=We(d._def,{...n,currentPath:[...n.basePath,n.definitionPath,c]},!0))!=null?f:Oa()}},{}):void 0,o=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,l=(a=We(e._def,o===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,o]},!1))!=null?a:Oa(),i=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;i!==void 0&&(l.title=i);let s=o===void 0?r?{...l,[n.definitionPath]:r}:l:{$ref:[...n.$refStrategy==="relative"?[]:n.basePath,n.definitionPath,o].join("/"),[n.definitionPath]:{...r,[o]:l}};return s.$schema="http://json-schema.org/draft-07/schema#",s},Hw=Symbol.for("vercel.ai.schema");function Lf(e){let t;return()=>(t==null&&(t=e()),t)}function Tf(e,{validate:t}={}){return{[Hw]:!0,_type:void 0,get jsonSchema(){return typeof e=="function"&&(e=e()),e},validate:t}}function q6(e){return typeof e=="object"&&e!==null&&Hw in e&&e[Hw]===!0&&"jsonSchema"in e&&"validate"in e}function Af(e){return e==null?Tf({properties:{},additionalProperties:!1}):q6(e)?e:"~standard"in e?e["~standard"].vendor==="zod"?cu(e):H6(e):e()}function H6(e){return Tf(()=>Gw(e["~standard"].jsonSchema.input({target:"draft-07"})),{validate:async t=>{let a=await e["~standard"].validate(t);return"value"in a?{success:!0,value:a.value}:{success:!1,error:new Sn({value:t,cause:a.issues})}}})}function j6(e,t){var a;let n=(a=t?.useReferences)!=null?a:!1;return Tf(()=>z6(e,{$refStrategy:n?"root":"none"}),{validate:async r=>{let o=await e.safeParseAsync(r);return o.success?{success:!0,value:o.data}:{success:!1,error:o.error}}})}function V6(e,t){var a;let n=(a=t?.useReferences)!=null?a:!1;return Tf(()=>Gw((void 0)(e,{target:"draft-7",io:"input",reused:n?"ref":"inline"})),{validate:async r=>{let o=await(void 0)(e,r);return o.success?{success:!0,value:o.data}:{success:!1,error:o.error}}})}function G6(e){return"_zod"in e}function cu(e,t){return G6(e)?V6(e,t):j6(e,t)}async function Mf({value:e,schema:t,context:a}){let n=await ri({value:e,schema:t,context:a});if(!n.success)throw Sn.wrap({value:e,cause:n.error,context:a});return n.value}async function ri({value:e,schema:t,context:a}){let n=Af(t);try{if(n.validate==null)return{success:!0,value:e,rawValue:e};let r=await n.validate(e);return r.success?{success:!0,value:r.value,rawValue:e}:{success:!1,error:Sn.wrap({value:e,cause:r.error,context:a}),rawValue:e}}catch(r){return{success:!1,error:Sn.wrap({value:e,cause:r,context:a}),rawValue:e}}}async function or({text:e,schema:t}){try{let a=e6(e);return t==null?{success:!0,value:a,rawValue:a}:await ri({value:a,schema:t})}catch(a){return{success:!1,error:Ow.isInstance(a)?a:new Ow({text:e,cause:a}),rawValue:void 0}}}function O2({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new If).pipeThrough(new TransformStream({async transform({data:a},n){a!=="[DONE]"&&n.enqueue(await or({text:a,schema:t}))}}))}async function Cn(e){return typeof e=="function"&&(e=e()),Promise.resolve(e)}var W6=Object.defineProperty,X6=(e,t)=>{for(var a in t)W6(e,a,{get:t[a],enumerable:!0})},K6="AI_InvalidArgumentError",Z6=`vercel.ai.error.${K6}`,Q6=Symbol.for(Z6),Y6;Y6=Q6;var J6="AI_InvalidStreamPartError",eH=`vercel.ai.error.${J6}`,tH=Symbol.for(eH),aH;aH=tH;var nH="AI_InvalidToolApprovalError",rH=`vercel.ai.error.${nH}`,oH=Symbol.for(rH),lH;lH=oH;var iH="AI_InvalidToolInputError",sH=`vercel.ai.error.${iH}`,uH=Symbol.for(sH),cH;cH=uH;var dH="AI_ToolCallNotFoundForApprovalError",fH=`vercel.ai.error.${dH}`,pH=Symbol.for(fH),mH;mH=pH;var hH="AI_MissingToolResultsError",gH=`vercel.ai.error.${hH}`,yH=Symbol.for(gH),wH;wH=yH;var xH="AI_NoImageGeneratedError",vH=`vercel.ai.error.${xH}`,bH=Symbol.for(vH),SH;SH=bH;var N2="AI_NoObjectGeneratedError",B2=`vercel.ai.error.${N2}`,CH=Symbol.for(B2),U2,Qr=class extends Me{constructor({message:e="No object generated.",cause:t,text:a,response:n,usage:r,finishReason:o}){super({name:N2,message:e,cause:t}),this[U2]=!0,this.text=a,this.response=n,this.usage=r,this.finishReason=o}static isInstance(e){return Me.hasMarker(e,B2)}};U2=CH;var IH="AI_NoOutputGeneratedError",kH=`vercel.ai.error.${IH}`,LH=Symbol.for(kH),TH;TH=LH;var AH="AI_NoSpeechGeneratedError",MH=`vercel.ai.error.${AH}`,EH=Symbol.for(MH),RH;RH=EH;var DH="AI_NoTranscriptGeneratedError",_H=`vercel.ai.error.${DH}`,OH=Symbol.for(_H),PH;PH=OH;var NH="AI_NoVideoGeneratedError",BH=`vercel.ai.error.${NH}`,UH=Symbol.for(BH),FH;FH=UH;var zH="AI_NoSuchToolError",qH=`vercel.ai.error.${zH}`,HH=Symbol.for(qH),jH;jH=HH;var VH="AI_ToolCallRepairError",GH=`vercel.ai.error.${VH}`,$H=Symbol.for(GH),WH;WH=$H;var F2="AI_UIMessageStreamError",z2=`vercel.ai.error.${F2}`,XH=Symbol.for(z2),q2,oi=class extends Me{constructor({chunkType:e,chunkId:t,message:a}){super({name:F2,message:a}),this[q2]=!0,this.chunkType=e,this.chunkId=t}static isInstance(e){return Me.hasMarker(e,z2)}};q2=XH;var KH="AI_InvalidDataContentError",ZH=`vercel.ai.error.${KH}`,QH=Symbol.for(ZH),YH;YH=QH;var JH="AI_InvalidMessageRoleError",e9=`vercel.ai.error.${JH}`,t9=Symbol.for(e9),a9;a9=t9;var n9="AI_MessageConversionError",r9=`vercel.ai.error.${n9}`,o9=Symbol.for(r9),l9;l9=o9;var i9="AI_RetryError",s9=`vercel.ai.error.${i9}`,u9=Symbol.for(s9),c9;c9=u9;var d9="6.0.141",f9=async({url:e,maxBytes:t,abortSignal:a})=>{var n;let r=e.toString();Vw(r);try{let o=await fetch(r,{headers:kf({},`ai-sdk/${d9}`,M2()),signal:a});if(o.redirected&&Vw(o.url),!o.ok)throw new Za({url:r,statusCode:o.status,statusText:o.statusText});return{data:await L2({response:o,url:r,maxBytes:t??jw}),mediaType:(n=o.headers.get("content-type"))!=null?n:void 0}}catch(o){throw Za.isInstance(o)?o:new Za({url:r,cause:o})}};var H2=h.union([h.string(),h.instanceof(Uint8Array),h.instanceof(ArrayBuffer),h.custom(e=>{var t,a;return(a=(t=globalThis.Buffer)==null?void 0:t.isBuffer(e))!=null?a:!1},{message:"Must be a Buffer"})]);var du=h.lazy(()=>h.union([h.null(),h.string(),h.number(),h.boolean(),h.record(h.string(),du.optional()),h.array(du)])),X=h.record(h.string(),h.record(h.string(),du.optional())),j2=h.object({type:h.literal("text"),text:h.string(),providerOptions:X.optional()}),p9=h.object({type:h.literal("image"),image:h.union([H2,h.instanceof(URL)]),mediaType:h.string().optional(),providerOptions:X.optional()}),V2=h.object({type:h.literal("file"),data:h.union([H2,h.instanceof(URL)]),filename:h.string().optional(),mediaType:h.string(),providerOptions:X.optional()}),m9=h.object({type:h.literal("reasoning"),text:h.string(),providerOptions:X.optional()}),h9=h.object({type:h.literal("tool-call"),toolCallId:h.string(),toolName:h.string(),input:h.unknown(),providerOptions:X.optional(),providerExecuted:h.boolean().optional()}),g9=h.discriminatedUnion("type",[h.object({type:h.literal("text"),value:h.string(),providerOptions:X.optional()}),h.object({type:h.literal("json"),value:du,providerOptions:X.optional()}),h.object({type:h.literal("execution-denied"),reason:h.string().optional(),providerOptions:X.optional()}),h.object({type:h.literal("error-text"),value:h.string(),providerOptions:X.optional()}),h.object({type:h.literal("error-json"),value:du,providerOptions:X.optional()}),h.object({type:h.literal("content"),value:h.array(h.union([h.object({type:h.literal("text"),text:h.string(),providerOptions:X.optional()}),h.object({type:h.literal("media"),data:h.string(),mediaType:h.string()}),h.object({type:h.literal("file-data"),data:h.string(),mediaType:h.string(),filename:h.string().optional(),providerOptions:X.optional()}),h.object({type:h.literal("file-url"),url:h.string(),providerOptions:X.optional()}),h.object({type:h.literal("file-id"),fileId:h.union([h.string(),h.record(h.string(),h.string())]),providerOptions:X.optional()}),h.object({type:h.literal("image-data"),data:h.string(),mediaType:h.string(),providerOptions:X.optional()}),h.object({type:h.literal("image-url"),url:h.string(),providerOptions:X.optional()}),h.object({type:h.literal("image-file-id"),fileId:h.union([h.string(),h.record(h.string(),h.string())]),providerOptions:X.optional()}),h.object({type:h.literal("custom"),providerOptions:X.optional()})]))})]),G2=h.object({type:h.literal("tool-result"),toolCallId:h.string(),toolName:h.string(),output:g9,providerOptions:X.optional()}),y9=h.object({type:h.literal("tool-approval-request"),approvalId:h.string(),toolCallId:h.string()}),w9=h.object({type:h.literal("tool-approval-response"),approvalId:h.string(),approved:h.boolean(),reason:h.string().optional()}),x9=h.object({role:h.literal("system"),content:h.string(),providerOptions:X.optional()}),v9=h.object({role:h.literal("user"),content:h.union([h.string(),h.array(h.union([j2,p9,V2]))]),providerOptions:X.optional()}),b9=h.object({role:h.literal("assistant"),content:h.union([h.string(),h.array(h.union([j2,V2,m9,h9,G2,y9]))]),providerOptions:X.optional()}),S9=h.object({role:h.literal("tool"),content:h.array(h.union([G2,w9])),providerOptions:X.optional()}),Hne=h.union([x9,v9,b9,S9]);function $2(e,t){if(e===void 0&&t===void 0)return;if(e===void 0)return t;if(t===void 0)return e;let a={...e};for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let r=t[n];if(r===void 0)continue;let o=n in e?e[n]:void 0,l=r!==null&&typeof r=="object"&&!Array.isArray(r)&&!(r instanceof Date)&&!(r instanceof RegExp),i=o!=null&&typeof o=="object"&&!Array.isArray(o)&&!(o instanceof Date)&&!(o instanceof RegExp);l&&i?a[n]=$2(o,r):a[n]=r}return a}var C9={};X6(C9,{array:()=>T9,choice:()=>A9,json:()=>M9,object:()=>L9,text:()=>k9});function I9(e){let t=["ROOT"],a=-1,n=null;function r(s,u,c){switch(s){case'"':{a=u,t.pop(),t.push(c),t.push("INSIDE_STRING");break}case"f":case"t":case"n":{a=u,n=u,t.pop(),t.push(c),t.push("INSIDE_LITERAL");break}case"-":{t.pop(),t.push(c),t.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{a=u,t.pop(),t.push(c),t.push("INSIDE_NUMBER");break}case"{":{a=u,t.pop(),t.push(c),t.push("INSIDE_OBJECT_START");break}case"[":{a=u,t.pop(),t.push(c),t.push("INSIDE_ARRAY_START");break}}}function o(s,u){switch(s){case",":{t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{a=u,t.pop();break}}}function l(s,u){switch(s){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{a=u,t.pop();break}}}for(let s=0;s<e.length;s++){let u=e[s];switch(t[t.length-1]){case"ROOT":r(u,s,"FINISH");break;case"INSIDE_OBJECT_START":{switch(u){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}case"}":{a=s,t.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{u==='"'&&(t.pop(),t.push("INSIDE_OBJECT_KEY"));break}case"INSIDE_OBJECT_KEY":{u==='"'&&(t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY"));break}case"INSIDE_OBJECT_AFTER_KEY":{u===":"&&(t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE"));break}case"INSIDE_OBJECT_BEFORE_VALUE":{r(u,s,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{o(u,s);break}case"INSIDE_STRING":{switch(u){case'"':{t.pop(),a=s;break}case"\\":{t.push("INSIDE_STRING_ESCAPE");break}default:a=s}break}case"INSIDE_ARRAY_START":{u==="]"?(a=s,t.pop()):(a=s,r(u,s,"INSIDE_ARRAY_AFTER_VALUE"));break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(u){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{a=s,t.pop();break}default:{a=s;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{r(u,s,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{t.pop(),a=s;break}case"INSIDE_NUMBER":{switch(u){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{a=s;break}case"e":case"E":case"-":case".":break;case",":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&l(u,s),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&o(u,s);break}case"}":{t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&o(u,s);break}case"]":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&l(u,s);break}default:{t.pop();break}}break}case"INSIDE_LITERAL":{let d=e.substring(n,s+1);!"false".startsWith(d)&&!"true".startsWith(d)&&!"null".startsWith(d)?(t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?o(u,s):t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&l(u,s)):a=s;break}}}let i=e.slice(0,a+1);for(let s=t.length-1;s>=0;s--)switch(t[s]){case"INSIDE_STRING":{i+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{i+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{i+="]";break}case"INSIDE_LITERAL":{let c=e.substring(n,e.length);"true".startsWith(c)?i+="true".slice(c.length):"false".startsWith(c)?i+="false".slice(c.length):"null".startsWith(c)&&(i+="null".slice(c.length))}}return i}async function fu(e){if(e===void 0)return{value:void 0,state:"undefined-input"};let t=await or({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=await or({text:I9(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var k9=()=>({name:"text",responseFormat:Promise.resolve({type:"text"}),async parseCompleteOutput({text:e}){return e},async parsePartialOutput({text:e}){return{partial:e}},createElementStreamTransform(){}}),L9=({schema:e,name:t,description:a})=>{let n=Af(e);return{name:"object",responseFormat:Cn(n.jsonSchema).then(r=>({type:"json",schema:r,...t!=null&&{name:t},...a!=null&&{description:a}})),async parseCompleteOutput({text:r},o){let l=await or({text:r});if(!l.success)throw new Qr({message:"No object generated: could not parse the response.",cause:l.error,text:r,response:o.response,usage:o.usage,finishReason:o.finishReason});let i=await ri({value:l.value,schema:n});if(!i.success)throw new Qr({message:"No object generated: response did not match schema.",cause:i.error,text:r,response:o.response,usage:o.usage,finishReason:o.finishReason});return i.value},async parsePartialOutput({text:r}){let o=await fu(r);switch(o.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:o.value}}},createElementStreamTransform(){}}},T9=({element:e,name:t,description:a})=>{let n=Af(e);return{name:"array",responseFormat:Cn(n.jsonSchema).then(r=>{let{$schema:o,...l}=r;return{type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{elements:{type:"array",items:l}},required:["elements"],additionalProperties:!1},...t!=null&&{name:t},...a!=null&&{description:a}}}),async parseCompleteOutput({text:r},o){let l=await or({text:r});if(!l.success)throw new Qr({message:"No object generated: could not parse the response.",cause:l.error,text:r,response:o.response,usage:o.usage,finishReason:o.finishReason});let i=l.value;if(i==null||typeof i!="object"||!("elements"in i)||!Array.isArray(i.elements))throw new Qr({message:"No object generated: response did not match schema.",cause:new Sn({value:i,cause:"response must be an object with an elements array"}),text:r,response:o.response,usage:o.usage,finishReason:o.finishReason});for(let s of i.elements){let u=await ri({value:s,schema:n});if(!u.success)throw new Qr({message:"No object generated: response did not match schema.",cause:u.error,text:r,response:o.response,usage:o.usage,finishReason:o.finishReason})}return i.elements},async parsePartialOutput({text:r}){let o=await fu(r);switch(o.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{let l=o.value;if(l==null||typeof l!="object"||!("elements"in l)||!Array.isArray(l.elements))return;let i=o.state==="repaired-parse"&&l.elements.length>0?l.elements.slice(0,-1):l.elements,s=[];for(let u of i){let c=await ri({value:u,schema:n});c.success&&s.push(c.value)}return{partial:s}}}},createElementStreamTransform(){let r=0;return new TransformStream({transform({partialOutput:o},l){if(o!=null)for(;r<o.length;r++)l.enqueue(o[r])}})}}},A9=({options:e,name:t,description:a})=>({name:"choice",responseFormat:Promise.resolve({type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{result:{type:"string",enum:e}},required:["result"],additionalProperties:!1},...t!=null&&{name:t},...a!=null&&{description:a}}),async parseCompleteOutput({text:n},r){let o=await or({text:n});if(!o.success)throw new Qr({message:"No object generated: could not parse the response.",cause:o.error,text:n,response:r.response,usage:r.usage,finishReason:r.finishReason});let l=o.value;if(l==null||typeof l!="object"||!("result"in l)||typeof l.result!="string"||!e.includes(l.result))throw new Qr({message:"No object generated: response did not match schema.",cause:new Sn({value:l,cause:"response must be an object that contains a choice value."}),text:n,response:r.response,usage:r.usage,finishReason:r.finishReason});return l.result},async parsePartialOutput({text:n}){let r=await fu(n);switch(r.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{let o=r.value;if(o==null||typeof o!="object"||!("result"in o)||typeof o.result!="string")return;let l=e.filter(i=>i.startsWith(o.result));return r.state==="successful-parse"?l.includes(o.result)?{partial:o.result}:void 0:l.length===1?{partial:l[0]}:void 0}}},createElementStreamTransform(){}}),M9=({name:e,description:t}={})=>({name:"json",responseFormat:Promise.resolve({type:"json",...e!=null&&{name:e},...t!=null&&{description:t}}),async parseCompleteOutput({text:a},n){let r=await or({text:a});if(!r.success)throw new Qr({message:"No object generated: could not parse the response.",cause:r.error,text:a,response:n.response,usage:n.usage,finishReason:n.finishReason});return r.value},async parsePartialOutput({text:a}){let n=await fu(a);switch(n.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return n.value===void 0?void 0:{partial:n.value}}},createElementStreamTransform(){}});var $ne=rr({prefix:"aitxt",size:24});var Xne=class extends TransformStream{constructor(){super({transform(e,t){t.enqueue(`data: ${JSON.stringify(e)}
|
|
134
134
|
|
|
135
135
|
`)},flush(e){e.enqueue(`data: [DONE]
|
|
136
136
|
|
|
137
|
-
`)}})}};var nx=Of(()=>pu(h.union([h.strictObject({type:h.literal("text-start"),id:h.string(),providerMetadata:Z.optional()}),h.strictObject({type:h.literal("text-delta"),id:h.string(),delta:h.string(),providerMetadata:Z.optional()}),h.strictObject({type:h.literal("text-end"),id:h.string(),providerMetadata:Z.optional()}),h.strictObject({type:h.literal("error"),errorText:h.string()}),h.strictObject({type:h.literal("tool-input-start"),toolCallId:h.string(),toolName:h.string(),providerExecuted:h.boolean().optional(),providerMetadata:Z.optional(),dynamic:h.boolean().optional(),title:h.string().optional()}),h.strictObject({type:h.literal("tool-input-delta"),toolCallId:h.string(),inputTextDelta:h.string()}),h.strictObject({type:h.literal("tool-input-available"),toolCallId:h.string(),toolName:h.string(),input:h.unknown(),providerExecuted:h.boolean().optional(),providerMetadata:Z.optional(),dynamic:h.boolean().optional(),title:h.string().optional()}),h.strictObject({type:h.literal("tool-input-error"),toolCallId:h.string(),toolName:h.string(),input:h.unknown(),providerExecuted:h.boolean().optional(),providerMetadata:Z.optional(),dynamic:h.boolean().optional(),errorText:h.string(),title:h.string().optional()}),h.strictObject({type:h.literal("tool-approval-request"),approvalId:h.string(),toolCallId:h.string()}),h.strictObject({type:h.literal("tool-output-available"),toolCallId:h.string(),output:h.unknown(),providerExecuted:h.boolean().optional(),providerMetadata:Z.optional(),dynamic:h.boolean().optional(),preliminary:h.boolean().optional()}),h.strictObject({type:h.literal("tool-output-error"),toolCallId:h.string(),errorText:h.string(),providerExecuted:h.boolean().optional(),providerMetadata:Z.optional(),dynamic:h.boolean().optional()}),h.strictObject({type:h.literal("tool-output-denied"),toolCallId:h.string()}),h.strictObject({type:h.literal("reasoning-start"),id:h.string(),providerMetadata:Z.optional()}),h.strictObject({type:h.literal("reasoning-delta"),id:h.string(),delta:h.string(),providerMetadata:Z.optional()}),h.strictObject({type:h.literal("reasoning-end"),id:h.string(),providerMetadata:Z.optional()}),h.strictObject({type:h.literal("source-url"),sourceId:h.string(),url:h.string(),title:h.string().optional(),providerMetadata:Z.optional()}),h.strictObject({type:h.literal("source-document"),sourceId:h.string(),mediaType:h.string(),title:h.string(),filename:h.string().optional(),providerMetadata:Z.optional()}),h.strictObject({type:h.literal("file"),url:h.string(),mediaType:h.string(),providerMetadata:Z.optional()}),h.strictObject({type:h.custom(e=>typeof e=="string"&&e.startsWith("data-"),{message:'Type must start with "data-"'}),id:h.string().optional(),data:h.unknown(),transient:h.boolean().optional()}),h.strictObject({type:h.literal("start-step")}),h.strictObject({type:h.literal("finish-step")}),h.strictObject({type:h.literal("start"),messageId:h.string().optional(),messageMetadata:h.unknown().optional()}),h.strictObject({type:h.literal("finish"),finishReason:h.enum(["stop","length","content-filter","tool-calls","error","other"]).optional(),messageMetadata:h.unknown().optional()}),h.strictObject({type:h.literal("abort"),reason:h.string().optional()}),h.strictObject({type:h.literal("message-metadata"),messageMetadata:h.unknown()})])));function V9(e){return e.type.startsWith("data-")}function ax(e){return e.type.startsWith("tool-")}function G9(e){return e.type==="dynamic-tool"}function Uf(e){return ax(e)||G9(e)}function Z2(e){return e.type.split("-").slice(1).join("-")}function W9({lastMessage:e,messageId:t}){return{message:e?.role==="assistant"?e:{id:t,metadata:void 0,role:"assistant",parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}function $9({stream:e,messageMetadataSchema:t,dataPartSchemas:a,runUpdateMessageJob:n,onError:r,onToolCall:o,onData:i}){return e.pipeThrough(new TransformStream({async transform(l,s){await n(async({state:u,write:c})=>{var d,f,p,m;function x(g){let T=u.message.parts.filter(Uf).find(S=>S.toolCallId===g);if(T==null)throw new ol({chunkType:"tool-invocation",chunkId:g,message:`No tool invocation found for tool call ID "${g}".`});return T}function I(g){var b;let T=u.message.parts.find(R=>ax(R)&&R.toolCallId===g.toolCallId),S=g,M=T;if(T!=null){T.state=g.state,M.input=S.input,M.output=S.output,M.errorText=S.errorText,M.rawInput=S.rawInput,M.preliminary=S.preliminary,g.title!==void 0&&(M.title=g.title),M.providerExecuted=(b=S.providerExecuted)!=null?b:T.providerExecuted;let R=S.providerMetadata;if(R!=null)if(g.state==="output-available"||g.state==="output-error"){let _=T;_.resultProviderMetadata=R}else T.callProviderMetadata=R}else u.message.parts.push({type:`tool-${g.toolName}`,toolCallId:g.toolCallId,state:g.state,title:g.title,input:S.input,output:S.output,rawInput:S.rawInput,errorText:S.errorText,providerExecuted:S.providerExecuted,preliminary:S.preliminary,...S.providerMetadata!=null&&(g.state==="output-available"||g.state==="output-error")?{resultProviderMetadata:S.providerMetadata}:{},...S.providerMetadata!=null&&!(g.state==="output-available"||g.state==="output-error")?{callProviderMetadata:S.providerMetadata}:{}})}function y(g){var b,T;let S=u.message.parts.find(_=>_.type==="dynamic-tool"&&_.toolCallId===g.toolCallId),M=g,R=S;if(S!=null){S.state=g.state,R.toolName=g.toolName,R.input=M.input,R.output=M.output,R.errorText=M.errorText,R.rawInput=(b=M.rawInput)!=null?b:R.rawInput,R.preliminary=M.preliminary,g.title!==void 0&&(R.title=g.title),R.providerExecuted=(T=M.providerExecuted)!=null?T:S.providerExecuted;let _=M.providerMetadata;if(_!=null)if(g.state==="output-available"||g.state==="output-error"){let k=S;k.resultProviderMetadata=_}else S.callProviderMetadata=_}else u.message.parts.push({type:"dynamic-tool",toolName:g.toolName,toolCallId:g.toolCallId,state:g.state,input:M.input,output:M.output,errorText:M.errorText,preliminary:M.preliminary,providerExecuted:M.providerExecuted,title:g.title,...M.providerMetadata!=null&&(g.state==="output-available"||g.state==="output-error")?{resultProviderMetadata:M.providerMetadata}:{},...M.providerMetadata!=null&&!(g.state==="output-available"||g.state==="output-error")?{callProviderMetadata:M.providerMetadata}:{}})}async function w(g){if(g!=null){let b=u.message.metadata!=null?lD(u.message.metadata,g):g;t!=null&&await Bf({value:b,schema:t,context:{field:"message.metadata",entityId:u.message.id}}),u.message.metadata=b}}switch(l.type){case"text-start":{let g={type:"text",text:"",providerMetadata:l.providerMetadata,state:"streaming"};u.activeTextParts[l.id]=g,u.message.parts.push(g),c();break}case"text-delta":{let g=u.activeTextParts[l.id];if(g==null)throw new ol({chunkType:"text-delta",chunkId:l.id,message:`Received text-delta for missing text part with ID "${l.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.`});g.text+=l.delta,g.providerMetadata=(d=l.providerMetadata)!=null?d:g.providerMetadata,c();break}case"text-end":{let g=u.activeTextParts[l.id];if(g==null)throw new ol({chunkType:"text-end",chunkId:l.id,message:`Received text-end for missing text part with ID "${l.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`});g.state="done",g.providerMetadata=(f=l.providerMetadata)!=null?f:g.providerMetadata,delete u.activeTextParts[l.id],c();break}case"reasoning-start":{let g={type:"reasoning",text:"",providerMetadata:l.providerMetadata,state:"streaming"};u.activeReasoningParts[l.id]=g,u.message.parts.push(g),c();break}case"reasoning-delta":{let g=u.activeReasoningParts[l.id];if(g==null)throw new ol({chunkType:"reasoning-delta",chunkId:l.id,message:`Received reasoning-delta for missing reasoning part with ID "${l.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.`});g.text+=l.delta,g.providerMetadata=(p=l.providerMetadata)!=null?p:g.providerMetadata,c();break}case"reasoning-end":{let g=u.activeReasoningParts[l.id];if(g==null)throw new ol({chunkType:"reasoning-end",chunkId:l.id,message:`Received reasoning-end for missing reasoning part with ID "${l.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`});g.providerMetadata=(m=l.providerMetadata)!=null?m:g.providerMetadata,g.state="done",delete u.activeReasoningParts[l.id],c();break}case"file":{u.message.parts.push({type:"file",mediaType:l.mediaType,url:l.url,...l.providerMetadata!=null?{providerMetadata:l.providerMetadata}:{}}),c();break}case"source-url":{u.message.parts.push({type:"source-url",sourceId:l.sourceId,url:l.url,title:l.title,providerMetadata:l.providerMetadata}),c();break}case"source-document":{u.message.parts.push({type:"source-document",sourceId:l.sourceId,mediaType:l.mediaType,title:l.title,filename:l.filename,providerMetadata:l.providerMetadata}),c();break}case"tool-input-start":{let g=u.message.parts.filter(ax);u.partialToolCalls[l.toolCallId]={text:"",toolName:l.toolName,index:g.length,dynamic:l.dynamic,title:l.title},l.dynamic?y({toolCallId:l.toolCallId,toolName:l.toolName,state:"input-streaming",input:void 0,providerExecuted:l.providerExecuted,title:l.title,providerMetadata:l.providerMetadata}):I({toolCallId:l.toolCallId,toolName:l.toolName,state:"input-streaming",input:void 0,providerExecuted:l.providerExecuted,title:l.title,providerMetadata:l.providerMetadata}),c();break}case"tool-input-delta":{let g=u.partialToolCalls[l.toolCallId];if(g==null)throw new ol({chunkType:"tool-input-delta",chunkId:l.toolCallId,message:`Received tool-input-delta for missing tool call with ID "${l.toolCallId}". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.`});g.text+=l.inputTextDelta;let{value:b}=await hu(g.text);g.dynamic?y({toolCallId:l.toolCallId,toolName:g.toolName,state:"input-streaming",input:b,title:g.title}):I({toolCallId:l.toolCallId,toolName:g.toolName,state:"input-streaming",input:b,title:g.title}),c();break}case"tool-input-available":{l.dynamic?y({toolCallId:l.toolCallId,toolName:l.toolName,state:"input-available",input:l.input,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata,title:l.title}):I({toolCallId:l.toolCallId,toolName:l.toolName,state:"input-available",input:l.input,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata,title:l.title}),c(),o&&!l.providerExecuted&&await o({toolCall:l});break}case"tool-input-error":{let g=u.message.parts.filter(Uf).find(T=>T.toolCallId===l.toolCallId);(g!=null?g.type==="dynamic-tool":!!l.dynamic)?y({toolCallId:l.toolCallId,toolName:l.toolName,state:"output-error",input:l.input,errorText:l.errorText,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata}):I({toolCallId:l.toolCallId,toolName:l.toolName,state:"output-error",input:void 0,rawInput:l.input,errorText:l.errorText,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata}),c();break}case"tool-approval-request":{let g=x(l.toolCallId);g.state="approval-requested",g.approval={id:l.approvalId},c();break}case"tool-output-denied":{let g=x(l.toolCallId);g.state="output-denied",c();break}case"tool-output-available":{let g=x(l.toolCallId);g.type==="dynamic-tool"?y({toolCallId:l.toolCallId,toolName:g.toolName,state:"output-available",input:g.input,output:l.output,preliminary:l.preliminary,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata,title:g.title}):I({toolCallId:l.toolCallId,toolName:Z2(g),state:"output-available",input:g.input,output:l.output,providerExecuted:l.providerExecuted,preliminary:l.preliminary,providerMetadata:l.providerMetadata,title:g.title}),c();break}case"tool-output-error":{let g=x(l.toolCallId);g.type==="dynamic-tool"?y({toolCallId:l.toolCallId,toolName:g.toolName,state:"output-error",input:g.input,errorText:l.errorText,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata,title:g.title}):I({toolCallId:l.toolCallId,toolName:Z2(g),state:"output-error",input:g.input,rawInput:g.rawInput,errorText:l.errorText,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata,title:g.title}),c();break}case"start-step":{u.message.parts.push({type:"step-start"});break}case"finish-step":{u.activeTextParts={},u.activeReasoningParts={};break}case"start":{l.messageId!=null&&(u.message.id=l.messageId),await w(l.messageMetadata),(l.messageId!=null||l.messageMetadata!=null)&&c();break}case"finish":{l.finishReason!=null&&(u.finishReason=l.finishReason),await w(l.messageMetadata),l.messageMetadata!=null&&c();break}case"message-metadata":{await w(l.messageMetadata),l.messageMetadata!=null&&c();break}case"error":{r?.(new Error(l.errorText));break}default:if(V9(l)){if(a?.[l.type]!=null){let T=u.message.parts.findIndex(M=>"id"in M&&"data"in M&&M.id===l.id&&M.type===l.type),S=T>=0?T:u.message.parts.length;await Bf({value:l.data,schema:a[l.type],context:{field:`message.parts[${S}].data`,entityName:l.type,entityId:l.id}})}let g=l;if(g.transient){i?.(g);break}let b=g.id!=null?u.message.parts.find(T=>g.type===T.type&&g.id===T.id):void 0;b!=null?b.data=g.data:u.message.parts.push(g),i?.(g),c()}}s.enqueue(l)})}}))}async function X9({stream:e,onError:t}){let a=e.getReader();try{for(;;){let{done:n}=await a.read();if(n)break}}catch(n){t?.(n)}finally{a.releaseLock()}}var gre=ir({prefix:"aitxt",size:24});var xre=Of(()=>pu(h.array(h.object({id:h.string(),role:h.enum(["system","user","assistant"]),metadata:h.unknown().optional(),parts:h.array(h.union([h.object({type:h.literal("text"),text:h.string(),state:h.enum(["streaming","done"]).optional(),providerMetadata:Z.optional()}),h.object({type:h.literal("reasoning"),text:h.string(),state:h.enum(["streaming","done"]).optional(),providerMetadata:Z.optional()}),h.object({type:h.literal("source-url"),sourceId:h.string(),url:h.string(),title:h.string().optional(),providerMetadata:Z.optional()}),h.object({type:h.literal("source-document"),sourceId:h.string(),mediaType:h.string(),title:h.string(),filename:h.string().optional(),providerMetadata:Z.optional()}),h.object({type:h.literal("file"),mediaType:h.string(),filename:h.string().optional(),url:h.string(),providerMetadata:Z.optional()}),h.object({type:h.literal("step-start")}),h.object({type:h.string().startsWith("data-"),id:h.string().optional(),data:h.unknown()}),h.object({type:h.literal("dynamic-tool"),toolName:h.string(),toolCallId:h.string(),state:h.literal("input-streaming"),input:h.unknown().optional(),providerExecuted:h.boolean().optional(),callProviderMetadata:Z.optional(),output:h.never().optional(),errorText:h.never().optional(),approval:h.never().optional()}),h.object({type:h.literal("dynamic-tool"),toolName:h.string(),toolCallId:h.string(),state:h.literal("input-available"),input:h.unknown(),providerExecuted:h.boolean().optional(),output:h.never().optional(),errorText:h.never().optional(),callProviderMetadata:Z.optional(),approval:h.never().optional()}),h.object({type:h.literal("dynamic-tool"),toolName:h.string(),toolCallId:h.string(),state:h.literal("approval-requested"),input:h.unknown(),providerExecuted:h.boolean().optional(),output:h.never().optional(),errorText:h.never().optional(),callProviderMetadata:Z.optional(),approval:h.object({id:h.string(),approved:h.never().optional(),reason:h.never().optional()})}),h.object({type:h.literal("dynamic-tool"),toolName:h.string(),toolCallId:h.string(),state:h.literal("approval-responded"),input:h.unknown(),providerExecuted:h.boolean().optional(),output:h.never().optional(),errorText:h.never().optional(),callProviderMetadata:Z.optional(),approval:h.object({id:h.string(),approved:h.boolean(),reason:h.string().optional()})}),h.object({type:h.literal("dynamic-tool"),toolName:h.string(),toolCallId:h.string(),state:h.literal("output-available"),input:h.unknown(),providerExecuted:h.boolean().optional(),output:h.unknown(),errorText:h.never().optional(),callProviderMetadata:Z.optional(),resultProviderMetadata:Z.optional(),preliminary:h.boolean().optional(),approval:h.object({id:h.string(),approved:h.literal(!0),reason:h.string().optional()}).optional()}),h.object({type:h.literal("dynamic-tool"),toolName:h.string(),toolCallId:h.string(),state:h.literal("output-error"),input:h.unknown(),rawInput:h.unknown().optional(),providerExecuted:h.boolean().optional(),output:h.never().optional(),errorText:h.string(),callProviderMetadata:Z.optional(),resultProviderMetadata:Z.optional(),approval:h.object({id:h.string(),approved:h.literal(!0),reason:h.string().optional()}).optional()}),h.object({type:h.literal("dynamic-tool"),toolName:h.string(),toolCallId:h.string(),state:h.literal("output-denied"),input:h.unknown(),providerExecuted:h.boolean().optional(),output:h.never().optional(),errorText:h.never().optional(),callProviderMetadata:Z.optional(),approval:h.object({id:h.string(),approved:h.literal(!1),reason:h.string().optional()})}),h.object({type:h.string().startsWith("tool-"),toolCallId:h.string(),state:h.literal("input-streaming"),providerExecuted:h.boolean().optional(),callProviderMetadata:Z.optional(),input:h.unknown().optional(),output:h.never().optional(),errorText:h.never().optional(),approval:h.never().optional()}),h.object({type:h.string().startsWith("tool-"),toolCallId:h.string(),state:h.literal("input-available"),providerExecuted:h.boolean().optional(),input:h.unknown(),output:h.never().optional(),errorText:h.never().optional(),callProviderMetadata:Z.optional(),approval:h.never().optional()}),h.object({type:h.string().startsWith("tool-"),toolCallId:h.string(),state:h.literal("approval-requested"),input:h.unknown(),providerExecuted:h.boolean().optional(),output:h.never().optional(),errorText:h.never().optional(),callProviderMetadata:Z.optional(),approval:h.object({id:h.string(),approved:h.never().optional(),reason:h.never().optional()})}),h.object({type:h.string().startsWith("tool-"),toolCallId:h.string(),state:h.literal("approval-responded"),input:h.unknown(),providerExecuted:h.boolean().optional(),output:h.never().optional(),errorText:h.never().optional(),callProviderMetadata:Z.optional(),approval:h.object({id:h.string(),approved:h.boolean(),reason:h.string().optional()})}),h.object({type:h.string().startsWith("tool-"),toolCallId:h.string(),state:h.literal("output-available"),providerExecuted:h.boolean().optional(),input:h.unknown(),output:h.unknown(),errorText:h.never().optional(),callProviderMetadata:Z.optional(),resultProviderMetadata:Z.optional(),preliminary:h.boolean().optional(),approval:h.object({id:h.string(),approved:h.literal(!0),reason:h.string().optional()}).optional()}),h.object({type:h.string().startsWith("tool-"),toolCallId:h.string(),state:h.literal("output-error"),providerExecuted:h.boolean().optional(),input:h.unknown(),rawInput:h.unknown().optional(),output:h.never().optional(),errorText:h.string(),callProviderMetadata:Z.optional(),resultProviderMetadata:Z.optional(),approval:h.object({id:h.string(),approved:h.literal(!0),reason:h.string().optional()}).optional()}),h.object({type:h.string().startsWith("tool-"),toolCallId:h.string(),state:h.literal("output-denied"),providerExecuted:h.boolean().optional(),input:h.unknown(),output:h.never().optional(),errorText:h.never().optional(),callProviderMetadata:Z.optional(),approval:h.object({id:h.string(),approved:h.literal(!1),reason:h.string().optional()})})])).nonempty("Message must contain at least one part")})).nonempty("Messages array must not be empty")));var bre=ir({prefix:"aiobj",size:24});function sD(e){return({url:t,abortSignal:a})=>L9({url:t,maxBytes:e?.maxBytes,abortSignal:a})}var K9=class{constructor(){this.queue=[],this.isProcessing=!1}async processQueue(){if(!this.isProcessing){for(this.isProcessing=!0;this.queue.length>0;)await this.queue[0](),this.queue.shift();this.isProcessing=!1}}async run(e){return new Promise((t,a)=>{this.queue.push(async()=>{try{await e(),t()}catch(n){a(n)}}),this.processQueue()})}};var Ire=ir({prefix:"aiobj",size:24});var Cre=sD();var Z9="AI_NoSuchProviderError",Q9=`vercel.ai.error.${Z9}`,Y9=Symbol.for(Q9),J9;J9=Y9;var kre=sD();async function ej(e){if(e==null)return[];if(!globalThis.FileList||!(e instanceof globalThis.FileList))throw new Error("FileList is not supported in the current environment");return Promise.all(Array.from(e).map(async t=>{let{name:a,type:n}=t,r=await new Promise((o,i)=>{let l=new FileReader;l.onload=s=>{var u;o((u=s.target)==null?void 0:u.result)},l.onerror=s=>i(s),l.readAsDataURL(t)});return{type:"file",mediaType:n,filename:a,url:r}}))}var tj=class{constructor({api:e="/api/chat",credentials:t,headers:a,body:n,fetch:r,prepareSendMessagesRequest:o,prepareReconnectToStreamRequest:i}){this.api=e,this.credentials=t,this.headers=a,this.body=n,this.fetch=r,this.prepareSendMessagesRequest=o,this.prepareReconnectToStreamRequest=i}async sendMessages({abortSignal:e,...t}){var a,n,r,o,i;let l=await Ln(this.body),s=await Ln(this.headers),u=await Ln(this.credentials),c={...Zr(s),...Zr(t.headers)},d=await((a=this.prepareSendMessagesRequest)==null?void 0:a.call(this,{api:this.api,id:t.chatId,messages:t.messages,body:{...l,...t.body},headers:c,credentials:u,requestMetadata:t.metadata,trigger:t.trigger,messageId:t.messageId})),f=(n=d?.api)!=null?n:this.api,p=d?.headers!==void 0?Zr(d.headers):c,m=d?.body!==void 0?d.body:{...l,...t.body,id:t.chatId,messages:t.messages,trigger:t.trigger,messageId:t.messageId},x=(r=d?.credentials)!=null?r:u,y=await((o=this.fetch)!=null?o:globalThis.fetch)(f,{method:"POST",headers:{"Content-Type":"application/json",...p},body:JSON.stringify(m),credentials:x,signal:e});if(!y.ok)throw new Error((i=await y.text())!=null?i:"Failed to fetch the chat response.");if(!y.body)throw new Error("The response body is empty.");return this.processResponseStream(y.body)}async reconnectToStream(e){var t,a,n,r,o;let i=await Ln(this.body),l=await Ln(this.headers),s=await Ln(this.credentials),u={...Zr(l),...Zr(e.headers)},c=await((t=this.prepareReconnectToStreamRequest)==null?void 0:t.call(this,{api:this.api,id:e.chatId,body:{...i,...e.body},headers:u,credentials:s,requestMetadata:e.metadata})),d=(a=c?.api)!=null?a:`${this.api}/${e.chatId}/stream`,f=c?.headers!==void 0?Zr(c.headers):u,p=(n=c?.credentials)!=null?n:s,x=await((r=this.fetch)!=null?r:globalThis.fetch)(d,{method:"GET",headers:f,credentials:p});if(x.status===204)return null;if(!x.ok)throw new Error((o=await x.text())!=null?o:"Failed to fetch the chat response.");if(!x.body)throw new Error("The response body is empty.");return this.processResponseStream(x.body)}},rx=class extends tj{constructor(e={}){super(e)}processResponseStream(e){return K2({stream:e,schema:nx}).pipeThrough(new TransformStream({async transform(t,a){if(!t.success)throw t.error;a.enqueue(t.value)}}))}},uD=class{constructor({generateId:e=j2,id:t=e(),transport:a=new rx,messageMetadataSchema:n,dataPartSchemas:r,state:o,onError:i,onToolCall:l,onFinish:s,onData:u,sendAutomaticallyWhen:c}){this.activeResponse=void 0,this.jobExecutor=new K9,this.sendMessage=async(d,f)=>{var p,m,x,I;if(d==null){await this.makeRequest({trigger:"submit-message",messageId:(p=this.lastMessage)==null?void 0:p.id,...f});return}let y;if("text"in d||"files"in d?y={parts:[...Array.isArray(d.files)?d.files:await ej(d.files),..."text"in d&&d.text!=null?[{type:"text",text:d.text}]:[]]}:y=d,d.messageId!=null){let w=this.state.messages.findIndex(g=>g.id===d.messageId);if(w===-1)throw new Error(`message with id ${d.messageId} not found`);if(this.state.messages[w].role!=="user")throw new Error(`message with id ${d.messageId} is not a user message`);this.state.messages=this.state.messages.slice(0,w+1),this.state.replaceMessage(w,{...y,id:d.messageId,role:(m=y.role)!=null?m:"user",metadata:d.metadata})}else this.state.pushMessage({...y,id:(x=y.id)!=null?x:this.generateId(),role:(I=y.role)!=null?I:"user",metadata:d.metadata});await this.makeRequest({trigger:"submit-message",messageId:d.messageId,...f})},this.regenerate=async({messageId:d,...f}={})=>{let p=d==null?this.state.messages.length-1:this.state.messages.findIndex(m=>m.id===d);if(p===-1)throw new Error(`message ${d} not found`);this.state.messages=this.state.messages.slice(0,this.messages[p].role==="assistant"?p:p+1),await this.makeRequest({trigger:"regenerate-message",messageId:d,...f})},this.resumeStream=async(d={})=>{await this.makeRequest({trigger:"resume-stream",...d})},this.clearError=()=>{this.status==="error"&&(this.state.error=void 0,this.setStatus({status:"ready"}))},this.addToolApprovalResponse=async({id:d,approved:f,reason:p,options:m})=>this.jobExecutor.run(async()=>{let x=this.state.messages,I=x[x.length-1],y=w=>Uf(w)&&w.state==="approval-requested"&&w.approval.id===d?{...w,state:"approval-responded",approval:{id:d,approved:f,reason:p}}:w;this.state.replaceMessage(x.length-1,{...I,parts:I.parts.map(y)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(y)),this.status!=="streaming"&&this.status!=="submitted"&&this.sendAutomaticallyWhen&&this.shouldSendAutomatically().then(w=>{var g;w&&this.makeRequest({trigger:"submit-message",messageId:(g=this.lastMessage)==null?void 0:g.id,...m})})}),this.addToolOutput=async({state:d="output-available",toolCallId:f,output:p,errorText:m,options:x})=>this.jobExecutor.run(async()=>{let I=this.state.messages,y=I[I.length-1],w=g=>Uf(g)&&g.toolCallId===f?{...g,state:d,output:p,errorText:m}:g;this.state.replaceMessage(I.length-1,{...y,parts:y.parts.map(w)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(w)),this.status!=="streaming"&&this.status!=="submitted"&&this.sendAutomaticallyWhen&&this.shouldSendAutomatically().then(g=>{var b;g&&this.makeRequest({trigger:"submit-message",messageId:(b=this.lastMessage)==null?void 0:b.id,...x})})}),this.addToolResult=this.addToolOutput,this.stop=async()=>{var d;this.status!=="streaming"&&this.status!=="submitted"||(d=this.activeResponse)!=null&&d.abortController&&this.activeResponse.abortController.abort()},this.id=t,this.transport=a,this.generateId=e,this.messageMetadataSchema=n,this.dataPartSchemas=r,this.state=o,this.onError=i,this.onToolCall=l,this.onFinish=s,this.onData=u,this.sendAutomaticallyWhen=c}get status(){return this.state.status}setStatus({status:e,error:t}){this.status!==e&&(this.state.status=e,this.state.error=t)}get error(){return this.state.error}get messages(){return this.state.messages}get lastMessage(){return this.state.messages[this.state.messages.length-1]}set messages(e){this.state.messages=e}async shouldSendAutomatically(){if(!this.sendAutomaticallyWhen)return!1;let e=this.sendAutomaticallyWhen({messages:this.state.messages});return e&&typeof e=="object"&&"then"in e?await e:e}async makeRequest({trigger:e,metadata:t,headers:a,body:n,messageId:r}){var o,i,l;let s;if(e==="resume-stream")try{let p=await this.transport.reconnectToStream({chatId:this.id,metadata:t,headers:a,body:n});if(p==null)return;s=p}catch(p){this.onError&&p instanceof Error&&this.onError(p),this.setStatus({status:"error",error:p});return}this.setStatus({status:"submitted",error:void 0});let u=this.lastMessage,c=!1,d=!1,f=!1;try{let p={state:W9({lastMessage:this.state.snapshot(u),messageId:this.generateId()}),abortController:new AbortController};p.abortController.signal.addEventListener("abort",()=>{c=!0}),this.activeResponse=p;let m;e==="resume-stream"?m=s:m=await this.transport.sendMessages({chatId:this.id,messages:this.state.messages,abortSignal:p.abortController.signal,metadata:t,headers:a,body:n,trigger:e,messageId:r});let x=I=>this.jobExecutor.run(()=>I({state:p.state,write:()=>{var y;this.setStatus({status:"streaming"}),p.state.message.id===((y=this.lastMessage)==null?void 0:y.id)?this.state.replaceMessage(this.state.messages.length-1,p.state.message):this.state.pushMessage(p.state.message)}}));await X9({stream:$9({stream:m,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:x,onError:I=>{throw I}}),onError:I=>{throw I}}),this.setStatus({status:"ready"})}catch(p){if(c||p.name==="AbortError")return c=!0,this.setStatus({status:"ready"}),null;f=!0,p instanceof TypeError&&(p.message.toLowerCase().includes("fetch")||p.message.toLowerCase().includes("network"))&&(d=!0),this.onError&&p instanceof Error&&this.onError(p),this.setStatus({status:"error",error:p})}finally{try{(i=this.onFinish)==null||i.call(this,{message:this.activeResponse.state.message,messages:this.state.messages,isAbort:c,isDisconnect:d,isError:f,finishReason:(o=this.activeResponse)==null?void 0:o.state.finishReason})}catch(p){console.error(p)}this.activeResponse=void 0}!f&&await this.shouldSendAutomatically()&&await this.makeRequest({trigger:"submit-message",messageId:(l=this.lastMessage)==null?void 0:l.id,metadata:t,headers:a,body:n})}};var mD=z(dD(),1);var xu=z(Le(),1);var qf=z(Le(),1);var pD=(e,t,a)=>{if(!t.has(e))throw TypeError("Cannot "+a)},ut=(e,t,a)=>(pD(e,t,"read from private field"),a?a.call(e):t.get(e)),Tn=(e,t,a)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,a)},Yr=(e,t,a,n)=>(pD(e,t,"write to private field"),n?n.call(e,a):t.set(e,a),a);function nj(e,t){return t!=null?(0,mD.default)(e,t):e}var Ja,Ff,zf,gu,yu,wu,il,ox,ix,rj=class{constructor(e=[]){Tn(this,Ja,void 0),Tn(this,Ff,"ready"),Tn(this,zf,void 0),Tn(this,gu,new Set),Tn(this,yu,new Set),Tn(this,wu,new Set),this.pushMessage=t=>{Yr(this,Ja,ut(this,Ja).concat(t)),ut(this,il).call(this)},this.popMessage=()=>{Yr(this,Ja,ut(this,Ja).slice(0,-1)),ut(this,il).call(this)},this.replaceMessage=(t,a)=>{Yr(this,Ja,[...ut(this,Ja).slice(0,t),this.snapshot(a),...ut(this,Ja).slice(t+1)]),ut(this,il).call(this)},this.snapshot=t=>structuredClone(t),this["~registerMessagesCallback"]=(t,a)=>{let n=a?nj(t,a):t;return ut(this,gu).add(n),()=>{ut(this,gu).delete(n)}},this["~registerStatusCallback"]=t=>(ut(this,yu).add(t),()=>{ut(this,yu).delete(t)}),this["~registerErrorCallback"]=t=>(ut(this,wu).add(t),()=>{ut(this,wu).delete(t)}),Tn(this,il,()=>{ut(this,gu).forEach(t=>t())}),Tn(this,ox,()=>{ut(this,yu).forEach(t=>t())}),Tn(this,ix,()=>{ut(this,wu).forEach(t=>t())}),Yr(this,Ja,e)}get status(){return ut(this,Ff)}set status(e){Yr(this,Ff,e),ut(this,ox).call(this)}get error(){return ut(this,zf)}set error(e){Yr(this,zf,e),ut(this,ix).call(this)}get messages(){return ut(this,Ja)}set messages(e){Yr(this,Ja,[...e]),ut(this,il).call(this)}};Ja=new WeakMap;Ff=new WeakMap;zf=new WeakMap;gu=new WeakMap;yu=new WeakMap;wu=new WeakMap;il=new WeakMap;ox=new WeakMap;ix=new WeakMap;var ll,fD=class extends uD{constructor({messages:e,...t}){let a=new rj(e);super({...t,state:a}),Tn(this,ll,void 0),this["~registerMessagesCallback"]=(n,r)=>ut(this,ll)["~registerMessagesCallback"](n,r),this["~registerStatusCallback"]=n=>ut(this,ll)["~registerStatusCallback"](n),this["~registerErrorCallback"]=n=>ut(this,ll)["~registerErrorCallback"](n),Yr(this,ll,a)}};ll=new WeakMap;function hD({experimental_throttle:e,resume:t=!1,...a}={}){let n=(0,en.useRef)("chat"in a?{}:{onToolCall:a.onToolCall,onData:a.onData,onFinish:a.onFinish,onError:a.onError,sendAutomaticallyWhen:a.sendAutomaticallyWhen});"chat"in a||(n.current={onToolCall:a.onToolCall,onData:a.onData,onFinish:a.onFinish,onError:a.onError,sendAutomaticallyWhen:a.sendAutomaticallyWhen});let r={...a,onToolCall:f=>{var p,m;return(m=(p=n.current).onToolCall)==null?void 0:m.call(p,f)},onData:f=>{var p,m;return(m=(p=n.current).onData)==null?void 0:m.call(p,f)},onFinish:f=>{var p,m;return(m=(p=n.current).onFinish)==null?void 0:m.call(p,f)},onError:f=>{var p,m;return(m=(p=n.current).onError)==null?void 0:m.call(p,f)},sendAutomaticallyWhen:f=>{var p,m,x;return(x=(m=(p=n.current).sendAutomaticallyWhen)==null?void 0:m.call(p,f))!=null?x:!1}},o=(0,en.useRef)("chat"in a?a.chat:new fD(r));("chat"in a&&a.chat!==o.current||"id"in a&&o.current.id!==a.id)&&(o.current="chat"in a?a.chat:new fD(r));let l=(0,en.useCallback)(f=>o.current["~registerMessagesCallback"](f,e),[e,o.current.id]),s=(0,en.useSyncExternalStore)(l,()=>o.current.messages,()=>o.current.messages),u=(0,en.useSyncExternalStore)(o.current["~registerStatusCallback"],()=>o.current.status,()=>o.current.status),c=(0,en.useSyncExternalStore)(o.current["~registerErrorCallback"],()=>o.current.error,()=>o.current.error),d=(0,en.useCallback)(f=>{typeof f=="function"&&(f=f(o.current.messages)),o.current.messages=f},[o]);return(0,en.useEffect)(()=>{t&&o.current.resumeStream()},[t,o]),{id:o.current.id,messages:s,setMessages:d,sendMessage:o.current.sendMessage,regenerate:o.current.regenerate,clearError:o.current.clearError,stop:o.current.stop,error:c,resumeStream:o.current.resumeStream,status:u,addToolResult:o.current.addToolOutput,addToolOutput:o.current.addToolOutput,addToolApprovalResponse:o.current.addToolApprovalResponse}}var Q=z(Le(),1);function sl(e,t,a){let[n,r=""]=e.split("?"),o=n.replace(/\/$/,""),i=new URLSearchParams(r);if(a)for(let[s,u]of Object.entries(a))i.set(s,u);let l=i.toString();return`${o}${t}${l?`?${l}`:""}`}function oj(e){let t=e?.cause,a=t?.issues??t?.errors;if(!Array.isArray(a))return null;let n=a.find(r=>r.code==="invalid_union");if(!n?.errors)return null;for(let r of n.errors){if(!Array.isArray(r)||r.some(l=>(l.code==="invalid_value"||l.code==="invalid_literal")&&l.path?.[0]==="type"))continue;let i=r.filter(l=>l.code==="unrecognized_keys").flatMap(l=>l.keys??[]);if(i.length>0)return i}return null}var Hf=class extends rx{processResponseStream(t){let a="",n=nx(),r=n.validate?.bind(n);return t.pipeThrough(new TextDecoderStream).pipeThrough(new TransformStream({async transform(o,i){a+=o;let l=a.split(`
|
|
138
|
-
`);a=l.pop()??"";for(let s of l){let u=s.trim();if(!u.startsWith("data:"))continue;let c=u.slice(5).trim();if(c!=="[DONE]")try{let d=JSON.parse(c);if(!r){i.enqueue(d);continue}let f=await r(d);if(f.success){i.enqueue(f.value);continue}let p=oj(f.error);if(p?.length){let m={...d};for(let I of p)delete m[I];let x=await r(m);x.success&&i.enqueue(x.value)}}catch{}}}}))}};var gD=50,yD=1e3;function jf(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.threadId=="string"&&typeof t.memoryUserId=="string"&&typeof t.title=="string"&&Array.isArray(t.messages)&&typeof t.createdAt=="string"&&typeof t.updatedAt=="string"}async function Vf(e){if(typeof indexedDB>"u")return null;let t=null;try{return t=await $h(),await e(t)}catch{return null}finally{try{t?.close()}catch{}}}function lx(e){return new Promise((t,a)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>a(e.error)})}async function sx(e){return await Vf(async a=>{let o=a.transaction(Da,"readonly").objectStore(Da).index(nd),l=(await lx(o.getAll(e))??[]).filter(jf);return l.sort((s,u)=>s.updatedAt<u.updatedAt?1:-1),l})??[]}async function Gf(e){return await Vf(async a=>{let r=a.transaction(Da,"readonly").objectStore(Da),o=await lx(r.get(e));return jf(o)?o:null})??null}async function ux(e){if(!jf(e))return;let t=e.messages.length>yD?{...e,messages:e.messages.slice(e.messages.length-yD)}:e;await Vf(async a=>{await new Promise((s,u)=>{let c=a.transaction(Da,"readwrite");c.oncomplete=()=>s(),c.onerror=()=>u(c.error),c.onabort=()=>u(c.error),c.objectStore(Da).put(t)});let n=a.transaction(Da,"readwrite"),r=n.objectStore(Da),o=r.index(nd),l=(await lx(o.getAll(t.memoryUserId))??[]).filter(jf);if(l.length>gD){l.sort((u,c)=>u.updatedAt<c.updatedAt?-1:1);let s=l.slice(0,l.length-gD);for(let u of s)r.delete(u.threadId)}return await new Promise((s,u)=>{n.oncomplete=()=>s(),n.onerror=()=>u(n.error),n.onabort=()=>u(n.error)}),null})}async function wD(e){await Vf(async t=>(await new Promise((a,n)=>{let r=t.transaction(Da,"readwrite");r.oncomplete=()=>a(),r.onerror=()=>n(r.error),r.onabort=()=>n(r.error),r.objectStore(Da).delete(e)}),null))}async function cx(e){return(await sx(e))[0]?.threadId??null}function xD(e){let t=e.trim();if(!t)return`Conversation on ${new Date().toISOString().slice(0,10)}`;let a=t.split(/\r?\n/,1)[0]??t;return a.length<=60?a:`${a.slice(0,60).trimEnd()}\u2026`}var ij="x-session-id",lj=250,sj=200;function vD(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Rs()}function Wf(){return new Date().toISOString()}function bD(e){if(typeof e!="string")return;let t=e.trim();return t.length>0?t:void 0}async function uj(e,t){let a=sl(e,"/tools"),n=await fetch(a,{method:"GET",headers:t?{...t}:void 0});if(!n.ok)throw new Error(`[Waniwani] Failed to fetch /tools: ${n.status} ${n.statusText}`);let r=await n.json();if(!r||!Array.isArray(r.tools))return{};let o={};for(let i of r.tools)i&&typeof i.name=="string"&&(o[i.name]=i);return o}function SD(e){let{api:t="/api/waniwani",headers:a,body:n,onMessageSent:r,onResponseReceived:o,enableThreadHistory:i=!1,activeThreadId:l,onThreadChange:s}=e,u=e.visitorId;(0,Q.useEffect)(()=>rd(u),[u]);let c=Tf(),d=(0,Q.useRef)(a),f=(0,Q.useRef)(n),p=(0,Q.useRef)(i);(0,Q.useEffect)(()=>{p.current=i},[i]);let m=(0,Q.useRef)(void 0),x=(0,Q.useRef)(null),[I,y]=(0,Q.useState)(void 0),w=(0,Q.useRef)(I),[g,b]=(0,Q.useState)(l),T=(0,Q.useRef)(g),[S,M]=(0,Q.useState)([]),[R,_]=(0,Q.useState)(!i),k=(0,Q.useRef)(void 0),G=(0,Q.useRef)(void 0),B=(0,Q.useRef)(void 0),U=(0,Q.useRef)(void 0),W=(0,Q.useRef)(0),A=(0,Q.useRef)(s);(0,Q.useEffect)(()=>{A.current=s},[s]);let H=(0,Q.useCallback)(O=>{T.current=O,b(O),O&&(A.current?.(O),c.emit({name:"thread.changed",sessionId:w.current,properties:{threadId:O}}))},[c]),$=(0,Q.useCallback)(async()=>{if(!i)return;let O=x.current?.memoryUserId;if(!O)return;let ee=await sx(O);M(ee)},[i]),We=(0,Q.useCallback)(()=>w.current,[]),$e=(0,Q.useCallback)(O=>{let ee=bD(O);if(!ee||w.current===ee)return;let ae=w.current===void 0;w.current=ee,y(ee),ae&&c.emit({name:"session.started",properties:{sessionId:ee}})},[c]),v=(0,Q.useCallback)(()=>{w.current=void 0,y(void 0)},[]);(0,Q.useEffect)(()=>{d.current=a},[a]),(0,Q.useEffect)(()=>{f.current=n},[n]),(0,Q.useEffect)(()=>{let O=!1,ee=W.current;return(async()=>{try{let ft=await ms();if(O)return;x.current=ft}catch{}if(!i)return;let ae=x.current?.memoryUserId;if(!ae){_(!0);return}try{let ft=l??await cx(ae);if(O||ee!==W.current)return;if(ft){let Ft=await Gf(ft);if(O||ee!==W.current)return;Ft&&Ft.memoryUserId===ae&&(T.current=Ft.threadId,b(Ft.threadId),k.current=Ft.createdAt,G.current=Ft.title,Ft.sessionId&&(w.current=Ft.sessionId,y(Ft.sessionId)),ue(Ft.messages))}await $()}finally{O||_(!0)}})(),()=>{O=!0}},[]);let De=(0,Q.useRef)(new Hf({api:t,headers:()=>({...d.current}),body:()=>{let O={...f.current??{}},ee=Object.hasOwn(O,"sessionId"),ae=bD(O.sessionId);if(ae)$e(ae),O.sessionId=ae;else if(ee)v(),delete O.sessionId;else{let np=We();np&&(O.sessionId=np)}tl(m.current)&&(O.modelContext=m.current);let ft=x.current,Ft=Kn();ft&&(O.visitorContext={timezone:ft.timezone,language:ft.language,languages:ft.languages,deviceType:ft.deviceType,referrer:ft.referrer,visitorId:Ft});let It=typeof O.visitor=="object"&&O.visitor!==null?O.visitor:{},FD=typeof It.client=="object"&&It.client!==null?It.client:{};O.visitor={...It,id:Ft,client:{...FD,...ft&&{memoryUserId:ft.memoryUserId}}};let yx=typeof O.extra=="object"&&O.extra!==null&&!Array.isArray(O.extra)?O.extra:void 0,wx=x.current?.memoryUserId,xx=x.current?.language,Su={};if(wx&&(Su.memoryUserId=wx),xx&&(Su.locale=xx),(Object.keys(Su).length>0||yx)&&(O.extra={...Su,...yx??{}}),p.current)if(Object.hasOwn(O,"threadId"))typeof O.threadId=="string"&&(T.current=O.threadId);else{let Iu=T.current;Iu||(Iu=vD(),k.current=Wf(),G.current=void 0,H(Iu)),O.threadId=Iu}return O},fetch:(async(O,ee)=>{let ae=await fetch(O,ee);return m.current=void 0,$e(ae.headers.get(ij)),ae})})),_e=(0,Q.useRef)(null),L=(0,Q.useRef)(null),ke=(0,Q.useRef)({}),[St,et]=(0,Q.useState)(0),Ut=e.skipRemoteConfig===!0,ve=(0,Q.useCallback)(async()=>{if(!Ut)try{let O=await uj(t,d.current);ke.current=O,et(ee=>ee+1)}catch(O){console.warn("[Waniwani] Failed to fetch tool definitions:",O instanceof Error?O.message:O)}},[t,Ut]);(0,Q.useEffect)(()=>{ve()},[ve]);let{messages:X,sendMessage:pe,setMessages:ue,status:oe}=hD({messages:e.initialMessages,transport:De.current,onFinish({message:O,isAbort:ee,isDisconnect:ae,isError:ft}){o?.(),!ee&&!ae&&!ft&&c.emit({name:"message.received"}),_e.current&&(L.current=O)},onError(O){console.warn("[Waniwani] Chat error:",O.message),c.emit({name:"chat.error",properties:{message:O.message.slice(0,sj)}}),_e.current&&(_e.current.reject(O),_e.current=null)}}),ye=(0,Q.useRef)(X);(0,Q.useEffect)(()=>{ye.current=X},[X]);let Xe=(0,Q.useRef)(i);(0,Q.useEffect)(()=>{if(!i||Xe.current||(Xe.current=!0,ye.current.length>0))return;let O=!1,ee=W.current;return _(!1),(async()=>{try{let ae=x.current;if(!ae)try{ae=await ms(),x.current=ae}catch{}let ft=ae?.memoryUserId;if(!ft||O||ee!==W.current){O||_(!0);return}let Ft=l??await cx(ft);if(O||ee!==W.current)return;if(Ft){let It=await Gf(Ft);if(O||ee!==W.current)return;It&&It.memoryUserId===ft&&(T.current=It.threadId,b(It.threadId),k.current=It.createdAt,G.current=It.title,It.sessionId&&(w.current=It.sessionId,y(It.sessionId)),ue(It.messages))}await $()}finally{O||_(!0)}})(),()=>{O=!0}},[i]),(0,Q.useEffect)(()=>{if(oe==="ready"&&_e.current&&L.current){let O=_e.current,ee=L.current;_e.current=null,L.current=null,O.resolve(ee)}},[oe]);let[dt,nt]=(0,Q.useState)(""),[Mt,K]=(0,Q.useState)([]),ce=oe==="submitted"||oe==="streaming",Ke=(0,Q.useCallback)(O=>{K(ee=>ee.filter(ae=>ae.id!==O))},[]),Na=ce&&Mt.length>0,fn=(0,Q.useCallback)(O=>{let ee=!!O.text?.trim(),ae=!!O.files?.length;if(ee||ae){if(ce){if(Mt.length>0)return;K(ft=>[...ft,{id:Rs(),text:O.text||"",files:O.files??[],modelContext:O.modelContext}]),nt("");return}m.current=O.modelContext,pe({text:O.text||"",files:O.files}),r?.(O.text||""),c.emit({name:"message.sent"}),nt("")}},[pe,r,ce,Mt.length,c]),sr=(0,Q.useCallback)(O=>new Promise((ee,ae)=>{_e.current={resolve:ee,reject:ae},pe({text:O}),r?.(O),c.emit({name:"message.sent"})}),[pe,r,c]);(0,Q.useEffect)(()=>{if(oe!=="ready"||Mt.length===0)return;let[O,...ee]=Mt;K(ee),m.current=O.modelContext,pe({text:O.text,files:O.files.length>0?O.files:void 0}),r?.(O.text),c.emit({name:"message.sent"})},[oe,pe,r,Mt,c]);let dl=(0,Q.useCallback)(()=>{ue([]),K([]),v(),nt(""),ke.current={},et(O=>O+1),ve()},[ue,v,ve]),Go=(0,Q.useCallback)(()=>{if(!p.current)return;let O=x.current?.memoryUserId,ee=T.current,ae=ye.current;if(!(!O||!ee||ae.length===0)){if(k.current||(k.current=Wf()),!G.current){let ft=ae.find(It=>It.role==="user"),Ft=ft?ft.parts.map(It=>"text"in It&&typeof It.text=="string"?It.text:"").join(" "):"";G.current=xD(Ft)}return{threadId:ee,memoryUserId:O,title:G.current,messages:ae,sessionId:w.current,createdAt:k.current,updatedAt:Wf()}}},[]),P=(0,Q.useCallback)(async()=>{let O=Go();O&&(await ux(O),await $())},[Go,$]);(0,Q.useEffect)(()=>{if(i&&R&&!(oe==="submitted"||oe==="streaming")&&X.length!==0)return B.current&&clearTimeout(B.current),B.current=setTimeout(()=>{B.current=void 0;let O=P().finally(()=>{U.current===O&&(U.current=void 0)});U.current=O},lj),()=>{B.current&&clearTimeout(B.current)}},[i,R,X,oe,P]);let q=(0,Q.useCallback)(()=>{let O=U.current,ee=B.current,ae=ee?Go():void 0;return ee&&(clearTimeout(ee),B.current=void 0),(async()=>{O&&await O,ae&&(await ux(ae),await $())})()},[Go,$]),le=(0,Q.useCallback)(()=>{W.current+=1,q(),ue([]),K([]),v(),nt("");let O=vD();return k.current=Wf(),G.current=void 0,H(O),$(),O},[ue,v,H,$,q]),he=(0,Q.useCallback)(async O=>{W.current+=1;let ee=W.current;if(await q(),ee!==W.current)return;let ae=await Gf(O);ee===W.current&&ae&&(ae.sessionId?(w.current=ae.sessionId,y(ae.sessionId)):v(),H(ae.threadId),k.current=ae.createdAt,G.current=ae.title,ue(ae.messages),K([]),nt(""))},[ue,v,H,q]),Fe=(0,Q.useCallback)(async O=>{if(T.current===O){W.current+=1,B.current&&(clearTimeout(B.current),B.current=void 0);let ee=U.current;ee&&await ee}await wD(O),await $(),T.current===O&&(ue([]),K([]),v(),nt(""),T.current=void 0,b(void 0),k.current=void 0,G.current=void 0)},[ue,v,$]);(0,Q.useEffect)(()=>{i&&R&&l!==void 0&&l!==T.current&&he(l)},[l,i,R,he]);let va=(0,Q.useCallback)(O=>{nt(O.target.value)},[]),pn=X[X.length-1],Ba=X.length>0,eo=ce&&(!Ba||pn.role==="user"),to=ke.current;return{messages:X,status:oe,text:dt,setText:nt,handleSubmit:fn,handleTextChange:va,isLoading:ce,showLoaderBubble:eo,lastMessage:pn,hasMessages:Ba,sendMessage:pe,sendMessageAndWait:sr,reset:dl,queuedMessages:Mt,queueFull:Na,removeQueuedMessage:Ke,sessionId:I,toolDefinitions:to,refreshToolDefinitions:ve,threads:S,activeThreadId:g,isThreadHistoryReady:R,startNewThread:le,switchThread:he,deleteThread:Fe}}var En=z(Le(),1);function cj(e){for(let t of e.parts){let a=t;if(a.type==="data"||a.type==="data-suggestions"){let n=a.data;if(n&&Array.isArray(n.suggestions))return n.suggestions}}return null}function ID(e){return typeof e=="object"&&e!==null&&"initial"in e}function CD(e){let{messages:t,status:a,config:n}=e,r=ID(n)&&n.initial?n.initial:void 0,[o,i]=(0,En.useState)(r??[]),l=(0,En.useRef)(a),s=n===!0||ID(n)&&n.dynamic!==!1,u=(0,En.useCallback)(()=>{i([])},[]),c=t.length>0;(0,En.useEffect)(()=>{!c&&r&&r.length>0&&i(r)},[r,c]);let d=t[t.length-1];return(0,En.useEffect)(()=>{d?.role==="user"&&u()},[d,u]),(0,En.useEffect)(()=>{let f=l.current;if(l.current=a,f==="streaming"&&a==="ready"&&s){let p=[...t].reverse().find(x=>x.role==="assistant");if(!p)return;let m=cj(p);m&&i(m)}},[a,s,t]),{suggestions:o,isLoading:!1,clear:u}}function kD(e,t){let a=t?.Authorization,n=typeof a=="string"&&a.startsWith("Bearer ")?a.slice(7):null;return sl(e,"/resource",n?{token:n}:void 0)}var dj={primaryColor:["--ww-primary","--ww-color-primary"],primaryForeground:["--ww-primary-fg","--ww-color-primary-foreground"],backgroundColor:["--ww-bg","--ww-color-background"],textColor:["--ww-text","--ww-color-foreground","--ww-color-accent-foreground"],mutedColor:["--ww-muted","--ww-color-muted-foreground"],borderColor:["--ww-border","--ww-color-border"],borderWidth:["--ww-border-width"],boxShadow:["--ww-shadow"],assistantBubbleColor:["--ww-assistant-bubble","--ww-color-accent"],userBubbleColor:["--ww-user-bubble"],inputBackgroundColor:["--ww-input-bg","--ww-color-input"],borderRadius:["--ww-radius"],messageBorderRadius:["--ww-msg-radius"],fontFamily:["--ww-font"],headerBackgroundColor:["--ww-header-bg"],headerTextColor:["--ww-header-text"],statusColor:["--ww-status"],toolCardColor:["--ww-tool-card","--ww-color-tool-card"],userBubbleTextColor:["--ww-user-bubble-text"],assistantBubbleTextColor:["--ww-assistant-bubble-text"],messagePaddingX:["--ww-msg-pad-x"],messagePaddingY:["--ww-msg-pad-y"],messageMaxWidth:["--ww-msg-max-width"],fontSize:["--ww-font-size"],lineHeight:["--ww-line-height"]};function $f(e){let t={};for(let[a,n]of Object.entries(dj)){let r=e[a];if(r===void 0)continue;let o=typeof r=="number"?`${r}px`:String(r);for(let i of n)t[i]=o}return t}var Ve=z(ne(),1),Xf=(0,Ge.forwardRef)(function(t,a){let{locale:n,messages:r}=t;return(0,Ve.jsx)(As,{locale:n,messages:r,children:(0,Ve.jsx)(fj,{...t,ref:a})})}),fj=(0,Ge.forwardRef)(function(t,a){let{t:n,ready:r}=Re(),{appearance:o,className:i,classNames:l,allowAttachments:s=!1,welcomeMessage:u,welcome:c,placeholder:d=n.promptInput.placeholder,triggerEvent:f="triggerDemoRequest",api:p,mcp:m,debug:x=!1,readOnly:I=!1,title:y,headerActions:w,hideHeader:g=!1,enableThreadHistory:b=!1,showToolCalls:T=!0,initializing:S=!1,disclaimer:M}=t,R=o?.theme,_=o?.variables,k=o?.assistantBubble??!1,G=_?$f(_):{},[B,U]=(0,Ge.useState)(!1);(0,Ge.useEffect)(()=>{if(R!=="auto"||typeof window>"u")return;let K=window.matchMedia("(prefers-color-scheme: dark)");U(K.matches);let ce=()=>U(K.matches);return K.addEventListener("change",ce),()=>K.removeEventListener("change",ce)},[R]);let W=R==="dark"||R==="auto"&&B,A=SD({...t,api:p}),H=Tf(),$=ER({...t,api:p,sessionId:A.sessionId,onCallTool:m?.onCallTool}),We=m?.resourceEndpoint??kD(p,t.headers),$e=dd(d,!A.text),[v,De]=(0,Ge.useState)(null),[_e,L]=(0,Ge.useState)(null),ke=(0,Ge.useRef)(null),St=(0,Ge.useRef)(null),et=(0,Ge.useRef)(null),Ut=(0,Ge.useRef)(null),[ve,X]=(0,Ge.useState)(!0),pe=(0,Ge.useRef)(ve);pe.current=ve;let ue=(0,Ge.useCallback)(()=>{let K=ke.current;if(!K)return;let ce=K.querySelector("textarea");ce&&ce.focus()},[]),oe=(0,Ge.useCallback)((K="smooth")=>{let ce=St.current;ce&&ce.scrollTo({top:ce.scrollHeight,behavior:K})},[]);(0,Ge.useEffect)(()=>{let K=Ut.current,ce=St.current;if(!K||!ce)return;let Ke=new IntersectionObserver(([Na])=>X(Na.isIntersecting),{root:ce,rootMargin:"0px 0px 200px 0px",threshold:0});return Ke.observe(K),()=>Ke.disconnect()},[]),(0,Ge.useEffect)(()=>{let K=St.current;if(!K)return;let ce=Ke=>{let fn=(Ke.target instanceof Element?Ke.target:null)?.closest("a");fn?.href&&H.emit({name:"link.clicked",properties:{url:fn.href}})};return K.addEventListener("click",ce),()=>K.removeEventListener("click",ce)},[H]),(0,Ge.useEffect)(()=>{(A.messages[A.messages.length-1]?.role==="user"||pe.current)&&oe("smooth")},[A.messages.length,A.messages[A.messages.length-1]]),(0,Ge.useEffect)(()=>{oe("auto")},[oe]),(0,Ge.useEffect)(()=>{if(typeof ResizeObserver>"u")return;let K=St.current,ce=et.current;if(!K&&!ce)return;let Ke=K?.scrollHeight??0,Na=K?.clientHeight??0,fn=new ResizeObserver(()=>{let sr=St.current;if(!sr)return;let dl=sr.scrollTop+Na>=Ke-5;Ke=sr.scrollHeight,Na=sr.clientHeight,dl&&oe("auto")});return K&&fn.observe(K),ce&&fn.observe(ce),()=>fn.disconnect()},[oe]);let ye=CD({messages:A.messages,status:A.status,config:t.suggestions}),Xe=(0,Ge.useCallback)(K=>{let ce=K.content.map(Ke=>Ke.text??"").join("").trim();ce&&A.handleSubmit({text:ce,files:[],modelContext:K.modelContext})},[A.handleSubmit]),dt=(0,Ge.useCallback)(K=>{let ce=ye.suggestions.indexOf(K),Ke=ce>=0?ce:c?.suggestions?.indexOf(K)??-1;H.emit({name:"suggestion.clicked",properties:{text:K,index:Ke}}),ye.clear(),A.handleSubmit({text:K,files:[]})},[ye.suggestions,ye.clear,A.handleSubmit,c,H]);(0,Ge.useImperativeHandle)(a,()=>({sendMessage:K=>{A.handleSubmit({text:K,files:[]}),ue()},sendMessageAndWait:K=>A.sendMessageAndWait(K),reset:A.reset,focus:ue,get messages(){return A.messages},get sessionId(){return A.sessionId}}),[A.handleSubmit,A.sendMessageAndWait,A.reset,A.messages,A.sessionId,ue]),(0,Ge.useEffect)(()=>{if(!f)return;let K=ce=>{let Ke=ce.detail,Na=typeof Ke?.message=="string"?Ke.message:void 0;Na&&A.handleSubmit({text:Na,files:[]}),ue()};return window.addEventListener(f,K),()=>window.removeEventListener(f,K)},[f,A.handleSubmit,ue]);let nt=!g&&!!(y||b||w),Mt=S||!r;return(0,Ve.jsxs)("div",{ref:ke,style:{...G,maxHeight:"inherit",...v&&_e?{height:_e}:{},opacity:Mt?0:1,transition:"opacity 220ms ease-out"},"data-waniwani-chat":"","data-waniwani-layout":"embed","data-assistant-bubble":k?"true":void 0,"data-color-scheme":R==="auto"?"auto":void 0,...Mt?{"data-waniwani-initializing":""}:{},...W?{"data-waniwani-dark":""}:{},className:j("ww:relative ww:w-full ww:h-full ww:flex ww:flex-col ww:bg-background ww:text-foreground ww:font-[family-name:var(--ww-font)] ww:overflow-hidden",R==="dark"&&"dark",i,l?.root),children:[nt&&(0,Ve.jsxs)("div",{className:j("ww-header ww:shrink-0 ww:flex ww:items-center ww:gap-2 ww:pl-4 ww:pr-3 ww:py-3 ww:border-b ww:border-border",l?.header),style:{backgroundColor:"var(--ww-color-card-header)",color:"var(--ww-color-card-header-foreground)"},children:[y&&(0,Ve.jsx)("div",{className:"ww:text-sm ww:font-semibold ww:truncate ww:flex-1 ww:min-w-0",children:y}),!y&&(0,Ve.jsx)("div",{className:"ww:flex-1"}),b&&(0,Ve.jsx)(kR,{threads:A.threads,activeThreadId:A.activeThreadId,onNewThread:A.startNewThread,onSelectThread:K=>{A.switchThread(K)},onDeleteThread:K=>{A.deleteThread(K)}}),w]}),(0,Ve.jsxs)("div",{ref:St,className:j("ww:relative ww:flex-1 ww:min-h-0",v?"ww:overflow-hidden":"ww:overflow-y-auto"),children:[(0,Ve.jsxs)("div",{ref:et,className:j("ww:mx-auto ww:w-full ww:max-w-3xl ww:px-4 ww:py-6 ww:flex ww:flex-col ww:gap-6",v&&"ww:!py-0"),children:[(0,Ve.jsx)(SR,{messages:A.messages,status:A.status,welcomeMessage:u,welcome:c,onSuggestionSelect:dt,resourceEndpoint:We,chatSessionId:A.sessionId,isDark:W,onFollowUp:Xe,onCallTool:$,fullscreenToolCallId:v,debug:x,showToolCalls:T,toolDefinitions:A.toolDefinitions,messageClassNames:{message:l?.message,userBubble:l?.userBubble,assistantBubble:l?.assistantBubble},onWidgetDisplayModeChange:(K,ce)=>{if(K==="fullscreen"){let Ke=ke.current?.getBoundingClientRect().height??0;L(Ke>0?Ke:null),De(ce.toolCallId)}else L(null),De(null)}}),(0,Ve.jsx)("div",{ref:Ut,"aria-hidden":!0,style:{height:1}})]}),!ve&&!v&&(0,Ve.jsx)("div",{className:"ww:sticky ww:bottom-2 ww:flex ww:justify-center ww:pointer-events-none",children:(0,Ve.jsx)(bn,{type:"button",onClick:()=>oe("smooth"),size:"icon",variant:"outline",className:"ww:rounded-full ww:shadow ww:pointer-events-auto","aria-label":"Scroll to latest",children:(0,Ve.jsx)(ys,{className:"ww:size-4"})})})]}),!I&&(0,Ve.jsxs)("div",{className:"ww:shrink-0 ww:bg-background",style:v?{display:"none"}:void 0,children:[(0,Ve.jsx)(cd,{suggestions:ye.suggestions,isLoading:ye.isLoading,onSelect:dt}),(0,Ve.jsx)(sC,{queuedMessages:A.queuedMessages,onRemove:A.removeQueuedMessage}),(0,Ve.jsx)("div",{className:"ww:px-4 ww:pb-2 ww:pt-2",children:(0,Ve.jsxs)("div",{className:"ww:mx-auto ww:w-full ww:max-w-3xl",children:[(0,Ve.jsx)(KI,{onSubmit:A.handleSubmit,globalDrop:s,multiple:s,className:j("ww-input ww:rounded-2xl ww:border-border ww:bg-input",l?.input),children:(0,Ve.jsxs)("div",{className:"ww:flex ww:items-center ww:gap-1 ww:pl-4 ww:pr-3 ww:py-2.5",children:[s&&(0,Ve.jsx)(YI,{}),(0,Ve.jsx)(ZI,{onChange:A.handleTextChange,value:A.text,placeholder:$e,className:"ww:min-h-0 ww:py-1 ww:px-0"}),(0,Ve.jsx)(QI,{status:A.status,disabled:A.queueFull})]})}),(0,Ve.jsxs)("div",{className:"ww:pt-2 ww:pb-1 ww:flex ww:flex-nowrap ww:justify-center ww:items-center ww:gap-1.5",children:[(0,Ve.jsx)(IR,{}),(0,Ve.jsx)(JI,{text:M})]})]})})]})]})});var vu=z(Le(),1);function pj(){if(typeof window>"u")return!1;try{return window.WANIWANI_DEBUG?!0:!!window.localStorage?.getItem("WANIWANI_DEBUG")}catch{return!1}}function ul(...e){pj()&&console.log("[Waniwani]",...e)}var mj="waniwani:config:";function LD(e,t,a){return`${mj}${e}|${t}|${a??""}`}function Kf(e,t,a){if(typeof window>"u")return null;try{let n=window.sessionStorage.getItem(LD(e,t,a));if(!n)return null;let r=JSON.parse(n);return r&&typeof r=="object"?r:null}catch{return null}}function hj(e,t,a,n){if(!(typeof window>"u"))try{window.sessionStorage.setItem(LD(e,t,a),JSON.stringify(n))}catch{}}var gj=600;async function yj(e,t,a,n){try{let r=sl(e,"/config",n?{channel:n}:void 0),o=await fetch(r,{method:"GET",headers:{Authorization:`Bearer ${t}`},signal:a});if(!o.ok)return{};let i=await o.json(),l=i&&typeof i=="object"&&"data"in i&&i.data?i.data:i;return l?wj(l):{}}catch{return{}}}function wj(e){let t={};return e.source!=null&&(t.source=e.source),e.title!=null&&(t.title=e.title),e.welcomeMessage!=null&&(t.welcomeMessage=e.welcomeMessage),e.placeholder!=null&&(t.placeholder=e.placeholder),e.suggestions!=null&&e.suggestions.length>0&&(t.suggestions=e.suggestions),typeof e.enableThreadHistory=="boolean"&&(t.enableThreadHistory=e.enableThreadHistory),e.toolCallDisplay==="full"?t.showToolCalls=!0:e.toolCallDisplay==="titles-only"?t.showToolCalls="titles-only":e.toolCallDisplay==="hidden"&&(t.showToolCalls=!1),e.visibility&&(t.visibility=e.visibility),t}function Zf(e,t,a){let[n,r]=(0,vu.useState)(e),[o,i]=(0,vu.useState)(!1);return(0,vu.useEffect)(()=>{let l=e.api,s=e.token,u=e.channelId;if(!l||!s){i(!0);return}let c=m=>{e.disablePageView||LI({api:l,token:s,channelId:u,mode:e.mode,source:m})},d=Kf(l,s,u);if(d)try{let m=hs(t,d,a);r(m),i(!0),ul("config resolved (sessionStorage cache)",{config:m,visibility:m.visibility}),c(d.source)}catch{}let f=new AbortController,p=setTimeout(()=>i(!0),gj);return yj(l,s,f.signal,u).then(m=>{if(!f.signal.aborted){if(ul("remote /config response",m),Object.keys(m).length>0){hj(l,s,u,m);try{let x=hs(t,m,a);r(x),ul("config resolved (remote)",{config:x,visibility:x.visibility})}catch(x){console.error("[Waniwani] Failed to apply remote config:",x)}}i(!0),c(m.source)}}).catch(m=>{console.error("[Waniwani] Remote config fetch failed:",m),i(!0)}).finally(()=>clearTimeout(p)),()=>{f.abort(),clearTimeout(p)}},[e.api,e.token,e.channelId]),{config:n,ready:o}}var Yf=z(Le(),1);function xj(e){return e?.patterns??e?.rules??[]}var TD="\0\0";function vj(e){let a=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\\\*\\\*/g,TD).replace(/\\\*/g,"[^/]*").split(TD).join(".*");return new RegExp(`^${a}$`)}function ED(e,t){try{return vj(e).test(t)}catch{return!1}}function Qf(e,t){if(!e)return!0;let a=!1;for(let n of xj(e))if(ED(n.glob,t)){if(n.action==="hide")return!1;a=!0}return a?!0:(e.default??"show")!=="hide"}function MD(e,t){for(let a of e?.appearRules??[])if(ED(a.glob,t))return a.appearAfter;return null}var dx="waniwani:locationchange",AD=!1;function bj(){if(!(AD||typeof history>"u")){AD=!0;for(let e of["pushState","replaceState"]){let t=history[e];history[e]=function(...n){let r=t.apply(this,n);return window.dispatchEvent(new Event(dx)),r}}}}function Sj(e){return bj(),window.addEventListener(dx,e),window.addEventListener("popstate",e),()=>{window.removeEventListener(dx,e),window.removeEventListener("popstate",e)}}function Ij(){return window.location.pathname}function Cj(){return"/"}function fx(){return(0,Yf.useSyncExternalStore)(Sj,Ij,Cj)}function Jf(e,t){let a=fx(),n=t&&Qf(e,a);return(0,Yf.useEffect)(()=>{ul("visibility gate",{pathname:a,ready:t,visible:n,rules:e})},[a,t,n]),n}var ep=z(Le(),1),kj=3e3,Lj=120,Tj=24;function RD(e){let[t,a]=(0,ep.useState)(!1);return(0,ep.useEffect)(()=>{if(!e||typeof document>"u"){a(!1);return}let n=!1,r=null,o=null,i=null,l=u=>{r=new IntersectionObserver(c=>{let d=c[0];d&&a(!d.isIntersecting&&d.boundingClientRect.bottom<=0)},{rootMargin:`0px 0px -${Tj}px 0px`,threshold:0}),r.observe(u)},s=()=>{if(n)return;let u=null;try{u=document.querySelector(e)}catch{a(!0);return}if(u){l(u);return}o=setTimeout(s,Lj)};return s(),i=setTimeout(()=>{n||r||(o&&clearTimeout(o),a(!0))},kj),()=>{n=!0,r?.disconnect(),o&&clearTimeout(o),i&&clearTimeout(i)}},[e]),t}var ct=z(ne(),1),Ej=2e3,Mj=90,Aj=1e3,DD=(0,Me.forwardRef)(function(t,a){return(0,ct.jsx)(As,{locale:t.config.locale,children:(0,ct.jsx)(Rj,{...t,ref:a})})}),Rj=(0,Me.forwardRef)(function({config:t,programmatic:a,scriptConfig:n},r){let{t:o}=Re(),{config:i,ready:l}=Zf(t,a,n),s=Jf(i.visibility,l),u=fx(),c=s?MD(i.visibility,u):null,d=RD(c),f=(0,Me.useRef)(null),p=(0,Me.useMemo)(()=>kf({mode:"floating",getSessionId:()=>f.current?.sessionId}),[]),m=i.onEvent;(0,Me.useEffect)(()=>{if(m)return p.subscribe(m)},[m,p]);let x=(0,Me.useRef)(null),I=(0,Me.useRef)(null),y=(0,Me.useRef)(!1),[w,g]=(0,Me.useState)("input"),[b,T]=(0,Me.useState)(""),[S,M]=(0,Me.useState)(!1),[R,_]=(0,Me.useState)(!1),[k,G]=(0,Me.useState)(0),B=i.appearance?.theme,U=i.appearance?.variables,W=(0,Me.useMemo)(()=>U?$f(U):{},[U]),A=i.suggestions??[],H=i.launcherText??i.placeholder??o.launcher.prompt,$=dd(H,b.length===0),We="var(--ww-shadow, 0 10px 30px rgba(0, 0, 0, 0.08))";(0,Me.useEffect)(()=>{if(!s){M(!1);return}if(c){M(d);return}let X=i.appearDelay??Ej,pe=setTimeout(()=>M(!0),Math.max(0,X));return()=>clearTimeout(pe)},[s,i.appearDelay,c,d]),(0,Me.useEffect)(()=>{if(!S||A.length===0)return;let X=setTimeout(()=>{y.current||g(pe=>pe==="input"?"expanded":pe)},Aj);return()=>clearTimeout(X)},[S,A.length]),(0,Me.useEffect)(()=>{k>0&&w==="open"&&f.current?.focus()},[k,w]);let $e=(0,Me.useRef)(!1);(0,Me.useEffect)(()=>{l&&!$e.current&&($e.current=!0,p.emit({name:"chat.ready"}))},[l,p]);let v=(0,Me.useRef)(!1);(0,Me.useEffect)(()=>{let X=s&&w==="open";X!==v.current&&(v.current=X,p.emit({name:X?"chat.opened":"chat.closed"}))},[s,w,p]);let De=(0,Me.useCallback)(()=>{g("open")},[]),_e=(0,Me.useCallback)(()=>{y.current=!0,g("input")},[]);(0,Me.useEffect)(()=>{if(w!=="expanded"){_(!1);return}let X=setTimeout(()=>_(!0),Mj);return()=>clearTimeout(X)},[w]);let L=(0,Me.useCallback)(X=>{De();let pe=X.trim();pe&&f.current?.sendMessage(pe)},[De]);(0,Me.useImperativeHandle)(r,()=>({open:()=>De(),close:()=>_e(),toggle:()=>{g(X=>X==="open"?"input":"open")},sendMessage:X=>L(X),sendMessageAndWait:async X=>{De();let pe=f.current;if(pe)return await pe.sendMessageAndWait(X)},reset:()=>f.current?.reset(),focus:()=>{De(),G(X=>X+1)},getMessages:()=>f.current?.messages??[],getSessionId:()=>f.current?.sessionId}),[L,De,_e]);let ke=(0,Me.useCallback)(()=>{b.trim()&&(L(b),T(""))},[b,L]),St=(0,Me.useCallback)(()=>{(f.current?.messages.length??0)>0?(g("open"),G(X=>X+1)):(y.current=!1,g(X=>X==="input"?"expanded":X))},[]),et={mode:"floating"};i.mcpServerUrl&&(et.mcpServerUrl=i.mcpServerUrl),i.channelId&&(et.channelId=i.channelId);let Ut=A.length>0&&w!=="input",ve=(0,ct.jsx)("button",{type:"button",onClick:_e,"aria-label":o.launcher.close,className:"ww:flex ww:size-7 ww:items-center ww:justify-center ww:rounded-md ww:text-muted-foreground ww:transition-colors hover:ww:bg-accent hover:ww:text-foreground ww:cursor-pointer",children:(0,ct.jsx)(Cs,{className:"ww:size-4"})});return(0,ct.jsx)(Ef,{value:p,children:(0,ct.jsx)("div",{"data-waniwani-chat":"","data-color-scheme":B==="auto"?"auto":void 0,className:j("ww:contents ww:font-[family-name:var(--ww-font-sans)]",B==="dark"&&"dark"),style:W,children:s&&(0,ct.jsxs)(ct.Fragment,{children:[(0,ct.jsx)("div",{ref:I,"data-waniwani-floating":"dock","data-state":w==="open"?"hidden":"shown","data-appeared":S?"true":"false",className:j("ww:fixed ww:bottom-3 ww:sm:bottom-4 ww:left-0 ww:right-0 ww:mx-auto ww:z-[2147483002] ww:flex ww:flex-col","ww:w-[calc(100vw-2rem)] ww:transition-[max-width] ww:duration-300 ww:ease-out",Ut?"ww:max-w-[720px]":"ww:max-w-[440px]"),children:(0,ct.jsxs)("div",{className:j("ww:relative ww:flex ww:flex-col ww:rounded-[20px] ww:border ww:transition-all ww:duration-300 ww:ease-out",Ut?"ww:p-2 ww:backdrop-blur-xl ww:backdrop-saturate-150":"ww:border-transparent ww:p-0"),style:Ut?{boxShadow:We,backgroundColor:"var(--ww-glass)",borderColor:"var(--ww-glass-border)"}:void 0,children:[Ut&&w!=="open"&&(0,ct.jsx)("button",{type:"button",onClick:_e,"aria-label":o.launcher.close,className:"ww:absolute ww:right-2 ww:top-2 ww:z-10 ww:flex ww:size-7 ww:items-center ww:justify-center ww:rounded-md ww:text-muted-foreground ww:transition-colors hover:ww:bg-accent hover:ww:text-foreground ww:cursor-pointer",children:(0,ct.jsx)(Qn,{className:"ww:size-4"})}),A.length>0&&(0,ct.jsx)("div",{className:j("ww:grid ww:transition-all ww:duration-300 ww:ease-out",R?"ww:grid-rows-[1fr] ww:opacity-100":"ww:pointer-events-none ww:grid-rows-[0fr] ww:opacity-0"),children:(0,ct.jsx)("div",{className:"ww:overflow-hidden",children:(0,ct.jsx)(cd,{suggestions:A,onSelect:X=>{p.emit({name:"suggestion.clicked",properties:{text:X,index:A.indexOf(X)}}),L(X)},className:"ww:pl-1 ww:pr-9 ww:pt-1 ww:pb-2.5"})})}),(0,ct.jsx)(BI,{animated:S,backgroundColor:"var(--ww-color-input)",borderRadius:16,edgeSensitivity:30,coneSpread:25,colors:["#c084fc","#f472b6","#38bdf8"],className:"ww:border-border",style:{boxShadow:We},children:(0,ct.jsxs)("div",{className:"ww:flex ww:items-center ww:gap-1 ww:pl-3.5 ww:pr-1.5 ww:py-1.5 ww:sm:pl-4 ww:sm:pr-2 ww:sm:py-2",children:[(0,ct.jsx)("input",{ref:x,type:"text",value:b,placeholder:$,onChange:X=>T(X.target.value),onFocus:St,onKeyDown:X=>{X.key==="Enter"&&!X.shiftKey&&(X.preventDefault(),ke())},className:"ww:min-w-0 ww:flex-1 ww:bg-transparent ww:py-1 ww:text-base ww:sm:text-sm ww:text-foreground ww:outline-none ww:placeholder:text-muted-foreground"}),(0,ct.jsx)("button",{type:"button",onClick:ke,disabled:!b.trim(),"aria-label":o.promptInput.submit,className:"ww:relative ww:flex ww:size-8 ww:shrink-0 ww:items-center ww:justify-center ww:rounded-full ww:bg-foreground ww:text-background ww:transition-opacity hover:ww:opacity-90 disabled:ww:opacity-40",children:(0,ct.jsx)(Io,{className:"ww:size-4"})})]})})]})}),(0,ct.jsx)("div",{role:"dialog","aria-label":i.title??H,"data-waniwani-floating":"panel","data-state":w==="open"?"shown":"hidden",style:{boxShadow:We},className:j("ww:fixed ww:z-[2147483002] ww:flex ww:flex-col ww:overflow-hidden ww:bg-background","ww:inset-0 ww:w-full ww:rounded-none","ww:sm:inset-auto ww:sm:bottom-4 ww:sm:left-0 ww:sm:right-0 ww:sm:mx-auto ww:sm:h-[720px] ww:sm:max-h-[calc(100dvh-2rem)] ww:sm:w-[calc(100vw-2rem)] ww:sm:max-w-[1000px] ww:sm:rounded-2xl ww:sm:border ww:sm:border-border"),children:(0,ct.jsx)(Xf,{ref:f,api:i.api??"",headers:{Authorization:`Bearer ${i.token}`},skipRemoteConfig:!0,body:et,appearance:i.appearance,title:i.title,headerActions:ve,hideHeader:!1,welcomeMessage:i.welcomeMessage,placeholder:i.placeholder,suggestions:i.suggestions?{initial:i.suggestions}:void 0,enableThreadHistory:i.enableThreadHistory,showToolCalls:i.showToolCalls,locale:i.locale,initializing:!l})})]})})})});var xa=z(Le(),1);var px=z(ne(),1),_D=(0,xa.forwardRef)(function({config:t,programmatic:a,scriptConfig:n,onReady:r,onVisibilityChange:o},i){let{config:l,ready:s}=Zf(t,a,n),u=(0,xa.useRef)(null),c=(0,xa.useMemo)(()=>kf({mode:"inline",getSessionId:()=>u.current?.sessionId}),[]),d=l.onEvent;(0,xa.useEffect)(()=>{if(d)return c.subscribe(d)},[d,c]);let f=(0,xa.useRef)(!1);(0,xa.useEffect)(()=>{s&&!f.current&&(f.current=!0,c.emit({name:"chat.ready"}))},[s,c]),(0,xa.useEffect)(()=>{r?.()},[]);let p=Jf(l.visibility,s);(0,xa.useEffect)(()=>{o?.(p)},[p,o]),(0,xa.useImperativeHandle)(i,()=>({get chat(){return u.current}}),[]);let m={mode:"inline"};return l.mcpServerUrl&&(m.mcpServerUrl=l.mcpServerUrl),l.channelId&&(m.channelId=l.channelId),(0,px.jsx)(Ef,{value:c,children:(0,px.jsx)(Xf,{ref:u,api:l.api??"",headers:{Authorization:`Bearer ${l.token}`},skipRemoteConfig:!0,body:m,appearance:l.appearance,title:l.title,hideHeader:l.hideHeader,welcomeMessage:l.welcomeMessage,placeholder:l.placeholder,suggestions:l.suggestions?{initial:l.suggestions}:void 0,enableThreadHistory:l.enableThreadHistory,showToolCalls:l.showToolCalls,locale:l.locale,initializing:!s})})});var mx="/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */\n@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root,:host{--ww-font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace;--ww-color-blue-400:oklch(70.7% .165 254.624);--ww-spacing:.25rem;--ww-container-sm:24rem;--ww-container-md:28rem;--ww-container-3xl:48rem;--ww-text-xs:.75rem;--ww-text-xs--line-height:calc(1/.75);--ww-text-sm:.875rem;--ww-text-sm--line-height:calc(1.25/.875);--ww-text-base:1rem;--ww-text-base--line-height:calc(1.5/1);--ww-text-lg:1.125rem;--ww-text-lg--line-height:calc(1.75/1.125);--ww-font-weight-medium:500;--ww-font-weight-semibold:600;--ww-tracking-wide:.025em;--ww-tracking-wider:.05em;--ww-radius-md:.375rem;--ww-radius-lg:.5rem;--ww-radius-xl:.75rem;--ww-radius-2xl:1rem;--ww-ease-out:cubic-bezier(0,0,.2,1);--ww-animate-spin:spin 1s linear infinite;--ww-animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--ww-blur-xl:24px;--ww-default-transition-duration:.15s;--ww-default-transition-timing-function:cubic-bezier(.4,0,.2,1);--ww-default-font-family:var(--ww-font-sans,system-ui,-apple-system,\"Segoe UI\",sans-serif);--ww-default-mono-font-family:var(--ww-font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--ww-default-font-family,ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\");font-feature-settings:var(--ww-default-font-feature-settings,normal);font-variation-settings:var(--ww-default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--ww-default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace);font-feature-settings:var(--ww-default-mono-font-feature-settings,normal);font-variation-settings:var(--ww-default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.ww\\:pointer-events-auto{pointer-events:auto}.ww\\:pointer-events-none{pointer-events:none}.ww\\:\\!relative{position:relative!important}.ww\\:absolute{position:absolute}.ww\\:fixed{position:fixed}.ww\\:relative{position:relative}.ww\\:sticky{position:sticky}.ww\\:inset-0{inset:calc(var(--ww-spacing)*0)}.ww\\:top-2{top:calc(var(--ww-spacing)*2)}.ww\\:top-full{top:100%}.ww\\:right-0{right:calc(var(--ww-spacing)*0)}.ww\\:right-2{right:calc(var(--ww-spacing)*2)}.ww\\:bottom-2{bottom:calc(var(--ww-spacing)*2)}.ww\\:bottom-3{bottom:calc(var(--ww-spacing)*3)}.ww\\:bottom-4{bottom:calc(var(--ww-spacing)*4)}.ww\\:left-0{left:calc(var(--ww-spacing)*0)}.ww\\:left-\\[50\\%\\]{left:50%}.ww\\:isolate{isolation:isolate}.ww\\:-z-\\[1\\]{z-index:calc(1*-1)}.ww\\:z-10{z-index:10}.ww\\:z-50{z-index:50}.ww\\:z-\\[1\\]{z-index:1}.ww\\:z-\\[2147483002\\]{z-index:2147483002}.ww\\:mx-auto{margin-inline:auto}.ww\\:mt-0\\.5{margin-top:calc(var(--ww-spacing)*.5)}.ww\\:mt-1{margin-top:calc(var(--ww-spacing)*1)}.ww\\:mt-2{margin-top:calc(var(--ww-spacing)*2)}.ww\\:mt-6{margin-top:calc(var(--ww-spacing)*6)}.ww\\:mb-0{margin-bottom:calc(var(--ww-spacing)*0)}.ww\\:mb-4{margin-bottom:calc(var(--ww-spacing)*4)}.ww\\:mb-6{margin-bottom:calc(var(--ww-spacing)*6)}.ww\\:ml-auto{margin-left:auto}.ww\\:line-clamp-1{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.ww\\:contents{display:contents}.ww\\:flex{display:flex}.ww\\:grid{display:grid}.ww\\:hidden{display:none}.ww\\:inline-block{display:inline-block}.ww\\:inline-flex{display:inline-flex}.ww\\:field-sizing-content{field-sizing:content}.ww\\:size-2{width:calc(var(--ww-spacing)*2);height:calc(var(--ww-spacing)*2)}.ww\\:size-3{width:calc(var(--ww-spacing)*3);height:calc(var(--ww-spacing)*3)}.ww\\:size-3\\.5{width:calc(var(--ww-spacing)*3.5);height:calc(var(--ww-spacing)*3.5)}.ww\\:size-4{width:calc(var(--ww-spacing)*4);height:calc(var(--ww-spacing)*4)}.ww\\:size-5{width:calc(var(--ww-spacing)*5);height:calc(var(--ww-spacing)*5)}.ww\\:size-7{width:calc(var(--ww-spacing)*7);height:calc(var(--ww-spacing)*7)}.ww\\:size-8{width:calc(var(--ww-spacing)*8);height:calc(var(--ww-spacing)*8)}.ww\\:size-9{width:calc(var(--ww-spacing)*9);height:calc(var(--ww-spacing)*9)}.ww\\:size-12{width:calc(var(--ww-spacing)*12);height:calc(var(--ww-spacing)*12)}.ww\\:size-auto{width:auto;height:auto}.ww\\:size-full{width:100%;height:100%}.ww\\:h-2\\.5{height:calc(var(--ww-spacing)*2.5)}.ww\\:h-5{height:calc(var(--ww-spacing)*5)}.ww\\:h-8{height:calc(var(--ww-spacing)*8)}.ww\\:h-9{height:calc(var(--ww-spacing)*9)}.ww\\:h-16{height:calc(var(--ww-spacing)*16)}.ww\\:h-auto{height:auto}.ww\\:h-full{height:100%}.ww\\:max-h-48{max-height:calc(var(--ww-spacing)*48)}.ww\\:max-h-80{max-height:calc(var(--ww-spacing)*80)}.ww\\:min-h-0{min-height:calc(var(--ww-spacing)*0)}.ww\\:min-h-5{min-height:calc(var(--ww-spacing)*5)}.ww\\:min-h-full{min-height:100%}.ww\\:w-72{width:calc(var(--ww-spacing)*72)}.ww\\:w-\\[calc\\(100vw-2rem\\)\\]{width:calc(100vw - 2rem)}.ww\\:w-auto{width:auto}.ww\\:w-fit{width:fit-content}.ww\\:w-full{width:100%}.ww\\:w-px{width:1px}.ww\\:\\[max-width\\:var\\(--ww-msg-max-width\\,80\\%\\)\\]{max-width:var(--ww-msg-max-width,80%)}.ww\\:max-w-3xl{max-width:var(--ww-container-3xl)}.ww\\:max-w-24{max-width:calc(var(--ww-spacing)*24)}.ww\\:max-w-32{max-width:calc(var(--ww-spacing)*32)}.ww\\:max-w-\\[440px\\]{max-width:440px}.ww\\:max-w-\\[720px\\]{max-width:720px}.ww\\:max-w-full{max-width:100%}.ww\\:max-w-md{max-width:var(--ww-container-md)}.ww\\:max-w-sm{max-width:var(--ww-container-sm)}.ww\\:min-w-0{min-width:calc(var(--ww-spacing)*0)}.ww\\:flex-1{flex:1}.ww\\:shrink-0{flex-shrink:0}.ww\\:grow{flex-grow:1}.ww\\:translate-x-\\[-50\\%\\]{--tw-translate-x:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.ww\\:rotate-90{rotate:90deg}.ww\\:rotate-180{rotate:180deg}.ww\\:animate-\\[ww-fade-in_0\\.2s_ease-out_both\\]{animation:.2s ease-out both ww-fade-in}.ww\\:animate-pulse{animation:var(--ww-animate-pulse)}.ww\\:animate-spin{animation:var(--ww-animate-spin)}.ww\\:cursor-pointer{cursor:pointer}.ww\\:resize-none{resize:none}.ww\\:grid-rows-\\[0fr\\]{grid-template-rows:0fr}.ww\\:grid-rows-\\[1fr\\]{grid-template-rows:1fr}.ww\\:flex-col{flex-direction:column}.ww\\:flex-nowrap{flex-wrap:nowrap}.ww\\:flex-wrap{flex-wrap:wrap}.ww\\:items-center{align-items:center}.ww\\:items-end{align-items:flex-end}.ww\\:items-start{align-items:flex-start}.ww\\:justify-between{justify-content:space-between}.ww\\:justify-center{justify-content:center}.ww\\:gap-1{gap:calc(var(--ww-spacing)*1)}.ww\\:gap-1\\.5{gap:calc(var(--ww-spacing)*1.5)}.ww\\:gap-2{gap:calc(var(--ww-spacing)*2)}.ww\\:gap-3{gap:calc(var(--ww-spacing)*3)}.ww\\:gap-6{gap:calc(var(--ww-spacing)*6)}:where(.ww\\:space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--ww-spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--ww-spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.ww\\:space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--ww-spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--ww-spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}.ww\\:self-stretch{align-self:stretch}.ww\\:truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.ww\\:\\!overflow-hidden{overflow:hidden!important}.ww\\:overflow-auto{overflow:auto}.ww\\:overflow-hidden{overflow:hidden}.ww\\:overflow-x-auto{overflow-x:auto}.ww\\:overflow-y-auto{overflow-y:auto}.ww\\:overflow-y-hidden{overflow-y:hidden}.ww\\:\\!rounded-full{border-radius:3.40282e38px!important}.ww\\:rounded{border-radius:var(--ww-radius,16px)}.ww\\:rounded-2xl{border-radius:var(--ww-radius-2xl)}.ww\\:rounded-\\[20px\\]{border-radius:20px}.ww\\:rounded-\\[inherit\\]{border-radius:inherit}.ww\\:rounded-\\[var\\(--ww-radius\\)\\]{border-radius:var(--ww-radius)}.ww\\:rounded-full{border-radius:3.40282e38px}.ww\\:rounded-lg{border-radius:var(--ww-radius-lg)}.ww\\:rounded-md{border-radius:var(--ww-radius-md)}.ww\\:rounded-none{border-radius:0}.ww\\:rounded-xl{border-radius:var(--ww-radius-xl)}.ww\\:border{border-style:var(--tw-border-style);border-width:1px}.ww\\:border-0{border-style:var(--tw-border-style);border-width:0}.ww\\:border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.ww\\:border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.ww\\:border-border{border-color:var(--ww-color-border,#e5e7eb)}.ww\\:border-muted-foreground\\/50{border-color:var(--ww-color-muted-foreground,#6b7280)}@supports (color:color-mix(in lab, red, red)){.ww\\:border-muted-foreground\\/50{border-color:color-mix(in oklab,var(--ww-color-muted-foreground,#6b7280)50%,transparent)}}.ww\\:border-transparent{border-color:#0000}.ww\\:bg-accent{background-color:var(--ww-color-accent,#f3f4f6)}.ww\\:bg-background,.ww\\:bg-background\\/20{background-color:var(--ww-color-background,#fff)}@supports (color:color-mix(in lab, red, red)){.ww\\:bg-background\\/20{background-color:color-mix(in oklab,var(--ww-color-background,#fff)20%,transparent)}}.ww\\:bg-border{background-color:var(--ww-color-border,#e5e7eb)}.ww\\:bg-foreground,.ww\\:bg-foreground\\/5{background-color:var(--ww-color-foreground,#1f2937)}@supports (color:color-mix(in lab, red, red)){.ww\\:bg-foreground\\/5{background-color:color-mix(in oklab,var(--ww-color-foreground,#1f2937)5%,transparent)}}.ww\\:bg-input{background-color:var(--ww-color-input,#f9fafb)}.ww\\:bg-muted{background-color:var(--ww-color-muted,#f1f5f9)}.ww\\:bg-muted-foreground\\/60{background-color:var(--ww-color-muted-foreground,#6b7280)}@supports (color:color-mix(in lab, red, red)){.ww\\:bg-muted-foreground\\/60{background-color:color-mix(in oklab,var(--ww-color-muted-foreground,#6b7280)60%,transparent)}}.ww\\:bg-muted\\/50{background-color:var(--ww-color-muted,#f1f5f9)}@supports (color:color-mix(in lab, red, red)){.ww\\:bg-muted\\/50{background-color:color-mix(in oklab,var(--ww-color-muted,#f1f5f9)50%,transparent)}}.ww\\:bg-primary{background-color:var(--ww-color-primary,#6366f1)}.ww\\:bg-tool-card{background-color:var(--ww-color-tool-card,#f4f4f5)}.ww\\:bg-transparent{background-color:#0000}.ww\\:object-cover{object-fit:cover}.ww\\:p-0{padding:calc(var(--ww-spacing)*0)}.ww\\:p-1{padding:calc(var(--ww-spacing)*1)}.ww\\:p-1\\.5{padding:calc(var(--ww-spacing)*1.5)}.ww\\:p-2{padding:calc(var(--ww-spacing)*2)}.ww\\:p-3{padding:calc(var(--ww-spacing)*3)}.ww\\:px-0{padding-inline:calc(var(--ww-spacing)*0)}.ww\\:px-1\\.5{padding-inline:calc(var(--ww-spacing)*1.5)}.ww\\:px-2{padding-inline:calc(var(--ww-spacing)*2)}.ww\\:px-3{padding-inline:calc(var(--ww-spacing)*3)}.ww\\:px-3\\.5{padding-inline:calc(var(--ww-spacing)*3.5)}.ww\\:px-4{padding-inline:calc(var(--ww-spacing)*4)}.ww\\:px-6{padding-inline:calc(var(--ww-spacing)*6)}.ww\\:\\!py-0{padding-block:calc(var(--ww-spacing)*0)!important}.ww\\:py-0\\.5{padding-block:calc(var(--ww-spacing)*.5)}.ww\\:py-1{padding-block:calc(var(--ww-spacing)*1)}.ww\\:py-1\\.5{padding-block:calc(var(--ww-spacing)*1.5)}.ww\\:py-2{padding-block:calc(var(--ww-spacing)*2)}.ww\\:py-2\\.5{padding-block:calc(var(--ww-spacing)*2.5)}.ww\\:py-3{padding-block:calc(var(--ww-spacing)*3)}.ww\\:py-6{padding-block:calc(var(--ww-spacing)*6)}.ww\\:py-12{padding-block:calc(var(--ww-spacing)*12)}.ww\\:pt-1{padding-top:calc(var(--ww-spacing)*1)}.ww\\:pt-2{padding-top:calc(var(--ww-spacing)*2)}.ww\\:pt-2\\.5{padding-top:calc(var(--ww-spacing)*2.5)}.ww\\:pt-3{padding-top:calc(var(--ww-spacing)*3)}.ww\\:pr-1\\.5{padding-right:calc(var(--ww-spacing)*1.5)}.ww\\:pr-3{padding-right:calc(var(--ww-spacing)*3)}.ww\\:pr-9{padding-right:calc(var(--ww-spacing)*9)}.ww\\:pb-1{padding-bottom:calc(var(--ww-spacing)*1)}.ww\\:pb-1\\.5{padding-bottom:calc(var(--ww-spacing)*1.5)}.ww\\:pb-2{padding-bottom:calc(var(--ww-spacing)*2)}.ww\\:pb-2\\.5{padding-bottom:calc(var(--ww-spacing)*2.5)}.ww\\:pb-3{padding-bottom:calc(var(--ww-spacing)*3)}.ww\\:pb-8{padding-bottom:calc(var(--ww-spacing)*8)}.ww\\:pl-1{padding-left:calc(var(--ww-spacing)*1)}.ww\\:pl-3\\.5{padding-left:calc(var(--ww-spacing)*3.5)}.ww\\:pl-4{padding-left:calc(var(--ww-spacing)*4)}.ww\\:text-center{text-align:center}.ww\\:text-left{text-align:left}.ww\\:font-\\[family-name\\:var\\(--ww-font\\)\\]{font-family:var(--ww-font)}.ww\\:font-\\[family-name\\:var\\(--ww-font-sans\\)\\]{font-family:var(--ww-font-sans)}.ww\\:font-mono{font-family:var(--ww-font-mono)}.ww\\:text-base{font-size:var(--ww-text-base);line-height:var(--tw-leading,var(--ww-text-base--line-height))}.ww\\:text-lg{font-size:var(--ww-text-lg);line-height:var(--tw-leading,var(--ww-text-lg--line-height))}.ww\\:text-sm{font-size:var(--ww-text-sm);line-height:var(--tw-leading,var(--ww-text-sm--line-height))}.ww\\:text-xs{font-size:var(--ww-text-xs);line-height:var(--tw-leading,var(--ww-text-xs--line-height))}.ww\\:\\[font-size\\:var\\(--ww-font-size\\,1rem\\)\\]{font-size:var(--ww-font-size,1rem)}.ww\\:text-\\[10px\\]{font-size:10px}.ww\\:text-\\[11px\\]{font-size:11px}.ww\\:\\[line-height\\:var\\(--ww-line-height\\,1\\.5\\)\\]{line-height:var(--ww-line-height,1.5)}.ww\\:font-medium{--tw-font-weight:var(--ww-font-weight-medium);font-weight:var(--ww-font-weight-medium)}.ww\\:font-semibold{--tw-font-weight:var(--ww-font-weight-semibold);font-weight:var(--ww-font-weight-semibold)}.ww\\:tracking-wide{--tw-tracking:var(--ww-tracking-wide);letter-spacing:var(--ww-tracking-wide)}.ww\\:tracking-wider{--tw-tracking:var(--ww-tracking-wider);letter-spacing:var(--ww-tracking-wider)}.ww\\:break-words{overflow-wrap:break-word}.ww\\:break-all{word-break:break-all}.ww\\:whitespace-nowrap{white-space:nowrap}.ww\\:whitespace-pre-wrap{white-space:pre-wrap}.ww\\:text-background{color:var(--ww-color-background,#fff)}.ww\\:text-foreground,.ww\\:text-foreground\\/80{color:var(--ww-color-foreground,#1f2937)}@supports (color:color-mix(in lab, red, red)){.ww\\:text-foreground\\/80{color:color-mix(in oklab,var(--ww-color-foreground,#1f2937)80%,transparent)}}.ww\\:text-muted-foreground{color:var(--ww-color-muted-foreground,#6b7280)}.ww\\:text-primary{color:var(--ww-color-primary,#6366f1)}.ww\\:text-primary-foreground{color:var(--ww-color-primary-foreground,#1f2937)}.ww\\:uppercase{text-transform:uppercase}.ww\\:italic{font-style:italic}.ww\\:opacity-0{opacity:0}.ww\\:opacity-70{opacity:.7}.ww\\:opacity-100{opacity:1}.ww\\:shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ww\\:shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ww\\:shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ww\\:ring-2{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ww\\:ring-\\[\\#0a6c74\\]{--tw-ring-color:#0a6c74}.ww\\:ring-blue-400\\/70{--tw-ring-color:var(--ww-color-blue-400)}@supports (color:color-mix(in lab, red, red)){.ww\\:ring-blue-400\\/70{--tw-ring-color:color-mix(in oklab,var(--ww-color-blue-400)70%,transparent)}}.ww\\:ring-offset-2{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.ww\\:ring-offset-background{--tw-ring-offset-color:var(--ww-color-background,#fff)}.ww\\:backdrop-blur-xl{--tw-backdrop-blur:blur(var(--ww-blur-xl));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.ww\\:backdrop-saturate-150{--tw-backdrop-saturate:saturate(150%);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.ww\\:transition-\\[grid-template-rows\\,opacity\\]{transition-property:grid-template-rows,opacity;transition-timing-function:var(--tw-ease,var(--ww-default-transition-timing-function));transition-duration:var(--tw-duration,var(--ww-default-transition-duration))}.ww\\:transition-\\[max-width\\]{transition-property:max-width;transition-timing-function:var(--tw-ease,var(--ww-default-transition-timing-function));transition-duration:var(--tw-duration,var(--ww-default-transition-duration))}.ww\\:transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--ww-default-transition-timing-function));transition-duration:var(--tw-duration,var(--ww-default-transition-duration))}.ww\\:transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--ww-default-transition-timing-function));transition-duration:var(--tw-duration,var(--ww-default-transition-duration))}.ww\\:transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--ww-default-transition-timing-function));transition-duration:var(--tw-duration,var(--ww-default-transition-duration))}.ww\\:transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--ww-default-transition-timing-function));transition-duration:var(--tw-duration,var(--ww-default-transition-duration))}.ww\\:duration-150{--tw-duration:.15s;transition-duration:.15s}.ww\\:duration-200{--tw-duration:.2s;transition-duration:.2s}.ww\\:duration-300{--tw-duration:.3s;transition-duration:.3s}.ww\\:ease-out{--tw-ease:var(--ww-ease-out);transition-timing-function:var(--ww-ease-out)}.ww\\:outline-none{--tw-outline-style:none;outline-style:none}@media (hover:hover){.ww\\:group-hover\\:opacity-0:is(:where(.ww\\:group):hover *){opacity:0}.ww\\:group-hover\\:opacity-100:is(:where(.ww\\:group):hover *){opacity:1}}.ww\\:group-\\[\\.is-assistant\\]\\:text-foreground:is(:where(.ww\\:group).is-assistant *){color:var(--ww-color-foreground,#1f2937)}.ww\\:group-\\[\\.is-user\\]\\:ml-auto:is(:where(.ww\\:group).is-user *){margin-left:auto}.ww\\:group-\\[\\.is-user\\]\\:\\[border-radius\\:var\\(--ww-msg-radius\\,8px\\)\\]:is(:where(.ww\\:group).is-user *){border-radius:var(--ww-msg-radius,8px)}.ww\\:group-\\[\\.is-user\\]\\:bg-user-bubble:is(:where(.ww\\:group).is-user *){background-color:var(--ww-color-user-bubble,#f4f4f4)}.ww\\:group-\\[\\.is-user\\]\\:\\[padding\\:var\\(--ww-msg-pad-y\\,12px\\)_var\\(--ww-msg-pad-x\\,16px\\)\\]:is(:where(.ww\\:group).is-user *){padding:var(--ww-msg-pad-y,12px)var(--ww-msg-pad-x,16px)}.ww\\:group-\\[\\.is-user\\]\\:\\[color\\:var\\(--ww-color-user-bubble-text\\)\\]:is(:where(.ww\\:group).is-user *){color:var(--ww-color-user-bubble-text)}.ww\\:placeholder\\:text-muted-foreground::placeholder{color:var(--ww-color-muted-foreground,#6b7280)}@media (hover:hover){.ww\\:hover\\:border-primary\\/30:hover{border-color:var(--ww-color-primary,#6366f1)}@supports (color:color-mix(in lab, red, red)){.ww\\:hover\\:border-primary\\/30:hover{border-color:color-mix(in oklab,var(--ww-color-primary,#6366f1)30%,transparent)}}.ww\\:hover\\:bg-accent:hover{background-color:var(--ww-color-accent,#f3f4f6)}.ww\\:hover\\:bg-foreground:hover{background-color:var(--ww-color-foreground,#1f2937)}.ww\\:hover\\:bg-muted:hover{background-color:var(--ww-color-muted,#f1f5f9)}.ww\\:hover\\:bg-muted-foreground\\/10:hover{background-color:var(--ww-color-muted-foreground,#6b7280)}@supports (color:color-mix(in lab, red, red)){.ww\\:hover\\:bg-muted-foreground\\/10:hover{background-color:color-mix(in oklab,var(--ww-color-muted-foreground,#6b7280)10%,transparent)}}.ww\\:hover\\:bg-primary\\/90:hover{background-color:var(--ww-color-primary,#6366f1)}@supports (color:color-mix(in lab, red, red)){.ww\\:hover\\:bg-primary\\/90:hover{background-color:color-mix(in oklab,var(--ww-color-primary,#6366f1)90%,transparent)}}.ww\\:hover\\:text-accent-foreground:hover{color:var(--ww-color-accent-foreground,#1f2937)}.ww\\:hover\\:text-foreground:hover{color:var(--ww-color-foreground,#1f2937)}.ww\\:hover\\:underline:hover{text-decoration-line:underline}}.ww\\:disabled\\:pointer-events-none:disabled{pointer-events:none}.ww\\:disabled\\:opacity-40:disabled{opacity:.4}.ww\\:disabled\\:opacity-50:disabled{opacity:.5}@media (min-width:40rem){.ww\\:sm\\:inset-auto{inset:auto}.ww\\:sm\\:right-0{right:calc(var(--ww-spacing)*0)}.ww\\:sm\\:bottom-4{bottom:calc(var(--ww-spacing)*4)}.ww\\:sm\\:left-0{left:calc(var(--ww-spacing)*0)}.ww\\:sm\\:mx-auto{margin-inline:auto}.ww\\:sm\\:h-\\[720px\\]{height:720px}.ww\\:sm\\:max-h-\\[calc\\(100dvh-2rem\\)\\]{max-height:calc(100dvh - 2rem)}.ww\\:sm\\:w-\\[calc\\(100vw-2rem\\)\\]{width:calc(100vw - 2rem)}.ww\\:sm\\:max-w-\\[1000px\\]{max-width:1000px}.ww\\:sm\\:rounded-2xl{border-radius:var(--ww-radius-2xl)}.ww\\:sm\\:border{border-style:var(--tw-border-style);border-width:1px}.ww\\:sm\\:border-border{border-color:var(--ww-color-border,#e5e7eb)}.ww\\:sm\\:py-2{padding-block:calc(var(--ww-spacing)*2)}.ww\\:sm\\:pr-2{padding-right:calc(var(--ww-spacing)*2)}.ww\\:sm\\:pl-4{padding-left:calc(var(--ww-spacing)*4)}.ww\\:sm\\:text-sm{font-size:var(--ww-text-sm);line-height:var(--tw-leading,var(--ww-text-sm--line-height))}.ww\\:sm\\:text-\\[11px\\]{font-size:11px}}.ww\\:\\[\\&\\>\\*\\:first-child\\]\\:mt-0>:first-child{margin-top:calc(var(--ww-spacing)*0)}.ww\\:\\[\\&\\>\\*\\:last-child\\]\\:mb-0>:last-child{margin-bottom:calc(var(--ww-spacing)*0)}}@keyframes ww-fade-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@keyframes ww-fade-out{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-4px)}}@keyframes ww-pulse{0%,80%,to{opacity:.3;transform:scale(.8)}40%{opacity:1;transform:scale(1)}}@keyframes ww-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){[data-waniwani-chat] [data-waniwani-shimmer]{color:var(--ww-color-muted-foreground)!important;animation:none!important}}[data-waniwani-floating=dock]{transition:opacity .32s,transform .42s cubic-bezier(.22,1,.36,1),max-width .3s,visibility 0s linear .42s}[data-waniwani-floating=dock][data-appeared=true][data-state=shown]{visibility:visible;opacity:1;pointer-events:auto;transition:opacity .32s,transform .42s cubic-bezier(.22,1,.36,1),max-width .3s,visibility;transform:translateY(0)}[data-waniwani-floating=dock][data-appeared=false],[data-waniwani-floating=dock][data-state=hidden]{opacity:0;visibility:hidden;pointer-events:none;transform:translateY(1rem)}[data-waniwani-floating=panel]{transition:clip-path .44s cubic-bezier(.22,1,.36,1),opacity .26s,visibility 0s linear .44s}[data-waniwani-floating=panel][data-state=shown]{visibility:visible;opacity:1;pointer-events:auto;clip-path:inset(-40px round 18px);transition:clip-path .44s cubic-bezier(.22,1,.36,1),opacity .26s,visibility}[data-waniwani-floating=panel][data-state=hidden]{opacity:0;visibility:hidden;pointer-events:none;clip-path:inset(calc(100% - 60px) 12% 0 round 24px)}@media (max-width:639px){[data-waniwani-floating=panel][data-state=shown]{clip-path:inset(0)}[data-waniwani-floating=panel][data-state=hidden]{clip-path:inset(calc(100% - 72px) 6% 0 round 22px)}}@media (prefers-reduced-motion:reduce){[data-waniwani-floating=dock],[data-waniwani-floating=panel]{clip-path:none;transition:visibility 0s linear 10ms}[data-waniwani-floating=dock][data-appeared=true][data-state=shown],[data-waniwani-floating=panel][data-state=shown]{transition:visibility}}[data-waniwani-chat] ::-webkit-scrollbar{width:8px}[data-waniwani-chat] ::-webkit-scrollbar-track{background:0 0}[data-waniwani-chat] ::-webkit-scrollbar-thumb{background:var(--ww-color-border);border-radius:9999px}[data-waniwani-chat] ::-webkit-scrollbar-thumb:hover{background:var(--ww-color-muted-foreground)}[data-waniwani-chat] *{scrollbar-width:thin;scrollbar-color:var(--ww-color-border)transparent}[data-waniwani-chat]{--ww-color-background:var(--ww-bg,#fff);--ww-color-foreground:var(--ww-text,#1f2937);--ww-color-primary:var(--ww-primary,#6366f1);--ww-color-primary-foreground:var(--ww-primary-fg,#1f2937);--ww-color-muted-foreground:var(--ww-muted,#6b7280);--ww-color-border:var(--ww-border,#e5e7eb);--ww-color-input:var(--ww-input-bg,#f9fafb);--ww-color-accent:var(--ww-assistant-bubble,#f3f4f6);--ww-color-accent-foreground:var(--ww-text,#1f2937);--ww-color-user-bubble:var(--ww-user-bubble,#f4f4f4);--ww-color-card:var(--ww-bg,#fff);--ww-color-card-foreground:var(--ww-text,#1f2937);--ww-color-card-header:var(--ww-header-bg,#fff);--ww-color-card-header-foreground:var(--ww-header-text,#1f2937);--ww-color-status:var(--ww-status,#22c55e);--ww-color-tool-card:var(--ww-tool-card,#f4f4f5);--ww-radius:var(--ww-radius,16px);--ww-font-sans:var(--ww-font,system-ui,-apple-system,\"Segoe UI\",sans-serif);--ww-color-user-bubble-text:var(--ww-user-bubble-text,var(--ww-color-primary-foreground));--ww-color-assistant-bubble-text:var(--ww-assistant-bubble-text,var(--ww-color-foreground));--ww-glass:#eceef499;--ww-glass-border:#0000000f;border-style:solid;border-width:var(--ww-border-width,0);border-color:var(--ww-color-border);box-shadow:var(--ww-shadow,none)}[data-waniwani-chat][data-assistant-bubble=true] .ww-message-assistant .ww-bubble{background:var(--ww-color-accent);color:var(--ww-color-assistant-bubble-text);border-radius:var(--ww-msg-radius,8px);padding:var(--ww-msg-pad-y,12px)var(--ww-msg-pad-x,16px);width:fit-content;max-width:var(--ww-msg-max-width,80%)}.dark [data-waniwani-chat],[data-waniwani-chat].dark{--ww-color-background:var(--ww-bg,#212121);--ww-color-foreground:var(--ww-text,#ececec);--ww-color-primary:var(--ww-primary,#6366f1);--ww-color-primary-foreground:var(--ww-primary-fg,#fff);--ww-color-muted-foreground:var(--ww-muted,#8e8ea0);--ww-color-border:var(--ww-border,#444);--ww-color-input:var(--ww-input-bg,#2f2f2f);--ww-color-accent:var(--ww-assistant-bubble,#2f2f2f);--ww-color-accent-foreground:var(--ww-text,#ececec);--ww-color-user-bubble:var(--ww-user-bubble,#303030);--ww-color-card:var(--ww-bg,#212121);--ww-color-card-foreground:var(--ww-text,#ececec);--ww-color-card-header:var(--ww-header-bg,#1e1e1e);--ww-color-card-header-foreground:var(--ww-header-text,#ececec);--ww-color-status:var(--ww-status,#22c55e);--ww-color-tool-card:var(--ww-tool-card,#262626);--ww-color-user-bubble-text:var(--ww-user-bubble-text,#fff);--ww-color-assistant-bubble-text:var(--ww-assistant-bubble-text,var(--ww-color-foreground));--ww-glass:#282a3480;--ww-glass-border:#ffffff1f}@media (prefers-color-scheme:dark){[data-waniwani-chat][data-color-scheme=auto]{--ww-color-background:var(--ww-bg,#212121);--ww-color-foreground:var(--ww-text,#ececec);--ww-color-primary:var(--ww-primary,#6366f1);--ww-color-primary-foreground:var(--ww-primary-fg,#fff);--ww-color-muted-foreground:var(--ww-muted,#8e8ea0);--ww-color-border:var(--ww-border,#444);--ww-color-input:var(--ww-input-bg,#2f2f2f);--ww-color-accent:var(--ww-assistant-bubble,#2f2f2f);--ww-color-accent-foreground:var(--ww-text,#ececec);--ww-color-user-bubble:var(--ww-user-bubble,#303030);--ww-color-card:var(--ww-bg,#212121);--ww-color-card-foreground:var(--ww-text,#ececec);--ww-color-card-header:var(--ww-header-bg,#1e1e1e);--ww-color-card-header-foreground:var(--ww-header-text,#ececec);--ww-color-status:var(--ww-status,#22c55e);--ww-color-tool-card:var(--ww-tool-card,#262626);--ww-color-user-bubble-text:var(--ww-user-bubble-text,#fff);--ww-color-assistant-bubble-text:var(--ww-assistant-bubble-text,var(--ww-color-foreground));--ww-glass:#282a3480;--ww-glass-border:#ffffff1f}}[data-waniwani-chat] [data-streamdown=table-wrapper]{flex-direction:column;gap:.5rem;margin-top:1rem;margin-bottom:1rem;display:flex}[data-waniwani-chat] [data-streamdown=table-wrapper]>div:first-child:has(button){justify-content:flex-end;align-items:center;gap:.25rem;display:flex}[data-waniwani-chat] [data-streamdown=table-wrapper]>div:last-child{overflow-x:auto}[data-waniwani-chat] [data-streamdown=table]{border-collapse:collapse;border:1px solid var(--ww-color-border);border-radius:.75rem;width:100%;overflow:hidden}[data-waniwani-chat] [data-streamdown=table-header]{background-color:var(--ww-color-accent)}@supports (color:color-mix(in lab, red, red)){[data-waniwani-chat] [data-streamdown=table-header]{background-color:color-mix(in srgb,var(--ww-color-accent)80%,transparent)}}[data-waniwani-chat] [data-streamdown=table-body]{background-color:var(--ww-color-accent)}@supports (color:color-mix(in lab, red, red)){[data-waniwani-chat] [data-streamdown=table-body]{background-color:color-mix(in srgb,var(--ww-color-accent)40%,transparent)}}[data-waniwani-chat] [data-streamdown=table-body]>tr+tr{border-top:1px solid var(--ww-color-border)}[data-waniwani-chat] [data-streamdown=table-row]{border-bottom:1px solid var(--ww-color-border)}[data-waniwani-chat] [data-streamdown=table-header-cell]{white-space:nowrap;text-align:left;padding:.5rem 1rem;font-size:.875rem;font-weight:600}[data-waniwani-chat] [data-streamdown=table-cell]{padding:.5rem 1rem;font-size:.875rem}[data-waniwani-chat] [data-streamdown=link]{color:var(--ww-color-primary);overflow-wrap:anywhere;cursor:pointer;font-weight:500;text-decoration:underline}[data-waniwani-chat].dark [data-streamdown=link],.dark [data-waniwani-chat] [data-streamdown=link]{color:var(--ww-color-primary)}@supports (color:color-mix(in lab, red, red)){[data-waniwani-chat].dark [data-streamdown=link],.dark [data-waniwani-chat] [data-streamdown=link]{color:color-mix(in oklab,var(--ww-color-primary)55%,white)}}@media (prefers-color-scheme:dark){[data-waniwani-chat][data-color-scheme=auto] [data-streamdown=link]{color:var(--ww-color-primary)}@supports (color:color-mix(in lab, red, red)){[data-waniwani-chat][data-color-scheme=auto] [data-streamdown=link]{color:color-mix(in oklab,var(--ww-color-primary)55%,white)}}}[data-waniwani-chat].dark [data-waniwani-logo],.dark [data-waniwani-chat] [data-waniwani-logo]{filter:invert()}@media (prefers-color-scheme:dark){[data-waniwani-chat][data-color-scheme=auto] [data-waniwani-logo]{filter:invert()}}[data-waniwani-chat] [data-streamdown=link-safety-modal]{z-index:50;background-color:var(--ww-color-background);justify-content:center;align-items:center;display:flex;position:fixed;inset:0}@supports (color:color-mix(in lab, red, red)){[data-waniwani-chat] [data-streamdown=link-safety-modal]{background-color:color-mix(in srgb,var(--ww-color-background)50%,transparent)}}[data-waniwani-chat] [data-streamdown=link-safety-modal]{-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div{border:1px solid var(--ww-color-border);background-color:var(--ww-color-background);width:100%;max-width:28rem;color:var(--ww-color-foreground);border-radius:.75rem;flex-direction:column;gap:1rem;margin:0 1rem;padding:1.5rem;display:flex;position:relative;box-shadow:0 10px 25px #0000001a}[data-waniwani-chat] [data-streamdown=link-safety-modal] button{cursor:pointer}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>button:first-child{color:var(--ww-color-muted-foreground);background:0 0;border:none;border-radius:.375rem;padding:.25rem;transition:background-color .15s,color .15s;position:absolute;top:1rem;right:1rem}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>button:first-child:hover{background-color:var(--ww-color-accent);color:var(--ww-color-foreground)}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>div:first-of-type{flex-direction:column;gap:.5rem;display:flex}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>div:first-of-type>div{align-items:center;gap:.5rem;font-size:1.125rem;font-weight:600;display:flex}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>div:first-of-type>p{color:var(--ww-color-muted-foreground);font-size:.875rem}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>div:nth-child(3){word-break:break-all;background-color:var(--ww-color-accent);border-radius:.375rem;max-height:8rem;padding:.75rem;font-family:ui-monospace,monospace;font-size:.875rem;overflow-y:auto}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>div:last-child{gap:.5rem;display:flex}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>div:last-child>button{border:none;border-radius:.375rem;flex:1;justify-content:center;align-items:center;gap:.5rem;padding:.5rem 1rem;font-size:.875rem;font-weight:500;transition:background-color .15s;display:flex}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>div:last-child>button:first-child{border:1px solid var(--ww-color-border);background-color:var(--ww-color-background);color:var(--ww-color-foreground)}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>div:last-child>button:first-child:hover{background-color:var(--ww-color-accent)}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>div:last-child>button:last-child{background-color:var(--ww-color-primary);color:#fff}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>div:last-child>button:last-child:hover{opacity:.9}[data-waniwani-chat] [data-streamdown=ordered-list]{white-space:normal;list-style-type:decimal;list-style-position:inside}[data-waniwani-chat] li [data-streamdown=ordered-list]{padding-left:1.5rem}[data-waniwani-chat] [data-streamdown=unordered-list]{white-space:normal;list-style-type:disc;list-style-position:inside}[data-waniwani-chat] li [data-streamdown=unordered-list]{padding-left:1.5rem}[data-waniwani-chat] [data-streamdown=list-item]{padding-top:.25rem;padding-bottom:.25rem}[data-waniwani-chat] [data-streamdown=list-item]>p{display:inline}[data-waniwani-chat] [data-streamdown=inline-code]{background-color:var(--ww-color-accent);border-radius:.25rem;padding:.125rem .375rem;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,monospace;font-size:.875rem}[data-waniwani-chat] [data-streamdown=heading-1]{margin-top:1.5rem;margin-bottom:.5rem;font-size:1.875rem;font-weight:600;line-height:2.25rem}[data-waniwani-chat] [data-streamdown=heading-2]{margin-top:1.5rem;margin-bottom:.5rem;font-size:1.5rem;font-weight:600;line-height:2rem}[data-waniwani-chat] [data-streamdown=heading-3]{margin-top:1.5rem;margin-bottom:.5rem;font-size:1.25rem;font-weight:600;line-height:1.75rem}[data-waniwani-chat] [data-streamdown=heading-4]{margin-top:1.5rem;margin-bottom:.5rem;font-size:1.125rem;font-weight:600;line-height:1.75rem}[data-waniwani-chat] [data-streamdown=heading-5]{margin-top:1.5rem;margin-bottom:.5rem;font-size:1rem;font-weight:600;line-height:1.5rem}[data-waniwani-chat] [data-streamdown=heading-6]{margin-top:1.5rem;margin-bottom:.5rem;font-size:.875rem;font-weight:600;line-height:1.25rem}[data-waniwani-chat] [data-streamdown=blockquote]{border-left:4px solid var(--ww-color-muted-foreground);margin-top:1rem;margin-bottom:1rem}@supports (color:color-mix(in lab, red, red)){[data-waniwani-chat] [data-streamdown=blockquote]{border-left:4px solid color-mix(in srgb,var(--ww-color-muted-foreground)30%,transparent)}}[data-waniwani-chat] [data-streamdown=blockquote]{color:var(--ww-color-muted-foreground);padding-left:1rem;font-style:italic}[data-waniwani-chat] [data-streamdown=horizontal-rule]{border-color:var(--ww-color-border);margin-top:1.5rem;margin-bottom:1.5rem}[data-waniwani-chat] [data-streamdown=strong]{font-weight:600}[data-waniwani-chat] [data-streamdown=image-wrapper]{margin-top:1rem;margin-bottom:1rem;display:inline-block;position:relative}[data-waniwani-chat] [data-streamdown=image]{border-radius:.5rem;max-width:100%}[data-waniwani-chat] [data-streamdown=code-block]{border:1px solid var(--ww-color-border);border-radius:.75rem;width:100%;margin-top:1rem;margin-bottom:1rem;overflow:hidden}[data-waniwani-chat] [data-streamdown=code-block-header]{background-color:var(--ww-color-accent);justify-content:space-between;align-items:center;display:flex}@supports (color:color-mix(in lab, red, red)){[data-waniwani-chat] [data-streamdown=code-block-header]{background-color:color-mix(in srgb,var(--ww-color-accent)80%,transparent)}}[data-waniwani-chat] [data-streamdown=code-block-header]{color:var(--ww-color-muted-foreground);padding:.75rem;font-size:.75rem}[data-waniwani-chat] [data-streamdown=code-block-body]{padding:1rem;font-size:.875rem;overflow-x:auto}[data-waniwani-chat] [data-streamdown=code-block-copy-button],[data-waniwani-chat] [data-streamdown=code-block-download-button]{cursor:pointer;color:var(--ww-color-muted-foreground);background:0 0;border:none;padding:.25rem;transition:color .15s}[data-waniwani-chat] [data-streamdown=code-block-copy-button]:hover,[data-waniwani-chat] [data-streamdown=code-block-download-button]:hover{color:var(--ww-color-foreground)}[data-waniwani-chat] [data-streamdown=mermaid-block]{border:1px solid var(--ww-color-border);border-radius:.75rem;height:auto;margin-top:1rem;margin-bottom:1rem;padding:1rem;position:relative}[data-waniwani-chat] [data-streamdown=mermaid]{width:100%;height:100%}@property --tw-translate-x{syntax:\"*\";inherits:false;initial-value:0}@property --tw-translate-y{syntax:\"*\";inherits:false;initial-value:0}@property --tw-translate-z{syntax:\"*\";inherits:false;initial-value:0}@property --tw-space-y-reverse{syntax:\"*\";inherits:false;initial-value:0}@property --tw-border-style{syntax:\"*\";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:\"*\";inherits:false}@property --tw-tracking{syntax:\"*\";inherits:false}@property --tw-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:\"*\";inherits:false}@property --tw-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:\"*\";inherits:false}@property --tw-inset-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:\"*\";inherits:false}@property --tw-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:\"*\";inherits:false}@property --tw-inset-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:\"*\";inherits:false}@property --tw-ring-offset-width{syntax:\"<length>\";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:\"*\";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-backdrop-blur{syntax:\"*\";inherits:false}@property --tw-backdrop-brightness{syntax:\"*\";inherits:false}@property --tw-backdrop-contrast{syntax:\"*\";inherits:false}@property --tw-backdrop-grayscale{syntax:\"*\";inherits:false}@property --tw-backdrop-hue-rotate{syntax:\"*\";inherits:false}@property --tw-backdrop-invert{syntax:\"*\";inherits:false}@property --tw-backdrop-opacity{syntax:\"*\";inherits:false}@property --tw-backdrop-saturate{syntax:\"*\";inherits:false}@property --tw-backdrop-sepia{syntax:\"*\";inherits:false}@property --tw-duration{syntax:\"*\";inherits:false}@property --tw-ease{syntax:\"*\";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}",bt=null,Jr=null,sa=null,tp=null,Dj="waniwani-chat-sizing",_j="waniwani-chat-defaults",Oj="waniwani-chat-chrome",Pj="waniwani-chat-auto-card",Nj=`:where([data-waniwani-embed]){height:${EI}}`,Bj=":where([data-waniwani-embed]){border-radius:16px;overflow:hidden}",Uj=":where([data-waniwani-embed]){border-style:solid;border-width:var(--ww-border-width,0);border-color:var(--ww-border,transparent);box-shadow:var(--ww-shadow,none)}",Fj=":where([data-waniwani-embed][data-waniwani-auto]){width:100%;max-width:28rem;margin-inline:auto;border-radius:16px;overflow:hidden;border-style:solid;border-width:var(--ww-border-width,1px);border-color:var(--ww-border,rgba(0,0,0,0.1));box-shadow:var(--ww-shadow,0 10px 30px rgba(0,0,0,0.08))}";function ap(e,t){if(typeof document>"u"||document.getElementById(e))return;let a=document.createElement("style");a.id=e,a.textContent=t,document.head.appendChild(a)}function zj(e,t){let a=t.appearance?.variables;!a||!(e instanceof HTMLElement)||(typeof a.borderWidth=="number"&&e.style.setProperty("--ww-border-width",`${a.borderWidth}px`),a.borderColor&&e.style.setProperty("--ww-border",a.borderColor),a.boxShadow&&e.style.setProperty("--ww-shadow",a.boxShadow))}function ND(e,t){if(mx&&mx!=="__WANIWANI_EMBED_CSS__"){let n=document.createElement("style");n.textContent=mx,e.appendChild(n)}let a=document.createElement("style");if(a.textContent="[data-waniwani-chat]{border-width:0;box-shadow:none}",e.appendChild(a),t.css)try{let n=new URL(t.css,window.location.href);if(n.protocol==="https:"||n.protocol==="http:"){let r=document.createElement("link");r.rel="stylesheet",r.href=n.href,e.appendChild(r)}else console.warn("[Waniwani] Custom CSS URL must use http or https protocol.")}catch{console.warn("[Waniwani] Invalid custom CSS URL:",t.css)}}var OD="data-waniwani-embed",hx="data-waniwani-auto";function qj(e){let t=document.querySelector(`[${OD}]`);if(t)return t;let a=document.createElement("div");a.setAttribute(OD,""),a.setAttribute(hx,"");let n=e?!!document.head?.contains(e):!1;return e?.parentNode&&!n?e.parentNode.insertBefore(a,e):document.body.appendChild(a),a}function Hj(e){return/^\d+$/.test(e.trim())?`${e.trim()}px`:e.trim()}function jj(e,t,a,n){let r=qj(n);ap(Dj,Nj),e.height&&r instanceof HTMLElement&&(r.style.height=Hj(e.height)),e.appearance?.theme&&ap(_j,Bj),ap(Oj,Uj),r.hasAttribute(hx)&&ap(Pj,Fj),zj(r,e),sa=document.createElement("div"),sa.id="waniwani-chat-embed",sa.style.cssText="width:100%;height:100%;max-height:inherit;display:flex;flex-direction:column;flex:1 1 auto;min-height:0;",r.appendChild(sa);let o=sa,i=()=>{let d=getComputedStyle(r);if(!d.maxHeight.endsWith("px")){o.style.removeProperty("max-height");return}let f=Number.parseFloat(d.maxHeight);if(!Number.isFinite(f)){o.style.removeProperty("max-height");return}let p=f;d.boxSizing==="border-box"&&(p-=(Number.parseFloat(d.paddingTop)||0)+(Number.parseFloat(d.paddingBottom)||0)+(Number.parseFloat(d.borderTopWidth)||0)+(Number.parseFloat(d.borderBottomWidth)||0)),p>0?o.style.maxHeight=`${p}px`:o.style.removeProperty("max-height")};i(),tp=new ResizeObserver(i),tp.observe(r);let l=sa.attachShadow({mode:"open"});ND(l,e);let s=document.createElement("div");s.className="ww:contents",l.appendChild(s);let u=bu.default.createRef(),c=d=>{r instanceof HTMLElement&&(r.style.display=d?"":"none")};if(e.token){let d=Kf(e.api??"",e.token,e.channelId);d?.visibility&&!Qf(d.visibility,window.location.pathname)&&c(!1)}return Jr=gx.default.createRoot(s),Jr.render(bu.default.createElement(_D,{ref:u,config:e,programmatic:t,scriptConfig:a,onVisibilityChange:c})),{destroy:()=>{tp?.disconnect(),tp=null,Jr?.unmount(),Jr=null,sa?.remove(),sa=null,r.hasAttribute(hx)&&r.remove(),bt=null},open:()=>{},close:()=>{},toggle:()=>{},sendMessage:d=>u.current?.chat?.sendMessage(d),sendMessageAndWait:async d=>{let f=u.current?.chat;if(f)return await f.sendMessageAndWait(d)},reset:()=>u.current?.chat?.reset(),focus:()=>u.current?.chat?.focus(),getMessages:()=>u.current?.chat?.messages??[],getSessionId:()=>u.current?.chat?.sessionId}}function Vj(e,t,a){sa=document.createElement("div"),sa.id="waniwani-chat-embed",sa.style.cssText="position:fixed;inset:0;z-index:2147483000;pointer-events:none;",document.body.appendChild(sa);let n=sa.attachShadow({mode:"open"});ND(n,e);let r=document.createElement("div");r.className="ww:contents",n.appendChild(r);let o=bu.default.createRef();return Jr=gx.default.createRoot(r),Jr.render(bu.default.createElement(DD,{ref:o,config:e,programmatic:t,scriptConfig:a})),{destroy:()=>{Jr?.unmount(),Jr=null,sa?.remove(),sa=null,bt=null},open:()=>o.current?.open(),close:()=>o.current?.close(),toggle:()=>o.current?.toggle(),sendMessage:i=>o.current?.sendMessage(i),sendMessageAndWait:async i=>{if(o.current)return o.current.sendMessageAndWait(i)},reset:()=>o.current?.reset(),focus:()=>o.current?.focus(),getMessages:()=>o.current?.getMessages()??[],getSessionId:()=>o.current?.getSessionId()}}function BD(e){if(bt)return console.warn("[Waniwani] Chat widget is already initialized. Call destroy() first to re-initialize."),bt;let t=Jh(),a=od(),n=hs(e,void 0,a);rd(n.visitorId);let r=n.mode==="floating"?Vj(n,e,a):jj(n,e,a,t),o=n.api??"",i=n.token?TI({api:o,token:n.token,channelId:n.channelId,getSource:()=>Kf(o,n.token,n.channelId)?.source??void 0,getSessionId:()=>r.getSessionId()}):Qh("no public token configured (set data-token or pass token to init())");return bt={...r,track:i.track,identify:(l,s)=>i.identify(l,s),setVisitorId:l=>ps(l),getVisitorId:()=>Kn(),destroy:()=>{i.shutdown(),r.destroy()}},bt}function Gj(){bt&&bt.destroy()}var UD=Qh("chat widget is not initialized (call WaniWani.chat.init() first)"),cl=()=>bt?bt.track:UD.track;window.WaniWani=window.WaniWani||{};window.WaniWani.chat={init:BD,destroy:Gj,open:()=>bt?.open(),close:()=>bt?.close(),toggle:()=>bt?.toggle(),sendMessage:e=>bt?.sendMessage(e),sendMessageAndWait:async e=>{if(bt)return bt.sendMessageAndWait(e)},reset:()=>bt?.reset(),focus:()=>bt?.focus(),getMessages:()=>bt?.getMessages()??[],getSessionId:()=>bt?.getSessionId(),track:Object.assign(e=>cl()(e),{priceShown:e=>cl().priceShown(e),pricesCompared:e=>cl().pricesCompared(e),optionSelected:e=>cl().optionSelected(e),leadQualified:e=>cl().leadQualified(e),converted:e=>cl().converted(e)}),identify:(e,t)=>bt?bt.identify(e,t):UD.identify(e,t),setVisitorId:e=>ps(e),getVisitorId:()=>Kn()};function PD(){if(od().token)try{BD()}catch(t){console.error("[Waniwani] Auto-initialization failed:",t)}}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",PD):PD();})();
|
|
137
|
+
`)}})}};var Ww=Lf(()=>cu(h.union([h.strictObject({type:h.literal("text-start"),id:h.string(),providerMetadata:X.optional()}),h.strictObject({type:h.literal("text-delta"),id:h.string(),delta:h.string(),providerMetadata:X.optional()}),h.strictObject({type:h.literal("text-end"),id:h.string(),providerMetadata:X.optional()}),h.strictObject({type:h.literal("error"),errorText:h.string()}),h.strictObject({type:h.literal("tool-input-start"),toolCallId:h.string(),toolName:h.string(),providerExecuted:h.boolean().optional(),providerMetadata:X.optional(),dynamic:h.boolean().optional(),title:h.string().optional()}),h.strictObject({type:h.literal("tool-input-delta"),toolCallId:h.string(),inputTextDelta:h.string()}),h.strictObject({type:h.literal("tool-input-available"),toolCallId:h.string(),toolName:h.string(),input:h.unknown(),providerExecuted:h.boolean().optional(),providerMetadata:X.optional(),dynamic:h.boolean().optional(),title:h.string().optional()}),h.strictObject({type:h.literal("tool-input-error"),toolCallId:h.string(),toolName:h.string(),input:h.unknown(),providerExecuted:h.boolean().optional(),providerMetadata:X.optional(),dynamic:h.boolean().optional(),errorText:h.string(),title:h.string().optional()}),h.strictObject({type:h.literal("tool-approval-request"),approvalId:h.string(),toolCallId:h.string()}),h.strictObject({type:h.literal("tool-output-available"),toolCallId:h.string(),output:h.unknown(),providerExecuted:h.boolean().optional(),providerMetadata:X.optional(),dynamic:h.boolean().optional(),preliminary:h.boolean().optional()}),h.strictObject({type:h.literal("tool-output-error"),toolCallId:h.string(),errorText:h.string(),providerExecuted:h.boolean().optional(),providerMetadata:X.optional(),dynamic:h.boolean().optional()}),h.strictObject({type:h.literal("tool-output-denied"),toolCallId:h.string()}),h.strictObject({type:h.literal("reasoning-start"),id:h.string(),providerMetadata:X.optional()}),h.strictObject({type:h.literal("reasoning-delta"),id:h.string(),delta:h.string(),providerMetadata:X.optional()}),h.strictObject({type:h.literal("reasoning-end"),id:h.string(),providerMetadata:X.optional()}),h.strictObject({type:h.literal("source-url"),sourceId:h.string(),url:h.string(),title:h.string().optional(),providerMetadata:X.optional()}),h.strictObject({type:h.literal("source-document"),sourceId:h.string(),mediaType:h.string(),title:h.string(),filename:h.string().optional(),providerMetadata:X.optional()}),h.strictObject({type:h.literal("file"),url:h.string(),mediaType:h.string(),providerMetadata:X.optional()}),h.strictObject({type:h.custom(e=>typeof e=="string"&&e.startsWith("data-"),{message:'Type must start with "data-"'}),id:h.string().optional(),data:h.unknown(),transient:h.boolean().optional()}),h.strictObject({type:h.literal("start-step")}),h.strictObject({type:h.literal("finish-step")}),h.strictObject({type:h.literal("start"),messageId:h.string().optional(),messageMetadata:h.unknown().optional()}),h.strictObject({type:h.literal("finish"),finishReason:h.enum(["stop","length","content-filter","tool-calls","error","other"]).optional(),messageMetadata:h.unknown().optional()}),h.strictObject({type:h.literal("abort"),reason:h.string().optional()}),h.strictObject({type:h.literal("message-metadata"),messageMetadata:h.unknown()})])));function E9(e){return e.type.startsWith("data-")}function $w(e){return e.type.startsWith("tool-")}function R9(e){return e.type==="dynamic-tool"}function Ef(e){return $w(e)||R9(e)}function P2(e){return e.type.split("-").slice(1).join("-")}function D9({lastMessage:e,messageId:t}){return{message:e?.role==="assistant"?e:{id:t,metadata:void 0,role:"assistant",parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}function _9({stream:e,messageMetadataSchema:t,dataPartSchemas:a,runUpdateMessageJob:n,onError:r,onToolCall:o,onData:l}){return e.pipeThrough(new TransformStream({async transform(i,s){await n(async({state:u,write:c})=>{var d,f,p,m;function x(g){let A=u.message.parts.filter(Ef).find(S=>S.toolCallId===g);if(A==null)throw new oi({chunkType:"tool-invocation",chunkId:g,message:`No tool invocation found for tool call ID "${g}".`});return A}function v(g){var C;let A=u.message.parts.find(R=>$w(R)&&R.toolCallId===g.toolCallId),S=g,M=A;if(A!=null){A.state=g.state,M.input=S.input,M.output=S.output,M.errorText=S.errorText,M.rawInput=S.rawInput,M.preliminary=S.preliminary,g.title!==void 0&&(M.title=g.title),M.providerExecuted=(C=S.providerExecuted)!=null?C:A.providerExecuted;let R=S.providerMetadata;if(R!=null)if(g.state==="output-available"||g.state==="output-error"){let D=A;D.resultProviderMetadata=R}else A.callProviderMetadata=R}else u.message.parts.push({type:`tool-${g.toolName}`,toolCallId:g.toolCallId,state:g.state,title:g.title,input:S.input,output:S.output,rawInput:S.rawInput,errorText:S.errorText,providerExecuted:S.providerExecuted,preliminary:S.preliminary,...S.providerMetadata!=null&&(g.state==="output-available"||g.state==="output-error")?{resultProviderMetadata:S.providerMetadata}:{},...S.providerMetadata!=null&&!(g.state==="output-available"||g.state==="output-error")?{callProviderMetadata:S.providerMetadata}:{}})}function y(g){var C,A;let S=u.message.parts.find(D=>D.type==="dynamic-tool"&&D.toolCallId===g.toolCallId),M=g,R=S;if(S!=null){S.state=g.state,R.toolName=g.toolName,R.input=M.input,R.output=M.output,R.errorText=M.errorText,R.rawInput=(C=M.rawInput)!=null?C:R.rawInput,R.preliminary=M.preliminary,g.title!==void 0&&(R.title=g.title),R.providerExecuted=(A=M.providerExecuted)!=null?A:S.providerExecuted;let D=M.providerMetadata;if(D!=null)if(g.state==="output-available"||g.state==="output-error"){let L=S;L.resultProviderMetadata=D}else S.callProviderMetadata=D}else u.message.parts.push({type:"dynamic-tool",toolName:g.toolName,toolCallId:g.toolCallId,state:g.state,input:M.input,output:M.output,errorText:M.errorText,preliminary:M.preliminary,providerExecuted:M.providerExecuted,title:g.title,...M.providerMetadata!=null&&(g.state==="output-available"||g.state==="output-error")?{resultProviderMetadata:M.providerMetadata}:{},...M.providerMetadata!=null&&!(g.state==="output-available"||g.state==="output-error")?{callProviderMetadata:M.providerMetadata}:{}})}async function w(g){if(g!=null){let C=u.message.metadata!=null?$2(u.message.metadata,g):g;t!=null&&await Mf({value:C,schema:t,context:{field:"message.metadata",entityId:u.message.id}}),u.message.metadata=C}}switch(i.type){case"text-start":{let g={type:"text",text:"",providerMetadata:i.providerMetadata,state:"streaming"};u.activeTextParts[i.id]=g,u.message.parts.push(g),c();break}case"text-delta":{let g=u.activeTextParts[i.id];if(g==null)throw new oi({chunkType:"text-delta",chunkId:i.id,message:`Received text-delta for missing text part with ID "${i.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.`});g.text+=i.delta,g.providerMetadata=(d=i.providerMetadata)!=null?d:g.providerMetadata,c();break}case"text-end":{let g=u.activeTextParts[i.id];if(g==null)throw new oi({chunkType:"text-end",chunkId:i.id,message:`Received text-end for missing text part with ID "${i.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`});g.state="done",g.providerMetadata=(f=i.providerMetadata)!=null?f:g.providerMetadata,delete u.activeTextParts[i.id],c();break}case"reasoning-start":{let g={type:"reasoning",text:"",providerMetadata:i.providerMetadata,state:"streaming"};u.activeReasoningParts[i.id]=g,u.message.parts.push(g),c();break}case"reasoning-delta":{let g=u.activeReasoningParts[i.id];if(g==null)throw new oi({chunkType:"reasoning-delta",chunkId:i.id,message:`Received reasoning-delta for missing reasoning part with ID "${i.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.`});g.text+=i.delta,g.providerMetadata=(p=i.providerMetadata)!=null?p:g.providerMetadata,c();break}case"reasoning-end":{let g=u.activeReasoningParts[i.id];if(g==null)throw new oi({chunkType:"reasoning-end",chunkId:i.id,message:`Received reasoning-end for missing reasoning part with ID "${i.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`});g.providerMetadata=(m=i.providerMetadata)!=null?m:g.providerMetadata,g.state="done",delete u.activeReasoningParts[i.id],c();break}case"file":{u.message.parts.push({type:"file",mediaType:i.mediaType,url:i.url,...i.providerMetadata!=null?{providerMetadata:i.providerMetadata}:{}}),c();break}case"source-url":{u.message.parts.push({type:"source-url",sourceId:i.sourceId,url:i.url,title:i.title,providerMetadata:i.providerMetadata}),c();break}case"source-document":{u.message.parts.push({type:"source-document",sourceId:i.sourceId,mediaType:i.mediaType,title:i.title,filename:i.filename,providerMetadata:i.providerMetadata}),c();break}case"tool-input-start":{let g=u.message.parts.filter($w);u.partialToolCalls[i.toolCallId]={text:"",toolName:i.toolName,index:g.length,dynamic:i.dynamic,title:i.title},i.dynamic?y({toolCallId:i.toolCallId,toolName:i.toolName,state:"input-streaming",input:void 0,providerExecuted:i.providerExecuted,title:i.title,providerMetadata:i.providerMetadata}):v({toolCallId:i.toolCallId,toolName:i.toolName,state:"input-streaming",input:void 0,providerExecuted:i.providerExecuted,title:i.title,providerMetadata:i.providerMetadata}),c();break}case"tool-input-delta":{let g=u.partialToolCalls[i.toolCallId];if(g==null)throw new oi({chunkType:"tool-input-delta",chunkId:i.toolCallId,message:`Received tool-input-delta for missing tool call with ID "${i.toolCallId}". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.`});g.text+=i.inputTextDelta;let{value:C}=await fu(g.text);g.dynamic?y({toolCallId:i.toolCallId,toolName:g.toolName,state:"input-streaming",input:C,title:g.title}):v({toolCallId:i.toolCallId,toolName:g.toolName,state:"input-streaming",input:C,title:g.title}),c();break}case"tool-input-available":{i.dynamic?y({toolCallId:i.toolCallId,toolName:i.toolName,state:"input-available",input:i.input,providerExecuted:i.providerExecuted,providerMetadata:i.providerMetadata,title:i.title}):v({toolCallId:i.toolCallId,toolName:i.toolName,state:"input-available",input:i.input,providerExecuted:i.providerExecuted,providerMetadata:i.providerMetadata,title:i.title}),c(),o&&!i.providerExecuted&&await o({toolCall:i});break}case"tool-input-error":{let g=u.message.parts.filter(Ef).find(A=>A.toolCallId===i.toolCallId);(g!=null?g.type==="dynamic-tool":!!i.dynamic)?y({toolCallId:i.toolCallId,toolName:i.toolName,state:"output-error",input:i.input,errorText:i.errorText,providerExecuted:i.providerExecuted,providerMetadata:i.providerMetadata}):v({toolCallId:i.toolCallId,toolName:i.toolName,state:"output-error",input:void 0,rawInput:i.input,errorText:i.errorText,providerExecuted:i.providerExecuted,providerMetadata:i.providerMetadata}),c();break}case"tool-approval-request":{let g=x(i.toolCallId);g.state="approval-requested",g.approval={id:i.approvalId},c();break}case"tool-output-denied":{let g=x(i.toolCallId);g.state="output-denied",c();break}case"tool-output-available":{let g=x(i.toolCallId);g.type==="dynamic-tool"?y({toolCallId:i.toolCallId,toolName:g.toolName,state:"output-available",input:g.input,output:i.output,preliminary:i.preliminary,providerExecuted:i.providerExecuted,providerMetadata:i.providerMetadata,title:g.title}):v({toolCallId:i.toolCallId,toolName:P2(g),state:"output-available",input:g.input,output:i.output,providerExecuted:i.providerExecuted,preliminary:i.preliminary,providerMetadata:i.providerMetadata,title:g.title}),c();break}case"tool-output-error":{let g=x(i.toolCallId);g.type==="dynamic-tool"?y({toolCallId:i.toolCallId,toolName:g.toolName,state:"output-error",input:g.input,errorText:i.errorText,providerExecuted:i.providerExecuted,providerMetadata:i.providerMetadata,title:g.title}):v({toolCallId:i.toolCallId,toolName:P2(g),state:"output-error",input:g.input,rawInput:g.rawInput,errorText:i.errorText,providerExecuted:i.providerExecuted,providerMetadata:i.providerMetadata,title:g.title}),c();break}case"start-step":{u.message.parts.push({type:"step-start"});break}case"finish-step":{u.activeTextParts={},u.activeReasoningParts={};break}case"start":{i.messageId!=null&&(u.message.id=i.messageId),await w(i.messageMetadata),(i.messageId!=null||i.messageMetadata!=null)&&c();break}case"finish":{i.finishReason!=null&&(u.finishReason=i.finishReason),await w(i.messageMetadata),i.messageMetadata!=null&&c();break}case"message-metadata":{await w(i.messageMetadata),i.messageMetadata!=null&&c();break}case"error":{r?.(new Error(i.errorText));break}default:if(E9(i)){if(a?.[i.type]!=null){let A=u.message.parts.findIndex(M=>"id"in M&&"data"in M&&M.id===i.id&&M.type===i.type),S=A>=0?A:u.message.parts.length;await Mf({value:i.data,schema:a[i.type],context:{field:`message.parts[${S}].data`,entityName:i.type,entityId:i.id}})}let g=i;if(g.transient){l?.(g);break}let C=g.id!=null?u.message.parts.find(A=>g.type===A.type&&g.id===A.id):void 0;C!=null?C.data=g.data:u.message.parts.push(g),l?.(g),c()}}s.enqueue(i)})}}))}async function O9({stream:e,onError:t}){let a=e.getReader();try{for(;;){let{done:n}=await a.read();if(n)break}}catch(n){t?.(n)}finally{a.releaseLock()}}var Yne=rr({prefix:"aitxt",size:24});var tre=Lf(()=>cu(h.array(h.object({id:h.string(),role:h.enum(["system","user","assistant"]),metadata:h.unknown().optional(),parts:h.array(h.union([h.object({type:h.literal("text"),text:h.string(),state:h.enum(["streaming","done"]).optional(),providerMetadata:X.optional()}),h.object({type:h.literal("reasoning"),text:h.string(),state:h.enum(["streaming","done"]).optional(),providerMetadata:X.optional()}),h.object({type:h.literal("source-url"),sourceId:h.string(),url:h.string(),title:h.string().optional(),providerMetadata:X.optional()}),h.object({type:h.literal("source-document"),sourceId:h.string(),mediaType:h.string(),title:h.string(),filename:h.string().optional(),providerMetadata:X.optional()}),h.object({type:h.literal("file"),mediaType:h.string(),filename:h.string().optional(),url:h.string(),providerMetadata:X.optional()}),h.object({type:h.literal("step-start")}),h.object({type:h.string().startsWith("data-"),id:h.string().optional(),data:h.unknown()}),h.object({type:h.literal("dynamic-tool"),toolName:h.string(),toolCallId:h.string(),state:h.literal("input-streaming"),input:h.unknown().optional(),providerExecuted:h.boolean().optional(),callProviderMetadata:X.optional(),output:h.never().optional(),errorText:h.never().optional(),approval:h.never().optional()}),h.object({type:h.literal("dynamic-tool"),toolName:h.string(),toolCallId:h.string(),state:h.literal("input-available"),input:h.unknown(),providerExecuted:h.boolean().optional(),output:h.never().optional(),errorText:h.never().optional(),callProviderMetadata:X.optional(),approval:h.never().optional()}),h.object({type:h.literal("dynamic-tool"),toolName:h.string(),toolCallId:h.string(),state:h.literal("approval-requested"),input:h.unknown(),providerExecuted:h.boolean().optional(),output:h.never().optional(),errorText:h.never().optional(),callProviderMetadata:X.optional(),approval:h.object({id:h.string(),approved:h.never().optional(),reason:h.never().optional()})}),h.object({type:h.literal("dynamic-tool"),toolName:h.string(),toolCallId:h.string(),state:h.literal("approval-responded"),input:h.unknown(),providerExecuted:h.boolean().optional(),output:h.never().optional(),errorText:h.never().optional(),callProviderMetadata:X.optional(),approval:h.object({id:h.string(),approved:h.boolean(),reason:h.string().optional()})}),h.object({type:h.literal("dynamic-tool"),toolName:h.string(),toolCallId:h.string(),state:h.literal("output-available"),input:h.unknown(),providerExecuted:h.boolean().optional(),output:h.unknown(),errorText:h.never().optional(),callProviderMetadata:X.optional(),resultProviderMetadata:X.optional(),preliminary:h.boolean().optional(),approval:h.object({id:h.string(),approved:h.literal(!0),reason:h.string().optional()}).optional()}),h.object({type:h.literal("dynamic-tool"),toolName:h.string(),toolCallId:h.string(),state:h.literal("output-error"),input:h.unknown(),rawInput:h.unknown().optional(),providerExecuted:h.boolean().optional(),output:h.never().optional(),errorText:h.string(),callProviderMetadata:X.optional(),resultProviderMetadata:X.optional(),approval:h.object({id:h.string(),approved:h.literal(!0),reason:h.string().optional()}).optional()}),h.object({type:h.literal("dynamic-tool"),toolName:h.string(),toolCallId:h.string(),state:h.literal("output-denied"),input:h.unknown(),providerExecuted:h.boolean().optional(),output:h.never().optional(),errorText:h.never().optional(),callProviderMetadata:X.optional(),approval:h.object({id:h.string(),approved:h.literal(!1),reason:h.string().optional()})}),h.object({type:h.string().startsWith("tool-"),toolCallId:h.string(),state:h.literal("input-streaming"),providerExecuted:h.boolean().optional(),callProviderMetadata:X.optional(),input:h.unknown().optional(),output:h.never().optional(),errorText:h.never().optional(),approval:h.never().optional()}),h.object({type:h.string().startsWith("tool-"),toolCallId:h.string(),state:h.literal("input-available"),providerExecuted:h.boolean().optional(),input:h.unknown(),output:h.never().optional(),errorText:h.never().optional(),callProviderMetadata:X.optional(),approval:h.never().optional()}),h.object({type:h.string().startsWith("tool-"),toolCallId:h.string(),state:h.literal("approval-requested"),input:h.unknown(),providerExecuted:h.boolean().optional(),output:h.never().optional(),errorText:h.never().optional(),callProviderMetadata:X.optional(),approval:h.object({id:h.string(),approved:h.never().optional(),reason:h.never().optional()})}),h.object({type:h.string().startsWith("tool-"),toolCallId:h.string(),state:h.literal("approval-responded"),input:h.unknown(),providerExecuted:h.boolean().optional(),output:h.never().optional(),errorText:h.never().optional(),callProviderMetadata:X.optional(),approval:h.object({id:h.string(),approved:h.boolean(),reason:h.string().optional()})}),h.object({type:h.string().startsWith("tool-"),toolCallId:h.string(),state:h.literal("output-available"),providerExecuted:h.boolean().optional(),input:h.unknown(),output:h.unknown(),errorText:h.never().optional(),callProviderMetadata:X.optional(),resultProviderMetadata:X.optional(),preliminary:h.boolean().optional(),approval:h.object({id:h.string(),approved:h.literal(!0),reason:h.string().optional()}).optional()}),h.object({type:h.string().startsWith("tool-"),toolCallId:h.string(),state:h.literal("output-error"),providerExecuted:h.boolean().optional(),input:h.unknown(),rawInput:h.unknown().optional(),output:h.never().optional(),errorText:h.string(),callProviderMetadata:X.optional(),resultProviderMetadata:X.optional(),approval:h.object({id:h.string(),approved:h.literal(!0),reason:h.string().optional()}).optional()}),h.object({type:h.string().startsWith("tool-"),toolCallId:h.string(),state:h.literal("output-denied"),providerExecuted:h.boolean().optional(),input:h.unknown(),output:h.never().optional(),errorText:h.never().optional(),callProviderMetadata:X.optional(),approval:h.object({id:h.string(),approved:h.literal(!1),reason:h.string().optional()})})])).nonempty("Message must contain at least one part")})).nonempty("Messages array must not be empty")));var nre=rr({prefix:"aiobj",size:24});function W2(e){return({url:t,abortSignal:a})=>f9({url:t,maxBytes:e?.maxBytes,abortSignal:a})}var P9=class{constructor(){this.queue=[],this.isProcessing=!1}async processQueue(){if(!this.isProcessing){for(this.isProcessing=!0;this.queue.length>0;)await this.queue[0](),this.queue.shift();this.isProcessing=!1}}async run(e){return new Promise((t,a)=>{this.queue.push(async()=>{try{await e(),t()}catch(n){a(n)}}),this.processQueue()})}};var ore=rr({prefix:"aiobj",size:24});var lre=W2();var N9="AI_NoSuchProviderError",B9=`vercel.ai.error.${N9}`,U9=Symbol.for(B9),F9;F9=U9;var ire=W2();async function z9(e){if(e==null)return[];if(!globalThis.FileList||!(e instanceof globalThis.FileList))throw new Error("FileList is not supported in the current environment");return Promise.all(Array.from(e).map(async t=>{let{name:a,type:n}=t,r=await new Promise((o,l)=>{let i=new FileReader;i.onload=s=>{var u;o((u=s.target)==null?void 0:u.result)},i.onerror=s=>l(s),i.readAsDataURL(t)});return{type:"file",mediaType:n,filename:a,url:r}}))}var q9=class{constructor({api:e="/api/chat",credentials:t,headers:a,body:n,fetch:r,prepareSendMessagesRequest:o,prepareReconnectToStreamRequest:l}){this.api=e,this.credentials=t,this.headers=a,this.body=n,this.fetch=r,this.prepareSendMessagesRequest=o,this.prepareReconnectToStreamRequest=l}async sendMessages({abortSignal:e,...t}){var a,n,r,o,l;let i=await Cn(this.body),s=await Cn(this.headers),u=await Cn(this.credentials),c={...Zr(s),...Zr(t.headers)},d=await((a=this.prepareSendMessagesRequest)==null?void 0:a.call(this,{api:this.api,id:t.chatId,messages:t.messages,body:{...i,...t.body},headers:c,credentials:u,requestMetadata:t.metadata,trigger:t.trigger,messageId:t.messageId})),f=(n=d?.api)!=null?n:this.api,p=d?.headers!==void 0?Zr(d.headers):c,m=d?.body!==void 0?d.body:{...i,...t.body,id:t.chatId,messages:t.messages,trigger:t.trigger,messageId:t.messageId},x=(r=d?.credentials)!=null?r:u,y=await((o=this.fetch)!=null?o:globalThis.fetch)(f,{method:"POST",headers:{"Content-Type":"application/json",...p},body:JSON.stringify(m),credentials:x,signal:e});if(!y.ok)throw new Error((l=await y.text())!=null?l:"Failed to fetch the chat response.");if(!y.body)throw new Error("The response body is empty.");return this.processResponseStream(y.body)}async reconnectToStream(e){var t,a,n,r,o;let l=await Cn(this.body),i=await Cn(this.headers),s=await Cn(this.credentials),u={...Zr(i),...Zr(e.headers)},c=await((t=this.prepareReconnectToStreamRequest)==null?void 0:t.call(this,{api:this.api,id:e.chatId,body:{...l,...e.body},headers:u,credentials:s,requestMetadata:e.metadata})),d=(a=c?.api)!=null?a:`${this.api}/${e.chatId}/stream`,f=c?.headers!==void 0?Zr(c.headers):u,p=(n=c?.credentials)!=null?n:s,x=await((r=this.fetch)!=null?r:globalThis.fetch)(d,{method:"GET",headers:f,credentials:p});if(x.status===204)return null;if(!x.ok)throw new Error((o=await x.text())!=null?o:"Failed to fetch the chat response.");if(!x.body)throw new Error("The response body is empty.");return this.processResponseStream(x.body)}},Xw=class extends q9{constructor(e={}){super(e)}processResponseStream(e){return O2({stream:e,schema:Ww}).pipeThrough(new TransformStream({async transform(t,a){if(!t.success)throw t.error;a.enqueue(t.value)}}))}},X2=class{constructor({generateId:e=A2,id:t=e(),transport:a=new Xw,messageMetadataSchema:n,dataPartSchemas:r,state:o,onError:l,onToolCall:i,onFinish:s,onData:u,sendAutomaticallyWhen:c}){this.activeResponse=void 0,this.jobExecutor=new P9,this.sendMessage=async(d,f)=>{var p,m,x,v;if(d==null){await this.makeRequest({trigger:"submit-message",messageId:(p=this.lastMessage)==null?void 0:p.id,...f});return}let y;if("text"in d||"files"in d?y={parts:[...Array.isArray(d.files)?d.files:await z9(d.files),..."text"in d&&d.text!=null?[{type:"text",text:d.text}]:[]]}:y=d,d.messageId!=null){let w=this.state.messages.findIndex(g=>g.id===d.messageId);if(w===-1)throw new Error(`message with id ${d.messageId} not found`);if(this.state.messages[w].role!=="user")throw new Error(`message with id ${d.messageId} is not a user message`);this.state.messages=this.state.messages.slice(0,w+1),this.state.replaceMessage(w,{...y,id:d.messageId,role:(m=y.role)!=null?m:"user",metadata:d.metadata})}else this.state.pushMessage({...y,id:(x=y.id)!=null?x:this.generateId(),role:(v=y.role)!=null?v:"user",metadata:d.metadata});await this.makeRequest({trigger:"submit-message",messageId:d.messageId,...f})},this.regenerate=async({messageId:d,...f}={})=>{let p=d==null?this.state.messages.length-1:this.state.messages.findIndex(m=>m.id===d);if(p===-1)throw new Error(`message ${d} not found`);this.state.messages=this.state.messages.slice(0,this.messages[p].role==="assistant"?p:p+1),await this.makeRequest({trigger:"regenerate-message",messageId:d,...f})},this.resumeStream=async(d={})=>{await this.makeRequest({trigger:"resume-stream",...d})},this.clearError=()=>{this.status==="error"&&(this.state.error=void 0,this.setStatus({status:"ready"}))},this.addToolApprovalResponse=async({id:d,approved:f,reason:p,options:m})=>this.jobExecutor.run(async()=>{let x=this.state.messages,v=x[x.length-1],y=w=>Ef(w)&&w.state==="approval-requested"&&w.approval.id===d?{...w,state:"approval-responded",approval:{id:d,approved:f,reason:p}}:w;this.state.replaceMessage(x.length-1,{...v,parts:v.parts.map(y)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(y)),this.status!=="streaming"&&this.status!=="submitted"&&this.sendAutomaticallyWhen&&this.shouldSendAutomatically().then(w=>{var g;w&&this.makeRequest({trigger:"submit-message",messageId:(g=this.lastMessage)==null?void 0:g.id,...m})})}),this.addToolOutput=async({state:d="output-available",toolCallId:f,output:p,errorText:m,options:x})=>this.jobExecutor.run(async()=>{let v=this.state.messages,y=v[v.length-1],w=g=>Ef(g)&&g.toolCallId===f?{...g,state:d,output:p,errorText:m}:g;this.state.replaceMessage(v.length-1,{...y,parts:y.parts.map(w)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(w)),this.status!=="streaming"&&this.status!=="submitted"&&this.sendAutomaticallyWhen&&this.shouldSendAutomatically().then(g=>{var C;g&&this.makeRequest({trigger:"submit-message",messageId:(C=this.lastMessage)==null?void 0:C.id,...x})})}),this.addToolResult=this.addToolOutput,this.stop=async()=>{var d;this.status!=="streaming"&&this.status!=="submitted"||(d=this.activeResponse)!=null&&d.abortController&&this.activeResponse.abortController.abort()},this.id=t,this.transport=a,this.generateId=e,this.messageMetadataSchema=n,this.dataPartSchemas=r,this.state=o,this.onError=l,this.onToolCall=i,this.onFinish=s,this.onData=u,this.sendAutomaticallyWhen=c}get status(){return this.state.status}setStatus({status:e,error:t}){this.status!==e&&(this.state.status=e,this.state.error=t)}get error(){return this.state.error}get messages(){return this.state.messages}get lastMessage(){return this.state.messages[this.state.messages.length-1]}set messages(e){this.state.messages=e}async shouldSendAutomatically(){if(!this.sendAutomaticallyWhen)return!1;let e=this.sendAutomaticallyWhen({messages:this.state.messages});return e&&typeof e=="object"&&"then"in e?await e:e}async makeRequest({trigger:e,metadata:t,headers:a,body:n,messageId:r}){var o,l,i;let s;if(e==="resume-stream")try{let p=await this.transport.reconnectToStream({chatId:this.id,metadata:t,headers:a,body:n});if(p==null)return;s=p}catch(p){this.onError&&p instanceof Error&&this.onError(p),this.setStatus({status:"error",error:p});return}this.setStatus({status:"submitted",error:void 0});let u=this.lastMessage,c=!1,d=!1,f=!1;try{let p={state:D9({lastMessage:this.state.snapshot(u),messageId:this.generateId()}),abortController:new AbortController};p.abortController.signal.addEventListener("abort",()=>{c=!0}),this.activeResponse=p;let m;e==="resume-stream"?m=s:m=await this.transport.sendMessages({chatId:this.id,messages:this.state.messages,abortSignal:p.abortController.signal,metadata:t,headers:a,body:n,trigger:e,messageId:r});let x=v=>this.jobExecutor.run(()=>v({state:p.state,write:()=>{var y;this.setStatus({status:"streaming"}),p.state.message.id===((y=this.lastMessage)==null?void 0:y.id)?this.state.replaceMessage(this.state.messages.length-1,p.state.message):this.state.pushMessage(p.state.message)}}));await O9({stream:_9({stream:m,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:x,onError:v=>{throw v}}),onError:v=>{throw v}}),this.setStatus({status:"ready"})}catch(p){if(c||p.name==="AbortError")return c=!0,this.setStatus({status:"ready"}),null;f=!0,p instanceof TypeError&&(p.message.toLowerCase().includes("fetch")||p.message.toLowerCase().includes("network"))&&(d=!0),this.onError&&p instanceof Error&&this.onError(p),this.setStatus({status:"error",error:p})}finally{try{(l=this.onFinish)==null||l.call(this,{message:this.activeResponse.state.message,messages:this.state.messages,isAbort:c,isDisconnect:d,isError:f,finishReason:(o=this.activeResponse)==null?void 0:o.state.finishReason})}catch(p){console.error(p)}this.activeResponse=void 0}!f&&await this.shouldSendAutomatically()&&await this.makeRequest({trigger:"submit-message",messageId:(i=this.lastMessage)==null?void 0:i.id,metadata:t,headers:a,body:n})}};var J2=z(Z2(),1);var gu=z(De(),1);var _f=z(De(),1);var Y2=(e,t,a)=>{if(!t.has(e))throw TypeError("Cannot "+a)},dt=(e,t,a)=>(Y2(e,t,"read from private field"),a?a.call(e):t.get(e)),In=(e,t,a)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,a)},Yr=(e,t,a,n)=>(Y2(e,t,"write to private field"),n?n.call(e,a):t.set(e,a),a);function j9(e,t){return t!=null?(0,J2.default)(e,t):e}var Qa,Rf,Df,pu,mu,hu,li,Kw,Zw,V9=class{constructor(e=[]){In(this,Qa,void 0),In(this,Rf,"ready"),In(this,Df,void 0),In(this,pu,new Set),In(this,mu,new Set),In(this,hu,new Set),this.pushMessage=t=>{Yr(this,Qa,dt(this,Qa).concat(t)),dt(this,li).call(this)},this.popMessage=()=>{Yr(this,Qa,dt(this,Qa).slice(0,-1)),dt(this,li).call(this)},this.replaceMessage=(t,a)=>{Yr(this,Qa,[...dt(this,Qa).slice(0,t),this.snapshot(a),...dt(this,Qa).slice(t+1)]),dt(this,li).call(this)},this.snapshot=t=>structuredClone(t),this["~registerMessagesCallback"]=(t,a)=>{let n=a?j9(t,a):t;return dt(this,pu).add(n),()=>{dt(this,pu).delete(n)}},this["~registerStatusCallback"]=t=>(dt(this,mu).add(t),()=>{dt(this,mu).delete(t)}),this["~registerErrorCallback"]=t=>(dt(this,hu).add(t),()=>{dt(this,hu).delete(t)}),In(this,li,()=>{dt(this,pu).forEach(t=>t())}),In(this,Kw,()=>{dt(this,mu).forEach(t=>t())}),In(this,Zw,()=>{dt(this,hu).forEach(t=>t())}),Yr(this,Qa,e)}get status(){return dt(this,Rf)}set status(e){Yr(this,Rf,e),dt(this,Kw).call(this)}get error(){return dt(this,Df)}set error(e){Yr(this,Df,e),dt(this,Zw).call(this)}get messages(){return dt(this,Qa)}set messages(e){Yr(this,Qa,[...e]),dt(this,li).call(this)}};Qa=new WeakMap;Rf=new WeakMap;Df=new WeakMap;pu=new WeakMap;mu=new WeakMap;hu=new WeakMap;li=new WeakMap;Kw=new WeakMap;Zw=new WeakMap;var ii,Q2=class extends X2{constructor({messages:e,...t}){let a=new V9(e);super({...t,state:a}),In(this,ii,void 0),this["~registerMessagesCallback"]=(n,r)=>dt(this,ii)["~registerMessagesCallback"](n,r),this["~registerStatusCallback"]=n=>dt(this,ii)["~registerStatusCallback"](n),this["~registerErrorCallback"]=n=>dt(this,ii)["~registerErrorCallback"](n),Yr(this,ii,a)}};ii=new WeakMap;function eD({experimental_throttle:e,resume:t=!1,...a}={}){let n=(0,Ya.useRef)("chat"in a?{}:{onToolCall:a.onToolCall,onData:a.onData,onFinish:a.onFinish,onError:a.onError,sendAutomaticallyWhen:a.sendAutomaticallyWhen});"chat"in a||(n.current={onToolCall:a.onToolCall,onData:a.onData,onFinish:a.onFinish,onError:a.onError,sendAutomaticallyWhen:a.sendAutomaticallyWhen});let r={...a,onToolCall:f=>{var p,m;return(m=(p=n.current).onToolCall)==null?void 0:m.call(p,f)},onData:f=>{var p,m;return(m=(p=n.current).onData)==null?void 0:m.call(p,f)},onFinish:f=>{var p,m;return(m=(p=n.current).onFinish)==null?void 0:m.call(p,f)},onError:f=>{var p,m;return(m=(p=n.current).onError)==null?void 0:m.call(p,f)},sendAutomaticallyWhen:f=>{var p,m,x;return(x=(m=(p=n.current).sendAutomaticallyWhen)==null?void 0:m.call(p,f))!=null?x:!1}},o=(0,Ya.useRef)("chat"in a?a.chat:new Q2(r));("chat"in a&&a.chat!==o.current||"id"in a&&o.current.id!==a.id)&&(o.current="chat"in a?a.chat:new Q2(r));let i=(0,Ya.useCallback)(f=>o.current["~registerMessagesCallback"](f,e),[e,o.current.id]),s=(0,Ya.useSyncExternalStore)(i,()=>o.current.messages,()=>o.current.messages),u=(0,Ya.useSyncExternalStore)(o.current["~registerStatusCallback"],()=>o.current.status,()=>o.current.status),c=(0,Ya.useSyncExternalStore)(o.current["~registerErrorCallback"],()=>o.current.error,()=>o.current.error),d=(0,Ya.useCallback)(f=>{typeof f=="function"&&(f=f(o.current.messages)),o.current.messages=f},[o]);return(0,Ya.useEffect)(()=>{t&&o.current.resumeStream()},[t,o]),{id:o.current.id,messages:s,setMessages:d,sendMessage:o.current.sendMessage,regenerate:o.current.regenerate,clearError:o.current.clearError,stop:o.current.stop,error:c,resumeStream:o.current.resumeStream,status:u,addToolResult:o.current.addToolOutput,addToolOutput:o.current.addToolOutput,addToolApprovalResponse:o.current.addToolApprovalResponse}}var K=z(De(),1);function si(e,t,a){let[n,r=""]=e.split("?"),o=n.replace(/\/$/,""),l=new URLSearchParams(r);if(a)for(let[s,u]of Object.entries(a))l.set(s,u);let i=l.toString();return`${o}${t}${i?`?${i}`:""}`}function G9(e){let t=e?.cause,a=t?.issues??t?.errors;if(!Array.isArray(a))return null;let n=a.find(r=>r.code==="invalid_union");if(!n?.errors)return null;for(let r of n.errors){if(!Array.isArray(r)||r.some(i=>(i.code==="invalid_value"||i.code==="invalid_literal")&&i.path?.[0]==="type"))continue;let l=r.filter(i=>i.code==="unrecognized_keys").flatMap(i=>i.keys??[]);if(l.length>0)return l}return null}var Of=class extends Xw{processResponseStream(t){let a="",n=Ww(),r=n.validate?.bind(n);return t.pipeThrough(new TextDecoderStream).pipeThrough(new TransformStream({async transform(o,l){a+=o;let i=a.split(`
|
|
138
|
+
`);a=i.pop()??"";for(let s of i){let u=s.trim();if(!u.startsWith("data:"))continue;let c=u.slice(5).trim();if(c!=="[DONE]")try{let d=JSON.parse(c);if(!r){l.enqueue(d);continue}let f=await r(d);if(f.success){l.enqueue(f.value);continue}let p=G9(f.error);if(p?.length){let m={...d};for(let v of p)delete m[v];let x=await r(m);x.success&&l.enqueue(x.value)}}catch{}}}}))}};var tD=50,aD=1e3;function Pf(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.threadId=="string"&&typeof t.memoryUserId=="string"&&typeof t.title=="string"&&Array.isArray(t.messages)&&typeof t.createdAt=="string"&&typeof t.updatedAt=="string"}async function Nf(e){if(typeof indexedDB>"u")return null;let t=null;try{return t=await Uh(),await e(t)}catch{return null}finally{try{t?.close()}catch{}}}function Qw(e){return new Promise((t,a)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>a(e.error)})}async function Yw(e){return await Nf(async a=>{let o=a.transaction(Ra,"readonly").objectStore(Ra).index(ed),i=(await Qw(o.getAll(e))??[]).filter(Pf);return i.sort((s,u)=>s.updatedAt<u.updatedAt?1:-1),i})??[]}async function Bf(e){return await Nf(async a=>{let r=a.transaction(Ra,"readonly").objectStore(Ra),o=await Qw(r.get(e));return Pf(o)?o:null})??null}async function Jw(e){if(!Pf(e))return;let t=e.messages.length>aD?{...e,messages:e.messages.slice(e.messages.length-aD)}:e;await Nf(async a=>{await new Promise((s,u)=>{let c=a.transaction(Ra,"readwrite");c.oncomplete=()=>s(),c.onerror=()=>u(c.error),c.onabort=()=>u(c.error),c.objectStore(Ra).put(t)});let n=a.transaction(Ra,"readwrite"),r=n.objectStore(Ra),o=r.index(ed),i=(await Qw(o.getAll(t.memoryUserId))??[]).filter(Pf);if(i.length>tD){i.sort((u,c)=>u.updatedAt<c.updatedAt?-1:1);let s=i.slice(0,i.length-tD);for(let u of s)r.delete(u.threadId)}return await new Promise((s,u)=>{n.oncomplete=()=>s(),n.onerror=()=>u(n.error),n.onabort=()=>u(n.error)}),null})}async function nD(e){await Nf(async t=>(await new Promise((a,n)=>{let r=t.transaction(Ra,"readwrite");r.oncomplete=()=>a(),r.onerror=()=>n(r.error),r.onabort=()=>n(r.error),r.objectStore(Ra).delete(e)}),null))}async function ex(e){return(await Yw(e))[0]?.threadId??null}function rD(e){let t=e.trim();if(!t)return`Conversation on ${new Date().toISOString().slice(0,10)}`;let a=t.split(/\r?\n/,1)[0]??t;return a.length<=60?a:`${a.slice(0,60).trimEnd()}\u2026`}var $9="x-session-id",W9=250;function oD(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():As()}function Uf(){return new Date().toISOString()}function lD(e){if(typeof e!="string")return;let t=e.trim();return t.length>0?t:void 0}async function X9(e,t){let a=si(e,"/tools"),n=await fetch(a,{method:"GET",headers:t?{...t}:void 0});if(!n.ok)throw new Error(`[Waniwani] Failed to fetch /tools: ${n.status} ${n.statusText}`);let r=await n.json();if(!r||!Array.isArray(r.tools))return{};let o={};for(let l of r.tools)l&&typeof l.name=="string"&&(o[l.name]=l);return o}function iD(e){let{api:t="/api/waniwani",headers:a,body:n,onMessageSent:r,onResponseReceived:o,enableThreadHistory:l=!1,activeThreadId:i,onThreadChange:s}=e,u=(0,K.useRef)(a),c=(0,K.useRef)(n),d=(0,K.useRef)(l);(0,K.useEffect)(()=>{d.current=l},[l]);let f=(0,K.useRef)(void 0),p=(0,K.useRef)(null),[m,x]=(0,K.useState)(void 0),v=(0,K.useRef)(m),[y,w]=(0,K.useState)(i),g=(0,K.useRef)(y),[C,A]=(0,K.useState)([]),[S,M]=(0,K.useState)(!l),R=(0,K.useRef)(void 0),D=(0,K.useRef)(void 0),L=(0,K.useRef)(void 0),G=(0,K.useRef)(void 0),B=(0,K.useRef)(0),U=(0,K.useRef)(s);(0,K.useEffect)(()=>{U.current=s},[s]);let W=(0,K.useCallback)(N=>{g.current=N,w(N),N&&U.current?.(N)},[]),E=(0,K.useCallback)(async()=>{if(!l)return;let N=p.current?.memoryUserId;if(!N)return;let ne=await Yw(N);A(ne)},[l]),j=(0,K.useCallback)(()=>v.current,[]),$=(0,K.useCallback)(N=>{let ne=lD(N);ne&&v.current!==ne&&(v.current=ne,x(ne))},[]),he=(0,K.useCallback)(()=>{v.current=void 0,x(void 0)},[]);(0,K.useEffect)(()=>{u.current=a},[a]),(0,K.useEffect)(()=>{c.current=n},[n]),(0,K.useEffect)(()=>{let N=!1,ne=B.current;return(async()=>{try{let gt=await So();if(N)return;p.current=gt}catch{}if(!l)return;let ee=p.current?.memoryUserId;if(!ee){M(!0);return}try{let gt=i??await ex(ee);if(N||ne!==B.current)return;if(gt){let Ze=await Bf(gt);if(N||ne!==B.current)return;Ze&&Ze.memoryUserId===ee&&(g.current=Ze.threadId,w(Ze.threadId),R.current=Ze.createdAt,D.current=Ze.title,Ze.sessionId&&(v.current=Ze.sessionId,x(Ze.sessionId)),Ee(Ze.messages))}await E()}finally{N||M(!0)}})(),()=>{N=!0}},[]);let Ie=(0,K.useRef)(new Of({api:t,headers:()=>({...u.current}),body:()=>{let N={...c.current??{}},ne=Object.hasOwn(N,"sessionId"),ee=lD(N.sessionId);if(ee)$(ee),N.sessionId=ee;else if(ne)he(),delete N.sessionId;else{let Pa=j();Pa&&(N.sessionId=Pa)}if(ti(f.current)&&(N.modelContext=f.current),p.current){let Pa=p.current;N.visitorContext={timezone:Pa.timezone,language:Pa.language,languages:Pa.languages,deviceType:Pa.deviceType,referrer:Pa.referrer,visitorId:Pa.visitorId};let Tn=typeof N.visitor=="object"&&N.visitor!==null?N.visitor:{},kD=typeof Tn.client=="object"&&Tn.client!==null?Tn.client:{};N.visitor={...Tn,id:Pa.visitorId,client:{...kD,memoryUserId:Pa.memoryUserId}}}let gt=typeof N.extra=="object"&&N.extra!==null&&!Array.isArray(N.extra)?N.extra:void 0,Ze=p.current?.memoryUserId,Ot=p.current?.language,vu={};if(Ze&&(vu.memoryUserId=Ze),Ot&&(vu.locale=Ot),(Object.keys(vu).length>0||gt)&&(N.extra={...vu,...gt??{}}),d.current)if(Object.hasOwn(N,"threadId"))typeof N.threadId=="string"&&(g.current=N.threadId);else{let Tn=g.current;Tn||(Tn=oD(),R.current=Uf(),D.current=void 0,W(Tn)),N.threadId=Tn}return N},fetch:(async(N,ne)=>{let ee=await fetch(N,ne);return f.current=void 0,$(ee.headers.get($9)),ee})})),b=(0,K.useRef)(null),qe=(0,K.useRef)(null),rt=(0,K.useRef)({}),[k,ke]=(0,K.useState)(0),ie=e.skipRemoteConfig===!0,ge=(0,K.useCallback)(async()=>{if(!ie)try{let N=await X9(t,u.current);rt.current=N,ke(ne=>ne+1)}catch(N){console.warn("[Waniwani] Failed to fetch tool definitions:",N instanceof Error?N.message:N)}},[t,ie]);(0,K.useEffect)(()=>{ge()},[ge]);let{messages:It,sendMessage:Le,setMessages:Ee,status:ye}=eD({messages:e.initialMessages,transport:Ie.current,onFinish({message:N}){o?.(),b.current&&(qe.current=N)},onError(N){console.warn("[Waniwani] Chat error:",N.message),b.current&&(b.current.reject(N),b.current=null)}}),we=(0,K.useRef)(It);(0,K.useEffect)(()=>{we.current=It},[It]);let fe=(0,K.useRef)(l);(0,K.useEffect)(()=>{if(!l||fe.current||(fe.current=!0,we.current.length>0))return;let N=!1,ne=B.current;return M(!1),(async()=>{try{let ee=p.current;if(!ee)try{ee=await So(),p.current=ee}catch{}let gt=ee?.memoryUserId;if(!gt||N||ne!==B.current){N||M(!0);return}let Ze=i??await ex(gt);if(N||ne!==B.current)return;if(Ze){let Ot=await Bf(Ze);if(N||ne!==B.current)return;Ot&&Ot.memoryUserId===gt&&(g.current=Ot.threadId,w(Ot.threadId),R.current=Ot.createdAt,D.current=Ot.title,Ot.sessionId&&(v.current=Ot.sessionId,x(Ot.sessionId)),Ee(Ot.messages))}await E()}finally{N||M(!0)}})(),()=>{N=!0}},[l]),(0,K.useEffect)(()=>{if(ye==="ready"&&b.current&&qe.current){let N=b.current,ne=qe.current;b.current=null,qe.current=null,N.resolve(ne)}},[ye]);let[Ue,Te]=(0,K.useState)(""),[je,ot]=(0,K.useState)([]),Y=ye==="submitted"||ye==="streaming",Re=(0,K.useCallback)(N=>{ot(ne=>ne.filter(ee=>ee.id!==N))},[]),ht=Y&&je.length>0,jt=(0,K.useCallback)(N=>{let ne=!!N.text?.trim(),ee=!!N.files?.length;if(ne||ee){if(Y){if(je.length>0)return;ot(gt=>[...gt,{id:As(),text:N.text||"",files:N.files??[],modelContext:N.modelContext}]),Te("");return}f.current=N.modelContext,Le({text:N.text||"",files:N.files}),r?.(N.text||""),Te("")}},[Le,r,Y,je.length]),eo=(0,K.useCallback)(N=>new Promise((ne,ee)=>{b.current={resolve:ne,reject:ee},Le({text:N}),r?.(N)}),[Le,r]);(0,K.useEffect)(()=>{if(ye!=="ready"||je.length===0)return;let[N,...ne]=je;ot(ne),f.current=N.modelContext,Le({text:N.text,files:N.files.length>0?N.files:void 0}),r?.(N.text)},[ye,Le,r,je]);let ir=(0,K.useCallback)(()=>{Ee([]),ot([]),he(),Te(""),rt.current={},ke(N=>N+1),ge()},[Ee,he,ge]),sr=(0,K.useCallback)(()=>{if(!d.current)return;let N=p.current?.memoryUserId,ne=g.current,ee=we.current;if(!(!N||!ne||ee.length===0)){if(R.current||(R.current=Uf()),!D.current){let gt=ee.find(Ot=>Ot.role==="user"),Ze=gt?gt.parts.map(Ot=>"text"in Ot&&typeof Ot.text=="string"?Ot.text:"").join(" "):"";D.current=rD(Ze)}return{threadId:ne,memoryUserId:N,title:D.current,messages:ee,sessionId:v.current,createdAt:R.current,updatedAt:Uf()}}},[]),xu=(0,K.useCallback)(async()=>{let N=sr();N&&(await Jw(N),await E())},[sr,E]);(0,K.useEffect)(()=>{if(l&&S&&!(ye==="submitted"||ye==="streaming")&&It.length!==0)return L.current&&clearTimeout(L.current),L.current=setTimeout(()=>{L.current=void 0;let N=xu().finally(()=>{G.current===N&&(G.current=void 0)});G.current=N},W9),()=>{L.current&&clearTimeout(L.current)}},[l,S,It,ye,xu]);let Go=(0,K.useCallback)(()=>{let N=G.current,ne=L.current,ee=ne?sr():void 0;return ne&&(clearTimeout(ne),L.current=void 0),(async()=>{N&&await N,ee&&(await Jw(ee),await E())})()},[sr,E]),O=(0,K.useCallback)(()=>{B.current+=1,Go(),Ee([]),ot([]),he(),Te("");let N=oD();return R.current=Uf(),D.current=void 0,W(N),E(),N},[Ee,he,W,E,Go]),q=(0,K.useCallback)(async N=>{B.current+=1;let ne=B.current;if(await Go(),ne!==B.current)return;let ee=await Bf(N);ne===B.current&&ee&&(W(ee.threadId),R.current=ee.createdAt,D.current=ee.title,ee.sessionId?(v.current=ee.sessionId,x(ee.sessionId)):he(),Ee(ee.messages),ot([]),Te(""))},[Ee,he,W,Go]),oe=(0,K.useCallback)(async N=>{if(g.current===N){B.current+=1,L.current&&(clearTimeout(L.current),L.current=void 0);let ne=G.current;ne&&await ne}await nD(N),await E(),g.current===N&&(Ee([]),ot([]),he(),Te(""),g.current=void 0,w(void 0),R.current=void 0,D.current=void 0)},[Ee,he,E]);(0,K.useEffect)(()=>{l&&S&&i!==void 0&&i!==g.current&&q(i)},[i,l,S,q]);let xe=(0,K.useCallback)(N=>{Te(N.target.value)},[]),He=It[It.length-1],ua=It.length>0,Ln=Y&&(!ua||He.role==="user"),Ja=rt.current;return{messages:It,status:ye,text:Ue,setText:Te,handleSubmit:jt,handleTextChange:xe,isLoading:Y,showLoaderBubble:Ln,lastMessage:He,hasMessages:ua,sendMessage:Le,sendMessageAndWait:eo,reset:ir,queuedMessages:je,queueFull:ht,removeQueuedMessage:Re,sessionId:m,toolDefinitions:Ja,refreshToolDefinitions:ge,threads:C,activeThreadId:y,isThreadHistoryReady:S,startNewThread:O,switchThread:q,deleteThread:oe}}var kn=z(De(),1);function K9(e){for(let t of e.parts){let a=t;if(a.type==="data"||a.type==="data-suggestions"){let n=a.data;if(n&&Array.isArray(n.suggestions))return n.suggestions}}return null}function sD(e){return typeof e=="object"&&e!==null&&"initial"in e}function uD(e){let{messages:t,status:a,config:n}=e,r=sD(n)&&n.initial?n.initial:void 0,[o,l]=(0,kn.useState)(r??[]),i=(0,kn.useRef)(a),s=n===!0||sD(n)&&n.dynamic!==!1,u=(0,kn.useCallback)(()=>{l([])},[]),c=t.length>0;(0,kn.useEffect)(()=>{!c&&r&&r.length>0&&l(r)},[r,c]);let d=t[t.length-1];return(0,kn.useEffect)(()=>{d?.role==="user"&&u()},[d,u]),(0,kn.useEffect)(()=>{let f=i.current;if(i.current=a,f==="streaming"&&a==="ready"&&s){let p=[...t].reverse().find(x=>x.role==="assistant");if(!p)return;let m=K9(p);m&&l(m)}},[a,s,t]),{suggestions:o,isLoading:!1,clear:u}}function cD(e,t){let a=t?.Authorization,n=typeof a=="string"&&a.startsWith("Bearer ")?a.slice(7):null;return si(e,"/resource",n?{token:n}:void 0)}var Z9={primaryColor:["--ww-primary","--ww-color-primary"],primaryForeground:["--ww-primary-fg","--ww-color-primary-foreground"],backgroundColor:["--ww-bg","--ww-color-background"],textColor:["--ww-text","--ww-color-foreground","--ww-color-accent-foreground"],mutedColor:["--ww-muted","--ww-color-muted-foreground"],borderColor:["--ww-border","--ww-color-border"],borderWidth:["--ww-border-width"],boxShadow:["--ww-shadow"],assistantBubbleColor:["--ww-assistant-bubble","--ww-color-accent"],userBubbleColor:["--ww-user-bubble"],inputBackgroundColor:["--ww-input-bg","--ww-color-input"],borderRadius:["--ww-radius"],messageBorderRadius:["--ww-msg-radius"],fontFamily:["--ww-font"],headerBackgroundColor:["--ww-header-bg"],headerTextColor:["--ww-header-text"],statusColor:["--ww-status"],toolCardColor:["--ww-tool-card","--ww-color-tool-card"],userBubbleTextColor:["--ww-user-bubble-text"],assistantBubbleTextColor:["--ww-assistant-bubble-text"],messagePaddingX:["--ww-msg-pad-x"],messagePaddingY:["--ww-msg-pad-y"],messageMaxWidth:["--ww-msg-max-width"],fontSize:["--ww-font-size"],lineHeight:["--ww-line-height"]};function Ff(e){let t={};for(let[a,n]of Object.entries(Z9)){let r=e[a];if(r===void 0)continue;let o=typeof r=="number"?`${r}px`:String(r);for(let l of n)t[l]=o}return t}var Xe=z(te(),1),zf=(0,tt.forwardRef)(function(t,a){let{locale:n,messages:r}=t;return(0,Xe.jsx)(Ts,{locale:n,messages:r,children:(0,Xe.jsx)(Q9,{...t,ref:a})})}),Q9=(0,tt.forwardRef)(function(t,a){let{t:n,ready:r}=Oe(),{appearance:o,className:l,classNames:i,allowAttachments:s=!1,welcomeMessage:u,welcome:c,placeholder:d=n.promptInput.placeholder,triggerEvent:f="triggerDemoRequest",api:p,mcp:m,debug:x=!1,readOnly:v=!1,title:y,headerActions:w,hideHeader:g=!1,enableThreadHistory:C=!1,showToolCalls:A=!0,initializing:S=!1,disclaimer:M}=t,R=o?.theme,D=o?.variables,L=o?.assistantBubble??!1,G=D?Ff(D):{},[B,U]=(0,tt.useState)(!1);(0,tt.useEffect)(()=>{if(R!=="auto"||typeof window>"u")return;let Y=window.matchMedia("(prefers-color-scheme: dark)");U(Y.matches);let Re=()=>U(Y.matches);return Y.addEventListener("change",Re),()=>Y.removeEventListener("change",Re)},[R]);let W=R==="dark"||R==="auto"&&B,E=iD({...t,api:p}),j=pR({...t,api:p,sessionId:E.sessionId,onCallTool:m?.onCallTool}),$=m?.resourceEndpoint??cD(p,t.headers),he=id(d,!E.text),[Ie,b]=(0,tt.useState)(null),[qe,rt]=(0,tt.useState)(null),k=(0,tt.useRef)(null),ke=(0,tt.useRef)(null),ie=(0,tt.useRef)(null),ge=(0,tt.useRef)(null),[It,Le]=(0,tt.useState)(!0),Ee=(0,tt.useRef)(It);Ee.current=It;let ye=(0,tt.useCallback)(()=>{let Y=k.current;if(!Y)return;let Re=Y.querySelector("textarea");Re&&Re.focus()},[]),we=(0,tt.useCallback)((Y="smooth")=>{let Re=ke.current;Re&&Re.scrollTo({top:Re.scrollHeight,behavior:Y})},[]);(0,tt.useEffect)(()=>{let Y=ge.current,Re=ke.current;if(!Y||!Re)return;let ht=new IntersectionObserver(([jt])=>Le(jt.isIntersecting),{root:Re,rootMargin:"0px 0px 200px 0px",threshold:0});return ht.observe(Y),()=>ht.disconnect()},[]),(0,tt.useEffect)(()=>{(E.messages[E.messages.length-1]?.role==="user"||Ee.current)&&we("smooth")},[E.messages.length,E.messages[E.messages.length-1]]),(0,tt.useEffect)(()=>{we("auto")},[we]),(0,tt.useEffect)(()=>{if(typeof ResizeObserver>"u")return;let Y=ke.current,Re=ie.current;if(!Y&&!Re)return;let ht=Y?.scrollHeight??0,jt=Y?.clientHeight??0,eo=new ResizeObserver(()=>{let ir=ke.current;if(!ir)return;let sr=ir.scrollTop+jt>=ht-5;ht=ir.scrollHeight,jt=ir.clientHeight,sr&&we("auto")});return Y&&eo.observe(Y),Re&&eo.observe(Re),()=>eo.disconnect()},[we]);let fe=uD({messages:E.messages,status:E.status,config:t.suggestions}),Ue=(0,tt.useCallback)(Y=>{let Re=Y.content.map(ht=>ht.text??"").join("").trim();Re&&E.handleSubmit({text:Re,files:[],modelContext:Y.modelContext})},[E.handleSubmit]),Te=(0,tt.useCallback)(Y=>{fe.clear(),E.handleSubmit({text:Y,files:[]})},[fe.clear,E.handleSubmit]);(0,tt.useImperativeHandle)(a,()=>({sendMessage:Y=>{E.handleSubmit({text:Y,files:[]}),ye()},sendMessageAndWait:Y=>E.sendMessageAndWait(Y),reset:E.reset,focus:ye,get messages(){return E.messages},get sessionId(){return E.sessionId}}),[E.handleSubmit,E.sendMessageAndWait,E.reset,E.messages,E.sessionId,ye]),(0,tt.useEffect)(()=>{if(!f)return;let Y=Re=>{let ht=Re.detail,jt=typeof ht?.message=="string"?ht.message:void 0;jt&&E.handleSubmit({text:jt,files:[]}),ye()};return window.addEventListener(f,Y),()=>window.removeEventListener(f,Y)},[f,E.handleSubmit,ye]);let je=!g&&!!(y||C||w),ot=S||!r;return(0,Xe.jsxs)("div",{ref:k,style:{...G,maxHeight:"inherit",...Ie&&qe?{height:qe}:{},opacity:ot?0:1,transition:"opacity 220ms ease-out"},"data-waniwani-chat":"","data-waniwani-layout":"embed","data-assistant-bubble":L?"true":void 0,"data-color-scheme":R==="auto"?"auto":void 0,...ot?{"data-waniwani-initializing":""}:{},...W?{"data-waniwani-dark":""}:{},className:H("ww:relative ww:w-full ww:h-full ww:flex ww:flex-col ww:bg-background ww:text-foreground ww:font-[family-name:var(--ww-font)] ww:overflow-hidden",R==="dark"&&"dark",l,i?.root),children:[je&&(0,Xe.jsxs)("div",{className:H("ww-header ww:shrink-0 ww:flex ww:items-center ww:gap-2 ww:pl-4 ww:pr-3 ww:py-3 ww:border-b ww:border-border",i?.header),style:{backgroundColor:"var(--ww-color-card-header)",color:"var(--ww-color-card-header-foreground)"},children:[y&&(0,Xe.jsx)("div",{className:"ww:text-sm ww:font-semibold ww:truncate ww:flex-1 ww:min-w-0",children:y}),!y&&(0,Xe.jsx)("div",{className:"ww:flex-1"}),C&&(0,Xe.jsx)(fR,{threads:E.threads,activeThreadId:E.activeThreadId,onNewThread:E.startNewThread,onSelectThread:Y=>{E.switchThread(Y)},onDeleteThread:Y=>{E.deleteThread(Y)}}),w]}),(0,Xe.jsxs)("div",{ref:ke,className:H("ww:relative ww:flex-1 ww:min-h-0",Ie?"ww:overflow-hidden":"ww:overflow-y-auto"),children:[(0,Xe.jsxs)("div",{ref:ie,className:H("ww:mx-auto ww:w-full ww:max-w-3xl ww:px-4 ww:py-6 ww:flex ww:flex-col ww:gap-6",Ie&&"ww:!py-0"),children:[(0,Xe.jsx)(uR,{messages:E.messages,status:E.status,welcomeMessage:u,welcome:c,onSuggestionSelect:Te,resourceEndpoint:$,chatSessionId:E.sessionId,isDark:W,onFollowUp:Ue,onCallTool:j,fullscreenToolCallId:Ie,debug:x,showToolCalls:A,toolDefinitions:E.toolDefinitions,messageClassNames:{message:i?.message,userBubble:i?.userBubble,assistantBubble:i?.assistantBubble},onWidgetDisplayModeChange:(Y,Re)=>{if(Y==="fullscreen"){let ht=k.current?.getBoundingClientRect().height??0;rt(ht>0?ht:null),b(Re.toolCallId)}else rt(null),b(null)}}),(0,Xe.jsx)("div",{ref:ge,"aria-hidden":!0,style:{height:1}})]}),!It&&!Ie&&(0,Xe.jsx)("div",{className:"ww:sticky ww:bottom-2 ww:flex ww:justify-center ww:pointer-events-none",children:(0,Xe.jsx)(wn,{type:"button",onClick:()=>we("smooth"),size:"icon",variant:"outline",className:"ww:rounded-full ww:shadow ww:pointer-events-auto","aria-label":"Scroll to latest",children:(0,Xe.jsx)(ms,{className:"ww:size-4"})})})]}),!v&&(0,Xe.jsxs)("div",{className:"ww:shrink-0 ww:bg-background",style:Ie?{display:"none"}:void 0,children:[(0,Xe.jsx)(ld,{suggestions:fe.suggestions,isLoading:fe.isLoading,onSelect:Te}),(0,Xe.jsx)(KC,{queuedMessages:E.queuedMessages,onRemove:E.removeQueuedMessage}),(0,Xe.jsx)("div",{className:"ww:px-4 ww:pb-2 ww:pt-2",children:(0,Xe.jsxs)("div",{className:"ww:mx-auto ww:w-full ww:max-w-3xl",children:[(0,Xe.jsx)(NC,{onSubmit:E.handleSubmit,globalDrop:s,multiple:s,className:H("ww-input ww:rounded-2xl ww:border-border ww:bg-input",i?.input),children:(0,Xe.jsxs)("div",{className:"ww:flex ww:items-center ww:gap-1 ww:pl-4 ww:pr-3 ww:py-2.5",children:[s&&(0,Xe.jsx)(FC,{}),(0,Xe.jsx)(BC,{onChange:E.handleTextChange,value:E.text,placeholder:he,className:"ww:min-h-0 ww:py-1 ww:px-0"}),(0,Xe.jsx)(UC,{status:E.status,disabled:E.queueFull})]})}),(0,Xe.jsxs)("div",{className:"ww:pt-2 ww:pb-1 ww:flex ww:flex-nowrap ww:justify-center ww:items-center ww:gap-1.5",children:[(0,Xe.jsx)(cR,{}),(0,Xe.jsx)(zC,{text:M})]})]})})]})]})});var yu=z(De(),1);function Y9(){if(typeof window>"u")return!1;try{return window.WANIWANI_DEBUG?!0:!!window.localStorage?.getItem("WANIWANI_DEBUG")}catch{return!1}}function ui(...e){Y9()&&console.log("[Waniwani]",...e)}var J9="waniwani:config:";function dD(e,t,a){return`${J9}${e}|${t}|${a??""}`}function qf(e,t,a){if(typeof window>"u")return null;try{let n=window.sessionStorage.getItem(dD(e,t,a));if(!n)return null;let r=JSON.parse(n);return r&&typeof r=="object"?r:null}catch{return null}}function ej(e,t,a,n){if(!(typeof window>"u"))try{window.sessionStorage.setItem(dD(e,t,a),JSON.stringify(n))}catch{}}var tj=600;async function aj(e,t,a,n){try{let r=si(e,"/config",n?{channel:n}:void 0),o=await fetch(r,{method:"GET",headers:{Authorization:`Bearer ${t}`},signal:a});if(!o.ok)return{};let l=await o.json(),i=l&&typeof l=="object"&&"data"in l&&l.data?l.data:l;return i?nj(i):{}}catch{return{}}}function nj(e){let t={};return e.source!=null&&(t.source=e.source),e.title!=null&&(t.title=e.title),e.welcomeMessage!=null&&(t.welcomeMessage=e.welcomeMessage),e.placeholder!=null&&(t.placeholder=e.placeholder),e.suggestions!=null&&e.suggestions.length>0&&(t.suggestions=e.suggestions),typeof e.enableThreadHistory=="boolean"&&(t.enableThreadHistory=e.enableThreadHistory),e.toolCallDisplay==="full"?t.showToolCalls=!0:e.toolCallDisplay==="titles-only"?t.showToolCalls="titles-only":e.toolCallDisplay==="hidden"&&(t.showToolCalls=!1),e.visibility&&(t.visibility=e.visibility),t}function Hf(e,t,a){let[n,r]=(0,yu.useState)(e),[o,l]=(0,yu.useState)(!1);return(0,yu.useEffect)(()=>{let i=e.api,s=e.token,u=e.channelId;if(!i||!s){l(!0);return}let c=m=>{e.disablePageView||pC({api:i,token:s,channelId:u,mode:e.mode,source:m})},d=qf(i,s,u);if(d)try{let m=fs(t,d,a);r(m),l(!0),ui("config resolved (sessionStorage cache)",{config:m,visibility:m.visibility}),c(d.source)}catch{}let f=new AbortController,p=setTimeout(()=>l(!0),tj);return aj(i,s,f.signal,u).then(m=>{if(!f.signal.aborted){if(ui("remote /config response",m),Object.keys(m).length>0){ej(i,s,u,m);try{let x=fs(t,m,a);r(x),ui("config resolved (remote)",{config:x,visibility:x.visibility})}catch(x){console.error("[Waniwani] Failed to apply remote config:",x)}}l(!0),c(m.source)}}).catch(m=>{console.error("[Waniwani] Remote config fetch failed:",m),l(!0)}).finally(()=>clearTimeout(p)),()=>{f.abort(),clearTimeout(p)}},[e.api,e.token,e.channelId]),{config:n,ready:o}}var Vf=z(De(),1);function rj(e){return e?.patterns??e?.rules??[]}var fD="\0\0";function oj(e){let a=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\\\*\\\*/g,fD).replace(/\\\*/g,"[^/]*").split(fD).join(".*");return new RegExp(`^${a}$`)}function pD(e,t){try{return oj(e).test(t)}catch{return!1}}function jf(e,t){if(!e)return!0;let a=!1;for(let n of rj(e))if(pD(n.glob,t)){if(n.action==="hide")return!1;a=!0}return a?!0:(e.default??"show")!=="hide"}function mD(e,t){for(let a of e?.appearRules??[])if(pD(a.glob,t))return a.appearAfter;return null}var tx="waniwani:locationchange",hD=!1;function lj(){if(!(hD||typeof history>"u")){hD=!0;for(let e of["pushState","replaceState"]){let t=history[e];history[e]=function(...n){let r=t.apply(this,n);return window.dispatchEvent(new Event(tx)),r}}}}function ij(e){return lj(),window.addEventListener(tx,e),window.addEventListener("popstate",e),()=>{window.removeEventListener(tx,e),window.removeEventListener("popstate",e)}}function sj(){return window.location.pathname}function uj(){return"/"}function ax(){return(0,Vf.useSyncExternalStore)(ij,sj,uj)}function Gf(e,t){let a=ax(),n=t&&jf(e,a);return(0,Vf.useEffect)(()=>{ui("visibility gate",{pathname:a,ready:t,visible:n,rules:e})},[a,t,n]),n}var $f=z(De(),1),cj=3e3,dj=120,fj=24;function gD(e){let[t,a]=(0,$f.useState)(!1);return(0,$f.useEffect)(()=>{if(!e||typeof document>"u"){a(!1);return}let n=!1,r=null,o=null,l=null,i=u=>{r=new IntersectionObserver(c=>{let d=c[0];d&&a(!d.isIntersecting&&d.boundingClientRect.bottom<=0)},{rootMargin:`0px 0px -${fj}px 0px`,threshold:0}),r.observe(u)},s=()=>{if(n)return;let u=null;try{u=document.querySelector(e)}catch{a(!0);return}if(u){i(u);return}o=setTimeout(s,dj)};return s(),l=setTimeout(()=>{n||r||(o&&clearTimeout(o),a(!0))},cj),()=>{n=!0,r?.disconnect(),o&&clearTimeout(o),l&&clearTimeout(l)}},[e]),t}var mt=z(te(),1),pj=2e3,mj=90,hj=1e3,yD=(0,Ke.forwardRef)(function(t,a){return(0,mt.jsx)(Ts,{locale:t.config.locale,children:(0,mt.jsx)(gj,{...t,ref:a})})}),gj=(0,Ke.forwardRef)(function({config:t,programmatic:a,scriptConfig:n},r){let{t:o}=Oe(),{config:l,ready:i}=Hf(t,a,n),s=Gf(l.visibility,i),u=ax(),c=s?mD(l.visibility,u):null,d=gD(c),f=(0,Ke.useRef)(null),p=(0,Ke.useRef)(null),m=(0,Ke.useRef)(null),x=(0,Ke.useRef)(!1),[v,y]=(0,Ke.useState)("input"),[w,g]=(0,Ke.useState)(""),[C,A]=(0,Ke.useState)(!1),[S,M]=(0,Ke.useState)(!1),[R,D]=(0,Ke.useState)(0),L=l.appearance?.theme,G=l.appearance?.variables,B=(0,Ke.useMemo)(()=>G?Ff(G):{},[G]),U=l.suggestions??[],W=l.launcherText??l.placeholder??o.launcher.prompt,E=id(W,w.length===0),j="var(--ww-shadow, 0 10px 30px rgba(0, 0, 0, 0.08))";(0,Ke.useEffect)(()=>{if(!s){A(!1);return}if(c){A(d);return}let ie=l.appearDelay??pj,ge=setTimeout(()=>A(!0),Math.max(0,ie));return()=>clearTimeout(ge)},[s,l.appearDelay,c,d]),(0,Ke.useEffect)(()=>{if(!C||U.length===0)return;let ie=setTimeout(()=>{x.current||y(ge=>ge==="input"?"expanded":ge)},hj);return()=>clearTimeout(ie)},[C,U.length]),(0,Ke.useEffect)(()=>{R>0&&v==="open"&&f.current?.focus()},[R,v]);let $=(0,Ke.useCallback)(()=>{y("open")},[]),he=(0,Ke.useCallback)(()=>{x.current=!0,y("input")},[]);(0,Ke.useEffect)(()=>{if(v!=="expanded"){M(!1);return}let ie=setTimeout(()=>M(!0),mj);return()=>clearTimeout(ie)},[v]);let Ie=(0,Ke.useCallback)(ie=>{$();let ge=ie.trim();ge&&f.current?.sendMessage(ge)},[$]);(0,Ke.useImperativeHandle)(r,()=>({open:()=>$(),close:()=>he(),toggle:()=>{y(ie=>ie==="open"?"input":"open")},sendMessage:ie=>Ie(ie),sendMessageAndWait:async ie=>{$();let ge=f.current;if(ge)return await ge.sendMessageAndWait(ie)},reset:()=>f.current?.reset(),focus:()=>{$(),D(ie=>ie+1)},getMessages:()=>f.current?.messages??[],getSessionId:()=>f.current?.sessionId}),[Ie,$,he]);let b=(0,Ke.useCallback)(()=>{w.trim()&&(Ie(w),g(""))},[w,Ie]),qe=(0,Ke.useCallback)(()=>{(f.current?.messages.length??0)>0?(y("open"),D(ie=>ie+1)):(x.current=!1,y(ie=>ie==="input"?"expanded":ie))},[]),rt={mode:"floating"};l.mcpServerUrl&&(rt.mcpServerUrl=l.mcpServerUrl),l.channelId&&(rt.channelId=l.channelId);let k=U.length>0&&v!=="input",ke=(0,mt.jsx)("button",{type:"button",onClick:he,"aria-label":o.launcher.close,className:"ww:flex ww:size-7 ww:items-center ww:justify-center ww:rounded-md ww:text-muted-foreground ww:transition-colors hover:ww:bg-accent hover:ww:text-foreground ww:cursor-pointer",children:(0,mt.jsx)(bs,{className:"ww:size-4"})});return(0,mt.jsx)("div",{"data-waniwani-chat":"","data-color-scheme":L==="auto"?"auto":void 0,className:H("ww:contents ww:font-[family-name:var(--ww-font-sans)]",L==="dark"&&"dark"),style:B,children:s&&(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)("div",{ref:m,"data-waniwani-floating":"dock","data-state":v==="open"?"hidden":"shown","data-appeared":C?"true":"false",className:H("ww:fixed ww:bottom-3 ww:sm:bottom-4 ww:left-0 ww:right-0 ww:mx-auto ww:z-[2147483002] ww:flex ww:flex-col","ww:w-[calc(100vw-2rem)] ww:transition-[max-width] ww:duration-300 ww:ease-out",k?"ww:max-w-[720px]":"ww:max-w-[440px]"),children:(0,mt.jsxs)("div",{className:H("ww:relative ww:flex ww:flex-col ww:rounded-[20px] ww:border ww:transition-all ww:duration-300 ww:ease-out",k?"ww:p-2 ww:backdrop-blur-xl ww:backdrop-saturate-150":"ww:border-transparent ww:p-0"),style:k?{boxShadow:j,backgroundColor:"var(--ww-glass)",borderColor:"var(--ww-glass-border)"}:void 0,children:[k&&v!=="open"&&(0,mt.jsx)("button",{type:"button",onClick:he,"aria-label":o.launcher.close,className:"ww:absolute ww:right-2 ww:top-2 ww:z-10 ww:flex ww:size-7 ww:items-center ww:justify-center ww:rounded-md ww:text-muted-foreground ww:transition-colors hover:ww:bg-accent hover:ww:text-foreground ww:cursor-pointer",children:(0,mt.jsx)(Kn,{className:"ww:size-4"})}),U.length>0&&(0,mt.jsx)("div",{className:H("ww:grid ww:transition-all ww:duration-300 ww:ease-out",S?"ww:grid-rows-[1fr] ww:opacity-100":"ww:pointer-events-none ww:grid-rows-[0fr] ww:opacity-0"),children:(0,mt.jsx)("div",{className:"ww:overflow-hidden",children:(0,mt.jsx)(ld,{suggestions:U,onSelect:Ie,className:"ww:pl-1 ww:pr-9 ww:pt-1 ww:pb-2.5"})})}),(0,mt.jsx)(IC,{animated:C,backgroundColor:"var(--ww-color-input)",borderRadius:16,edgeSensitivity:30,coneSpread:25,colors:["#c084fc","#f472b6","#38bdf8"],className:"ww:border-border",style:{boxShadow:j},children:(0,mt.jsxs)("div",{className:"ww:flex ww:items-center ww:gap-1 ww:pl-3.5 ww:pr-1.5 ww:py-1.5 ww:sm:pl-4 ww:sm:pr-2 ww:sm:py-2",children:[(0,mt.jsx)("input",{ref:p,type:"text",value:w,placeholder:E,onChange:ie=>g(ie.target.value),onFocus:qe,onKeyDown:ie=>{ie.key==="Enter"&&!ie.shiftKey&&(ie.preventDefault(),b())},className:"ww:min-w-0 ww:flex-1 ww:bg-transparent ww:py-1 ww:text-base ww:sm:text-sm ww:text-foreground ww:outline-none ww:placeholder:text-muted-foreground"}),(0,mt.jsx)("button",{type:"button",onClick:b,disabled:!w.trim(),"aria-label":o.promptInput.submit,className:"ww:relative ww:flex ww:size-8 ww:shrink-0 ww:items-center ww:justify-center ww:rounded-full ww:bg-foreground ww:text-background ww:transition-opacity hover:ww:opacity-90 disabled:ww:opacity-40",children:(0,mt.jsx)(Co,{className:"ww:size-4"})})]})})]})}),(0,mt.jsx)("div",{role:"dialog","aria-label":l.title??W,"data-waniwani-floating":"panel","data-state":v==="open"?"shown":"hidden",style:{boxShadow:j},className:H("ww:fixed ww:z-[2147483002] ww:flex ww:flex-col ww:overflow-hidden ww:bg-background","ww:inset-0 ww:w-full ww:rounded-none","ww:sm:inset-auto ww:sm:bottom-4 ww:sm:left-0 ww:sm:right-0 ww:sm:mx-auto ww:sm:h-[720px] ww:sm:max-h-[calc(100dvh-2rem)] ww:sm:w-[calc(100vw-2rem)] ww:sm:max-w-[1000px] ww:sm:rounded-2xl ww:sm:border ww:sm:border-border"),children:(0,mt.jsx)(zf,{ref:f,api:l.api??"",headers:{Authorization:`Bearer ${l.token}`},skipRemoteConfig:!0,body:rt,appearance:l.appearance,title:l.title,headerActions:ke,hideHeader:!1,welcomeMessage:l.welcomeMessage,placeholder:l.placeholder,suggestions:l.suggestions?{initial:l.suggestions}:void 0,enableThreadHistory:l.enableThreadHistory,showToolCalls:l.showToolCalls,locale:l.locale,initializing:!i})})]})})});var lr=z(De(),1);var xD=z(te(),1),wD=(0,lr.forwardRef)(function({config:t,programmatic:a,scriptConfig:n,onReady:r,onVisibilityChange:o},l){let{config:i,ready:s}=Hf(t,a,n),u=(0,lr.useRef)(null);(0,lr.useEffect)(()=>{r?.()},[]);let c=Gf(i.visibility,s);(0,lr.useEffect)(()=>{o?.(c)},[c,o]),(0,lr.useImperativeHandle)(l,()=>({get chat(){return u.current}}),[]);let d={mode:"inline"};return i.mcpServerUrl&&(d.mcpServerUrl=i.mcpServerUrl),i.channelId&&(d.channelId=i.channelId),(0,xD.jsx)(zf,{ref:u,api:i.api??"",headers:{Authorization:`Bearer ${i.token}`},skipRemoteConfig:!0,body:d,appearance:i.appearance,title:i.title,hideHeader:i.hideHeader,welcomeMessage:i.welcomeMessage,placeholder:i.placeholder,suggestions:i.suggestions?{initial:i.suggestions}:void 0,enableThreadHistory:i.enableThreadHistory,showToolCalls:i.showToolCalls,locale:i.locale,initializing:!s})});var nx="/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */\n@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root,:host{--ww-font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace;--ww-color-blue-400:oklch(70.7% .165 254.624);--ww-spacing:.25rem;--ww-container-sm:24rem;--ww-container-md:28rem;--ww-container-3xl:48rem;--ww-text-xs:.75rem;--ww-text-xs--line-height:calc(1/.75);--ww-text-sm:.875rem;--ww-text-sm--line-height:calc(1.25/.875);--ww-text-base:1rem;--ww-text-base--line-height:calc(1.5/1);--ww-text-lg:1.125rem;--ww-text-lg--line-height:calc(1.75/1.125);--ww-font-weight-medium:500;--ww-font-weight-semibold:600;--ww-tracking-wide:.025em;--ww-tracking-wider:.05em;--ww-radius-md:.375rem;--ww-radius-lg:.5rem;--ww-radius-xl:.75rem;--ww-radius-2xl:1rem;--ww-ease-out:cubic-bezier(0,0,.2,1);--ww-animate-spin:spin 1s linear infinite;--ww-animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--ww-blur-xl:24px;--ww-default-transition-duration:.15s;--ww-default-transition-timing-function:cubic-bezier(.4,0,.2,1);--ww-default-font-family:var(--ww-font-sans,system-ui,-apple-system,\"Segoe UI\",sans-serif);--ww-default-mono-font-family:var(--ww-font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--ww-default-font-family,ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\");font-feature-settings:var(--ww-default-font-feature-settings,normal);font-variation-settings:var(--ww-default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--ww-default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace);font-feature-settings:var(--ww-default-mono-font-feature-settings,normal);font-variation-settings:var(--ww-default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.ww\\:pointer-events-auto{pointer-events:auto}.ww\\:pointer-events-none{pointer-events:none}.ww\\:\\!relative{position:relative!important}.ww\\:absolute{position:absolute}.ww\\:fixed{position:fixed}.ww\\:relative{position:relative}.ww\\:sticky{position:sticky}.ww\\:inset-0{inset:calc(var(--ww-spacing)*0)}.ww\\:top-2{top:calc(var(--ww-spacing)*2)}.ww\\:top-full{top:100%}.ww\\:right-0{right:calc(var(--ww-spacing)*0)}.ww\\:right-2{right:calc(var(--ww-spacing)*2)}.ww\\:bottom-2{bottom:calc(var(--ww-spacing)*2)}.ww\\:bottom-3{bottom:calc(var(--ww-spacing)*3)}.ww\\:bottom-4{bottom:calc(var(--ww-spacing)*4)}.ww\\:left-0{left:calc(var(--ww-spacing)*0)}.ww\\:left-\\[50\\%\\]{left:50%}.ww\\:isolate{isolation:isolate}.ww\\:-z-\\[1\\]{z-index:calc(1*-1)}.ww\\:z-10{z-index:10}.ww\\:z-50{z-index:50}.ww\\:z-\\[1\\]{z-index:1}.ww\\:z-\\[2147483002\\]{z-index:2147483002}.ww\\:mx-auto{margin-inline:auto}.ww\\:mt-0\\.5{margin-top:calc(var(--ww-spacing)*.5)}.ww\\:mt-1{margin-top:calc(var(--ww-spacing)*1)}.ww\\:mt-2{margin-top:calc(var(--ww-spacing)*2)}.ww\\:mt-6{margin-top:calc(var(--ww-spacing)*6)}.ww\\:mb-0{margin-bottom:calc(var(--ww-spacing)*0)}.ww\\:mb-4{margin-bottom:calc(var(--ww-spacing)*4)}.ww\\:mb-6{margin-bottom:calc(var(--ww-spacing)*6)}.ww\\:ml-auto{margin-left:auto}.ww\\:line-clamp-1{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.ww\\:contents{display:contents}.ww\\:flex{display:flex}.ww\\:grid{display:grid}.ww\\:hidden{display:none}.ww\\:inline-block{display:inline-block}.ww\\:inline-flex{display:inline-flex}.ww\\:field-sizing-content{field-sizing:content}.ww\\:size-2{width:calc(var(--ww-spacing)*2);height:calc(var(--ww-spacing)*2)}.ww\\:size-3{width:calc(var(--ww-spacing)*3);height:calc(var(--ww-spacing)*3)}.ww\\:size-3\\.5{width:calc(var(--ww-spacing)*3.5);height:calc(var(--ww-spacing)*3.5)}.ww\\:size-4{width:calc(var(--ww-spacing)*4);height:calc(var(--ww-spacing)*4)}.ww\\:size-5{width:calc(var(--ww-spacing)*5);height:calc(var(--ww-spacing)*5)}.ww\\:size-7{width:calc(var(--ww-spacing)*7);height:calc(var(--ww-spacing)*7)}.ww\\:size-8{width:calc(var(--ww-spacing)*8);height:calc(var(--ww-spacing)*8)}.ww\\:size-9{width:calc(var(--ww-spacing)*9);height:calc(var(--ww-spacing)*9)}.ww\\:size-12{width:calc(var(--ww-spacing)*12);height:calc(var(--ww-spacing)*12)}.ww\\:size-auto{width:auto;height:auto}.ww\\:size-full{width:100%;height:100%}.ww\\:h-2\\.5{height:calc(var(--ww-spacing)*2.5)}.ww\\:h-5{height:calc(var(--ww-spacing)*5)}.ww\\:h-8{height:calc(var(--ww-spacing)*8)}.ww\\:h-9{height:calc(var(--ww-spacing)*9)}.ww\\:h-16{height:calc(var(--ww-spacing)*16)}.ww\\:h-auto{height:auto}.ww\\:h-full{height:100%}.ww\\:max-h-48{max-height:calc(var(--ww-spacing)*48)}.ww\\:max-h-80{max-height:calc(var(--ww-spacing)*80)}.ww\\:min-h-0{min-height:calc(var(--ww-spacing)*0)}.ww\\:min-h-5{min-height:calc(var(--ww-spacing)*5)}.ww\\:min-h-full{min-height:100%}.ww\\:w-72{width:calc(var(--ww-spacing)*72)}.ww\\:w-\\[calc\\(100vw-2rem\\)\\]{width:calc(100vw - 2rem)}.ww\\:w-auto{width:auto}.ww\\:w-fit{width:fit-content}.ww\\:w-full{width:100%}.ww\\:w-px{width:1px}.ww\\:\\[max-width\\:var\\(--ww-msg-max-width\\,80\\%\\)\\]{max-width:var(--ww-msg-max-width,80%)}.ww\\:max-w-3xl{max-width:var(--ww-container-3xl)}.ww\\:max-w-24{max-width:calc(var(--ww-spacing)*24)}.ww\\:max-w-32{max-width:calc(var(--ww-spacing)*32)}.ww\\:max-w-\\[440px\\]{max-width:440px}.ww\\:max-w-\\[720px\\]{max-width:720px}.ww\\:max-w-full{max-width:100%}.ww\\:max-w-md{max-width:var(--ww-container-md)}.ww\\:max-w-sm{max-width:var(--ww-container-sm)}.ww\\:min-w-0{min-width:calc(var(--ww-spacing)*0)}.ww\\:flex-1{flex:1}.ww\\:shrink-0{flex-shrink:0}.ww\\:grow{flex-grow:1}.ww\\:translate-x-\\[-50\\%\\]{--tw-translate-x:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.ww\\:rotate-90{rotate:90deg}.ww\\:rotate-180{rotate:180deg}.ww\\:animate-\\[ww-fade-in_0\\.2s_ease-out_both\\]{animation:.2s ease-out both ww-fade-in}.ww\\:animate-pulse{animation:var(--ww-animate-pulse)}.ww\\:animate-spin{animation:var(--ww-animate-spin)}.ww\\:cursor-pointer{cursor:pointer}.ww\\:resize-none{resize:none}.ww\\:grid-rows-\\[0fr\\]{grid-template-rows:0fr}.ww\\:grid-rows-\\[1fr\\]{grid-template-rows:1fr}.ww\\:flex-col{flex-direction:column}.ww\\:flex-nowrap{flex-wrap:nowrap}.ww\\:flex-wrap{flex-wrap:wrap}.ww\\:items-center{align-items:center}.ww\\:items-end{align-items:flex-end}.ww\\:items-start{align-items:flex-start}.ww\\:justify-between{justify-content:space-between}.ww\\:justify-center{justify-content:center}.ww\\:gap-1{gap:calc(var(--ww-spacing)*1)}.ww\\:gap-1\\.5{gap:calc(var(--ww-spacing)*1.5)}.ww\\:gap-2{gap:calc(var(--ww-spacing)*2)}.ww\\:gap-3{gap:calc(var(--ww-spacing)*3)}.ww\\:gap-6{gap:calc(var(--ww-spacing)*6)}:where(.ww\\:space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--ww-spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--ww-spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.ww\\:space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--ww-spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--ww-spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}.ww\\:self-stretch{align-self:stretch}.ww\\:truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.ww\\:\\!overflow-hidden{overflow:hidden!important}.ww\\:overflow-auto{overflow:auto}.ww\\:overflow-hidden{overflow:hidden}.ww\\:overflow-x-auto{overflow-x:auto}.ww\\:overflow-y-auto{overflow-y:auto}.ww\\:overflow-y-hidden{overflow-y:hidden}.ww\\:\\!rounded-full{border-radius:3.40282e38px!important}.ww\\:rounded{border-radius:var(--ww-radius,16px)}.ww\\:rounded-2xl{border-radius:var(--ww-radius-2xl)}.ww\\:rounded-\\[20px\\]{border-radius:20px}.ww\\:rounded-\\[inherit\\]{border-radius:inherit}.ww\\:rounded-\\[var\\(--ww-radius\\)\\]{border-radius:var(--ww-radius)}.ww\\:rounded-full{border-radius:3.40282e38px}.ww\\:rounded-lg{border-radius:var(--ww-radius-lg)}.ww\\:rounded-md{border-radius:var(--ww-radius-md)}.ww\\:rounded-none{border-radius:0}.ww\\:rounded-xl{border-radius:var(--ww-radius-xl)}.ww\\:border{border-style:var(--tw-border-style);border-width:1px}.ww\\:border-0{border-style:var(--tw-border-style);border-width:0}.ww\\:border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.ww\\:border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.ww\\:border-border{border-color:var(--ww-color-border,#e5e7eb)}.ww\\:border-muted-foreground\\/50{border-color:var(--ww-color-muted-foreground,#6b7280)}@supports (color:color-mix(in lab, red, red)){.ww\\:border-muted-foreground\\/50{border-color:color-mix(in oklab,var(--ww-color-muted-foreground,#6b7280)50%,transparent)}}.ww\\:border-transparent{border-color:#0000}.ww\\:bg-accent{background-color:var(--ww-color-accent,#f3f4f6)}.ww\\:bg-background,.ww\\:bg-background\\/20{background-color:var(--ww-color-background,#fff)}@supports (color:color-mix(in lab, red, red)){.ww\\:bg-background\\/20{background-color:color-mix(in oklab,var(--ww-color-background,#fff)20%,transparent)}}.ww\\:bg-border{background-color:var(--ww-color-border,#e5e7eb)}.ww\\:bg-foreground,.ww\\:bg-foreground\\/5{background-color:var(--ww-color-foreground,#1f2937)}@supports (color:color-mix(in lab, red, red)){.ww\\:bg-foreground\\/5{background-color:color-mix(in oklab,var(--ww-color-foreground,#1f2937)5%,transparent)}}.ww\\:bg-input{background-color:var(--ww-color-input,#f9fafb)}.ww\\:bg-muted{background-color:var(--ww-color-muted,#f1f5f9)}.ww\\:bg-muted-foreground\\/60{background-color:var(--ww-color-muted-foreground,#6b7280)}@supports (color:color-mix(in lab, red, red)){.ww\\:bg-muted-foreground\\/60{background-color:color-mix(in oklab,var(--ww-color-muted-foreground,#6b7280)60%,transparent)}}.ww\\:bg-muted\\/50{background-color:var(--ww-color-muted,#f1f5f9)}@supports (color:color-mix(in lab, red, red)){.ww\\:bg-muted\\/50{background-color:color-mix(in oklab,var(--ww-color-muted,#f1f5f9)50%,transparent)}}.ww\\:bg-primary{background-color:var(--ww-color-primary,#6366f1)}.ww\\:bg-tool-card{background-color:var(--ww-color-tool-card,#f4f4f5)}.ww\\:bg-transparent{background-color:#0000}.ww\\:object-cover{object-fit:cover}.ww\\:p-0{padding:calc(var(--ww-spacing)*0)}.ww\\:p-1{padding:calc(var(--ww-spacing)*1)}.ww\\:p-1\\.5{padding:calc(var(--ww-spacing)*1.5)}.ww\\:p-2{padding:calc(var(--ww-spacing)*2)}.ww\\:p-3{padding:calc(var(--ww-spacing)*3)}.ww\\:px-0{padding-inline:calc(var(--ww-spacing)*0)}.ww\\:px-1\\.5{padding-inline:calc(var(--ww-spacing)*1.5)}.ww\\:px-2{padding-inline:calc(var(--ww-spacing)*2)}.ww\\:px-3{padding-inline:calc(var(--ww-spacing)*3)}.ww\\:px-3\\.5{padding-inline:calc(var(--ww-spacing)*3.5)}.ww\\:px-4{padding-inline:calc(var(--ww-spacing)*4)}.ww\\:px-6{padding-inline:calc(var(--ww-spacing)*6)}.ww\\:\\!py-0{padding-block:calc(var(--ww-spacing)*0)!important}.ww\\:py-0\\.5{padding-block:calc(var(--ww-spacing)*.5)}.ww\\:py-1{padding-block:calc(var(--ww-spacing)*1)}.ww\\:py-1\\.5{padding-block:calc(var(--ww-spacing)*1.5)}.ww\\:py-2{padding-block:calc(var(--ww-spacing)*2)}.ww\\:py-2\\.5{padding-block:calc(var(--ww-spacing)*2.5)}.ww\\:py-3{padding-block:calc(var(--ww-spacing)*3)}.ww\\:py-6{padding-block:calc(var(--ww-spacing)*6)}.ww\\:py-12{padding-block:calc(var(--ww-spacing)*12)}.ww\\:pt-1{padding-top:calc(var(--ww-spacing)*1)}.ww\\:pt-2{padding-top:calc(var(--ww-spacing)*2)}.ww\\:pt-2\\.5{padding-top:calc(var(--ww-spacing)*2.5)}.ww\\:pt-3{padding-top:calc(var(--ww-spacing)*3)}.ww\\:pr-1\\.5{padding-right:calc(var(--ww-spacing)*1.5)}.ww\\:pr-3{padding-right:calc(var(--ww-spacing)*3)}.ww\\:pr-9{padding-right:calc(var(--ww-spacing)*9)}.ww\\:pb-1{padding-bottom:calc(var(--ww-spacing)*1)}.ww\\:pb-1\\.5{padding-bottom:calc(var(--ww-spacing)*1.5)}.ww\\:pb-2{padding-bottom:calc(var(--ww-spacing)*2)}.ww\\:pb-2\\.5{padding-bottom:calc(var(--ww-spacing)*2.5)}.ww\\:pb-3{padding-bottom:calc(var(--ww-spacing)*3)}.ww\\:pb-8{padding-bottom:calc(var(--ww-spacing)*8)}.ww\\:pl-1{padding-left:calc(var(--ww-spacing)*1)}.ww\\:pl-3\\.5{padding-left:calc(var(--ww-spacing)*3.5)}.ww\\:pl-4{padding-left:calc(var(--ww-spacing)*4)}.ww\\:text-center{text-align:center}.ww\\:text-left{text-align:left}.ww\\:font-\\[family-name\\:var\\(--ww-font\\)\\]{font-family:var(--ww-font)}.ww\\:font-\\[family-name\\:var\\(--ww-font-sans\\)\\]{font-family:var(--ww-font-sans)}.ww\\:font-mono{font-family:var(--ww-font-mono)}.ww\\:text-base{font-size:var(--ww-text-base);line-height:var(--tw-leading,var(--ww-text-base--line-height))}.ww\\:text-lg{font-size:var(--ww-text-lg);line-height:var(--tw-leading,var(--ww-text-lg--line-height))}.ww\\:text-sm{font-size:var(--ww-text-sm);line-height:var(--tw-leading,var(--ww-text-sm--line-height))}.ww\\:text-xs{font-size:var(--ww-text-xs);line-height:var(--tw-leading,var(--ww-text-xs--line-height))}.ww\\:\\[font-size\\:var\\(--ww-font-size\\,1rem\\)\\]{font-size:var(--ww-font-size,1rem)}.ww\\:text-\\[10px\\]{font-size:10px}.ww\\:text-\\[11px\\]{font-size:11px}.ww\\:\\[line-height\\:var\\(--ww-line-height\\,1\\.5\\)\\]{line-height:var(--ww-line-height,1.5)}.ww\\:font-medium{--tw-font-weight:var(--ww-font-weight-medium);font-weight:var(--ww-font-weight-medium)}.ww\\:font-semibold{--tw-font-weight:var(--ww-font-weight-semibold);font-weight:var(--ww-font-weight-semibold)}.ww\\:tracking-wide{--tw-tracking:var(--ww-tracking-wide);letter-spacing:var(--ww-tracking-wide)}.ww\\:tracking-wider{--tw-tracking:var(--ww-tracking-wider);letter-spacing:var(--ww-tracking-wider)}.ww\\:break-words{overflow-wrap:break-word}.ww\\:break-all{word-break:break-all}.ww\\:whitespace-nowrap{white-space:nowrap}.ww\\:whitespace-pre-wrap{white-space:pre-wrap}.ww\\:text-background{color:var(--ww-color-background,#fff)}.ww\\:text-foreground,.ww\\:text-foreground\\/80{color:var(--ww-color-foreground,#1f2937)}@supports (color:color-mix(in lab, red, red)){.ww\\:text-foreground\\/80{color:color-mix(in oklab,var(--ww-color-foreground,#1f2937)80%,transparent)}}.ww\\:text-muted-foreground{color:var(--ww-color-muted-foreground,#6b7280)}.ww\\:text-primary{color:var(--ww-color-primary,#6366f1)}.ww\\:text-primary-foreground{color:var(--ww-color-primary-foreground,#1f2937)}.ww\\:uppercase{text-transform:uppercase}.ww\\:italic{font-style:italic}.ww\\:opacity-0{opacity:0}.ww\\:opacity-70{opacity:.7}.ww\\:opacity-100{opacity:1}.ww\\:shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ww\\:shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ww\\:shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ww\\:ring-2{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ww\\:ring-\\[\\#0a6c74\\]{--tw-ring-color:#0a6c74}.ww\\:ring-blue-400\\/70{--tw-ring-color:var(--ww-color-blue-400)}@supports (color:color-mix(in lab, red, red)){.ww\\:ring-blue-400\\/70{--tw-ring-color:color-mix(in oklab,var(--ww-color-blue-400)70%,transparent)}}.ww\\:ring-offset-2{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.ww\\:ring-offset-background{--tw-ring-offset-color:var(--ww-color-background,#fff)}.ww\\:backdrop-blur-xl{--tw-backdrop-blur:blur(var(--ww-blur-xl));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.ww\\:backdrop-saturate-150{--tw-backdrop-saturate:saturate(150%);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.ww\\:transition-\\[grid-template-rows\\,opacity\\]{transition-property:grid-template-rows,opacity;transition-timing-function:var(--tw-ease,var(--ww-default-transition-timing-function));transition-duration:var(--tw-duration,var(--ww-default-transition-duration))}.ww\\:transition-\\[max-width\\]{transition-property:max-width;transition-timing-function:var(--tw-ease,var(--ww-default-transition-timing-function));transition-duration:var(--tw-duration,var(--ww-default-transition-duration))}.ww\\:transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--ww-default-transition-timing-function));transition-duration:var(--tw-duration,var(--ww-default-transition-duration))}.ww\\:transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--ww-default-transition-timing-function));transition-duration:var(--tw-duration,var(--ww-default-transition-duration))}.ww\\:transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--ww-default-transition-timing-function));transition-duration:var(--tw-duration,var(--ww-default-transition-duration))}.ww\\:transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--ww-default-transition-timing-function));transition-duration:var(--tw-duration,var(--ww-default-transition-duration))}.ww\\:duration-150{--tw-duration:.15s;transition-duration:.15s}.ww\\:duration-200{--tw-duration:.2s;transition-duration:.2s}.ww\\:duration-300{--tw-duration:.3s;transition-duration:.3s}.ww\\:ease-out{--tw-ease:var(--ww-ease-out);transition-timing-function:var(--ww-ease-out)}.ww\\:outline-none{--tw-outline-style:none;outline-style:none}@media (hover:hover){.ww\\:group-hover\\:opacity-0:is(:where(.ww\\:group):hover *){opacity:0}.ww\\:group-hover\\:opacity-100:is(:where(.ww\\:group):hover *){opacity:1}}.ww\\:group-\\[\\.is-assistant\\]\\:text-foreground:is(:where(.ww\\:group).is-assistant *){color:var(--ww-color-foreground,#1f2937)}.ww\\:group-\\[\\.is-user\\]\\:ml-auto:is(:where(.ww\\:group).is-user *){margin-left:auto}.ww\\:group-\\[\\.is-user\\]\\:\\[border-radius\\:var\\(--ww-msg-radius\\,8px\\)\\]:is(:where(.ww\\:group).is-user *){border-radius:var(--ww-msg-radius,8px)}.ww\\:group-\\[\\.is-user\\]\\:bg-user-bubble:is(:where(.ww\\:group).is-user *){background-color:var(--ww-color-user-bubble,#f4f4f4)}.ww\\:group-\\[\\.is-user\\]\\:\\[padding\\:var\\(--ww-msg-pad-y\\,12px\\)_var\\(--ww-msg-pad-x\\,16px\\)\\]:is(:where(.ww\\:group).is-user *){padding:var(--ww-msg-pad-y,12px)var(--ww-msg-pad-x,16px)}.ww\\:group-\\[\\.is-user\\]\\:\\[color\\:var\\(--ww-color-user-bubble-text\\)\\]:is(:where(.ww\\:group).is-user *){color:var(--ww-color-user-bubble-text)}.ww\\:placeholder\\:text-muted-foreground::placeholder{color:var(--ww-color-muted-foreground,#6b7280)}@media (hover:hover){.ww\\:hover\\:border-primary\\/30:hover{border-color:var(--ww-color-primary,#6366f1)}@supports (color:color-mix(in lab, red, red)){.ww\\:hover\\:border-primary\\/30:hover{border-color:color-mix(in oklab,var(--ww-color-primary,#6366f1)30%,transparent)}}.ww\\:hover\\:bg-accent:hover{background-color:var(--ww-color-accent,#f3f4f6)}.ww\\:hover\\:bg-foreground:hover{background-color:var(--ww-color-foreground,#1f2937)}.ww\\:hover\\:bg-muted:hover{background-color:var(--ww-color-muted,#f1f5f9)}.ww\\:hover\\:bg-muted-foreground\\/10:hover{background-color:var(--ww-color-muted-foreground,#6b7280)}@supports (color:color-mix(in lab, red, red)){.ww\\:hover\\:bg-muted-foreground\\/10:hover{background-color:color-mix(in oklab,var(--ww-color-muted-foreground,#6b7280)10%,transparent)}}.ww\\:hover\\:bg-primary\\/90:hover{background-color:var(--ww-color-primary,#6366f1)}@supports (color:color-mix(in lab, red, red)){.ww\\:hover\\:bg-primary\\/90:hover{background-color:color-mix(in oklab,var(--ww-color-primary,#6366f1)90%,transparent)}}.ww\\:hover\\:text-accent-foreground:hover{color:var(--ww-color-accent-foreground,#1f2937)}.ww\\:hover\\:text-foreground:hover{color:var(--ww-color-foreground,#1f2937)}.ww\\:hover\\:underline:hover{text-decoration-line:underline}}.ww\\:disabled\\:pointer-events-none:disabled{pointer-events:none}.ww\\:disabled\\:opacity-40:disabled{opacity:.4}.ww\\:disabled\\:opacity-50:disabled{opacity:.5}@media (min-width:40rem){.ww\\:sm\\:inset-auto{inset:auto}.ww\\:sm\\:right-0{right:calc(var(--ww-spacing)*0)}.ww\\:sm\\:bottom-4{bottom:calc(var(--ww-spacing)*4)}.ww\\:sm\\:left-0{left:calc(var(--ww-spacing)*0)}.ww\\:sm\\:mx-auto{margin-inline:auto}.ww\\:sm\\:h-\\[720px\\]{height:720px}.ww\\:sm\\:max-h-\\[calc\\(100dvh-2rem\\)\\]{max-height:calc(100dvh - 2rem)}.ww\\:sm\\:w-\\[calc\\(100vw-2rem\\)\\]{width:calc(100vw - 2rem)}.ww\\:sm\\:max-w-\\[1000px\\]{max-width:1000px}.ww\\:sm\\:rounded-2xl{border-radius:var(--ww-radius-2xl)}.ww\\:sm\\:border{border-style:var(--tw-border-style);border-width:1px}.ww\\:sm\\:border-border{border-color:var(--ww-color-border,#e5e7eb)}.ww\\:sm\\:py-2{padding-block:calc(var(--ww-spacing)*2)}.ww\\:sm\\:pr-2{padding-right:calc(var(--ww-spacing)*2)}.ww\\:sm\\:pl-4{padding-left:calc(var(--ww-spacing)*4)}.ww\\:sm\\:text-sm{font-size:var(--ww-text-sm);line-height:var(--tw-leading,var(--ww-text-sm--line-height))}.ww\\:sm\\:text-\\[11px\\]{font-size:11px}}.ww\\:\\[\\&\\>\\*\\:first-child\\]\\:mt-0>:first-child{margin-top:calc(var(--ww-spacing)*0)}.ww\\:\\[\\&\\>\\*\\:last-child\\]\\:mb-0>:last-child{margin-bottom:calc(var(--ww-spacing)*0)}}@keyframes ww-fade-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@keyframes ww-fade-out{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-4px)}}@keyframes ww-pulse{0%,80%,to{opacity:.3;transform:scale(.8)}40%{opacity:1;transform:scale(1)}}@keyframes ww-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){[data-waniwani-chat] [data-waniwani-shimmer]{color:var(--ww-color-muted-foreground)!important;animation:none!important}}[data-waniwani-floating=dock]{transition:opacity .32s,transform .42s cubic-bezier(.22,1,.36,1),max-width .3s,visibility 0s linear .42s}[data-waniwani-floating=dock][data-appeared=true][data-state=shown]{visibility:visible;opacity:1;pointer-events:auto;transition:opacity .32s,transform .42s cubic-bezier(.22,1,.36,1),max-width .3s,visibility;transform:translateY(0)}[data-waniwani-floating=dock][data-appeared=false],[data-waniwani-floating=dock][data-state=hidden]{opacity:0;visibility:hidden;pointer-events:none;transform:translateY(1rem)}[data-waniwani-floating=panel]{transition:clip-path .44s cubic-bezier(.22,1,.36,1),opacity .26s,visibility 0s linear .44s}[data-waniwani-floating=panel][data-state=shown]{visibility:visible;opacity:1;pointer-events:auto;clip-path:inset(-40px round 18px);transition:clip-path .44s cubic-bezier(.22,1,.36,1),opacity .26s,visibility}[data-waniwani-floating=panel][data-state=hidden]{opacity:0;visibility:hidden;pointer-events:none;clip-path:inset(calc(100% - 60px) 12% 0 round 24px)}@media (max-width:639px){[data-waniwani-floating=panel][data-state=shown]{clip-path:inset(0)}[data-waniwani-floating=panel][data-state=hidden]{clip-path:inset(calc(100% - 72px) 6% 0 round 22px)}}@media (prefers-reduced-motion:reduce){[data-waniwani-floating=dock],[data-waniwani-floating=panel]{clip-path:none;transition:visibility 0s linear 10ms}[data-waniwani-floating=dock][data-appeared=true][data-state=shown],[data-waniwani-floating=panel][data-state=shown]{transition:visibility}}[data-waniwani-chat] ::-webkit-scrollbar{width:8px}[data-waniwani-chat] ::-webkit-scrollbar-track{background:0 0}[data-waniwani-chat] ::-webkit-scrollbar-thumb{background:var(--ww-color-border);border-radius:9999px}[data-waniwani-chat] ::-webkit-scrollbar-thumb:hover{background:var(--ww-color-muted-foreground)}[data-waniwani-chat] *{scrollbar-width:thin;scrollbar-color:var(--ww-color-border)transparent}[data-waniwani-chat]{--ww-color-background:var(--ww-bg,#fff);--ww-color-foreground:var(--ww-text,#1f2937);--ww-color-primary:var(--ww-primary,#6366f1);--ww-color-primary-foreground:var(--ww-primary-fg,#1f2937);--ww-color-muted-foreground:var(--ww-muted,#6b7280);--ww-color-border:var(--ww-border,#e5e7eb);--ww-color-input:var(--ww-input-bg,#f9fafb);--ww-color-accent:var(--ww-assistant-bubble,#f3f4f6);--ww-color-accent-foreground:var(--ww-text,#1f2937);--ww-color-user-bubble:var(--ww-user-bubble,#f4f4f4);--ww-color-card:var(--ww-bg,#fff);--ww-color-card-foreground:var(--ww-text,#1f2937);--ww-color-card-header:var(--ww-header-bg,#fff);--ww-color-card-header-foreground:var(--ww-header-text,#1f2937);--ww-color-status:var(--ww-status,#22c55e);--ww-color-tool-card:var(--ww-tool-card,#f4f4f5);--ww-radius:var(--ww-radius,16px);--ww-font-sans:var(--ww-font,system-ui,-apple-system,\"Segoe UI\",sans-serif);--ww-color-user-bubble-text:var(--ww-user-bubble-text,var(--ww-color-primary-foreground));--ww-color-assistant-bubble-text:var(--ww-assistant-bubble-text,var(--ww-color-foreground));--ww-glass:#eceef499;--ww-glass-border:#0000000f;border-style:solid;border-width:var(--ww-border-width,0);border-color:var(--ww-color-border);box-shadow:var(--ww-shadow,none)}[data-waniwani-chat][data-assistant-bubble=true] .ww-message-assistant .ww-bubble{background:var(--ww-color-accent);color:var(--ww-color-assistant-bubble-text);border-radius:var(--ww-msg-radius,8px);padding:var(--ww-msg-pad-y,12px)var(--ww-msg-pad-x,16px);width:fit-content;max-width:var(--ww-msg-max-width,80%)}.dark [data-waniwani-chat],[data-waniwani-chat].dark{--ww-color-background:var(--ww-bg,#212121);--ww-color-foreground:var(--ww-text,#ececec);--ww-color-primary:var(--ww-primary,#6366f1);--ww-color-primary-foreground:var(--ww-primary-fg,#fff);--ww-color-muted-foreground:var(--ww-muted,#8e8ea0);--ww-color-border:var(--ww-border,#444);--ww-color-input:var(--ww-input-bg,#2f2f2f);--ww-color-accent:var(--ww-assistant-bubble,#2f2f2f);--ww-color-accent-foreground:var(--ww-text,#ececec);--ww-color-user-bubble:var(--ww-user-bubble,#303030);--ww-color-card:var(--ww-bg,#212121);--ww-color-card-foreground:var(--ww-text,#ececec);--ww-color-card-header:var(--ww-header-bg,#1e1e1e);--ww-color-card-header-foreground:var(--ww-header-text,#ececec);--ww-color-status:var(--ww-status,#22c55e);--ww-color-tool-card:var(--ww-tool-card,#262626);--ww-color-user-bubble-text:var(--ww-user-bubble-text,#fff);--ww-color-assistant-bubble-text:var(--ww-assistant-bubble-text,var(--ww-color-foreground));--ww-glass:#282a3480;--ww-glass-border:#ffffff1f}@media (prefers-color-scheme:dark){[data-waniwani-chat][data-color-scheme=auto]{--ww-color-background:var(--ww-bg,#212121);--ww-color-foreground:var(--ww-text,#ececec);--ww-color-primary:var(--ww-primary,#6366f1);--ww-color-primary-foreground:var(--ww-primary-fg,#fff);--ww-color-muted-foreground:var(--ww-muted,#8e8ea0);--ww-color-border:var(--ww-border,#444);--ww-color-input:var(--ww-input-bg,#2f2f2f);--ww-color-accent:var(--ww-assistant-bubble,#2f2f2f);--ww-color-accent-foreground:var(--ww-text,#ececec);--ww-color-user-bubble:var(--ww-user-bubble,#303030);--ww-color-card:var(--ww-bg,#212121);--ww-color-card-foreground:var(--ww-text,#ececec);--ww-color-card-header:var(--ww-header-bg,#1e1e1e);--ww-color-card-header-foreground:var(--ww-header-text,#ececec);--ww-color-status:var(--ww-status,#22c55e);--ww-color-tool-card:var(--ww-tool-card,#262626);--ww-color-user-bubble-text:var(--ww-user-bubble-text,#fff);--ww-color-assistant-bubble-text:var(--ww-assistant-bubble-text,var(--ww-color-foreground));--ww-glass:#282a3480;--ww-glass-border:#ffffff1f}}[data-waniwani-chat] [data-streamdown=table-wrapper]{flex-direction:column;gap:.5rem;margin-top:1rem;margin-bottom:1rem;display:flex}[data-waniwani-chat] [data-streamdown=table-wrapper]>div:first-child:has(button){justify-content:flex-end;align-items:center;gap:.25rem;display:flex}[data-waniwani-chat] [data-streamdown=table-wrapper]>div:last-child{overflow-x:auto}[data-waniwani-chat] [data-streamdown=table]{border-collapse:collapse;border:1px solid var(--ww-color-border);border-radius:.75rem;width:100%;overflow:hidden}[data-waniwani-chat] [data-streamdown=table-header]{background-color:var(--ww-color-accent)}@supports (color:color-mix(in lab, red, red)){[data-waniwani-chat] [data-streamdown=table-header]{background-color:color-mix(in srgb,var(--ww-color-accent)80%,transparent)}}[data-waniwani-chat] [data-streamdown=table-body]{background-color:var(--ww-color-accent)}@supports (color:color-mix(in lab, red, red)){[data-waniwani-chat] [data-streamdown=table-body]{background-color:color-mix(in srgb,var(--ww-color-accent)40%,transparent)}}[data-waniwani-chat] [data-streamdown=table-body]>tr+tr{border-top:1px solid var(--ww-color-border)}[data-waniwani-chat] [data-streamdown=table-row]{border-bottom:1px solid var(--ww-color-border)}[data-waniwani-chat] [data-streamdown=table-header-cell]{white-space:nowrap;text-align:left;padding:.5rem 1rem;font-size:.875rem;font-weight:600}[data-waniwani-chat] [data-streamdown=table-cell]{padding:.5rem 1rem;font-size:.875rem}[data-waniwani-chat] [data-streamdown=link]{color:var(--ww-color-primary);overflow-wrap:anywhere;cursor:pointer;font-weight:500;text-decoration:underline}[data-waniwani-chat].dark [data-streamdown=link],.dark [data-waniwani-chat] [data-streamdown=link]{color:var(--ww-color-primary)}@supports (color:color-mix(in lab, red, red)){[data-waniwani-chat].dark [data-streamdown=link],.dark [data-waniwani-chat] [data-streamdown=link]{color:color-mix(in oklab,var(--ww-color-primary)55%,white)}}@media (prefers-color-scheme:dark){[data-waniwani-chat][data-color-scheme=auto] [data-streamdown=link]{color:var(--ww-color-primary)}@supports (color:color-mix(in lab, red, red)){[data-waniwani-chat][data-color-scheme=auto] [data-streamdown=link]{color:color-mix(in oklab,var(--ww-color-primary)55%,white)}}}[data-waniwani-chat].dark [data-waniwani-logo],.dark [data-waniwani-chat] [data-waniwani-logo]{filter:invert()}@media (prefers-color-scheme:dark){[data-waniwani-chat][data-color-scheme=auto] [data-waniwani-logo]{filter:invert()}}[data-waniwani-chat] [data-streamdown=link-safety-modal]{z-index:50;background-color:var(--ww-color-background);justify-content:center;align-items:center;display:flex;position:fixed;inset:0}@supports (color:color-mix(in lab, red, red)){[data-waniwani-chat] [data-streamdown=link-safety-modal]{background-color:color-mix(in srgb,var(--ww-color-background)50%,transparent)}}[data-waniwani-chat] [data-streamdown=link-safety-modal]{-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div{border:1px solid var(--ww-color-border);background-color:var(--ww-color-background);width:100%;max-width:28rem;color:var(--ww-color-foreground);border-radius:.75rem;flex-direction:column;gap:1rem;margin:0 1rem;padding:1.5rem;display:flex;position:relative;box-shadow:0 10px 25px #0000001a}[data-waniwani-chat] [data-streamdown=link-safety-modal] button{cursor:pointer}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>button:first-child{color:var(--ww-color-muted-foreground);background:0 0;border:none;border-radius:.375rem;padding:.25rem;transition:background-color .15s,color .15s;position:absolute;top:1rem;right:1rem}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>button:first-child:hover{background-color:var(--ww-color-accent);color:var(--ww-color-foreground)}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>div:first-of-type{flex-direction:column;gap:.5rem;display:flex}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>div:first-of-type>div{align-items:center;gap:.5rem;font-size:1.125rem;font-weight:600;display:flex}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>div:first-of-type>p{color:var(--ww-color-muted-foreground);font-size:.875rem}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>div:nth-child(3){word-break:break-all;background-color:var(--ww-color-accent);border-radius:.375rem;max-height:8rem;padding:.75rem;font-family:ui-monospace,monospace;font-size:.875rem;overflow-y:auto}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>div:last-child{gap:.5rem;display:flex}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>div:last-child>button{border:none;border-radius:.375rem;flex:1;justify-content:center;align-items:center;gap:.5rem;padding:.5rem 1rem;font-size:.875rem;font-weight:500;transition:background-color .15s;display:flex}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>div:last-child>button:first-child{border:1px solid var(--ww-color-border);background-color:var(--ww-color-background);color:var(--ww-color-foreground)}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>div:last-child>button:first-child:hover{background-color:var(--ww-color-accent)}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>div:last-child>button:last-child{background-color:var(--ww-color-primary);color:#fff}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>div:last-child>button:last-child:hover{opacity:.9}[data-waniwani-chat] [data-streamdown=ordered-list]{white-space:normal;list-style-type:decimal;list-style-position:inside}[data-waniwani-chat] li [data-streamdown=ordered-list]{padding-left:1.5rem}[data-waniwani-chat] [data-streamdown=unordered-list]{white-space:normal;list-style-type:disc;list-style-position:inside}[data-waniwani-chat] li [data-streamdown=unordered-list]{padding-left:1.5rem}[data-waniwani-chat] [data-streamdown=list-item]{padding-top:.25rem;padding-bottom:.25rem}[data-waniwani-chat] [data-streamdown=list-item]>p{display:inline}[data-waniwani-chat] [data-streamdown=inline-code]{background-color:var(--ww-color-accent);border-radius:.25rem;padding:.125rem .375rem;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,monospace;font-size:.875rem}[data-waniwani-chat] [data-streamdown=heading-1]{margin-top:1.5rem;margin-bottom:.5rem;font-size:1.875rem;font-weight:600;line-height:2.25rem}[data-waniwani-chat] [data-streamdown=heading-2]{margin-top:1.5rem;margin-bottom:.5rem;font-size:1.5rem;font-weight:600;line-height:2rem}[data-waniwani-chat] [data-streamdown=heading-3]{margin-top:1.5rem;margin-bottom:.5rem;font-size:1.25rem;font-weight:600;line-height:1.75rem}[data-waniwani-chat] [data-streamdown=heading-4]{margin-top:1.5rem;margin-bottom:.5rem;font-size:1.125rem;font-weight:600;line-height:1.75rem}[data-waniwani-chat] [data-streamdown=heading-5]{margin-top:1.5rem;margin-bottom:.5rem;font-size:1rem;font-weight:600;line-height:1.5rem}[data-waniwani-chat] [data-streamdown=heading-6]{margin-top:1.5rem;margin-bottom:.5rem;font-size:.875rem;font-weight:600;line-height:1.25rem}[data-waniwani-chat] [data-streamdown=blockquote]{border-left:4px solid var(--ww-color-muted-foreground);margin-top:1rem;margin-bottom:1rem}@supports (color:color-mix(in lab, red, red)){[data-waniwani-chat] [data-streamdown=blockquote]{border-left:4px solid color-mix(in srgb,var(--ww-color-muted-foreground)30%,transparent)}}[data-waniwani-chat] [data-streamdown=blockquote]{color:var(--ww-color-muted-foreground);padding-left:1rem;font-style:italic}[data-waniwani-chat] [data-streamdown=horizontal-rule]{border-color:var(--ww-color-border);margin-top:1.5rem;margin-bottom:1.5rem}[data-waniwani-chat] [data-streamdown=strong]{font-weight:600}[data-waniwani-chat] [data-streamdown=image-wrapper]{margin-top:1rem;margin-bottom:1rem;display:inline-block;position:relative}[data-waniwani-chat] [data-streamdown=image]{border-radius:.5rem;max-width:100%}[data-waniwani-chat] [data-streamdown=code-block]{border:1px solid var(--ww-color-border);border-radius:.75rem;width:100%;margin-top:1rem;margin-bottom:1rem;overflow:hidden}[data-waniwani-chat] [data-streamdown=code-block-header]{background-color:var(--ww-color-accent);justify-content:space-between;align-items:center;display:flex}@supports (color:color-mix(in lab, red, red)){[data-waniwani-chat] [data-streamdown=code-block-header]{background-color:color-mix(in srgb,var(--ww-color-accent)80%,transparent)}}[data-waniwani-chat] [data-streamdown=code-block-header]{color:var(--ww-color-muted-foreground);padding:.75rem;font-size:.75rem}[data-waniwani-chat] [data-streamdown=code-block-body]{padding:1rem;font-size:.875rem;overflow-x:auto}[data-waniwani-chat] [data-streamdown=code-block-copy-button],[data-waniwani-chat] [data-streamdown=code-block-download-button]{cursor:pointer;color:var(--ww-color-muted-foreground);background:0 0;border:none;padding:.25rem;transition:color .15s}[data-waniwani-chat] [data-streamdown=code-block-copy-button]:hover,[data-waniwani-chat] [data-streamdown=code-block-download-button]:hover{color:var(--ww-color-foreground)}[data-waniwani-chat] [data-streamdown=mermaid-block]{border:1px solid var(--ww-color-border);border-radius:.75rem;height:auto;margin-top:1rem;margin-bottom:1rem;padding:1rem;position:relative}[data-waniwani-chat] [data-streamdown=mermaid]{width:100%;height:100%}@property --tw-translate-x{syntax:\"*\";inherits:false;initial-value:0}@property --tw-translate-y{syntax:\"*\";inherits:false;initial-value:0}@property --tw-translate-z{syntax:\"*\";inherits:false;initial-value:0}@property --tw-space-y-reverse{syntax:\"*\";inherits:false;initial-value:0}@property --tw-border-style{syntax:\"*\";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:\"*\";inherits:false}@property --tw-tracking{syntax:\"*\";inherits:false}@property --tw-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:\"*\";inherits:false}@property --tw-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:\"*\";inherits:false}@property --tw-inset-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:\"*\";inherits:false}@property --tw-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:\"*\";inherits:false}@property --tw-inset-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:\"*\";inherits:false}@property --tw-ring-offset-width{syntax:\"<length>\";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:\"*\";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-backdrop-blur{syntax:\"*\";inherits:false}@property --tw-backdrop-brightness{syntax:\"*\";inherits:false}@property --tw-backdrop-contrast{syntax:\"*\";inherits:false}@property --tw-backdrop-grayscale{syntax:\"*\";inherits:false}@property --tw-backdrop-hue-rotate{syntax:\"*\";inherits:false}@property --tw-backdrop-invert{syntax:\"*\";inherits:false}@property --tw-backdrop-opacity{syntax:\"*\";inherits:false}@property --tw-backdrop-saturate{syntax:\"*\";inherits:false}@property --tw-backdrop-sepia{syntax:\"*\";inherits:false}@property --tw-duration{syntax:\"*\";inherits:false}@property --tw-ease{syntax:\"*\";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}",Ct=null,Jr=null,sa=null,Wf=null,yj="waniwani-chat-sizing",wj="waniwani-chat-defaults",xj="waniwani-chat-chrome",vj="waniwani-chat-auto-card",bj=`:where([data-waniwani-embed]){height:${hC}}`,Sj=":where([data-waniwani-embed]){border-radius:16px;overflow:hidden}",Cj=":where([data-waniwani-embed]){border-style:solid;border-width:var(--ww-border-width,0);border-color:var(--ww-border,transparent);box-shadow:var(--ww-shadow,none)}",Ij=":where([data-waniwani-embed][data-waniwani-auto]){width:100%;max-width:28rem;margin-inline:auto;border-radius:16px;overflow:hidden;border-style:solid;border-width:var(--ww-border-width,1px);border-color:var(--ww-border,rgba(0,0,0,0.1));box-shadow:var(--ww-shadow,0 10px 30px rgba(0,0,0,0.08))}";function Xf(e,t){if(typeof document>"u"||document.getElementById(e))return;let a=document.createElement("style");a.id=e,a.textContent=t,document.head.appendChild(a)}function kj(e,t){let a=t.appearance?.variables;!a||!(e instanceof HTMLElement)||(typeof a.borderWidth=="number"&&e.style.setProperty("--ww-border-width",`${a.borderWidth}px`),a.borderColor&&e.style.setProperty("--ww-border",a.borderColor),a.boxShadow&&e.style.setProperty("--ww-shadow",a.boxShadow))}function SD(e,t){if(nx&&nx!=="__WANIWANI_EMBED_CSS__"){let n=document.createElement("style");n.textContent=nx,e.appendChild(n)}let a=document.createElement("style");if(a.textContent="[data-waniwani-chat]{border-width:0;box-shadow:none}",e.appendChild(a),t.css)try{let n=new URL(t.css,window.location.href);if(n.protocol==="https:"||n.protocol==="http:"){let r=document.createElement("link");r.rel="stylesheet",r.href=n.href,e.appendChild(r)}else console.warn("[Waniwani] Custom CSS URL must use http or https protocol.")}catch{console.warn("[Waniwani] Invalid custom CSS URL:",t.css)}}var vD="data-waniwani-embed",rx="data-waniwani-auto";function Lj(e){let t=document.querySelector(`[${vD}]`);if(t)return t;let a=document.createElement("div");a.setAttribute(vD,""),a.setAttribute(rx,"");let n=e?!!document.head?.contains(e):!1;return e?.parentNode&&!n?e.parentNode.insertBefore(a,e):document.body.appendChild(a),a}function Tj(e){return/^\d+$/.test(e.trim())?`${e.trim()}px`:e.trim()}function Aj(e,t,a,n){let r=Lj(n);Xf(yj,bj),e.height&&r instanceof HTMLElement&&(r.style.height=Tj(e.height)),e.appearance?.theme&&Xf(wj,Sj),Xf(xj,Cj),r.hasAttribute(rx)&&Xf(vj,Ij),kj(r,e),sa=document.createElement("div"),sa.id="waniwani-chat-embed",sa.style.cssText="width:100%;height:100%;max-height:inherit;display:flex;flex-direction:column;flex:1 1 auto;min-height:0;",r.appendChild(sa);let o=sa,l=()=>{let d=getComputedStyle(r);if(!d.maxHeight.endsWith("px")){o.style.removeProperty("max-height");return}let f=Number.parseFloat(d.maxHeight);if(!Number.isFinite(f)){o.style.removeProperty("max-height");return}let p=f;d.boxSizing==="border-box"&&(p-=(Number.parseFloat(d.paddingTop)||0)+(Number.parseFloat(d.paddingBottom)||0)+(Number.parseFloat(d.borderTopWidth)||0)+(Number.parseFloat(d.borderBottomWidth)||0)),p>0?o.style.maxHeight=`${p}px`:o.style.removeProperty("max-height")};l(),Wf=new ResizeObserver(l),Wf.observe(r);let i=sa.attachShadow({mode:"open"});SD(i,e);let s=document.createElement("div");s.className="ww:contents",i.appendChild(s);let u=wu.default.createRef(),c=d=>{r instanceof HTMLElement&&(r.style.display=d?"":"none")};if(e.token){let d=qf(e.api??"",e.token,e.channelId);d?.visibility&&!jf(d.visibility,window.location.pathname)&&c(!1)}return Jr=ox.default.createRoot(s),Jr.render(wu.default.createElement(wD,{ref:u,config:e,programmatic:t,scriptConfig:a,onVisibilityChange:c})),{destroy:()=>{Wf?.disconnect(),Wf=null,Jr?.unmount(),Jr=null,sa?.remove(),sa=null,r.hasAttribute(rx)&&r.remove(),Ct=null},open:()=>{},close:()=>{},toggle:()=>{},sendMessage:d=>u.current?.chat?.sendMessage(d),sendMessageAndWait:async d=>{let f=u.current?.chat;if(f)return await f.sendMessageAndWait(d)},reset:()=>u.current?.chat?.reset(),focus:()=>u.current?.chat?.focus(),getMessages:()=>u.current?.chat?.messages??[],getSessionId:()=>u.current?.chat?.sessionId}}function Mj(e,t,a){sa=document.createElement("div"),sa.id="waniwani-chat-embed",sa.style.cssText="position:fixed;inset:0;z-index:2147483000;pointer-events:none;",document.body.appendChild(sa);let n=sa.attachShadow({mode:"open"});SD(n,e);let r=document.createElement("div");r.className="ww:contents",n.appendChild(r);let o=wu.default.createRef();return Jr=ox.default.createRoot(r),Jr.render(wu.default.createElement(yD,{ref:o,config:e,programmatic:t,scriptConfig:a})),{destroy:()=>{Jr?.unmount(),Jr=null,sa?.remove(),sa=null,Ct=null},open:()=>o.current?.open(),close:()=>o.current?.close(),toggle:()=>o.current?.toggle(),sendMessage:l=>o.current?.sendMessage(l),sendMessageAndWait:async l=>{if(o.current)return o.current.sendMessageAndWait(l)},reset:()=>o.current?.reset(),focus:()=>o.current?.focus(),getMessages:()=>o.current?.getMessages()??[],getSessionId:()=>o.current?.getSessionId()}}function CD(e){if(Ct)return console.warn("[Waniwani] Chat widget is already initialized. Call destroy() first to re-initialize."),Ct;let t=jh(),a=td(),n=fs(e,void 0,a),r=n.mode==="floating"?Mj(n,e,a):Aj(n,e,a,t),o=n.api??"",l=n.token?mC({api:o,token:n.token,channelId:n.channelId,getSource:()=>qf(o,n.token,n.channelId)?.source??void 0,getSessionId:()=>r.getSessionId()}):qh("no public token configured (set data-token or pass token to init())");return Ct={...r,track:l.track,identify:(i,s)=>l.identify(i,s),destroy:()=>{l.shutdown(),r.destroy()}},Ct}function Ej(){Ct&&Ct.destroy()}var ID=qh("chat widget is not initialized (call WaniWani.chat.init() first)"),ci=()=>Ct?Ct.track:ID.track;window.WaniWani=window.WaniWani||{};window.WaniWani.chat={init:CD,destroy:Ej,open:()=>Ct?.open(),close:()=>Ct?.close(),toggle:()=>Ct?.toggle(),sendMessage:e=>Ct?.sendMessage(e),sendMessageAndWait:async e=>{if(Ct)return Ct.sendMessageAndWait(e)},reset:()=>Ct?.reset(),focus:()=>Ct?.focus(),getMessages:()=>Ct?.getMessages()??[],getSessionId:()=>Ct?.getSessionId(),track:Object.assign(e=>ci()(e),{priceShown:e=>ci().priceShown(e),pricesCompared:e=>ci().pricesCompared(e),optionSelected:e=>ci().optionSelected(e),leadQualified:e=>ci().leadQualified(e),converted:e=>ci().converted(e)}),identify:(e,t)=>Ct?Ct.identify(e,t):ID.identify(e,t)};function bD(){if(td().token)try{CD()}catch(t){console.error("[Waniwani] Auto-initialization failed:",t)}}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",bD):bD();})();
|
|
139
139
|
/*! Bundled license information:
|
|
140
140
|
|
|
141
141
|
react/cjs/react.production.js:
|